/******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __webpack_require__) { const { BaseKonnector, log, addData, hydrateAndFilter, errors, cozyClient, } = __webpack_require__(1) const getAccountId = __webpack_require__(1244) const moment = __webpack_require__(1245) const rp = __webpack_require__(1379) __webpack_require__(1383) moment.locale('fr') // set the language moment.tz.setDefault('Europe/Paris') // set the timezone /*** Connector Constants ***/ const manualExecution = process.env.COZY_JOB_MANUAL_EXECUTION === 'true' ? true : false const startDailyDate = manualExecution ? moment().subtract(12, 'month') : moment().subtract(32, 'month') const startDailyDateString = startDailyDate.format('YYYY-MM-DD') const startLoadDate = moment().subtract(7, 'day') const startLoadDateString = startLoadDate.format('YYYY-MM-DD') const checkHistoryDate = moment().subtract(8, 'day') const endDate = moment() const endDateString = endDate.format('YYYY-MM-DD') const baseUrl = 'https://gw.prd.api.enedis.fr' const dailyDataURL = `${baseUrl}/v4/metering_data/daily_consumption` const loadCurveURL = `${baseUrl}/v4/metering_data/consumption_load_curve` /** * The start function is run by the BaseKonnector instance only when it got all the account * information (fields). When you run this connector yourself in "standalone" mode or "dev" mode, * the account information come from ./konnector-dev-config.json file * cozyParameters are static parameters, independents from the account. Most often, it can be a * secret api key. * @param {Object} fields * @param {string} fields.access_token - access token * @param {string} fields.refresh_token - refresh token * @param {Object} cozyParameters - cozy parameters * @param {boolean} doRetry - whether we should use the refresh token or not */ async function start(fields, cozyParameters, doRetry = true) { log('info', 'Starting the enedis konnector') log('info', `Manual execution: ${manualExecution}`) const accountId = getAccountId() let usage_point_id = '' try { const { access_token } = fields if ( this._account && this._account.oauth_callback_results && this._account.oauth_callback_results.usage_points_id ) { const usage_points_id = this._account.oauth_callback_results.usage_points_id.split( ',' ) usage_point_id = usage_points_id[0] } else if (fields.usage_point_id) { // In case of refresh token, we retrieve the usage point id from the fields usage_point_id = fields.usage_point_id } else { log('error', 'no usage_point_id found') throw errors.USER_ACTION_NEEDED_OAUTH_OUTDATED } log('info', 'Fetching enedis daily data') const fetchedDailyData = await getDailyData(access_token, usage_point_id) log('info', 'Process enedis daily data') const processedDailyData = await processData( fetchedDailyData, 'com.grandlyon.enedis.day', ['year', 'month', 'day'] ) log('info', 'Agregate enedis daily data for month and year') await agregateMonthAndYearData(processedDailyData) // log('info', 'Process enedis load data') // await startLoadDataProcess(access_token, usage_point_id) } catch (err) { if (err.statusCode === 403 || err.code === 403) { if (!fields.refresh_token) { log('info', 'no refresh token found') throw errors.USER_ACTION_NEEDED_OAUTH_OUTDATED } else if (doRetry) { log('info', 'asking refresh from the stack') let body try { body = await cozyClient.fetchJSON( 'POST', `/accounts/enedisgrandlyon/${accountId}/refresh` ) } catch (err) { log('info', `Error during refresh ${err.message}`) throw errors.USER_ACTION_NEEDED_OAUTH_OUTDATED } log('info', 'refresh response') log('info', JSON.stringify(body)) fields.access_token = body.attributes.oauth.access_token fields.usage_point_id = usage_point_id return start(fields, cozyParameters, false) } log('error', `Error during authentication: ${err.message}`) throw errors.VENDOR_DOWN } else { log('error', 'caught an unexpected error') log('error', err.message) throw err } } } /** * Retrieve data from the API * Format: { value: "Wh", "date": "YYYY-MM-DD" } */ async function getDailyData(token, usagePointID) { const dataRequest = { method: 'GET', uri: dailyDataURL + '?start=' + startDailyDateString + '&end=' + endDateString + '&usage_point_id=' + usagePointID, headers: { Accept: 'application/json', Authorization: 'Bearer ' + token, }, } const response = await rp(dataRequest) return response } /** * Check if history is loaded * If not, call several time the api to retrieve 1 month of history for load data * If yes only call once the api */ async function startLoadDataProcess(token, usagePointID) { log('info', 'Check consent for user') const isConsent = await checkConsentForLoadCurve( token, usagePointID, startLoadDateString, endDateString ) if (isConsent) { log('info', 'Check history') const isHistory = await isHistoryLoaded('com.grandlyon.enedis.minute') log('info', `isHistory: ${isHistory}`) if (isHistory || manualExecution) { log('info', 'launch process without history') await launchLoadDataProcess( token, usagePointID, startLoadDateString, endDateString ) } else { log('info', 'launch process with history') for (var i = 0; i < 4; i++) { const increamentedStartDate = moment(startLoadDate) const incrementedEndDate = moment(endDate) const increamentedStartDateString = increamentedStartDate .subtract(7 * i, 'day') .format('YYYY-MM-DD') const incrementedEndDateString = incrementedEndDate .subtract(7 * i, 'day') .format('YYYY-MM-DD') await launchLoadDataProcess( token, usagePointID, increamentedStartDateString, incrementedEndDateString ) } } } } /** * Request API and check return code * Return true or false */ async function checkConsentForLoadCurve( token, usagePointID, _startDate, _endDate ) { const dataRequest = { method: 'GET', uri: loadCurveURL + '?start=' + _startDate + '&end=' + _endDate + '&usage_point_id=' + usagePointID, headers: { Accept: 'application/json', Authorization: 'Bearer ' + token, }, } try { await rp(dataRequest) log('info', 'Consent found for load curve') return true } catch (err) { if ( (err.statusCode === 400 || err.code === 400) && err.message.search('ADAM-ERR0075') > 0 ) { log('info', 'No consent for load curve') return false } else if (err.statusCode === 403 || err.code === 403) { log('info', 'No consent for load curve') return false } else { throw err } } } /** * Function checking if the history is loaded */ async function isHistoryLoaded(doctype) { log('debug', doctype, 'Retrieve data') const result = await cozyClient.data.findAll(doctype) if (result && result.length > 0) { const filtered = result.filter(function(el) { const elDate = moment({ year: el.year, month: el.month, day: el.day, minute: el.minute, }) return elDate.isBefore(checkHistoryDate) }) if (filtered.length > 0) { return true } else { return false } } return false } /** * Launch process to handle load data */ async function launchLoadDataProcess( token, usagePointID, _startLoadDate, _endDate ) { log('info', 'Fetching enedis load data') const fetchedLoadData = await getLoadData( token, usagePointID, _startLoadDate, _endDate ) if (fetchedLoadData && fetchedLoadData.length > 0) { log('info', 'Process enedis load data') await processData(fetchedLoadData, 'com.grandlyon.enedis.minute', [ 'year', 'month', 'day', 'hour', 'minute', ]) } else { log('info', 'No consent or data for load curve') } } /** * Retrieve data from the API * Format: { value: "W", "date": "YYYY-MM-DD hh:mm:ss" } */ async function getLoadData(token, usagePointID, _startDate, _endDate) { const dataRequest = { method: 'GET', uri: loadCurveURL + '?start=' + _startDate + '&end=' + _endDate + '&usage_point_id=' + usagePointID, headers: { Accept: 'application/json', Authorization: 'Bearer ' + token, }, } const response = await rp(dataRequest) return response } /** * Parse data * Remove existing data from DB using hydrateAndFilter * Store filtered data * Return the list of filtered data */ async function processData(data, doctype, filterKeys) { const parsedData = JSON.parse(data) const intervalData = parsedData.meter_reading.interval_reading const formatedData = await formateData(intervalData, doctype) // Remove data for existing days into the DB const filteredData = await hydrateAndFilter(formatedData, doctype, { keys: filterKeys, }) // Store new day data await storeData(filteredData, doctype, filterKeys) return filteredData } /** * Agregate data from daily data to monthly and yearly data */ async function agregateMonthAndYearData(data) { // Sum year and month values into object with year or year-month as keys if (data && data.length > 0) { let monthData = {} let yearData = {} data.forEach(element => { element.year + '-' + element.month in monthData ? (monthData[element.year + '-' + element.month] += element.load) : (monthData[element.year + '-' + element.month] = element.load) element.year in yearData ? (yearData[element.year] += element.load) : (yearData[element.year] = element.load) }) // Agregation for Month data const agregatedMonthData = await buildAgregatedData( monthData, 'com.grandlyon.enedis.month' ) await storeData(agregatedMonthData, 'com.grandlyon.enedis.month', [ 'year', 'month', ]) // Agregation for Year data const agregatedYearData = await buildAgregatedData( yearData, 'com.grandlyon.enedis.year' ) await storeData(agregatedYearData, 'com.grandlyon.enedis.year', ['year']) } } /** * Save data in the right doctype db and prevent duplicated keys */ async function storeData(data, doctype, filterKeys) { log('debug', doctype, 'Store into') const filteredDocuments = await hydrateAndFilter(data, doctype, { keys: filterKeys, }) return await addData(filteredDocuments, doctype) } /** * Format data for DB storage * Remove bad data */ async function formateData(data, doctype) { log('info', 'Formating data') return data.map(record => { let date = moment(record.date, 'YYYY/MM/DD h:mm:ss') if (record.value != -2) { const load = doctype === 'com.grandlyon.enedis.minute' ? record.value / 2 : record.value if (doctype === 'com.grandlyon.enedis.minute') { date = date.subtract(30, 'minute') } return { load: parseFloat(load / 1000), year: parseInt(date.format('YYYY')), month: parseInt(date.format('M')), day: parseInt(date.format('D')), hour: parseInt(date.format('H')), minute: parseInt(date.format('m')), } } }) } /** * Retrieve and remove old data for a specific doctype * Return an Array of agregated data */ async function buildAgregatedData(data, doctype) { let agregatedData = [] for (let [key, value] of Object.entries(data)) { const data = await buildDataFromKey(doctype, key, value) const oldValue = await resetInProgressAggregatedData(data, doctype) data.load += oldValue agregatedData.push(data) } return agregatedData } /** * Format an entry for DB storage * using key and value * For year doctype: key = "YYYY" * For month doctype: key = "YYYY-MM" */ async function buildDataFromKey(doctype, key, value) { let year, month, day, hour if (doctype === 'com.grandlyon.enedis.year') { year = key month = 1 day = 0 hour = 0 } else if (doctype === 'com.grandlyon.enedis.month') { const split = key.split('-') year = split[0] month = split[1] day = 0 hour = 0 } else { const split = key.split('-') year = split[0] month = split[1] day = split[2] hour = split[3] } return { load: Math.round(value * 10000) / 10000, year: parseInt(year), month: parseInt(month), day: parseInt(day), hour: parseInt(hour), minute: 0, } } /** * Function handling special case. * The temporary aggregated data need to be remove in order for the most recent one te be saved. * ex for com.grandlyon.enedis.year : * { load: 76.712, year: 2020, ... } need to be replace by * { load: 82.212, year: 2020, ... } after enedis data reprocess */ async function resetInProgressAggregatedData(data, doctype) { // /!\ Warning: cannot use mongo queries because not supported for dev by cozy-konnectors-libs log('debug', doctype, 'Remove aggregated data for') const result = await cozyClient.data.findAll(doctype) if (result && result.length > 0) { // Filter data to remove var filtered = [] if (doctype === 'com.grandlyon.enedis.year') { // Yearly case filtered = result.filter(function(el) { return el.year == data.year }) } else if (doctype === 'com.grandlyon.enedis.month') { // Monthly case filtered = result.filter(function(el) { return el.year == data.year && el.month == data.month }) } else { // Hourly case filtered = result.filter(function(el) { return ( el.year == data.year && el.month == data.month && el.day == data.day && el.hour == data.hour ) }) } // Remove data let sum = 0.0 for (const doc of filtered) { sum += doc.load log('debug', doc, 'Removing this entry for ' + doctype) await cozyClient.data.delete(doctype, doc) } return sum } return 0.0 } module.exports = new BaseKonnector(start) /***/ }), /* 1 */ /***/ (function(module, exports, __webpack_require__) { const log = __webpack_require__(2).namespace('cozy-konnector-libs'); const requestFactory = __webpack_require__(22); const hydrateAndFilter = __webpack_require__(611); const categorization = __webpack_require__(1115); module.exports = { BaseKonnector: __webpack_require__(1170), CookieKonnector: __webpack_require__(1237), cozyClient: __webpack_require__(617), errors: __webpack_require__(1176), log, saveFiles: __webpack_require__(1172), saveBills: __webpack_require__(1171), saveIdentity: __webpack_require__(1203), linkBankOperations: __webpack_require__(1181), addData: __webpack_require__(1180), hydrateAndFilter, htmlToPDF: __webpack_require__(1238).htmlToPDF, createCozyPDFDocument: __webpack_require__(1238).createCozyPDFDocument, filterData: deprecate(hydrateAndFilter, 'Use hydrateAndFilter now. filterData will be removed in cozy-konnector-libs@4'), updateOrCreate: __webpack_require__(1202), request: deprecate(requestFactory, 'Use requestFactory instead of request. It will be removed in cozy-konnector-libs@4'), requestFactory, retry: __webpack_require__(1173), wrapIfSentrySetUp: __webpack_require__(1204).wrapIfSentrySetUp, Document: __webpack_require__(1239), signin: __webpack_require__(1199), submitForm: __webpack_require__(1199), scrape: __webpack_require__(1241), mkdirp: __webpack_require__(1175), normalizeFilename: __webpack_require__(1242), utils: __webpack_require__(616), solveCaptcha: __webpack_require__(1243), createCategorizer: categorization.createCategorizer, categorize: categorization.categorize, manifest: __webpack_require__(1059) }; function deprecate(wrapped, message) { return function () { log('warn', message); return wrapped.apply(this, arguments); }; } /***/ }), /* 2 */ /***/ (function(module, exports, __webpack_require__) { const { filterLevel, filterSecrets } = __webpack_require__(3) const Secret = __webpack_require__(4) const { LOG_LEVEL } = process.env let level = LOG_LEVEL || 'debug' const format = __webpack_require__(5) const filters = [filterLevel, filterSecrets] const filterOut = function() { for (const filter of filters) { if (filter.apply(null, arguments) === false) { return true } } return false } /** * Use it to log messages in your konnector. Typical types are * * - `debug` * - `warning` * - `info` * - `error` * - `ok` * * * @example * * They will be colored in development mode. In production mode, those logs are formatted in JSON to be interpreted by the stack and possibly sent to the client. `error` will stop the konnector. * * ```js * logger = log('my-namespace') * logger('debug', '365 bills') * // my-namespace : debug : 365 bills * logger('info', 'Page fetched') * // my-namespace : info : Page fetched * ``` * @param {string} type * @param {string} message * @param {string} label * @param {string} namespace */ function log(type, message, label, namespace) { if (filterOut(level, type, message, label, namespace)) { return } // eslint-disable-next-line no-console console.log(format(type, message, label, namespace)) } log.addFilter = function(filter) { return filters.push(filter) } log.setLevel = function(lvl) { level = lvl } // Short-hands const methods = ['debug', 'info', 'warn', 'error', 'ok', 'critical'] methods.forEach(level => { log[level] = function(message, label, namespace) { return log(level, message, label, namespace) } }) module.exports = log log.setNoRetry = obj => { if (obj) obj.no_retry = true else obj = { no_retry: true } return obj.no_retry } log.Secret = Secret log.namespace = function(namespace) { return function(type, message, label, ns = namespace) { log(type, message, label, ns) } } /***/ }), /* 3 */ /***/ (function(module, exports, __webpack_require__) { const levels = { secret: 0, debug: 10, info: 20, warn: 30, error: 40, ok: 50, critical: 50 } const Secret = __webpack_require__(4) const filterSecrets = function(level, type, message) { if (type !== 'secret' && message instanceof Secret) { throw new Error('You should log a secret with log.secret') } } const filterLevel = function(level, type) { return levels[type] >= levels[level] } module.exports = { filterSecrets, filterLevel } /***/ }), /* 4 */ /***/ (function(module, exports) { const Secret = function(data) { Object.assign(this, data) return this } Secret.prototype.toString = function() { throw new Error('Cannot convert Secret to string') } module.exports = Secret /***/ }), /* 5 */ /***/ (function(module, exports, __webpack_require__) { const prodFormat = __webpack_require__(6) const devFormat = __webpack_require__(8) switch ("none") { case 'production': module.exports = prodFormat break case 'development': module.exports = devFormat break case 'standalone': module.exports = devFormat break case 'test': module.exports = devFormat break default: module.exports = prodFormat } /***/ }), /* 6 */ /***/ (function(module, exports, __webpack_require__) { const stringify = __webpack_require__(7) const LOG_LENGTH_LIMIT = 64 * 1024 - 1 function prodFormat(type, message, label, namespace) { const log = { time: new Date(), type, label, namespace } if (typeof message === 'object') { if (message && message.no_retry) { log.no_retry = message.no_retry } if (message && message.message) { log.message = message.message } } else { log.message = message } // properly display error messages if (log.message && log.message.stack) { log.message = log.message.stack } // cut the string to avoid a fail in the stack let result = log try { result = stringify(log).substr(0, LOG_LENGTH_LIMIT) } catch (err) { // eslint-disable-next-line no-console console.log(err.message, 'cozy-logger: Failed to convert message to JSON') } return result } module.exports = prodFormat /***/ }), /* 7 */ /***/ (function(module, exports) { exports = module.exports = stringify exports.getSerialize = serializer function stringify(obj, replacer, spaces, cycleReplacer) { return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces) } function serializer(replacer, cycleReplacer) { var stack = [], keys = [] if (cycleReplacer == null) cycleReplacer = function(key, value) { if (stack[0] === value) return "[Circular ~]" return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]" } return function(key, value) { if (stack.length > 0) { var thisPos = stack.indexOf(this) ~thisPos ? stack.splice(thisPos + 1) : stack.push(this) ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key) if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value) } else stack.push(value) return replacer == null ? value : replacer.call(this, key, value) } } /***/ }), /* 8 */ /***/ (function(module, exports, __webpack_require__) { const util = __webpack_require__(9) const chalk = __webpack_require__(10) if (util && util.inspect && util.inspect.defaultOptions) { util.inspect.defaultOptions.maxArrayLength = null util.inspect.defaultOptions.depth = 2 util.inspect.defaultOptions.colors = true } const type2color = { debug: 'cyan', warn: 'yellow', info: 'blue', error: 'red', ok: 'green', secret: 'red', critical: 'red' } function devFormat(type, message, label, namespace) { let formatmessage = message if (typeof formatmessage !== 'string') { formatmessage = util.inspect(formatmessage) } let formatlabel = label ? ` : "${label}" ` : '' let formatnamespace = namespace ? chalk.magenta(`${namespace}: `) : '' let color = type2color[type] let formattype = color ? chalk[color](type) : type return `${formatnamespace}${formattype}${formatlabel} : ${formatmessage}` } module.exports = devFormat /***/ }), /* 9 */ /***/ (function(module, exports) { module.exports = require("util"); /***/ }), /* 10 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const escapeStringRegexp = __webpack_require__(11); const ansiStyles = __webpack_require__(12); const stdoutColor = __webpack_require__(18).stdout; const template = __webpack_require__(21); const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm'); // `supportsColor.level` → `ansiStyles.color[name]` mapping const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m']; // `color-convert` models to exclude from the Chalk API due to conflicts and such const skipModels = new Set(['gray']); const styles = Object.create(null); function applyOptions(obj, options) { options = options || {}; // Detect level if not set manually const scLevel = stdoutColor ? stdoutColor.level : 0; obj.level = options.level === undefined ? scLevel : options.level; obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0; } function Chalk(options) { // We check for this.template here since calling `chalk.constructor()` // by itself will have a `this` of a previously constructed chalk object if (!this || !(this instanceof Chalk) || this.template) { const chalk = {}; applyOptions(chalk, options); chalk.template = function () { const args = [].slice.call(arguments); return chalkTag.apply(null, [chalk.template].concat(args)); }; Object.setPrototypeOf(chalk, Chalk.prototype); Object.setPrototypeOf(chalk.template, chalk); chalk.template.constructor = Chalk; return chalk.template; } applyOptions(this, options); } // Use bright blue on Windows as the normal blue color is illegible if (isSimpleWindowsTerm) { ansiStyles.blue.open = '\u001B[94m'; } for (const key of Object.keys(ansiStyles)) { ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); styles[key] = { get() { const codes = ansiStyles[key]; return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key); } }; } styles.visible = { get() { return build.call(this, this._styles || [], true, 'visible'); } }; ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g'); for (const model of Object.keys(ansiStyles.color.ansi)) { if (skipModels.has(model)) { continue; } styles[model] = { get() { const level = this.level; return function () { const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments); const codes = { open, close: ansiStyles.color.close, closeRe: ansiStyles.color.closeRe }; return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); }; } }; } ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g'); for (const model of Object.keys(ansiStyles.bgColor.ansi)) { if (skipModels.has(model)) { continue; } const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1); styles[bgModel] = { get() { const level = this.level; return function () { const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments); const codes = { open, close: ansiStyles.bgColor.close, closeRe: ansiStyles.bgColor.closeRe }; return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); }; } }; } const proto = Object.defineProperties(() => {}, styles); function build(_styles, _empty, key) { const builder = function () { return applyStyle.apply(builder, arguments); }; builder._styles = _styles; builder._empty = _empty; const self = this; Object.defineProperty(builder, 'level', { enumerable: true, get() { return self.level; }, set(level) { self.level = level; } }); Object.defineProperty(builder, 'enabled', { enumerable: true, get() { return self.enabled; }, set(enabled) { self.enabled = enabled; } }); // See below for fix regarding invisible grey/dim combination on Windows builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey'; // `__proto__` is used because we must return a function, but there is // no way to create a function with a different prototype builder.__proto__ = proto; // eslint-disable-line no-proto return builder; } function applyStyle() { // Support varags, but simply cast to string in case there's only one arg const args = arguments; const argsLen = args.length; let str = String(arguments[0]); if (argsLen === 0) { return ''; } if (argsLen > 1) { // Don't slice `arguments`, it prevents V8 optimizations for (let a = 1; a < argsLen; a++) { str += ' ' + args[a]; } } if (!this.enabled || this.level <= 0 || !str) { return this._empty ? '' : str; } // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, // see https://github.com/chalk/chalk/issues/58 // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. const originalDim = ansiStyles.dim.open; if (isSimpleWindowsTerm && this.hasGrey) { ansiStyles.dim.open = ''; } for (const code of this._styles.slice().reverse()) { // Replace any instances already present with a re-opening code // otherwise only the part of the string until said closing code // will be colored, and the rest will simply be 'plain'. str = code.open + str.replace(code.closeRe, code.open) + code.close; // Close the styling before a linebreak and reopen // after next line to fix a bleed issue on macOS // https://github.com/chalk/chalk/pull/92 str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`); } // Reset the original `dim` if we changed it to work around the Windows dimmed gray issue ansiStyles.dim.open = originalDim; return str; } function chalkTag(chalk, strings) { if (!Array.isArray(strings)) { // If chalk() was called by itself or with a string, // return the string itself as a string. return [].slice.call(arguments, 1).join(' '); } const args = [].slice.call(arguments, 2); const parts = [strings.raw[0]]; for (let i = 1; i < strings.length; i++) { parts.push(String(args[i - 1]).replace(/[{}\\]/g, '\\$&')); parts.push(String(strings.raw[i])); } return template(chalk, parts.join('')); } Object.defineProperties(Chalk.prototype, styles); module.exports = Chalk(); // eslint-disable-line new-cap module.exports.supportsColor = stdoutColor; module.exports.default = module.exports; // For TypeScript /***/ }), /* 11 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; module.exports = function (str) { if (typeof str !== 'string') { throw new TypeError('Expected a string'); } return str.replace(matchOperatorsRe, '\\$&'); }; /***/ }), /* 12 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(module) { const colorConvert = __webpack_require__(14); const wrapAnsi16 = (fn, offset) => function () { const code = fn.apply(colorConvert, arguments); return `\u001B[${code + offset}m`; }; const wrapAnsi256 = (fn, offset) => function () { const code = fn.apply(colorConvert, arguments); return `\u001B[${38 + offset};5;${code}m`; }; const wrapAnsi16m = (fn, offset) => function () { const rgb = fn.apply(colorConvert, arguments); return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; }; function assembleStyles() { const codes = new Map(); const styles = { modifier: { reset: [0, 0], // 21 isn't widely supported and 22 does the same thing bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], gray: [90, 39], // Bright color redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], // Bright color bgBlackBright: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } }; // Fix humans styles.color.grey = styles.color.gray; for (const groupName of Object.keys(styles)) { const group = styles[groupName]; for (const styleName of Object.keys(group)) { const style = group[styleName]; styles[styleName] = { open: `\u001B[${style[0]}m`, close: `\u001B[${style[1]}m` }; group[styleName] = styles[styleName]; codes.set(style[0], style[1]); } Object.defineProperty(styles, groupName, { value: group, enumerable: false }); Object.defineProperty(styles, 'codes', { value: codes, enumerable: false }); } const ansi2ansi = n => n; const rgb2rgb = (r, g, b) => [r, g, b]; styles.color.close = '\u001B[39m'; styles.bgColor.close = '\u001B[49m'; styles.color.ansi = { ansi: wrapAnsi16(ansi2ansi, 0) }; styles.color.ansi256 = { ansi256: wrapAnsi256(ansi2ansi, 0) }; styles.color.ansi16m = { rgb: wrapAnsi16m(rgb2rgb, 0) }; styles.bgColor.ansi = { ansi: wrapAnsi16(ansi2ansi, 10) }; styles.bgColor.ansi256 = { ansi256: wrapAnsi256(ansi2ansi, 10) }; styles.bgColor.ansi16m = { rgb: wrapAnsi16m(rgb2rgb, 10) }; for (let key of Object.keys(colorConvert)) { if (typeof colorConvert[key] !== 'object') { continue; } const suite = colorConvert[key]; if (key === 'ansi16') { key = 'ansi'; } if ('ansi16' in suite) { styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0); styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10); } if ('ansi256' in suite) { styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0); styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10); } if ('rgb' in suite) { styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0); styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10); } } return styles; } // Make the export immutable Object.defineProperty(module, 'exports', { enumerable: true, get: assembleStyles }); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(13)(module))) /***/ }), /* 13 */ /***/ (function(module, exports) { module.exports = function(module) { if (!module.webpackPolyfill) { module.deprecate = function() {}; module.paths = []; // module.parent = undefined by default if (!module.children) module.children = []; Object.defineProperty(module, "loaded", { enumerable: true, get: function() { return module.l; } }); Object.defineProperty(module, "id", { enumerable: true, get: function() { return module.i; } }); module.webpackPolyfill = 1; } return module; }; /***/ }), /* 14 */ /***/ (function(module, exports, __webpack_require__) { var conversions = __webpack_require__(15); var route = __webpack_require__(17); var convert = {}; var models = Object.keys(conversions); function wrapRaw(fn) { var wrappedFn = function (args) { if (args === undefined || args === null) { return args; } if (arguments.length > 1) { args = Array.prototype.slice.call(arguments); } return fn(args); }; // preserve .conversion property if there is one if ('conversion' in fn) { wrappedFn.conversion = fn.conversion; } return wrappedFn; } function wrapRounded(fn) { var wrappedFn = function (args) { if (args === undefined || args === null) { return args; } if (arguments.length > 1) { args = Array.prototype.slice.call(arguments); } var result = fn(args); // we're assuming the result is an array here. // see notice in conversions.js; don't use box types // in conversion functions. if (typeof result === 'object') { for (var len = result.length, i = 0; i < len; i++) { result[i] = Math.round(result[i]); } } return result; }; // preserve .conversion property if there is one if ('conversion' in fn) { wrappedFn.conversion = fn.conversion; } return wrappedFn; } models.forEach(function (fromModel) { convert[fromModel] = {}; Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels}); Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels}); var routes = route(fromModel); var routeModels = Object.keys(routes); routeModels.forEach(function (toModel) { var fn = routes[toModel]; convert[fromModel][toModel] = wrapRounded(fn); convert[fromModel][toModel].raw = wrapRaw(fn); }); }); module.exports = convert; /***/ }), /* 15 */ /***/ (function(module, exports, __webpack_require__) { /* MIT license */ var cssKeywords = __webpack_require__(16); // NOTE: conversions should only return primitive values (i.e. arrays, or // values that give correct `typeof` results). // do not use box values types (i.e. Number(), String(), etc.) var reverseKeywords = {}; for (var key in cssKeywords) { if (cssKeywords.hasOwnProperty(key)) { reverseKeywords[cssKeywords[key]] = key; } } var convert = module.exports = { rgb: {channels: 3, labels: 'rgb'}, hsl: {channels: 3, labels: 'hsl'}, hsv: {channels: 3, labels: 'hsv'}, hwb: {channels: 3, labels: 'hwb'}, cmyk: {channels: 4, labels: 'cmyk'}, xyz: {channels: 3, labels: 'xyz'}, lab: {channels: 3, labels: 'lab'}, lch: {channels: 3, labels: 'lch'}, hex: {channels: 1, labels: ['hex']}, keyword: {channels: 1, labels: ['keyword']}, ansi16: {channels: 1, labels: ['ansi16']}, ansi256: {channels: 1, labels: ['ansi256']}, hcg: {channels: 3, labels: ['h', 'c', 'g']}, apple: {channels: 3, labels: ['r16', 'g16', 'b16']}, gray: {channels: 1, labels: ['gray']} }; // hide .channels and .labels properties for (var model in convert) { if (convert.hasOwnProperty(model)) { if (!('channels' in convert[model])) { throw new Error('missing channels property: ' + model); } if (!('labels' in convert[model])) { throw new Error('missing channel labels property: ' + model); } if (convert[model].labels.length !== convert[model].channels) { throw new Error('channel and label counts mismatch: ' + model); } var channels = convert[model].channels; var labels = convert[model].labels; delete convert[model].channels; delete convert[model].labels; Object.defineProperty(convert[model], 'channels', {value: channels}); Object.defineProperty(convert[model], 'labels', {value: labels}); } } convert.rgb.hsl = function (rgb) { var r = rgb[0] / 255; var g = rgb[1] / 255; var b = rgb[2] / 255; var min = Math.min(r, g, b); var max = Math.max(r, g, b); var delta = max - min; var h; var s; var l; if (max === min) { h = 0; } else if (r === max) { h = (g - b) / delta; } else if (g === max) { h = 2 + (b - r) / delta; } else if (b === max) { h = 4 + (r - g) / delta; } h = Math.min(h * 60, 360); if (h < 0) { h += 360; } l = (min + max) / 2; if (max === min) { s = 0; } else if (l <= 0.5) { s = delta / (max + min); } else { s = delta / (2 - max - min); } return [h, s * 100, l * 100]; }; convert.rgb.hsv = function (rgb) { var rdif; var gdif; var bdif; var h; var s; var r = rgb[0] / 255; var g = rgb[1] / 255; var b = rgb[2] / 255; var v = Math.max(r, g, b); var diff = v - Math.min(r, g, b); var diffc = function (c) { return (v - c) / 6 / diff + 1 / 2; }; if (diff === 0) { h = s = 0; } else { s = diff / v; rdif = diffc(r); gdif = diffc(g); bdif = diffc(b); if (r === v) { h = bdif - gdif; } else if (g === v) { h = (1 / 3) + rdif - bdif; } else if (b === v) { h = (2 / 3) + gdif - rdif; } if (h < 0) { h += 1; } else if (h > 1) { h -= 1; } } return [ h * 360, s * 100, v * 100 ]; }; convert.rgb.hwb = function (rgb) { var r = rgb[0]; var g = rgb[1]; var b = rgb[2]; var h = convert.rgb.hsl(rgb)[0]; var w = 1 / 255 * Math.min(r, Math.min(g, b)); b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); return [h, w * 100, b * 100]; }; convert.rgb.cmyk = function (rgb) { var r = rgb[0] / 255; var g = rgb[1] / 255; var b = rgb[2] / 255; var c; var m; var y; var k; k = Math.min(1 - r, 1 - g, 1 - b); c = (1 - r - k) / (1 - k) || 0; m = (1 - g - k) / (1 - k) || 0; y = (1 - b - k) / (1 - k) || 0; return [c * 100, m * 100, y * 100, k * 100]; }; /** * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance * */ function comparativeDistance(x, y) { return ( Math.pow(x[0] - y[0], 2) + Math.pow(x[1] - y[1], 2) + Math.pow(x[2] - y[2], 2) ); } convert.rgb.keyword = function (rgb) { var reversed = reverseKeywords[rgb]; if (reversed) { return reversed; } var currentClosestDistance = Infinity; var currentClosestKeyword; for (var keyword in cssKeywords) { if (cssKeywords.hasOwnProperty(keyword)) { var value = cssKeywords[keyword]; // Compute comparative distance var distance = comparativeDistance(rgb, value); // Check if its less, if so set as closest if (distance < currentClosestDistance) { currentClosestDistance = distance; currentClosestKeyword = keyword; } } } return currentClosestKeyword; }; convert.keyword.rgb = function (keyword) { return cssKeywords[keyword]; }; convert.rgb.xyz = function (rgb) { var r = rgb[0] / 255; var g = rgb[1] / 255; var b = rgb[2] / 255; // assume sRGB r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92); g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92); b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92); var x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805); var y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722); var z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505); return [x * 100, y * 100, z * 100]; }; convert.rgb.lab = function (rgb) { var xyz = convert.rgb.xyz(rgb); var x = xyz[0]; var y = xyz[1]; var z = xyz[2]; var l; var a; var b; x /= 95.047; y /= 100; z /= 108.883; x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116); y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116); z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116); l = (116 * y) - 16; a = 500 * (x - y); b = 200 * (y - z); return [l, a, b]; }; convert.hsl.rgb = function (hsl) { var h = hsl[0] / 360; var s = hsl[1] / 100; var l = hsl[2] / 100; var t1; var t2; var t3; var rgb; var val; if (s === 0) { val = l * 255; return [val, val, val]; } if (l < 0.5) { t2 = l * (1 + s); } else { t2 = l + s - l * s; } t1 = 2 * l - t2; rgb = [0, 0, 0]; for (var i = 0; i < 3; i++) { t3 = h + 1 / 3 * -(i - 1); if (t3 < 0) { t3++; } if (t3 > 1) { t3--; } if (6 * t3 < 1) { val = t1 + (t2 - t1) * 6 * t3; } else if (2 * t3 < 1) { val = t2; } else if (3 * t3 < 2) { val = t1 + (t2 - t1) * (2 / 3 - t3) * 6; } else { val = t1; } rgb[i] = val * 255; } return rgb; }; convert.hsl.hsv = function (hsl) { var h = hsl[0]; var s = hsl[1] / 100; var l = hsl[2] / 100; var smin = s; var lmin = Math.max(l, 0.01); var sv; var v; l *= 2; s *= (l <= 1) ? l : 2 - l; smin *= lmin <= 1 ? lmin : 2 - lmin; v = (l + s) / 2; sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s); return [h, sv * 100, v * 100]; }; convert.hsv.rgb = function (hsv) { var h = hsv[0] / 60; var s = hsv[1] / 100; var v = hsv[2] / 100; var hi = Math.floor(h) % 6; var f = h - Math.floor(h); var p = 255 * v * (1 - s); var q = 255 * v * (1 - (s * f)); var t = 255 * v * (1 - (s * (1 - f))); v *= 255; switch (hi) { case 0: return [v, t, p]; case 1: return [q, v, p]; case 2: return [p, v, t]; case 3: return [p, q, v]; case 4: return [t, p, v]; case 5: return [v, p, q]; } }; convert.hsv.hsl = function (hsv) { var h = hsv[0]; var s = hsv[1] / 100; var v = hsv[2] / 100; var vmin = Math.max(v, 0.01); var lmin; var sl; var l; l = (2 - s) * v; lmin = (2 - s) * vmin; sl = s * vmin; sl /= (lmin <= 1) ? lmin : 2 - lmin; sl = sl || 0; l /= 2; return [h, sl * 100, l * 100]; }; // http://dev.w3.org/csswg/css-color/#hwb-to-rgb convert.hwb.rgb = function (hwb) { var h = hwb[0] / 360; var wh = hwb[1] / 100; var bl = hwb[2] / 100; var ratio = wh + bl; var i; var v; var f; var n; // wh + bl cant be > 1 if (ratio > 1) { wh /= ratio; bl /= ratio; } i = Math.floor(6 * h); v = 1 - bl; f = 6 * h - i; if ((i & 0x01) !== 0) { f = 1 - f; } n = wh + f * (v - wh); // linear interpolation var r; var g; var b; switch (i) { default: case 6: case 0: r = v; g = n; b = wh; break; case 1: r = n; g = v; b = wh; break; case 2: r = wh; g = v; b = n; break; case 3: r = wh; g = n; b = v; break; case 4: r = n; g = wh; b = v; break; case 5: r = v; g = wh; b = n; break; } return [r * 255, g * 255, b * 255]; }; convert.cmyk.rgb = function (cmyk) { var c = cmyk[0] / 100; var m = cmyk[1] / 100; var y = cmyk[2] / 100; var k = cmyk[3] / 100; var r; var g; var b; r = 1 - Math.min(1, c * (1 - k) + k); g = 1 - Math.min(1, m * (1 - k) + k); b = 1 - Math.min(1, y * (1 - k) + k); return [r * 255, g * 255, b * 255]; }; convert.xyz.rgb = function (xyz) { var x = xyz[0] / 100; var y = xyz[1] / 100; var z = xyz[2] / 100; var r; var g; var b; r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986); g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415); b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570); // assume sRGB r = r > 0.0031308 ? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055) : r * 12.92; g = g > 0.0031308 ? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055) : g * 12.92; b = b > 0.0031308 ? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055) : b * 12.92; r = Math.min(Math.max(0, r), 1); g = Math.min(Math.max(0, g), 1); b = Math.min(Math.max(0, b), 1); return [r * 255, g * 255, b * 255]; }; convert.xyz.lab = function (xyz) { var x = xyz[0]; var y = xyz[1]; var z = xyz[2]; var l; var a; var b; x /= 95.047; y /= 100; z /= 108.883; x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116); y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116); z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116); l = (116 * y) - 16; a = 500 * (x - y); b = 200 * (y - z); return [l, a, b]; }; convert.lab.xyz = function (lab) { var l = lab[0]; var a = lab[1]; var b = lab[2]; var x; var y; var z; y = (l + 16) / 116; x = a / 500 + y; z = y - b / 200; var y2 = Math.pow(y, 3); var x2 = Math.pow(x, 3); var z2 = Math.pow(z, 3); y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787; x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787; z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787; x *= 95.047; y *= 100; z *= 108.883; return [x, y, z]; }; convert.lab.lch = function (lab) { var l = lab[0]; var a = lab[1]; var b = lab[2]; var hr; var h; var c; hr = Math.atan2(b, a); h = hr * 360 / 2 / Math.PI; if (h < 0) { h += 360; } c = Math.sqrt(a * a + b * b); return [l, c, h]; }; convert.lch.lab = function (lch) { var l = lch[0]; var c = lch[1]; var h = lch[2]; var a; var b; var hr; hr = h / 360 * 2 * Math.PI; a = c * Math.cos(hr); b = c * Math.sin(hr); return [l, a, b]; }; convert.rgb.ansi16 = function (args) { var r = args[0]; var g = args[1]; var b = args[2]; var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization value = Math.round(value / 50); if (value === 0) { return 30; } var ansi = 30 + ((Math.round(b / 255) << 2) | (Math.round(g / 255) << 1) | Math.round(r / 255)); if (value === 2) { ansi += 60; } return ansi; }; convert.hsv.ansi16 = function (args) { // optimization here; we already know the value and don't need to get // it converted for us. return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); }; convert.rgb.ansi256 = function (args) { var r = args[0]; var g = args[1]; var b = args[2]; // we use the extended greyscale palette here, with the exception of // black and white. normal palette only has 4 greyscale shades. if (r === g && g === b) { if (r < 8) { return 16; } if (r > 248) { return 231; } return Math.round(((r - 8) / 247) * 24) + 232; } var ansi = 16 + (36 * Math.round(r / 255 * 5)) + (6 * Math.round(g / 255 * 5)) + Math.round(b / 255 * 5); return ansi; }; convert.ansi16.rgb = function (args) { var color = args % 10; // handle greyscale if (color === 0 || color === 7) { if (args > 50) { color += 3.5; } color = color / 10.5 * 255; return [color, color, color]; } var mult = (~~(args > 50) + 1) * 0.5; var r = ((color & 1) * mult) * 255; var g = (((color >> 1) & 1) * mult) * 255; var b = (((color >> 2) & 1) * mult) * 255; return [r, g, b]; }; convert.ansi256.rgb = function (args) { // handle greyscale if (args >= 232) { var c = (args - 232) * 10 + 8; return [c, c, c]; } args -= 16; var rem; var r = Math.floor(args / 36) / 5 * 255; var g = Math.floor((rem = args % 36) / 6) / 5 * 255; var b = (rem % 6) / 5 * 255; return [r, g, b]; }; convert.rgb.hex = function (args) { var integer = ((Math.round(args[0]) & 0xFF) << 16) + ((Math.round(args[1]) & 0xFF) << 8) + (Math.round(args[2]) & 0xFF); var string = integer.toString(16).toUpperCase(); return '000000'.substring(string.length) + string; }; convert.hex.rgb = function (args) { var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); if (!match) { return [0, 0, 0]; } var colorString = match[0]; if (match[0].length === 3) { colorString = colorString.split('').map(function (char) { return char + char; }).join(''); } var integer = parseInt(colorString, 16); var r = (integer >> 16) & 0xFF; var g = (integer >> 8) & 0xFF; var b = integer & 0xFF; return [r, g, b]; }; convert.rgb.hcg = function (rgb) { var r = rgb[0] / 255; var g = rgb[1] / 255; var b = rgb[2] / 255; var max = Math.max(Math.max(r, g), b); var min = Math.min(Math.min(r, g), b); var chroma = (max - min); var grayscale; var hue; if (chroma < 1) { grayscale = min / (1 - chroma); } else { grayscale = 0; } if (chroma <= 0) { hue = 0; } else if (max === r) { hue = ((g - b) / chroma) % 6; } else if (max === g) { hue = 2 + (b - r) / chroma; } else { hue = 4 + (r - g) / chroma + 4; } hue /= 6; hue %= 1; return [hue * 360, chroma * 100, grayscale * 100]; }; convert.hsl.hcg = function (hsl) { var s = hsl[1] / 100; var l = hsl[2] / 100; var c = 1; var f = 0; if (l < 0.5) { c = 2.0 * s * l; } else { c = 2.0 * s * (1.0 - l); } if (c < 1.0) { f = (l - 0.5 * c) / (1.0 - c); } return [hsl[0], c * 100, f * 100]; }; convert.hsv.hcg = function (hsv) { var s = hsv[1] / 100; var v = hsv[2] / 100; var c = s * v; var f = 0; if (c < 1.0) { f = (v - c) / (1 - c); } return [hsv[0], c * 100, f * 100]; }; convert.hcg.rgb = function (hcg) { var h = hcg[0] / 360; var c = hcg[1] / 100; var g = hcg[2] / 100; if (c === 0.0) { return [g * 255, g * 255, g * 255]; } var pure = [0, 0, 0]; var hi = (h % 1) * 6; var v = hi % 1; var w = 1 - v; var mg = 0; switch (Math.floor(hi)) { case 0: pure[0] = 1; pure[1] = v; pure[2] = 0; break; case 1: pure[0] = w; pure[1] = 1; pure[2] = 0; break; case 2: pure[0] = 0; pure[1] = 1; pure[2] = v; break; case 3: pure[0] = 0; pure[1] = w; pure[2] = 1; break; case 4: pure[0] = v; pure[1] = 0; pure[2] = 1; break; default: pure[0] = 1; pure[1] = 0; pure[2] = w; } mg = (1.0 - c) * g; return [ (c * pure[0] + mg) * 255, (c * pure[1] + mg) * 255, (c * pure[2] + mg) * 255 ]; }; convert.hcg.hsv = function (hcg) { var c = hcg[1] / 100; var g = hcg[2] / 100; var v = c + g * (1.0 - c); var f = 0; if (v > 0.0) { f = c / v; } return [hcg[0], f * 100, v * 100]; }; convert.hcg.hsl = function (hcg) { var c = hcg[1] / 100; var g = hcg[2] / 100; var l = g * (1.0 - c) + 0.5 * c; var s = 0; if (l > 0.0 && l < 0.5) { s = c / (2 * l); } else if (l >= 0.5 && l < 1.0) { s = c / (2 * (1 - l)); } return [hcg[0], s * 100, l * 100]; }; convert.hcg.hwb = function (hcg) { var c = hcg[1] / 100; var g = hcg[2] / 100; var v = c + g * (1.0 - c); return [hcg[0], (v - c) * 100, (1 - v) * 100]; }; convert.hwb.hcg = function (hwb) { var w = hwb[1] / 100; var b = hwb[2] / 100; var v = 1 - b; var c = v - w; var g = 0; if (c < 1) { g = (v - c) / (1 - c); } return [hwb[0], c * 100, g * 100]; }; convert.apple.rgb = function (apple) { return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255]; }; convert.rgb.apple = function (rgb) { return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535]; }; convert.gray.rgb = function (args) { return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; }; convert.gray.hsl = convert.gray.hsv = function (args) { return [0, 0, args[0]]; }; convert.gray.hwb = function (gray) { return [0, 100, gray[0]]; }; convert.gray.cmyk = function (gray) { return [0, 0, 0, gray[0]]; }; convert.gray.lab = function (gray) { return [gray[0], 0, 0]; }; convert.gray.hex = function (gray) { var val = Math.round(gray[0] / 100 * 255) & 0xFF; var integer = (val << 16) + (val << 8) + val; var string = integer.toString(16).toUpperCase(); return '000000'.substring(string.length) + string; }; convert.rgb.gray = function (rgb) { var val = (rgb[0] + rgb[1] + rgb[2]) / 3; return [val / 255 * 100]; }; /***/ }), /* 16 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = { "aliceblue": [240, 248, 255], "antiquewhite": [250, 235, 215], "aqua": [0, 255, 255], "aquamarine": [127, 255, 212], "azure": [240, 255, 255], "beige": [245, 245, 220], "bisque": [255, 228, 196], "black": [0, 0, 0], "blanchedalmond": [255, 235, 205], "blue": [0, 0, 255], "blueviolet": [138, 43, 226], "brown": [165, 42, 42], "burlywood": [222, 184, 135], "cadetblue": [95, 158, 160], "chartreuse": [127, 255, 0], "chocolate": [210, 105, 30], "coral": [255, 127, 80], "cornflowerblue": [100, 149, 237], "cornsilk": [255, 248, 220], "crimson": [220, 20, 60], "cyan": [0, 255, 255], "darkblue": [0, 0, 139], "darkcyan": [0, 139, 139], "darkgoldenrod": [184, 134, 11], "darkgray": [169, 169, 169], "darkgreen": [0, 100, 0], "darkgrey": [169, 169, 169], "darkkhaki": [189, 183, 107], "darkmagenta": [139, 0, 139], "darkolivegreen": [85, 107, 47], "darkorange": [255, 140, 0], "darkorchid": [153, 50, 204], "darkred": [139, 0, 0], "darksalmon": [233, 150, 122], "darkseagreen": [143, 188, 143], "darkslateblue": [72, 61, 139], "darkslategray": [47, 79, 79], "darkslategrey": [47, 79, 79], "darkturquoise": [0, 206, 209], "darkviolet": [148, 0, 211], "deeppink": [255, 20, 147], "deepskyblue": [0, 191, 255], "dimgray": [105, 105, 105], "dimgrey": [105, 105, 105], "dodgerblue": [30, 144, 255], "firebrick": [178, 34, 34], "floralwhite": [255, 250, 240], "forestgreen": [34, 139, 34], "fuchsia": [255, 0, 255], "gainsboro": [220, 220, 220], "ghostwhite": [248, 248, 255], "gold": [255, 215, 0], "goldenrod": [218, 165, 32], "gray": [128, 128, 128], "green": [0, 128, 0], "greenyellow": [173, 255, 47], "grey": [128, 128, 128], "honeydew": [240, 255, 240], "hotpink": [255, 105, 180], "indianred": [205, 92, 92], "indigo": [75, 0, 130], "ivory": [255, 255, 240], "khaki": [240, 230, 140], "lavender": [230, 230, 250], "lavenderblush": [255, 240, 245], "lawngreen": [124, 252, 0], "lemonchiffon": [255, 250, 205], "lightblue": [173, 216, 230], "lightcoral": [240, 128, 128], "lightcyan": [224, 255, 255], "lightgoldenrodyellow": [250, 250, 210], "lightgray": [211, 211, 211], "lightgreen": [144, 238, 144], "lightgrey": [211, 211, 211], "lightpink": [255, 182, 193], "lightsalmon": [255, 160, 122], "lightseagreen": [32, 178, 170], "lightskyblue": [135, 206, 250], "lightslategray": [119, 136, 153], "lightslategrey": [119, 136, 153], "lightsteelblue": [176, 196, 222], "lightyellow": [255, 255, 224], "lime": [0, 255, 0], "limegreen": [50, 205, 50], "linen": [250, 240, 230], "magenta": [255, 0, 255], "maroon": [128, 0, 0], "mediumaquamarine": [102, 205, 170], "mediumblue": [0, 0, 205], "mediumorchid": [186, 85, 211], "mediumpurple": [147, 112, 219], "mediumseagreen": [60, 179, 113], "mediumslateblue": [123, 104, 238], "mediumspringgreen": [0, 250, 154], "mediumturquoise": [72, 209, 204], "mediumvioletred": [199, 21, 133], "midnightblue": [25, 25, 112], "mintcream": [245, 255, 250], "mistyrose": [255, 228, 225], "moccasin": [255, 228, 181], "navajowhite": [255, 222, 173], "navy": [0, 0, 128], "oldlace": [253, 245, 230], "olive": [128, 128, 0], "olivedrab": [107, 142, 35], "orange": [255, 165, 0], "orangered": [255, 69, 0], "orchid": [218, 112, 214], "palegoldenrod": [238, 232, 170], "palegreen": [152, 251, 152], "paleturquoise": [175, 238, 238], "palevioletred": [219, 112, 147], "papayawhip": [255, 239, 213], "peachpuff": [255, 218, 185], "peru": [205, 133, 63], "pink": [255, 192, 203], "plum": [221, 160, 221], "powderblue": [176, 224, 230], "purple": [128, 0, 128], "rebeccapurple": [102, 51, 153], "red": [255, 0, 0], "rosybrown": [188, 143, 143], "royalblue": [65, 105, 225], "saddlebrown": [139, 69, 19], "salmon": [250, 128, 114], "sandybrown": [244, 164, 96], "seagreen": [46, 139, 87], "seashell": [255, 245, 238], "sienna": [160, 82, 45], "silver": [192, 192, 192], "skyblue": [135, 206, 235], "slateblue": [106, 90, 205], "slategray": [112, 128, 144], "slategrey": [112, 128, 144], "snow": [255, 250, 250], "springgreen": [0, 255, 127], "steelblue": [70, 130, 180], "tan": [210, 180, 140], "teal": [0, 128, 128], "thistle": [216, 191, 216], "tomato": [255, 99, 71], "turquoise": [64, 224, 208], "violet": [238, 130, 238], "wheat": [245, 222, 179], "white": [255, 255, 255], "whitesmoke": [245, 245, 245], "yellow": [255, 255, 0], "yellowgreen": [154, 205, 50] }; /***/ }), /* 17 */ /***/ (function(module, exports, __webpack_require__) { var conversions = __webpack_require__(15); /* this function routes a model to all other models. all functions that are routed have a property `.conversion` attached to the returned synthetic function. This property is an array of strings, each with the steps in between the 'from' and 'to' color models (inclusive). conversions that are not possible simply are not included. */ function buildGraph() { var graph = {}; // https://jsperf.com/object-keys-vs-for-in-with-closure/3 var models = Object.keys(conversions); for (var len = models.length, i = 0; i < len; i++) { graph[models[i]] = { // http://jsperf.com/1-vs-infinity // micro-opt, but this is simple. distance: -1, parent: null }; } return graph; } // https://en.wikipedia.org/wiki/Breadth-first_search function deriveBFS(fromModel) { var graph = buildGraph(); var queue = [fromModel]; // unshift -> queue -> pop graph[fromModel].distance = 0; while (queue.length) { var current = queue.pop(); var adjacents = Object.keys(conversions[current]); for (var len = adjacents.length, i = 0; i < len; i++) { var adjacent = adjacents[i]; var node = graph[adjacent]; if (node.distance === -1) { node.distance = graph[current].distance + 1; node.parent = current; queue.unshift(adjacent); } } } return graph; } function link(from, to) { return function (args) { return to(from(args)); }; } function wrapConversion(toModel, graph) { var path = [graph[toModel].parent, toModel]; var fn = conversions[graph[toModel].parent][toModel]; var cur = graph[toModel].parent; while (graph[cur].parent) { path.unshift(graph[cur].parent); fn = link(conversions[graph[cur].parent][cur], fn); cur = graph[cur].parent; } fn.conversion = path; return fn; } module.exports = function (fromModel) { var graph = deriveBFS(fromModel); var conversion = {}; var models = Object.keys(graph); for (var len = models.length, i = 0; i < len; i++) { var toModel = models[i]; var node = graph[toModel]; if (node.parent === null) { // no possible conversion, or this node is the source model. continue; } conversion[toModel] = wrapConversion(toModel, graph); } return conversion; }; /***/ }), /* 18 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const os = __webpack_require__(19); const hasFlag = __webpack_require__(20); const env = process.env; let forceColor; if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false')) { forceColor = false; } else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) { forceColor = true; } if ('FORCE_COLOR' in env) { forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0; } function translateLevel(level) { if (level === 0) { return false; } return { level, hasBasic: true, has256: level >= 2, has16m: level >= 3 }; } function supportsColor(stream) { if (forceColor === false) { return 0; } if (hasFlag('color=16m') || hasFlag('color=full') || hasFlag('color=truecolor')) { return 3; } if (hasFlag('color=256')) { return 2; } if (stream && !stream.isTTY && forceColor !== true) { return 0; } const min = forceColor ? 1 : 0; if (process.platform === 'win32') { // Node.js 7.5.0 is the first version of Node.js to include a patch to // libuv that enables 256 color output on Windows. Anything earlier and it // won't work. However, here we target Node.js 8 at minimum as it is an LTS // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows // release that supports 256 colors. Windows 10 build 14931 is the first release // that supports 16m/TrueColor. const osRelease = os.release().split('.'); if ( Number(process.versions.node.split('.')[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586 ) { return Number(osRelease[2]) >= 14931 ? 3 : 2; } return 1; } if ('CI' in env) { if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') { return 1; } return min; } if ('TEAMCITY_VERSION' in env) { return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; } if (env.COLORTERM === 'truecolor') { return 3; } if ('TERM_PROGRAM' in env) { const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); switch (env.TERM_PROGRAM) { case 'iTerm.app': return version >= 3 ? 3 : 2; case 'Apple_Terminal': return 2; // No default } } if (/-256(color)?$/i.test(env.TERM)) { return 2; } if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { return 1; } if ('COLORTERM' in env) { return 1; } if (env.TERM === 'dumb') { return min; } return min; } function getSupportLevel(stream) { const level = supportsColor(stream); return translateLevel(level); } module.exports = { supportsColor: getSupportLevel, stdout: getSupportLevel(process.stdout), stderr: getSupportLevel(process.stderr) }; /***/ }), /* 19 */ /***/ (function(module, exports) { module.exports = require("os"); /***/ }), /* 20 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = (flag, argv) => { argv = argv || process.argv; const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); const pos = argv.indexOf(prefix + flag); const terminatorPos = argv.indexOf('--'); return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos); }; /***/ }), /* 21 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const TEMPLATE_REGEX = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi; const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g; const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/; const ESCAPE_REGEX = /\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi; const ESCAPES = new Map([ ['n', '\n'], ['r', '\r'], ['t', '\t'], ['b', '\b'], ['f', '\f'], ['v', '\v'], ['0', '\0'], ['\\', '\\'], ['e', '\u001B'], ['a', '\u0007'] ]); function unescape(c) { if ((c[0] === 'u' && c.length === 5) || (c[0] === 'x' && c.length === 3)) { return String.fromCharCode(parseInt(c.slice(1), 16)); } return ESCAPES.get(c) || c; } function parseArguments(name, args) { const results = []; const chunks = args.trim().split(/\s*,\s*/g); let matches; for (const chunk of chunks) { if (!isNaN(chunk)) { results.push(Number(chunk)); } else if ((matches = chunk.match(STRING_REGEX))) { results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, chr) => escape ? unescape(escape) : chr)); } else { throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`); } } return results; } function parseStyle(style) { STYLE_REGEX.lastIndex = 0; const results = []; let matches; while ((matches = STYLE_REGEX.exec(style)) !== null) { const name = matches[1]; if (matches[2]) { const args = parseArguments(name, matches[2]); results.push([name].concat(args)); } else { results.push([name]); } } return results; } function buildStyle(chalk, styles) { const enabled = {}; for (const layer of styles) { for (const style of layer.styles) { enabled[style[0]] = layer.inverse ? null : style.slice(1); } } let current = chalk; for (const styleName of Object.keys(enabled)) { if (Array.isArray(enabled[styleName])) { if (!(styleName in current)) { throw new Error(`Unknown Chalk style: ${styleName}`); } if (enabled[styleName].length > 0) { current = current[styleName].apply(current, enabled[styleName]); } else { current = current[styleName]; } } } return current; } module.exports = (chalk, tmp) => { const styles = []; const chunks = []; let chunk = []; // eslint-disable-next-line max-params tmp.replace(TEMPLATE_REGEX, (m, escapeChar, inverse, style, close, chr) => { if (escapeChar) { chunk.push(unescape(escapeChar)); } else if (style) { const str = chunk.join(''); chunk = []; chunks.push(styles.length === 0 ? str : buildStyle(chalk, styles)(str)); styles.push({inverse, styles: parseStyle(style)}); } else if (close) { if (styles.length === 0) { throw new Error('Found extraneous } in Chalk template literal'); } chunks.push(buildStyle(chalk, styles)(chunk.join(''))); chunk = []; styles.pop(); } else { chunk.push(chr); } }); chunks.push(chunk.join('')); if (styles.length > 0) { const errMsg = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`; throw new Error(errMsg); } return chunks.join(''); }; /***/ }), /* 22 */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(23).default; /***/ }), /* 23 */ /***/ (function(module, exports, __webpack_require__) { /** * This is a function which returns an instance of * [request-promise](https://www.npmjs.com/package/request-promise) initialized with * defaults often used in connector development. * * ```js * // Showing defaults * req = requestFactory({ * cheerio: false, * jar: true, * json: true * }) * ``` * * Options : * * - `cheerio`: will parse automatically the `response.body` in a cheerio instance * * ```javascript * req = requestFactory({ cheerio: true }) * req('http://github.com', $ => { * const repos = $('#repo_listing .repo') * }) * ``` * * - `jar`: is passed to `request` options. Remembers cookies for future use. * - `json`: will parse the `response.body` as JSON * - `resolveWithFullResponse`: The full response will be return in the promise. It is compatible * with cheerio and json options. * * ```javascript * req = requestFactory({ * resolveWithFullResponse: true, * cheerio: true * }) * req('http://github.com', response => { * console.log(response.statusCode) * const $ = response.body * const repos = $('#repo_listing .repo') * }) * ``` * - `debug`: will display request and responses details in error output. Possible values : * * true : display request and response in normal request-debug json format * * 'json' : display request and response in full json format * * 'simple' : display main information about each request and response * ``` * GET -> http://books.toscrape.com/media/cache/26/0c/260c6ae16bce31c8f8c95daddd9f4a1c.jpg * <- 200 Content-Length: 7095 * ``` * * 'full' : display comple information about each request and response * ``` * GET -> http://quotes.toscrape.com/login * * BEGIN HEADERS * host: quotes.toscrape.com * END HEADERS * * <- 200 Content-Length: 1869 * * BEGIN HEADERS * server: nginx/1.12.1 * ... * END HEADERS * * BEGIN BODY * <html>.... * END BODY * ``` * * You can find the full list of available options in [request-promise](https://github.com/request/request-promise) and [request](https://github.com/request/request) documentations. * * @module requestFactory */ let request = __webpack_require__(24); const requestdebug = __webpack_require__(277); exports = module.exports = { default: requestFactory, mergeDefaultOptions, transformWithCheerio, getRequestOptions }; function requestFactory({ debug, ...options } = { debug: false }) { const logFn = setDebugFunction(debug); debug && requestdebug(request, logFn); return request.defaults(getRequestOptions(mergeDefaultOptions(options))); } function setDebugFunction(debug) { /* eslint no-console: off */ if (debug === 'simple') { return (type, data) => console.error(requestToStrings(type, data).oneline); } else if (debug === 'json') { return (type, data) => console.error(JSON.stringify({ type, data })); } else if (debug === 'full') { return (type, data) => { const { oneline, headers, body } = requestToStrings(type, data); console.error(`${oneline} BEGIN HEADERS ${headers} END HEADERS ` + (body ? `BEGIN BODY ${body} END BODY ` : '')); }; } else if (typeof debug === 'function') { return (type, data, resp) => debug({ strings: requestToStrings(type, data), type, data, resp }); } } function requestToStrings(type, data) { const result = {}; if (type === 'request') { result.oneline = `${data.method} -> ${data.uri} ${data.headers['content-length'] ? 'Content-Length: ' + data.headers['content-length'] : ''}`; } else if (type === 'response') { result.oneline = `<- ${data.statusCode} ${data.headers['content-length'] ? 'Content-Length: ' + data.headers['content-length'] : ''}`; } else { result.oneline = `<- ${data.statusCode} ${data.uri}`; } result.headers = Object.keys(data.headers).map(key => `${key}: ${data.headers[key]}`).join('\n'); result.body = data.body; return result; } function mergeDefaultOptions(options = {}) { const defaultOptions = { debug: false, json: true, cheerio: false, headers: {}, followAllRedirects: true }; if (options.cheerio === true) { options.json = false; } return { ...defaultOptions, ...options }; } function transformWithCheerio(body, response, resolveWithFullResponse) { const result = __webpack_require__(279).load(body); if (resolveWithFullResponse) { return { ...response, body: result }; } return result; } function getRequestOptions({ cheerio, userAgent, ...options }) { return cheerio ? { ...options, transform: transformWithCheerio, headers: { ...options.headers, 'User-Agent': userAgent === undefined || userAgent ? DEFAULT_USER_AGENT : options.headers['User-Agent'] } } : { ...options, headers: { ...options.headers, 'User-Agent': userAgent ? DEFAULT_USER_AGENT : options.headers['User-Agent'] } }; } const DEFAULT_USER_AGENT = 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0'; /***/ }), /* 24 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(module) { var Bluebird = __webpack_require__(25).getNewLibraryCopy(), configure = __webpack_require__(62), stealthyRequire = __webpack_require__(77); try { // Load Request freshly - so that users can require an unaltered request instance! var request = stealthyRequire(__webpack_require__.c, function () { return __webpack_require__(78); }, function () { __webpack_require__(270); }, module); } catch (err) { /* istanbul ignore next */ var EOL = __webpack_require__(19).EOL; /* istanbul ignore next */ console.error(EOL + '###' + EOL + '### The "request" library is not installed automatically anymore.' + EOL + '### But is a dependency of "request-promise".' + EOL + '### Please install it with:' + EOL + '### npm install request --save' + EOL + '###' + EOL); /* istanbul ignore next */ throw err; } Bluebird.config({cancellation: true}); configure({ request: request, PromiseImpl: Bluebird, expose: [ 'then', 'catch', 'finally', 'cancel', 'promise' // Would you like to expose more Bluebird methods? Try e.g. `rp(...).promise().tap(...)` first. `.promise()` returns the full-fledged Bluebird promise. ], constructorMixin: function (resolve, reject, onCancel) { var self = this; onCancel(function () { self.abort(); }); } }); request.bindCLS = function RP$bindCLS() { throw new Error('CLS support was dropped. To get it back read: https://github.com/request/request-promise/wiki/Getting-Back-Support-for-Continuation-Local-Storage'); }; module.exports = request; /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(13)(module))) /***/ }), /* 25 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var old; if (typeof Promise !== "undefined") old = Promise; function noConflict() { try { if (Promise === bluebird) Promise = old; } catch (e) {} return bluebird; } var bluebird = __webpack_require__(26)(); bluebird.noConflict = noConflict; module.exports = bluebird; /***/ }), /* 26 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function() { var makeSelfResolutionError = function () { return new TypeError("circular promise resolution chain\u000a\u000a See http://goo.gl/MqrFmX\u000a"); }; var reflectHandler = function() { return new Promise.PromiseInspection(this._target()); }; var apiRejection = function(msg) { return Promise.reject(new TypeError(msg)); }; function Proxyable() {} var UNDEFINED_BINDING = {}; var util = __webpack_require__(27); util.setReflectHandler(reflectHandler); var getDomain = function() { var domain = process.domain; if (domain === undefined) { return null; } return domain; }; var getContextDefault = function() { return null; }; var getContextDomain = function() { return { domain: getDomain(), async: null }; }; var AsyncResource = util.isNode && util.nodeSupportsAsyncResource ? __webpack_require__(29).AsyncResource : null; var getContextAsyncHooks = function() { return { domain: getDomain(), async: new AsyncResource("Bluebird::Promise") }; }; var getContext = util.isNode ? getContextDomain : getContextDefault; util.notEnumerableProp(Promise, "_getContext", getContext); var enableAsyncHooks = function() { getContext = getContextAsyncHooks; util.notEnumerableProp(Promise, "_getContext", getContextAsyncHooks); }; var disableAsyncHooks = function() { getContext = getContextDomain; util.notEnumerableProp(Promise, "_getContext", getContextDomain); }; var es5 = __webpack_require__(28); var Async = __webpack_require__(30); var async = new Async(); es5.defineProperty(Promise, "_async", {value: async}); var errors = __webpack_require__(33); var TypeError = Promise.TypeError = errors.TypeError; Promise.RangeError = errors.RangeError; var CancellationError = Promise.CancellationError = errors.CancellationError; Promise.TimeoutError = errors.TimeoutError; Promise.OperationalError = errors.OperationalError; Promise.RejectionError = errors.OperationalError; Promise.AggregateError = errors.AggregateError; var INTERNAL = function(){}; var APPLY = {}; var NEXT_FILTER = {}; var tryConvertToPromise = __webpack_require__(34)(Promise, INTERNAL); var PromiseArray = __webpack_require__(35)(Promise, INTERNAL, tryConvertToPromise, apiRejection, Proxyable); var Context = __webpack_require__(36)(Promise); /*jshint unused:false*/ var createContext = Context.create; var debug = __webpack_require__(37)(Promise, Context, enableAsyncHooks, disableAsyncHooks); var CapturedTrace = debug.CapturedTrace; var PassThroughHandlerContext = __webpack_require__(38)(Promise, tryConvertToPromise, NEXT_FILTER); var catchFilter = __webpack_require__(39)(NEXT_FILTER); var nodebackForPromise = __webpack_require__(40); var errorObj = util.errorObj; var tryCatch = util.tryCatch; function check(self, executor) { if (self == null || self.constructor !== Promise) { throw new TypeError("the promise constructor cannot be invoked directly\u000a\u000a See http://goo.gl/MqrFmX\u000a"); } if (typeof executor !== "function") { throw new TypeError("expecting a function but got " + util.classString(executor)); } } function Promise(executor) { if (executor !== INTERNAL) { check(this, executor); } this._bitField = 0; this._fulfillmentHandler0 = undefined; this._rejectionHandler0 = undefined; this._promise0 = undefined; this._receiver0 = undefined; this._resolveFromExecutor(executor); this._promiseCreated(); this._fireEvent("promiseCreated", this); } Promise.prototype.toString = function () { return "[object Promise]"; }; Promise.prototype.caught = Promise.prototype["catch"] = function (fn) { var len = arguments.length; if (len > 1) { var catchInstances = new Array(len - 1), j = 0, i; for (i = 0; i < len - 1; ++i) { var item = arguments[i]; if (util.isObject(item)) { catchInstances[j++] = item; } else { return apiRejection("Catch statement predicate: " + "expecting an object but got " + util.classString(item)); } } catchInstances.length = j; fn = arguments[i]; if (typeof fn !== "function") { throw new TypeError("The last argument to .catch() " + "must be a function, got " + util.toString(fn)); } return this.then(undefined, catchFilter(catchInstances, fn, this)); } return this.then(undefined, fn); }; Promise.prototype.reflect = function () { return this._then(reflectHandler, reflectHandler, undefined, this, undefined); }; Promise.prototype.then = function (didFulfill, didReject) { if (debug.warnings() && arguments.length > 0 && typeof didFulfill !== "function" && typeof didReject !== "function") { var msg = ".then() only accepts functions but was passed: " + util.classString(didFulfill); if (arguments.length > 1) { msg += ", " + util.classString(didReject); } this._warn(msg); } return this._then(didFulfill, didReject, undefined, undefined, undefined); }; Promise.prototype.done = function (didFulfill, didReject) { var promise = this._then(didFulfill, didReject, undefined, undefined, undefined); promise._setIsFinal(); }; Promise.prototype.spread = function (fn) { if (typeof fn !== "function") { return apiRejection("expecting a function but got " + util.classString(fn)); } return this.all()._then(fn, undefined, undefined, APPLY, undefined); }; Promise.prototype.toJSON = function () { var ret = { isFulfilled: false, isRejected: false, fulfillmentValue: undefined, rejectionReason: undefined }; if (this.isFulfilled()) { ret.fulfillmentValue = this.value(); ret.isFulfilled = true; } else if (this.isRejected()) { ret.rejectionReason = this.reason(); ret.isRejected = true; } return ret; }; Promise.prototype.all = function () { if (arguments.length > 0) { this._warn(".all() was passed arguments but it does not take any"); } return new PromiseArray(this).promise(); }; Promise.prototype.error = function (fn) { return this.caught(util.originatesFromRejection, fn); }; Promise.getNewLibraryCopy = module.exports; Promise.is = function (val) { return val instanceof Promise; }; Promise.fromNode = Promise.fromCallback = function(fn) { var ret = new Promise(INTERNAL); ret._captureStackTrace(); var multiArgs = arguments.length > 1 ? !!Object(arguments[1]).multiArgs : false; var result = tryCatch(fn)(nodebackForPromise(ret, multiArgs)); if (result === errorObj) { ret._rejectCallback(result.e, true); } if (!ret._isFateSealed()) ret._setAsyncGuaranteed(); return ret; }; Promise.all = function (promises) { return new PromiseArray(promises).promise(); }; Promise.cast = function (obj) { var ret = tryConvertToPromise(obj); if (!(ret instanceof Promise)) { ret = new Promise(INTERNAL); ret._captureStackTrace(); ret._setFulfilled(); ret._rejectionHandler0 = obj; } return ret; }; Promise.resolve = Promise.fulfilled = Promise.cast; Promise.reject = Promise.rejected = function (reason) { var ret = new Promise(INTERNAL); ret._captureStackTrace(); ret._rejectCallback(reason, true); return ret; }; Promise.setScheduler = function(fn) { if (typeof fn !== "function") { throw new TypeError("expecting a function but got " + util.classString(fn)); } return async.setScheduler(fn); }; Promise.prototype._then = function ( didFulfill, didReject, _, receiver, internalData ) { var haveInternalData = internalData !== undefined; var promise = haveInternalData ? internalData : new Promise(INTERNAL); var target = this._target(); var bitField = target._bitField; if (!haveInternalData) { promise._propagateFrom(this, 3); promise._captureStackTrace(); if (receiver === undefined && ((this._bitField & 2097152) !== 0)) { if (!((bitField & 50397184) === 0)) { receiver = this._boundValue(); } else { receiver = target === this ? undefined : this._boundTo; } } this._fireEvent("promiseChained", this, promise); } var context = getContext(); if (!((bitField & 50397184) === 0)) { var handler, value, settler = target._settlePromiseCtx; if (((bitField & 33554432) !== 0)) { value = target._rejectionHandler0; handler = didFulfill; } else if (((bitField & 16777216) !== 0)) { value = target._fulfillmentHandler0; handler = didReject; target._unsetRejectionIsUnhandled(); } else { settler = target._settlePromiseLateCancellationObserver; value = new CancellationError("late cancellation observer"); target._attachExtraTrace(value); handler = didReject; } async.invoke(settler, target, { handler: util.contextBind(context, handler), promise: promise, receiver: receiver, value: value }); } else { target._addCallbacks(didFulfill, didReject, promise, receiver, context); } return promise; }; Promise.prototype._length = function () { return this._bitField & 65535; }; Promise.prototype._isFateSealed = function () { return (this._bitField & 117506048) !== 0; }; Promise.prototype._isFollowing = function () { return (this._bitField & 67108864) === 67108864; }; Promise.prototype._setLength = function (len) { this._bitField = (this._bitField & -65536) | (len & 65535); }; Promise.prototype._setFulfilled = function () { this._bitField = this._bitField | 33554432; this._fireEvent("promiseFulfilled", this); }; Promise.prototype._setRejected = function () { this._bitField = this._bitField | 16777216; this._fireEvent("promiseRejected", this); }; Promise.prototype._setFollowing = function () { this._bitField = this._bitField | 67108864; this._fireEvent("promiseResolved", this); }; Promise.prototype._setIsFinal = function () { this._bitField = this._bitField | 4194304; }; Promise.prototype._isFinal = function () { return (this._bitField & 4194304) > 0; }; Promise.prototype._unsetCancelled = function() { this._bitField = this._bitField & (~65536); }; Promise.prototype._setCancelled = function() { this._bitField = this._bitField | 65536; this._fireEvent("promiseCancelled", this); }; Promise.prototype._setWillBeCancelled = function() { this._bitField = this._bitField | 8388608; }; Promise.prototype._setAsyncGuaranteed = function() { if (async.hasCustomScheduler()) return; var bitField = this._bitField; this._bitField = bitField | (((bitField & 536870912) >> 2) ^ 134217728); }; Promise.prototype._setNoAsyncGuarantee = function() { this._bitField = (this._bitField | 536870912) & (~134217728); }; Promise.prototype._receiverAt = function (index) { var ret = index === 0 ? this._receiver0 : this[ index * 4 - 4 + 3]; if (ret === UNDEFINED_BINDING) { return undefined; } else if (ret === undefined && this._isBound()) { return this._boundValue(); } return ret; }; Promise.prototype._promiseAt = function (index) { return this[ index * 4 - 4 + 2]; }; Promise.prototype._fulfillmentHandlerAt = function (index) { return this[ index * 4 - 4 + 0]; }; Promise.prototype._rejectionHandlerAt = function (index) { return this[ index * 4 - 4 + 1]; }; Promise.prototype._boundValue = function() {}; Promise.prototype._migrateCallback0 = function (follower) { var bitField = follower._bitField; var fulfill = follower._fulfillmentHandler0; var reject = follower._rejectionHandler0; var promise = follower._promise0; var receiver = follower._receiverAt(0); if (receiver === undefined) receiver = UNDEFINED_BINDING; this._addCallbacks(fulfill, reject, promise, receiver, null); }; Promise.prototype._migrateCallbackAt = function (follower, index) { var fulfill = follower._fulfillmentHandlerAt(index); var reject = follower._rejectionHandlerAt(index); var promise = follower._promiseAt(index); var receiver = follower._receiverAt(index); if (receiver === undefined) receiver = UNDEFINED_BINDING; this._addCallbacks(fulfill, reject, promise, receiver, null); }; Promise.prototype._addCallbacks = function ( fulfill, reject, promise, receiver, context ) { var index = this._length(); if (index >= 65535 - 4) { index = 0; this._setLength(0); } if (index === 0) { this._promise0 = promise; this._receiver0 = receiver; if (typeof fulfill === "function") { this._fulfillmentHandler0 = util.contextBind(context, fulfill); } if (typeof reject === "function") { this._rejectionHandler0 = util.contextBind(context, reject); } } else { var base = index * 4 - 4; this[base + 2] = promise; this[base + 3] = receiver; if (typeof fulfill === "function") { this[base + 0] = util.contextBind(context, fulfill); } if (typeof reject === "function") { this[base + 1] = util.contextBind(context, reject); } } this._setLength(index + 1); return index; }; Promise.prototype._proxy = function (proxyable, arg) { this._addCallbacks(undefined, undefined, arg, proxyable, null); }; Promise.prototype._resolveCallback = function(value, shouldBind) { if (((this._bitField & 117506048) !== 0)) return; if (value === this) return this._rejectCallback(makeSelfResolutionError(), false); var maybePromise = tryConvertToPromise(value, this); if (!(maybePromise instanceof Promise)) return this._fulfill(value); if (shouldBind) this._propagateFrom(maybePromise, 2); var promise = maybePromise._target(); if (promise === this) { this._reject(makeSelfResolutionError()); return; } var bitField = promise._bitField; if (((bitField & 50397184) === 0)) { var len = this._length(); if (len > 0) promise._migrateCallback0(this); for (var i = 1; i < len; ++i) { promise._migrateCallbackAt(this, i); } this._setFollowing(); this._setLength(0); this._setFollowee(maybePromise); } else if (((bitField & 33554432) !== 0)) { this._fulfill(promise._value()); } else if (((bitField & 16777216) !== 0)) { this._reject(promise._reason()); } else { var reason = new CancellationError("late cancellation observer"); promise._attachExtraTrace(reason); this._reject(reason); } }; Promise.prototype._rejectCallback = function(reason, synchronous, ignoreNonErrorWarnings) { var trace = util.ensureErrorObject(reason); var hasStack = trace === reason; if (!hasStack && !ignoreNonErrorWarnings && debug.warnings()) { var message = "a promise was rejected with a non-error: " + util.classString(reason); this._warn(message, true); } this._attachExtraTrace(trace, synchronous ? hasStack : false); this._reject(reason); }; Promise.prototype._resolveFromExecutor = function (executor) { if (executor === INTERNAL) return; var promise = this; this._captureStackTrace(); this._pushContext(); var synchronous = true; var r = this._execute(executor, function(value) { promise._resolveCallback(value); }, function (reason) { promise._rejectCallback(reason, synchronous); }); synchronous = false; this._popContext(); if (r !== undefined) { promise._rejectCallback(r, true); } }; Promise.prototype._settlePromiseFromHandler = function ( handler, receiver, value, promise ) { var bitField = promise._bitField; if (((bitField & 65536) !== 0)) return; promise._pushContext(); var x; if (receiver === APPLY) { if (!value || typeof value.length !== "number") { x = errorObj; x.e = new TypeError("cannot .spread() a non-array: " + util.classString(value)); } else { x = tryCatch(handler).apply(this._boundValue(), value); } } else { x = tryCatch(handler).call(receiver, value); } var promiseCreated = promise._popContext(); bitField = promise._bitField; if (((bitField & 65536) !== 0)) return; if (x === NEXT_FILTER) { promise._reject(value); } else if (x === errorObj) { promise._rejectCallback(x.e, false); } else { debug.checkForgottenReturns(x, promiseCreated, "", promise, this); promise._resolveCallback(x); } }; Promise.prototype._target = function() { var ret = this; while (ret._isFollowing()) ret = ret._followee(); return ret; }; Promise.prototype._followee = function() { return this._rejectionHandler0; }; Promise.prototype._setFollowee = function(promise) { this._rejectionHandler0 = promise; }; Promise.prototype._settlePromise = function(promise, handler, receiver, value) { var isPromise = promise instanceof Promise; var bitField = this._bitField; var asyncGuaranteed = ((bitField & 134217728) !== 0); if (((bitField & 65536) !== 0)) { if (isPromise) promise._invokeInternalOnCancel(); if (receiver instanceof PassThroughHandlerContext && receiver.isFinallyHandler()) { receiver.cancelPromise = promise; if (tryCatch(handler).call(receiver, value) === errorObj) { promise._reject(errorObj.e); } } else if (handler === reflectHandler) { promise._fulfill(reflectHandler.call(receiver)); } else if (receiver instanceof Proxyable) { receiver._promiseCancelled(promise); } else if (isPromise || promise instanceof PromiseArray) { promise._cancel(); } else { receiver.cancel(); } } else if (typeof handler === "function") { if (!isPromise) { handler.call(receiver, value, promise); } else { if (asyncGuaranteed) promise._setAsyncGuaranteed(); this._settlePromiseFromHandler(handler, receiver, value, promise); } } else if (receiver instanceof Proxyable) { if (!receiver._isResolved()) { if (((bitField & 33554432) !== 0)) { receiver._promiseFulfilled(value, promise); } else { receiver._promiseRejected(value, promise); } } } else if (isPromise) { if (asyncGuaranteed) promise._setAsyncGuaranteed(); if (((bitField & 33554432) !== 0)) { promise._fulfill(value); } else { promise._reject(value); } } }; Promise.prototype._settlePromiseLateCancellationObserver = function(ctx) { var handler = ctx.handler; var promise = ctx.promise; var receiver = ctx.receiver; var value = ctx.value; if (typeof handler === "function") { if (!(promise instanceof Promise)) { handler.call(receiver, value, promise); } else { this._settlePromiseFromHandler(handler, receiver, value, promise); } } else if (promise instanceof Promise) { promise._reject(value); } }; Promise.prototype._settlePromiseCtx = function(ctx) { this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value); }; Promise.prototype._settlePromise0 = function(handler, value, bitField) { var promise = this._promise0; var receiver = this._receiverAt(0); this._promise0 = undefined; this._receiver0 = undefined; this._settlePromise(promise, handler, receiver, value); }; Promise.prototype._clearCallbackDataAtIndex = function(index) { var base = index * 4 - 4; this[base + 2] = this[base + 3] = this[base + 0] = this[base + 1] = undefined; }; Promise.prototype._fulfill = function (value) { var bitField = this._bitField; if (((bitField & 117506048) >>> 16)) return; if (value === this) { var err = makeSelfResolutionError(); this._attachExtraTrace(err); return this._reject(err); } this._setFulfilled(); this._rejectionHandler0 = value; if ((bitField & 65535) > 0) { if (((bitField & 134217728) !== 0)) { this._settlePromises(); } else { async.settlePromises(this); } this._dereferenceTrace(); } }; Promise.prototype._reject = function (reason) { var bitField = this._bitField; if (((bitField & 117506048) >>> 16)) return; this._setRejected(); this._fulfillmentHandler0 = reason; if (this._isFinal()) { return async.fatalError(reason, util.isNode); } if ((bitField & 65535) > 0) { async.settlePromises(this); } else { this._ensurePossibleRejectionHandled(); } }; Promise.prototype._fulfillPromises = function (len, value) { for (var i = 1; i < len; i++) { var handler = this._fulfillmentHandlerAt(i); var promise = this._promiseAt(i); var receiver = this._receiverAt(i); this._clearCallbackDataAtIndex(i); this._settlePromise(promise, handler, receiver, value); } }; Promise.prototype._rejectPromises = function (len, reason) { for (var i = 1; i < len; i++) { var handler = this._rejectionHandlerAt(i); var promise = this._promiseAt(i); var receiver = this._receiverAt(i); this._clearCallbackDataAtIndex(i); this._settlePromise(promise, handler, receiver, reason); } }; Promise.prototype._settlePromises = function () { var bitField = this._bitField; var len = (bitField & 65535); if (len > 0) { if (((bitField & 16842752) !== 0)) { var reason = this._fulfillmentHandler0; this._settlePromise0(this._rejectionHandler0, reason, bitField); this._rejectPromises(len, reason); } else { var value = this._rejectionHandler0; this._settlePromise0(this._fulfillmentHandler0, value, bitField); this._fulfillPromises(len, value); } this._setLength(0); } this._clearCancellationData(); }; Promise.prototype._settledValue = function() { var bitField = this._bitField; if (((bitField & 33554432) !== 0)) { return this._rejectionHandler0; } else if (((bitField & 16777216) !== 0)) { return this._fulfillmentHandler0; } }; if (typeof Symbol !== "undefined" && Symbol.toStringTag) { es5.defineProperty(Promise.prototype, Symbol.toStringTag, { get: function () { return "Object"; } }); } function deferResolve(v) {this.promise._resolveCallback(v);} function deferReject(v) {this.promise._rejectCallback(v, false);} Promise.defer = Promise.pending = function() { debug.deprecated("Promise.defer", "new Promise"); var promise = new Promise(INTERNAL); return { promise: promise, resolve: deferResolve, reject: deferReject }; }; util.notEnumerableProp(Promise, "_makeSelfResolutionError", makeSelfResolutionError); __webpack_require__(41)(Promise, INTERNAL, tryConvertToPromise, apiRejection, debug); __webpack_require__(42)(Promise, INTERNAL, tryConvertToPromise, debug); __webpack_require__(43)(Promise, PromiseArray, apiRejection, debug); __webpack_require__(44)(Promise); __webpack_require__(45)(Promise); __webpack_require__(46)( Promise, PromiseArray, tryConvertToPromise, INTERNAL, async); Promise.Promise = Promise; Promise.version = "3.7.1"; __webpack_require__(47)(Promise); __webpack_require__(48)(Promise, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug); __webpack_require__(49)(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug); __webpack_require__(50)(Promise); __webpack_require__(51)(Promise, INTERNAL); __webpack_require__(52)(Promise, PromiseArray, tryConvertToPromise, apiRejection); __webpack_require__(53)(Promise, INTERNAL, tryConvertToPromise, apiRejection); __webpack_require__(54)(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug); __webpack_require__(55)(Promise, PromiseArray, debug); __webpack_require__(56)(Promise, PromiseArray, apiRejection); __webpack_require__(57)(Promise, INTERNAL, debug); __webpack_require__(58)(Promise, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug); __webpack_require__(59)(Promise); __webpack_require__(60)(Promise, INTERNAL); __webpack_require__(61)(Promise, INTERNAL); util.toFastProperties(Promise); util.toFastProperties(Promise.prototype); function fillTypes(value) { var p = new Promise(INTERNAL); p._fulfillmentHandler0 = value; p._rejectionHandler0 = value; p._promise0 = value; p._receiver0 = value; } // Complete slack tracking, opt out of field-type tracking and // stabilize map fillTypes({a: 1}); fillTypes({b: 2}); fillTypes({c: 3}); fillTypes(1); fillTypes(function(){}); fillTypes(undefined); fillTypes(false); fillTypes(new Promise(INTERNAL)); debug.setBounds(Async.firstLineError, util.lastLineError); return Promise; }; /***/ }), /* 27 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var es5 = __webpack_require__(28); var canEvaluate = typeof navigator == "undefined"; var errorObj = {e: {}}; var tryCatchTarget; var globalObject = typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : this !== undefined ? this : null; function tryCatcher() { try { var target = tryCatchTarget; tryCatchTarget = null; return target.apply(this, arguments); } catch (e) { errorObj.e = e; return errorObj; } } function tryCatch(fn) { tryCatchTarget = fn; return tryCatcher; } var inherits = function(Child, Parent) { var hasProp = {}.hasOwnProperty; function T() { this.constructor = Child; this.constructor$ = Parent; for (var propertyName in Parent.prototype) { if (hasProp.call(Parent.prototype, propertyName) && propertyName.charAt(propertyName.length-1) !== "$" ) { this[propertyName + "$"] = Parent.prototype[propertyName]; } } } T.prototype = Parent.prototype; Child.prototype = new T(); return Child.prototype; }; function isPrimitive(val) { return val == null || val === true || val === false || typeof val === "string" || typeof val === "number"; } function isObject(value) { return typeof value === "function" || typeof value === "object" && value !== null; } function maybeWrapAsError(maybeError) { if (!isPrimitive(maybeError)) return maybeError; return new Error(safeToString(maybeError)); } function withAppended(target, appendee) { var len = target.length; var ret = new Array(len + 1); var i; for (i = 0; i < len; ++i) { ret[i] = target[i]; } ret[i] = appendee; return ret; } function getDataPropertyOrDefault(obj, key, defaultValue) { if (es5.isES5) { var desc = Object.getOwnPropertyDescriptor(obj, key); if (desc != null) { return desc.get == null && desc.set == null ? desc.value : defaultValue; } } else { return {}.hasOwnProperty.call(obj, key) ? obj[key] : undefined; } } function notEnumerableProp(obj, name, value) { if (isPrimitive(obj)) return obj; var descriptor = { value: value, configurable: true, enumerable: false, writable: true }; es5.defineProperty(obj, name, descriptor); return obj; } function thrower(r) { throw r; } var inheritedDataKeys = (function() { var excludedPrototypes = [ Array.prototype, Object.prototype, Function.prototype ]; var isExcludedProto = function(val) { for (var i = 0; i < excludedPrototypes.length; ++i) { if (excludedPrototypes[i] === val) { return true; } } return false; }; if (es5.isES5) { var getKeys = Object.getOwnPropertyNames; return function(obj) { var ret = []; var visitedKeys = Object.create(null); while (obj != null && !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]) continue; visitedKeys[key] = true; var desc = Object.getOwnPropertyDescriptor(obj, key); if (desc != null && desc.get == null && desc.set == null) { ret.push(key); } } obj = es5.getPrototypeOf(obj); } return ret; }; } else { var hasProp = {}.hasOwnProperty; return function(obj) { if (isExcludedProto(obj)) return []; var ret = []; /*jshint forin:false */ 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; }; } })(); var thisAssignmentPattern = /this\s*\.\s*\S+\s*=/; function isClass(fn) { try { if (typeof fn === "function") { var keys = es5.names(fn.prototype); var hasMethods = es5.isES5 && keys.length > 1; var hasMethodsOtherThanConstructor = keys.length > 0 && !(keys.length === 1 && keys[0] === "constructor"); var hasThisAssignmentAndStaticMethods = thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0; if (hasMethods || hasMethodsOtherThanConstructor || hasThisAssignmentAndStaticMethods) { return true; } } return false; } catch (e) { return false; } } function toFastProperties(obj) { /*jshint -W027,-W055,-W031*/ function FakeConstructor() {} FakeConstructor.prototype = obj; var receiver = new FakeConstructor(); function ic() { return typeof receiver.foo; } ic(); ic(); return obj; eval(obj); } var rident = /^[a-z$_][a-z$_0-9]*$/i; function isIdentifier(str) { return rident.test(str); } function filledRange(count, prefix, suffix) { var ret = new Array(count); for(var i = 0; i < count; ++i) { ret[i] = prefix + i + suffix; } return ret; } function safeToString(obj) { try { return obj + ""; } catch (e) { return "[no string representation]"; } } function isError(obj) { return obj instanceof Error || (obj !== null && typeof obj === "object" && typeof obj.message === "string" && typeof obj.name === "string"); } function markAsOriginatingFromRejection(e) { try { notEnumerableProp(e, "isOperational", true); } catch(ignore) {} } function originatesFromRejection(e) { if (e == null) return false; return ((e instanceof Error["__BluebirdErrorTypes__"].OperationalError) || e["isOperational"] === true); } function canAttachTrace(obj) { return isError(obj) && es5.propertyIsWritable(obj, "stack"); } var ensureErrorObject = (function() { if (!("stack" in new Error())) { return function(value) { if (canAttachTrace(value)) return value; try {throw new Error(safeToString(value));} catch(err) {return err;} }; } else { return function(value) { if (canAttachTrace(value)) return value; return new Error(safeToString(value)); }; } })(); function classString(obj) { return {}.toString.call(obj); } function copyDescriptors(from, to, filter) { var keys = es5.names(from); for (var i = 0; i < keys.length; ++i) { var key = keys[i]; if (filter(key)) { try { es5.defineProperty(to, key, es5.getDescriptor(from, key)); } catch (ignore) {} } } } var asArray = function(v) { if (es5.isArray(v)) { return v; } return null; }; if (typeof Symbol !== "undefined" && Symbol.iterator) { var ArrayFrom = typeof Array.from === "function" ? function(v) { return Array.from(v); } : function(v) { var ret = []; var it = v[Symbol.iterator](); var itResult; while (!((itResult = it.next()).done)) { ret.push(itResult.value); } return ret; }; asArray = function(v) { if (es5.isArray(v)) { return v; } else if (v != null && typeof v[Symbol.iterator] === "function") { return ArrayFrom(v); } return null; }; } var isNode = typeof process !== "undefined" && classString(process).toLowerCase() === "[object process]"; var hasEnvVariables = typeof process !== "undefined" && typeof process.env !== "undefined"; function env(key) { return hasEnvVariables ? process.env[key] : undefined; } function getNativePromise() { if (typeof Promise === "function") { try { var promise = new Promise(function(){}); if (classString(promise) === "[object Promise]") { return Promise; } } catch (e) {} } } var reflectHandler; function contextBind(ctx, cb) { if (ctx === null || typeof cb !== "function" || cb === reflectHandler) { return cb; } if (ctx.domain !== null) { cb = ctx.domain.bind(cb); } var async = ctx.async; if (async !== null) { var old = cb; cb = function() { var $_len = arguments.length + 2;var args = new Array($_len); for(var $_i = 2; $_i < $_len ; ++$_i) {args[$_i] = arguments[$_i - 2];}; args[0] = old; args[1] = this; return async.runInAsyncScope.apply(async, args); }; } return cb; } var ret = { setReflectHandler: function(fn) { reflectHandler = fn; }, isClass: isClass, isIdentifier: isIdentifier, inheritedDataKeys: inheritedDataKeys, getDataPropertyOrDefault: getDataPropertyOrDefault, thrower: thrower, isArray: es5.isArray, asArray: asArray, notEnumerableProp: notEnumerableProp, isPrimitive: isPrimitive, isObject: isObject, isError: isError, canEvaluate: canEvaluate, errorObj: errorObj, tryCatch: tryCatch, inherits: inherits, withAppended: withAppended, maybeWrapAsError: maybeWrapAsError, toFastProperties: toFastProperties, filledRange: filledRange, toString: safeToString, canAttachTrace: canAttachTrace, ensureErrorObject: ensureErrorObject, originatesFromRejection: originatesFromRejection, markAsOriginatingFromRejection: markAsOriginatingFromRejection, classString: classString, copyDescriptors: copyDescriptors, isNode: isNode, hasEnvVariables: hasEnvVariables, env: env, global: globalObject, getNativePromise: getNativePromise, contextBind: contextBind }; ret.isRecentNode = ret.isNode && (function() { var version; if (process.versions && process.versions.node) { version = process.versions.node.split(".").map(Number); } else if (process.version) { version = process.version.split(".").map(Number); } return (version[0] === 0 && version[1] > 10) || (version[0] > 0); })(); ret.nodeSupportsAsyncResource = ret.isNode && (function() { var supportsAsync = false; try { var res = __webpack_require__(29).AsyncResource; supportsAsync = typeof res.prototype.runInAsyncScope === "function"; } catch (e) { supportsAsync = false; } return supportsAsync; })(); if (ret.isNode) ret.toFastProperties(process); try {throw new Error(); } catch (e) {ret.lastLineError = e;} module.exports = ret; /***/ }), /* 28 */ /***/ (function(module, exports) { var isES5 = (function(){ "use strict"; return this === undefined; })(); 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; var str = {}.toString; var proto = {}.constructor.prototype; var ObjectKeys = function (o) { var ret = []; for (var key in o) { if (has.call(o, key)) { ret.push(key); } } return ret; }; var ObjectGetDescriptor = function(o, key) { return {value: o[key]}; }; var ObjectDefineProperty = function (o, key, desc) { o[key] = desc.value; return o; }; var ObjectFreeze = function (obj) { return obj; }; var ObjectGetPrototypeOf = function (obj) { try { return Object(obj).constructor.prototype; } catch (e) { return proto; } }; var ArrayIsArray = function (obj) { try { return str.call(obj) === "[object Array]"; } catch(e) { return false; } }; module.exports = { isArray: ArrayIsArray, keys: ObjectKeys, names: ObjectKeys, defineProperty: ObjectDefineProperty, getDescriptor: ObjectGetDescriptor, freeze: ObjectFreeze, getPrototypeOf: ObjectGetPrototypeOf, isES5: isES5, propertyIsWritable: function() { return true; } }; } /***/ }), /* 29 */ /***/ (function(module, exports) { module.exports = require("async_hooks"); /***/ }), /* 30 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var firstLineError; try {throw new Error(); } catch (e) {firstLineError = e;} var schedule = __webpack_require__(31); var Queue = __webpack_require__(32); function Async() { this._customScheduler = false; this._isTickUsed = false; this._lateQueue = new Queue(16); this._normalQueue = new Queue(16); this._haveDrainedQueues = false; var self = this; this.drainQueues = function () { self._drainQueues(); }; this._schedule = schedule; } Async.prototype.setScheduler = function(fn) { var prev = this._schedule; this._schedule = fn; this._customScheduler = true; return prev; }; Async.prototype.hasCustomScheduler = function() { return this._customScheduler; }; Async.prototype.haveItemsQueued = function () { return this._isTickUsed || this._haveDrainedQueues; }; Async.prototype.fatalError = function(e, isNode) { if (isNode) { process.stderr.write("Fatal " + (e instanceof Error ? e.stack : e) + "\n"); process.exit(2); } else { this.throwLater(e); } }; Async.prototype.throwLater = function(fn, arg) { if (arguments.length === 1) { arg = fn; fn = function () { throw arg; }; } if (typeof setTimeout !== "undefined") { setTimeout(function() { fn(arg); }, 0); } else try { this._schedule(function() { fn(arg); }); } catch (e) { throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/MqrFmX\u000a"); } }; function AsyncInvokeLater(fn, receiver, arg) { this._lateQueue.push(fn, receiver, arg); this._queueTick(); } function AsyncInvoke(fn, receiver, arg) { this._normalQueue.push(fn, receiver, arg); this._queueTick(); } function AsyncSettlePromises(promise) { this._normalQueue._pushOne(promise); this._queueTick(); } Async.prototype.invokeLater = AsyncInvokeLater; Async.prototype.invoke = AsyncInvoke; Async.prototype.settlePromises = AsyncSettlePromises; function _drainQueue(queue) { while (queue.length() > 0) { _drainQueueStep(queue); } } function _drainQueueStep(queue) { var fn = queue.shift(); if (typeof fn !== "function") { fn._settlePromises(); } else { var receiver = queue.shift(); var arg = queue.shift(); fn.call(receiver, arg); } } Async.prototype._drainQueues = function () { _drainQueue(this._normalQueue); this._reset(); this._haveDrainedQueues = true; _drainQueue(this._lateQueue); }; Async.prototype._queueTick = function () { if (!this._isTickUsed) { this._isTickUsed = true; this._schedule(this.drainQueues); } }; Async.prototype._reset = function () { this._isTickUsed = false; }; module.exports = Async; module.exports.firstLineError = firstLineError; /***/ }), /* 31 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(27); var schedule; var noAsyncScheduler = function() { throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/MqrFmX\u000a"); }; var NativePromise = util.getNativePromise(); if (util.isNode && typeof MutationObserver === "undefined") { var GlobalSetImmediate = global.setImmediate; var ProcessNextTick = process.nextTick; schedule = util.isRecentNode ? function(fn) { GlobalSetImmediate.call(global, fn); } : function(fn) { ProcessNextTick.call(process, fn); }; } else if (typeof NativePromise === "function" && typeof NativePromise.resolve === "function") { var nativePromise = NativePromise.resolve(); schedule = function(fn) { nativePromise.then(fn); }; } else if ((typeof MutationObserver !== "undefined") && !(typeof window !== "undefined" && window.navigator && (window.navigator.standalone || window.cordova)) && ("classList" in document.documentElement)) { schedule = (function() { var div = document.createElement("div"); var opts = {attributes: true}; var toggleScheduled = false; var div2 = document.createElement("div"); var o2 = new MutationObserver(function() { div.classList.toggle("foo"); toggleScheduled = false; }); o2.observe(div2, opts); var scheduleToggle = function() { if (toggleScheduled) return; toggleScheduled = true; div2.classList.toggle("foo"); }; return function schedule(fn) { var o = new MutationObserver(function() { o.disconnect(); fn(); }); o.observe(div, opts); scheduleToggle(); }; })(); } else if (typeof setImmediate !== "undefined") { schedule = function (fn) { setImmediate(fn); }; } else if (typeof setTimeout !== "undefined") { schedule = function (fn) { setTimeout(fn, 0); }; } else { schedule = noAsyncScheduler; } module.exports = schedule; /***/ }), /* 32 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; function arrayMove(src, srcIndex, dst, dstIndex, len) { for (var j = 0; j < len; ++j) { dst[j + dstIndex] = src[j + srcIndex]; src[j + srcIndex] = void 0; } } function Queue(capacity) { this._capacity = capacity; this._length = 0; this._front = 0; } Queue.prototype._willBeOverCapacity = function (size) { return this._capacity < size; }; Queue.prototype._pushOne = function (arg) { var length = this.length(); this._checkCapacity(length + 1); var i = (this._front + length) & (this._capacity - 1); this[i] = arg; this._length = length + 1; }; Queue.prototype.push = function (fn, receiver, arg) { var length = this.length() + 3; if (this._willBeOverCapacity(length)) { this._pushOne(fn); this._pushOne(receiver); this._pushOne(arg); return; } var j = this._front + length - 3; this._checkCapacity(length); var wrapMask = this._capacity - 1; this[(j + 0) & wrapMask] = fn; this[(j + 1) & wrapMask] = receiver; this[(j + 2) & wrapMask] = arg; this._length = length; }; Queue.prototype.shift = function () { var front = this._front, ret = this[front]; this[front] = undefined; this._front = (front + 1) & (this._capacity - 1); this._length--; return ret; }; Queue.prototype.length = function () { return this._length; }; Queue.prototype._checkCapacity = function (size) { if (this._capacity < size) { this._resizeTo(this._capacity << 1); } }; Queue.prototype._resizeTo = function (capacity) { var oldCapacity = this._capacity; this._capacity = capacity; var front = this._front; var length = this._length; var moveItemsCount = (front + length) & (oldCapacity - 1); arrayMove(this, 0, this, oldCapacity, moveItemsCount); }; module.exports = Queue; /***/ }), /* 33 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var es5 = __webpack_require__(28); var Objectfreeze = es5.freeze; var util = __webpack_require__(27); var inherits = util.inherits; var notEnumerableProp = util.notEnumerableProp; function subError(nameProperty, defaultMessage) { function SubError(message) { if (!(this instanceof SubError)) return new SubError(message); notEnumerableProp(this, "message", typeof message === "string" ? message : defaultMessage); notEnumerableProp(this, "name", nameProperty); if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } else { Error.call(this); } } inherits(SubError, Error); return SubError; } var _TypeError, _RangeError; var Warning = subError("Warning", "warning"); var CancellationError = subError("CancellationError", "cancellation error"); var TimeoutError = subError("TimeoutError", "timeout error"); var AggregateError = subError("AggregateError", "aggregate error"); try { _TypeError = TypeError; _RangeError = RangeError; } catch(e) { _TypeError = subError("TypeError", "type error"); _RangeError = subError("RangeError", "range error"); } var methods = ("join pop push shift unshift slice filter forEach some " + "every map indexOf lastIndexOf reduce reduceRight sort reverse").split(" "); for (var i = 0; i < methods.length; ++i) { if (typeof Array.prototype[methods[i]] === "function") { AggregateError.prototype[methods[i]] = Array.prototype[methods[i]]; } } es5.defineProperty(AggregateError.prototype, "length", { value: 0, configurable: false, writable: true, enumerable: true }); AggregateError.prototype["isOperational"] = true; var level = 0; AggregateError.prototype.toString = function() { var indent = Array(level * 4 + 1).join(" "); var ret = "\n" + indent + "AggregateError of:" + "\n"; level++; indent = Array(level * 4 + 1).join(" "); for (var i = 0; i < this.length; ++i) { var str = this[i] === this ? "[Circular AggregateError]" : this[i] + ""; var lines = str.split("\n"); for (var j = 0; j < lines.length; ++j) { lines[j] = indent + lines[j]; } str = lines.join("\n"); ret += str + "\n"; } level--; return ret; }; function OperationalError(message) { if (!(this instanceof OperationalError)) return new OperationalError(message); notEnumerableProp(this, "name", "OperationalError"); notEnumerableProp(this, "message", message); this.cause = message; this["isOperational"] = true; if (message instanceof Error) { notEnumerableProp(this, "message", message.message); notEnumerableProp(this, "stack", message.stack); } else if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } } inherits(OperationalError, Error); var errorTypes = Error["__BluebirdErrorTypes__"]; if (!errorTypes) { errorTypes = Objectfreeze({ CancellationError: CancellationError, TimeoutError: TimeoutError, OperationalError: OperationalError, RejectionError: OperationalError, AggregateError: AggregateError }); es5.defineProperty(Error, "__BluebirdErrorTypes__", { value: errorTypes, writable: false, enumerable: false, configurable: false }); } module.exports = { Error: Error, TypeError: _TypeError, RangeError: _RangeError, CancellationError: errorTypes.CancellationError, OperationalError: errorTypes.OperationalError, TimeoutError: errorTypes.TimeoutError, AggregateError: errorTypes.AggregateError, Warning: Warning }; /***/ }), /* 34 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, INTERNAL) { var util = __webpack_require__(27); var errorObj = util.errorObj; var isObject = util.isObject; function tryConvertToPromise(obj, context) { if (isObject(obj)) { if (obj instanceof Promise) return obj; var then = getThen(obj); if (then === errorObj) { if (context) context._pushContext(); var ret = Promise.reject(then.e); if (context) context._popContext(); return ret; } else if (typeof then === "function") { if (isAnyBluebirdPromise(obj)) { var ret = new Promise(INTERNAL); obj._then( ret._fulfill, ret._reject, undefined, ret, null ); return ret; } return doThenable(obj, then, context); } } return obj; } function doGetThen(obj) { return obj.then; } function getThen(obj) { try { return doGetThen(obj); } catch (e) { errorObj.e = e; return errorObj; } } var hasProp = {}.hasOwnProperty; function isAnyBluebirdPromise(obj) { try { return hasProp.call(obj, "_promise0"); } catch (e) { return false; } } function doThenable(x, then, context) { var promise = new Promise(INTERNAL); var ret = promise; if (context) context._pushContext(); promise._captureStackTrace(); if (context) context._popContext(); var synchronous = true; var result = util.tryCatch(then).call(x, resolve, reject); synchronous = false; if (promise && result === errorObj) { promise._rejectCallback(result.e, true, true); promise = null; } function resolve(value) { if (!promise) return; promise._resolveCallback(value); promise = null; } function reject(reason) { if (!promise) return; promise._rejectCallback(reason, synchronous, true); promise = null; } return ret; } return tryConvertToPromise; }; /***/ }), /* 35 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, INTERNAL, tryConvertToPromise, apiRejection, Proxyable) { var util = __webpack_require__(27); var isArray = util.isArray; function toResolutionValue(val) { switch(val) { case -2: return []; case -3: return {}; case -6: return new Map(); } } function PromiseArray(values) { var promise = this._promise = new Promise(INTERNAL); if (values instanceof Promise) { promise._propagateFrom(values, 3); values.suppressUnhandledRejections(); } promise._setOnCancel(this); this._values = values; this._length = 0; this._totalResolved = 0; this._init(undefined, -2); } util.inherits(PromiseArray, Proxyable); PromiseArray.prototype.length = function () { return this._length; }; PromiseArray.prototype.promise = function () { return this._promise; }; PromiseArray.prototype._init = function init(_, resolveValueIfEmpty) { var values = tryConvertToPromise(this._values, this._promise); if (values instanceof Promise) { values = values._target(); var bitField = values._bitField; ; this._values = values; if (((bitField & 50397184) === 0)) { this._promise._setAsyncGuaranteed(); return values._then( init, this._reject, undefined, this, resolveValueIfEmpty ); } else if (((bitField & 33554432) !== 0)) { values = values._value(); } else if (((bitField & 16777216) !== 0)) { return this._reject(values._reason()); } else { return this._cancel(); } } values = util.asArray(values); if (values === null) { var err = apiRejection( "expecting an array or an iterable object but got " + util.classString(values)).reason(); this._promise._rejectCallback(err, false); return; } if (values.length === 0) { if (resolveValueIfEmpty === -5) { this._resolveEmptyArray(); } else { this._resolve(toResolutionValue(resolveValueIfEmpty)); } return; } this._iterate(values); }; PromiseArray.prototype._iterate = function(values) { var len = this.getActualLength(values.length); this._length = len; this._values = this.shouldCopyValues() ? new Array(len) : this._values; var result = this._promise; var isResolved = false; var bitField = null; for (var i = 0; i < len; ++i) { var maybePromise = tryConvertToPromise(values[i], result); if (maybePromise instanceof Promise) { maybePromise = maybePromise._target(); bitField = maybePromise._bitField; } else { bitField = null; } if (isResolved) { if (bitField !== null) { maybePromise.suppressUnhandledRejections(); } } else if (bitField !== null) { if (((bitField & 50397184) === 0)) { maybePromise._proxy(this, i); this._values[i] = maybePromise; } else if (((bitField & 33554432) !== 0)) { isResolved = this._promiseFulfilled(maybePromise._value(), i); } else if (((bitField & 16777216) !== 0)) { isResolved = this._promiseRejected(maybePromise._reason(), i); } else { isResolved = this._promiseCancelled(i); } } else { isResolved = this._promiseFulfilled(maybePromise, i); } } if (!isResolved) result._setAsyncGuaranteed(); }; PromiseArray.prototype._isResolved = function () { return this._values === null; }; PromiseArray.prototype._resolve = function (value) { this._values = null; this._promise._fulfill(value); }; PromiseArray.prototype._cancel = function() { if (this._isResolved() || !this._promise._isCancellable()) return; this._values = null; this._promise._cancel(); }; PromiseArray.prototype._reject = function (reason) { this._values = null; this._promise._rejectCallback(reason, false); }; PromiseArray.prototype._promiseFulfilled = function (value, index) { this._values[index] = value; var totalResolved = ++this._totalResolved; if (totalResolved >= this._length) { this._resolve(this._values); return true; } return false; }; PromiseArray.prototype._promiseCancelled = function() { this._cancel(); return true; }; PromiseArray.prototype._promiseRejected = function (reason) { this._totalResolved++; this._reject(reason); return true; }; PromiseArray.prototype._resultCancelled = function() { if (this._isResolved()) return; var values = this._values; this._cancel(); if (values instanceof Promise) { values.cancel(); } else { for (var i = 0; i < values.length; ++i) { if (values[i] instanceof Promise) { values[i].cancel(); } } } }; PromiseArray.prototype.shouldCopyValues = function () { return true; }; PromiseArray.prototype.getActualLength = function (len) { return len; }; return PromiseArray; }; /***/ }), /* 36 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise) { var longStackTraces = false; var contextStack = []; Promise.prototype._promiseCreated = function() {}; Promise.prototype._pushContext = function() {}; Promise.prototype._popContext = function() {return null;}; Promise._peekContext = Promise.prototype._peekContext = function() {}; function Context() { this._trace = new Context.CapturedTrace(peekContext()); } Context.prototype._pushContext = function () { if (this._trace !== undefined) { this._trace._promiseCreated = null; contextStack.push(this._trace); } }; Context.prototype._popContext = function () { if (this._trace !== undefined) { var trace = contextStack.pop(); var ret = trace._promiseCreated; trace._promiseCreated = null; return ret; } return null; }; function createContext() { if (longStackTraces) return new Context(); } function peekContext() { var lastIndex = contextStack.length - 1; if (lastIndex >= 0) { return contextStack[lastIndex]; } return undefined; } Context.CapturedTrace = null; Context.create = createContext; Context.deactivateLongStackTraces = function() {}; Context.activateLongStackTraces = function() { var Promise_pushContext = Promise.prototype._pushContext; var Promise_popContext = Promise.prototype._popContext; var Promise_PeekContext = Promise._peekContext; var Promise_peekContext = Promise.prototype._peekContext; var Promise_promiseCreated = Promise.prototype._promiseCreated; Context.deactivateLongStackTraces = function() { Promise.prototype._pushContext = Promise_pushContext; Promise.prototype._popContext = Promise_popContext; Promise._peekContext = Promise_PeekContext; Promise.prototype._peekContext = Promise_peekContext; Promise.prototype._promiseCreated = Promise_promiseCreated; longStackTraces = false; }; longStackTraces = true; Promise.prototype._pushContext = Context.prototype._pushContext; Promise.prototype._popContext = Context.prototype._popContext; Promise._peekContext = Promise.prototype._peekContext = peekContext; Promise.prototype._promiseCreated = function() { var ctx = this._peekContext(); if (ctx && ctx._promiseCreated == null) ctx._promiseCreated = this; }; }; return Context; }; /***/ }), /* 37 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, Context, enableAsyncHooks, disableAsyncHooks) { var async = Promise._async; var Warning = __webpack_require__(33).Warning; var util = __webpack_require__(27); var es5 = __webpack_require__(28); var canAttachTrace = util.canAttachTrace; var unhandledRejectionHandled; var possiblyUnhandledRejection; var bluebirdFramePattern = /[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/; var nodeFramePattern = /\((?:timers\.js):\d+:\d+\)/; var parseLinePattern = /[\/<\(](.+?):(\d+):(\d+)\)?\s*$/; var stackFramePattern = null; var formatStack = null; var indentStackFrames = false; var printWarning; var debugging = !!(util.env("BLUEBIRD_DEBUG") != 0 && ( false || util.env("BLUEBIRD_DEBUG") || util.env("NODE_ENV") === "development")); var warnings = !!(util.env("BLUEBIRD_WARNINGS") != 0 && (debugging || util.env("BLUEBIRD_WARNINGS"))); var longStackTraces = !!(util.env("BLUEBIRD_LONG_STACK_TRACES") != 0 && (debugging || util.env("BLUEBIRD_LONG_STACK_TRACES"))); var wForgottenReturn = util.env("BLUEBIRD_W_FORGOTTEN_RETURN") != 0 && (warnings || !!util.env("BLUEBIRD_W_FORGOTTEN_RETURN")); var deferUnhandledRejectionCheck; (function() { var promises = []; function unhandledRejectionCheck() { for (var i = 0; i < promises.length; ++i) { promises[i]._notifyUnhandledRejection(); } unhandledRejectionClear(); } function unhandledRejectionClear() { promises.length = 0; } if (typeof document === "object" && document.createElement) { deferUnhandledRejectionCheck = (function() { var iframeSetTimeout; function checkIframe() { if (document.body) { var iframe = document.createElement("iframe"); document.body.appendChild(iframe); if (iframe.contentWindow && iframe.contentWindow.setTimeout) { iframeSetTimeout = iframe.contentWindow.setTimeout; } document.body.removeChild(iframe); } } checkIframe(); return function(promise) { promises.push(promise); if (iframeSetTimeout) { iframeSetTimeout(unhandledRejectionCheck, 1); } else { checkIframe(); } }; })(); } else { deferUnhandledRejectionCheck = function(promise) { promises.push(promise); setTimeout(unhandledRejectionCheck, 1); }; } es5.defineProperty(Promise, "_unhandledRejectionCheck", { value: unhandledRejectionCheck }); es5.defineProperty(Promise, "_unhandledRejectionClear", { value: unhandledRejectionClear }); })(); Promise.prototype.suppressUnhandledRejections = function() { var target = this._target(); target._bitField = ((target._bitField & (~1048576)) | 524288); }; Promise.prototype._ensurePossibleRejectionHandled = function () { if ((this._bitField & 524288) !== 0) return; this._setRejectionIsUnhandled(); deferUnhandledRejectionCheck(this); }; Promise.prototype._notifyUnhandledRejectionIsHandled = function () { fireRejectionEvent("rejectionHandled", unhandledRejectionHandled, undefined, this); }; Promise.prototype._setReturnedNonUndefined = function() { this._bitField = this._bitField | 268435456; }; Promise.prototype._returnedNonUndefined = function() { return (this._bitField & 268435456) !== 0; }; Promise.prototype._notifyUnhandledRejection = function () { if (this._isRejectionUnhandled()) { var reason = this._settledValue(); this._setUnhandledRejectionIsNotified(); fireRejectionEvent("unhandledRejection", possiblyUnhandledRejection, reason, this); } }; Promise.prototype._setUnhandledRejectionIsNotified = function () { this._bitField = this._bitField | 262144; }; Promise.prototype._unsetUnhandledRejectionIsNotified = function () { this._bitField = this._bitField & (~262144); }; Promise.prototype._isUnhandledRejectionNotified = function () { return (this._bitField & 262144) > 0; }; Promise.prototype._setRejectionIsUnhandled = function () { this._bitField = this._bitField | 1048576; }; Promise.prototype._unsetRejectionIsUnhandled = function () { this._bitField = this._bitField & (~1048576); if (this._isUnhandledRejectionNotified()) { this._unsetUnhandledRejectionIsNotified(); this._notifyUnhandledRejectionIsHandled(); } }; Promise.prototype._isRejectionUnhandled = function () { return (this._bitField & 1048576) > 0; }; Promise.prototype._warn = function(message, shouldUseOwnTrace, promise) { return warn(message, shouldUseOwnTrace, promise || this); }; Promise.onPossiblyUnhandledRejection = function (fn) { var context = Promise._getContext(); possiblyUnhandledRejection = util.contextBind(context, fn); }; Promise.onUnhandledRejectionHandled = function (fn) { var context = Promise._getContext(); unhandledRejectionHandled = util.contextBind(context, fn); }; var disableLongStackTraces = function() {}; Promise.longStackTraces = function () { if (async.haveItemsQueued() && !config.longStackTraces) { throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/MqrFmX\u000a"); } if (!config.longStackTraces && longStackTracesIsSupported()) { var Promise_captureStackTrace = Promise.prototype._captureStackTrace; var Promise_attachExtraTrace = Promise.prototype._attachExtraTrace; var Promise_dereferenceTrace = Promise.prototype._dereferenceTrace; config.longStackTraces = true; disableLongStackTraces = function() { if (async.haveItemsQueued() && !config.longStackTraces) { throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/MqrFmX\u000a"); } Promise.prototype._captureStackTrace = Promise_captureStackTrace; Promise.prototype._attachExtraTrace = Promise_attachExtraTrace; Promise.prototype._dereferenceTrace = Promise_dereferenceTrace; Context.deactivateLongStackTraces(); config.longStackTraces = false; }; Promise.prototype._captureStackTrace = longStackTracesCaptureStackTrace; Promise.prototype._attachExtraTrace = longStackTracesAttachExtraTrace; Promise.prototype._dereferenceTrace = longStackTracesDereferenceTrace; Context.activateLongStackTraces(); } }; Promise.hasLongStackTraces = function () { return config.longStackTraces && longStackTracesIsSupported(); }; var legacyHandlers = { unhandledrejection: { before: function() { var ret = util.global.onunhandledrejection; util.global.onunhandledrejection = null; return ret; }, after: function(fn) { util.global.onunhandledrejection = fn; } }, rejectionhandled: { before: function() { var ret = util.global.onrejectionhandled; util.global.onrejectionhandled = null; return ret; }, after: function(fn) { util.global.onrejectionhandled = fn; } } }; var fireDomEvent = (function() { var dispatch = function(legacy, e) { if (legacy) { var fn; try { fn = legacy.before(); return !util.global.dispatchEvent(e); } finally { legacy.after(fn); } } else { return !util.global.dispatchEvent(e); } }; try { if (typeof CustomEvent === "function") { var event = new CustomEvent("CustomEvent"); util.global.dispatchEvent(event); return function(name, event) { name = name.toLowerCase(); var eventData = { detail: event, cancelable: true }; var domEvent = new CustomEvent(name, eventData); es5.defineProperty( domEvent, "promise", {value: event.promise}); es5.defineProperty( domEvent, "reason", {value: event.reason}); return dispatch(legacyHandlers[name], domEvent); }; } else if (typeof Event === "function") { var event = new Event("CustomEvent"); util.global.dispatchEvent(event); return function(name, event) { name = name.toLowerCase(); var domEvent = new Event(name, { cancelable: true }); domEvent.detail = event; es5.defineProperty(domEvent, "promise", {value: event.promise}); es5.defineProperty(domEvent, "reason", {value: event.reason}); return dispatch(legacyHandlers[name], domEvent); }; } else { var event = document.createEvent("CustomEvent"); event.initCustomEvent("testingtheevent", false, true, {}); util.global.dispatchEvent(event); return function(name, event) { name = name.toLowerCase(); var domEvent = document.createEvent("CustomEvent"); domEvent.initCustomEvent(name, false, true, event); return dispatch(legacyHandlers[name], domEvent); }; } } catch (e) {} return function() { return false; }; })(); var fireGlobalEvent = (function() { if (util.isNode) { return function() { return process.emit.apply(process, arguments); }; } else { if (!util.global) { return function() { return false; }; } return function(name) { var methodName = "on" + name.toLowerCase(); var method = util.global[methodName]; if (!method) return false; method.apply(util.global, [].slice.call(arguments, 1)); return true; }; } })(); function generatePromiseLifecycleEventObject(name, promise) { return {promise: promise}; } var eventToObjectGenerator = { promiseCreated: generatePromiseLifecycleEventObject, promiseFulfilled: generatePromiseLifecycleEventObject, promiseRejected: generatePromiseLifecycleEventObject, promiseResolved: generatePromiseLifecycleEventObject, promiseCancelled: generatePromiseLifecycleEventObject, promiseChained: function(name, promise, child) { return {promise: promise, child: child}; }, warning: function(name, warning) { return {warning: warning}; }, unhandledRejection: function (name, reason, promise) { return {reason: reason, promise: promise}; }, rejectionHandled: generatePromiseLifecycleEventObject }; var activeFireEvent = function (name) { var globalEventFired = false; try { globalEventFired = fireGlobalEvent.apply(null, arguments); } catch (e) { async.throwLater(e); globalEventFired = true; } var domEventFired = false; try { domEventFired = fireDomEvent(name, eventToObjectGenerator[name].apply(null, arguments)); } catch (e) { async.throwLater(e); domEventFired = true; } return domEventFired || globalEventFired; }; Promise.config = function(opts) { opts = Object(opts); if ("longStackTraces" in opts) { if (opts.longStackTraces) { Promise.longStackTraces(); } else if (!opts.longStackTraces && Promise.hasLongStackTraces()) { disableLongStackTraces(); } } if ("warnings" in opts) { var warningsOption = opts.warnings; config.warnings = !!warningsOption; wForgottenReturn = config.warnings; if (util.isObject(warningsOption)) { if ("wForgottenReturn" in warningsOption) { wForgottenReturn = !!warningsOption.wForgottenReturn; } } } if ("cancellation" in opts && opts.cancellation && !config.cancellation) { if (async.haveItemsQueued()) { throw new Error( "cannot enable cancellation after promises are in use"); } Promise.prototype._clearCancellationData = cancellationClearCancellationData; Promise.prototype._propagateFrom = cancellationPropagateFrom; Promise.prototype._onCancel = cancellationOnCancel; Promise.prototype._setOnCancel = cancellationSetOnCancel; Promise.prototype._attachCancellationCallback = cancellationAttachCancellationCallback; Promise.prototype._execute = cancellationExecute; propagateFromFunction = cancellationPropagateFrom; config.cancellation = true; } if ("monitoring" in opts) { if (opts.monitoring && !config.monitoring) { config.monitoring = true; Promise.prototype._fireEvent = activeFireEvent; } else if (!opts.monitoring && config.monitoring) { config.monitoring = false; Promise.prototype._fireEvent = defaultFireEvent; } } if ("asyncHooks" in opts && util.nodeSupportsAsyncResource) { var prev = config.asyncHooks; var cur = !!opts.asyncHooks; if (prev !== cur) { config.asyncHooks = cur; if (cur) { enableAsyncHooks(); } else { disableAsyncHooks(); } } } return Promise; }; function defaultFireEvent() { return false; } Promise.prototype._fireEvent = defaultFireEvent; Promise.prototype._execute = function(executor, resolve, reject) { try { executor(resolve, reject); } catch (e) { return e; } }; Promise.prototype._onCancel = function () {}; Promise.prototype._setOnCancel = function (handler) { ; }; Promise.prototype._attachCancellationCallback = function(onCancel) { ; }; Promise.prototype._captureStackTrace = function () {}; Promise.prototype._attachExtraTrace = function () {}; Promise.prototype._dereferenceTrace = function () {}; Promise.prototype._clearCancellationData = function() {}; Promise.prototype._propagateFrom = function (parent, flags) { ; ; }; function cancellationExecute(executor, resolve, reject) { var promise = this; try { executor(resolve, reject, function(onCancel) { if (typeof onCancel !== "function") { throw new TypeError("onCancel must be a function, got: " + util.toString(onCancel)); } promise._attachCancellationCallback(onCancel); }); } catch (e) { return e; } } function cancellationAttachCancellationCallback(onCancel) { if (!this._isCancellable()) return this; var previousOnCancel = this._onCancel(); if (previousOnCancel !== undefined) { if (util.isArray(previousOnCancel)) { previousOnCancel.push(onCancel); } else { this._setOnCancel([previousOnCancel, onCancel]); } } else { this._setOnCancel(onCancel); } } function cancellationOnCancel() { return this._onCancelField; } function cancellationSetOnCancel(onCancel) { this._onCancelField = onCancel; } function cancellationClearCancellationData() { this._cancellationParent = undefined; this._onCancelField = undefined; } function cancellationPropagateFrom(parent, flags) { if ((flags & 1) !== 0) { this._cancellationParent = parent; var branchesRemainingToCancel = parent._branchesRemainingToCancel; if (branchesRemainingToCancel === undefined) { branchesRemainingToCancel = 0; } parent._branchesRemainingToCancel = branchesRemainingToCancel + 1; } if ((flags & 2) !== 0 && parent._isBound()) { this._setBoundTo(parent._boundTo); } } function bindingPropagateFrom(parent, flags) { if ((flags & 2) !== 0 && parent._isBound()) { this._setBoundTo(parent._boundTo); } } var propagateFromFunction = bindingPropagateFrom; function boundValueFunction() { var ret = this._boundTo; if (ret !== undefined) { if (ret instanceof Promise) { if (ret.isFulfilled()) { return ret.value(); } else { return undefined; } } } return ret; } function longStackTracesCaptureStackTrace() { this._trace = new CapturedTrace(this._peekContext()); } function longStackTracesAttachExtraTrace(error, ignoreSelf) { if (canAttachTrace(error)) { var trace = this._trace; if (trace !== undefined) { if (ignoreSelf) trace = trace._parent; } if (trace !== undefined) { trace.attachExtraTrace(error); } else if (!error.__stackCleaned__) { var parsed = parseStackAndMessage(error); util.notEnumerableProp(error, "stack", parsed.message + "\n" + parsed.stack.join("\n")); util.notEnumerableProp(error, "__stackCleaned__", true); } } } function longStackTracesDereferenceTrace() { this._trace = undefined; } function checkForgottenReturns(returnValue, promiseCreated, name, promise, parent) { if (returnValue === undefined && promiseCreated !== null && wForgottenReturn) { if (parent !== undefined && parent._returnedNonUndefined()) return; if ((promise._bitField & 65535) === 0) return; if (name) name = name + " "; var handlerLine = ""; var creatorLine = ""; if (promiseCreated._trace) { var traceLines = promiseCreated._trace.stack.split("\n"); var stack = cleanStack(traceLines); for (var i = stack.length - 1; i >= 0; --i) { var line = stack[i]; if (!nodeFramePattern.test(line)) { var lineMatches = line.match(parseLinePattern); if (lineMatches) { handlerLine = "at " + lineMatches[1] + ":" + lineMatches[2] + ":" + lineMatches[3] + " "; } break; } } if (stack.length > 0) { var firstUserLine = stack[0]; for (var i = 0; i < traceLines.length; ++i) { if (traceLines[i] === firstUserLine) { if (i > 0) { creatorLine = "\n" + traceLines[i - 1]; } break; } } } } var msg = "a promise was created in a " + name + "handler " + handlerLine + "but was not returned from it, " + "see http://goo.gl/rRqMUw" + creatorLine; promise._warn(msg, true, promiseCreated); } } function deprecated(name, replacement) { var message = name + " is deprecated and will be removed in a future version."; if (replacement) message += " Use " + replacement + " instead."; return warn(message); } function warn(message, shouldUseOwnTrace, promise) { if (!config.warnings) return; var warning = new Warning(message); var ctx; if (shouldUseOwnTrace) { promise._attachExtraTrace(warning); } else if (config.longStackTraces && (ctx = Promise._peekContext())) { ctx.attachExtraTrace(warning); } else { var parsed = parseStackAndMessage(warning); warning.stack = parsed.message + "\n" + parsed.stack.join("\n"); } if (!activeFireEvent("warning", warning)) { formatAndLogError(warning, "", true); } } function reconstructStack(message, stacks) { for (var i = 0; i < stacks.length - 1; ++i) { stacks[i].push("From previous event:"); stacks[i] = stacks[i].join("\n"); } if (i < stacks.length) { stacks[i] = stacks[i].join("\n"); } return message + "\n" + stacks.join("\n"); } function removeDuplicateOrEmptyJumps(stacks) { for (var i = 0; i < stacks.length; ++i) { if (stacks[i].length === 0 || ((i + 1 < stacks.length) && stacks[i][0] === stacks[i+1][0])) { stacks.splice(i, 1); i--; } } } function removeCommonRoots(stacks) { var current = stacks[0]; for (var i = 1; i < stacks.length; ++i) { var prev = stacks[i]; var currentLastIndex = current.length - 1; var currentLastLine = current[currentLastIndex]; var commonRootMeetPoint = -1; for (var j = prev.length - 1; j >= 0; --j) { if (prev[j] === currentLastLine) { commonRootMeetPoint = j; break; } } for (var j = commonRootMeetPoint; j >= 0; --j) { var line = prev[j]; if (current[currentLastIndex] === line) { current.pop(); currentLastIndex--; } else { break; } } current = prev; } } function cleanStack(stack) { var ret = []; for (var i = 0; i < stack.length; ++i) { var line = stack[i]; var isTraceLine = " (No stack trace)" === line || stackFramePattern.test(line); var isInternalFrame = isTraceLine && shouldIgnore(line); if (isTraceLine && !isInternalFrame) { if (indentStackFrames && line.charAt(0) !== " ") { line = " " + line; } ret.push(line); } } return ret; } function stackFramesAsArray(error) { var stack = error.stack.replace(/\s+$/g, "").split("\n"); for (var i = 0; i < stack.length; ++i) { var line = stack[i]; if (" (No stack trace)" === line || stackFramePattern.test(line)) { break; } } if (i > 0 && error.name != "SyntaxError") { stack = stack.slice(i); } return stack; } function parseStackAndMessage(error) { var stack = error.stack; var message = error.toString(); stack = typeof stack === "string" && stack.length > 0 ? stackFramesAsArray(error) : [" (No stack trace)"]; return { message: message, stack: error.name == "SyntaxError" ? stack : cleanStack(stack) }; } function formatAndLogError(error, title, isSoft) { if (typeof console !== "undefined") { var message; if (util.isObject(error)) { var stack = error.stack; message = title + formatStack(stack, error); } else { message = title + String(error); } if (typeof printWarning === "function") { printWarning(message, isSoft); } else if (typeof console.log === "function" || typeof console.log === "object") { console.log(message); } } } function fireRejectionEvent(name, localHandler, reason, promise) { var localEventFired = false; try { if (typeof localHandler === "function") { localEventFired = true; if (name === "rejectionHandled") { localHandler(promise); } else { localHandler(reason, promise); } } } catch (e) { async.throwLater(e); } if (name === "unhandledRejection") { if (!activeFireEvent(name, reason, promise) && !localEventFired) { formatAndLogError(reason, "Unhandled rejection "); } } else { activeFireEvent(name, promise); } } function formatNonError(obj) { var str; if (typeof obj === "function") { str = "[function " + (obj.name || "anonymous") + "]"; } else { str = obj && typeof obj.toString === "function" ? obj.toString() : util.toString(obj); var ruselessToString = /\[object [a-zA-Z0-9$_]+\]/; if (ruselessToString.test(str)) { try { var newStr = JSON.stringify(obj); str = newStr; } catch(e) { } } if (str.length === 0) { str = "(empty array)"; } } return ("(<" + snip(str) + ">, no stack trace)"); } function snip(str) { var maxChars = 41; if (str.length < maxChars) { return str; } return str.substr(0, maxChars - 3) + "..."; } function longStackTracesIsSupported() { return typeof captureStackTrace === "function"; } var shouldIgnore = function() { return false; }; var parseLineInfoRegex = /[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/; function parseLineInfo(line) { var matches = line.match(parseLineInfoRegex); if (matches) { return { fileName: matches[1], line: parseInt(matches[2], 10) }; } } function setBounds(firstLineError, lastLineError) { if (!longStackTracesIsSupported()) return; var firstStackLines = (firstLineError.stack || "").split("\n"); var lastStackLines = (lastLineError.stack || "").split("\n"); var firstIndex = -1; var lastIndex = -1; var firstFileName; var lastFileName; for (var i = 0; i < firstStackLines.length; ++i) { var result = parseLineInfo(firstStackLines[i]); if (result) { firstFileName = result.fileName; firstIndex = result.line; break; } } for (var i = 0; i < lastStackLines.length; ++i) { var result = parseLineInfo(lastStackLines[i]); if (result) { lastFileName = result.fileName; lastIndex = result.line; break; } } if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName || firstFileName !== lastFileName || firstIndex >= lastIndex) { return; } shouldIgnore = function(line) { if (bluebirdFramePattern.test(line)) return true; var info = parseLineInfo(line); if (info) { if (info.fileName === firstFileName && (firstIndex <= info.line && info.line <= lastIndex)) { return true; } } return false; }; } function CapturedTrace(parent) { this._parent = parent; this._promisesCreated = 0; var length = this._length = 1 + (parent === undefined ? 0 : parent._length); captureStackTrace(this, CapturedTrace); if (length > 32) this.uncycle(); } util.inherits(CapturedTrace, Error); Context.CapturedTrace = CapturedTrace; CapturedTrace.prototype.uncycle = function() { var length = this._length; if (length < 2) return; var nodes = []; var stackToIndex = {}; for (var i = 0, node = this; node !== undefined; ++i) { nodes.push(node); node = node._parent; } length = this._length = i; for (var i = length - 1; i >= 0; --i) { var stack = nodes[i].stack; if (stackToIndex[stack] === undefined) { stackToIndex[stack] = i; } } for (var i = 0; i < length; ++i) { var currentStack = nodes[i].stack; var index = stackToIndex[currentStack]; if (index !== undefined && index !== i) { if (index > 0) { nodes[index - 1]._parent = undefined; nodes[index - 1]._length = 1; } nodes[i]._parent = undefined; nodes[i]._length = 1; var cycleEdgeNode = i > 0 ? nodes[i - 1] : this; if (index < length - 1) { cycleEdgeNode._parent = nodes[index + 1]; cycleEdgeNode._parent.uncycle(); cycleEdgeNode._length = cycleEdgeNode._parent._length + 1; } else { cycleEdgeNode._parent = undefined; cycleEdgeNode._length = 1; } var currentChildLength = cycleEdgeNode._length + 1; for (var j = i - 2; j >= 0; --j) { nodes[j]._length = currentChildLength; currentChildLength++; } return; } } }; CapturedTrace.prototype.attachExtraTrace = function(error) { if (error.__stackCleaned__) return; this.uncycle(); var parsed = parseStackAndMessage(error); var message = parsed.message; var stacks = [parsed.stack]; var trace = this; while (trace !== undefined) { stacks.push(cleanStack(trace.stack.split("\n"))); trace = trace._parent; } removeCommonRoots(stacks); removeDuplicateOrEmptyJumps(stacks); util.notEnumerableProp(error, "stack", reconstructStack(message, stacks)); util.notEnumerableProp(error, "__stackCleaned__", true); }; var captureStackTrace = (function stackDetection() { var v8stackFramePattern = /^\s*at\s*/; var v8stackFormatter = function(stack, error) { if (typeof stack === "string") return stack; if (error.name !== undefined && error.message !== undefined) { return error.toString(); } return formatNonError(error); }; if (typeof Error.stackTraceLimit === "number" && typeof Error.captureStackTrace === "function") { Error.stackTraceLimit += 6; stackFramePattern = v8stackFramePattern; formatStack = v8stackFormatter; var captureStackTrace = Error.captureStackTrace; shouldIgnore = function(line) { return bluebirdFramePattern.test(line); }; return function(receiver, ignoreUntil) { Error.stackTraceLimit += 6; captureStackTrace(receiver, ignoreUntil); Error.stackTraceLimit -= 6; }; } var err = new Error(); if (typeof err.stack === "string" && err.stack.split("\n")[0].indexOf("stackDetection@") >= 0) { stackFramePattern = /@/; formatStack = v8stackFormatter; indentStackFrames = true; return function captureStackTrace(o) { o.stack = new Error().stack; }; } var hasStackAfterThrow; try { throw new Error(); } catch(e) { hasStackAfterThrow = ("stack" in e); } if (!("stack" in err) && hasStackAfterThrow && typeof Error.stackTraceLimit === "number") { stackFramePattern = v8stackFramePattern; formatStack = v8stackFormatter; return function captureStackTrace(o) { Error.stackTraceLimit += 6; try { throw new Error(); } catch(e) { o.stack = e.stack; } Error.stackTraceLimit -= 6; }; } formatStack = function(stack, error) { if (typeof stack === "string") return stack; if ((typeof error === "object" || typeof error === "function") && error.name !== undefined && error.message !== undefined) { return error.toString(); } return formatNonError(error); }; return null; })([]); if (typeof console !== "undefined" && typeof console.warn !== "undefined") { printWarning = function (message) { console.warn(message); }; if (util.isNode && process.stderr.isTTY) { printWarning = function(message, isSoft) { var color = isSoft ? "\u001b[33m" : "\u001b[31m"; console.warn(color + message + "\u001b[0m\n"); }; } else if (!util.isNode && typeof (new Error().stack) === "string") { printWarning = function(message, isSoft) { console.warn("%c" + message, isSoft ? "color: darkorange" : "color: red"); }; } } var config = { warnings: warnings, longStackTraces: false, cancellation: false, monitoring: false, asyncHooks: false }; if (longStackTraces) Promise.longStackTraces(); return { asyncHooks: function() { return config.asyncHooks; }, longStackTraces: function() { return config.longStackTraces; }, warnings: function() { return config.warnings; }, cancellation: function() { return config.cancellation; }, monitoring: function() { return config.monitoring; }, propagateFromFunction: function() { return propagateFromFunction; }, boundValueFunction: function() { return boundValueFunction; }, checkForgottenReturns: checkForgottenReturns, setBounds: setBounds, warn: warn, deprecated: deprecated, CapturedTrace: CapturedTrace, fireDomEvent: fireDomEvent, fireGlobalEvent: fireGlobalEvent }; }; /***/ }), /* 38 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, tryConvertToPromise, NEXT_FILTER) { var util = __webpack_require__(27); var CancellationError = Promise.CancellationError; var errorObj = util.errorObj; var catchFilter = __webpack_require__(39)(NEXT_FILTER); function PassThroughHandlerContext(promise, type, handler) { this.promise = promise; this.type = type; this.handler = handler; this.called = false; this.cancelPromise = null; } PassThroughHandlerContext.prototype.isFinallyHandler = function() { return this.type === 0; }; function FinallyHandlerCancelReaction(finallyHandler) { this.finallyHandler = finallyHandler; } FinallyHandlerCancelReaction.prototype._resultCancelled = function() { checkCancel(this.finallyHandler); }; function checkCancel(ctx, reason) { if (ctx.cancelPromise != null) { if (arguments.length > 1) { ctx.cancelPromise._reject(reason); } else { ctx.cancelPromise._cancel(); } ctx.cancelPromise = null; return true; } return false; } function succeed() { return finallyHandler.call(this, this.promise._target()._settledValue()); } function fail(reason) { if (checkCancel(this, reason)) return; errorObj.e = reason; return errorObj; } function finallyHandler(reasonOrValue) { var promise = this.promise; var handler = this.handler; if (!this.called) { this.called = true; var ret = this.isFinallyHandler() ? handler.call(promise._boundValue()) : handler.call(promise._boundValue(), reasonOrValue); if (ret === NEXT_FILTER) { return ret; } else if (ret !== undefined) { promise._setReturnedNonUndefined(); var maybePromise = tryConvertToPromise(ret, promise); if (maybePromise instanceof Promise) { if (this.cancelPromise != null) { if (maybePromise._isCancelled()) { var reason = new CancellationError("late cancellation observer"); promise._attachExtraTrace(reason); errorObj.e = reason; return errorObj; } else if (maybePromise.isPending()) { maybePromise._attachCancellationCallback( new FinallyHandlerCancelReaction(this)); } } return maybePromise._then( succeed, fail, undefined, this, undefined); } } } if (promise.isRejected()) { checkCancel(this); errorObj.e = reasonOrValue; return errorObj; } else { checkCancel(this); return reasonOrValue; } } Promise.prototype._passThrough = function(handler, type, success, fail) { if (typeof handler !== "function") return this.then(); return this._then(success, fail, undefined, new PassThroughHandlerContext(this, type, handler), undefined); }; Promise.prototype.lastly = Promise.prototype["finally"] = function (handler) { return this._passThrough(handler, 0, finallyHandler, finallyHandler); }; Promise.prototype.tap = function (handler) { return this._passThrough(handler, 1, finallyHandler); }; Promise.prototype.tapCatch = function (handlerOrPredicate) { var len = arguments.length; if(len === 1) { return this._passThrough(handlerOrPredicate, 1, undefined, finallyHandler); } else { var catchInstances = new Array(len - 1), j = 0, i; for (i = 0; i < len - 1; ++i) { var item = arguments[i]; if (util.isObject(item)) { catchInstances[j++] = item; } else { return Promise.reject(new TypeError( "tapCatch statement predicate: " + "expecting an object but got " + util.classString(item) )); } } catchInstances.length = j; var handler = arguments[i]; return this._passThrough(catchFilter(catchInstances, handler, this), 1, undefined, finallyHandler); } }; return PassThroughHandlerContext; }; /***/ }), /* 39 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function(NEXT_FILTER) { var util = __webpack_require__(27); var getKeys = __webpack_require__(28).keys; var tryCatch = util.tryCatch; var errorObj = util.errorObj; function catchFilter(instances, cb, promise) { return function(e) { var boundTo = promise._boundValue(); predicateLoop: for (var i = 0; i < instances.length; ++i) { var item = instances[i]; if (item === Error || (item != null && item.prototype instanceof Error)) { if (e instanceof item) { return tryCatch(cb).call(boundTo, e); } } else if (typeof item === "function") { var matchesPredicate = tryCatch(item).call(boundTo, e); if (matchesPredicate === errorObj) { return matchesPredicate; } else if (matchesPredicate) { return tryCatch(cb).call(boundTo, e); } } else if (util.isObject(e)) { var keys = getKeys(item); for (var j = 0; j < keys.length; ++j) { var key = keys[j]; if (item[key] != e[key]) { continue predicateLoop; } } return tryCatch(cb).call(boundTo, e); } } return NEXT_FILTER; }; } return catchFilter; }; /***/ }), /* 40 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(27); var maybeWrapAsError = util.maybeWrapAsError; var errors = __webpack_require__(33); var OperationalError = errors.OperationalError; var es5 = __webpack_require__(28); function isUntypedError(obj) { return obj instanceof Error && es5.getPrototypeOf(obj) === Error.prototype; } var rErrorKey = /^(?:name|message|stack|cause)$/; function wrapAsOperationalError(obj) { var ret; if (isUntypedError(obj)) { ret = new OperationalError(obj); ret.name = obj.name; ret.message = obj.message; ret.stack = obj.stack; var keys = es5.keys(obj); for (var i = 0; i < keys.length; ++i) { var key = keys[i]; if (!rErrorKey.test(key)) { ret[key] = obj[key]; } } return ret; } util.markAsOriginatingFromRejection(obj); return obj; } function nodebackForPromise(promise, multiArgs) { return function(err, value) { if (promise === null) return; if (err) { var wrapped = wrapAsOperationalError(maybeWrapAsError(err)); promise._attachExtraTrace(wrapped); promise._reject(wrapped); } else if (!multiArgs) { promise._fulfill(value); } else { var $_len = arguments.length;var args = new Array(Math.max($_len - 1, 0)); for(var $_i = 1; $_i < $_len; ++$_i) {args[$_i - 1] = arguments[$_i];}; promise._fulfill(args); } promise = null; }; } module.exports = nodebackForPromise; /***/ }), /* 41 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, INTERNAL, tryConvertToPromise, apiRejection, debug) { var util = __webpack_require__(27); var tryCatch = util.tryCatch; Promise.method = function (fn) { if (typeof fn !== "function") { throw new Promise.TypeError("expecting a function but got " + util.classString(fn)); } return function () { var ret = new Promise(INTERNAL); ret._captureStackTrace(); ret._pushContext(); var value = tryCatch(fn).apply(this, arguments); var promiseCreated = ret._popContext(); debug.checkForgottenReturns( value, promiseCreated, "Promise.method", ret); ret._resolveFromSyncValue(value); return ret; }; }; Promise.attempt = Promise["try"] = function (fn) { if (typeof fn !== "function") { return apiRejection("expecting a function but got " + util.classString(fn)); } var ret = new Promise(INTERNAL); ret._captureStackTrace(); ret._pushContext(); var value; if (arguments.length > 1) { debug.deprecated("calling Promise.try with more than 1 argument"); var arg = arguments[1]; var ctx = arguments[2]; value = util.isArray(arg) ? tryCatch(fn).apply(ctx, arg) : tryCatch(fn).call(ctx, arg); } else { value = tryCatch(fn)(); } var promiseCreated = ret._popContext(); debug.checkForgottenReturns( value, promiseCreated, "Promise.try", ret); ret._resolveFromSyncValue(value); return ret; }; Promise.prototype._resolveFromSyncValue = function (value) { if (value === util.errorObj) { this._rejectCallback(value.e, false); } else { this._resolveCallback(value, true); } }; }; /***/ }), /* 42 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, INTERNAL, tryConvertToPromise, debug) { var calledBind = false; var rejectThis = function(_, e) { this._reject(e); }; var targetRejected = function(e, context) { context.promiseRejectionQueued = true; context.bindingPromise._then(rejectThis, rejectThis, null, this, e); }; var bindingResolved = function(thisArg, context) { if (((this._bitField & 50397184) === 0)) { this._resolveCallback(context.target); } }; var bindingRejected = function(e, context) { if (!context.promiseRejectionQueued) this._reject(e); }; Promise.prototype.bind = function (thisArg) { if (!calledBind) { calledBind = true; Promise.prototype._propagateFrom = debug.propagateFromFunction(); Promise.prototype._boundValue = debug.boundValueFunction(); } var maybePromise = tryConvertToPromise(thisArg); var ret = new Promise(INTERNAL); ret._propagateFrom(this, 1); var target = this._target(); ret._setBoundTo(maybePromise); if (maybePromise instanceof Promise) { var context = { promiseRejectionQueued: false, promise: ret, target: target, bindingPromise: maybePromise }; target._then(INTERNAL, targetRejected, undefined, ret, context); maybePromise._then( bindingResolved, bindingRejected, undefined, ret, context); ret._setOnCancel(maybePromise); } else { ret._resolveCallback(target); } return ret; }; Promise.prototype._setBoundTo = function (obj) { if (obj !== undefined) { this._bitField = this._bitField | 2097152; this._boundTo = obj; } else { this._bitField = this._bitField & (~2097152); } }; Promise.prototype._isBound = function () { return (this._bitField & 2097152) === 2097152; }; Promise.bind = function (thisArg, value) { return Promise.resolve(value).bind(thisArg); }; }; /***/ }), /* 43 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, PromiseArray, apiRejection, debug) { var util = __webpack_require__(27); var tryCatch = util.tryCatch; var errorObj = util.errorObj; var async = Promise._async; Promise.prototype["break"] = Promise.prototype.cancel = function() { if (!debug.cancellation()) return this._warn("cancellation is disabled"); var promise = this; var child = promise; while (promise._isCancellable()) { if (!promise._cancelBy(child)) { if (child._isFollowing()) { child._followee().cancel(); } else { child._cancelBranched(); } break; } var parent = promise._cancellationParent; if (parent == null || !parent._isCancellable()) { if (promise._isFollowing()) { promise._followee().cancel(); } else { promise._cancelBranched(); } break; } else { if (promise._isFollowing()) promise._followee().cancel(); promise._setWillBeCancelled(); child = promise; promise = parent; } } }; Promise.prototype._branchHasCancelled = function() { this._branchesRemainingToCancel--; }; Promise.prototype._enoughBranchesHaveCancelled = function() { return this._branchesRemainingToCancel === undefined || this._branchesRemainingToCancel <= 0; }; Promise.prototype._cancelBy = function(canceller) { if (canceller === this) { this._branchesRemainingToCancel = 0; this._invokeOnCancel(); return true; } else { this._branchHasCancelled(); if (this._enoughBranchesHaveCancelled()) { this._invokeOnCancel(); return true; } } return false; }; Promise.prototype._cancelBranched = function() { if (this._enoughBranchesHaveCancelled()) { this._cancel(); } }; Promise.prototype._cancel = function() { if (!this._isCancellable()) return; this._setCancelled(); async.invoke(this._cancelPromises, this, undefined); }; Promise.prototype._cancelPromises = function() { if (this._length() > 0) this._settlePromises(); }; Promise.prototype._unsetOnCancel = function() { this._onCancelField = undefined; }; Promise.prototype._isCancellable = function() { return this.isPending() && !this._isCancelled(); }; Promise.prototype.isCancellable = function() { return this.isPending() && !this.isCancelled(); }; Promise.prototype._doInvokeOnCancel = function(onCancelCallback, internalOnly) { if (util.isArray(onCancelCallback)) { for (var i = 0; i < onCancelCallback.length; ++i) { this._doInvokeOnCancel(onCancelCallback[i], internalOnly); } } else if (onCancelCallback !== undefined) { if (typeof onCancelCallback === "function") { if (!internalOnly) { var e = tryCatch(onCancelCallback).call(this._boundValue()); if (e === errorObj) { this._attachExtraTrace(e.e); async.throwLater(e.e); } } } else { onCancelCallback._resultCancelled(this); } } }; Promise.prototype._invokeOnCancel = function() { var onCancelCallback = this._onCancel(); this._unsetOnCancel(); async.invoke(this._doInvokeOnCancel, this, onCancelCallback); }; Promise.prototype._invokeInternalOnCancel = function() { if (this._isCancellable()) { this._doInvokeOnCancel(this._onCancel(), true); this._unsetOnCancel(); } }; Promise.prototype._resultCancelled = function() { this.cancel(); }; }; /***/ }), /* 44 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise) { function returner() { return this.value; } function thrower() { throw this.reason; } Promise.prototype["return"] = Promise.prototype.thenReturn = function (value) { if (value instanceof Promise) value.suppressUnhandledRejections(); return this._then( returner, undefined, undefined, {value: value}, undefined); }; Promise.prototype["throw"] = Promise.prototype.thenThrow = function (reason) { return this._then( thrower, undefined, undefined, {reason: reason}, undefined); }; Promise.prototype.catchThrow = function (reason) { if (arguments.length <= 1) { return this._then( undefined, thrower, undefined, {reason: reason}, undefined); } else { var _reason = arguments[1]; var handler = function() {throw _reason;}; return this.caught(reason, handler); } }; Promise.prototype.catchReturn = function (value) { if (arguments.length <= 1) { if (value instanceof Promise) value.suppressUnhandledRejections(); return this._then( undefined, returner, undefined, {value: value}, undefined); } else { var _value = arguments[1]; if (_value instanceof Promise) _value.suppressUnhandledRejections(); var handler = function() {return _value;}; return this.caught(value, handler); } }; }; /***/ }), /* 45 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise) { function PromiseInspection(promise) { if (promise !== undefined) { promise = promise._target(); this._bitField = promise._bitField; this._settledValueField = promise._isFateSealed() ? promise._settledValue() : undefined; } else { this._bitField = 0; this._settledValueField = undefined; } } PromiseInspection.prototype._settledValue = function() { return this._settledValueField; }; var value = PromiseInspection.prototype.value = function () { if (!this.isFulfilled()) { throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\u000a\u000a See http://goo.gl/MqrFmX\u000a"); } return this._settledValue(); }; var reason = PromiseInspection.prototype.error = PromiseInspection.prototype.reason = function () { if (!this.isRejected()) { throw new TypeError("cannot get rejection reason of a non-rejected promise\u000a\u000a See http://goo.gl/MqrFmX\u000a"); } return this._settledValue(); }; var isFulfilled = PromiseInspection.prototype.isFulfilled = function() { return (this._bitField & 33554432) !== 0; }; var isRejected = PromiseInspection.prototype.isRejected = function () { return (this._bitField & 16777216) !== 0; }; var isPending = PromiseInspection.prototype.isPending = function () { return (this._bitField & 50397184) === 0; }; var isResolved = PromiseInspection.prototype.isResolved = function () { return (this._bitField & 50331648) !== 0; }; PromiseInspection.prototype.isCancelled = function() { return (this._bitField & 8454144) !== 0; }; Promise.prototype.__isCancelled = function() { return (this._bitField & 65536) === 65536; }; Promise.prototype._isCancelled = function() { return this._target().__isCancelled(); }; Promise.prototype.isCancelled = function() { return (this._target()._bitField & 8454144) !== 0; }; Promise.prototype.isPending = function() { return isPending.call(this._target()); }; Promise.prototype.isRejected = function() { return isRejected.call(this._target()); }; Promise.prototype.isFulfilled = function() { return isFulfilled.call(this._target()); }; Promise.prototype.isResolved = function() { return isResolved.call(this._target()); }; Promise.prototype.value = function() { return value.call(this._target()); }; Promise.prototype.reason = function() { var target = this._target(); target._unsetRejectionIsUnhandled(); return reason.call(target); }; Promise.prototype._value = function() { return this._settledValue(); }; Promise.prototype._reason = function() { this._unsetRejectionIsUnhandled(); return this._settledValue(); }; Promise.PromiseInspection = PromiseInspection; }; /***/ }), /* 46 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, PromiseArray, tryConvertToPromise, INTERNAL, async) { var util = __webpack_require__(27); var canEvaluate = util.canEvaluate; var tryCatch = util.tryCatch; var errorObj = util.errorObj; var reject; if (true) { if (canEvaluate) { var thenCallback = function(i) { return new Function("value", "holder", " \n\ 'use strict'; \n\ holder.pIndex = value; \n\ holder.checkFulfillment(this); \n\ ".replace(/Index/g, i)); }; var promiseSetter = function(i) { return new Function("promise", "holder", " \n\ 'use strict'; \n\ holder.pIndex = promise; \n\ ".replace(/Index/g, i)); }; var generateHolderClass = function(total) { var props = new Array(total); for (var i = 0; i < props.length; ++i) { props[i] = "this.p" + (i+1); } var assignment = props.join(" = ") + " = null;"; var cancellationCode= "var promise;\n" + props.map(function(prop) { return " \n\ promise = " + prop + "; \n\ if (promise instanceof Promise) { \n\ promise.cancel(); \n\ } \n\ "; }).join("\n"); var passedArguments = props.join(", "); var name = "Holder$" + total; var code = "return function(tryCatch, errorObj, Promise, async) { \n\ 'use strict'; \n\ function [TheName](fn) { \n\ [TheProperties] \n\ this.fn = fn; \n\ this.asyncNeeded = true; \n\ this.now = 0; \n\ } \n\ \n\ [TheName].prototype._callFunction = function(promise) { \n\ promise._pushContext(); \n\ var ret = tryCatch(this.fn)([ThePassedArguments]); \n\ promise._popContext(); \n\ if (ret === errorObj) { \n\ promise._rejectCallback(ret.e, false); \n\ } else { \n\ promise._resolveCallback(ret); \n\ } \n\ }; \n\ \n\ [TheName].prototype.checkFulfillment = function(promise) { \n\ var now = ++this.now; \n\ if (now === [TheTotal]) { \n\ if (this.asyncNeeded) { \n\ async.invoke(this._callFunction, this, promise); \n\ } else { \n\ this._callFunction(promise); \n\ } \n\ \n\ } \n\ }; \n\ \n\ [TheName].prototype._resultCancelled = function() { \n\ [CancellationCode] \n\ }; \n\ \n\ return [TheName]; \n\ }(tryCatch, errorObj, Promise, async); \n\ "; code = code.replace(/\[TheName\]/g, name) .replace(/\[TheTotal\]/g, total) .replace(/\[ThePassedArguments\]/g, passedArguments) .replace(/\[TheProperties\]/g, assignment) .replace(/\[CancellationCode\]/g, cancellationCode); return new Function("tryCatch", "errorObj", "Promise", "async", code) (tryCatch, errorObj, Promise, async); }; var holderClasses = []; var thenCallbacks = []; var promiseSetters = []; for (var i = 0; i < 8; ++i) { holderClasses.push(generateHolderClass(i + 1)); thenCallbacks.push(thenCallback(i + 1)); promiseSetters.push(promiseSetter(i + 1)); } reject = function (reason) { this._reject(reason); }; }} Promise.join = function () { var last = arguments.length - 1; var fn; if (last > 0 && typeof arguments[last] === "function") { fn = arguments[last]; if (true) { if (last <= 8 && canEvaluate) { var ret = new Promise(INTERNAL); ret._captureStackTrace(); var HolderClass = holderClasses[last - 1]; var holder = new HolderClass(fn); var callbacks = thenCallbacks; for (var i = 0; i < last; ++i) { var maybePromise = tryConvertToPromise(arguments[i], ret); if (maybePromise instanceof Promise) { maybePromise = maybePromise._target(); var bitField = maybePromise._bitField; ; if (((bitField & 50397184) === 0)) { maybePromise._then(callbacks[i], reject, undefined, ret, holder); promiseSetters[i](maybePromise, holder); holder.asyncNeeded = false; } else if (((bitField & 33554432) !== 0)) { callbacks[i].call(ret, maybePromise._value(), holder); } else if (((bitField & 16777216) !== 0)) { ret._reject(maybePromise._reason()); } else { ret._cancel(); } } else { callbacks[i].call(ret, maybePromise, holder); } } if (!ret._isFateSealed()) { if (holder.asyncNeeded) { var context = Promise._getContext(); holder.fn = util.contextBind(context, holder.fn); } ret._setAsyncGuaranteed(); ret._setOnCancel(holder); } return ret; } } } var $_len = arguments.length;var args = new Array($_len); for(var $_i = 0; $_i < $_len ; ++$_i) {args[$_i] = arguments[$_i ];}; if (fn) args.pop(); var ret = new PromiseArray(args).promise(); return fn !== undefined ? ret.spread(fn) : ret; }; }; /***/ }), /* 47 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var cr = Object.create; if (cr) { var callerCache = cr(null); var getterCache = cr(null); callerCache[" size"] = getterCache[" size"] = 0; } module.exports = function(Promise) { var util = __webpack_require__(27); var canEvaluate = util.canEvaluate; var isIdentifier = util.isIdentifier; var getMethodCaller; var getGetter; if (true) { var makeMethodCaller = function (methodName) { return new Function("ensureMethod", " \n\ return function(obj) { \n\ 'use strict' \n\ var len = this.length; \n\ ensureMethod(obj, 'methodName'); \n\ switch(len) { \n\ case 1: return obj.methodName(this[0]); \n\ case 2: return obj.methodName(this[0], this[1]); \n\ case 3: return obj.methodName(this[0], this[1], this[2]); \n\ case 0: return obj.methodName(); \n\ default: \n\ return obj.methodName.apply(obj, this); \n\ } \n\ }; \n\ ".replace(/methodName/g, methodName))(ensureMethod); }; var makeGetter = function (propertyName) { return new Function("obj", " \n\ 'use strict'; \n\ return obj.propertyName; \n\ ".replace("propertyName", propertyName)); }; var getCompiled = function(name, compiler, cache) { var ret = cache[name]; if (typeof ret !== "function") { if (!isIdentifier(name)) { return null; } ret = compiler(name); cache[name] = ret; cache[" size"]++; if (cache[" size"] > 512) { var keys = Object.keys(cache); for (var i = 0; i < 256; ++i) delete cache[keys[i]]; cache[" size"] = keys.length - 256; } } return ret; }; getMethodCaller = function(name) { return getCompiled(name, makeMethodCaller, callerCache); }; getGetter = function(name) { return getCompiled(name, makeGetter, getterCache); }; } function ensureMethod(obj, methodName) { var fn; if (obj != null) fn = obj[methodName]; if (typeof fn !== "function") { var message = "Object " + util.classString(obj) + " has no method '" + util.toString(methodName) + "'"; throw new Promise.TypeError(message); } return fn; } function caller(obj) { var methodName = this.pop(); var fn = ensureMethod(obj, methodName); return fn.apply(obj, this); } Promise.prototype.call = function (methodName) { var $_len = arguments.length;var args = new Array(Math.max($_len - 1, 0)); for(var $_i = 1; $_i < $_len; ++$_i) {args[$_i - 1] = arguments[$_i];}; if (true) { if (canEvaluate) { var maybeCaller = getMethodCaller(methodName); if (maybeCaller !== null) { return this._then( maybeCaller, undefined, undefined, args, undefined); } } } args.push(methodName); return this._then(caller, undefined, undefined, args, undefined); }; function namedGetter(obj) { return obj[this]; } function indexedGetter(obj) { var index = +this; if (index < 0) index = Math.max(0, index + obj.length); return obj[index]; } Promise.prototype.get = function (propertyName) { var isIndex = (typeof propertyName === "number"); var getter; if (!isIndex) { if (canEvaluate) { var maybeGetter = getGetter(propertyName); getter = maybeGetter !== null ? maybeGetter : namedGetter; } else { getter = namedGetter; } } else { getter = indexedGetter; } return this._then(getter, undefined, undefined, propertyName, undefined); }; }; /***/ }), /* 48 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug) { var errors = __webpack_require__(33); var TypeError = errors.TypeError; var util = __webpack_require__(27); var errorObj = util.errorObj; var tryCatch = util.tryCatch; var yieldHandlers = []; function promiseFromYieldHandler(value, yieldHandlers, traceParent) { for (var i = 0; i < yieldHandlers.length; ++i) { traceParent._pushContext(); var result = tryCatch(yieldHandlers[i])(value); traceParent._popContext(); if (result === errorObj) { traceParent._pushContext(); var ret = Promise.reject(errorObj.e); traceParent._popContext(); return ret; } var maybePromise = tryConvertToPromise(result, traceParent); if (maybePromise instanceof Promise) return maybePromise; } return null; } function PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) { if (debug.cancellation()) { var internal = new Promise(INTERNAL); var _finallyPromise = this._finallyPromise = new Promise(INTERNAL); this._promise = internal.lastly(function() { return _finallyPromise; }); internal._captureStackTrace(); internal._setOnCancel(this); } else { var promise = this._promise = new Promise(INTERNAL); promise._captureStackTrace(); } this._stack = stack; this._generatorFunction = generatorFunction; this._receiver = receiver; this._generator = undefined; this._yieldHandlers = typeof yieldHandler === "function" ? [yieldHandler].concat(yieldHandlers) : yieldHandlers; this._yieldedPromise = null; this._cancellationPhase = false; } util.inherits(PromiseSpawn, Proxyable); PromiseSpawn.prototype._isResolved = function() { return this._promise === null; }; PromiseSpawn.prototype._cleanup = function() { this._promise = this._generator = null; if (debug.cancellation() && this._finallyPromise !== null) { this._finallyPromise._fulfill(); this._finallyPromise = null; } }; PromiseSpawn.prototype._promiseCancelled = function() { if (this._isResolved()) return; var implementsReturn = typeof this._generator["return"] !== "undefined"; var result; if (!implementsReturn) { var reason = new Promise.CancellationError( "generator .return() sentinel"); Promise.coroutine.returnSentinel = reason; this._promise._attachExtraTrace(reason); this._promise._pushContext(); result = tryCatch(this._generator["throw"]).call(this._generator, reason); this._promise._popContext(); } else { this._promise._pushContext(); result = tryCatch(this._generator["return"]).call(this._generator, undefined); this._promise._popContext(); } this._cancellationPhase = true; this._yieldedPromise = null; this._continue(result); }; PromiseSpawn.prototype._promiseFulfilled = function(value) { this._yieldedPromise = null; this._promise._pushContext(); var result = tryCatch(this._generator.next).call(this._generator, value); this._promise._popContext(); this._continue(result); }; PromiseSpawn.prototype._promiseRejected = function(reason) { this._yieldedPromise = null; this._promise._attachExtraTrace(reason); this._promise._pushContext(); var result = tryCatch(this._generator["throw"]) .call(this._generator, reason); this._promise._popContext(); this._continue(result); }; PromiseSpawn.prototype._resultCancelled = function() { if (this._yieldedPromise instanceof Promise) { var promise = this._yieldedPromise; this._yieldedPromise = null; promise.cancel(); } }; PromiseSpawn.prototype.promise = function () { return this._promise; }; PromiseSpawn.prototype._run = function () { this._generator = this._generatorFunction.call(this._receiver); this._receiver = this._generatorFunction = undefined; this._promiseFulfilled(undefined); }; PromiseSpawn.prototype._continue = function (result) { var promise = this._promise; if (result === errorObj) { this._cleanup(); if (this._cancellationPhase) { return promise.cancel(); } else { return promise._rejectCallback(result.e, false); } } var value = result.value; if (result.done === true) { this._cleanup(); if (this._cancellationPhase) { return promise.cancel(); } else { return promise._resolveCallback(value); } } else { var maybePromise = tryConvertToPromise(value, this._promise); if (!(maybePromise instanceof Promise)) { maybePromise = promiseFromYieldHandler(maybePromise, this._yieldHandlers, this._promise); if (maybePromise === null) { this._promiseRejected( new TypeError( "A value %s was yielded that could not be treated as a promise\u000a\u000a See http://goo.gl/MqrFmX\u000a\u000a".replace("%s", String(value)) + "From coroutine:\u000a" + this._stack.split("\n").slice(1, -7).join("\n") ) ); return; } } maybePromise = maybePromise._target(); var bitField = maybePromise._bitField; ; if (((bitField & 50397184) === 0)) { this._yieldedPromise = maybePromise; maybePromise._proxy(this, null); } else if (((bitField & 33554432) !== 0)) { Promise._async.invoke( this._promiseFulfilled, this, maybePromise._value() ); } else if (((bitField & 16777216) !== 0)) { Promise._async.invoke( this._promiseRejected, this, maybePromise._reason() ); } else { this._promiseCancelled(); } } }; Promise.coroutine = function (generatorFunction, options) { if (typeof generatorFunction !== "function") { throw new TypeError("generatorFunction must be a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); } var yieldHandler = Object(options).yieldHandler; var PromiseSpawn$ = PromiseSpawn; var stack = new Error().stack; return function () { var generator = generatorFunction.apply(this, arguments); var spawn = new PromiseSpawn$(undefined, undefined, yieldHandler, stack); var ret = spawn.promise(); spawn._generator = generator; spawn._promiseFulfilled(undefined); return ret; }; }; Promise.coroutine.addYieldHandler = function(fn) { if (typeof fn !== "function") { throw new TypeError("expecting a function but got " + util.classString(fn)); } yieldHandlers.push(fn); }; Promise.spawn = function (generatorFunction) { debug.deprecated("Promise.spawn()", "Promise.coroutine()"); if (typeof generatorFunction !== "function") { return apiRejection("generatorFunction must be a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); } var spawn = new PromiseSpawn(generatorFunction, this); var ret = spawn.promise(); spawn._run(Promise.spawn); return ret; }; }; /***/ }), /* 49 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug) { var util = __webpack_require__(27); var tryCatch = util.tryCatch; var errorObj = util.errorObj; var async = Promise._async; function MappingPromiseArray(promises, fn, limit, _filter) { this.constructor$(promises); this._promise._captureStackTrace(); var context = Promise._getContext(); this._callback = util.contextBind(context, fn); this._preservedValues = _filter === INTERNAL ? new Array(this.length()) : null; this._limit = limit; this._inFlight = 0; this._queue = []; async.invoke(this._asyncInit, this, undefined); if (util.isArray(promises)) { for (var i = 0; i < promises.length; ++i) { var maybePromise = promises[i]; if (maybePromise instanceof Promise) { maybePromise.suppressUnhandledRejections(); } } } } util.inherits(MappingPromiseArray, PromiseArray); MappingPromiseArray.prototype._asyncInit = function() { this._init$(undefined, -2); }; MappingPromiseArray.prototype._init = function () {}; MappingPromiseArray.prototype._promiseFulfilled = function (value, index) { var values = this._values; var length = this.length(); var preservedValues = this._preservedValues; var limit = this._limit; if (index < 0) { index = (index * -1) - 1; values[index] = value; if (limit >= 1) { this._inFlight--; this._drainQueue(); if (this._isResolved()) return true; } } else { if (limit >= 1 && this._inFlight >= limit) { values[index] = value; this._queue.push(index); return false; } if (preservedValues !== null) preservedValues[index] = value; var promise = this._promise; var callback = this._callback; var receiver = promise._boundValue(); promise._pushContext(); var ret = tryCatch(callback).call(receiver, value, index, length); var promiseCreated = promise._popContext(); debug.checkForgottenReturns( ret, promiseCreated, preservedValues !== null ? "Promise.filter" : "Promise.map", promise ); if (ret === errorObj) { this._reject(ret.e); return true; } var maybePromise = tryConvertToPromise(ret, this._promise); if (maybePromise instanceof Promise) { maybePromise = maybePromise._target(); var bitField = maybePromise._bitField; ; if (((bitField & 50397184) === 0)) { if (limit >= 1) this._inFlight++; values[index] = maybePromise; maybePromise._proxy(this, (index + 1) * -1); return false; } else if (((bitField & 33554432) !== 0)) { ret = maybePromise._value(); } else if (((bitField & 16777216) !== 0)) { this._reject(maybePromise._reason()); return true; } else { this._cancel(); return true; } } values[index] = ret; } var totalResolved = ++this._totalResolved; if (totalResolved >= length) { if (preservedValues !== null) { this._filter(values, preservedValues); } else { this._resolve(values); } return true; } return false; }; MappingPromiseArray.prototype._drainQueue = function () { var queue = this._queue; var limit = this._limit; var values = this._values; while (queue.length > 0 && this._inFlight < limit) { if (this._isResolved()) return; var index = queue.pop(); this._promiseFulfilled(values[index], index); } }; MappingPromiseArray.prototype._filter = function (booleans, values) { var len = values.length; var ret = new Array(len); var j = 0; for (var i = 0; i < len; ++i) { if (booleans[i]) ret[j++] = values[i]; } ret.length = j; this._resolve(ret); }; MappingPromiseArray.prototype.preservedValues = function () { return this._preservedValues; }; function map(promises, fn, options, _filter) { if (typeof fn !== "function") { return apiRejection("expecting a function but got " + util.classString(fn)); } var limit = 0; if (options !== undefined) { if (typeof options === "object" && options !== null) { if (typeof options.concurrency !== "number") { return Promise.reject( new TypeError("'concurrency' must be a number but it is " + util.classString(options.concurrency))); } limit = options.concurrency; } else { return Promise.reject(new TypeError( "options argument must be an object but it is " + util.classString(options))); } } limit = typeof limit === "number" && isFinite(limit) && limit >= 1 ? limit : 0; return new MappingPromiseArray(promises, fn, limit, _filter).promise(); } Promise.prototype.map = function (fn, options) { return map(this, fn, options, null); }; Promise.map = function (promises, fn, options, _filter) { return map(promises, fn, options, _filter); }; }; /***/ }), /* 50 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise) { var util = __webpack_require__(27); var async = Promise._async; var tryCatch = util.tryCatch; var errorObj = util.errorObj; function spreadAdapter(val, nodeback) { var promise = this; if (!util.isArray(val)) return successAdapter.call(promise, val, nodeback); var ret = tryCatch(nodeback).apply(promise._boundValue(), [null].concat(val)); if (ret === errorObj) { async.throwLater(ret.e); } } function successAdapter(val, nodeback) { var promise = this; var receiver = promise._boundValue(); var ret = val === undefined ? tryCatch(nodeback).call(receiver, null) : tryCatch(nodeback).call(receiver, null, val); if (ret === errorObj) { async.throwLater(ret.e); } } function errorAdapter(reason, nodeback) { var promise = this; if (!reason) { var newReason = new Error(reason + ""); newReason.cause = reason; reason = newReason; } var ret = tryCatch(nodeback).call(promise._boundValue(), reason); if (ret === errorObj) { async.throwLater(ret.e); } } Promise.prototype.asCallback = Promise.prototype.nodeify = function (nodeback, options) { if (typeof nodeback == "function") { var adapter = successAdapter; if (options !== undefined && Object(options).spread) { adapter = spreadAdapter; } this._then( adapter, errorAdapter, undefined, this, nodeback ); } return this; }; }; /***/ }), /* 51 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, INTERNAL) { var THIS = {}; var util = __webpack_require__(27); var nodebackForPromise = __webpack_require__(40); var withAppended = util.withAppended; var maybeWrapAsError = util.maybeWrapAsError; var canEvaluate = util.canEvaluate; var TypeError = __webpack_require__(33).TypeError; var defaultSuffix = "Async"; var defaultPromisified = {__isPromisified__: true}; var noCopyProps = [ "arity", "length", "name", "arguments", "caller", "callee", "prototype", "__isPromisified__" ]; var noCopyPropsPattern = new RegExp("^(?:" + noCopyProps.join("|") + ")$"); var defaultFilter = function(name) { return util.isIdentifier(name) && name.charAt(0) !== "_" && name !== "constructor"; }; function propsFilter(key) { return !noCopyPropsPattern.test(key); } function isPromisified(fn) { try { return fn.__isPromisified__ === true; } catch (e) { return false; } } function hasPromisified(obj, key, suffix) { var val = util.getDataPropertyOrDefault(obj, key + suffix, defaultPromisified); return val ? isPromisified(val) : false; } function checkValid(ret, suffix, suffixRegexp) { for (var i = 0; i < ret.length; i += 2) { var key = ret[i]; if (suffixRegexp.test(key)) { var keyWithoutAsyncSuffix = key.replace(suffixRegexp, ""); for (var j = 0; j < ret.length; j += 2) { if (ret[j] === keyWithoutAsyncSuffix) { throw new TypeError("Cannot promisify an API that has normal methods with '%s'-suffix\u000a\u000a See http://goo.gl/MqrFmX\u000a" .replace("%s", suffix)); } } } } } function promisifiableMethods(obj, suffix, suffixRegexp, filter) { var keys = util.inheritedDataKeys(obj); var ret = []; for (var i = 0; i < keys.length; ++i) { var key = keys[i]; var value = obj[key]; var passesDefaultFilter = filter === defaultFilter ? true : defaultFilter(key, value, obj); if (typeof value === "function" && !isPromisified(value) && !hasPromisified(obj, key, suffix) && filter(key, value, obj, passesDefaultFilter)) { ret.push(key, value); } } checkValid(ret, suffix, suffixRegexp); return ret; } var escapeIdentRegex = function(str) { return str.replace(/([$])/, "\\$"); }; var makeNodePromisifiedEval; if (true) { var switchCaseArgumentOrder = function(likelyArgumentCount) { var ret = [likelyArgumentCount]; var min = Math.max(0, likelyArgumentCount - 1 - 3); for(var i = likelyArgumentCount - 1; i >= min; --i) { ret.push(i); } for(var i = likelyArgumentCount + 1; i <= 3; ++i) { ret.push(i); } return ret; }; var argumentSequence = function(argumentCount) { return util.filledRange(argumentCount, "_arg", ""); }; var parameterDeclaration = function(parameterCount) { return util.filledRange( Math.max(parameterCount, 3), "_arg", ""); }; var parameterCount = function(fn) { if (typeof fn.length === "number") { return Math.max(Math.min(fn.length, 1023 + 1), 0); } return 0; }; makeNodePromisifiedEval = function(callback, receiver, originalName, fn, _, multiArgs) { var newParameterCount = Math.max(0, parameterCount(fn) - 1); var argumentOrder = switchCaseArgumentOrder(newParameterCount); var shouldProxyThis = typeof callback === "string" || receiver === THIS; function generateCallForArgumentCount(count) { var args = argumentSequence(count).join(", "); var comma = count > 0 ? ", " : ""; var ret; if (shouldProxyThis) { ret = "ret = callback.call(this, {{args}}, nodeback); break;\n"; } else { ret = receiver === undefined ? "ret = callback({{args}}, nodeback); break;\n" : "ret = callback.call(receiver, {{args}}, nodeback); break;\n"; } return ret.replace("{{args}}", args).replace(", ", comma); } function generateArgumentSwitchCase() { var ret = ""; for (var i = 0; i < argumentOrder.length; ++i) { ret += "case " + argumentOrder[i] +":" + generateCallForArgumentCount(argumentOrder[i]); } ret += " \n\ default: \n\ var args = new Array(len + 1); \n\ var i = 0; \n\ for (var i = 0; i < len; ++i) { \n\ args[i] = arguments[i]; \n\ } \n\ args[i] = nodeback; \n\ [CodeForCall] \n\ break; \n\ ".replace("[CodeForCall]", (shouldProxyThis ? "ret = callback.apply(this, args);\n" : "ret = callback.apply(receiver, args);\n")); return ret; } var getFunctionCode = typeof callback === "string" ? ("this != null ? this['"+callback+"'] : fn") : "fn"; var body = "'use strict'; \n\ var ret = function (Parameters) { \n\ 'use strict'; \n\ var len = arguments.length; \n\ var promise = new Promise(INTERNAL); \n\ promise._captureStackTrace(); \n\ var nodeback = nodebackForPromise(promise, " + multiArgs + "); \n\ var ret; \n\ var callback = tryCatch([GetFunctionCode]); \n\ switch(len) { \n\ [CodeForSwitchCase] \n\ } \n\ if (ret === errorObj) { \n\ promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n\ } \n\ if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); \n\ return promise; \n\ }; \n\ notEnumerableProp(ret, '__isPromisified__', true); \n\ return ret; \n\ ".replace("[CodeForSwitchCase]", generateArgumentSwitchCase()) .replace("[GetFunctionCode]", getFunctionCode); body = body.replace("Parameters", parameterDeclaration(newParameterCount)); return new Function("Promise", "fn", "receiver", "withAppended", "maybeWrapAsError", "nodebackForPromise", "tryCatch", "errorObj", "notEnumerableProp", "INTERNAL", body)( Promise, fn, receiver, withAppended, maybeWrapAsError, nodebackForPromise, util.tryCatch, util.errorObj, util.notEnumerableProp, INTERNAL); }; } function makeNodePromisifiedClosure(callback, receiver, _, fn, __, multiArgs) { var defaultThis = (function() {return this;})(); var method = callback; if (typeof method === "string") { callback = fn; } function promisified() { var _receiver = receiver; if (receiver === THIS) _receiver = this; var promise = new Promise(INTERNAL); promise._captureStackTrace(); var cb = typeof method === "string" && this !== defaultThis ? this[method] : callback; var fn = nodebackForPromise(promise, multiArgs); try { cb.apply(_receiver, withAppended(arguments, fn)); } catch(e) { promise._rejectCallback(maybeWrapAsError(e), true, true); } if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); return promise; } util.notEnumerableProp(promisified, "__isPromisified__", true); return promisified; } var makeNodePromisified = canEvaluate ? makeNodePromisifiedEval : makeNodePromisifiedClosure; function promisifyAll(obj, suffix, filter, promisifier, multiArgs) { var suffixRegexp = new RegExp(escapeIdentRegex(suffix) + "$"); var methods = promisifiableMethods(obj, suffix, suffixRegexp, filter); for (var i = 0, len = methods.length; i < len; i+= 2) { var key = methods[i]; var fn = methods[i+1]; var promisifiedKey = key + suffix; if (promisifier === makeNodePromisified) { obj[promisifiedKey] = makeNodePromisified(key, THIS, key, fn, suffix, multiArgs); } else { var promisified = promisifier(fn, function() { return makeNodePromisified(key, THIS, key, fn, suffix, multiArgs); }); util.notEnumerableProp(promisified, "__isPromisified__", true); obj[promisifiedKey] = promisified; } } util.toFastProperties(obj); return obj; } function promisify(callback, receiver, multiArgs) { return makeNodePromisified(callback, receiver, undefined, callback, null, multiArgs); } Promise.promisify = function (fn, options) { if (typeof fn !== "function") { throw new TypeError("expecting a function but got " + util.classString(fn)); } if (isPromisified(fn)) { return fn; } options = Object(options); var receiver = options.context === undefined ? THIS : options.context; var multiArgs = !!options.multiArgs; var ret = promisify(fn, receiver, multiArgs); util.copyDescriptors(fn, ret, propsFilter); return ret; }; Promise.promisifyAll = function (target, options) { if (typeof target !== "function" && typeof target !== "object") { throw new TypeError("the target of promisifyAll must be an object or a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); } options = Object(options); var multiArgs = !!options.multiArgs; var suffix = options.suffix; if (typeof suffix !== "string") suffix = defaultSuffix; var filter = options.filter; if (typeof filter !== "function") filter = defaultFilter; var promisifier = options.promisifier; if (typeof promisifier !== "function") promisifier = makeNodePromisified; if (!util.isIdentifier(suffix)) { throw new RangeError("suffix must be a valid identifier\u000a\u000a See http://goo.gl/MqrFmX\u000a"); } var keys = util.inheritedDataKeys(target); for (var i = 0; i < keys.length; ++i) { var value = target[keys[i]]; if (keys[i] !== "constructor" && util.isClass(value)) { promisifyAll(value.prototype, suffix, filter, promisifier, multiArgs); promisifyAll(value, suffix, filter, promisifier, multiArgs); } } return promisifyAll(target, suffix, filter, promisifier, multiArgs); }; }; /***/ }), /* 52 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function( Promise, PromiseArray, tryConvertToPromise, apiRejection) { var util = __webpack_require__(27); var isObject = util.isObject; var es5 = __webpack_require__(28); var Es6Map; if (typeof Map === "function") Es6Map = Map; var mapToEntries = (function() { var index = 0; var size = 0; function extractEntry(value, key) { this[index] = value; this[index + size] = key; index++; } return function mapToEntries(map) { size = map.size; index = 0; var ret = new Array(map.size * 2); map.forEach(extractEntry, ret); return ret; }; })(); var entriesToMap = function(entries) { var ret = new Es6Map(); var length = entries.length / 2 | 0; for (var i = 0; i < length; ++i) { var key = entries[length + i]; var value = entries[i]; ret.set(key, value); } return ret; }; function PropertiesPromiseArray(obj) { var isMap = false; var entries; if (Es6Map !== undefined && obj instanceof Es6Map) { entries = mapToEntries(obj); isMap = true; } else { var keys = es5.keys(obj); var len = keys.length; entries = new Array(len * 2); for (var i = 0; i < len; ++i) { var key = keys[i]; entries[i] = obj[key]; entries[i + len] = key; } } this.constructor$(entries); this._isMap = isMap; this._init$(undefined, isMap ? -6 : -3); } util.inherits(PropertiesPromiseArray, PromiseArray); PropertiesPromiseArray.prototype._init = function () {}; PropertiesPromiseArray.prototype._promiseFulfilled = function (value, index) { this._values[index] = value; var totalResolved = ++this._totalResolved; if (totalResolved >= this._length) { var val; if (this._isMap) { val = entriesToMap(this._values); } else { val = {}; var keyOffset = this.length(); for (var i = 0, len = this.length(); i < len; ++i) { val[this._values[i + keyOffset]] = this._values[i]; } } this._resolve(val); return true; } return false; }; PropertiesPromiseArray.prototype.shouldCopyValues = function () { return false; }; PropertiesPromiseArray.prototype.getActualLength = function (len) { return len >> 1; }; function props(promises) { var ret; var castValue = tryConvertToPromise(promises); if (!isObject(castValue)) { return apiRejection("cannot await properties of a non-object\u000a\u000a See http://goo.gl/MqrFmX\u000a"); } else if (castValue instanceof Promise) { ret = castValue._then( Promise.props, undefined, undefined, undefined, undefined); } else { ret = new PropertiesPromiseArray(castValue).promise(); } if (castValue instanceof Promise) { ret._propagateFrom(castValue, 2); } return ret; } Promise.prototype.props = function () { return props(this); }; Promise.props = function (promises) { return props(promises); }; }; /***/ }), /* 53 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function( Promise, INTERNAL, tryConvertToPromise, apiRejection) { var util = __webpack_require__(27); var raceLater = function (promise) { return promise.then(function(array) { return race(array, promise); }); }; function race(promises, parent) { var maybePromise = tryConvertToPromise(promises); if (maybePromise instanceof Promise) { return raceLater(maybePromise); } else { promises = util.asArray(promises); if (promises === null) return apiRejection("expecting an array or an iterable object but got " + util.classString(promises)); } var ret = new Promise(INTERNAL); if (parent !== undefined) { ret._propagateFrom(parent, 3); } var fulfill = ret._fulfill; var reject = ret._reject; for (var i = 0, len = promises.length; i < len; ++i) { var val = promises[i]; if (val === undefined && !(i in promises)) { continue; } Promise.cast(val)._then(fulfill, reject, undefined, ret, null); } return ret; } Promise.race = function (promises) { return race(promises, undefined); }; Promise.prototype.race = function () { return race(this, undefined); }; }; /***/ }), /* 54 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug) { var util = __webpack_require__(27); var tryCatch = util.tryCatch; function ReductionPromiseArray(promises, fn, initialValue, _each) { this.constructor$(promises); var context = Promise._getContext(); this._fn = util.contextBind(context, fn); if (initialValue !== undefined) { initialValue = Promise.resolve(initialValue); initialValue._attachCancellationCallback(this); } this._initialValue = initialValue; this._currentCancellable = null; if(_each === INTERNAL) { this._eachValues = Array(this._length); } else if (_each === 0) { this._eachValues = null; } else { this._eachValues = undefined; } this._promise._captureStackTrace(); this._init$(undefined, -5); } util.inherits(ReductionPromiseArray, PromiseArray); ReductionPromiseArray.prototype._gotAccum = function(accum) { if (this._eachValues !== undefined && this._eachValues !== null && accum !== INTERNAL) { this._eachValues.push(accum); } }; ReductionPromiseArray.prototype._eachComplete = function(value) { if (this._eachValues !== null) { this._eachValues.push(value); } return this._eachValues; }; ReductionPromiseArray.prototype._init = function() {}; ReductionPromiseArray.prototype._resolveEmptyArray = function() { this._resolve(this._eachValues !== undefined ? this._eachValues : this._initialValue); }; ReductionPromiseArray.prototype.shouldCopyValues = function () { return false; }; ReductionPromiseArray.prototype._resolve = function(value) { this._promise._resolveCallback(value); this._values = null; }; ReductionPromiseArray.prototype._resultCancelled = function(sender) { if (sender === this._initialValue) return this._cancel(); if (this._isResolved()) return; this._resultCancelled$(); if (this._currentCancellable instanceof Promise) { this._currentCancellable.cancel(); } if (this._initialValue instanceof Promise) { this._initialValue.cancel(); } }; ReductionPromiseArray.prototype._iterate = function (values) { this._values = values; var value; var i; var length = values.length; if (this._initialValue !== undefined) { value = this._initialValue; i = 0; } else { value = Promise.resolve(values[0]); i = 1; } this._currentCancellable = value; for (var j = i; j < length; ++j) { var maybePromise = values[j]; if (maybePromise instanceof Promise) { maybePromise.suppressUnhandledRejections(); } } if (!value.isRejected()) { for (; i < length; ++i) { var ctx = { accum: null, value: values[i], index: i, length: length, array: this }; value = value._then(gotAccum, undefined, undefined, ctx, undefined); if ((i & 127) === 0) { value._setNoAsyncGuarantee(); } } } if (this._eachValues !== undefined) { value = value ._then(this._eachComplete, undefined, undefined, this, undefined); } value._then(completed, completed, undefined, value, this); }; Promise.prototype.reduce = function (fn, initialValue) { return reduce(this, fn, initialValue, null); }; Promise.reduce = function (promises, fn, initialValue, _each) { return reduce(promises, fn, initialValue, _each); }; function completed(valueOrReason, array) { if (this.isFulfilled()) { array._resolve(valueOrReason); } else { array._reject(valueOrReason); } } function reduce(promises, fn, initialValue, _each) { if (typeof fn !== "function") { return apiRejection("expecting a function but got " + util.classString(fn)); } var array = new ReductionPromiseArray(promises, fn, initialValue, _each); return array.promise(); } function gotAccum(accum) { this.accum = accum; this.array._gotAccum(accum); var value = tryConvertToPromise(this.value, this.array._promise); if (value instanceof Promise) { this.array._currentCancellable = value; return value._then(gotValue, undefined, undefined, this, undefined); } else { return gotValue.call(this, value); } } function gotValue(value) { var array = this.array; var promise = array._promise; var fn = tryCatch(array._fn); promise._pushContext(); var ret; if (array._eachValues !== undefined) { ret = fn.call(promise._boundValue(), value, this.index, this.length); } else { ret = fn.call(promise._boundValue(), this.accum, value, this.index, this.length); } if (ret instanceof Promise) { array._currentCancellable = ret; } var promiseCreated = promise._popContext(); debug.checkForgottenReturns( ret, promiseCreated, array._eachValues !== undefined ? "Promise.each" : "Promise.reduce", promise ); return ret; } }; /***/ }), /* 55 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, PromiseArray, debug) { var PromiseInspection = Promise.PromiseInspection; var util = __webpack_require__(27); function SettledPromiseArray(values) { this.constructor$(values); } util.inherits(SettledPromiseArray, PromiseArray); SettledPromiseArray.prototype._promiseResolved = function (index, inspection) { this._values[index] = inspection; var totalResolved = ++this._totalResolved; if (totalResolved >= this._length) { this._resolve(this._values); return true; } return false; }; SettledPromiseArray.prototype._promiseFulfilled = function (value, index) { var ret = new PromiseInspection(); ret._bitField = 33554432; ret._settledValueField = value; return this._promiseResolved(index, ret); }; SettledPromiseArray.prototype._promiseRejected = function (reason, index) { var ret = new PromiseInspection(); ret._bitField = 16777216; ret._settledValueField = reason; return this._promiseResolved(index, ret); }; Promise.settle = function (promises) { debug.deprecated(".settle()", ".reflect()"); return new SettledPromiseArray(promises).promise(); }; Promise.allSettled = function (promises) { return new SettledPromiseArray(promises).promise(); }; Promise.prototype.settle = function () { return Promise.settle(this); }; }; /***/ }), /* 56 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, PromiseArray, apiRejection) { var util = __webpack_require__(27); var RangeError = __webpack_require__(33).RangeError; var AggregateError = __webpack_require__(33).AggregateError; var isArray = util.isArray; var CANCELLATION = {}; function SomePromiseArray(values) { this.constructor$(values); this._howMany = 0; this._unwrap = false; this._initialized = false; } util.inherits(SomePromiseArray, PromiseArray); SomePromiseArray.prototype._init = function () { if (!this._initialized) { return; } if (this._howMany === 0) { this._resolve([]); return; } this._init$(undefined, -5); var isArrayResolved = isArray(this._values); if (!this._isResolved() && isArrayResolved && this._howMany > this._canPossiblyFulfill()) { this._reject(this._getRangeError(this.length())); } }; SomePromiseArray.prototype.init = function () { this._initialized = true; this._init(); }; SomePromiseArray.prototype.setUnwrap = function () { this._unwrap = true; }; SomePromiseArray.prototype.howMany = function () { return this._howMany; }; SomePromiseArray.prototype.setHowMany = function (count) { this._howMany = count; }; SomePromiseArray.prototype._promiseFulfilled = function (value) { this._addFulfilled(value); if (this._fulfilled() === this.howMany()) { this._values.length = this.howMany(); if (this.howMany() === 1 && this._unwrap) { this._resolve(this._values[0]); } else { this._resolve(this._values); } return true; } return false; }; SomePromiseArray.prototype._promiseRejected = function (reason) { this._addRejected(reason); return this._checkOutcome(); }; SomePromiseArray.prototype._promiseCancelled = function () { if (this._values instanceof Promise || this._values == null) { return this._cancel(); } this._addRejected(CANCELLATION); return this._checkOutcome(); }; SomePromiseArray.prototype._checkOutcome = function() { if (this.howMany() > this._canPossiblyFulfill()) { var e = new AggregateError(); for (var i = this.length(); i < this._values.length; ++i) { if (this._values[i] !== CANCELLATION) { e.push(this._values[i]); } } if (e.length > 0) { this._reject(e); } else { this._cancel(); } return true; } return false; }; SomePromiseArray.prototype._fulfilled = function () { return this._totalResolved; }; SomePromiseArray.prototype._rejected = function () { return this._values.length - this.length(); }; SomePromiseArray.prototype._addRejected = function (reason) { this._values.push(reason); }; SomePromiseArray.prototype._addFulfilled = function (value) { this._values[this._totalResolved++] = value; }; SomePromiseArray.prototype._canPossiblyFulfill = function () { return this.length() - this._rejected(); }; SomePromiseArray.prototype._getRangeError = function (count) { var message = "Input array must contain at least " + this._howMany + " items but contains only " + count + " items"; return new RangeError(message); }; SomePromiseArray.prototype._resolveEmptyArray = function () { this._reject(this._getRangeError(0)); }; function some(promises, howMany) { if ((howMany | 0) !== howMany || howMany < 0) { return apiRejection("expecting a positive integer\u000a\u000a See http://goo.gl/MqrFmX\u000a"); } var ret = new SomePromiseArray(promises); var promise = ret.promise(); ret.setHowMany(howMany); ret.init(); return promise; } Promise.some = function (promises, howMany) { return some(promises, howMany); }; Promise.prototype.some = function (howMany) { return some(this, howMany); }; Promise._SomePromiseArray = SomePromiseArray; }; /***/ }), /* 57 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, INTERNAL, debug) { var util = __webpack_require__(27); var TimeoutError = Promise.TimeoutError; function HandleWrapper(handle) { this.handle = handle; } HandleWrapper.prototype._resultCancelled = function() { clearTimeout(this.handle); }; var afterValue = function(value) { return delay(+this).thenReturn(value); }; var delay = Promise.delay = function (ms, value) { var ret; var handle; if (value !== undefined) { ret = Promise.resolve(value) ._then(afterValue, null, null, ms, undefined); if (debug.cancellation() && value instanceof Promise) { ret._setOnCancel(value); } } else { ret = new Promise(INTERNAL); handle = setTimeout(function() { ret._fulfill(); }, +ms); if (debug.cancellation()) { ret._setOnCancel(new HandleWrapper(handle)); } ret._captureStackTrace(); } ret._setAsyncGuaranteed(); return ret; }; Promise.prototype.delay = function (ms) { return delay(ms, this); }; var afterTimeout = function (promise, message, parent) { var err; if (typeof message !== "string") { if (message instanceof Error) { err = message; } else { err = new TimeoutError("operation timed out"); } } else { err = new TimeoutError(message); } util.markAsOriginatingFromRejection(err); promise._attachExtraTrace(err); promise._reject(err); if (parent != null) { parent.cancel(); } }; function successClear(value) { clearTimeout(this.handle); return value; } function failureClear(reason) { clearTimeout(this.handle); throw reason; } Promise.prototype.timeout = function (ms, message) { ms = +ms; var ret, parent; var handleWrapper = new HandleWrapper(setTimeout(function timeoutTimeout() { if (ret.isPending()) { afterTimeout(ret, message, parent); } }, ms)); if (debug.cancellation()) { parent = this.then(); ret = parent._then(successClear, failureClear, undefined, handleWrapper, undefined); ret._setOnCancel(handleWrapper); } else { ret = this._then(successClear, failureClear, undefined, handleWrapper, undefined); } return ret; }; }; /***/ }), /* 58 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function (Promise, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug) { var util = __webpack_require__(27); var TypeError = __webpack_require__(33).TypeError; var inherits = __webpack_require__(27).inherits; var errorObj = util.errorObj; var tryCatch = util.tryCatch; var NULL = {}; function thrower(e) { setTimeout(function(){throw e;}, 0); } function castPreservingDisposable(thenable) { var maybePromise = tryConvertToPromise(thenable); if (maybePromise !== thenable && typeof thenable._isDisposable === "function" && typeof thenable._getDisposer === "function" && thenable._isDisposable()) { maybePromise._setDisposable(thenable._getDisposer()); } return maybePromise; } function dispose(resources, inspection) { var i = 0; var len = resources.length; var ret = new Promise(INTERNAL); function iterator() { if (i >= len) return ret._fulfill(); var maybePromise = castPreservingDisposable(resources[i++]); if (maybePromise instanceof Promise && maybePromise._isDisposable()) { try { maybePromise = tryConvertToPromise( maybePromise._getDisposer().tryDispose(inspection), resources.promise); } catch (e) { return thrower(e); } if (maybePromise instanceof Promise) { return maybePromise._then(iterator, thrower, null, null, null); } } iterator(); } iterator(); return ret; } function Disposer(data, promise, context) { this._data = data; this._promise = promise; this._context = context; } Disposer.prototype.data = function () { return this._data; }; Disposer.prototype.promise = function () { return this._promise; }; Disposer.prototype.resource = function () { if (this.promise().isFulfilled()) { return this.promise().value(); } return NULL; }; Disposer.prototype.tryDispose = function(inspection) { var resource = this.resource(); var context = this._context; if (context !== undefined) context._pushContext(); var ret = resource !== NULL ? this.doDispose(resource, inspection) : null; if (context !== undefined) context._popContext(); this._promise._unsetDisposable(); this._data = null; return ret; }; Disposer.isDisposer = function (d) { return (d != null && typeof d.resource === "function" && typeof d.tryDispose === "function"); }; function FunctionDisposer(fn, promise, context) { this.constructor$(fn, promise, context); } inherits(FunctionDisposer, Disposer); FunctionDisposer.prototype.doDispose = function (resource, inspection) { var fn = this.data(); return fn.call(resource, resource, inspection); }; function maybeUnwrapDisposer(value) { if (Disposer.isDisposer(value)) { this.resources[this.index]._setDisposable(value); return value.promise(); } return value; } function ResourceList(length) { this.length = length; this.promise = null; this[length-1] = null; } ResourceList.prototype._resultCancelled = function() { var len = this.length; for (var i = 0; i < len; ++i) { var item = this[i]; if (item instanceof Promise) { item.cancel(); } } }; Promise.using = function () { var len = arguments.length; if (len < 2) return apiRejection( "you must pass at least 2 arguments to Promise.using"); var fn = arguments[len - 1]; if (typeof fn !== "function") { return apiRejection("expecting a function but got " + util.classString(fn)); } var input; var spreadArgs = true; if (len === 2 && Array.isArray(arguments[0])) { input = arguments[0]; len = input.length; spreadArgs = false; } else { input = arguments; len--; } var resources = new ResourceList(len); for (var i = 0; i < len; ++i) { var resource = input[i]; if (Disposer.isDisposer(resource)) { var disposer = resource; resource = resource.promise(); resource._setDisposable(disposer); } else { var maybePromise = tryConvertToPromise(resource); if (maybePromise instanceof Promise) { resource = maybePromise._then(maybeUnwrapDisposer, null, null, { resources: resources, index: i }, undefined); } } resources[i] = resource; } var reflectedResources = new Array(resources.length); for (var i = 0; i < reflectedResources.length; ++i) { reflectedResources[i] = Promise.resolve(resources[i]).reflect(); } var resultPromise = Promise.all(reflectedResources) .then(function(inspections) { for (var i = 0; i < inspections.length; ++i) { var inspection = inspections[i]; if (inspection.isRejected()) { errorObj.e = inspection.error(); return errorObj; } else if (!inspection.isFulfilled()) { resultPromise.cancel(); return; } inspections[i] = inspection.value(); } promise._pushContext(); fn = tryCatch(fn); var ret = spreadArgs ? fn.apply(undefined, inspections) : fn(inspections); var promiseCreated = promise._popContext(); debug.checkForgottenReturns( ret, promiseCreated, "Promise.using", promise); return ret; }); var promise = resultPromise.lastly(function() { var inspection = new Promise.PromiseInspection(resultPromise); return dispose(resources, inspection); }); resources.promise = promise; promise._setOnCancel(resources); return promise; }; Promise.prototype._setDisposable = function (disposer) { this._bitField = this._bitField | 131072; this._disposer = disposer; }; Promise.prototype._isDisposable = function () { return (this._bitField & 131072) > 0; }; Promise.prototype._getDisposer = function () { return this._disposer; }; Promise.prototype._unsetDisposable = function () { this._bitField = this._bitField & (~131072); this._disposer = undefined; }; Promise.prototype.disposer = function (fn) { if (typeof fn === "function") { return new FunctionDisposer(fn, this, createContext()); } throw new TypeError(); }; }; /***/ }), /* 59 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise) { var SomePromiseArray = Promise._SomePromiseArray; function any(promises) { var ret = new SomePromiseArray(promises); var promise = ret.promise(); ret.setHowMany(1); ret.setUnwrap(); ret.init(); return promise; } Promise.any = function (promises) { return any(promises); }; Promise.prototype.any = function () { return any(this); }; }; /***/ }), /* 60 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, INTERNAL) { var PromiseReduce = Promise.reduce; var PromiseAll = Promise.all; function promiseAllThis() { return PromiseAll(this); } function PromiseMapSeries(promises, fn) { return PromiseReduce(promises, fn, INTERNAL, INTERNAL); } Promise.prototype.each = function (fn) { return PromiseReduce(this, fn, INTERNAL, 0) ._then(promiseAllThis, undefined, undefined, this, undefined); }; Promise.prototype.mapSeries = function (fn) { return PromiseReduce(this, fn, INTERNAL, INTERNAL); }; Promise.each = function (promises, fn) { return PromiseReduce(promises, fn, INTERNAL, 0) ._then(promiseAllThis, undefined, undefined, promises, undefined); }; Promise.mapSeries = PromiseMapSeries; }; /***/ }), /* 61 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Promise, INTERNAL) { var PromiseMap = Promise.map; Promise.prototype.filter = function (fn, options) { return PromiseMap(this, fn, options, INTERNAL); }; Promise.filter = function (promises, fn, options) { return PromiseMap(promises, fn, options, INTERNAL); }; }; /***/ }), /* 62 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var core = __webpack_require__(63), isArray = __webpack_require__(75), isFunction = __webpack_require__(65), isObjectLike = __webpack_require__(73); module.exports = function (options) { var errorText = 'Please verify options'; // For better minification because this string is repeating if (!isObjectLike(options)) { throw new TypeError(errorText); } if (!isFunction(options.request)) { throw new TypeError(errorText + '.request'); } if (!isArray(options.expose) || options.expose.length === 0) { throw new TypeError(errorText + '.expose'); } var plumbing = core({ PromiseImpl: options.PromiseImpl, constructorMixin: options.constructorMixin }); // Intercepting Request's init method var originalInit = options.request.Request.prototype.init; options.request.Request.prototype.init = function RP$initInterceptor(requestOptions) { // Init may be called again - currently in case of redirects if (isObjectLike(requestOptions) && !this._callback && !this._rp_promise) { plumbing.init.call(this, requestOptions); } return originalInit.apply(this, arguments); }; // Exposing the Promise capabilities var thenExposed = false; for ( var i = 0; i < options.expose.length; i+=1 ) { var method = options.expose[i]; plumbing[ method === 'promise' ? 'exposePromise' : 'exposePromiseMethod' ]( options.request.Request.prototype, null, '_rp_promise', method ); if (method === 'then') { thenExposed = true; } } if (!thenExposed) { throw new Error('Please expose "then"'); } }; /***/ }), /* 63 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var errors = __webpack_require__(64), isFunction = __webpack_require__(65), isObjectLike = __webpack_require__(73), isString = __webpack_require__(74), isUndefined = __webpack_require__(76); module.exports = function (options) { var errorText = 'Please verify options'; // For better minification because this string is repeating if (!isObjectLike(options)) { throw new TypeError(errorText); } if (!isFunction(options.PromiseImpl)) { throw new TypeError(errorText + '.PromiseImpl'); } if (!isUndefined(options.constructorMixin) && !isFunction(options.constructorMixin)) { throw new TypeError(errorText + '.PromiseImpl'); } var PromiseImpl = options.PromiseImpl; var constructorMixin = options.constructorMixin; var plumbing = {}; plumbing.init = function (requestOptions) { var self = this; self._rp_promise = new PromiseImpl(function (resolve, reject) { self._rp_resolve = resolve; self._rp_reject = reject; if (constructorMixin) { constructorMixin.apply(self, arguments); // Using arguments since specific Promise libraries may pass additional parameters } }); self._rp_callbackOrig = requestOptions.callback; requestOptions.callback = self.callback = function RP$callback(err, response, body) { plumbing.callback.call(self, err, response, body); }; if (isString(requestOptions.method)) { requestOptions.method = requestOptions.method.toUpperCase(); } requestOptions.transform = requestOptions.transform || plumbing.defaultTransformations[requestOptions.method]; self._rp_options = requestOptions; self._rp_options.simple = requestOptions.simple !== false; self._rp_options.resolveWithFullResponse = requestOptions.resolveWithFullResponse === true; self._rp_options.transform2xxOnly = requestOptions.transform2xxOnly === true; }; plumbing.defaultTransformations = { HEAD: function (body, response, resolveWithFullResponse) { return resolveWithFullResponse ? response : response.headers; } }; plumbing.callback = function (err, response, body) { var self = this; var origCallbackThrewException = false, thrownException = null; if (isFunction(self._rp_callbackOrig)) { try { self._rp_callbackOrig.apply(self, arguments); // TODO: Apply to self mimics behavior of request@2. Is that also right for request@next? } catch (e) { origCallbackThrewException = true; thrownException = e; } } var is2xx = !err && /^2/.test('' + response.statusCode); if (err) { self._rp_reject(new errors.RequestError(err, self._rp_options, response)); } else if (self._rp_options.simple && !is2xx) { if (isFunction(self._rp_options.transform) && self._rp_options.transform2xxOnly === false) { (new PromiseImpl(function (resolve) { resolve(self._rp_options.transform(body, response, self._rp_options.resolveWithFullResponse)); // transform may return a Promise })) .then(function (transformedResponse) { self._rp_reject(new errors.StatusCodeError(response.statusCode, body, self._rp_options, transformedResponse)); }) .catch(function (transformErr) { self._rp_reject(new errors.TransformError(transformErr, self._rp_options, response)); }); } else { self._rp_reject(new errors.StatusCodeError(response.statusCode, body, self._rp_options, response)); } } else { if (isFunction(self._rp_options.transform) && (is2xx || self._rp_options.transform2xxOnly === false)) { (new PromiseImpl(function (resolve) { resolve(self._rp_options.transform(body, response, self._rp_options.resolveWithFullResponse)); // transform may return a Promise })) .then(function (transformedResponse) { self._rp_resolve(transformedResponse); }) .catch(function (transformErr) { self._rp_reject(new errors.TransformError(transformErr, self._rp_options, response)); }); } else if (self._rp_options.resolveWithFullResponse) { self._rp_resolve(response); } else { self._rp_resolve(body); } } if (origCallbackThrewException) { throw thrownException; } }; plumbing.exposePromiseMethod = function (exposeTo, bindTo, promisePropertyKey, methodToExpose, exposeAs) { exposeAs = exposeAs || methodToExpose; if (exposeAs in exposeTo) { throw new Error('Unable to expose method "' + exposeAs + '"'); } exposeTo[exposeAs] = function RP$exposed() { var self = bindTo || this; return self[promisePropertyKey][methodToExpose].apply(self[promisePropertyKey], arguments); }; }; plumbing.exposePromise = function (exposeTo, bindTo, promisePropertyKey, exposeAs) { exposeAs = exposeAs || 'promise'; if (exposeAs in exposeTo) { throw new Error('Unable to expose method "' + exposeAs + '"'); } exposeTo[exposeAs] = function RP$promise() { var self = bindTo || this; return self[promisePropertyKey]; }; }; return plumbing; }; /***/ }), /* 64 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; function RequestError(cause, options, response) { this.name = 'RequestError'; this.message = String(cause); this.cause = cause; this.error = cause; // legacy attribute this.options = options; this.response = response; if (Error.captureStackTrace) { // required for non-V8 environments Error.captureStackTrace(this); } } RequestError.prototype = Object.create(Error.prototype); RequestError.prototype.constructor = RequestError; function StatusCodeError(statusCode, body, options, response) { this.name = 'StatusCodeError'; this.statusCode = statusCode; this.message = statusCode + ' - ' + (JSON && JSON.stringify ? JSON.stringify(body) : body); this.error = body; // legacy attribute this.options = options; this.response = response; if (Error.captureStackTrace) { // required for non-V8 environments Error.captureStackTrace(this); } } StatusCodeError.prototype = Object.create(Error.prototype); StatusCodeError.prototype.constructor = StatusCodeError; function TransformError(cause, options, response) { this.name = 'TransformError'; this.message = String(cause); this.cause = cause; this.error = cause; // legacy attribute this.options = options; this.response = response; if (Error.captureStackTrace) { // required for non-V8 environments Error.captureStackTrace(this); } } TransformError.prototype = Object.create(Error.prototype); TransformError.prototype.constructor = TransformError; module.exports = { RequestError: RequestError, StatusCodeError: StatusCodeError, TransformError: TransformError }; /***/ }), /* 65 */ /***/ (function(module, exports, __webpack_require__) { var baseGetTag = __webpack_require__(66), isObject = __webpack_require__(72); /** `Object#toString` result references. */ var asyncTag = '[object AsyncFunction]', funcTag = '[object Function]', genTag = '[object GeneratorFunction]', proxyTag = '[object Proxy]'; /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */ function isFunction(value) { if (!isObject(value)) { return false; } // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 9 which returns 'object' for typed arrays and other constructors. var tag = baseGetTag(value); return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } module.exports = isFunction; /***/ }), /* 66 */ /***/ (function(module, exports, __webpack_require__) { var Symbol = __webpack_require__(67), getRawTag = __webpack_require__(70), objectToString = __webpack_require__(71); /** `Object#toString` result references. */ var nullTag = '[object Null]', undefinedTag = '[object Undefined]'; /** Built-in value references. */ var symToStringTag = Symbol ? Symbol.toStringTag : undefined; /** * The base implementation of `getTag` without fallbacks for buggy environments. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ function baseGetTag(value) { if (value == null) { return value === undefined ? undefinedTag : nullTag; } return (symToStringTag && symToStringTag in Object(value)) ? getRawTag(value) : objectToString(value); } module.exports = baseGetTag; /***/ }), /* 67 */ /***/ (function(module, exports, __webpack_require__) { var root = __webpack_require__(68); /** Built-in value references. */ var Symbol = root.Symbol; module.exports = Symbol; /***/ }), /* 68 */ /***/ (function(module, exports, __webpack_require__) { var freeGlobal = __webpack_require__(69); /** Detect free variable `self`. */ var freeSelf = typeof self == 'object' && self && self.Object === Object && self; /** Used as a reference to the global object. */ var root = freeGlobal || freeSelf || Function('return this')(); module.exports = root; /***/ }), /* 69 */ /***/ (function(module, exports) { /** Detect free variable `global` from Node.js. */ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; module.exports = freeGlobal; /***/ }), /* 70 */ /***/ (function(module, exports, __webpack_require__) { var Symbol = __webpack_require__(67); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString = objectProto.toString; /** Built-in value references. */ var symToStringTag = Symbol ? Symbol.toStringTag : undefined; /** * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. * * @private * @param {*} value The value to query. * @returns {string} Returns the raw `toStringTag`. */ function getRawTag(value) { var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; try { value[symToStringTag] = undefined; var unmasked = true; } catch (e) {} var result = nativeObjectToString.call(value); if (unmasked) { if (isOwn) { value[symToStringTag] = tag; } else { delete value[symToStringTag]; } } return result; } module.exports = getRawTag; /***/ }), /* 71 */ /***/ (function(module, exports) { /** Used for built-in method references. */ var objectProto = Object.prototype; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString = objectProto.toString; /** * Converts `value` to a string using `Object.prototype.toString`. * * @private * @param {*} value The value to convert. * @returns {string} Returns the converted string. */ function objectToString(value) { return nativeObjectToString.call(value); } module.exports = objectToString; /***/ }), /* 72 */ /***/ (function(module, exports) { /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function isObject(value) { var type = typeof value; return value != null && (type == 'object' || type == 'function'); } module.exports = isObject; /***/ }), /* 73 */ /***/ (function(module, exports) { /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return value != null && typeof value == 'object'; } module.exports = isObjectLike; /***/ }), /* 74 */ /***/ (function(module, exports, __webpack_require__) { var baseGetTag = __webpack_require__(66), isArray = __webpack_require__(75), isObjectLike = __webpack_require__(73); /** `Object#toString` result references. */ var stringTag = '[object String]'; /** * Checks if `value` is classified as a `String` primitive or object. * * @static * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a string, else `false`. * @example * * _.isString('abc'); * // => true * * _.isString(1); * // => false */ function isString(value) { return typeof value == 'string' || (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); } module.exports = isString; /***/ }), /* 75 */ /***/ (function(module, exports) { /** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(document.body.children); * // => false * * _.isArray('abc'); * // => false * * _.isArray(_.noop); * // => false */ var isArray = Array.isArray; module.exports = isArray; /***/ }), /* 76 */ /***/ (function(module, exports) { /** * Checks if `value` is `undefined`. * * @static * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. * @example * * _.isUndefined(void 0); * // => true * * _.isUndefined(null); * // => false */ function isUndefined(value) { return value === undefined; } module.exports = isUndefined; /***/ }), /* 77 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isNative = /\.node$/; function forEach(obj, callback) { for ( var key in obj ) { if (!Object.prototype.hasOwnProperty.call(obj, key)) { continue; } callback(key); } } function assign(target, source) { forEach(source, function (key) { target[key] = source[key]; }); return target; } function clearCache(requireCache) { forEach(requireCache, function (resolvedPath) { if (!isNative.test(resolvedPath)) { delete requireCache[resolvedPath]; } }); } module.exports = function (requireCache, callback, callbackForModulesToKeep, module) { var originalCache = assign({}, requireCache); clearCache(requireCache); if (callbackForModulesToKeep) { var originalModuleChildren = module.children ? module.children.slice() : false; // Creates a shallow copy of module.children callbackForModulesToKeep(); // Lists the cache entries made by callbackForModulesToKeep() var modulesToKeep = []; forEach(requireCache, function (key) { modulesToKeep.push(key); }); // Discards the modules required in callbackForModulesToKeep() clearCache(requireCache); if (module.children) { // Only true for node.js module.children = originalModuleChildren; // Removes last references to modules required in callbackForModulesToKeep() -> No memory leak } // Takes the cache entries of the original cache in case the modules where required before for ( var i = 0; i < modulesToKeep.length; i+=1 ) { if (originalCache[modulesToKeep[i]]) { requireCache[modulesToKeep[i]] = originalCache[modulesToKeep[i]]; } } } var freshModule = callback(); var stealthCache = callbackForModulesToKeep ? assign({}, requireCache) : false; clearCache(requireCache); if (callbackForModulesToKeep) { // In case modules to keep were required inside the stealthy require for the first time, copy them to the restored cache for ( var k = 0; k < modulesToKeep.length; k+=1 ) { if (stealthCache[modulesToKeep[k]]) { requireCache[modulesToKeep[k]] = stealthCache[modulesToKeep[k]]; } } } assign(requireCache, originalCache); return freshModule; }; /***/ }), /* 78 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Copyright 2010-2012 Mikeal Rogers // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. var extend = __webpack_require__(79) var cookies = __webpack_require__(80) var helpers = __webpack_require__(93) var paramsHaveRequestBody = helpers.paramsHaveRequestBody // organize params for patch, post, put, head, del function initParams (uri, options, callback) { if (typeof options === 'function') { callback = options } var params = {} if (typeof options === 'object') { extend(params, options, {uri: uri}) } else if (typeof uri === 'string') { extend(params, {uri: uri}) } else { extend(params, uri) } params.callback = callback || params.callback return params } function request (uri, options, callback) { if (typeof uri === 'undefined') { throw new Error('undefined is not a valid uri or options object.') } var params = initParams(uri, options, callback) if (params.method === 'HEAD' && paramsHaveRequestBody(params)) { throw new Error('HTTP HEAD requests MUST NOT include a request body.') } return new request.Request(params) } function verbFunc (verb) { var method = verb.toUpperCase() return function (uri, options, callback) { var params = initParams(uri, options, callback) params.method = method return request(params, params.callback) } } // define like this to please codeintel/intellisense IDEs request.get = verbFunc('get') request.head = verbFunc('head') request.options = verbFunc('options') request.post = verbFunc('post') request.put = verbFunc('put') request.patch = verbFunc('patch') request.del = verbFunc('delete') request['delete'] = verbFunc('delete') request.jar = function (store) { return cookies.jar(store) } request.cookie = function (str) { return cookies.parse(str) } function wrapRequestMethod (method, options, requester, verb) { return function (uri, opts, callback) { var params = initParams(uri, opts, callback) var target = {} extend(true, target, options, params) target.pool = params.pool || options.pool if (verb) { target.method = verb.toUpperCase() } if (typeof requester === 'function') { method = requester } return method(target, target.callback) } } request.defaults = function (options, requester) { var self = this options = options || {} if (typeof options === 'function') { requester = options options = {} } var defaults = wrapRequestMethod(self, options, requester) var verbs = ['get', 'head', 'post', 'put', 'patch', 'del', 'delete'] verbs.forEach(function (verb) { defaults[verb] = wrapRequestMethod(self[verb], options, requester, verb) }) defaults.cookie = wrapRequestMethod(self.cookie, options, requester) defaults.jar = self.jar defaults.defaults = self.defaults return defaults } request.forever = function (agentOptions, optionsArg) { var options = {} if (optionsArg) { extend(options, optionsArg) } if (agentOptions) { options.agentOptions = agentOptions } options.forever = true return request.defaults(options) } // Exports module.exports = request request.Request = __webpack_require__(97) request.initParams = initParams // Backwards compatibility for request.debug Object.defineProperty(request, 'debug', { enumerable: true, get: function () { return request.Request.debug }, set: function (debug) { request.Request.debug = debug } }) /***/ }), /* 79 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var hasOwn = Object.prototype.hasOwnProperty; var toStr = Object.prototype.toString; var defineProperty = Object.defineProperty; var gOPD = Object.getOwnPropertyDescriptor; var isArray = function isArray(arr) { if (typeof Array.isArray === 'function') { return Array.isArray(arr); } return toStr.call(arr) === '[object Array]'; }; var isPlainObject = function isPlainObject(obj) { if (!obj || toStr.call(obj) !== '[object Object]') { return false; } var hasOwnConstructor = hasOwn.call(obj, 'constructor'); var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); // Not own constructor property must be Object if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { return false; } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. var key; for (key in obj) { /**/ } return typeof key === 'undefined' || hasOwn.call(obj, key); }; // If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target var setProperty = function setProperty(target, options) { if (defineProperty && options.name === '__proto__') { defineProperty(target, options.name, { enumerable: true, configurable: true, value: options.newValue, writable: true }); } else { target[options.name] = options.newValue; } }; // Return undefined instead of __proto__ if '__proto__' is not an own property var getProperty = function getProperty(obj, name) { if (name === '__proto__') { if (!hasOwn.call(obj, name)) { return void 0; } else if (gOPD) { // In early versions of node, obj['__proto__'] is buggy when obj has // __proto__ as an own property. Object.getOwnPropertyDescriptor() works. return gOPD(obj, name).value; } } return obj[name]; }; module.exports = function extend() { var options, name, src, copy, copyIsArray, clone; var target = arguments[0]; var i = 1; var length = arguments.length; var deep = false; // Handle a deep copy situation if (typeof target === 'boolean') { deep = target; target = arguments[1] || {}; // skip the boolean and the target i = 2; } if (target == null || (typeof target !== 'object' && typeof target !== 'function')) { target = {}; } for (; i < length; ++i) { options = arguments[i]; // Only deal with non-null/undefined values if (options != null) { // Extend the base object for (name in options) { src = getProperty(target, name); copy = getProperty(options, name); // Prevent never-ending loop if (target !== copy) { // Recurse if we're merging plain objects or arrays if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { if (copyIsArray) { copyIsArray = false; clone = src && isArray(src) ? src : []; } else { clone = src && isPlainObject(src) ? src : {}; } // Never move original objects, clone them setProperty(target, { name: name, newValue: extend(deep, clone, copy) }); // Don't bring in undefined values } else if (typeof copy !== 'undefined') { setProperty(target, { name: name, newValue: copy }); } } } } } // Return the modified object return target; }; /***/ }), /* 80 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var tough = __webpack_require__(81) var Cookie = tough.Cookie var CookieJar = tough.CookieJar exports.parse = function (str) { if (str && str.uri) { str = str.uri } if (typeof str !== 'string') { throw new Error('The cookie function only accepts STRING as param') } return Cookie.parse(str, {loose: true}) } // Adapt the sometimes-Async api of tough.CookieJar to our requirements function RequestJar (store) { var self = this self._jar = new CookieJar(store, {looseMode: true}) } RequestJar.prototype.setCookie = function (cookieOrStr, uri, options) { var self = this return self._jar.setCookieSync(cookieOrStr, uri, options || {}) } RequestJar.prototype.getCookieString = function (uri) { var self = this return self._jar.getCookieStringSync(uri) } RequestJar.prototype.getCookies = function (uri) { var self = this return self._jar.getCookiesSync(uri) } exports.jar = function (store) { return new RequestJar(store) } /***/ }), /* 81 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * Copyright (c) 2015, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ var net = __webpack_require__(82); var urlParse = __webpack_require__(83).parse; var util = __webpack_require__(9); var pubsuffix = __webpack_require__(84); var Store = __webpack_require__(88).Store; var MemoryCookieStore = __webpack_require__(89).MemoryCookieStore; var pathMatch = __webpack_require__(91).pathMatch; var VERSION = __webpack_require__(92).version; var punycode; try { punycode = __webpack_require__(86); } catch(e) { console.warn("tough-cookie: can't load punycode; won't use punycode for domain normalization"); } // From RFC6265 S4.1.1 // note that it excludes \x3B ";" var COOKIE_OCTETS = /^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]+$/; var CONTROL_CHARS = /[\x00-\x1F]/; // From Chromium // '\r', '\n' and '\0' should be treated as a terminator in // the "relaxed" mode, see: // https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L60 var TERMINATORS = ['\n', '\r', '\0']; // RFC6265 S4.1.1 defines path value as 'any CHAR except CTLs or ";"' // Note ';' is \x3B var PATH_VALUE = /[\x20-\x3A\x3C-\x7E]+/; // date-time parsing constants (RFC6265 S5.1.1) var DATE_DELIM = /[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]/; var MONTH_TO_NUM = { jan:0, feb:1, mar:2, apr:3, may:4, jun:5, jul:6, aug:7, sep:8, oct:9, nov:10, dec:11 }; var NUM_TO_MONTH = [ 'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec' ]; var NUM_TO_DAY = [ 'Sun','Mon','Tue','Wed','Thu','Fri','Sat' ]; var MAX_TIME = 2147483647000; // 31-bit max var MIN_TIME = 0; // 31-bit min /* * Parses a Natural number (i.e., non-negative integer) with either the * <min>*<max>DIGIT ( non-digit *OCTET ) * or * <min>*<max>DIGIT * grammar (RFC6265 S5.1.1). * * The "trailingOK" boolean controls if the grammar accepts a * "( non-digit *OCTET )" trailer. */ function parseDigits(token, minDigits, maxDigits, trailingOK) { var count = 0; while (count < token.length) { var c = token.charCodeAt(count); // "non-digit = %x00-2F / %x3A-FF" if (c <= 0x2F || c >= 0x3A) { break; } count++; } // constrain to a minimum and maximum number of digits. if (count < minDigits || count > maxDigits) { return null; } if (!trailingOK && count != token.length) { return null; } return parseInt(token.substr(0,count), 10); } function parseTime(token) { var parts = token.split(':'); var result = [0,0,0]; /* RF6256 S5.1.1: * time = hms-time ( non-digit *OCTET ) * hms-time = time-field ":" time-field ":" time-field * time-field = 1*2DIGIT */ if (parts.length !== 3) { return null; } for (var i = 0; i < 3; i++) { // "time-field" must be strictly "1*2DIGIT", HOWEVER, "hms-time" can be // followed by "( non-digit *OCTET )" so therefore the last time-field can // have a trailer var trailingOK = (i == 2); var num = parseDigits(parts[i], 1, 2, trailingOK); if (num === null) { return null; } result[i] = num; } return result; } function parseMonth(token) { token = String(token).substr(0,3).toLowerCase(); var num = MONTH_TO_NUM[token]; return num >= 0 ? num : null; } /* * RFC6265 S5.1.1 date parser (see RFC for full grammar) */ function parseDate(str) { if (!str) { return; } /* RFC6265 S5.1.1: * 2. Process each date-token sequentially in the order the date-tokens * appear in the cookie-date */ var tokens = str.split(DATE_DELIM); if (!tokens) { return; } var hour = null; var minute = null; var second = null; var dayOfMonth = null; var month = null; var year = null; for (var i=0; i<tokens.length; i++) { var token = tokens[i].trim(); if (!token.length) { continue; } var result; /* 2.1. If the found-time flag is not set and the token matches the time * production, set the found-time flag and set the hour- value, * minute-value, and second-value to the numbers denoted by the digits in * the date-token, respectively. Skip the remaining sub-steps and continue * to the next date-token. */ if (second === null) { result = parseTime(token); if (result) { hour = result[0]; minute = result[1]; second = result[2]; continue; } } /* 2.2. If the found-day-of-month flag is not set and the date-token matches * the day-of-month production, set the found-day-of- month flag and set * the day-of-month-value to the number denoted by the date-token. Skip * the remaining sub-steps and continue to the next date-token. */ if (dayOfMonth === null) { // "day-of-month = 1*2DIGIT ( non-digit *OCTET )" result = parseDigits(token, 1, 2, true); if (result !== null) { dayOfMonth = result; continue; } } /* 2.3. If the found-month flag is not set and the date-token matches the * month production, set the found-month flag and set the month-value to * the month denoted by the date-token. Skip the remaining sub-steps and * continue to the next date-token. */ if (month === null) { result = parseMonth(token); if (result !== null) { month = result; continue; } } /* 2.4. If the found-year flag is not set and the date-token matches the * year production, set the found-year flag and set the year-value to the * number denoted by the date-token. Skip the remaining sub-steps and * continue to the next date-token. */ if (year === null) { // "year = 2*4DIGIT ( non-digit *OCTET )" result = parseDigits(token, 2, 4, true); if (result !== null) { year = result; /* From S5.1.1: * 3. If the year-value is greater than or equal to 70 and less * than or equal to 99, increment the year-value by 1900. * 4. If the year-value is greater than or equal to 0 and less * than or equal to 69, increment the year-value by 2000. */ if (year >= 70 && year <= 99) { year += 1900; } else if (year >= 0 && year <= 69) { year += 2000; } } } } /* RFC 6265 S5.1.1 * "5. Abort these steps and fail to parse the cookie-date if: * * at least one of the found-day-of-month, found-month, found- * year, or found-time flags is not set, * * the day-of-month-value is less than 1 or greater than 31, * * the year-value is less than 1601, * * the hour-value is greater than 23, * * the minute-value is greater than 59, or * * the second-value is greater than 59. * (Note that leap seconds cannot be represented in this syntax.)" * * So, in order as above: */ if ( dayOfMonth === null || month === null || year === null || second === null || dayOfMonth < 1 || dayOfMonth > 31 || year < 1601 || hour > 23 || minute > 59 || second > 59 ) { return; } return new Date(Date.UTC(year, month, dayOfMonth, hour, minute, second)); } function formatDate(date) { var d = date.getUTCDate(); d = d >= 10 ? d : '0'+d; var h = date.getUTCHours(); h = h >= 10 ? h : '0'+h; var m = date.getUTCMinutes(); m = m >= 10 ? m : '0'+m; var s = date.getUTCSeconds(); s = s >= 10 ? s : '0'+s; return NUM_TO_DAY[date.getUTCDay()] + ', ' + d+' '+ NUM_TO_MONTH[date.getUTCMonth()] +' '+ date.getUTCFullYear() +' '+ h+':'+m+':'+s+' GMT'; } // S5.1.2 Canonicalized Host Names function canonicalDomain(str) { if (str == null) { return null; } str = str.trim().replace(/^\./,''); // S4.1.2.3 & S5.2.3: ignore leading . // convert to IDN if any non-ASCII characters if (punycode && /[^\u0001-\u007f]/.test(str)) { str = punycode.toASCII(str); } return str.toLowerCase(); } // S5.1.3 Domain Matching function domainMatch(str, domStr, canonicalize) { if (str == null || domStr == null) { return null; } if (canonicalize !== false) { str = canonicalDomain(str); domStr = canonicalDomain(domStr); } /* * "The domain string and the string are identical. (Note that both the * domain string and the string will have been canonicalized to lower case at * this point)" */ if (str == domStr) { return true; } /* "All of the following [three] conditions hold:" (order adjusted from the RFC) */ /* "* The string is a host name (i.e., not an IP address)." */ if (net.isIP(str)) { return false; } /* "* The domain string is a suffix of the string" */ var idx = str.indexOf(domStr); if (idx <= 0) { return false; // it's a non-match (-1) or prefix (0) } // e.g "a.b.c".indexOf("b.c") === 2 // 5 === 3+2 if (str.length !== domStr.length + idx) { // it's not a suffix return false; } /* "* The last character of the string that is not included in the domain * string is a %x2E (".") character." */ if (str.substr(idx-1,1) !== '.') { return false; } return true; } // RFC6265 S5.1.4 Paths and Path-Match /* * "The user agent MUST use an algorithm equivalent to the following algorithm * to compute the default-path of a cookie:" * * Assumption: the path (and not query part or absolute uri) is passed in. */ function defaultPath(path) { // "2. If the uri-path is empty or if the first character of the uri-path is not // a %x2F ("/") character, output %x2F ("/") and skip the remaining steps. if (!path || path.substr(0,1) !== "/") { return "/"; } // "3. If the uri-path contains no more than one %x2F ("/") character, output // %x2F ("/") and skip the remaining step." if (path === "/") { return path; } var rightSlash = path.lastIndexOf("/"); if (rightSlash === 0) { return "/"; } // "4. Output the characters of the uri-path from the first character up to, // but not including, the right-most %x2F ("/")." return path.slice(0, rightSlash); } function trimTerminator(str) { for (var t = 0; t < TERMINATORS.length; t++) { var terminatorIdx = str.indexOf(TERMINATORS[t]); if (terminatorIdx !== -1) { str = str.substr(0,terminatorIdx); } } return str; } function parseCookiePair(cookiePair, looseMode) { cookiePair = trimTerminator(cookiePair); var firstEq = cookiePair.indexOf('='); if (looseMode) { if (firstEq === 0) { // '=' is immediately at start cookiePair = cookiePair.substr(1); firstEq = cookiePair.indexOf('='); // might still need to split on '=' } } else { // non-loose mode if (firstEq <= 0) { // no '=' or is at start return; // needs to have non-empty "cookie-name" } } var cookieName, cookieValue; if (firstEq <= 0) { cookieName = ""; cookieValue = cookiePair.trim(); } else { cookieName = cookiePair.substr(0, firstEq).trim(); cookieValue = cookiePair.substr(firstEq+1).trim(); } if (CONTROL_CHARS.test(cookieName) || CONTROL_CHARS.test(cookieValue)) { return; } var c = new Cookie(); c.key = cookieName; c.value = cookieValue; return c; } function parse(str, options) { if (!options || typeof options !== 'object') { options = {}; } str = str.trim(); // We use a regex to parse the "name-value-pair" part of S5.2 var firstSemi = str.indexOf(';'); // S5.2 step 1 var cookiePair = (firstSemi === -1) ? str : str.substr(0, firstSemi); var c = parseCookiePair(cookiePair, !!options.loose); if (!c) { return; } if (firstSemi === -1) { return c; } // S5.2.3 "unparsed-attributes consist of the remainder of the set-cookie-string // (including the %x3B (";") in question)." plus later on in the same section // "discard the first ";" and trim". var unparsed = str.slice(firstSemi + 1).trim(); // "If the unparsed-attributes string is empty, skip the rest of these // steps." if (unparsed.length === 0) { return c; } /* * S5.2 says that when looping over the items "[p]rocess the attribute-name * and attribute-value according to the requirements in the following * subsections" for every item. Plus, for many of the individual attributes * in S5.3 it says to use the "attribute-value of the last attribute in the * cookie-attribute-list". Therefore, in this implementation, we overwrite * the previous value. */ var cookie_avs = unparsed.split(';'); while (cookie_avs.length) { var av = cookie_avs.shift().trim(); if (av.length === 0) { // happens if ";;" appears continue; } var av_sep = av.indexOf('='); var av_key, av_value; if (av_sep === -1) { av_key = av; av_value = null; } else { av_key = av.substr(0,av_sep); av_value = av.substr(av_sep+1); } av_key = av_key.trim().toLowerCase(); if (av_value) { av_value = av_value.trim(); } switch(av_key) { case 'expires': // S5.2.1 if (av_value) { var exp = parseDate(av_value); // "If the attribute-value failed to parse as a cookie date, ignore the // cookie-av." if (exp) { // over and underflow not realistically a concern: V8's getTime() seems to // store something larger than a 32-bit time_t (even with 32-bit node) c.expires = exp; } } break; case 'max-age': // S5.2.2 if (av_value) { // "If the first character of the attribute-value is not a DIGIT or a "-" // character ...[or]... If the remainder of attribute-value contains a // non-DIGIT character, ignore the cookie-av." if (/^-?[0-9]+$/.test(av_value)) { var delta = parseInt(av_value, 10); // "If delta-seconds is less than or equal to zero (0), let expiry-time // be the earliest representable date and time." c.setMaxAge(delta); } } break; case 'domain': // S5.2.3 // "If the attribute-value is empty, the behavior is undefined. However, // the user agent SHOULD ignore the cookie-av entirely." if (av_value) { // S5.2.3 "Let cookie-domain be the attribute-value without the leading %x2E // (".") character." var domain = av_value.trim().replace(/^\./, ''); if (domain) { // "Convert the cookie-domain to lower case." c.domain = domain.toLowerCase(); } } break; case 'path': // S5.2.4 /* * "If the attribute-value is empty or if the first character of the * attribute-value is not %x2F ("/"): * Let cookie-path be the default-path. * Otherwise: * Let cookie-path be the attribute-value." * * We'll represent the default-path as null since it depends on the * context of the parsing. */ c.path = av_value && av_value[0] === "/" ? av_value : null; break; case 'secure': // S5.2.5 /* * "If the attribute-name case-insensitively matches the string "Secure", * the user agent MUST append an attribute to the cookie-attribute-list * with an attribute-name of Secure and an empty attribute-value." */ c.secure = true; break; case 'httponly': // S5.2.6 -- effectively the same as 'secure' c.httpOnly = true; break; default: c.extensions = c.extensions || []; c.extensions.push(av); break; } } return c; } // avoid the V8 deoptimization monster! function jsonParse(str) { var obj; try { obj = JSON.parse(str); } catch (e) { return e; } return obj; } function fromJSON(str) { if (!str) { return null; } var obj; if (typeof str === 'string') { obj = jsonParse(str); if (obj instanceof Error) { return null; } } else { // assume it's an Object obj = str; } var c = new Cookie(); for (var i=0; i<Cookie.serializableProperties.length; i++) { var prop = Cookie.serializableProperties[i]; if (obj[prop] === undefined || obj[prop] === Cookie.prototype[prop]) { continue; // leave as prototype default } if (prop === 'expires' || prop === 'creation' || prop === 'lastAccessed') { if (obj[prop] === null) { c[prop] = null; } else { c[prop] = obj[prop] == "Infinity" ? "Infinity" : new Date(obj[prop]); } } else { c[prop] = obj[prop]; } } return c; } /* Section 5.4 part 2: * "* Cookies with longer paths are listed before cookies with * shorter paths. * * * Among cookies that have equal-length path fields, cookies with * earlier creation-times are listed before cookies with later * creation-times." */ function cookieCompare(a,b) { var cmp = 0; // descending for length: b CMP a var aPathLen = a.path ? a.path.length : 0; var bPathLen = b.path ? b.path.length : 0; cmp = bPathLen - aPathLen; if (cmp !== 0) { return cmp; } // ascending for time: a CMP b var aTime = a.creation ? a.creation.getTime() : MAX_TIME; var bTime = b.creation ? b.creation.getTime() : MAX_TIME; cmp = aTime - bTime; if (cmp !== 0) { return cmp; } // break ties for the same millisecond (precision of JavaScript's clock) cmp = a.creationIndex - b.creationIndex; return cmp; } // Gives the permutation of all possible pathMatch()es of a given path. The // array is in longest-to-shortest order. Handy for indexing. function permutePath(path) { if (path === '/') { return ['/']; } if (path.lastIndexOf('/') === path.length-1) { path = path.substr(0,path.length-1); } var permutations = [path]; while (path.length > 1) { var lindex = path.lastIndexOf('/'); if (lindex === 0) { break; } path = path.substr(0,lindex); permutations.push(path); } permutations.push('/'); return permutations; } function getCookieContext(url) { if (url instanceof Object) { return url; } // NOTE: decodeURI will throw on malformed URIs (see GH-32). // Therefore, we will just skip decoding for such URIs. try { url = decodeURI(url); } catch(err) { // Silently swallow error } return urlParse(url); } function Cookie(options) { options = options || {}; Object.keys(options).forEach(function(prop) { if (Cookie.prototype.hasOwnProperty(prop) && Cookie.prototype[prop] !== options[prop] && prop.substr(0,1) !== '_') { this[prop] = options[prop]; } }, this); this.creation = this.creation || new Date(); // used to break creation ties in cookieCompare(): Object.defineProperty(this, 'creationIndex', { configurable: false, enumerable: false, // important for assert.deepEqual checks writable: true, value: ++Cookie.cookiesCreated }); } Cookie.cookiesCreated = 0; // incremented each time a cookie is created Cookie.parse = parse; Cookie.fromJSON = fromJSON; Cookie.prototype.key = ""; Cookie.prototype.value = ""; // the order in which the RFC has them: Cookie.prototype.expires = "Infinity"; // coerces to literal Infinity Cookie.prototype.maxAge = null; // takes precedence over expires for TTL Cookie.prototype.domain = null; Cookie.prototype.path = null; Cookie.prototype.secure = false; Cookie.prototype.httpOnly = false; Cookie.prototype.extensions = null; // set by the CookieJar: Cookie.prototype.hostOnly = null; // boolean when set Cookie.prototype.pathIsDefault = null; // boolean when set Cookie.prototype.creation = null; // Date when set; defaulted by Cookie.parse Cookie.prototype.lastAccessed = null; // Date when set Object.defineProperty(Cookie.prototype, 'creationIndex', { configurable: true, enumerable: false, writable: true, value: 0 }); Cookie.serializableProperties = Object.keys(Cookie.prototype) .filter(function(prop) { return !( Cookie.prototype[prop] instanceof Function || prop === 'creationIndex' || prop.substr(0,1) === '_' ); }); Cookie.prototype.inspect = function inspect() { var now = Date.now(); return 'Cookie="'+this.toString() + '; hostOnly='+(this.hostOnly != null ? this.hostOnly : '?') + '; aAge='+(this.lastAccessed ? (now-this.lastAccessed.getTime())+'ms' : '?') + '; cAge='+(this.creation ? (now-this.creation.getTime())+'ms' : '?') + '"'; }; // Use the new custom inspection symbol to add the custom inspect function if // available. if (util.inspect.custom) { Cookie.prototype[util.inspect.custom] = Cookie.prototype.inspect; } Cookie.prototype.toJSON = function() { var obj = {}; var props = Cookie.serializableProperties; for (var i=0; i<props.length; i++) { var prop = props[i]; if (this[prop] === Cookie.prototype[prop]) { continue; // leave as prototype default } if (prop === 'expires' || prop === 'creation' || prop === 'lastAccessed') { if (this[prop] === null) { obj[prop] = null; } else { obj[prop] = this[prop] == "Infinity" ? // intentionally not === "Infinity" : this[prop].toISOString(); } } else if (prop === 'maxAge') { if (this[prop] !== null) { // again, intentionally not === obj[prop] = (this[prop] == Infinity || this[prop] == -Infinity) ? this[prop].toString() : this[prop]; } } else { if (this[prop] !== Cookie.prototype[prop]) { obj[prop] = this[prop]; } } } return obj; }; Cookie.prototype.clone = function() { return fromJSON(this.toJSON()); }; Cookie.prototype.validate = function validate() { if (!COOKIE_OCTETS.test(this.value)) { return false; } if (this.expires != Infinity && !(this.expires instanceof Date) && !parseDate(this.expires)) { return false; } if (this.maxAge != null && this.maxAge <= 0) { return false; // "Max-Age=" non-zero-digit *DIGIT } if (this.path != null && !PATH_VALUE.test(this.path)) { return false; } var cdomain = this.cdomain(); if (cdomain) { if (cdomain.match(/\.$/)) { return false; // S4.1.2.3 suggests that this is bad. domainMatch() tests confirm this } var suffix = pubsuffix.getPublicSuffix(cdomain); if (suffix == null) { // it's a public suffix return false; } } return true; }; Cookie.prototype.setExpires = function setExpires(exp) { if (exp instanceof Date) { this.expires = exp; } else { this.expires = parseDate(exp) || "Infinity"; } }; Cookie.prototype.setMaxAge = function setMaxAge(age) { if (age === Infinity || age === -Infinity) { this.maxAge = age.toString(); // so JSON.stringify() works } else { this.maxAge = age; } }; // gives Cookie header format Cookie.prototype.cookieString = function cookieString() { var val = this.value; if (val == null) { val = ''; } if (this.key === '') { return val; } return this.key+'='+val; }; // gives Set-Cookie header format Cookie.prototype.toString = function toString() { var str = this.cookieString(); if (this.expires != Infinity) { if (this.expires instanceof Date) { str += '; Expires='+formatDate(this.expires); } else { str += '; Expires='+this.expires; } } if (this.maxAge != null && this.maxAge != Infinity) { str += '; Max-Age='+this.maxAge; } if (this.domain && !this.hostOnly) { str += '; Domain='+this.domain; } if (this.path) { str += '; Path='+this.path; } if (this.secure) { str += '; Secure'; } if (this.httpOnly) { str += '; HttpOnly'; } if (this.extensions) { this.extensions.forEach(function(ext) { str += '; '+ext; }); } return str; }; // TTL() partially replaces the "expiry-time" parts of S5.3 step 3 (setCookie() // elsewhere) // S5.3 says to give the "latest representable date" for which we use Infinity // For "expired" we use 0 Cookie.prototype.TTL = function TTL(now) { /* RFC6265 S4.1.2.2 If a cookie has both the Max-Age and the Expires * attribute, the Max-Age attribute has precedence and controls the * expiration date of the cookie. * (Concurs with S5.3 step 3) */ if (this.maxAge != null) { return this.maxAge<=0 ? 0 : this.maxAge*1000; } var expires = this.expires; if (expires != Infinity) { if (!(expires instanceof Date)) { expires = parseDate(expires) || Infinity; } if (expires == Infinity) { return Infinity; } return expires.getTime() - (now || Date.now()); } return Infinity; }; // expiryTime() replaces the "expiry-time" parts of S5.3 step 3 (setCookie() // elsewhere) Cookie.prototype.expiryTime = function expiryTime(now) { if (this.maxAge != null) { var relativeTo = now || this.creation || new Date(); var age = (this.maxAge <= 0) ? -Infinity : this.maxAge*1000; return relativeTo.getTime() + age; } if (this.expires == Infinity) { return Infinity; } return this.expires.getTime(); }; // expiryDate() replaces the "expiry-time" parts of S5.3 step 3 (setCookie() // elsewhere), except it returns a Date Cookie.prototype.expiryDate = function expiryDate(now) { var millisec = this.expiryTime(now); if (millisec == Infinity) { return new Date(MAX_TIME); } else if (millisec == -Infinity) { return new Date(MIN_TIME); } else { return new Date(millisec); } }; // This replaces the "persistent-flag" parts of S5.3 step 3 Cookie.prototype.isPersistent = function isPersistent() { return (this.maxAge != null || this.expires != Infinity); }; // Mostly S5.1.2 and S5.2.3: Cookie.prototype.cdomain = Cookie.prototype.canonicalizedDomain = function canonicalizedDomain() { if (this.domain == null) { return null; } return canonicalDomain(this.domain); }; function CookieJar(store, options) { if (typeof options === "boolean") { options = {rejectPublicSuffixes: options}; } else if (options == null) { options = {}; } if (options.rejectPublicSuffixes != null) { this.rejectPublicSuffixes = options.rejectPublicSuffixes; } if (options.looseMode != null) { this.enableLooseMode = options.looseMode; } if (!store) { store = new MemoryCookieStore(); } this.store = store; } CookieJar.prototype.store = null; CookieJar.prototype.rejectPublicSuffixes = true; CookieJar.prototype.enableLooseMode = false; var CAN_BE_SYNC = []; CAN_BE_SYNC.push('setCookie'); CookieJar.prototype.setCookie = function(cookie, url, options, cb) { var err; var context = getCookieContext(url); if (options instanceof Function) { cb = options; options = {}; } var host = canonicalDomain(context.hostname); var loose = this.enableLooseMode; if (options.loose != null) { loose = options.loose; } // S5.3 step 1 if (!(cookie instanceof Cookie)) { cookie = Cookie.parse(cookie, { loose: loose }); } if (!cookie) { err = new Error("Cookie failed to parse"); return cb(options.ignoreError ? null : err); } // S5.3 step 2 var now = options.now || new Date(); // will assign later to save effort in the face of errors // S5.3 step 3: NOOP; persistent-flag and expiry-time is handled by getCookie() // S5.3 step 4: NOOP; domain is null by default // S5.3 step 5: public suffixes if (this.rejectPublicSuffixes && cookie.domain) { var suffix = pubsuffix.getPublicSuffix(cookie.cdomain()); if (suffix == null) { // e.g. "com" err = new Error("Cookie has domain set to a public suffix"); return cb(options.ignoreError ? null : err); } } // S5.3 step 6: if (cookie.domain) { if (!domainMatch(host, cookie.cdomain(), false)) { err = new Error("Cookie not in this host's domain. Cookie:"+cookie.cdomain()+" Request:"+host); return cb(options.ignoreError ? null : err); } if (cookie.hostOnly == null) { // don't reset if already set cookie.hostOnly = false; } } else { cookie.hostOnly = true; cookie.domain = host; } //S5.2.4 If the attribute-value is empty or if the first character of the //attribute-value is not %x2F ("/"): //Let cookie-path be the default-path. if (!cookie.path || cookie.path[0] !== '/') { cookie.path = defaultPath(context.pathname); cookie.pathIsDefault = true; } // S5.3 step 8: NOOP; secure attribute // S5.3 step 9: NOOP; httpOnly attribute // S5.3 step 10 if (options.http === false && cookie.httpOnly) { err = new Error("Cookie is HttpOnly and this isn't an HTTP API"); return cb(options.ignoreError ? null : err); } var store = this.store; if (!store.updateCookie) { store.updateCookie = function(oldCookie, newCookie, cb) { this.putCookie(newCookie, cb); }; } function withCookie(err, oldCookie) { if (err) { return cb(err); } var next = function(err) { if (err) { return cb(err); } else { cb(null, cookie); } }; if (oldCookie) { // S5.3 step 11 - "If the cookie store contains a cookie with the same name, // domain, and path as the newly created cookie:" if (options.http === false && oldCookie.httpOnly) { // step 11.2 err = new Error("old Cookie is HttpOnly and this isn't an HTTP API"); return cb(options.ignoreError ? null : err); } cookie.creation = oldCookie.creation; // step 11.3 cookie.creationIndex = oldCookie.creationIndex; // preserve tie-breaker cookie.lastAccessed = now; // Step 11.4 (delete cookie) is implied by just setting the new one: store.updateCookie(oldCookie, cookie, next); // step 12 } else { cookie.creation = cookie.lastAccessed = now; store.putCookie(cookie, next); // step 12 } } store.findCookie(cookie.domain, cookie.path, cookie.key, withCookie); }; // RFC6365 S5.4 CAN_BE_SYNC.push('getCookies'); CookieJar.prototype.getCookies = function(url, options, cb) { var context = getCookieContext(url); if (options instanceof Function) { cb = options; options = {}; } var host = canonicalDomain(context.hostname); var path = context.pathname || '/'; var secure = options.secure; if (secure == null && context.protocol && (context.protocol == 'https:' || context.protocol == 'wss:')) { secure = true; } var http = options.http; if (http == null) { http = true; } var now = options.now || Date.now(); var expireCheck = options.expire !== false; var allPaths = !!options.allPaths; var store = this.store; function matchingCookie(c) { // "Either: // The cookie's host-only-flag is true and the canonicalized // request-host is identical to the cookie's domain. // Or: // The cookie's host-only-flag is false and the canonicalized // request-host domain-matches the cookie's domain." if (c.hostOnly) { if (c.domain != host) { return false; } } else { if (!domainMatch(host, c.domain, false)) { return false; } } // "The request-uri's path path-matches the cookie's path." if (!allPaths && !pathMatch(path, c.path)) { return false; } // "If the cookie's secure-only-flag is true, then the request-uri's // scheme must denote a "secure" protocol" if (c.secure && !secure) { return false; } // "If the cookie's http-only-flag is true, then exclude the cookie if the // cookie-string is being generated for a "non-HTTP" API" if (c.httpOnly && !http) { return false; } // deferred from S5.3 // non-RFC: allow retention of expired cookies by choice if (expireCheck && c.expiryTime() <= now) { store.removeCookie(c.domain, c.path, c.key, function(){}); // result ignored return false; } return true; } store.findCookies(host, allPaths ? null : path, function(err,cookies) { if (err) { return cb(err); } cookies = cookies.filter(matchingCookie); // sorting of S5.4 part 2 if (options.sort !== false) { cookies = cookies.sort(cookieCompare); } // S5.4 part 3 var now = new Date(); cookies.forEach(function(c) { c.lastAccessed = now; }); // TODO persist lastAccessed cb(null,cookies); }); }; CAN_BE_SYNC.push('getCookieString'); CookieJar.prototype.getCookieString = function(/*..., cb*/) { var args = Array.prototype.slice.call(arguments,0); var cb = args.pop(); var next = function(err,cookies) { if (err) { cb(err); } else { cb(null, cookies .sort(cookieCompare) .map(function(c){ return c.cookieString(); }) .join('; ')); } }; args.push(next); this.getCookies.apply(this,args); }; CAN_BE_SYNC.push('getSetCookieStrings'); CookieJar.prototype.getSetCookieStrings = function(/*..., cb*/) { var args = Array.prototype.slice.call(arguments,0); var cb = args.pop(); var next = function(err,cookies) { if (err) { cb(err); } else { cb(null, cookies.map(function(c){ return c.toString(); })); } }; args.push(next); this.getCookies.apply(this,args); }; CAN_BE_SYNC.push('serialize'); CookieJar.prototype.serialize = function(cb) { var type = this.store.constructor.name; if (type === 'Object') { type = null; } // update README.md "Serialization Format" if you change this, please! var serialized = { // The version of tough-cookie that serialized this jar. Generally a good // practice since future versions can make data import decisions based on // known past behavior. When/if this matters, use `semver`. version: 'tough-cookie@'+VERSION, // add the store type, to make humans happy: storeType: type, // CookieJar configuration: rejectPublicSuffixes: !!this.rejectPublicSuffixes, // this gets filled from getAllCookies: cookies: [] }; if (!(this.store.getAllCookies && typeof this.store.getAllCookies === 'function')) { return cb(new Error('store does not support getAllCookies and cannot be serialized')); } this.store.getAllCookies(function(err,cookies) { if (err) { return cb(err); } serialized.cookies = cookies.map(function(cookie) { // convert to serialized 'raw' cookies cookie = (cookie instanceof Cookie) ? cookie.toJSON() : cookie; // Remove the index so new ones get assigned during deserialization delete cookie.creationIndex; return cookie; }); return cb(null, serialized); }); }; // well-known name that JSON.stringify calls CookieJar.prototype.toJSON = function() { return this.serializeSync(); }; // use the class method CookieJar.deserialize instead of calling this directly CAN_BE_SYNC.push('_importCookies'); CookieJar.prototype._importCookies = function(serialized, cb) { var jar = this; var cookies = serialized.cookies; if (!cookies || !Array.isArray(cookies)) { return cb(new Error('serialized jar has no cookies array')); } cookies = cookies.slice(); // do not modify the original function putNext(err) { if (err) { return cb(err); } if (!cookies.length) { return cb(err, jar); } var cookie; try { cookie = fromJSON(cookies.shift()); } catch (e) { return cb(e); } if (cookie === null) { return putNext(null); // skip this cookie } jar.store.putCookie(cookie, putNext); } putNext(); }; CookieJar.deserialize = function(strOrObj, store, cb) { if (arguments.length !== 3) { // store is optional cb = store; store = null; } var serialized; if (typeof strOrObj === 'string') { serialized = jsonParse(strOrObj); if (serialized instanceof Error) { return cb(serialized); } } else { serialized = strOrObj; } var jar = new CookieJar(store, serialized.rejectPublicSuffixes); jar._importCookies(serialized, function(err) { if (err) { return cb(err); } cb(null, jar); }); }; CookieJar.deserializeSync = function(strOrObj, store) { var serialized = typeof strOrObj === 'string' ? JSON.parse(strOrObj) : strOrObj; var jar = new CookieJar(store, serialized.rejectPublicSuffixes); // catch this mistake early: if (!jar.store.synchronous) { throw new Error('CookieJar store is not synchronous; use async API instead.'); } jar._importCookiesSync(serialized); return jar; }; CookieJar.fromJSON = CookieJar.deserializeSync; CAN_BE_SYNC.push('clone'); CookieJar.prototype.clone = function(newStore, cb) { if (arguments.length === 1) { cb = newStore; newStore = null; } this.serialize(function(err,serialized) { if (err) { return cb(err); } CookieJar.deserialize(newStore, serialized, cb); }); }; // Use a closure to provide a true imperative API for synchronous stores. function syncWrap(method) { return function() { if (!this.store.synchronous) { throw new Error('CookieJar store is not synchronous; use async API instead.'); } var args = Array.prototype.slice.call(arguments); var syncErr, syncResult; args.push(function syncCb(err, result) { syncErr = err; syncResult = result; }); this[method].apply(this, args); if (syncErr) { throw syncErr; } return syncResult; }; } // wrap all declared CAN_BE_SYNC methods in the sync wrapper CAN_BE_SYNC.forEach(function(method) { CookieJar.prototype[method+'Sync'] = syncWrap(method); }); exports.CookieJar = CookieJar; exports.Cookie = Cookie; exports.Store = Store; exports.MemoryCookieStore = MemoryCookieStore; exports.parseDate = parseDate; exports.formatDate = formatDate; exports.parse = parse; exports.fromJSON = fromJSON; exports.domainMatch = domainMatch; exports.defaultPath = defaultPath; exports.pathMatch = pathMatch; exports.getPublicSuffix = pubsuffix.getPublicSuffix; exports.cookieCompare = cookieCompare; exports.permuteDomain = __webpack_require__(90).permuteDomain; exports.permutePath = permutePath; exports.canonicalDomain = canonicalDomain; /***/ }), /* 82 */ /***/ (function(module, exports) { module.exports = require("net"); /***/ }), /* 83 */ /***/ (function(module, exports) { module.exports = require("url"); /***/ }), /* 84 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * Copyright (c) 2018, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ var psl = __webpack_require__(85); function getPublicSuffix(domain) { return psl.get(domain); } exports.getPublicSuffix = getPublicSuffix; /***/ }), /* 85 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*eslint no-var:0, prefer-arrow-callback: 0, object-shorthand: 0 */ var Punycode = __webpack_require__(86); var internals = {}; // // Read rules from file. // internals.rules = __webpack_require__(87).map(function (rule) { return { rule: rule, suffix: rule.replace(/^(\*\.|\!)/, ''), punySuffix: -1, wildcard: rule.charAt(0) === '*', exception: rule.charAt(0) === '!' }; }); // // Check is given string ends with `suffix`. // internals.endsWith = function (str, suffix) { return str.indexOf(suffix, str.length - suffix.length) !== -1; }; // // Find rule for a given domain. // internals.findRule = function (domain) { var punyDomain = Punycode.toASCII(domain); return internals.rules.reduce(function (memo, rule) { if (rule.punySuffix === -1){ rule.punySuffix = Punycode.toASCII(rule.suffix); } if (!internals.endsWith(punyDomain, '.' + rule.punySuffix) && punyDomain !== rule.punySuffix) { return memo; } // This has been commented out as it never seems to run. This is because // sub tlds always appear after their parents and we never find a shorter // match. //if (memo) { // var memoSuffix = Punycode.toASCII(memo.suffix); // if (memoSuffix.length >= punySuffix.length) { // return memo; // } //} return rule; }, null); }; // // Error codes and messages. // exports.errorCodes = { DOMAIN_TOO_SHORT: 'Domain name too short.', DOMAIN_TOO_LONG: 'Domain name too long. It should be no more than 255 chars.', LABEL_STARTS_WITH_DASH: 'Domain name label can not start with a dash.', LABEL_ENDS_WITH_DASH: 'Domain name label can not end with a dash.', LABEL_TOO_LONG: 'Domain name label should be at most 63 chars long.', LABEL_TOO_SHORT: 'Domain name label should be at least 1 character long.', LABEL_INVALID_CHARS: 'Domain name label can only contain alphanumeric characters or dashes.' }; // // Validate domain name and throw if not valid. // // From wikipedia: // // Hostnames are composed of series of labels concatenated with dots, as are all // domain names. Each label must be between 1 and 63 characters long, and the // entire hostname (including the delimiting dots) has a maximum of 255 chars. // // Allowed chars: // // * `a-z` // * `0-9` // * `-` but not as a starting or ending character // * `.` as a separator for the textual portions of a domain name // // * http://en.wikipedia.org/wiki/Domain_name // * http://en.wikipedia.org/wiki/Hostname // internals.validate = function (input) { // Before we can validate we need to take care of IDNs with unicode chars. var ascii = Punycode.toASCII(input); if (ascii.length < 1) { return 'DOMAIN_TOO_SHORT'; } if (ascii.length > 255) { return 'DOMAIN_TOO_LONG'; } // Check each part's length and allowed chars. var labels = ascii.split('.'); var label; for (var i = 0; i < labels.length; ++i) { label = labels[i]; if (!label.length) { return 'LABEL_TOO_SHORT'; } if (label.length > 63) { return 'LABEL_TOO_LONG'; } if (label.charAt(0) === '-') { return 'LABEL_STARTS_WITH_DASH'; } if (label.charAt(label.length - 1) === '-') { return 'LABEL_ENDS_WITH_DASH'; } if (!/^[a-z0-9\-]+$/.test(label)) { return 'LABEL_INVALID_CHARS'; } } }; // // Public API // // // Parse domain. // exports.parse = function (input) { if (typeof input !== 'string') { throw new TypeError('Domain name must be a string.'); } // Force domain to lowercase. var domain = input.slice(0).toLowerCase(); // Handle FQDN. // TODO: Simply remove trailing dot? if (domain.charAt(domain.length - 1) === '.') { domain = domain.slice(0, domain.length - 1); } // Validate and sanitise input. var error = internals.validate(domain); if (error) { return { input: input, error: { message: exports.errorCodes[error], code: error } }; } var parsed = { input: input, tld: null, sld: null, domain: null, subdomain: null, listed: false }; var domainParts = domain.split('.'); // Non-Internet TLD if (domainParts[domainParts.length - 1] === 'local') { return parsed; } var handlePunycode = function () { if (!/xn--/.test(domain)) { return parsed; } if (parsed.domain) { parsed.domain = Punycode.toASCII(parsed.domain); } if (parsed.subdomain) { parsed.subdomain = Punycode.toASCII(parsed.subdomain); } return parsed; }; var rule = internals.findRule(domain); // Unlisted tld. if (!rule) { if (domainParts.length < 2) { return parsed; } parsed.tld = domainParts.pop(); parsed.sld = domainParts.pop(); parsed.domain = [parsed.sld, parsed.tld].join('.'); if (domainParts.length) { parsed.subdomain = domainParts.pop(); } return handlePunycode(); } // At this point we know the public suffix is listed. parsed.listed = true; var tldParts = rule.suffix.split('.'); var privateParts = domainParts.slice(0, domainParts.length - tldParts.length); if (rule.exception) { privateParts.push(tldParts.shift()); } parsed.tld = tldParts.join('.'); if (!privateParts.length) { return handlePunycode(); } if (rule.wildcard) { tldParts.unshift(privateParts.pop()); parsed.tld = tldParts.join('.'); } if (!privateParts.length) { return handlePunycode(); } parsed.sld = privateParts.pop(); parsed.domain = [parsed.sld, parsed.tld].join('.'); if (privateParts.length) { parsed.subdomain = privateParts.join('.'); } return handlePunycode(); }; // // Get domain. // exports.get = function (domain) { if (!domain) { return null; } return exports.parse(domain).domain || null; }; // // Check whether domain belongs to a known public suffix. // exports.isValid = function (domain) { var parsed = exports.parse(domain); return Boolean(parsed.domain && parsed.listed); }; /***/ }), /* 86 */ /***/ (function(module, exports) { module.exports = require("punycode"); /***/ }), /* 87 */ /***/ (function(module) { module.exports = JSON.parse("[\"ac\",\"com.ac\",\"edu.ac\",\"gov.ac\",\"net.ac\",\"mil.ac\",\"org.ac\",\"ad\",\"nom.ad\",\"ae\",\"co.ae\",\"net.ae\",\"org.ae\",\"sch.ae\",\"ac.ae\",\"gov.ae\",\"mil.ae\",\"aero\",\"accident-investigation.aero\",\"accident-prevention.aero\",\"aerobatic.aero\",\"aeroclub.aero\",\"aerodrome.aero\",\"agents.aero\",\"aircraft.aero\",\"airline.aero\",\"airport.aero\",\"air-surveillance.aero\",\"airtraffic.aero\",\"air-traffic-control.aero\",\"ambulance.aero\",\"amusement.aero\",\"association.aero\",\"author.aero\",\"ballooning.aero\",\"broker.aero\",\"caa.aero\",\"cargo.aero\",\"catering.aero\",\"certification.aero\",\"championship.aero\",\"charter.aero\",\"civilaviation.aero\",\"club.aero\",\"conference.aero\",\"consultant.aero\",\"consulting.aero\",\"control.aero\",\"council.aero\",\"crew.aero\",\"design.aero\",\"dgca.aero\",\"educator.aero\",\"emergency.aero\",\"engine.aero\",\"engineer.aero\",\"entertainment.aero\",\"equipment.aero\",\"exchange.aero\",\"express.aero\",\"federation.aero\",\"flight.aero\",\"freight.aero\",\"fuel.aero\",\"gliding.aero\",\"government.aero\",\"groundhandling.aero\",\"group.aero\",\"hanggliding.aero\",\"homebuilt.aero\",\"insurance.aero\",\"journal.aero\",\"journalist.aero\",\"leasing.aero\",\"logistics.aero\",\"magazine.aero\",\"maintenance.aero\",\"media.aero\",\"microlight.aero\",\"modelling.aero\",\"navigation.aero\",\"parachuting.aero\",\"paragliding.aero\",\"passenger-association.aero\",\"pilot.aero\",\"press.aero\",\"production.aero\",\"recreation.aero\",\"repbody.aero\",\"res.aero\",\"research.aero\",\"rotorcraft.aero\",\"safety.aero\",\"scientist.aero\",\"services.aero\",\"show.aero\",\"skydiving.aero\",\"software.aero\",\"student.aero\",\"trader.aero\",\"trading.aero\",\"trainer.aero\",\"union.aero\",\"workinggroup.aero\",\"works.aero\",\"af\",\"gov.af\",\"com.af\",\"org.af\",\"net.af\",\"edu.af\",\"ag\",\"com.ag\",\"org.ag\",\"net.ag\",\"co.ag\",\"nom.ag\",\"ai\",\"off.ai\",\"com.ai\",\"net.ai\",\"org.ai\",\"al\",\"com.al\",\"edu.al\",\"gov.al\",\"mil.al\",\"net.al\",\"org.al\",\"am\",\"co.am\",\"com.am\",\"commune.am\",\"net.am\",\"org.am\",\"ao\",\"ed.ao\",\"gv.ao\",\"og.ao\",\"co.ao\",\"pb.ao\",\"it.ao\",\"aq\",\"ar\",\"com.ar\",\"edu.ar\",\"gob.ar\",\"gov.ar\",\"int.ar\",\"mil.ar\",\"musica.ar\",\"net.ar\",\"org.ar\",\"tur.ar\",\"arpa\",\"e164.arpa\",\"in-addr.arpa\",\"ip6.arpa\",\"iris.arpa\",\"uri.arpa\",\"urn.arpa\",\"as\",\"gov.as\",\"asia\",\"at\",\"ac.at\",\"co.at\",\"gv.at\",\"or.at\",\"au\",\"com.au\",\"net.au\",\"org.au\",\"edu.au\",\"gov.au\",\"asn.au\",\"id.au\",\"info.au\",\"conf.au\",\"oz.au\",\"act.au\",\"nsw.au\",\"nt.au\",\"qld.au\",\"sa.au\",\"tas.au\",\"vic.au\",\"wa.au\",\"act.edu.au\",\"catholic.edu.au\",\"eq.edu.au\",\"nsw.edu.au\",\"nt.edu.au\",\"qld.edu.au\",\"sa.edu.au\",\"tas.edu.au\",\"vic.edu.au\",\"wa.edu.au\",\"qld.gov.au\",\"sa.gov.au\",\"tas.gov.au\",\"vic.gov.au\",\"wa.gov.au\",\"education.tas.edu.au\",\"schools.nsw.edu.au\",\"aw\",\"com.aw\",\"ax\",\"az\",\"com.az\",\"net.az\",\"int.az\",\"gov.az\",\"org.az\",\"edu.az\",\"info.az\",\"pp.az\",\"mil.az\",\"name.az\",\"pro.az\",\"biz.az\",\"ba\",\"com.ba\",\"edu.ba\",\"gov.ba\",\"mil.ba\",\"net.ba\",\"org.ba\",\"bb\",\"biz.bb\",\"co.bb\",\"com.bb\",\"edu.bb\",\"gov.bb\",\"info.bb\",\"net.bb\",\"org.bb\",\"store.bb\",\"tv.bb\",\"*.bd\",\"be\",\"ac.be\",\"bf\",\"gov.bf\",\"bg\",\"a.bg\",\"b.bg\",\"c.bg\",\"d.bg\",\"e.bg\",\"f.bg\",\"g.bg\",\"h.bg\",\"i.bg\",\"j.bg\",\"k.bg\",\"l.bg\",\"m.bg\",\"n.bg\",\"o.bg\",\"p.bg\",\"q.bg\",\"r.bg\",\"s.bg\",\"t.bg\",\"u.bg\",\"v.bg\",\"w.bg\",\"x.bg\",\"y.bg\",\"z.bg\",\"0.bg\",\"1.bg\",\"2.bg\",\"3.bg\",\"4.bg\",\"5.bg\",\"6.bg\",\"7.bg\",\"8.bg\",\"9.bg\",\"bh\",\"com.bh\",\"edu.bh\",\"net.bh\",\"org.bh\",\"gov.bh\",\"bi\",\"co.bi\",\"com.bi\",\"edu.bi\",\"or.bi\",\"org.bi\",\"biz\",\"bj\",\"asso.bj\",\"barreau.bj\",\"gouv.bj\",\"bm\",\"com.bm\",\"edu.bm\",\"gov.bm\",\"net.bm\",\"org.bm\",\"bn\",\"com.bn\",\"edu.bn\",\"gov.bn\",\"net.bn\",\"org.bn\",\"bo\",\"com.bo\",\"edu.bo\",\"gob.bo\",\"int.bo\",\"org.bo\",\"net.bo\",\"mil.bo\",\"tv.bo\",\"web.bo\",\"academia.bo\",\"agro.bo\",\"arte.bo\",\"blog.bo\",\"bolivia.bo\",\"ciencia.bo\",\"cooperativa.bo\",\"democracia.bo\",\"deporte.bo\",\"ecologia.bo\",\"economia.bo\",\"empresa.bo\",\"indigena.bo\",\"industria.bo\",\"info.bo\",\"medicina.bo\",\"movimiento.bo\",\"musica.bo\",\"natural.bo\",\"nombre.bo\",\"noticias.bo\",\"patria.bo\",\"politica.bo\",\"profesional.bo\",\"plurinacional.bo\",\"pueblo.bo\",\"revista.bo\",\"salud.bo\",\"tecnologia.bo\",\"tksat.bo\",\"transporte.bo\",\"wiki.bo\",\"br\",\"9guacu.br\",\"abc.br\",\"adm.br\",\"adv.br\",\"agr.br\",\"aju.br\",\"am.br\",\"anani.br\",\"aparecida.br\",\"arq.br\",\"art.br\",\"ato.br\",\"b.br\",\"barueri.br\",\"belem.br\",\"bhz.br\",\"bio.br\",\"blog.br\",\"bmd.br\",\"boavista.br\",\"bsb.br\",\"campinagrande.br\",\"campinas.br\",\"caxias.br\",\"cim.br\",\"cng.br\",\"cnt.br\",\"com.br\",\"contagem.br\",\"coop.br\",\"cri.br\",\"cuiaba.br\",\"curitiba.br\",\"def.br\",\"ecn.br\",\"eco.br\",\"edu.br\",\"emp.br\",\"eng.br\",\"esp.br\",\"etc.br\",\"eti.br\",\"far.br\",\"feira.br\",\"flog.br\",\"floripa.br\",\"fm.br\",\"fnd.br\",\"fortal.br\",\"fot.br\",\"foz.br\",\"fst.br\",\"g12.br\",\"ggf.br\",\"goiania.br\",\"gov.br\",\"ac.gov.br\",\"al.gov.br\",\"am.gov.br\",\"ap.gov.br\",\"ba.gov.br\",\"ce.gov.br\",\"df.gov.br\",\"es.gov.br\",\"go.gov.br\",\"ma.gov.br\",\"mg.gov.br\",\"ms.gov.br\",\"mt.gov.br\",\"pa.gov.br\",\"pb.gov.br\",\"pe.gov.br\",\"pi.gov.br\",\"pr.gov.br\",\"rj.gov.br\",\"rn.gov.br\",\"ro.gov.br\",\"rr.gov.br\",\"rs.gov.br\",\"sc.gov.br\",\"se.gov.br\",\"sp.gov.br\",\"to.gov.br\",\"gru.br\",\"imb.br\",\"ind.br\",\"inf.br\",\"jab.br\",\"jampa.br\",\"jdf.br\",\"joinville.br\",\"jor.br\",\"jus.br\",\"leg.br\",\"lel.br\",\"londrina.br\",\"macapa.br\",\"maceio.br\",\"manaus.br\",\"maringa.br\",\"mat.br\",\"med.br\",\"mil.br\",\"morena.br\",\"mp.br\",\"mus.br\",\"natal.br\",\"net.br\",\"niteroi.br\",\"*.nom.br\",\"not.br\",\"ntr.br\",\"odo.br\",\"ong.br\",\"org.br\",\"osasco.br\",\"palmas.br\",\"poa.br\",\"ppg.br\",\"pro.br\",\"psc.br\",\"psi.br\",\"pvh.br\",\"qsl.br\",\"radio.br\",\"rec.br\",\"recife.br\",\"ribeirao.br\",\"rio.br\",\"riobranco.br\",\"riopreto.br\",\"salvador.br\",\"sampa.br\",\"santamaria.br\",\"santoandre.br\",\"saobernardo.br\",\"saogonca.br\",\"sjc.br\",\"slg.br\",\"slz.br\",\"sorocaba.br\",\"srv.br\",\"taxi.br\",\"tc.br\",\"teo.br\",\"the.br\",\"tmp.br\",\"trd.br\",\"tur.br\",\"tv.br\",\"udi.br\",\"vet.br\",\"vix.br\",\"vlog.br\",\"wiki.br\",\"zlg.br\",\"bs\",\"com.bs\",\"net.bs\",\"org.bs\",\"edu.bs\",\"gov.bs\",\"bt\",\"com.bt\",\"edu.bt\",\"gov.bt\",\"net.bt\",\"org.bt\",\"bv\",\"bw\",\"co.bw\",\"org.bw\",\"by\",\"gov.by\",\"mil.by\",\"com.by\",\"of.by\",\"bz\",\"com.bz\",\"net.bz\",\"org.bz\",\"edu.bz\",\"gov.bz\",\"ca\",\"ab.ca\",\"bc.ca\",\"mb.ca\",\"nb.ca\",\"nf.ca\",\"nl.ca\",\"ns.ca\",\"nt.ca\",\"nu.ca\",\"on.ca\",\"pe.ca\",\"qc.ca\",\"sk.ca\",\"yk.ca\",\"gc.ca\",\"cat\",\"cc\",\"cd\",\"gov.cd\",\"cf\",\"cg\",\"ch\",\"ci\",\"org.ci\",\"or.ci\",\"com.ci\",\"co.ci\",\"edu.ci\",\"ed.ci\",\"ac.ci\",\"net.ci\",\"go.ci\",\"asso.ci\",\"aéroport.ci\",\"int.ci\",\"presse.ci\",\"md.ci\",\"gouv.ci\",\"*.ck\",\"!www.ck\",\"cl\",\"gov.cl\",\"gob.cl\",\"co.cl\",\"mil.cl\",\"cm\",\"co.cm\",\"com.cm\",\"gov.cm\",\"net.cm\",\"cn\",\"ac.cn\",\"com.cn\",\"edu.cn\",\"gov.cn\",\"net.cn\",\"org.cn\",\"mil.cn\",\"公司.cn\",\"网络.cn\",\"網絡.cn\",\"ah.cn\",\"bj.cn\",\"cq.cn\",\"fj.cn\",\"gd.cn\",\"gs.cn\",\"gz.cn\",\"gx.cn\",\"ha.cn\",\"hb.cn\",\"he.cn\",\"hi.cn\",\"hl.cn\",\"hn.cn\",\"jl.cn\",\"js.cn\",\"jx.cn\",\"ln.cn\",\"nm.cn\",\"nx.cn\",\"qh.cn\",\"sc.cn\",\"sd.cn\",\"sh.cn\",\"sn.cn\",\"sx.cn\",\"tj.cn\",\"xj.cn\",\"xz.cn\",\"yn.cn\",\"zj.cn\",\"hk.cn\",\"mo.cn\",\"tw.cn\",\"co\",\"arts.co\",\"com.co\",\"edu.co\",\"firm.co\",\"gov.co\",\"info.co\",\"int.co\",\"mil.co\",\"net.co\",\"nom.co\",\"org.co\",\"rec.co\",\"web.co\",\"com\",\"coop\",\"cr\",\"ac.cr\",\"co.cr\",\"ed.cr\",\"fi.cr\",\"go.cr\",\"or.cr\",\"sa.cr\",\"cu\",\"com.cu\",\"edu.cu\",\"org.cu\",\"net.cu\",\"gov.cu\",\"inf.cu\",\"cv\",\"cw\",\"com.cw\",\"edu.cw\",\"net.cw\",\"org.cw\",\"cx\",\"gov.cx\",\"cy\",\"ac.cy\",\"biz.cy\",\"com.cy\",\"ekloges.cy\",\"gov.cy\",\"ltd.cy\",\"name.cy\",\"net.cy\",\"org.cy\",\"parliament.cy\",\"press.cy\",\"pro.cy\",\"tm.cy\",\"cz\",\"de\",\"dj\",\"dk\",\"dm\",\"com.dm\",\"net.dm\",\"org.dm\",\"edu.dm\",\"gov.dm\",\"do\",\"art.do\",\"com.do\",\"edu.do\",\"gob.do\",\"gov.do\",\"mil.do\",\"net.do\",\"org.do\",\"sld.do\",\"web.do\",\"dz\",\"com.dz\",\"org.dz\",\"net.dz\",\"gov.dz\",\"edu.dz\",\"asso.dz\",\"pol.dz\",\"art.dz\",\"ec\",\"com.ec\",\"info.ec\",\"net.ec\",\"fin.ec\",\"k12.ec\",\"med.ec\",\"pro.ec\",\"org.ec\",\"edu.ec\",\"gov.ec\",\"gob.ec\",\"mil.ec\",\"edu\",\"ee\",\"edu.ee\",\"gov.ee\",\"riik.ee\",\"lib.ee\",\"med.ee\",\"com.ee\",\"pri.ee\",\"aip.ee\",\"org.ee\",\"fie.ee\",\"eg\",\"com.eg\",\"edu.eg\",\"eun.eg\",\"gov.eg\",\"mil.eg\",\"name.eg\",\"net.eg\",\"org.eg\",\"sci.eg\",\"*.er\",\"es\",\"com.es\",\"nom.es\",\"org.es\",\"gob.es\",\"edu.es\",\"et\",\"com.et\",\"gov.et\",\"org.et\",\"edu.et\",\"biz.et\",\"name.et\",\"info.et\",\"net.et\",\"eu\",\"fi\",\"aland.fi\",\"*.fj\",\"*.fk\",\"fm\",\"fo\",\"fr\",\"asso.fr\",\"com.fr\",\"gouv.fr\",\"nom.fr\",\"prd.fr\",\"tm.fr\",\"aeroport.fr\",\"avocat.fr\",\"avoues.fr\",\"cci.fr\",\"chambagri.fr\",\"chirurgiens-dentistes.fr\",\"experts-comptables.fr\",\"geometre-expert.fr\",\"greta.fr\",\"huissier-justice.fr\",\"medecin.fr\",\"notaires.fr\",\"pharmacien.fr\",\"port.fr\",\"veterinaire.fr\",\"ga\",\"gb\",\"gd\",\"ge\",\"com.ge\",\"edu.ge\",\"gov.ge\",\"org.ge\",\"mil.ge\",\"net.ge\",\"pvt.ge\",\"gf\",\"gg\",\"co.gg\",\"net.gg\",\"org.gg\",\"gh\",\"com.gh\",\"edu.gh\",\"gov.gh\",\"org.gh\",\"mil.gh\",\"gi\",\"com.gi\",\"ltd.gi\",\"gov.gi\",\"mod.gi\",\"edu.gi\",\"org.gi\",\"gl\",\"co.gl\",\"com.gl\",\"edu.gl\",\"net.gl\",\"org.gl\",\"gm\",\"gn\",\"ac.gn\",\"com.gn\",\"edu.gn\",\"gov.gn\",\"org.gn\",\"net.gn\",\"gov\",\"gp\",\"com.gp\",\"net.gp\",\"mobi.gp\",\"edu.gp\",\"org.gp\",\"asso.gp\",\"gq\",\"gr\",\"com.gr\",\"edu.gr\",\"net.gr\",\"org.gr\",\"gov.gr\",\"gs\",\"gt\",\"com.gt\",\"edu.gt\",\"gob.gt\",\"ind.gt\",\"mil.gt\",\"net.gt\",\"org.gt\",\"gu\",\"com.gu\",\"edu.gu\",\"gov.gu\",\"guam.gu\",\"info.gu\",\"net.gu\",\"org.gu\",\"web.gu\",\"gw\",\"gy\",\"co.gy\",\"com.gy\",\"edu.gy\",\"gov.gy\",\"net.gy\",\"org.gy\",\"hk\",\"com.hk\",\"edu.hk\",\"gov.hk\",\"idv.hk\",\"net.hk\",\"org.hk\",\"公司.hk\",\"教育.hk\",\"敎育.hk\",\"政府.hk\",\"個人.hk\",\"个人.hk\",\"箇人.hk\",\"網络.hk\",\"网络.hk\",\"组織.hk\",\"網絡.hk\",\"网絡.hk\",\"组织.hk\",\"組織.hk\",\"組织.hk\",\"hm\",\"hn\",\"com.hn\",\"edu.hn\",\"org.hn\",\"net.hn\",\"mil.hn\",\"gob.hn\",\"hr\",\"iz.hr\",\"from.hr\",\"name.hr\",\"com.hr\",\"ht\",\"com.ht\",\"shop.ht\",\"firm.ht\",\"info.ht\",\"adult.ht\",\"net.ht\",\"pro.ht\",\"org.ht\",\"med.ht\",\"art.ht\",\"coop.ht\",\"pol.ht\",\"asso.ht\",\"edu.ht\",\"rel.ht\",\"gouv.ht\",\"perso.ht\",\"hu\",\"co.hu\",\"info.hu\",\"org.hu\",\"priv.hu\",\"sport.hu\",\"tm.hu\",\"2000.hu\",\"agrar.hu\",\"bolt.hu\",\"casino.hu\",\"city.hu\",\"erotica.hu\",\"erotika.hu\",\"film.hu\",\"forum.hu\",\"games.hu\",\"hotel.hu\",\"ingatlan.hu\",\"jogasz.hu\",\"konyvelo.hu\",\"lakas.hu\",\"media.hu\",\"news.hu\",\"reklam.hu\",\"sex.hu\",\"shop.hu\",\"suli.hu\",\"szex.hu\",\"tozsde.hu\",\"utazas.hu\",\"video.hu\",\"id\",\"ac.id\",\"biz.id\",\"co.id\",\"desa.id\",\"go.id\",\"mil.id\",\"my.id\",\"net.id\",\"or.id\",\"ponpes.id\",\"sch.id\",\"web.id\",\"ie\",\"gov.ie\",\"il\",\"ac.il\",\"co.il\",\"gov.il\",\"idf.il\",\"k12.il\",\"muni.il\",\"net.il\",\"org.il\",\"im\",\"ac.im\",\"co.im\",\"com.im\",\"ltd.co.im\",\"net.im\",\"org.im\",\"plc.co.im\",\"tt.im\",\"tv.im\",\"in\",\"co.in\",\"firm.in\",\"net.in\",\"org.in\",\"gen.in\",\"ind.in\",\"nic.in\",\"ac.in\",\"edu.in\",\"res.in\",\"gov.in\",\"mil.in\",\"info\",\"int\",\"eu.int\",\"io\",\"com.io\",\"iq\",\"gov.iq\",\"edu.iq\",\"mil.iq\",\"com.iq\",\"org.iq\",\"net.iq\",\"ir\",\"ac.ir\",\"co.ir\",\"gov.ir\",\"id.ir\",\"net.ir\",\"org.ir\",\"sch.ir\",\"ایران.ir\",\"ايران.ir\",\"is\",\"net.is\",\"com.is\",\"edu.is\",\"gov.is\",\"org.is\",\"int.is\",\"it\",\"gov.it\",\"edu.it\",\"abr.it\",\"abruzzo.it\",\"aosta-valley.it\",\"aostavalley.it\",\"bas.it\",\"basilicata.it\",\"cal.it\",\"calabria.it\",\"cam.it\",\"campania.it\",\"emilia-romagna.it\",\"emiliaromagna.it\",\"emr.it\",\"friuli-v-giulia.it\",\"friuli-ve-giulia.it\",\"friuli-vegiulia.it\",\"friuli-venezia-giulia.it\",\"friuli-veneziagiulia.it\",\"friuli-vgiulia.it\",\"friuliv-giulia.it\",\"friulive-giulia.it\",\"friulivegiulia.it\",\"friulivenezia-giulia.it\",\"friuliveneziagiulia.it\",\"friulivgiulia.it\",\"fvg.it\",\"laz.it\",\"lazio.it\",\"lig.it\",\"liguria.it\",\"lom.it\",\"lombardia.it\",\"lombardy.it\",\"lucania.it\",\"mar.it\",\"marche.it\",\"mol.it\",\"molise.it\",\"piedmont.it\",\"piemonte.it\",\"pmn.it\",\"pug.it\",\"puglia.it\",\"sar.it\",\"sardegna.it\",\"sardinia.it\",\"sic.it\",\"sicilia.it\",\"sicily.it\",\"taa.it\",\"tos.it\",\"toscana.it\",\"trentin-sud-tirol.it\",\"trentin-süd-tirol.it\",\"trentin-sudtirol.it\",\"trentin-südtirol.it\",\"trentin-sued-tirol.it\",\"trentin-suedtirol.it\",\"trentino-a-adige.it\",\"trentino-aadige.it\",\"trentino-alto-adige.it\",\"trentino-altoadige.it\",\"trentino-s-tirol.it\",\"trentino-stirol.it\",\"trentino-sud-tirol.it\",\"trentino-süd-tirol.it\",\"trentino-sudtirol.it\",\"trentino-südtirol.it\",\"trentino-sued-tirol.it\",\"trentino-suedtirol.it\",\"trentino.it\",\"trentinoa-adige.it\",\"trentinoaadige.it\",\"trentinoalto-adige.it\",\"trentinoaltoadige.it\",\"trentinos-tirol.it\",\"trentinostirol.it\",\"trentinosud-tirol.it\",\"trentinosüd-tirol.it\",\"trentinosudtirol.it\",\"trentinosüdtirol.it\",\"trentinosued-tirol.it\",\"trentinosuedtirol.it\",\"trentinsud-tirol.it\",\"trentinsüd-tirol.it\",\"trentinsudtirol.it\",\"trentinsüdtirol.it\",\"trentinsued-tirol.it\",\"trentinsuedtirol.it\",\"tuscany.it\",\"umb.it\",\"umbria.it\",\"val-d-aosta.it\",\"val-daosta.it\",\"vald-aosta.it\",\"valdaosta.it\",\"valle-aosta.it\",\"valle-d-aosta.it\",\"valle-daosta.it\",\"valleaosta.it\",\"valled-aosta.it\",\"valledaosta.it\",\"vallee-aoste.it\",\"vallée-aoste.it\",\"vallee-d-aoste.it\",\"vallée-d-aoste.it\",\"valleeaoste.it\",\"valléeaoste.it\",\"valleedaoste.it\",\"valléedaoste.it\",\"vao.it\",\"vda.it\",\"ven.it\",\"veneto.it\",\"ag.it\",\"agrigento.it\",\"al.it\",\"alessandria.it\",\"alto-adige.it\",\"altoadige.it\",\"an.it\",\"ancona.it\",\"andria-barletta-trani.it\",\"andria-trani-barletta.it\",\"andriabarlettatrani.it\",\"andriatranibarletta.it\",\"ao.it\",\"aosta.it\",\"aoste.it\",\"ap.it\",\"aq.it\",\"aquila.it\",\"ar.it\",\"arezzo.it\",\"ascoli-piceno.it\",\"ascolipiceno.it\",\"asti.it\",\"at.it\",\"av.it\",\"avellino.it\",\"ba.it\",\"balsan-sudtirol.it\",\"balsan-südtirol.it\",\"balsan-suedtirol.it\",\"balsan.it\",\"bari.it\",\"barletta-trani-andria.it\",\"barlettatraniandria.it\",\"belluno.it\",\"benevento.it\",\"bergamo.it\",\"bg.it\",\"bi.it\",\"biella.it\",\"bl.it\",\"bn.it\",\"bo.it\",\"bologna.it\",\"bolzano-altoadige.it\",\"bolzano.it\",\"bozen-sudtirol.it\",\"bozen-südtirol.it\",\"bozen-suedtirol.it\",\"bozen.it\",\"br.it\",\"brescia.it\",\"brindisi.it\",\"bs.it\",\"bt.it\",\"bulsan-sudtirol.it\",\"bulsan-südtirol.it\",\"bulsan-suedtirol.it\",\"bulsan.it\",\"bz.it\",\"ca.it\",\"cagliari.it\",\"caltanissetta.it\",\"campidano-medio.it\",\"campidanomedio.it\",\"campobasso.it\",\"carbonia-iglesias.it\",\"carboniaiglesias.it\",\"carrara-massa.it\",\"carraramassa.it\",\"caserta.it\",\"catania.it\",\"catanzaro.it\",\"cb.it\",\"ce.it\",\"cesena-forli.it\",\"cesena-forlì.it\",\"cesenaforli.it\",\"cesenaforlì.it\",\"ch.it\",\"chieti.it\",\"ci.it\",\"cl.it\",\"cn.it\",\"co.it\",\"como.it\",\"cosenza.it\",\"cr.it\",\"cremona.it\",\"crotone.it\",\"cs.it\",\"ct.it\",\"cuneo.it\",\"cz.it\",\"dell-ogliastra.it\",\"dellogliastra.it\",\"en.it\",\"enna.it\",\"fc.it\",\"fe.it\",\"fermo.it\",\"ferrara.it\",\"fg.it\",\"fi.it\",\"firenze.it\",\"florence.it\",\"fm.it\",\"foggia.it\",\"forli-cesena.it\",\"forlì-cesena.it\",\"forlicesena.it\",\"forlìcesena.it\",\"fr.it\",\"frosinone.it\",\"ge.it\",\"genoa.it\",\"genova.it\",\"go.it\",\"gorizia.it\",\"gr.it\",\"grosseto.it\",\"iglesias-carbonia.it\",\"iglesiascarbonia.it\",\"im.it\",\"imperia.it\",\"is.it\",\"isernia.it\",\"kr.it\",\"la-spezia.it\",\"laquila.it\",\"laspezia.it\",\"latina.it\",\"lc.it\",\"le.it\",\"lecce.it\",\"lecco.it\",\"li.it\",\"livorno.it\",\"lo.it\",\"lodi.it\",\"lt.it\",\"lu.it\",\"lucca.it\",\"macerata.it\",\"mantova.it\",\"massa-carrara.it\",\"massacarrara.it\",\"matera.it\",\"mb.it\",\"mc.it\",\"me.it\",\"medio-campidano.it\",\"mediocampidano.it\",\"messina.it\",\"mi.it\",\"milan.it\",\"milano.it\",\"mn.it\",\"mo.it\",\"modena.it\",\"monza-brianza.it\",\"monza-e-della-brianza.it\",\"monza.it\",\"monzabrianza.it\",\"monzaebrianza.it\",\"monzaedellabrianza.it\",\"ms.it\",\"mt.it\",\"na.it\",\"naples.it\",\"napoli.it\",\"no.it\",\"novara.it\",\"nu.it\",\"nuoro.it\",\"og.it\",\"ogliastra.it\",\"olbia-tempio.it\",\"olbiatempio.it\",\"or.it\",\"oristano.it\",\"ot.it\",\"pa.it\",\"padova.it\",\"padua.it\",\"palermo.it\",\"parma.it\",\"pavia.it\",\"pc.it\",\"pd.it\",\"pe.it\",\"perugia.it\",\"pesaro-urbino.it\",\"pesarourbino.it\",\"pescara.it\",\"pg.it\",\"pi.it\",\"piacenza.it\",\"pisa.it\",\"pistoia.it\",\"pn.it\",\"po.it\",\"pordenone.it\",\"potenza.it\",\"pr.it\",\"prato.it\",\"pt.it\",\"pu.it\",\"pv.it\",\"pz.it\",\"ra.it\",\"ragusa.it\",\"ravenna.it\",\"rc.it\",\"re.it\",\"reggio-calabria.it\",\"reggio-emilia.it\",\"reggiocalabria.it\",\"reggioemilia.it\",\"rg.it\",\"ri.it\",\"rieti.it\",\"rimini.it\",\"rm.it\",\"rn.it\",\"ro.it\",\"roma.it\",\"rome.it\",\"rovigo.it\",\"sa.it\",\"salerno.it\",\"sassari.it\",\"savona.it\",\"si.it\",\"siena.it\",\"siracusa.it\",\"so.it\",\"sondrio.it\",\"sp.it\",\"sr.it\",\"ss.it\",\"suedtirol.it\",\"südtirol.it\",\"sv.it\",\"ta.it\",\"taranto.it\",\"te.it\",\"tempio-olbia.it\",\"tempioolbia.it\",\"teramo.it\",\"terni.it\",\"tn.it\",\"to.it\",\"torino.it\",\"tp.it\",\"tr.it\",\"trani-andria-barletta.it\",\"trani-barletta-andria.it\",\"traniandriabarletta.it\",\"tranibarlettaandria.it\",\"trapani.it\",\"trento.it\",\"treviso.it\",\"trieste.it\",\"ts.it\",\"turin.it\",\"tv.it\",\"ud.it\",\"udine.it\",\"urbino-pesaro.it\",\"urbinopesaro.it\",\"va.it\",\"varese.it\",\"vb.it\",\"vc.it\",\"ve.it\",\"venezia.it\",\"venice.it\",\"verbania.it\",\"vercelli.it\",\"verona.it\",\"vi.it\",\"vibo-valentia.it\",\"vibovalentia.it\",\"vicenza.it\",\"viterbo.it\",\"vr.it\",\"vs.it\",\"vt.it\",\"vv.it\",\"je\",\"co.je\",\"net.je\",\"org.je\",\"*.jm\",\"jo\",\"com.jo\",\"org.jo\",\"net.jo\",\"edu.jo\",\"sch.jo\",\"gov.jo\",\"mil.jo\",\"name.jo\",\"jobs\",\"jp\",\"ac.jp\",\"ad.jp\",\"co.jp\",\"ed.jp\",\"go.jp\",\"gr.jp\",\"lg.jp\",\"ne.jp\",\"or.jp\",\"aichi.jp\",\"akita.jp\",\"aomori.jp\",\"chiba.jp\",\"ehime.jp\",\"fukui.jp\",\"fukuoka.jp\",\"fukushima.jp\",\"gifu.jp\",\"gunma.jp\",\"hiroshima.jp\",\"hokkaido.jp\",\"hyogo.jp\",\"ibaraki.jp\",\"ishikawa.jp\",\"iwate.jp\",\"kagawa.jp\",\"kagoshima.jp\",\"kanagawa.jp\",\"kochi.jp\",\"kumamoto.jp\",\"kyoto.jp\",\"mie.jp\",\"miyagi.jp\",\"miyazaki.jp\",\"nagano.jp\",\"nagasaki.jp\",\"nara.jp\",\"niigata.jp\",\"oita.jp\",\"okayama.jp\",\"okinawa.jp\",\"osaka.jp\",\"saga.jp\",\"saitama.jp\",\"shiga.jp\",\"shimane.jp\",\"shizuoka.jp\",\"tochigi.jp\",\"tokushima.jp\",\"tokyo.jp\",\"tottori.jp\",\"toyama.jp\",\"wakayama.jp\",\"yamagata.jp\",\"yamaguchi.jp\",\"yamanashi.jp\",\"栃木.jp\",\"愛知.jp\",\"愛媛.jp\",\"兵庫.jp\",\"熊本.jp\",\"茨城.jp\",\"北海道.jp\",\"千葉.jp\",\"和歌山.jp\",\"長崎.jp\",\"長野.jp\",\"新潟.jp\",\"青森.jp\",\"静岡.jp\",\"東京.jp\",\"石川.jp\",\"埼玉.jp\",\"三重.jp\",\"京都.jp\",\"佐賀.jp\",\"大分.jp\",\"大阪.jp\",\"奈良.jp\",\"宮城.jp\",\"宮崎.jp\",\"富山.jp\",\"山口.jp\",\"山形.jp\",\"山梨.jp\",\"岩手.jp\",\"岐阜.jp\",\"岡山.jp\",\"島根.jp\",\"広島.jp\",\"徳島.jp\",\"沖縄.jp\",\"滋賀.jp\",\"神奈川.jp\",\"福井.jp\",\"福岡.jp\",\"福島.jp\",\"秋田.jp\",\"群馬.jp\",\"香川.jp\",\"高知.jp\",\"鳥取.jp\",\"鹿児島.jp\",\"*.kawasaki.jp\",\"*.kitakyushu.jp\",\"*.kobe.jp\",\"*.nagoya.jp\",\"*.sapporo.jp\",\"*.sendai.jp\",\"*.yokohama.jp\",\"!city.kawasaki.jp\",\"!city.kitakyushu.jp\",\"!city.kobe.jp\",\"!city.nagoya.jp\",\"!city.sapporo.jp\",\"!city.sendai.jp\",\"!city.yokohama.jp\",\"aisai.aichi.jp\",\"ama.aichi.jp\",\"anjo.aichi.jp\",\"asuke.aichi.jp\",\"chiryu.aichi.jp\",\"chita.aichi.jp\",\"fuso.aichi.jp\",\"gamagori.aichi.jp\",\"handa.aichi.jp\",\"hazu.aichi.jp\",\"hekinan.aichi.jp\",\"higashiura.aichi.jp\",\"ichinomiya.aichi.jp\",\"inazawa.aichi.jp\",\"inuyama.aichi.jp\",\"isshiki.aichi.jp\",\"iwakura.aichi.jp\",\"kanie.aichi.jp\",\"kariya.aichi.jp\",\"kasugai.aichi.jp\",\"kira.aichi.jp\",\"kiyosu.aichi.jp\",\"komaki.aichi.jp\",\"konan.aichi.jp\",\"kota.aichi.jp\",\"mihama.aichi.jp\",\"miyoshi.aichi.jp\",\"nishio.aichi.jp\",\"nisshin.aichi.jp\",\"obu.aichi.jp\",\"oguchi.aichi.jp\",\"oharu.aichi.jp\",\"okazaki.aichi.jp\",\"owariasahi.aichi.jp\",\"seto.aichi.jp\",\"shikatsu.aichi.jp\",\"shinshiro.aichi.jp\",\"shitara.aichi.jp\",\"tahara.aichi.jp\",\"takahama.aichi.jp\",\"tobishima.aichi.jp\",\"toei.aichi.jp\",\"togo.aichi.jp\",\"tokai.aichi.jp\",\"tokoname.aichi.jp\",\"toyoake.aichi.jp\",\"toyohashi.aichi.jp\",\"toyokawa.aichi.jp\",\"toyone.aichi.jp\",\"toyota.aichi.jp\",\"tsushima.aichi.jp\",\"yatomi.aichi.jp\",\"akita.akita.jp\",\"daisen.akita.jp\",\"fujisato.akita.jp\",\"gojome.akita.jp\",\"hachirogata.akita.jp\",\"happou.akita.jp\",\"higashinaruse.akita.jp\",\"honjo.akita.jp\",\"honjyo.akita.jp\",\"ikawa.akita.jp\",\"kamikoani.akita.jp\",\"kamioka.akita.jp\",\"katagami.akita.jp\",\"kazuno.akita.jp\",\"kitaakita.akita.jp\",\"kosaka.akita.jp\",\"kyowa.akita.jp\",\"misato.akita.jp\",\"mitane.akita.jp\",\"moriyoshi.akita.jp\",\"nikaho.akita.jp\",\"noshiro.akita.jp\",\"odate.akita.jp\",\"oga.akita.jp\",\"ogata.akita.jp\",\"semboku.akita.jp\",\"yokote.akita.jp\",\"yurihonjo.akita.jp\",\"aomori.aomori.jp\",\"gonohe.aomori.jp\",\"hachinohe.aomori.jp\",\"hashikami.aomori.jp\",\"hiranai.aomori.jp\",\"hirosaki.aomori.jp\",\"itayanagi.aomori.jp\",\"kuroishi.aomori.jp\",\"misawa.aomori.jp\",\"mutsu.aomori.jp\",\"nakadomari.aomori.jp\",\"noheji.aomori.jp\",\"oirase.aomori.jp\",\"owani.aomori.jp\",\"rokunohe.aomori.jp\",\"sannohe.aomori.jp\",\"shichinohe.aomori.jp\",\"shingo.aomori.jp\",\"takko.aomori.jp\",\"towada.aomori.jp\",\"tsugaru.aomori.jp\",\"tsuruta.aomori.jp\",\"abiko.chiba.jp\",\"asahi.chiba.jp\",\"chonan.chiba.jp\",\"chosei.chiba.jp\",\"choshi.chiba.jp\",\"chuo.chiba.jp\",\"funabashi.chiba.jp\",\"futtsu.chiba.jp\",\"hanamigawa.chiba.jp\",\"ichihara.chiba.jp\",\"ichikawa.chiba.jp\",\"ichinomiya.chiba.jp\",\"inzai.chiba.jp\",\"isumi.chiba.jp\",\"kamagaya.chiba.jp\",\"kamogawa.chiba.jp\",\"kashiwa.chiba.jp\",\"katori.chiba.jp\",\"katsuura.chiba.jp\",\"kimitsu.chiba.jp\",\"kisarazu.chiba.jp\",\"kozaki.chiba.jp\",\"kujukuri.chiba.jp\",\"kyonan.chiba.jp\",\"matsudo.chiba.jp\",\"midori.chiba.jp\",\"mihama.chiba.jp\",\"minamiboso.chiba.jp\",\"mobara.chiba.jp\",\"mutsuzawa.chiba.jp\",\"nagara.chiba.jp\",\"nagareyama.chiba.jp\",\"narashino.chiba.jp\",\"narita.chiba.jp\",\"noda.chiba.jp\",\"oamishirasato.chiba.jp\",\"omigawa.chiba.jp\",\"onjuku.chiba.jp\",\"otaki.chiba.jp\",\"sakae.chiba.jp\",\"sakura.chiba.jp\",\"shimofusa.chiba.jp\",\"shirako.chiba.jp\",\"shiroi.chiba.jp\",\"shisui.chiba.jp\",\"sodegaura.chiba.jp\",\"sosa.chiba.jp\",\"tako.chiba.jp\",\"tateyama.chiba.jp\",\"togane.chiba.jp\",\"tohnosho.chiba.jp\",\"tomisato.chiba.jp\",\"urayasu.chiba.jp\",\"yachimata.chiba.jp\",\"yachiyo.chiba.jp\",\"yokaichiba.chiba.jp\",\"yokoshibahikari.chiba.jp\",\"yotsukaido.chiba.jp\",\"ainan.ehime.jp\",\"honai.ehime.jp\",\"ikata.ehime.jp\",\"imabari.ehime.jp\",\"iyo.ehime.jp\",\"kamijima.ehime.jp\",\"kihoku.ehime.jp\",\"kumakogen.ehime.jp\",\"masaki.ehime.jp\",\"matsuno.ehime.jp\",\"matsuyama.ehime.jp\",\"namikata.ehime.jp\",\"niihama.ehime.jp\",\"ozu.ehime.jp\",\"saijo.ehime.jp\",\"seiyo.ehime.jp\",\"shikokuchuo.ehime.jp\",\"tobe.ehime.jp\",\"toon.ehime.jp\",\"uchiko.ehime.jp\",\"uwajima.ehime.jp\",\"yawatahama.ehime.jp\",\"echizen.fukui.jp\",\"eiheiji.fukui.jp\",\"fukui.fukui.jp\",\"ikeda.fukui.jp\",\"katsuyama.fukui.jp\",\"mihama.fukui.jp\",\"minamiechizen.fukui.jp\",\"obama.fukui.jp\",\"ohi.fukui.jp\",\"ono.fukui.jp\",\"sabae.fukui.jp\",\"sakai.fukui.jp\",\"takahama.fukui.jp\",\"tsuruga.fukui.jp\",\"wakasa.fukui.jp\",\"ashiya.fukuoka.jp\",\"buzen.fukuoka.jp\",\"chikugo.fukuoka.jp\",\"chikuho.fukuoka.jp\",\"chikujo.fukuoka.jp\",\"chikushino.fukuoka.jp\",\"chikuzen.fukuoka.jp\",\"chuo.fukuoka.jp\",\"dazaifu.fukuoka.jp\",\"fukuchi.fukuoka.jp\",\"hakata.fukuoka.jp\",\"higashi.fukuoka.jp\",\"hirokawa.fukuoka.jp\",\"hisayama.fukuoka.jp\",\"iizuka.fukuoka.jp\",\"inatsuki.fukuoka.jp\",\"kaho.fukuoka.jp\",\"kasuga.fukuoka.jp\",\"kasuya.fukuoka.jp\",\"kawara.fukuoka.jp\",\"keisen.fukuoka.jp\",\"koga.fukuoka.jp\",\"kurate.fukuoka.jp\",\"kurogi.fukuoka.jp\",\"kurume.fukuoka.jp\",\"minami.fukuoka.jp\",\"miyako.fukuoka.jp\",\"miyama.fukuoka.jp\",\"miyawaka.fukuoka.jp\",\"mizumaki.fukuoka.jp\",\"munakata.fukuoka.jp\",\"nakagawa.fukuoka.jp\",\"nakama.fukuoka.jp\",\"nishi.fukuoka.jp\",\"nogata.fukuoka.jp\",\"ogori.fukuoka.jp\",\"okagaki.fukuoka.jp\",\"okawa.fukuoka.jp\",\"oki.fukuoka.jp\",\"omuta.fukuoka.jp\",\"onga.fukuoka.jp\",\"onojo.fukuoka.jp\",\"oto.fukuoka.jp\",\"saigawa.fukuoka.jp\",\"sasaguri.fukuoka.jp\",\"shingu.fukuoka.jp\",\"shinyoshitomi.fukuoka.jp\",\"shonai.fukuoka.jp\",\"soeda.fukuoka.jp\",\"sue.fukuoka.jp\",\"tachiarai.fukuoka.jp\",\"tagawa.fukuoka.jp\",\"takata.fukuoka.jp\",\"toho.fukuoka.jp\",\"toyotsu.fukuoka.jp\",\"tsuiki.fukuoka.jp\",\"ukiha.fukuoka.jp\",\"umi.fukuoka.jp\",\"usui.fukuoka.jp\",\"yamada.fukuoka.jp\",\"yame.fukuoka.jp\",\"yanagawa.fukuoka.jp\",\"yukuhashi.fukuoka.jp\",\"aizubange.fukushima.jp\",\"aizumisato.fukushima.jp\",\"aizuwakamatsu.fukushima.jp\",\"asakawa.fukushima.jp\",\"bandai.fukushima.jp\",\"date.fukushima.jp\",\"fukushima.fukushima.jp\",\"furudono.fukushima.jp\",\"futaba.fukushima.jp\",\"hanawa.fukushima.jp\",\"higashi.fukushima.jp\",\"hirata.fukushima.jp\",\"hirono.fukushima.jp\",\"iitate.fukushima.jp\",\"inawashiro.fukushima.jp\",\"ishikawa.fukushima.jp\",\"iwaki.fukushima.jp\",\"izumizaki.fukushima.jp\",\"kagamiishi.fukushima.jp\",\"kaneyama.fukushima.jp\",\"kawamata.fukushima.jp\",\"kitakata.fukushima.jp\",\"kitashiobara.fukushima.jp\",\"koori.fukushima.jp\",\"koriyama.fukushima.jp\",\"kunimi.fukushima.jp\",\"miharu.fukushima.jp\",\"mishima.fukushima.jp\",\"namie.fukushima.jp\",\"nango.fukushima.jp\",\"nishiaizu.fukushima.jp\",\"nishigo.fukushima.jp\",\"okuma.fukushima.jp\",\"omotego.fukushima.jp\",\"ono.fukushima.jp\",\"otama.fukushima.jp\",\"samegawa.fukushima.jp\",\"shimogo.fukushima.jp\",\"shirakawa.fukushima.jp\",\"showa.fukushima.jp\",\"soma.fukushima.jp\",\"sukagawa.fukushima.jp\",\"taishin.fukushima.jp\",\"tamakawa.fukushima.jp\",\"tanagura.fukushima.jp\",\"tenei.fukushima.jp\",\"yabuki.fukushima.jp\",\"yamato.fukushima.jp\",\"yamatsuri.fukushima.jp\",\"yanaizu.fukushima.jp\",\"yugawa.fukushima.jp\",\"anpachi.gifu.jp\",\"ena.gifu.jp\",\"gifu.gifu.jp\",\"ginan.gifu.jp\",\"godo.gifu.jp\",\"gujo.gifu.jp\",\"hashima.gifu.jp\",\"hichiso.gifu.jp\",\"hida.gifu.jp\",\"higashishirakawa.gifu.jp\",\"ibigawa.gifu.jp\",\"ikeda.gifu.jp\",\"kakamigahara.gifu.jp\",\"kani.gifu.jp\",\"kasahara.gifu.jp\",\"kasamatsu.gifu.jp\",\"kawaue.gifu.jp\",\"kitagata.gifu.jp\",\"mino.gifu.jp\",\"minokamo.gifu.jp\",\"mitake.gifu.jp\",\"mizunami.gifu.jp\",\"motosu.gifu.jp\",\"nakatsugawa.gifu.jp\",\"ogaki.gifu.jp\",\"sakahogi.gifu.jp\",\"seki.gifu.jp\",\"sekigahara.gifu.jp\",\"shirakawa.gifu.jp\",\"tajimi.gifu.jp\",\"takayama.gifu.jp\",\"tarui.gifu.jp\",\"toki.gifu.jp\",\"tomika.gifu.jp\",\"wanouchi.gifu.jp\",\"yamagata.gifu.jp\",\"yaotsu.gifu.jp\",\"yoro.gifu.jp\",\"annaka.gunma.jp\",\"chiyoda.gunma.jp\",\"fujioka.gunma.jp\",\"higashiagatsuma.gunma.jp\",\"isesaki.gunma.jp\",\"itakura.gunma.jp\",\"kanna.gunma.jp\",\"kanra.gunma.jp\",\"katashina.gunma.jp\",\"kawaba.gunma.jp\",\"kiryu.gunma.jp\",\"kusatsu.gunma.jp\",\"maebashi.gunma.jp\",\"meiwa.gunma.jp\",\"midori.gunma.jp\",\"minakami.gunma.jp\",\"naganohara.gunma.jp\",\"nakanojo.gunma.jp\",\"nanmoku.gunma.jp\",\"numata.gunma.jp\",\"oizumi.gunma.jp\",\"ora.gunma.jp\",\"ota.gunma.jp\",\"shibukawa.gunma.jp\",\"shimonita.gunma.jp\",\"shinto.gunma.jp\",\"showa.gunma.jp\",\"takasaki.gunma.jp\",\"takayama.gunma.jp\",\"tamamura.gunma.jp\",\"tatebayashi.gunma.jp\",\"tomioka.gunma.jp\",\"tsukiyono.gunma.jp\",\"tsumagoi.gunma.jp\",\"ueno.gunma.jp\",\"yoshioka.gunma.jp\",\"asaminami.hiroshima.jp\",\"daiwa.hiroshima.jp\",\"etajima.hiroshima.jp\",\"fuchu.hiroshima.jp\",\"fukuyama.hiroshima.jp\",\"hatsukaichi.hiroshima.jp\",\"higashihiroshima.hiroshima.jp\",\"hongo.hiroshima.jp\",\"jinsekikogen.hiroshima.jp\",\"kaita.hiroshima.jp\",\"kui.hiroshima.jp\",\"kumano.hiroshima.jp\",\"kure.hiroshima.jp\",\"mihara.hiroshima.jp\",\"miyoshi.hiroshima.jp\",\"naka.hiroshima.jp\",\"onomichi.hiroshima.jp\",\"osakikamijima.hiroshima.jp\",\"otake.hiroshima.jp\",\"saka.hiroshima.jp\",\"sera.hiroshima.jp\",\"seranishi.hiroshima.jp\",\"shinichi.hiroshima.jp\",\"shobara.hiroshima.jp\",\"takehara.hiroshima.jp\",\"abashiri.hokkaido.jp\",\"abira.hokkaido.jp\",\"aibetsu.hokkaido.jp\",\"akabira.hokkaido.jp\",\"akkeshi.hokkaido.jp\",\"asahikawa.hokkaido.jp\",\"ashibetsu.hokkaido.jp\",\"ashoro.hokkaido.jp\",\"assabu.hokkaido.jp\",\"atsuma.hokkaido.jp\",\"bibai.hokkaido.jp\",\"biei.hokkaido.jp\",\"bifuka.hokkaido.jp\",\"bihoro.hokkaido.jp\",\"biratori.hokkaido.jp\",\"chippubetsu.hokkaido.jp\",\"chitose.hokkaido.jp\",\"date.hokkaido.jp\",\"ebetsu.hokkaido.jp\",\"embetsu.hokkaido.jp\",\"eniwa.hokkaido.jp\",\"erimo.hokkaido.jp\",\"esan.hokkaido.jp\",\"esashi.hokkaido.jp\",\"fukagawa.hokkaido.jp\",\"fukushima.hokkaido.jp\",\"furano.hokkaido.jp\",\"furubira.hokkaido.jp\",\"haboro.hokkaido.jp\",\"hakodate.hokkaido.jp\",\"hamatonbetsu.hokkaido.jp\",\"hidaka.hokkaido.jp\",\"higashikagura.hokkaido.jp\",\"higashikawa.hokkaido.jp\",\"hiroo.hokkaido.jp\",\"hokuryu.hokkaido.jp\",\"hokuto.hokkaido.jp\",\"honbetsu.hokkaido.jp\",\"horokanai.hokkaido.jp\",\"horonobe.hokkaido.jp\",\"ikeda.hokkaido.jp\",\"imakane.hokkaido.jp\",\"ishikari.hokkaido.jp\",\"iwamizawa.hokkaido.jp\",\"iwanai.hokkaido.jp\",\"kamifurano.hokkaido.jp\",\"kamikawa.hokkaido.jp\",\"kamishihoro.hokkaido.jp\",\"kamisunagawa.hokkaido.jp\",\"kamoenai.hokkaido.jp\",\"kayabe.hokkaido.jp\",\"kembuchi.hokkaido.jp\",\"kikonai.hokkaido.jp\",\"kimobetsu.hokkaido.jp\",\"kitahiroshima.hokkaido.jp\",\"kitami.hokkaido.jp\",\"kiyosato.hokkaido.jp\",\"koshimizu.hokkaido.jp\",\"kunneppu.hokkaido.jp\",\"kuriyama.hokkaido.jp\",\"kuromatsunai.hokkaido.jp\",\"kushiro.hokkaido.jp\",\"kutchan.hokkaido.jp\",\"kyowa.hokkaido.jp\",\"mashike.hokkaido.jp\",\"matsumae.hokkaido.jp\",\"mikasa.hokkaido.jp\",\"minamifurano.hokkaido.jp\",\"mombetsu.hokkaido.jp\",\"moseushi.hokkaido.jp\",\"mukawa.hokkaido.jp\",\"muroran.hokkaido.jp\",\"naie.hokkaido.jp\",\"nakagawa.hokkaido.jp\",\"nakasatsunai.hokkaido.jp\",\"nakatombetsu.hokkaido.jp\",\"nanae.hokkaido.jp\",\"nanporo.hokkaido.jp\",\"nayoro.hokkaido.jp\",\"nemuro.hokkaido.jp\",\"niikappu.hokkaido.jp\",\"niki.hokkaido.jp\",\"nishiokoppe.hokkaido.jp\",\"noboribetsu.hokkaido.jp\",\"numata.hokkaido.jp\",\"obihiro.hokkaido.jp\",\"obira.hokkaido.jp\",\"oketo.hokkaido.jp\",\"okoppe.hokkaido.jp\",\"otaru.hokkaido.jp\",\"otobe.hokkaido.jp\",\"otofuke.hokkaido.jp\",\"otoineppu.hokkaido.jp\",\"oumu.hokkaido.jp\",\"ozora.hokkaido.jp\",\"pippu.hokkaido.jp\",\"rankoshi.hokkaido.jp\",\"rebun.hokkaido.jp\",\"rikubetsu.hokkaido.jp\",\"rishiri.hokkaido.jp\",\"rishirifuji.hokkaido.jp\",\"saroma.hokkaido.jp\",\"sarufutsu.hokkaido.jp\",\"shakotan.hokkaido.jp\",\"shari.hokkaido.jp\",\"shibecha.hokkaido.jp\",\"shibetsu.hokkaido.jp\",\"shikabe.hokkaido.jp\",\"shikaoi.hokkaido.jp\",\"shimamaki.hokkaido.jp\",\"shimizu.hokkaido.jp\",\"shimokawa.hokkaido.jp\",\"shinshinotsu.hokkaido.jp\",\"shintoku.hokkaido.jp\",\"shiranuka.hokkaido.jp\",\"shiraoi.hokkaido.jp\",\"shiriuchi.hokkaido.jp\",\"sobetsu.hokkaido.jp\",\"sunagawa.hokkaido.jp\",\"taiki.hokkaido.jp\",\"takasu.hokkaido.jp\",\"takikawa.hokkaido.jp\",\"takinoue.hokkaido.jp\",\"teshikaga.hokkaido.jp\",\"tobetsu.hokkaido.jp\",\"tohma.hokkaido.jp\",\"tomakomai.hokkaido.jp\",\"tomari.hokkaido.jp\",\"toya.hokkaido.jp\",\"toyako.hokkaido.jp\",\"toyotomi.hokkaido.jp\",\"toyoura.hokkaido.jp\",\"tsubetsu.hokkaido.jp\",\"tsukigata.hokkaido.jp\",\"urakawa.hokkaido.jp\",\"urausu.hokkaido.jp\",\"uryu.hokkaido.jp\",\"utashinai.hokkaido.jp\",\"wakkanai.hokkaido.jp\",\"wassamu.hokkaido.jp\",\"yakumo.hokkaido.jp\",\"yoichi.hokkaido.jp\",\"aioi.hyogo.jp\",\"akashi.hyogo.jp\",\"ako.hyogo.jp\",\"amagasaki.hyogo.jp\",\"aogaki.hyogo.jp\",\"asago.hyogo.jp\",\"ashiya.hyogo.jp\",\"awaji.hyogo.jp\",\"fukusaki.hyogo.jp\",\"goshiki.hyogo.jp\",\"harima.hyogo.jp\",\"himeji.hyogo.jp\",\"ichikawa.hyogo.jp\",\"inagawa.hyogo.jp\",\"itami.hyogo.jp\",\"kakogawa.hyogo.jp\",\"kamigori.hyogo.jp\",\"kamikawa.hyogo.jp\",\"kasai.hyogo.jp\",\"kasuga.hyogo.jp\",\"kawanishi.hyogo.jp\",\"miki.hyogo.jp\",\"minamiawaji.hyogo.jp\",\"nishinomiya.hyogo.jp\",\"nishiwaki.hyogo.jp\",\"ono.hyogo.jp\",\"sanda.hyogo.jp\",\"sannan.hyogo.jp\",\"sasayama.hyogo.jp\",\"sayo.hyogo.jp\",\"shingu.hyogo.jp\",\"shinonsen.hyogo.jp\",\"shiso.hyogo.jp\",\"sumoto.hyogo.jp\",\"taishi.hyogo.jp\",\"taka.hyogo.jp\",\"takarazuka.hyogo.jp\",\"takasago.hyogo.jp\",\"takino.hyogo.jp\",\"tamba.hyogo.jp\",\"tatsuno.hyogo.jp\",\"toyooka.hyogo.jp\",\"yabu.hyogo.jp\",\"yashiro.hyogo.jp\",\"yoka.hyogo.jp\",\"yokawa.hyogo.jp\",\"ami.ibaraki.jp\",\"asahi.ibaraki.jp\",\"bando.ibaraki.jp\",\"chikusei.ibaraki.jp\",\"daigo.ibaraki.jp\",\"fujishiro.ibaraki.jp\",\"hitachi.ibaraki.jp\",\"hitachinaka.ibaraki.jp\",\"hitachiomiya.ibaraki.jp\",\"hitachiota.ibaraki.jp\",\"ibaraki.ibaraki.jp\",\"ina.ibaraki.jp\",\"inashiki.ibaraki.jp\",\"itako.ibaraki.jp\",\"iwama.ibaraki.jp\",\"joso.ibaraki.jp\",\"kamisu.ibaraki.jp\",\"kasama.ibaraki.jp\",\"kashima.ibaraki.jp\",\"kasumigaura.ibaraki.jp\",\"koga.ibaraki.jp\",\"miho.ibaraki.jp\",\"mito.ibaraki.jp\",\"moriya.ibaraki.jp\",\"naka.ibaraki.jp\",\"namegata.ibaraki.jp\",\"oarai.ibaraki.jp\",\"ogawa.ibaraki.jp\",\"omitama.ibaraki.jp\",\"ryugasaki.ibaraki.jp\",\"sakai.ibaraki.jp\",\"sakuragawa.ibaraki.jp\",\"shimodate.ibaraki.jp\",\"shimotsuma.ibaraki.jp\",\"shirosato.ibaraki.jp\",\"sowa.ibaraki.jp\",\"suifu.ibaraki.jp\",\"takahagi.ibaraki.jp\",\"tamatsukuri.ibaraki.jp\",\"tokai.ibaraki.jp\",\"tomobe.ibaraki.jp\",\"tone.ibaraki.jp\",\"toride.ibaraki.jp\",\"tsuchiura.ibaraki.jp\",\"tsukuba.ibaraki.jp\",\"uchihara.ibaraki.jp\",\"ushiku.ibaraki.jp\",\"yachiyo.ibaraki.jp\",\"yamagata.ibaraki.jp\",\"yawara.ibaraki.jp\",\"yuki.ibaraki.jp\",\"anamizu.ishikawa.jp\",\"hakui.ishikawa.jp\",\"hakusan.ishikawa.jp\",\"kaga.ishikawa.jp\",\"kahoku.ishikawa.jp\",\"kanazawa.ishikawa.jp\",\"kawakita.ishikawa.jp\",\"komatsu.ishikawa.jp\",\"nakanoto.ishikawa.jp\",\"nanao.ishikawa.jp\",\"nomi.ishikawa.jp\",\"nonoichi.ishikawa.jp\",\"noto.ishikawa.jp\",\"shika.ishikawa.jp\",\"suzu.ishikawa.jp\",\"tsubata.ishikawa.jp\",\"tsurugi.ishikawa.jp\",\"uchinada.ishikawa.jp\",\"wajima.ishikawa.jp\",\"fudai.iwate.jp\",\"fujisawa.iwate.jp\",\"hanamaki.iwate.jp\",\"hiraizumi.iwate.jp\",\"hirono.iwate.jp\",\"ichinohe.iwate.jp\",\"ichinoseki.iwate.jp\",\"iwaizumi.iwate.jp\",\"iwate.iwate.jp\",\"joboji.iwate.jp\",\"kamaishi.iwate.jp\",\"kanegasaki.iwate.jp\",\"karumai.iwate.jp\",\"kawai.iwate.jp\",\"kitakami.iwate.jp\",\"kuji.iwate.jp\",\"kunohe.iwate.jp\",\"kuzumaki.iwate.jp\",\"miyako.iwate.jp\",\"mizusawa.iwate.jp\",\"morioka.iwate.jp\",\"ninohe.iwate.jp\",\"noda.iwate.jp\",\"ofunato.iwate.jp\",\"oshu.iwate.jp\",\"otsuchi.iwate.jp\",\"rikuzentakata.iwate.jp\",\"shiwa.iwate.jp\",\"shizukuishi.iwate.jp\",\"sumita.iwate.jp\",\"tanohata.iwate.jp\",\"tono.iwate.jp\",\"yahaba.iwate.jp\",\"yamada.iwate.jp\",\"ayagawa.kagawa.jp\",\"higashikagawa.kagawa.jp\",\"kanonji.kagawa.jp\",\"kotohira.kagawa.jp\",\"manno.kagawa.jp\",\"marugame.kagawa.jp\",\"mitoyo.kagawa.jp\",\"naoshima.kagawa.jp\",\"sanuki.kagawa.jp\",\"tadotsu.kagawa.jp\",\"takamatsu.kagawa.jp\",\"tonosho.kagawa.jp\",\"uchinomi.kagawa.jp\",\"utazu.kagawa.jp\",\"zentsuji.kagawa.jp\",\"akune.kagoshima.jp\",\"amami.kagoshima.jp\",\"hioki.kagoshima.jp\",\"isa.kagoshima.jp\",\"isen.kagoshima.jp\",\"izumi.kagoshima.jp\",\"kagoshima.kagoshima.jp\",\"kanoya.kagoshima.jp\",\"kawanabe.kagoshima.jp\",\"kinko.kagoshima.jp\",\"kouyama.kagoshima.jp\",\"makurazaki.kagoshima.jp\",\"matsumoto.kagoshima.jp\",\"minamitane.kagoshima.jp\",\"nakatane.kagoshima.jp\",\"nishinoomote.kagoshima.jp\",\"satsumasendai.kagoshima.jp\",\"soo.kagoshima.jp\",\"tarumizu.kagoshima.jp\",\"yusui.kagoshima.jp\",\"aikawa.kanagawa.jp\",\"atsugi.kanagawa.jp\",\"ayase.kanagawa.jp\",\"chigasaki.kanagawa.jp\",\"ebina.kanagawa.jp\",\"fujisawa.kanagawa.jp\",\"hadano.kanagawa.jp\",\"hakone.kanagawa.jp\",\"hiratsuka.kanagawa.jp\",\"isehara.kanagawa.jp\",\"kaisei.kanagawa.jp\",\"kamakura.kanagawa.jp\",\"kiyokawa.kanagawa.jp\",\"matsuda.kanagawa.jp\",\"minamiashigara.kanagawa.jp\",\"miura.kanagawa.jp\",\"nakai.kanagawa.jp\",\"ninomiya.kanagawa.jp\",\"odawara.kanagawa.jp\",\"oi.kanagawa.jp\",\"oiso.kanagawa.jp\",\"sagamihara.kanagawa.jp\",\"samukawa.kanagawa.jp\",\"tsukui.kanagawa.jp\",\"yamakita.kanagawa.jp\",\"yamato.kanagawa.jp\",\"yokosuka.kanagawa.jp\",\"yugawara.kanagawa.jp\",\"zama.kanagawa.jp\",\"zushi.kanagawa.jp\",\"aki.kochi.jp\",\"geisei.kochi.jp\",\"hidaka.kochi.jp\",\"higashitsuno.kochi.jp\",\"ino.kochi.jp\",\"kagami.kochi.jp\",\"kami.kochi.jp\",\"kitagawa.kochi.jp\",\"kochi.kochi.jp\",\"mihara.kochi.jp\",\"motoyama.kochi.jp\",\"muroto.kochi.jp\",\"nahari.kochi.jp\",\"nakamura.kochi.jp\",\"nankoku.kochi.jp\",\"nishitosa.kochi.jp\",\"niyodogawa.kochi.jp\",\"ochi.kochi.jp\",\"okawa.kochi.jp\",\"otoyo.kochi.jp\",\"otsuki.kochi.jp\",\"sakawa.kochi.jp\",\"sukumo.kochi.jp\",\"susaki.kochi.jp\",\"tosa.kochi.jp\",\"tosashimizu.kochi.jp\",\"toyo.kochi.jp\",\"tsuno.kochi.jp\",\"umaji.kochi.jp\",\"yasuda.kochi.jp\",\"yusuhara.kochi.jp\",\"amakusa.kumamoto.jp\",\"arao.kumamoto.jp\",\"aso.kumamoto.jp\",\"choyo.kumamoto.jp\",\"gyokuto.kumamoto.jp\",\"kamiamakusa.kumamoto.jp\",\"kikuchi.kumamoto.jp\",\"kumamoto.kumamoto.jp\",\"mashiki.kumamoto.jp\",\"mifune.kumamoto.jp\",\"minamata.kumamoto.jp\",\"minamioguni.kumamoto.jp\",\"nagasu.kumamoto.jp\",\"nishihara.kumamoto.jp\",\"oguni.kumamoto.jp\",\"ozu.kumamoto.jp\",\"sumoto.kumamoto.jp\",\"takamori.kumamoto.jp\",\"uki.kumamoto.jp\",\"uto.kumamoto.jp\",\"yamaga.kumamoto.jp\",\"yamato.kumamoto.jp\",\"yatsushiro.kumamoto.jp\",\"ayabe.kyoto.jp\",\"fukuchiyama.kyoto.jp\",\"higashiyama.kyoto.jp\",\"ide.kyoto.jp\",\"ine.kyoto.jp\",\"joyo.kyoto.jp\",\"kameoka.kyoto.jp\",\"kamo.kyoto.jp\",\"kita.kyoto.jp\",\"kizu.kyoto.jp\",\"kumiyama.kyoto.jp\",\"kyotamba.kyoto.jp\",\"kyotanabe.kyoto.jp\",\"kyotango.kyoto.jp\",\"maizuru.kyoto.jp\",\"minami.kyoto.jp\",\"minamiyamashiro.kyoto.jp\",\"miyazu.kyoto.jp\",\"muko.kyoto.jp\",\"nagaokakyo.kyoto.jp\",\"nakagyo.kyoto.jp\",\"nantan.kyoto.jp\",\"oyamazaki.kyoto.jp\",\"sakyo.kyoto.jp\",\"seika.kyoto.jp\",\"tanabe.kyoto.jp\",\"uji.kyoto.jp\",\"ujitawara.kyoto.jp\",\"wazuka.kyoto.jp\",\"yamashina.kyoto.jp\",\"yawata.kyoto.jp\",\"asahi.mie.jp\",\"inabe.mie.jp\",\"ise.mie.jp\",\"kameyama.mie.jp\",\"kawagoe.mie.jp\",\"kiho.mie.jp\",\"kisosaki.mie.jp\",\"kiwa.mie.jp\",\"komono.mie.jp\",\"kumano.mie.jp\",\"kuwana.mie.jp\",\"matsusaka.mie.jp\",\"meiwa.mie.jp\",\"mihama.mie.jp\",\"minamiise.mie.jp\",\"misugi.mie.jp\",\"miyama.mie.jp\",\"nabari.mie.jp\",\"shima.mie.jp\",\"suzuka.mie.jp\",\"tado.mie.jp\",\"taiki.mie.jp\",\"taki.mie.jp\",\"tamaki.mie.jp\",\"toba.mie.jp\",\"tsu.mie.jp\",\"udono.mie.jp\",\"ureshino.mie.jp\",\"watarai.mie.jp\",\"yokkaichi.mie.jp\",\"furukawa.miyagi.jp\",\"higashimatsushima.miyagi.jp\",\"ishinomaki.miyagi.jp\",\"iwanuma.miyagi.jp\",\"kakuda.miyagi.jp\",\"kami.miyagi.jp\",\"kawasaki.miyagi.jp\",\"marumori.miyagi.jp\",\"matsushima.miyagi.jp\",\"minamisanriku.miyagi.jp\",\"misato.miyagi.jp\",\"murata.miyagi.jp\",\"natori.miyagi.jp\",\"ogawara.miyagi.jp\",\"ohira.miyagi.jp\",\"onagawa.miyagi.jp\",\"osaki.miyagi.jp\",\"rifu.miyagi.jp\",\"semine.miyagi.jp\",\"shibata.miyagi.jp\",\"shichikashuku.miyagi.jp\",\"shikama.miyagi.jp\",\"shiogama.miyagi.jp\",\"shiroishi.miyagi.jp\",\"tagajo.miyagi.jp\",\"taiwa.miyagi.jp\",\"tome.miyagi.jp\",\"tomiya.miyagi.jp\",\"wakuya.miyagi.jp\",\"watari.miyagi.jp\",\"yamamoto.miyagi.jp\",\"zao.miyagi.jp\",\"aya.miyazaki.jp\",\"ebino.miyazaki.jp\",\"gokase.miyazaki.jp\",\"hyuga.miyazaki.jp\",\"kadogawa.miyazaki.jp\",\"kawaminami.miyazaki.jp\",\"kijo.miyazaki.jp\",\"kitagawa.miyazaki.jp\",\"kitakata.miyazaki.jp\",\"kitaura.miyazaki.jp\",\"kobayashi.miyazaki.jp\",\"kunitomi.miyazaki.jp\",\"kushima.miyazaki.jp\",\"mimata.miyazaki.jp\",\"miyakonojo.miyazaki.jp\",\"miyazaki.miyazaki.jp\",\"morotsuka.miyazaki.jp\",\"nichinan.miyazaki.jp\",\"nishimera.miyazaki.jp\",\"nobeoka.miyazaki.jp\",\"saito.miyazaki.jp\",\"shiiba.miyazaki.jp\",\"shintomi.miyazaki.jp\",\"takaharu.miyazaki.jp\",\"takanabe.miyazaki.jp\",\"takazaki.miyazaki.jp\",\"tsuno.miyazaki.jp\",\"achi.nagano.jp\",\"agematsu.nagano.jp\",\"anan.nagano.jp\",\"aoki.nagano.jp\",\"asahi.nagano.jp\",\"azumino.nagano.jp\",\"chikuhoku.nagano.jp\",\"chikuma.nagano.jp\",\"chino.nagano.jp\",\"fujimi.nagano.jp\",\"hakuba.nagano.jp\",\"hara.nagano.jp\",\"hiraya.nagano.jp\",\"iida.nagano.jp\",\"iijima.nagano.jp\",\"iiyama.nagano.jp\",\"iizuna.nagano.jp\",\"ikeda.nagano.jp\",\"ikusaka.nagano.jp\",\"ina.nagano.jp\",\"karuizawa.nagano.jp\",\"kawakami.nagano.jp\",\"kiso.nagano.jp\",\"kisofukushima.nagano.jp\",\"kitaaiki.nagano.jp\",\"komagane.nagano.jp\",\"komoro.nagano.jp\",\"matsukawa.nagano.jp\",\"matsumoto.nagano.jp\",\"miasa.nagano.jp\",\"minamiaiki.nagano.jp\",\"minamimaki.nagano.jp\",\"minamiminowa.nagano.jp\",\"minowa.nagano.jp\",\"miyada.nagano.jp\",\"miyota.nagano.jp\",\"mochizuki.nagano.jp\",\"nagano.nagano.jp\",\"nagawa.nagano.jp\",\"nagiso.nagano.jp\",\"nakagawa.nagano.jp\",\"nakano.nagano.jp\",\"nozawaonsen.nagano.jp\",\"obuse.nagano.jp\",\"ogawa.nagano.jp\",\"okaya.nagano.jp\",\"omachi.nagano.jp\",\"omi.nagano.jp\",\"ookuwa.nagano.jp\",\"ooshika.nagano.jp\",\"otaki.nagano.jp\",\"otari.nagano.jp\",\"sakae.nagano.jp\",\"sakaki.nagano.jp\",\"saku.nagano.jp\",\"sakuho.nagano.jp\",\"shimosuwa.nagano.jp\",\"shinanomachi.nagano.jp\",\"shiojiri.nagano.jp\",\"suwa.nagano.jp\",\"suzaka.nagano.jp\",\"takagi.nagano.jp\",\"takamori.nagano.jp\",\"takayama.nagano.jp\",\"tateshina.nagano.jp\",\"tatsuno.nagano.jp\",\"togakushi.nagano.jp\",\"togura.nagano.jp\",\"tomi.nagano.jp\",\"ueda.nagano.jp\",\"wada.nagano.jp\",\"yamagata.nagano.jp\",\"yamanouchi.nagano.jp\",\"yasaka.nagano.jp\",\"yasuoka.nagano.jp\",\"chijiwa.nagasaki.jp\",\"futsu.nagasaki.jp\",\"goto.nagasaki.jp\",\"hasami.nagasaki.jp\",\"hirado.nagasaki.jp\",\"iki.nagasaki.jp\",\"isahaya.nagasaki.jp\",\"kawatana.nagasaki.jp\",\"kuchinotsu.nagasaki.jp\",\"matsuura.nagasaki.jp\",\"nagasaki.nagasaki.jp\",\"obama.nagasaki.jp\",\"omura.nagasaki.jp\",\"oseto.nagasaki.jp\",\"saikai.nagasaki.jp\",\"sasebo.nagasaki.jp\",\"seihi.nagasaki.jp\",\"shimabara.nagasaki.jp\",\"shinkamigoto.nagasaki.jp\",\"togitsu.nagasaki.jp\",\"tsushima.nagasaki.jp\",\"unzen.nagasaki.jp\",\"ando.nara.jp\",\"gose.nara.jp\",\"heguri.nara.jp\",\"higashiyoshino.nara.jp\",\"ikaruga.nara.jp\",\"ikoma.nara.jp\",\"kamikitayama.nara.jp\",\"kanmaki.nara.jp\",\"kashiba.nara.jp\",\"kashihara.nara.jp\",\"katsuragi.nara.jp\",\"kawai.nara.jp\",\"kawakami.nara.jp\",\"kawanishi.nara.jp\",\"koryo.nara.jp\",\"kurotaki.nara.jp\",\"mitsue.nara.jp\",\"miyake.nara.jp\",\"nara.nara.jp\",\"nosegawa.nara.jp\",\"oji.nara.jp\",\"ouda.nara.jp\",\"oyodo.nara.jp\",\"sakurai.nara.jp\",\"sango.nara.jp\",\"shimoichi.nara.jp\",\"shimokitayama.nara.jp\",\"shinjo.nara.jp\",\"soni.nara.jp\",\"takatori.nara.jp\",\"tawaramoto.nara.jp\",\"tenkawa.nara.jp\",\"tenri.nara.jp\",\"uda.nara.jp\",\"yamatokoriyama.nara.jp\",\"yamatotakada.nara.jp\",\"yamazoe.nara.jp\",\"yoshino.nara.jp\",\"aga.niigata.jp\",\"agano.niigata.jp\",\"gosen.niigata.jp\",\"itoigawa.niigata.jp\",\"izumozaki.niigata.jp\",\"joetsu.niigata.jp\",\"kamo.niigata.jp\",\"kariwa.niigata.jp\",\"kashiwazaki.niigata.jp\",\"minamiuonuma.niigata.jp\",\"mitsuke.niigata.jp\",\"muika.niigata.jp\",\"murakami.niigata.jp\",\"myoko.niigata.jp\",\"nagaoka.niigata.jp\",\"niigata.niigata.jp\",\"ojiya.niigata.jp\",\"omi.niigata.jp\",\"sado.niigata.jp\",\"sanjo.niigata.jp\",\"seiro.niigata.jp\",\"seirou.niigata.jp\",\"sekikawa.niigata.jp\",\"shibata.niigata.jp\",\"tagami.niigata.jp\",\"tainai.niigata.jp\",\"tochio.niigata.jp\",\"tokamachi.niigata.jp\",\"tsubame.niigata.jp\",\"tsunan.niigata.jp\",\"uonuma.niigata.jp\",\"yahiko.niigata.jp\",\"yoita.niigata.jp\",\"yuzawa.niigata.jp\",\"beppu.oita.jp\",\"bungoono.oita.jp\",\"bungotakada.oita.jp\",\"hasama.oita.jp\",\"hiji.oita.jp\",\"himeshima.oita.jp\",\"hita.oita.jp\",\"kamitsue.oita.jp\",\"kokonoe.oita.jp\",\"kuju.oita.jp\",\"kunisaki.oita.jp\",\"kusu.oita.jp\",\"oita.oita.jp\",\"saiki.oita.jp\",\"taketa.oita.jp\",\"tsukumi.oita.jp\",\"usa.oita.jp\",\"usuki.oita.jp\",\"yufu.oita.jp\",\"akaiwa.okayama.jp\",\"asakuchi.okayama.jp\",\"bizen.okayama.jp\",\"hayashima.okayama.jp\",\"ibara.okayama.jp\",\"kagamino.okayama.jp\",\"kasaoka.okayama.jp\",\"kibichuo.okayama.jp\",\"kumenan.okayama.jp\",\"kurashiki.okayama.jp\",\"maniwa.okayama.jp\",\"misaki.okayama.jp\",\"nagi.okayama.jp\",\"niimi.okayama.jp\",\"nishiawakura.okayama.jp\",\"okayama.okayama.jp\",\"satosho.okayama.jp\",\"setouchi.okayama.jp\",\"shinjo.okayama.jp\",\"shoo.okayama.jp\",\"soja.okayama.jp\",\"takahashi.okayama.jp\",\"tamano.okayama.jp\",\"tsuyama.okayama.jp\",\"wake.okayama.jp\",\"yakage.okayama.jp\",\"aguni.okinawa.jp\",\"ginowan.okinawa.jp\",\"ginoza.okinawa.jp\",\"gushikami.okinawa.jp\",\"haebaru.okinawa.jp\",\"higashi.okinawa.jp\",\"hirara.okinawa.jp\",\"iheya.okinawa.jp\",\"ishigaki.okinawa.jp\",\"ishikawa.okinawa.jp\",\"itoman.okinawa.jp\",\"izena.okinawa.jp\",\"kadena.okinawa.jp\",\"kin.okinawa.jp\",\"kitadaito.okinawa.jp\",\"kitanakagusuku.okinawa.jp\",\"kumejima.okinawa.jp\",\"kunigami.okinawa.jp\",\"minamidaito.okinawa.jp\",\"motobu.okinawa.jp\",\"nago.okinawa.jp\",\"naha.okinawa.jp\",\"nakagusuku.okinawa.jp\",\"nakijin.okinawa.jp\",\"nanjo.okinawa.jp\",\"nishihara.okinawa.jp\",\"ogimi.okinawa.jp\",\"okinawa.okinawa.jp\",\"onna.okinawa.jp\",\"shimoji.okinawa.jp\",\"taketomi.okinawa.jp\",\"tarama.okinawa.jp\",\"tokashiki.okinawa.jp\",\"tomigusuku.okinawa.jp\",\"tonaki.okinawa.jp\",\"urasoe.okinawa.jp\",\"uruma.okinawa.jp\",\"yaese.okinawa.jp\",\"yomitan.okinawa.jp\",\"yonabaru.okinawa.jp\",\"yonaguni.okinawa.jp\",\"zamami.okinawa.jp\",\"abeno.osaka.jp\",\"chihayaakasaka.osaka.jp\",\"chuo.osaka.jp\",\"daito.osaka.jp\",\"fujiidera.osaka.jp\",\"habikino.osaka.jp\",\"hannan.osaka.jp\",\"higashiosaka.osaka.jp\",\"higashisumiyoshi.osaka.jp\",\"higashiyodogawa.osaka.jp\",\"hirakata.osaka.jp\",\"ibaraki.osaka.jp\",\"ikeda.osaka.jp\",\"izumi.osaka.jp\",\"izumiotsu.osaka.jp\",\"izumisano.osaka.jp\",\"kadoma.osaka.jp\",\"kaizuka.osaka.jp\",\"kanan.osaka.jp\",\"kashiwara.osaka.jp\",\"katano.osaka.jp\",\"kawachinagano.osaka.jp\",\"kishiwada.osaka.jp\",\"kita.osaka.jp\",\"kumatori.osaka.jp\",\"matsubara.osaka.jp\",\"minato.osaka.jp\",\"minoh.osaka.jp\",\"misaki.osaka.jp\",\"moriguchi.osaka.jp\",\"neyagawa.osaka.jp\",\"nishi.osaka.jp\",\"nose.osaka.jp\",\"osakasayama.osaka.jp\",\"sakai.osaka.jp\",\"sayama.osaka.jp\",\"sennan.osaka.jp\",\"settsu.osaka.jp\",\"shijonawate.osaka.jp\",\"shimamoto.osaka.jp\",\"suita.osaka.jp\",\"tadaoka.osaka.jp\",\"taishi.osaka.jp\",\"tajiri.osaka.jp\",\"takaishi.osaka.jp\",\"takatsuki.osaka.jp\",\"tondabayashi.osaka.jp\",\"toyonaka.osaka.jp\",\"toyono.osaka.jp\",\"yao.osaka.jp\",\"ariake.saga.jp\",\"arita.saga.jp\",\"fukudomi.saga.jp\",\"genkai.saga.jp\",\"hamatama.saga.jp\",\"hizen.saga.jp\",\"imari.saga.jp\",\"kamimine.saga.jp\",\"kanzaki.saga.jp\",\"karatsu.saga.jp\",\"kashima.saga.jp\",\"kitagata.saga.jp\",\"kitahata.saga.jp\",\"kiyama.saga.jp\",\"kouhoku.saga.jp\",\"kyuragi.saga.jp\",\"nishiarita.saga.jp\",\"ogi.saga.jp\",\"omachi.saga.jp\",\"ouchi.saga.jp\",\"saga.saga.jp\",\"shiroishi.saga.jp\",\"taku.saga.jp\",\"tara.saga.jp\",\"tosu.saga.jp\",\"yoshinogari.saga.jp\",\"arakawa.saitama.jp\",\"asaka.saitama.jp\",\"chichibu.saitama.jp\",\"fujimi.saitama.jp\",\"fujimino.saitama.jp\",\"fukaya.saitama.jp\",\"hanno.saitama.jp\",\"hanyu.saitama.jp\",\"hasuda.saitama.jp\",\"hatogaya.saitama.jp\",\"hatoyama.saitama.jp\",\"hidaka.saitama.jp\",\"higashichichibu.saitama.jp\",\"higashimatsuyama.saitama.jp\",\"honjo.saitama.jp\",\"ina.saitama.jp\",\"iruma.saitama.jp\",\"iwatsuki.saitama.jp\",\"kamiizumi.saitama.jp\",\"kamikawa.saitama.jp\",\"kamisato.saitama.jp\",\"kasukabe.saitama.jp\",\"kawagoe.saitama.jp\",\"kawaguchi.saitama.jp\",\"kawajima.saitama.jp\",\"kazo.saitama.jp\",\"kitamoto.saitama.jp\",\"koshigaya.saitama.jp\",\"kounosu.saitama.jp\",\"kuki.saitama.jp\",\"kumagaya.saitama.jp\",\"matsubushi.saitama.jp\",\"minano.saitama.jp\",\"misato.saitama.jp\",\"miyashiro.saitama.jp\",\"miyoshi.saitama.jp\",\"moroyama.saitama.jp\",\"nagatoro.saitama.jp\",\"namegawa.saitama.jp\",\"niiza.saitama.jp\",\"ogano.saitama.jp\",\"ogawa.saitama.jp\",\"ogose.saitama.jp\",\"okegawa.saitama.jp\",\"omiya.saitama.jp\",\"otaki.saitama.jp\",\"ranzan.saitama.jp\",\"ryokami.saitama.jp\",\"saitama.saitama.jp\",\"sakado.saitama.jp\",\"satte.saitama.jp\",\"sayama.saitama.jp\",\"shiki.saitama.jp\",\"shiraoka.saitama.jp\",\"soka.saitama.jp\",\"sugito.saitama.jp\",\"toda.saitama.jp\",\"tokigawa.saitama.jp\",\"tokorozawa.saitama.jp\",\"tsurugashima.saitama.jp\",\"urawa.saitama.jp\",\"warabi.saitama.jp\",\"yashio.saitama.jp\",\"yokoze.saitama.jp\",\"yono.saitama.jp\",\"yorii.saitama.jp\",\"yoshida.saitama.jp\",\"yoshikawa.saitama.jp\",\"yoshimi.saitama.jp\",\"aisho.shiga.jp\",\"gamo.shiga.jp\",\"higashiomi.shiga.jp\",\"hikone.shiga.jp\",\"koka.shiga.jp\",\"konan.shiga.jp\",\"kosei.shiga.jp\",\"koto.shiga.jp\",\"kusatsu.shiga.jp\",\"maibara.shiga.jp\",\"moriyama.shiga.jp\",\"nagahama.shiga.jp\",\"nishiazai.shiga.jp\",\"notogawa.shiga.jp\",\"omihachiman.shiga.jp\",\"otsu.shiga.jp\",\"ritto.shiga.jp\",\"ryuoh.shiga.jp\",\"takashima.shiga.jp\",\"takatsuki.shiga.jp\",\"torahime.shiga.jp\",\"toyosato.shiga.jp\",\"yasu.shiga.jp\",\"akagi.shimane.jp\",\"ama.shimane.jp\",\"gotsu.shimane.jp\",\"hamada.shimane.jp\",\"higashiizumo.shimane.jp\",\"hikawa.shimane.jp\",\"hikimi.shimane.jp\",\"izumo.shimane.jp\",\"kakinoki.shimane.jp\",\"masuda.shimane.jp\",\"matsue.shimane.jp\",\"misato.shimane.jp\",\"nishinoshima.shimane.jp\",\"ohda.shimane.jp\",\"okinoshima.shimane.jp\",\"okuizumo.shimane.jp\",\"shimane.shimane.jp\",\"tamayu.shimane.jp\",\"tsuwano.shimane.jp\",\"unnan.shimane.jp\",\"yakumo.shimane.jp\",\"yasugi.shimane.jp\",\"yatsuka.shimane.jp\",\"arai.shizuoka.jp\",\"atami.shizuoka.jp\",\"fuji.shizuoka.jp\",\"fujieda.shizuoka.jp\",\"fujikawa.shizuoka.jp\",\"fujinomiya.shizuoka.jp\",\"fukuroi.shizuoka.jp\",\"gotemba.shizuoka.jp\",\"haibara.shizuoka.jp\",\"hamamatsu.shizuoka.jp\",\"higashiizu.shizuoka.jp\",\"ito.shizuoka.jp\",\"iwata.shizuoka.jp\",\"izu.shizuoka.jp\",\"izunokuni.shizuoka.jp\",\"kakegawa.shizuoka.jp\",\"kannami.shizuoka.jp\",\"kawanehon.shizuoka.jp\",\"kawazu.shizuoka.jp\",\"kikugawa.shizuoka.jp\",\"kosai.shizuoka.jp\",\"makinohara.shizuoka.jp\",\"matsuzaki.shizuoka.jp\",\"minamiizu.shizuoka.jp\",\"mishima.shizuoka.jp\",\"morimachi.shizuoka.jp\",\"nishiizu.shizuoka.jp\",\"numazu.shizuoka.jp\",\"omaezaki.shizuoka.jp\",\"shimada.shizuoka.jp\",\"shimizu.shizuoka.jp\",\"shimoda.shizuoka.jp\",\"shizuoka.shizuoka.jp\",\"susono.shizuoka.jp\",\"yaizu.shizuoka.jp\",\"yoshida.shizuoka.jp\",\"ashikaga.tochigi.jp\",\"bato.tochigi.jp\",\"haga.tochigi.jp\",\"ichikai.tochigi.jp\",\"iwafune.tochigi.jp\",\"kaminokawa.tochigi.jp\",\"kanuma.tochigi.jp\",\"karasuyama.tochigi.jp\",\"kuroiso.tochigi.jp\",\"mashiko.tochigi.jp\",\"mibu.tochigi.jp\",\"moka.tochigi.jp\",\"motegi.tochigi.jp\",\"nasu.tochigi.jp\",\"nasushiobara.tochigi.jp\",\"nikko.tochigi.jp\",\"nishikata.tochigi.jp\",\"nogi.tochigi.jp\",\"ohira.tochigi.jp\",\"ohtawara.tochigi.jp\",\"oyama.tochigi.jp\",\"sakura.tochigi.jp\",\"sano.tochigi.jp\",\"shimotsuke.tochigi.jp\",\"shioya.tochigi.jp\",\"takanezawa.tochigi.jp\",\"tochigi.tochigi.jp\",\"tsuga.tochigi.jp\",\"ujiie.tochigi.jp\",\"utsunomiya.tochigi.jp\",\"yaita.tochigi.jp\",\"aizumi.tokushima.jp\",\"anan.tokushima.jp\",\"ichiba.tokushima.jp\",\"itano.tokushima.jp\",\"kainan.tokushima.jp\",\"komatsushima.tokushima.jp\",\"matsushige.tokushima.jp\",\"mima.tokushima.jp\",\"minami.tokushima.jp\",\"miyoshi.tokushima.jp\",\"mugi.tokushima.jp\",\"nakagawa.tokushima.jp\",\"naruto.tokushima.jp\",\"sanagochi.tokushima.jp\",\"shishikui.tokushima.jp\",\"tokushima.tokushima.jp\",\"wajiki.tokushima.jp\",\"adachi.tokyo.jp\",\"akiruno.tokyo.jp\",\"akishima.tokyo.jp\",\"aogashima.tokyo.jp\",\"arakawa.tokyo.jp\",\"bunkyo.tokyo.jp\",\"chiyoda.tokyo.jp\",\"chofu.tokyo.jp\",\"chuo.tokyo.jp\",\"edogawa.tokyo.jp\",\"fuchu.tokyo.jp\",\"fussa.tokyo.jp\",\"hachijo.tokyo.jp\",\"hachioji.tokyo.jp\",\"hamura.tokyo.jp\",\"higashikurume.tokyo.jp\",\"higashimurayama.tokyo.jp\",\"higashiyamato.tokyo.jp\",\"hino.tokyo.jp\",\"hinode.tokyo.jp\",\"hinohara.tokyo.jp\",\"inagi.tokyo.jp\",\"itabashi.tokyo.jp\",\"katsushika.tokyo.jp\",\"kita.tokyo.jp\",\"kiyose.tokyo.jp\",\"kodaira.tokyo.jp\",\"koganei.tokyo.jp\",\"kokubunji.tokyo.jp\",\"komae.tokyo.jp\",\"koto.tokyo.jp\",\"kouzushima.tokyo.jp\",\"kunitachi.tokyo.jp\",\"machida.tokyo.jp\",\"meguro.tokyo.jp\",\"minato.tokyo.jp\",\"mitaka.tokyo.jp\",\"mizuho.tokyo.jp\",\"musashimurayama.tokyo.jp\",\"musashino.tokyo.jp\",\"nakano.tokyo.jp\",\"nerima.tokyo.jp\",\"ogasawara.tokyo.jp\",\"okutama.tokyo.jp\",\"ome.tokyo.jp\",\"oshima.tokyo.jp\",\"ota.tokyo.jp\",\"setagaya.tokyo.jp\",\"shibuya.tokyo.jp\",\"shinagawa.tokyo.jp\",\"shinjuku.tokyo.jp\",\"suginami.tokyo.jp\",\"sumida.tokyo.jp\",\"tachikawa.tokyo.jp\",\"taito.tokyo.jp\",\"tama.tokyo.jp\",\"toshima.tokyo.jp\",\"chizu.tottori.jp\",\"hino.tottori.jp\",\"kawahara.tottori.jp\",\"koge.tottori.jp\",\"kotoura.tottori.jp\",\"misasa.tottori.jp\",\"nanbu.tottori.jp\",\"nichinan.tottori.jp\",\"sakaiminato.tottori.jp\",\"tottori.tottori.jp\",\"wakasa.tottori.jp\",\"yazu.tottori.jp\",\"yonago.tottori.jp\",\"asahi.toyama.jp\",\"fuchu.toyama.jp\",\"fukumitsu.toyama.jp\",\"funahashi.toyama.jp\",\"himi.toyama.jp\",\"imizu.toyama.jp\",\"inami.toyama.jp\",\"johana.toyama.jp\",\"kamiichi.toyama.jp\",\"kurobe.toyama.jp\",\"nakaniikawa.toyama.jp\",\"namerikawa.toyama.jp\",\"nanto.toyama.jp\",\"nyuzen.toyama.jp\",\"oyabe.toyama.jp\",\"taira.toyama.jp\",\"takaoka.toyama.jp\",\"tateyama.toyama.jp\",\"toga.toyama.jp\",\"tonami.toyama.jp\",\"toyama.toyama.jp\",\"unazuki.toyama.jp\",\"uozu.toyama.jp\",\"yamada.toyama.jp\",\"arida.wakayama.jp\",\"aridagawa.wakayama.jp\",\"gobo.wakayama.jp\",\"hashimoto.wakayama.jp\",\"hidaka.wakayama.jp\",\"hirogawa.wakayama.jp\",\"inami.wakayama.jp\",\"iwade.wakayama.jp\",\"kainan.wakayama.jp\",\"kamitonda.wakayama.jp\",\"katsuragi.wakayama.jp\",\"kimino.wakayama.jp\",\"kinokawa.wakayama.jp\",\"kitayama.wakayama.jp\",\"koya.wakayama.jp\",\"koza.wakayama.jp\",\"kozagawa.wakayama.jp\",\"kudoyama.wakayama.jp\",\"kushimoto.wakayama.jp\",\"mihama.wakayama.jp\",\"misato.wakayama.jp\",\"nachikatsuura.wakayama.jp\",\"shingu.wakayama.jp\",\"shirahama.wakayama.jp\",\"taiji.wakayama.jp\",\"tanabe.wakayama.jp\",\"wakayama.wakayama.jp\",\"yuasa.wakayama.jp\",\"yura.wakayama.jp\",\"asahi.yamagata.jp\",\"funagata.yamagata.jp\",\"higashine.yamagata.jp\",\"iide.yamagata.jp\",\"kahoku.yamagata.jp\",\"kaminoyama.yamagata.jp\",\"kaneyama.yamagata.jp\",\"kawanishi.yamagata.jp\",\"mamurogawa.yamagata.jp\",\"mikawa.yamagata.jp\",\"murayama.yamagata.jp\",\"nagai.yamagata.jp\",\"nakayama.yamagata.jp\",\"nanyo.yamagata.jp\",\"nishikawa.yamagata.jp\",\"obanazawa.yamagata.jp\",\"oe.yamagata.jp\",\"oguni.yamagata.jp\",\"ohkura.yamagata.jp\",\"oishida.yamagata.jp\",\"sagae.yamagata.jp\",\"sakata.yamagata.jp\",\"sakegawa.yamagata.jp\",\"shinjo.yamagata.jp\",\"shirataka.yamagata.jp\",\"shonai.yamagata.jp\",\"takahata.yamagata.jp\",\"tendo.yamagata.jp\",\"tozawa.yamagata.jp\",\"tsuruoka.yamagata.jp\",\"yamagata.yamagata.jp\",\"yamanobe.yamagata.jp\",\"yonezawa.yamagata.jp\",\"yuza.yamagata.jp\",\"abu.yamaguchi.jp\",\"hagi.yamaguchi.jp\",\"hikari.yamaguchi.jp\",\"hofu.yamaguchi.jp\",\"iwakuni.yamaguchi.jp\",\"kudamatsu.yamaguchi.jp\",\"mitou.yamaguchi.jp\",\"nagato.yamaguchi.jp\",\"oshima.yamaguchi.jp\",\"shimonoseki.yamaguchi.jp\",\"shunan.yamaguchi.jp\",\"tabuse.yamaguchi.jp\",\"tokuyama.yamaguchi.jp\",\"toyota.yamaguchi.jp\",\"ube.yamaguchi.jp\",\"yuu.yamaguchi.jp\",\"chuo.yamanashi.jp\",\"doshi.yamanashi.jp\",\"fuefuki.yamanashi.jp\",\"fujikawa.yamanashi.jp\",\"fujikawaguchiko.yamanashi.jp\",\"fujiyoshida.yamanashi.jp\",\"hayakawa.yamanashi.jp\",\"hokuto.yamanashi.jp\",\"ichikawamisato.yamanashi.jp\",\"kai.yamanashi.jp\",\"kofu.yamanashi.jp\",\"koshu.yamanashi.jp\",\"kosuge.yamanashi.jp\",\"minami-alps.yamanashi.jp\",\"minobu.yamanashi.jp\",\"nakamichi.yamanashi.jp\",\"nanbu.yamanashi.jp\",\"narusawa.yamanashi.jp\",\"nirasaki.yamanashi.jp\",\"nishikatsura.yamanashi.jp\",\"oshino.yamanashi.jp\",\"otsuki.yamanashi.jp\",\"showa.yamanashi.jp\",\"tabayama.yamanashi.jp\",\"tsuru.yamanashi.jp\",\"uenohara.yamanashi.jp\",\"yamanakako.yamanashi.jp\",\"yamanashi.yamanashi.jp\",\"ke\",\"ac.ke\",\"co.ke\",\"go.ke\",\"info.ke\",\"me.ke\",\"mobi.ke\",\"ne.ke\",\"or.ke\",\"sc.ke\",\"kg\",\"org.kg\",\"net.kg\",\"com.kg\",\"edu.kg\",\"gov.kg\",\"mil.kg\",\"*.kh\",\"ki\",\"edu.ki\",\"biz.ki\",\"net.ki\",\"org.ki\",\"gov.ki\",\"info.ki\",\"com.ki\",\"km\",\"org.km\",\"nom.km\",\"gov.km\",\"prd.km\",\"tm.km\",\"edu.km\",\"mil.km\",\"ass.km\",\"com.km\",\"coop.km\",\"asso.km\",\"presse.km\",\"medecin.km\",\"notaires.km\",\"pharmaciens.km\",\"veterinaire.km\",\"gouv.km\",\"kn\",\"net.kn\",\"org.kn\",\"edu.kn\",\"gov.kn\",\"kp\",\"com.kp\",\"edu.kp\",\"gov.kp\",\"org.kp\",\"rep.kp\",\"tra.kp\",\"kr\",\"ac.kr\",\"co.kr\",\"es.kr\",\"go.kr\",\"hs.kr\",\"kg.kr\",\"mil.kr\",\"ms.kr\",\"ne.kr\",\"or.kr\",\"pe.kr\",\"re.kr\",\"sc.kr\",\"busan.kr\",\"chungbuk.kr\",\"chungnam.kr\",\"daegu.kr\",\"daejeon.kr\",\"gangwon.kr\",\"gwangju.kr\",\"gyeongbuk.kr\",\"gyeonggi.kr\",\"gyeongnam.kr\",\"incheon.kr\",\"jeju.kr\",\"jeonbuk.kr\",\"jeonnam.kr\",\"seoul.kr\",\"ulsan.kr\",\"kw\",\"com.kw\",\"edu.kw\",\"emb.kw\",\"gov.kw\",\"ind.kw\",\"net.kw\",\"org.kw\",\"ky\",\"edu.ky\",\"gov.ky\",\"com.ky\",\"org.ky\",\"net.ky\",\"kz\",\"org.kz\",\"edu.kz\",\"net.kz\",\"gov.kz\",\"mil.kz\",\"com.kz\",\"la\",\"int.la\",\"net.la\",\"info.la\",\"edu.la\",\"gov.la\",\"per.la\",\"com.la\",\"org.la\",\"lb\",\"com.lb\",\"edu.lb\",\"gov.lb\",\"net.lb\",\"org.lb\",\"lc\",\"com.lc\",\"net.lc\",\"co.lc\",\"org.lc\",\"edu.lc\",\"gov.lc\",\"li\",\"lk\",\"gov.lk\",\"sch.lk\",\"net.lk\",\"int.lk\",\"com.lk\",\"org.lk\",\"edu.lk\",\"ngo.lk\",\"soc.lk\",\"web.lk\",\"ltd.lk\",\"assn.lk\",\"grp.lk\",\"hotel.lk\",\"ac.lk\",\"lr\",\"com.lr\",\"edu.lr\",\"gov.lr\",\"org.lr\",\"net.lr\",\"ls\",\"ac.ls\",\"biz.ls\",\"co.ls\",\"edu.ls\",\"gov.ls\",\"info.ls\",\"net.ls\",\"org.ls\",\"sc.ls\",\"lt\",\"gov.lt\",\"lu\",\"lv\",\"com.lv\",\"edu.lv\",\"gov.lv\",\"org.lv\",\"mil.lv\",\"id.lv\",\"net.lv\",\"asn.lv\",\"conf.lv\",\"ly\",\"com.ly\",\"net.ly\",\"gov.ly\",\"plc.ly\",\"edu.ly\",\"sch.ly\",\"med.ly\",\"org.ly\",\"id.ly\",\"ma\",\"co.ma\",\"net.ma\",\"gov.ma\",\"org.ma\",\"ac.ma\",\"press.ma\",\"mc\",\"tm.mc\",\"asso.mc\",\"md\",\"me\",\"co.me\",\"net.me\",\"org.me\",\"edu.me\",\"ac.me\",\"gov.me\",\"its.me\",\"priv.me\",\"mg\",\"org.mg\",\"nom.mg\",\"gov.mg\",\"prd.mg\",\"tm.mg\",\"edu.mg\",\"mil.mg\",\"com.mg\",\"co.mg\",\"mh\",\"mil\",\"mk\",\"com.mk\",\"org.mk\",\"net.mk\",\"edu.mk\",\"gov.mk\",\"inf.mk\",\"name.mk\",\"ml\",\"com.ml\",\"edu.ml\",\"gouv.ml\",\"gov.ml\",\"net.ml\",\"org.ml\",\"presse.ml\",\"*.mm\",\"mn\",\"gov.mn\",\"edu.mn\",\"org.mn\",\"mo\",\"com.mo\",\"net.mo\",\"org.mo\",\"edu.mo\",\"gov.mo\",\"mobi\",\"mp\",\"mq\",\"mr\",\"gov.mr\",\"ms\",\"com.ms\",\"edu.ms\",\"gov.ms\",\"net.ms\",\"org.ms\",\"mt\",\"com.mt\",\"edu.mt\",\"net.mt\",\"org.mt\",\"mu\",\"com.mu\",\"net.mu\",\"org.mu\",\"gov.mu\",\"ac.mu\",\"co.mu\",\"or.mu\",\"museum\",\"academy.museum\",\"agriculture.museum\",\"air.museum\",\"airguard.museum\",\"alabama.museum\",\"alaska.museum\",\"amber.museum\",\"ambulance.museum\",\"american.museum\",\"americana.museum\",\"americanantiques.museum\",\"americanart.museum\",\"amsterdam.museum\",\"and.museum\",\"annefrank.museum\",\"anthro.museum\",\"anthropology.museum\",\"antiques.museum\",\"aquarium.museum\",\"arboretum.museum\",\"archaeological.museum\",\"archaeology.museum\",\"architecture.museum\",\"art.museum\",\"artanddesign.museum\",\"artcenter.museum\",\"artdeco.museum\",\"arteducation.museum\",\"artgallery.museum\",\"arts.museum\",\"artsandcrafts.museum\",\"asmatart.museum\",\"assassination.museum\",\"assisi.museum\",\"association.museum\",\"astronomy.museum\",\"atlanta.museum\",\"austin.museum\",\"australia.museum\",\"automotive.museum\",\"aviation.museum\",\"axis.museum\",\"badajoz.museum\",\"baghdad.museum\",\"bahn.museum\",\"bale.museum\",\"baltimore.museum\",\"barcelona.museum\",\"baseball.museum\",\"basel.museum\",\"baths.museum\",\"bauern.museum\",\"beauxarts.museum\",\"beeldengeluid.museum\",\"bellevue.museum\",\"bergbau.museum\",\"berkeley.museum\",\"berlin.museum\",\"bern.museum\",\"bible.museum\",\"bilbao.museum\",\"bill.museum\",\"birdart.museum\",\"birthplace.museum\",\"bonn.museum\",\"boston.museum\",\"botanical.museum\",\"botanicalgarden.museum\",\"botanicgarden.museum\",\"botany.museum\",\"brandywinevalley.museum\",\"brasil.museum\",\"bristol.museum\",\"british.museum\",\"britishcolumbia.museum\",\"broadcast.museum\",\"brunel.museum\",\"brussel.museum\",\"brussels.museum\",\"bruxelles.museum\",\"building.museum\",\"burghof.museum\",\"bus.museum\",\"bushey.museum\",\"cadaques.museum\",\"california.museum\",\"cambridge.museum\",\"can.museum\",\"canada.museum\",\"capebreton.museum\",\"carrier.museum\",\"cartoonart.museum\",\"casadelamoneda.museum\",\"castle.museum\",\"castres.museum\",\"celtic.museum\",\"center.museum\",\"chattanooga.museum\",\"cheltenham.museum\",\"chesapeakebay.museum\",\"chicago.museum\",\"children.museum\",\"childrens.museum\",\"childrensgarden.museum\",\"chiropractic.museum\",\"chocolate.museum\",\"christiansburg.museum\",\"cincinnati.museum\",\"cinema.museum\",\"circus.museum\",\"civilisation.museum\",\"civilization.museum\",\"civilwar.museum\",\"clinton.museum\",\"clock.museum\",\"coal.museum\",\"coastaldefence.museum\",\"cody.museum\",\"coldwar.museum\",\"collection.museum\",\"colonialwilliamsburg.museum\",\"coloradoplateau.museum\",\"columbia.museum\",\"columbus.museum\",\"communication.museum\",\"communications.museum\",\"community.museum\",\"computer.museum\",\"computerhistory.museum\",\"comunicações.museum\",\"contemporary.museum\",\"contemporaryart.museum\",\"convent.museum\",\"copenhagen.museum\",\"corporation.museum\",\"correios-e-telecomunicações.museum\",\"corvette.museum\",\"costume.museum\",\"countryestate.museum\",\"county.museum\",\"crafts.museum\",\"cranbrook.museum\",\"creation.museum\",\"cultural.museum\",\"culturalcenter.museum\",\"culture.museum\",\"cyber.museum\",\"cymru.museum\",\"dali.museum\",\"dallas.museum\",\"database.museum\",\"ddr.museum\",\"decorativearts.museum\",\"delaware.museum\",\"delmenhorst.museum\",\"denmark.museum\",\"depot.museum\",\"design.museum\",\"detroit.museum\",\"dinosaur.museum\",\"discovery.museum\",\"dolls.museum\",\"donostia.museum\",\"durham.museum\",\"eastafrica.museum\",\"eastcoast.museum\",\"education.museum\",\"educational.museum\",\"egyptian.museum\",\"eisenbahn.museum\",\"elburg.museum\",\"elvendrell.museum\",\"embroidery.museum\",\"encyclopedic.museum\",\"england.museum\",\"entomology.museum\",\"environment.museum\",\"environmentalconservation.museum\",\"epilepsy.museum\",\"essex.museum\",\"estate.museum\",\"ethnology.museum\",\"exeter.museum\",\"exhibition.museum\",\"family.museum\",\"farm.museum\",\"farmequipment.museum\",\"farmers.museum\",\"farmstead.museum\",\"field.museum\",\"figueres.museum\",\"filatelia.museum\",\"film.museum\",\"fineart.museum\",\"finearts.museum\",\"finland.museum\",\"flanders.museum\",\"florida.museum\",\"force.museum\",\"fortmissoula.museum\",\"fortworth.museum\",\"foundation.museum\",\"francaise.museum\",\"frankfurt.museum\",\"franziskaner.museum\",\"freemasonry.museum\",\"freiburg.museum\",\"fribourg.museum\",\"frog.museum\",\"fundacio.museum\",\"furniture.museum\",\"gallery.museum\",\"garden.museum\",\"gateway.museum\",\"geelvinck.museum\",\"gemological.museum\",\"geology.museum\",\"georgia.museum\",\"giessen.museum\",\"glas.museum\",\"glass.museum\",\"gorge.museum\",\"grandrapids.museum\",\"graz.museum\",\"guernsey.museum\",\"halloffame.museum\",\"hamburg.museum\",\"handson.museum\",\"harvestcelebration.museum\",\"hawaii.museum\",\"health.museum\",\"heimatunduhren.museum\",\"hellas.museum\",\"helsinki.museum\",\"hembygdsforbund.museum\",\"heritage.museum\",\"histoire.museum\",\"historical.museum\",\"historicalsociety.museum\",\"historichouses.museum\",\"historisch.museum\",\"historisches.museum\",\"history.museum\",\"historyofscience.museum\",\"horology.museum\",\"house.museum\",\"humanities.museum\",\"illustration.museum\",\"imageandsound.museum\",\"indian.museum\",\"indiana.museum\",\"indianapolis.museum\",\"indianmarket.museum\",\"intelligence.museum\",\"interactive.museum\",\"iraq.museum\",\"iron.museum\",\"isleofman.museum\",\"jamison.museum\",\"jefferson.museum\",\"jerusalem.museum\",\"jewelry.museum\",\"jewish.museum\",\"jewishart.museum\",\"jfk.museum\",\"journalism.museum\",\"judaica.museum\",\"judygarland.museum\",\"juedisches.museum\",\"juif.museum\",\"karate.museum\",\"karikatur.museum\",\"kids.museum\",\"koebenhavn.museum\",\"koeln.museum\",\"kunst.museum\",\"kunstsammlung.museum\",\"kunstunddesign.museum\",\"labor.museum\",\"labour.museum\",\"lajolla.museum\",\"lancashire.museum\",\"landes.museum\",\"lans.museum\",\"läns.museum\",\"larsson.museum\",\"lewismiller.museum\",\"lincoln.museum\",\"linz.museum\",\"living.museum\",\"livinghistory.museum\",\"localhistory.museum\",\"london.museum\",\"losangeles.museum\",\"louvre.museum\",\"loyalist.museum\",\"lucerne.museum\",\"luxembourg.museum\",\"luzern.museum\",\"mad.museum\",\"madrid.museum\",\"mallorca.museum\",\"manchester.museum\",\"mansion.museum\",\"mansions.museum\",\"manx.museum\",\"marburg.museum\",\"maritime.museum\",\"maritimo.museum\",\"maryland.museum\",\"marylhurst.museum\",\"media.museum\",\"medical.museum\",\"medizinhistorisches.museum\",\"meeres.museum\",\"memorial.museum\",\"mesaverde.museum\",\"michigan.museum\",\"midatlantic.museum\",\"military.museum\",\"mill.museum\",\"miners.museum\",\"mining.museum\",\"minnesota.museum\",\"missile.museum\",\"missoula.museum\",\"modern.museum\",\"moma.museum\",\"money.museum\",\"monmouth.museum\",\"monticello.museum\",\"montreal.museum\",\"moscow.museum\",\"motorcycle.museum\",\"muenchen.museum\",\"muenster.museum\",\"mulhouse.museum\",\"muncie.museum\",\"museet.museum\",\"museumcenter.museum\",\"museumvereniging.museum\",\"music.museum\",\"national.museum\",\"nationalfirearms.museum\",\"nationalheritage.museum\",\"nativeamerican.museum\",\"naturalhistory.museum\",\"naturalhistorymuseum.museum\",\"naturalsciences.museum\",\"nature.museum\",\"naturhistorisches.museum\",\"natuurwetenschappen.museum\",\"naumburg.museum\",\"naval.museum\",\"nebraska.museum\",\"neues.museum\",\"newhampshire.museum\",\"newjersey.museum\",\"newmexico.museum\",\"newport.museum\",\"newspaper.museum\",\"newyork.museum\",\"niepce.museum\",\"norfolk.museum\",\"north.museum\",\"nrw.museum\",\"nyc.museum\",\"nyny.museum\",\"oceanographic.museum\",\"oceanographique.museum\",\"omaha.museum\",\"online.museum\",\"ontario.museum\",\"openair.museum\",\"oregon.museum\",\"oregontrail.museum\",\"otago.museum\",\"oxford.museum\",\"pacific.museum\",\"paderborn.museum\",\"palace.museum\",\"paleo.museum\",\"palmsprings.museum\",\"panama.museum\",\"paris.museum\",\"pasadena.museum\",\"pharmacy.museum\",\"philadelphia.museum\",\"philadelphiaarea.museum\",\"philately.museum\",\"phoenix.museum\",\"photography.museum\",\"pilots.museum\",\"pittsburgh.museum\",\"planetarium.museum\",\"plantation.museum\",\"plants.museum\",\"plaza.museum\",\"portal.museum\",\"portland.museum\",\"portlligat.museum\",\"posts-and-telecommunications.museum\",\"preservation.museum\",\"presidio.museum\",\"press.museum\",\"project.museum\",\"public.museum\",\"pubol.museum\",\"quebec.museum\",\"railroad.museum\",\"railway.museum\",\"research.museum\",\"resistance.museum\",\"riodejaneiro.museum\",\"rochester.museum\",\"rockart.museum\",\"roma.museum\",\"russia.museum\",\"saintlouis.museum\",\"salem.museum\",\"salvadordali.museum\",\"salzburg.museum\",\"sandiego.museum\",\"sanfrancisco.museum\",\"santabarbara.museum\",\"santacruz.museum\",\"santafe.museum\",\"saskatchewan.museum\",\"satx.museum\",\"savannahga.museum\",\"schlesisches.museum\",\"schoenbrunn.museum\",\"schokoladen.museum\",\"school.museum\",\"schweiz.museum\",\"science.museum\",\"scienceandhistory.museum\",\"scienceandindustry.museum\",\"sciencecenter.museum\",\"sciencecenters.museum\",\"science-fiction.museum\",\"sciencehistory.museum\",\"sciences.museum\",\"sciencesnaturelles.museum\",\"scotland.museum\",\"seaport.museum\",\"settlement.museum\",\"settlers.museum\",\"shell.museum\",\"sherbrooke.museum\",\"sibenik.museum\",\"silk.museum\",\"ski.museum\",\"skole.museum\",\"society.museum\",\"sologne.museum\",\"soundandvision.museum\",\"southcarolina.museum\",\"southwest.museum\",\"space.museum\",\"spy.museum\",\"square.museum\",\"stadt.museum\",\"stalbans.museum\",\"starnberg.museum\",\"state.museum\",\"stateofdelaware.museum\",\"station.museum\",\"steam.museum\",\"steiermark.museum\",\"stjohn.museum\",\"stockholm.museum\",\"stpetersburg.museum\",\"stuttgart.museum\",\"suisse.museum\",\"surgeonshall.museum\",\"surrey.museum\",\"svizzera.museum\",\"sweden.museum\",\"sydney.museum\",\"tank.museum\",\"tcm.museum\",\"technology.museum\",\"telekommunikation.museum\",\"television.museum\",\"texas.museum\",\"textile.museum\",\"theater.museum\",\"time.museum\",\"timekeeping.museum\",\"topology.museum\",\"torino.museum\",\"touch.museum\",\"town.museum\",\"transport.museum\",\"tree.museum\",\"trolley.museum\",\"trust.museum\",\"trustee.museum\",\"uhren.museum\",\"ulm.museum\",\"undersea.museum\",\"university.museum\",\"usa.museum\",\"usantiques.museum\",\"usarts.museum\",\"uscountryestate.museum\",\"usculture.museum\",\"usdecorativearts.museum\",\"usgarden.museum\",\"ushistory.museum\",\"ushuaia.museum\",\"uslivinghistory.museum\",\"utah.museum\",\"uvic.museum\",\"valley.museum\",\"vantaa.museum\",\"versailles.museum\",\"viking.museum\",\"village.museum\",\"virginia.museum\",\"virtual.museum\",\"virtuel.museum\",\"vlaanderen.museum\",\"volkenkunde.museum\",\"wales.museum\",\"wallonie.museum\",\"war.museum\",\"washingtondc.museum\",\"watchandclock.museum\",\"watch-and-clock.museum\",\"western.museum\",\"westfalen.museum\",\"whaling.museum\",\"wildlife.museum\",\"williamsburg.museum\",\"windmill.museum\",\"workshop.museum\",\"york.museum\",\"yorkshire.museum\",\"yosemite.museum\",\"youth.museum\",\"zoological.museum\",\"zoology.museum\",\"ירושלים.museum\",\"иком.museum\",\"mv\",\"aero.mv\",\"biz.mv\",\"com.mv\",\"coop.mv\",\"edu.mv\",\"gov.mv\",\"info.mv\",\"int.mv\",\"mil.mv\",\"museum.mv\",\"name.mv\",\"net.mv\",\"org.mv\",\"pro.mv\",\"mw\",\"ac.mw\",\"biz.mw\",\"co.mw\",\"com.mw\",\"coop.mw\",\"edu.mw\",\"gov.mw\",\"int.mw\",\"museum.mw\",\"net.mw\",\"org.mw\",\"mx\",\"com.mx\",\"org.mx\",\"gob.mx\",\"edu.mx\",\"net.mx\",\"my\",\"com.my\",\"net.my\",\"org.my\",\"gov.my\",\"edu.my\",\"mil.my\",\"name.my\",\"mz\",\"ac.mz\",\"adv.mz\",\"co.mz\",\"edu.mz\",\"gov.mz\",\"mil.mz\",\"net.mz\",\"org.mz\",\"na\",\"info.na\",\"pro.na\",\"name.na\",\"school.na\",\"or.na\",\"dr.na\",\"us.na\",\"mx.na\",\"ca.na\",\"in.na\",\"cc.na\",\"tv.na\",\"ws.na\",\"mobi.na\",\"co.na\",\"com.na\",\"org.na\",\"name\",\"nc\",\"asso.nc\",\"nom.nc\",\"ne\",\"net\",\"nf\",\"com.nf\",\"net.nf\",\"per.nf\",\"rec.nf\",\"web.nf\",\"arts.nf\",\"firm.nf\",\"info.nf\",\"other.nf\",\"store.nf\",\"ng\",\"com.ng\",\"edu.ng\",\"gov.ng\",\"i.ng\",\"mil.ng\",\"mobi.ng\",\"name.ng\",\"net.ng\",\"org.ng\",\"sch.ng\",\"ni\",\"ac.ni\",\"biz.ni\",\"co.ni\",\"com.ni\",\"edu.ni\",\"gob.ni\",\"in.ni\",\"info.ni\",\"int.ni\",\"mil.ni\",\"net.ni\",\"nom.ni\",\"org.ni\",\"web.ni\",\"nl\",\"no\",\"fhs.no\",\"vgs.no\",\"fylkesbibl.no\",\"folkebibl.no\",\"museum.no\",\"idrett.no\",\"priv.no\",\"mil.no\",\"stat.no\",\"dep.no\",\"kommune.no\",\"herad.no\",\"aa.no\",\"ah.no\",\"bu.no\",\"fm.no\",\"hl.no\",\"hm.no\",\"jan-mayen.no\",\"mr.no\",\"nl.no\",\"nt.no\",\"of.no\",\"ol.no\",\"oslo.no\",\"rl.no\",\"sf.no\",\"st.no\",\"svalbard.no\",\"tm.no\",\"tr.no\",\"va.no\",\"vf.no\",\"gs.aa.no\",\"gs.ah.no\",\"gs.bu.no\",\"gs.fm.no\",\"gs.hl.no\",\"gs.hm.no\",\"gs.jan-mayen.no\",\"gs.mr.no\",\"gs.nl.no\",\"gs.nt.no\",\"gs.of.no\",\"gs.ol.no\",\"gs.oslo.no\",\"gs.rl.no\",\"gs.sf.no\",\"gs.st.no\",\"gs.svalbard.no\",\"gs.tm.no\",\"gs.tr.no\",\"gs.va.no\",\"gs.vf.no\",\"akrehamn.no\",\"åkrehamn.no\",\"algard.no\",\"ålgård.no\",\"arna.no\",\"brumunddal.no\",\"bryne.no\",\"bronnoysund.no\",\"brønnøysund.no\",\"drobak.no\",\"drøbak.no\",\"egersund.no\",\"fetsund.no\",\"floro.no\",\"florø.no\",\"fredrikstad.no\",\"hokksund.no\",\"honefoss.no\",\"hønefoss.no\",\"jessheim.no\",\"jorpeland.no\",\"jørpeland.no\",\"kirkenes.no\",\"kopervik.no\",\"krokstadelva.no\",\"langevag.no\",\"langevåg.no\",\"leirvik.no\",\"mjondalen.no\",\"mjøndalen.no\",\"mo-i-rana.no\",\"mosjoen.no\",\"mosjøen.no\",\"nesoddtangen.no\",\"orkanger.no\",\"osoyro.no\",\"osøyro.no\",\"raholt.no\",\"råholt.no\",\"sandnessjoen.no\",\"sandnessjøen.no\",\"skedsmokorset.no\",\"slattum.no\",\"spjelkavik.no\",\"stathelle.no\",\"stavern.no\",\"stjordalshalsen.no\",\"stjørdalshalsen.no\",\"tananger.no\",\"tranby.no\",\"vossevangen.no\",\"afjord.no\",\"åfjord.no\",\"agdenes.no\",\"al.no\",\"ål.no\",\"alesund.no\",\"ålesund.no\",\"alstahaug.no\",\"alta.no\",\"áltá.no\",\"alaheadju.no\",\"álaheadju.no\",\"alvdal.no\",\"amli.no\",\"åmli.no\",\"amot.no\",\"åmot.no\",\"andebu.no\",\"andoy.no\",\"andøy.no\",\"andasuolo.no\",\"ardal.no\",\"årdal.no\",\"aremark.no\",\"arendal.no\",\"ås.no\",\"aseral.no\",\"åseral.no\",\"asker.no\",\"askim.no\",\"askvoll.no\",\"askoy.no\",\"askøy.no\",\"asnes.no\",\"åsnes.no\",\"audnedaln.no\",\"aukra.no\",\"aure.no\",\"aurland.no\",\"aurskog-holand.no\",\"aurskog-høland.no\",\"austevoll.no\",\"austrheim.no\",\"averoy.no\",\"averøy.no\",\"balestrand.no\",\"ballangen.no\",\"balat.no\",\"bálát.no\",\"balsfjord.no\",\"bahccavuotna.no\",\"báhccavuotna.no\",\"bamble.no\",\"bardu.no\",\"beardu.no\",\"beiarn.no\",\"bajddar.no\",\"bájddar.no\",\"baidar.no\",\"báidár.no\",\"berg.no\",\"bergen.no\",\"berlevag.no\",\"berlevåg.no\",\"bearalvahki.no\",\"bearalváhki.no\",\"bindal.no\",\"birkenes.no\",\"bjarkoy.no\",\"bjarkøy.no\",\"bjerkreim.no\",\"bjugn.no\",\"bodo.no\",\"bodø.no\",\"badaddja.no\",\"bådåddjå.no\",\"budejju.no\",\"bokn.no\",\"bremanger.no\",\"bronnoy.no\",\"brønnøy.no\",\"bygland.no\",\"bykle.no\",\"barum.no\",\"bærum.no\",\"bo.telemark.no\",\"bø.telemark.no\",\"bo.nordland.no\",\"bø.nordland.no\",\"bievat.no\",\"bievát.no\",\"bomlo.no\",\"bømlo.no\",\"batsfjord.no\",\"båtsfjord.no\",\"bahcavuotna.no\",\"báhcavuotna.no\",\"dovre.no\",\"drammen.no\",\"drangedal.no\",\"dyroy.no\",\"dyrøy.no\",\"donna.no\",\"dønna.no\",\"eid.no\",\"eidfjord.no\",\"eidsberg.no\",\"eidskog.no\",\"eidsvoll.no\",\"eigersund.no\",\"elverum.no\",\"enebakk.no\",\"engerdal.no\",\"etne.no\",\"etnedal.no\",\"evenes.no\",\"evenassi.no\",\"evenášši.no\",\"evje-og-hornnes.no\",\"farsund.no\",\"fauske.no\",\"fuossko.no\",\"fuoisku.no\",\"fedje.no\",\"fet.no\",\"finnoy.no\",\"finnøy.no\",\"fitjar.no\",\"fjaler.no\",\"fjell.no\",\"flakstad.no\",\"flatanger.no\",\"flekkefjord.no\",\"flesberg.no\",\"flora.no\",\"fla.no\",\"flå.no\",\"folldal.no\",\"forsand.no\",\"fosnes.no\",\"frei.no\",\"frogn.no\",\"froland.no\",\"frosta.no\",\"frana.no\",\"fræna.no\",\"froya.no\",\"frøya.no\",\"fusa.no\",\"fyresdal.no\",\"forde.no\",\"førde.no\",\"gamvik.no\",\"gangaviika.no\",\"gáŋgaviika.no\",\"gaular.no\",\"gausdal.no\",\"gildeskal.no\",\"gildeskål.no\",\"giske.no\",\"gjemnes.no\",\"gjerdrum.no\",\"gjerstad.no\",\"gjesdal.no\",\"gjovik.no\",\"gjøvik.no\",\"gloppen.no\",\"gol.no\",\"gran.no\",\"grane.no\",\"granvin.no\",\"gratangen.no\",\"grimstad.no\",\"grong.no\",\"kraanghke.no\",\"kråanghke.no\",\"grue.no\",\"gulen.no\",\"hadsel.no\",\"halden.no\",\"halsa.no\",\"hamar.no\",\"hamaroy.no\",\"habmer.no\",\"hábmer.no\",\"hapmir.no\",\"hápmir.no\",\"hammerfest.no\",\"hammarfeasta.no\",\"hámmárfeasta.no\",\"haram.no\",\"hareid.no\",\"harstad.no\",\"hasvik.no\",\"aknoluokta.no\",\"ákŋoluokta.no\",\"hattfjelldal.no\",\"aarborte.no\",\"haugesund.no\",\"hemne.no\",\"hemnes.no\",\"hemsedal.no\",\"heroy.more-og-romsdal.no\",\"herøy.møre-og-romsdal.no\",\"heroy.nordland.no\",\"herøy.nordland.no\",\"hitra.no\",\"hjartdal.no\",\"hjelmeland.no\",\"hobol.no\",\"hobøl.no\",\"hof.no\",\"hol.no\",\"hole.no\",\"holmestrand.no\",\"holtalen.no\",\"holtålen.no\",\"hornindal.no\",\"horten.no\",\"hurdal.no\",\"hurum.no\",\"hvaler.no\",\"hyllestad.no\",\"hagebostad.no\",\"hægebostad.no\",\"hoyanger.no\",\"høyanger.no\",\"hoylandet.no\",\"høylandet.no\",\"ha.no\",\"hå.no\",\"ibestad.no\",\"inderoy.no\",\"inderøy.no\",\"iveland.no\",\"jevnaker.no\",\"jondal.no\",\"jolster.no\",\"jølster.no\",\"karasjok.no\",\"karasjohka.no\",\"kárášjohka.no\",\"karlsoy.no\",\"galsa.no\",\"gálsá.no\",\"karmoy.no\",\"karmøy.no\",\"kautokeino.no\",\"guovdageaidnu.no\",\"klepp.no\",\"klabu.no\",\"klæbu.no\",\"kongsberg.no\",\"kongsvinger.no\",\"kragero.no\",\"kragerø.no\",\"kristiansand.no\",\"kristiansund.no\",\"krodsherad.no\",\"krødsherad.no\",\"kvalsund.no\",\"rahkkeravju.no\",\"ráhkkerávju.no\",\"kvam.no\",\"kvinesdal.no\",\"kvinnherad.no\",\"kviteseid.no\",\"kvitsoy.no\",\"kvitsøy.no\",\"kvafjord.no\",\"kvæfjord.no\",\"giehtavuoatna.no\",\"kvanangen.no\",\"kvænangen.no\",\"navuotna.no\",\"návuotna.no\",\"kafjord.no\",\"kåfjord.no\",\"gaivuotna.no\",\"gáivuotna.no\",\"larvik.no\",\"lavangen.no\",\"lavagis.no\",\"loabat.no\",\"loabát.no\",\"lebesby.no\",\"davvesiida.no\",\"leikanger.no\",\"leirfjord.no\",\"leka.no\",\"leksvik.no\",\"lenvik.no\",\"leangaviika.no\",\"leaŋgaviika.no\",\"lesja.no\",\"levanger.no\",\"lier.no\",\"lierne.no\",\"lillehammer.no\",\"lillesand.no\",\"lindesnes.no\",\"lindas.no\",\"lindås.no\",\"lom.no\",\"loppa.no\",\"lahppi.no\",\"láhppi.no\",\"lund.no\",\"lunner.no\",\"luroy.no\",\"lurøy.no\",\"luster.no\",\"lyngdal.no\",\"lyngen.no\",\"ivgu.no\",\"lardal.no\",\"lerdal.no\",\"lærdal.no\",\"lodingen.no\",\"lødingen.no\",\"lorenskog.no\",\"lørenskog.no\",\"loten.no\",\"løten.no\",\"malvik.no\",\"masoy.no\",\"måsøy.no\",\"muosat.no\",\"muosát.no\",\"mandal.no\",\"marker.no\",\"marnardal.no\",\"masfjorden.no\",\"meland.no\",\"meldal.no\",\"melhus.no\",\"meloy.no\",\"meløy.no\",\"meraker.no\",\"meråker.no\",\"moareke.no\",\"moåreke.no\",\"midsund.no\",\"midtre-gauldal.no\",\"modalen.no\",\"modum.no\",\"molde.no\",\"moskenes.no\",\"moss.no\",\"mosvik.no\",\"malselv.no\",\"målselv.no\",\"malatvuopmi.no\",\"málatvuopmi.no\",\"namdalseid.no\",\"aejrie.no\",\"namsos.no\",\"namsskogan.no\",\"naamesjevuemie.no\",\"nååmesjevuemie.no\",\"laakesvuemie.no\",\"nannestad.no\",\"narvik.no\",\"narviika.no\",\"naustdal.no\",\"nedre-eiker.no\",\"nes.akershus.no\",\"nes.buskerud.no\",\"nesna.no\",\"nesodden.no\",\"nesseby.no\",\"unjarga.no\",\"unjárga.no\",\"nesset.no\",\"nissedal.no\",\"nittedal.no\",\"nord-aurdal.no\",\"nord-fron.no\",\"nord-odal.no\",\"norddal.no\",\"nordkapp.no\",\"davvenjarga.no\",\"davvenjárga.no\",\"nordre-land.no\",\"nordreisa.no\",\"raisa.no\",\"ráisa.no\",\"nore-og-uvdal.no\",\"notodden.no\",\"naroy.no\",\"nærøy.no\",\"notteroy.no\",\"nøtterøy.no\",\"odda.no\",\"oksnes.no\",\"øksnes.no\",\"oppdal.no\",\"oppegard.no\",\"oppegård.no\",\"orkdal.no\",\"orland.no\",\"ørland.no\",\"orskog.no\",\"ørskog.no\",\"orsta.no\",\"ørsta.no\",\"os.hedmark.no\",\"os.hordaland.no\",\"osen.no\",\"osteroy.no\",\"osterøy.no\",\"ostre-toten.no\",\"østre-toten.no\",\"overhalla.no\",\"ovre-eiker.no\",\"øvre-eiker.no\",\"oyer.no\",\"øyer.no\",\"oygarden.no\",\"øygarden.no\",\"oystre-slidre.no\",\"øystre-slidre.no\",\"porsanger.no\",\"porsangu.no\",\"porsáŋgu.no\",\"porsgrunn.no\",\"radoy.no\",\"radøy.no\",\"rakkestad.no\",\"rana.no\",\"ruovat.no\",\"randaberg.no\",\"rauma.no\",\"rendalen.no\",\"rennebu.no\",\"rennesoy.no\",\"rennesøy.no\",\"rindal.no\",\"ringebu.no\",\"ringerike.no\",\"ringsaker.no\",\"rissa.no\",\"risor.no\",\"risør.no\",\"roan.no\",\"rollag.no\",\"rygge.no\",\"ralingen.no\",\"rælingen.no\",\"rodoy.no\",\"rødøy.no\",\"romskog.no\",\"rømskog.no\",\"roros.no\",\"røros.no\",\"rost.no\",\"røst.no\",\"royken.no\",\"røyken.no\",\"royrvik.no\",\"røyrvik.no\",\"rade.no\",\"råde.no\",\"salangen.no\",\"siellak.no\",\"saltdal.no\",\"salat.no\",\"sálát.no\",\"sálat.no\",\"samnanger.no\",\"sande.more-og-romsdal.no\",\"sande.møre-og-romsdal.no\",\"sande.vestfold.no\",\"sandefjord.no\",\"sandnes.no\",\"sandoy.no\",\"sandøy.no\",\"sarpsborg.no\",\"sauda.no\",\"sauherad.no\",\"sel.no\",\"selbu.no\",\"selje.no\",\"seljord.no\",\"sigdal.no\",\"siljan.no\",\"sirdal.no\",\"skaun.no\",\"skedsmo.no\",\"ski.no\",\"skien.no\",\"skiptvet.no\",\"skjervoy.no\",\"skjervøy.no\",\"skierva.no\",\"skiervá.no\",\"skjak.no\",\"skjåk.no\",\"skodje.no\",\"skanland.no\",\"skånland.no\",\"skanit.no\",\"skánit.no\",\"smola.no\",\"smøla.no\",\"snillfjord.no\",\"snasa.no\",\"snåsa.no\",\"snoasa.no\",\"snaase.no\",\"snåase.no\",\"sogndal.no\",\"sokndal.no\",\"sola.no\",\"solund.no\",\"songdalen.no\",\"sortland.no\",\"spydeberg.no\",\"stange.no\",\"stavanger.no\",\"steigen.no\",\"steinkjer.no\",\"stjordal.no\",\"stjørdal.no\",\"stokke.no\",\"stor-elvdal.no\",\"stord.no\",\"stordal.no\",\"storfjord.no\",\"omasvuotna.no\",\"strand.no\",\"stranda.no\",\"stryn.no\",\"sula.no\",\"suldal.no\",\"sund.no\",\"sunndal.no\",\"surnadal.no\",\"sveio.no\",\"svelvik.no\",\"sykkylven.no\",\"sogne.no\",\"søgne.no\",\"somna.no\",\"sømna.no\",\"sondre-land.no\",\"søndre-land.no\",\"sor-aurdal.no\",\"sør-aurdal.no\",\"sor-fron.no\",\"sør-fron.no\",\"sor-odal.no\",\"sør-odal.no\",\"sor-varanger.no\",\"sør-varanger.no\",\"matta-varjjat.no\",\"mátta-várjjat.no\",\"sorfold.no\",\"sørfold.no\",\"sorreisa.no\",\"sørreisa.no\",\"sorum.no\",\"sørum.no\",\"tana.no\",\"deatnu.no\",\"time.no\",\"tingvoll.no\",\"tinn.no\",\"tjeldsund.no\",\"dielddanuorri.no\",\"tjome.no\",\"tjøme.no\",\"tokke.no\",\"tolga.no\",\"torsken.no\",\"tranoy.no\",\"tranøy.no\",\"tromso.no\",\"tromsø.no\",\"tromsa.no\",\"romsa.no\",\"trondheim.no\",\"troandin.no\",\"trysil.no\",\"trana.no\",\"træna.no\",\"trogstad.no\",\"trøgstad.no\",\"tvedestrand.no\",\"tydal.no\",\"tynset.no\",\"tysfjord.no\",\"divtasvuodna.no\",\"divttasvuotna.no\",\"tysnes.no\",\"tysvar.no\",\"tysvær.no\",\"tonsberg.no\",\"tønsberg.no\",\"ullensaker.no\",\"ullensvang.no\",\"ulvik.no\",\"utsira.no\",\"vadso.no\",\"vadsø.no\",\"cahcesuolo.no\",\"čáhcesuolo.no\",\"vaksdal.no\",\"valle.no\",\"vang.no\",\"vanylven.no\",\"vardo.no\",\"vardø.no\",\"varggat.no\",\"várggát.no\",\"vefsn.no\",\"vaapste.no\",\"vega.no\",\"vegarshei.no\",\"vegårshei.no\",\"vennesla.no\",\"verdal.no\",\"verran.no\",\"vestby.no\",\"vestnes.no\",\"vestre-slidre.no\",\"vestre-toten.no\",\"vestvagoy.no\",\"vestvågøy.no\",\"vevelstad.no\",\"vik.no\",\"vikna.no\",\"vindafjord.no\",\"volda.no\",\"voss.no\",\"varoy.no\",\"værøy.no\",\"vagan.no\",\"vågan.no\",\"voagat.no\",\"vagsoy.no\",\"vågsøy.no\",\"vaga.no\",\"vågå.no\",\"valer.ostfold.no\",\"våler.østfold.no\",\"valer.hedmark.no\",\"våler.hedmark.no\",\"*.np\",\"nr\",\"biz.nr\",\"info.nr\",\"gov.nr\",\"edu.nr\",\"org.nr\",\"net.nr\",\"com.nr\",\"nu\",\"nz\",\"ac.nz\",\"co.nz\",\"cri.nz\",\"geek.nz\",\"gen.nz\",\"govt.nz\",\"health.nz\",\"iwi.nz\",\"kiwi.nz\",\"maori.nz\",\"mil.nz\",\"māori.nz\",\"net.nz\",\"org.nz\",\"parliament.nz\",\"school.nz\",\"om\",\"co.om\",\"com.om\",\"edu.om\",\"gov.om\",\"med.om\",\"museum.om\",\"net.om\",\"org.om\",\"pro.om\",\"onion\",\"org\",\"pa\",\"ac.pa\",\"gob.pa\",\"com.pa\",\"org.pa\",\"sld.pa\",\"edu.pa\",\"net.pa\",\"ing.pa\",\"abo.pa\",\"med.pa\",\"nom.pa\",\"pe\",\"edu.pe\",\"gob.pe\",\"nom.pe\",\"mil.pe\",\"org.pe\",\"com.pe\",\"net.pe\",\"pf\",\"com.pf\",\"org.pf\",\"edu.pf\",\"*.pg\",\"ph\",\"com.ph\",\"net.ph\",\"org.ph\",\"gov.ph\",\"edu.ph\",\"ngo.ph\",\"mil.ph\",\"i.ph\",\"pk\",\"com.pk\",\"net.pk\",\"edu.pk\",\"org.pk\",\"fam.pk\",\"biz.pk\",\"web.pk\",\"gov.pk\",\"gob.pk\",\"gok.pk\",\"gon.pk\",\"gop.pk\",\"gos.pk\",\"info.pk\",\"pl\",\"com.pl\",\"net.pl\",\"org.pl\",\"aid.pl\",\"agro.pl\",\"atm.pl\",\"auto.pl\",\"biz.pl\",\"edu.pl\",\"gmina.pl\",\"gsm.pl\",\"info.pl\",\"mail.pl\",\"miasta.pl\",\"media.pl\",\"mil.pl\",\"nieruchomosci.pl\",\"nom.pl\",\"pc.pl\",\"powiat.pl\",\"priv.pl\",\"realestate.pl\",\"rel.pl\",\"sex.pl\",\"shop.pl\",\"sklep.pl\",\"sos.pl\",\"szkola.pl\",\"targi.pl\",\"tm.pl\",\"tourism.pl\",\"travel.pl\",\"turystyka.pl\",\"gov.pl\",\"ap.gov.pl\",\"ic.gov.pl\",\"is.gov.pl\",\"us.gov.pl\",\"kmpsp.gov.pl\",\"kppsp.gov.pl\",\"kwpsp.gov.pl\",\"psp.gov.pl\",\"wskr.gov.pl\",\"kwp.gov.pl\",\"mw.gov.pl\",\"ug.gov.pl\",\"um.gov.pl\",\"umig.gov.pl\",\"ugim.gov.pl\",\"upow.gov.pl\",\"uw.gov.pl\",\"starostwo.gov.pl\",\"pa.gov.pl\",\"po.gov.pl\",\"psse.gov.pl\",\"pup.gov.pl\",\"rzgw.gov.pl\",\"sa.gov.pl\",\"so.gov.pl\",\"sr.gov.pl\",\"wsa.gov.pl\",\"sko.gov.pl\",\"uzs.gov.pl\",\"wiih.gov.pl\",\"winb.gov.pl\",\"pinb.gov.pl\",\"wios.gov.pl\",\"witd.gov.pl\",\"wzmiuw.gov.pl\",\"piw.gov.pl\",\"wiw.gov.pl\",\"griw.gov.pl\",\"wif.gov.pl\",\"oum.gov.pl\",\"sdn.gov.pl\",\"zp.gov.pl\",\"uppo.gov.pl\",\"mup.gov.pl\",\"wuoz.gov.pl\",\"konsulat.gov.pl\",\"oirm.gov.pl\",\"augustow.pl\",\"babia-gora.pl\",\"bedzin.pl\",\"beskidy.pl\",\"bialowieza.pl\",\"bialystok.pl\",\"bielawa.pl\",\"bieszczady.pl\",\"boleslawiec.pl\",\"bydgoszcz.pl\",\"bytom.pl\",\"cieszyn.pl\",\"czeladz.pl\",\"czest.pl\",\"dlugoleka.pl\",\"elblag.pl\",\"elk.pl\",\"glogow.pl\",\"gniezno.pl\",\"gorlice.pl\",\"grajewo.pl\",\"ilawa.pl\",\"jaworzno.pl\",\"jelenia-gora.pl\",\"jgora.pl\",\"kalisz.pl\",\"kazimierz-dolny.pl\",\"karpacz.pl\",\"kartuzy.pl\",\"kaszuby.pl\",\"katowice.pl\",\"kepno.pl\",\"ketrzyn.pl\",\"klodzko.pl\",\"kobierzyce.pl\",\"kolobrzeg.pl\",\"konin.pl\",\"konskowola.pl\",\"kutno.pl\",\"lapy.pl\",\"lebork.pl\",\"legnica.pl\",\"lezajsk.pl\",\"limanowa.pl\",\"lomza.pl\",\"lowicz.pl\",\"lubin.pl\",\"lukow.pl\",\"malbork.pl\",\"malopolska.pl\",\"mazowsze.pl\",\"mazury.pl\",\"mielec.pl\",\"mielno.pl\",\"mragowo.pl\",\"naklo.pl\",\"nowaruda.pl\",\"nysa.pl\",\"olawa.pl\",\"olecko.pl\",\"olkusz.pl\",\"olsztyn.pl\",\"opoczno.pl\",\"opole.pl\",\"ostroda.pl\",\"ostroleka.pl\",\"ostrowiec.pl\",\"ostrowwlkp.pl\",\"pila.pl\",\"pisz.pl\",\"podhale.pl\",\"podlasie.pl\",\"polkowice.pl\",\"pomorze.pl\",\"pomorskie.pl\",\"prochowice.pl\",\"pruszkow.pl\",\"przeworsk.pl\",\"pulawy.pl\",\"radom.pl\",\"rawa-maz.pl\",\"rybnik.pl\",\"rzeszow.pl\",\"sanok.pl\",\"sejny.pl\",\"slask.pl\",\"slupsk.pl\",\"sosnowiec.pl\",\"stalowa-wola.pl\",\"skoczow.pl\",\"starachowice.pl\",\"stargard.pl\",\"suwalki.pl\",\"swidnica.pl\",\"swiebodzin.pl\",\"swinoujscie.pl\",\"szczecin.pl\",\"szczytno.pl\",\"tarnobrzeg.pl\",\"tgory.pl\",\"turek.pl\",\"tychy.pl\",\"ustka.pl\",\"walbrzych.pl\",\"warmia.pl\",\"warszawa.pl\",\"waw.pl\",\"wegrow.pl\",\"wielun.pl\",\"wlocl.pl\",\"wloclawek.pl\",\"wodzislaw.pl\",\"wolomin.pl\",\"wroclaw.pl\",\"zachpomor.pl\",\"zagan.pl\",\"zarow.pl\",\"zgora.pl\",\"zgorzelec.pl\",\"pm\",\"pn\",\"gov.pn\",\"co.pn\",\"org.pn\",\"edu.pn\",\"net.pn\",\"post\",\"pr\",\"com.pr\",\"net.pr\",\"org.pr\",\"gov.pr\",\"edu.pr\",\"isla.pr\",\"pro.pr\",\"biz.pr\",\"info.pr\",\"name.pr\",\"est.pr\",\"prof.pr\",\"ac.pr\",\"pro\",\"aaa.pro\",\"aca.pro\",\"acct.pro\",\"avocat.pro\",\"bar.pro\",\"cpa.pro\",\"eng.pro\",\"jur.pro\",\"law.pro\",\"med.pro\",\"recht.pro\",\"ps\",\"edu.ps\",\"gov.ps\",\"sec.ps\",\"plo.ps\",\"com.ps\",\"org.ps\",\"net.ps\",\"pt\",\"net.pt\",\"gov.pt\",\"org.pt\",\"edu.pt\",\"int.pt\",\"publ.pt\",\"com.pt\",\"nome.pt\",\"pw\",\"co.pw\",\"ne.pw\",\"or.pw\",\"ed.pw\",\"go.pw\",\"belau.pw\",\"py\",\"com.py\",\"coop.py\",\"edu.py\",\"gov.py\",\"mil.py\",\"net.py\",\"org.py\",\"qa\",\"com.qa\",\"edu.qa\",\"gov.qa\",\"mil.qa\",\"name.qa\",\"net.qa\",\"org.qa\",\"sch.qa\",\"re\",\"asso.re\",\"com.re\",\"nom.re\",\"ro\",\"arts.ro\",\"com.ro\",\"firm.ro\",\"info.ro\",\"nom.ro\",\"nt.ro\",\"org.ro\",\"rec.ro\",\"store.ro\",\"tm.ro\",\"www.ro\",\"rs\",\"ac.rs\",\"co.rs\",\"edu.rs\",\"gov.rs\",\"in.rs\",\"org.rs\",\"ru\",\"ac.ru\",\"edu.ru\",\"gov.ru\",\"int.ru\",\"mil.ru\",\"test.ru\",\"rw\",\"ac.rw\",\"co.rw\",\"coop.rw\",\"gov.rw\",\"mil.rw\",\"net.rw\",\"org.rw\",\"sa\",\"com.sa\",\"net.sa\",\"org.sa\",\"gov.sa\",\"med.sa\",\"pub.sa\",\"edu.sa\",\"sch.sa\",\"sb\",\"com.sb\",\"edu.sb\",\"gov.sb\",\"net.sb\",\"org.sb\",\"sc\",\"com.sc\",\"gov.sc\",\"net.sc\",\"org.sc\",\"edu.sc\",\"sd\",\"com.sd\",\"net.sd\",\"org.sd\",\"edu.sd\",\"med.sd\",\"tv.sd\",\"gov.sd\",\"info.sd\",\"se\",\"a.se\",\"ac.se\",\"b.se\",\"bd.se\",\"brand.se\",\"c.se\",\"d.se\",\"e.se\",\"f.se\",\"fh.se\",\"fhsk.se\",\"fhv.se\",\"g.se\",\"h.se\",\"i.se\",\"k.se\",\"komforb.se\",\"kommunalforbund.se\",\"komvux.se\",\"l.se\",\"lanbib.se\",\"m.se\",\"n.se\",\"naturbruksgymn.se\",\"o.se\",\"org.se\",\"p.se\",\"parti.se\",\"pp.se\",\"press.se\",\"r.se\",\"s.se\",\"t.se\",\"tm.se\",\"u.se\",\"w.se\",\"x.se\",\"y.se\",\"z.se\",\"sg\",\"com.sg\",\"net.sg\",\"org.sg\",\"gov.sg\",\"edu.sg\",\"per.sg\",\"sh\",\"com.sh\",\"net.sh\",\"gov.sh\",\"org.sh\",\"mil.sh\",\"si\",\"sj\",\"sk\",\"sl\",\"com.sl\",\"net.sl\",\"edu.sl\",\"gov.sl\",\"org.sl\",\"sm\",\"sn\",\"art.sn\",\"com.sn\",\"edu.sn\",\"gouv.sn\",\"org.sn\",\"perso.sn\",\"univ.sn\",\"so\",\"com.so\",\"net.so\",\"org.so\",\"sr\",\"st\",\"co.st\",\"com.st\",\"consulado.st\",\"edu.st\",\"embaixada.st\",\"gov.st\",\"mil.st\",\"net.st\",\"org.st\",\"principe.st\",\"saotome.st\",\"store.st\",\"su\",\"sv\",\"com.sv\",\"edu.sv\",\"gob.sv\",\"org.sv\",\"red.sv\",\"sx\",\"gov.sx\",\"sy\",\"edu.sy\",\"gov.sy\",\"net.sy\",\"mil.sy\",\"com.sy\",\"org.sy\",\"sz\",\"co.sz\",\"ac.sz\",\"org.sz\",\"tc\",\"td\",\"tel\",\"tf\",\"tg\",\"th\",\"ac.th\",\"co.th\",\"go.th\",\"in.th\",\"mi.th\",\"net.th\",\"or.th\",\"tj\",\"ac.tj\",\"biz.tj\",\"co.tj\",\"com.tj\",\"edu.tj\",\"go.tj\",\"gov.tj\",\"int.tj\",\"mil.tj\",\"name.tj\",\"net.tj\",\"nic.tj\",\"org.tj\",\"test.tj\",\"web.tj\",\"tk\",\"tl\",\"gov.tl\",\"tm\",\"com.tm\",\"co.tm\",\"org.tm\",\"net.tm\",\"nom.tm\",\"gov.tm\",\"mil.tm\",\"edu.tm\",\"tn\",\"com.tn\",\"ens.tn\",\"fin.tn\",\"gov.tn\",\"ind.tn\",\"intl.tn\",\"nat.tn\",\"net.tn\",\"org.tn\",\"info.tn\",\"perso.tn\",\"tourism.tn\",\"edunet.tn\",\"rnrt.tn\",\"rns.tn\",\"rnu.tn\",\"mincom.tn\",\"agrinet.tn\",\"defense.tn\",\"turen.tn\",\"to\",\"com.to\",\"gov.to\",\"net.to\",\"org.to\",\"edu.to\",\"mil.to\",\"tr\",\"av.tr\",\"bbs.tr\",\"bel.tr\",\"biz.tr\",\"com.tr\",\"dr.tr\",\"edu.tr\",\"gen.tr\",\"gov.tr\",\"info.tr\",\"mil.tr\",\"k12.tr\",\"kep.tr\",\"name.tr\",\"net.tr\",\"org.tr\",\"pol.tr\",\"tel.tr\",\"tsk.tr\",\"tv.tr\",\"web.tr\",\"nc.tr\",\"gov.nc.tr\",\"tt\",\"co.tt\",\"com.tt\",\"org.tt\",\"net.tt\",\"biz.tt\",\"info.tt\",\"pro.tt\",\"int.tt\",\"coop.tt\",\"jobs.tt\",\"mobi.tt\",\"travel.tt\",\"museum.tt\",\"aero.tt\",\"name.tt\",\"gov.tt\",\"edu.tt\",\"tv\",\"tw\",\"edu.tw\",\"gov.tw\",\"mil.tw\",\"com.tw\",\"net.tw\",\"org.tw\",\"idv.tw\",\"game.tw\",\"ebiz.tw\",\"club.tw\",\"網路.tw\",\"組織.tw\",\"商業.tw\",\"tz\",\"ac.tz\",\"co.tz\",\"go.tz\",\"hotel.tz\",\"info.tz\",\"me.tz\",\"mil.tz\",\"mobi.tz\",\"ne.tz\",\"or.tz\",\"sc.tz\",\"tv.tz\",\"ua\",\"com.ua\",\"edu.ua\",\"gov.ua\",\"in.ua\",\"net.ua\",\"org.ua\",\"cherkassy.ua\",\"cherkasy.ua\",\"chernigov.ua\",\"chernihiv.ua\",\"chernivtsi.ua\",\"chernovtsy.ua\",\"ck.ua\",\"cn.ua\",\"cr.ua\",\"crimea.ua\",\"cv.ua\",\"dn.ua\",\"dnepropetrovsk.ua\",\"dnipropetrovsk.ua\",\"dominic.ua\",\"donetsk.ua\",\"dp.ua\",\"if.ua\",\"ivano-frankivsk.ua\",\"kh.ua\",\"kharkiv.ua\",\"kharkov.ua\",\"kherson.ua\",\"khmelnitskiy.ua\",\"khmelnytskyi.ua\",\"kiev.ua\",\"kirovograd.ua\",\"km.ua\",\"kr.ua\",\"krym.ua\",\"ks.ua\",\"kv.ua\",\"kyiv.ua\",\"lg.ua\",\"lt.ua\",\"lugansk.ua\",\"lutsk.ua\",\"lv.ua\",\"lviv.ua\",\"mk.ua\",\"mykolaiv.ua\",\"nikolaev.ua\",\"od.ua\",\"odesa.ua\",\"odessa.ua\",\"pl.ua\",\"poltava.ua\",\"rivne.ua\",\"rovno.ua\",\"rv.ua\",\"sb.ua\",\"sebastopol.ua\",\"sevastopol.ua\",\"sm.ua\",\"sumy.ua\",\"te.ua\",\"ternopil.ua\",\"uz.ua\",\"uzhgorod.ua\",\"vinnica.ua\",\"vinnytsia.ua\",\"vn.ua\",\"volyn.ua\",\"yalta.ua\",\"zaporizhzhe.ua\",\"zaporizhzhia.ua\",\"zhitomir.ua\",\"zhytomyr.ua\",\"zp.ua\",\"zt.ua\",\"ug\",\"co.ug\",\"or.ug\",\"ac.ug\",\"sc.ug\",\"go.ug\",\"ne.ug\",\"com.ug\",\"org.ug\",\"uk\",\"ac.uk\",\"co.uk\",\"gov.uk\",\"ltd.uk\",\"me.uk\",\"net.uk\",\"nhs.uk\",\"org.uk\",\"plc.uk\",\"police.uk\",\"*.sch.uk\",\"us\",\"dni.us\",\"fed.us\",\"isa.us\",\"kids.us\",\"nsn.us\",\"ak.us\",\"al.us\",\"ar.us\",\"as.us\",\"az.us\",\"ca.us\",\"co.us\",\"ct.us\",\"dc.us\",\"de.us\",\"fl.us\",\"ga.us\",\"gu.us\",\"hi.us\",\"ia.us\",\"id.us\",\"il.us\",\"in.us\",\"ks.us\",\"ky.us\",\"la.us\",\"ma.us\",\"md.us\",\"me.us\",\"mi.us\",\"mn.us\",\"mo.us\",\"ms.us\",\"mt.us\",\"nc.us\",\"nd.us\",\"ne.us\",\"nh.us\",\"nj.us\",\"nm.us\",\"nv.us\",\"ny.us\",\"oh.us\",\"ok.us\",\"or.us\",\"pa.us\",\"pr.us\",\"ri.us\",\"sc.us\",\"sd.us\",\"tn.us\",\"tx.us\",\"ut.us\",\"vi.us\",\"vt.us\",\"va.us\",\"wa.us\",\"wi.us\",\"wv.us\",\"wy.us\",\"k12.ak.us\",\"k12.al.us\",\"k12.ar.us\",\"k12.as.us\",\"k12.az.us\",\"k12.ca.us\",\"k12.co.us\",\"k12.ct.us\",\"k12.dc.us\",\"k12.de.us\",\"k12.fl.us\",\"k12.ga.us\",\"k12.gu.us\",\"k12.ia.us\",\"k12.id.us\",\"k12.il.us\",\"k12.in.us\",\"k12.ks.us\",\"k12.ky.us\",\"k12.la.us\",\"k12.ma.us\",\"k12.md.us\",\"k12.me.us\",\"k12.mi.us\",\"k12.mn.us\",\"k12.mo.us\",\"k12.ms.us\",\"k12.mt.us\",\"k12.nc.us\",\"k12.ne.us\",\"k12.nh.us\",\"k12.nj.us\",\"k12.nm.us\",\"k12.nv.us\",\"k12.ny.us\",\"k12.oh.us\",\"k12.ok.us\",\"k12.or.us\",\"k12.pa.us\",\"k12.pr.us\",\"k12.ri.us\",\"k12.sc.us\",\"k12.tn.us\",\"k12.tx.us\",\"k12.ut.us\",\"k12.vi.us\",\"k12.vt.us\",\"k12.va.us\",\"k12.wa.us\",\"k12.wi.us\",\"k12.wy.us\",\"cc.ak.us\",\"cc.al.us\",\"cc.ar.us\",\"cc.as.us\",\"cc.az.us\",\"cc.ca.us\",\"cc.co.us\",\"cc.ct.us\",\"cc.dc.us\",\"cc.de.us\",\"cc.fl.us\",\"cc.ga.us\",\"cc.gu.us\",\"cc.hi.us\",\"cc.ia.us\",\"cc.id.us\",\"cc.il.us\",\"cc.in.us\",\"cc.ks.us\",\"cc.ky.us\",\"cc.la.us\",\"cc.ma.us\",\"cc.md.us\",\"cc.me.us\",\"cc.mi.us\",\"cc.mn.us\",\"cc.mo.us\",\"cc.ms.us\",\"cc.mt.us\",\"cc.nc.us\",\"cc.nd.us\",\"cc.ne.us\",\"cc.nh.us\",\"cc.nj.us\",\"cc.nm.us\",\"cc.nv.us\",\"cc.ny.us\",\"cc.oh.us\",\"cc.ok.us\",\"cc.or.us\",\"cc.pa.us\",\"cc.pr.us\",\"cc.ri.us\",\"cc.sc.us\",\"cc.sd.us\",\"cc.tn.us\",\"cc.tx.us\",\"cc.ut.us\",\"cc.vi.us\",\"cc.vt.us\",\"cc.va.us\",\"cc.wa.us\",\"cc.wi.us\",\"cc.wv.us\",\"cc.wy.us\",\"lib.ak.us\",\"lib.al.us\",\"lib.ar.us\",\"lib.as.us\",\"lib.az.us\",\"lib.ca.us\",\"lib.co.us\",\"lib.ct.us\",\"lib.dc.us\",\"lib.fl.us\",\"lib.ga.us\",\"lib.gu.us\",\"lib.hi.us\",\"lib.ia.us\",\"lib.id.us\",\"lib.il.us\",\"lib.in.us\",\"lib.ks.us\",\"lib.ky.us\",\"lib.la.us\",\"lib.ma.us\",\"lib.md.us\",\"lib.me.us\",\"lib.mi.us\",\"lib.mn.us\",\"lib.mo.us\",\"lib.ms.us\",\"lib.mt.us\",\"lib.nc.us\",\"lib.nd.us\",\"lib.ne.us\",\"lib.nh.us\",\"lib.nj.us\",\"lib.nm.us\",\"lib.nv.us\",\"lib.ny.us\",\"lib.oh.us\",\"lib.ok.us\",\"lib.or.us\",\"lib.pa.us\",\"lib.pr.us\",\"lib.ri.us\",\"lib.sc.us\",\"lib.sd.us\",\"lib.tn.us\",\"lib.tx.us\",\"lib.ut.us\",\"lib.vi.us\",\"lib.vt.us\",\"lib.va.us\",\"lib.wa.us\",\"lib.wi.us\",\"lib.wy.us\",\"pvt.k12.ma.us\",\"chtr.k12.ma.us\",\"paroch.k12.ma.us\",\"ann-arbor.mi.us\",\"cog.mi.us\",\"dst.mi.us\",\"eaton.mi.us\",\"gen.mi.us\",\"mus.mi.us\",\"tec.mi.us\",\"washtenaw.mi.us\",\"uy\",\"com.uy\",\"edu.uy\",\"gub.uy\",\"mil.uy\",\"net.uy\",\"org.uy\",\"uz\",\"co.uz\",\"com.uz\",\"net.uz\",\"org.uz\",\"va\",\"vc\",\"com.vc\",\"net.vc\",\"org.vc\",\"gov.vc\",\"mil.vc\",\"edu.vc\",\"ve\",\"arts.ve\",\"co.ve\",\"com.ve\",\"e12.ve\",\"edu.ve\",\"firm.ve\",\"gob.ve\",\"gov.ve\",\"info.ve\",\"int.ve\",\"mil.ve\",\"net.ve\",\"org.ve\",\"rec.ve\",\"store.ve\",\"tec.ve\",\"web.ve\",\"vg\",\"vi\",\"co.vi\",\"com.vi\",\"k12.vi\",\"net.vi\",\"org.vi\",\"vn\",\"com.vn\",\"net.vn\",\"org.vn\",\"edu.vn\",\"gov.vn\",\"int.vn\",\"ac.vn\",\"biz.vn\",\"info.vn\",\"name.vn\",\"pro.vn\",\"health.vn\",\"vu\",\"com.vu\",\"edu.vu\",\"net.vu\",\"org.vu\",\"wf\",\"ws\",\"com.ws\",\"net.ws\",\"org.ws\",\"gov.ws\",\"edu.ws\",\"yt\",\"امارات\",\"հայ\",\"বাংলা\",\"бг\",\"бел\",\"中国\",\"中國\",\"الجزائر\",\"مصر\",\"ею\",\"გე\",\"ελ\",\"香港\",\"公司.香港\",\"教育.香港\",\"政府.香港\",\"個人.香港\",\"網絡.香港\",\"組織.香港\",\"ಭಾರತ\",\"ଭାରତ\",\"ভাৰত\",\"भारतम्\",\"भारोत\",\"ڀارت\",\"ഭാരതം\",\"भारत\",\"بارت\",\"بھارت\",\"భారత్\",\"ભારત\",\"ਭਾਰਤ\",\"ভারত\",\"இந்தியா\",\"ایران\",\"ايران\",\"عراق\",\"الاردن\",\"한국\",\"қаз\",\"ලංකා\",\"இலங்கை\",\"المغرب\",\"мкд\",\"мон\",\"澳門\",\"澳门\",\"مليسيا\",\"عمان\",\"پاکستان\",\"پاكستان\",\"فلسطين\",\"срб\",\"пр.срб\",\"орг.срб\",\"обр.срб\",\"од.срб\",\"упр.срб\",\"ак.срб\",\"рф\",\"قطر\",\"السعودية\",\"السعودیة\",\"السعودیۃ\",\"السعوديه\",\"سودان\",\"新加坡\",\"சிங்கப்பூர்\",\"سورية\",\"سوريا\",\"ไทย\",\"ศึกษา.ไทย\",\"ธุรกิจ.ไทย\",\"รัฐบาล.ไทย\",\"ทหาร.ไทย\",\"เน็ต.ไทย\",\"องค์กร.ไทย\",\"تونس\",\"台灣\",\"台湾\",\"臺灣\",\"укр\",\"اليمن\",\"xxx\",\"*.ye\",\"ac.za\",\"agric.za\",\"alt.za\",\"co.za\",\"edu.za\",\"gov.za\",\"grondar.za\",\"law.za\",\"mil.za\",\"net.za\",\"ngo.za\",\"nic.za\",\"nis.za\",\"nom.za\",\"org.za\",\"school.za\",\"tm.za\",\"web.za\",\"zm\",\"ac.zm\",\"biz.zm\",\"co.zm\",\"com.zm\",\"edu.zm\",\"gov.zm\",\"info.zm\",\"mil.zm\",\"net.zm\",\"org.zm\",\"sch.zm\",\"zw\",\"ac.zw\",\"co.zw\",\"gov.zw\",\"mil.zw\",\"org.zw\",\"aaa\",\"aarp\",\"abarth\",\"abb\",\"abbott\",\"abbvie\",\"abc\",\"able\",\"abogado\",\"abudhabi\",\"academy\",\"accenture\",\"accountant\",\"accountants\",\"aco\",\"actor\",\"adac\",\"ads\",\"adult\",\"aeg\",\"aetna\",\"afamilycompany\",\"afl\",\"africa\",\"agakhan\",\"agency\",\"aig\",\"aigo\",\"airbus\",\"airforce\",\"airtel\",\"akdn\",\"alfaromeo\",\"alibaba\",\"alipay\",\"allfinanz\",\"allstate\",\"ally\",\"alsace\",\"alstom\",\"americanexpress\",\"americanfamily\",\"amex\",\"amfam\",\"amica\",\"amsterdam\",\"analytics\",\"android\",\"anquan\",\"anz\",\"aol\",\"apartments\",\"app\",\"apple\",\"aquarelle\",\"arab\",\"aramco\",\"archi\",\"army\",\"art\",\"arte\",\"asda\",\"associates\",\"athleta\",\"attorney\",\"auction\",\"audi\",\"audible\",\"audio\",\"auspost\",\"author\",\"auto\",\"autos\",\"avianca\",\"aws\",\"axa\",\"azure\",\"baby\",\"baidu\",\"banamex\",\"bananarepublic\",\"band\",\"bank\",\"bar\",\"barcelona\",\"barclaycard\",\"barclays\",\"barefoot\",\"bargains\",\"baseball\",\"basketball\",\"bauhaus\",\"bayern\",\"bbc\",\"bbt\",\"bbva\",\"bcg\",\"bcn\",\"beats\",\"beauty\",\"beer\",\"bentley\",\"berlin\",\"best\",\"bestbuy\",\"bet\",\"bharti\",\"bible\",\"bid\",\"bike\",\"bing\",\"bingo\",\"bio\",\"black\",\"blackfriday\",\"blockbuster\",\"blog\",\"bloomberg\",\"blue\",\"bms\",\"bmw\",\"bnpparibas\",\"boats\",\"boehringer\",\"bofa\",\"bom\",\"bond\",\"boo\",\"book\",\"booking\",\"bosch\",\"bostik\",\"boston\",\"bot\",\"boutique\",\"box\",\"bradesco\",\"bridgestone\",\"broadway\",\"broker\",\"brother\",\"brussels\",\"budapest\",\"bugatti\",\"build\",\"builders\",\"business\",\"buy\",\"buzz\",\"bzh\",\"cab\",\"cafe\",\"cal\",\"call\",\"calvinklein\",\"cam\",\"camera\",\"camp\",\"cancerresearch\",\"canon\",\"capetown\",\"capital\",\"capitalone\",\"car\",\"caravan\",\"cards\",\"care\",\"career\",\"careers\",\"cars\",\"cartier\",\"casa\",\"case\",\"caseih\",\"cash\",\"casino\",\"catering\",\"catholic\",\"cba\",\"cbn\",\"cbre\",\"cbs\",\"ceb\",\"center\",\"ceo\",\"cern\",\"cfa\",\"cfd\",\"chanel\",\"channel\",\"charity\",\"chase\",\"chat\",\"cheap\",\"chintai\",\"christmas\",\"chrome\",\"chrysler\",\"church\",\"cipriani\",\"circle\",\"cisco\",\"citadel\",\"citi\",\"citic\",\"city\",\"cityeats\",\"claims\",\"cleaning\",\"click\",\"clinic\",\"clinique\",\"clothing\",\"cloud\",\"club\",\"clubmed\",\"coach\",\"codes\",\"coffee\",\"college\",\"cologne\",\"comcast\",\"commbank\",\"community\",\"company\",\"compare\",\"computer\",\"comsec\",\"condos\",\"construction\",\"consulting\",\"contact\",\"contractors\",\"cooking\",\"cookingchannel\",\"cool\",\"corsica\",\"country\",\"coupon\",\"coupons\",\"courses\",\"cpa\",\"credit\",\"creditcard\",\"creditunion\",\"cricket\",\"crown\",\"crs\",\"cruise\",\"cruises\",\"csc\",\"cuisinella\",\"cymru\",\"cyou\",\"dabur\",\"dad\",\"dance\",\"data\",\"date\",\"dating\",\"datsun\",\"day\",\"dclk\",\"dds\",\"deal\",\"dealer\",\"deals\",\"degree\",\"delivery\",\"dell\",\"deloitte\",\"delta\",\"democrat\",\"dental\",\"dentist\",\"desi\",\"design\",\"dev\",\"dhl\",\"diamonds\",\"diet\",\"digital\",\"direct\",\"directory\",\"discount\",\"discover\",\"dish\",\"diy\",\"dnp\",\"docs\",\"doctor\",\"dodge\",\"dog\",\"domains\",\"dot\",\"download\",\"drive\",\"dtv\",\"dubai\",\"duck\",\"dunlop\",\"dupont\",\"durban\",\"dvag\",\"dvr\",\"earth\",\"eat\",\"eco\",\"edeka\",\"education\",\"email\",\"emerck\",\"energy\",\"engineer\",\"engineering\",\"enterprises\",\"epson\",\"equipment\",\"ericsson\",\"erni\",\"esq\",\"estate\",\"esurance\",\"etisalat\",\"eurovision\",\"eus\",\"events\",\"everbank\",\"exchange\",\"expert\",\"exposed\",\"express\",\"extraspace\",\"fage\",\"fail\",\"fairwinds\",\"faith\",\"family\",\"fan\",\"fans\",\"farm\",\"farmers\",\"fashion\",\"fast\",\"fedex\",\"feedback\",\"ferrari\",\"ferrero\",\"fiat\",\"fidelity\",\"fido\",\"film\",\"final\",\"finance\",\"financial\",\"fire\",\"firestone\",\"firmdale\",\"fish\",\"fishing\",\"fit\",\"fitness\",\"flickr\",\"flights\",\"flir\",\"florist\",\"flowers\",\"fly\",\"foo\",\"food\",\"foodnetwork\",\"football\",\"ford\",\"forex\",\"forsale\",\"forum\",\"foundation\",\"fox\",\"free\",\"fresenius\",\"frl\",\"frogans\",\"frontdoor\",\"frontier\",\"ftr\",\"fujitsu\",\"fujixerox\",\"fun\",\"fund\",\"furniture\",\"futbol\",\"fyi\",\"gal\",\"gallery\",\"gallo\",\"gallup\",\"game\",\"games\",\"gap\",\"garden\",\"gay\",\"gbiz\",\"gdn\",\"gea\",\"gent\",\"genting\",\"george\",\"ggee\",\"gift\",\"gifts\",\"gives\",\"giving\",\"glade\",\"glass\",\"gle\",\"global\",\"globo\",\"gmail\",\"gmbh\",\"gmo\",\"gmx\",\"godaddy\",\"gold\",\"goldpoint\",\"golf\",\"goo\",\"goodyear\",\"goog\",\"google\",\"gop\",\"got\",\"grainger\",\"graphics\",\"gratis\",\"green\",\"gripe\",\"grocery\",\"group\",\"guardian\",\"gucci\",\"guge\",\"guide\",\"guitars\",\"guru\",\"hair\",\"hamburg\",\"hangout\",\"haus\",\"hbo\",\"hdfc\",\"hdfcbank\",\"health\",\"healthcare\",\"help\",\"helsinki\",\"here\",\"hermes\",\"hgtv\",\"hiphop\",\"hisamitsu\",\"hitachi\",\"hiv\",\"hkt\",\"hockey\",\"holdings\",\"holiday\",\"homedepot\",\"homegoods\",\"homes\",\"homesense\",\"honda\",\"horse\",\"hospital\",\"host\",\"hosting\",\"hot\",\"hoteles\",\"hotels\",\"hotmail\",\"house\",\"how\",\"hsbc\",\"hughes\",\"hyatt\",\"hyundai\",\"ibm\",\"icbc\",\"ice\",\"icu\",\"ieee\",\"ifm\",\"ikano\",\"imamat\",\"imdb\",\"immo\",\"immobilien\",\"inc\",\"industries\",\"infiniti\",\"ing\",\"ink\",\"institute\",\"insurance\",\"insure\",\"intel\",\"international\",\"intuit\",\"investments\",\"ipiranga\",\"irish\",\"ismaili\",\"ist\",\"istanbul\",\"itau\",\"itv\",\"iveco\",\"jaguar\",\"java\",\"jcb\",\"jcp\",\"jeep\",\"jetzt\",\"jewelry\",\"jio\",\"jll\",\"jmp\",\"jnj\",\"joburg\",\"jot\",\"joy\",\"jpmorgan\",\"jprs\",\"juegos\",\"juniper\",\"kaufen\",\"kddi\",\"kerryhotels\",\"kerrylogistics\",\"kerryproperties\",\"kfh\",\"kia\",\"kim\",\"kinder\",\"kindle\",\"kitchen\",\"kiwi\",\"koeln\",\"komatsu\",\"kosher\",\"kpmg\",\"kpn\",\"krd\",\"kred\",\"kuokgroup\",\"kyoto\",\"lacaixa\",\"ladbrokes\",\"lamborghini\",\"lamer\",\"lancaster\",\"lancia\",\"lancome\",\"land\",\"landrover\",\"lanxess\",\"lasalle\",\"lat\",\"latino\",\"latrobe\",\"law\",\"lawyer\",\"lds\",\"lease\",\"leclerc\",\"lefrak\",\"legal\",\"lego\",\"lexus\",\"lgbt\",\"liaison\",\"lidl\",\"life\",\"lifeinsurance\",\"lifestyle\",\"lighting\",\"like\",\"lilly\",\"limited\",\"limo\",\"lincoln\",\"linde\",\"link\",\"lipsy\",\"live\",\"living\",\"lixil\",\"llc\",\"llp\",\"loan\",\"loans\",\"locker\",\"locus\",\"loft\",\"lol\",\"london\",\"lotte\",\"lotto\",\"love\",\"lpl\",\"lplfinancial\",\"ltd\",\"ltda\",\"lundbeck\",\"lupin\",\"luxe\",\"luxury\",\"macys\",\"madrid\",\"maif\",\"maison\",\"makeup\",\"man\",\"management\",\"mango\",\"map\",\"market\",\"marketing\",\"markets\",\"marriott\",\"marshalls\",\"maserati\",\"mattel\",\"mba\",\"mckinsey\",\"med\",\"media\",\"meet\",\"melbourne\",\"meme\",\"memorial\",\"men\",\"menu\",\"merckmsd\",\"metlife\",\"miami\",\"microsoft\",\"mini\",\"mint\",\"mit\",\"mitsubishi\",\"mlb\",\"mls\",\"mma\",\"mobile\",\"mobily\",\"moda\",\"moe\",\"moi\",\"mom\",\"monash\",\"money\",\"monster\",\"mopar\",\"mormon\",\"mortgage\",\"moscow\",\"moto\",\"motorcycles\",\"mov\",\"movie\",\"movistar\",\"msd\",\"mtn\",\"mtr\",\"mutual\",\"nab\",\"nadex\",\"nagoya\",\"nationwide\",\"natura\",\"navy\",\"nba\",\"nec\",\"netbank\",\"netflix\",\"network\",\"neustar\",\"new\",\"newholland\",\"news\",\"next\",\"nextdirect\",\"nexus\",\"nfl\",\"ngo\",\"nhk\",\"nico\",\"nike\",\"nikon\",\"ninja\",\"nissan\",\"nissay\",\"nokia\",\"northwesternmutual\",\"norton\",\"now\",\"nowruz\",\"nowtv\",\"nra\",\"nrw\",\"ntt\",\"nyc\",\"obi\",\"observer\",\"off\",\"office\",\"okinawa\",\"olayan\",\"olayangroup\",\"oldnavy\",\"ollo\",\"omega\",\"one\",\"ong\",\"onl\",\"online\",\"onyourside\",\"ooo\",\"open\",\"oracle\",\"orange\",\"organic\",\"origins\",\"osaka\",\"otsuka\",\"ott\",\"ovh\",\"page\",\"panasonic\",\"paris\",\"pars\",\"partners\",\"parts\",\"party\",\"passagens\",\"pay\",\"pccw\",\"pet\",\"pfizer\",\"pharmacy\",\"phd\",\"philips\",\"phone\",\"photo\",\"photography\",\"photos\",\"physio\",\"piaget\",\"pics\",\"pictet\",\"pictures\",\"pid\",\"pin\",\"ping\",\"pink\",\"pioneer\",\"pizza\",\"place\",\"play\",\"playstation\",\"plumbing\",\"plus\",\"pnc\",\"pohl\",\"poker\",\"politie\",\"porn\",\"pramerica\",\"praxi\",\"press\",\"prime\",\"prod\",\"productions\",\"prof\",\"progressive\",\"promo\",\"properties\",\"property\",\"protection\",\"pru\",\"prudential\",\"pub\",\"pwc\",\"qpon\",\"quebec\",\"quest\",\"qvc\",\"racing\",\"radio\",\"raid\",\"read\",\"realestate\",\"realtor\",\"realty\",\"recipes\",\"red\",\"redstone\",\"redumbrella\",\"rehab\",\"reise\",\"reisen\",\"reit\",\"reliance\",\"ren\",\"rent\",\"rentals\",\"repair\",\"report\",\"republican\",\"rest\",\"restaurant\",\"review\",\"reviews\",\"rexroth\",\"rich\",\"richardli\",\"ricoh\",\"rightathome\",\"ril\",\"rio\",\"rip\",\"rmit\",\"rocher\",\"rocks\",\"rodeo\",\"rogers\",\"room\",\"rsvp\",\"rugby\",\"ruhr\",\"run\",\"rwe\",\"ryukyu\",\"saarland\",\"safe\",\"safety\",\"sakura\",\"sale\",\"salon\",\"samsclub\",\"samsung\",\"sandvik\",\"sandvikcoromant\",\"sanofi\",\"sap\",\"sarl\",\"sas\",\"save\",\"saxo\",\"sbi\",\"sbs\",\"sca\",\"scb\",\"schaeffler\",\"schmidt\",\"scholarships\",\"school\",\"schule\",\"schwarz\",\"science\",\"scjohnson\",\"scor\",\"scot\",\"search\",\"seat\",\"secure\",\"security\",\"seek\",\"select\",\"sener\",\"services\",\"ses\",\"seven\",\"sew\",\"sex\",\"sexy\",\"sfr\",\"shangrila\",\"sharp\",\"shaw\",\"shell\",\"shia\",\"shiksha\",\"shoes\",\"shop\",\"shopping\",\"shouji\",\"show\",\"showtime\",\"shriram\",\"silk\",\"sina\",\"singles\",\"site\",\"ski\",\"skin\",\"sky\",\"skype\",\"sling\",\"smart\",\"smile\",\"sncf\",\"soccer\",\"social\",\"softbank\",\"software\",\"sohu\",\"solar\",\"solutions\",\"song\",\"sony\",\"soy\",\"space\",\"sport\",\"spot\",\"spreadbetting\",\"srl\",\"srt\",\"stada\",\"staples\",\"star\",\"statebank\",\"statefarm\",\"stc\",\"stcgroup\",\"stockholm\",\"storage\",\"store\",\"stream\",\"studio\",\"study\",\"style\",\"sucks\",\"supplies\",\"supply\",\"support\",\"surf\",\"surgery\",\"suzuki\",\"swatch\",\"swiftcover\",\"swiss\",\"sydney\",\"symantec\",\"systems\",\"tab\",\"taipei\",\"talk\",\"taobao\",\"target\",\"tatamotors\",\"tatar\",\"tattoo\",\"tax\",\"taxi\",\"tci\",\"tdk\",\"team\",\"tech\",\"technology\",\"telefonica\",\"temasek\",\"tennis\",\"teva\",\"thd\",\"theater\",\"theatre\",\"tiaa\",\"tickets\",\"tienda\",\"tiffany\",\"tips\",\"tires\",\"tirol\",\"tjmaxx\",\"tjx\",\"tkmaxx\",\"tmall\",\"today\",\"tokyo\",\"tools\",\"top\",\"toray\",\"toshiba\",\"total\",\"tours\",\"town\",\"toyota\",\"toys\",\"trade\",\"trading\",\"training\",\"travel\",\"travelchannel\",\"travelers\",\"travelersinsurance\",\"trust\",\"trv\",\"tube\",\"tui\",\"tunes\",\"tushu\",\"tvs\",\"ubank\",\"ubs\",\"uconnect\",\"unicom\",\"university\",\"uno\",\"uol\",\"ups\",\"vacations\",\"vana\",\"vanguard\",\"vegas\",\"ventures\",\"verisign\",\"versicherung\",\"vet\",\"viajes\",\"video\",\"vig\",\"viking\",\"villas\",\"vin\",\"vip\",\"virgin\",\"visa\",\"vision\",\"vistaprint\",\"viva\",\"vivo\",\"vlaanderen\",\"vodka\",\"volkswagen\",\"volvo\",\"vote\",\"voting\",\"voto\",\"voyage\",\"vuelos\",\"wales\",\"walmart\",\"walter\",\"wang\",\"wanggou\",\"warman\",\"watch\",\"watches\",\"weather\",\"weatherchannel\",\"webcam\",\"weber\",\"website\",\"wed\",\"wedding\",\"weibo\",\"weir\",\"whoswho\",\"wien\",\"wiki\",\"williamhill\",\"win\",\"windows\",\"wine\",\"winners\",\"wme\",\"wolterskluwer\",\"woodside\",\"work\",\"works\",\"world\",\"wow\",\"wtc\",\"wtf\",\"xbox\",\"xerox\",\"xfinity\",\"xihuan\",\"xin\",\"कॉम\",\"セール\",\"佛山\",\"慈善\",\"集团\",\"在线\",\"大众汽车\",\"点看\",\"คอม\",\"八卦\",\"موقع\",\"公益\",\"公司\",\"香格里拉\",\"网站\",\"移动\",\"我爱你\",\"москва\",\"католик\",\"онлайн\",\"сайт\",\"联通\",\"קום\",\"时尚\",\"微博\",\"淡马锡\",\"ファッション\",\"орг\",\"नेट\",\"ストア\",\"삼성\",\"商标\",\"商店\",\"商城\",\"дети\",\"ポイント\",\"新闻\",\"工行\",\"家電\",\"كوم\",\"中文网\",\"中信\",\"娱乐\",\"谷歌\",\"電訊盈科\",\"购物\",\"クラウド\",\"通販\",\"网店\",\"संगठन\",\"餐厅\",\"网络\",\"ком\",\"诺基亚\",\"食品\",\"飞利浦\",\"手表\",\"手机\",\"ارامكو\",\"العليان\",\"اتصالات\",\"بازار\",\"موبايلي\",\"ابوظبي\",\"كاثوليك\",\"همراه\",\"닷컴\",\"政府\",\"شبكة\",\"بيتك\",\"عرب\",\"机构\",\"组织机构\",\"健康\",\"招聘\",\"рус\",\"珠宝\",\"大拿\",\"みんな\",\"グーグル\",\"世界\",\"書籍\",\"网址\",\"닷넷\",\"コム\",\"天主教\",\"游戏\",\"vermögensberater\",\"vermögensberatung\",\"企业\",\"信息\",\"嘉里大酒店\",\"嘉里\",\"广东\",\"政务\",\"xyz\",\"yachts\",\"yahoo\",\"yamaxun\",\"yandex\",\"yodobashi\",\"yoga\",\"yokohama\",\"you\",\"youtube\",\"yun\",\"zappos\",\"zara\",\"zero\",\"zip\",\"zone\",\"zuerich\",\"cc.ua\",\"inf.ua\",\"ltd.ua\",\"beep.pl\",\"barsy.ca\",\"*.compute.estate\",\"*.alces.network\",\"alwaysdata.net\",\"cloudfront.net\",\"*.compute.amazonaws.com\",\"*.compute-1.amazonaws.com\",\"*.compute.amazonaws.com.cn\",\"us-east-1.amazonaws.com\",\"cn-north-1.eb.amazonaws.com.cn\",\"cn-northwest-1.eb.amazonaws.com.cn\",\"elasticbeanstalk.com\",\"ap-northeast-1.elasticbeanstalk.com\",\"ap-northeast-2.elasticbeanstalk.com\",\"ap-northeast-3.elasticbeanstalk.com\",\"ap-south-1.elasticbeanstalk.com\",\"ap-southeast-1.elasticbeanstalk.com\",\"ap-southeast-2.elasticbeanstalk.com\",\"ca-central-1.elasticbeanstalk.com\",\"eu-central-1.elasticbeanstalk.com\",\"eu-west-1.elasticbeanstalk.com\",\"eu-west-2.elasticbeanstalk.com\",\"eu-west-3.elasticbeanstalk.com\",\"sa-east-1.elasticbeanstalk.com\",\"us-east-1.elasticbeanstalk.com\",\"us-east-2.elasticbeanstalk.com\",\"us-gov-west-1.elasticbeanstalk.com\",\"us-west-1.elasticbeanstalk.com\",\"us-west-2.elasticbeanstalk.com\",\"*.elb.amazonaws.com\",\"*.elb.amazonaws.com.cn\",\"s3.amazonaws.com\",\"s3-ap-northeast-1.amazonaws.com\",\"s3-ap-northeast-2.amazonaws.com\",\"s3-ap-south-1.amazonaws.com\",\"s3-ap-southeast-1.amazonaws.com\",\"s3-ap-southeast-2.amazonaws.com\",\"s3-ca-central-1.amazonaws.com\",\"s3-eu-central-1.amazonaws.com\",\"s3-eu-west-1.amazonaws.com\",\"s3-eu-west-2.amazonaws.com\",\"s3-eu-west-3.amazonaws.com\",\"s3-external-1.amazonaws.com\",\"s3-fips-us-gov-west-1.amazonaws.com\",\"s3-sa-east-1.amazonaws.com\",\"s3-us-gov-west-1.amazonaws.com\",\"s3-us-east-2.amazonaws.com\",\"s3-us-west-1.amazonaws.com\",\"s3-us-west-2.amazonaws.com\",\"s3.ap-northeast-2.amazonaws.com\",\"s3.ap-south-1.amazonaws.com\",\"s3.cn-north-1.amazonaws.com.cn\",\"s3.ca-central-1.amazonaws.com\",\"s3.eu-central-1.amazonaws.com\",\"s3.eu-west-2.amazonaws.com\",\"s3.eu-west-3.amazonaws.com\",\"s3.us-east-2.amazonaws.com\",\"s3.dualstack.ap-northeast-1.amazonaws.com\",\"s3.dualstack.ap-northeast-2.amazonaws.com\",\"s3.dualstack.ap-south-1.amazonaws.com\",\"s3.dualstack.ap-southeast-1.amazonaws.com\",\"s3.dualstack.ap-southeast-2.amazonaws.com\",\"s3.dualstack.ca-central-1.amazonaws.com\",\"s3.dualstack.eu-central-1.amazonaws.com\",\"s3.dualstack.eu-west-1.amazonaws.com\",\"s3.dualstack.eu-west-2.amazonaws.com\",\"s3.dualstack.eu-west-3.amazonaws.com\",\"s3.dualstack.sa-east-1.amazonaws.com\",\"s3.dualstack.us-east-1.amazonaws.com\",\"s3.dualstack.us-east-2.amazonaws.com\",\"s3-website-us-east-1.amazonaws.com\",\"s3-website-us-west-1.amazonaws.com\",\"s3-website-us-west-2.amazonaws.com\",\"s3-website-ap-northeast-1.amazonaws.com\",\"s3-website-ap-southeast-1.amazonaws.com\",\"s3-website-ap-southeast-2.amazonaws.com\",\"s3-website-eu-west-1.amazonaws.com\",\"s3-website-sa-east-1.amazonaws.com\",\"s3-website.ap-northeast-2.amazonaws.com\",\"s3-website.ap-south-1.amazonaws.com\",\"s3-website.ca-central-1.amazonaws.com\",\"s3-website.eu-central-1.amazonaws.com\",\"s3-website.eu-west-2.amazonaws.com\",\"s3-website.eu-west-3.amazonaws.com\",\"s3-website.us-east-2.amazonaws.com\",\"t3l3p0rt.net\",\"tele.amune.org\",\"apigee.io\",\"on-aptible.com\",\"user.aseinet.ne.jp\",\"gv.vc\",\"d.gv.vc\",\"user.party.eus\",\"pimienta.org\",\"poivron.org\",\"potager.org\",\"sweetpepper.org\",\"myasustor.com\",\"go-vip.co\",\"go-vip.net\",\"wpcomstaging.com\",\"myfritz.net\",\"*.awdev.ca\",\"*.advisor.ws\",\"b-data.io\",\"backplaneapp.io\",\"balena-devices.com\",\"app.banzaicloud.io\",\"betainabox.com\",\"bnr.la\",\"blackbaudcdn.net\",\"boomla.net\",\"boxfuse.io\",\"square7.ch\",\"bplaced.com\",\"bplaced.de\",\"square7.de\",\"bplaced.net\",\"square7.net\",\"browsersafetymark.io\",\"uk0.bigv.io\",\"dh.bytemark.co.uk\",\"vm.bytemark.co.uk\",\"mycd.eu\",\"carrd.co\",\"crd.co\",\"uwu.ai\",\"ae.org\",\"ar.com\",\"br.com\",\"cn.com\",\"com.de\",\"com.se\",\"de.com\",\"eu.com\",\"gb.com\",\"gb.net\",\"hu.com\",\"hu.net\",\"jp.net\",\"jpn.com\",\"kr.com\",\"mex.com\",\"no.com\",\"qc.com\",\"ru.com\",\"sa.com\",\"se.net\",\"uk.com\",\"uk.net\",\"us.com\",\"uy.com\",\"za.bz\",\"za.com\",\"africa.com\",\"gr.com\",\"in.net\",\"us.org\",\"co.com\",\"c.la\",\"certmgr.org\",\"xenapponazure.com\",\"discourse.group\",\"virtueeldomein.nl\",\"cleverapps.io\",\"*.lcl.dev\",\"*.stg.dev\",\"c66.me\",\"cloud66.ws\",\"cloud66.zone\",\"jdevcloud.com\",\"wpdevcloud.com\",\"cloudaccess.host\",\"freesite.host\",\"cloudaccess.net\",\"cloudcontrolled.com\",\"cloudcontrolapp.com\",\"cloudera.site\",\"trycloudflare.com\",\"workers.dev\",\"wnext.app\",\"co.ca\",\"*.otap.co\",\"co.cz\",\"c.cdn77.org\",\"cdn77-ssl.net\",\"r.cdn77.net\",\"rsc.cdn77.org\",\"ssl.origin.cdn77-secure.org\",\"cloudns.asia\",\"cloudns.biz\",\"cloudns.club\",\"cloudns.cc\",\"cloudns.eu\",\"cloudns.in\",\"cloudns.info\",\"cloudns.org\",\"cloudns.pro\",\"cloudns.pw\",\"cloudns.us\",\"cloudeity.net\",\"cnpy.gdn\",\"co.nl\",\"co.no\",\"webhosting.be\",\"hosting-cluster.nl\",\"dyn.cosidns.de\",\"dynamisches-dns.de\",\"dnsupdater.de\",\"internet-dns.de\",\"l-o-g-i-n.de\",\"dynamic-dns.info\",\"feste-ip.net\",\"knx-server.net\",\"static-access.net\",\"realm.cz\",\"*.cryptonomic.net\",\"cupcake.is\",\"cyon.link\",\"cyon.site\",\"daplie.me\",\"localhost.daplie.me\",\"dattolocal.com\",\"dattorelay.com\",\"dattoweb.com\",\"mydatto.com\",\"dattolocal.net\",\"mydatto.net\",\"biz.dk\",\"co.dk\",\"firm.dk\",\"reg.dk\",\"store.dk\",\"*.dapps.earth\",\"*.bzz.dapps.earth\",\"debian.net\",\"dedyn.io\",\"dnshome.de\",\"online.th\",\"shop.th\",\"drayddns.com\",\"dreamhosters.com\",\"mydrobo.com\",\"drud.io\",\"drud.us\",\"duckdns.org\",\"dy.fi\",\"tunk.org\",\"dyndns-at-home.com\",\"dyndns-at-work.com\",\"dyndns-blog.com\",\"dyndns-free.com\",\"dyndns-home.com\",\"dyndns-ip.com\",\"dyndns-mail.com\",\"dyndns-office.com\",\"dyndns-pics.com\",\"dyndns-remote.com\",\"dyndns-server.com\",\"dyndns-web.com\",\"dyndns-wiki.com\",\"dyndns-work.com\",\"dyndns.biz\",\"dyndns.info\",\"dyndns.org\",\"dyndns.tv\",\"at-band-camp.net\",\"ath.cx\",\"barrel-of-knowledge.info\",\"barrell-of-knowledge.info\",\"better-than.tv\",\"blogdns.com\",\"blogdns.net\",\"blogdns.org\",\"blogsite.org\",\"boldlygoingnowhere.org\",\"broke-it.net\",\"buyshouses.net\",\"cechire.com\",\"dnsalias.com\",\"dnsalias.net\",\"dnsalias.org\",\"dnsdojo.com\",\"dnsdojo.net\",\"dnsdojo.org\",\"does-it.net\",\"doesntexist.com\",\"doesntexist.org\",\"dontexist.com\",\"dontexist.net\",\"dontexist.org\",\"doomdns.com\",\"doomdns.org\",\"dvrdns.org\",\"dyn-o-saur.com\",\"dynalias.com\",\"dynalias.net\",\"dynalias.org\",\"dynathome.net\",\"dyndns.ws\",\"endofinternet.net\",\"endofinternet.org\",\"endoftheinternet.org\",\"est-a-la-maison.com\",\"est-a-la-masion.com\",\"est-le-patron.com\",\"est-mon-blogueur.com\",\"for-better.biz\",\"for-more.biz\",\"for-our.info\",\"for-some.biz\",\"for-the.biz\",\"forgot.her.name\",\"forgot.his.name\",\"from-ak.com\",\"from-al.com\",\"from-ar.com\",\"from-az.net\",\"from-ca.com\",\"from-co.net\",\"from-ct.com\",\"from-dc.com\",\"from-de.com\",\"from-fl.com\",\"from-ga.com\",\"from-hi.com\",\"from-ia.com\",\"from-id.com\",\"from-il.com\",\"from-in.com\",\"from-ks.com\",\"from-ky.com\",\"from-la.net\",\"from-ma.com\",\"from-md.com\",\"from-me.org\",\"from-mi.com\",\"from-mn.com\",\"from-mo.com\",\"from-ms.com\",\"from-mt.com\",\"from-nc.com\",\"from-nd.com\",\"from-ne.com\",\"from-nh.com\",\"from-nj.com\",\"from-nm.com\",\"from-nv.com\",\"from-ny.net\",\"from-oh.com\",\"from-ok.com\",\"from-or.com\",\"from-pa.com\",\"from-pr.com\",\"from-ri.com\",\"from-sc.com\",\"from-sd.com\",\"from-tn.com\",\"from-tx.com\",\"from-ut.com\",\"from-va.com\",\"from-vt.com\",\"from-wa.com\",\"from-wi.com\",\"from-wv.com\",\"from-wy.com\",\"ftpaccess.cc\",\"fuettertdasnetz.de\",\"game-host.org\",\"game-server.cc\",\"getmyip.com\",\"gets-it.net\",\"go.dyndns.org\",\"gotdns.com\",\"gotdns.org\",\"groks-the.info\",\"groks-this.info\",\"ham-radio-op.net\",\"here-for-more.info\",\"hobby-site.com\",\"hobby-site.org\",\"home.dyndns.org\",\"homedns.org\",\"homeftp.net\",\"homeftp.org\",\"homeip.net\",\"homelinux.com\",\"homelinux.net\",\"homelinux.org\",\"homeunix.com\",\"homeunix.net\",\"homeunix.org\",\"iamallama.com\",\"in-the-band.net\",\"is-a-anarchist.com\",\"is-a-blogger.com\",\"is-a-bookkeeper.com\",\"is-a-bruinsfan.org\",\"is-a-bulls-fan.com\",\"is-a-candidate.org\",\"is-a-caterer.com\",\"is-a-celticsfan.org\",\"is-a-chef.com\",\"is-a-chef.net\",\"is-a-chef.org\",\"is-a-conservative.com\",\"is-a-cpa.com\",\"is-a-cubicle-slave.com\",\"is-a-democrat.com\",\"is-a-designer.com\",\"is-a-doctor.com\",\"is-a-financialadvisor.com\",\"is-a-geek.com\",\"is-a-geek.net\",\"is-a-geek.org\",\"is-a-green.com\",\"is-a-guru.com\",\"is-a-hard-worker.com\",\"is-a-hunter.com\",\"is-a-knight.org\",\"is-a-landscaper.com\",\"is-a-lawyer.com\",\"is-a-liberal.com\",\"is-a-libertarian.com\",\"is-a-linux-user.org\",\"is-a-llama.com\",\"is-a-musician.com\",\"is-a-nascarfan.com\",\"is-a-nurse.com\",\"is-a-painter.com\",\"is-a-patsfan.org\",\"is-a-personaltrainer.com\",\"is-a-photographer.com\",\"is-a-player.com\",\"is-a-republican.com\",\"is-a-rockstar.com\",\"is-a-socialist.com\",\"is-a-soxfan.org\",\"is-a-student.com\",\"is-a-teacher.com\",\"is-a-techie.com\",\"is-a-therapist.com\",\"is-an-accountant.com\",\"is-an-actor.com\",\"is-an-actress.com\",\"is-an-anarchist.com\",\"is-an-artist.com\",\"is-an-engineer.com\",\"is-an-entertainer.com\",\"is-by.us\",\"is-certified.com\",\"is-found.org\",\"is-gone.com\",\"is-into-anime.com\",\"is-into-cars.com\",\"is-into-cartoons.com\",\"is-into-games.com\",\"is-leet.com\",\"is-lost.org\",\"is-not-certified.com\",\"is-saved.org\",\"is-slick.com\",\"is-uberleet.com\",\"is-very-bad.org\",\"is-very-evil.org\",\"is-very-good.org\",\"is-very-nice.org\",\"is-very-sweet.org\",\"is-with-theband.com\",\"isa-geek.com\",\"isa-geek.net\",\"isa-geek.org\",\"isa-hockeynut.com\",\"issmarterthanyou.com\",\"isteingeek.de\",\"istmein.de\",\"kicks-ass.net\",\"kicks-ass.org\",\"knowsitall.info\",\"land-4-sale.us\",\"lebtimnetz.de\",\"leitungsen.de\",\"likes-pie.com\",\"likescandy.com\",\"merseine.nu\",\"mine.nu\",\"misconfused.org\",\"mypets.ws\",\"myphotos.cc\",\"neat-url.com\",\"office-on-the.net\",\"on-the-web.tv\",\"podzone.net\",\"podzone.org\",\"readmyblog.org\",\"saves-the-whales.com\",\"scrapper-site.net\",\"scrapping.cc\",\"selfip.biz\",\"selfip.com\",\"selfip.info\",\"selfip.net\",\"selfip.org\",\"sells-for-less.com\",\"sells-for-u.com\",\"sells-it.net\",\"sellsyourhome.org\",\"servebbs.com\",\"servebbs.net\",\"servebbs.org\",\"serveftp.net\",\"serveftp.org\",\"servegame.org\",\"shacknet.nu\",\"simple-url.com\",\"space-to-rent.com\",\"stuff-4-sale.org\",\"stuff-4-sale.us\",\"teaches-yoga.com\",\"thruhere.net\",\"traeumtgerade.de\",\"webhop.biz\",\"webhop.info\",\"webhop.net\",\"webhop.org\",\"worse-than.tv\",\"writesthisblog.com\",\"ddnss.de\",\"dyn.ddnss.de\",\"dyndns.ddnss.de\",\"dyndns1.de\",\"dyn-ip24.de\",\"home-webserver.de\",\"dyn.home-webserver.de\",\"myhome-server.de\",\"ddnss.org\",\"definima.net\",\"definima.io\",\"bci.dnstrace.pro\",\"ddnsfree.com\",\"ddnsgeek.com\",\"giize.com\",\"gleeze.com\",\"kozow.com\",\"loseyourip.com\",\"ooguy.com\",\"theworkpc.com\",\"casacam.net\",\"dynu.net\",\"accesscam.org\",\"camdvr.org\",\"freeddns.org\",\"mywire.org\",\"webredirect.org\",\"myddns.rocks\",\"blogsite.xyz\",\"dynv6.net\",\"e4.cz\",\"mytuleap.com\",\"onred.one\",\"staging.onred.one\",\"enonic.io\",\"customer.enonic.io\",\"eu.org\",\"al.eu.org\",\"asso.eu.org\",\"at.eu.org\",\"au.eu.org\",\"be.eu.org\",\"bg.eu.org\",\"ca.eu.org\",\"cd.eu.org\",\"ch.eu.org\",\"cn.eu.org\",\"cy.eu.org\",\"cz.eu.org\",\"de.eu.org\",\"dk.eu.org\",\"edu.eu.org\",\"ee.eu.org\",\"es.eu.org\",\"fi.eu.org\",\"fr.eu.org\",\"gr.eu.org\",\"hr.eu.org\",\"hu.eu.org\",\"ie.eu.org\",\"il.eu.org\",\"in.eu.org\",\"int.eu.org\",\"is.eu.org\",\"it.eu.org\",\"jp.eu.org\",\"kr.eu.org\",\"lt.eu.org\",\"lu.eu.org\",\"lv.eu.org\",\"mc.eu.org\",\"me.eu.org\",\"mk.eu.org\",\"mt.eu.org\",\"my.eu.org\",\"net.eu.org\",\"ng.eu.org\",\"nl.eu.org\",\"no.eu.org\",\"nz.eu.org\",\"paris.eu.org\",\"pl.eu.org\",\"pt.eu.org\",\"q-a.eu.org\",\"ro.eu.org\",\"ru.eu.org\",\"se.eu.org\",\"si.eu.org\",\"sk.eu.org\",\"tr.eu.org\",\"uk.eu.org\",\"us.eu.org\",\"eu-1.evennode.com\",\"eu-2.evennode.com\",\"eu-3.evennode.com\",\"eu-4.evennode.com\",\"us-1.evennode.com\",\"us-2.evennode.com\",\"us-3.evennode.com\",\"us-4.evennode.com\",\"twmail.cc\",\"twmail.net\",\"twmail.org\",\"mymailer.com.tw\",\"url.tw\",\"apps.fbsbx.com\",\"ru.net\",\"adygeya.ru\",\"bashkiria.ru\",\"bir.ru\",\"cbg.ru\",\"com.ru\",\"dagestan.ru\",\"grozny.ru\",\"kalmykia.ru\",\"kustanai.ru\",\"marine.ru\",\"mordovia.ru\",\"msk.ru\",\"mytis.ru\",\"nalchik.ru\",\"nov.ru\",\"pyatigorsk.ru\",\"spb.ru\",\"vladikavkaz.ru\",\"vladimir.ru\",\"abkhazia.su\",\"adygeya.su\",\"aktyubinsk.su\",\"arkhangelsk.su\",\"armenia.su\",\"ashgabad.su\",\"azerbaijan.su\",\"balashov.su\",\"bashkiria.su\",\"bryansk.su\",\"bukhara.su\",\"chimkent.su\",\"dagestan.su\",\"east-kazakhstan.su\",\"exnet.su\",\"georgia.su\",\"grozny.su\",\"ivanovo.su\",\"jambyl.su\",\"kalmykia.su\",\"kaluga.su\",\"karacol.su\",\"karaganda.su\",\"karelia.su\",\"khakassia.su\",\"krasnodar.su\",\"kurgan.su\",\"kustanai.su\",\"lenug.su\",\"mangyshlak.su\",\"mordovia.su\",\"msk.su\",\"murmansk.su\",\"nalchik.su\",\"navoi.su\",\"north-kazakhstan.su\",\"nov.su\",\"obninsk.su\",\"penza.su\",\"pokrovsk.su\",\"sochi.su\",\"spb.su\",\"tashkent.su\",\"termez.su\",\"togliatti.su\",\"troitsk.su\",\"tselinograd.su\",\"tula.su\",\"tuva.su\",\"vladikavkaz.su\",\"vladimir.su\",\"vologda.su\",\"channelsdvr.net\",\"fastly-terrarium.com\",\"fastlylb.net\",\"map.fastlylb.net\",\"freetls.fastly.net\",\"map.fastly.net\",\"a.prod.fastly.net\",\"global.prod.fastly.net\",\"a.ssl.fastly.net\",\"b.ssl.fastly.net\",\"global.ssl.fastly.net\",\"fastpanel.direct\",\"fastvps-server.com\",\"fhapp.xyz\",\"fedorainfracloud.org\",\"fedorapeople.org\",\"cloud.fedoraproject.org\",\"app.os.fedoraproject.org\",\"app.os.stg.fedoraproject.org\",\"mydobiss.com\",\"filegear.me\",\"filegear-au.me\",\"filegear-de.me\",\"filegear-gb.me\",\"filegear-ie.me\",\"filegear-jp.me\",\"filegear-sg.me\",\"firebaseapp.com\",\"flynnhub.com\",\"flynnhosting.net\",\"freebox-os.com\",\"freeboxos.com\",\"fbx-os.fr\",\"fbxos.fr\",\"freebox-os.fr\",\"freeboxos.fr\",\"freedesktop.org\",\"*.futurecms.at\",\"*.ex.futurecms.at\",\"*.in.futurecms.at\",\"futurehosting.at\",\"futuremailing.at\",\"*.ex.ortsinfo.at\",\"*.kunden.ortsinfo.at\",\"*.statics.cloud\",\"service.gov.uk\",\"gehirn.ne.jp\",\"usercontent.jp\",\"lab.ms\",\"github.io\",\"githubusercontent.com\",\"gitlab.io\",\"glitch.me\",\"cloudapps.digital\",\"london.cloudapps.digital\",\"homeoffice.gov.uk\",\"ro.im\",\"shop.ro\",\"goip.de\",\"run.app\",\"a.run.app\",\"web.app\",\"*.0emm.com\",\"appspot.com\",\"blogspot.ae\",\"blogspot.al\",\"blogspot.am\",\"blogspot.ba\",\"blogspot.be\",\"blogspot.bg\",\"blogspot.bj\",\"blogspot.ca\",\"blogspot.cf\",\"blogspot.ch\",\"blogspot.cl\",\"blogspot.co.at\",\"blogspot.co.id\",\"blogspot.co.il\",\"blogspot.co.ke\",\"blogspot.co.nz\",\"blogspot.co.uk\",\"blogspot.co.za\",\"blogspot.com\",\"blogspot.com.ar\",\"blogspot.com.au\",\"blogspot.com.br\",\"blogspot.com.by\",\"blogspot.com.co\",\"blogspot.com.cy\",\"blogspot.com.ee\",\"blogspot.com.eg\",\"blogspot.com.es\",\"blogspot.com.mt\",\"blogspot.com.ng\",\"blogspot.com.tr\",\"blogspot.com.uy\",\"blogspot.cv\",\"blogspot.cz\",\"blogspot.de\",\"blogspot.dk\",\"blogspot.fi\",\"blogspot.fr\",\"blogspot.gr\",\"blogspot.hk\",\"blogspot.hr\",\"blogspot.hu\",\"blogspot.ie\",\"blogspot.in\",\"blogspot.is\",\"blogspot.it\",\"blogspot.jp\",\"blogspot.kr\",\"blogspot.li\",\"blogspot.lt\",\"blogspot.lu\",\"blogspot.md\",\"blogspot.mk\",\"blogspot.mr\",\"blogspot.mx\",\"blogspot.my\",\"blogspot.nl\",\"blogspot.no\",\"blogspot.pe\",\"blogspot.pt\",\"blogspot.qa\",\"blogspot.re\",\"blogspot.ro\",\"blogspot.rs\",\"blogspot.ru\",\"blogspot.se\",\"blogspot.sg\",\"blogspot.si\",\"blogspot.sk\",\"blogspot.sn\",\"blogspot.td\",\"blogspot.tw\",\"blogspot.ug\",\"blogspot.vn\",\"cloudfunctions.net\",\"cloud.goog\",\"codespot.com\",\"googleapis.com\",\"googlecode.com\",\"pagespeedmobilizer.com\",\"publishproxy.com\",\"withgoogle.com\",\"withyoutube.com\",\"fin.ci\",\"free.hr\",\"caa.li\",\"ua.rs\",\"conf.se\",\"hs.zone\",\"hs.run\",\"hashbang.sh\",\"hasura.app\",\"hasura-app.io\",\"hepforge.org\",\"herokuapp.com\",\"herokussl.com\",\"myravendb.com\",\"ravendb.community\",\"ravendb.me\",\"development.run\",\"ravendb.run\",\"bpl.biz\",\"orx.biz\",\"ng.city\",\"biz.gl\",\"ng.ink\",\"col.ng\",\"firm.ng\",\"gen.ng\",\"ltd.ng\",\"ng.school\",\"sch.so\",\"häkkinen.fi\",\"*.moonscale.io\",\"moonscale.net\",\"iki.fi\",\"dyn-berlin.de\",\"in-berlin.de\",\"in-brb.de\",\"in-butter.de\",\"in-dsl.de\",\"in-dsl.net\",\"in-dsl.org\",\"in-vpn.de\",\"in-vpn.net\",\"in-vpn.org\",\"biz.at\",\"info.at\",\"info.cx\",\"ac.leg.br\",\"al.leg.br\",\"am.leg.br\",\"ap.leg.br\",\"ba.leg.br\",\"ce.leg.br\",\"df.leg.br\",\"es.leg.br\",\"go.leg.br\",\"ma.leg.br\",\"mg.leg.br\",\"ms.leg.br\",\"mt.leg.br\",\"pa.leg.br\",\"pb.leg.br\",\"pe.leg.br\",\"pi.leg.br\",\"pr.leg.br\",\"rj.leg.br\",\"rn.leg.br\",\"ro.leg.br\",\"rr.leg.br\",\"rs.leg.br\",\"sc.leg.br\",\"se.leg.br\",\"sp.leg.br\",\"to.leg.br\",\"pixolino.com\",\"ipifony.net\",\"mein-iserv.de\",\"test-iserv.de\",\"iserv.dev\",\"iobb.net\",\"myjino.ru\",\"*.hosting.myjino.ru\",\"*.landing.myjino.ru\",\"*.spectrum.myjino.ru\",\"*.vps.myjino.ru\",\"*.triton.zone\",\"*.cns.joyent.com\",\"js.org\",\"kaas.gg\",\"khplay.nl\",\"keymachine.de\",\"kinghost.net\",\"uni5.net\",\"knightpoint.systems\",\"co.krd\",\"edu.krd\",\"git-repos.de\",\"lcube-server.de\",\"svn-repos.de\",\"leadpages.co\",\"lpages.co\",\"lpusercontent.com\",\"lelux.site\",\"co.business\",\"co.education\",\"co.events\",\"co.financial\",\"co.network\",\"co.place\",\"co.technology\",\"app.lmpm.com\",\"linkitools.space\",\"linkyard.cloud\",\"linkyard-cloud.ch\",\"members.linode.com\",\"nodebalancer.linode.com\",\"we.bs\",\"loginline.app\",\"loginline.dev\",\"loginline.io\",\"loginline.services\",\"loginline.site\",\"krasnik.pl\",\"leczna.pl\",\"lubartow.pl\",\"lublin.pl\",\"poniatowa.pl\",\"swidnik.pl\",\"uklugs.org\",\"glug.org.uk\",\"lug.org.uk\",\"lugs.org.uk\",\"barsy.bg\",\"barsy.co.uk\",\"barsyonline.co.uk\",\"barsycenter.com\",\"barsyonline.com\",\"barsy.club\",\"barsy.de\",\"barsy.eu\",\"barsy.in\",\"barsy.info\",\"barsy.io\",\"barsy.me\",\"barsy.menu\",\"barsy.mobi\",\"barsy.net\",\"barsy.online\",\"barsy.org\",\"barsy.pro\",\"barsy.pub\",\"barsy.shop\",\"barsy.site\",\"barsy.support\",\"barsy.uk\",\"*.magentosite.cloud\",\"mayfirst.info\",\"mayfirst.org\",\"hb.cldmail.ru\",\"miniserver.com\",\"memset.net\",\"cloud.metacentrum.cz\",\"custom.metacentrum.cz\",\"flt.cloud.muni.cz\",\"usr.cloud.muni.cz\",\"meteorapp.com\",\"eu.meteorapp.com\",\"co.pl\",\"azurecontainer.io\",\"azurewebsites.net\",\"azure-mobile.net\",\"cloudapp.net\",\"mozilla-iot.org\",\"bmoattachments.org\",\"net.ru\",\"org.ru\",\"pp.ru\",\"ui.nabu.casa\",\"pony.club\",\"of.fashion\",\"on.fashion\",\"of.football\",\"in.london\",\"of.london\",\"for.men\",\"and.mom\",\"for.mom\",\"for.one\",\"for.sale\",\"of.work\",\"to.work\",\"nctu.me\",\"bitballoon.com\",\"netlify.com\",\"4u.com\",\"ngrok.io\",\"nh-serv.co.uk\",\"nfshost.com\",\"dnsking.ch\",\"mypi.co\",\"n4t.co\",\"001www.com\",\"ddnslive.com\",\"myiphost.com\",\"forumz.info\",\"16-b.it\",\"32-b.it\",\"64-b.it\",\"soundcast.me\",\"tcp4.me\",\"dnsup.net\",\"hicam.net\",\"now-dns.net\",\"ownip.net\",\"vpndns.net\",\"dynserv.org\",\"now-dns.org\",\"x443.pw\",\"now-dns.top\",\"ntdll.top\",\"freeddns.us\",\"crafting.xyz\",\"zapto.xyz\",\"nsupdate.info\",\"nerdpol.ovh\",\"blogsyte.com\",\"brasilia.me\",\"cable-modem.org\",\"ciscofreak.com\",\"collegefan.org\",\"couchpotatofries.org\",\"damnserver.com\",\"ddns.me\",\"ditchyourip.com\",\"dnsfor.me\",\"dnsiskinky.com\",\"dvrcam.info\",\"dynns.com\",\"eating-organic.net\",\"fantasyleague.cc\",\"geekgalaxy.com\",\"golffan.us\",\"health-carereform.com\",\"homesecuritymac.com\",\"homesecuritypc.com\",\"hopto.me\",\"ilovecollege.info\",\"loginto.me\",\"mlbfan.org\",\"mmafan.biz\",\"myactivedirectory.com\",\"mydissent.net\",\"myeffect.net\",\"mymediapc.net\",\"mypsx.net\",\"mysecuritycamera.com\",\"mysecuritycamera.net\",\"mysecuritycamera.org\",\"net-freaks.com\",\"nflfan.org\",\"nhlfan.net\",\"no-ip.ca\",\"no-ip.co.uk\",\"no-ip.net\",\"noip.us\",\"onthewifi.com\",\"pgafan.net\",\"point2this.com\",\"pointto.us\",\"privatizehealthinsurance.net\",\"quicksytes.com\",\"read-books.org\",\"securitytactics.com\",\"serveexchange.com\",\"servehumour.com\",\"servep2p.com\",\"servesarcasm.com\",\"stufftoread.com\",\"ufcfan.org\",\"unusualperson.com\",\"workisboring.com\",\"3utilities.com\",\"bounceme.net\",\"ddns.net\",\"ddnsking.com\",\"gotdns.ch\",\"hopto.org\",\"myftp.biz\",\"myftp.org\",\"myvnc.com\",\"no-ip.biz\",\"no-ip.info\",\"no-ip.org\",\"noip.me\",\"redirectme.net\",\"servebeer.com\",\"serveblog.net\",\"servecounterstrike.com\",\"serveftp.com\",\"servegame.com\",\"servehalflife.com\",\"servehttp.com\",\"serveirc.com\",\"serveminecraft.net\",\"servemp3.com\",\"servepics.com\",\"servequake.com\",\"sytes.net\",\"webhop.me\",\"zapto.org\",\"stage.nodeart.io\",\"nodum.co\",\"nodum.io\",\"pcloud.host\",\"nyc.mn\",\"nom.ae\",\"nom.af\",\"nom.ai\",\"nom.al\",\"nym.by\",\"nym.bz\",\"nom.cl\",\"nym.ec\",\"nom.gd\",\"nom.ge\",\"nom.gl\",\"nym.gr\",\"nom.gt\",\"nym.gy\",\"nym.hk\",\"nom.hn\",\"nym.ie\",\"nom.im\",\"nom.ke\",\"nym.kz\",\"nym.la\",\"nym.lc\",\"nom.li\",\"nym.li\",\"nym.lt\",\"nym.lu\",\"nym.me\",\"nom.mk\",\"nym.mn\",\"nym.mx\",\"nom.nu\",\"nym.nz\",\"nym.pe\",\"nym.pt\",\"nom.pw\",\"nom.qa\",\"nym.ro\",\"nom.rs\",\"nom.si\",\"nym.sk\",\"nom.st\",\"nym.su\",\"nym.sx\",\"nom.tj\",\"nym.tw\",\"nom.ug\",\"nom.uy\",\"nom.vc\",\"nom.vg\",\"cya.gg\",\"cloudycluster.net\",\"nid.io\",\"opencraft.hosting\",\"operaunite.com\",\"outsystemscloud.com\",\"ownprovider.com\",\"own.pm\",\"ox.rs\",\"oy.lc\",\"pgfog.com\",\"pagefrontapp.com\",\"art.pl\",\"gliwice.pl\",\"krakow.pl\",\"poznan.pl\",\"wroc.pl\",\"zakopane.pl\",\"pantheonsite.io\",\"gotpantheon.com\",\"mypep.link\",\"on-web.fr\",\"*.platform.sh\",\"*.platformsh.site\",\"dyn53.io\",\"co.bn\",\"xen.prgmr.com\",\"priv.at\",\"prvcy.page\",\"*.dweb.link\",\"protonet.io\",\"chirurgiens-dentistes-en-france.fr\",\"byen.site\",\"pubtls.org\",\"qualifioapp.com\",\"instantcloud.cn\",\"ras.ru\",\"qa2.com\",\"dev-myqnapcloud.com\",\"alpha-myqnapcloud.com\",\"myqnapcloud.com\",\"*.quipelements.com\",\"vapor.cloud\",\"vaporcloud.io\",\"rackmaze.com\",\"rackmaze.net\",\"*.on-rancher.cloud\",\"*.on-rio.io\",\"readthedocs.io\",\"rhcloud.com\",\"app.render.com\",\"onrender.com\",\"repl.co\",\"repl.run\",\"resindevice.io\",\"devices.resinstaging.io\",\"hzc.io\",\"wellbeingzone.eu\",\"ptplus.fit\",\"wellbeingzone.co.uk\",\"git-pages.rit.edu\",\"sandcats.io\",\"logoip.de\",\"logoip.com\",\"schokokeks.net\",\"scrysec.com\",\"firewall-gateway.com\",\"firewall-gateway.de\",\"my-gateway.de\",\"my-router.de\",\"spdns.de\",\"spdns.eu\",\"firewall-gateway.net\",\"my-firewall.org\",\"myfirewall.org\",\"spdns.org\",\"biz.ua\",\"co.ua\",\"pp.ua\",\"shiftedit.io\",\"myshopblocks.com\",\"shopitsite.com\",\"mo-siemens.io\",\"1kapp.com\",\"appchizi.com\",\"applinzi.com\",\"sinaapp.com\",\"vipsinaapp.com\",\"siteleaf.net\",\"bounty-full.com\",\"alpha.bounty-full.com\",\"beta.bounty-full.com\",\"stackhero-network.com\",\"static.land\",\"dev.static.land\",\"sites.static.land\",\"apps.lair.io\",\"*.stolos.io\",\"spacekit.io\",\"customer.speedpartner.de\",\"api.stdlib.com\",\"storj.farm\",\"utwente.io\",\"soc.srcf.net\",\"user.srcf.net\",\"temp-dns.com\",\"applicationcloud.io\",\"scapp.io\",\"*.s5y.io\",\"*.sensiosite.cloud\",\"syncloud.it\",\"diskstation.me\",\"dscloud.biz\",\"dscloud.me\",\"dscloud.mobi\",\"dsmynas.com\",\"dsmynas.net\",\"dsmynas.org\",\"familyds.com\",\"familyds.net\",\"familyds.org\",\"i234.me\",\"myds.me\",\"synology.me\",\"vpnplus.to\",\"direct.quickconnect.to\",\"taifun-dns.de\",\"gda.pl\",\"gdansk.pl\",\"gdynia.pl\",\"med.pl\",\"sopot.pl\",\"edugit.org\",\"telebit.app\",\"telebit.io\",\"*.telebit.xyz\",\"gwiddle.co.uk\",\"thingdustdata.com\",\"cust.dev.thingdust.io\",\"cust.disrec.thingdust.io\",\"cust.prod.thingdust.io\",\"cust.testing.thingdust.io\",\"arvo.network\",\"azimuth.network\",\"bloxcms.com\",\"townnews-staging.com\",\"12hp.at\",\"2ix.at\",\"4lima.at\",\"lima-city.at\",\"12hp.ch\",\"2ix.ch\",\"4lima.ch\",\"lima-city.ch\",\"trafficplex.cloud\",\"de.cool\",\"12hp.de\",\"2ix.de\",\"4lima.de\",\"lima-city.de\",\"1337.pictures\",\"clan.rip\",\"lima-city.rocks\",\"webspace.rocks\",\"lima.zone\",\"*.transurl.be\",\"*.transurl.eu\",\"*.transurl.nl\",\"tuxfamily.org\",\"dd-dns.de\",\"diskstation.eu\",\"diskstation.org\",\"dray-dns.de\",\"draydns.de\",\"dyn-vpn.de\",\"dynvpn.de\",\"mein-vigor.de\",\"my-vigor.de\",\"my-wan.de\",\"syno-ds.de\",\"synology-diskstation.de\",\"synology-ds.de\",\"uber.space\",\"*.uberspace.de\",\"hk.com\",\"hk.org\",\"ltd.hk\",\"inc.hk\",\"virtualuser.de\",\"virtual-user.de\",\"lib.de.us\",\"2038.io\",\"router.management\",\"v-info.info\",\"voorloper.cloud\",\"wafflecell.com\",\"*.webhare.dev\",\"wedeploy.io\",\"wedeploy.me\",\"wedeploy.sh\",\"remotewd.com\",\"wmflabs.org\",\"half.host\",\"xnbay.com\",\"u2.xnbay.com\",\"u2-local.xnbay.com\",\"cistron.nl\",\"demon.nl\",\"xs4all.space\",\"yandexcloud.net\",\"storage.yandexcloud.net\",\"website.yandexcloud.net\",\"official.academy\",\"yolasite.com\",\"ybo.faith\",\"yombo.me\",\"homelink.one\",\"ybo.party\",\"ybo.review\",\"ybo.science\",\"ybo.trade\",\"nohost.me\",\"noho.st\",\"za.net\",\"za.org\",\"now.sh\",\"bss.design\",\"basicserver.io\",\"virtualserver.io\",\"site.builder.nu\",\"enterprisecloud.nu\",\"zone.id\"]"); /***/ }), /* 88 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * Copyright (c) 2015, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /*jshint unused:false */ function Store() { } exports.Store = Store; // Stores may be synchronous, but are still required to use a // Continuation-Passing Style API. The CookieJar itself will expose a "*Sync" // API that converts from synchronous-callbacks to imperative style. Store.prototype.synchronous = false; Store.prototype.findCookie = function(domain, path, key, cb) { throw new Error('findCookie is not implemented'); }; Store.prototype.findCookies = function(domain, path, cb) { throw new Error('findCookies is not implemented'); }; Store.prototype.putCookie = function(cookie, cb) { throw new Error('putCookie is not implemented'); }; Store.prototype.updateCookie = function(oldCookie, newCookie, cb) { // recommended default implementation: // return this.putCookie(newCookie, cb); throw new Error('updateCookie is not implemented'); }; Store.prototype.removeCookie = function(domain, path, key, cb) { throw new Error('removeCookie is not implemented'); }; Store.prototype.removeCookies = function(domain, path, cb) { throw new Error('removeCookies is not implemented'); }; Store.prototype.getAllCookies = function(cb) { throw new Error('getAllCookies is not implemented (therefore jar cannot be serialized)'); }; /***/ }), /* 89 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * Copyright (c) 2015, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ var Store = __webpack_require__(88).Store; var permuteDomain = __webpack_require__(90).permuteDomain; var pathMatch = __webpack_require__(91).pathMatch; var util = __webpack_require__(9); function MemoryCookieStore() { Store.call(this); this.idx = {}; } util.inherits(MemoryCookieStore, Store); exports.MemoryCookieStore = MemoryCookieStore; MemoryCookieStore.prototype.idx = null; // Since it's just a struct in RAM, this Store is synchronous MemoryCookieStore.prototype.synchronous = true; // force a default depth: MemoryCookieStore.prototype.inspect = function() { return "{ idx: "+util.inspect(this.idx, false, 2)+' }'; }; // Use the new custom inspection symbol to add the custom inspect function if // available. if (util.inspect.custom) { MemoryCookieStore.prototype[util.inspect.custom] = MemoryCookieStore.prototype.inspect; } MemoryCookieStore.prototype.findCookie = function(domain, path, key, cb) { if (!this.idx[domain]) { return cb(null,undefined); } if (!this.idx[domain][path]) { return cb(null,undefined); } return cb(null,this.idx[domain][path][key]||null); }; MemoryCookieStore.prototype.findCookies = function(domain, path, cb) { var results = []; if (!domain) { return cb(null,[]); } var pathMatcher; if (!path) { // null means "all paths" pathMatcher = function matchAll(domainIndex) { for (var curPath in domainIndex) { var pathIndex = domainIndex[curPath]; for (var key in pathIndex) { results.push(pathIndex[key]); } } }; } else { pathMatcher = function matchRFC(domainIndex) { //NOTE: we should use path-match algorithm from S5.1.4 here //(see : https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/canonical_cookie.cc#L299) Object.keys(domainIndex).forEach(function (cookiePath) { if (pathMatch(path, cookiePath)) { var pathIndex = domainIndex[cookiePath]; for (var key in pathIndex) { results.push(pathIndex[key]); } } }); }; } var domains = permuteDomain(domain) || [domain]; var idx = this.idx; domains.forEach(function(curDomain) { var domainIndex = idx[curDomain]; if (!domainIndex) { return; } pathMatcher(domainIndex); }); cb(null,results); }; MemoryCookieStore.prototype.putCookie = function(cookie, cb) { if (!this.idx[cookie.domain]) { this.idx[cookie.domain] = {}; } if (!this.idx[cookie.domain][cookie.path]) { this.idx[cookie.domain][cookie.path] = {}; } this.idx[cookie.domain][cookie.path][cookie.key] = cookie; cb(null); }; MemoryCookieStore.prototype.updateCookie = function(oldCookie, newCookie, cb) { // updateCookie() may avoid updating cookies that are identical. For example, // lastAccessed may not be important to some stores and an equality // comparison could exclude that field. this.putCookie(newCookie,cb); }; MemoryCookieStore.prototype.removeCookie = function(domain, path, key, cb) { if (this.idx[domain] && this.idx[domain][path] && this.idx[domain][path][key]) { delete this.idx[domain][path][key]; } cb(null); }; MemoryCookieStore.prototype.removeCookies = function(domain, path, cb) { if (this.idx[domain]) { if (path) { delete this.idx[domain][path]; } else { delete this.idx[domain]; } } return cb(null); }; MemoryCookieStore.prototype.getAllCookies = function(cb) { var cookies = []; var idx = this.idx; var domains = Object.keys(idx); domains.forEach(function(domain) { var paths = Object.keys(idx[domain]); paths.forEach(function(path) { var keys = Object.keys(idx[domain][path]); keys.forEach(function(key) { if (key !== null) { cookies.push(idx[domain][path][key]); } }); }); }); // Sort by creationIndex so deserializing retains the creation order. // When implementing your own store, this SHOULD retain the order too cookies.sort(function(a,b) { return (a.creationIndex||0) - (b.creationIndex||0); }); cb(null, cookies); }; /***/ }), /* 90 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * Copyright (c) 2015, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ var pubsuffix = __webpack_require__(84); // Gives the permutation of all possible domainMatch()es of a given domain. The // array is in shortest-to-longest order. Handy for indexing. function permuteDomain (domain) { var pubSuf = pubsuffix.getPublicSuffix(domain); if (!pubSuf) { return null; } if (pubSuf == domain) { return [domain]; } var prefix = domain.slice(0, -(pubSuf.length + 1)); // ".example.com" var parts = prefix.split('.').reverse(); var cur = pubSuf; var permutations = [cur]; while (parts.length) { cur = parts.shift() + '.' + cur; permutations.push(cur); } return permutations; } exports.permuteDomain = permuteDomain; /***/ }), /* 91 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * Copyright (c) 2015, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /* * "A request-path path-matches a given cookie-path if at least one of the * following conditions holds:" */ function pathMatch (reqPath, cookiePath) { // "o The cookie-path and the request-path are identical." if (cookiePath === reqPath) { return true; } var idx = reqPath.indexOf(cookiePath); if (idx === 0) { // "o The cookie-path is a prefix of the request-path, and the last // character of the cookie-path is %x2F ("/")." if (cookiePath.substr(-1) === "/") { return true; } // " o The cookie-path is a prefix of the request-path, and the first // character of the request-path that is not included in the cookie- path // is a %x2F ("/") character." if (reqPath.substr(cookiePath.length, 1) === "/") { return true; } } return false; } exports.pathMatch = pathMatch; /***/ }), /* 92 */ /***/ (function(module) { module.exports = JSON.parse("{\"author\":{\"name\":\"Jeremy Stashewsky\",\"email\":\"jstash@gmail.com\",\"website\":\"https://github.com/stash\"},\"contributors\":[{\"name\":\"Alexander Savin\",\"website\":\"https://github.com/apsavin\"},{\"name\":\"Ian Livingstone\",\"website\":\"https://github.com/ianlivingstone\"},{\"name\":\"Ivan Nikulin\",\"website\":\"https://github.com/inikulin\"},{\"name\":\"Lalit Kapoor\",\"website\":\"https://github.com/lalitkapoor\"},{\"name\":\"Sam Thompson\",\"website\":\"https://github.com/sambthompson\"},{\"name\":\"Sebastian Mayr\",\"website\":\"https://github.com/Sebmaster\"}],\"license\":\"BSD-3-Clause\",\"name\":\"tough-cookie\",\"description\":\"RFC6265 Cookies and Cookie Jar for node.js\",\"keywords\":[\"HTTP\",\"cookie\",\"cookies\",\"set-cookie\",\"cookiejar\",\"jar\",\"RFC6265\",\"RFC2965\"],\"version\":\"2.4.3\",\"homepage\":\"https://github.com/salesforce/tough-cookie\",\"repository\":{\"type\":\"git\",\"url\":\"git://github.com/salesforce/tough-cookie.git\"},\"bugs\":{\"url\":\"https://github.com/salesforce/tough-cookie/issues\"},\"main\":\"./lib/cookie\",\"files\":[\"lib\"],\"scripts\":{\"test\":\"vows test/*_test.js\",\"cover\":\"nyc --reporter=lcov --reporter=html vows test/*_test.js\"},\"engines\":{\"node\":\">=0.8\"},\"devDependencies\":{\"async\":\"^1.4.2\",\"nyc\":\"^11.6.0\",\"string.prototype.repeat\":\"^0.2.0\",\"vows\":\"^0.8.1\"},\"dependencies\":{\"psl\":\"^1.1.24\",\"punycode\":\"^1.4.1\"}}"); /***/ }), /* 93 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var jsonSafeStringify = __webpack_require__(7) var crypto = __webpack_require__(94) var Buffer = __webpack_require__(95).Buffer var defer = typeof setImmediate === 'undefined' ? process.nextTick : setImmediate function paramsHaveRequestBody (params) { return ( params.body || params.requestBodyStream || (params.json && typeof params.json !== 'boolean') || params.multipart ) } function safeStringify (obj, replacer) { var ret try { ret = JSON.stringify(obj, replacer) } catch (e) { ret = jsonSafeStringify(obj, replacer) } return ret } function md5 (str) { return crypto.createHash('md5').update(str).digest('hex') } function isReadStream (rs) { return rs.readable && rs.path && rs.mode } function toBase64 (str) { return Buffer.from(str || '', 'utf8').toString('base64') } function copy (obj) { var o = {} Object.keys(obj).forEach(function (i) { o[i] = obj[i] }) return o } function version () { var numbers = process.version.replace('v', '').split('.') return { major: parseInt(numbers[0], 10), minor: parseInt(numbers[1], 10), patch: parseInt(numbers[2], 10) } } exports.paramsHaveRequestBody = paramsHaveRequestBody exports.safeStringify = safeStringify exports.md5 = md5 exports.isReadStream = isReadStream exports.toBase64 = toBase64 exports.copy = copy exports.version = version exports.defer = defer /***/ }), /* 94 */ /***/ (function(module, exports) { module.exports = require("crypto"); /***/ }), /* 95 */ /***/ (function(module, exports, __webpack_require__) { /* eslint-disable node/no-deprecated-api */ var buffer = __webpack_require__(96) var Buffer = buffer.Buffer // alternative to using Object.keys for old browsers function copyProps (src, dst) { for (var key in src) { dst[key] = src[key] } } if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { module.exports = buffer } else { // Copy properties from require('buffer') copyProps(buffer, exports) exports.Buffer = SafeBuffer } function SafeBuffer (arg, encodingOrOffset, length) { return Buffer(arg, encodingOrOffset, length) } SafeBuffer.prototype = Object.create(Buffer.prototype) // Copy static methods from Buffer copyProps(Buffer, SafeBuffer) SafeBuffer.from = function (arg, encodingOrOffset, length) { if (typeof arg === 'number') { throw new TypeError('Argument must not be a number') } return Buffer(arg, encodingOrOffset, length) } SafeBuffer.alloc = function (size, fill, encoding) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } var buf = Buffer(size) if (fill !== undefined) { if (typeof encoding === 'string') { buf.fill(fill, encoding) } else { buf.fill(fill) } } else { buf.fill(0) } return buf } SafeBuffer.allocUnsafe = function (size) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } return Buffer(size) } SafeBuffer.allocUnsafeSlow = function (size) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } return buffer.SlowBuffer(size) } /***/ }), /* 96 */ /***/ (function(module, exports) { module.exports = require("buffer"); /***/ }), /* 97 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var http = __webpack_require__(98) var https = __webpack_require__(99) var url = __webpack_require__(83) var util = __webpack_require__(9) var stream = __webpack_require__(100) var zlib = __webpack_require__(101) var aws2 = __webpack_require__(102) var aws4 = __webpack_require__(103) var httpSignature = __webpack_require__(106) var mime = __webpack_require__(157) var caseless = __webpack_require__(161) var ForeverAgent = __webpack_require__(162) var FormData = __webpack_require__(164) var extend = __webpack_require__(79) var isstream = __webpack_require__(179) var isTypedArray = __webpack_require__(180).strict var helpers = __webpack_require__(93) var cookies = __webpack_require__(80) var getProxyFromURI = __webpack_require__(181) var Querystring = __webpack_require__(182).Querystring var Har = __webpack_require__(188).Har var Auth = __webpack_require__(257).Auth var OAuth = __webpack_require__(261).OAuth var hawk = __webpack_require__(263) var Multipart = __webpack_require__(264).Multipart var Redirect = __webpack_require__(265).Redirect var Tunnel = __webpack_require__(266).Tunnel var now = __webpack_require__(269) var Buffer = __webpack_require__(95).Buffer var safeStringify = helpers.safeStringify var isReadStream = helpers.isReadStream var toBase64 = helpers.toBase64 var defer = helpers.defer var copy = helpers.copy var version = helpers.version var globalCookieJar = cookies.jar() var globalPool = {} function filterForNonReserved (reserved, options) { // Filter out properties that are not reserved. // Reserved values are passed in at call site. var object = {} for (var i in options) { var notReserved = (reserved.indexOf(i) === -1) if (notReserved) { object[i] = options[i] } } return object } function filterOutReservedFunctions (reserved, options) { // Filter out properties that are functions and are reserved. // Reserved values are passed in at call site. var object = {} for (var i in options) { var isReserved = !(reserved.indexOf(i) === -1) var isFunction = (typeof options[i] === 'function') if (!(isReserved && isFunction)) { object[i] = options[i] } } return object } // Return a simpler request object to allow serialization function requestToJSON () { var self = this return { uri: self.uri, method: self.method, headers: self.headers } } // Return a simpler response object to allow serialization function responseToJSON () { var self = this return { statusCode: self.statusCode, body: self.body, headers: self.headers, request: requestToJSON.call(self.request) } } function Request (options) { // if given the method property in options, set property explicitMethod to true // extend the Request instance with any non-reserved properties // remove any reserved functions from the options object // set Request instance to be readable and writable // call init var self = this // start with HAR, then override with additional options if (options.har) { self._har = new Har(self) options = self._har.options(options) } stream.Stream.call(self) var reserved = Object.keys(Request.prototype) var nonReserved = filterForNonReserved(reserved, options) extend(self, nonReserved) options = filterOutReservedFunctions(reserved, options) self.readable = true self.writable = true if (options.method) { self.explicitMethod = true } self._qs = new Querystring(self) self._auth = new Auth(self) self._oauth = new OAuth(self) self._multipart = new Multipart(self) self._redirect = new Redirect(self) self._tunnel = new Tunnel(self) self.init(options) } util.inherits(Request, stream.Stream) // Debugging Request.debug = process.env.NODE_DEBUG && /\brequest\b/.test(process.env.NODE_DEBUG) function debug () { if (Request.debug) { console.error('REQUEST %s', util.format.apply(util, arguments)) } } Request.prototype.debug = debug Request.prototype.init = function (options) { // init() contains all the code to setup the request object. // the actual outgoing request is not started until start() is called // this function is called from both the constructor and on redirect. var self = this if (!options) { options = {} } self.headers = self.headers ? copy(self.headers) : {} // Delete headers with value undefined since they break // ClientRequest.OutgoingMessage.setHeader in node 0.12 for (var headerName in self.headers) { if (typeof self.headers[headerName] === 'undefined') { delete self.headers[headerName] } } caseless.httpify(self, self.headers) if (!self.method) { self.method = options.method || 'GET' } if (!self.localAddress) { self.localAddress = options.localAddress } self._qs.init(options) debug(options) if (!self.pool && self.pool !== false) { self.pool = globalPool } self.dests = self.dests || [] self.__isRequestRequest = true // Protect against double callback if (!self._callback && self.callback) { self._callback = self.callback self.callback = function () { if (self._callbackCalled) { return // Print a warning maybe? } self._callbackCalled = true self._callback.apply(self, arguments) } self.on('error', self.callback.bind()) self.on('complete', self.callback.bind(self, null)) } // People use this property instead all the time, so support it if (!self.uri && self.url) { self.uri = self.url delete self.url } // If there's a baseUrl, then use it as the base URL (i.e. uri must be // specified as a relative path and is appended to baseUrl). if (self.baseUrl) { if (typeof self.baseUrl !== 'string') { return self.emit('error', new Error('options.baseUrl must be a string')) } if (typeof self.uri !== 'string') { return self.emit('error', new Error('options.uri must be a string when using options.baseUrl')) } if (self.uri.indexOf('//') === 0 || self.uri.indexOf('://') !== -1) { return self.emit('error', new Error('options.uri must be a path when using options.baseUrl')) } // Handle all cases to make sure that there's only one slash between // baseUrl and uri. var baseUrlEndsWithSlash = self.baseUrl.lastIndexOf('/') === self.baseUrl.length - 1 var uriStartsWithSlash = self.uri.indexOf('/') === 0 if (baseUrlEndsWithSlash && uriStartsWithSlash) { self.uri = self.baseUrl + self.uri.slice(1) } else if (baseUrlEndsWithSlash || uriStartsWithSlash) { self.uri = self.baseUrl + self.uri } else if (self.uri === '') { self.uri = self.baseUrl } else { self.uri = self.baseUrl + '/' + self.uri } delete self.baseUrl } // A URI is needed by this point, emit error if we haven't been able to get one if (!self.uri) { return self.emit('error', new Error('options.uri is a required argument')) } // If a string URI/URL was given, parse it into a URL object if (typeof self.uri === 'string') { self.uri = url.parse(self.uri) } // Some URL objects are not from a URL parsed string and need href added if (!self.uri.href) { self.uri.href = url.format(self.uri) } // DEPRECATED: Warning for users of the old Unix Sockets URL Scheme if (self.uri.protocol === 'unix:') { return self.emit('error', new Error('`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`')) } // Support Unix Sockets if (self.uri.host === 'unix') { self.enableUnixSocket() } if (self.strictSSL === false) { self.rejectUnauthorized = false } if (!self.uri.pathname) { self.uri.pathname = '/' } if (!(self.uri.host || (self.uri.hostname && self.uri.port)) && !self.uri.isUnix) { // Invalid URI: it may generate lot of bad errors, like 'TypeError: Cannot call method `indexOf` of undefined' in CookieJar // Detect and reject it as soon as possible var faultyUri = url.format(self.uri) var message = 'Invalid URI "' + faultyUri + '"' if (Object.keys(options).length === 0) { // No option ? This can be the sign of a redirect // As this is a case where the user cannot do anything (they didn't call request directly with this URL) // they should be warned that it can be caused by a redirection (can save some hair) message += '. This can be caused by a crappy redirection.' } // This error was fatal self.abort() return self.emit('error', new Error(message)) } if (!self.hasOwnProperty('proxy')) { self.proxy = getProxyFromURI(self.uri) } self.tunnel = self._tunnel.isEnabled() if (self.proxy) { self._tunnel.setup(options) } self._redirect.onRequest(options) self.setHost = false if (!self.hasHeader('host')) { var hostHeaderName = self.originalHostHeaderName || 'host' self.setHeader(hostHeaderName, self.uri.host) // Drop :port suffix from Host header if known protocol. if (self.uri.port) { if ((self.uri.port === '80' && self.uri.protocol === 'http:') || (self.uri.port === '443' && self.uri.protocol === 'https:')) { self.setHeader(hostHeaderName, self.uri.hostname) } } self.setHost = true } self.jar(self._jar || options.jar) if (!self.uri.port) { if (self.uri.protocol === 'http:') { self.uri.port = 80 } else if (self.uri.protocol === 'https:') { self.uri.port = 443 } } if (self.proxy && !self.tunnel) { self.port = self.proxy.port self.host = self.proxy.hostname } else { self.port = self.uri.port self.host = self.uri.hostname } if (options.form) { self.form(options.form) } if (options.formData) { var formData = options.formData var requestForm = self.form() var appendFormValue = function (key, value) { if (value && value.hasOwnProperty('value') && value.hasOwnProperty('options')) { requestForm.append(key, value.value, value.options) } else { requestForm.append(key, value) } } for (var formKey in formData) { if (formData.hasOwnProperty(formKey)) { var formValue = formData[formKey] if (formValue instanceof Array) { for (var j = 0; j < formValue.length; j++) { appendFormValue(formKey, formValue[j]) } } else { appendFormValue(formKey, formValue) } } } } if (options.qs) { self.qs(options.qs) } if (self.uri.path) { self.path = self.uri.path } else { self.path = self.uri.pathname + (self.uri.search || '') } if (self.path.length === 0) { self.path = '/' } // Auth must happen last in case signing is dependent on other headers if (options.aws) { self.aws(options.aws) } if (options.hawk) { self.hawk(options.hawk) } if (options.httpSignature) { self.httpSignature(options.httpSignature) } if (options.auth) { if (Object.prototype.hasOwnProperty.call(options.auth, 'username')) { options.auth.user = options.auth.username } if (Object.prototype.hasOwnProperty.call(options.auth, 'password')) { options.auth.pass = options.auth.password } self.auth( options.auth.user, options.auth.pass, options.auth.sendImmediately, options.auth.bearer ) } if (self.gzip && !self.hasHeader('accept-encoding')) { self.setHeader('accept-encoding', 'gzip, deflate') } if (self.uri.auth && !self.hasHeader('authorization')) { var uriAuthPieces = self.uri.auth.split(':').map(function (item) { return self._qs.unescape(item) }) self.auth(uriAuthPieces[0], uriAuthPieces.slice(1).join(':'), true) } if (!self.tunnel && self.proxy && self.proxy.auth && !self.hasHeader('proxy-authorization')) { var proxyAuthPieces = self.proxy.auth.split(':').map(function (item) { return self._qs.unescape(item) }) var authHeader = 'Basic ' + toBase64(proxyAuthPieces.join(':')) self.setHeader('proxy-authorization', authHeader) } if (self.proxy && !self.tunnel) { self.path = (self.uri.protocol + '//' + self.uri.host + self.path) } if (options.json) { self.json(options.json) } if (options.multipart) { self.multipart(options.multipart) } if (options.time) { self.timing = true // NOTE: elapsedTime is deprecated in favor of .timings self.elapsedTime = self.elapsedTime || 0 } function setContentLength () { if (isTypedArray(self.body)) { self.body = Buffer.from(self.body) } if (!self.hasHeader('content-length')) { var length if (typeof self.body === 'string') { length = Buffer.byteLength(self.body) } else if (Array.isArray(self.body)) { length = self.body.reduce(function (a, b) { return a + b.length }, 0) } else { length = self.body.length } if (length) { self.setHeader('content-length', length) } else { self.emit('error', new Error('Argument error, options.body.')) } } } if (self.body && !isstream(self.body)) { setContentLength() } if (options.oauth) { self.oauth(options.oauth) } else if (self._oauth.params && self.hasHeader('authorization')) { self.oauth(self._oauth.params) } var protocol = self.proxy && !self.tunnel ? self.proxy.protocol : self.uri.protocol var defaultModules = {'http:': http, 'https:': https} var httpModules = self.httpModules || {} self.httpModule = httpModules[protocol] || defaultModules[protocol] if (!self.httpModule) { return self.emit('error', new Error('Invalid protocol: ' + protocol)) } if (options.ca) { self.ca = options.ca } if (!self.agent) { if (options.agentOptions) { self.agentOptions = options.agentOptions } if (options.agentClass) { self.agentClass = options.agentClass } else if (options.forever) { var v = version() // use ForeverAgent in node 0.10- only if (v.major === 0 && v.minor <= 10) { self.agentClass = protocol === 'http:' ? ForeverAgent : ForeverAgent.SSL } else { self.agentClass = self.httpModule.Agent self.agentOptions = self.agentOptions || {} self.agentOptions.keepAlive = true } } else { self.agentClass = self.httpModule.Agent } } if (self.pool === false) { self.agent = false } else { self.agent = self.agent || self.getNewAgent() } self.on('pipe', function (src) { if (self.ntick && self._started) { self.emit('error', new Error('You cannot pipe to this stream after the outbound request has started.')) } self.src = src if (isReadStream(src)) { if (!self.hasHeader('content-type')) { self.setHeader('content-type', mime.lookup(src.path)) } } else { if (src.headers) { for (var i in src.headers) { if (!self.hasHeader(i)) { self.setHeader(i, src.headers[i]) } } } if (self._json && !self.hasHeader('content-type')) { self.setHeader('content-type', 'application/json') } if (src.method && !self.explicitMethod) { self.method = src.method } } // self.on('pipe', function () { // console.error('You have already piped to this stream. Pipeing twice is likely to break the request.') // }) }) defer(function () { if (self._aborted) { return } var end = function () { if (self._form) { if (!self._auth.hasAuth) { self._form.pipe(self) } else if (self._auth.hasAuth && self._auth.sentAuth) { self._form.pipe(self) } } if (self._multipart && self._multipart.chunked) { self._multipart.body.pipe(self) } if (self.body) { if (isstream(self.body)) { self.body.pipe(self) } else { setContentLength() if (Array.isArray(self.body)) { self.body.forEach(function (part) { self.write(part) }) } else { self.write(self.body) } self.end() } } else if (self.requestBodyStream) { console.warn('options.requestBodyStream is deprecated, please pass the request object to stream.pipe.') self.requestBodyStream.pipe(self) } else if (!self.src) { if (self._auth.hasAuth && !self._auth.sentAuth) { self.end() return } if (self.method !== 'GET' && typeof self.method !== 'undefined') { self.setHeader('content-length', 0) } self.end() } } if (self._form && !self.hasHeader('content-length')) { // Before ending the request, we had to compute the length of the whole form, asyncly self.setHeader(self._form.getHeaders(), true) self._form.getLength(function (err, length) { if (!err && !isNaN(length)) { self.setHeader('content-length', length) } end() }) } else { end() } self.ntick = true }) } Request.prototype.getNewAgent = function () { var self = this var Agent = self.agentClass var options = {} if (self.agentOptions) { for (var i in self.agentOptions) { options[i] = self.agentOptions[i] } } if (self.ca) { options.ca = self.ca } if (self.ciphers) { options.ciphers = self.ciphers } if (self.secureProtocol) { options.secureProtocol = self.secureProtocol } if (self.secureOptions) { options.secureOptions = self.secureOptions } if (typeof self.rejectUnauthorized !== 'undefined') { options.rejectUnauthorized = self.rejectUnauthorized } if (self.cert && self.key) { options.key = self.key options.cert = self.cert } if (self.pfx) { options.pfx = self.pfx } if (self.passphrase) { options.passphrase = self.passphrase } var poolKey = '' // different types of agents are in different pools if (Agent !== self.httpModule.Agent) { poolKey += Agent.name } // ca option is only relevant if proxy or destination are https var proxy = self.proxy if (typeof proxy === 'string') { proxy = url.parse(proxy) } var isHttps = (proxy && proxy.protocol === 'https:') || this.uri.protocol === 'https:' if (isHttps) { if (options.ca) { if (poolKey) { poolKey += ':' } poolKey += options.ca } if (typeof options.rejectUnauthorized !== 'undefined') { if (poolKey) { poolKey += ':' } poolKey += options.rejectUnauthorized } if (options.cert) { if (poolKey) { poolKey += ':' } poolKey += options.cert.toString('ascii') + options.key.toString('ascii') } if (options.pfx) { if (poolKey) { poolKey += ':' } poolKey += options.pfx.toString('ascii') } if (options.ciphers) { if (poolKey) { poolKey += ':' } poolKey += options.ciphers } if (options.secureProtocol) { if (poolKey) { poolKey += ':' } poolKey += options.secureProtocol } if (options.secureOptions) { if (poolKey) { poolKey += ':' } poolKey += options.secureOptions } } if (self.pool === globalPool && !poolKey && Object.keys(options).length === 0 && self.httpModule.globalAgent) { // not doing anything special. Use the globalAgent return self.httpModule.globalAgent } // we're using a stored agent. Make sure it's protocol-specific poolKey = self.uri.protocol + poolKey // generate a new agent for this setting if none yet exists if (!self.pool[poolKey]) { self.pool[poolKey] = new Agent(options) // properly set maxSockets on new agents if (self.pool.maxSockets) { self.pool[poolKey].maxSockets = self.pool.maxSockets } } return self.pool[poolKey] } Request.prototype.start = function () { // start() is called once we are ready to send the outgoing HTTP request. // this is usually called on the first write(), end() or on nextTick() var self = this if (self.timing) { // All timings will be relative to this request's startTime. In order to do this, // we need to capture the wall-clock start time (via Date), immediately followed // by the high-resolution timer (via now()). While these two won't be set // at the _exact_ same time, they should be close enough to be able to calculate // high-resolution, monotonically non-decreasing timestamps relative to startTime. var startTime = new Date().getTime() var startTimeNow = now() } if (self._aborted) { return } self._started = true self.method = self.method || 'GET' self.href = self.uri.href if (self.src && self.src.stat && self.src.stat.size && !self.hasHeader('content-length')) { self.setHeader('content-length', self.src.stat.size) } if (self._aws) { self.aws(self._aws, true) } // We have a method named auth, which is completely different from the http.request // auth option. If we don't remove it, we're gonna have a bad time. var reqOptions = copy(self) delete reqOptions.auth debug('make request', self.uri.href) // node v6.8.0 now supports a `timeout` value in `http.request()`, but we // should delete it for now since we handle timeouts manually for better // consistency with node versions before v6.8.0 delete reqOptions.timeout try { self.req = self.httpModule.request(reqOptions) } catch (err) { self.emit('error', err) return } if (self.timing) { self.startTime = startTime self.startTimeNow = startTimeNow // Timing values will all be relative to startTime (by comparing to startTimeNow // so we have an accurate clock) self.timings = {} } var timeout if (self.timeout && !self.timeoutTimer) { if (self.timeout < 0) { timeout = 0 } else if (typeof self.timeout === 'number' && isFinite(self.timeout)) { timeout = self.timeout } } self.req.on('response', self.onRequestResponse.bind(self)) self.req.on('error', self.onRequestError.bind(self)) self.req.on('drain', function () { self.emit('drain') }) self.req.on('socket', function (socket) { // `._connecting` was the old property which was made public in node v6.1.0 var isConnecting = socket._connecting || socket.connecting if (self.timing) { self.timings.socket = now() - self.startTimeNow if (isConnecting) { var onLookupTiming = function () { self.timings.lookup = now() - self.startTimeNow } var onConnectTiming = function () { self.timings.connect = now() - self.startTimeNow } socket.once('lookup', onLookupTiming) socket.once('connect', onConnectTiming) // clean up timing event listeners if needed on error self.req.once('error', function () { socket.removeListener('lookup', onLookupTiming) socket.removeListener('connect', onConnectTiming) }) } } var setReqTimeout = function () { // This timeout sets the amount of time to wait *between* bytes sent // from the server once connected. // // In particular, it's useful for erroring if the server fails to send // data halfway through streaming a response. self.req.setTimeout(timeout, function () { if (self.req) { self.abort() var e = new Error('ESOCKETTIMEDOUT') e.code = 'ESOCKETTIMEDOUT' e.connect = false self.emit('error', e) } }) } if (timeout !== undefined) { // Only start the connection timer if we're actually connecting a new // socket, otherwise if we're already connected (because this is a // keep-alive connection) do not bother. This is important since we won't // get a 'connect' event for an already connected socket. if (isConnecting) { var onReqSockConnect = function () { socket.removeListener('connect', onReqSockConnect) clearTimeout(self.timeoutTimer) self.timeoutTimer = null setReqTimeout() } socket.on('connect', onReqSockConnect) self.req.on('error', function (err) { // eslint-disable-line handle-callback-err socket.removeListener('connect', onReqSockConnect) }) // Set a timeout in memory - this block will throw if the server takes more // than `timeout` to write the HTTP status and headers (corresponding to // the on('response') event on the client). NB: this measures wall-clock // time, not the time between bytes sent by the server. self.timeoutTimer = setTimeout(function () { socket.removeListener('connect', onReqSockConnect) self.abort() var e = new Error('ETIMEDOUT') e.code = 'ETIMEDOUT' e.connect = true self.emit('error', e) }, timeout) } else { // We're already connected setReqTimeout() } } self.emit('socket', socket) }) self.emit('request', self.req) } Request.prototype.onRequestError = function (error) { var self = this if (self._aborted) { return } if (self.req && self.req._reusedSocket && error.code === 'ECONNRESET' && self.agent.addRequestNoreuse) { self.agent = { addRequest: self.agent.addRequestNoreuse.bind(self.agent) } self.start() self.req.end() return } if (self.timeout && self.timeoutTimer) { clearTimeout(self.timeoutTimer) self.timeoutTimer = null } self.emit('error', error) } Request.prototype.onRequestResponse = function (response) { var self = this if (self.timing) { self.timings.response = now() - self.startTimeNow } debug('onRequestResponse', self.uri.href, response.statusCode, response.headers) response.on('end', function () { if (self.timing) { self.timings.end = now() - self.startTimeNow response.timingStart = self.startTime // fill in the blanks for any periods that didn't trigger, such as // no lookup or connect due to keep alive if (!self.timings.socket) { self.timings.socket = 0 } if (!self.timings.lookup) { self.timings.lookup = self.timings.socket } if (!self.timings.connect) { self.timings.connect = self.timings.lookup } if (!self.timings.response) { self.timings.response = self.timings.connect } debug('elapsed time', self.timings.end) // elapsedTime includes all redirects self.elapsedTime += Math.round(self.timings.end) // NOTE: elapsedTime is deprecated in favor of .timings response.elapsedTime = self.elapsedTime // timings is just for the final fetch response.timings = self.timings // pre-calculate phase timings as well response.timingPhases = { wait: self.timings.socket, dns: self.timings.lookup - self.timings.socket, tcp: self.timings.connect - self.timings.lookup, firstByte: self.timings.response - self.timings.connect, download: self.timings.end - self.timings.response, total: self.timings.end } } debug('response end', self.uri.href, response.statusCode, response.headers) }) if (self._aborted) { debug('aborted', self.uri.href) response.resume() return } self.response = response response.request = self response.toJSON = responseToJSON // XXX This is different on 0.10, because SSL is strict by default if (self.httpModule === https && self.strictSSL && (!response.hasOwnProperty('socket') || !response.socket.authorized)) { debug('strict ssl error', self.uri.href) var sslErr = response.hasOwnProperty('socket') ? response.socket.authorizationError : self.uri.href + ' does not support SSL' self.emit('error', new Error('SSL Error: ' + sslErr)) return } // Save the original host before any redirect (if it changes, we need to // remove any authorization headers). Also remember the case of the header // name because lots of broken servers expect Host instead of host and we // want the caller to be able to specify this. self.originalHost = self.getHeader('host') if (!self.originalHostHeaderName) { self.originalHostHeaderName = self.hasHeader('host') } if (self.setHost) { self.removeHeader('host') } if (self.timeout && self.timeoutTimer) { clearTimeout(self.timeoutTimer) self.timeoutTimer = null } var targetCookieJar = (self._jar && self._jar.setCookie) ? self._jar : globalCookieJar var addCookie = function (cookie) { // set the cookie if it's domain in the href's domain. try { targetCookieJar.setCookie(cookie, self.uri.href, {ignoreError: true}) } catch (e) { self.emit('error', e) } } response.caseless = caseless(response.headers) if (response.caseless.has('set-cookie') && (!self._disableCookies)) { var headerName = response.caseless.has('set-cookie') if (Array.isArray(response.headers[headerName])) { response.headers[headerName].forEach(addCookie) } else { addCookie(response.headers[headerName]) } } if (self._redirect.onResponse(response)) { return // Ignore the rest of the response } else { // Be a good stream and emit end when the response is finished. // Hack to emit end on close because of a core bug that never fires end response.on('close', function () { if (!self._ended) { self.response.emit('end') } }) response.once('end', function () { self._ended = true }) var noBody = function (code) { return ( self.method === 'HEAD' || // Informational (code >= 100 && code < 200) || // No Content code === 204 || // Not Modified code === 304 ) } var responseContent if (self.gzip && !noBody(response.statusCode)) { var contentEncoding = response.headers['content-encoding'] || 'identity' contentEncoding = contentEncoding.trim().toLowerCase() // Be more lenient with decoding compressed responses, since (very rarely) // servers send slightly invalid gzip responses that are still accepted // by common browsers. // Always using Z_SYNC_FLUSH is what cURL does. var zlibOptions = { flush: zlib.Z_SYNC_FLUSH, finishFlush: zlib.Z_SYNC_FLUSH } if (contentEncoding === 'gzip') { responseContent = zlib.createGunzip(zlibOptions) response.pipe(responseContent) } else if (contentEncoding === 'deflate') { responseContent = zlib.createInflate(zlibOptions) response.pipe(responseContent) } else { // Since previous versions didn't check for Content-Encoding header, // ignore any invalid values to preserve backwards-compatibility if (contentEncoding !== 'identity') { debug('ignoring unrecognized Content-Encoding ' + contentEncoding) } responseContent = response } } else { responseContent = response } if (self.encoding) { if (self.dests.length !== 0) { console.error('Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid.') } else { responseContent.setEncoding(self.encoding) } } if (self._paused) { responseContent.pause() } self.responseContent = responseContent self.emit('response', response) self.dests.forEach(function (dest) { self.pipeDest(dest) }) responseContent.on('data', function (chunk) { if (self.timing && !self.responseStarted) { self.responseStartTime = (new Date()).getTime() // NOTE: responseStartTime is deprecated in favor of .timings response.responseStartTime = self.responseStartTime } self._destdata = true self.emit('data', chunk) }) responseContent.once('end', function (chunk) { self.emit('end', chunk) }) responseContent.on('error', function (error) { self.emit('error', error) }) responseContent.on('close', function () { self.emit('close') }) if (self.callback) { self.readResponseBody(response) } else { // if no callback self.on('end', function () { if (self._aborted) { debug('aborted', self.uri.href) return } self.emit('complete', response) }) } } debug('finish init function', self.uri.href) } Request.prototype.readResponseBody = function (response) { var self = this debug("reading response's body") var buffers = [] var bufferLength = 0 var strings = [] self.on('data', function (chunk) { if (!Buffer.isBuffer(chunk)) { strings.push(chunk) } else if (chunk.length) { bufferLength += chunk.length buffers.push(chunk) } }) self.on('end', function () { debug('end event', self.uri.href) if (self._aborted) { debug('aborted', self.uri.href) // `buffer` is defined in the parent scope and used in a closure it exists for the life of the request. // This can lead to leaky behavior if the user retains a reference to the request object. buffers = [] bufferLength = 0 return } if (bufferLength) { debug('has body', self.uri.href, bufferLength) response.body = Buffer.concat(buffers, bufferLength) if (self.encoding !== null) { response.body = response.body.toString(self.encoding) } // `buffer` is defined in the parent scope and used in a closure it exists for the life of the Request. // This can lead to leaky behavior if the user retains a reference to the request object. buffers = [] bufferLength = 0 } else if (strings.length) { // The UTF8 BOM [0xEF,0xBB,0xBF] is converted to [0xFE,0xFF] in the JS UTC16/UCS2 representation. // Strip this value out when the encoding is set to 'utf8', as upstream consumers won't expect it and it breaks JSON.parse(). if (self.encoding === 'utf8' && strings[0].length > 0 && strings[0][0] === '\uFEFF') { strings[0] = strings[0].substring(1) } response.body = strings.join('') } if (self._json) { try { response.body = JSON.parse(response.body, self._jsonReviver) } catch (e) { debug('invalid JSON received', self.uri.href) } } debug('emitting complete', self.uri.href) if (typeof response.body === 'undefined' && !self._json) { response.body = self.encoding === null ? Buffer.alloc(0) : '' } self.emit('complete', response, response.body) }) } Request.prototype.abort = function () { var self = this self._aborted = true if (self.req) { self.req.abort() } else if (self.response) { self.response.destroy() } self.emit('abort') } Request.prototype.pipeDest = function (dest) { var self = this var response = self.response // Called after the response is received if (dest.headers && !dest.headersSent) { if (response.caseless.has('content-type')) { var ctname = response.caseless.has('content-type') if (dest.setHeader) { dest.setHeader(ctname, response.headers[ctname]) } else { dest.headers[ctname] = response.headers[ctname] } } if (response.caseless.has('content-length')) { var clname = response.caseless.has('content-length') if (dest.setHeader) { dest.setHeader(clname, response.headers[clname]) } else { dest.headers[clname] = response.headers[clname] } } } if (dest.setHeader && !dest.headersSent) { for (var i in response.headers) { // If the response content is being decoded, the Content-Encoding header // of the response doesn't represent the piped content, so don't pass it. if (!self.gzip || i !== 'content-encoding') { dest.setHeader(i, response.headers[i]) } } dest.statusCode = response.statusCode } if (self.pipefilter) { self.pipefilter(response, dest) } } Request.prototype.qs = function (q, clobber) { var self = this var base if (!clobber && self.uri.query) { base = self._qs.parse(self.uri.query) } else { base = {} } for (var i in q) { base[i] = q[i] } var qs = self._qs.stringify(base) if (qs === '') { return self } self.uri = url.parse(self.uri.href.split('?')[0] + '?' + qs) self.url = self.uri self.path = self.uri.path if (self.uri.host === 'unix') { self.enableUnixSocket() } return self } Request.prototype.form = function (form) { var self = this if (form) { if (!/^application\/x-www-form-urlencoded\b/.test(self.getHeader('content-type'))) { self.setHeader('content-type', 'application/x-www-form-urlencoded') } self.body = (typeof form === 'string') ? self._qs.rfc3986(form.toString('utf8')) : self._qs.stringify(form).toString('utf8') return self } // create form-data object self._form = new FormData() self._form.on('error', function (err) { err.message = 'form-data: ' + err.message self.emit('error', err) self.abort() }) return self._form } Request.prototype.multipart = function (multipart) { var self = this self._multipart.onRequest(multipart) if (!self._multipart.chunked) { self.body = self._multipart.body } return self } Request.prototype.json = function (val) { var self = this if (!self.hasHeader('accept')) { self.setHeader('accept', 'application/json') } if (typeof self.jsonReplacer === 'function') { self._jsonReplacer = self.jsonReplacer } self._json = true if (typeof val === 'boolean') { if (self.body !== undefined) { if (!/^application\/x-www-form-urlencoded\b/.test(self.getHeader('content-type'))) { self.body = safeStringify(self.body, self._jsonReplacer) } else { self.body = self._qs.rfc3986(self.body) } if (!self.hasHeader('content-type')) { self.setHeader('content-type', 'application/json') } } } else { self.body = safeStringify(val, self._jsonReplacer) if (!self.hasHeader('content-type')) { self.setHeader('content-type', 'application/json') } } if (typeof self.jsonReviver === 'function') { self._jsonReviver = self.jsonReviver } return self } Request.prototype.getHeader = function (name, headers) { var self = this var result, re, match if (!headers) { headers = self.headers } Object.keys(headers).forEach(function (key) { if (key.length !== name.length) { return } re = new RegExp(name, 'i') match = key.match(re) if (match) { result = headers[key] } }) return result } Request.prototype.enableUnixSocket = function () { // Get the socket & request paths from the URL var unixParts = this.uri.path.split(':') var host = unixParts[0] var path = unixParts[1] // Apply unix properties to request this.socketPath = host this.uri.pathname = path this.uri.path = path this.uri.host = host this.uri.hostname = host this.uri.isUnix = true } Request.prototype.auth = function (user, pass, sendImmediately, bearer) { var self = this self._auth.onRequest(user, pass, sendImmediately, bearer) return self } Request.prototype.aws = function (opts, now) { var self = this if (!now) { self._aws = opts return self } if (opts.sign_version === 4 || opts.sign_version === '4') { // use aws4 var options = { host: self.uri.host, path: self.uri.path, method: self.method, headers: self.headers, body: self.body } if (opts.service) { options.service = opts.service } var signRes = aws4.sign(options, { accessKeyId: opts.key, secretAccessKey: opts.secret, sessionToken: opts.session }) self.setHeader('authorization', signRes.headers.Authorization) self.setHeader('x-amz-date', signRes.headers['X-Amz-Date']) if (signRes.headers['X-Amz-Security-Token']) { self.setHeader('x-amz-security-token', signRes.headers['X-Amz-Security-Token']) } } else { // default: use aws-sign2 var date = new Date() self.setHeader('date', date.toUTCString()) var auth = { key: opts.key, secret: opts.secret, verb: self.method.toUpperCase(), date: date, contentType: self.getHeader('content-type') || '', md5: self.getHeader('content-md5') || '', amazonHeaders: aws2.canonicalizeHeaders(self.headers) } var path = self.uri.path if (opts.bucket && path) { auth.resource = '/' + opts.bucket + path } else if (opts.bucket && !path) { auth.resource = '/' + opts.bucket } else if (!opts.bucket && path) { auth.resource = path } else if (!opts.bucket && !path) { auth.resource = '/' } auth.resource = aws2.canonicalizeResource(auth.resource) self.setHeader('authorization', aws2.authorization(auth)) } return self } Request.prototype.httpSignature = function (opts) { var self = this httpSignature.signRequest({ getHeader: function (header) { return self.getHeader(header, self.headers) }, setHeader: function (header, value) { self.setHeader(header, value) }, method: self.method, path: self.path }, opts) debug('httpSignature authorization', self.getHeader('authorization')) return self } Request.prototype.hawk = function (opts) { var self = this self.setHeader('Authorization', hawk.header(self.uri, self.method, opts)) } Request.prototype.oauth = function (_oauth) { var self = this self._oauth.onRequest(_oauth) return self } Request.prototype.jar = function (jar) { var self = this var cookies if (self._redirect.redirectsFollowed === 0) { self.originalCookieHeader = self.getHeader('cookie') } if (!jar) { // disable cookies cookies = false self._disableCookies = true } else { var targetCookieJar = (jar && jar.getCookieString) ? jar : globalCookieJar var urihref = self.uri.href // fetch cookie in the Specified host if (targetCookieJar) { cookies = targetCookieJar.getCookieString(urihref) } } // if need cookie and cookie is not empty if (cookies && cookies.length) { if (self.originalCookieHeader) { // Don't overwrite existing Cookie header self.setHeader('cookie', self.originalCookieHeader + '; ' + cookies) } else { self.setHeader('cookie', cookies) } } self._jar = jar return self } // Stream API Request.prototype.pipe = function (dest, opts) { var self = this if (self.response) { if (self._destdata) { self.emit('error', new Error('You cannot pipe after data has been emitted from the response.')) } else if (self._ended) { self.emit('error', new Error('You cannot pipe after the response has been ended.')) } else { stream.Stream.prototype.pipe.call(self, dest, opts) self.pipeDest(dest) return dest } } else { self.dests.push(dest) stream.Stream.prototype.pipe.call(self, dest, opts) return dest } } Request.prototype.write = function () { var self = this if (self._aborted) { return } if (!self._started) { self.start() } if (self.req) { return self.req.write.apply(self.req, arguments) } } Request.prototype.end = function (chunk) { var self = this if (self._aborted) { return } if (chunk) { self.write(chunk) } if (!self._started) { self.start() } if (self.req) { self.req.end() } } Request.prototype.pause = function () { var self = this if (!self.responseContent) { self._paused = true } else { self.responseContent.pause.apply(self.responseContent, arguments) } } Request.prototype.resume = function () { var self = this if (!self.responseContent) { self._paused = false } else { self.responseContent.resume.apply(self.responseContent, arguments) } } Request.prototype.destroy = function () { var self = this if (!self._ended) { self.end() } else if (self.response) { self.response.destroy() } } Request.defaultProxyHeaderWhiteList = Tunnel.defaultProxyHeaderWhiteList.slice() Request.defaultProxyHeaderExclusiveList = Tunnel.defaultProxyHeaderExclusiveList.slice() // Exports Request.prototype.toJSON = requestToJSON module.exports = Request /***/ }), /* 98 */ /***/ (function(module, exports) { module.exports = require("http"); /***/ }), /* 99 */ /***/ (function(module, exports) { module.exports = require("https"); /***/ }), /* 100 */ /***/ (function(module, exports) { module.exports = require("stream"); /***/ }), /* 101 */ /***/ (function(module, exports) { module.exports = require("zlib"); /***/ }), /* 102 */ /***/ (function(module, exports, __webpack_require__) { /*! * Copyright 2010 LearnBoost <dev@learnboost.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Module dependencies. */ var crypto = __webpack_require__(94) , parse = __webpack_require__(83).parse ; /** * Valid keys. */ var keys = [ 'acl' , 'location' , 'logging' , 'notification' , 'partNumber' , 'policy' , 'requestPayment' , 'torrent' , 'uploadId' , 'uploads' , 'versionId' , 'versioning' , 'versions' , 'website' ] /** * Return an "Authorization" header value with the given `options` * in the form of "AWS <key>:<signature>" * * @param {Object} options * @return {String} * @api private */ function authorization (options) { return 'AWS ' + options.key + ':' + sign(options) } module.exports = authorization module.exports.authorization = authorization /** * Simple HMAC-SHA1 Wrapper * * @param {Object} options * @return {String} * @api private */ function hmacSha1 (options) { return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64') } module.exports.hmacSha1 = hmacSha1 /** * Create a base64 sha1 HMAC for `options`. * * @param {Object} options * @return {String} * @api private */ function sign (options) { options.message = stringToSign(options) return hmacSha1(options) } module.exports.sign = sign /** * Create a base64 sha1 HMAC for `options`. * * Specifically to be used with S3 presigned URLs * * @param {Object} options * @return {String} * @api private */ function signQuery (options) { options.message = queryStringToSign(options) return hmacSha1(options) } module.exports.signQuery= signQuery /** * Return a string for sign() with the given `options`. * * Spec: * * <verb>\n * <md5>\n * <content-type>\n * <date>\n * [headers\n] * <resource> * * @param {Object} options * @return {String} * @api private */ function stringToSign (options) { var headers = options.amazonHeaders || '' if (headers) headers += '\n' var r = [ options.verb , options.md5 , options.contentType , options.date ? options.date.toUTCString() : '' , headers + options.resource ] return r.join('\n') } module.exports.stringToSign = stringToSign /** * Return a string for sign() with the given `options`, but is meant exclusively * for S3 presigned URLs * * Spec: * * <date>\n * <resource> * * @param {Object} options * @return {String} * @api private */ function queryStringToSign (options){ return 'GET\n\n\n' + options.date + '\n' + options.resource } module.exports.queryStringToSign = queryStringToSign /** * Perform the following: * * - ignore non-amazon headers * - lowercase fields * - sort lexicographically * - trim whitespace between ":" * - join with newline * * @param {Object} headers * @return {String} * @api private */ function canonicalizeHeaders (headers) { var buf = [] , fields = Object.keys(headers) ; for (var i = 0, len = fields.length; i < len; ++i) { var field = fields[i] , val = headers[field] , field = field.toLowerCase() ; if (0 !== field.indexOf('x-amz')) continue buf.push(field + ':' + val) } return buf.sort().join('\n') } module.exports.canonicalizeHeaders = canonicalizeHeaders /** * Perform the following: * * - ignore non sub-resources * - sort lexicographically * * @param {String} resource * @return {String} * @api private */ function canonicalizeResource (resource) { var url = parse(resource, true) , path = url.pathname , buf = [] ; Object.keys(url.query).forEach(function(key){ if (!~keys.indexOf(key)) return var val = '' == url.query[key] ? '' : '=' + encodeURIComponent(url.query[key]) buf.push(key + val) }) return path + (buf.length ? '?' + buf.sort().join('&') : '') } module.exports.canonicalizeResource = canonicalizeResource /***/ }), /* 103 */ /***/ (function(module, exports, __webpack_require__) { var aws4 = exports, url = __webpack_require__(83), querystring = __webpack_require__(104), crypto = __webpack_require__(94), lru = __webpack_require__(105), credentialsCache = lru(1000) // http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html function hmac(key, string, encoding) { return crypto.createHmac('sha256', key).update(string, 'utf8').digest(encoding) } function hash(string, encoding) { return crypto.createHash('sha256').update(string, 'utf8').digest(encoding) } // This function assumes the string has already been percent encoded function encodeRfc3986(urlEncodedString) { return urlEncodedString.replace(/[!'()*]/g, function(c) { return '%' + c.charCodeAt(0).toString(16).toUpperCase() }) } // request: { path | body, [host], [method], [headers], [service], [region] } // credentials: { accessKeyId, secretAccessKey, [sessionToken] } function RequestSigner(request, credentials) { if (typeof request === 'string') request = url.parse(request) var headers = request.headers = (request.headers || {}), hostParts = this.matchHost(request.hostname || request.host || headers.Host || headers.host) this.request = request this.credentials = credentials || this.defaultCredentials() this.service = request.service || hostParts[0] || '' this.region = request.region || hostParts[1] || 'us-east-1' // SES uses a different domain from the service name if (this.service === 'email') this.service = 'ses' if (!request.method && request.body) request.method = 'POST' if (!headers.Host && !headers.host) { headers.Host = request.hostname || request.host || this.createHost() // If a port is specified explicitly, use it as is if (request.port) headers.Host += ':' + request.port } if (!request.hostname && !request.host) request.hostname = headers.Host || headers.host this.isCodeCommitGit = this.service === 'codecommit' && request.method === 'GIT' } RequestSigner.prototype.matchHost = function(host) { var match = (host || '').match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com(\.cn)?$/) var hostParts = (match || []).slice(1, 3) // ES's hostParts are sometimes the other way round, if the value that is expected // to be region equals ‘es’ switch them back // e.g. search-cluster-name-aaaa00aaaa0aaa0aaaaaaa0aaa.us-east-1.es.amazonaws.com if (hostParts[1] === 'es') hostParts = hostParts.reverse() return hostParts } // http://docs.aws.amazon.com/general/latest/gr/rande.html RequestSigner.prototype.isSingleRegion = function() { // Special case for S3 and SimpleDB in us-east-1 if (['s3', 'sdb'].indexOf(this.service) >= 0 && this.region === 'us-east-1') return true return ['cloudfront', 'ls', 'route53', 'iam', 'importexport', 'sts'] .indexOf(this.service) >= 0 } RequestSigner.prototype.createHost = function() { var region = this.isSingleRegion() ? '' : (this.service === 's3' && this.region !== 'us-east-1' ? '-' : '.') + this.region, service = this.service === 'ses' ? 'email' : this.service return service + region + '.amazonaws.com' } RequestSigner.prototype.prepareRequest = function() { this.parsePath() var request = this.request, headers = request.headers, query if (request.signQuery) { this.parsedPath.query = query = this.parsedPath.query || {} if (this.credentials.sessionToken) query['X-Amz-Security-Token'] = this.credentials.sessionToken if (this.service === 's3' && !query['X-Amz-Expires']) query['X-Amz-Expires'] = 86400 if (query['X-Amz-Date']) this.datetime = query['X-Amz-Date'] else query['X-Amz-Date'] = this.getDateTime() query['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256' query['X-Amz-Credential'] = this.credentials.accessKeyId + '/' + this.credentialString() query['X-Amz-SignedHeaders'] = this.signedHeaders() } else { if (!request.doNotModifyHeaders && !this.isCodeCommitGit) { if (request.body && !headers['Content-Type'] && !headers['content-type']) headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8' if (request.body && !headers['Content-Length'] && !headers['content-length']) headers['Content-Length'] = Buffer.byteLength(request.body) if (this.credentials.sessionToken && !headers['X-Amz-Security-Token'] && !headers['x-amz-security-token']) headers['X-Amz-Security-Token'] = this.credentials.sessionToken if (this.service === 's3' && !headers['X-Amz-Content-Sha256'] && !headers['x-amz-content-sha256']) headers['X-Amz-Content-Sha256'] = hash(this.request.body || '', 'hex') if (headers['X-Amz-Date'] || headers['x-amz-date']) this.datetime = headers['X-Amz-Date'] || headers['x-amz-date'] else headers['X-Amz-Date'] = this.getDateTime() } delete headers.Authorization delete headers.authorization } } RequestSigner.prototype.sign = function() { if (!this.parsedPath) this.prepareRequest() if (this.request.signQuery) { this.parsedPath.query['X-Amz-Signature'] = this.signature() } else { this.request.headers.Authorization = this.authHeader() } this.request.path = this.formatPath() return this.request } RequestSigner.prototype.getDateTime = function() { if (!this.datetime) { var headers = this.request.headers, date = new Date(headers.Date || headers.date || new Date) this.datetime = date.toISOString().replace(/[:\-]|\.\d{3}/g, '') // Remove the trailing 'Z' on the timestamp string for CodeCommit git access if (this.isCodeCommitGit) this.datetime = this.datetime.slice(0, -1) } return this.datetime } RequestSigner.prototype.getDate = function() { return this.getDateTime().substr(0, 8) } RequestSigner.prototype.authHeader = function() { return [ 'AWS4-HMAC-SHA256 Credential=' + this.credentials.accessKeyId + '/' + this.credentialString(), 'SignedHeaders=' + this.signedHeaders(), 'Signature=' + this.signature(), ].join(', ') } RequestSigner.prototype.signature = function() { var date = this.getDate(), cacheKey = [this.credentials.secretAccessKey, date, this.region, this.service].join(), kDate, kRegion, kService, kCredentials = credentialsCache.get(cacheKey) if (!kCredentials) { kDate = hmac('AWS4' + this.credentials.secretAccessKey, date) kRegion = hmac(kDate, this.region) kService = hmac(kRegion, this.service) kCredentials = hmac(kService, 'aws4_request') credentialsCache.set(cacheKey, kCredentials) } return hmac(kCredentials, this.stringToSign(), 'hex') } RequestSigner.prototype.stringToSign = function() { return [ 'AWS4-HMAC-SHA256', this.getDateTime(), this.credentialString(), hash(this.canonicalString(), 'hex'), ].join('\n') } RequestSigner.prototype.canonicalString = function() { if (!this.parsedPath) this.prepareRequest() var pathStr = this.parsedPath.path, query = this.parsedPath.query, headers = this.request.headers, queryStr = '', normalizePath = this.service !== 's3', decodePath = this.service === 's3' || this.request.doNotEncodePath, decodeSlashesInPath = this.service === 's3', firstValOnly = this.service === 's3', bodyHash if (this.service === 's3' && this.request.signQuery) { bodyHash = 'UNSIGNED-PAYLOAD' } else if (this.isCodeCommitGit) { bodyHash = '' } else { bodyHash = headers['X-Amz-Content-Sha256'] || headers['x-amz-content-sha256'] || hash(this.request.body || '', 'hex') } if (query) { queryStr = encodeRfc3986(querystring.stringify(Object.keys(query).sort().reduce(function(obj, key) { if (!key) return obj obj[key] = !Array.isArray(query[key]) ? query[key] : (firstValOnly ? query[key][0] : query[key].slice().sort()) return obj }, {}))) } if (pathStr !== '/') { if (normalizePath) pathStr = pathStr.replace(/\/{2,}/g, '/') pathStr = pathStr.split('/').reduce(function(path, piece) { if (normalizePath && piece === '..') { path.pop() } else if (!normalizePath || piece !== '.') { if (decodePath) piece = decodeURIComponent(piece) path.push(encodeRfc3986(encodeURIComponent(piece))) } return path }, []).join('/') if (pathStr[0] !== '/') pathStr = '/' + pathStr if (decodeSlashesInPath) pathStr = pathStr.replace(/%2F/g, '/') } return [ this.request.method || 'GET', pathStr, queryStr, this.canonicalHeaders() + '\n', this.signedHeaders(), bodyHash, ].join('\n') } RequestSigner.prototype.canonicalHeaders = function() { var headers = this.request.headers function trimAll(header) { return header.toString().trim().replace(/\s+/g, ' ') } return Object.keys(headers) .sort(function(a, b) { return a.toLowerCase() < b.toLowerCase() ? -1 : 1 }) .map(function(key) { return key.toLowerCase() + ':' + trimAll(headers[key]) }) .join('\n') } RequestSigner.prototype.signedHeaders = function() { return Object.keys(this.request.headers) .map(function(key) { return key.toLowerCase() }) .sort() .join(';') } RequestSigner.prototype.credentialString = function() { return [ this.getDate(), this.region, this.service, 'aws4_request', ].join('/') } RequestSigner.prototype.defaultCredentials = function() { var env = process.env return { accessKeyId: env.AWS_ACCESS_KEY_ID || env.AWS_ACCESS_KEY, secretAccessKey: env.AWS_SECRET_ACCESS_KEY || env.AWS_SECRET_KEY, sessionToken: env.AWS_SESSION_TOKEN, } } RequestSigner.prototype.parsePath = function() { var path = this.request.path || '/', queryIx = path.indexOf('?'), query = null if (queryIx >= 0) { query = querystring.parse(path.slice(queryIx + 1)) path = path.slice(0, queryIx) } // S3 doesn't always encode characters > 127 correctly and // all services don't encode characters > 255 correctly // So if there are non-reserved chars (and it's not already all % encoded), just encode them all if (/[^0-9A-Za-z!'()*\-._~%/]/.test(path)) { path = path.split('/').map(function(piece) { return encodeURIComponent(decodeURIComponent(piece)) }).join('/') } this.parsedPath = { path: path, query: query, } } RequestSigner.prototype.formatPath = function() { var path = this.parsedPath.path, query = this.parsedPath.query if (!query) return path // Services don't support empty query string keys if (query[''] != null) delete query[''] return path + '?' + encodeRfc3986(querystring.stringify(query)) } aws4.RequestSigner = RequestSigner aws4.sign = function(request, credentials) { return new RequestSigner(request, credentials).sign() } /***/ }), /* 104 */ /***/ (function(module, exports) { module.exports = require("querystring"); /***/ }), /* 105 */ /***/ (function(module, exports) { module.exports = function(size) { return new LruCache(size) } function LruCache(size) { this.capacity = size | 0 this.map = Object.create(null) this.list = new DoublyLinkedList() } LruCache.prototype.get = function(key) { var node = this.map[key] if (node == null) return undefined this.used(node) return node.val } LruCache.prototype.set = function(key, val) { var node = this.map[key] if (node != null) { node.val = val } else { if (!this.capacity) this.prune() if (!this.capacity) return false node = new DoublyLinkedNode(key, val) this.map[key] = node this.capacity-- } this.used(node) return true } LruCache.prototype.used = function(node) { this.list.moveToFront(node) } LruCache.prototype.prune = function() { var node = this.list.pop() if (node != null) { delete this.map[node.key] this.capacity++ } } function DoublyLinkedList() { this.firstNode = null this.lastNode = null } DoublyLinkedList.prototype.moveToFront = function(node) { if (this.firstNode == node) return this.remove(node) if (this.firstNode == null) { this.firstNode = node this.lastNode = node node.prev = null node.next = null } else { node.prev = null node.next = this.firstNode node.next.prev = node this.firstNode = node } } DoublyLinkedList.prototype.pop = function() { var lastNode = this.lastNode if (lastNode != null) { this.remove(lastNode) } return lastNode } DoublyLinkedList.prototype.remove = function(node) { if (this.firstNode == node) { this.firstNode = node.next } else if (node.prev != null) { node.prev.next = node.next } if (this.lastNode == node) { this.lastNode = node.prev } else if (node.next != null) { node.next.prev = node.prev } } function DoublyLinkedNode(key, val) { this.key = key this.val = val this.prev = null this.next = null } /***/ }), /* 106 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. var parser = __webpack_require__(107); var signer = __webpack_require__(149); var verify = __webpack_require__(156); var utils = __webpack_require__(110); ///--- API module.exports = { parse: parser.parseRequest, parseRequest: parser.parseRequest, sign: signer.signRequest, signRequest: signer.signRequest, createSigner: signer.createSigner, isSigner: signer.isSigner, sshKeyToPEM: utils.sshKeyToPEM, sshKeyFingerprint: utils.fingerprint, pemToRsaSSHKey: utils.pemToRsaSSHKey, verify: verify.verifySignature, verifySignature: verify.verifySignature, verifyHMAC: verify.verifyHMAC }; /***/ }), /* 107 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2012 Joyent, Inc. All rights reserved. var assert = __webpack_require__(108); var util = __webpack_require__(9); var utils = __webpack_require__(110); ///--- Globals var HASH_ALGOS = utils.HASH_ALGOS; var PK_ALGOS = utils.PK_ALGOS; var HttpSignatureError = utils.HttpSignatureError; var InvalidAlgorithmError = utils.InvalidAlgorithmError; var validateAlgorithm = utils.validateAlgorithm; var State = { New: 0, Params: 1 }; var ParamsState = { Name: 0, Quote: 1, Value: 2, Comma: 3 }; ///--- Specific Errors function ExpiredRequestError(message) { HttpSignatureError.call(this, message, ExpiredRequestError); } util.inherits(ExpiredRequestError, HttpSignatureError); function InvalidHeaderError(message) { HttpSignatureError.call(this, message, InvalidHeaderError); } util.inherits(InvalidHeaderError, HttpSignatureError); function InvalidParamsError(message) { HttpSignatureError.call(this, message, InvalidParamsError); } util.inherits(InvalidParamsError, HttpSignatureError); function MissingHeaderError(message) { HttpSignatureError.call(this, message, MissingHeaderError); } util.inherits(MissingHeaderError, HttpSignatureError); function StrictParsingError(message) { HttpSignatureError.call(this, message, StrictParsingError); } util.inherits(StrictParsingError, HttpSignatureError); ///--- Exported API module.exports = { /** * Parses the 'Authorization' header out of an http.ServerRequest object. * * Note that this API will fully validate the Authorization header, and throw * on any error. It will not however check the signature, or the keyId format * as those are specific to your environment. You can use the options object * to pass in extra constraints. * * As a response object you can expect this: * * { * "scheme": "Signature", * "params": { * "keyId": "foo", * "algorithm": "rsa-sha256", * "headers": [ * "date" or "x-date", * "digest" * ], * "signature": "base64" * }, * "signingString": "ready to be passed to crypto.verify()" * } * * @param {Object} request an http.ServerRequest. * @param {Object} options an optional options object with: * - clockSkew: allowed clock skew in seconds (default 300). * - headers: required header names (def: date or x-date) * - algorithms: algorithms to support (default: all). * - strict: should enforce latest spec parsing * (default: false). * @return {Object} parsed out object (see above). * @throws {TypeError} on invalid input. * @throws {InvalidHeaderError} on an invalid Authorization header error. * @throws {InvalidParamsError} if the params in the scheme are invalid. * @throws {MissingHeaderError} if the params indicate a header not present, * either in the request headers from the params, * or not in the params from a required header * in options. * @throws {StrictParsingError} if old attributes are used in strict parsing * mode. * @throws {ExpiredRequestError} if the value of date or x-date exceeds skew. */ parseRequest: function parseRequest(request, options) { assert.object(request, 'request'); assert.object(request.headers, 'request.headers'); if (options === undefined) { options = {}; } if (options.headers === undefined) { options.headers = [request.headers['x-date'] ? 'x-date' : 'date']; } assert.object(options, 'options'); assert.arrayOfString(options.headers, 'options.headers'); assert.optionalFinite(options.clockSkew, 'options.clockSkew'); var authzHeaderName = options.authorizationHeaderName || 'authorization'; if (!request.headers[authzHeaderName]) { throw new MissingHeaderError('no ' + authzHeaderName + ' header ' + 'present in the request'); } options.clockSkew = options.clockSkew || 300; var i = 0; var state = State.New; var substate = ParamsState.Name; var tmpName = ''; var tmpValue = ''; var parsed = { scheme: '', params: {}, signingString: '' }; var authz = request.headers[authzHeaderName]; for (i = 0; i < authz.length; i++) { var c = authz.charAt(i); switch (Number(state)) { case State.New: if (c !== ' ') parsed.scheme += c; else state = State.Params; break; case State.Params: switch (Number(substate)) { case ParamsState.Name: var code = c.charCodeAt(0); // restricted name of A-Z / a-z if ((code >= 0x41 && code <= 0x5a) || // A-Z (code >= 0x61 && code <= 0x7a)) { // a-z tmpName += c; } else if (c === '=') { if (tmpName.length === 0) throw new InvalidHeaderError('bad param format'); substate = ParamsState.Quote; } else { throw new InvalidHeaderError('bad param format'); } break; case ParamsState.Quote: if (c === '"') { tmpValue = ''; substate = ParamsState.Value; } else { throw new InvalidHeaderError('bad param format'); } break; case ParamsState.Value: if (c === '"') { parsed.params[tmpName] = tmpValue; substate = ParamsState.Comma; } else { tmpValue += c; } break; case ParamsState.Comma: if (c === ',') { tmpName = ''; substate = ParamsState.Name; } else { throw new InvalidHeaderError('bad param format'); } break; default: throw new Error('Invalid substate'); } break; default: throw new Error('Invalid substate'); } } if (!parsed.params.headers || parsed.params.headers === '') { if (request.headers['x-date']) { parsed.params.headers = ['x-date']; } else { parsed.params.headers = ['date']; } } else { parsed.params.headers = parsed.params.headers.split(' '); } // Minimally validate the parsed object if (!parsed.scheme || parsed.scheme !== 'Signature') throw new InvalidHeaderError('scheme was not "Signature"'); if (!parsed.params.keyId) throw new InvalidHeaderError('keyId was not specified'); if (!parsed.params.algorithm) throw new InvalidHeaderError('algorithm was not specified'); if (!parsed.params.signature) throw new InvalidHeaderError('signature was not specified'); // Check the algorithm against the official list parsed.params.algorithm = parsed.params.algorithm.toLowerCase(); try { validateAlgorithm(parsed.params.algorithm); } catch (e) { if (e instanceof InvalidAlgorithmError) throw (new InvalidParamsError(parsed.params.algorithm + ' is not ' + 'supported')); else throw (e); } // Build the signingString for (i = 0; i < parsed.params.headers.length; i++) { var h = parsed.params.headers[i].toLowerCase(); parsed.params.headers[i] = h; if (h === 'request-line') { if (!options.strict) { /* * We allow headers from the older spec drafts if strict parsing isn't * specified in options. */ parsed.signingString += request.method + ' ' + request.url + ' HTTP/' + request.httpVersion; } else { /* Strict parsing doesn't allow older draft headers. */ throw (new StrictParsingError('request-line is not a valid header ' + 'with strict parsing enabled.')); } } else if (h === '(request-target)') { parsed.signingString += '(request-target): ' + request.method.toLowerCase() + ' ' + request.url; } else { var value = request.headers[h]; if (value === undefined) throw new MissingHeaderError(h + ' was not in the request'); parsed.signingString += h + ': ' + value; } if ((i + 1) < parsed.params.headers.length) parsed.signingString += '\n'; } // Check against the constraints var date; if (request.headers.date || request.headers['x-date']) { if (request.headers['x-date']) { date = new Date(request.headers['x-date']); } else { date = new Date(request.headers.date); } var now = new Date(); var skew = Math.abs(now.getTime() - date.getTime()); if (skew > options.clockSkew * 1000) { throw new ExpiredRequestError('clock skew of ' + (skew / 1000) + 's was greater than ' + options.clockSkew + 's'); } } options.headers.forEach(function (hdr) { // Remember that we already checked any headers in the params // were in the request, so if this passes we're good. if (parsed.params.headers.indexOf(hdr.toLowerCase()) < 0) throw new MissingHeaderError(hdr + ' was not a signed header'); }); if (options.algorithms) { if (options.algorithms.indexOf(parsed.params.algorithm) === -1) throw new InvalidParamsError(parsed.params.algorithm + ' is not a supported algorithm'); } parsed.algorithm = parsed.params.algorithm.toUpperCase(); parsed.keyId = parsed.params.keyId; return parsed; } }; /***/ }), /* 108 */ /***/ (function(module, exports, __webpack_require__) { // Copyright (c) 2012, Mark Cavage. All rights reserved. // Copyright 2015 Joyent, Inc. var assert = __webpack_require__(109); var Stream = __webpack_require__(100).Stream; var util = __webpack_require__(9); ///--- Globals /* JSSTYLED */ var 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}$/; ///--- Internal 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: (actual === undefined) ? 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() { // Why even bother with asserts? } ///--- Exports var types = { bool: { check: function (arg) { return typeof (arg) === 'boolean'; } }, func: { check: function (arg) { return typeof (arg) === 'function'; } }, string: { check: function (arg) { return typeof (arg) === 'string'; } }, object: { check: function (arg) { return typeof (arg) === 'object' && arg !== null; } }, number: { check: function (arg) { return typeof (arg) === 'number' && !isNaN(arg); } }, finite: { check: function (arg) { return typeof (arg) === 'number' && !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 typeof (arg) === 'string' && UUID_REGEXP.test(arg); }, operator: 'isUUID' } }; function _setExports(ndebug) { var keys = Object.keys(types); var out; /* re-export standard assert */ if (process.env.NODE_NDEBUG) { out = noop; } else { out = function (arg, msg) { if (!arg) { _toss(msg, 'true', arg); } }; } /* standard checks */ keys.forEach(function (k) { if (ndebug) { out[k] = noop; return; } var type = types[k]; out[k] = function (arg, msg) { if (!type.check(arg)) { _toss(msg, k, type.operator, arg, type.actual); } }; }); /* optional checks */ keys.forEach(function (k) { var name = 'optional' + _capitalize(k); if (ndebug) { out[name] = noop; return; } var type = types[k]; out[name] = function (arg, msg) { if (arg === undefined || arg === null) { return; } if (!type.check(arg)) { _toss(msg, k, type.operator, arg, type.actual); } }; }); /* arrayOf checks */ keys.forEach(function (k) { var name = 'arrayOf' + _capitalize(k); if (ndebug) { out[name] = noop; return; } var type = types[k]; var expected = '[' + k + ']'; out[name] = function (arg, msg) { if (!Array.isArray(arg)) { _toss(msg, expected, type.operator, arg, type.actual); } var i; for (i = 0; i < arg.length; i++) { if (!type.check(arg[i])) { _toss(msg, expected, type.operator, arg, type.actual); } } }; }); /* optionalArrayOf checks */ keys.forEach(function (k) { var name = 'optionalArrayOf' + _capitalize(k); if (ndebug) { out[name] = noop; return; } var type = types[k]; var expected = '[' + k + ']'; out[name] = function (arg, msg) { if (arg === undefined || arg === null) { return; } if (!Array.isArray(arg)) { _toss(msg, expected, type.operator, arg, type.actual); } var i; for (i = 0; i < arg.length; i++) { if (!type.check(arg[i])) { _toss(msg, expected, type.operator, arg, type.actual); } } }; }); /* re-export built-in assertions */ Object.keys(assert).forEach(function (k) { if (k === 'AssertionError') { out[k] = assert[k]; return; } if (ndebug) { out[k] = noop; return; } out[k] = assert[k]; }); /* export ourselves (for unit tests _only_) */ out._setExports = _setExports; return out; } module.exports = _setExports(process.env.NODE_NDEBUG); /***/ }), /* 109 */ /***/ (function(module, exports) { module.exports = require("assert"); /***/ }), /* 110 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2012 Joyent, Inc. All rights reserved. var assert = __webpack_require__(108); var sshpk = __webpack_require__(111); var util = __webpack_require__(9); var HASH_ALGOS = { 'sha1': true, 'sha256': true, 'sha512': true }; var PK_ALGOS = { 'rsa': true, 'dsa': true, 'ecdsa': true }; function HttpSignatureError(message, caller) { if (Error.captureStackTrace) Error.captureStackTrace(this, caller || HttpSignatureError); this.message = message; this.name = caller.name; } util.inherits(HttpSignatureError, Error); function InvalidAlgorithmError(message) { HttpSignatureError.call(this, message, InvalidAlgorithmError); } util.inherits(InvalidAlgorithmError, HttpSignatureError); function validateAlgorithm(algorithm) { var alg = algorithm.toLowerCase().split('-'); if (alg.length !== 2) { throw (new InvalidAlgorithmError(alg[0].toUpperCase() + ' is not a ' + 'valid algorithm')); } if (alg[0] !== 'hmac' && !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); } ///--- API module.exports = { HASH_ALGOS: HASH_ALGOS, PK_ALGOS: PK_ALGOS, HttpSignatureError: HttpSignatureError, InvalidAlgorithmError: InvalidAlgorithmError, validateAlgorithm: validateAlgorithm, /** * Converts an OpenSSH public key (rsa only) to a PKCS#8 PEM file. * * The intent of this module is to interoperate with OpenSSL only, * specifically the node crypto module's `verify` method. * * @param {String} key an OpenSSH public key. * @return {String} PEM encoded form of the RSA public key. * @throws {TypeError} on bad input. * @throws {Error} on invalid ssh key formatted data. */ sshKeyToPEM: function sshKeyToPEM(key) { assert.string(key, 'ssh_key'); var k = sshpk.parseKey(key, 'ssh'); return (k.toString('pem')); }, /** * Generates an OpenSSH fingerprint from an ssh public key. * * @param {String} key an OpenSSH public key. * @return {String} key fingerprint. * @throws {TypeError} on bad input. * @throws {Error} if what you passed doesn't look like an ssh public key. */ fingerprint: function fingerprint(key) { assert.string(key, 'ssh_key'); var k = sshpk.parseKey(key, 'ssh'); return (k.fingerprint('md5').toString('hex')); }, /** * Converts a PKGCS#8 PEM file to an OpenSSH public key (rsa) * * The reverse of the above function. */ pemToRsaSSHKey: function pemToRsaSSHKey(pem, comment) { assert.equal('string', typeof (pem), 'typeof pem'); var k = sshpk.parseKey(pem, 'pem'); k.comment = comment; return (k.toString('ssh')); } }; /***/ }), /* 111 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. var Key = __webpack_require__(112); var Fingerprint = __webpack_require__(115); var Signature = __webpack_require__(118); var PrivateKey = __webpack_require__(117); var Certificate = __webpack_require__(144); var Identity = __webpack_require__(145); var errs = __webpack_require__(116); module.exports = { /* top-level classes */ Key: Key, parseKey: Key.parse, Fingerprint: Fingerprint, parseFingerprint: Fingerprint.parse, Signature: Signature, parseSignature: Signature.parse, PrivateKey: PrivateKey, parsePrivateKey: PrivateKey.parse, generatePrivateKey: PrivateKey.generate, Certificate: Certificate, parseCertificate: Certificate.parse, createSelfSignedCertificate: Certificate.createSelfSigned, createCertificate: Certificate.create, Identity: Identity, identityFromDN: Identity.parseDN, identityForHost: Identity.forHost, identityForUser: Identity.forUser, identityForEmail: Identity.forEmail, identityFromArray: Identity.fromArray, /* errors */ FingerprintFormatError: errs.FingerprintFormatError, InvalidAlgorithmError: errs.InvalidAlgorithmError, KeyParseError: errs.KeyParseError, SignatureParseError: errs.SignatureParseError, KeyEncryptedError: errs.KeyEncryptedError, CertificateParseError: errs.CertificateParseError }; /***/ }), /* 112 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2018 Joyent, Inc. module.exports = Key; var assert = __webpack_require__(108); var algs = __webpack_require__(113); var crypto = __webpack_require__(94); var Fingerprint = __webpack_require__(115); var Signature = __webpack_require__(118); var DiffieHellman = __webpack_require__(130).DiffieHellman; var errs = __webpack_require__(116); var utils = __webpack_require__(119); var PrivateKey = __webpack_require__(117); var edCompat; try { edCompat = __webpack_require__(133); } catch (e) { /* Just continue through, and bail out if we try to use it. */ } var InvalidAlgorithmError = errs.InvalidAlgorithmError; var KeyParseError = errs.KeyParseError; var formats = {}; formats['auto'] = __webpack_require__(134); formats['pem'] = __webpack_require__(135); formats['pkcs1'] = __webpack_require__(136); formats['pkcs8'] = __webpack_require__(137); formats['rfc4253'] = __webpack_require__(139); formats['ssh'] = __webpack_require__(141); formats['ssh-private'] = __webpack_require__(138); formats['openssh'] = formats['ssh-private']; formats['dnssec'] = __webpack_require__(142); formats['putty'] = __webpack_require__(143); formats['ppk'] = formats['putty']; 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 (typeof (algInfo) !== 'object') throw (new InvalidAlgorithmError(opts.type)); var partLookup = {}; for (var i = 0; i < opts.parts.length; ++i) { var part = opts.parts[i]; partLookup[part.name] = part; } this.type = opts.type; this.parts = opts.parts; this.part = partLookup; this.comment = undefined; this.source = opts.source; /* for speeding up hashing/fingerprint operations */ this._rfc4253Cache = opts._rfc4253Cache; this._hashCache = {}; var sz; this.curve = undefined; if (this.type === 'ecdsa') { var curve = this.part.curve.data.toString(); this.curve = curve; sz = algs.curves[curve].size; } else if (this.type === 'ed25519' || this.type === 'curve25519') { sz = 256; this.curve = 'curve25519'; } else { var szPart = this.part[algInfo.sizePart]; sz = szPart.data.length; sz = sz * 8 - utils.countZeros(szPart.data); } this.size = sz; } Key.formats = formats; Key.prototype.toBuffer = function (format, options) { if (format === undefined) format = 'ssh'; assert.string(format, 'format'); assert.object(formats[format], 'formats[format]'); assert.optionalObject(options, 'options'); if (format === 'rfc4253') { if (this._rfc4253Cache === undefined) this._rfc4253Cache = formats['rfc4253'].write(this); return (this._rfc4253Cache); } return (formats[format].write(this, options)); }; Key.prototype.toString = function (format, options) { return (this.toBuffer(format, options).toString()); }; Key.prototype.hash = function (algo, type) { assert.string(algo, 'algorithm'); assert.optionalString(type, 'type'); if (type === undefined) type = 'ssh'; algo = algo.toLowerCase(); if (algs.hashAlgs[algo] === undefined) throw (new InvalidAlgorithmError(algo)); var cacheKey = algo + '||' + type; if (this._hashCache[cacheKey]) return (this._hashCache[cacheKey]); var buf; if (type === 'ssh') { buf = this.toBuffer('rfc4253'); } else if (type === 'spki') { buf = formats.pkcs8.pkcs8ToBuffer(this); } else { throw (new Error('Hash type ' + type + ' not supported')); } var hash = crypto.createHash(algo).update(buf).digest(); this._hashCache[cacheKey] = hash; return (hash); }; Key.prototype.fingerprint = function (algo, type) { if (algo === undefined) algo = 'sha256'; if (type === undefined) 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'; if (this.type === 'rsa') hashAlgo = 'sha256'; if (this.type === 'dsa' && this.size > 1024) hashAlgo = 'sha256'; if (this.type === 'ed25519') hashAlgo = 'sha512'; if (this.type === 'ecdsa') { if (this.size <= 256) hashAlgo = 'sha256'; else if (this.size <= 384) hashAlgo = 'sha384'; else hashAlgo = 'sha512'; } return (hashAlgo); }; Key.prototype.createVerify = function (hashAlgo) { if (hashAlgo === undefined) hashAlgo = this.defaultHashAlgorithm(); assert.string(hashAlgo, 'hash algorithm'); /* ED25519 is not supported by OpenSSL, use a javascript impl. */ if (this.type === 'ed25519' && edCompat !== undefined) return (new edCompat.Verifier(this, hashAlgo)); if (this.type === 'curve25519') 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; } if (v === undefined || (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); var key = this.toBuffer('pkcs8'); var curve = this.curve; var self = this; v.verify = function (signature, fmt) { if (Signature.isSignature(signature, [2, 0])) { if (signature.type !== self.type) return (false); if (signature.hashAlgorithm && signature.hashAlgorithm !== hashAlgo) return (false); if (signature.curve && self.type === 'ecdsa' && signature.curve !== curve) return (false); return (oldVerify(key, signature.toBuffer('asn1'))); } else if (typeof (signature) === 'string' || Buffer.isBuffer(signature)) { return (oldVerify(key, signature, fmt)); /* * Avoid doing this on valid arguments, walking the prototype * chain can be quite slow. */ } else if (Signature.isSignature(signature, [1, 0])) { throw (new Error('signature was created by too old ' + 'a version of sshpk and cannot be verified')); } else { throw (new TypeError('signature must be a string, ' + 'Buffer, or Signature object')); } }; return (v); }; Key.prototype.createDiffieHellman = function () { if (this.type === 'rsa') 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) { if (typeof (data) !== 'string') assert.buffer(data, 'data'); if (format === undefined) format = 'auto'; assert.string(format, 'format'); if (typeof (options) === 'string') options = { filename: options }; assert.optionalObject(options, 'options'); if (options === undefined) options = {}; assert.optionalString(options.filename, 'options.filename'); if (options.filename === undefined) options.filename = '(unnamed)'; assert.object(formats[format], 'formats[format]'); try { var k = formats[format].read(data, options); if (k instanceof PrivateKey) k = k.toPublic(); if (!k.comment) k.comment = options.filename; return (k); } catch (e) { if (e.name === 'KeyEncryptedError') throw (e); throw (new KeyParseError(options.filename, format, e)); } }; Key.isKey = function (obj, ver) { return (utils.isCompatible(obj, Key, ver)); }; /* * API versions for Key: * [1,0] -- initial ver, may take Signature for createVerify or may not * [1,1] -- added pkcs1, pkcs8 formats * [1,2] -- added auto, ssh-private, openssh formats * [1,3] -- added defaultHashAlgorithm * [1,4] -- added ed support, createDH * [1,5] -- first explicitly tagged version * [1,6] -- changed ed25519 part names * [1,7] -- spki hash types */ Key.prototype._sshpkApiVersion = [1, 7]; Key._oldVersionDetect = function (obj) { assert.func(obj.toBuffer); assert.func(obj.fingerprint); if (obj.createDH) return ([1, 4]); if (obj.defaultHashAlgorithm) return ([1, 3]); if (obj.formats['auto']) return ([1, 2]); if (obj.formats['pkcs1']) return ([1, 1]); return ([1, 0]); }; /***/ }), /* 113 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. var Buffer = __webpack_require__(114).Buffer; var 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 hashAlgs = { 'md5': true, 'sha1': true, 'sha256': true, 'sha384': true, 'sha512': true }; /* * Taken from * http://csrc.nist.gov/groups/ST/toolkit/documents/dss/NISTReCur.pdf */ var curves = { 'nistp256': { size: 256, pkcs8oid: '1.2.840.10045.3.1.7', p: Buffer.from(('00' + 'ffffffff 00000001 00000000 00000000' + '00000000 ffffffff ffffffff ffffffff'). replace(/ /g, ''), 'hex'), a: Buffer.from(('00' + 'FFFFFFFF 00000001 00000000 00000000' + '00000000 FFFFFFFF FFFFFFFF FFFFFFFC'). replace(/ /g, ''), 'hex'), b: Buffer.from(( '5ac635d8 aa3a93e7 b3ebbd55 769886bc' + '651d06b0 cc53b0f6 3bce3c3e 27d2604b'). replace(/ /g, ''), 'hex'), s: Buffer.from(('00' + 'c49d3608 86e70493 6a6678e1 139d26b7' + '819f7e90'). replace(/ /g, ''), 'hex'), n: Buffer.from(('00' + 'ffffffff 00000000 ffffffff ffffffff' + 'bce6faad a7179e84 f3b9cac2 fc632551'). replace(/ /g, ''), 'hex'), G: Buffer.from(('04' + '6b17d1f2 e12c4247 f8bce6e5 63a440f2' + '77037d81 2deb33a0 f4a13945 d898c296' + '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16' + '2bce3357 6b315ece cbb64068 37bf51f5'). replace(/ /g, ''), 'hex') }, 'nistp384': { size: 384, pkcs8oid: '1.3.132.0.34', p: Buffer.from(('00' + 'ffffffff ffffffff ffffffff ffffffff' + 'ffffffff ffffffff ffffffff fffffffe' + 'ffffffff 00000000 00000000 ffffffff'). replace(/ /g, ''), 'hex'), a: Buffer.from(('00' + 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE' + 'FFFFFFFF 00000000 00000000 FFFFFFFC'). replace(/ /g, ''), 'hex'), b: Buffer.from(( 'b3312fa7 e23ee7e4 988e056b e3f82d19' + '181d9c6e fe814112 0314088f 5013875a' + 'c656398d 8a2ed19d 2a85c8ed d3ec2aef'). replace(/ /g, ''), 'hex'), s: Buffer.from(('00' + 'a335926a a319a27a 1d00896a 6773a482' + '7acdac73'). replace(/ /g, ''), 'hex'), n: Buffer.from(('00' + 'ffffffff ffffffff ffffffff ffffffff' + 'ffffffff ffffffff c7634d81 f4372ddf' + '581a0db2 48b0a77a ecec196a ccc52973'). replace(/ /g, ''), 'hex'), G: Buffer.from(('04' + 'aa87ca22 be8b0537 8eb1c71e f320ad74' + '6e1d3b62 8ba79b98 59f741e0 82542a38' + '5502f25d bf55296c 3a545e38 72760ab7' + '3617de4a 96262c6f 5d9e98bf 9292dc29' + 'f8f41dbd 289a147c e9da3113 b5f0b8c0' + '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f'). replace(/ /g, ''), 'hex') }, 'nistp521': { size: 521, pkcs8oid: '1.3.132.0.35', p: Buffer.from(( '01ffffff ffffffff ffffffff ffffffff' + 'ffffffff ffffffff ffffffff ffffffff' + 'ffffffff ffffffff ffffffff ffffffff' + 'ffffffff ffffffff ffffffff ffffffff' + 'ffff').replace(/ /g, ''), 'hex'), a: Buffer.from(('01FF' + 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC'). replace(/ /g, ''), 'hex'), b: Buffer.from(('51' + '953eb961 8e1c9a1f 929a21a0 b68540ee' + 'a2da725b 99b315f3 b8b48991 8ef109e1' + '56193951 ec7e937b 1652c0bd 3bb1bf07' + '3573df88 3d2c34f1 ef451fd4 6b503f00'). replace(/ /g, ''), 'hex'), s: Buffer.from(('00' + 'd09e8800 291cb853 96cc6717 393284aa' + 'a0da64ba').replace(/ /g, ''), 'hex'), n: Buffer.from(('01ff' + 'ffffffff ffffffff ffffffff ffffffff' + 'ffffffff ffffffff ffffffff fffffffa' + '51868783 bf2f966b 7fcc0148 f709a5d0' + '3bb5c9b8 899c47ae bb6fb71e 91386409'). replace(/ /g, ''), 'hex'), G: Buffer.from(('04' + '00c6 858e06b7 0404e9cd 9e3ecb66 2395b442' + '9c648139 053fb521 f828af60 6b4d3dba' + 'a14b5e77 efe75928 fe1dc127 a2ffa8de' + '3348b3c1 856a429b f97e7e31 c2e5bd66' + '0118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9' + '98f54449 579b4468 17afbd17 273e662c' + '97ee7299 5ef42640 c550b901 3fad0761' + '353c7086 a272c240 88be9476 9fd16650'). replace(/ /g, ''), 'hex') } }; module.exports = { info: algInfo, privInfo: algPrivInfo, hashAlgs: hashAlgs, curves: curves }; /***/ }), /* 114 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* eslint-disable node/no-deprecated-api */ var buffer = __webpack_require__(96) var Buffer = buffer.Buffer var safer = {} var key for (key in buffer) { if (!buffer.hasOwnProperty(key)) continue if (key === 'SlowBuffer' || key === 'Buffer') continue safer[key] = buffer[key] } var Safer = safer.Buffer = {} for (key in Buffer) { if (!Buffer.hasOwnProperty(key)) continue if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue Safer[key] = Buffer[key] } safer.Buffer.prototype = Buffer.prototype if (!Safer.from || Safer.from === Uint8Array.from) { Safer.from = function (value, encodingOrOffset, length) { if (typeof value === 'number') { throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value) } if (value && typeof value.length === 'undefined') { 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) } } if (!Safer.alloc) { Safer.alloc = function (size, fill, encoding) { if (typeof size !== 'number') { 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) if (!fill || fill.length === 0) { buf.fill(0) } else if (typeof encoding === 'string') { buf.fill(fill, encoding) } else { buf.fill(fill) } return buf } } if (!safer.kStringMaxLength) { try { safer.kStringMaxLength = process.binding('buffer').kStringMaxLength } catch (e) { // we can't determine kStringMaxLength in environments where process.binding // is unsupported, so let's not set it } } if (!safer.constants) { safer.constants = { MAX_LENGTH: safer.kMaxLength } if (safer.kStringMaxLength) { safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength } } module.exports = safer /***/ }), /* 115 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2018 Joyent, Inc. module.exports = Fingerprint; var assert = __webpack_require__(108); var Buffer = __webpack_require__(114).Buffer; var algs = __webpack_require__(113); var crypto = __webpack_require__(94); var errs = __webpack_require__(116); var Key = __webpack_require__(112); var PrivateKey = __webpack_require__(117); var Certificate = __webpack_require__(144); var utils = __webpack_require__(119); var FingerprintFormatError = errs.FingerprintFormatError; var InvalidAlgorithmError = errs.InvalidAlgorithmError; function Fingerprint(opts) { 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(); if (algs.hashAlgs[this.algorithm] !== true) throw (new InvalidAlgorithmError(this.algorithm)); this.hash = opts.hash; this.type = opts.type; this.hashType = opts.hashType; } Fingerprint.prototype.toString = function (format) { if (format === undefined) { if (this.algorithm === 'md5' || this.hashType === 'spki') format = 'hex'; else format = 'base64'; } assert.string(format); switch (format) { case 'hex': if (this.hashType === 'spki') return (this.hash.toString('hex')); return (addColons(this.hash.toString('hex'))); case 'base64': if (this.hashType === 'spki') return (this.hash.toString('base64')); return (sshBase64Format(this.algorithm, this.hash.toString('base64'))); default: throw (new FingerprintFormatError(undefined, format)); } }; Fingerprint.prototype.matches = function (other) { assert.object(other, 'key or certificate'); if (this.type === 'key' && this.hashType !== 'ssh') { utils.assertCompatible(other, Key, [1, 7], 'key with spki'); if (PrivateKey.isPrivateKey(other)) { utils.assertCompatible(other, PrivateKey, [1, 6], 'privatekey with spki support'); } } else if (this.type === 'key') { utils.assertCompatible(other, Key, [1, 0], 'key'); } else { utils.assertCompatible(other, Certificate, [1, 0], 'certificate'); } var theirHash = other.hash(this.algorithm, this.hashType); var theirHash2 = crypto.createHash(this.algorithm). update(theirHash).digest('base64'); if (this.hash2 === undefined) this.hash2 = crypto.createHash(this.algorithm). update(this.hash).digest('base64'); return (this.hash2 === theirHash2); }; /*JSSTYLED*/ var base64RE = /^[A-Za-z0-9+\/=]+$/; /*JSSTYLED*/ var hexRE = /^[a-fA-F0-9]+$/; Fingerprint.parse = function (fp, options) { assert.string(fp, 'fingerprint'); var alg, hash, enAlgs; if (Array.isArray(options)) { enAlgs = options; options = {}; } assert.optionalObject(options, 'options'); if (options === undefined) options = {}; if (options.enAlgs !== undefined) enAlgs = options.enAlgs; if (options.algorithms !== undefined) enAlgs = options.algorithms; assert.optionalArrayOfString(enAlgs, 'algorithms'); var hashType = 'ssh'; if (options.hashType !== undefined) hashType = options.hashType; assert.string(hashType, 'options.hashType'); var parts = fp.split(':'); if (parts.length == 2) { alg = parts[0].toLowerCase(); if (!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) { alg = 'md5'; if (parts[0].toLowerCase() === 'md5') parts = parts.slice(1); parts = parts.map(function (p) { while (p.length < 2) p = '0' + p; if (p.length > 2) throw (new FingerprintFormatError(fp)); return (p); }); parts = parts.join(''); if (!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)) { hash = Buffer.from(fp, 'base64'); } else { throw (new FingerprintFormatError(fp)); } 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)); } /* Plain hex/base64: guess it's probably SPKI unless told. */ if (options.hashType === undefined) hashType = 'spki'; } if (alg === undefined) throw (new FingerprintFormatError(fp)); if (algs.hashAlgs[alg] === undefined) throw (new InvalidAlgorithmError(alg)); if (enAlgs !== undefined) { enAlgs = enAlgs.map(function (a) { return a.toLowerCase(); }); if (enAlgs.indexOf(alg) === -1) throw (new InvalidAlgorithmError(alg)); } return (new Fingerprint({ algorithm: alg, hash: hash, type: options.type || 'key', hashType: hashType })); }; function addColons(s) { /*JSSTYLED*/ return (s.replace(/(.{2})(?=.)/g, '$1:')); } function base64Strip(s) { /*JSSTYLED*/ return (s.replace(/=*$/, '')); } function sshBase64Format(alg, h) { return (alg.toUpperCase() + ':' + base64Strip(h)); } Fingerprint.isFingerprint = function (obj, ver) { return (utils.isCompatible(obj, Fingerprint, ver)); }; /* * API versions for Fingerprint: * [1,0] -- initial ver * [1,1] -- first tagged ver * [1,2] -- hashType and spki support */ Fingerprint.prototype._sshpkApiVersion = [1, 2]; Fingerprint._oldVersionDetect = function (obj) { assert.func(obj.toString); assert.func(obj.matches); return ([1, 0]); }; /***/ }), /* 116 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. var assert = __webpack_require__(108); var util = __webpack_require__(9); function FingerprintFormatError(fp, format) { if (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: '; if (fp !== undefined) this.message += ' fingerprint = ' + fp; if (format !== undefined) this.message += ' format = ' + format; } util.inherits(FingerprintFormatError, Error); function InvalidAlgorithmError(alg) { if (Error.captureStackTrace) Error.captureStackTrace(this, InvalidAlgorithmError); this.name = 'InvalidAlgorithmError'; this.algorithm = alg; this.message = 'Algorithm "' + alg + '" is not supported'; } util.inherits(InvalidAlgorithmError, Error); function KeyParseError(name, format, innerErr) { if (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; } util.inherits(KeyParseError, Error); function SignatureParseError(type, format, innerErr) { if (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; } util.inherits(SignatureParseError, Error); function CertificateParseError(name, format, innerErr) { if (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; } util.inherits(CertificateParseError, Error); function KeyEncryptedError(name, format) { if (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(KeyEncryptedError, Error); module.exports = { FingerprintFormatError: FingerprintFormatError, InvalidAlgorithmError: InvalidAlgorithmError, KeyParseError: KeyParseError, SignatureParseError: SignatureParseError, KeyEncryptedError: KeyEncryptedError, CertificateParseError: CertificateParseError }; /***/ }), /* 117 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2017 Joyent, Inc. module.exports = PrivateKey; var assert = __webpack_require__(108); var Buffer = __webpack_require__(114).Buffer; var algs = __webpack_require__(113); var crypto = __webpack_require__(94); var Fingerprint = __webpack_require__(115); var Signature = __webpack_require__(118); var errs = __webpack_require__(116); var util = __webpack_require__(9); var utils = __webpack_require__(119); var dhe = __webpack_require__(130); var generateECDSA = dhe.generateECDSA; var generateED25519 = dhe.generateED25519; var edCompat = __webpack_require__(133); var nacl = __webpack_require__(128); var Key = __webpack_require__(112); var InvalidAlgorithmError = errs.InvalidAlgorithmError; var KeyParseError = errs.KeyParseError; var KeyEncryptedError = errs.KeyEncryptedError; var formats = {}; formats['auto'] = __webpack_require__(134); formats['pem'] = __webpack_require__(135); formats['pkcs1'] = __webpack_require__(136); formats['pkcs8'] = __webpack_require__(137); formats['rfc4253'] = __webpack_require__(139); formats['ssh-private'] = __webpack_require__(138); formats['openssh'] = formats['ssh-private']; formats['ssh'] = formats['ssh-private']; formats['dnssec'] = __webpack_require__(142); function PrivateKey(opts) { assert.object(opts, 'options'); Key.call(this, opts); this._pubCache = undefined; } util.inherits(PrivateKey, Key); PrivateKey.formats = formats; PrivateKey.prototype.toBuffer = function (format, options) { if (format === undefined) format = 'pkcs1'; assert.string(format, 'format'); assert.object(formats[format], 'formats[format]'); assert.optionalObject(options, 'options'); return (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); var algInfo = algs.info[this.type]; var pubParts = []; for (var i = 0; i < algInfo.parts.length; ++i) { var p = algInfo.parts[i]; pubParts.push(this.part[p]); } this._pubCache = new Key({ type: this.type, source: this, parts: pubParts }); if (this.comment) this._pubCache.comment = this.comment; return (this._pubCache); }; PrivateKey.prototype.derive = function (newType) { assert.string(newType, 'type'); var priv, pub, pair; if (this.type === 'ed25519' && newType === 'curve25519') { priv = this.part.k.data; if (priv[0] === 0x00) priv = priv.slice(1); pair = nacl.box.keyPair.fromSecretKey(new Uint8Array(priv)); pub = Buffer.from(pair.publicKey); return (new PrivateKey({ type: 'curve25519', parts: [ { name: 'A', data: utils.mpNormalize(pub) }, { name: 'k', data: utils.mpNormalize(priv) } ] })); } else if (this.type === 'curve25519' && newType === 'ed25519') { priv = this.part.k.data; if (priv[0] === 0x00) priv = priv.slice(1); pair = nacl.sign.keyPair.fromSeed(new Uint8Array(priv)); pub = Buffer.from(pair.publicKey); return (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 (hashAlgo === undefined) hashAlgo = this.defaultHashAlgorithm(); assert.string(hashAlgo, 'hash algorithm'); /* ED25519 is not supported by OpenSSL, use a javascript impl. */ if (this.type === 'ed25519' && edCompat !== undefined) return (new edCompat.Signer(this, hashAlgo)); if (this.type === 'curve25519') 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; } if (v === undefined || (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); var key = this.toBuffer('pkcs1'); var type = this.type; var curve = this.curve; v.sign = function () { var sig = oldSign(key); if (typeof (sig) === 'string') sig = Buffer.from(sig, 'binary'); sig = Signature.parse(sig, type, 'asn1'); sig.hashAlgorithm = hashAlgo; sig.curve = curve; return (sig); }; return (v); }; PrivateKey.parse = function (data, format, options) { if (typeof (data) !== 'string') assert.buffer(data, 'data'); if (format === undefined) format = 'auto'; assert.string(format, 'format'); if (typeof (options) === 'string') options = { filename: options }; assert.optionalObject(options, 'options'); if (options === undefined) options = {}; assert.optionalString(options.filename, 'options.filename'); if (options.filename === undefined) options.filename = '(unnamed)'; assert.object(formats[format], 'formats[format]'); try { var k = formats[format].read(data, options); assert.ok(k instanceof PrivateKey, 'key is not a private key'); if (!k.comment) k.comment = options.filename; return (k); } catch (e) { if (e.name === 'KeyEncryptedError') 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) { if (options === undefined) options = {}; assert.object(options, 'options'); switch (type) { case 'ecdsa': if (options.curve === undefined) options.curve = 'nistp256'; assert.string(options.curve, 'options.curve'); return (generateECDSA(options.curve)); case 'ed25519': return (generateED25519()); default: throw (new Error('Key generation not supported with key ' + 'type "' + type + '"')); } }; /* * API versions for PrivateKey: * [1,0] -- initial ver * [1,1] -- added auto, pkcs[18], openssh/ssh-private formats * [1,2] -- added defaultHashAlgorithm * [1,3] -- added derive, ed, createDH * [1,4] -- first tagged version * [1,5] -- changed ed25519 part names and format * [1,6] -- type arguments for hash() and fingerprint() */ PrivateKey.prototype._sshpkApiVersion = [1, 6]; PrivateKey._oldVersionDetect = function (obj) { assert.func(obj.toPublic); assert.func(obj.createSign); if (obj.derive) return ([1, 3]); if (obj.defaultHashAlgorithm) return ([1, 2]); if (obj.formats['auto']) return ([1, 1]); return ([1, 0]); }; /***/ }), /* 118 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. module.exports = Signature; var assert = __webpack_require__(108); var Buffer = __webpack_require__(114).Buffer; var algs = __webpack_require__(113); var crypto = __webpack_require__(94); var errs = __webpack_require__(116); var utils = __webpack_require__(119); var asn1 = __webpack_require__(120); var SSHBuffer = __webpack_require__(129); var InvalidAlgorithmError = errs.InvalidAlgorithmError; var SignatureParseError = errs.SignatureParseError; function Signature(opts) { assert.object(opts, 'options'); assert.arrayOfObject(opts.parts, 'options.parts'); assert.string(opts.type, 'options.type'); var partLookup = {}; for (var 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) { if (format === undefined) format = 'asn1'; assert.string(format, 'format'); var buf; 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 undefined: break; default: throw (new Error('SSH signature ' + 'format does not support hash ' + 'algorithm ' + this.hashAlgorithm)); } if (format === 'ssh') { buf = new SSHBuffer({}); buf.writeString(stype); buf.writePart(this.part.sig); return (buf.toBuffer()); } else { return (this.part.sig.data); } break; case 'ed25519': if (format === 'ssh') { buf = new SSHBuffer({}); buf.writeString(stype); buf.writePart(this.part.sig); return (buf.toBuffer()); } else { return (this.part.sig.data); } break; case 'dsa': case 'ecdsa': var r, s; if (format === 'asn1') { var der = new asn1.BerWriter(); 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(); return (der.buffer); } else if (format === 'ssh' && this.type === 'dsa') { buf = new SSHBuffer({}); buf.writeString('ssh-dss'); r = this.part.r.data; if (r.length > 20 && r[0] === 0x00) r = r.slice(1); s = this.part.s.data; if (s.length > 20 && s[0] === 0x00) s = s.slice(1); if ((this.hashAlgorithm && this.hashAlgorithm !== 'sha1') || r.length + s.length !== 40) { throw (new Error('OpenSSH only supports ' + 'DSA signatures with SHA1 hash')); } buf.writeBuffer(Buffer.concat([r, s])); return (buf.toBuffer()); } else if (format === 'ssh' && this.type === 'ecdsa') { var inner = new SSHBuffer({}); r = this.part.r.data; inner.writeBuffer(r); inner.writePart(this.part.s); buf = new SSHBuffer({}); /* XXX: find a more proper way to do this? */ var curve; if (r[0] === 0x00) r = r.slice(1); var sz = r.length * 8; if (sz === 256) curve = 'nistp256'; else if (sz === 384) curve = 'nistp384'; else if (sz === 528) curve = 'nistp521'; buf.writeString('ecdsa-sha2-' + curve); buf.writeBuffer(inner.toBuffer()); return (buf.toBuffer()); } throw (new Error('Invalid signature format')); default: throw (new Error('Invalid signature data')); } }; Signature.prototype.toString = function (format) { assert.optionalString(format, 'format'); return (this.toBuffer(format).toString('base64')); }; Signature.parse = function (data, type, format) { if (typeof (data) === 'string') 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 { assert.ok(data.length > 0, 'signature must not be empty'); switch (opts.type) { case 'rsa': return (parseOneNum(data, type, format, opts)); case 'ed25519': return (parseOneNum(data, type, format, opts)); case 'dsa': case 'ecdsa': if (format === 'asn1') return (parseDSAasn1(data, type, format, opts)); else if (opts.type === 'dsa') return (parseDSA(data, type, format, opts)); else return (parseECDSA(data, type, format, opts)); default: throw (new InvalidAlgorithmError(type)); } } catch (e) { if (e instanceof InvalidAlgorithmError) throw (e); throw (new SignatureParseError(type, format, e)); } }; function parseOneNum(data, type, format, opts) { if (format === 'ssh') { try { var buf = new SSHBuffer({buffer: data}); var head = buf.readString(); } catch (e) { /* fall through */ } if (buf !== undefined) { 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(); assert.ok(buf.atEnd(), 'extra trailing bytes'); sig.name = 'sig'; opts.parts.push(sig); return (new Signature(opts)); } } opts.parts.push({name: 'sig', data: data}); return (new Signature(opts)); } function parseDSAasn1(data, type, format, opts) { var der = new asn1.BerReader(data); der.readSequence(); var r = der.readString(asn1.Ber.Integer, true); var s = der.readString(asn1.Ber.Integer, true); opts.parts.push({name: 'r', data: utils.mpNormalize(r)}); opts.parts.push({name: 's', data: utils.mpNormalize(s)}); return (new Signature(opts)); } function parseDSA(data, type, format, opts) { if (data.length != 40) { var buf = new SSHBuffer({buffer: data}); var d = buf.readBuffer(); if (d.toString('ascii') === 'ssh-dss') d = buf.readBuffer(); assert.ok(buf.atEnd(), 'extra trailing bytes'); assert.strictEqual(d.length, 40, 'invalid inner length'); data = d; } opts.parts.push({name: 'r', data: data.slice(0, 20)}); opts.parts.push({name: 's', data: data.slice(20, 40)}); return (new Signature(opts)); } function parseECDSA(data, type, format, opts) { var buf = new SSHBuffer({buffer: data}); var r, s; var inner = buf.readBuffer(); var stype = inner.toString('ascii'); if (stype.slice(0, 6) === 'ecdsa-') { var parts = stype.split('-'); assert.strictEqual(parts[0], 'ecdsa'); assert.strictEqual(parts[1], 'sha2'); opts.curve = parts[2]; switch (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'); buf = new SSHBuffer({buffer: inner}); r = buf.readPart(); } else { r = {data: inner}; } s = buf.readPart(); assert.ok(buf.atEnd(), 'extra trailing bytes'); r.name = 'r'; s.name = 's'; opts.parts.push(r); opts.parts.push(s); return (new Signature(opts)); } Signature.isSignature = function (obj, ver) { return (utils.isCompatible(obj, Signature, ver)); }; /* * API versions for Signature: * [1,0] -- initial ver * [2,0] -- support for rsa in full ssh format, compat with sshpk-agent * hashAlgorithm property * [2,1] -- first tagged version */ Signature.prototype._sshpkApiVersion = [2, 1]; Signature._oldVersionDetect = function (obj) { assert.func(obj.toBuffer); if (obj.hasOwnProperty('hashAlgorithm')) return ([2, 0]); return ([1, 0]); }; /***/ }), /* 119 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. module.exports = { bufferSplit: bufferSplit, addRSAMissing: addRSAMissing, calculateDSAPublic: calculateDSAPublic, calculateED25519Public: calculateED25519Public, calculateX25519Public: calculateX25519Public, mpNormalize: mpNormalize, mpDenormalize: mpDenormalize, ecNormalize: ecNormalize, countZeros: countZeros, assertCompatible: assertCompatible, isCompatible: isCompatible, opensslKeyDeriv: opensslKeyDeriv, opensshCipherInfo: opensshCipherInfo, publicFromPrivateECDSA: publicFromPrivateECDSA, zeroPadToLength: zeroPadToLength, writeBitString: writeBitString, readBitString: readBitString, pbkdf2: pbkdf2 }; var assert = __webpack_require__(108); var Buffer = __webpack_require__(114).Buffer; var PrivateKey = __webpack_require__(117); var Key = __webpack_require__(112); var crypto = __webpack_require__(94); var algs = __webpack_require__(113); var asn1 = __webpack_require__(120); var ec = __webpack_require__(126); var jsbn = __webpack_require__(127).BigInteger; var nacl = __webpack_require__(128); var MAX_CLASS_DEPTH = 3; function isCompatible(obj, klass, needVer) { if (obj === null || typeof (obj) !== 'object') return (false); if (needVer === undefined) needVer = klass.prototype._sshpkApiVersion; if (obj instanceof klass && klass.prototype._sshpkApiVersion[0] == needVer[0]) return (true); var proto = Object.getPrototypeOf(obj); var depth = 0; while (proto.constructor.name !== klass.name) { proto = Object.getPrototypeOf(proto); if (!proto || ++depth > MAX_CLASS_DEPTH) return (false); } if (proto.constructor.name !== klass.name) return (false); var ver = proto._sshpkApiVersion; if (ver === undefined) ver = klass._oldVersionDetect(obj); if (ver[0] != needVer[0] || ver[1] < needVer[1]) return (false); return (true); } function assertCompatible(obj, klass, needVer, name) { if (name === undefined) name = 'object'; assert.ok(obj, name + ' must not be null'); assert.object(obj, name + ' must be an object'); if (needVer === undefined) needVer = klass.prototype._sshpkApiVersion; if (obj instanceof klass && klass.prototype._sshpkApiVersion[0] == needVer[0]) return; var proto = Object.getPrototypeOf(obj); var depth = 0; while (proto.constructor.name !== klass.name) { proto = Object.getPrototypeOf(proto); assert.ok(proto && ++depth <= MAX_CLASS_DEPTH, 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; if (ver === undefined) 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 } }; var PKCS5_SALT_LEN = 8; function opensslKeyDeriv(cipher, salt, passphrase, count) { assert.buffer(salt, 'salt'); assert.buffer(passphrase, 'passphrase'); assert.number(count, 'iteration count'); var clen = CIPHER_LEN[cipher]; assert.object(clen, 'supported cipher'); salt = salt.slice(0, PKCS5_SALT_LEN); var D, D_prev, bufs; var material = Buffer.alloc(0); while (material.length < clen.key + clen.iv) { bufs = []; if (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) }); } /* See: RFC2898 */ function pbkdf2(hashAlg, salt, iterations, size, passphrase) { var hkey = Buffer.alloc(salt.length + 4); salt.copy(hkey); var gen = 0, ts = []; var i = 1; while (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); var Ti = hmac.digest(); var Uc = Ti; var c = 1; while (c++ < iterations) { hmac = crypto.createHmac(hashAlg, passphrase); hmac.update(Uc); Uc = hmac.digest(); for (var x = 0; x < Ti.length; ++x) Ti[x] ^= Uc[x]; } return (Ti); } } /* Count leading zero bits on a buffer */ function countZeros(buf) { var o = 0, obit = 8; while (o < buf.length) { var mask = (1 << obit); if ((buf[o] & mask) === mask) break; obit--; if (obit < 0) { o++; obit = 8; } } return (o*8 + (8 - obit) - 1); } function bufferSplit(buf, chr) { assert.buffer(buf); assert.string(chr); var parts = []; var lastPart = 0; var matches = 0; for (var i = 0; i < buf.length; ++i) { if (buf[i] === chr.charCodeAt(matches)) ++matches; else if (buf[i] === chr.charCodeAt(0)) matches = 1; else matches = 0; if (matches >= chr.length) { var newPart = i + 1; parts.push(buf.slice(lastPart, newPart - matches)); lastPart = newPart; matches = 0; } } if (lastPart <= buf.length) parts.push(buf.slice(lastPart, buf.length)); return (parts); } function ecNormalize(buf, addZero) { assert.buffer(buf); if (buf[0] === 0x00 && buf[1] === 0x04) { if (addZero) return (buf); return (buf.slice(1)); } else if (buf[0] === 0x04) { if (!addZero) return (buf); } else { while (buf[0] === 0x00) buf = buf.slice(1); if (buf[0] === 0x02 || buf[0] === 0x03) throw (new Error('Compressed elliptic curve points ' + 'are not supported')); if (buf[0] !== 0x04) throw (new Error('Not a valid elliptic curve point')); if (!addZero) return (buf); } var b = Buffer.alloc(buf.length + 1); b[0] = 0x0; buf.copy(b, 1); return (b); } function readBitString(der, tag) { if (tag === undefined) tag = asn1.Ber.BitString; var buf = der.readString(tag, true); assert.strictEqual(buf[0], 0x00, 'bit strings with unused bits are ' + 'not supported (0x' + buf[0].toString(16) + ')'); return (buf.slice(1)); } function writeBitString(der, buf, tag) { if (tag === undefined) tag = asn1.Ber.BitString; var b = Buffer.alloc(buf.length + 1); b[0] = 0x00; buf.copy(b, 1); der.writeBuffer(b, tag); } function mpNormalize(buf) { assert.buffer(buf); while (buf.length > 1 && buf[0] === 0x00 && (buf[1] & 0x80) === 0x00) buf = buf.slice(1); if ((buf[0] & 0x80) === 0x80) { var b = Buffer.alloc(buf.length + 1); b[0] = 0x00; buf.copy(b, 1); buf = b; } return (buf); } function mpDenormalize(buf) { assert.buffer(buf); while (buf.length > 1 && buf[0] === 0x00) buf = buf.slice(1); return (buf); } function zeroPadToLength(buf, len) { assert.buffer(buf); assert.number(len); while (buf.length > len) { assert.equal(buf[0], 0x00); buf = buf.slice(1); } while (buf.length < len) { var b = Buffer.alloc(buf.length + 1); b[0] = 0x00; buf.copy(b, 1); buf = b; } return (buf); } function bigintToMpBuf(bigint) { var buf = Buffer.from(bigint.toByteArray()); buf = mpNormalize(buf); return (buf); } function calculateDSAPublic(g, p, x) { assert.buffer(g); assert.buffer(p); assert.buffer(x); g = new jsbn(g); p = new jsbn(p); x = new jsbn(x); var y = g.modPow(x, p); var ybuf = bigintToMpBuf(y); return (ybuf); } function calculateED25519Public(k) { assert.buffer(k); var kp = nacl.sign.keyPair.fromSeed(new Uint8Array(k)); return (Buffer.from(kp.publicKey)); } function calculateX25519Public(k) { assert.buffer(k); var kp = nacl.box.keyPair.fromSeed(new Uint8Array(k)); return (Buffer.from(kp.publicKey)); } function addRSAMissing(key) { assert.object(key); assertCompatible(key, PrivateKey, [1, 1]); var d = new jsbn(key.part.d.data); var buf; if (!key.part.dmodp) { var p = new jsbn(key.part.p.data); var dmodp = d.mod(p.subtract(1)); buf = bigintToMpBuf(dmodp); 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); var dmodq = d.mod(q.subtract(1)); buf = bigintToMpBuf(dmodq); key.part.dmodq = {name: 'dmodq', data: buf}; key.parts.push(key.part.dmodq); } } function publicFromPrivateECDSA(curveName, priv) { assert.string(curveName, 'curveName'); assert.buffer(priv); var params = algs.curves[curveName]; var p = new jsbn(params.p); var a = new jsbn(params.a); var b = new jsbn(params.b); var curve = new ec.ECCurveFp(p, a, b); var G = curve.decodePointHex(params.G.toString('hex')); var d = new jsbn(mpNormalize(priv)); var pub = G.multiply(d); pub = Buffer.from(curve.encodePointHex(pub), 'hex'); var parts = []; parts.push({name: 'curve', data: Buffer.from(curveName)}); parts.push({name: 'Q', data: pub}); var key = new Key({type: 'ecdsa', curve: curve, parts: parts}); return (key); } function opensshCipherInfo(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 'aes128-gcm@openssh.com': inf.keySize = 16; inf.blockSize = 16; inf.opensslName = 'aes-128-' + cipher.slice(7, 10); break; case 'aes192-cbc': case 'aes192-ctr': case 'aes192-gcm@openssh.com': inf.keySize = 24; inf.blockSize = 16; inf.opensslName = 'aes-192-' + cipher.slice(7, 10); break; case 'aes256-cbc': case 'aes256-ctr': case 'aes256-gcm@openssh.com': 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); } /***/ }), /* 120 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved. // If you have no idea what ASN.1 or BER is, see this: // ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc var Ber = __webpack_require__(121); // --- Exported API module.exports = { Ber: Ber, BerReader: Ber.Reader, BerWriter: Ber.Writer }; /***/ }), /* 121 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved. var errors = __webpack_require__(122); var types = __webpack_require__(123); var Reader = __webpack_require__(124); var Writer = __webpack_require__(125); // --- Exports module.exports = { Reader: Reader, Writer: Writer }; for (var t in types) { if (types.hasOwnProperty(t)) module.exports[t] = types[t]; } for (var e in errors) { if (errors.hasOwnProperty(e)) module.exports[e] = errors[e]; } /***/ }), /* 122 */ /***/ (function(module, exports) { // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved. module.exports = { newInvalidAsn1Error: function (msg) { var e = new Error(); e.name = 'InvalidAsn1Error'; e.message = msg || ''; return e; } }; /***/ }), /* 123 */ /***/ (function(module, exports) { // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved. module.exports = { EOC: 0, Boolean: 1, Integer: 2, BitString: 3, OctetString: 4, Null: 5, OID: 6, ObjectDescriptor: 7, External: 8, Real: 9, // float Enumeration: 10, PDV: 11, Utf8String: 12, RelativeOID: 13, Sequence: 16, Set: 17, NumericString: 18, PrintableString: 19, T61String: 20, VideotexString: 21, IA5String: 22, UTCTime: 23, GeneralizedTime: 24, GraphicString: 25, VisibleString: 26, GeneralString: 28, UniversalString: 29, CharacterString: 30, BMPString: 31, Constructor: 32, Context: 128 }; /***/ }), /* 124 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved. var assert = __webpack_require__(109); var Buffer = __webpack_require__(114).Buffer; var ASN1 = __webpack_require__(123); var errors = __webpack_require__(122); // --- Globals var newInvalidAsn1Error = errors.newInvalidAsn1Error; // --- API function Reader(data) { if (!data || !Buffer.isBuffer(data)) throw new TypeError('data must be a node Buffer'); this._buf = data; this._size = data.length; // These hold the "current" state this._len = 0; this._offset = 0; } Object.defineProperty(Reader.prototype, 'length', { enumerable: true, get: function () { return (this._len); } }); Object.defineProperty(Reader.prototype, 'offset', { enumerable: true, get: function () { return (this._offset); } }); Object.defineProperty(Reader.prototype, 'remain', { get: function () { return (this._size - this._offset); } }); Object.defineProperty(Reader.prototype, 'buffer', { get: function () { return (this._buf.slice(this._offset)); } }); /** * Reads a single byte and advances offset; you can pass in `true` to make this * a "peek" operation (i.e., get the byte, but don't advance the offset). * * @param {Boolean} peek true means don't move offset. * @return {Number} the next byte, null if not enough data. */ Reader.prototype.readByte = function (peek) { if (this._size - this._offset < 1) return null; var b = this._buf[this._offset] & 0xff; if (!peek) this._offset += 1; return b; }; Reader.prototype.peek = function () { return this.readByte(true); }; /** * Reads a (potentially) variable length off the BER buffer. This call is * not really meant to be called directly, as callers have to manipulate * the internal buffer afterwards. * * As a result of this call, you can call `Reader.length`, until the * next thing called that does a readLength. * * @return {Number} the amount of offset to advance the buffer. * @throws {InvalidAsn1Error} on bad ASN.1 */ Reader.prototype.readLength = function (offset) { if (offset === undefined) offset = this._offset; if (offset >= this._size) return null; var lenB = this._buf[offset++] & 0xff; if (lenB === null) return null; if ((lenB & 0x80) === 0x80) { lenB &= 0x7f; if (lenB === 0) throw newInvalidAsn1Error('Indefinite length not supported'); if (lenB > 4) throw newInvalidAsn1Error('encoding too long'); if (this._size - offset < lenB) return null; this._len = 0; for (var i = 0; i < lenB; i++) this._len = (this._len << 8) + (this._buf[offset++] & 0xff); } else { // Wasn't a variable length this._len = lenB; } return offset; }; /** * Parses the next sequence in this BER buffer. * * To get the length of the sequence, call `Reader.length`. * * @return {Number} the sequence's tag. */ Reader.prototype.readSequence = function (tag) { var seq = this.peek(); if (seq === null) return null; if (tag !== undefined && tag !== seq) throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + ': got 0x' + seq.toString(16)); var o = this.readLength(this._offset + 1); // stored in `length` if (o === null) return null; this._offset = o; return seq; }; Reader.prototype.readInt = function () { return this._readTag(ASN1.Integer); }; Reader.prototype.readBoolean = function () { return (this._readTag(ASN1.Boolean) === 0 ? false : true); }; Reader.prototype.readEnumeration = function () { return this._readTag(ASN1.Enumeration); }; Reader.prototype.readString = function (tag, retbuf) { if (!tag) tag = ASN1.OctetString; var b = this.peek(); if (b === null) return null; if (b !== tag) throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + ': got 0x' + b.toString(16)); var o = this.readLength(this._offset + 1); // stored in `length` if (o === null) return null; if (this.length > this._size - o) return null; this._offset = o; if (this.length === 0) return retbuf ? Buffer.alloc(0) : ''; var str = this._buf.slice(this._offset, this._offset + this.length); this._offset += this.length; return retbuf ? str : str.toString('utf8'); }; Reader.prototype.readOID = function (tag) { if (!tag) tag = ASN1.OID; var b = this.readString(tag, true); if (b === null) return null; var values = []; var value = 0; for (var i = 0; i < b.length; i++) { var byte = b[i] & 0xff; value <<= 7; value += byte & 0x7f; if ((byte & 0x80) === 0) { values.push(value); value = 0; } } value = values.shift(); values.unshift(value % 40); values.unshift((value / 40) >> 0); return values.join('.'); }; Reader.prototype._readTag = function (tag) { assert.ok(tag !== undefined); var b = this.peek(); if (b === null) return null; if (b !== tag) throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + ': got 0x' + b.toString(16)); var o = this.readLength(this._offset + 1); // stored in `length` if (o === null) return null; if (this.length > 4) throw newInvalidAsn1Error('Integer too long: ' + this.length); if (this.length > this._size - o) return null; this._offset = o; var fb = this._buf[this._offset]; var value = 0; for (var i = 0; i < this.length; i++) { value <<= 8; value |= (this._buf[this._offset++] & 0xff); } if ((fb & 0x80) === 0x80 && i !== 4) value -= (1 << (i * 8)); return value >> 0; }; // --- Exported API module.exports = Reader; /***/ }), /* 125 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved. var assert = __webpack_require__(109); var Buffer = __webpack_require__(114).Buffer; var ASN1 = __webpack_require__(123); var errors = __webpack_require__(122); // --- Globals var newInvalidAsn1Error = errors.newInvalidAsn1Error; var DEFAULT_OPTS = { size: 1024, growthFactor: 8 }; // --- Helpers function merge(from, to) { assert.ok(from); assert.equal(typeof (from), 'object'); assert.ok(to); assert.equal(typeof (to), 'object'); var keys = Object.getOwnPropertyNames(from); keys.forEach(function (key) { if (to[key]) return; var value = Object.getOwnPropertyDescriptor(from, key); Object.defineProperty(to, key, value); }); return to; } // --- API function Writer(options) { options = merge(DEFAULT_OPTS, options || {}); this._buf = Buffer.alloc(options.size || 1024); this._size = this._buf.length; this._offset = 0; this._options = options; // A list of offsets in the buffer where we need to insert // sequence tag/len pairs. this._seq = []; } Object.defineProperty(Writer.prototype, 'buffer', { get: function () { if (this._seq.length) throw newInvalidAsn1Error(this._seq.length + ' unended sequence(s)'); return (this._buf.slice(0, this._offset)); } }); Writer.prototype.writeByte = function (b) { if (typeof (b) !== 'number') throw new TypeError('argument must be a Number'); this._ensure(1); this._buf[this._offset++] = b; }; Writer.prototype.writeInt = function (i, tag) { if (typeof (i) !== 'number') throw new TypeError('argument must be a Number'); if (typeof (tag) !== 'number') tag = ASN1.Integer; var sz = 4; while ((((i & 0xff800000) === 0) || ((i & 0xff800000) === 0xff800000 >> 0)) && (sz > 1)) { sz--; i <<= 8; } if (sz > 4) throw newInvalidAsn1Error('BER ints cannot be > 0xffffffff'); this._ensure(2 + sz); this._buf[this._offset++] = tag; this._buf[this._offset++] = sz; while (sz-- > 0) { this._buf[this._offset++] = ((i & 0xff000000) >>> 24); i <<= 8; } }; Writer.prototype.writeNull = function () { this.writeByte(ASN1.Null); this.writeByte(0x00); }; Writer.prototype.writeEnumeration = function (i, tag) { if (typeof (i) !== 'number') throw new TypeError('argument must be a Number'); if (typeof (tag) !== 'number') tag = ASN1.Enumeration; return this.writeInt(i, tag); }; Writer.prototype.writeBoolean = function (b, tag) { if (typeof (b) !== 'boolean') throw new TypeError('argument must be a Boolean'); if (typeof (tag) !== 'number') tag = ASN1.Boolean; this._ensure(3); this._buf[this._offset++] = tag; this._buf[this._offset++] = 0x01; this._buf[this._offset++] = b ? 0xff : 0x00; }; Writer.prototype.writeString = function (s, tag) { if (typeof (s) !== 'string') throw new TypeError('argument must be a string (was: ' + typeof (s) + ')'); if (typeof (tag) !== 'number') tag = ASN1.OctetString; var len = Buffer.byteLength(s); this.writeByte(tag); this.writeLength(len); if (len) { this._ensure(len); this._buf.write(s, this._offset); this._offset += len; } }; Writer.prototype.writeBuffer = function (buf, tag) { if (typeof (tag) !== 'number') throw new TypeError('tag must be a number'); if (!Buffer.isBuffer(buf)) throw new TypeError('argument must be a buffer'); this.writeByte(tag); this.writeLength(buf.length); this._ensure(buf.length); buf.copy(this._buf, this._offset, 0, buf.length); this._offset += buf.length; }; Writer.prototype.writeStringArray = function (strings) { if ((!strings instanceof Array)) throw new TypeError('argument must be an Array[String]'); var self = this; strings.forEach(function (s) { self.writeString(s); }); }; // This is really to solve DER cases, but whatever for now Writer.prototype.writeOID = function (s, tag) { if (typeof (s) !== 'string') throw new TypeError('argument must be a string'); if (typeof (tag) !== 'number') tag = ASN1.OID; if (!/^([0-9]+\.){3,}[0-9]+$/.test(s)) throw new Error('argument is not a valid OID string'); function encodeOctet(bytes, octet) { if (octet < 128) { bytes.push(octet); } else if (octet < 16384) { bytes.push((octet >>> 7) | 0x80); bytes.push(octet & 0x7F); } else if (octet < 2097152) { bytes.push((octet >>> 14) | 0x80); bytes.push(((octet >>> 7) | 0x80) & 0xFF); bytes.push(octet & 0x7F); } else if (octet < 268435456) { bytes.push((octet >>> 21) | 0x80); bytes.push(((octet >>> 14) | 0x80) & 0xFF); bytes.push(((octet >>> 7) | 0x80) & 0xFF); bytes.push(octet & 0x7F); } else { bytes.push(((octet >>> 28) | 0x80) & 0xFF); bytes.push(((octet >>> 21) | 0x80) & 0xFF); bytes.push(((octet >>> 14) | 0x80) & 0xFF); bytes.push(((octet >>> 7) | 0x80) & 0xFF); bytes.push(octet & 0x7F); } } var tmp = s.split('.'); var bytes = []; bytes.push(parseInt(tmp[0], 10) * 40 + parseInt(tmp[1], 10)); tmp.slice(2).forEach(function (b) { encodeOctet(bytes, parseInt(b, 10)); }); var self = this; this._ensure(2 + bytes.length); this.writeByte(tag); this.writeLength(bytes.length); bytes.forEach(function (b) { self.writeByte(b); }); }; Writer.prototype.writeLength = function (len) { if (typeof (len) !== 'number') throw new TypeError('argument must be a Number'); this._ensure(4); if (len <= 0x7f) { this._buf[this._offset++] = len; } else if (len <= 0xff) { this._buf[this._offset++] = 0x81; this._buf[this._offset++] = len; } else if (len <= 0xffff) { this._buf[this._offset++] = 0x82; this._buf[this._offset++] = len >> 8; this._buf[this._offset++] = len; } else if (len <= 0xffffff) { this._buf[this._offset++] = 0x83; this._buf[this._offset++] = len >> 16; this._buf[this._offset++] = len >> 8; this._buf[this._offset++] = len; } else { throw newInvalidAsn1Error('Length too long (> 4 bytes)'); } }; Writer.prototype.startSequence = function (tag) { if (typeof (tag) !== 'number') tag = ASN1.Sequence | ASN1.Constructor; this.writeByte(tag); this._seq.push(this._offset); this._ensure(3); this._offset += 3; }; Writer.prototype.endSequence = function () { var seq = this._seq.pop(); var start = seq + 3; var len = this._offset - start; if (len <= 0x7f) { this._shift(start, len, -2); this._buf[seq] = len; } else if (len <= 0xff) { this._shift(start, len, -1); this._buf[seq] = 0x81; this._buf[seq + 1] = len; } else if (len <= 0xffff) { this._buf[seq] = 0x82; this._buf[seq + 1] = len >> 8; this._buf[seq + 2] = len; } else if (len <= 0xffffff) { this._shift(start, len, 1); this._buf[seq] = 0x83; this._buf[seq + 1] = len >> 16; this._buf[seq + 2] = len >> 8; this._buf[seq + 3] = len; } else { throw newInvalidAsn1Error('Sequence too long'); } }; Writer.prototype._shift = function (start, len, shift) { assert.ok(start !== undefined); assert.ok(len !== undefined); assert.ok(shift); this._buf.copy(this._buf, start + shift, start, start + len); this._offset += shift; }; Writer.prototype._ensure = function (len) { assert.ok(len); if (this._size - this._offset < len) { var sz = this._size * this._options.growthFactor; if (sz - this._offset < len) sz += len; var buf = Buffer.alloc(sz); this._buf.copy(buf, 0, 0, this._offset); this._buf = buf; this._size = sz; } }; // --- Exported API module.exports = Writer; /***/ }), /* 126 */ /***/ (function(module, exports, __webpack_require__) { // Basic Javascript Elliptic Curve implementation // Ported loosely from BouncyCastle's Java EC code // Only Fp curves implemented for now // Requires jsbn.js and jsbn2.js var BigInteger = __webpack_require__(127).BigInteger var Barrett = BigInteger.prototype.Barrett // ---------------- // ECFieldElementFp // constructor function ECFieldElementFp(q,x) { this.x = x; // TODO if(x.compareTo(q) >= 0) error this.q = q; } function feFpEquals(other) { if(other == this) return true; return (this.q.equals(other.q) && this.x.equals(other.x)); } function feFpToBigInteger() { return this.x; } function feFpNegate() { return new ECFieldElementFp(this.q, this.x.negate().mod(this.q)); } function feFpAdd(b) { return new ECFieldElementFp(this.q, this.x.add(b.toBigInteger()).mod(this.q)); } function feFpSubtract(b) { return new ECFieldElementFp(this.q, this.x.subtract(b.toBigInteger()).mod(this.q)); } function feFpMultiply(b) { return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger()).mod(this.q)); } function feFpSquare() { return new ECFieldElementFp(this.q, this.x.square().mod(this.q)); } function feFpDivide(b) { return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger().modInverse(this.q)).mod(this.q)); } ECFieldElementFp.prototype.equals = feFpEquals; ECFieldElementFp.prototype.toBigInteger = feFpToBigInteger; ECFieldElementFp.prototype.negate = feFpNegate; ECFieldElementFp.prototype.add = feFpAdd; ECFieldElementFp.prototype.subtract = feFpSubtract; ECFieldElementFp.prototype.multiply = feFpMultiply; ECFieldElementFp.prototype.square = feFpSquare; ECFieldElementFp.prototype.divide = feFpDivide; // ---------------- // ECPointFp // constructor function ECPointFp(curve,x,y,z) { this.curve = curve; this.x = x; this.y = y; // Projective coordinates: either zinv == null or z * zinv == 1 // z and zinv are just BigIntegers, not fieldElements if(z == null) { this.z = BigInteger.ONE; } else { this.z = z; } this.zinv = null; //TODO: compression flag } function pointFpGetX() { if(this.zinv == null) { this.zinv = this.z.modInverse(this.curve.q); } var r = this.x.toBigInteger().multiply(this.zinv); this.curve.reduce(r); return this.curve.fromBigInteger(r); } function pointFpGetY() { if(this.zinv == null) { this.zinv = this.z.modInverse(this.curve.q); } var r = this.y.toBigInteger().multiply(this.zinv); this.curve.reduce(r); return this.curve.fromBigInteger(r); } function pointFpEquals(other) { if(other == this) return true; if(this.isInfinity()) return other.isInfinity(); if(other.isInfinity()) return this.isInfinity(); var u, v; // u = Y2 * Z1 - Y1 * Z2 u = other.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(other.z)).mod(this.curve.q); if(!u.equals(BigInteger.ZERO)) return false; // v = X2 * Z1 - X1 * Z2 v = other.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(other.z)).mod(this.curve.q); return v.equals(BigInteger.ZERO); } function pointFpIsInfinity() { if((this.x == null) && (this.y == null)) return true; return this.z.equals(BigInteger.ZERO) && !this.y.toBigInteger().equals(BigInteger.ZERO); } function pointFpNegate() { return new ECPointFp(this.curve, this.x, this.y.negate(), this.z); } function pointFpAdd(b) { if(this.isInfinity()) return b; if(b.isInfinity()) return this; // u = Y2 * Z1 - Y1 * Z2 var u = b.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(b.z)).mod(this.curve.q); // v = X2 * Z1 - X1 * Z2 var v = b.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(b.z)).mod(this.curve.q); if(BigInteger.ZERO.equals(v)) { if(BigInteger.ZERO.equals(u)) { return this.twice(); // this == b, so double } return this.curve.getInfinity(); // this = -b, so infinity } var THREE = new BigInteger("3"); var x1 = this.x.toBigInteger(); var y1 = this.y.toBigInteger(); var x2 = b.x.toBigInteger(); var y2 = b.y.toBigInteger(); var v2 = v.square(); var v3 = v2.multiply(v); var x1v2 = x1.multiply(v2); var zu2 = u.square().multiply(this.z); // x3 = v * (z2 * (z1 * u^2 - 2 * x1 * v^2) - v^3) var x3 = zu2.subtract(x1v2.shiftLeft(1)).multiply(b.z).subtract(v3).multiply(v).mod(this.curve.q); // y3 = z2 * (3 * x1 * u * v^2 - y1 * v^3 - z1 * u^3) + u * v^3 var 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 = v^3 * z1 * z2 var 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); } function pointFpTwice() { if(this.isInfinity()) return this; if(this.y.toBigInteger().signum() == 0) return this.curve.getInfinity(); // TODO: optimized handling of constants var THREE = new BigInteger("3"); var x1 = this.x.toBigInteger(); var y1 = this.y.toBigInteger(); var y1z1 = y1.multiply(this.z); var y1sqz1 = y1z1.multiply(y1).mod(this.curve.q); var a = this.curve.a.toBigInteger(); // w = 3 * x1^2 + a * z1^2 var w = x1.square().multiply(THREE); if(!BigInteger.ZERO.equals(a)) { w = w.add(this.z.square().multiply(a)); } w = w.mod(this.curve.q); //this.curve.reduce(w); // x3 = 2 * y1 * z1 * (w^2 - 8 * x1 * y1^2 * z1) var x3 = w.square().subtract(x1.shiftLeft(3).multiply(y1sqz1)).shiftLeft(1).multiply(y1z1).mod(this.curve.q); // y3 = 4 * y1^2 * z1 * (3 * w * x1 - 2 * y1^2 * z1) - w^3 var y3 = w.multiply(THREE).multiply(x1).subtract(y1sqz1.shiftLeft(1)).shiftLeft(2).multiply(y1sqz1).subtract(w.square().multiply(w)).mod(this.curve.q); // z3 = 8 * (y1 * z1)^3 var 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); } // Simple NAF (Non-Adjacent Form) multiplication algorithm // TODO: modularize the multiplication algorithm function pointFpMultiply(k) { if(this.isInfinity()) return this; if(k.signum() == 0) return this.curve.getInfinity(); var e = k; var h = e.multiply(new BigInteger("3")); var neg = this.negate(); var R = this; var i; for(i = h.bitLength() - 2; i > 0; --i) { R = R.twice(); var hBit = h.testBit(i); var eBit = e.testBit(i); if (hBit != eBit) { R = R.add(hBit ? this : neg); } } return R; } // Compute this*j + x*k (simultaneous multiplication) function pointFpMultiplyTwo(j,x,k) { var i; if(j.bitLength() > k.bitLength()) i = j.bitLength() - 1; else i = k.bitLength() - 1; var R = this.curve.getInfinity(); var both = this.add(x); while(i >= 0) { R = R.twice(); if(j.testBit(i)) { if(k.testBit(i)) { R = R.add(both); } else { R = R.add(this); } } else { if(k.testBit(i)) { R = R.add(x); } } --i; } return R; } ECPointFp.prototype.getX = pointFpGetX; ECPointFp.prototype.getY = pointFpGetY; ECPointFp.prototype.equals = pointFpEquals; ECPointFp.prototype.isInfinity = pointFpIsInfinity; ECPointFp.prototype.negate = pointFpNegate; ECPointFp.prototype.add = pointFpAdd; ECPointFp.prototype.twice = pointFpTwice; ECPointFp.prototype.multiply = pointFpMultiply; ECPointFp.prototype.multiplyTwo = pointFpMultiplyTwo; // ---------------- // ECCurveFp // constructor 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); } function curveFpGetQ() { return this.q; } function curveFpGetA() { return this.a; } function curveFpGetB() { return this.b; } function curveFpEquals(other) { if(other == this) return true; return(this.q.equals(other.q) && this.a.equals(other.a) && this.b.equals(other.b)); } function curveFpGetInfinity() { return this.infinity; } function curveFpFromBigInteger(x) { return new ECFieldElementFp(this.q, x); } function curveReduce(x) { this.reducer.reduce(x); } // for now, work with hex strings because they're easier in JS function curveFpDecodePointHex(s) { switch(parseInt(s.substr(0,2), 16)) { // first byte case 0: return this.infinity; case 2: case 3: // point compression not supported yet return null; case 4: case 6: case 7: var len = (s.length - 2) / 2; var 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: // unsupported return null; } } function curveFpEncodePointHex(p) { if (p.isInfinity()) return "00"; var xHex = p.getX().toBigInteger().toString(16); var yHex = p.getY().toBigInteger().toString(16); var oLen = this.getQ().toString(16).length; if ((oLen % 2) != 0) oLen++; while (xHex.length < oLen) { xHex = "0" + xHex; } while (yHex.length < oLen) { yHex = "0" + yHex; } return "04" + xHex + yHex; } ECCurveFp.prototype.getQ = curveFpGetQ; ECCurveFp.prototype.getA = curveFpGetA; ECCurveFp.prototype.getB = curveFpGetB; ECCurveFp.prototype.equals = curveFpEquals; ECCurveFp.prototype.getInfinity = curveFpGetInfinity; ECCurveFp.prototype.fromBigInteger = curveFpFromBigInteger; ECCurveFp.prototype.reduce = curveReduce; //ECCurveFp.prototype.decodePointHex = curveFpDecodePointHex; ECCurveFp.prototype.encodePointHex = curveFpEncodePointHex; // from: https://github.com/kaielvin/jsbn-ec-point-compression ECCurveFp.prototype.decodePointHex = function(s) { var yIsEven; switch(parseInt(s.substr(0,2), 16)) { // first byte case 0: return this.infinity; case 2: yIsEven = false; case 3: if(yIsEven == undefined) yIsEven = true; var len = s.length - 2; var xHex = s.substr(2, len); var x = this.fromBigInteger(new BigInteger(xHex,16)); var alpha = x.multiply(x.square().add(this.getA())).add(this.getB()); var beta = alpha.sqrt(); if (beta == null) throw "Invalid point compression"; var betaValue = beta.toBigInteger(); if (betaValue.testBit(0) != yIsEven) { // Use the other root beta = this.fromBigInteger(this.getQ().subtract(betaValue)); } return new ECPointFp(this,x,beta); case 4: case 6: case 7: var len = (s.length - 2) / 2; var 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: // unsupported return null; } } ECCurveFp.prototype.encodeCompressedPointHex = function(p) { if (p.isInfinity()) return "00"; var xHex = p.getX().toBigInteger().toString(16); var oLen = this.getQ().toString(16).length; if ((oLen % 2) != 0) oLen++; while (xHex.length < oLen) xHex = "0" + xHex; var yPrefix; if(p.getY().toBigInteger().isEven()) yPrefix = "02"; else yPrefix = "03"; return yPrefix + xHex; } ECFieldElementFp.prototype.getR = function() { if(this.r != undefined) return this.r; this.r = null; var bitLength = this.q.bitLength(); if (bitLength > 128) { var firstWord = this.q.shiftRight(bitLength - 64); if (firstWord.intValue() == -1) { this.r = BigInteger.ONE.shiftLeft(bitLength).subtract(this.q); } } return this.r; } ECFieldElementFp.prototype.modMult = function(x1,x2) { return this.modReduce(x1.multiply(x2)); } ECFieldElementFp.prototype.modReduce = function(x) { if (this.getR() != null) { var qLen = q.bitLength(); while (x.bitLength() > (qLen + 1)) { var u = x.shiftRight(qLen); var v = x.subtract(u.shiftLeft(qLen)); if (!this.getR().equals(BigInteger.ONE)) { u = u.multiply(this.getR()); } x = u.add(v); } while (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"; // p mod 4 == 3 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; } // p mod 4 == 1 var qMinusOne = this.q.subtract(BigInteger.ONE); var legendreExponent = qMinusOne.shiftRight(1); if (!(this.x.modPow(legendreExponent, this.q).equals(BigInteger.ONE))) { return null; } var u = qMinusOne.shiftRight(2); var k = u.shiftLeft(1).add(BigInteger.ONE); var Q = this.x; var fourQ = modDouble(modDouble(Q)); var U, V; 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); U = result[0]; V = result[1]; if (this.modMult(V, V).equals(fourQ)) { // Integer division by 2, mod q if (V.testBit(0)) { V = V.add(q); } V = V.shiftRight(1); return new ECFieldElementFp(q,V); } } while (U.equals(BigInteger.ONE) || U.equals(qMinusOne)); return null; } ECFieldElementFp.prototype.lucasSequence = function(P,Q,k) { var n = k.bitLength(); var s = k.getLowestSetBit(); var Uh = BigInteger.ONE; var Vl = BigInteger.TWO; var Vh = P; var Ql = BigInteger.ONE; var Qh = BigInteger.ONE; for (var j = n - 1; j >= s + 1; --j) { Ql = this.modMult(Ql, Qh); if (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))); } else { 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))); } } 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); for (var 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 ]; } var exports = { ECCurveFp: ECCurveFp, ECPointFp: ECPointFp, ECFieldElementFp: ECFieldElementFp } module.exports = exports /***/ }), /* 127 */ /***/ (function(module, exports, __webpack_require__) { (function(){ // Copyright (c) 2005 Tom Wu // All Rights Reserved. // See "LICENSE" for details. // Basic JavaScript BN library - subset useful for RSA encryption. // Bits per digit var dbits; // JavaScript engine analysis var canary = 0xdeadbeefcafe; var j_lm = ((canary&0xffffff)==0xefcafe); // (public) Constructor function BigInteger(a,b,c) { if(a != null) if("number" == typeof a) this.fromNumber(a,b,c); else if(b == null && "string" != typeof a) this.fromString(a,256); else this.fromString(a,b); } // return new, unset BigInteger function nbi() { return new BigInteger(null); } // am: Compute w_j += (x*this_i), propagate carries, // c is initial carry, returns final carry. // c < 3*dvalue, x < 2*dvalue, this_i < dvalue // We need to select the fastest one that works in this environment. // am1: use a single mult and divide to get the high bits, // max digit bits should be 26 because // max internal value = 2*dvalue^2-2*dvalue (< 2^53) function am1(i,x,w,j,c,n) { while(--n >= 0) { var v = x*this[i++]+w[j]+c; c = Math.floor(v/0x4000000); w[j++] = v&0x3ffffff; } return c; } // am2 avoids a big mult-and-extract completely. // Max digit bits should be <= 30 because we do bitwise ops // on values up to 2*hdvalue^2-hdvalue-1 (< 2^31) function am2(i,x,w,j,c,n) { var xl = x&0x7fff, xh = x>>15; while(--n >= 0) { var l = this[i]&0x7fff; var h = this[i++]>>15; var m = xh*l+h*xl; l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff); c = (l>>>30)+(m>>>15)+xh*h+(c>>>30); w[j++] = l&0x3fffffff; } return c; } // Alternately, set max digit bits to 28 since some // browsers slow down when dealing with 32-bit numbers. function am3(i,x,w,j,c,n) { var xl = x&0x3fff, xh = x>>14; while(--n >= 0) { var l = this[i]&0x3fff; var h = this[i++]>>14; var m = xh*l+h*xl; l = xl*l+((m&0x3fff)<<14)+w[j]+c; c = (l>>28)+(m>>14)+xh*h; w[j++] = l&0xfffffff; } return c; } var inBrowser = typeof navigator !== "undefined"; if(inBrowser && j_lm && (navigator.appName == "Microsoft Internet Explorer")) { BigInteger.prototype.am = am2; dbits = 30; } else if(inBrowser && j_lm && (navigator.appName != "Netscape")) { BigInteger.prototype.am = am1; dbits = 26; } else { // Mozilla/Netscape seems to prefer am3 BigInteger.prototype.am = am3; dbits = 28; } BigInteger.prototype.DB = dbits; BigInteger.prototype.DM = ((1<<dbits)-1); BigInteger.prototype.DV = (1<<dbits); var BI_FP = 52; BigInteger.prototype.FV = Math.pow(2,BI_FP); BigInteger.prototype.F1 = BI_FP-dbits; BigInteger.prototype.F2 = 2*dbits-BI_FP; // Digit conversions var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz"; var BI_RC = new Array(); var rr,vv; rr = "0".charCodeAt(0); for(vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv; rr = "a".charCodeAt(0); for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv; rr = "A".charCodeAt(0); for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv; function int2char(n) { return BI_RM.charAt(n); } function intAt(s,i) { var c = BI_RC[s.charCodeAt(i)]; return (c==null)?-1:c; } // (protected) copy this to r function bnpCopyTo(r) { for(var i = this.t-1; i >= 0; --i) r[i] = this[i]; r.t = this.t; r.s = this.s; } // (protected) set from integer value x, -DV <= x < DV function bnpFromInt(x) { this.t = 1; this.s = (x<0)?-1:0; if(x > 0) this[0] = x; else if(x < -1) this[0] = x+this.DV; else this.t = 0; } // return bigint initialized to value function nbv(i) { var r = nbi(); r.fromInt(i); return r; } // (protected) set from string and radix function bnpFromString(s,b) { var k; if(b == 16) k = 4; else if(b == 8) k = 3; else if(b == 256) k = 8; // byte array else if(b == 2) k = 1; else if(b == 32) k = 5; else if(b == 4) k = 2; else { this.fromRadix(s,b); return; } this.t = 0; this.s = 0; var i = s.length, mi = false, sh = 0; while(--i >= 0) { var x = (k==8)?s[i]&0xff:intAt(s,i); if(x < 0) { if(s.charAt(i) == "-") mi = true; continue; } mi = false; if(sh == 0) this[this.t++] = x; else if(sh+k > this.DB) { this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<<sh; this[this.t++] = (x>>(this.DB-sh)); } else this[this.t-1] |= x<<sh; sh += k; if(sh >= this.DB) sh -= this.DB; } if(k == 8 && (s[0]&0x80) != 0) { this.s = -1; if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)<<sh; } this.clamp(); if(mi) BigInteger.ZERO.subTo(this,this); } // (protected) clamp off excess high words function bnpClamp() { var c = this.s&this.DM; while(this.t > 0 && this[this.t-1] == c) --this.t; } // (public) return string representation in given radix function bnToString(b) { if(this.s < 0) return "-"+this.negate().toString(b); var k; if(b == 16) k = 4; else if(b == 8) k = 3; else if(b == 2) k = 1; else if(b == 32) k = 5; else if(b == 4) k = 2; else return this.toRadix(b); var km = (1<<k)-1, d, m = false, r = "", i = this.t; var p = this.DB-(i*this.DB)%k; if(i-- > 0) { if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); } while(i >= 0) { if(p < k) { d = (this[i]&((1<<p)-1))<<(k-p); d |= this[--i]>>(p+=this.DB-k); } else { d = (this[i]>>(p-=k))&km; if(p <= 0) { p += this.DB; --i; } } if(d > 0) m = true; if(m) r += int2char(d); } } return m?r:"0"; } // (public) -this function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; } // (public) |this| function bnAbs() { return (this.s<0)?this.negate():this; } // (public) return + if this > a, - if this < a, 0 if equal function bnCompareTo(a) { var r = this.s-a.s; if(r != 0) return r; var i = this.t; r = i-a.t; if(r != 0) return (this.s<0)?-r:r; while(--i >= 0) if((r=this[i]-a[i]) != 0) return r; return 0; } // returns bit length of the integer x function nbits(x) { var r = 1, t; if((t=x>>>16) != 0) { x = t; r += 16; } if((t=x>>8) != 0) { x = t; r += 8; } if((t=x>>4) != 0) { x = t; r += 4; } if((t=x>>2) != 0) { x = t; r += 2; } if((t=x>>1) != 0) { x = t; r += 1; } return r; } // (public) return the number of bits in "this" function bnBitLength() { if(this.t <= 0) return 0; return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM)); } // (protected) r = this << n*DB function bnpDLShiftTo(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; } // (protected) r = this >> n*DB function bnpDRShiftTo(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; } // (protected) r = this << n function bnpLShiftTo(n,r) { var bs = n%this.DB; var cbs = this.DB-bs; var bm = (1<<cbs)-1; var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i; 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(); } // (protected) r = this >> n function bnpRShiftTo(n,r) { r.s = this.s; var ds = Math.floor(n/this.DB); if(ds >= this.t) { r.t = 0; return; } var bs = n%this.DB; var cbs = this.DB-bs; var 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; } if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs; r.t = this.t-ds; r.clamp(); } // (protected) r = this - a function bnpSubTo(a,r) { var i = 0, c = 0, m = Math.min(a.t,this.t); while(i < m) { c += this[i]-a[i]; r[i++] = c&this.DM; c >>= this.DB; } if(a.t < this.t) { c -= a.s; while(i < this.t) { c += this[i]; r[i++] = c&this.DM; c >>= this.DB; } c += this.s; } else { c += this.s; while(i < a.t) { c -= a[i]; r[i++] = c&this.DM; c >>= this.DB; } c -= a.s; } r.s = (c<0)?-1:0; if(c < -1) r[i++] = this.DV+c; else if(c > 0) r[i++] = c; r.t = i; r.clamp(); } // (protected) r = this * a, r != this,a (HAC 14.12) // "this" should be the larger one if appropriate. function bnpMultiplyTo(a,r) { var x = this.abs(), y = a.abs(); var i = x.t; r.t = i+y.t; while(--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(); if(this.s != a.s) BigInteger.ZERO.subTo(r,r); } // (protected) r = this^2, r != this (HAC 14.16) function bnpSquareTo(r) { var x = this.abs(); var i = r.t = 2*x.t; while(--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); if((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; } } if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1); r.s = 0; r.clamp(); } // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20) // r != q, this != m. q or r may be null. function bnpDivRemTo(m,q,r) { var pm = m.abs(); if(pm.t <= 0) return; var pt = this.abs(); if(pt.t < pm.t) { if(q != null) q.fromInt(0); if(r != null) this.copyTo(r); return; } if(r == null) r = nbi(); var y = nbi(), ts = this.s, ms = m.s; var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); } var ys = y.t; var y0 = y[ys-1]; if(y0 == 0) return; var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0); var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2; var i = r.t, j = i-ys, t = (q==null)?nbi():q; y.dlShiftTo(j,t); if(r.compareTo(t) >= 0) { r[r.t++] = 1; r.subTo(t,r); } BigInteger.ONE.dlShiftTo(ys,t); t.subTo(y,y); // "negative" y so we can replace sub with am later while(y.t < ys) y[y.t++] = 0; while(--j >= 0) { // Estimate quotient digit 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) { // Try it out y.dlShiftTo(j,t); r.subTo(t,r); while(r[i] < --qd) r.subTo(t,r); } } if(q != null) { r.drShiftTo(ys,q); if(ts != ms) BigInteger.ZERO.subTo(q,q); } r.t = ys; r.clamp(); if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder if(ts < 0) BigInteger.ZERO.subTo(r,r); } // (public) this mod a function bnMod(a) { var r = nbi(); this.abs().divRemTo(a,null,r); if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r); return r; } // Modular reduction using "classic" algorithm function Classic(m) { this.m = m; } function cConvert(x) { if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m); else return x; } function cRevert(x) { return x; } function cReduce(x) { x.divRemTo(this.m,null,x); } function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); } Classic.prototype.convert = cConvert; Classic.prototype.revert = cRevert; Classic.prototype.reduce = cReduce; Classic.prototype.mulTo = cMulTo; Classic.prototype.sqrTo = cSqrTo; // (protected) return "-1/this % 2^DB"; useful for Mont. reduction // justification: // xy == 1 (mod m) // xy = 1+km // xy(2-xy) = (1+km)(1-km) // x[y(2-xy)] = 1-k^2m^2 // x[y(2-xy)] == 1 (mod m^2) // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2 // should reduce x and y(2-xy) by m^2 at each step to keep size bounded. // JS multiply "overflows" differently from C/C++, so care is needed here. function bnpInvDigit() { if(this.t < 1) return 0; var x = this[0]; if((x&1) == 0) return 0; var y = x&3; // y == 1/x mod 2^2 y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4 y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8 y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16 // last step - calculate inverse mod DV directly; // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits // we really want the negative inverse, and -DV < y < DV return (y>0)?this.DV-y:-y; } // Montgomery reduction function Montgomery(m) { this.m = m; this.mp = m.invDigit(); this.mpl = this.mp&0x7fff; this.mph = this.mp>>15; this.um = (1<<(m.DB-15))-1; this.mt2 = 2*m.t; } // xR mod m function montConvert(x) { var r = nbi(); x.abs().dlShiftTo(this.m.t,r); r.divRemTo(this.m,null,r); if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r); return r; } // x/R mod m function montRevert(x) { var r = nbi(); x.copyTo(r); this.reduce(r); return r; } // x = x/R mod m (HAC 14.32) function montReduce(x) { while(x.t <= this.mt2) // pad x so am has enough room later x[x.t++] = 0; for(var i = 0; i < this.m.t; ++i) { // faster way of calculating u0 = x[i]*mp mod DV var j = x[i]&0x7fff; var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM; // use am to combine the multiply-shift-add into one call j = i+this.m.t; x[j] += this.m.am(0,u0,x,i,0,this.m.t); // propagate carry while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; } } x.clamp(); x.drShiftTo(this.m.t,x); if(x.compareTo(this.m) >= 0) x.subTo(this.m,x); } // r = "x^2/R mod m"; x != r function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); } // r = "xy/R mod m"; x,y != r function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } Montgomery.prototype.convert = montConvert; Montgomery.prototype.revert = montRevert; Montgomery.prototype.reduce = montReduce; Montgomery.prototype.mulTo = montMulTo; Montgomery.prototype.sqrTo = montSqrTo; // (protected) true iff this is even function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; } // (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79) function bnpExp(e,z) { if(e > 0xffffffff || e < 1) return BigInteger.ONE; var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1; g.copyTo(r); while(--i >= 0) { z.sqrTo(r,r2); if((e&(1<<i)) > 0) z.mulTo(r2,g,r); else { var t = r; r = r2; r2 = t; } } return z.revert(r); } // (public) this^e % m, 0 <= e < 2^32 function bnModPowInt(e,m) { var z; if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m); return this.exp(e,z); } // protected BigInteger.prototype.copyTo = bnpCopyTo; BigInteger.prototype.fromInt = bnpFromInt; BigInteger.prototype.fromString = bnpFromString; BigInteger.prototype.clamp = bnpClamp; BigInteger.prototype.dlShiftTo = bnpDLShiftTo; BigInteger.prototype.drShiftTo = bnpDRShiftTo; BigInteger.prototype.lShiftTo = bnpLShiftTo; BigInteger.prototype.rShiftTo = bnpRShiftTo; BigInteger.prototype.subTo = bnpSubTo; BigInteger.prototype.multiplyTo = bnpMultiplyTo; BigInteger.prototype.squareTo = bnpSquareTo; BigInteger.prototype.divRemTo = bnpDivRemTo; BigInteger.prototype.invDigit = bnpInvDigit; BigInteger.prototype.isEven = bnpIsEven; BigInteger.prototype.exp = bnpExp; // public BigInteger.prototype.toString = bnToString; BigInteger.prototype.negate = bnNegate; BigInteger.prototype.abs = bnAbs; BigInteger.prototype.compareTo = bnCompareTo; BigInteger.prototype.bitLength = bnBitLength; BigInteger.prototype.mod = bnMod; BigInteger.prototype.modPowInt = bnModPowInt; // "constants" BigInteger.ZERO = nbv(0); BigInteger.ONE = nbv(1); // Copyright (c) 2005-2009 Tom Wu // All Rights Reserved. // See "LICENSE" for details. // Extended JavaScript BN functions, required for RSA private ops. // Version 1.1: new BigInteger("0", 10) returns "proper" zero // Version 1.2: square() API, isProbablePrime fix // (public) function bnClone() { var r = nbi(); this.copyTo(r); return r; } // (public) return value as integer function bnIntValue() { if(this.s < 0) { if(this.t == 1) return this[0]-this.DV; else if(this.t == 0) return -1; } else if(this.t == 1) return this[0]; else if(this.t == 0) return 0; // assumes 16 < DB < 32 return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0]; } // (public) return value as byte function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; } // (public) return value as short (assumes DB>=16) function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; } // (protected) return x s.t. r^x < DV function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); } // (public) 0 if this == 0, 1 if this > 0 function bnSigNum() { if(this.s < 0) return -1; else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0; else return 1; } // (protected) convert to radix string function bnpToRadix(b) { if(b == null) b = 10; if(this.signum() == 0 || b < 2 || b > 36) return "0"; var cs = this.chunkSize(b); var a = Math.pow(b,cs); var d = nbv(a), y = nbi(), z = nbi(), r = ""; this.divRemTo(d,y,z); while(y.signum() > 0) { r = (a+z.intValue()).toString(b).substr(1) + r; y.divRemTo(d,y,z); } return z.intValue().toString(b) + r; } // (protected) convert from radix string function bnpFromRadix(s,b) { this.fromInt(0); if(b == null) b = 10; var cs = this.chunkSize(b); var d = Math.pow(b,cs), mi = false, j = 0, w = 0; for(var i = 0; i < s.length; ++i) { var x = intAt(s,i); if(x < 0) { if(s.charAt(i) == "-" && this.signum() == 0) mi = true; continue; } w = b*w+x; if(++j >= cs) { this.dMultiply(d); this.dAddOffset(w,0); j = 0; w = 0; } } if(j > 0) { this.dMultiply(Math.pow(b,j)); this.dAddOffset(w,0); } if(mi) BigInteger.ZERO.subTo(this,this); } // (protected) alternate constructor function bnpFromNumber(a,b,c) { if("number" == typeof b) { // new BigInteger(int,int,RNG) if(a < 2) this.fromInt(1); else { this.fromNumber(a,c); if(!this.testBit(a-1)) // force MSB set this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this); if(this.isEven()) this.dAddOffset(1,0); // force odd while(!this.isProbablePrime(b)) { this.dAddOffset(2,0); if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this); } } } else { // new BigInteger(int,RNG) var x = new Array(), t = a&7; x.length = (a>>3)+1; b.nextBytes(x); if(t > 0) x[0] &= ((1<<t)-1); else x[0] = 0; this.fromString(x,256); } } // (public) convert to bigendian byte array function bnToByteArray() { var i = this.t, r = new Array(); r[0] = this.s; var p = this.DB-(i*this.DB)%8, d, k = 0; if(i-- > 0) { if(p < this.DB && (d = this[i]>>p) != (this.s&this.DM)>>p) r[k++] = d|(this.s<<(this.DB-p)); while(i >= 0) { if(p < 8) { d = (this[i]&((1<<p)-1))<<(8-p); d |= this[--i]>>(p+=this.DB-8); } else { d = (this[i]>>(p-=8))&0xff; if(p <= 0) { p += this.DB; --i; } } if((d&0x80) != 0) d |= -256; if(k == 0 && (this.s&0x80) != (d&0x80)) ++k; if(k > 0 || d != this.s) r[k++] = d; } } return r; } function bnEquals(a) { return(this.compareTo(a)==0); } function bnMin(a) { return(this.compareTo(a)<0)?this:a; } function bnMax(a) { return(this.compareTo(a)>0)?this:a; } // (protected) r = this op a (bitwise) function bnpBitwiseTo(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) { f = a.s&this.DM; for(i = m; i < this.t; ++i) r[i] = op(this[i],f); r.t = this.t; } else { f = this.s&this.DM; for(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(); } // (public) this & a function op_and(x,y) { return x&y; } function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; } // (public) this | a function op_or(x,y) { return x|y; } function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; } // (public) this ^ a function op_xor(x,y) { return x^y; } function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; } // (public) this & ~a function op_andnot(x,y) { return x&~y; } function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; } // (public) ~this function bnNot() { var r = nbi(); for(var i = 0; i < this.t; ++i) r[i] = this.DM&~this[i]; r.t = this.t; r.s = ~this.s; return r; } // (public) this << n function bnShiftLeft(n) { var r = nbi(); if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r); return r; } // (public) this >> n function bnShiftRight(n) { var r = nbi(); if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r); return r; } // return index of lowest 1-bit in x, x < 2^31 function lbit(x) { if(x == 0) return -1; var r = 0; if((x&0xffff) == 0) { x >>= 16; r += 16; } if((x&0xff) == 0) { x >>= 8; r += 8; } if((x&0xf) == 0) { x >>= 4; r += 4; } if((x&3) == 0) { x >>= 2; r += 2; } if((x&1) == 0) ++r; return r; } // (public) returns index of lowest 1-bit (or -1 if none) function bnGetLowestSetBit() { for(var i = 0; i < this.t; ++i) if(this[i] != 0) return i*this.DB+lbit(this[i]); if(this.s < 0) return this.t*this.DB; return -1; } // return number of 1 bits in x function cbit(x) { var r = 0; while(x != 0) { x &= x-1; ++r; } return r; } // (public) return number of set bits function bnBitCount() { var r = 0, x = this.s&this.DM; for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x); return r; } // (public) true iff nth bit is set function bnTestBit(n) { var j = Math.floor(n/this.DB); if(j >= this.t) return(this.s!=0); return((this[j]&(1<<(n%this.DB)))!=0); } // (protected) this op (1<<n) function bnpChangeBit(n,op) { var r = BigInteger.ONE.shiftLeft(n); this.bitwiseTo(r,op,r); return r; } // (public) this | (1<<n) function bnSetBit(n) { return this.changeBit(n,op_or); } // (public) this & ~(1<<n) function bnClearBit(n) { return this.changeBit(n,op_andnot); } // (public) this ^ (1<<n) function bnFlipBit(n) { return this.changeBit(n,op_xor); } // (protected) r = this + a function bnpAddTo(a,r) { var i = 0, c = 0, m = Math.min(a.t,this.t); while(i < m) { c += this[i]+a[i]; r[i++] = c&this.DM; c >>= this.DB; } if(a.t < this.t) { c += a.s; while(i < this.t) { c += this[i]; r[i++] = c&this.DM; c >>= this.DB; } c += this.s; } else { c += this.s; while(i < a.t) { c += a[i]; r[i++] = c&this.DM; c >>= this.DB; } c += a.s; } r.s = (c<0)?-1:0; if(c > 0) r[i++] = c; else if(c < -1) r[i++] = this.DV+c; r.t = i; r.clamp(); } // (public) this + a function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; } // (public) this - a function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; } // (public) this * a function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; } // (public) this^2 function bnSquare() { var r = nbi(); this.squareTo(r); return r; } // (public) this / a function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; } // (public) this % a function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; } // (public) [this/a,this%a] function bnDivideAndRemainder(a) { var q = nbi(), r = nbi(); this.divRemTo(a,q,r); return new Array(q,r); } // (protected) this *= n, this >= 0, 1 < n < DV function bnpDMultiply(n) { this[this.t] = this.am(0,n-1,this,0,0,this.t); ++this.t; this.clamp(); } // (protected) this += n << w words, this >= 0 function bnpDAddOffset(n,w) { if(n == 0) return; while(this.t <= w) this[this.t++] = 0; this[w] += n; while(this[w] >= this.DV) { this[w] -= this.DV; if(++w >= this.t) this[this.t++] = 0; ++this[w]; } } // A "null" reducer function NullExp() {} function nNop(x) { return x; } function nMulTo(x,y,r) { x.multiplyTo(y,r); } function nSqrTo(x,r) { x.squareTo(r); } NullExp.prototype.convert = nNop; NullExp.prototype.revert = nNop; NullExp.prototype.mulTo = nMulTo; NullExp.prototype.sqrTo = nSqrTo; // (public) this^e function bnPow(e) { return this.exp(e,new NullExp()); } // (protected) r = lower n words of "this * a", a.t <= n // "this" should be the larger one if appropriate. function bnpMultiplyLowerTo(a,n,r) { var i = Math.min(this.t+a.t,n); r.s = 0; // assumes a,this >= 0 r.t = i; while(i > 0) r[--i] = 0; var j; 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(); } // (protected) r = "this * a" without lower n words, n > 0 // "this" should be the larger one if appropriate. function bnpMultiplyUpperTo(a,n,r) { --n; var i = r.t = this.t+a.t-n; r.s = 0; // assumes a,this >= 0 while(--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); } // Barrett modular reduction function Barrett(m) { // setup Barrett this.r2 = nbi(); this.q3 = nbi(); BigInteger.ONE.dlShiftTo(2*m.t,this.r2); this.mu = this.r2.divide(m); this.m = m; } function barrettConvert(x) { if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m); else if(x.compareTo(this.m) < 0) return x; else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; } } function barrettRevert(x) { return x; } // x = x mod m (HAC 14.42) function barrettReduce(x) { x.drShiftTo(this.m.t-1,this.r2); if(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); while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1); x.subTo(this.r2,x); while(x.compareTo(this.m) >= 0) x.subTo(this.m,x); } // r = x^2 mod m; x != r function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); } // r = x*y mod m; x,y != r function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } Barrett.prototype.convert = barrettConvert; Barrett.prototype.revert = barrettRevert; Barrett.prototype.reduce = barrettReduce; Barrett.prototype.mulTo = barrettMulTo; Barrett.prototype.sqrTo = barrettSqrTo; // (public) this^e % m (HAC 14.85) function bnModPow(e,m) { var i = e.bitLength(), k, r = nbv(1), z; if(i <= 0) return r; else if(i < 18) k = 1; else if(i < 48) k = 3; else if(i < 144) k = 4; else if(i < 768) k = 5; else k = 6; if(i < 8) z = new Classic(m); else if(m.isEven()) z = new Barrett(m); else z = new Montgomery(m); // precomputation var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1; g[1] = z.convert(this); if(k > 1) { var g2 = nbi(); z.sqrTo(g[1],g2); while(n <= km) { g[n] = nbi(); z.mulTo(g2,g[n-2],g[n]); n += 2; } } var j = e.t-1, w, is1 = true, r2 = nbi(), t; i = nbits(e[j])-1; while(j >= 0) { if(i >= k1) w = (e[j]>>(i-k1))&km; else { w = (e[j]&((1<<(i+1))-1))<<(k1-i); if(j > 0) w |= e[j-1]>>(this.DB+i-k1); } n = k; while((w&1) == 0) { w >>= 1; --n; } if((i -= n) < 0) { i += this.DB; --j; } if(is1) { // ret == 1, don't bother squaring or multiplying it g[w].copyTo(r); is1 = false; } else { while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; } if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; } z.mulTo(r2,g[w],r); } while(j >= 0 && (e[j]&(1<<i)) == 0) { z.sqrTo(r,r2); t = r; r = r2; r2 = t; if(--i < 0) { i = this.DB-1; --j; } } } return z.revert(r); } // (public) gcd(this,a) (HAC 14.54) function bnGCD(a) { var x = (this.s<0)?this.negate():this.clone(); var 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; if(i < g) g = i; if(g > 0) { x.rShiftTo(g,x); y.rShiftTo(g,y); } while(x.signum() > 0) { if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x); if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y); if(x.compareTo(y) >= 0) { x.subTo(y,x); x.rShiftTo(1,x); } else { y.subTo(x,y); y.rShiftTo(1,y); } } if(g > 0) y.lShiftTo(g,y); return y; } // (protected) this % n, n < 2^26 function bnpModInt(n) { if(n <= 0) return 0; var d = this.DV%n, r = (this.s<0)?n-1:0; if(this.t > 0) if(d == 0) r = this[0]%n; else for(var i = this.t-1; i >= 0; --i) r = (d*r+this[i])%n; return r; } // (public) 1/this % m (HAC 14.61) function bnModInverse(m) { var ac = m.isEven(); if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO; var u = m.clone(), v = this.clone(); var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1); while(u.signum() != 0) { while(u.isEven()) { u.rShiftTo(1,u); if(ac) { if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); } a.rShiftTo(1,a); } else if(!b.isEven()) b.subTo(m,b); b.rShiftTo(1,b); } while(v.isEven()) { v.rShiftTo(1,v); if(ac) { if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); } c.rShiftTo(1,c); } else if(!d.isEven()) d.subTo(m,d); d.rShiftTo(1,d); } if(u.compareTo(v) >= 0) { u.subTo(v,u); if(ac) a.subTo(c,a); b.subTo(d,b); } else { v.subTo(u,v); if(ac) c.subTo(a,c); d.subTo(b,d); } } if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO; if(d.compareTo(m) >= 0) return d.subtract(m); if(d.signum() < 0) d.addTo(m,d); else return d; if(d.signum() < 0) return d.add(m); else return d; } var 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]; var lplim = (1<<26)/lowprimes[lowprimes.length-1]; // (public) test primality with certainty >= 1-.5^t function bnIsProbablePrime(t) { var i, x = this.abs(); if(x.t == 1 && x[0] <= lowprimes[lowprimes.length-1]) { for(i = 0; i < lowprimes.length; ++i) if(x[0] == lowprimes[i]) return true; return false; } if(x.isEven()) return false; i = 1; while(i < lowprimes.length) { var m = lowprimes[i], j = i+1; while(j < lowprimes.length && m < lplim) m *= lowprimes[j++]; m = x.modInt(m); while(i < j) if(m%lowprimes[i++] == 0) return false; } return x.millerRabin(t); } // (protected) true if probably prime (HAC 4.24, Miller-Rabin) function bnpMillerRabin(t) { var n1 = this.subtract(BigInteger.ONE); var k = n1.getLowestSetBit(); if(k <= 0) return false; var r = n1.shiftRight(k); t = (t+1)>>1; if(t > lowprimes.length) t = lowprimes.length; var a = nbi(); for(var i = 0; i < t; ++i) { //Pick bases at random, instead of starting at 2 a.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]); var y = a.modPow(r,this); if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) { var j = 1; while(j++ < k && y.compareTo(n1) != 0) { y = y.modPowInt(2,this); if(y.compareTo(BigInteger.ONE) == 0) return false; } if(y.compareTo(n1) != 0) return false; } } return true; } // protected BigInteger.prototype.chunkSize = bnpChunkSize; BigInteger.prototype.toRadix = bnpToRadix; BigInteger.prototype.fromRadix = bnpFromRadix; BigInteger.prototype.fromNumber = bnpFromNumber; BigInteger.prototype.bitwiseTo = bnpBitwiseTo; BigInteger.prototype.changeBit = bnpChangeBit; BigInteger.prototype.addTo = bnpAddTo; BigInteger.prototype.dMultiply = bnpDMultiply; BigInteger.prototype.dAddOffset = bnpDAddOffset; BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo; BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo; BigInteger.prototype.modInt = bnpModInt; BigInteger.prototype.millerRabin = bnpMillerRabin; // public BigInteger.prototype.clone = bnClone; BigInteger.prototype.intValue = bnIntValue; BigInteger.prototype.byteValue = bnByteValue; BigInteger.prototype.shortValue = bnShortValue; BigInteger.prototype.signum = bnSigNum; BigInteger.prototype.toByteArray = bnToByteArray; BigInteger.prototype.equals = bnEquals; BigInteger.prototype.min = bnMin; BigInteger.prototype.max = bnMax; BigInteger.prototype.and = bnAnd; BigInteger.prototype.or = bnOr; BigInteger.prototype.xor = bnXor; BigInteger.prototype.andNot = bnAndNot; BigInteger.prototype.not = bnNot; BigInteger.prototype.shiftLeft = bnShiftLeft; BigInteger.prototype.shiftRight = bnShiftRight; BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit; BigInteger.prototype.bitCount = bnBitCount; BigInteger.prototype.testBit = bnTestBit; BigInteger.prototype.setBit = bnSetBit; BigInteger.prototype.clearBit = bnClearBit; BigInteger.prototype.flipBit = bnFlipBit; BigInteger.prototype.add = bnAdd; BigInteger.prototype.subtract = bnSubtract; BigInteger.prototype.multiply = bnMultiply; BigInteger.prototype.divide = bnDivide; BigInteger.prototype.remainder = bnRemainder; BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder; BigInteger.prototype.modPow = bnModPow; BigInteger.prototype.modInverse = bnModInverse; BigInteger.prototype.pow = bnPow; BigInteger.prototype.gcd = bnGCD; BigInteger.prototype.isProbablePrime = bnIsProbablePrime; // JSBN-specific extension BigInteger.prototype.square = bnSquare; // Expose the Barrett function BigInteger.prototype.Barrett = Barrett // BigInteger interfaces not implemented in jsbn: // BigInteger(int signum, byte[] magnitude) // double doubleValue() // float floatValue() // int hashCode() // long longValue() // static BigInteger valueOf(long val) // Random number generator - requires a PRNG backend, e.g. prng4.js // For best results, put code like // <body onClick='rng_seed_time();' onKeyPress='rng_seed_time();'> // in your main HTML document. var rng_state; var rng_pool; var rng_pptr; // Mix in a 32-bit integer into the pool function rng_seed_int(x) { rng_pool[rng_pptr++] ^= x & 255; rng_pool[rng_pptr++] ^= (x >> 8) & 255; rng_pool[rng_pptr++] ^= (x >> 16) & 255; rng_pool[rng_pptr++] ^= (x >> 24) & 255; if(rng_pptr >= rng_psize) rng_pptr -= rng_psize; } // Mix in the current time (w/milliseconds) into the pool function rng_seed_time() { rng_seed_int(new Date().getTime()); } // Initialize the pool with junk if needed. if(rng_pool == null) { rng_pool = new Array(); rng_pptr = 0; var t; if(typeof window !== "undefined" && window.crypto) { if (window.crypto.getRandomValues) { // Use webcrypto if available var ua = new Uint8Array(32); window.crypto.getRandomValues(ua); for(t = 0; t < 32; ++t) rng_pool[rng_pptr++] = ua[t]; } else if(navigator.appName == "Netscape" && navigator.appVersion < "5") { // Extract entropy (256 bits) from NS4 RNG if available var z = window.crypto.random(32); for(t = 0; t < z.length; ++t) rng_pool[rng_pptr++] = z.charCodeAt(t) & 255; } } while(rng_pptr < rng_psize) { // extract some randomness from Math.random() t = Math.floor(65536 * Math.random()); rng_pool[rng_pptr++] = t >>> 8; rng_pool[rng_pptr++] = t & 255; } rng_pptr = 0; rng_seed_time(); //rng_seed_int(window.screenX); //rng_seed_int(window.screenY); } function rng_get_byte() { if(rng_state == null) { rng_seed_time(); rng_state = prng_newstate(); rng_state.init(rng_pool); for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr) rng_pool[rng_pptr] = 0; rng_pptr = 0; //rng_pool = null; } // TODO: allow reseeding after first request return rng_state.next(); } function rng_get_bytes(ba) { var i; for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte(); } function SecureRandom() {} SecureRandom.prototype.nextBytes = rng_get_bytes; // prng4.js - uses Arcfour as a PRNG function Arcfour() { this.i = 0; this.j = 0; this.S = new Array(); } // Initialize arcfour context from key, an array of ints, each from [0..255] function ARC4init(key) { var i, j, t; for(i = 0; i < 256; ++i) this.S[i] = i; j = 0; for(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; } function ARC4next() { var t; 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; return this.S[(t + this.S[this.i]) & 255]; } Arcfour.prototype.init = ARC4init; Arcfour.prototype.next = ARC4next; // Plug in your RNG constructor here function prng_newstate() { return new Arcfour(); } // Pool size must be a multiple of 4 and greater than 32. // An array of bytes the size of the pool will be passed to init() var rng_psize = 256; BigInteger.SecureRandom = SecureRandom; BigInteger.BigInteger = BigInteger; if (true) { exports = module.exports = BigInteger; } else {} }).call(this); /***/ }), /* 128 */ /***/ (function(module, exports, __webpack_require__) { (function(nacl) { 'use strict'; // Ported in 2014 by Dmitry Chestnykh and Devi Mandiri. // Public domain. // // Implementation derived from TweetNaCl version 20140427. // See for details: http://tweetnacl.cr.yp.to/ 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; }; // Pluggable, initialized in high-level API below. var randombytes = function(/* x, n */) { throw new Error('no PRNG'); }; var _0 = new Uint8Array(16); var _9 = new Uint8Array(32); _9[0] = 9; var gf0 = gf(), gf1 = gf([1]), _121665 = gf([0xdb41, 1]), D = gf([0x78a3, 0x1359, 0x4dca, 0x75eb, 0xd8ab, 0x4141, 0x0a4d, 0x0070, 0xe898, 0x7779, 0x4079, 0x8cc7, 0xfe73, 0x2b6f, 0x6cee, 0x5203]), D2 = gf([0xf159, 0x26b2, 0x9b94, 0xebd6, 0xb156, 0x8283, 0x149a, 0x00e0, 0xd130, 0xeef3, 0x80f2, 0x198e, 0xfce7, 0x56df, 0xd9dc, 0x2406]), X = gf([0xd51a, 0x8f25, 0x2d60, 0xc956, 0xa7b2, 0x9525, 0xc760, 0x692c, 0xdc5c, 0xfdd6, 0xe231, 0xc0a4, 0x53fe, 0xcd6e, 0x36d3, 0x2169]), Y = gf([0x6658, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666]), I = gf([0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43, 0xd7a7, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83]); function ts64(x, i, h, l) { x[i] = (h >> 24) & 0xff; x[i+1] = (h >> 16) & 0xff; x[i+2] = (h >> 8) & 0xff; x[i+3] = h & 0xff; x[i+4] = (l >> 24) & 0xff; x[i+5] = (l >> 16) & 0xff; x[i+6] = (l >> 8) & 0xff; x[i+7] = l & 0xff; } 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 core_salsa20(o, p, k, c) { var j0 = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24, j1 = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24, j2 = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24, j3 = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24, j4 = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24, j5 = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24, j6 = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24, j7 = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24, j8 = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24, j9 = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24, j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24, j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24, j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24, j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24, j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24, j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24; var 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, u; for (var i = 0; i < 20; i += 2) { u = x0 + x12 | 0; x4 ^= u<<7 | u>>>(32-7); u = x4 + x0 | 0; x8 ^= u<<9 | u>>>(32-9); u = x8 + x4 | 0; x12 ^= u<<13 | u>>>(32-13); u = x12 + x8 | 0; x0 ^= u<<18 | u>>>(32-18); u = x5 + x1 | 0; x9 ^= u<<7 | u>>>(32-7); u = x9 + x5 | 0; x13 ^= u<<9 | u>>>(32-9); u = x13 + x9 | 0; x1 ^= u<<13 | u>>>(32-13); u = x1 + x13 | 0; x5 ^= u<<18 | u>>>(32-18); u = x10 + x6 | 0; x14 ^= u<<7 | u>>>(32-7); u = x14 + x10 | 0; x2 ^= u<<9 | u>>>(32-9); u = x2 + x14 | 0; x6 ^= u<<13 | u>>>(32-13); u = x6 + x2 | 0; x10 ^= u<<18 | u>>>(32-18); u = x15 + x11 | 0; x3 ^= u<<7 | u>>>(32-7); u = x3 + x15 | 0; x7 ^= u<<9 | u>>>(32-9); u = x7 + x3 | 0; x11 ^= u<<13 | u>>>(32-13); u = x11 + x7 | 0; x15 ^= u<<18 | u>>>(32-18); u = x0 + x3 | 0; x1 ^= u<<7 | u>>>(32-7); u = x1 + x0 | 0; x2 ^= u<<9 | u>>>(32-9); u = x2 + x1 | 0; x3 ^= u<<13 | u>>>(32-13); u = x3 + x2 | 0; x0 ^= u<<18 | u>>>(32-18); u = x5 + x4 | 0; x6 ^= u<<7 | u>>>(32-7); u = x6 + x5 | 0; x7 ^= u<<9 | u>>>(32-9); u = x7 + x6 | 0; x4 ^= u<<13 | u>>>(32-13); u = x4 + x7 | 0; x5 ^= u<<18 | u>>>(32-18); u = x10 + x9 | 0; x11 ^= u<<7 | u>>>(32-7); u = x11 + x10 | 0; x8 ^= u<<9 | u>>>(32-9); u = x8 + x11 | 0; x9 ^= u<<13 | u>>>(32-13); u = x9 + x8 | 0; x10 ^= u<<18 | u>>>(32-18); u = x15 + x14 | 0; x12 ^= u<<7 | u>>>(32-7); u = x12 + x15 | 0; x13 ^= u<<9 | u>>>(32-9); u = x13 + x12 | 0; x14 ^= u<<13 | u>>>(32-13); u = x14 + x13 | 0; x15 ^= u<<18 | u>>>(32-18); } 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 & 0xff; o[ 1] = x0 >>> 8 & 0xff; o[ 2] = x0 >>> 16 & 0xff; o[ 3] = x0 >>> 24 & 0xff; o[ 4] = x1 >>> 0 & 0xff; o[ 5] = x1 >>> 8 & 0xff; o[ 6] = x1 >>> 16 & 0xff; o[ 7] = x1 >>> 24 & 0xff; o[ 8] = x2 >>> 0 & 0xff; o[ 9] = x2 >>> 8 & 0xff; o[10] = x2 >>> 16 & 0xff; o[11] = x2 >>> 24 & 0xff; o[12] = x3 >>> 0 & 0xff; o[13] = x3 >>> 8 & 0xff; o[14] = x3 >>> 16 & 0xff; o[15] = x3 >>> 24 & 0xff; o[16] = x4 >>> 0 & 0xff; o[17] = x4 >>> 8 & 0xff; o[18] = x4 >>> 16 & 0xff; o[19] = x4 >>> 24 & 0xff; o[20] = x5 >>> 0 & 0xff; o[21] = x5 >>> 8 & 0xff; o[22] = x5 >>> 16 & 0xff; o[23] = x5 >>> 24 & 0xff; o[24] = x6 >>> 0 & 0xff; o[25] = x6 >>> 8 & 0xff; o[26] = x6 >>> 16 & 0xff; o[27] = x6 >>> 24 & 0xff; o[28] = x7 >>> 0 & 0xff; o[29] = x7 >>> 8 & 0xff; o[30] = x7 >>> 16 & 0xff; o[31] = x7 >>> 24 & 0xff; o[32] = x8 >>> 0 & 0xff; o[33] = x8 >>> 8 & 0xff; o[34] = x8 >>> 16 & 0xff; o[35] = x8 >>> 24 & 0xff; o[36] = x9 >>> 0 & 0xff; o[37] = x9 >>> 8 & 0xff; o[38] = x9 >>> 16 & 0xff; o[39] = x9 >>> 24 & 0xff; o[40] = x10 >>> 0 & 0xff; o[41] = x10 >>> 8 & 0xff; o[42] = x10 >>> 16 & 0xff; o[43] = x10 >>> 24 & 0xff; o[44] = x11 >>> 0 & 0xff; o[45] = x11 >>> 8 & 0xff; o[46] = x11 >>> 16 & 0xff; o[47] = x11 >>> 24 & 0xff; o[48] = x12 >>> 0 & 0xff; o[49] = x12 >>> 8 & 0xff; o[50] = x12 >>> 16 & 0xff; o[51] = x12 >>> 24 & 0xff; o[52] = x13 >>> 0 & 0xff; o[53] = x13 >>> 8 & 0xff; o[54] = x13 >>> 16 & 0xff; o[55] = x13 >>> 24 & 0xff; o[56] = x14 >>> 0 & 0xff; o[57] = x14 >>> 8 & 0xff; o[58] = x14 >>> 16 & 0xff; o[59] = x14 >>> 24 & 0xff; o[60] = x15 >>> 0 & 0xff; o[61] = x15 >>> 8 & 0xff; o[62] = x15 >>> 16 & 0xff; o[63] = x15 >>> 24 & 0xff; } function core_hsalsa20(o,p,k,c) { var j0 = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24, j1 = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24, j2 = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24, j3 = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24, j4 = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24, j5 = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24, j6 = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24, j7 = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24, j8 = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24, j9 = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24, j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24, j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24, j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24, j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24, j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24, j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24; var 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, u; for (var i = 0; i < 20; i += 2) { u = x0 + x12 | 0; x4 ^= u<<7 | u>>>(32-7); u = x4 + x0 | 0; x8 ^= u<<9 | u>>>(32-9); u = x8 + x4 | 0; x12 ^= u<<13 | u>>>(32-13); u = x12 + x8 | 0; x0 ^= u<<18 | u>>>(32-18); u = x5 + x1 | 0; x9 ^= u<<7 | u>>>(32-7); u = x9 + x5 | 0; x13 ^= u<<9 | u>>>(32-9); u = x13 + x9 | 0; x1 ^= u<<13 | u>>>(32-13); u = x1 + x13 | 0; x5 ^= u<<18 | u>>>(32-18); u = x10 + x6 | 0; x14 ^= u<<7 | u>>>(32-7); u = x14 + x10 | 0; x2 ^= u<<9 | u>>>(32-9); u = x2 + x14 | 0; x6 ^= u<<13 | u>>>(32-13); u = x6 + x2 | 0; x10 ^= u<<18 | u>>>(32-18); u = x15 + x11 | 0; x3 ^= u<<7 | u>>>(32-7); u = x3 + x15 | 0; x7 ^= u<<9 | u>>>(32-9); u = x7 + x3 | 0; x11 ^= u<<13 | u>>>(32-13); u = x11 + x7 | 0; x15 ^= u<<18 | u>>>(32-18); u = x0 + x3 | 0; x1 ^= u<<7 | u>>>(32-7); u = x1 + x0 | 0; x2 ^= u<<9 | u>>>(32-9); u = x2 + x1 | 0; x3 ^= u<<13 | u>>>(32-13); u = x3 + x2 | 0; x0 ^= u<<18 | u>>>(32-18); u = x5 + x4 | 0; x6 ^= u<<7 | u>>>(32-7); u = x6 + x5 | 0; x7 ^= u<<9 | u>>>(32-9); u = x7 + x6 | 0; x4 ^= u<<13 | u>>>(32-13); u = x4 + x7 | 0; x5 ^= u<<18 | u>>>(32-18); u = x10 + x9 | 0; x11 ^= u<<7 | u>>>(32-7); u = x11 + x10 | 0; x8 ^= u<<9 | u>>>(32-9); u = x8 + x11 | 0; x9 ^= u<<13 | u>>>(32-13); u = x9 + x8 | 0; x10 ^= u<<18 | u>>>(32-18); u = x15 + x14 | 0; x12 ^= u<<7 | u>>>(32-7); u = x12 + x15 | 0; x13 ^= u<<9 | u>>>(32-9); u = x13 + x12 | 0; x14 ^= u<<13 | u>>>(32-13); u = x14 + x13 | 0; x15 ^= u<<18 | u>>>(32-18); } o[ 0] = x0 >>> 0 & 0xff; o[ 1] = x0 >>> 8 & 0xff; o[ 2] = x0 >>> 16 & 0xff; o[ 3] = x0 >>> 24 & 0xff; o[ 4] = x5 >>> 0 & 0xff; o[ 5] = x5 >>> 8 & 0xff; o[ 6] = x5 >>> 16 & 0xff; o[ 7] = x5 >>> 24 & 0xff; o[ 8] = x10 >>> 0 & 0xff; o[ 9] = x10 >>> 8 & 0xff; o[10] = x10 >>> 16 & 0xff; o[11] = x10 >>> 24 & 0xff; o[12] = x15 >>> 0 & 0xff; o[13] = x15 >>> 8 & 0xff; o[14] = x15 >>> 16 & 0xff; o[15] = x15 >>> 24 & 0xff; o[16] = x6 >>> 0 & 0xff; o[17] = x6 >>> 8 & 0xff; o[18] = x6 >>> 16 & 0xff; o[19] = x6 >>> 24 & 0xff; o[20] = x7 >>> 0 & 0xff; o[21] = x7 >>> 8 & 0xff; o[22] = x7 >>> 16 & 0xff; o[23] = x7 >>> 24 & 0xff; o[24] = x8 >>> 0 & 0xff; o[25] = x8 >>> 8 & 0xff; o[26] = x8 >>> 16 & 0xff; o[27] = x8 >>> 24 & 0xff; o[28] = x9 >>> 0 & 0xff; o[29] = x9 >>> 8 & 0xff; o[30] = x9 >>> 16 & 0xff; o[31] = x9 >>> 24 & 0xff; } function crypto_core_salsa20(out,inp,k,c) { core_salsa20(out,inp,k,c); } function crypto_core_hsalsa20(out,inp,k,c) { core_hsalsa20(out,inp,k,c); } var sigma = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]); // "expand 32-byte k" function crypto_stream_salsa20_xor(c,cpos,m,mpos,b,n,k) { var z = new Uint8Array(16), x = new Uint8Array(64); var u, i; for (i = 0; i < 16; i++) z[i] = 0; for (i = 0; i < 8; i++) z[i] = n[i]; while (b >= 64) { crypto_core_salsa20(x,z,k,sigma); for (i = 0; i < 64; i++) c[cpos+i] = m[mpos+i] ^ x[i]; u = 1; for (i = 8; i < 16; i++) { u = u + (z[i] & 0xff) | 0; z[i] = u & 0xff; u >>>= 8; } b -= 64; cpos += 64; mpos += 64; } if (b > 0) { crypto_core_salsa20(x,z,k,sigma); for (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 z = new Uint8Array(16), x = new Uint8Array(64); var u, i; for (i = 0; i < 16; i++) z[i] = 0; for (i = 0; i < 8; i++) z[i] = n[i]; while (b >= 64) { crypto_core_salsa20(x,z,k,sigma); for (i = 0; i < 64; i++) c[cpos+i] = x[i]; u = 1; for (i = 8; i < 16; i++) { u = u + (z[i] & 0xff) | 0; z[i] = u & 0xff; u >>>= 8; } b -= 64; cpos += 64; } if (b > 0) { crypto_core_salsa20(x,z,k,sigma); for (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); var sn = new Uint8Array(8); for (var 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); var sn = new Uint8Array(8); for (var i = 0; i < 8; i++) sn[i] = n[i+16]; return crypto_stream_salsa20_xor(c,cpos,m,mpos,d,sn,s); } /* * Port of Andrew Moon's Poly1305-donna-16. Public domain. * https://github.com/floodyberry/poly1305-donna */ var poly1305 = function(key) { 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; var t0, t1, t2, t3, t4, t5, t6, t7; t0 = key[ 0] & 0xff | (key[ 1] & 0xff) << 8; this.r[0] = ( t0 ) & 0x1fff; t1 = key[ 2] & 0xff | (key[ 3] & 0xff) << 8; this.r[1] = ((t0 >>> 13) | (t1 << 3)) & 0x1fff; t2 = key[ 4] & 0xff | (key[ 5] & 0xff) << 8; this.r[2] = ((t1 >>> 10) | (t2 << 6)) & 0x1f03; t3 = key[ 6] & 0xff | (key[ 7] & 0xff) << 8; this.r[3] = ((t2 >>> 7) | (t3 << 9)) & 0x1fff; t4 = key[ 8] & 0xff | (key[ 9] & 0xff) << 8; this.r[4] = ((t3 >>> 4) | (t4 << 12)) & 0x00ff; this.r[5] = ((t4 >>> 1)) & 0x1ffe; t5 = key[10] & 0xff | (key[11] & 0xff) << 8; this.r[6] = ((t4 >>> 14) | (t5 << 2)) & 0x1fff; t6 = key[12] & 0xff | (key[13] & 0xff) << 8; this.r[7] = ((t5 >>> 11) | (t6 << 5)) & 0x1f81; t7 = key[14] & 0xff | (key[15] & 0xff) << 8; this.r[8] = ((t6 >>> 8) | (t7 << 8)) & 0x1fff; this.r[9] = ((t7 >>> 5)) & 0x007f; this.pad[0] = key[16] & 0xff | (key[17] & 0xff) << 8; this.pad[1] = key[18] & 0xff | (key[19] & 0xff) << 8; this.pad[2] = key[20] & 0xff | (key[21] & 0xff) << 8; this.pad[3] = key[22] & 0xff | (key[23] & 0xff) << 8; this.pad[4] = key[24] & 0xff | (key[25] & 0xff) << 8; this.pad[5] = key[26] & 0xff | (key[27] & 0xff) << 8; this.pad[6] = key[28] & 0xff | (key[29] & 0xff) << 8; this.pad[7] = key[30] & 0xff | (key[31] & 0xff) << 8; }; poly1305.prototype.blocks = function(m, mpos, bytes) { var hibit = this.fin ? 0 : (1 << 11); var t0, t1, t2, t3, t4, t5, t6, t7, c; var d0, d1, d2, d3, d4, d5, d6, d7, d8, d9; var 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]; var 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]; while (bytes >= 16) { t0 = m[mpos+ 0] & 0xff | (m[mpos+ 1] & 0xff) << 8; h0 += ( t0 ) & 0x1fff; t1 = m[mpos+ 2] & 0xff | (m[mpos+ 3] & 0xff) << 8; h1 += ((t0 >>> 13) | (t1 << 3)) & 0x1fff; t2 = m[mpos+ 4] & 0xff | (m[mpos+ 5] & 0xff) << 8; h2 += ((t1 >>> 10) | (t2 << 6)) & 0x1fff; t3 = m[mpos+ 6] & 0xff | (m[mpos+ 7] & 0xff) << 8; h3 += ((t2 >>> 7) | (t3 << 9)) & 0x1fff; t4 = m[mpos+ 8] & 0xff | (m[mpos+ 9] & 0xff) << 8; h4 += ((t3 >>> 4) | (t4 << 12)) & 0x1fff; h5 += ((t4 >>> 1)) & 0x1fff; t5 = m[mpos+10] & 0xff | (m[mpos+11] & 0xff) << 8; h6 += ((t4 >>> 14) | (t5 << 2)) & 0x1fff; t6 = m[mpos+12] & 0xff | (m[mpos+13] & 0xff) << 8; h7 += ((t5 >>> 11) | (t6 << 5)) & 0x1fff; t7 = m[mpos+14] & 0xff | (m[mpos+15] & 0xff) << 8; h8 += ((t6 >>> 8) | (t7 << 8)) & 0x1fff; h9 += ((t7 >>> 5)) | hibit; c = 0; d0 = c; d0 += h0 * r0; d0 += h1 * (5 * r9); d0 += h2 * (5 * r8); d0 += h3 * (5 * r7); d0 += h4 * (5 * r6); c = (d0 >>> 13); d0 &= 0x1fff; d0 += h5 * (5 * r5); d0 += h6 * (5 * r4); d0 += h7 * (5 * r3); d0 += h8 * (5 * r2); d0 += h9 * (5 * r1); c += (d0 >>> 13); d0 &= 0x1fff; d1 = c; d1 += h0 * r1; d1 += h1 * r0; d1 += h2 * (5 * r9); d1 += h3 * (5 * r8); d1 += h4 * (5 * r7); c = (d1 >>> 13); d1 &= 0x1fff; d1 += h5 * (5 * r6); d1 += h6 * (5 * r5); d1 += h7 * (5 * r4); d1 += h8 * (5 * r3); d1 += h9 * (5 * r2); c += (d1 >>> 13); d1 &= 0x1fff; d2 = c; d2 += h0 * r2; d2 += h1 * r1; d2 += h2 * r0; d2 += h3 * (5 * r9); d2 += h4 * (5 * r8); c = (d2 >>> 13); d2 &= 0x1fff; d2 += h5 * (5 * r7); d2 += h6 * (5 * r6); d2 += h7 * (5 * r5); d2 += h8 * (5 * r4); d2 += h9 * (5 * r3); c += (d2 >>> 13); d2 &= 0x1fff; d3 = c; d3 += h0 * r3; d3 += h1 * r2; d3 += h2 * r1; d3 += h3 * r0; d3 += h4 * (5 * r9); c = (d3 >>> 13); d3 &= 0x1fff; d3 += h5 * (5 * r8); d3 += h6 * (5 * r7); d3 += h7 * (5 * r6); d3 += h8 * (5 * r5); d3 += h9 * (5 * r4); c += (d3 >>> 13); d3 &= 0x1fff; d4 = c; d4 += h0 * r4; d4 += h1 * r3; d4 += h2 * r2; d4 += h3 * r1; d4 += h4 * r0; c = (d4 >>> 13); d4 &= 0x1fff; d4 += h5 * (5 * r9); d4 += h6 * (5 * r8); d4 += h7 * (5 * r7); d4 += h8 * (5 * r6); d4 += h9 * (5 * r5); c += (d4 >>> 13); d4 &= 0x1fff; d5 = c; d5 += h0 * r5; d5 += h1 * r4; d5 += h2 * r3; d5 += h3 * r2; d5 += h4 * r1; c = (d5 >>> 13); d5 &= 0x1fff; d5 += h5 * r0; d5 += h6 * (5 * r9); d5 += h7 * (5 * r8); d5 += h8 * (5 * r7); d5 += h9 * (5 * r6); c += (d5 >>> 13); d5 &= 0x1fff; d6 = c; d6 += h0 * r6; d6 += h1 * r5; d6 += h2 * r4; d6 += h3 * r3; d6 += h4 * r2; c = (d6 >>> 13); d6 &= 0x1fff; d6 += h5 * r1; d6 += h6 * r0; d6 += h7 * (5 * r9); d6 += h8 * (5 * r8); d6 += h9 * (5 * r7); c += (d6 >>> 13); d6 &= 0x1fff; d7 = c; d7 += h0 * r7; d7 += h1 * r6; d7 += h2 * r5; d7 += h3 * r4; d7 += h4 * r3; c = (d7 >>> 13); d7 &= 0x1fff; d7 += h5 * r2; d7 += h6 * r1; d7 += h7 * r0; d7 += h8 * (5 * r9); d7 += h9 * (5 * r8); c += (d7 >>> 13); d7 &= 0x1fff; d8 = c; d8 += h0 * r8; d8 += h1 * r7; d8 += h2 * r6; d8 += h3 * r5; d8 += h4 * r4; c = (d8 >>> 13); d8 &= 0x1fff; d8 += h5 * r3; d8 += h6 * r2; d8 += h7 * r1; d8 += h8 * r0; d8 += h9 * (5 * r9); c += (d8 >>> 13); d8 &= 0x1fff; d9 = c; d9 += h0 * r9; d9 += h1 * r8; d9 += h2 * r7; d9 += h3 * r6; d9 += h4 * r5; c = (d9 >>> 13); d9 &= 0x1fff; d9 += h5 * r4; d9 += h6 * r3; d9 += h7 * r2; d9 += h8 * r1; d9 += h9 * r0; c += (d9 >>> 13); d9 &= 0x1fff; c = (((c << 2) + c)) | 0; c = (c + d0) | 0; d0 = c & 0x1fff; c = (c >>> 13); d1 += c; h0 = d0; h1 = d1; h2 = d2; h3 = d3; h4 = d4; h5 = d5; h6 = d6; h7 = d7; h8 = d8; h9 = d9; 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 g = new Uint16Array(10); var c, mask, f, i; if (this.leftover) { i = this.leftover; this.buffer[i++] = 1; for (; i < 16; i++) this.buffer[i] = 0; this.fin = 1; this.blocks(this.buffer, 0, 16); } c = this.h[1] >>> 13; this.h[1] &= 0x1fff; for (i = 2; i < 10; i++) { this.h[i] += c; c = this.h[i] >>> 13; this.h[i] &= 0x1fff; } this.h[0] += (c * 5); c = this.h[0] >>> 13; this.h[0] &= 0x1fff; this.h[1] += c; c = this.h[1] >>> 13; this.h[1] &= 0x1fff; this.h[2] += c; g[0] = this.h[0] + 5; c = g[0] >>> 13; g[0] &= 0x1fff; for (i = 1; i < 10; i++) { g[i] = this.h[i] + c; c = g[i] >>> 13; g[i] &= 0x1fff; } g[9] -= (1 << 13); mask = (c ^ 1) - 1; for (i = 0; i < 10; i++) g[i] &= mask; mask = ~mask; for (i = 0; i < 10; i++) this.h[i] = (this.h[i] & mask) | g[i]; this.h[0] = ((this.h[0] ) | (this.h[1] << 13) ) & 0xffff; this.h[1] = ((this.h[1] >>> 3) | (this.h[2] << 10) ) & 0xffff; this.h[2] = ((this.h[2] >>> 6) | (this.h[3] << 7) ) & 0xffff; this.h[3] = ((this.h[3] >>> 9) | (this.h[4] << 4) ) & 0xffff; this.h[4] = ((this.h[4] >>> 12) | (this.h[5] << 1) | (this.h[6] << 14)) & 0xffff; this.h[5] = ((this.h[6] >>> 2) | (this.h[7] << 11) ) & 0xffff; this.h[6] = ((this.h[7] >>> 5) | (this.h[8] << 8) ) & 0xffff; this.h[7] = ((this.h[8] >>> 8) | (this.h[9] << 5) ) & 0xffff; f = this.h[0] + this.pad[0]; this.h[0] = f & 0xffff; for (i = 1; i < 8; i++) { f = (((this.h[i] + this.pad[i]) | 0) + (f >>> 16)) | 0; this.h[i] = f & 0xffff; } mac[macpos+ 0] = (this.h[0] >>> 0) & 0xff; mac[macpos+ 1] = (this.h[0] >>> 8) & 0xff; mac[macpos+ 2] = (this.h[1] >>> 0) & 0xff; mac[macpos+ 3] = (this.h[1] >>> 8) & 0xff; mac[macpos+ 4] = (this.h[2] >>> 0) & 0xff; mac[macpos+ 5] = (this.h[2] >>> 8) & 0xff; mac[macpos+ 6] = (this.h[3] >>> 0) & 0xff; mac[macpos+ 7] = (this.h[3] >>> 8) & 0xff; mac[macpos+ 8] = (this.h[4] >>> 0) & 0xff; mac[macpos+ 9] = (this.h[4] >>> 8) & 0xff; mac[macpos+10] = (this.h[5] >>> 0) & 0xff; mac[macpos+11] = (this.h[5] >>> 8) & 0xff; mac[macpos+12] = (this.h[6] >>> 0) & 0xff; mac[macpos+13] = (this.h[6] >>> 8) & 0xff; mac[macpos+14] = (this.h[7] >>> 0) & 0xff; mac[macpos+15] = (this.h[7] >>> 8) & 0xff; }; poly1305.prototype.update = function(m, mpos, bytes) { var i, want; if (this.leftover) { want = (16 - this.leftover); if (want > bytes) want = bytes; for (i = 0; i < want; i++) this.buffer[this.leftover + i] = m[mpos+i]; bytes -= want; mpos += want; this.leftover += want; if (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; } if (bytes) { for (i = 0; i < bytes; i++) this.buffer[this.leftover + i] = m[mpos+i]; this.leftover += bytes; } }; function crypto_onetimeauth(out, outpos, m, mpos, n, k) { var s = new poly1305(k); s.update(m, mpos, n); s.finish(out, outpos); return 0; } function crypto_onetimeauth_verify(h, hpos, m, mpos, n, k) { var x = new Uint8Array(16); crypto_onetimeauth(x,0,m,mpos,n,k); return crypto_verify_16(h,hpos,x,0); } function crypto_secretbox(c,m,d,n,k) { var i; if (d < 32) return -1; crypto_stream_xor(c,0,m,0,d,n,k); crypto_onetimeauth(c, 16, c, 32, d - 32, c); for (i = 0; i < 16; i++) c[i] = 0; return 0; } function crypto_secretbox_open(m,c,d,n,k) { var i; var x = new Uint8Array(32); if (d < 32) return -1; crypto_stream(x,0,32,n,k); if (crypto_onetimeauth_verify(c, 16,c, 32,d - 32,x) !== 0) return -1; crypto_stream_xor(m,0,c,0,d,n,k); for (i = 0; i < 32; i++) m[i] = 0; return 0; } function set25519(r, a) { var i; for (i = 0; i < 16; i++) r[i] = a[i]|0; } 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 - c * 65536; } o[0] += c-1 + 37 * (c-1); } function sel25519(p, q, b) { var t, c = ~(b-1); for (var 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; var m = gf(), t = gf(); for (i = 0; i < 16; i++) t[i] = n[i]; car25519(t); car25519(t); car25519(t); for (j = 0; j < 2; j++) { m[0] = t[0] - 0xffed; for (i = 1; i < 15; i++) { m[i] = t[i] - 0xffff - ((m[i-1]>>16) & 1); m[i-1] &= 0xffff; } m[15] = t[15] - 0x7fff - ((m[14]>>16) & 1); b = (m[15]>>16) & 1; m[14] &= 0xffff; sel25519(t, m, 1-b); } for (i = 0; i < 16; i++) { o[2*i] = t[i] & 0xff; o[2*i+1] = t[i]>>8; } } function neq25519(a, b) { var c = new Uint8Array(32), d = new Uint8Array(32); pack25519(c, a); pack25519(d, b); return crypto_verify_32(c, 0, d, 0); } function par25519(a) { var d = new Uint8Array(32); pack25519(d, a); return d[0] & 1; } function unpack25519(o, n) { var i; for (i = 0; i < 16; i++) o[i] = n[2*i] + (n[2*i+1] << 8); o[15] &= 0x7fff; } 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]; v = a[0]; t0 += v * 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; v = a[1]; t1 += v * 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; v = a[2]; t2 += v * 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; v = a[3]; t3 += v * 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; v = a[4]; t4 += v * 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; v = a[5]; t5 += v * 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; v = a[6]; t6 += v * 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; v = a[7]; t7 += v * 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; v = a[8]; t8 += v * 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; v = a[9]; t9 += v * 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; v = a[10]; t10 += v * 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; v = a[11]; t11 += v * 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; v = a[12]; t12 += v * 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; v = a[13]; t13 += v * 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; v = a[14]; t14 += v * 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; v = a[15]; t15 += v * b0; t16 += v * b1; t17 += v * b2; t18 += v * b3; t19 += v * b4; t20 += v * b5; t21 += v * b6; t22 += v * b7; t23 += v * b8; t24 += v * b9; t25 += v * b10; t26 += v * b11; t27 += v * b12; t28 += v * b13; t29 += v * b14; t30 += v * b15; t0 += 38 * t16; t1 += 38 * t17; t2 += 38 * t18; t3 += 38 * t19; t4 += 38 * t20; t5 += 38 * t21; t6 += 38 * t22; t7 += 38 * t23; t8 += 38 * t24; t9 += 38 * t25; t10 += 38 * t26; t11 += 38 * t27; t12 += 38 * t28; t13 += 38 * t29; t14 += 38 * t30; // t15 left as is // first car c = 1; v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536; v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536; v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536; v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536; v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536; v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536; v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536; v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536; v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536; v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536; v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536; v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536; v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536; v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536; v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536; v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536; t0 += c-1 + 37 * (c-1); // second car c = 1; v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536; v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536; v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536; v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536; v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536; v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536; v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536; v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536; v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536; v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536; v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536; v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536; v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536; v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536; v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536; v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 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 c = gf(); var a; for (a = 0; a < 16; a++) c[a] = i[a]; for (a = 253; a >= 0; a--) { S(c, c); if(a !== 2 && a !== 4) M(c, c, i); } for (a = 0; a < 16; a++) o[a] = c[a]; } function pow2523(o, i) { var c = gf(); var a; for (a = 0; a < 16; a++) c[a] = i[a]; for (a = 250; a >= 0; a--) { S(c, c); if(a !== 1) M(c, c, i); } for (a = 0; a < 16; a++) o[a] = c[a]; } function crypto_scalarmult(q, n, p) { var z = new Uint8Array(32); var x = new Float64Array(80), r, i; var a = gf(), b = gf(), c = gf(), d = gf(), e = gf(), f = gf(); for (i = 0; i < 31; i++) z[i] = n[i]; z[31]=(n[31]&127)|64; z[0]&=248; unpack25519(x,p); for (i = 0; i < 16; i++) { b[i]=x[i]; d[i]=a[i]=c[i]=0; } a[0]=d[0]=1; for (i=254; i>=0; --i) { r=(z[i>>>3]>>>(i&7))&1; sel25519(a,b,r); 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); var x16 = x.subarray(16); inv25519(x32,x32); M(x16,x16,x32); pack25519(q,x16); return 0; } function crypto_scalarmult_base(q, n) { return crypto_scalarmult(q, n, _9); } function crypto_box_keypair(y, x) { randombytes(x, 32); return crypto_scalarmult_base(y, x); } function crypto_box_beforenm(k, y, x) { var s = new Uint8Array(32); crypto_scalarmult(s, x, y); return crypto_core_hsalsa20(k, _0, s, sigma); } var crypto_box_afternm = crypto_secretbox; var crypto_box_open_afternm = crypto_secretbox_open; function crypto_box(c, m, d, n, y, x) { var k = new Uint8Array(32); crypto_box_beforenm(k, y, x); return crypto_box_afternm(c, m, d, n, k); } function crypto_box_open(m, c, d, n, y, x) { var k = new Uint8Array(32); crypto_box_beforenm(k, y, x); return crypto_box_open_afternm(m, c, d, n, k); } var K = [ 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd, 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc, 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019, 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118, 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe, 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2, 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1, 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694, 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3, 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65, 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483, 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5, 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210, 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4, 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725, 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70, 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926, 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df, 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8, 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b, 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001, 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30, 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910, 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8, 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53, 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8, 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb, 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3, 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60, 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec, 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9, 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b, 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207, 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178, 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6, 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b, 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493, 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c, 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a, 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817 ]; function crypto_hashblocks_hl(hh, hl, m, n) { var wh = new Int32Array(16), wl = new Int32Array(16), 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; var 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]; var pos = 0; while (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++) { bh0 = ah0; bh1 = ah1; bh2 = ah2; bh3 = ah3; bh4 = ah4; bh5 = ah5; bh6 = ah6; bh7 = ah7; bl0 = al0; bl1 = al1; bl2 = al2; bl3 = al3; bl4 = al4; bl5 = al5; bl6 = al6; bl7 = al7; // add h = ah7; l = al7; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; // Sigma1 h = ((ah4 >>> 14) | (al4 << (32-14))) ^ ((ah4 >>> 18) | (al4 << (32-18))) ^ ((al4 >>> (41-32)) | (ah4 << (32-(41-32)))); l = ((al4 >>> 14) | (ah4 << (32-14))) ^ ((al4 >>> 18) | (ah4 << (32-18))) ^ ((ah4 >>> (41-32)) | (al4 << (32-(41-32)))); a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; // Ch h = (ah4 & ah5) ^ (~ah4 & ah6); l = (al4 & al5) ^ (~al4 & al6); a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; // K h = K[i*2]; l = K[i*2+1]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; // w h = wh[i%16]; l = wl[i%16]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; th = c & 0xffff | d << 16; tl = a & 0xffff | b << 16; // add h = th; l = tl; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; // Sigma0 h = ((ah0 >>> 28) | (al0 << (32-28))) ^ ((al0 >>> (34-32)) | (ah0 << (32-(34-32)))) ^ ((al0 >>> (39-32)) | (ah0 << (32-(39-32)))); l = ((al0 >>> 28) | (ah0 << (32-28))) ^ ((ah0 >>> (34-32)) | (al0 << (32-(34-32)))) ^ ((ah0 >>> (39-32)) | (al0 << (32-(39-32)))); a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; // Maj h = (ah0 & ah1) ^ (ah0 & ah2) ^ (ah1 & ah2); l = (al0 & al1) ^ (al0 & al2) ^ (al1 & al2); a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; bh7 = (c & 0xffff) | (d << 16); bl7 = (a & 0xffff) | (b << 16); // add h = bh3; l = bl3; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; h = th; l = tl; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; bh3 = (c & 0xffff) | (d << 16); bl3 = (a & 0xffff) | (b << 16); ah1 = bh0; ah2 = bh1; ah3 = bh2; ah4 = bh3; ah5 = bh4; ah6 = bh5; ah7 = bh6; ah0 = bh7; al1 = bl0; al2 = bl1; al3 = bl2; al4 = bl3; al5 = bl4; al6 = bl5; al7 = bl6; al0 = bl7; if (i%16 === 15) { for (j = 0; j < 16; j++) { // add h = wh[j]; l = wl[j]; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; h = wh[(j+9)%16]; l = wl[(j+9)%16]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; // sigma0 th = wh[(j+1)%16]; tl = wl[(j+1)%16]; h = ((th >>> 1) | (tl << (32-1))) ^ ((th >>> 8) | (tl << (32-8))) ^ (th >>> 7); l = ((tl >>> 1) | (th << (32-1))) ^ ((tl >>> 8) | (th << (32-8))) ^ ((tl >>> 7) | (th << (32-7))); a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; // sigma1 th = wh[(j+14)%16]; tl = wl[(j+14)%16]; h = ((th >>> 19) | (tl << (32-19))) ^ ((tl >>> (61-32)) | (th << (32-(61-32)))) ^ (th >>> 6); l = ((tl >>> 19) | (th << (32-19))) ^ ((th >>> (61-32)) | (tl << (32-(61-32)))) ^ ((tl >>> 6) | (th << (32-6))); a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; wh[j] = (c & 0xffff) | (d << 16); wl[j] = (a & 0xffff) | (b << 16); } } } // add h = ah0; l = al0; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; h = hh[0]; l = hl[0]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; hh[0] = ah0 = (c & 0xffff) | (d << 16); hl[0] = al0 = (a & 0xffff) | (b << 16); h = ah1; l = al1; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; h = hh[1]; l = hl[1]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; hh[1] = ah1 = (c & 0xffff) | (d << 16); hl[1] = al1 = (a & 0xffff) | (b << 16); h = ah2; l = al2; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; h = hh[2]; l = hl[2]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; hh[2] = ah2 = (c & 0xffff) | (d << 16); hl[2] = al2 = (a & 0xffff) | (b << 16); h = ah3; l = al3; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; h = hh[3]; l = hl[3]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; hh[3] = ah3 = (c & 0xffff) | (d << 16); hl[3] = al3 = (a & 0xffff) | (b << 16); h = ah4; l = al4; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; h = hh[4]; l = hl[4]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; hh[4] = ah4 = (c & 0xffff) | (d << 16); hl[4] = al4 = (a & 0xffff) | (b << 16); h = ah5; l = al5; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; h = hh[5]; l = hl[5]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; hh[5] = ah5 = (c & 0xffff) | (d << 16); hl[5] = al5 = (a & 0xffff) | (b << 16); h = ah6; l = al6; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; h = hh[6]; l = hl[6]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; hh[6] = ah6 = (c & 0xffff) | (d << 16); hl[6] = al6 = (a & 0xffff) | (b << 16); h = ah7; l = al7; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; h = hh[7]; l = hl[7]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; hh[7] = ah7 = (c & 0xffff) | (d << 16); hl[7] = al7 = (a & 0xffff) | (b << 16); pos += 128; n -= 128; } return n; } function crypto_hash(out, m, n) { var hh = new Int32Array(8), hl = new Int32Array(8), x = new Uint8Array(256), i, b = n; hh[0] = 0x6a09e667; hh[1] = 0xbb67ae85; hh[2] = 0x3c6ef372; hh[3] = 0xa54ff53a; hh[4] = 0x510e527f; hh[5] = 0x9b05688c; hh[6] = 0x1f83d9ab; hh[7] = 0x5be0cd19; hl[0] = 0xf3bcc908; hl[1] = 0x84caa73b; hl[2] = 0xfe94f82b; hl[3] = 0x5f1d36f1; hl[4] = 0xade682d1; hl[5] = 0x2b3e6c1f; hl[6] = 0xfb41bd6b; hl[7] = 0x137e2179; crypto_hashblocks_hl(hh, hl, m, n); n %= 128; for (i = 0; i < n; i++) x[i] = m[b-n+i]; x[n] = 128; n = 256-128*(n<112?1:0); x[n-9] = 0; ts64(x, n-8, (b / 0x20000000) | 0, b << 3); crypto_hashblocks_hl(hh, hl, x, n); for (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; set25519(p[0], gf0); set25519(p[1], gf1); set25519(p[2], gf1); set25519(p[3], gf0); for (i = 255; i >= 0; --i) { b = (s[(i/8)|0] >> (i&7)) & 1; cswap(p, q, b); 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 d = new Uint8Array(64); var p = [gf(), gf(), gf(), gf()]; var i; if (!seeded) randombytes(sk, 32); crypto_hash(d, sk, 32); d[0] &= 248; d[31] &= 127; d[31] |= 64; scalarbase(p, d); pack(pk, p); for (i = 0; i < 32; i++) sk[i+32] = pk[i]; return 0; } var L = new Float64Array([0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10]); function modL(r, x) { var carry, i, j, k; for (i = 63; i >= 32; --i) { carry = 0; for (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] -= carry * 256; } x[j] += carry; x[i] = 0; } carry = 0; for (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] = x[i] & 255; } } function reduce(r) { var x = new Float64Array(64), i; for (i = 0; i < 64; i++) x[i] = r[i]; for (i = 0; i < 64; i++) r[i] = 0; modL(r, x); } // Note: difference from C - smlen returned, not passed as argument. function crypto_sign(sm, m, n, sk) { var d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64); var i, j, x = new Float64Array(64); var 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]; crypto_hash(r, sm.subarray(32), n+32); reduce(r); scalarbase(p, r); pack(sm, p); for (i = 32; i < 64; i++) sm[i] = sk[i]; crypto_hash(h, sm, n + 64); reduce(h); for (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]; } } modL(sm.subarray(32), x); return smlen; } function unpackneg(r, p) { var t = gf(), chk = gf(), num = gf(), den = gf(), den2 = gf(), den4 = gf(), den6 = gf(); 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); pow2523(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); if (neq25519(chk, num)) M(r[0], r[0], I); S(chk, r[0]); M(chk, chk, den); if (neq25519(chk, num)) return -1; if (par25519(r[0]) === (p[31]>>7)) Z(r[0], gf0, r[0]); M(r[3], r[0], r[1]); return 0; } function crypto_sign_open(m, sm, n, pk) { var i, mlen; var t = new Uint8Array(32), h = new Uint8Array(64); var p = [gf(), gf(), gf(), gf()], q = [gf(), gf(), gf(), gf()]; mlen = -1; if (n < 64) return -1; if (unpackneg(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]; crypto_hash(h, m, n); reduce(h); scalarmult(p, q, h); scalarbase(q, sm.subarray(32)); add(p, q); pack(t, p); n -= 64; if (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]; mlen = n; return mlen; } var 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 = crypto_secretbox_NONCEBYTES, crypto_box_ZEROBYTES = crypto_secretbox_ZEROBYTES, crypto_box_BOXZEROBYTES = crypto_secretbox_BOXZEROBYTES, crypto_sign_BYTES = 64, crypto_sign_PUBLICKEYBYTES = 32, crypto_sign_SECRETKEYBYTES = 64, crypto_sign_SEEDBYTES = 32, crypto_hash_BYTES = 64; 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: crypto_box, crypto_box_open: crypto_box_open, 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: crypto_secretbox_KEYBYTES, crypto_secretbox_NONCEBYTES: crypto_secretbox_NONCEBYTES, crypto_secretbox_ZEROBYTES: crypto_secretbox_ZEROBYTES, crypto_secretbox_BOXZEROBYTES: crypto_secretbox_BOXZEROBYTES, crypto_scalarmult_BYTES: crypto_scalarmult_BYTES, crypto_scalarmult_SCALARBYTES: crypto_scalarmult_SCALARBYTES, crypto_box_PUBLICKEYBYTES: crypto_box_PUBLICKEYBYTES, crypto_box_SECRETKEYBYTES: crypto_box_SECRETKEYBYTES, crypto_box_BEFORENMBYTES: crypto_box_BEFORENMBYTES, crypto_box_NONCEBYTES: crypto_box_NONCEBYTES, crypto_box_ZEROBYTES: crypto_box_ZEROBYTES, crypto_box_BOXZEROBYTES: crypto_box_BOXZEROBYTES, crypto_sign_BYTES: crypto_sign_BYTES, crypto_sign_PUBLICKEYBYTES: crypto_sign_PUBLICKEYBYTES, crypto_sign_SECRETKEYBYTES: crypto_sign_SECRETKEYBYTES, crypto_sign_SEEDBYTES: crypto_sign_SEEDBYTES, crypto_hash_BYTES: crypto_hash_BYTES }; /* High-level API */ function checkLengths(k, n) { if (k.length !== crypto_secretbox_KEYBYTES) throw new Error('bad key size'); if (n.length !== crypto_secretbox_NONCEBYTES) throw new Error('bad nonce size'); } function checkBoxLengths(pk, sk) { if (pk.length !== crypto_box_PUBLICKEYBYTES) throw new Error('bad public key size'); if (sk.length !== crypto_box_SECRETKEYBYTES) throw new Error('bad secret key size'); } function checkArrayTypes() { var t, i; for (i = 0; i < arguments.length; i++) { if ((t = Object.prototype.toString.call(arguments[i])) !== '[object Uint8Array]') throw new TypeError('unexpected type ' + t + ', use Uint8Array'); } } function cleanup(arr) { for (var i = 0; i < arr.length; i++) arr[i] = 0; } // TODO: Completely remove this in v0.15. if (!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); randombytes(b, n); return b; }; nacl.secretbox = function(msg, nonce, key) { checkArrayTypes(msg, nonce, key); checkLengths(key, nonce); var m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.length); var c = new Uint8Array(m.length); for (var i = 0; i < msg.length; i++) m[i+crypto_secretbox_ZEROBYTES] = msg[i]; crypto_secretbox(c, m, m.length, nonce, key); return c.subarray(crypto_secretbox_BOXZEROBYTES); }; nacl.secretbox.open = function(box, nonce, key) { checkArrayTypes(box, nonce, key); checkLengths(key, nonce); var c = new Uint8Array(crypto_secretbox_BOXZEROBYTES + box.length); var m = new Uint8Array(c.length); for (var i = 0; i < box.length; i++) c[i+crypto_secretbox_BOXZEROBYTES] = box[i]; if (c.length < 32) return false; if (crypto_secretbox_open(m, c, c.length, nonce, key) !== 0) return false; return m.subarray(crypto_secretbox_ZEROBYTES); }; nacl.secretbox.keyLength = crypto_secretbox_KEYBYTES; nacl.secretbox.nonceLength = crypto_secretbox_NONCEBYTES; nacl.secretbox.overheadLength = crypto_secretbox_BOXZEROBYTES; nacl.scalarMult = function(n, p) { checkArrayTypes(n, p); if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size'); if (p.length !== crypto_scalarmult_BYTES) throw new Error('bad p size'); var q = new Uint8Array(crypto_scalarmult_BYTES); crypto_scalarmult(q, n, p); return q; }; nacl.scalarMult.base = function(n) { checkArrayTypes(n); if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size'); var q = new Uint8Array(crypto_scalarmult_BYTES); crypto_scalarmult_base(q, n); return q; }; nacl.scalarMult.scalarLength = crypto_scalarmult_SCALARBYTES; nacl.scalarMult.groupElementLength = crypto_scalarmult_BYTES; 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); checkBoxLengths(publicKey, secretKey); var k = new Uint8Array(crypto_box_BEFORENMBYTES); crypto_box_beforenm(k, publicKey, secretKey); return 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(crypto_box_PUBLICKEYBYTES); var sk = new Uint8Array(crypto_box_SECRETKEYBYTES); crypto_box_keypair(pk, sk); return {publicKey: pk, secretKey: sk}; }; nacl.box.keyPair.fromSecretKey = function(secretKey) { checkArrayTypes(secretKey); if (secretKey.length !== crypto_box_SECRETKEYBYTES) throw new Error('bad secret key size'); var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES); crypto_scalarmult_base(pk, secretKey); return {publicKey: pk, secretKey: new Uint8Array(secretKey)}; }; nacl.box.publicKeyLength = crypto_box_PUBLICKEYBYTES; nacl.box.secretKeyLength = crypto_box_SECRETKEYBYTES; nacl.box.sharedKeyLength = crypto_box_BEFORENMBYTES; nacl.box.nonceLength = crypto_box_NONCEBYTES; nacl.box.overheadLength = nacl.secretbox.overheadLength; nacl.sign = function(msg, secretKey) { checkArrayTypes(msg, secretKey); if (secretKey.length !== crypto_sign_SECRETKEYBYTES) throw new Error('bad secret key size'); var signedMsg = new Uint8Array(crypto_sign_BYTES+msg.length); crypto_sign(signedMsg, msg, msg.length, secretKey); return signedMsg; }; nacl.sign.open = function(signedMsg, publicKey) { if (arguments.length !== 2) throw new Error('nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?'); checkArrayTypes(signedMsg, publicKey); if (publicKey.length !== crypto_sign_PUBLICKEYBYTES) throw new Error('bad public key size'); var tmp = new Uint8Array(signedMsg.length); var mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey); if (mlen < 0) return null; var m = new Uint8Array(mlen); for (var i = 0; i < m.length; i++) m[i] = tmp[i]; return m; }; nacl.sign.detached = function(msg, secretKey) { var signedMsg = nacl.sign(msg, secretKey); var sig = new Uint8Array(crypto_sign_BYTES); for (var i = 0; i < sig.length; i++) sig[i] = signedMsg[i]; return sig; }; nacl.sign.detached.verify = function(msg, sig, publicKey) { checkArrayTypes(msg, sig, publicKey); if (sig.length !== crypto_sign_BYTES) throw new Error('bad signature size'); if (publicKey.length !== crypto_sign_PUBLICKEYBYTES) throw new Error('bad public key size'); var sm = new Uint8Array(crypto_sign_BYTES + msg.length); var m = new Uint8Array(crypto_sign_BYTES + msg.length); var i; for (i = 0; i < crypto_sign_BYTES; i++) sm[i] = sig[i]; for (i = 0; i < msg.length; i++) sm[i+crypto_sign_BYTES] = msg[i]; return (crypto_sign_open(m, sm, sm.length, publicKey) >= 0); }; nacl.sign.keyPair = function() { var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES); crypto_sign_keypair(pk, sk); return {publicKey: pk, secretKey: sk}; }; nacl.sign.keyPair.fromSecretKey = function(secretKey) { checkArrayTypes(secretKey); if (secretKey.length !== crypto_sign_SECRETKEYBYTES) throw new Error('bad secret key size'); var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); for (var i = 0; i < pk.length; i++) pk[i] = secretKey[32+i]; return {publicKey: pk, secretKey: new Uint8Array(secretKey)}; }; nacl.sign.keyPair.fromSeed = function(seed) { checkArrayTypes(seed); if (seed.length !== crypto_sign_SEEDBYTES) throw new Error('bad seed size'); var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES); for (var i = 0; i < 32; i++) sk[i] = seed[i]; crypto_sign_keypair(pk, sk, true); return {publicKey: pk, secretKey: sk}; }; nacl.sign.publicKeyLength = crypto_sign_PUBLICKEYBYTES; nacl.sign.secretKeyLength = crypto_sign_SECRETKEYBYTES; nacl.sign.seedLength = crypto_sign_SEEDBYTES; nacl.sign.signatureLength = crypto_sign_BYTES; nacl.hash = function(msg) { checkArrayTypes(msg); var h = new Uint8Array(crypto_hash_BYTES); crypto_hash(h, msg, msg.length); return h; }; nacl.hash.hashLength = crypto_hash_BYTES; nacl.verify = function(x, y) { checkArrayTypes(x, y); // Zero length arguments are considered not equal. if (x.length === 0 || y.length === 0) return false; if (x.length !== y.length) return false; return (vn(x, 0, y, 0, x.length) === 0) ? true : false; }; nacl.setPRNG = function(fn) { randombytes = fn; }; (function() { // Initialize PRNG if environment provides CSPRNG. // If not, methods calling randombytes will throw. var crypto = typeof self !== 'undefined' ? (self.crypto || self.msCrypto) : null; if (crypto && crypto.getRandomValues) { // Browsers. var QUOTA = 65536; nacl.setPRNG(function(x, n) { var i, v = new Uint8Array(n); for (i = 0; i < n; i += QUOTA) { crypto.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA))); } for (i = 0; i < n; i++) x[i] = v[i]; cleanup(v); }); } else if (true) { // Node.js. crypto = __webpack_require__(94); if (crypto && 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); }); } } })(); })( true && module.exports ? module.exports : (self.nacl = self.nacl || {})); /***/ }), /* 129 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. module.exports = SSHBuffer; var assert = __webpack_require__(108); var Buffer = __webpack_require__(114).Buffer; function SSHBuffer(opts) { assert.object(opts, 'options'); if (opts.buffer !== undefined) 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); this._offset += len; return (buf); }; SSHBuffer.prototype.readString = function () { return (this.readBuffer().toString()); }; SSHBuffer.prototype.readCString = function () { var offset = this._offset; while (offset < this._buffer.length && this._buffer[offset] !== 0x00) offset++; assert.ok(offset < this._buffer.length, 'c string does not terminate'); var str = this._buffer.slice(this._offset, offset).toString(); this._offset = offset + 1; return (str); }; SSHBuffer.prototype.readInt = function () { var v = this._buffer.readUInt32BE(this._offset); this._offset += 4; return (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); this._offset += 8; return (v); }; SSHBuffer.prototype.readChar = function () { var v = this._buffer[this._offset++]; return (v); }; SSHBuffer.prototype.writeBuffer = function (buf) { while (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) { while (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) { while (this._offset + 4 > this._size) this.expand(); this._buffer.writeUInt32BE(v, this._offset); this._offset += 4; }; SSHBuffer.prototype.writeInt64 = function (v) { assert.buffer(v, 'value'); if (v.length > 8) { var lead = v.slice(0, v.length - 8); for (var 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); } while (this._offset + 8 > this._size) this.expand(); v.copy(this._buffer, this._offset); this._offset += 8; }; SSHBuffer.prototype.writeChar = function (v) { while (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) { while (this._offset + buf.length > this._size) this.expand(); buf.copy(this._buffer, this._offset); this._offset += buf.length; }; /***/ }), /* 130 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2017 Joyent, Inc. module.exports = { DiffieHellman: DiffieHellman, generateECDSA: generateECDSA, generateED25519: generateED25519 }; var assert = __webpack_require__(108); var crypto = __webpack_require__(94); var Buffer = __webpack_require__(114).Buffer; var algs = __webpack_require__(113); var utils = __webpack_require__(119); var nacl = __webpack_require__(128); var Key = __webpack_require__(112); var PrivateKey = __webpack_require__(117); var CRYPTO_HAVE_ECDH = (crypto.createECDH !== undefined); var ecdh = __webpack_require__(131); var ec = __webpack_require__(126); var jsbn = __webpack_require__(127).BigInteger; function DiffieHellman(key) { utils.assertCompatible(key, Key, [1, 4], 'key'); this._isPriv = PrivateKey.isPrivateKey(key, [1, 3]); this._algo = key.type; this._curve = key.curve; this._key = key; if (key.type === 'dsa') { if (!CRYPTO_HAVE_ECDH) { throw (new Error('Due to bugs in the node 0.10 ' + 'crypto API, node 0.12.x or later is required ' + 'to use DH')); } this._dh = crypto.createDiffieHellman( key.part.p.data, undefined, key.part.g.data, undefined); this._p = key.part.p; this._g = key.part.g; if (this._isPriv) this._dh.setPrivateKey(key.part.x.data); this._dh.setPublicKey(key.part.y.data); } else if (key.type === 'ecdsa') { if (!CRYPTO_HAVE_ECDH) { this._ecParams = new X9ECParameters(this._curve); if (this._isPriv) { this._priv = new ECPrivate( this._ecParams, key.part.d.data); } return; } var curve = { 'nistp256': 'prime256v1', 'nistp384': 'secp384r1', 'nistp521': 'secp521r1' }[key.curve]; this._dh = crypto.createECDH(curve); if (typeof (this._dh) !== 'object' || typeof (this._dh.setPrivateKey) !== 'function') { CRYPTO_HAVE_ECDH = false; DiffieHellman.call(this, key); return; } if (this._isPriv) this._dh.setPrivateKey(key.part.d.data); this._dh.setPublicKey(key.part.Q.data); } else if (key.type === 'curve25519') { if (this._isPriv) { utils.assertCompatible(key, PrivateKey, [1, 5], 'key'); this._priv = key.part.k.data; } } else { throw (new Error('DH not supported for ' + key.type + ' keys')); } } DiffieHellman.prototype.getPublicKey = function () { if (this._isPriv) return (this._key.toPublic()); return (this._key); }; DiffieHellman.prototype.getPrivateKey = function () { if (this._isPriv) return (this._key); else return (undefined); }; DiffieHellman.prototype.getKey = DiffieHellman.prototype.getPrivateKey; DiffieHellman.prototype._keyCheck = function (pk, isPub) { assert.object(pk, 'key'); if (!isPub) utils.assertCompatible(pk, PrivateKey, [1, 3], 'key'); utils.assertCompatible(pk, Key, [1, 4], 'key'); if (pk.type !== this._algo) { throw (new Error('A ' + pk.type + ' key cannot be used in ' + this._algo + ' Diffie-Hellman')); } if (pk.curve !== this._curve) { throw (new Error('A key from the ' + pk.curve + ' curve ' + 'cannot be used with a ' + this._curve + ' Diffie-Hellman')); } if (pk.type === 'dsa') { assert.deepEqual(pk.part.p, this._p, 'DSA key prime does not match'); assert.deepEqual(pk.part.g, this._g, 'DSA key generator does not match'); } }; DiffieHellman.prototype.setKey = function (pk) { this._keyCheck(pk); if (pk.type === 'dsa') { this._dh.setPrivateKey(pk.part.x.data); this._dh.setPublicKey(pk.part.y.data); } else if (pk.type === 'ecdsa') { if (CRYPTO_HAVE_ECDH) { this._dh.setPrivateKey(pk.part.d.data); this._dh.setPublicKey(pk.part.Q.data); } else { this._priv = new ECPrivate( this._ecParams, pk.part.d.data); } } else if (pk.type === 'curve25519') { var k = pk.part.k; if (!pk.part.k) k = pk.part.r; this._priv = k.data; if (this._priv[0] === 0x00) this._priv = this._priv.slice(1); this._priv = this._priv.slice(0, 32); } this._key = pk; this._isPriv = true; }; DiffieHellman.prototype.setPrivateKey = DiffieHellman.prototype.setKey; DiffieHellman.prototype.computeSecret = function (otherpk) { this._keyCheck(otherpk, true); if (!this._isPriv) throw (new Error('DH exchange has not been initialized with ' + 'a private key yet')); var pub; if (this._algo === 'dsa') { return (this._dh.computeSecret( otherpk.part.y.data)); } else if (this._algo === 'ecdsa') { if (CRYPTO_HAVE_ECDH) { return (this._dh.computeSecret( otherpk.part.Q.data)); } else { pub = new ECPublic( this._ecParams, otherpk.part.Q.data); return (this._priv.deriveSharedSecret(pub)); } } else if (this._algo === 'curve25519') { pub = otherpk.part.A.data; while (pub[0] === 0x00 && pub.length > 32) pub = pub.slice(1); var priv = this._priv; assert.strictEqual(pub.length, 32); assert.strictEqual(priv.length, 32); var secret = nacl.box.before(new Uint8Array(pub), new Uint8Array(priv)); return (Buffer.from(secret)); } throw (new Error('Invalid algorithm: ' + this._algo)); }; DiffieHellman.prototype.generateKey = function () { var parts = []; var priv, pub; if (this._algo === 'dsa') { this._dh.generateKeys(); parts.push({name: 'p', data: this._p.data}); parts.push({name: 'q', data: this._key.part.q.data}); parts.push({name: 'g', data: this._g.data}); parts.push({name: 'y', data: this._dh.getPublicKey()}); parts.push({name: 'x', data: this._dh.getPrivateKey()}); this._key = new PrivateKey({ type: 'dsa', parts: parts }); this._isPriv = true; return (this._key); } else if (this._algo === 'ecdsa') { if (CRYPTO_HAVE_ECDH) { this._dh.generateKeys(); parts.push({name: 'curve', data: Buffer.from(this._curve)}); parts.push({name: 'Q', data: this._dh.getPublicKey()}); parts.push({name: 'd', data: this._dh.getPrivateKey()}); this._key = new PrivateKey({ type: 'ecdsa', curve: this._curve, parts: parts }); this._isPriv = true; return (this._key); } else { var n = this._ecParams.getN(); var r = new jsbn(crypto.randomBytes(n.bitLength())); var n1 = n.subtract(jsbn.ONE); priv = r.mod(n1).add(jsbn.ONE); pub = this._ecParams.getG().multiply(priv); priv = Buffer.from(priv.toByteArray()); pub = Buffer.from(this._ecParams.getCurve(). encodePointHex(pub), 'hex'); this._priv = new ECPrivate(this._ecParams, priv); parts.push({name: 'curve', data: Buffer.from(this._curve)}); parts.push({name: 'Q', data: pub}); parts.push({name: 'd', data: priv}); this._key = new PrivateKey({ type: 'ecdsa', curve: this._curve, parts: parts }); this._isPriv = true; return (this._key); } } else if (this._algo === 'curve25519') { var pair = nacl.box.keyPair(); priv = Buffer.from(pair.secretKey); pub = Buffer.from(pair.publicKey); priv = Buffer.concat([priv, pub]); assert.strictEqual(priv.length, 64); assert.strictEqual(pub.length, 32); parts.push({name: 'A', data: pub}); parts.push({name: 'k', data: priv}); this._key = new PrivateKey({ type: 'curve25519', parts: parts }); this._isPriv = true; return (this._key); } throw (new Error('Invalid algorithm: ' + this._algo)); }; DiffieHellman.prototype.generateKeys = DiffieHellman.prototype.generateKey; /* These are helpers for using ecc-jsbn (for node 0.10 compatibility). */ function X9ECParameters(name) { var params = algs.curves[name]; assert.object(params); var p = new jsbn(params.p); var a = new jsbn(params.a); var b = new jsbn(params.b); var n = new jsbn(params.n); var h = jsbn.ONE; var curve = new ec.ECCurveFp(p, a, b); var G = curve.decodePointHex(params.G.toString('hex')); this.curve = curve; this.g = G; this.n = n; this.h = h; } X9ECParameters.prototype.getCurve = function () { return (this.curve); }; X9ECParameters.prototype.getG = function () { return (this.g); }; X9ECParameters.prototype.getN = function () { return (this.n); }; X9ECParameters.prototype.getH = function () { return (this.h); }; function ECPublic(params, buffer) { this._params = params; if (buffer[0] === 0x00) buffer = buffer.slice(1); this._pub = params.getCurve().decodePointHex(buffer.toString('hex')); } function ECPrivate(params, buffer) { this._params = params; this._priv = new jsbn(utils.mpNormalize(buffer)); } ECPrivate.prototype.deriveSharedSecret = function (pubKey) { assert.ok(pubKey instanceof ECPublic); var S = pubKey._pub.multiply(this._priv); return (Buffer.from(S.getX().toBigInteger().toByteArray())); }; function generateED25519() { var pair = nacl.sign.keyPair(); var priv = Buffer.from(pair.secretKey); var pub = Buffer.from(pair.publicKey); assert.strictEqual(priv.length, 64); assert.strictEqual(pub.length, 32); var parts = []; parts.push({name: 'A', data: pub}); parts.push({name: 'k', data: priv.slice(0, 32)}); var key = new PrivateKey({ type: 'ed25519', parts: parts }); return (key); } /* Generates a new ECDSA private key on a given curve. */ function generateECDSA(curve) { var parts = []; var key; if (CRYPTO_HAVE_ECDH) { /* * Node crypto doesn't expose key generation directly, but the * ECDH instances can generate keys. It turns out this just * calls into the OpenSSL generic key generator, and we can * read its output happily without doing an actual DH. So we * use that here. */ var osCurve = { 'nistp256': 'prime256v1', 'nistp384': 'secp384r1', 'nistp521': 'secp521r1' }[curve]; var dh = crypto.createECDH(osCurve); dh.generateKeys(); parts.push({name: 'curve', data: Buffer.from(curve)}); parts.push({name: 'Q', data: dh.getPublicKey()}); parts.push({name: 'd', data: dh.getPrivateKey()}); key = new PrivateKey({ type: 'ecdsa', curve: curve, parts: parts }); return (key); } else { var ecParams = new X9ECParameters(curve); /* This algorithm taken from FIPS PUB 186-4 (section B.4.1) */ var n = ecParams.getN(); /* * The crypto.randomBytes() function can only give us whole * bytes, so taking a nod from X9.62, we round up. */ var cByteLen = Math.ceil((n.bitLength() + 64) / 8); var c = new jsbn(crypto.randomBytes(cByteLen)); var n1 = n.subtract(jsbn.ONE); var priv = c.mod(n1).add(jsbn.ONE); var pub = ecParams.getG().multiply(priv); priv = Buffer.from(priv.toByteArray()); pub = Buffer.from(ecParams.getCurve(). encodePointHex(pub), 'hex'); parts.push({name: 'curve', data: Buffer.from(curve)}); parts.push({name: 'Q', data: pub}); parts.push({name: 'd', data: priv}); key = new PrivateKey({ type: 'ecdsa', curve: curve, parts: parts }); return (key); } } /***/ }), /* 131 */ /***/ (function(module, exports, __webpack_require__) { var crypto = __webpack_require__(94); var BigInteger = __webpack_require__(127).BigInteger; var ECPointFp = __webpack_require__(126).ECPointFp; var Buffer = __webpack_require__(114).Buffer; exports.ECCurves = __webpack_require__(132); // zero prepad function unstupid(hex,len) { return (hex.length >= len) ? hex : unstupid("0"+hex,len); } exports.ECKey = function(curve, key, isPublic) { var priv; var c = curve(); var n = c.getN(); var bytes = Math.floor(n.bitLength()/8); if(key) { if(isPublic) { var curve = c.getCurve(); // var x = key.slice(1,bytes+1); // skip the 04 for uncompressed format // var y = key.slice(bytes+1); // this.P = new ECPointFp(curve, // curve.fromBigInteger(new BigInteger(x.toString("hex"), 16)), // curve.fromBigInteger(new BigInteger(y.toString("hex"), 16))); this.P = curve.decodePointHex(key.toString("hex")); }else{ if(key.length != bytes) return false; priv = new BigInteger(key.toString("hex"), 16); } }else{ var n1 = n.subtract(BigInteger.ONE); var r = new BigInteger(crypto.randomBytes(n.bitLength())); priv = r.mod(n1).add(BigInteger.ONE); this.P = c.getG().multiply(priv); } if(this.P) { // var pubhex = unstupid(this.P.getX().toBigInteger().toString(16),bytes*2)+unstupid(this.P.getY().toBigInteger().toString(16),bytes*2); // this.PublicKey = Buffer.from("04"+pubhex,"hex"); this.PublicKey = Buffer.from(c.getCurve().encodeCompressedPointHex(this.P),"hex"); } if(priv) { this.PrivateKey = Buffer.from(unstupid(priv.toString(16),bytes*2),"hex"); this.deriveSharedSecret = function(key) { if(!key || !key.P) return false; var S = key.P.multiply(priv); return Buffer.from(unstupid(S.getX().toBigInteger().toString(16),bytes*2),"hex"); } } } /***/ }), /* 132 */ /***/ (function(module, exports, __webpack_require__) { // Named EC curves // Requires ec.js, jsbn.js, and jsbn2.js var BigInteger = __webpack_require__(127).BigInteger var ECCurveFp = __webpack_require__(126).ECCurveFp // ---------------- // X9ECParameters // constructor function X9ECParameters(curve,g,n,h) { this.curve = curve; this.g = g; this.n = n; this.h = h; } function x9getCurve() { return this.curve; } function x9getG() { return this.g; } function x9getN() { return this.n; } function x9getH() { return this.h; } X9ECParameters.prototype.getCurve = x9getCurve; X9ECParameters.prototype.getG = x9getG; X9ECParameters.prototype.getN = x9getN; X9ECParameters.prototype.getH = x9getH; // ---------------- // SECNamedCurves function fromHex(s) { return new BigInteger(s, 16); } function secp128r1() { // p = 2^128 - 2^97 - 1 var p = fromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF"); var a = fromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC"); var b = fromHex("E87579C11079F43DD824993C2CEE5ED3"); //byte[] S = Hex.decode("000E0D4D696E6768756151750CC03A4473D03679"); var n = fromHex("FFFFFFFE0000000075A30D1B9038A115"); var h = BigInteger.ONE; var curve = new ECCurveFp(p, a, b); var G = curve.decodePointHex("04" + "161FF7528B899B2D0C28607CA52C5B86" + "CF5AC8395BAFEB13C02DA292DDED7A83"); return new X9ECParameters(curve, G, n, h); } function secp160k1() { // p = 2^160 - 2^32 - 2^14 - 2^12 - 2^9 - 2^8 - 2^7 - 2^3 - 2^2 - 1 var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73"); var a = BigInteger.ZERO; var b = fromHex("7"); //byte[] S = null; var n = fromHex("0100000000000000000001B8FA16DFAB9ACA16B6B3"); var h = BigInteger.ONE; var curve = new ECCurveFp(p, a, b); var G = curve.decodePointHex("04" + "3B4C382CE37AA192A4019E763036F4F5DD4D7EBB" + "938CF935318FDCED6BC28286531733C3F03C4FEE"); return new X9ECParameters(curve, G, n, h); } function secp160r1() { // p = 2^160 - 2^31 - 1 var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF"); var a = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC"); var b = fromHex("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45"); //byte[] S = Hex.decode("1053CDE42C14D696E67687561517533BF3F83345"); var n = fromHex("0100000000000000000001F4C8F927AED3CA752257"); var h = BigInteger.ONE; var curve = new ECCurveFp(p, a, b); var G = curve.decodePointHex("04" + "4A96B5688EF573284664698968C38BB913CBFC82" + "23A628553168947D59DCC912042351377AC5FB32"); return new X9ECParameters(curve, G, n, h); } function secp192k1() { // p = 2^192 - 2^32 - 2^12 - 2^8 - 2^7 - 2^6 - 2^3 - 1 var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37"); var a = BigInteger.ZERO; var b = fromHex("3"); //byte[] S = null; var n = fromHex("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D"); var h = BigInteger.ONE; var curve = new ECCurveFp(p, a, b); var G = curve.decodePointHex("04" + "DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D" + "9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D"); return new X9ECParameters(curve, G, n, h); } function secp192r1() { // p = 2^192 - 2^64 - 1 var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"); var a = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC"); var b = fromHex("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1"); //byte[] S = Hex.decode("3045AE6FC8422F64ED579528D38120EAE12196D5"); var n = fromHex("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831"); var h = BigInteger.ONE; var curve = new ECCurveFp(p, a, b); var G = curve.decodePointHex("04" + "188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012" + "07192B95FFC8DA78631011ED6B24CDD573F977A11E794811"); return new X9ECParameters(curve, G, n, h); } function secp224r1() { // p = 2^224 - 2^96 + 1 var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001"); var a = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE"); var b = fromHex("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4"); //byte[] S = Hex.decode("BD71344799D5C7FCDC45B59FA3B9AB8F6A948BC5"); var n = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D"); var h = BigInteger.ONE; var curve = new ECCurveFp(p, a, b); var G = curve.decodePointHex("04" + "B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21" + "BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34"); return new X9ECParameters(curve, G, n, h); } function secp256r1() { // p = 2^224 (2^32 - 1) + 2^192 + 2^96 - 1 var p = fromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"); var a = fromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"); var b = fromHex("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"); //byte[] S = Hex.decode("C49D360886E704936A6678E1139D26B7819F7E90"); var n = fromHex("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"); var h = BigInteger.ONE; var curve = new ECCurveFp(p, a, b); var G = curve.decodePointHex("04" + "6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296" + "4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5"); return new X9ECParameters(curve, G, n, h); } // TODO: make this into a proper hashtable function getSECCurveByName(name) { if(name == "secp128r1") return secp128r1(); if(name == "secp160k1") return secp160k1(); if(name == "secp160r1") return secp160r1(); if(name == "secp192k1") return secp192k1(); if(name == "secp192r1") return secp192r1(); if(name == "secp224r1") return secp224r1(); if(name == "secp256r1") return secp256r1(); return null; } module.exports = { "secp128r1":secp128r1, "secp160k1":secp160k1, "secp160r1":secp160r1, "secp192k1":secp192k1, "secp192r1":secp192r1, "secp224r1":secp224r1, "secp256r1":secp256r1 } /***/ }), /* 133 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. module.exports = { Verifier: Verifier, Signer: Signer }; var nacl = __webpack_require__(128); var stream = __webpack_require__(100); var util = __webpack_require__(9); var assert = __webpack_require__(108); var Buffer = __webpack_require__(114).Buffer; var Signature = __webpack_require__(118); function Verifier(key, hashAlgo) { if (hashAlgo.toLowerCase() !== 'sha512') throw (new Error('ED25519 only supports the use of ' + 'SHA-512 hashes')); this.key = key; this.chunks = []; stream.Writable.call(this, {}); } util.inherits(Verifier, stream.Writable); Verifier.prototype._write = function (chunk, enc, cb) { this.chunks.push(chunk); cb(); }; Verifier.prototype.update = function (chunk) { if (typeof (chunk) === 'string') chunk = Buffer.from(chunk, 'binary'); this.chunks.push(chunk); }; Verifier.prototype.verify = function (signature, fmt) { var sig; if (Signature.isSignature(signature, [2, 0])) { if (signature.type !== 'ed25519') return (false); sig = signature.toBuffer('raw'); } else if (typeof (signature) === 'string') { sig = Buffer.from(signature, 'base64'); } else if (Signature.isSignature(signature, [1, 0])) { throw (new Error('signature was created by too old ' + 'a version of sshpk and cannot be verified')); } assert.buffer(sig); return (nacl.sign.detached.verify( new Uint8Array(Buffer.concat(this.chunks)), new Uint8Array(sig), new Uint8Array(this.key.part.A.data))); }; function Signer(key, hashAlgo) { if (hashAlgo.toLowerCase() !== 'sha512') throw (new Error('ED25519 only supports the use of ' + 'SHA-512 hashes')); this.key = key; this.chunks = []; stream.Writable.call(this, {}); } util.inherits(Signer, stream.Writable); Signer.prototype._write = function (chunk, enc, cb) { this.chunks.push(chunk); cb(); }; Signer.prototype.update = function (chunk) { if (typeof (chunk) === 'string') chunk = Buffer.from(chunk, 'binary'); this.chunks.push(chunk); }; Signer.prototype.sign = function () { var sig = nacl.sign.detached( new Uint8Array(Buffer.concat(this.chunks)), new Uint8Array(Buffer.concat([ this.key.part.k.data, this.key.part.A.data]))); var sigBuf = Buffer.from(sig); var sigObj = Signature.parse(sigBuf, 'ed25519', 'raw'); sigObj.hashAlgorithm = 'sha512'; return (sigObj); }; /***/ }), /* 134 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2018 Joyent, Inc. module.exports = { read: read, write: write }; var assert = __webpack_require__(108); var Buffer = __webpack_require__(114).Buffer; var utils = __webpack_require__(119); var Key = __webpack_require__(112); var PrivateKey = __webpack_require__(117); var pem = __webpack_require__(135); var ssh = __webpack_require__(141); var rfc4253 = __webpack_require__(139); var dnssec = __webpack_require__(142); var putty = __webpack_require__(143); var DNSSEC_PRIVKEY_HEADER_PREFIX = 'Private-key-format: v1'; function read(buf, options) { if (typeof (buf) === 'string') { if (buf.trim().match(/^[-]+[ ]*BEGIN/)) return (pem.read(buf, options)); if (buf.match(/^\s*ssh-[a-z]/)) return (ssh.read(buf, options)); if (buf.match(/^\s*ecdsa-/)) return (ssh.read(buf, options)); if (buf.match(/^putty-user-key-file-2:/i)) return (putty.read(buf, options)); if (findDNSSECHeader(buf)) return (dnssec.read(buf, options)); buf = Buffer.from(buf, 'binary'); } else { assert.buffer(buf); if (findPEMHeader(buf)) return (pem.read(buf, options)); if (findSSHHeader(buf)) return (ssh.read(buf, options)); if (findPuTTYHeader(buf)) return (putty.read(buf, options)); if (findDNSSECHeader(buf)) return (dnssec.read(buf, options)); } if (buf.readUInt32BE(0) < buf.length) return (rfc4253.read(buf, options)); throw (new Error('Failed to auto-detect format of key')); } function findPuTTYHeader(buf) { var offset = 0; while (offset < buf.length && (buf[offset] === 32 || buf[offset] === 10 || buf[offset] === 9)) ++offset; if (offset + 22 <= buf.length && buf.slice(offset, offset + 22).toString('ascii').toLowerCase() === 'putty-user-key-file-2:') return (true); return (false); } function findSSHHeader(buf) { var offset = 0; while (offset < buf.length && (buf[offset] === 32 || buf[offset] === 10 || buf[offset] === 9)) ++offset; if (offset + 4 <= buf.length && buf.slice(offset, offset + 4).toString('ascii') === 'ssh-') return (true); if (offset + 6 <= buf.length && buf.slice(offset, offset + 6).toString('ascii') === 'ecdsa-') return (true); return (false); } function findPEMHeader(buf) { var offset = 0; while (offset < buf.length && (buf[offset] === 32 || buf[offset] === 10)) ++offset; if (buf[offset] !== 45) return (false); while (offset < buf.length && (buf[offset] === 45)) ++offset; while (offset < buf.length && (buf[offset] === 32)) ++offset; if (offset + 5 > buf.length || buf.slice(offset, offset + 5).toString('ascii') !== 'BEGIN') return (false); return (true); } function findDNSSECHeader(buf) { // private case first if (buf.length <= DNSSEC_PRIVKEY_HEADER_PREFIX.length) return (false); var headerCheck = buf.slice(0, DNSSEC_PRIVKEY_HEADER_PREFIX.length); if (headerCheck.toString('ascii') === DNSSEC_PRIVKEY_HEADER_PREFIX) return (true); // public-key RFC3110 ? // 'domain.com. IN KEY ...' or 'domain.com. IN DNSKEY ...' // skip any comment-lines if (typeof (buf) !== 'string') { buf = buf.toString('ascii'); } var lines = buf.split('\n'); var line = 0; /* JSSTYLED */ while (lines[line].match(/^\;/)) line++; if (lines[line].toString('ascii').match(/\. IN KEY /)) return (true); if (lines[line].toString('ascii').match(/\. IN DNSKEY /)) return (true); return (false); } function write(key, options) { throw (new Error('"auto" format cannot be used for writing')); } /***/ }), /* 135 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2018 Joyent, Inc. module.exports = { read: read, write: write }; var assert = __webpack_require__(108); var asn1 = __webpack_require__(120); var crypto = __webpack_require__(94); var Buffer = __webpack_require__(114).Buffer; var algs = __webpack_require__(113); var utils = __webpack_require__(119); var Key = __webpack_require__(112); var PrivateKey = __webpack_require__(117); var pkcs1 = __webpack_require__(136); var pkcs8 = __webpack_require__(137); var sshpriv = __webpack_require__(138); var rfc4253 = __webpack_require__(139); var errors = __webpack_require__(116); var OID_PBES2 = '1.2.840.113549.1.5.13'; var OID_PBKDF2 = '1.2.840.113549.1.5.12'; var 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' }; var 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' }; var HASH_TO_OID = {}; Object.keys(OID_TO_HASH).forEach(function (k) { HASH_TO_OID[OID_TO_HASH[k]] = k; }); /* * For reading we support both PKCS#1 and PKCS#8. If we find a private key, * we just take the public component of it and use that. */ function read(buf, options, forceType) { var input = buf; if (typeof (buf) !== 'string') { assert.buffer(buf, 'buf'); buf = buf.toString('ascii'); } var lines = buf.trim().split(/[\r\n]+/g); var m; var si = -1; while (!m && si < lines.length) { m = lines[++si].match(/*JSSTYLED*/ /[-]+[ ]*BEGIN ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/); } assert.ok(m, 'invalid PEM header'); var m2; var ei = lines.length; while (!m2 && ei > 0) { m2 = lines[--ei].match(/*JSSTYLED*/ /[-]+[ ]*END ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/); } assert.ok(m2, 'invalid PEM footer'); /* Begin and end banners must match key type */ assert.equal(m[2], m2[2]); var type = m[2].toLowerCase(); var alg; if (m[1]) { /* They also must match algorithms, if given */ assert.equal(m[1], m2[1], 'PEM header and footer mismatch'); alg = m[1].trim(); } lines = lines.slice(si, ei + 1); var headers = {}; while (true) { lines = lines.slice(1); m = lines[0].match(/*JSSTYLED*/ /^([A-Za-z0-9-]+): (.+)$/); if (!m) break; headers[m[1].toLowerCase()] = m[2]; } /* Chop off the first and last lines */ lines = lines.slice(0, -1).join(''); buf = Buffer.from(lines, 'base64'); var cipher, key, iv; if (headers['proc-type']) { var parts = headers['proc-type'].split(','); if (parts[0] === '4' && parts[1] === 'ENCRYPTED') { if (typeof (options.passphrase) === 'string') { options.passphrase = Buffer.from( options.passphrase, 'utf-8'); } if (!Buffer.isBuffer(options.passphrase)) { throw (new errors.KeyEncryptedError( options.filename, 'PEM')); } else { parts = headers['dek-info'].split(','); assert.ok(parts.length === 2); cipher = parts[0].toLowerCase(); iv = Buffer.from(parts[1], 'hex'); key = utils.opensslKeyDeriv(cipher, iv, options.passphrase, 1).key; } } } if (alg && alg.toLowerCase() === 'encrypted') { var eder = new asn1.BerReader(buf); var pbesEnd; eder.readSequence(); eder.readSequence(); pbesEnd = eder.offset + eder.length; var method = eder.readOID(); if (method !== OID_PBES2) { throw (new Error('Unsupported PEM/PKCS8 encryption ' + 'scheme: ' + method)); } eder.readSequence(); /* PBES2-params */ eder.readSequence(); /* keyDerivationFunc */ var kdfEnd = eder.offset + eder.length; var kdfOid = eder.readOID(); if (kdfOid !== OID_PBKDF2) throw (new Error('Unsupported PBES2 KDF: ' + kdfOid)); eder.readSequence(); var salt = eder.readString(asn1.Ber.OctetString, true); var iterations = eder.readInt(); var hashAlg = 'sha1'; if (eder.offset < kdfEnd) { eder.readSequence(); var hashAlgOid = eder.readOID(); hashAlg = OID_TO_HASH[hashAlgOid]; if (hashAlg === undefined) { throw (new Error('Unsupported PBKDF2 hash: ' + hashAlgOid)); } } eder._offset = kdfEnd; eder.readSequence(); /* encryptionScheme */ var cipherOid = eder.readOID(); cipher = OID_TO_CIPHER[cipherOid]; if (cipher === undefined) { throw (new Error('Unsupported PBES2 cipher: ' + cipherOid)); } iv = eder.readString(asn1.Ber.OctetString, true); eder._offset = pbesEnd; buf = eder.readString(asn1.Ber.OctetString, true); if (typeof (options.passphrase) === 'string') { options.passphrase = Buffer.from( options.passphrase, 'utf-8'); } if (!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 = undefined; } if (cipher && key && iv) { var cipherStream = crypto.createDecipheriv(cipher, key, iv); var chunk, chunks = []; cipherStream.once('error', function (e) { if (e.toString().indexOf('bad decrypt') !== -1) { throw (new Error('Incorrect passphrase ' + 'supplied, could not decrypt key')); } throw (e); }); cipherStream.write(buf); cipherStream.end(); while ((chunk = cipherStream.read()) !== null) chunks.push(chunk); buf = Buffer.concat(chunks); } /* The new OpenSSH internal format abuses PEM headers */ if (alg && alg.toLowerCase() === 'openssh') return (sshpriv.readSSHPrivate(type, buf, options)); if (alg && alg.toLowerCase() === 'ssh2') return (rfc4253.readType(type, buf, options)); var der = new asn1.BerReader(buf); der.originalInput = input; /* * All of the PEM file types start with a sequence tag, so chop it * off here */ der.readSequence(); /* PKCS#1 type keys name an algorithm in the banner explicitly */ if (alg) { if (forceType) assert.strictEqual(forceType, 'pkcs1'); return (pkcs1.readPkcs1(alg, type, der)); } else { if (forceType) assert.strictEqual(forceType, 'pkcs8'); return (pkcs8.readPkcs8(alg, type, der)); } } function write(key, options, type) { assert.object(key); var alg = { 'ecdsa': 'EC', 'rsa': 'RSA', 'dsa': 'DSA', 'ed25519': 'EdDSA' }[key.type]; var header; var der = new asn1.BerWriter(); if (PrivateKey.isPrivateKey(key)) { if (type && type === 'pkcs8') { header = 'PRIVATE KEY'; pkcs8.writePkcs8(der, key); } else { if (type) assert.strictEqual(type, 'pkcs1'); header = alg + ' PRIVATE KEY'; pkcs1.writePkcs1(der, key); } } else if (Key.isKey(key)) { if (type && type === 'pkcs1') { header = alg + ' PUBLIC KEY'; pkcs1.writePkcs1(der, key); } else { if (type) assert.strictEqual(type, 'pkcs8'); header = 'PUBLIC KEY'; pkcs8.writePkcs8(der, key); } } else { throw (new Error('key is not a Key or PrivateKey')); } var tmp = der.buffer.toString('base64'); var len = tmp.length + (tmp.length / 64) + 18 + 16 + header.length*2 + 10; var buf = Buffer.alloc(len); var o = 0; o += buf.write('-----BEGIN ' + header + '-----\n', o); for (var i = 0; i < tmp.length; ) { var limit = i + 64; if (limit > tmp.length) limit = tmp.length; o += buf.write(tmp.slice(i, limit), o); buf[o++] = 10; i = limit; } o += buf.write('-----END ' + header + '-----\n', o); return (buf.slice(0, o)); } /***/ }), /* 136 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. module.exports = { read: read, readPkcs1: readPkcs1, write: write, writePkcs1: writePkcs1 }; var assert = __webpack_require__(108); var asn1 = __webpack_require__(120); var Buffer = __webpack_require__(114).Buffer; var algs = __webpack_require__(113); var utils = __webpack_require__(119); var Key = __webpack_require__(112); var PrivateKey = __webpack_require__(117); var pem = __webpack_require__(135); var pkcs8 = __webpack_require__(137); var readECDSACurve = pkcs8.readECDSACurve; function read(buf, options) { return (pem.read(buf, options, 'pkcs1')); } function write(key, options) { return (pem.write(key, options, 'pkcs1')); } /* Helper to read in a single mpint */ function readMPInt(der, nm) { assert.strictEqual(der.peek(), asn1.Ber.Integer, nm + ' is not an Integer'); return (utils.mpNormalize(der.readString(asn1.Ber.Integer, true))); } function readPkcs1(alg, type, der) { switch (alg) { case 'RSA': if (type === 'public') return (readPkcs1RSAPublic(der)); else if (type === 'private') return (readPkcs1RSAPrivate(der)); throw (new Error('Unknown key type: ' + type)); case 'DSA': if (type === 'public') return (readPkcs1DSAPublic(der)); else if (type === 'private') return (readPkcs1DSAPrivate(der)); throw (new Error('Unknown key type: ' + type)); case 'EC': case 'ECDSA': if (type === 'private') return (readPkcs1ECDSAPrivate(der)); else if (type === 'public') return (readPkcs1ECDSAPublic(der)); throw (new Error('Unknown key type: ' + type)); case 'EDDSA': case 'EdDSA': if (type === 'private') return (readPkcs1EdDSAPrivate(der)); throw (new Error(type + ' keys not supported with EdDSA')); default: throw (new Error('Unknown key algo: ' + alg)); } } function readPkcs1RSAPublic(der) { // modulus and exponent var n = readMPInt(der, 'modulus'); var e = readMPInt(der, 'exponent'); // now, make the key var key = { type: 'rsa', parts: [ { name: 'e', data: e }, { name: 'n', data: n } ] }; return (new Key(key)); } function readPkcs1RSAPrivate(der) { var version = readMPInt(der, 'version'); assert.strictEqual(version[0], 0); // modulus then public exponent var n = readMPInt(der, 'modulus'); var e = readMPInt(der, 'public exponent'); var d = readMPInt(der, 'private exponent'); var p = readMPInt(der, 'prime1'); var q = readMPInt(der, 'prime2'); var dmodp = readMPInt(der, 'exponent1'); var dmodq = readMPInt(der, 'exponent2'); var iqmp = readMPInt(der, 'iqmp'); // now, make the key var key = { 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 } ] }; return (new PrivateKey(key)); } function readPkcs1DSAPrivate(der) { var version = readMPInt(der, 'version'); assert.strictEqual(version.readUInt8(0), 0); var p = readMPInt(der, 'p'); var q = readMPInt(der, 'q'); var g = readMPInt(der, 'g'); var y = readMPInt(der, 'y'); var x = readMPInt(der, 'x'); // now, make the key var key = { type: 'dsa', parts: [ { name: 'p', data: p }, { name: 'q', data: q }, { name: 'g', data: g }, { name: 'y', data: y }, { name: 'x', data: x } ] }; return (new PrivateKey(key)); } function readPkcs1EdDSAPrivate(der) { var version = readMPInt(der, 'version'); assert.strictEqual(version.readUInt8(0), 1); // private key var k = der.readString(asn1.Ber.OctetString, true); der.readSequence(0xa0); var oid = der.readOID(); assert.strictEqual(oid, '1.3.101.112', 'the ed25519 curve identifier'); der.readSequence(0xa1); var A = utils.readBitString(der); var key = { type: 'ed25519', parts: [ { name: 'A', data: utils.zeroPadToLength(A, 32) }, { name: 'k', data: k } ] }; return (new PrivateKey(key)); } function readPkcs1DSAPublic(der) { var y = readMPInt(der, 'y'); var p = readMPInt(der, 'p'); var q = readMPInt(der, 'q'); var g = readMPInt(der, 'g'); var key = { type: 'dsa', parts: [ { name: 'y', data: y }, { name: 'p', data: p }, { name: 'q', data: q }, { name: 'g', data: g } ] }; return (new Key(key)); } function readPkcs1ECDSAPublic(der) { der.readSequence(); var oid = der.readOID(); assert.strictEqual(oid, '1.2.840.10045.2.1', 'must be ecPublicKey'); var curveOid = der.readOID(); var curve; var curves = Object.keys(algs.curves); for (var j = 0; j < curves.length; ++j) { var c = curves[j]; var cd = algs.curves[c]; if (cd.pkcs8oid === curveOid) { curve = c; break; } } assert.string(curve, 'a known ECDSA named curve'); var Q = der.readString(asn1.Ber.BitString, true); Q = utils.ecNormalize(Q); var key = { type: 'ecdsa', parts: [ { name: 'curve', data: Buffer.from(curve) }, { name: 'Q', data: Q } ] }; return (new Key(key)); } function readPkcs1ECDSAPrivate(der) { var version = readMPInt(der, 'version'); assert.strictEqual(version.readUInt8(0), 1); // private key var d = der.readString(asn1.Ber.OctetString, true); der.readSequence(0xa0); var curve = readECDSACurve(der); assert.string(curve, 'a known elliptic curve'); der.readSequence(0xa1); var Q = der.readString(asn1.Ber.BitString, true); Q = utils.ecNormalize(Q); var key = { type: 'ecdsa', parts: [ { name: 'curve', data: Buffer.from(curve) }, { name: 'Q', data: Q }, { name: 'd', data: d } ] }; return (new PrivateKey(key)); } function writePkcs1(der, key) { der.startSequence(); switch (key.type) { case 'rsa': if (PrivateKey.isPrivateKey(key)) writePkcs1RSAPrivate(der, key); else writePkcs1RSAPublic(der, key); break; case 'dsa': if (PrivateKey.isPrivateKey(key)) writePkcs1DSAPrivate(der, key); else writePkcs1DSAPublic(der, key); break; case 'ecdsa': if (PrivateKey.isPrivateKey(key)) writePkcs1ECDSAPrivate(der, key); else writePkcs1ECDSAPublic(der, key); break; case 'ed25519': if (PrivateKey.isPrivateKey(key)) writePkcs1EdDSAPrivate(der, key); else writePkcs1EdDSAPublic(der, key); break; default: throw (new Error('Unknown key algo: ' + key.type)); } der.endSequence(); } function writePkcs1RSAPublic(der, key) { der.writeBuffer(key.part.n.data, asn1.Ber.Integer); der.writeBuffer(key.part.e.data, asn1.Ber.Integer); } function writePkcs1RSAPrivate(der, key) { var ver = Buffer.from([0]); der.writeBuffer(ver, 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); if (!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); } function writePkcs1DSAPrivate(der, key) { var ver = Buffer.from([0]); der.writeBuffer(ver, asn1.Ber.Integer); 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.writeBuffer(key.part.y.data, asn1.Ber.Integer); der.writeBuffer(key.part.x.data, asn1.Ber.Integer); } function writePkcs1DSAPublic(der, key) { der.writeBuffer(key.part.y.data, asn1.Ber.Integer); 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); } function writePkcs1ECDSAPublic(der, key) { der.startSequence(); der.writeOID('1.2.840.10045.2.1'); /* ecPublicKey */ var curve = key.part.curve.data.toString(); var curveOid = algs.curves[curve].pkcs8oid; assert.string(curveOid, 'a known ECDSA named curve'); der.writeOID(curveOid); der.endSequence(); var Q = utils.ecNormalize(key.part.Q.data, true); der.writeBuffer(Q, asn1.Ber.BitString); } function writePkcs1ECDSAPrivate(der, key) { var ver = Buffer.from([1]); der.writeBuffer(ver, asn1.Ber.Integer); der.writeBuffer(key.part.d.data, asn1.Ber.OctetString); der.startSequence(0xa0); var curve = key.part.curve.data.toString(); var curveOid = algs.curves[curve].pkcs8oid; assert.string(curveOid, 'a known ECDSA named curve'); der.writeOID(curveOid); der.endSequence(); der.startSequence(0xa1); var Q = utils.ecNormalize(key.part.Q.data, true); der.writeBuffer(Q, asn1.Ber.BitString); der.endSequence(); } function writePkcs1EdDSAPrivate(der, key) { var ver = Buffer.from([1]); der.writeBuffer(ver, asn1.Ber.Integer); der.writeBuffer(key.part.k.data, asn1.Ber.OctetString); der.startSequence(0xa0); der.writeOID('1.3.101.112'); der.endSequence(); der.startSequence(0xa1); utils.writeBitString(der, key.part.A.data); der.endSequence(); } function writePkcs1EdDSAPublic(der, key) { throw (new Error('Public keys are not supported for EdDSA PKCS#1')); } /***/ }), /* 137 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2018 Joyent, Inc. module.exports = { read: read, readPkcs8: readPkcs8, write: write, writePkcs8: writePkcs8, pkcs8ToBuffer: pkcs8ToBuffer, readECDSACurve: readECDSACurve, writeECDSACurve: writeECDSACurve }; var assert = __webpack_require__(108); var asn1 = __webpack_require__(120); var Buffer = __webpack_require__(114).Buffer; var algs = __webpack_require__(113); var utils = __webpack_require__(119); var Key = __webpack_require__(112); var PrivateKey = __webpack_require__(117); var pem = __webpack_require__(135); function read(buf, options) { return (pem.read(buf, options, 'pkcs8')); } function write(key, options) { return (pem.write(key, options, 'pkcs8')); } /* Helper to read in a single mpint */ function readMPInt(der, nm) { assert.strictEqual(der.peek(), asn1.Ber.Integer, nm + ' is not an Integer'); return (utils.mpNormalize(der.readString(asn1.Ber.Integer, true))); } function readPkcs8(alg, type, der) { /* Private keys in pkcs#8 format have a weird extra int */ if (der.peek() === asn1.Ber.Integer) { assert.strictEqual(type, 'private', 'unexpected Integer at start of public key'); der.readString(asn1.Ber.Integer, true); } der.readSequence(); var next = der.offset + der.length; var oid = der.readOID(); switch (oid) { case '1.2.840.113549.1.1.1': der._offset = next; if (type === 'public') return (readPkcs8RSAPublic(der)); else return (readPkcs8RSAPrivate(der)); case '1.2.840.10040.4.1': if (type === 'public') return (readPkcs8DSAPublic(der)); else return (readPkcs8DSAPrivate(der)); case '1.2.840.10045.2.1': if (type === 'public') return (readPkcs8ECDSAPublic(der)); else return (readPkcs8ECDSAPrivate(der)); case '1.3.101.112': if (type === 'public') { return (readPkcs8EdDSAPublic(der)); } else { return (readPkcs8EdDSAPrivate(der)); } case '1.3.101.110': if (type === 'public') { return (readPkcs8X25519Public(der)); } else { return (readPkcs8X25519Private(der)); } default: throw (new Error('Unknown key type OID ' + oid)); } } function readPkcs8RSAPublic(der) { // bit string sequence der.readSequence(asn1.Ber.BitString); der.readByte(); der.readSequence(); // modulus var n = readMPInt(der, 'modulus'); var e = readMPInt(der, 'exponent'); // now, make the key var key = { type: 'rsa', source: der.originalInput, parts: [ { name: 'e', data: e }, { name: 'n', data: n } ] }; return (new Key(key)); } function readPkcs8RSAPrivate(der) { der.readSequence(asn1.Ber.OctetString); der.readSequence(); var ver = readMPInt(der, 'version'); assert.equal(ver[0], 0x0, 'unknown RSA private key version'); // modulus then public exponent var n = readMPInt(der, 'modulus'); var e = readMPInt(der, 'public exponent'); var d = readMPInt(der, 'private exponent'); var p = readMPInt(der, 'prime1'); var q = readMPInt(der, 'prime2'); var dmodp = readMPInt(der, 'exponent1'); var dmodq = readMPInt(der, 'exponent2'); var iqmp = readMPInt(der, 'iqmp'); // now, make the key var key = { 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 } ] }; return (new PrivateKey(key)); } function readPkcs8DSAPublic(der) { der.readSequence(); var p = readMPInt(der, 'p'); var q = readMPInt(der, 'q'); var g = readMPInt(der, 'g'); // bit string sequence der.readSequence(asn1.Ber.BitString); der.readByte(); var y = readMPInt(der, 'y'); // now, make the key var key = { type: 'dsa', parts: [ { name: 'p', data: p }, { name: 'q', data: q }, { name: 'g', data: g }, { name: 'y', data: y } ] }; return (new Key(key)); } function readPkcs8DSAPrivate(der) { der.readSequence(); var p = readMPInt(der, 'p'); var q = readMPInt(der, 'q'); var g = readMPInt(der, 'g'); der.readSequence(asn1.Ber.OctetString); var x = readMPInt(der, 'x'); /* The pkcs#8 format does not include the public key */ var y = utils.calculateDSAPublic(g, p, x); var key = { type: 'dsa', parts: [ { name: 'p', data: p }, { name: 'q', data: q }, { name: 'g', data: g }, { name: 'y', data: y }, { name: 'x', data: x } ] }; return (new PrivateKey(key)); } function readECDSACurve(der) { var curveName, curveNames; var j, c, cd; if (der.peek() === asn1.Ber.OID) { var oid = der.readOID(); curveNames = Object.keys(algs.curves); for (j = 0; j < curveNames.length; ++j) { c = curveNames[j]; cd = algs.curves[c]; if (cd.pkcs8oid === oid) { curveName = c; break; } } } else { // ECParameters sequence der.readSequence(); var version = der.readString(asn1.Ber.Integer, true); assert.strictEqual(version[0], 1, 'ECDSA key not version 1'); var curve = {}; // FieldID sequence 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, true)); /* * p always starts with a 1 bit, so count the zeros to get its * real size. */ curve.size = p.length * 8 - utils.countZeros(p); // Curve sequence der.readSequence(); curve.a = utils.mpNormalize( der.readString(asn1.Ber.OctetString, true)); curve.b = utils.mpNormalize( der.readString(asn1.Ber.OctetString, true)); if (der.peek() === asn1.Ber.BitString) curve.s = der.readString(asn1.Ber.BitString, true); // Combined Gx and Gy curve.G = der.readString(asn1.Ber.OctetString, true); assert.strictEqual(curve.G[0], 0x4, 'uncompressed G is required'); curve.n = utils.mpNormalize( der.readString(asn1.Ber.Integer, true)); curve.h = utils.mpNormalize( der.readString(asn1.Ber.Integer, true)); assert.strictEqual(curve.h[0], 0x1, '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]; var equal = true; for (var i = 0; i < ks.length; ++i) { var k = ks[i]; if (cd[k] === undefined) continue; if (typeof (cd[k]) === 'object' && cd[k].equals !== undefined) { if (!cd[k].equals(curve[k])) { equal = false; break; } } else if (Buffer.isBuffer(cd[k])) { if (cd[k].toString('binary') !== curve[k].toString('binary')) { equal = false; break; } } else { if (cd[k] !== curve[k]) { equal = false; break; } } } if (equal) { curveName = c; break; } } } return (curveName); } function readPkcs8ECDSAPrivate(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 d = der.readString(asn1.Ber.OctetString, true); var Q; if (der.peek() == 0xa0) { der.readSequence(0xa0); der._offset += der.length; } if (der.peek() == 0xa1) { der.readSequence(0xa1); Q = der.readString(asn1.Ber.BitString, true); Q = utils.ecNormalize(Q); } if (Q === undefined) { var pub = utils.publicFromPrivateECDSA(curveName, d); Q = pub.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)); } function readPkcs8ECDSAPublic(der) { var curveName = readECDSACurve(der); assert.string(curveName, 'a known elliptic curve'); var Q = der.readString(asn1.Ber.BitString, true); Q = utils.ecNormalize(Q); var key = { type: 'ecdsa', parts: [ { name: 'curve', data: Buffer.from(curveName) }, { name: 'Q', data: Q } ] }; return (new Key(key)); } function readPkcs8EdDSAPublic(der) { if (der.peek() === 0x00) der.readByte(); var A = utils.readBitString(der); var key = { type: 'ed25519', parts: [ { name: 'A', data: utils.zeroPadToLength(A, 32) } ] }; return (new Key(key)); } function readPkcs8X25519Public(der) { var A = utils.readBitString(der); var key = { type: 'curve25519', parts: [ { name: 'A', data: utils.zeroPadToLength(A, 32) } ] }; return (new Key(key)); } function readPkcs8EdDSAPrivate(der) { if (der.peek() === 0x00) der.readByte(); der.readSequence(asn1.Ber.OctetString); var k = der.readString(asn1.Ber.OctetString, true); k = utils.zeroPadToLength(k, 32); var A; if (der.peek() === asn1.Ber.BitString) { A = utils.readBitString(der); A = utils.zeroPadToLength(A, 32); } else { 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)); } function readPkcs8X25519Private(der) { if (der.peek() === 0x00) der.readByte(); der.readSequence(asn1.Ber.OctetString); var k = der.readString(asn1.Ber.OctetString, true); k = utils.zeroPadToLength(k, 32); var A = utils.calculateX25519Public(k); var key = { type: 'curve25519', parts: [ { name: 'A', data: utils.zeroPadToLength(A, 32) }, { name: 'k', data: utils.zeroPadToLength(k, 32) } ] }; return (new PrivateKey(key)); } function pkcs8ToBuffer(key) { var der = new asn1.BerWriter(); writePkcs8(der, key); return (der.buffer); } function writePkcs8(der, key) { der.startSequence(); if (PrivateKey.isPrivateKey(key)) { var sillyInt = Buffer.from([0]); der.writeBuffer(sillyInt, asn1.Ber.Integer); } der.startSequence(); switch (key.type) { case 'rsa': der.writeOID('1.2.840.113549.1.1.1'); if (PrivateKey.isPrivateKey(key)) writePkcs8RSAPrivate(key, der); else writePkcs8RSAPublic(key, der); break; case 'dsa': der.writeOID('1.2.840.10040.4.1'); if (PrivateKey.isPrivateKey(key)) writePkcs8DSAPrivate(key, der); else writePkcs8DSAPublic(key, der); break; case 'ecdsa': der.writeOID('1.2.840.10045.2.1'); if (PrivateKey.isPrivateKey(key)) writePkcs8ECDSAPrivate(key, der); else writePkcs8ECDSAPublic(key, der); break; case 'ed25519': der.writeOID('1.3.101.112'); if (PrivateKey.isPrivateKey(key)) throw (new Error('Ed25519 private keys in pkcs8 ' + 'format are not supported')); writePkcs8EdDSAPublic(key, der); break; default: throw (new Error('Unsupported key type: ' + key.type)); } der.endSequence(); } function writePkcs8RSAPrivate(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); if (!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(); } function writePkcs8RSAPublic(key, der) { der.writeNull(); der.endSequence(); der.startSequence(asn1.Ber.BitString); der.writeByte(0x00); der.startSequence(); der.writeBuffer(key.part.n.data, asn1.Ber.Integer); der.writeBuffer(key.part.e.data, asn1.Ber.Integer); der.endSequence(); der.endSequence(); } function writePkcs8DSAPrivate(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(); } function writePkcs8DSAPublic(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(0x00); der.writeBuffer(key.part.y.data, asn1.Ber.Integer); der.endSequence(); } function writeECDSACurve(key, der) { var curve = algs.curves[key.curve]; if (curve.pkcs8oid) { /* This one has a name in pkcs#8, so just write the oid */ der.writeOID(curve.pkcs8oid); } else { // ECParameters sequence der.startSequence(); var version = Buffer.from([1]); der.writeBuffer(version, asn1.Ber.Integer); // FieldID sequence der.startSequence(); der.writeOID('1.2.840.10045.1.1'); // prime-field der.writeBuffer(curve.p, asn1.Ber.Integer); der.endSequence(); // Curve sequence der.startSequence(); var a = curve.p; if (a[0] === 0x0) 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; if (!h) { h = Buffer.from([1]); } der.writeBuffer(h, asn1.Ber.Integer); // ECParameters der.endSequence(); } } function writePkcs8ECDSAPublic(key, der) { writeECDSACurve(key, der); der.endSequence(); var Q = utils.ecNormalize(key.part.Q.data, true); der.writeBuffer(Q, asn1.Ber.BitString); } function writePkcs8ECDSAPrivate(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(0xa1); var Q = utils.ecNormalize(key.part.Q.data, true); der.writeBuffer(Q, asn1.Ber.BitString); der.endSequence(); der.endSequence(); der.endSequence(); } function writePkcs8EdDSAPublic(key, der) { der.endSequence(); utils.writeBitString(der, key.part.A.data); } function writePkcs8EdDSAPrivate(key, der) { der.endSequence(); var k = utils.mpNormalize(key.part.k.data, true); der.startSequence(asn1.Ber.OctetString); der.writeBuffer(k, asn1.Ber.OctetString); der.endSequence(); } /***/ }), /* 138 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. module.exports = { read: read, readSSHPrivate: readSSHPrivate, write: write }; var assert = __webpack_require__(108); var asn1 = __webpack_require__(120); var Buffer = __webpack_require__(114).Buffer; var algs = __webpack_require__(113); var utils = __webpack_require__(119); var crypto = __webpack_require__(94); var Key = __webpack_require__(112); var PrivateKey = __webpack_require__(117); var pem = __webpack_require__(135); var rfc4253 = __webpack_require__(139); var SSHBuffer = __webpack_require__(129); var errors = __webpack_require__(116); var bcrypt; function read(buf, options) { return (pem.read(buf, options)); } var MAGIC = 'openssh-key-v1'; function readSSHPrivate(type, buf, options) { buf = new SSHBuffer({buffer: buf}); var magic = buf.readCString(); assert.strictEqual(magic, MAGIC, 'bad magic string'); var cipher = buf.readString(); var kdf = buf.readString(); var kdfOpts = buf.readBuffer(); var nkeys = buf.readInt(); if (nkeys !== 1) { throw (new Error('OpenSSH-format key file contains ' + 'multiple keys: this is unsupported.')); } var pubKey = buf.readBuffer(); if (type === 'public') { assert.ok(buf.atEnd(), 'excess bytes left after key'); return (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 (cipher !== 'none') { throw (new Error('OpenSSH-format key uses KDF "none" ' + 'but specifies a cipher other than "none"')); } break; case 'bcrypt': var salt = kdfOptsBuf.readBuffer(); var rounds = kdfOptsBuf.readInt(); var cinf = utils.opensshCipherInfo(cipher); if (bcrypt === undefined) { bcrypt = __webpack_require__(140); } if (typeof (options.passphrase) === 'string') { options.passphrase = Buffer.from(options.passphrase, 'utf-8'); } if (!Buffer.isBuffer(options.passphrase)) { throw (new errors.KeyEncryptedError( options.filename, 'OpenSSH')); } var pass = new Uint8Array(options.passphrase); var salti = new Uint8Array(salt); /* Use the pbkdf to derive both the key and the IV. */ var out = new Uint8Array(cinf.keySize + cinf.blockSize); var res = bcrypt.pbkdf(pass, pass.length, salti, salti.length, out, out.length, rounds); if (res !== 0) { throw (new Error('bcrypt_pbkdf function returned ' + 'failure, parameters invalid')); } out = Buffer.from(out); var ckey = out.slice(0, cinf.keySize); var iv = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize); var cipherStream = crypto.createDecipheriv(cinf.opensslName, ckey, iv); cipherStream.setAutoPadding(false); var chunk, chunks = []; cipherStream.once('error', function (e) { if (e.toString().indexOf('bad decrypt') !== -1) { throw (new Error('Incorrect passphrase ' + 'supplied, could not decrypt key')); } throw (e); }); cipherStream.write(privKeyBlob); cipherStream.end(); while ((chunk = cipherStream.read()) !== null) chunks.push(chunk); privKeyBlob = Buffer.concat(chunks); break; default: throw (new Error( 'OpenSSH-format key uses unknown KDF "' + kdf + '"')); } buf = new SSHBuffer({buffer: privKeyBlob}); var checkInt1 = buf.readInt(); var checkInt2 = buf.readInt(); if (checkInt1 !== checkInt2) { throw (new Error('Incorrect passphrase supplied, could not ' + 'decrypt key')); } var ret = {}; var key = rfc4253.readInternal(ret, 'private', buf.remainder()); buf.skip(ret.consumed); var comment = buf.readString(); key.comment = comment; return (key); } function write(key, options) { var pubKey; if (PrivateKey.isPrivateKey(key)) pubKey = key.toPublic(); else pubKey = key; var cipher = 'none'; var kdf = 'none'; var kdfopts = Buffer.alloc(0); var cinf = { blockSize: 8 }; var passphrase; if (options !== undefined) { passphrase = options.passphrase; if (typeof (passphrase) === 'string') passphrase = Buffer.from(passphrase, 'utf-8'); if (passphrase !== undefined) { assert.buffer(passphrase, 'options.passphrase'); assert.optionalString(options.cipher, 'options.cipher'); cipher = options.cipher; if (cipher === undefined) cipher = 'aes128-ctr'; cinf = utils.opensshCipherInfo(cipher); kdf = 'bcrypt'; } } var privBuf; if (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 || ''); var n = 1; while (privBuf._offset % cinf.blockSize !== 0) privBuf.writeChar(n++); privBuf = privBuf.toBuffer(); } switch (kdf) { case 'none': break; case 'bcrypt': var salt = crypto.randomBytes(16); var rounds = 16; var kdfssh = new SSHBuffer({}); kdfssh.writeBuffer(salt); kdfssh.writeInt(rounds); kdfopts = kdfssh.toBuffer(); if (bcrypt === undefined) { bcrypt = __webpack_require__(140); } var pass = new Uint8Array(passphrase); var salti = new Uint8Array(salt); /* Use the pbkdf to derive both the key and the IV. */ var out = new Uint8Array(cinf.keySize + cinf.blockSize); var res = bcrypt.pbkdf(pass, pass.length, salti, salti.length, out, out.length, rounds); if (res !== 0) { throw (new Error('bcrypt_pbkdf function returned ' + 'failure, parameters invalid')); } out = Buffer.from(out); var ckey = out.slice(0, cinf.keySize); var iv = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize); var cipherStream = crypto.createCipheriv(cinf.opensslName, ckey, iv); cipherStream.setAutoPadding(false); var chunk, chunks = []; cipherStream.once('error', function (e) { throw (e); }); cipherStream.write(privBuf); cipherStream.end(); while ((chunk = cipherStream.read()) !== null) chunks.push(chunk); privBuf = Buffer.concat(chunks); break; default: throw (new Error('Unsupported kdf ' + kdf)); } var buf = new SSHBuffer({}); buf.writeCString(MAGIC); buf.writeString(cipher); /* cipher */ buf.writeString(kdf); /* kdf */ buf.writeBuffer(kdfopts); /* kdfoptions */ buf.writeInt(1); /* nkeys */ buf.writeBuffer(pubKey.toBuffer('rfc4253')); if (privBuf) buf.writeBuffer(privBuf); buf = buf.toBuffer(); var header; if (PrivateKey.isPrivateKey(key)) header = 'OPENSSH PRIVATE KEY'; else header = 'OPENSSH PUBLIC KEY'; var tmp = buf.toString('base64'); var len = tmp.length + (tmp.length / 70) + 18 + 16 + header.length*2 + 10; buf = Buffer.alloc(len); var o = 0; o += buf.write('-----BEGIN ' + header + '-----\n', o); for (var i = 0; i < tmp.length; ) { var limit = i + 70; if (limit > tmp.length) limit = tmp.length; o += buf.write(tmp.slice(i, limit), o); buf[o++] = 10; i = limit; } o += buf.write('-----END ' + header + '-----\n', o); return (buf.slice(0, o)); } /***/ }), /* 139 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. module.exports = { read: read.bind(undefined, false, undefined), readType: read.bind(undefined, false), write: write, /* semi-private api, used by sshpk-agent */ readPartial: read.bind(undefined, true), /* shared with ssh format */ readInternal: read, keyTypeToAlg: keyTypeToAlg, algToKeyType: algToKeyType }; var assert = __webpack_require__(108); var Buffer = __webpack_require__(114).Buffer; var algs = __webpack_require__(113); var utils = __webpack_require__(119); var Key = __webpack_require__(112); var PrivateKey = __webpack_require__(117); var SSHBuffer = __webpack_require__(129); function algToKeyType(alg) { assert.string(alg); if (alg === 'ssh-dss') return ('dsa'); else if (alg === 'ssh-rsa') return ('rsa'); else if (alg === 'ssh-ed25519') return ('ed25519'); else if (alg === 'ssh-curve25519') return ('curve25519'); else if (alg.match(/^ecdsa-sha2-/)) return ('ecdsa'); else throw (new Error('Unknown algorithm ' + alg)); } function keyTypeToAlg(key) { assert.object(key); if (key.type === 'dsa') return ('ssh-dss'); else if (key.type === 'rsa') return ('ssh-rsa'); else if (key.type === 'ed25519') return ('ssh-ed25519'); else if (key.type === 'curve25519') return ('ssh-curve25519'); else if (key.type === 'ecdsa') return ('ecdsa-sha2-' + key.part.curve.data.toString()); else throw (new Error('Unknown key type ' + key.type)); } function read(partial, type, buf, options) { if (typeof (buf) === 'string') buf = Buffer.from(buf); assert.buffer(buf, 'buf'); var key = {}; var parts = key.parts = []; var sshbuf = new SSHBuffer({buffer: buf}); var 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; if (type && type === 'private') partCount = algs.privInfo[key.type].parts.length; while (!sshbuf.atEnd() && parts.length < partCount) parts.push(sshbuf.readPart()); while (!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; var algInfo = algs.info[key.type]; if (type === 'private' || algInfo.parts.length !== parts.length) { algInfo = algs.privInfo[key.type]; Constructor = PrivateKey; } assert.strictEqual(algInfo.parts.length, parts.length); if (key.type === 'ecdsa') { var res = /^ecdsa-sha2-(.+)$/.exec(alg); assert.ok(res !== null); assert.strictEqual(res[1], parts[0].data.toString()); } var normalized = true; for (var i = 0; i < algInfo.parts.length; ++i) { var p = parts[i]; p.name = algInfo.parts[i]; /* * OpenSSH stores ed25519 "private" keys as seed + public key * concat'd together (k followed by A). We want to keep them * separate for other formats that don't do this. */ if (key.type === 'ed25519' && p.name === 'k') p.data = p.data.slice(0, 32); if (p.name !== 'curve' && algInfo.normalize !== false) { var nd; if (key.type === 'ed25519') { nd = utils.zeroPadToLength(p.data, 32); } else { nd = utils.mpNormalize(p.data); } if (nd.toString('binary') !== p.data.toString('binary')) { p.data = nd; normalized = false; } } } if (normalized) key._rfc4253Cache = sshbuf.toBuffer(); if (partial && typeof (partial) === 'object') { partial.remainder = sshbuf.remainder(); partial.consumed = sshbuf._offset; } return (new Constructor(key)); } function write(key, options) { assert.object(key); var alg = keyTypeToAlg(key); var i; var algInfo = algs.info[key.type]; if (PrivateKey.isPrivateKey(key)) algInfo = algs.privInfo[key.type]; var parts = algInfo.parts; var buf = new SSHBuffer({}); buf.writeString(alg); for (i = 0; i < parts.length; ++i) { var data = key.part[parts[i]].data; if (algInfo.normalize !== false) { if (key.type === 'ed25519') data = utils.zeroPadToLength(data, 32); else data = utils.mpNormalize(data); } if (key.type === 'ed25519' && parts[i] === 'k') data = Buffer.concat([data, key.part.A.data]); buf.writeBuffer(data); } return (buf.toBuffer()); } /***/ }), /* 140 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var crypto_hash_sha512 = __webpack_require__(128).lowlevel.crypto_hash; /* * This file is a 1:1 port from the OpenBSD blowfish.c and bcrypt_pbkdf.c. As a * result, it retains the original copyright and license. The two files are * under slightly different (but compatible) licenses, and are here combined in * one file. * * Credit for the actual porting work goes to: * Devi Mandiri <me@devi.web.id> */ /* * The Blowfish portions are under the following license: * * Blowfish block cipher for OpenBSD * Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de> * All rights reserved. * * Implementation advice by David Mazieres <dm@lcs.mit.edu>. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * The bcrypt_pbkdf portions are under the following license: * * Copyright (c) 2013 Ted Unangst <tedu@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * Performance improvements (Javascript-specific): * * Copyright 2016, Joyent Inc * Author: Alex Wilson <alex.wilson@joyent.com> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ // Ported from OpenBSD bcrypt_pbkdf.c v1.9 var BLF_J = 0; var Blowfish = function() { this.S = [ new Uint32Array([ 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e, 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677, 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88, 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239, 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0, 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88, 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba, 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09, 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82, 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8, 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1, 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477, 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915, 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a]), new Uint32Array([ 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7, 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87, 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16, 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf, 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281, 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0, 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061, 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7]), new Uint32Array([ 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504, 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb, 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc, 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115, 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c, 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a, 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633, 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027, 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62, 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0]), new Uint32Array([ 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6, 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9, 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51, 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b, 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd, 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32, 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47, 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84, 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048, 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38, 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f, 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525, 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964, 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d, 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a, 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9, 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6]) ]; this.P = new Uint32Array([ 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, 0x9216d5d9, 0x8979fb1b]); }; function F(S, x8, i) { return (((S[0][x8[i+3]] + S[1][x8[i+2]]) ^ S[2][x8[i+1]]) + S[3][x8[i]]); }; Blowfish.prototype.encipher = function(x, x8) { if (x8 === undefined) { x8 = new Uint8Array(x.buffer); if (x.byteOffset !== 0) x8 = x8.subarray(x.byteOffset); } x[0] ^= this.P[0]; for (var i = 1; i < 16; i += 2) { x[1] ^= F(this.S, x8, 0) ^ this.P[i]; x[0] ^= F(this.S, x8, 4) ^ this.P[i+1]; } var t = x[0]; x[0] = x[1] ^ this.P[17]; x[1] = t; }; Blowfish.prototype.decipher = function(x) { var x8 = new Uint8Array(x.buffer); if (x.byteOffset !== 0) x8 = x8.subarray(x.byteOffset); x[0] ^= this.P[17]; for (var i = 16; i > 0; i -= 2) { x[1] ^= F(this.S, x8, 0) ^ this.P[i]; x[0] ^= F(this.S, x8, 4) ^ this.P[i-1]; } var t = x[0]; x[0] = x[1] ^ this.P[0]; x[1] = t; }; function stream2word(data, databytes){ var i, temp = 0; for (i = 0; i < 4; i++, BLF_J++) { if (BLF_J >= databytes) BLF_J = 0; temp = (temp << 8) | data[BLF_J]; } return temp; }; Blowfish.prototype.expand0state = function(key, keybytes) { var d = new Uint32Array(2), i, k; var d8 = new Uint8Array(d.buffer); for (i = 0, BLF_J = 0; i < 18; i++) { this.P[i] ^= stream2word(key, keybytes); } BLF_J = 0; for (i = 0; i < 18; i += 2) { this.encipher(d, d8); this.P[i] = d[0]; this.P[i+1] = d[1]; } for (i = 0; i < 4; i++) { for (k = 0; k < 256; k += 2) { this.encipher(d, d8); this.S[i][k] = d[0]; this.S[i][k+1] = d[1]; } } }; Blowfish.prototype.expandstate = function(data, databytes, key, keybytes) { var d = new Uint32Array(2), i, k; for (i = 0, BLF_J = 0; i < 18; i++) { this.P[i] ^= stream2word(key, keybytes); } for (i = 0, BLF_J = 0; i < 18; i += 2) { d[0] ^= stream2word(data, databytes); d[1] ^= stream2word(data, databytes); this.encipher(d); this.P[i] = d[0]; this.P[i+1] = d[1]; } for (i = 0; i < 4; i++) { for (k = 0; k < 256; k += 2) { d[0] ^= stream2word(data, databytes); d[1] ^= stream2word(data, databytes); this.encipher(d); this.S[i][k] = d[0]; this.S[i][k+1] = d[1]; } } BLF_J = 0; }; Blowfish.prototype.enc = function(data, blocks) { for (var i = 0; i < blocks; i++) { this.encipher(data.subarray(i*2)); } }; Blowfish.prototype.dec = function(data, blocks) { for (var i = 0; i < blocks; i++) { this.decipher(data.subarray(i*2)); } }; var BCRYPT_BLOCKS = 8, BCRYPT_HASHSIZE = 32; function bcrypt_hash(sha2pass, sha2salt, out) { var state = new Blowfish(), cdata = new Uint32Array(BCRYPT_BLOCKS), i, ciphertext = new Uint8Array([79,120,121,99,104,114,111,109,97,116,105, 99,66,108,111,119,102,105,115,104,83,119,97,116,68,121,110,97,109, 105,116,101]); //"OxychromaticBlowfishSwatDynamite" state.expandstate(sha2salt, 64, sha2pass, 64); for (i = 0; i < 64; i++) { state.expand0state(sha2salt, 64); state.expand0state(sha2pass, 64); } for (i = 0; i < BCRYPT_BLOCKS; i++) cdata[i] = stream2word(ciphertext, ciphertext.byteLength); for (i = 0; i < 64; i++) state.enc(cdata, cdata.byteLength / 8); for (i = 0; i < BCRYPT_BLOCKS; i++) { out[4*i+3] = cdata[i] >>> 24; out[4*i+2] = cdata[i] >>> 16; out[4*i+1] = cdata[i] >>> 8; out[4*i+0] = cdata[i]; } }; function bcrypt_pbkdf(pass, passlen, salt, saltlen, key, keylen, rounds) { var sha2pass = new Uint8Array(64), sha2salt = new Uint8Array(64), out = new Uint8Array(BCRYPT_HASHSIZE), tmpout = new Uint8Array(BCRYPT_HASHSIZE), countsalt = new Uint8Array(saltlen+4), i, j, amt, stride, dest, count, origkeylen = keylen; if (rounds < 1) return -1; if (passlen === 0 || saltlen === 0 || keylen === 0 || keylen > (out.byteLength * out.byteLength) || saltlen > (1<<20)) return -1; stride = Math.floor((keylen + out.byteLength - 1) / out.byteLength); amt = Math.floor((keylen + stride - 1) / stride); for (i = 0; i < saltlen; i++) countsalt[i] = salt[i]; crypto_hash_sha512(sha2pass, pass, passlen); for (count = 1; keylen > 0; count++) { countsalt[saltlen+0] = count >>> 24; countsalt[saltlen+1] = count >>> 16; countsalt[saltlen+2] = count >>> 8; countsalt[saltlen+3] = count; crypto_hash_sha512(sha2salt, countsalt, saltlen + 4); bcrypt_hash(sha2pass, sha2salt, tmpout); for (i = out.byteLength; i--;) out[i] = tmpout[i]; for (i = 1; i < rounds; i++) { crypto_hash_sha512(sha2salt, tmpout, tmpout.byteLength); bcrypt_hash(sha2pass, sha2salt, tmpout); for (j = 0; j < out.byteLength; j++) out[j] ^= tmpout[j]; } amt = Math.min(amt, keylen); for (i = 0; i < amt; i++) { dest = i * stride + (count - 1); if (dest >= origkeylen) break; key[dest] = out[i]; } keylen -= i; } return 0; }; module.exports = { BLOCKS: BCRYPT_BLOCKS, HASHSIZE: BCRYPT_HASHSIZE, hash: bcrypt_hash, pbkdf: bcrypt_pbkdf }; /***/ }), /* 141 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. module.exports = { read: read, write: write }; var assert = __webpack_require__(108); var Buffer = __webpack_require__(114).Buffer; var rfc4253 = __webpack_require__(139); var utils = __webpack_require__(119); var Key = __webpack_require__(112); var PrivateKey = __webpack_require__(117); var sshpriv = __webpack_require__(138); /*JSSTYLED*/ var SSHKEY_RE = /^([a-z0-9-]+)[ \t]+([a-zA-Z0-9+\/]+[=]*)([ \t]+([^ \t][^\n]*[\n]*)?)?$/; /*JSSTYLED*/ var SSHKEY_RE2 = /^([a-z0-9-]+)[ \t\n]+([a-zA-Z0-9+\/][a-zA-Z0-9+\/ \t\n=]*)([^a-zA-Z0-9+\/ \t\n=].*)?$/; function read(buf, options) { if (typeof (buf) !== 'string') { assert.buffer(buf, 'buf'); buf = buf.toString('ascii'); } var trimmed = buf.trim().replace(/[\\\r]/g, ''); var m = trimmed.match(SSHKEY_RE); if (!m) m = trimmed.match(SSHKEY_RE2); assert.ok(m, 'key must match regex'); var type = rfc4253.algToKeyType(m[1]); var kbuf = Buffer.from(m[2], 'base64'); /* * This is a bit tricky. If we managed to parse the key and locate the * key comment with the regex, then do a non-partial read and assert * that we have consumed all bytes. If we couldn't locate the key * comment, though, there may be whitespace shenanigans going on that * have conjoined the comment to the rest of the key. We do a partial * read in this case to try to make the best out of a sorry situation. */ var key; var ret = {}; if (m[4]) { try { key = rfc4253.read(kbuf); } catch (e) { m = trimmed.match(SSHKEY_RE2); assert.ok(m, 'key must match regex'); kbuf = Buffer.from(m[2], 'base64'); key = rfc4253.readInternal(ret, 'public', kbuf); } } else { key = rfc4253.readInternal(ret, 'public', kbuf); } assert.strictEqual(type, key.type); if (m[4] && m[4].length > 0) { key.comment = m[4]; } else if (ret.consumed) { /* * Now the magic: trying to recover the key comment when it's * gotten conjoined to the key or otherwise shenanigan'd. * * Work out how much base64 we used, then drop all non-base64 * chars from the beginning up to this point in the the string. * Then offset in this and try to make up for missing = chars. */ var data = m[2] + (m[3] ? m[3] : ''); var realOffset = Math.ceil(ret.consumed / 3) * 4; data = data.slice(0, realOffset - 2). /*JSSTYLED*/ replace(/[^a-zA-Z0-9+\/=]/g, '') + data.slice(realOffset - 2); var padding = ret.consumed % 3; if (padding > 0 && data.slice(realOffset - 1, realOffset) !== '=') realOffset--; while (data.slice(realOffset, realOffset + 1) === '=') realOffset++; /* Finally, grab what we think is the comment & clean it up. */ var trailer = data.slice(realOffset); trailer = trailer.replace(/[\r\n]/g, ' '). replace(/^\s+/, ''); if (trailer.match(/^[a-zA-Z0-9]/)) key.comment = trailer; } return (key); } function write(key, options) { assert.object(key); if (!Key.isKey(key)) throw (new Error('Must be a public key')); var parts = []; var alg = rfc4253.keyTypeToAlg(key); parts.push(alg); var buf = rfc4253.write(key); parts.push(buf.toString('base64')); if (key.comment) parts.push(key.comment); return (Buffer.from(parts.join(' '))); } /***/ }), /* 142 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2017 Joyent, Inc. module.exports = { read: read, write: write }; var assert = __webpack_require__(108); var Buffer = __webpack_require__(114).Buffer; var Key = __webpack_require__(112); var PrivateKey = __webpack_require__(117); var utils = __webpack_require__(119); var SSHBuffer = __webpack_require__(129); var Dhe = __webpack_require__(130); var supportedAlgos = { 'rsa-sha1' : 5, 'rsa-sha256' : 8, 'rsa-sha512' : 10, 'ecdsa-p256-sha256' : 13, 'ecdsa-p384-sha384' : 14 /* * ed25519 is hypothetically supported with id 15 * but the common tools available don't appear to be * capable of generating/using ed25519 keys */ }; var supportedAlgosById = {}; Object.keys(supportedAlgos).forEach(function (k) { supportedAlgosById[supportedAlgos[k]] = k.toUpperCase(); }); function read(buf, options) { if (typeof (buf) !== 'string') { assert.buffer(buf, 'buf'); buf = buf.toString('ascii'); } var lines = buf.split('\n'); if (lines[0].match(/^Private-key-format\: v1/)) { var algElems = lines[1].split(' '); var algoNum = parseInt(algElems[1], 10); var algoName = algElems[2]; if (!supportedAlgosById[algoNum]) throw (new Error('Unsupported algorithm: ' + algoName)); return (readDNSSECPrivateKey(algoNum, lines.slice(2))); } // skip any comment-lines var line = 0; /* JSSTYLED */ while (lines[line].match(/^\;/)) line++; // we should now have *one single* line left with our KEY on it. if ((lines[line].match(/\. IN KEY /) || lines[line].match(/\. IN DNSKEY /)) && lines[line+1].length === 0) { return (readRFC3110(lines[line])); } throw (new Error('Cannot parse dnssec key')); } function readRFC3110(keyString) { var elems = keyString.split(' '); //unused var flags = parseInt(elems[3], 10); //unused var protocol = parseInt(elems[4], 10); var algorithm = parseInt(elems[5], 10); if (!supportedAlgosById[algorithm]) throw (new Error('Unsupported algorithm: ' + algorithm)); var base64key = elems.slice(6, elems.length).join(); var keyBuffer = Buffer.from(base64key, 'base64'); if (supportedAlgosById[algorithm].match(/^RSA-/)) { // join the rest of the body into a single base64-blob var publicExponentLen = keyBuffer.readUInt8(0); if (publicExponentLen != 3 && publicExponentLen != 1) throw (new Error('Cannot parse dnssec key: ' + 'unsupported exponent length')); var publicExponent = keyBuffer.slice(1, publicExponentLen+1); publicExponent = utils.mpNormalize(publicExponent); var modulus = keyBuffer.slice(1+publicExponentLen); modulus = utils.mpNormalize(modulus); // now, make the key var rsaKey = { type: 'rsa', parts: [] }; rsaKey.parts.push({ name: 'e', data: publicExponent}); rsaKey.parts.push({ name: 'n', data: modulus}); return (new Key(rsaKey)); } if (supportedAlgosById[algorithm] === 'ECDSA-P384-SHA384' || supportedAlgosById[algorithm] === 'ECDSA-P256-SHA256') { var curve = 'nistp384'; var size = 384; if (supportedAlgosById[algorithm].match(/^ECDSA-P256-SHA256/)) { curve = 'nistp256'; size = 256; } var ecdsaKey = { type: 'ecdsa', curve: curve, size: size, parts: [ {name: 'curve', data: Buffer.from(curve) }, {name: 'Q', data: utils.ecNormalize(keyBuffer) } ] }; return (new Key(ecdsaKey)); } throw (new Error('Unsupported algorithm: ' + supportedAlgosById[algorithm])); } function elementToBuf(e) { return (Buffer.from(e.split(' ')[1], 'base64')); } function readDNSSECRSAPrivateKey(elements) { var rsaParams = {}; elements.forEach(function (element) { if (element.split(' ')[0] === 'Modulus:') rsaParams['n'] = elementToBuf(element); else if (element.split(' ')[0] === 'PublicExponent:') rsaParams['e'] = elementToBuf(element); else if (element.split(' ')[0] === 'PrivateExponent:') rsaParams['d'] = elementToBuf(element); else if (element.split(' ')[0] === 'Prime1:') rsaParams['p'] = elementToBuf(element); else if (element.split(' ')[0] === 'Prime2:') rsaParams['q'] = elementToBuf(element); else if (element.split(' ')[0] === 'Exponent1:') rsaParams['dmodp'] = elementToBuf(element); else if (element.split(' ')[0] === 'Exponent2:') rsaParams['dmodq'] = elementToBuf(element); else if (element.split(' ')[0] === 'Coefficient:') rsaParams['iqmp'] = elementToBuf(element); }); // now, make the key var key = { type: 'rsa', parts: [ { name: 'e', data: utils.mpNormalize(rsaParams['e'])}, { name: 'n', data: utils.mpNormalize(rsaParams['n'])}, { name: 'd', data: utils.mpNormalize(rsaParams['d'])}, { name: 'p', data: utils.mpNormalize(rsaParams['p'])}, { name: 'q', data: utils.mpNormalize(rsaParams['q'])}, { name: 'dmodp', data: utils.mpNormalize(rsaParams['dmodp'])}, { name: 'dmodq', data: utils.mpNormalize(rsaParams['dmodq'])}, { name: 'iqmp', data: utils.mpNormalize(rsaParams['iqmp'])} ] }; return (new PrivateKey(key)); } function readDNSSECPrivateKey(alg, elements) { if (supportedAlgosById[alg].match(/^RSA-/)) { return (readDNSSECRSAPrivateKey(elements)); } if (supportedAlgosById[alg] === 'ECDSA-P384-SHA384' || supportedAlgosById[alg] === 'ECDSA-P256-SHA256') { var d = Buffer.from(elements[0].split(' ')[1], 'base64'); var curve = 'nistp384'; var size = 384; if (supportedAlgosById[alg] === 'ECDSA-P256-SHA256') { curve = 'nistp256'; size = 256; } // DNSSEC generates the public-key on the fly (go calculate it) var publicKey = utils.publicFromPrivateECDSA(curve, d); var Q = publicKey.part['Q'].data; var ecdsaKey = { type: 'ecdsa', curve: curve, size: size, parts: [ {name: 'curve', data: Buffer.from(curve) }, {name: 'd', data: d }, {name: 'Q', data: Q } ] }; return (new PrivateKey(ecdsaKey)); } throw (new Error('Unsupported algorithm: ' + supportedAlgosById[alg])); } function dnssecTimestamp(date) { var year = date.getFullYear() + ''; //stringify var month = (date.getMonth() + 1); var timestampStr = year + month + date.getUTCDate(); timestampStr += '' + date.getUTCHours() + date.getUTCMinutes(); timestampStr += date.getUTCSeconds(); return (timestampStr); } function rsaAlgFromOptions(opts) { if (!opts || !opts.hashAlgo || opts.hashAlgo === 'sha1') return ('5 (RSASHA1)'); else if (opts.hashAlgo === 'sha256') return ('8 (RSASHA256)'); else if (opts.hashAlgo === 'sha512') return ('10 (RSASHA512)'); else throw (new Error('Unknown or unsupported hash: ' + opts.hashAlgo)); } function writeRSA(key, options) { // if we're missing parts, add them. if (!key.part.dmodp || !key.part.dmodq) { utils.addRSAMissing(key); } var out = ''; out += 'Private-key-format: v1.3\n'; out += 'Algorithm: ' + rsaAlgFromOptions(options) + '\n'; var n = utils.mpDenormalize(key.part['n'].data); out += 'Modulus: ' + n.toString('base64') + '\n'; var e = utils.mpDenormalize(key.part['e'].data); out += 'PublicExponent: ' + e.toString('base64') + '\n'; var d = utils.mpDenormalize(key.part['d'].data); out += 'PrivateExponent: ' + d.toString('base64') + '\n'; var p = utils.mpDenormalize(key.part['p'].data); out += 'Prime1: ' + p.toString('base64') + '\n'; var q = utils.mpDenormalize(key.part['q'].data); out += 'Prime2: ' + q.toString('base64') + '\n'; var dmodp = utils.mpDenormalize(key.part['dmodp'].data); out += 'Exponent1: ' + dmodp.toString('base64') + '\n'; var dmodq = utils.mpDenormalize(key.part['dmodq'].data); out += 'Exponent2: ' + dmodq.toString('base64') + '\n'; var iqmp = utils.mpDenormalize(key.part['iqmp'].data); out += 'Coefficient: ' + iqmp.toString('base64') + '\n'; // Assume that we're valid as-of now var timestamp = new Date(); out += 'Created: ' + dnssecTimestamp(timestamp) + '\n'; out += 'Publish: ' + dnssecTimestamp(timestamp) + '\n'; out += 'Activate: ' + dnssecTimestamp(timestamp) + '\n'; return (Buffer.from(out, 'ascii')); } function writeECDSA(key, options) { var out = ''; out += 'Private-key-format: v1.3\n'; if (key.curve === 'nistp256') { out += 'Algorithm: 13 (ECDSAP256SHA256)\n'; } else if (key.curve === 'nistp384') { out += 'Algorithm: 14 (ECDSAP384SHA384)\n'; } else { throw (new Error('Unsupported curve')); } var base64Key = key.part['d'].data.toString('base64'); out += 'PrivateKey: ' + base64Key + '\n'; // Assume that we're valid as-of now var timestamp = new Date(); out += 'Created: ' + dnssecTimestamp(timestamp) + '\n'; out += 'Publish: ' + dnssecTimestamp(timestamp) + '\n'; out += 'Activate: ' + dnssecTimestamp(timestamp) + '\n'; return (Buffer.from(out, 'ascii')); } function write(key, options) { if (PrivateKey.isPrivateKey(key)) { if (key.type === 'rsa') { return (writeRSA(key, options)); } else if (key.type === 'ecdsa') { return (writeECDSA(key, options)); } else { throw (new Error('Unsupported algorithm: ' + key.type)); } } else if (Key.isKey(key)) { /* * RFC3110 requires a keyname, and a keytype, which we * don't really have a mechanism for specifying such * additional metadata. */ throw (new Error('Format "dnssec" only supports ' + 'writing private keys')); } else { throw (new Error('key is not a Key or PrivateKey')); } } /***/ }), /* 143 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2018 Joyent, Inc. module.exports = { read: read, write: write }; var assert = __webpack_require__(108); var Buffer = __webpack_require__(114).Buffer; var rfc4253 = __webpack_require__(139); var Key = __webpack_require__(112); var errors = __webpack_require__(116); function read(buf, options) { var lines = buf.toString('ascii').split(/[\r\n]+/); var found = false; var parts; var si = 0; while (si < lines.length) { parts = splitHeader(lines[si++]); if (parts && parts[0].toLowerCase() === 'putty-user-key-file-2') { found = true; break; } } if (!found) { throw (new Error('No PuTTY format first line found')); } var alg = parts[1]; parts = splitHeader(lines[si++]); assert.equal(parts[0].toLowerCase(), 'encryption'); parts = splitHeader(lines[si++]); assert.equal(parts[0].toLowerCase(), 'comment'); var comment = parts[1]; parts = splitHeader(lines[si++]); assert.equal(parts[0].toLowerCase(), 'public-lines'); var publicLines = parseInt(parts[1], 10); if (!isFinite(publicLines) || publicLines < 0 || publicLines > lines.length) { throw (new Error('Invalid public-lines count')); } var publicBuf = Buffer.from( lines.slice(si, si + publicLines).join(''), 'base64'); var keyType = rfc4253.algToKeyType(alg); var key = rfc4253.read(publicBuf); if (key.type !== keyType) { throw (new Error('Outer key algorithm mismatch')); } key.comment = comment; return (key); } function splitHeader(line) { var idx = line.indexOf(':'); if (idx === -1) return (null); var header = line.slice(0, idx); ++idx; while (line[idx] === ' ') ++idx; var rest = line.slice(idx); return ([header, rest]); } function write(key, options) { assert.object(key); if (!Key.isKey(key)) throw (new Error('Must be a public key')); var alg = rfc4253.keyTypeToAlg(key); var buf = rfc4253.write(key); var comment = key.comment || ''; var b64 = buf.toString('base64'); var lines = wrap(b64, 64); lines.unshift('Public-Lines: ' + lines.length); lines.unshift('Comment: ' + comment); lines.unshift('Encryption: none'); lines.unshift('PuTTY-User-Key-File-2: ' + alg); return (Buffer.from(lines.join('\n') + '\n')); } function wrap(txt, len) { var lines = []; var pos = 0; while (pos < txt.length) { lines.push(txt.slice(pos, pos + 64)); pos += 64; } return (lines); } /***/ }), /* 144 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2016 Joyent, Inc. module.exports = Certificate; var assert = __webpack_require__(108); var Buffer = __webpack_require__(114).Buffer; var algs = __webpack_require__(113); var crypto = __webpack_require__(94); var Fingerprint = __webpack_require__(115); var Signature = __webpack_require__(118); var errs = __webpack_require__(116); var util = __webpack_require__(9); var utils = __webpack_require__(119); var Key = __webpack_require__(112); var PrivateKey = __webpack_require__(117); var Identity = __webpack_require__(145); var formats = {}; formats['openssh'] = __webpack_require__(146); formats['x509'] = __webpack_require__(147); formats['pem'] = __webpack_require__(148); var CertificateParseError = errs.CertificateParseError; var 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'); if (opts.issuerKey !== undefined) { 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) { if (format === undefined) format = 'x509'; assert.string(format, 'format'); assert.object(formats[format], 'formats[format]'); assert.optionalObject(options, 'options'); return (formats[format].write(this, options)); }; Certificate.prototype.toString = function (format, options) { if (format === undefined) format = 'pem'; return (this.toBuffer(format, options).toString()); }; Certificate.prototype.fingerprint = function (algo) { if (algo === undefined) 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) { assert.string(algo, 'algorithm'); algo = algo.toLowerCase(); if (algs.hashAlgs[algo] === undefined) throw (new InvalidAlgorithmError(algo)); if (this._hashCache[algo]) return (this._hashCache[algo]); var hash = crypto.createHash(algo). update(this.toBuffer('x509')).digest(); this._hashCache[algo] = hash; return (hash); }; Certificate.prototype.isExpired = function (when) { if (when === undefined) when = new Date(); return (!((when.getTime() >= this.validFrom.getTime()) && (when.getTime() < this.validUntil.getTime()))); }; Certificate.prototype.isSignedBy = function (issuerCert) { utils.assertCompatible(issuerCert, Certificate, [1, 0], 'issuer'); if (!this.issuer.equals(issuerCert.subjects[0])) return (false); if (this.issuer.purposes && this.issuer.purposes.length > 0 && this.issuer.purposes.indexOf('ca') === -1) { return (false); } return (this.isSignedByKey(issuerCert.subjectKey)); }; Certificate.prototype.getExtension = function (keyOrOid) { assert.string(keyOrOid, 'keyOrOid'); var ext = this.getExtensions().filter(function (maybeExt) { if (maybeExt.format === 'x509') return (maybeExt.oid === keyOrOid); if (maybeExt.format === 'openssh') return (maybeExt.name === keyOrOid); return (false); })[0]; return (ext); }; Certificate.prototype.getExtensions = function () { var exts = []; var x509 = this.signatures.x509; if (x509 && x509.extras && x509.extras.exts) { x509.extras.exts.forEach(function (ext) { ext.format = 'x509'; exts.push(ext); }); } var openssh = this.signatures.openssh; if (openssh && openssh.exts) { openssh.exts.forEach(function (ext) { ext.format = 'openssh'; exts.push(ext); }); } return (exts); }; Certificate.prototype.isSignedByKey = function (issuerKey) { utils.assertCompatible(issuerKey, Key, [1, 2], 'issuerKey'); if (this.issuerKey !== undefined) { return (this.issuerKey. fingerprint('sha512').matches(issuerKey)); } var fmt = Object.keys(this.signatures)[0]; var valid = formats[fmt].verify(this, issuerKey); if (valid) this.issuerKey = issuerKey; return (valid); }; Certificate.prototype.signWith = function (key) { utils.assertCompatible(key, PrivateKey, [1, 2], 'key'); var fmts = Object.keys(formats); var didOne = false; for (var i = 0; i < fmts.length; ++i) { if (fmts[i] !== 'pem') { var ret = formats[fmts[i]].sign(this, key); if (ret === true) didOne = true; } } if (!didOne) { throw (new Error('Failed to sign the certificate for any ' + 'available certificate formats')); } }; Certificate.createSelfSigned = function (subjectOrSubjects, key, options) { var subjects; if (Array.isArray(subjectOrSubjects)) subjects = subjectOrSubjects; else subjects = [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'); if (options === undefined) options = {}; assert.optionalObject(options.validFrom, 'options.validFrom'); assert.optionalObject(options.validUntil, 'options.validUntil'); var validFrom = options.validFrom; var validUntil = options.validUntil; if (validFrom === undefined) validFrom = new Date(); if (validUntil === undefined) { assert.optionalNumber(options.lifetime, 'options.lifetime'); var lifetime = options.lifetime; if (lifetime === undefined) lifetime = 10*365*24*3600; validUntil = new Date(); validUntil.setTime(validUntil.getTime() + lifetime*1000); } assert.optionalBuffer(options.serial, 'options.serial'); var serial = options.serial; if (serial === undefined) serial = Buffer.from('0000000000000001', 'hex'); var purposes = options.purposes; if (purposes === undefined) purposes = []; if (purposes.indexOf('signature') === -1) purposes.push('signature'); /* Self-signed certs are always CAs. */ if (purposes.indexOf('ca') === -1) purposes.push('ca'); if (purposes.indexOf('crl') === -1) purposes.push('crl'); /* * If we weren't explicitly given any other purposes, do the sensible * thing and add some basic ones depending on the subject type. */ if (purposes.length <= 3) { var hostSubjects = subjects.filter(function (subject) { return (subject.type === 'host'); }); var userSubjects = subjects.filter(function (subject) { return (subject.type === 'user'); }); if (hostSubjects.length > 0) { if (purposes.indexOf('serverAuth') === -1) purposes.push('serverAuth'); } if (userSubjects.length > 0) { if (purposes.indexOf('clientAuth') === -1) purposes.push('clientAuth'); } if (userSubjects.length > 0 || hostSubjects.length > 0) { if (purposes.indexOf('keyAgreement') === -1) purposes.push('keyAgreement'); if (key.type === 'rsa' && purposes.indexOf('encryption') === -1) 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 }); cert.signWith(key); return (cert); }; Certificate.create = function (subjectOrSubjects, key, issuer, issuerKey, options) { var subjects; if (Array.isArray(subjectOrSubjects)) subjects = subjectOrSubjects; else subjects = [subjectOrSubjects]; assert.arrayOfObject(subjects); subjects.forEach(function (subject) { utils.assertCompatible(subject, Identity, [1, 0], 'subject'); }); utils.assertCompatible(key, Key, [1, 0], 'key'); if (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'); if (options === undefined) options = {}; assert.optionalObject(options.validFrom, 'options.validFrom'); assert.optionalObject(options.validUntil, 'options.validUntil'); var validFrom = options.validFrom; var validUntil = options.validUntil; if (validFrom === undefined) validFrom = new Date(); if (validUntil === undefined) { assert.optionalNumber(options.lifetime, 'options.lifetime'); var lifetime = options.lifetime; if (lifetime === undefined) lifetime = 10*365*24*3600; validUntil = new Date(); validUntil.setTime(validUntil.getTime() + lifetime*1000); } assert.optionalBuffer(options.serial, 'options.serial'); var serial = options.serial; if (serial === undefined) serial = Buffer.from('0000000000000001', 'hex'); var purposes = options.purposes; if (purposes === undefined) purposes = []; if (purposes.indexOf('signature') === -1) purposes.push('signature'); if (options.ca === true) { if (purposes.indexOf('ca') === -1) purposes.push('ca'); if (purposes.indexOf('crl') === -1) purposes.push('crl'); } var hostSubjects = subjects.filter(function (subject) { return (subject.type === 'host'); }); var userSubjects = subjects.filter(function (subject) { return (subject.type === 'user'); }); if (hostSubjects.length > 0) { if (purposes.indexOf('serverAuth') === -1) purposes.push('serverAuth'); } if (userSubjects.length > 0) { if (purposes.indexOf('clientAuth') === -1) purposes.push('clientAuth'); } if (userSubjects.length > 0 || hostSubjects.length > 0) { if (purposes.indexOf('keyAgreement') === -1) purposes.push('keyAgreement'); if (key.type === 'rsa' && purposes.indexOf('encryption') === -1) 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 }); cert.signWith(issuerKey); return (cert); }; Certificate.parse = function (data, format, options) { if (typeof (data) !== 'string') assert.buffer(data, 'data'); if (format === undefined) format = 'auto'; assert.string(format, 'format'); if (typeof (options) === 'string') options = { filename: options }; assert.optionalObject(options, 'options'); if (options === undefined) options = {}; assert.optionalString(options.filename, 'options.filename'); if (options.filename === undefined) options.filename = '(unnamed)'; assert.object(formats[format], 'formats[format]'); try { var k = formats[format].read(data, options); return (k); } catch (e) { throw (new CertificateParseError(options.filename, format, e)); } }; Certificate.isCertificate = function (obj, ver) { return (utils.isCompatible(obj, Certificate, ver)); }; /* * API versions for Certificate: * [1,0] -- initial ver * [1,1] -- openssh format now unpacks extensions */ Certificate.prototype._sshpkApiVersion = [1, 1]; Certificate._oldVersionDetect = function (obj) { return ([1, 0]); }; /***/ }), /* 145 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2017 Joyent, Inc. module.exports = Identity; var assert = __webpack_require__(108); var algs = __webpack_require__(113); var crypto = __webpack_require__(94); var Fingerprint = __webpack_require__(115); var Signature = __webpack_require__(118); var errs = __webpack_require__(116); var util = __webpack_require__(9); var utils = __webpack_require__(119); var asn1 = __webpack_require__(120); var Buffer = __webpack_require__(114).Buffer; /*JSSTYLED*/ var DNS_NAME_RE = /^([*]|[a-z0-9][a-z0-9\-]{0,62})(?:\.([*]|[a-z0-9][a-z0-9\-]{0,62}))*$/i; var oids = {}; oids.cn = '2.5.4.3'; oids.o = '2.5.4.10'; oids.ou = '2.5.4.11'; oids.l = '2.5.4.7'; oids.s = '2.5.4.8'; oids.c = '2.5.4.6'; oids.sn = '2.5.4.4'; oids.postalCode = '2.5.4.17'; oids.serialNumber = '2.5.4.5'; oids.street = '2.5.4.9'; oids.x500UniqueIdentifier = '2.5.4.45'; oids.role = '2.5.4.72'; oids.telephoneNumber = '2.5.4.20'; oids.description = '2.5.4.13'; oids.dc = '0.9.2342.19200300.100.1.25'; oids.uid = '0.9.2342.19200300.100.1.1'; oids.mail = '0.9.2342.19200300.100.1.3'; oids.title = '2.5.4.12'; oids.gn = '2.5.4.42'; oids.initials = '2.5.4.43'; oids.pseudonym = '2.5.4.65'; oids.emailAddress = '1.2.840.113549.1.9.1'; var unoids = {}; Object.keys(oids).forEach(function (k) { unoids[oids[k]] = k; }); function Identity(opts) { var self = this; assert.object(opts, 'options'); assert.arrayOfObject(opts.components, 'options.components'); this.components = opts.components; this.componentLookup = {}; this.components.forEach(function (c) { if (c.name && !c.oid) c.oid = oids[c.name]; if (c.oid && !c.name) c.name = unoids[c.oid]; if (self.componentLookup[c.name] === undefined) self.componentLookup[c.name] = []; self.componentLookup[c.name].push(c); }); if (this.componentLookup.cn && this.componentLookup.cn.length > 0) { this.cn = this.componentLookup.cn[0].value; } assert.optionalString(opts.type, 'options.type'); if (opts.type === undefined) { if (this.components.length === 1 && this.componentLookup.cn && this.componentLookup.cn.length === 1 && this.componentLookup.cn[0].value.match(DNS_NAME_RE)) { this.type = 'host'; this.hostname = this.componentLookup.cn[0].value; } else if (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('.'); } else if (this.componentLookup.uid && this.components.length === this.componentLookup.uid.length) { this.type = 'user'; this.uid = this.componentLookup.uid[0].value; } else if (this.componentLookup.cn && this.componentLookup.cn.length === 1 && this.componentLookup.cn[0].value.match(DNS_NAME_RE)) { this.type = 'host'; this.hostname = this.componentLookup.cn[0].value; } else if (this.componentLookup.uid && this.componentLookup.uid.length === 1) { this.type = 'user'; this.uid = this.componentLookup.uid[0].value; } else if (this.componentLookup.mail && this.componentLookup.mail.length === 1) { this.type = 'email'; this.email = this.componentLookup.mail[0].value; } else if (this.componentLookup.cn && this.componentLookup.cn.length === 1) { this.type = 'user'; this.uid = this.componentLookup.cn[0].value; } else { this.type = 'unknown'; } } else { this.type = opts.type; if (this.type === 'host') this.hostname = opts.hostname; else if (this.type === 'user') this.uid = opts.uid; else if (this.type === 'email') this.email = opts.email; else throw (new Error('Unknown type ' + this.type)); } } Identity.prototype.toString = function () { return (this.components.map(function (c) { var n = c.name.toUpperCase(); /*JSSTYLED*/ n = n.replace(/=/g, '\\='); var v = c.value; /*JSSTYLED*/ v = v.replace(/,/g, '\\,'); return (n + '=' + v); }).join(', ')); }; Identity.prototype.get = function (name, asArray) { assert.string(name, 'name'); var arr = this.componentLookup[name]; if (arr === undefined || arr.length === 0) return (undefined); if (!asArray && arr.length > 1) throw (new Error('Multiple values for attribute ' + name)); if (!asArray) return (arr[0].value); return (arr.map(function (c) { return (c.value); })); }; Identity.prototype.toArray = function (idx) { return (this.components.map(function (c) { return ({ name: c.name, value: c.value }); })); }; /* * These are from X.680 -- PrintableString allowed chars are in section 37.4 * table 8. Spec for IA5Strings is "1,6 + SPACE + DEL" where 1 refers to * ISO IR #001 (standard ASCII control characters) and 6 refers to ISO IR #006 * (the basic ASCII character set). */ /* JSSTYLED */ var NOT_PRINTABLE = /[^a-zA-Z0-9 '(),+.\/:=?-]/; /* JSSTYLED */ var NOT_IA5 = /[^\x00-\x7f]/; Identity.prototype.toAsn1 = function (der, tag) { der.startSequence(tag); this.components.forEach(function (c) { der.startSequence(asn1.Ber.Constructor | asn1.Ber.Set); der.startSequence(); der.writeOID(c.oid); /* * If we fit in a PrintableString, use that. Otherwise use an * IA5String or UTF8String. * * If this identity was parsed from a DN, use the ASN.1 types * from the original representation (otherwise this might not * be a full match for the original in some validators). */ if (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; if (c.asn1type !== undefined) type = c.asn1type; der.writeString(c.value, type); } der.endSequence(); der.endSequence(); }); der.endSequence(); }; function globMatch(a, b) { if (a === '**' || b === '**') return (true); var aParts = a.split('.'); var bParts = b.split('.'); if (aParts.length !== bParts.length) return (false); for (var i = 0; i < aParts.length; ++i) { if (aParts[i] === '*' || bParts[i] === '*') continue; if (aParts[i] !== bParts[i]) return (false); } return (true); } Identity.prototype.equals = function (other) { if (!Identity.isIdentity(other, [1, 0])) return (false); if (other.components.length !== this.components.length) return (false); for (var i = 0; i < this.components.length; ++i) { if (this.components[i].oid !== other.components[i].oid) return (false); if (!globMatch(this.components[i].value, other.components[i].value)) { return (false); } } return (true); }; Identity.forHost = function (hostname) { assert.string(hostname, 'hostname'); return (new Identity({ type: 'host', hostname: hostname, components: [ { name: 'cn', value: hostname } ] })); }; Identity.forUser = function (uid) { assert.string(uid, 'uid'); return (new Identity({ type: 'user', uid: uid, components: [ { name: 'uid', value: uid } ] })); }; Identity.forEmail = function (email) { assert.string(email, 'email'); return (new Identity({ type: 'email', email: email, components: [ { name: 'mail', value: email } ] })); }; Identity.parseDN = function (dn) { assert.string(dn, 'dn'); var parts = ['']; var idx = 0; var rem = dn; while (rem.length > 0) { var m; /*JSSTYLED*/ if ((m = /^,/.exec(rem)) !== null) { parts[++idx] = ''; rem = rem.slice(m[0].length); /*JSSTYLED*/ } else if ((m = /^\\,/.exec(rem)) !== null) { parts[idx] += ','; rem = rem.slice(m[0].length); /*JSSTYLED*/ } else if ((m = /^\\./.exec(rem)) !== null) { parts[idx] += m[0]; rem = rem.slice(m[0].length); /*JSSTYLED*/ } else if ((m = /^[^\\,]+/.exec(rem)) !== null) { parts[idx] += m[0]; rem = rem.slice(m[0].length); } else { throw (new Error('Failed to parse DN')); } } var cmps = parts.map(function (c) { c = c.trim(); var eqPos = c.indexOf('='); while (eqPos > 0 && c.charAt(eqPos - 1) === '\\') eqPos = c.indexOf('=', eqPos + 1); if (eqPos === -1) { throw (new Error('Failed to parse DN')); } /*JSSTYLED*/ var name = c.slice(0, eqPos).toLowerCase().replace(/\\=/g, '='); var value = c.slice(eqPos + 1); return ({ name: name, value: value }); }); return (new Identity({ components: cmps })); }; Identity.fromArray = function (components) { assert.arrayOfObject(components, 'components'); components.forEach(function (cmp) { assert.object(cmp, 'component'); assert.string(cmp.name, 'component.name'); if (!Buffer.isBuffer(cmp.value) && !(typeof (cmp.value) === 'string')) { throw (new Error('Invalid component value')); } }); return (new Identity({ components: components })); }; Identity.parseAsn1 = function (der, top) { var components = []; der.readSequence(top); var end = der.offset + der.length; while (der.offset < end) { der.readSequence(asn1.Ber.Constructor | asn1.Ber.Set); var after = der.offset + der.length; der.readSequence(); var oid = der.readOID(); var type = der.peek(); var value; 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 = der.readString(type, true); value = value.toString('utf8'); break; case asn1.Ber.CharacterString: case asn1.Ber.BMPString: value = der.readString(type, true); value = value.toString('utf16le'); break; default: throw (new Error('Unknown asn1 type ' + type)); } components.push({ oid: oid, asn1type: type, value: value }); der._offset = after; } der._offset = end; return (new Identity({ components: components })); }; Identity.isIdentity = function (obj, ver) { return (utils.isCompatible(obj, Identity, ver)); }; /* * API versions for Identity: * [1,0] -- initial ver */ Identity.prototype._sshpkApiVersion = [1, 0]; Identity._oldVersionDetect = function (obj) { return ([1, 0]); }; /***/ }), /* 146 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2017 Joyent, Inc. module.exports = { read: read, verify: verify, sign: sign, signAsync: signAsync, write: write, /* Internal private API */ fromBuffer: fromBuffer, toBuffer: toBuffer }; var assert = __webpack_require__(108); var SSHBuffer = __webpack_require__(129); var crypto = __webpack_require__(94); var Buffer = __webpack_require__(114).Buffer; var algs = __webpack_require__(113); var Key = __webpack_require__(112); var PrivateKey = __webpack_require__(117); var Identity = __webpack_require__(145); var rfc4253 = __webpack_require__(139); var Signature = __webpack_require__(118); var utils = __webpack_require__(119); var Certificate = __webpack_require__(144); function verify(cert, key) { /* * We always give an issuerKey, so if our verify() is being called then * there was no signature. Return false. */ return (false); } var TYPES = { 'user': 1, 'host': 2 }; Object.keys(TYPES).forEach(function (k) { TYPES[TYPES[k]] = k; }); var ECDSA_ALGO = /^ecdsa-sha2-([^@-]+)-cert-v01@openssh.com$/; function read(buf, options) { if (Buffer.isBuffer(buf)) buf = buf.toString('ascii'); var parts = buf.trim().split(/[ \t\n]+/g); if (parts.length < 2 || parts.length > 3) throw (new Error('Not a valid SSH certificate line')); var algo = parts[0]; var data = parts[1]; data = Buffer.from(data, 'base64'); return (fromBuffer(data, algo)); } function fromBuffer(data, algo, partial) { var sshbuf = new SSHBuffer({ buffer: data }); var innerAlgo = sshbuf.readString(); if (algo !== undefined && innerAlgo !== algo) throw (new Error('SSH certificate algorithm mismatch')); if (algo === undefined) algo = innerAlgo; var cert = {}; cert.signatures = {}; cert.signatures.openssh = {}; cert.signatures.openssh.nonce = sshbuf.readBuffer(); var key = {}; var parts = (key.parts = []); key.type = getAlg(algo); var partCount = algs.info[key.type].parts.length; while (parts.length < partCount) parts.push(sshbuf.readPart()); assert.ok(parts.length >= 1, 'key must have at least one part'); var algInfo = algs.info[key.type]; if (key.type === 'ecdsa') { var res = ECDSA_ALGO.exec(algo); assert.ok(res !== null); assert.strictEqual(res[1], parts[0].data.toString()); } for (var i = 0; i < algInfo.parts.length; ++i) { parts[i].name = algInfo.parts[i]; if (parts[i].name !== 'curve' && algInfo.normalize !== false) { var p = parts[i]; p.data = utils.mpNormalize(p.data); } } cert.subjectKey = new Key(key); cert.serial = sshbuf.readInt64(); var type = TYPES[sshbuf.readInt()]; assert.string(type, 'valid cert type'); cert.signatures.openssh.keyId = sshbuf.readString(); var principals = []; var pbuf = sshbuf.readBuffer(); var psshbuf = new SSHBuffer({ buffer: pbuf }); while (!psshbuf.atEnd()) principals.push(psshbuf.readString()); if (principals.length === 0) principals = ['*']; cert.subjects = principals.map(function (pr) { if (type === 'user') return (Identity.forUser(pr)); else if (type === 'host') return (Identity.forHost(pr)); throw (new Error('Unknown identity type ' + type)); }); cert.validFrom = int64ToDate(sshbuf.readInt64()); cert.validUntil = int64ToDate(sshbuf.readInt64()); var exts = []; var extbuf = new SSHBuffer({ buffer: sshbuf.readBuffer() }); var ext; while (!extbuf.atEnd()) { ext = { critical: true }; ext.name = extbuf.readString(); ext.data = extbuf.readBuffer(); exts.push(ext); } extbuf = new SSHBuffer({ buffer: sshbuf.readBuffer() }); while (!extbuf.atEnd()) { ext = { critical: false }; ext.name = extbuf.readString(); ext.data = extbuf.readBuffer(); exts.push(ext); } cert.signatures.openssh.exts = exts; /* reserved */ sshbuf.readBuffer(); var signingKeyBuf = sshbuf.readBuffer(); cert.issuerKey = rfc4253.read(signingKeyBuf); /* * OpenSSH certs don't give the identity of the issuer, just their * public key. So, we use an Identity that matches anything. The * isSignedBy() function will later tell you if the key matches. */ cert.issuer = Identity.forHost('**'); var sigBuf = sshbuf.readBuffer(); cert.signatures.openssh.signature = Signature.parse(sigBuf, cert.issuerKey.type, 'ssh'); if (partial !== undefined) { partial.remainder = sshbuf.remainder(); partial.consumed = sshbuf._offset; } return (new Certificate(cert)); } function int64ToDate(buf) { var i = buf.readUInt32BE(0) * 4294967296; i += buf.readUInt32BE(4); var d = new Date(); d.setTime(i * 1000); d.sourceInt64 = buf; return (d); } function dateToInt64(date) { if (date.sourceInt64 !== undefined) return (date.sourceInt64); var i = Math.round(date.getTime() / 1000); var upper = Math.floor(i / 4294967296); var lower = Math.floor(i % 4294967296); var buf = Buffer.alloc(8); buf.writeUInt32BE(upper, 0); buf.writeUInt32BE(lower, 4); return (buf); } function sign(cert, key) { if (cert.signatures.openssh === undefined) cert.signatures.openssh = {}; try { var blob = toBuffer(cert, true); } catch (e) { delete (cert.signatures.openssh); return (false); } var sig = cert.signatures.openssh; var hashAlgo = undefined; if (key.type === 'rsa' || key.type === 'dsa') hashAlgo = 'sha1'; var signer = key.createSign(hashAlgo); signer.write(blob); sig.signature = signer.sign(); return (true); } function signAsync(cert, signer, done) { if (cert.signatures.openssh === undefined) cert.signatures.openssh = {}; try { var blob = toBuffer(cert, true); } catch (e) { delete (cert.signatures.openssh); done(e); return; } var sig = cert.signatures.openssh; signer(blob, function (err, signature) { if (err) { done(err); return; } try { /* * This will throw if the signature isn't of a * type/algo that can be used for SSH. */ signature.toBuffer('ssh'); } catch (e) { done(e); return; } sig.signature = signature; done(); }); } function write(cert, options) { if (options === undefined) options = {}; var blob = toBuffer(cert); var out = getCertType(cert.subjectKey) + ' ' + blob.toString('base64'); if (options.comment) out = out + ' ' + options.comment; return (out); } function toBuffer(cert, noSig) { assert.object(cert.signatures.openssh, 'signature for openssh format'); var sig = cert.signatures.openssh; if (sig.nonce === undefined) sig.nonce = crypto.randomBytes(16); var buf = new SSHBuffer({}); buf.writeString(getCertType(cert.subjectKey)); buf.writeBuffer(sig.nonce); var key = cert.subjectKey; var algInfo = algs.info[key.type]; algInfo.parts.forEach(function (part) { buf.writePart(key.part[part]); }); buf.writeInt64(cert.serial); var type = cert.subjects[0].type; assert.notStrictEqual(type, 'unknown'); cert.subjects.forEach(function (id) { assert.strictEqual(id.type, type); }); type = TYPES[type]; buf.writeInt(type); if (sig.keyId === undefined) { sig.keyId = cert.subjects[0].type + '_' + (cert.subjects[0].uid || cert.subjects[0].hostname); } buf.writeString(sig.keyId); var sub = new SSHBuffer({}); cert.subjects.forEach(function (id) { if (type === TYPES.host) sub.writeString(id.hostname); else if (type === TYPES.user) sub.writeString(id.uid); }); buf.writeBuffer(sub.toBuffer()); buf.writeInt64(dateToInt64(cert.validFrom)); buf.writeInt64(dateToInt64(cert.validUntil)); var exts = sig.exts; if (exts === undefined) exts = []; var extbuf = new SSHBuffer({}); exts.forEach(function (ext) { if (ext.critical !== true) return; extbuf.writeString(ext.name); extbuf.writeBuffer(ext.data); }); buf.writeBuffer(extbuf.toBuffer()); extbuf = new SSHBuffer({}); exts.forEach(function (ext) { if (ext.critical === true) return; extbuf.writeString(ext.name); extbuf.writeBuffer(ext.data); }); buf.writeBuffer(extbuf.toBuffer()); /* reserved */ buf.writeBuffer(Buffer.alloc(0)); sub = rfc4253.write(cert.issuerKey); buf.writeBuffer(sub); if (!noSig) buf.writeBuffer(sig.signature.toBuffer('ssh')); return (buf.toBuffer()); } function getAlg(certType) { if (certType === 'ssh-rsa-cert-v01@openssh.com') return ('rsa'); if (certType === 'ssh-dss-cert-v01@openssh.com') return ('dsa'); if (certType.match(ECDSA_ALGO)) return ('ecdsa'); if (certType === 'ssh-ed25519-cert-v01@openssh.com') return ('ed25519'); throw (new Error('Unsupported cert type ' + certType)); } function getCertType(key) { if (key.type === 'rsa') return ('ssh-rsa-cert-v01@openssh.com'); if (key.type === 'dsa') return ('ssh-dss-cert-v01@openssh.com'); if (key.type === 'ecdsa') return ('ecdsa-sha2-' + key.curve + '-cert-v01@openssh.com'); if (key.type === 'ed25519') return ('ssh-ed25519-cert-v01@openssh.com'); throw (new Error('Unsupported key type ' + key.type)); } /***/ }), /* 147 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2017 Joyent, Inc. module.exports = { read: read, verify: verify, sign: sign, signAsync: signAsync, write: write }; var assert = __webpack_require__(108); var asn1 = __webpack_require__(120); var Buffer = __webpack_require__(114).Buffer; var algs = __webpack_require__(113); var utils = __webpack_require__(119); var Key = __webpack_require__(112); var PrivateKey = __webpack_require__(117); var pem = __webpack_require__(135); var Identity = __webpack_require__(145); var Signature = __webpack_require__(118); var Certificate = __webpack_require__(144); var pkcs8 = __webpack_require__(137); /* * This file is based on RFC5280 (X.509). */ /* Helper to read in a single mpint */ function readMPInt(der, nm) { assert.strictEqual(der.peek(), asn1.Ber.Integer, nm + ' is not an Integer'); return (utils.mpNormalize(der.readString(asn1.Ber.Integer, true))); } function verify(cert, key) { var sig = cert.signatures.x509; assert.object(sig, 'x509 signature'); var algParts = sig.algo.split('-'); if (algParts[0] !== key.type) return (false); var blob = sig.cache; if (blob === undefined) { var der = new asn1.BerWriter(); writeTBSCert(cert, der); blob = der.buffer; } var verifier = key.createVerify(algParts[1]); verifier.write(blob); return (verifier.verify(sig.signature)); } function Local(i) { return (asn1.Ber.Context | asn1.Ber.Constructor | i); } function Context(i) { return (asn1.Ber.Context | i); } var SIGN_ALGS = { 'rsa-md5': '1.2.840.113549.1.1.4', 'rsa-sha1': '1.2.840.113549.1.1.5', 'rsa-sha256': '1.2.840.113549.1.1.11', 'rsa-sha384': '1.2.840.113549.1.1.12', 'rsa-sha512': '1.2.840.113549.1.1.13', 'dsa-sha1': '1.2.840.10040.4.3', 'dsa-sha256': '2.16.840.1.101.3.4.3.2', 'ecdsa-sha1': '1.2.840.10045.4.1', 'ecdsa-sha256': '1.2.840.10045.4.3.2', 'ecdsa-sha384': '1.2.840.10045.4.3.3', 'ecdsa-sha512': '1.2.840.10045.4.3.4', 'ed25519-sha512': '1.3.101.112' }; Object.keys(SIGN_ALGS).forEach(function (k) { SIGN_ALGS[SIGN_ALGS[k]] = k; }); SIGN_ALGS['1.3.14.3.2.3'] = 'rsa-md5'; SIGN_ALGS['1.3.14.3.2.29'] = 'rsa-sha1'; var EXTS = { 'issuerKeyId': '2.5.29.35', 'altName': '2.5.29.17', 'basicConstraints': '2.5.29.19', 'keyUsage': '2.5.29.15', 'extKeyUsage': '2.5.29.37' }; function read(buf, options) { if (typeof (buf) === 'string') { buf = Buffer.from(buf, 'binary'); } assert.buffer(buf, 'buf'); var der = new asn1.BerReader(buf); der.readSequence(); if (Math.abs(der.length - der.remain) > 1) { throw (new Error('DER sequence does not contain whole byte ' + 'stream')); } var tbsStart = der.offset; der.readSequence(); var sigOffset = der.offset + der.length; var tbsEnd = sigOffset; if (der.peek() === Local(0)) { der.readSequence(Local(0)); var version = der.readInt(); assert.ok(version <= 3, 'only x.509 versions up to v3 supported'); } var cert = {}; cert.signatures = {}; var sig = (cert.signatures.x509 = {}); sig.extras = {}; cert.serial = readMPInt(der, 'serial'); der.readSequence(); var after = der.offset + der.length; var certAlgOid = der.readOID(); var certAlg = SIGN_ALGS[certAlgOid]; if (certAlg === undefined) throw (new Error('unknown signature algorithm ' + certAlgOid)); der._offset = after; cert.issuer = Identity.parseAsn1(der); der.readSequence(); cert.validFrom = readDate(der); cert.validUntil = readDate(der); cert.subjects = [Identity.parseAsn1(der)]; der.readSequence(); after = der.offset + der.length; cert.subjectKey = pkcs8.readPkcs8(undefined, 'public', der); der._offset = after; /* issuerUniqueID */ if (der.peek() === Local(1)) { der.readSequence(Local(1)); sig.extras.issuerUniqueID = buf.slice(der.offset, der.offset + der.length); der._offset += der.length; } /* subjectUniqueID */ if (der.peek() === Local(2)) { der.readSequence(Local(2)); sig.extras.subjectUniqueID = buf.slice(der.offset, der.offset + der.length); der._offset += der.length; } /* extensions */ if (der.peek() === Local(3)) { der.readSequence(Local(3)); var extEnd = der.offset + der.length; der.readSequence(); while (der.offset < extEnd) readExtension(cert, buf, der); assert.strictEqual(der.offset, extEnd); } assert.strictEqual(der.offset, sigOffset); der.readSequence(); after = der.offset + der.length; var sigAlgOid = der.readOID(); var sigAlg = SIGN_ALGS[sigAlgOid]; if (sigAlg === undefined) throw (new Error('unknown signature algorithm ' + sigAlgOid)); der._offset = after; var sigData = der.readString(asn1.Ber.BitString, true); if (sigData[0] === 0) sigData = sigData.slice(1); var algParts = sigAlg.split('-'); sig.signature = Signature.parse(sigData, algParts[0], 'asn1'); sig.signature.hashAlgorithm = algParts[1]; sig.algo = sigAlg; sig.cache = buf.slice(tbsStart, tbsEnd); return (new Certificate(cert)); } function readDate(der) { if (der.peek() === asn1.Ber.UTCTime) { return (utcTimeToDate(der.readString(asn1.Ber.UTCTime))); } else if (der.peek() === asn1.Ber.GeneralizedTime) { return (gTimeToDate(der.readString(asn1.Ber.GeneralizedTime))); } else { throw (new Error('Unsupported date format')); } } function writeDate(der, date) { if (date.getUTCFullYear() >= 2050 || date.getUTCFullYear() < 1950) { der.writeString(dateToGTime(date), asn1.Ber.GeneralizedTime); } else { der.writeString(dateToUTCTime(date), asn1.Ber.UTCTime); } } /* RFC5280, section 4.2.1.6 (GeneralName type) */ var ALTNAME = { OtherName: Local(0), RFC822Name: Context(1), DNSName: Context(2), X400Address: Local(3), DirectoryName: Local(4), EDIPartyName: Local(5), URI: Context(6), IPAddress: Context(7), OID: Context(8) }; /* RFC5280, section 4.2.1.12 (KeyPurposeId) */ var EXTPURPOSE = { 'serverAuth': '1.3.6.1.5.5.7.3.1', 'clientAuth': '1.3.6.1.5.5.7.3.2', 'codeSigning': '1.3.6.1.5.5.7.3.3', /* See https://github.com/joyent/oid-docs/blob/master/root.md */ 'joyentDocker': '1.3.6.1.4.1.38678.1.4.1', 'joyentCmon': '1.3.6.1.4.1.38678.1.4.2' }; var EXTPURPOSE_REV = {}; Object.keys(EXTPURPOSE).forEach(function (k) { EXTPURPOSE_REV[EXTPURPOSE[k]] = k; }); var KEYUSEBITS = [ 'signature', 'identity', 'keyEncryption', 'encryption', 'keyAgreement', 'ca', 'crl' ]; function readExtension(cert, buf, der) { der.readSequence(); var after = der.offset + der.length; var extId = der.readOID(); var id; var sig = cert.signatures.x509; if (!sig.extras.exts) sig.extras.exts = []; var critical; if (der.peek() === asn1.Ber.Boolean) critical = der.readBoolean(); switch (extId) { case (EXTS.basicConstraints): der.readSequence(asn1.Ber.OctetString); der.readSequence(); var bcEnd = der.offset + der.length; var ca = false; if (der.peek() === asn1.Ber.Boolean) ca = der.readBoolean(); if (cert.purposes === undefined) cert.purposes = []; if (ca === true) cert.purposes.push('ca'); var bc = { oid: extId, critical: critical }; if (der.offset < bcEnd && der.peek() === asn1.Ber.Integer) bc.pathLen = der.readInt(); sig.extras.exts.push(bc); break; case (EXTS.extKeyUsage): der.readSequence(asn1.Ber.OctetString); der.readSequence(); if (cert.purposes === undefined) cert.purposes = []; var ekEnd = der.offset + der.length; while (der.offset < ekEnd) { var oid = der.readOID(); cert.purposes.push(EXTPURPOSE_REV[oid] || oid); } /* * This is a bit of a hack: in the case where we have a cert * that's only allowed to do serverAuth or clientAuth (and not * the other), we want to make sure all our Subjects are of * the right type. But we already parsed our Subjects and * decided if they were hosts or users earlier (since it appears * first in the cert). * * So we go through and mutate them into the right kind here if * it doesn't match. This might not be hugely beneficial, as it * seems that single-purpose certs are not often seen in the * wild. */ if (cert.purposes.indexOf('serverAuth') !== -1 && cert.purposes.indexOf('clientAuth') === -1) { cert.subjects.forEach(function (ide) { if (ide.type !== 'host') { ide.type = 'host'; ide.hostname = ide.uid || ide.email || ide.components[0].value; } }); } else if (cert.purposes.indexOf('clientAuth') !== -1 && cert.purposes.indexOf('serverAuth') === -1) { cert.subjects.forEach(function (ide) { if (ide.type !== 'user') { ide.type = 'user'; ide.uid = ide.hostname || ide.email || ide.components[0].value; } }); } sig.extras.exts.push({ oid: extId, critical: critical }); break; case (EXTS.keyUsage): der.readSequence(asn1.Ber.OctetString); var bits = der.readString(asn1.Ber.BitString, true); var setBits = readBitField(bits, KEYUSEBITS); setBits.forEach(function (bit) { if (cert.purposes === undefined) cert.purposes = []; if (cert.purposes.indexOf(bit) === -1) cert.purposes.push(bit); }); sig.extras.exts.push({ oid: extId, critical: critical, bits: bits }); break; case (EXTS.altName): der.readSequence(asn1.Ber.OctetString); der.readSequence(); var aeEnd = der.offset + der.length; while (der.offset < aeEnd) { switch (der.peek()) { case ALTNAME.OtherName: case ALTNAME.EDIPartyName: der.readSequence(); der._offset += der.length; break; case ALTNAME.OID: der.readOID(ALTNAME.OID); break; case ALTNAME.RFC822Name: /* RFC822 specifies email addresses */ var email = der.readString(ALTNAME.RFC822Name); id = Identity.forEmail(email); if (!cert.subjects[0].equals(id)) cert.subjects.push(id); break; case ALTNAME.DirectoryName: der.readSequence(ALTNAME.DirectoryName); id = Identity.parseAsn1(der); if (!cert.subjects[0].equals(id)) cert.subjects.push(id); break; case ALTNAME.DNSName: var host = der.readString( ALTNAME.DNSName); id = Identity.forHost(host); if (!cert.subjects[0].equals(id)) cert.subjects.push(id); break; default: der.readString(der.peek()); break; } } sig.extras.exts.push({ oid: extId, critical: critical }); break; default: sig.extras.exts.push({ oid: extId, critical: critical, data: der.readString(asn1.Ber.OctetString, true) }); break; } der._offset = after; } var UTCTIME_RE = /^([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/; function utcTimeToDate(t) { var m = t.match(UTCTIME_RE); assert.ok(m, 'timestamps must be in UTC'); var d = new Date(); var thisYear = d.getUTCFullYear(); var century = Math.floor(thisYear / 100) * 100; var year = parseInt(m[1], 10); if (thisYear % 100 < 50 && year >= 60) year += (century - 1); else year += century; d.setUTCFullYear(year, parseInt(m[2], 10) - 1, parseInt(m[3], 10)); d.setUTCHours(parseInt(m[4], 10), parseInt(m[5], 10)); if (m[6] && m[6].length > 0) d.setUTCSeconds(parseInt(m[6], 10)); return (d); } var GTIME_RE = /^([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/; function gTimeToDate(t) { var m = t.match(GTIME_RE); assert.ok(m); var d = new Date(); d.setUTCFullYear(parseInt(m[1], 10), parseInt(m[2], 10) - 1, parseInt(m[3], 10)); d.setUTCHours(parseInt(m[4], 10), parseInt(m[5], 10)); if (m[6] && m[6].length > 0) d.setUTCSeconds(parseInt(m[6], 10)); return (d); } function zeroPad(n, m) { if (m === undefined) m = 2; var s = '' + n; while (s.length < m) s = '0' + s; return (s); } function dateToUTCTime(d) { var s = ''; s += zeroPad(d.getUTCFullYear() % 100); s += zeroPad(d.getUTCMonth() + 1); s += zeroPad(d.getUTCDate()); s += zeroPad(d.getUTCHours()); s += zeroPad(d.getUTCMinutes()); s += zeroPad(d.getUTCSeconds()); s += 'Z'; return (s); } function dateToGTime(d) { var s = ''; s += zeroPad(d.getUTCFullYear(), 4); s += zeroPad(d.getUTCMonth() + 1); s += zeroPad(d.getUTCDate()); s += zeroPad(d.getUTCHours()); s += zeroPad(d.getUTCMinutes()); s += zeroPad(d.getUTCSeconds()); s += 'Z'; return (s); } function sign(cert, key) { if (cert.signatures.x509 === undefined) cert.signatures.x509 = {}; var sig = cert.signatures.x509; sig.algo = key.type + '-' + key.defaultHashAlgorithm(); if (SIGN_ALGS[sig.algo] === undefined) return (false); var der = new asn1.BerWriter(); writeTBSCert(cert, der); var blob = der.buffer; sig.cache = blob; var signer = key.createSign(); signer.write(blob); cert.signatures.x509.signature = signer.sign(); return (true); } function signAsync(cert, signer, done) { if (cert.signatures.x509 === undefined) cert.signatures.x509 = {}; var sig = cert.signatures.x509; var der = new asn1.BerWriter(); writeTBSCert(cert, der); var blob = der.buffer; sig.cache = blob; signer(blob, function (err, signature) { if (err) { done(err); return; } sig.algo = signature.type + '-' + signature.hashAlgorithm; if (SIGN_ALGS[sig.algo] === undefined) { done(new Error('Invalid signing algorithm "' + sig.algo + '"')); return; } sig.signature = signature; done(); }); } function write(cert, options) { var sig = cert.signatures.x509; assert.object(sig, 'x509 signature'); var der = new asn1.BerWriter(); der.startSequence(); if (sig.cache) { der._ensure(sig.cache.length); sig.cache.copy(der._buf, der._offset); der._offset += sig.cache.length; } else { writeTBSCert(cert, der); } der.startSequence(); der.writeOID(SIGN_ALGS[sig.algo]); if (sig.algo.match(/^rsa-/)) der.writeNull(); der.endSequence(); var sigData = sig.signature.toBuffer('asn1'); var data = Buffer.alloc(sigData.length + 1); data[0] = 0; sigData.copy(data, 1); der.writeBuffer(data, asn1.Ber.BitString); der.endSequence(); return (der.buffer); } function writeTBSCert(cert, der) { var sig = cert.signatures.x509; assert.object(sig, 'x509 signature'); der.startSequence(); der.startSequence(Local(0)); der.writeInt(2); der.endSequence(); der.writeBuffer(utils.mpNormalize(cert.serial), asn1.Ber.Integer); der.startSequence(); der.writeOID(SIGN_ALGS[sig.algo]); if (sig.algo.match(/^rsa-/)) der.writeNull(); der.endSequence(); cert.issuer.toAsn1(der); der.startSequence(); writeDate(der, cert.validFrom); writeDate(der, cert.validUntil); der.endSequence(); var subject = cert.subjects[0]; var altNames = cert.subjects.slice(1); subject.toAsn1(der); pkcs8.writePkcs8(der, cert.subjectKey); if (sig.extras && sig.extras.issuerUniqueID) { der.writeBuffer(sig.extras.issuerUniqueID, Local(1)); } if (sig.extras && sig.extras.subjectUniqueID) { der.writeBuffer(sig.extras.subjectUniqueID, Local(2)); } if (altNames.length > 0 || subject.type === 'host' || (cert.purposes !== undefined && cert.purposes.length > 0) || (sig.extras && sig.extras.exts)) { der.startSequence(Local(3)); der.startSequence(); var exts = []; if (cert.purposes !== undefined && cert.purposes.length > 0) { exts.push({ oid: EXTS.basicConstraints, critical: true }); exts.push({ oid: EXTS.keyUsage, critical: true }); exts.push({ oid: EXTS.extKeyUsage, critical: true }); } exts.push({ oid: EXTS.altName }); if (sig.extras && sig.extras.exts) exts = sig.extras.exts; for (var i = 0; i < exts.length; ++i) { der.startSequence(); der.writeOID(exts[i].oid); if (exts[i].critical !== undefined) der.writeBoolean(exts[i].critical); if (exts[i].oid === EXTS.altName) { der.startSequence(asn1.Ber.OctetString); der.startSequence(); if (subject.type === 'host') { der.writeString(subject.hostname, Context(2)); } for (var j = 0; j < altNames.length; ++j) { if (altNames[j].type === 'host') { der.writeString( altNames[j].hostname, ALTNAME.DNSName); } else if (altNames[j].type === 'email') { der.writeString( altNames[j].email, ALTNAME.RFC822Name); } else { /* * Encode anything else as a * DN style name for now. */ der.startSequence( ALTNAME.DirectoryName); altNames[j].toAsn1(der); der.endSequence(); } } der.endSequence(); der.endSequence(); } else if (exts[i].oid === EXTS.basicConstraints) { der.startSequence(asn1.Ber.OctetString); der.startSequence(); var ca = (cert.purposes.indexOf('ca') !== -1); var pathLen = exts[i].pathLen; der.writeBoolean(ca); if (pathLen !== undefined) der.writeInt(pathLen); der.endSequence(); der.endSequence(); } else if (exts[i].oid === EXTS.extKeyUsage) { der.startSequence(asn1.Ber.OctetString); der.startSequence(); cert.purposes.forEach(function (purpose) { if (purpose === 'ca') return; if (KEYUSEBITS.indexOf(purpose) !== -1) return; var oid = purpose; if (EXTPURPOSE[purpose] !== undefined) oid = EXTPURPOSE[purpose]; der.writeOID(oid); }); der.endSequence(); der.endSequence(); } else if (exts[i].oid === EXTS.keyUsage) { der.startSequence(asn1.Ber.OctetString); /* * If we parsed this certificate from a byte * stream (i.e. we didn't generate it in sshpk) * then we'll have a ".bits" property on the * ext with the original raw byte contents. * * If we have this, use it here instead of * regenerating it. This guarantees we output * the same data we parsed, so signatures still * validate. */ if (exts[i].bits !== undefined) { der.writeBuffer(exts[i].bits, asn1.Ber.BitString); } else { var bits = writeBitField(cert.purposes, KEYUSEBITS); der.writeBuffer(bits, asn1.Ber.BitString); } der.endSequence(); } else { der.writeBuffer(exts[i].data, asn1.Ber.OctetString); } der.endSequence(); } der.endSequence(); der.endSequence(); } der.endSequence(); } /* * Reads an ASN.1 BER bitfield out of the Buffer produced by doing * `BerReader#readString(asn1.Ber.BitString)`. That function gives us the raw * contents of the BitString tag, which is a count of unused bits followed by * the bits as a right-padded byte string. * * `bits` is the Buffer, `bitIndex` should contain an array of string names * for the bits in the string, ordered starting with bit #0 in the ASN.1 spec. * * Returns an array of Strings, the names of the bits that were set to 1. */ function readBitField(bits, bitIndex) { var bitLen = 8 * (bits.length - 1) - bits[0]; var setBits = {}; for (var i = 0; i < bitLen; ++i) { var byteN = 1 + Math.floor(i / 8); var bit = 7 - (i % 8); var mask = 1 << bit; var bitVal = ((bits[byteN] & mask) !== 0); var name = bitIndex[i]; if (bitVal && typeof (name) === 'string') { setBits[name] = true; } } return (Object.keys(setBits)); } /* * `setBits` is an array of strings, containing the names for each bit that * sould be set to 1. `bitIndex` is same as in `readBitField()`. * * Returns a Buffer, ready to be written out with `BerWriter#writeString()`. */ function writeBitField(setBits, bitIndex) { var bitLen = bitIndex.length; var blen = Math.ceil(bitLen / 8); var unused = blen * 8 - bitLen; var bits = Buffer.alloc(1 + blen); // zero-filled bits[0] = unused; for (var i = 0; i < bitLen; ++i) { var byteN = 1 + Math.floor(i / 8); var bit = 7 - (i % 8); var mask = 1 << bit; var name = bitIndex[i]; if (name === undefined) continue; var bitVal = (setBits.indexOf(name) !== -1); if (bitVal) { bits[byteN] |= mask; } } return (bits); } /***/ }), /* 148 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2016 Joyent, Inc. var x509 = __webpack_require__(147); module.exports = { read: read, verify: x509.verify, sign: x509.sign, write: write }; var assert = __webpack_require__(108); var asn1 = __webpack_require__(120); var Buffer = __webpack_require__(114).Buffer; var algs = __webpack_require__(113); var utils = __webpack_require__(119); var Key = __webpack_require__(112); var PrivateKey = __webpack_require__(117); var pem = __webpack_require__(135); var Identity = __webpack_require__(145); var Signature = __webpack_require__(118); var Certificate = __webpack_require__(144); function read(buf, options) { if (typeof (buf) !== 'string') { assert.buffer(buf, 'buf'); buf = buf.toString('ascii'); } var lines = buf.trim().split(/[\r\n]+/g); var m; var si = -1; while (!m && si < lines.length) { m = lines[++si].match(/*JSSTYLED*/ /[-]+[ ]*BEGIN CERTIFICATE[ ]*[-]+/); } assert.ok(m, 'invalid PEM header'); var m2; var ei = lines.length; while (!m2 && ei > 0) { m2 = lines[--ei].match(/*JSSTYLED*/ /[-]+[ ]*END CERTIFICATE[ ]*[-]+/); } assert.ok(m2, 'invalid PEM footer'); lines = lines.slice(si, ei + 1); var headers = {}; while (true) { lines = lines.slice(1); m = lines[0].match(/*JSSTYLED*/ /^([A-Za-z0-9-]+): (.+)$/); if (!m) break; headers[m[1].toLowerCase()] = m[2]; } /* Chop off the first and last lines */ lines = lines.slice(0, -1).join(''); buf = Buffer.from(lines, 'base64'); return (x509.read(buf, options)); } function write(cert, options) { var dbuf = x509.write(cert, options); var header = 'CERTIFICATE'; var tmp = dbuf.toString('base64'); var len = tmp.length + (tmp.length / 64) + 18 + 16 + header.length*2 + 10; var buf = Buffer.alloc(len); var o = 0; o += buf.write('-----BEGIN ' + header + '-----\n', o); for (var i = 0; i < tmp.length; ) { var limit = i + 64; if (limit > tmp.length) limit = tmp.length; o += buf.write(tmp.slice(i, limit), o); buf[o++] = 10; i = limit; } o += buf.write('-----END ' + header + '-----\n', o); return (buf.slice(0, o)); } /***/ }), /* 149 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2012 Joyent, Inc. All rights reserved. var assert = __webpack_require__(108); var crypto = __webpack_require__(94); var http = __webpack_require__(98); var util = __webpack_require__(9); var sshpk = __webpack_require__(111); var jsprim = __webpack_require__(150); var utils = __webpack_require__(110); var sprintf = __webpack_require__(9).format; var HASH_ALGOS = utils.HASH_ALGOS; var PK_ALGOS = utils.PK_ALGOS; var InvalidAlgorithmError = utils.InvalidAlgorithmError; var HttpSignatureError = utils.HttpSignatureError; var validateAlgorithm = utils.validateAlgorithm; ///--- Globals var AUTHZ_FMT = 'Signature keyId="%s",algorithm="%s",headers="%s",signature="%s"'; ///--- Specific Errors function MissingHeaderError(message) { HttpSignatureError.call(this, message, MissingHeaderError); } util.inherits(MissingHeaderError, HttpSignatureError); function StrictParsingError(message) { HttpSignatureError.call(this, message, StrictParsingError); } util.inherits(StrictParsingError, HttpSignatureError); /* See createSigner() */ function RequestSigner(options) { assert.object(options, 'options'); var alg = []; if (options.algorithm !== undefined) { assert.string(options.algorithm, 'options.algorithm'); alg = validateAlgorithm(options.algorithm); } this.rs_alg = alg; /* * RequestSigners come in two varieties: ones with an rs_signFunc, and ones * with an rs_signer. * * rs_signFunc-based RequestSigners have to build up their entire signing * string within the rs_lines array and give it to rs_signFunc as a single * concat'd blob. rs_signer-based RequestSigners can add a line at a time to * their signing state by using rs_signer.update(), thus only needing to * buffer the hash function state and one line at a time. */ if (options.sign !== undefined) { assert.func(options.sign, 'options.sign'); this.rs_signFunc = options.sign; } else if (alg[0] === 'hmac' && options.key !== undefined) { assert.string(options.keyId, 'options.keyId'); this.rs_keyId = options.keyId; if (typeof (options.key) !== 'string' && !Buffer.isBuffer(options.key)) throw (new TypeError('options.key for HMAC must be a string or Buffer')); /* * Make an rs_signer for HMACs, not a rs_signFunc -- HMACs digest their * data in chunks rather than requiring it all to be given in one go * at the end, so they are more similar to signers than signFuncs. */ this.rs_signer = crypto.createHmac(alg[1].toUpperCase(), options.key); this.rs_signer.sign = function () { var digest = this.digest('base64'); return ({ hashAlgorithm: alg[1], toString: function () { return (digest); } }); }; } else if (options.key !== undefined) { var key = options.key; if (typeof (key) === 'string' || Buffer.isBuffer(key)) key = sshpk.parsePrivateKey(key); assert.ok(sshpk.PrivateKey.isPrivateKey(key, [1, 2]), 'options.key must be a sshpk.PrivateKey'); this.rs_key = key; assert.string(options.keyId, 'options.keyId'); this.rs_keyId = options.keyId; if (!PK_ALGOS[key.type]) { throw (new InvalidAlgorithmError(key.type.toUpperCase() + ' type ' + 'keys are not supported')); } if (alg[0] !== undefined && key.type !== alg[0]) { throw (new InvalidAlgorithmError('options.key must be a ' + alg[0].toUpperCase() + ' key, was given a ' + key.type.toUpperCase() + ' key instead')); } this.rs_signer = key.createSign(alg[1]); } else { throw (new TypeError('options.sign (func) or options.key is required')); } this.rs_headers = []; this.rs_lines = []; } /** * Adds a header to be signed, with its value, into this signer. * * @param {String} header * @param {String} value * @return {String} value written */ RequestSigner.prototype.writeHeader = function (header, value) { assert.string(header, 'header'); header = header.toLowerCase(); assert.string(value, 'value'); this.rs_headers.push(header); if (this.rs_signFunc) { this.rs_lines.push(header + ': ' + value); } else { var line = header + ': ' + value; if (this.rs_headers.length > 0) line = '\n' + line; this.rs_signer.update(line); } return (value); }; /** * Adds a default Date header, returning its value. * * @return {String} */ RequestSigner.prototype.writeDateHeader = function () { return (this.writeHeader('date', jsprim.rfc1123(new Date()))); }; /** * Adds the request target line to be signed. * * @param {String} method, HTTP method (e.g. 'get', 'post', 'put') * @param {String} path */ RequestSigner.prototype.writeTarget = function (method, path) { assert.string(method, 'method'); assert.string(path, 'path'); method = method.toLowerCase(); this.writeHeader('(request-target)', method + ' ' + path); }; /** * Calculate the value for the Authorization header on this request * asynchronously. * * @param {Func} callback (err, authz) */ RequestSigner.prototype.sign = function (cb) { assert.func(cb, 'callback'); if (this.rs_headers.length < 1) throw (new Error('At least one header must be signed')); var alg, authz; if (this.rs_signFunc) { var data = this.rs_lines.join('\n'); var self = this; this.rs_signFunc(data, function (err, sig) { if (err) { cb(err); return; } try { assert.object(sig, 'signature'); assert.string(sig.keyId, 'signature.keyId'); assert.string(sig.algorithm, 'signature.algorithm'); assert.string(sig.signature, 'signature.signature'); alg = validateAlgorithm(sig.algorithm); authz = sprintf(AUTHZ_FMT, sig.keyId, sig.algorithm, self.rs_headers.join(' '), sig.signature); } catch (e) { cb(e); return; } cb(null, authz); }); } else { try { var sigObj = this.rs_signer.sign(); } catch (e) { cb(e); return; } alg = (this.rs_alg[0] || this.rs_key.type) + '-' + sigObj.hashAlgorithm; var signature = sigObj.toString(); authz = sprintf(AUTHZ_FMT, this.rs_keyId, alg, this.rs_headers.join(' '), signature); cb(null, authz); } }; ///--- Exported API module.exports = { /** * Identifies whether a given object is a request signer or not. * * @param {Object} object, the object to identify * @returns {Boolean} */ isSigner: function (obj) { if (typeof (obj) === 'object' && obj instanceof RequestSigner) return (true); return (false); }, /** * Creates a request signer, used to asynchronously build a signature * for a request (does not have to be an http.ClientRequest). * * @param {Object} options, either: * - {String} keyId * - {String|Buffer} key * - {String} algorithm (optional, required for HMAC) * or: * - {Func} sign (data, cb) * @return {RequestSigner} */ createSigner: function createSigner(options) { return (new RequestSigner(options)); }, /** * Adds an 'Authorization' header to an http.ClientRequest object. * * Note that this API will add a Date header if it's not already set. Any * other headers in the options.headers array MUST be present, or this * will throw. * * You shouldn't need to check the return type; it's just there if you want * to be pedantic. * * The optional flag indicates whether parsing should use strict enforcement * of the version draft-cavage-http-signatures-04 of the spec or beyond. * The default is to be loose and support * older versions for compatibility. * * @param {Object} request an instance of http.ClientRequest. * @param {Object} options signing parameters object: * - {String} keyId required. * - {String} key required (either a PEM or HMAC key). * - {Array} headers optional; defaults to ['date']. * - {String} algorithm optional (unless key is HMAC); * default is the same as the sshpk default * signing algorithm for the type of key given * - {String} httpVersion optional; defaults to '1.1'. * - {Boolean} strict optional; defaults to 'false'. * @return {Boolean} true if Authorization (and optionally Date) were added. * @throws {TypeError} on bad parameter types (input). * @throws {InvalidAlgorithmError} if algorithm was bad or incompatible with * the given key. * @throws {sshpk.KeyParseError} if key was bad. * @throws {MissingHeaderError} if a header to be signed was specified but * was not present. */ signRequest: function signRequest(request, options) { assert.object(request, 'request'); assert.object(options, 'options'); assert.optionalString(options.algorithm, 'options.algorithm'); assert.string(options.keyId, 'options.keyId'); assert.optionalArrayOfString(options.headers, 'options.headers'); assert.optionalString(options.httpVersion, 'options.httpVersion'); if (!request.getHeader('Date')) request.setHeader('Date', jsprim.rfc1123(new Date())); if (!options.headers) options.headers = ['date']; if (!options.httpVersion) options.httpVersion = '1.1'; var alg = []; if (options.algorithm) { options.algorithm = options.algorithm.toLowerCase(); alg = validateAlgorithm(options.algorithm); } var i; var stringToSign = ''; for (i = 0; i < options.headers.length; i++) { if (typeof (options.headers[i]) !== 'string') throw new TypeError('options.headers must be an array of Strings'); var h = options.headers[i].toLowerCase(); if (h === 'request-line') { if (!options.strict) { /** * We allow headers from the older spec drafts if strict parsing isn't * specified in options. */ stringToSign += request.method + ' ' + request.path + ' HTTP/' + options.httpVersion; } else { /* Strict parsing doesn't allow older draft headers. */ throw (new StrictParsingError('request-line is not a valid header ' + 'with strict parsing enabled.')); } } else if (h === '(request-target)') { stringToSign += '(request-target): ' + request.method.toLowerCase() + ' ' + request.path; } else { var value = request.getHeader(h); if (value === undefined || value === '') { throw new MissingHeaderError(h + ' was not in the request'); } stringToSign += h + ': ' + value; } if ((i + 1) < options.headers.length) stringToSign += '\n'; } /* This is just for unit tests. */ if (request.hasOwnProperty('_stringToSign')) { request._stringToSign = stringToSign; } var signature; if (alg[0] === 'hmac') { if (typeof (options.key) !== 'string' && !Buffer.isBuffer(options.key)) throw (new TypeError('options.key must be a string or Buffer')); var hmac = crypto.createHmac(alg[1].toUpperCase(), options.key); hmac.update(stringToSign); signature = hmac.digest('base64'); } else { var key = options.key; if (typeof (key) === 'string' || Buffer.isBuffer(key)) key = sshpk.parsePrivateKey(options.key); assert.ok(sshpk.PrivateKey.isPrivateKey(key, [1, 2]), 'options.key must be a sshpk.PrivateKey'); if (!PK_ALGOS[key.type]) { throw (new InvalidAlgorithmError(key.type.toUpperCase() + ' type ' + 'keys are not supported')); } if (alg[0] !== undefined && key.type !== alg[0]) { throw (new InvalidAlgorithmError('options.key must be a ' + alg[0].toUpperCase() + ' key, was given a ' + key.type.toUpperCase() + ' key instead')); } var signer = key.createSign(alg[1]); signer.update(stringToSign); var sigObj = signer.sign(); if (!HASH_ALGOS[sigObj.hashAlgorithm]) { throw (new InvalidAlgorithmError(sigObj.hashAlgorithm.toUpperCase() + ' is not a supported hash algorithm')); } options.algorithm = key.type + '-' + sigObj.hashAlgorithm; signature = sigObj.toString(); assert.notStrictEqual(signature, '', 'empty signature produced'); } var authzHeaderName = options.authorizationHeaderName || 'Authorization'; request.setHeader(authzHeaderName, sprintf(AUTHZ_FMT, options.keyId, options.algorithm, options.headers.join(' '), signature)); return true; } }; /***/ }), /* 150 */ /***/ (function(module, exports, __webpack_require__) { /* * lib/jsprim.js: utilities for primitive JavaScript types */ var mod_assert = __webpack_require__(108); var mod_util = __webpack_require__(9); var mod_extsprintf = __webpack_require__(151); var mod_verror = __webpack_require__(152); var mod_jsonschema = __webpack_require__(155); /* * Public interface */ exports.deepCopy = deepCopy; exports.deepEqual = deepEqual; exports.isEmpty = isEmpty; exports.hasKey = hasKey; exports.forEachKey = forEachKey; exports.pluck = pluck; exports.flattenObject = flattenObject; exports.flattenIter = flattenIter; exports.validateJsonObject = validateJsonObjectJS; exports.validateJsonObjectJS = validateJsonObjectJS; exports.randElt = randElt; exports.extraProperties = extraProperties; exports.mergeObjects = mergeObjects; exports.startsWith = startsWith; exports.endsWith = endsWith; exports.parseInteger = parseInteger; exports.iso8601 = iso8601; exports.rfc1123 = rfc1123; exports.parseDateTime = parseDateTime; exports.hrtimediff = hrtimeDiff; exports.hrtimeDiff = hrtimeDiff; exports.hrtimeAccum = hrtimeAccum; exports.hrtimeAdd = hrtimeAdd; exports.hrtimeNanosec = hrtimeNanosec; exports.hrtimeMicrosec = hrtimeMicrosec; exports.hrtimeMillisec = hrtimeMillisec; /* * Deep copy an acyclic *basic* Javascript object. This only handles basic * scalars (strings, numbers, booleans) and arbitrarily deep arrays and objects * containing these. This does *not* handle instances of other classes. */ function deepCopy(obj) { var ret, key; var marker = '__deepCopy'; if (obj && obj[marker]) throw (new Error('attempted deep copy of cyclic object')); if (obj && obj.constructor == Object) { ret = {}; obj[marker] = true; for (key in obj) { if (key == marker) continue; ret[key] = deepCopy(obj[key]); } delete (obj[marker]); return (ret); } if (obj && obj.constructor == Array) { ret = []; obj[marker] = true; for (key = 0; key < obj.length; key++) ret.push(deepCopy(obj[key])); delete (obj[marker]); return (ret); } /* * It must be a primitive type -- just return it. */ return (obj); } function deepEqual(obj1, obj2) { if (typeof (obj1) != typeof (obj2)) return (false); if (obj1 === null || obj2 === null || typeof (obj1) != 'object') return (obj1 === obj2); if (obj1.constructor != obj2.constructor) return (false); var k; for (k in obj1) { if (!obj2.hasOwnProperty(k)) return (false); if (!deepEqual(obj1[k], obj2[k])) return (false); } for (k in obj2) { if (!obj1.hasOwnProperty(k)) return (false); } return (true); } function isEmpty(obj) { var key; for (key in obj) return (false); return (true); } function hasKey(obj, key) { mod_assert.equal(typeof (key), 'string'); return (Object.prototype.hasOwnProperty.call(obj, key)); } function forEachKey(obj, callback) { for (var key in obj) { if (hasKey(obj, key)) { callback(key, obj[key]); } } } function pluck(obj, key) { mod_assert.equal(typeof (key), 'string'); return (pluckv(obj, key)); } function pluckv(obj, key) { if (obj === null || typeof (obj) !== 'object') return (undefined); if (obj.hasOwnProperty(key)) return (obj[key]); var i = key.indexOf('.'); if (i == -1) return (undefined); var key1 = key.substr(0, i); if (!obj.hasOwnProperty(key1)) return (undefined); return (pluckv(obj[key1], key.substr(i + 1))); } /* * Invoke callback(row) for each entry in the array that would be returned by * flattenObject(data, depth). This is just like flattenObject(data, * depth).forEach(callback), except that the intermediate array is never * created. */ function flattenIter(data, depth, callback) { doFlattenIter(data, depth, [], callback); } function doFlattenIter(data, depth, accum, callback) { var each; var key; if (depth === 0) { each = accum.slice(0); each.push(data); callback(each); return; } mod_assert.ok(data !== null); mod_assert.equal(typeof (data), 'object'); mod_assert.equal(typeof (depth), 'number'); mod_assert.ok(depth >= 0); for (key in data) { each = accum.slice(0); each.push(key); doFlattenIter(data[key], depth - 1, each, callback); } } function flattenObject(data, depth) { if (depth === 0) return ([ data ]); mod_assert.ok(data !== null); mod_assert.equal(typeof (data), 'object'); mod_assert.equal(typeof (depth), 'number'); mod_assert.ok(depth >= 0); var rv = []; var key; for (key in data) { flattenObject(data[key], depth - 1).forEach(function (p) { rv.push([ key ].concat(p)); }); } return (rv); } function startsWith(str, prefix) { return (str.substr(0, prefix.length) == prefix); } function endsWith(str, suffix) { return (str.substr( str.length - suffix.length, suffix.length) == suffix); } function iso8601(d) { if (typeof (d) == 'number') d = new Date(d); mod_assert.ok(d.constructor === Date); return (mod_extsprintf.sprintf('%4d-%02d-%02dT%02d:%02d:%02d.%03dZ', d.getUTCFullYear(), d.getUTCMonth() + 1, d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds())); } var RFC1123_MONTHS = [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; var RFC1123_DAYS = [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; function rfc1123(date) { return (mod_extsprintf.sprintf('%s, %02d %s %04d %02d:%02d:%02d GMT', RFC1123_DAYS[date.getUTCDay()], date.getUTCDate(), RFC1123_MONTHS[date.getUTCMonth()], date.getUTCFullYear(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds())); } /* * Parses a date expressed as a string, as either a number of milliseconds since * the epoch or any string format that Date accepts, giving preference to the * former where these two sets overlap (e.g., small numbers). */ function parseDateTime(str) { /* * This is irritatingly implicit, but significantly more concise than * alternatives. The "+str" will convert a string containing only a * number directly to a Number, or NaN for other strings. Thus, if the * conversion succeeds, we use it (this is the milliseconds-since-epoch * case). Otherwise, we pass the string directly to the Date * constructor to parse. */ var numeric = +str; if (!isNaN(numeric)) { return (new Date(numeric)); } else { return (new Date(str)); } } /* * Number.*_SAFE_INTEGER isn't present before node v0.12, so we hardcode * the ES6 definitions here, while allowing for them to someday be higher. */ var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991; var MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER || -9007199254740991; /* * Default options for parseInteger(). */ var PI_DEFAULTS = { base: 10, allowSign: true, allowPrefix: false, allowTrailing: false, allowImprecise: false, trimWhitespace: false, leadingZeroIsOctal: false }; var CP_0 = 0x30; var CP_9 = 0x39; var CP_A = 0x41; var CP_B = 0x42; var CP_O = 0x4f; var CP_T = 0x54; var CP_X = 0x58; var CP_Z = 0x5a; var CP_a = 0x61; var CP_b = 0x62; var CP_o = 0x6f; var CP_t = 0x74; var CP_x = 0x78; var CP_z = 0x7a; var PI_CONV_DEC = 0x30; var PI_CONV_UC = 0x37; var PI_CONV_LC = 0x57; /* * A stricter version of parseInt() that provides options for changing what * is an acceptable string (for example, disallowing trailing characters). */ function parseInteger(str, uopts) { mod_assert.string(str, 'str'); mod_assert.optionalObject(uopts, 'options'); var baseOverride = false; var options = PI_DEFAULTS; if (uopts) { baseOverride = hasKey(uopts, 'base'); options = mergeObjects(options, uopts); mod_assert.number(options.base, 'options.base'); mod_assert.ok(options.base >= 2, 'options.base >= 2'); mod_assert.ok(options.base <= 36, 'options.base <= 36'); mod_assert.bool(options.allowSign, 'options.allowSign'); mod_assert.bool(options.allowPrefix, 'options.allowPrefix'); mod_assert.bool(options.allowTrailing, 'options.allowTrailing'); mod_assert.bool(options.allowImprecise, 'options.allowImprecise'); mod_assert.bool(options.trimWhitespace, 'options.trimWhitespace'); mod_assert.bool(options.leadingZeroIsOctal, 'options.leadingZeroIsOctal'); if (options.leadingZeroIsOctal) { mod_assert.ok(!baseOverride, '"base" and "leadingZeroIsOctal" are ' + 'mutually exclusive'); } } var c; var pbase = -1; var base = options.base; var start; var mult = 1; var value = 0; var idx = 0; var len = str.length; /* Trim any whitespace on the left side. */ if (options.trimWhitespace) { while (idx < len && isSpace(str.charCodeAt(idx))) { ++idx; } } /* Check the number for a leading sign. */ if (options.allowSign) { if (str[idx] === '-') { idx += 1; mult = -1; } else if (str[idx] === '+') { idx += 1; } } /* Parse the base-indicating prefix if there is one. */ if (str[idx] === '0') { if (options.allowPrefix) { pbase = prefixToBase(str.charCodeAt(idx + 1)); if (pbase !== -1 && (!baseOverride || pbase === base)) { base = pbase; idx += 2; } } if (pbase === -1 && options.leadingZeroIsOctal) { base = 8; } } /* Parse the actual digits. */ for (start = idx; idx < len; ++idx) { c = translateDigit(str.charCodeAt(idx)); if (c !== -1 && c < base) { value *= base; value += c; } else { break; } } /* If we didn't parse any digits, we have an invalid number. */ if (start === idx) { return (new Error('invalid number: ' + JSON.stringify(str))); } /* Trim any whitespace on the right side. */ if (options.trimWhitespace) { while (idx < len && isSpace(str.charCodeAt(idx))) { ++idx; } } /* Check for trailing characters. */ if (idx < len && !options.allowTrailing) { return (new Error('trailing characters after number: ' + JSON.stringify(str.slice(idx)))); } /* If our value is 0, we return now, to avoid returning -0. */ if (value === 0) { return (0); } /* Calculate our final value. */ var result = value * mult; /* * If the string represents a value that cannot be precisely represented * by JavaScript, then we want to check that: * * - We never increased the value past MAX_SAFE_INTEGER * - We don't make the result negative and below MIN_SAFE_INTEGER * * Because we only ever increment the value during parsing, there's no * chance of moving past MAX_SAFE_INTEGER and then dropping below it * again, losing precision in the process. This means that we only need * to do our checks here, at the end. */ if (!options.allowImprecise && (value > MAX_SAFE_INTEGER || result < MIN_SAFE_INTEGER)) { return (new Error('number is outside of the supported range: ' + JSON.stringify(str.slice(start, idx)))); } return (result); } /* * Interpret a character code as a base-36 digit. */ function translateDigit(d) { if (d >= CP_0 && d <= CP_9) { /* '0' to '9' -> 0 to 9 */ return (d - PI_CONV_DEC); } else if (d >= CP_A && d <= CP_Z) { /* 'A' - 'Z' -> 10 to 35 */ return (d - PI_CONV_UC); } else if (d >= CP_a && d <= CP_z) { /* 'a' - 'z' -> 10 to 35 */ return (d - PI_CONV_LC); } else { /* Invalid character code */ return (-1); } } /* * Test if a value matches the ECMAScript definition of trimmable whitespace. */ function isSpace(c) { return (c === 0x20) || (c >= 0x0009 && c <= 0x000d) || (c === 0x00a0) || (c === 0x1680) || (c === 0x180e) || (c >= 0x2000 && c <= 0x200a) || (c === 0x2028) || (c === 0x2029) || (c === 0x202f) || (c === 0x205f) || (c === 0x3000) || (c === 0xfeff); } /* * Determine which base a character indicates (e.g., 'x' indicates hex). */ function prefixToBase(c) { if (c === CP_b || c === CP_B) { /* 0b/0B (binary) */ return (2); } else if (c === CP_o || c === CP_O) { /* 0o/0O (octal) */ return (8); } else if (c === CP_t || c === CP_T) { /* 0t/0T (decimal) */ return (10); } else if (c === CP_x || c === CP_X) { /* 0x/0X (hexadecimal) */ return (16); } else { /* Not a meaningful character */ return (-1); } } function validateJsonObjectJS(schema, input) { var report = mod_jsonschema.validate(input, schema); if (report.errors.length === 0) return (null); /* Currently, we only do anything useful with the first error. */ var error = report.errors[0]; /* The failed property is given by a URI with an irrelevant prefix. */ var propname = error['property']; var reason = error['message'].toLowerCase(); var i, j; /* * There's at least one case where the property error message is * confusing at best. We work around this here. */ if ((i = reason.indexOf('the property ')) != -1 && (j = reason.indexOf(' is not defined in the schema and the ' + 'schema does not allow additional properties')) != -1) { i += 'the property '.length; if (propname === '') propname = reason.substr(i, j - i); else propname = propname + '.' + reason.substr(i, j - i); reason = 'unsupported property'; } var rv = new mod_verror.VError('property "%s": %s', propname, reason); rv.jsv_details = error; return (rv); } function randElt(arr) { mod_assert.ok(Array.isArray(arr) && arr.length > 0, 'randElt argument must be a non-empty array'); return (arr[Math.floor(Math.random() * arr.length)]); } function assertHrtime(a) { mod_assert.ok(a[0] >= 0 && a[1] >= 0, 'negative numbers not allowed in hrtimes'); mod_assert.ok(a[1] < 1e9, 'nanoseconds column overflow'); } /* * Compute the time elapsed between hrtime readings A and B, where A is later * than B. hrtime readings come from Node's process.hrtime(). There is no * defined way to represent negative deltas, so it's illegal to diff B from A * where the time denoted by B is later than the time denoted by A. If this * becomes valuable, we can define a representation and extend the * implementation to support it. */ function hrtimeDiff(a, b) { assertHrtime(a); assertHrtime(b); mod_assert.ok(a[0] > b[0] || (a[0] == b[0] && a[1] >= b[1]), 'negative differences not allowed'); var rv = [ a[0] - b[0], 0 ]; if (a[1] >= b[1]) { rv[1] = a[1] - b[1]; } else { rv[0]--; rv[1] = 1e9 - (b[1] - a[1]); } return (rv); } /* * Convert a hrtime reading from the array format returned by Node's * process.hrtime() into a scalar number of nanoseconds. */ function hrtimeNanosec(a) { assertHrtime(a); return (Math.floor(a[0] * 1e9 + a[1])); } /* * Convert a hrtime reading from the array format returned by Node's * process.hrtime() into a scalar number of microseconds. */ function hrtimeMicrosec(a) { assertHrtime(a); return (Math.floor(a[0] * 1e6 + a[1] / 1e3)); } /* * Convert a hrtime reading from the array format returned by Node's * process.hrtime() into a scalar number of milliseconds. */ function hrtimeMillisec(a) { assertHrtime(a); return (Math.floor(a[0] * 1e3 + a[1] / 1e6)); } /* * Add two hrtime readings A and B, overwriting A with the result of the * addition. This function is useful for accumulating several hrtime intervals * into a counter. Returns A. */ function hrtimeAccum(a, b) { assertHrtime(a); assertHrtime(b); /* * Accumulate the nanosecond component. */ a[1] += b[1]; if (a[1] >= 1e9) { /* * The nanosecond component overflowed, so carry to the seconds * field. */ a[0]++; a[1] -= 1e9; } /* * Accumulate the seconds component. */ a[0] += b[0]; return (a); } /* * Add two hrtime readings A and B, returning the result as a new hrtime array. * Does not modify either input argument. */ function hrtimeAdd(a, b) { assertHrtime(a); var rv = [ a[0], a[1] ]; return (hrtimeAccum(rv, b)); } /* * Check an object for unexpected properties. Accepts the object to check, and * an array of allowed property names (strings). Returns an array of key names * that were found on the object, but did not appear in the list of allowed * properties. If no properties were found, the returned array will be of * zero length. */ function extraProperties(obj, allowed) { mod_assert.ok(typeof (obj) === 'object' && obj !== null, 'obj argument must be a non-null object'); mod_assert.ok(Array.isArray(allowed), 'allowed argument must be an array of strings'); for (var i = 0; i < allowed.length; i++) { mod_assert.ok(typeof (allowed[i]) === 'string', 'allowed argument must be an array of strings'); } return (Object.keys(obj).filter(function (key) { return (allowed.indexOf(key) === -1); })); } /* * Given three sets of properties "provided" (may be undefined), "overrides" * (required), and "defaults" (may be undefined), construct an object containing * the union of these sets with "overrides" overriding "provided", and * "provided" overriding "defaults". None of the input objects are modified. */ function mergeObjects(provided, overrides, defaults) { var rv, k; rv = {}; if (defaults) { for (k in defaults) rv[k] = defaults[k]; } if (provided) { for (k in provided) rv[k] = provided[k]; } if (overrides) { for (k in overrides) rv[k] = overrides[k]; } return (rv); } /***/ }), /* 151 */ /***/ (function(module, exports, __webpack_require__) { /* * extsprintf.js: extended POSIX-style sprintf */ var mod_assert = __webpack_require__(109); var mod_util = __webpack_require__(9); /* * Public interface */ exports.sprintf = jsSprintf; exports.printf = jsPrintf; exports.fprintf = jsFprintf; /* * Stripped down version of s[n]printf(3c). We make a best effort to throw an * exception when given a format string we don't understand, rather than * ignoring it, so that we won't break existing programs if/when we go implement * the rest of this. * * This implementation currently supports specifying * - field alignment ('-' flag), * - zero-pad ('0' flag) * - always show numeric sign ('+' flag), * - field width * - conversions for strings, decimal integers, and floats (numbers). * - argument size specifiers. These are all accepted but ignored, since * Javascript has no notion of the physical size of an argument. * * Everything else is currently unsupported, most notably precision, unsigned * numbers, non-decimal numbers, and characters. */ function jsSprintf(fmt) { var regex = [ '([^%]*)', /* normal text */ '%', /* start of format */ '([\'\\-+ #0]*?)', /* flags (optional) */ '([1-9]\\d*)?', /* width (optional) */ '(\\.([1-9]\\d*))?', /* precision (optional) */ '[lhjztL]*?', /* length mods (ignored) */ '([diouxXfFeEgGaAcCsSp%jr])' /* conversion */ ].join(''); var re = new RegExp(regex); var args = Array.prototype.slice.call(arguments, 1); var flags, width, precision, conversion; var left, pad, sign, arg, match; var ret = ''; var argn = 1; mod_assert.equal('string', typeof (fmt)); while ((match = re.exec(fmt)) !== null) { ret += match[1]; fmt = fmt.substring(match[0].length); flags = match[2] || ''; width = match[3] || 0; precision = match[4] || ''; conversion = match[6]; left = false; sign = false; pad = ' '; if (conversion == '%') { ret += '%'; continue; } if (args.length === 0) throw (new Error('too few args to sprintf')); arg = args.shift(); argn++; if (flags.match(/[\' #]/)) throw (new Error( 'unsupported flags: ' + flags)); if (precision.length > 0) throw (new Error( 'non-zero precision not supported')); if (flags.match(/-/)) left = true; if (flags.match(/0/)) pad = '0'; if (flags.match(/\+/)) sign = true; switch (conversion) { case 's': if (arg === undefined || arg === null) throw (new Error('argument ' + argn + ': attempted to print undefined or null ' + 'as a string')); ret += doPad(pad, width, left, arg.toString()); break; case 'd': arg = Math.floor(arg); /*jsl:fallthru*/ case 'f': sign = sign && arg > 0 ? '+' : ''; ret += sign + doPad(pad, width, left, arg.toString()); break; case 'x': ret += doPad(pad, width, left, arg.toString(16)); break; case 'j': /* non-standard */ if (width === 0) width = 10; ret += mod_util.inspect(arg, false, width); break; case 'r': /* non-standard */ ret += dumpException(arg); break; default: throw (new Error('unsupported conversion: ' + conversion)); } } ret += fmt; return (ret); } function jsPrintf() { var args = Array.prototype.slice.call(arguments); args.unshift(process.stdout); jsFprintf.apply(null, args); } function jsFprintf(stream) { var args = Array.prototype.slice.call(arguments, 1); return (stream.write(jsSprintf.apply(this, args))); } function doPad(chr, width, left, str) { var ret = str; while (ret.length < width) { if (left) ret += chr; else ret = chr + ret; } return (ret); } /* * This function dumps long stack traces for exceptions having a cause() method. * See node-verror for an example. */ function dumpException(ex) { var ret; if (!(ex instanceof Error)) throw (new Error(jsSprintf('invalid type for %%r: %j', ex))); /* Note that V8 prepends "ex.stack" with ex.toString(). */ ret = 'EXCEPTION: ' + ex.constructor.name + ': ' + ex.stack; if (ex.cause && typeof (ex.cause) === 'function') { var cex = ex.cause(); if (cex) { ret += '\nCaused by: ' + dumpException(cex); } } return (ret); } /***/ }), /* 152 */ /***/ (function(module, exports, __webpack_require__) { /* * verror.js: richer JavaScript errors */ var mod_assertplus = __webpack_require__(108); var mod_util = __webpack_require__(9); var mod_extsprintf = __webpack_require__(153); var mod_isError = __webpack_require__(154).isError; var sprintf = mod_extsprintf.sprintf; /* * Public interface */ /* So you can 'var VError = require('verror')' */ module.exports = VError; /* For compatibility */ VError.VError = VError; /* Other exported classes */ VError.SError = SError; VError.WError = WError; VError.MultiError = MultiError; /* * Common function used to parse constructor arguments for VError, WError, and * SError. Named arguments to this function: * * strict force strict interpretation of sprintf arguments, even * if the options in "argv" don't say so * * argv error's constructor arguments, which are to be * interpreted as described in README.md. For quick * reference, "argv" has one of the following forms: * * [ sprintf_args... ] (argv[0] is a string) * [ cause, sprintf_args... ] (argv[0] is an Error) * [ options, sprintf_args... ] (argv[0] is an object) * * This function normalizes these forms, producing an object with the following * properties: * * options equivalent to "options" in third form. This will never * be a direct reference to what the caller passed in * (i.e., it may be a shallow copy), so it can be freely * modified. * * shortmessage result of sprintf(sprintf_args), taking options.strict * into account as described in README.md. */ function parseConstructorArguments(args) { var argv, options, sprintf_args, shortmessage, k; mod_assertplus.object(args, 'args'); mod_assertplus.bool(args.strict, 'args.strict'); mod_assertplus.array(args.argv, 'args.argv'); argv = args.argv; /* * First, figure out which form of invocation we've been given. */ if (argv.length === 0) { options = {}; sprintf_args = []; } else if (mod_isError(argv[0])) { options = { 'cause': argv[0] }; sprintf_args = argv.slice(1); } else if (typeof (argv[0]) === 'object') { options = {}; for (k in argv[0]) { options[k] = argv[0][k]; } sprintf_args = argv.slice(1); } else { mod_assertplus.string(argv[0], 'first argument to VError, SError, or WError ' + 'constructor must be a string, object, or Error'); options = {}; sprintf_args = argv; } /* * Now construct the error's message. * * extsprintf (which we invoke here with our caller's arguments in order * to construct this Error's message) is strict in its interpretation of * values to be processed by the "%s" specifier. The value passed to * extsprintf must actually be a string or something convertible to a * String using .toString(). Passing other values (notably "null" and * "undefined") is considered a programmer error. The assumption is * that if you actually want to print the string "null" or "undefined", * then that's easy to do that when you're calling extsprintf; on the * other hand, if you did NOT want that (i.e., there's actually a bug * where the program assumes some variable is non-null and tries to * print it, which might happen when constructing a packet or file in * some specific format), then it's better to stop immediately than * produce bogus output. * * However, sometimes the bug is only in the code calling VError, and a * programmer might prefer to have the error message contain "null" or * "undefined" rather than have the bug in the error path crash the * program (making the first bug harder to identify). For that reason, * by default VError converts "null" or "undefined" arguments to their * string representations and passes those to extsprintf. Programmers * desiring the strict behavior can use the SError class or pass the * "strict" option to the VError constructor. */ mod_assertplus.object(options); if (!options.strict && !args.strict) { sprintf_args = sprintf_args.map(function (a) { return (a === null ? 'null' : a === undefined ? 'undefined' : a); }); } if (sprintf_args.length === 0) { shortmessage = ''; } else { shortmessage = sprintf.apply(null, sprintf_args); } return ({ 'options': options, 'shortmessage': shortmessage }); } /* * See README.md for reference documentation. */ function VError() { var args, obj, parsed, cause, ctor, message, k; args = Array.prototype.slice.call(arguments, 0); /* * This is a regrettable pattern, but JavaScript's built-in Error class * is defined to work this way, so we allow the constructor to be called * without "new". */ if (!(this instanceof VError)) { obj = Object.create(VError.prototype); VError.apply(obj, arguments); return (obj); } /* * For convenience and backwards compatibility, we support several * different calling forms. Normalize them here. */ parsed = parseConstructorArguments({ 'argv': args, 'strict': false }); /* * If we've been given a name, apply it now. */ if (parsed.options.name) { mod_assertplus.string(parsed.options.name, 'error\'s "name" must be a string'); this.name = parsed.options.name; } /* * For debugging, we keep track of the original short message (attached * this Error particularly) separately from the complete message (which * includes the messages of our cause chain). */ this.jse_shortmsg = parsed.shortmessage; message = parsed.shortmessage; /* * If we've been given a cause, record a reference to it and update our * message appropriately. */ cause = parsed.options.cause; if (cause) { mod_assertplus.ok(mod_isError(cause), 'cause is not an Error'); this.jse_cause = cause; if (!parsed.options.skipCauseMessage) { message += ': ' + cause.message; } } /* * If we've been given an object with properties, shallow-copy that * here. We don't want to use a deep copy in case there are non-plain * objects here, but we don't want to use the original object in case * the caller modifies it later. */ this.jse_info = {}; if (parsed.options.info) { for (k in parsed.options.info) { this.jse_info[k] = parsed.options.info[k]; } } this.message = message; Error.call(this, message); if (Error.captureStackTrace) { ctor = parsed.options.constructorOpt || this.constructor; Error.captureStackTrace(this, ctor); } return (this); } mod_util.inherits(VError, Error); VError.prototype.name = 'VError'; VError.prototype.toString = function ve_toString() { var str = (this.hasOwnProperty('name') && this.name || this.constructor.name || this.constructor.prototype.name); if (this.message) str += ': ' + this.message; return (str); }; /* * This method is provided for compatibility. New callers should use * VError.cause() instead. That method also uses the saner `null` return value * when there is no cause. */ VError.prototype.cause = function ve_cause() { var cause = VError.cause(this); return (cause === null ? undefined : cause); }; /* * Static methods * * These class-level methods are provided so that callers can use them on * instances of Errors that are not VErrors. New interfaces should be provided * only using static methods to eliminate the class of programming mistake where * people fail to check whether the Error object has the corresponding methods. */ VError.cause = function (err) { mod_assertplus.ok(mod_isError(err), 'err must be an Error'); return (mod_isError(err.jse_cause) ? err.jse_cause : null); }; VError.info = function (err) { var rv, cause, k; mod_assertplus.ok(mod_isError(err), 'err must be an Error'); cause = VError.cause(err); if (cause !== null) { rv = VError.info(cause); } else { rv = {}; } if (typeof (err.jse_info) == 'object' && err.jse_info !== null) { for (k in err.jse_info) { rv[k] = err.jse_info[k]; } } return (rv); }; VError.findCauseByName = function (err, name) { var cause; mod_assertplus.ok(mod_isError(err), 'err must be an Error'); mod_assertplus.string(name, 'name'); mod_assertplus.ok(name.length > 0, 'name cannot be empty'); for (cause = err; cause !== null; cause = VError.cause(cause)) { mod_assertplus.ok(mod_isError(cause)); if (cause.name == name) { return (cause); } } return (null); }; VError.hasCauseWithName = function (err, name) { return (VError.findCauseByName(err, name) !== null); }; VError.fullStack = function (err) { mod_assertplus.ok(mod_isError(err), 'err must be an Error'); var cause = VError.cause(err); if (cause) { return (err.stack + '\ncaused by: ' + VError.fullStack(cause)); } return (err.stack); }; VError.errorFromList = function (errors) { mod_assertplus.arrayOfObject(errors, 'errors'); if (errors.length === 0) { return (null); } errors.forEach(function (e) { mod_assertplus.ok(mod_isError(e)); }); if (errors.length == 1) { return (errors[0]); } return (new MultiError(errors)); }; VError.errorForEach = function (err, func) { mod_assertplus.ok(mod_isError(err), 'err must be an Error'); mod_assertplus.func(func, 'func'); if (err instanceof MultiError) { err.errors().forEach(function iterError(e) { func(e); }); } else { func(err); } }; /* * SError is like VError, but stricter about types. You cannot pass "null" or * "undefined" as string arguments to the formatter. */ function SError() { var args, obj, parsed, options; args = Array.prototype.slice.call(arguments, 0); if (!(this instanceof SError)) { obj = Object.create(SError.prototype); SError.apply(obj, arguments); return (obj); } parsed = parseConstructorArguments({ 'argv': args, 'strict': true }); options = parsed.options; VError.call(this, options, '%s', parsed.shortmessage); return (this); } /* * We don't bother setting SError.prototype.name because once constructed, * SErrors are just like VErrors. */ mod_util.inherits(SError, VError); /* * Represents a collection of errors for the purpose of consumers that generally * only deal with one error. Callers can extract the individual errors * contained in this object, but may also just treat it as a normal single * error, in which case a summary message will be printed. */ function MultiError(errors) { mod_assertplus.array(errors, 'list of errors'); mod_assertplus.ok(errors.length > 0, 'must be at least one error'); this.ase_errors = errors; VError.call(this, { 'cause': errors[0] }, 'first of %d error%s', errors.length, errors.length == 1 ? '' : 's'); } mod_util.inherits(MultiError, VError); MultiError.prototype.name = 'MultiError'; MultiError.prototype.errors = function me_errors() { return (this.ase_errors.slice(0)); }; /* * See README.md for reference details. */ function WError() { var args, obj, parsed, options; args = Array.prototype.slice.call(arguments, 0); if (!(this instanceof WError)) { obj = Object.create(WError.prototype); WError.apply(obj, args); return (obj); } parsed = parseConstructorArguments({ 'argv': args, 'strict': false }); options = parsed.options; options['skipCauseMessage'] = true; VError.call(this, options, '%s', parsed.shortmessage); return (this); } mod_util.inherits(WError, VError); WError.prototype.name = 'WError'; WError.prototype.toString = function we_toString() { var str = (this.hasOwnProperty('name') && this.name || this.constructor.name || this.constructor.prototype.name); if (this.message) str += ': ' + this.message; if (this.jse_cause && this.jse_cause.message) str += '; caused by ' + this.jse_cause.toString(); return (str); }; /* * For purely historical reasons, WError's cause() function allows you to set * the cause. */ WError.prototype.cause = function we_cause(c) { if (mod_isError(c)) this.jse_cause = c; return (this.jse_cause); }; /***/ }), /* 153 */ /***/ (function(module, exports, __webpack_require__) { /* * extsprintf.js: extended POSIX-style sprintf */ var mod_assert = __webpack_require__(109); var mod_util = __webpack_require__(9); /* * Public interface */ exports.sprintf = jsSprintf; exports.printf = jsPrintf; exports.fprintf = jsFprintf; /* * Stripped down version of s[n]printf(3c). We make a best effort to throw an * exception when given a format string we don't understand, rather than * ignoring it, so that we won't break existing programs if/when we go implement * the rest of this. * * This implementation currently supports specifying * - field alignment ('-' flag), * - zero-pad ('0' flag) * - always show numeric sign ('+' flag), * - field width * - conversions for strings, decimal integers, and floats (numbers). * - argument size specifiers. These are all accepted but ignored, since * Javascript has no notion of the physical size of an argument. * * Everything else is currently unsupported, most notably precision, unsigned * numbers, non-decimal numbers, and characters. */ function jsSprintf(ofmt) { var regex = [ '([^%]*)', /* normal text */ '%', /* start of format */ '([\'\\-+ #0]*?)', /* flags (optional) */ '([1-9]\\d*)?', /* width (optional) */ '(\\.([1-9]\\d*))?', /* precision (optional) */ '[lhjztL]*?', /* length mods (ignored) */ '([diouxXfFeEgGaAcCsSp%jr])' /* conversion */ ].join(''); var re = new RegExp(regex); /* variadic arguments used to fill in conversion specifiers */ var args = Array.prototype.slice.call(arguments, 1); /* remaining format string */ var fmt = ofmt; /* components of the current conversion specifier */ var flags, width, precision, conversion; var left, pad, sign, arg, match; /* return value */ var ret = ''; /* current variadic argument (1-based) */ var argn = 1; /* 0-based position in the format string that we've read */ var posn = 0; /* 1-based position in the format string of the current conversion */ var convposn; /* current conversion specifier */ var curconv; mod_assert.equal('string', typeof (fmt), 'first argument must be a format string'); while ((match = re.exec(fmt)) !== null) { ret += match[1]; fmt = fmt.substring(match[0].length); /* * Update flags related to the current conversion specifier's * position so that we can report clear error messages. */ curconv = match[0].substring(match[1].length); convposn = posn + match[1].length + 1; posn += match[0].length; flags = match[2] || ''; width = match[3] || 0; precision = match[4] || ''; conversion = match[6]; left = false; sign = false; pad = ' '; if (conversion == '%') { ret += '%'; continue; } if (args.length === 0) { throw (jsError(ofmt, convposn, curconv, 'has no matching argument ' + '(too few arguments passed)')); } arg = args.shift(); argn++; if (flags.match(/[\' #]/)) { throw (jsError(ofmt, convposn, curconv, 'uses unsupported flags')); } if (precision.length > 0) { throw (jsError(ofmt, convposn, curconv, 'uses non-zero precision (not supported)')); } if (flags.match(/-/)) left = true; if (flags.match(/0/)) pad = '0'; if (flags.match(/\+/)) sign = true; switch (conversion) { case 's': if (arg === undefined || arg === null) { throw (jsError(ofmt, convposn, curconv, 'attempted to print undefined or null ' + 'as a string (argument ' + argn + ' to ' + 'sprintf)')); } ret += doPad(pad, width, left, arg.toString()); break; case 'd': arg = Math.floor(arg); /*jsl:fallthru*/ case 'f': sign = sign && arg > 0 ? '+' : ''; ret += sign + doPad(pad, width, left, arg.toString()); break; case 'x': ret += doPad(pad, width, left, arg.toString(16)); break; case 'j': /* non-standard */ if (width === 0) width = 10; ret += mod_util.inspect(arg, false, width); break; case 'r': /* non-standard */ ret += dumpException(arg); break; default: throw (jsError(ofmt, convposn, curconv, 'is not supported')); } } ret += fmt; return (ret); } function jsError(fmtstr, convposn, curconv, reason) { mod_assert.equal(typeof (fmtstr), 'string'); mod_assert.equal(typeof (curconv), 'string'); mod_assert.equal(typeof (convposn), 'number'); mod_assert.equal(typeof (reason), 'string'); return (new Error('format string "' + fmtstr + '": conversion specifier "' + curconv + '" at character ' + convposn + ' ' + reason)); } function jsPrintf() { var args = Array.prototype.slice.call(arguments); args.unshift(process.stdout); jsFprintf.apply(null, args); } function jsFprintf(stream) { var args = Array.prototype.slice.call(arguments, 1); return (stream.write(jsSprintf.apply(this, args))); } function doPad(chr, width, left, str) { var ret = str; while (ret.length < width) { if (left) ret += chr; else ret = chr + ret; } return (ret); } /* * This function dumps long stack traces for exceptions having a cause() method. * See node-verror for an example. */ function dumpException(ex) { var ret; if (!(ex instanceof Error)) throw (new Error(jsSprintf('invalid type for %%r: %j', ex))); /* Note that V8 prepends "ex.stack" with ex.toString(). */ ret = 'EXCEPTION: ' + ex.constructor.name + ': ' + ex.stack; if (ex.cause && typeof (ex.cause) === 'function') { var cex = ex.cause(); if (cex) { ret += '\nCaused by: ' + dumpException(cex); } } return (ret); } /***/ }), /* 154 */ /***/ (function(module, exports) { // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // NOTE: These type checking functions intentionally don't use `instanceof` // because it is fragile and can be easily faked with `Object.create()`. function isArray(arg) { if (Array.isArray) { return Array.isArray(arg); } return objectToString(arg) === '[object Array]'; } exports.isArray = isArray; function isBoolean(arg) { return typeof arg === 'boolean'; } exports.isBoolean = isBoolean; function isNull(arg) { return arg === null; } exports.isNull = isNull; function isNullOrUndefined(arg) { return arg == null; } exports.isNullOrUndefined = isNullOrUndefined; function isNumber(arg) { return typeof arg === 'number'; } exports.isNumber = isNumber; function isString(arg) { return typeof arg === 'string'; } exports.isString = isString; function isSymbol(arg) { return typeof arg === 'symbol'; } exports.isSymbol = isSymbol; function isUndefined(arg) { return arg === void 0; } exports.isUndefined = isUndefined; function isRegExp(re) { return objectToString(re) === '[object RegExp]'; } exports.isRegExp = isRegExp; function isObject(arg) { return typeof arg === 'object' && arg !== null; } exports.isObject = isObject; function isDate(d) { return objectToString(d) === '[object Date]'; } exports.isDate = isDate; function isError(e) { return (objectToString(e) === '[object Error]' || e instanceof Error); } exports.isError = isError; function isFunction(arg) { return typeof arg === 'function'; } exports.isFunction = isFunction; function isPrimitive(arg) { return arg === null || typeof arg === 'boolean' || typeof arg === 'number' || typeof arg === 'string' || typeof arg === 'symbol' || // ES6 symbol typeof arg === 'undefined'; } exports.isPrimitive = isPrimitive; exports.isBuffer = Buffer.isBuffer; function objectToString(o) { return Object.prototype.toString.call(o); } /***/ }), /* 155 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** * JSONSchema Validator - Validates JavaScript objects using JSON Schemas * (http://www.json.com/json-schema-proposal/) * * Copyright (c) 2007 Kris Zyp SitePen (www.sitepen.com) * Licensed under the MIT (MIT-LICENSE.txt) license. To use the validator call the validate function with an instance object and an optional schema object. If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating), that schema will be used to validate and the schema parameter is not necessary (if both exist, both validations will occur). The validate method will return an array of validation errors. If there are no errors, then an empty list will be returned. A validation error will have two properties: "property" which indicates which property had the error "message" which indicates what the error was */ (function (root, factory) { if (true) { // AMD. Register as an anonymous module. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { return factory(); }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else {} }(this, function () {// setup primitive classes to be JSON Schema types var exports = validate exports.Integer = {type:"integer"}; var primitiveConstructors = { String: String, Boolean: Boolean, Number: Number, Object: Object, Array: Array, Date: Date } exports.validate = validate; function validate(/*Any*/instance,/*Object*/schema) { // Summary: // To use the validator call JSONSchema.validate with an instance object and an optional schema object. // If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating), // that schema will be used to validate and the schema parameter is not necessary (if both exist, // both validations will occur). // The validate method will return an object with two properties: // valid: A boolean indicating if the instance is valid by the schema // errors: An array of validation errors. If there are no errors, then an // empty list will be returned. A validation error will have two properties: // property: which indicates which property had the error // message: which indicates what the error was // return validate(instance, schema, {changing: false});//, coerce: false, existingOnly: false}); }; exports.checkPropertyChange = function(/*Any*/value,/*Object*/schema, /*String*/property) { // Summary: // The checkPropertyChange method will check to see if an value can legally be in property with the given schema // This is slightly different than the validate method in that it will fail if the schema is readonly and it will // not check for self-validation, it is assumed that the passed in value is already internally valid. // The checkPropertyChange method will return the same object type as validate, see JSONSchema.validate for // information. // return validate(value, schema, {changing: property || "property"}); }; var validate = exports._validate = function(/*Any*/instance,/*Object*/schema,/*Object*/options) { if (!options) options = {}; var _changing = options.changing; function getType(schema){ return schema.type || (primitiveConstructors[schema.name] == schema && schema.name.toLowerCase()); } var errors = []; // validate a value against a property definition function checkProp(value, schema, path,i){ var l; path += path ? typeof i == 'number' ? '[' + i + ']' : typeof i == 'undefined' ? '' : '.' + i : i; function addError(message){ errors.push({property:path,message:message}); } if((typeof schema != 'object' || schema instanceof Array) && (path || typeof schema != 'function') && !(schema && getType(schema))){ if(typeof schema == 'function'){ if(!(value instanceof schema)){ addError("is not an instance of the class/constructor " + schema.name); } }else if(schema){ addError("Invalid schema/property definition " + schema); } return null; } if(_changing && schema.readonly){ addError("is a readonly field, it can not be changed"); } if(schema['extends']){ // if it extends another schema, it must pass that schema as well checkProp(value,schema['extends'],path,i); } // validate a value against a type definition function checkType(type,value){ if(type){ if(typeof type == 'string' && type != 'any' && (type == 'null' ? value !== null : typeof value != type) && !(value instanceof Array && type == 'array') && !(value instanceof Date && type == 'date') && !(type == 'integer' && value%1===0)){ return [{property:path,message:(typeof value) + " value found, but a " + type + " is required"}]; } if(type instanceof Array){ var unionErrors=[]; for(var j = 0; j < type.length; j++){ // a union type if(!(unionErrors=checkType(type[j],value)).length){ break; } } if(unionErrors.length){ return unionErrors; } }else if(typeof type == 'object'){ var priorErrors = errors; errors = []; checkProp(value,type,path); var theseErrors = errors; errors = priorErrors; return theseErrors; } } return []; } if(value === undefined){ if(schema.required){ addError("is missing and it is required"); } }else{ errors = errors.concat(checkType(getType(schema),value)); if(schema.disallow && !checkType(schema.disallow,value).length){ addError(" disallowed value was matched"); } if(value !== null){ if(value instanceof Array){ if(schema.items){ var itemsIsArray = schema.items instanceof Array; var propDef = schema.items; for (i = 0, l = value.length; i < l; i += 1) { if (itemsIsArray) propDef = schema.items[i]; if (options.coerce) value[i] = options.coerce(value[i], propDef); errors.concat(checkProp(value[i],propDef,path,i)); } } if(schema.minItems && value.length < schema.minItems){ addError("There must be a minimum of " + schema.minItems + " in the array"); } if(schema.maxItems && value.length > schema.maxItems){ addError("There must be a maximum of " + schema.maxItems + " in the array"); } }else if(schema.properties || schema.additionalProperties){ errors.concat(checkObj(value, schema.properties, path, schema.additionalProperties)); } if(schema.pattern && typeof value == 'string' && !value.match(schema.pattern)){ addError("does not match the regex pattern " + schema.pattern); } if(schema.maxLength && typeof value == 'string' && value.length > schema.maxLength){ addError("may only be " + schema.maxLength + " characters long"); } if(schema.minLength && typeof value == 'string' && value.length < schema.minLength){ addError("must be at least " + schema.minLength + " characters long"); } if(typeof schema.minimum !== undefined && typeof value == typeof schema.minimum && schema.minimum > value){ addError("must have a minimum value of " + schema.minimum); } if(typeof schema.maximum !== undefined && typeof value == typeof schema.maximum && schema.maximum < value){ addError("must have a maximum value of " + schema.maximum); } if(schema['enum']){ var enumer = schema['enum']; l = enumer.length; var found; for(var j = 0; j < l; j++){ if(enumer[j]===value){ found=1; break; } } if(!found){ addError("does not have a value in the enumeration " + enumer.join(", ")); } } if(typeof schema.maxDecimal == 'number' && (value.toString().match(new RegExp("\\.[0-9]{" + (schema.maxDecimal + 1) + ",}")))){ addError("may only have " + schema.maxDecimal + " digits of decimal places"); } } } return null; } // validate an object against a schema function checkObj(instance,objTypeDef,path,additionalProp){ if(typeof objTypeDef =='object'){ if(typeof instance != 'object' || instance instanceof Array){ errors.push({property:path,message:"an object is required"}); } for(var i in objTypeDef){ if(objTypeDef.hasOwnProperty(i)){ var value = instance[i]; // skip _not_ specified properties if (value === undefined && options.existingOnly) continue; var propDef = objTypeDef[i]; // set default if(value === undefined && propDef["default"]){ value = instance[i] = propDef["default"]; } if(options.coerce && i in instance){ value = instance[i] = options.coerce(value, propDef); } checkProp(value,propDef,path,i); } } } for(i in instance){ if(instance.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){ if (options.filter) { delete instance[i]; continue; } else { errors.push({property:path,message:(typeof value) + "The property " + i + " is not defined in the schema and the schema does not allow additional properties"}); } } var requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires; if(requires && !(requires in instance)){ errors.push({property:path,message:"the presence of the property " + i + " requires that " + requires + " also be present"}); } value = instance[i]; if(additionalProp && (!(objTypeDef && typeof objTypeDef == 'object') || !(i in objTypeDef))){ if(options.coerce){ value = instance[i] = options.coerce(value, additionalProp); } checkProp(value,additionalProp,path,i); } if(!_changing && value && value.$schema){ errors = errors.concat(checkProp(value,value.$schema,path,i)); } } return errors; } if(schema){ checkProp(instance,schema,'',_changing || ''); } if(!_changing && instance && instance.$schema){ checkProp(instance,instance.$schema,'',''); } return {valid:!errors.length,errors:errors}; }; exports.mustBeValid = function(result){ // summary: // This checks to ensure that the result is valid and will throw an appropriate error message if it is not // result: the result returned from checkPropertyChange or validate if(!result.valid){ throw new TypeError(result.errors.map(function(error){return "for property " + error.property + ': ' + error.message;}).join(", \n")); } } return exports; })); /***/ }), /* 156 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. var assert = __webpack_require__(108); var crypto = __webpack_require__(94); var sshpk = __webpack_require__(111); var utils = __webpack_require__(110); var HASH_ALGOS = utils.HASH_ALGOS; var PK_ALGOS = utils.PK_ALGOS; var InvalidAlgorithmError = utils.InvalidAlgorithmError; var HttpSignatureError = utils.HttpSignatureError; var validateAlgorithm = utils.validateAlgorithm; ///--- Exported API module.exports = { /** * Verify RSA/DSA signature against public key. You are expected to pass in * an object that was returned from `parse()`. * * @param {Object} parsedSignature the object you got from `parse`. * @param {String} pubkey RSA/DSA private key PEM. * @return {Boolean} true if valid, false otherwise. * @throws {TypeError} if you pass in bad arguments. * @throws {InvalidAlgorithmError} */ verifySignature: function verifySignature(parsedSignature, pubkey) { assert.object(parsedSignature, 'parsedSignature'); if (typeof (pubkey) === 'string' || Buffer.isBuffer(pubkey)) pubkey = sshpk.parseKey(pubkey); assert.ok(sshpk.Key.isKey(pubkey, [1, 1]), 'pubkey must be a sshpk.Key'); var alg = validateAlgorithm(parsedSignature.algorithm); if (alg[0] === 'hmac' || alg[0] !== pubkey.type) return (false); var v = pubkey.createVerify(alg[1]); v.update(parsedSignature.signingString); return (v.verify(parsedSignature.params.signature, 'base64')); }, /** * Verify HMAC against shared secret. You are expected to pass in an object * that was returned from `parse()`. * * @param {Object} parsedSignature the object you got from `parse`. * @param {String} secret HMAC shared secret. * @return {Boolean} true if valid, false otherwise. * @throws {TypeError} if you pass in bad arguments. * @throws {InvalidAlgorithmError} */ verifyHMAC: function verifyHMAC(parsedSignature, secret) { assert.object(parsedSignature, 'parsedHMAC'); assert.string(secret, 'secret'); var alg = validateAlgorithm(parsedSignature.algorithm); if (alg[0] !== 'hmac') return (false); var hashAlg = alg[1].toUpperCase(); var hmac = crypto.createHmac(hashAlg, secret); hmac.update(parsedSignature.signingString); /* * Now double-hash to avoid leaking timing information - there's * no easy constant-time compare in JS, so we use this approach * instead. See for more info: * https://www.isecpartners.com/blog/2011/february/double-hmac- * verification.aspx */ var h1 = crypto.createHmac(hashAlg, secret); h1.update(hmac.digest()); h1 = h1.digest(); var h2 = crypto.createHmac(hashAlg, secret); h2.update(new Buffer(parsedSignature.params.signature, 'base64')); h2 = h2.digest(); /* Node 0.8 returns strings from .digest(). */ if (typeof (h1) === 'string') return (h1 === h2); /* And node 0.10 lacks the .equals() method on Buffers. */ if (Buffer.isBuffer(h1) && !h1.equals) return (h1.toString('binary') === h2.toString('binary')); return (h1.equals(h2)); } }; /***/ }), /* 157 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * mime-types * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var db = __webpack_require__(158) var extname = __webpack_require__(160).extname /** * Module variables. * @private */ var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/ var TEXT_TYPE_REGEXP = /^text\//i /** * Module exports. * @public */ exports.charset = charset exports.charsets = { lookup: charset } exports.contentType = contentType exports.extension = extension exports.extensions = Object.create(null) exports.lookup = lookup exports.types = Object.create(null) // Populate the extensions/types maps populateMaps(exports.extensions, exports.types) /** * Get the default charset for a MIME type. * * @param {string} type * @return {boolean|string} */ function charset (type) { if (!type || typeof type !== 'string') { return false } // TODO: use media-typer var match = EXTRACT_TYPE_REGEXP.exec(type) var mime = match && db[match[1].toLowerCase()] if (mime && mime.charset) { return mime.charset } // default text/* to utf-8 if (match && TEXT_TYPE_REGEXP.test(match[1])) { return 'UTF-8' } return false } /** * Create a full Content-Type header given a MIME type or extension. * * @param {string} str * @return {boolean|string} */ function contentType (str) { // TODO: should this even be in this module? if (!str || typeof str !== 'string') { return false } var mime = str.indexOf('/') === -1 ? exports.lookup(str) : str if (!mime) { return false } // TODO: use content-type or other module if (mime.indexOf('charset') === -1) { var charset = exports.charset(mime) if (charset) mime += '; charset=' + charset.toLowerCase() } return mime } /** * Get the default extension for a MIME type. * * @param {string} type * @return {boolean|string} */ function extension (type) { if (!type || typeof type !== 'string') { return false } // TODO: use media-typer var match = EXTRACT_TYPE_REGEXP.exec(type) // get extensions var exts = match && exports.extensions[match[1].toLowerCase()] if (!exts || !exts.length) { return false } return exts[0] } /** * Lookup the MIME type for a file path/extension. * * @param {string} path * @return {boolean|string} */ function lookup (path) { if (!path || typeof path !== 'string') { return false } // get the extension ("ext" or ".ext" or full path) var extension = extname('x.' + path) .toLowerCase() .substr(1) if (!extension) { return false } return exports.types[extension] || false } /** * Populate the extensions and types maps. * @private */ function populateMaps (extensions, types) { // source preference (least -> most) var preference = ['nginx', 'apache', undefined, 'iana'] Object.keys(db).forEach(function forEachMimeType (type) { var mime = db[type] var exts = mime.extensions if (!exts || !exts.length) { return } // mime -> extensions extensions[type] = exts // extension -> mime for (var i = 0; i < exts.length; i++) { var extension = exts[i] if (types[extension]) { var from = preference.indexOf(db[types[extension]].source) var to = preference.indexOf(mime.source) if (types[extension] !== 'application/octet-stream' && (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) { // skip the remapping continue } } // set the extension -> mime types[extension] = type } }) } /***/ }), /* 158 */ /***/ (function(module, exports, __webpack_require__) { /*! * mime-db * Copyright(c) 2014 Jonathan Ong * MIT Licensed */ /** * Module exports. */ module.exports = __webpack_require__(159) /***/ }), /* 159 */ /***/ (function(module) { module.exports = JSON.parse("{\"application/1d-interleaved-parityfec\":{\"source\":\"iana\"},\"application/3gpdash-qoe-report+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/3gpp-ims+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/a2l\":{\"source\":\"iana\"},\"application/activemessage\":{\"source\":\"iana\"},\"application/activity+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-costmap+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-costmapfilter+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-directory+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-endpointcost+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-endpointcostparams+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-endpointprop+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-endpointpropparams+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-error+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-networkmap+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-networkmapfilter+json\":{\"source\":\"iana\",\"compressible\":true},\"application/aml\":{\"source\":\"iana\"},\"application/andrew-inset\":{\"source\":\"iana\",\"extensions\":[\"ez\"]},\"application/applefile\":{\"source\":\"iana\"},\"application/applixware\":{\"source\":\"apache\",\"extensions\":[\"aw\"]},\"application/atf\":{\"source\":\"iana\"},\"application/atfx\":{\"source\":\"iana\"},\"application/atom+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"atom\"]},\"application/atomcat+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"atomcat\"]},\"application/atomdeleted+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/atomicmail\":{\"source\":\"iana\"},\"application/atomsvc+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"atomsvc\"]},\"application/atsc-dwd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/atsc-held+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/atsc-rsat+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/atxml\":{\"source\":\"iana\"},\"application/auth-policy+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/bacnet-xdd+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/batch-smtp\":{\"source\":\"iana\"},\"application/bdoc\":{\"compressible\":false,\"extensions\":[\"bdoc\"]},\"application/beep+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/calendar+json\":{\"source\":\"iana\",\"compressible\":true},\"application/calendar+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/call-completion\":{\"source\":\"iana\"},\"application/cals-1840\":{\"source\":\"iana\"},\"application/cbor\":{\"source\":\"iana\"},\"application/cccex\":{\"source\":\"iana\"},\"application/ccmp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/ccxml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ccxml\"]},\"application/cdfx+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cdmi-capability\":{\"source\":\"iana\",\"extensions\":[\"cdmia\"]},\"application/cdmi-container\":{\"source\":\"iana\",\"extensions\":[\"cdmic\"]},\"application/cdmi-domain\":{\"source\":\"iana\",\"extensions\":[\"cdmid\"]},\"application/cdmi-object\":{\"source\":\"iana\",\"extensions\":[\"cdmio\"]},\"application/cdmi-queue\":{\"source\":\"iana\",\"extensions\":[\"cdmiq\"]},\"application/cdni\":{\"source\":\"iana\"},\"application/cea\":{\"source\":\"iana\"},\"application/cea-2018+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cellml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cfw\":{\"source\":\"iana\"},\"application/clue_info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cms\":{\"source\":\"iana\"},\"application/cnrp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/coap-group+json\":{\"source\":\"iana\",\"compressible\":true},\"application/coap-payload\":{\"source\":\"iana\"},\"application/commonground\":{\"source\":\"iana\"},\"application/conference-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cose\":{\"source\":\"iana\"},\"application/cose-key\":{\"source\":\"iana\"},\"application/cose-key-set\":{\"source\":\"iana\"},\"application/cpl+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/csrattrs\":{\"source\":\"iana\"},\"application/csta+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cstadata+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/csvm+json\":{\"source\":\"iana\",\"compressible\":true},\"application/cu-seeme\":{\"source\":\"apache\",\"extensions\":[\"cu\"]},\"application/cwt\":{\"source\":\"iana\"},\"application/cybercash\":{\"source\":\"iana\"},\"application/dart\":{\"compressible\":true},\"application/dash+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mpd\"]},\"application/dashdelta\":{\"source\":\"iana\"},\"application/davmount+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"davmount\"]},\"application/dca-rft\":{\"source\":\"iana\"},\"application/dcd\":{\"source\":\"iana\"},\"application/dec-dx\":{\"source\":\"iana\"},\"application/dialog-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/dicom\":{\"source\":\"iana\"},\"application/dicom+json\":{\"source\":\"iana\",\"compressible\":true},\"application/dicom+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/dii\":{\"source\":\"iana\"},\"application/dit\":{\"source\":\"iana\"},\"application/dns\":{\"source\":\"iana\"},\"application/dns+json\":{\"source\":\"iana\",\"compressible\":true},\"application/dns-message\":{\"source\":\"iana\"},\"application/docbook+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"dbk\"]},\"application/dskpp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/dssc+der\":{\"source\":\"iana\",\"extensions\":[\"dssc\"]},\"application/dssc+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xdssc\"]},\"application/dvcs\":{\"source\":\"iana\"},\"application/ecmascript\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ecma\",\"es\"]},\"application/edi-consent\":{\"source\":\"iana\"},\"application/edi-x12\":{\"source\":\"iana\",\"compressible\":false},\"application/edifact\":{\"source\":\"iana\",\"compressible\":false},\"application/efi\":{\"source\":\"iana\"},\"application/emergencycalldata.comment+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.control+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.deviceinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.ecall.msd\":{\"source\":\"iana\"},\"application/emergencycalldata.providerinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.serviceinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.subscriberinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.veds+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emma+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"emma\"]},\"application/emotionml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/encaprtp\":{\"source\":\"iana\"},\"application/epp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/epub+zip\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"epub\"]},\"application/eshop\":{\"source\":\"iana\"},\"application/exi\":{\"source\":\"iana\",\"extensions\":[\"exi\"]},\"application/expect-ct-report+json\":{\"source\":\"iana\",\"compressible\":true},\"application/fastinfoset\":{\"source\":\"iana\"},\"application/fastsoap\":{\"source\":\"iana\"},\"application/fdt+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/fhir+json\":{\"source\":\"iana\",\"compressible\":true},\"application/fhir+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/fido.trusted-apps+json\":{\"compressible\":true},\"application/fits\":{\"source\":\"iana\"},\"application/font-sfnt\":{\"source\":\"iana\"},\"application/font-tdpfr\":{\"source\":\"iana\",\"extensions\":[\"pfr\"]},\"application/font-woff\":{\"source\":\"iana\",\"compressible\":false},\"application/framework-attributes+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/geo+json\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"geojson\"]},\"application/geo+json-seq\":{\"source\":\"iana\"},\"application/geopackage+sqlite3\":{\"source\":\"iana\"},\"application/geoxacml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/gltf-buffer\":{\"source\":\"iana\"},\"application/gml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"gml\"]},\"application/gpx+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"gpx\"]},\"application/gxf\":{\"source\":\"apache\",\"extensions\":[\"gxf\"]},\"application/gzip\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"gz\"]},\"application/h224\":{\"source\":\"iana\"},\"application/held+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/hjson\":{\"extensions\":[\"hjson\"]},\"application/http\":{\"source\":\"iana\"},\"application/hyperstudio\":{\"source\":\"iana\",\"extensions\":[\"stk\"]},\"application/ibe-key-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/ibe-pkg-reply+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/ibe-pp-data\":{\"source\":\"iana\"},\"application/iges\":{\"source\":\"iana\"},\"application/im-iscomposing+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/index\":{\"source\":\"iana\"},\"application/index.cmd\":{\"source\":\"iana\"},\"application/index.obj\":{\"source\":\"iana\"},\"application/index.response\":{\"source\":\"iana\"},\"application/index.vnd\":{\"source\":\"iana\"},\"application/inkml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ink\",\"inkml\"]},\"application/iotp\":{\"source\":\"iana\"},\"application/ipfix\":{\"source\":\"iana\",\"extensions\":[\"ipfix\"]},\"application/ipp\":{\"source\":\"iana\"},\"application/isup\":{\"source\":\"iana\"},\"application/its+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/java-archive\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"jar\",\"war\",\"ear\"]},\"application/java-serialized-object\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"ser\"]},\"application/java-vm\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"class\"]},\"application/javascript\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"js\",\"mjs\"]},\"application/jf2feed+json\":{\"source\":\"iana\",\"compressible\":true},\"application/jose\":{\"source\":\"iana\"},\"application/jose+json\":{\"source\":\"iana\",\"compressible\":true},\"application/jrd+json\":{\"source\":\"iana\",\"compressible\":true},\"application/json\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"json\",\"map\"]},\"application/json-patch+json\":{\"source\":\"iana\",\"compressible\":true},\"application/json-seq\":{\"source\":\"iana\"},\"application/json5\":{\"extensions\":[\"json5\"]},\"application/jsonml+json\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"jsonml\"]},\"application/jwk+json\":{\"source\":\"iana\",\"compressible\":true},\"application/jwk-set+json\":{\"source\":\"iana\",\"compressible\":true},\"application/jwt\":{\"source\":\"iana\"},\"application/kpml-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/kpml-response+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/ld+json\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"jsonld\"]},\"application/lgr+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/link-format\":{\"source\":\"iana\"},\"application/load-control+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/lost+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"lostxml\"]},\"application/lostsync+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/lxf\":{\"source\":\"iana\"},\"application/mac-binhex40\":{\"source\":\"iana\",\"extensions\":[\"hqx\"]},\"application/mac-compactpro\":{\"source\":\"apache\",\"extensions\":[\"cpt\"]},\"application/macwriteii\":{\"source\":\"iana\"},\"application/mads+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mads\"]},\"application/manifest+json\":{\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"webmanifest\"]},\"application/marc\":{\"source\":\"iana\",\"extensions\":[\"mrc\"]},\"application/marcxml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mrcx\"]},\"application/mathematica\":{\"source\":\"iana\",\"extensions\":[\"ma\",\"nb\",\"mb\"]},\"application/mathml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mathml\"]},\"application/mathml-content+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mathml-presentation+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-associated-procedure-description+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-deregister+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-envelope+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-msk+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-msk-response+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-protection-description+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-reception-report+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-register+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-register-response+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-schedule+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-user-service-description+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbox\":{\"source\":\"iana\",\"extensions\":[\"mbox\"]},\"application/media-policy-dataset+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/media_control+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mediaservercontrol+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mscml\"]},\"application/merge-patch+json\":{\"source\":\"iana\",\"compressible\":true},\"application/metalink+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"metalink\"]},\"application/metalink4+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"meta4\"]},\"application/mets+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mets\"]},\"application/mf4\":{\"source\":\"iana\"},\"application/mikey\":{\"source\":\"iana\"},\"application/mmt-aei+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mmt-usd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mods+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mods\"]},\"application/moss-keys\":{\"source\":\"iana\"},\"application/moss-signature\":{\"source\":\"iana\"},\"application/mosskey-data\":{\"source\":\"iana\"},\"application/mosskey-request\":{\"source\":\"iana\"},\"application/mp21\":{\"source\":\"iana\",\"extensions\":[\"m21\",\"mp21\"]},\"application/mp4\":{\"source\":\"iana\",\"extensions\":[\"mp4s\",\"m4p\"]},\"application/mpeg4-generic\":{\"source\":\"iana\"},\"application/mpeg4-iod\":{\"source\":\"iana\"},\"application/mpeg4-iod-xmt\":{\"source\":\"iana\"},\"application/mrb-consumer+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mrb-publish+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/msc-ivr+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/msc-mixer+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/msword\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"doc\",\"dot\"]},\"application/mud+json\":{\"source\":\"iana\",\"compressible\":true},\"application/mxf\":{\"source\":\"iana\",\"extensions\":[\"mxf\"]},\"application/n-quads\":{\"source\":\"iana\",\"extensions\":[\"nq\"]},\"application/n-triples\":{\"source\":\"iana\",\"extensions\":[\"nt\"]},\"application/nasdata\":{\"source\":\"iana\"},\"application/news-checkgroups\":{\"source\":\"iana\"},\"application/news-groupinfo\":{\"source\":\"iana\"},\"application/news-transmission\":{\"source\":\"iana\"},\"application/nlsml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/node\":{\"source\":\"iana\"},\"application/nss\":{\"source\":\"iana\"},\"application/ocsp-request\":{\"source\":\"iana\"},\"application/ocsp-response\":{\"source\":\"iana\"},\"application/octet-stream\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"bin\",\"dms\",\"lrf\",\"mar\",\"so\",\"dist\",\"distz\",\"pkg\",\"bpk\",\"dump\",\"elc\",\"deploy\",\"exe\",\"dll\",\"deb\",\"dmg\",\"iso\",\"img\",\"msi\",\"msp\",\"msm\",\"buffer\"]},\"application/oda\":{\"source\":\"iana\",\"extensions\":[\"oda\"]},\"application/odm+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/odx\":{\"source\":\"iana\"},\"application/oebps-package+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"opf\"]},\"application/ogg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"ogx\"]},\"application/omdoc+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"omdoc\"]},\"application/onenote\":{\"source\":\"apache\",\"extensions\":[\"onetoc\",\"onetoc2\",\"onetmp\",\"onepkg\"]},\"application/oscore\":{\"source\":\"iana\"},\"application/oxps\":{\"source\":\"iana\",\"extensions\":[\"oxps\"]},\"application/p2p-overlay+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/parityfec\":{\"source\":\"iana\"},\"application/passport\":{\"source\":\"iana\"},\"application/patch-ops-error+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xer\"]},\"application/pdf\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"pdf\"]},\"application/pdx\":{\"source\":\"iana\"},\"application/pem-certificate-chain\":{\"source\":\"iana\"},\"application/pgp-encrypted\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"pgp\"]},\"application/pgp-keys\":{\"source\":\"iana\"},\"application/pgp-signature\":{\"source\":\"iana\",\"extensions\":[\"asc\",\"sig\"]},\"application/pics-rules\":{\"source\":\"apache\",\"extensions\":[\"prf\"]},\"application/pidf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/pidf-diff+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/pkcs10\":{\"source\":\"iana\",\"extensions\":[\"p10\"]},\"application/pkcs12\":{\"source\":\"iana\"},\"application/pkcs7-mime\":{\"source\":\"iana\",\"extensions\":[\"p7m\",\"p7c\"]},\"application/pkcs7-signature\":{\"source\":\"iana\",\"extensions\":[\"p7s\"]},\"application/pkcs8\":{\"source\":\"iana\",\"extensions\":[\"p8\"]},\"application/pkcs8-encrypted\":{\"source\":\"iana\"},\"application/pkix-attr-cert\":{\"source\":\"iana\",\"extensions\":[\"ac\"]},\"application/pkix-cert\":{\"source\":\"iana\",\"extensions\":[\"cer\"]},\"application/pkix-crl\":{\"source\":\"iana\",\"extensions\":[\"crl\"]},\"application/pkix-pkipath\":{\"source\":\"iana\",\"extensions\":[\"pkipath\"]},\"application/pkixcmp\":{\"source\":\"iana\",\"extensions\":[\"pki\"]},\"application/pls+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"pls\"]},\"application/poc-settings+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/postscript\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ai\",\"eps\",\"ps\"]},\"application/ppsp-tracker+json\":{\"source\":\"iana\",\"compressible\":true},\"application/problem+json\":{\"source\":\"iana\",\"compressible\":true},\"application/problem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/provenance+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/prs.alvestrand.titrax-sheet\":{\"source\":\"iana\"},\"application/prs.cww\":{\"source\":\"iana\",\"extensions\":[\"cww\"]},\"application/prs.hpub+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/prs.nprend\":{\"source\":\"iana\"},\"application/prs.plucker\":{\"source\":\"iana\"},\"application/prs.rdf-xml-crypt\":{\"source\":\"iana\"},\"application/prs.xsf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/pskc+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"pskcxml\"]},\"application/qsig\":{\"source\":\"iana\"},\"application/raml+yaml\":{\"compressible\":true,\"extensions\":[\"raml\"]},\"application/raptorfec\":{\"source\":\"iana\"},\"application/rdap+json\":{\"source\":\"iana\",\"compressible\":true},\"application/rdf+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rdf\",\"owl\"]},\"application/reginfo+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rif\"]},\"application/relax-ng-compact-syntax\":{\"source\":\"iana\",\"extensions\":[\"rnc\"]},\"application/remote-printing\":{\"source\":\"iana\"},\"application/reputon+json\":{\"source\":\"iana\",\"compressible\":true},\"application/resource-lists+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rl\"]},\"application/resource-lists-diff+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rld\"]},\"application/rfc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/riscos\":{\"source\":\"iana\"},\"application/rlmi+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/rls-services+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rs\"]},\"application/route-apd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/route-s-tsid+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/route-usd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/rpki-ghostbusters\":{\"source\":\"iana\",\"extensions\":[\"gbr\"]},\"application/rpki-manifest\":{\"source\":\"iana\",\"extensions\":[\"mft\"]},\"application/rpki-publication\":{\"source\":\"iana\"},\"application/rpki-roa\":{\"source\":\"iana\",\"extensions\":[\"roa\"]},\"application/rpki-updown\":{\"source\":\"iana\"},\"application/rsd+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"rsd\"]},\"application/rss+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"rss\"]},\"application/rtf\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rtf\"]},\"application/rtploopback\":{\"source\":\"iana\"},\"application/rtx\":{\"source\":\"iana\"},\"application/samlassertion+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/samlmetadata+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/sbml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"sbml\"]},\"application/scaip+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/scim+json\":{\"source\":\"iana\",\"compressible\":true},\"application/scvp-cv-request\":{\"source\":\"iana\",\"extensions\":[\"scq\"]},\"application/scvp-cv-response\":{\"source\":\"iana\",\"extensions\":[\"scs\"]},\"application/scvp-vp-request\":{\"source\":\"iana\",\"extensions\":[\"spq\"]},\"application/scvp-vp-response\":{\"source\":\"iana\",\"extensions\":[\"spp\"]},\"application/sdp\":{\"source\":\"iana\",\"extensions\":[\"sdp\"]},\"application/secevent+jwt\":{\"source\":\"iana\"},\"application/senml+cbor\":{\"source\":\"iana\"},\"application/senml+json\":{\"source\":\"iana\",\"compressible\":true},\"application/senml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/senml-exi\":{\"source\":\"iana\"},\"application/sensml+cbor\":{\"source\":\"iana\"},\"application/sensml+json\":{\"source\":\"iana\",\"compressible\":true},\"application/sensml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/sensml-exi\":{\"source\":\"iana\"},\"application/sep+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/sep-exi\":{\"source\":\"iana\"},\"application/session-info\":{\"source\":\"iana\"},\"application/set-payment\":{\"source\":\"iana\"},\"application/set-payment-initiation\":{\"source\":\"iana\",\"extensions\":[\"setpay\"]},\"application/set-registration\":{\"source\":\"iana\"},\"application/set-registration-initiation\":{\"source\":\"iana\",\"extensions\":[\"setreg\"]},\"application/sgml\":{\"source\":\"iana\"},\"application/sgml-open-catalog\":{\"source\":\"iana\"},\"application/shf+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"shf\"]},\"application/sieve\":{\"source\":\"iana\",\"extensions\":[\"siv\",\"sieve\"]},\"application/simple-filter+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/simple-message-summary\":{\"source\":\"iana\"},\"application/simplesymbolcontainer\":{\"source\":\"iana\"},\"application/slate\":{\"source\":\"iana\"},\"application/smil\":{\"source\":\"iana\"},\"application/smil+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"smi\",\"smil\"]},\"application/smpte336m\":{\"source\":\"iana\"},\"application/soap+fastinfoset\":{\"source\":\"iana\"},\"application/soap+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/sparql-query\":{\"source\":\"iana\",\"extensions\":[\"rq\"]},\"application/sparql-results+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"srx\"]},\"application/spirits-event+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/sql\":{\"source\":\"iana\"},\"application/srgs\":{\"source\":\"iana\",\"extensions\":[\"gram\"]},\"application/srgs+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"grxml\"]},\"application/sru+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"sru\"]},\"application/ssdl+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"ssdl\"]},\"application/ssml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ssml\"]},\"application/stix+json\":{\"source\":\"iana\",\"compressible\":true},\"application/tamp-apex-update\":{\"source\":\"iana\"},\"application/tamp-apex-update-confirm\":{\"source\":\"iana\"},\"application/tamp-community-update\":{\"source\":\"iana\"},\"application/tamp-community-update-confirm\":{\"source\":\"iana\"},\"application/tamp-error\":{\"source\":\"iana\"},\"application/tamp-sequence-adjust\":{\"source\":\"iana\"},\"application/tamp-sequence-adjust-confirm\":{\"source\":\"iana\"},\"application/tamp-status-query\":{\"source\":\"iana\"},\"application/tamp-status-response\":{\"source\":\"iana\"},\"application/tamp-update\":{\"source\":\"iana\"},\"application/tamp-update-confirm\":{\"source\":\"iana\"},\"application/tar\":{\"compressible\":true},\"application/taxii+json\":{\"source\":\"iana\",\"compressible\":true},\"application/tei+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"tei\",\"teicorpus\"]},\"application/tetra_isi\":{\"source\":\"iana\"},\"application/thraud+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"tfi\"]},\"application/timestamp-query\":{\"source\":\"iana\"},\"application/timestamp-reply\":{\"source\":\"iana\"},\"application/timestamped-data\":{\"source\":\"iana\",\"extensions\":[\"tsd\"]},\"application/tlsrpt+gzip\":{\"source\":\"iana\"},\"application/tlsrpt+json\":{\"source\":\"iana\",\"compressible\":true},\"application/tnauthlist\":{\"source\":\"iana\"},\"application/trickle-ice-sdpfrag\":{\"source\":\"iana\"},\"application/trig\":{\"source\":\"iana\"},\"application/ttml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/tve-trigger\":{\"source\":\"iana\"},\"application/tzif\":{\"source\":\"iana\"},\"application/tzif-leap\":{\"source\":\"iana\"},\"application/ulpfec\":{\"source\":\"iana\"},\"application/urc-grpsheet+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/urc-ressheet+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/urc-targetdesc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/urc-uisocketdesc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vcard+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vcard+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vemmi\":{\"source\":\"iana\"},\"application/vividence.scriptfile\":{\"source\":\"apache\"},\"application/vnd.1000minds.decision-model+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp-prose+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp-prose-pc3ch+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp-v2x-local-service-information\":{\"source\":\"iana\"},\"application/vnd.3gpp.access-transfer-events+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.bsf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.gmop+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mc-signalling-ear\":{\"source\":\"iana\"},\"application/vnd.3gpp.mcdata-affiliation-command+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcdata-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcdata-payload\":{\"source\":\"iana\"},\"application/vnd.3gpp.mcdata-service-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcdata-signalling\":{\"source\":\"iana\"},\"application/vnd.3gpp.mcdata-ue-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcdata-user-profile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-affiliation-command+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-floor-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-location-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-mbms-usage-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-service-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-signed+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-ue-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-ue-init-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-user-profile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-affiliation-command+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-affiliation-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-location-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-mbms-usage-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-service-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-transmission-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-ue-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-user-profile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mid-call+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.pic-bw-large\":{\"source\":\"iana\",\"extensions\":[\"plb\"]},\"application/vnd.3gpp.pic-bw-small\":{\"source\":\"iana\",\"extensions\":[\"psb\"]},\"application/vnd.3gpp.pic-bw-var\":{\"source\":\"iana\",\"extensions\":[\"pvb\"]},\"application/vnd.3gpp.sms\":{\"source\":\"iana\"},\"application/vnd.3gpp.sms+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.srvcc-ext+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.srvcc-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.state-and-event-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.ussd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp2.bcmcsinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp2.sms\":{\"source\":\"iana\"},\"application/vnd.3gpp2.tcap\":{\"source\":\"iana\",\"extensions\":[\"tcap\"]},\"application/vnd.3lightssoftware.imagescal\":{\"source\":\"iana\"},\"application/vnd.3m.post-it-notes\":{\"source\":\"iana\",\"extensions\":[\"pwn\"]},\"application/vnd.accpac.simply.aso\":{\"source\":\"iana\",\"extensions\":[\"aso\"]},\"application/vnd.accpac.simply.imp\":{\"source\":\"iana\",\"extensions\":[\"imp\"]},\"application/vnd.acucobol\":{\"source\":\"iana\",\"extensions\":[\"acu\"]},\"application/vnd.acucorp\":{\"source\":\"iana\",\"extensions\":[\"atc\",\"acutc\"]},\"application/vnd.adobe.air-application-installer-package+zip\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"air\"]},\"application/vnd.adobe.flash.movie\":{\"source\":\"iana\"},\"application/vnd.adobe.formscentral.fcdt\":{\"source\":\"iana\",\"extensions\":[\"fcdt\"]},\"application/vnd.adobe.fxp\":{\"source\":\"iana\",\"extensions\":[\"fxp\",\"fxpl\"]},\"application/vnd.adobe.partial-upload\":{\"source\":\"iana\"},\"application/vnd.adobe.xdp+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xdp\"]},\"application/vnd.adobe.xfdf\":{\"source\":\"iana\",\"extensions\":[\"xfdf\"]},\"application/vnd.aether.imp\":{\"source\":\"iana\"},\"application/vnd.afpc.afplinedata\":{\"source\":\"iana\"},\"application/vnd.afpc.modca\":{\"source\":\"iana\"},\"application/vnd.ah-barcode\":{\"source\":\"iana\"},\"application/vnd.ahead.space\":{\"source\":\"iana\",\"extensions\":[\"ahead\"]},\"application/vnd.airzip.filesecure.azf\":{\"source\":\"iana\",\"extensions\":[\"azf\"]},\"application/vnd.airzip.filesecure.azs\":{\"source\":\"iana\",\"extensions\":[\"azs\"]},\"application/vnd.amadeus+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.amazon.ebook\":{\"source\":\"apache\",\"extensions\":[\"azw\"]},\"application/vnd.amazon.mobi8-ebook\":{\"source\":\"iana\"},\"application/vnd.americandynamics.acc\":{\"source\":\"iana\",\"extensions\":[\"acc\"]},\"application/vnd.amiga.ami\":{\"source\":\"iana\",\"extensions\":[\"ami\"]},\"application/vnd.amundsen.maze+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.android.package-archive\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"apk\"]},\"application/vnd.anki\":{\"source\":\"iana\"},\"application/vnd.anser-web-certificate-issue-initiation\":{\"source\":\"iana\",\"extensions\":[\"cii\"]},\"application/vnd.anser-web-funds-transfer-initiation\":{\"source\":\"apache\",\"extensions\":[\"fti\"]},\"application/vnd.antix.game-component\":{\"source\":\"iana\",\"extensions\":[\"atx\"]},\"application/vnd.apache.thrift.binary\":{\"source\":\"iana\"},\"application/vnd.apache.thrift.compact\":{\"source\":\"iana\"},\"application/vnd.apache.thrift.json\":{\"source\":\"iana\"},\"application/vnd.api+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.apothekende.reservation+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.apple.installer+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mpkg\"]},\"application/vnd.apple.keynote\":{\"source\":\"iana\",\"extensions\":[\"keynote\"]},\"application/vnd.apple.mpegurl\":{\"source\":\"iana\",\"extensions\":[\"m3u8\"]},\"application/vnd.apple.numbers\":{\"source\":\"iana\",\"extensions\":[\"numbers\"]},\"application/vnd.apple.pages\":{\"source\":\"iana\",\"extensions\":[\"pages\"]},\"application/vnd.apple.pkpass\":{\"compressible\":false,\"extensions\":[\"pkpass\"]},\"application/vnd.arastra.swi\":{\"source\":\"iana\"},\"application/vnd.aristanetworks.swi\":{\"source\":\"iana\",\"extensions\":[\"swi\"]},\"application/vnd.artisan+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.artsquare\":{\"source\":\"iana\"},\"application/vnd.astraea-software.iota\":{\"source\":\"iana\",\"extensions\":[\"iota\"]},\"application/vnd.audiograph\":{\"source\":\"iana\",\"extensions\":[\"aep\"]},\"application/vnd.autopackage\":{\"source\":\"iana\"},\"application/vnd.avalon+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.avistar+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.balsamiq.bmml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.balsamiq.bmpr\":{\"source\":\"iana\"},\"application/vnd.banana-accounting\":{\"source\":\"iana\"},\"application/vnd.bbf.usp.msg\":{\"source\":\"iana\"},\"application/vnd.bbf.usp.msg+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.bekitzur-stech+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.bint.med-content\":{\"source\":\"iana\"},\"application/vnd.biopax.rdf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.blink-idb-value-wrapper\":{\"source\":\"iana\"},\"application/vnd.blueice.multipass\":{\"source\":\"iana\",\"extensions\":[\"mpm\"]},\"application/vnd.bluetooth.ep.oob\":{\"source\":\"iana\"},\"application/vnd.bluetooth.le.oob\":{\"source\":\"iana\"},\"application/vnd.bmi\":{\"source\":\"iana\",\"extensions\":[\"bmi\"]},\"application/vnd.businessobjects\":{\"source\":\"iana\",\"extensions\":[\"rep\"]},\"application/vnd.byu.uapi+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.cab-jscript\":{\"source\":\"iana\"},\"application/vnd.canon-cpdl\":{\"source\":\"iana\"},\"application/vnd.canon-lips\":{\"source\":\"iana\"},\"application/vnd.capasystems-pg+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.cendio.thinlinc.clientconf\":{\"source\":\"iana\"},\"application/vnd.century-systems.tcp_stream\":{\"source\":\"iana\"},\"application/vnd.chemdraw+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"cdxml\"]},\"application/vnd.chess-pgn\":{\"source\":\"iana\"},\"application/vnd.chipnuts.karaoke-mmd\":{\"source\":\"iana\",\"extensions\":[\"mmd\"]},\"application/vnd.cinderella\":{\"source\":\"iana\",\"extensions\":[\"cdy\"]},\"application/vnd.cirpack.isdn-ext\":{\"source\":\"iana\"},\"application/vnd.citationstyles.style+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"csl\"]},\"application/vnd.claymore\":{\"source\":\"iana\",\"extensions\":[\"cla\"]},\"application/vnd.cloanto.rp9\":{\"source\":\"iana\",\"extensions\":[\"rp9\"]},\"application/vnd.clonk.c4group\":{\"source\":\"iana\",\"extensions\":[\"c4g\",\"c4d\",\"c4f\",\"c4p\",\"c4u\"]},\"application/vnd.cluetrust.cartomobile-config\":{\"source\":\"iana\",\"extensions\":[\"c11amc\"]},\"application/vnd.cluetrust.cartomobile-config-pkg\":{\"source\":\"iana\",\"extensions\":[\"c11amz\"]},\"application/vnd.coffeescript\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.document\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.document-template\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.presentation\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.presentation-template\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.spreadsheet\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.spreadsheet-template\":{\"source\":\"iana\"},\"application/vnd.collection+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.collection.doc+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.collection.next+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.comicbook+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.comicbook-rar\":{\"source\":\"iana\"},\"application/vnd.commerce-battelle\":{\"source\":\"iana\"},\"application/vnd.commonspace\":{\"source\":\"iana\",\"extensions\":[\"csp\"]},\"application/vnd.contact.cmsg\":{\"source\":\"iana\",\"extensions\":[\"cdbcmsg\"]},\"application/vnd.coreos.ignition+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.cosmocaller\":{\"source\":\"iana\",\"extensions\":[\"cmc\"]},\"application/vnd.crick.clicker\":{\"source\":\"iana\",\"extensions\":[\"clkx\"]},\"application/vnd.crick.clicker.keyboard\":{\"source\":\"iana\",\"extensions\":[\"clkk\"]},\"application/vnd.crick.clicker.palette\":{\"source\":\"iana\",\"extensions\":[\"clkp\"]},\"application/vnd.crick.clicker.template\":{\"source\":\"iana\",\"extensions\":[\"clkt\"]},\"application/vnd.crick.clicker.wordbank\":{\"source\":\"iana\",\"extensions\":[\"clkw\"]},\"application/vnd.criticaltools.wbs+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"wbs\"]},\"application/vnd.ctc-posml\":{\"source\":\"iana\",\"extensions\":[\"pml\"]},\"application/vnd.ctct.ws+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.cups-pdf\":{\"source\":\"iana\"},\"application/vnd.cups-postscript\":{\"source\":\"iana\"},\"application/vnd.cups-ppd\":{\"source\":\"iana\",\"extensions\":[\"ppd\"]},\"application/vnd.cups-raster\":{\"source\":\"iana\"},\"application/vnd.cups-raw\":{\"source\":\"iana\"},\"application/vnd.curl\":{\"source\":\"iana\"},\"application/vnd.curl.car\":{\"source\":\"apache\",\"extensions\":[\"car\"]},\"application/vnd.curl.pcurl\":{\"source\":\"apache\",\"extensions\":[\"pcurl\"]},\"application/vnd.cyan.dean.root+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.cybank\":{\"source\":\"iana\"},\"application/vnd.d2l.coursepackage1p0+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.dart\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"dart\"]},\"application/vnd.data-vision.rdz\":{\"source\":\"iana\",\"extensions\":[\"rdz\"]},\"application/vnd.datapackage+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dataresource+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.debian.binary-package\":{\"source\":\"iana\"},\"application/vnd.dece.data\":{\"source\":\"iana\",\"extensions\":[\"uvf\",\"uvvf\",\"uvd\",\"uvvd\"]},\"application/vnd.dece.ttml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"uvt\",\"uvvt\"]},\"application/vnd.dece.unspecified\":{\"source\":\"iana\",\"extensions\":[\"uvx\",\"uvvx\"]},\"application/vnd.dece.zip\":{\"source\":\"iana\",\"extensions\":[\"uvz\",\"uvvz\"]},\"application/vnd.denovo.fcselayout-link\":{\"source\":\"iana\",\"extensions\":[\"fe_launch\"]},\"application/vnd.desmume.movie\":{\"source\":\"iana\"},\"application/vnd.dir-bi.plate-dl-nosuffix\":{\"source\":\"iana\"},\"application/vnd.dm.delegation+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dna\":{\"source\":\"iana\",\"extensions\":[\"dna\"]},\"application/vnd.document+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dolby.mlp\":{\"source\":\"apache\",\"extensions\":[\"mlp\"]},\"application/vnd.dolby.mobile.1\":{\"source\":\"iana\"},\"application/vnd.dolby.mobile.2\":{\"source\":\"iana\"},\"application/vnd.doremir.scorecloud-binary-document\":{\"source\":\"iana\"},\"application/vnd.dpgraph\":{\"source\":\"iana\",\"extensions\":[\"dpg\"]},\"application/vnd.dreamfactory\":{\"source\":\"iana\",\"extensions\":[\"dfac\"]},\"application/vnd.drive+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ds-keypoint\":{\"source\":\"apache\",\"extensions\":[\"kpxx\"]},\"application/vnd.dtg.local\":{\"source\":\"iana\"},\"application/vnd.dtg.local.flash\":{\"source\":\"iana\"},\"application/vnd.dtg.local.html\":{\"source\":\"iana\"},\"application/vnd.dvb.ait\":{\"source\":\"iana\",\"extensions\":[\"ait\"]},\"application/vnd.dvb.dvbj\":{\"source\":\"iana\"},\"application/vnd.dvb.esgcontainer\":{\"source\":\"iana\"},\"application/vnd.dvb.ipdcdftnotifaccess\":{\"source\":\"iana\"},\"application/vnd.dvb.ipdcesgaccess\":{\"source\":\"iana\"},\"application/vnd.dvb.ipdcesgaccess2\":{\"source\":\"iana\"},\"application/vnd.dvb.ipdcesgpdd\":{\"source\":\"iana\"},\"application/vnd.dvb.ipdcroaming\":{\"source\":\"iana\"},\"application/vnd.dvb.iptv.alfec-base\":{\"source\":\"iana\"},\"application/vnd.dvb.iptv.alfec-enhancement\":{\"source\":\"iana\"},\"application/vnd.dvb.notif-aggregate-root+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-container+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-generic+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-ia-msglist+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-ia-registration-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-ia-registration-response+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-init+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.pfr\":{\"source\":\"iana\"},\"application/vnd.dvb.service\":{\"source\":\"iana\",\"extensions\":[\"svc\"]},\"application/vnd.dxr\":{\"source\":\"iana\"},\"application/vnd.dynageo\":{\"source\":\"iana\",\"extensions\":[\"geo\"]},\"application/vnd.dzr\":{\"source\":\"iana\"},\"application/vnd.easykaraoke.cdgdownload\":{\"source\":\"iana\"},\"application/vnd.ecdis-update\":{\"source\":\"iana\"},\"application/vnd.ecip.rlp\":{\"source\":\"iana\"},\"application/vnd.ecowin.chart\":{\"source\":\"iana\",\"extensions\":[\"mag\"]},\"application/vnd.ecowin.filerequest\":{\"source\":\"iana\"},\"application/vnd.ecowin.fileupdate\":{\"source\":\"iana\"},\"application/vnd.ecowin.series\":{\"source\":\"iana\"},\"application/vnd.ecowin.seriesrequest\":{\"source\":\"iana\"},\"application/vnd.ecowin.seriesupdate\":{\"source\":\"iana\"},\"application/vnd.efi.img\":{\"source\":\"iana\"},\"application/vnd.efi.iso\":{\"source\":\"iana\"},\"application/vnd.emclient.accessrequest+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.enliven\":{\"source\":\"iana\",\"extensions\":[\"nml\"]},\"application/vnd.enphase.envoy\":{\"source\":\"iana\"},\"application/vnd.eprints.data+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.epson.esf\":{\"source\":\"iana\",\"extensions\":[\"esf\"]},\"application/vnd.epson.msf\":{\"source\":\"iana\",\"extensions\":[\"msf\"]},\"application/vnd.epson.quickanime\":{\"source\":\"iana\",\"extensions\":[\"qam\"]},\"application/vnd.epson.salt\":{\"source\":\"iana\",\"extensions\":[\"slt\"]},\"application/vnd.epson.ssf\":{\"source\":\"iana\",\"extensions\":[\"ssf\"]},\"application/vnd.ericsson.quickcall\":{\"source\":\"iana\"},\"application/vnd.espass-espass+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.eszigno3+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"es3\",\"et3\"]},\"application/vnd.etsi.aoc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.asic-e+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.etsi.asic-s+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.etsi.cug+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvcommand+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvdiscovery+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvprofile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvsad-bc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvsad-cod+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvsad-npvr+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvservice+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvsync+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvueprofile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.mcid+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.mheg5\":{\"source\":\"iana\"},\"application/vnd.etsi.overload-control-policy-dataset+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.pstn+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.sci+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.simservs+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.timestamp-token\":{\"source\":\"iana\"},\"application/vnd.etsi.tsl+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.tsl.der\":{\"source\":\"iana\"},\"application/vnd.eudora.data\":{\"source\":\"iana\"},\"application/vnd.evolv.ecig.profile\":{\"source\":\"iana\"},\"application/vnd.evolv.ecig.settings\":{\"source\":\"iana\"},\"application/vnd.evolv.ecig.theme\":{\"source\":\"iana\"},\"application/vnd.exstream-empower+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.exstream-package\":{\"source\":\"iana\"},\"application/vnd.ezpix-album\":{\"source\":\"iana\",\"extensions\":[\"ez2\"]},\"application/vnd.ezpix-package\":{\"source\":\"iana\",\"extensions\":[\"ez3\"]},\"application/vnd.f-secure.mobile\":{\"source\":\"iana\"},\"application/vnd.fastcopy-disk-image\":{\"source\":\"iana\"},\"application/vnd.fdf\":{\"source\":\"iana\",\"extensions\":[\"fdf\"]},\"application/vnd.fdsn.mseed\":{\"source\":\"iana\",\"extensions\":[\"mseed\"]},\"application/vnd.fdsn.seed\":{\"source\":\"iana\",\"extensions\":[\"seed\",\"dataless\"]},\"application/vnd.ffsns\":{\"source\":\"iana\"},\"application/vnd.filmit.zfc\":{\"source\":\"iana\"},\"application/vnd.fints\":{\"source\":\"iana\"},\"application/vnd.firemonkeys.cloudcell\":{\"source\":\"iana\"},\"application/vnd.flographit\":{\"source\":\"iana\",\"extensions\":[\"gph\"]},\"application/vnd.fluxtime.clip\":{\"source\":\"iana\",\"extensions\":[\"ftc\"]},\"application/vnd.font-fontforge-sfd\":{\"source\":\"iana\"},\"application/vnd.framemaker\":{\"source\":\"iana\",\"extensions\":[\"fm\",\"frame\",\"maker\",\"book\"]},\"application/vnd.frogans.fnc\":{\"source\":\"iana\",\"extensions\":[\"fnc\"]},\"application/vnd.frogans.ltf\":{\"source\":\"iana\",\"extensions\":[\"ltf\"]},\"application/vnd.fsc.weblaunch\":{\"source\":\"iana\",\"extensions\":[\"fsc\"]},\"application/vnd.fujitsu.oasys\":{\"source\":\"iana\",\"extensions\":[\"oas\"]},\"application/vnd.fujitsu.oasys2\":{\"source\":\"iana\",\"extensions\":[\"oa2\"]},\"application/vnd.fujitsu.oasys3\":{\"source\":\"iana\",\"extensions\":[\"oa3\"]},\"application/vnd.fujitsu.oasysgp\":{\"source\":\"iana\",\"extensions\":[\"fg5\"]},\"application/vnd.fujitsu.oasysprs\":{\"source\":\"iana\",\"extensions\":[\"bh2\"]},\"application/vnd.fujixerox.art-ex\":{\"source\":\"iana\"},\"application/vnd.fujixerox.art4\":{\"source\":\"iana\"},\"application/vnd.fujixerox.ddd\":{\"source\":\"iana\",\"extensions\":[\"ddd\"]},\"application/vnd.fujixerox.docuworks\":{\"source\":\"iana\",\"extensions\":[\"xdw\"]},\"application/vnd.fujixerox.docuworks.binder\":{\"source\":\"iana\",\"extensions\":[\"xbd\"]},\"application/vnd.fujixerox.docuworks.container\":{\"source\":\"iana\"},\"application/vnd.fujixerox.hbpl\":{\"source\":\"iana\"},\"application/vnd.fut-misnet\":{\"source\":\"iana\"},\"application/vnd.futoin+cbor\":{\"source\":\"iana\"},\"application/vnd.futoin+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.fuzzysheet\":{\"source\":\"iana\",\"extensions\":[\"fzs\"]},\"application/vnd.genomatix.tuxedo\":{\"source\":\"iana\",\"extensions\":[\"txd\"]},\"application/vnd.geo+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.geocube+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.geogebra.file\":{\"source\":\"iana\",\"extensions\":[\"ggb\"]},\"application/vnd.geogebra.tool\":{\"source\":\"iana\",\"extensions\":[\"ggt\"]},\"application/vnd.geometry-explorer\":{\"source\":\"iana\",\"extensions\":[\"gex\",\"gre\"]},\"application/vnd.geonext\":{\"source\":\"iana\",\"extensions\":[\"gxt\"]},\"application/vnd.geoplan\":{\"source\":\"iana\",\"extensions\":[\"g2w\"]},\"application/vnd.geospace\":{\"source\":\"iana\",\"extensions\":[\"g3w\"]},\"application/vnd.gerber\":{\"source\":\"iana\"},\"application/vnd.globalplatform.card-content-mgt\":{\"source\":\"iana\"},\"application/vnd.globalplatform.card-content-mgt-response\":{\"source\":\"iana\"},\"application/vnd.gmx\":{\"source\":\"iana\",\"extensions\":[\"gmx\"]},\"application/vnd.google-apps.document\":{\"compressible\":false,\"extensions\":[\"gdoc\"]},\"application/vnd.google-apps.presentation\":{\"compressible\":false,\"extensions\":[\"gslides\"]},\"application/vnd.google-apps.spreadsheet\":{\"compressible\":false,\"extensions\":[\"gsheet\"]},\"application/vnd.google-earth.kml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"kml\"]},\"application/vnd.google-earth.kmz\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"kmz\"]},\"application/vnd.gov.sk.e-form+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.gov.sk.e-form+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.gov.sk.xmldatacontainer+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.grafeq\":{\"source\":\"iana\",\"extensions\":[\"gqf\",\"gqs\"]},\"application/vnd.gridmp\":{\"source\":\"iana\"},\"application/vnd.groove-account\":{\"source\":\"iana\",\"extensions\":[\"gac\"]},\"application/vnd.groove-help\":{\"source\":\"iana\",\"extensions\":[\"ghf\"]},\"application/vnd.groove-identity-message\":{\"source\":\"iana\",\"extensions\":[\"gim\"]},\"application/vnd.groove-injector\":{\"source\":\"iana\",\"extensions\":[\"grv\"]},\"application/vnd.groove-tool-message\":{\"source\":\"iana\",\"extensions\":[\"gtm\"]},\"application/vnd.groove-tool-template\":{\"source\":\"iana\",\"extensions\":[\"tpl\"]},\"application/vnd.groove-vcard\":{\"source\":\"iana\",\"extensions\":[\"vcg\"]},\"application/vnd.hal+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hal+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"hal\"]},\"application/vnd.handheld-entertainment+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"zmm\"]},\"application/vnd.hbci\":{\"source\":\"iana\",\"extensions\":[\"hbci\"]},\"application/vnd.hc+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hcl-bireports\":{\"source\":\"iana\"},\"application/vnd.hdt\":{\"source\":\"iana\"},\"application/vnd.heroku+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hhe.lesson-player\":{\"source\":\"iana\",\"extensions\":[\"les\"]},\"application/vnd.hp-hpgl\":{\"source\":\"iana\",\"extensions\":[\"hpgl\"]},\"application/vnd.hp-hpid\":{\"source\":\"iana\",\"extensions\":[\"hpid\"]},\"application/vnd.hp-hps\":{\"source\":\"iana\",\"extensions\":[\"hps\"]},\"application/vnd.hp-jlyt\":{\"source\":\"iana\",\"extensions\":[\"jlt\"]},\"application/vnd.hp-pcl\":{\"source\":\"iana\",\"extensions\":[\"pcl\"]},\"application/vnd.hp-pclxl\":{\"source\":\"iana\",\"extensions\":[\"pclxl\"]},\"application/vnd.httphone\":{\"source\":\"iana\"},\"application/vnd.hydrostatix.sof-data\":{\"source\":\"iana\",\"extensions\":[\"sfd-hdstx\"]},\"application/vnd.hyper+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hyper-item+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hyperdrive+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hzn-3d-crossword\":{\"source\":\"iana\"},\"application/vnd.ibm.afplinedata\":{\"source\":\"iana\"},\"application/vnd.ibm.electronic-media\":{\"source\":\"iana\"},\"application/vnd.ibm.minipay\":{\"source\":\"iana\",\"extensions\":[\"mpy\"]},\"application/vnd.ibm.modcap\":{\"source\":\"iana\",\"extensions\":[\"afp\",\"listafp\",\"list3820\"]},\"application/vnd.ibm.rights-management\":{\"source\":\"iana\",\"extensions\":[\"irm\"]},\"application/vnd.ibm.secure-container\":{\"source\":\"iana\",\"extensions\":[\"sc\"]},\"application/vnd.iccprofile\":{\"source\":\"iana\",\"extensions\":[\"icc\",\"icm\"]},\"application/vnd.ieee.1905\":{\"source\":\"iana\"},\"application/vnd.igloader\":{\"source\":\"iana\",\"extensions\":[\"igl\"]},\"application/vnd.imagemeter.folder+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.imagemeter.image+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.immervision-ivp\":{\"source\":\"iana\",\"extensions\":[\"ivp\"]},\"application/vnd.immervision-ivu\":{\"source\":\"iana\",\"extensions\":[\"ivu\"]},\"application/vnd.ims.imsccv1p1\":{\"source\":\"iana\"},\"application/vnd.ims.imsccv1p2\":{\"source\":\"iana\"},\"application/vnd.ims.imsccv1p3\":{\"source\":\"iana\"},\"application/vnd.ims.lis.v2.result+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ims.lti.v2.toolconsumerprofile+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ims.lti.v2.toolproxy+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ims.lti.v2.toolproxy.id+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ims.lti.v2.toolsettings+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ims.lti.v2.toolsettings.simple+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.informedcontrol.rms+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.informix-visionary\":{\"source\":\"iana\"},\"application/vnd.infotech.project\":{\"source\":\"iana\"},\"application/vnd.infotech.project+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.innopath.wamp.notification\":{\"source\":\"iana\"},\"application/vnd.insors.igm\":{\"source\":\"iana\",\"extensions\":[\"igm\"]},\"application/vnd.intercon.formnet\":{\"source\":\"iana\",\"extensions\":[\"xpw\",\"xpx\"]},\"application/vnd.intergeo\":{\"source\":\"iana\",\"extensions\":[\"i2g\"]},\"application/vnd.intertrust.digibox\":{\"source\":\"iana\"},\"application/vnd.intertrust.nncp\":{\"source\":\"iana\"},\"application/vnd.intu.qbo\":{\"source\":\"iana\",\"extensions\":[\"qbo\"]},\"application/vnd.intu.qfx\":{\"source\":\"iana\",\"extensions\":[\"qfx\"]},\"application/vnd.iptc.g2.catalogitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.conceptitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.knowledgeitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.newsitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.newsmessage+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.packageitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.planningitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ipunplugged.rcprofile\":{\"source\":\"iana\",\"extensions\":[\"rcprofile\"]},\"application/vnd.irepository.package+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"irp\"]},\"application/vnd.is-xpr\":{\"source\":\"iana\",\"extensions\":[\"xpr\"]},\"application/vnd.isac.fcs\":{\"source\":\"iana\",\"extensions\":[\"fcs\"]},\"application/vnd.jam\":{\"source\":\"iana\",\"extensions\":[\"jam\"]},\"application/vnd.japannet-directory-service\":{\"source\":\"iana\"},\"application/vnd.japannet-jpnstore-wakeup\":{\"source\":\"iana\"},\"application/vnd.japannet-payment-wakeup\":{\"source\":\"iana\"},\"application/vnd.japannet-registration\":{\"source\":\"iana\"},\"application/vnd.japannet-registration-wakeup\":{\"source\":\"iana\"},\"application/vnd.japannet-setstore-wakeup\":{\"source\":\"iana\"},\"application/vnd.japannet-verification\":{\"source\":\"iana\"},\"application/vnd.japannet-verification-wakeup\":{\"source\":\"iana\"},\"application/vnd.jcp.javame.midlet-rms\":{\"source\":\"iana\",\"extensions\":[\"rms\"]},\"application/vnd.jisp\":{\"source\":\"iana\",\"extensions\":[\"jisp\"]},\"application/vnd.joost.joda-archive\":{\"source\":\"iana\",\"extensions\":[\"joda\"]},\"application/vnd.jsk.isdn-ngn\":{\"source\":\"iana\"},\"application/vnd.kahootz\":{\"source\":\"iana\",\"extensions\":[\"ktz\",\"ktr\"]},\"application/vnd.kde.karbon\":{\"source\":\"iana\",\"extensions\":[\"karbon\"]},\"application/vnd.kde.kchart\":{\"source\":\"iana\",\"extensions\":[\"chrt\"]},\"application/vnd.kde.kformula\":{\"source\":\"iana\",\"extensions\":[\"kfo\"]},\"application/vnd.kde.kivio\":{\"source\":\"iana\",\"extensions\":[\"flw\"]},\"application/vnd.kde.kontour\":{\"source\":\"iana\",\"extensions\":[\"kon\"]},\"application/vnd.kde.kpresenter\":{\"source\":\"iana\",\"extensions\":[\"kpr\",\"kpt\"]},\"application/vnd.kde.kspread\":{\"source\":\"iana\",\"extensions\":[\"ksp\"]},\"application/vnd.kde.kword\":{\"source\":\"iana\",\"extensions\":[\"kwd\",\"kwt\"]},\"application/vnd.kenameaapp\":{\"source\":\"iana\",\"extensions\":[\"htke\"]},\"application/vnd.kidspiration\":{\"source\":\"iana\",\"extensions\":[\"kia\"]},\"application/vnd.kinar\":{\"source\":\"iana\",\"extensions\":[\"kne\",\"knp\"]},\"application/vnd.koan\":{\"source\":\"iana\",\"extensions\":[\"skp\",\"skd\",\"skt\",\"skm\"]},\"application/vnd.kodak-descriptor\":{\"source\":\"iana\",\"extensions\":[\"sse\"]},\"application/vnd.las.las+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.las.las+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"lasxml\"]},\"application/vnd.leap+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.liberty-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.llamagraphics.life-balance.desktop\":{\"source\":\"iana\",\"extensions\":[\"lbd\"]},\"application/vnd.llamagraphics.life-balance.exchange+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"lbe\"]},\"application/vnd.lotus-1-2-3\":{\"source\":\"iana\",\"extensions\":[\"123\"]},\"application/vnd.lotus-approach\":{\"source\":\"iana\",\"extensions\":[\"apr\"]},\"application/vnd.lotus-freelance\":{\"source\":\"iana\",\"extensions\":[\"pre\"]},\"application/vnd.lotus-notes\":{\"source\":\"iana\",\"extensions\":[\"nsf\"]},\"application/vnd.lotus-organizer\":{\"source\":\"iana\",\"extensions\":[\"org\"]},\"application/vnd.lotus-screencam\":{\"source\":\"iana\",\"extensions\":[\"scm\"]},\"application/vnd.lotus-wordpro\":{\"source\":\"iana\",\"extensions\":[\"lwp\"]},\"application/vnd.macports.portpkg\":{\"source\":\"iana\",\"extensions\":[\"portpkg\"]},\"application/vnd.mapbox-vector-tile\":{\"source\":\"iana\"},\"application/vnd.marlin.drm.actiontoken+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.marlin.drm.conftoken+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.marlin.drm.license+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.marlin.drm.mdcf\":{\"source\":\"iana\"},\"application/vnd.mason+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.maxmind.maxmind-db\":{\"source\":\"iana\"},\"application/vnd.mcd\":{\"source\":\"iana\",\"extensions\":[\"mcd\"]},\"application/vnd.medcalcdata\":{\"source\":\"iana\",\"extensions\":[\"mc1\"]},\"application/vnd.mediastation.cdkey\":{\"source\":\"iana\",\"extensions\":[\"cdkey\"]},\"application/vnd.meridian-slingshot\":{\"source\":\"iana\"},\"application/vnd.mfer\":{\"source\":\"iana\",\"extensions\":[\"mwf\"]},\"application/vnd.mfmp\":{\"source\":\"iana\",\"extensions\":[\"mfm\"]},\"application/vnd.micro+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.micrografx.flo\":{\"source\":\"iana\",\"extensions\":[\"flo\"]},\"application/vnd.micrografx.igx\":{\"source\":\"iana\",\"extensions\":[\"igx\"]},\"application/vnd.microsoft.portable-executable\":{\"source\":\"iana\"},\"application/vnd.microsoft.windows.thumbnail-cache\":{\"source\":\"iana\"},\"application/vnd.miele+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.mif\":{\"source\":\"iana\",\"extensions\":[\"mif\"]},\"application/vnd.minisoft-hp3000-save\":{\"source\":\"iana\"},\"application/vnd.mitsubishi.misty-guard.trustweb\":{\"source\":\"iana\"},\"application/vnd.mobius.daf\":{\"source\":\"iana\",\"extensions\":[\"daf\"]},\"application/vnd.mobius.dis\":{\"source\":\"iana\",\"extensions\":[\"dis\"]},\"application/vnd.mobius.mbk\":{\"source\":\"iana\",\"extensions\":[\"mbk\"]},\"application/vnd.mobius.mqy\":{\"source\":\"iana\",\"extensions\":[\"mqy\"]},\"application/vnd.mobius.msl\":{\"source\":\"iana\",\"extensions\":[\"msl\"]},\"application/vnd.mobius.plc\":{\"source\":\"iana\",\"extensions\":[\"plc\"]},\"application/vnd.mobius.txf\":{\"source\":\"iana\",\"extensions\":[\"txf\"]},\"application/vnd.mophun.application\":{\"source\":\"iana\",\"extensions\":[\"mpn\"]},\"application/vnd.mophun.certificate\":{\"source\":\"iana\",\"extensions\":[\"mpc\"]},\"application/vnd.motorola.flexsuite\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.adsi\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.fis\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.gotap\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.kmr\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.ttc\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.wem\":{\"source\":\"iana\"},\"application/vnd.motorola.iprm\":{\"source\":\"iana\"},\"application/vnd.mozilla.xul+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xul\"]},\"application/vnd.ms-3mfdocument\":{\"source\":\"iana\"},\"application/vnd.ms-artgalry\":{\"source\":\"iana\",\"extensions\":[\"cil\"]},\"application/vnd.ms-asf\":{\"source\":\"iana\"},\"application/vnd.ms-cab-compressed\":{\"source\":\"iana\",\"extensions\":[\"cab\"]},\"application/vnd.ms-color.iccprofile\":{\"source\":\"apache\"},\"application/vnd.ms-excel\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"xls\",\"xlm\",\"xla\",\"xlc\",\"xlt\",\"xlw\"]},\"application/vnd.ms-excel.addin.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"xlam\"]},\"application/vnd.ms-excel.sheet.binary.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"xlsb\"]},\"application/vnd.ms-excel.sheet.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"xlsm\"]},\"application/vnd.ms-excel.template.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"xltm\"]},\"application/vnd.ms-fontobject\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"eot\"]},\"application/vnd.ms-htmlhelp\":{\"source\":\"iana\",\"extensions\":[\"chm\"]},\"application/vnd.ms-ims\":{\"source\":\"iana\",\"extensions\":[\"ims\"]},\"application/vnd.ms-lrm\":{\"source\":\"iana\",\"extensions\":[\"lrm\"]},\"application/vnd.ms-office.activex+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ms-officetheme\":{\"source\":\"iana\",\"extensions\":[\"thmx\"]},\"application/vnd.ms-opentype\":{\"source\":\"apache\",\"compressible\":true},\"application/vnd.ms-outlook\":{\"compressible\":false,\"extensions\":[\"msg\"]},\"application/vnd.ms-package.obfuscated-opentype\":{\"source\":\"apache\"},\"application/vnd.ms-pki.seccat\":{\"source\":\"apache\",\"extensions\":[\"cat\"]},\"application/vnd.ms-pki.stl\":{\"source\":\"apache\",\"extensions\":[\"stl\"]},\"application/vnd.ms-playready.initiator+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ms-powerpoint\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"ppt\",\"pps\",\"pot\"]},\"application/vnd.ms-powerpoint.addin.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"ppam\"]},\"application/vnd.ms-powerpoint.presentation.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"pptm\"]},\"application/vnd.ms-powerpoint.slide.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"sldm\"]},\"application/vnd.ms-powerpoint.slideshow.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"ppsm\"]},\"application/vnd.ms-powerpoint.template.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"potm\"]},\"application/vnd.ms-printdevicecapabilities+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ms-printing.printticket+xml\":{\"source\":\"apache\",\"compressible\":true},\"application/vnd.ms-printschematicket+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ms-project\":{\"source\":\"iana\",\"extensions\":[\"mpp\",\"mpt\"]},\"application/vnd.ms-tnef\":{\"source\":\"iana\"},\"application/vnd.ms-windows.devicepairing\":{\"source\":\"iana\"},\"application/vnd.ms-windows.nwprinting.oob\":{\"source\":\"iana\"},\"application/vnd.ms-windows.printerpairing\":{\"source\":\"iana\"},\"application/vnd.ms-windows.wsd.oob\":{\"source\":\"iana\"},\"application/vnd.ms-wmdrm.lic-chlg-req\":{\"source\":\"iana\"},\"application/vnd.ms-wmdrm.lic-resp\":{\"source\":\"iana\"},\"application/vnd.ms-wmdrm.meter-chlg-req\":{\"source\":\"iana\"},\"application/vnd.ms-wmdrm.meter-resp\":{\"source\":\"iana\"},\"application/vnd.ms-word.document.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"docm\"]},\"application/vnd.ms-word.template.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"dotm\"]},\"application/vnd.ms-works\":{\"source\":\"iana\",\"extensions\":[\"wps\",\"wks\",\"wcm\",\"wdb\"]},\"application/vnd.ms-wpl\":{\"source\":\"iana\",\"extensions\":[\"wpl\"]},\"application/vnd.ms-xpsdocument\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"xps\"]},\"application/vnd.msa-disk-image\":{\"source\":\"iana\"},\"application/vnd.mseq\":{\"source\":\"iana\",\"extensions\":[\"mseq\"]},\"application/vnd.msign\":{\"source\":\"iana\"},\"application/vnd.multiad.creator\":{\"source\":\"iana\"},\"application/vnd.multiad.creator.cif\":{\"source\":\"iana\"},\"application/vnd.music-niff\":{\"source\":\"iana\"},\"application/vnd.musician\":{\"source\":\"iana\",\"extensions\":[\"mus\"]},\"application/vnd.muvee.style\":{\"source\":\"iana\",\"extensions\":[\"msty\"]},\"application/vnd.mynfc\":{\"source\":\"iana\",\"extensions\":[\"taglet\"]},\"application/vnd.ncd.control\":{\"source\":\"iana\"},\"application/vnd.ncd.reference\":{\"source\":\"iana\"},\"application/vnd.nearst.inv+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nervana\":{\"source\":\"iana\"},\"application/vnd.netfpx\":{\"source\":\"iana\"},\"application/vnd.neurolanguage.nlu\":{\"source\":\"iana\",\"extensions\":[\"nlu\"]},\"application/vnd.nimn\":{\"source\":\"iana\"},\"application/vnd.nintendo.nitro.rom\":{\"source\":\"iana\"},\"application/vnd.nintendo.snes.rom\":{\"source\":\"iana\"},\"application/vnd.nitf\":{\"source\":\"iana\",\"extensions\":[\"ntf\",\"nitf\"]},\"application/vnd.noblenet-directory\":{\"source\":\"iana\",\"extensions\":[\"nnd\"]},\"application/vnd.noblenet-sealer\":{\"source\":\"iana\",\"extensions\":[\"nns\"]},\"application/vnd.noblenet-web\":{\"source\":\"iana\",\"extensions\":[\"nnw\"]},\"application/vnd.nokia.catalogs\":{\"source\":\"iana\"},\"application/vnd.nokia.conml+wbxml\":{\"source\":\"iana\"},\"application/vnd.nokia.conml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.iptv.config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.isds-radio-presets\":{\"source\":\"iana\"},\"application/vnd.nokia.landmark+wbxml\":{\"source\":\"iana\"},\"application/vnd.nokia.landmark+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.landmarkcollection+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.n-gage.ac+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.n-gage.data\":{\"source\":\"iana\",\"extensions\":[\"ngdat\"]},\"application/vnd.nokia.n-gage.symbian.install\":{\"source\":\"iana\",\"extensions\":[\"n-gage\"]},\"application/vnd.nokia.ncd\":{\"source\":\"iana\"},\"application/vnd.nokia.pcd+wbxml\":{\"source\":\"iana\"},\"application/vnd.nokia.pcd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.radio-preset\":{\"source\":\"iana\",\"extensions\":[\"rpst\"]},\"application/vnd.nokia.radio-presets\":{\"source\":\"iana\",\"extensions\":[\"rpss\"]},\"application/vnd.novadigm.edm\":{\"source\":\"iana\",\"extensions\":[\"edm\"]},\"application/vnd.novadigm.edx\":{\"source\":\"iana\",\"extensions\":[\"edx\"]},\"application/vnd.novadigm.ext\":{\"source\":\"iana\",\"extensions\":[\"ext\"]},\"application/vnd.ntt-local.content-share\":{\"source\":\"iana\"},\"application/vnd.ntt-local.file-transfer\":{\"source\":\"iana\"},\"application/vnd.ntt-local.ogw_remote-access\":{\"source\":\"iana\"},\"application/vnd.ntt-local.sip-ta_remote\":{\"source\":\"iana\"},\"application/vnd.ntt-local.sip-ta_tcp_stream\":{\"source\":\"iana\"},\"application/vnd.oasis.opendocument.chart\":{\"source\":\"iana\",\"extensions\":[\"odc\"]},\"application/vnd.oasis.opendocument.chart-template\":{\"source\":\"iana\",\"extensions\":[\"otc\"]},\"application/vnd.oasis.opendocument.database\":{\"source\":\"iana\",\"extensions\":[\"odb\"]},\"application/vnd.oasis.opendocument.formula\":{\"source\":\"iana\",\"extensions\":[\"odf\"]},\"application/vnd.oasis.opendocument.formula-template\":{\"source\":\"iana\",\"extensions\":[\"odft\"]},\"application/vnd.oasis.opendocument.graphics\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"odg\"]},\"application/vnd.oasis.opendocument.graphics-template\":{\"source\":\"iana\",\"extensions\":[\"otg\"]},\"application/vnd.oasis.opendocument.image\":{\"source\":\"iana\",\"extensions\":[\"odi\"]},\"application/vnd.oasis.opendocument.image-template\":{\"source\":\"iana\",\"extensions\":[\"oti\"]},\"application/vnd.oasis.opendocument.presentation\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"odp\"]},\"application/vnd.oasis.opendocument.presentation-template\":{\"source\":\"iana\",\"extensions\":[\"otp\"]},\"application/vnd.oasis.opendocument.spreadsheet\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"ods\"]},\"application/vnd.oasis.opendocument.spreadsheet-template\":{\"source\":\"iana\",\"extensions\":[\"ots\"]},\"application/vnd.oasis.opendocument.text\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"odt\"]},\"application/vnd.oasis.opendocument.text-master\":{\"source\":\"iana\",\"extensions\":[\"odm\"]},\"application/vnd.oasis.opendocument.text-template\":{\"source\":\"iana\",\"extensions\":[\"ott\"]},\"application/vnd.oasis.opendocument.text-web\":{\"source\":\"iana\",\"extensions\":[\"oth\"]},\"application/vnd.obn\":{\"source\":\"iana\"},\"application/vnd.ocf+cbor\":{\"source\":\"iana\"},\"application/vnd.oftn.l10n+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.contentaccessdownload+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.contentaccessstreaming+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.cspg-hexbinary\":{\"source\":\"iana\"},\"application/vnd.oipf.dae.svg+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.dae.xhtml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.mippvcontrolmessage+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.pae.gem\":{\"source\":\"iana\"},\"application/vnd.oipf.spdiscovery+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.spdlist+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.ueprofile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.userprofile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.olpc-sugar\":{\"source\":\"iana\",\"extensions\":[\"xo\"]},\"application/vnd.oma-scws-config\":{\"source\":\"iana\"},\"application/vnd.oma-scws-http-request\":{\"source\":\"iana\"},\"application/vnd.oma-scws-http-response\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.associated-procedure-parameter+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.drm-trigger+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.imd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.ltkm\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.notification+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.provisioningtrigger\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.sgboot\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.sgdd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.sgdu\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.simple-symbol-container\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.smartcard-trigger+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.sprov+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.stkm\":{\"source\":\"iana\"},\"application/vnd.oma.cab-address-book+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.cab-feature-handler+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.cab-pcc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.cab-subs-invite+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.cab-user-prefs+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.dcd\":{\"source\":\"iana\"},\"application/vnd.oma.dcdc\":{\"source\":\"iana\"},\"application/vnd.oma.dd2+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"dd2\"]},\"application/vnd.oma.drm.risd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.group-usage-list+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.lwm2m+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.lwm2m+tlv\":{\"source\":\"iana\"},\"application/vnd.oma.pal+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.poc.detailed-progress-report+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.poc.final-report+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.poc.groups+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.poc.invocation-descriptor+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.poc.optimized-progress-report+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.push\":{\"source\":\"iana\"},\"application/vnd.oma.scidm.messages+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.xcap-directory+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.omads-email+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.omads-file+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.omads-folder+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.omaloc-supl-init\":{\"source\":\"iana\"},\"application/vnd.onepager\":{\"source\":\"iana\"},\"application/vnd.onepagertamp\":{\"source\":\"iana\"},\"application/vnd.onepagertamx\":{\"source\":\"iana\"},\"application/vnd.onepagertat\":{\"source\":\"iana\"},\"application/vnd.onepagertatp\":{\"source\":\"iana\"},\"application/vnd.onepagertatx\":{\"source\":\"iana\"},\"application/vnd.openblox.game+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openblox.game-binary\":{\"source\":\"iana\"},\"application/vnd.openeye.oeb\":{\"source\":\"iana\"},\"application/vnd.openofficeorg.extension\":{\"source\":\"apache\",\"extensions\":[\"oxt\"]},\"application/vnd.openstreetmap.data+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.custom-properties+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.customxmlproperties+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawing+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.chart+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.extended-properties+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.comments+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.presentation\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"pptx\"]},\"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.slide\":{\"source\":\"iana\",\"extensions\":[\"sldx\"]},\"application/vnd.openxmlformats-officedocument.presentationml.slide+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.slideshow\":{\"source\":\"iana\",\"extensions\":[\"ppsx\"]},\"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.tags+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.template\":{\"source\":\"iana\",\"extensions\":[\"potx\"]},\"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"xlsx\"]},\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.template\":{\"source\":\"iana\",\"extensions\":[\"xltx\"]},\"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.theme+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.themeoverride+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.vmldrawing\":{\"source\":\"iana\"},\"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"docx\"]},\"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.template\":{\"source\":\"iana\",\"extensions\":[\"dotx\"]},\"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-package.core-properties+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-package.relationships+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oracle.resource+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.orange.indata\":{\"source\":\"iana\"},\"application/vnd.osa.netdeploy\":{\"source\":\"iana\"},\"application/vnd.osgeo.mapguide.package\":{\"source\":\"iana\",\"extensions\":[\"mgp\"]},\"application/vnd.osgi.bundle\":{\"source\":\"iana\"},\"application/vnd.osgi.dp\":{\"source\":\"iana\",\"extensions\":[\"dp\"]},\"application/vnd.osgi.subsystem\":{\"source\":\"iana\",\"extensions\":[\"esa\"]},\"application/vnd.otps.ct-kip+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oxli.countgraph\":{\"source\":\"iana\"},\"application/vnd.pagerduty+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.palm\":{\"source\":\"iana\",\"extensions\":[\"pdb\",\"pqa\",\"oprc\"]},\"application/vnd.panoply\":{\"source\":\"iana\"},\"application/vnd.paos.xml\":{\"source\":\"iana\"},\"application/vnd.patentdive\":{\"source\":\"iana\"},\"application/vnd.patientecommsdoc\":{\"source\":\"iana\"},\"application/vnd.pawaafile\":{\"source\":\"iana\",\"extensions\":[\"paw\"]},\"application/vnd.pcos\":{\"source\":\"iana\"},\"application/vnd.pg.format\":{\"source\":\"iana\",\"extensions\":[\"str\"]},\"application/vnd.pg.osasli\":{\"source\":\"iana\",\"extensions\":[\"ei6\"]},\"application/vnd.piaccess.application-licence\":{\"source\":\"iana\"},\"application/vnd.picsel\":{\"source\":\"iana\",\"extensions\":[\"efif\"]},\"application/vnd.pmi.widget\":{\"source\":\"iana\",\"extensions\":[\"wg\"]},\"application/vnd.poc.group-advertisement+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.pocketlearn\":{\"source\":\"iana\",\"extensions\":[\"plf\"]},\"application/vnd.powerbuilder6\":{\"source\":\"iana\",\"extensions\":[\"pbd\"]},\"application/vnd.powerbuilder6-s\":{\"source\":\"iana\"},\"application/vnd.powerbuilder7\":{\"source\":\"iana\"},\"application/vnd.powerbuilder7-s\":{\"source\":\"iana\"},\"application/vnd.powerbuilder75\":{\"source\":\"iana\"},\"application/vnd.powerbuilder75-s\":{\"source\":\"iana\"},\"application/vnd.preminet\":{\"source\":\"iana\"},\"application/vnd.previewsystems.box\":{\"source\":\"iana\",\"extensions\":[\"box\"]},\"application/vnd.proteus.magazine\":{\"source\":\"iana\",\"extensions\":[\"mgz\"]},\"application/vnd.psfs\":{\"source\":\"iana\"},\"application/vnd.publishare-delta-tree\":{\"source\":\"iana\",\"extensions\":[\"qps\"]},\"application/vnd.pvi.ptid1\":{\"source\":\"iana\",\"extensions\":[\"ptid\"]},\"application/vnd.pwg-multiplexed\":{\"source\":\"iana\"},\"application/vnd.pwg-xhtml-print+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.qualcomm.brew-app-res\":{\"source\":\"iana\"},\"application/vnd.quarantainenet\":{\"source\":\"iana\"},\"application/vnd.quark.quarkxpress\":{\"source\":\"iana\",\"extensions\":[\"qxd\",\"qxt\",\"qwd\",\"qwt\",\"qxl\",\"qxb\"]},\"application/vnd.quobject-quoxdocument\":{\"source\":\"iana\"},\"application/vnd.radisys.moml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-audit+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-audit-conf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-audit-conn+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-audit-dialog+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-audit-stream+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-conf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-base+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-fax-detect+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-fax-sendrecv+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-group+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-speech+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-transform+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.rainstor.data\":{\"source\":\"iana\"},\"application/vnd.rapid\":{\"source\":\"iana\"},\"application/vnd.rar\":{\"source\":\"iana\"},\"application/vnd.realvnc.bed\":{\"source\":\"iana\",\"extensions\":[\"bed\"]},\"application/vnd.recordare.musicxml\":{\"source\":\"iana\",\"extensions\":[\"mxl\"]},\"application/vnd.recordare.musicxml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"musicxml\"]},\"application/vnd.renlearn.rlprint\":{\"source\":\"iana\"},\"application/vnd.restful+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.rig.cryptonote\":{\"source\":\"iana\",\"extensions\":[\"cryptonote\"]},\"application/vnd.rim.cod\":{\"source\":\"apache\",\"extensions\":[\"cod\"]},\"application/vnd.rn-realmedia\":{\"source\":\"apache\",\"extensions\":[\"rm\"]},\"application/vnd.rn-realmedia-vbr\":{\"source\":\"apache\",\"extensions\":[\"rmvb\"]},\"application/vnd.route66.link66+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"link66\"]},\"application/vnd.rs-274x\":{\"source\":\"iana\"},\"application/vnd.ruckus.download\":{\"source\":\"iana\"},\"application/vnd.s3sms\":{\"source\":\"iana\"},\"application/vnd.sailingtracker.track\":{\"source\":\"iana\",\"extensions\":[\"st\"]},\"application/vnd.sbm.cid\":{\"source\":\"iana\"},\"application/vnd.sbm.mid2\":{\"source\":\"iana\"},\"application/vnd.scribus\":{\"source\":\"iana\"},\"application/vnd.sealed.3df\":{\"source\":\"iana\"},\"application/vnd.sealed.csf\":{\"source\":\"iana\"},\"application/vnd.sealed.doc\":{\"source\":\"iana\"},\"application/vnd.sealed.eml\":{\"source\":\"iana\"},\"application/vnd.sealed.mht\":{\"source\":\"iana\"},\"application/vnd.sealed.net\":{\"source\":\"iana\"},\"application/vnd.sealed.ppt\":{\"source\":\"iana\"},\"application/vnd.sealed.tiff\":{\"source\":\"iana\"},\"application/vnd.sealed.xls\":{\"source\":\"iana\"},\"application/vnd.sealedmedia.softseal.html\":{\"source\":\"iana\"},\"application/vnd.sealedmedia.softseal.pdf\":{\"source\":\"iana\"},\"application/vnd.seemail\":{\"source\":\"iana\",\"extensions\":[\"see\"]},\"application/vnd.sema\":{\"source\":\"iana\",\"extensions\":[\"sema\"]},\"application/vnd.semd\":{\"source\":\"iana\",\"extensions\":[\"semd\"]},\"application/vnd.semf\":{\"source\":\"iana\",\"extensions\":[\"semf\"]},\"application/vnd.shana.informed.formdata\":{\"source\":\"iana\",\"extensions\":[\"ifm\"]},\"application/vnd.shana.informed.formtemplate\":{\"source\":\"iana\",\"extensions\":[\"itp\"]},\"application/vnd.shana.informed.interchange\":{\"source\":\"iana\",\"extensions\":[\"iif\"]},\"application/vnd.shana.informed.package\":{\"source\":\"iana\",\"extensions\":[\"ipk\"]},\"application/vnd.shootproof+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.sigrok.session\":{\"source\":\"iana\"},\"application/vnd.simtech-mindmapper\":{\"source\":\"iana\",\"extensions\":[\"twd\",\"twds\"]},\"application/vnd.siren+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.smaf\":{\"source\":\"iana\",\"extensions\":[\"mmf\"]},\"application/vnd.smart.notebook\":{\"source\":\"iana\"},\"application/vnd.smart.teacher\":{\"source\":\"iana\",\"extensions\":[\"teacher\"]},\"application/vnd.software602.filler.form+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.software602.filler.form-xml-zip\":{\"source\":\"iana\"},\"application/vnd.solent.sdkm+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"sdkm\",\"sdkd\"]},\"application/vnd.spotfire.dxp\":{\"source\":\"iana\",\"extensions\":[\"dxp\"]},\"application/vnd.spotfire.sfs\":{\"source\":\"iana\",\"extensions\":[\"sfs\"]},\"application/vnd.sqlite3\":{\"source\":\"iana\"},\"application/vnd.sss-cod\":{\"source\":\"iana\"},\"application/vnd.sss-dtf\":{\"source\":\"iana\"},\"application/vnd.sss-ntf\":{\"source\":\"iana\"},\"application/vnd.stardivision.calc\":{\"source\":\"apache\",\"extensions\":[\"sdc\"]},\"application/vnd.stardivision.draw\":{\"source\":\"apache\",\"extensions\":[\"sda\"]},\"application/vnd.stardivision.impress\":{\"source\":\"apache\",\"extensions\":[\"sdd\"]},\"application/vnd.stardivision.math\":{\"source\":\"apache\",\"extensions\":[\"smf\"]},\"application/vnd.stardivision.writer\":{\"source\":\"apache\",\"extensions\":[\"sdw\",\"vor\"]},\"application/vnd.stardivision.writer-global\":{\"source\":\"apache\",\"extensions\":[\"sgl\"]},\"application/vnd.stepmania.package\":{\"source\":\"iana\",\"extensions\":[\"smzip\"]},\"application/vnd.stepmania.stepchart\":{\"source\":\"iana\",\"extensions\":[\"sm\"]},\"application/vnd.street-stream\":{\"source\":\"iana\"},\"application/vnd.sun.wadl+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"wadl\"]},\"application/vnd.sun.xml.calc\":{\"source\":\"apache\",\"extensions\":[\"sxc\"]},\"application/vnd.sun.xml.calc.template\":{\"source\":\"apache\",\"extensions\":[\"stc\"]},\"application/vnd.sun.xml.draw\":{\"source\":\"apache\",\"extensions\":[\"sxd\"]},\"application/vnd.sun.xml.draw.template\":{\"source\":\"apache\",\"extensions\":[\"std\"]},\"application/vnd.sun.xml.impress\":{\"source\":\"apache\",\"extensions\":[\"sxi\"]},\"application/vnd.sun.xml.impress.template\":{\"source\":\"apache\",\"extensions\":[\"sti\"]},\"application/vnd.sun.xml.math\":{\"source\":\"apache\",\"extensions\":[\"sxm\"]},\"application/vnd.sun.xml.writer\":{\"source\":\"apache\",\"extensions\":[\"sxw\"]},\"application/vnd.sun.xml.writer.global\":{\"source\":\"apache\",\"extensions\":[\"sxg\"]},\"application/vnd.sun.xml.writer.template\":{\"source\":\"apache\",\"extensions\":[\"stw\"]},\"application/vnd.sus-calendar\":{\"source\":\"iana\",\"extensions\":[\"sus\",\"susp\"]},\"application/vnd.svd\":{\"source\":\"iana\",\"extensions\":[\"svd\"]},\"application/vnd.swiftview-ics\":{\"source\":\"iana\"},\"application/vnd.symbian.install\":{\"source\":\"apache\",\"extensions\":[\"sis\",\"sisx\"]},\"application/vnd.syncml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xsm\"]},\"application/vnd.syncml.dm+wbxml\":{\"source\":\"iana\",\"extensions\":[\"bdm\"]},\"application/vnd.syncml.dm+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xdm\"]},\"application/vnd.syncml.dm.notification\":{\"source\":\"iana\"},\"application/vnd.syncml.dmddf+wbxml\":{\"source\":\"iana\"},\"application/vnd.syncml.dmddf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.syncml.dmtnds+wbxml\":{\"source\":\"iana\"},\"application/vnd.syncml.dmtnds+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.syncml.ds.notification\":{\"source\":\"iana\"},\"application/vnd.tableschema+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.tao.intent-module-archive\":{\"source\":\"iana\",\"extensions\":[\"tao\"]},\"application/vnd.tcpdump.pcap\":{\"source\":\"iana\",\"extensions\":[\"pcap\",\"cap\",\"dmp\"]},\"application/vnd.think-cell.ppttc+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.tmd.mediaflex.api+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.tml\":{\"source\":\"iana\"},\"application/vnd.tmobile-livetv\":{\"source\":\"iana\",\"extensions\":[\"tmo\"]},\"application/vnd.tri.onesource\":{\"source\":\"iana\"},\"application/vnd.trid.tpt\":{\"source\":\"iana\",\"extensions\":[\"tpt\"]},\"application/vnd.triscape.mxs\":{\"source\":\"iana\",\"extensions\":[\"mxs\"]},\"application/vnd.trueapp\":{\"source\":\"iana\",\"extensions\":[\"tra\"]},\"application/vnd.truedoc\":{\"source\":\"iana\"},\"application/vnd.ubisoft.webplayer\":{\"source\":\"iana\"},\"application/vnd.ufdl\":{\"source\":\"iana\",\"extensions\":[\"ufd\",\"ufdl\"]},\"application/vnd.uiq.theme\":{\"source\":\"iana\",\"extensions\":[\"utz\"]},\"application/vnd.umajin\":{\"source\":\"iana\",\"extensions\":[\"umj\"]},\"application/vnd.unity\":{\"source\":\"iana\",\"extensions\":[\"unityweb\"]},\"application/vnd.uoml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"uoml\"]},\"application/vnd.uplanet.alert\":{\"source\":\"iana\"},\"application/vnd.uplanet.alert-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.bearer-choice\":{\"source\":\"iana\"},\"application/vnd.uplanet.bearer-choice-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.cacheop\":{\"source\":\"iana\"},\"application/vnd.uplanet.cacheop-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.channel\":{\"source\":\"iana\"},\"application/vnd.uplanet.channel-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.list\":{\"source\":\"iana\"},\"application/vnd.uplanet.list-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.listcmd\":{\"source\":\"iana\"},\"application/vnd.uplanet.listcmd-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.signal\":{\"source\":\"iana\"},\"application/vnd.uri-map\":{\"source\":\"iana\"},\"application/vnd.valve.source.material\":{\"source\":\"iana\"},\"application/vnd.vcx\":{\"source\":\"iana\",\"extensions\":[\"vcx\"]},\"application/vnd.vd-study\":{\"source\":\"iana\"},\"application/vnd.vectorworks\":{\"source\":\"iana\"},\"application/vnd.vel+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.verimatrix.vcas\":{\"source\":\"iana\"},\"application/vnd.veryant.thin\":{\"source\":\"iana\"},\"application/vnd.vidsoft.vidconference\":{\"source\":\"iana\"},\"application/vnd.visio\":{\"source\":\"iana\",\"extensions\":[\"vsd\",\"vst\",\"vss\",\"vsw\"]},\"application/vnd.visionary\":{\"source\":\"iana\",\"extensions\":[\"vis\"]},\"application/vnd.vividence.scriptfile\":{\"source\":\"iana\"},\"application/vnd.vsf\":{\"source\":\"iana\",\"extensions\":[\"vsf\"]},\"application/vnd.wap.sic\":{\"source\":\"iana\"},\"application/vnd.wap.slc\":{\"source\":\"iana\"},\"application/vnd.wap.wbxml\":{\"source\":\"iana\",\"extensions\":[\"wbxml\"]},\"application/vnd.wap.wmlc\":{\"source\":\"iana\",\"extensions\":[\"wmlc\"]},\"application/vnd.wap.wmlscriptc\":{\"source\":\"iana\",\"extensions\":[\"wmlsc\"]},\"application/vnd.webturbo\":{\"source\":\"iana\",\"extensions\":[\"wtb\"]},\"application/vnd.wfa.p2p\":{\"source\":\"iana\"},\"application/vnd.wfa.wsc\":{\"source\":\"iana\"},\"application/vnd.windows.devicepairing\":{\"source\":\"iana\"},\"application/vnd.wmc\":{\"source\":\"iana\"},\"application/vnd.wmf.bootstrap\":{\"source\":\"iana\"},\"application/vnd.wolfram.mathematica\":{\"source\":\"iana\"},\"application/vnd.wolfram.mathematica.package\":{\"source\":\"iana\"},\"application/vnd.wolfram.player\":{\"source\":\"iana\",\"extensions\":[\"nbp\"]},\"application/vnd.wordperfect\":{\"source\":\"iana\",\"extensions\":[\"wpd\"]},\"application/vnd.wqd\":{\"source\":\"iana\",\"extensions\":[\"wqd\"]},\"application/vnd.wrq-hp3000-labelled\":{\"source\":\"iana\"},\"application/vnd.wt.stf\":{\"source\":\"iana\",\"extensions\":[\"stf\"]},\"application/vnd.wv.csp+wbxml\":{\"source\":\"iana\"},\"application/vnd.wv.csp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.wv.ssp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.xacml+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.xara\":{\"source\":\"iana\",\"extensions\":[\"xar\"]},\"application/vnd.xfdl\":{\"source\":\"iana\",\"extensions\":[\"xfdl\"]},\"application/vnd.xfdl.webform\":{\"source\":\"iana\"},\"application/vnd.xmi+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.xmpie.cpkg\":{\"source\":\"iana\"},\"application/vnd.xmpie.dpkg\":{\"source\":\"iana\"},\"application/vnd.xmpie.plan\":{\"source\":\"iana\"},\"application/vnd.xmpie.ppkg\":{\"source\":\"iana\"},\"application/vnd.xmpie.xlim\":{\"source\":\"iana\"},\"application/vnd.yamaha.hv-dic\":{\"source\":\"iana\",\"extensions\":[\"hvd\"]},\"application/vnd.yamaha.hv-script\":{\"source\":\"iana\",\"extensions\":[\"hvs\"]},\"application/vnd.yamaha.hv-voice\":{\"source\":\"iana\",\"extensions\":[\"hvp\"]},\"application/vnd.yamaha.openscoreformat\":{\"source\":\"iana\",\"extensions\":[\"osf\"]},\"application/vnd.yamaha.openscoreformat.osfpvg+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"osfpvg\"]},\"application/vnd.yamaha.remote-setup\":{\"source\":\"iana\"},\"application/vnd.yamaha.smaf-audio\":{\"source\":\"iana\",\"extensions\":[\"saf\"]},\"application/vnd.yamaha.smaf-phrase\":{\"source\":\"iana\",\"extensions\":[\"spf\"]},\"application/vnd.yamaha.through-ngn\":{\"source\":\"iana\"},\"application/vnd.yamaha.tunnel-udpencap\":{\"source\":\"iana\"},\"application/vnd.yaoweme\":{\"source\":\"iana\"},\"application/vnd.yellowriver-custom-menu\":{\"source\":\"iana\",\"extensions\":[\"cmp\"]},\"application/vnd.youtube.yt\":{\"source\":\"iana\"},\"application/vnd.zul\":{\"source\":\"iana\",\"extensions\":[\"zir\",\"zirz\"]},\"application/vnd.zzazz.deck+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"zaz\"]},\"application/voicexml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"vxml\"]},\"application/voucher-cms+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vq-rtcpxr\":{\"source\":\"iana\"},\"application/wasm\":{\"compressible\":true,\"extensions\":[\"wasm\"]},\"application/watcherinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/webpush-options+json\":{\"source\":\"iana\",\"compressible\":true},\"application/whoispp-query\":{\"source\":\"iana\"},\"application/whoispp-response\":{\"source\":\"iana\"},\"application/widget\":{\"source\":\"iana\",\"extensions\":[\"wgt\"]},\"application/winhlp\":{\"source\":\"apache\",\"extensions\":[\"hlp\"]},\"application/wita\":{\"source\":\"iana\"},\"application/wordperfect5.1\":{\"source\":\"iana\"},\"application/wsdl+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"wsdl\"]},\"application/wspolicy+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"wspolicy\"]},\"application/x-7z-compressed\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"7z\"]},\"application/x-abiword\":{\"source\":\"apache\",\"extensions\":[\"abw\"]},\"application/x-ace-compressed\":{\"source\":\"apache\",\"extensions\":[\"ace\"]},\"application/x-amf\":{\"source\":\"apache\"},\"application/x-apple-diskimage\":{\"source\":\"apache\",\"extensions\":[\"dmg\"]},\"application/x-arj\":{\"compressible\":false,\"extensions\":[\"arj\"]},\"application/x-authorware-bin\":{\"source\":\"apache\",\"extensions\":[\"aab\",\"x32\",\"u32\",\"vox\"]},\"application/x-authorware-map\":{\"source\":\"apache\",\"extensions\":[\"aam\"]},\"application/x-authorware-seg\":{\"source\":\"apache\",\"extensions\":[\"aas\"]},\"application/x-bcpio\":{\"source\":\"apache\",\"extensions\":[\"bcpio\"]},\"application/x-bdoc\":{\"compressible\":false,\"extensions\":[\"bdoc\"]},\"application/x-bittorrent\":{\"source\":\"apache\",\"extensions\":[\"torrent\"]},\"application/x-blorb\":{\"source\":\"apache\",\"extensions\":[\"blb\",\"blorb\"]},\"application/x-bzip\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"bz\"]},\"application/x-bzip2\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"bz2\",\"boz\"]},\"application/x-cbr\":{\"source\":\"apache\",\"extensions\":[\"cbr\",\"cba\",\"cbt\",\"cbz\",\"cb7\"]},\"application/x-cdlink\":{\"source\":\"apache\",\"extensions\":[\"vcd\"]},\"application/x-cfs-compressed\":{\"source\":\"apache\",\"extensions\":[\"cfs\"]},\"application/x-chat\":{\"source\":\"apache\",\"extensions\":[\"chat\"]},\"application/x-chess-pgn\":{\"source\":\"apache\",\"extensions\":[\"pgn\"]},\"application/x-chrome-extension\":{\"extensions\":[\"crx\"]},\"application/x-cocoa\":{\"source\":\"nginx\",\"extensions\":[\"cco\"]},\"application/x-compress\":{\"source\":\"apache\"},\"application/x-conference\":{\"source\":\"apache\",\"extensions\":[\"nsc\"]},\"application/x-cpio\":{\"source\":\"apache\",\"extensions\":[\"cpio\"]},\"application/x-csh\":{\"source\":\"apache\",\"extensions\":[\"csh\"]},\"application/x-deb\":{\"compressible\":false},\"application/x-debian-package\":{\"source\":\"apache\",\"extensions\":[\"deb\",\"udeb\"]},\"application/x-dgc-compressed\":{\"source\":\"apache\",\"extensions\":[\"dgc\"]},\"application/x-director\":{\"source\":\"apache\",\"extensions\":[\"dir\",\"dcr\",\"dxr\",\"cst\",\"cct\",\"cxt\",\"w3d\",\"fgd\",\"swa\"]},\"application/x-doom\":{\"source\":\"apache\",\"extensions\":[\"wad\"]},\"application/x-dtbncx+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"ncx\"]},\"application/x-dtbook+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"dtb\"]},\"application/x-dtbresource+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"res\"]},\"application/x-dvi\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"dvi\"]},\"application/x-envoy\":{\"source\":\"apache\",\"extensions\":[\"evy\"]},\"application/x-eva\":{\"source\":\"apache\",\"extensions\":[\"eva\"]},\"application/x-font-bdf\":{\"source\":\"apache\",\"extensions\":[\"bdf\"]},\"application/x-font-dos\":{\"source\":\"apache\"},\"application/x-font-framemaker\":{\"source\":\"apache\"},\"application/x-font-ghostscript\":{\"source\":\"apache\",\"extensions\":[\"gsf\"]},\"application/x-font-libgrx\":{\"source\":\"apache\"},\"application/x-font-linux-psf\":{\"source\":\"apache\",\"extensions\":[\"psf\"]},\"application/x-font-pcf\":{\"source\":\"apache\",\"extensions\":[\"pcf\"]},\"application/x-font-snf\":{\"source\":\"apache\",\"extensions\":[\"snf\"]},\"application/x-font-speedo\":{\"source\":\"apache\"},\"application/x-font-sunos-news\":{\"source\":\"apache\"},\"application/x-font-type1\":{\"source\":\"apache\",\"extensions\":[\"pfa\",\"pfb\",\"pfm\",\"afm\"]},\"application/x-font-vfont\":{\"source\":\"apache\"},\"application/x-freearc\":{\"source\":\"apache\",\"extensions\":[\"arc\"]},\"application/x-futuresplash\":{\"source\":\"apache\",\"extensions\":[\"spl\"]},\"application/x-gca-compressed\":{\"source\":\"apache\",\"extensions\":[\"gca\"]},\"application/x-glulx\":{\"source\":\"apache\",\"extensions\":[\"ulx\"]},\"application/x-gnumeric\":{\"source\":\"apache\",\"extensions\":[\"gnumeric\"]},\"application/x-gramps-xml\":{\"source\":\"apache\",\"extensions\":[\"gramps\"]},\"application/x-gtar\":{\"source\":\"apache\",\"extensions\":[\"gtar\"]},\"application/x-gzip\":{\"source\":\"apache\"},\"application/x-hdf\":{\"source\":\"apache\",\"extensions\":[\"hdf\"]},\"application/x-httpd-php\":{\"compressible\":true,\"extensions\":[\"php\"]},\"application/x-install-instructions\":{\"source\":\"apache\",\"extensions\":[\"install\"]},\"application/x-iso9660-image\":{\"source\":\"apache\",\"extensions\":[\"iso\"]},\"application/x-java-archive-diff\":{\"source\":\"nginx\",\"extensions\":[\"jardiff\"]},\"application/x-java-jnlp-file\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"jnlp\"]},\"application/x-javascript\":{\"compressible\":true},\"application/x-latex\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"latex\"]},\"application/x-lua-bytecode\":{\"extensions\":[\"luac\"]},\"application/x-lzh-compressed\":{\"source\":\"apache\",\"extensions\":[\"lzh\",\"lha\"]},\"application/x-makeself\":{\"source\":\"nginx\",\"extensions\":[\"run\"]},\"application/x-mie\":{\"source\":\"apache\",\"extensions\":[\"mie\"]},\"application/x-mobipocket-ebook\":{\"source\":\"apache\",\"extensions\":[\"prc\",\"mobi\"]},\"application/x-mpegurl\":{\"compressible\":false},\"application/x-ms-application\":{\"source\":\"apache\",\"extensions\":[\"application\"]},\"application/x-ms-shortcut\":{\"source\":\"apache\",\"extensions\":[\"lnk\"]},\"application/x-ms-wmd\":{\"source\":\"apache\",\"extensions\":[\"wmd\"]},\"application/x-ms-wmz\":{\"source\":\"apache\",\"extensions\":[\"wmz\"]},\"application/x-ms-xbap\":{\"source\":\"apache\",\"extensions\":[\"xbap\"]},\"application/x-msaccess\":{\"source\":\"apache\",\"extensions\":[\"mdb\"]},\"application/x-msbinder\":{\"source\":\"apache\",\"extensions\":[\"obd\"]},\"application/x-mscardfile\":{\"source\":\"apache\",\"extensions\":[\"crd\"]},\"application/x-msclip\":{\"source\":\"apache\",\"extensions\":[\"clp\"]},\"application/x-msdos-program\":{\"extensions\":[\"exe\"]},\"application/x-msdownload\":{\"source\":\"apache\",\"extensions\":[\"exe\",\"dll\",\"com\",\"bat\",\"msi\"]},\"application/x-msmediaview\":{\"source\":\"apache\",\"extensions\":[\"mvb\",\"m13\",\"m14\"]},\"application/x-msmetafile\":{\"source\":\"apache\",\"extensions\":[\"wmf\",\"wmz\",\"emf\",\"emz\"]},\"application/x-msmoney\":{\"source\":\"apache\",\"extensions\":[\"mny\"]},\"application/x-mspublisher\":{\"source\":\"apache\",\"extensions\":[\"pub\"]},\"application/x-msschedule\":{\"source\":\"apache\",\"extensions\":[\"scd\"]},\"application/x-msterminal\":{\"source\":\"apache\",\"extensions\":[\"trm\"]},\"application/x-mswrite\":{\"source\":\"apache\",\"extensions\":[\"wri\"]},\"application/x-netcdf\":{\"source\":\"apache\",\"extensions\":[\"nc\",\"cdf\"]},\"application/x-ns-proxy-autoconfig\":{\"compressible\":true,\"extensions\":[\"pac\"]},\"application/x-nzb\":{\"source\":\"apache\",\"extensions\":[\"nzb\"]},\"application/x-perl\":{\"source\":\"nginx\",\"extensions\":[\"pl\",\"pm\"]},\"application/x-pilot\":{\"source\":\"nginx\",\"extensions\":[\"prc\",\"pdb\"]},\"application/x-pkcs12\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"p12\",\"pfx\"]},\"application/x-pkcs7-certificates\":{\"source\":\"apache\",\"extensions\":[\"p7b\",\"spc\"]},\"application/x-pkcs7-certreqresp\":{\"source\":\"apache\",\"extensions\":[\"p7r\"]},\"application/x-rar-compressed\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"rar\"]},\"application/x-redhat-package-manager\":{\"source\":\"nginx\",\"extensions\":[\"rpm\"]},\"application/x-research-info-systems\":{\"source\":\"apache\",\"extensions\":[\"ris\"]},\"application/x-sea\":{\"source\":\"nginx\",\"extensions\":[\"sea\"]},\"application/x-sh\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"sh\"]},\"application/x-shar\":{\"source\":\"apache\",\"extensions\":[\"shar\"]},\"application/x-shockwave-flash\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"swf\"]},\"application/x-silverlight-app\":{\"source\":\"apache\",\"extensions\":[\"xap\"]},\"application/x-sql\":{\"source\":\"apache\",\"extensions\":[\"sql\"]},\"application/x-stuffit\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"sit\"]},\"application/x-stuffitx\":{\"source\":\"apache\",\"extensions\":[\"sitx\"]},\"application/x-subrip\":{\"source\":\"apache\",\"extensions\":[\"srt\"]},\"application/x-sv4cpio\":{\"source\":\"apache\",\"extensions\":[\"sv4cpio\"]},\"application/x-sv4crc\":{\"source\":\"apache\",\"extensions\":[\"sv4crc\"]},\"application/x-t3vm-image\":{\"source\":\"apache\",\"extensions\":[\"t3\"]},\"application/x-tads\":{\"source\":\"apache\",\"extensions\":[\"gam\"]},\"application/x-tar\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"tar\"]},\"application/x-tcl\":{\"source\":\"apache\",\"extensions\":[\"tcl\",\"tk\"]},\"application/x-tex\":{\"source\":\"apache\",\"extensions\":[\"tex\"]},\"application/x-tex-tfm\":{\"source\":\"apache\",\"extensions\":[\"tfm\"]},\"application/x-texinfo\":{\"source\":\"apache\",\"extensions\":[\"texinfo\",\"texi\"]},\"application/x-tgif\":{\"source\":\"apache\",\"extensions\":[\"obj\"]},\"application/x-ustar\":{\"source\":\"apache\",\"extensions\":[\"ustar\"]},\"application/x-virtualbox-hdd\":{\"compressible\":true,\"extensions\":[\"hdd\"]},\"application/x-virtualbox-ova\":{\"compressible\":true,\"extensions\":[\"ova\"]},\"application/x-virtualbox-ovf\":{\"compressible\":true,\"extensions\":[\"ovf\"]},\"application/x-virtualbox-vbox\":{\"compressible\":true,\"extensions\":[\"vbox\"]},\"application/x-virtualbox-vbox-extpack\":{\"compressible\":false,\"extensions\":[\"vbox-extpack\"]},\"application/x-virtualbox-vdi\":{\"compressible\":true,\"extensions\":[\"vdi\"]},\"application/x-virtualbox-vhd\":{\"compressible\":true,\"extensions\":[\"vhd\"]},\"application/x-virtualbox-vmdk\":{\"compressible\":true,\"extensions\":[\"vmdk\"]},\"application/x-wais-source\":{\"source\":\"apache\",\"extensions\":[\"src\"]},\"application/x-web-app-manifest+json\":{\"compressible\":true,\"extensions\":[\"webapp\"]},\"application/x-www-form-urlencoded\":{\"source\":\"iana\",\"compressible\":true},\"application/x-x509-ca-cert\":{\"source\":\"apache\",\"extensions\":[\"der\",\"crt\",\"pem\"]},\"application/x-xfig\":{\"source\":\"apache\",\"extensions\":[\"fig\"]},\"application/x-xliff+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"xlf\"]},\"application/x-xpinstall\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"xpi\"]},\"application/x-xz\":{\"source\":\"apache\",\"extensions\":[\"xz\"]},\"application/x-zmachine\":{\"source\":\"apache\",\"extensions\":[\"z1\",\"z2\",\"z3\",\"z4\",\"z5\",\"z6\",\"z7\",\"z8\"]},\"application/x400-bp\":{\"source\":\"iana\"},\"application/xacml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xaml+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"xaml\"]},\"application/xcap-att+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xcap-caps+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xcap-diff+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xdf\"]},\"application/xcap-el+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xcap-error+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xcap-ns+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xcon-conference-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xcon-conference-info-diff+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xenc+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xenc\"]},\"application/xhtml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xhtml\",\"xht\"]},\"application/xhtml-voice+xml\":{\"source\":\"apache\",\"compressible\":true},\"application/xliff+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xml\",\"xsl\",\"xsd\",\"rng\"]},\"application/xml-dtd\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"dtd\"]},\"application/xml-external-parsed-entity\":{\"source\":\"iana\"},\"application/xml-patch+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xmpp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xop+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xop\"]},\"application/xproc+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"xpl\"]},\"application/xslt+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xslt\"]},\"application/xspf+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"xspf\"]},\"application/xv+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mxml\",\"xhvml\",\"xvml\",\"xvm\"]},\"application/yang\":{\"source\":\"iana\",\"extensions\":[\"yang\"]},\"application/yang-data+json\":{\"source\":\"iana\",\"compressible\":true},\"application/yang-data+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/yang-patch+json\":{\"source\":\"iana\",\"compressible\":true},\"application/yang-patch+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/yin+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"yin\"]},\"application/zip\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"zip\"]},\"application/zlib\":{\"source\":\"iana\"},\"application/zstd\":{\"source\":\"iana\"},\"audio/1d-interleaved-parityfec\":{\"source\":\"iana\"},\"audio/32kadpcm\":{\"source\":\"iana\"},\"audio/3gpp\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"3gpp\"]},\"audio/3gpp2\":{\"source\":\"iana\"},\"audio/aac\":{\"source\":\"iana\"},\"audio/ac3\":{\"source\":\"iana\"},\"audio/adpcm\":{\"source\":\"apache\",\"extensions\":[\"adp\"]},\"audio/amr\":{\"source\":\"iana\"},\"audio/amr-wb\":{\"source\":\"iana\"},\"audio/amr-wb+\":{\"source\":\"iana\"},\"audio/aptx\":{\"source\":\"iana\"},\"audio/asc\":{\"source\":\"iana\"},\"audio/atrac-advanced-lossless\":{\"source\":\"iana\"},\"audio/atrac-x\":{\"source\":\"iana\"},\"audio/atrac3\":{\"source\":\"iana\"},\"audio/basic\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"au\",\"snd\"]},\"audio/bv16\":{\"source\":\"iana\"},\"audio/bv32\":{\"source\":\"iana\"},\"audio/clearmode\":{\"source\":\"iana\"},\"audio/cn\":{\"source\":\"iana\"},\"audio/dat12\":{\"source\":\"iana\"},\"audio/dls\":{\"source\":\"iana\"},\"audio/dsr-es201108\":{\"source\":\"iana\"},\"audio/dsr-es202050\":{\"source\":\"iana\"},\"audio/dsr-es202211\":{\"source\":\"iana\"},\"audio/dsr-es202212\":{\"source\":\"iana\"},\"audio/dv\":{\"source\":\"iana\"},\"audio/dvi4\":{\"source\":\"iana\"},\"audio/eac3\":{\"source\":\"iana\"},\"audio/encaprtp\":{\"source\":\"iana\"},\"audio/evrc\":{\"source\":\"iana\"},\"audio/evrc-qcp\":{\"source\":\"iana\"},\"audio/evrc0\":{\"source\":\"iana\"},\"audio/evrc1\":{\"source\":\"iana\"},\"audio/evrcb\":{\"source\":\"iana\"},\"audio/evrcb0\":{\"source\":\"iana\"},\"audio/evrcb1\":{\"source\":\"iana\"},\"audio/evrcnw\":{\"source\":\"iana\"},\"audio/evrcnw0\":{\"source\":\"iana\"},\"audio/evrcnw1\":{\"source\":\"iana\"},\"audio/evrcwb\":{\"source\":\"iana\"},\"audio/evrcwb0\":{\"source\":\"iana\"},\"audio/evrcwb1\":{\"source\":\"iana\"},\"audio/evs\":{\"source\":\"iana\"},\"audio/fwdred\":{\"source\":\"iana\"},\"audio/g711-0\":{\"source\":\"iana\"},\"audio/g719\":{\"source\":\"iana\"},\"audio/g722\":{\"source\":\"iana\"},\"audio/g7221\":{\"source\":\"iana\"},\"audio/g723\":{\"source\":\"iana\"},\"audio/g726-16\":{\"source\":\"iana\"},\"audio/g726-24\":{\"source\":\"iana\"},\"audio/g726-32\":{\"source\":\"iana\"},\"audio/g726-40\":{\"source\":\"iana\"},\"audio/g728\":{\"source\":\"iana\"},\"audio/g729\":{\"source\":\"iana\"},\"audio/g7291\":{\"source\":\"iana\"},\"audio/g729d\":{\"source\":\"iana\"},\"audio/g729e\":{\"source\":\"iana\"},\"audio/gsm\":{\"source\":\"iana\"},\"audio/gsm-efr\":{\"source\":\"iana\"},\"audio/gsm-hr-08\":{\"source\":\"iana\"},\"audio/ilbc\":{\"source\":\"iana\"},\"audio/ip-mr_v2.5\":{\"source\":\"iana\"},\"audio/isac\":{\"source\":\"apache\"},\"audio/l16\":{\"source\":\"iana\"},\"audio/l20\":{\"source\":\"iana\"},\"audio/l24\":{\"source\":\"iana\",\"compressible\":false},\"audio/l8\":{\"source\":\"iana\"},\"audio/lpc\":{\"source\":\"iana\"},\"audio/melp\":{\"source\":\"iana\"},\"audio/melp1200\":{\"source\":\"iana\"},\"audio/melp2400\":{\"source\":\"iana\"},\"audio/melp600\":{\"source\":\"iana\"},\"audio/midi\":{\"source\":\"apache\",\"extensions\":[\"mid\",\"midi\",\"kar\",\"rmi\"]},\"audio/mobile-xmf\":{\"source\":\"iana\"},\"audio/mp3\":{\"compressible\":false,\"extensions\":[\"mp3\"]},\"audio/mp4\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"m4a\",\"mp4a\"]},\"audio/mp4a-latm\":{\"source\":\"iana\"},\"audio/mpa\":{\"source\":\"iana\"},\"audio/mpa-robust\":{\"source\":\"iana\"},\"audio/mpeg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"mpga\",\"mp2\",\"mp2a\",\"mp3\",\"m2a\",\"m3a\"]},\"audio/mpeg4-generic\":{\"source\":\"iana\"},\"audio/musepack\":{\"source\":\"apache\"},\"audio/ogg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"oga\",\"ogg\",\"spx\"]},\"audio/opus\":{\"source\":\"iana\"},\"audio/parityfec\":{\"source\":\"iana\"},\"audio/pcma\":{\"source\":\"iana\"},\"audio/pcma-wb\":{\"source\":\"iana\"},\"audio/pcmu\":{\"source\":\"iana\"},\"audio/pcmu-wb\":{\"source\":\"iana\"},\"audio/prs.sid\":{\"source\":\"iana\"},\"audio/qcelp\":{\"source\":\"iana\"},\"audio/raptorfec\":{\"source\":\"iana\"},\"audio/red\":{\"source\":\"iana\"},\"audio/rtp-enc-aescm128\":{\"source\":\"iana\"},\"audio/rtp-midi\":{\"source\":\"iana\"},\"audio/rtploopback\":{\"source\":\"iana\"},\"audio/rtx\":{\"source\":\"iana\"},\"audio/s3m\":{\"source\":\"apache\",\"extensions\":[\"s3m\"]},\"audio/silk\":{\"source\":\"apache\",\"extensions\":[\"sil\"]},\"audio/smv\":{\"source\":\"iana\"},\"audio/smv-qcp\":{\"source\":\"iana\"},\"audio/smv0\":{\"source\":\"iana\"},\"audio/sp-midi\":{\"source\":\"iana\"},\"audio/speex\":{\"source\":\"iana\"},\"audio/t140c\":{\"source\":\"iana\"},\"audio/t38\":{\"source\":\"iana\"},\"audio/telephone-event\":{\"source\":\"iana\"},\"audio/tetra_acelp\":{\"source\":\"iana\"},\"audio/tone\":{\"source\":\"iana\"},\"audio/uemclip\":{\"source\":\"iana\"},\"audio/ulpfec\":{\"source\":\"iana\"},\"audio/usac\":{\"source\":\"iana\"},\"audio/vdvi\":{\"source\":\"iana\"},\"audio/vmr-wb\":{\"source\":\"iana\"},\"audio/vnd.3gpp.iufp\":{\"source\":\"iana\"},\"audio/vnd.4sb\":{\"source\":\"iana\"},\"audio/vnd.audiokoz\":{\"source\":\"iana\"},\"audio/vnd.celp\":{\"source\":\"iana\"},\"audio/vnd.cisco.nse\":{\"source\":\"iana\"},\"audio/vnd.cmles.radio-events\":{\"source\":\"iana\"},\"audio/vnd.cns.anp1\":{\"source\":\"iana\"},\"audio/vnd.cns.inf1\":{\"source\":\"iana\"},\"audio/vnd.dece.audio\":{\"source\":\"iana\",\"extensions\":[\"uva\",\"uvva\"]},\"audio/vnd.digital-winds\":{\"source\":\"iana\",\"extensions\":[\"eol\"]},\"audio/vnd.dlna.adts\":{\"source\":\"iana\"},\"audio/vnd.dolby.heaac.1\":{\"source\":\"iana\"},\"audio/vnd.dolby.heaac.2\":{\"source\":\"iana\"},\"audio/vnd.dolby.mlp\":{\"source\":\"iana\"},\"audio/vnd.dolby.mps\":{\"source\":\"iana\"},\"audio/vnd.dolby.pl2\":{\"source\":\"iana\"},\"audio/vnd.dolby.pl2x\":{\"source\":\"iana\"},\"audio/vnd.dolby.pl2z\":{\"source\":\"iana\"},\"audio/vnd.dolby.pulse.1\":{\"source\":\"iana\"},\"audio/vnd.dra\":{\"source\":\"iana\",\"extensions\":[\"dra\"]},\"audio/vnd.dts\":{\"source\":\"iana\",\"extensions\":[\"dts\"]},\"audio/vnd.dts.hd\":{\"source\":\"iana\",\"extensions\":[\"dtshd\"]},\"audio/vnd.dts.uhd\":{\"source\":\"iana\"},\"audio/vnd.dvb.file\":{\"source\":\"iana\"},\"audio/vnd.everad.plj\":{\"source\":\"iana\"},\"audio/vnd.hns.audio\":{\"source\":\"iana\"},\"audio/vnd.lucent.voice\":{\"source\":\"iana\",\"extensions\":[\"lvp\"]},\"audio/vnd.ms-playready.media.pya\":{\"source\":\"iana\",\"extensions\":[\"pya\"]},\"audio/vnd.nokia.mobile-xmf\":{\"source\":\"iana\"},\"audio/vnd.nortel.vbk\":{\"source\":\"iana\"},\"audio/vnd.nuera.ecelp4800\":{\"source\":\"iana\",\"extensions\":[\"ecelp4800\"]},\"audio/vnd.nuera.ecelp7470\":{\"source\":\"iana\",\"extensions\":[\"ecelp7470\"]},\"audio/vnd.nuera.ecelp9600\":{\"source\":\"iana\",\"extensions\":[\"ecelp9600\"]},\"audio/vnd.octel.sbc\":{\"source\":\"iana\"},\"audio/vnd.presonus.multitrack\":{\"source\":\"iana\"},\"audio/vnd.qcelp\":{\"source\":\"iana\"},\"audio/vnd.rhetorex.32kadpcm\":{\"source\":\"iana\"},\"audio/vnd.rip\":{\"source\":\"iana\",\"extensions\":[\"rip\"]},\"audio/vnd.rn-realaudio\":{\"compressible\":false},\"audio/vnd.sealedmedia.softseal.mpeg\":{\"source\":\"iana\"},\"audio/vnd.vmx.cvsd\":{\"source\":\"iana\"},\"audio/vnd.wave\":{\"compressible\":false},\"audio/vorbis\":{\"source\":\"iana\",\"compressible\":false},\"audio/vorbis-config\":{\"source\":\"iana\"},\"audio/wav\":{\"compressible\":false,\"extensions\":[\"wav\"]},\"audio/wave\":{\"compressible\":false,\"extensions\":[\"wav\"]},\"audio/webm\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"weba\"]},\"audio/x-aac\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"aac\"]},\"audio/x-aiff\":{\"source\":\"apache\",\"extensions\":[\"aif\",\"aiff\",\"aifc\"]},\"audio/x-caf\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"caf\"]},\"audio/x-flac\":{\"source\":\"apache\",\"extensions\":[\"flac\"]},\"audio/x-m4a\":{\"source\":\"nginx\",\"extensions\":[\"m4a\"]},\"audio/x-matroska\":{\"source\":\"apache\",\"extensions\":[\"mka\"]},\"audio/x-mpegurl\":{\"source\":\"apache\",\"extensions\":[\"m3u\"]},\"audio/x-ms-wax\":{\"source\":\"apache\",\"extensions\":[\"wax\"]},\"audio/x-ms-wma\":{\"source\":\"apache\",\"extensions\":[\"wma\"]},\"audio/x-pn-realaudio\":{\"source\":\"apache\",\"extensions\":[\"ram\",\"ra\"]},\"audio/x-pn-realaudio-plugin\":{\"source\":\"apache\",\"extensions\":[\"rmp\"]},\"audio/x-realaudio\":{\"source\":\"nginx\",\"extensions\":[\"ra\"]},\"audio/x-tta\":{\"source\":\"apache\"},\"audio/x-wav\":{\"source\":\"apache\",\"extensions\":[\"wav\"]},\"audio/xm\":{\"source\":\"apache\",\"extensions\":[\"xm\"]},\"chemical/x-cdx\":{\"source\":\"apache\",\"extensions\":[\"cdx\"]},\"chemical/x-cif\":{\"source\":\"apache\",\"extensions\":[\"cif\"]},\"chemical/x-cmdf\":{\"source\":\"apache\",\"extensions\":[\"cmdf\"]},\"chemical/x-cml\":{\"source\":\"apache\",\"extensions\":[\"cml\"]},\"chemical/x-csml\":{\"source\":\"apache\",\"extensions\":[\"csml\"]},\"chemical/x-pdb\":{\"source\":\"apache\"},\"chemical/x-xyz\":{\"source\":\"apache\",\"extensions\":[\"xyz\"]},\"font/collection\":{\"source\":\"iana\",\"extensions\":[\"ttc\"]},\"font/otf\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"otf\"]},\"font/sfnt\":{\"source\":\"iana\"},\"font/ttf\":{\"source\":\"iana\",\"extensions\":[\"ttf\"]},\"font/woff\":{\"source\":\"iana\",\"extensions\":[\"woff\"]},\"font/woff2\":{\"source\":\"iana\",\"extensions\":[\"woff2\"]},\"image/aces\":{\"source\":\"iana\",\"extensions\":[\"exr\"]},\"image/apng\":{\"compressible\":false,\"extensions\":[\"apng\"]},\"image/avci\":{\"source\":\"iana\"},\"image/avcs\":{\"source\":\"iana\"},\"image/bmp\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"bmp\"]},\"image/cgm\":{\"source\":\"iana\",\"extensions\":[\"cgm\"]},\"image/dicom-rle\":{\"source\":\"iana\",\"extensions\":[\"drle\"]},\"image/emf\":{\"source\":\"iana\",\"extensions\":[\"emf\"]},\"image/fits\":{\"source\":\"iana\",\"extensions\":[\"fits\"]},\"image/g3fax\":{\"source\":\"iana\",\"extensions\":[\"g3\"]},\"image/gif\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"gif\"]},\"image/heic\":{\"source\":\"iana\",\"extensions\":[\"heic\"]},\"image/heic-sequence\":{\"source\":\"iana\",\"extensions\":[\"heics\"]},\"image/heif\":{\"source\":\"iana\",\"extensions\":[\"heif\"]},\"image/heif-sequence\":{\"source\":\"iana\",\"extensions\":[\"heifs\"]},\"image/ief\":{\"source\":\"iana\",\"extensions\":[\"ief\"]},\"image/jls\":{\"source\":\"iana\",\"extensions\":[\"jls\"]},\"image/jp2\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"jp2\",\"jpg2\"]},\"image/jpeg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"jpeg\",\"jpg\",\"jpe\"]},\"image/jpm\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"jpm\"]},\"image/jpx\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"jpx\",\"jpf\"]},\"image/jxr\":{\"source\":\"iana\",\"extensions\":[\"jxr\"]},\"image/ktx\":{\"source\":\"iana\",\"extensions\":[\"ktx\"]},\"image/naplps\":{\"source\":\"iana\"},\"image/pjpeg\":{\"compressible\":false},\"image/png\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"png\"]},\"image/prs.btif\":{\"source\":\"iana\",\"extensions\":[\"btif\"]},\"image/prs.pti\":{\"source\":\"iana\",\"extensions\":[\"pti\"]},\"image/pwg-raster\":{\"source\":\"iana\"},\"image/sgi\":{\"source\":\"apache\",\"extensions\":[\"sgi\"]},\"image/svg+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"svg\",\"svgz\"]},\"image/t38\":{\"source\":\"iana\",\"extensions\":[\"t38\"]},\"image/tiff\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"tif\",\"tiff\"]},\"image/tiff-fx\":{\"source\":\"iana\",\"extensions\":[\"tfx\"]},\"image/vnd.adobe.photoshop\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"psd\"]},\"image/vnd.airzip.accelerator.azv\":{\"source\":\"iana\",\"extensions\":[\"azv\"]},\"image/vnd.cns.inf2\":{\"source\":\"iana\"},\"image/vnd.dece.graphic\":{\"source\":\"iana\",\"extensions\":[\"uvi\",\"uvvi\",\"uvg\",\"uvvg\"]},\"image/vnd.djvu\":{\"source\":\"iana\",\"extensions\":[\"djvu\",\"djv\"]},\"image/vnd.dvb.subtitle\":{\"source\":\"iana\",\"extensions\":[\"sub\"]},\"image/vnd.dwg\":{\"source\":\"iana\",\"extensions\":[\"dwg\"]},\"image/vnd.dxf\":{\"source\":\"iana\",\"extensions\":[\"dxf\"]},\"image/vnd.fastbidsheet\":{\"source\":\"iana\",\"extensions\":[\"fbs\"]},\"image/vnd.fpx\":{\"source\":\"iana\",\"extensions\":[\"fpx\"]},\"image/vnd.fst\":{\"source\":\"iana\",\"extensions\":[\"fst\"]},\"image/vnd.fujixerox.edmics-mmr\":{\"source\":\"iana\",\"extensions\":[\"mmr\"]},\"image/vnd.fujixerox.edmics-rlc\":{\"source\":\"iana\",\"extensions\":[\"rlc\"]},\"image/vnd.globalgraphics.pgb\":{\"source\":\"iana\"},\"image/vnd.microsoft.icon\":{\"source\":\"iana\",\"extensions\":[\"ico\"]},\"image/vnd.mix\":{\"source\":\"iana\"},\"image/vnd.mozilla.apng\":{\"source\":\"iana\"},\"image/vnd.ms-modi\":{\"source\":\"iana\",\"extensions\":[\"mdi\"]},\"image/vnd.ms-photo\":{\"source\":\"apache\",\"extensions\":[\"wdp\"]},\"image/vnd.net-fpx\":{\"source\":\"iana\",\"extensions\":[\"npx\"]},\"image/vnd.radiance\":{\"source\":\"iana\"},\"image/vnd.sealed.png\":{\"source\":\"iana\"},\"image/vnd.sealedmedia.softseal.gif\":{\"source\":\"iana\"},\"image/vnd.sealedmedia.softseal.jpg\":{\"source\":\"iana\"},\"image/vnd.svf\":{\"source\":\"iana\"},\"image/vnd.tencent.tap\":{\"source\":\"iana\",\"extensions\":[\"tap\"]},\"image/vnd.valve.source.texture\":{\"source\":\"iana\",\"extensions\":[\"vtf\"]},\"image/vnd.wap.wbmp\":{\"source\":\"iana\",\"extensions\":[\"wbmp\"]},\"image/vnd.xiff\":{\"source\":\"iana\",\"extensions\":[\"xif\"]},\"image/vnd.zbrush.pcx\":{\"source\":\"iana\",\"extensions\":[\"pcx\"]},\"image/webp\":{\"source\":\"apache\",\"extensions\":[\"webp\"]},\"image/wmf\":{\"source\":\"iana\",\"extensions\":[\"wmf\"]},\"image/x-3ds\":{\"source\":\"apache\",\"extensions\":[\"3ds\"]},\"image/x-cmu-raster\":{\"source\":\"apache\",\"extensions\":[\"ras\"]},\"image/x-cmx\":{\"source\":\"apache\",\"extensions\":[\"cmx\"]},\"image/x-freehand\":{\"source\":\"apache\",\"extensions\":[\"fh\",\"fhc\",\"fh4\",\"fh5\",\"fh7\"]},\"image/x-icon\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"ico\"]},\"image/x-jng\":{\"source\":\"nginx\",\"extensions\":[\"jng\"]},\"image/x-mrsid-image\":{\"source\":\"apache\",\"extensions\":[\"sid\"]},\"image/x-ms-bmp\":{\"source\":\"nginx\",\"compressible\":true,\"extensions\":[\"bmp\"]},\"image/x-pcx\":{\"source\":\"apache\",\"extensions\":[\"pcx\"]},\"image/x-pict\":{\"source\":\"apache\",\"extensions\":[\"pic\",\"pct\"]},\"image/x-portable-anymap\":{\"source\":\"apache\",\"extensions\":[\"pnm\"]},\"image/x-portable-bitmap\":{\"source\":\"apache\",\"extensions\":[\"pbm\"]},\"image/x-portable-graymap\":{\"source\":\"apache\",\"extensions\":[\"pgm\"]},\"image/x-portable-pixmap\":{\"source\":\"apache\",\"extensions\":[\"ppm\"]},\"image/x-rgb\":{\"source\":\"apache\",\"extensions\":[\"rgb\"]},\"image/x-tga\":{\"source\":\"apache\",\"extensions\":[\"tga\"]},\"image/x-xbitmap\":{\"source\":\"apache\",\"extensions\":[\"xbm\"]},\"image/x-xcf\":{\"compressible\":false},\"image/x-xpixmap\":{\"source\":\"apache\",\"extensions\":[\"xpm\"]},\"image/x-xwindowdump\":{\"source\":\"apache\",\"extensions\":[\"xwd\"]},\"message/cpim\":{\"source\":\"iana\"},\"message/delivery-status\":{\"source\":\"iana\"},\"message/disposition-notification\":{\"source\":\"iana\",\"extensions\":[\"disposition-notification\"]},\"message/external-body\":{\"source\":\"iana\"},\"message/feedback-report\":{\"source\":\"iana\"},\"message/global\":{\"source\":\"iana\",\"extensions\":[\"u8msg\"]},\"message/global-delivery-status\":{\"source\":\"iana\",\"extensions\":[\"u8dsn\"]},\"message/global-disposition-notification\":{\"source\":\"iana\",\"extensions\":[\"u8mdn\"]},\"message/global-headers\":{\"source\":\"iana\",\"extensions\":[\"u8hdr\"]},\"message/http\":{\"source\":\"iana\",\"compressible\":false},\"message/imdn+xml\":{\"source\":\"iana\",\"compressible\":true},\"message/news\":{\"source\":\"iana\"},\"message/partial\":{\"source\":\"iana\",\"compressible\":false},\"message/rfc822\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"eml\",\"mime\"]},\"message/s-http\":{\"source\":\"iana\"},\"message/sip\":{\"source\":\"iana\"},\"message/sipfrag\":{\"source\":\"iana\"},\"message/tracking-status\":{\"source\":\"iana\"},\"message/vnd.si.simp\":{\"source\":\"iana\"},\"message/vnd.wfa.wsc\":{\"source\":\"iana\",\"extensions\":[\"wsc\"]},\"model/3mf\":{\"source\":\"iana\",\"extensions\":[\"3mf\"]},\"model/gltf+json\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"gltf\"]},\"model/gltf-binary\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"glb\"]},\"model/iges\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"igs\",\"iges\"]},\"model/mesh\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"msh\",\"mesh\",\"silo\"]},\"model/stl\":{\"source\":\"iana\",\"extensions\":[\"stl\"]},\"model/vnd.collada+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"dae\"]},\"model/vnd.dwf\":{\"source\":\"iana\",\"extensions\":[\"dwf\"]},\"model/vnd.flatland.3dml\":{\"source\":\"iana\"},\"model/vnd.gdl\":{\"source\":\"iana\",\"extensions\":[\"gdl\"]},\"model/vnd.gs-gdl\":{\"source\":\"apache\"},\"model/vnd.gs.gdl\":{\"source\":\"iana\"},\"model/vnd.gtw\":{\"source\":\"iana\",\"extensions\":[\"gtw\"]},\"model/vnd.moml+xml\":{\"source\":\"iana\",\"compressible\":true},\"model/vnd.mts\":{\"source\":\"iana\",\"extensions\":[\"mts\"]},\"model/vnd.opengex\":{\"source\":\"iana\",\"extensions\":[\"ogex\"]},\"model/vnd.parasolid.transmit.binary\":{\"source\":\"iana\",\"extensions\":[\"x_b\"]},\"model/vnd.parasolid.transmit.text\":{\"source\":\"iana\",\"extensions\":[\"x_t\"]},\"model/vnd.rosette.annotated-data-model\":{\"source\":\"iana\"},\"model/vnd.usdz+zip\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"usdz\"]},\"model/vnd.valve.source.compiled-map\":{\"source\":\"iana\",\"extensions\":[\"bsp\"]},\"model/vnd.vtu\":{\"source\":\"iana\",\"extensions\":[\"vtu\"]},\"model/vrml\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"wrl\",\"vrml\"]},\"model/x3d+binary\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"x3db\",\"x3dbz\"]},\"model/x3d+fastinfoset\":{\"source\":\"iana\",\"extensions\":[\"x3db\"]},\"model/x3d+vrml\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"x3dv\",\"x3dvz\"]},\"model/x3d+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"x3d\",\"x3dz\"]},\"model/x3d-vrml\":{\"source\":\"iana\",\"extensions\":[\"x3dv\"]},\"multipart/alternative\":{\"source\":\"iana\",\"compressible\":false},\"multipart/appledouble\":{\"source\":\"iana\"},\"multipart/byteranges\":{\"source\":\"iana\"},\"multipart/digest\":{\"source\":\"iana\"},\"multipart/encrypted\":{\"source\":\"iana\",\"compressible\":false},\"multipart/form-data\":{\"source\":\"iana\",\"compressible\":false},\"multipart/header-set\":{\"source\":\"iana\"},\"multipart/mixed\":{\"source\":\"iana\",\"compressible\":false},\"multipart/multilingual\":{\"source\":\"iana\"},\"multipart/parallel\":{\"source\":\"iana\"},\"multipart/related\":{\"source\":\"iana\",\"compressible\":false},\"multipart/report\":{\"source\":\"iana\"},\"multipart/signed\":{\"source\":\"iana\",\"compressible\":false},\"multipart/vnd.bint.med-plus\":{\"source\":\"iana\"},\"multipart/voice-message\":{\"source\":\"iana\"},\"multipart/x-mixed-replace\":{\"source\":\"iana\"},\"text/1d-interleaved-parityfec\":{\"source\":\"iana\"},\"text/cache-manifest\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"appcache\",\"manifest\"]},\"text/calendar\":{\"source\":\"iana\",\"extensions\":[\"ics\",\"ifb\"]},\"text/calender\":{\"compressible\":true},\"text/cmd\":{\"compressible\":true},\"text/coffeescript\":{\"extensions\":[\"coffee\",\"litcoffee\"]},\"text/css\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"css\"]},\"text/csv\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"csv\"]},\"text/csv-schema\":{\"source\":\"iana\"},\"text/directory\":{\"source\":\"iana\"},\"text/dns\":{\"source\":\"iana\"},\"text/ecmascript\":{\"source\":\"iana\"},\"text/encaprtp\":{\"source\":\"iana\"},\"text/enriched\":{\"source\":\"iana\"},\"text/fwdred\":{\"source\":\"iana\"},\"text/grammar-ref-list\":{\"source\":\"iana\"},\"text/html\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"html\",\"htm\",\"shtml\"]},\"text/jade\":{\"extensions\":[\"jade\"]},\"text/javascript\":{\"source\":\"iana\",\"compressible\":true},\"text/jcr-cnd\":{\"source\":\"iana\"},\"text/jsx\":{\"compressible\":true,\"extensions\":[\"jsx\"]},\"text/less\":{\"compressible\":true,\"extensions\":[\"less\"]},\"text/markdown\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"markdown\",\"md\"]},\"text/mathml\":{\"source\":\"nginx\",\"extensions\":[\"mml\"]},\"text/mdx\":{\"compressible\":true,\"extensions\":[\"mdx\"]},\"text/mizar\":{\"source\":\"iana\"},\"text/n3\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"n3\"]},\"text/parameters\":{\"source\":\"iana\"},\"text/parityfec\":{\"source\":\"iana\"},\"text/plain\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"txt\",\"text\",\"conf\",\"def\",\"list\",\"log\",\"in\",\"ini\"]},\"text/provenance-notation\":{\"source\":\"iana\"},\"text/prs.fallenstein.rst\":{\"source\":\"iana\"},\"text/prs.lines.tag\":{\"source\":\"iana\",\"extensions\":[\"dsc\"]},\"text/prs.prop.logic\":{\"source\":\"iana\"},\"text/raptorfec\":{\"source\":\"iana\"},\"text/red\":{\"source\":\"iana\"},\"text/rfc822-headers\":{\"source\":\"iana\"},\"text/richtext\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rtx\"]},\"text/rtf\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rtf\"]},\"text/rtp-enc-aescm128\":{\"source\":\"iana\"},\"text/rtploopback\":{\"source\":\"iana\"},\"text/rtx\":{\"source\":\"iana\"},\"text/sgml\":{\"source\":\"iana\",\"extensions\":[\"sgml\",\"sgm\"]},\"text/shex\":{\"extensions\":[\"shex\"]},\"text/slim\":{\"extensions\":[\"slim\",\"slm\"]},\"text/strings\":{\"source\":\"iana\"},\"text/stylus\":{\"extensions\":[\"stylus\",\"styl\"]},\"text/t140\":{\"source\":\"iana\"},\"text/tab-separated-values\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"tsv\"]},\"text/troff\":{\"source\":\"iana\",\"extensions\":[\"t\",\"tr\",\"roff\",\"man\",\"me\",\"ms\"]},\"text/turtle\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"extensions\":[\"ttl\"]},\"text/ulpfec\":{\"source\":\"iana\"},\"text/uri-list\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"uri\",\"uris\",\"urls\"]},\"text/vcard\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"vcard\"]},\"text/vnd.a\":{\"source\":\"iana\"},\"text/vnd.abc\":{\"source\":\"iana\"},\"text/vnd.ascii-art\":{\"source\":\"iana\"},\"text/vnd.curl\":{\"source\":\"iana\",\"extensions\":[\"curl\"]},\"text/vnd.curl.dcurl\":{\"source\":\"apache\",\"extensions\":[\"dcurl\"]},\"text/vnd.curl.mcurl\":{\"source\":\"apache\",\"extensions\":[\"mcurl\"]},\"text/vnd.curl.scurl\":{\"source\":\"apache\",\"extensions\":[\"scurl\"]},\"text/vnd.debian.copyright\":{\"source\":\"iana\"},\"text/vnd.dmclientscript\":{\"source\":\"iana\"},\"text/vnd.dvb.subtitle\":{\"source\":\"iana\",\"extensions\":[\"sub\"]},\"text/vnd.esmertec.theme-descriptor\":{\"source\":\"iana\"},\"text/vnd.fly\":{\"source\":\"iana\",\"extensions\":[\"fly\"]},\"text/vnd.fmi.flexstor\":{\"source\":\"iana\",\"extensions\":[\"flx\"]},\"text/vnd.gml\":{\"source\":\"iana\"},\"text/vnd.graphviz\":{\"source\":\"iana\",\"extensions\":[\"gv\"]},\"text/vnd.hgl\":{\"source\":\"iana\"},\"text/vnd.in3d.3dml\":{\"source\":\"iana\",\"extensions\":[\"3dml\"]},\"text/vnd.in3d.spot\":{\"source\":\"iana\",\"extensions\":[\"spot\"]},\"text/vnd.iptc.newsml\":{\"source\":\"iana\"},\"text/vnd.iptc.nitf\":{\"source\":\"iana\"},\"text/vnd.latex-z\":{\"source\":\"iana\"},\"text/vnd.motorola.reflex\":{\"source\":\"iana\"},\"text/vnd.ms-mediapackage\":{\"source\":\"iana\"},\"text/vnd.net2phone.commcenter.command\":{\"source\":\"iana\"},\"text/vnd.radisys.msml-basic-layout\":{\"source\":\"iana\"},\"text/vnd.senx.warpscript\":{\"source\":\"iana\"},\"text/vnd.si.uricatalogue\":{\"source\":\"iana\"},\"text/vnd.sun.j2me.app-descriptor\":{\"source\":\"iana\",\"extensions\":[\"jad\"]},\"text/vnd.trolltech.linguist\":{\"source\":\"iana\"},\"text/vnd.wap.si\":{\"source\":\"iana\"},\"text/vnd.wap.sl\":{\"source\":\"iana\"},\"text/vnd.wap.wml\":{\"source\":\"iana\",\"extensions\":[\"wml\"]},\"text/vnd.wap.wmlscript\":{\"source\":\"iana\",\"extensions\":[\"wmls\"]},\"text/vtt\":{\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"vtt\"]},\"text/x-asm\":{\"source\":\"apache\",\"extensions\":[\"s\",\"asm\"]},\"text/x-c\":{\"source\":\"apache\",\"extensions\":[\"c\",\"cc\",\"cxx\",\"cpp\",\"h\",\"hh\",\"dic\"]},\"text/x-component\":{\"source\":\"nginx\",\"extensions\":[\"htc\"]},\"text/x-fortran\":{\"source\":\"apache\",\"extensions\":[\"f\",\"for\",\"f77\",\"f90\"]},\"text/x-gwt-rpc\":{\"compressible\":true},\"text/x-handlebars-template\":{\"extensions\":[\"hbs\"]},\"text/x-java-source\":{\"source\":\"apache\",\"extensions\":[\"java\"]},\"text/x-jquery-tmpl\":{\"compressible\":true},\"text/x-lua\":{\"extensions\":[\"lua\"]},\"text/x-markdown\":{\"compressible\":true,\"extensions\":[\"mkd\"]},\"text/x-nfo\":{\"source\":\"apache\",\"extensions\":[\"nfo\"]},\"text/x-opml\":{\"source\":\"apache\",\"extensions\":[\"opml\"]},\"text/x-org\":{\"compressible\":true,\"extensions\":[\"org\"]},\"text/x-pascal\":{\"source\":\"apache\",\"extensions\":[\"p\",\"pas\"]},\"text/x-processing\":{\"compressible\":true,\"extensions\":[\"pde\"]},\"text/x-sass\":{\"extensions\":[\"sass\"]},\"text/x-scss\":{\"extensions\":[\"scss\"]},\"text/x-setext\":{\"source\":\"apache\",\"extensions\":[\"etx\"]},\"text/x-sfv\":{\"source\":\"apache\",\"extensions\":[\"sfv\"]},\"text/x-suse-ymp\":{\"compressible\":true,\"extensions\":[\"ymp\"]},\"text/x-uuencode\":{\"source\":\"apache\",\"extensions\":[\"uu\"]},\"text/x-vcalendar\":{\"source\":\"apache\",\"extensions\":[\"vcs\"]},\"text/x-vcard\":{\"source\":\"apache\",\"extensions\":[\"vcf\"]},\"text/xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xml\"]},\"text/xml-external-parsed-entity\":{\"source\":\"iana\"},\"text/yaml\":{\"extensions\":[\"yaml\",\"yml\"]},\"video/1d-interleaved-parityfec\":{\"source\":\"iana\"},\"video/3gpp\":{\"source\":\"iana\",\"extensions\":[\"3gp\",\"3gpp\"]},\"video/3gpp-tt\":{\"source\":\"iana\"},\"video/3gpp2\":{\"source\":\"iana\",\"extensions\":[\"3g2\"]},\"video/bmpeg\":{\"source\":\"iana\"},\"video/bt656\":{\"source\":\"iana\"},\"video/celb\":{\"source\":\"iana\"},\"video/dv\":{\"source\":\"iana\"},\"video/encaprtp\":{\"source\":\"iana\"},\"video/h261\":{\"source\":\"iana\",\"extensions\":[\"h261\"]},\"video/h263\":{\"source\":\"iana\",\"extensions\":[\"h263\"]},\"video/h263-1998\":{\"source\":\"iana\"},\"video/h263-2000\":{\"source\":\"iana\"},\"video/h264\":{\"source\":\"iana\",\"extensions\":[\"h264\"]},\"video/h264-rcdo\":{\"source\":\"iana\"},\"video/h264-svc\":{\"source\":\"iana\"},\"video/h265\":{\"source\":\"iana\"},\"video/iso.segment\":{\"source\":\"iana\"},\"video/jpeg\":{\"source\":\"iana\",\"extensions\":[\"jpgv\"]},\"video/jpeg2000\":{\"source\":\"iana\"},\"video/jpm\":{\"source\":\"apache\",\"extensions\":[\"jpm\",\"jpgm\"]},\"video/mj2\":{\"source\":\"iana\",\"extensions\":[\"mj2\",\"mjp2\"]},\"video/mp1s\":{\"source\":\"iana\"},\"video/mp2p\":{\"source\":\"iana\"},\"video/mp2t\":{\"source\":\"iana\",\"extensions\":[\"ts\"]},\"video/mp4\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"mp4\",\"mp4v\",\"mpg4\"]},\"video/mp4v-es\":{\"source\":\"iana\"},\"video/mpeg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"mpeg\",\"mpg\",\"mpe\",\"m1v\",\"m2v\"]},\"video/mpeg4-generic\":{\"source\":\"iana\"},\"video/mpv\":{\"source\":\"iana\"},\"video/nv\":{\"source\":\"iana\"},\"video/ogg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"ogv\"]},\"video/parityfec\":{\"source\":\"iana\"},\"video/pointer\":{\"source\":\"iana\"},\"video/quicktime\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"qt\",\"mov\"]},\"video/raptorfec\":{\"source\":\"iana\"},\"video/raw\":{\"source\":\"iana\"},\"video/rtp-enc-aescm128\":{\"source\":\"iana\"},\"video/rtploopback\":{\"source\":\"iana\"},\"video/rtx\":{\"source\":\"iana\"},\"video/smpte291\":{\"source\":\"iana\"},\"video/smpte292m\":{\"source\":\"iana\"},\"video/ulpfec\":{\"source\":\"iana\"},\"video/vc1\":{\"source\":\"iana\"},\"video/vc2\":{\"source\":\"iana\"},\"video/vnd.cctv\":{\"source\":\"iana\"},\"video/vnd.dece.hd\":{\"source\":\"iana\",\"extensions\":[\"uvh\",\"uvvh\"]},\"video/vnd.dece.mobile\":{\"source\":\"iana\",\"extensions\":[\"uvm\",\"uvvm\"]},\"video/vnd.dece.mp4\":{\"source\":\"iana\"},\"video/vnd.dece.pd\":{\"source\":\"iana\",\"extensions\":[\"uvp\",\"uvvp\"]},\"video/vnd.dece.sd\":{\"source\":\"iana\",\"extensions\":[\"uvs\",\"uvvs\"]},\"video/vnd.dece.video\":{\"source\":\"iana\",\"extensions\":[\"uvv\",\"uvvv\"]},\"video/vnd.directv.mpeg\":{\"source\":\"iana\"},\"video/vnd.directv.mpeg-tts\":{\"source\":\"iana\"},\"video/vnd.dlna.mpeg-tts\":{\"source\":\"iana\"},\"video/vnd.dvb.file\":{\"source\":\"iana\",\"extensions\":[\"dvb\"]},\"video/vnd.fvt\":{\"source\":\"iana\",\"extensions\":[\"fvt\"]},\"video/vnd.hns.video\":{\"source\":\"iana\"},\"video/vnd.iptvforum.1dparityfec-1010\":{\"source\":\"iana\"},\"video/vnd.iptvforum.1dparityfec-2005\":{\"source\":\"iana\"},\"video/vnd.iptvforum.2dparityfec-1010\":{\"source\":\"iana\"},\"video/vnd.iptvforum.2dparityfec-2005\":{\"source\":\"iana\"},\"video/vnd.iptvforum.ttsavc\":{\"source\":\"iana\"},\"video/vnd.iptvforum.ttsmpeg2\":{\"source\":\"iana\"},\"video/vnd.motorola.video\":{\"source\":\"iana\"},\"video/vnd.motorola.videop\":{\"source\":\"iana\"},\"video/vnd.mpegurl\":{\"source\":\"iana\",\"extensions\":[\"mxu\",\"m4u\"]},\"video/vnd.ms-playready.media.pyv\":{\"source\":\"iana\",\"extensions\":[\"pyv\"]},\"video/vnd.nokia.interleaved-multimedia\":{\"source\":\"iana\"},\"video/vnd.nokia.mp4vr\":{\"source\":\"iana\"},\"video/vnd.nokia.videovoip\":{\"source\":\"iana\"},\"video/vnd.objectvideo\":{\"source\":\"iana\"},\"video/vnd.radgamettools.bink\":{\"source\":\"iana\"},\"video/vnd.radgamettools.smacker\":{\"source\":\"iana\"},\"video/vnd.sealed.mpeg1\":{\"source\":\"iana\"},\"video/vnd.sealed.mpeg4\":{\"source\":\"iana\"},\"video/vnd.sealed.swf\":{\"source\":\"iana\"},\"video/vnd.sealedmedia.softseal.mov\":{\"source\":\"iana\"},\"video/vnd.uvvu.mp4\":{\"source\":\"iana\",\"extensions\":[\"uvu\",\"uvvu\"]},\"video/vnd.vivo\":{\"source\":\"iana\",\"extensions\":[\"viv\"]},\"video/vp8\":{\"source\":\"iana\"},\"video/webm\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"webm\"]},\"video/x-f4v\":{\"source\":\"apache\",\"extensions\":[\"f4v\"]},\"video/x-fli\":{\"source\":\"apache\",\"extensions\":[\"fli\"]},\"video/x-flv\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"flv\"]},\"video/x-m4v\":{\"source\":\"apache\",\"extensions\":[\"m4v\"]},\"video/x-matroska\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"mkv\",\"mk3d\",\"mks\"]},\"video/x-mng\":{\"source\":\"apache\",\"extensions\":[\"mng\"]},\"video/x-ms-asf\":{\"source\":\"apache\",\"extensions\":[\"asf\",\"asx\"]},\"video/x-ms-vob\":{\"source\":\"apache\",\"extensions\":[\"vob\"]},\"video/x-ms-wm\":{\"source\":\"apache\",\"extensions\":[\"wm\"]},\"video/x-ms-wmv\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"wmv\"]},\"video/x-ms-wmx\":{\"source\":\"apache\",\"extensions\":[\"wmx\"]},\"video/x-ms-wvx\":{\"source\":\"apache\",\"extensions\":[\"wvx\"]},\"video/x-msvideo\":{\"source\":\"apache\",\"extensions\":[\"avi\"]},\"video/x-sgi-movie\":{\"source\":\"apache\",\"extensions\":[\"movie\"]},\"video/x-smv\":{\"source\":\"apache\",\"extensions\":[\"smv\"]},\"x-conference/x-cooltalk\":{\"source\":\"apache\",\"extensions\":[\"ice\"]},\"x-shader/x-fragment\":{\"compressible\":true},\"x-shader/x-vertex\":{\"compressible\":true}}"); /***/ }), /* 160 */ /***/ (function(module, exports) { module.exports = require("path"); /***/ }), /* 161 */ /***/ (function(module, exports) { function Caseless (dict) { this.dict = dict || {} } Caseless.prototype.set = function (name, value, clobber) { if (typeof name === 'object') { for (var i in name) { this.set(i, name[i], value) } } else { if (typeof clobber === 'undefined') clobber = true var has = this.has(name) if (!clobber && has) this.dict[has] = this.dict[has] + ',' + value else this.dict[has || name] = value return has } } Caseless.prototype.has = function (name) { var keys = Object.keys(this.dict) , name = name.toLowerCase() ; for (var i=0;i<keys.length;i++) { if (keys[i].toLowerCase() === name) return keys[i] } return false } Caseless.prototype.get = function (name) { name = name.toLowerCase() var result, _key var headers = this.dict Object.keys(headers).forEach(function (key) { _key = key.toLowerCase() if (name === _key) result = headers[key] }) return result } Caseless.prototype.swap = function (name) { var has = this.has(name) if (has === name) return if (!has) throw new Error('There is no header than matches "'+name+'"') this.dict[name] = this.dict[has] delete this.dict[has] } Caseless.prototype.del = function (name) { var has = this.has(name) return delete this.dict[has || name] } module.exports = function (dict) {return new Caseless(dict)} module.exports.httpify = function (resp, headers) { var c = new Caseless(headers) resp.setHeader = function (key, value, clobber) { if (typeof value === 'undefined') return return c.set(key, value, clobber) } resp.hasHeader = function (key) { return c.has(key) } resp.getHeader = function (key) { return c.get(key) } resp.removeHeader = function (key) { return c.del(key) } resp.headers = c.dict return c } /***/ }), /* 162 */ /***/ (function(module, exports, __webpack_require__) { module.exports = ForeverAgent ForeverAgent.SSL = ForeverAgentSSL var util = __webpack_require__(9) , Agent = __webpack_require__(98).Agent , net = __webpack_require__(82) , tls = __webpack_require__(163) , AgentSSL = __webpack_require__(99).Agent function getConnectionName(host, port) { var name = '' if (typeof host === 'string') { name = host + ':' + port } else { // For node.js v012.0 and iojs-v1.5.1, host is an object. And any existing localAddress is part of the connection name. name = host.host + ':' + host.port + ':' + (host.localAddress ? (host.localAddress + ':') : ':') } return name } function ForeverAgent(options) { var self = this self.options = options || {} self.requests = {} self.sockets = {} self.freeSockets = {} self.maxSockets = self.options.maxSockets || Agent.defaultMaxSockets self.minSockets = self.options.minSockets || ForeverAgent.defaultMinSockets self.on('free', function(socket, host, port) { var name = getConnectionName(host, port) if (self.requests[name] && self.requests[name].length) { self.requests[name].shift().onSocket(socket) } else if (self.sockets[name].length < self.minSockets) { if (!self.freeSockets[name]) self.freeSockets[name] = [] self.freeSockets[name].push(socket) // if an error happens while we don't use the socket anyway, meh, throw the socket away var onIdleError = function() { socket.destroy() } socket._onIdleError = onIdleError socket.on('error', onIdleError) } else { // If there are no pending requests just destroy the // socket and it will get removed from the pool. This // gets us out of timeout issues and allows us to // default to Connection:keep-alive. socket.destroy() } }) } util.inherits(ForeverAgent, Agent) ForeverAgent.defaultMinSockets = 5 ForeverAgent.prototype.createConnection = net.createConnection ForeverAgent.prototype.addRequestNoreuse = Agent.prototype.addRequest ForeverAgent.prototype.addRequest = function(req, host, port) { var name = getConnectionName(host, port) if (typeof host !== 'string') { var options = host port = options.port host = options.host } if (this.freeSockets[name] && this.freeSockets[name].length > 0 && !req.useChunkedEncodingByDefault) { var idleSocket = this.freeSockets[name].pop() idleSocket.removeListener('error', idleSocket._onIdleError) delete idleSocket._onIdleError req._reusedSocket = true req.onSocket(idleSocket) } else { this.addRequestNoreuse(req, host, port) } } ForeverAgent.prototype.removeSocket = function(s, name, host, port) { if (this.sockets[name]) { var index = this.sockets[name].indexOf(s) if (index !== -1) { this.sockets[name].splice(index, 1) } } else if (this.sockets[name] && this.sockets[name].length === 0) { // don't leak delete this.sockets[name] delete this.requests[name] } if (this.freeSockets[name]) { var index = this.freeSockets[name].indexOf(s) if (index !== -1) { this.freeSockets[name].splice(index, 1) if (this.freeSockets[name].length === 0) { delete this.freeSockets[name] } } } if (this.requests[name] && this.requests[name].length) { // If we have pending requests and a socket gets closed a new one // needs to be created to take over in the pool for the one that closed. this.createSocket(name, host, port).emit('free') } } function ForeverAgentSSL (options) { ForeverAgent.call(this, options) } util.inherits(ForeverAgentSSL, ForeverAgent) ForeverAgentSSL.prototype.createConnection = createConnectionSSL ForeverAgentSSL.prototype.addRequestNoreuse = AgentSSL.prototype.addRequest function createConnectionSSL (port, host, options) { if (typeof port === 'object') { options = port; } else if (typeof host === 'object') { options = host; } else if (typeof options === 'object') { options = options; } else { options = {}; } if (typeof port === 'number') { options.port = port; } if (typeof host === 'string') { options.host = host; } return tls.connect(options); } /***/ }), /* 163 */ /***/ (function(module, exports) { module.exports = require("tls"); /***/ }), /* 164 */ /***/ (function(module, exports, __webpack_require__) { var CombinedStream = __webpack_require__(165); var util = __webpack_require__(9); var path = __webpack_require__(160); var http = __webpack_require__(98); var https = __webpack_require__(99); var parseUrl = __webpack_require__(83).parse; var fs = __webpack_require__(167); var mime = __webpack_require__(157); var asynckit = __webpack_require__(168); var populate = __webpack_require__(178); // Public API module.exports = FormData; // make it a Stream util.inherits(FormData, CombinedStream); /** * Create readable "multipart/form-data" streams. * Can be used to submit forms * and file uploads to other web applications. * * @constructor * @param {Object} options - Properties to be added/overriden for FormData and CombinedStream */ function FormData(options) { if (!(this instanceof FormData)) { return new FormData(); } this._overheadLength = 0; this._valueLength = 0; this._valuesToMeasure = []; CombinedStream.call(this); options = options || {}; for (var option in options) { this[option] = options[option]; } } FormData.LINE_BREAK = '\r\n'; FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream'; FormData.prototype.append = function(field, value, options) { options = options || {}; // allow filename as single option if (typeof options == 'string') { options = {filename: options}; } var append = CombinedStream.prototype.append.bind(this); // all that streamy business can't handle numbers if (typeof value == 'number') { value = '' + value; } // https://github.com/felixge/node-form-data/issues/38 if (util.isArray(value)) { // Please convert your array into string // the way web server expects it this._error(new Error('Arrays are not supported.')); return; } var header = this._multiPartHeader(field, value, options); var footer = this._multiPartFooter(); append(header); append(value); append(footer); // pass along options.knownLength this._trackLength(header, value, options); }; FormData.prototype._trackLength = function(header, value, options) { var valueLength = 0; // used w/ getLengthSync(), when length is known. // e.g. for streaming directly from a remote server, // w/ a known file a size, and not wanting to wait for // incoming file to finish to get its size. if (options.knownLength != null) { valueLength += +options.knownLength; } else if (Buffer.isBuffer(value)) { valueLength = value.length; } else if (typeof value === 'string') { valueLength = Buffer.byteLength(value); } this._valueLength += valueLength; // @check why add CRLF? does this account for custom/multiple CRLFs? this._overheadLength += Buffer.byteLength(header) + FormData.LINE_BREAK.length; // empty or either doesn't have path or not an http response if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) )) { return; } // no need to bother with the length if (!options.knownLength) { this._valuesToMeasure.push(value); } }; FormData.prototype._lengthRetriever = function(value, callback) { if (value.hasOwnProperty('fd')) { // take read range into a account // `end` = Infinity –> read file till the end // // TODO: Looks like there is bug in Node fs.createReadStream // it doesn't respect `end` options without `start` options // Fix it when node fixes it. // https://github.com/joyent/node/issues/7819 if (value.end != undefined && value.end != Infinity && value.start != undefined) { // when end specified // no need to calculate range // inclusive, starts with 0 callback(null, value.end + 1 - (value.start ? value.start : 0)); // not that fast snoopy } else { // still need to fetch file size from fs fs.stat(value.path, function(err, stat) { var fileSize; if (err) { callback(err); return; } // update final size based on the range options fileSize = stat.size - (value.start ? value.start : 0); callback(null, fileSize); }); } // or http response } else if (value.hasOwnProperty('httpVersion')) { callback(null, +value.headers['content-length']); // or request stream http://github.com/mikeal/request } else if (value.hasOwnProperty('httpModule')) { // wait till response come back value.on('response', function(response) { value.pause(); callback(null, +response.headers['content-length']); }); value.resume(); // something else } else { callback('Unknown stream'); } }; FormData.prototype._multiPartHeader = function(field, value, options) { // custom header specified (as string)? // it becomes responsible for boundary // (e.g. to handle extra CRLFs on .NET servers) if (typeof options.header == 'string') { return options.header; } var contentDisposition = this._getContentDisposition(value, options); var contentType = this._getContentType(value, options); var contents = ''; var headers = { // add custom disposition as third element or keep it two elements if not 'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []), // if no content type. allow it to be empty array 'Content-Type': [].concat(contentType || []) }; // allow custom headers. if (typeof options.header == 'object') { populate(headers, options.header); } var header; for (var prop in headers) { if (!headers.hasOwnProperty(prop)) continue; header = headers[prop]; // skip nullish headers. if (header == null) { continue; } // convert all headers to arrays. if (!Array.isArray(header)) { header = [header]; } // add non-empty headers. if (header.length) { contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK; } } return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK; }; FormData.prototype._getContentDisposition = function(value, options) { var filename , contentDisposition ; if (typeof options.filepath === 'string') { // custom filepath for relative paths filename = path.normalize(options.filepath).replace(/\\/g, '/'); } else if (options.filename || value.name || value.path) { // custom filename take precedence // formidable and the browser add a name property // fs- and request- streams have path property filename = path.basename(options.filename || value.name || value.path); } else if (value.readable && value.hasOwnProperty('httpVersion')) { // or try http response filename = path.basename(value.client._httpMessage.path); } if (filename) { contentDisposition = 'filename="' + filename + '"'; } return contentDisposition; }; FormData.prototype._getContentType = function(value, options) { // use custom content-type above all var contentType = options.contentType; // or try `name` from formidable, browser if (!contentType && value.name) { contentType = mime.lookup(value.name); } // or try `path` from fs-, request- streams if (!contentType && value.path) { contentType = mime.lookup(value.path); } // or if it's http-reponse if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) { contentType = value.headers['content-type']; } // or guess it from the filepath or filename if (!contentType && (options.filepath || options.filename)) { contentType = mime.lookup(options.filepath || options.filename); } // fallback to the default content type if `value` is not simple value if (!contentType && typeof value == 'object') { contentType = FormData.DEFAULT_CONTENT_TYPE; } return contentType; }; FormData.prototype._multiPartFooter = function() { return function(next) { var footer = FormData.LINE_BREAK; var lastPart = (this._streams.length === 0); if (lastPart) { footer += this._lastBoundary(); } next(footer); }.bind(this); }; FormData.prototype._lastBoundary = function() { return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK; }; FormData.prototype.getHeaders = function(userHeaders) { var header; var formHeaders = { 'content-type': 'multipart/form-data; boundary=' + this.getBoundary() }; for (header in userHeaders) { if (userHeaders.hasOwnProperty(header)) { formHeaders[header.toLowerCase()] = userHeaders[header]; } } return formHeaders; }; FormData.prototype.getBoundary = function() { if (!this._boundary) { this._generateBoundary(); } return this._boundary; }; FormData.prototype._generateBoundary = function() { // This generates a 50 character boundary similar to those used by Firefox. // They are optimized for boyer-moore parsing. var boundary = '--------------------------'; for (var i = 0; i < 24; i++) { boundary += Math.floor(Math.random() * 10).toString(16); } this._boundary = boundary; }; // Note: getLengthSync DOESN'T calculate streams length // As workaround one can calculate file size manually // and add it as knownLength option FormData.prototype.getLengthSync = function() { var knownLength = this._overheadLength + this._valueLength; // Don't get confused, there are 3 "internal" streams for each keyval pair // so it basically checks if there is any value added to the form if (this._streams.length) { knownLength += this._lastBoundary().length; } // https://github.com/form-data/form-data/issues/40 if (!this.hasKnownLength()) { // Some async length retrievers are present // therefore synchronous length calculation is false. // Please use getLength(callback) to get proper length this._error(new Error('Cannot calculate proper length in synchronous way.')); } return knownLength; }; // Public API to check if length of added values is known // https://github.com/form-data/form-data/issues/196 // https://github.com/form-data/form-data/issues/262 FormData.prototype.hasKnownLength = function() { var hasKnownLength = true; if (this._valuesToMeasure.length) { hasKnownLength = false; } return hasKnownLength; }; FormData.prototype.getLength = function(cb) { var knownLength = this._overheadLength + this._valueLength; if (this._streams.length) { knownLength += this._lastBoundary().length; } if (!this._valuesToMeasure.length) { process.nextTick(cb.bind(this, null, knownLength)); return; } asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) { if (err) { cb(err); return; } values.forEach(function(length) { knownLength += length; }); cb(null, knownLength); }); }; FormData.prototype.submit = function(params, cb) { var request , options , defaults = {method: 'post'} ; // parse provided url if it's string // or treat it as options object if (typeof params == 'string') { params = parseUrl(params); options = populate({ port: params.port, path: params.pathname, host: params.hostname, protocol: params.protocol }, defaults); // use custom params } else { options = populate(params, defaults); // if no port provided use default one if (!options.port) { options.port = options.protocol == 'https:' ? 443 : 80; } } // put that good code in getHeaders to some use options.headers = this.getHeaders(params.headers); // https if specified, fallback to http in any other case if (options.protocol == 'https:') { request = https.request(options); } else { request = http.request(options); } // get content length and fire away this.getLength(function(err, length) { if (err) { this._error(err); return; } // add content length request.setHeader('Content-Length', length); this.pipe(request); if (cb) { request.on('error', cb); request.on('response', cb.bind(this, null)); } }.bind(this)); return request; }; FormData.prototype._error = function(err) { if (!this.error) { this.error = err; this.pause(); this.emit('error', err); } }; FormData.prototype.toString = function () { return '[object FormData]'; }; /***/ }), /* 165 */ /***/ (function(module, exports, __webpack_require__) { var util = __webpack_require__(9); var Stream = __webpack_require__(100).Stream; var DelayedStream = __webpack_require__(166); module.exports = CombinedStream; function CombinedStream() { this.writable = false; this.readable = true; this.dataSize = 0; this.maxDataSize = 2 * 1024 * 1024; this.pauseStreams = true; this._released = false; this._streams = []; this._currentStream = null; this._insideLoop = false; this._pendingNext = false; } util.inherits(CombinedStream, Stream); CombinedStream.create = function(options) { var combinedStream = new this(); options = options || {}; for (var option in options) { combinedStream[option] = options[option]; } return combinedStream; }; CombinedStream.isStreamLike = function(stream) { return (typeof stream !== 'function') && (typeof stream !== 'string') && (typeof stream !== 'boolean') && (typeof stream !== 'number') && (!Buffer.isBuffer(stream)); }; CombinedStream.prototype.append = function(stream) { var isStreamLike = CombinedStream.isStreamLike(stream); if (isStreamLike) { if (!(stream instanceof DelayedStream)) { var newStream = DelayedStream.create(stream, { maxDataSize: Infinity, pauseStream: this.pauseStreams, }); stream.on('data', this._checkDataSize.bind(this)); stream = newStream; } this._handleErrors(stream); if (this.pauseStreams) { stream.pause(); } } this._streams.push(stream); return this; }; CombinedStream.prototype.pipe = function(dest, options) { Stream.prototype.pipe.call(this, dest, options); this.resume(); return dest; }; CombinedStream.prototype._getNext = function() { this._currentStream = null; if (this._insideLoop) { this._pendingNext = true; return; // defer call } this._insideLoop = true; try { do { this._pendingNext = false; this._realGetNext(); } while (this._pendingNext); } finally { this._insideLoop = false; } }; CombinedStream.prototype._realGetNext = function() { var stream = this._streams.shift(); if (typeof stream == 'undefined') { this.end(); return; } if (typeof stream !== 'function') { this._pipeNext(stream); return; } var getStream = stream; getStream(function(stream) { var isStreamLike = CombinedStream.isStreamLike(stream); if (isStreamLike) { stream.on('data', this._checkDataSize.bind(this)); this._handleErrors(stream); } this._pipeNext(stream); }.bind(this)); }; CombinedStream.prototype._pipeNext = function(stream) { this._currentStream = stream; var isStreamLike = CombinedStream.isStreamLike(stream); if (isStreamLike) { stream.on('end', this._getNext.bind(this)); stream.pipe(this, {end: false}); return; } var value = stream; this.write(value); this._getNext(); }; CombinedStream.prototype._handleErrors = function(stream) { var self = this; stream.on('error', function(err) { self._emitError(err); }); }; CombinedStream.prototype.write = function(data) { this.emit('data', data); }; CombinedStream.prototype.pause = function() { if (!this.pauseStreams) { return; } if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause(); this.emit('pause'); }; CombinedStream.prototype.resume = function() { if (!this._released) { this._released = true; this.writable = true; this._getNext(); } if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume(); this.emit('resume'); }; CombinedStream.prototype.end = function() { this._reset(); this.emit('end'); }; CombinedStream.prototype.destroy = function() { this._reset(); this.emit('close'); }; CombinedStream.prototype._reset = function() { this.writable = false; this._streams = []; this._currentStream = null; }; CombinedStream.prototype._checkDataSize = function() { this._updateDataSize(); if (this.dataSize <= this.maxDataSize) { return; } var message = 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'; this._emitError(new Error(message)); }; CombinedStream.prototype._updateDataSize = function() { this.dataSize = 0; var self = this; this._streams.forEach(function(stream) { if (!stream.dataSize) { return; } self.dataSize += stream.dataSize; }); if (this._currentStream && this._currentStream.dataSize) { this.dataSize += this._currentStream.dataSize; } }; CombinedStream.prototype._emitError = function(err) { this._reset(); this.emit('error', err); }; /***/ }), /* 166 */ /***/ (function(module, exports, __webpack_require__) { var Stream = __webpack_require__(100).Stream; var util = __webpack_require__(9); module.exports = DelayedStream; function DelayedStream() { this.source = null; this.dataSize = 0; this.maxDataSize = 1024 * 1024; this.pauseStream = true; this._maxDataSizeExceeded = false; this._released = false; this._bufferedEvents = []; } util.inherits(DelayedStream, Stream); DelayedStream.create = function(source, options) { var delayedStream = new this(); options = options || {}; for (var option in options) { delayedStream[option] = options[option]; } delayedStream.source = source; var realEmit = source.emit; source.emit = function() { delayedStream._handleEmit(arguments); return realEmit.apply(source, arguments); }; source.on('error', function() {}); if (delayedStream.pauseStream) { source.pause(); } return delayedStream; }; Object.defineProperty(DelayedStream.prototype, 'readable', { configurable: true, enumerable: true, get: function() { return this.source.readable; } }); DelayedStream.prototype.setEncoding = function() { return this.source.setEncoding.apply(this.source, arguments); }; DelayedStream.prototype.resume = function() { if (!this._released) { this.release(); } this.source.resume(); }; DelayedStream.prototype.pause = function() { this.source.pause(); }; DelayedStream.prototype.release = function() { this._released = true; this._bufferedEvents.forEach(function(args) { this.emit.apply(this, args); }.bind(this)); this._bufferedEvents = []; }; DelayedStream.prototype.pipe = function() { var r = Stream.prototype.pipe.apply(this, arguments); this.resume(); return r; }; DelayedStream.prototype._handleEmit = function(args) { if (this._released) { this.emit.apply(this, args); return; } if (args[0] === 'data') { this.dataSize += args[1].length; this._checkIfMaxDataSizeExceeded(); } this._bufferedEvents.push(args); }; DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { if (this._maxDataSizeExceeded) { return; } if (this.dataSize <= this.maxDataSize) { return; } this._maxDataSizeExceeded = true; var message = 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.' this.emit('error', new Error(message)); }; /***/ }), /* 167 */ /***/ (function(module, exports) { module.exports = require("fs"); /***/ }), /* 168 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { parallel : __webpack_require__(169), serial : __webpack_require__(176), serialOrdered : __webpack_require__(177) }; /***/ }), /* 169 */ /***/ (function(module, exports, __webpack_require__) { var iterate = __webpack_require__(170) , initState = __webpack_require__(174) , terminator = __webpack_require__(175) ; // Public API module.exports = parallel; /** * Runs iterator over provided array elements in parallel * * @param {array|object} list - array or object (named list) to iterate over * @param {function} iterator - iterator to run * @param {function} callback - invoked when all elements processed * @returns {function} - jobs terminator */ function parallel(list, iterator, callback) { var state = initState(list); while (state.index < (state['keyedList'] || list).length) { iterate(list, iterator, state, function(error, result) { if (error) { callback(error, result); return; } // looks like it's the last one if (Object.keys(state.jobs).length === 0) { callback(null, state.results); return; } }); state.index++; } return terminator.bind(state, callback); } /***/ }), /* 170 */ /***/ (function(module, exports, __webpack_require__) { var async = __webpack_require__(171) , abort = __webpack_require__(173) ; // API module.exports = iterate; /** * Iterates over each job object * * @param {array|object} list - array or object (named list) to iterate over * @param {function} iterator - iterator to run * @param {object} state - current job status * @param {function} callback - invoked when all elements processed */ function iterate(list, iterator, state, callback) { // store current index var key = state['keyedList'] ? state['keyedList'][state.index] : state.index; state.jobs[key] = runJob(iterator, key, list[key], function(error, output) { // don't repeat yourself // skip secondary callbacks if (!(key in state.jobs)) { return; } // clean up jobs delete state.jobs[key]; if (error) { // don't process rest of the results // stop still active jobs // and reset the list abort(state); } else { state.results[key] = output; } // return salvaged results callback(error, state.results); }); } /** * Runs iterator over provided job element * * @param {function} iterator - iterator to invoke * @param {string|number} key - key/index of the element in the list of jobs * @param {mixed} item - job description * @param {function} callback - invoked after iterator is done with the job * @returns {function|mixed} - job abort function or something else */ function runJob(iterator, key, item, callback) { var aborter; // allow shortcut if iterator expects only two arguments if (iterator.length == 2) { aborter = iterator(item, async(callback)); } // otherwise go with full three arguments else { aborter = iterator(item, key, async(callback)); } return aborter; } /***/ }), /* 171 */ /***/ (function(module, exports, __webpack_require__) { var defer = __webpack_require__(172); // API module.exports = async; /** * Runs provided callback asynchronously * even if callback itself is not * * @param {function} callback - callback to invoke * @returns {function} - augmented callback */ function async(callback) { var isAsync = false; // check if async happened defer(function() { isAsync = true; }); return function async_callback(err, result) { if (isAsync) { callback(err, result); } else { defer(function nextTick_callback() { callback(err, result); }); } }; } /***/ }), /* 172 */ /***/ (function(module, exports) { module.exports = defer; /** * Runs provided function on next iteration of the event loop * * @param {function} fn - function to run */ function defer(fn) { var nextTick = typeof setImmediate == 'function' ? setImmediate : ( typeof process == 'object' && typeof process.nextTick == 'function' ? process.nextTick : null ); if (nextTick) { nextTick(fn); } else { setTimeout(fn, 0); } } /***/ }), /* 173 */ /***/ (function(module, exports) { // API module.exports = abort; /** * Aborts leftover active jobs * * @param {object} state - current state object */ function abort(state) { Object.keys(state.jobs).forEach(clean.bind(state)); // reset leftover jobs state.jobs = {}; } /** * Cleans up leftover job by invoking abort function for the provided job id * * @this state * @param {string|number} key - job id to abort */ function clean(key) { if (typeof this.jobs[key] == 'function') { this.jobs[key](); } } /***/ }), /* 174 */ /***/ (function(module, exports) { // API module.exports = state; /** * Creates initial state object * for iteration over list * * @param {array|object} list - list to iterate over * @param {function|null} sortMethod - function to use for keys sort, * or `null` to keep them as is * @returns {object} - initial state object */ function state(list, sortMethod) { var isNamedList = !Array.isArray(list) , initState = { index : 0, keyedList: isNamedList || sortMethod ? Object.keys(list) : null, jobs : {}, results : isNamedList ? {} : [], size : isNamedList ? Object.keys(list).length : list.length } ; if (sortMethod) { // sort array keys based on it's values // sort object's keys just on own merit initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) { return sortMethod(list[a], list[b]); }); } return initState; } /***/ }), /* 175 */ /***/ (function(module, exports, __webpack_require__) { var abort = __webpack_require__(173) , async = __webpack_require__(171) ; // API module.exports = terminator; /** * Terminates jobs in the attached state context * * @this AsyncKitState# * @param {function} callback - final callback to invoke after termination */ function terminator(callback) { if (!Object.keys(this.jobs).length) { return; } // fast forward iteration index this.index = this.size; // abort jobs abort(this); // send back results we have so far async(callback)(null, this.results); } /***/ }), /* 176 */ /***/ (function(module, exports, __webpack_require__) { var serialOrdered = __webpack_require__(177); // Public API module.exports = serial; /** * Runs iterator over provided array elements in series * * @param {array|object} list - array or object (named list) to iterate over * @param {function} iterator - iterator to run * @param {function} callback - invoked when all elements processed * @returns {function} - jobs terminator */ function serial(list, iterator, callback) { return serialOrdered(list, iterator, null, callback); } /***/ }), /* 177 */ /***/ (function(module, exports, __webpack_require__) { var iterate = __webpack_require__(170) , initState = __webpack_require__(174) , terminator = __webpack_require__(175) ; // Public API module.exports = serialOrdered; // sorting helpers module.exports.ascending = ascending; module.exports.descending = descending; /** * Runs iterator over provided sorted array elements in series * * @param {array|object} list - array or object (named list) to iterate over * @param {function} iterator - iterator to run * @param {function} sortMethod - custom sort function * @param {function} callback - invoked when all elements processed * @returns {function} - jobs terminator */ function serialOrdered(list, iterator, sortMethod, callback) { var state = initState(list, sortMethod); iterate(list, iterator, state, function iteratorHandler(error, result) { if (error) { callback(error, result); return; } state.index++; // are we there yet? if (state.index < (state['keyedList'] || list).length) { iterate(list, iterator, state, iteratorHandler); return; } // done here callback(null, state.results); }); return terminator.bind(state, callback); } /* * -- Sort methods */ /** * sort helper to sort array elements in ascending order * * @param {mixed} a - an item to compare * @param {mixed} b - an item to compare * @returns {number} - comparison result */ function ascending(a, b) { return a < b ? -1 : a > b ? 1 : 0; } /** * sort helper to sort array elements in descending order * * @param {mixed} a - an item to compare * @param {mixed} b - an item to compare * @returns {number} - comparison result */ function descending(a, b) { return -1 * ascending(a, b); } /***/ }), /* 178 */ /***/ (function(module, exports) { // populates missing values module.exports = function(dst, src) { Object.keys(src).forEach(function(prop) { dst[prop] = dst[prop] || src[prop]; }); return dst; }; /***/ }), /* 179 */ /***/ (function(module, exports, __webpack_require__) { var stream = __webpack_require__(100) function isStream (obj) { return obj instanceof stream.Stream } function isReadable (obj) { return isStream(obj) && typeof obj._read == 'function' && typeof obj._readableState == 'object' } function isWritable (obj) { return isStream(obj) && typeof obj._write == 'function' && typeof obj._writableState == 'object' } function isDuplex (obj) { return isReadable(obj) && isWritable(obj) } module.exports = isStream module.exports.isReadable = isReadable module.exports.isWritable = isWritable module.exports.isDuplex = isDuplex /***/ }), /* 180 */ /***/ (function(module, exports) { module.exports = isTypedArray isTypedArray.strict = isStrictTypedArray isTypedArray.loose = isLooseTypedArray var toString = Object.prototype.toString var names = { '[object Int8Array]': true , '[object Int16Array]': true , '[object Int32Array]': true , '[object Uint8Array]': true , '[object Uint8ClampedArray]': true , '[object Uint16Array]': true , '[object Uint32Array]': true , '[object Float32Array]': true , '[object Float64Array]': true } function isTypedArray(arr) { return ( isStrictTypedArray(arr) || isLooseTypedArray(arr) ) } function isStrictTypedArray(arr) { return ( arr instanceof Int8Array || arr instanceof Int16Array || arr instanceof Int32Array || arr instanceof Uint8Array || arr instanceof Uint8ClampedArray || arr instanceof Uint16Array || arr instanceof Uint32Array || arr instanceof Float32Array || arr instanceof Float64Array ) } function isLooseTypedArray(arr) { return names[toString.call(arr)] } /***/ }), /* 181 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; function formatHostname (hostname) { // canonicalize the hostname, so that 'oogle.com' won't match 'google.com' return hostname.replace(/^\.*/, '.').toLowerCase() } function parseNoProxyZone (zone) { zone = zone.trim().toLowerCase() var zoneParts = zone.split(':', 2) var zoneHost = formatHostname(zoneParts[0]) var zonePort = zoneParts[1] var hasPort = zone.indexOf(':') > -1 return {hostname: zoneHost, port: zonePort, hasPort: hasPort} } function uriInNoProxy (uri, noProxy) { var port = uri.port || (uri.protocol === 'https:' ? '443' : '80') var hostname = formatHostname(uri.hostname) var noProxyList = noProxy.split(',') // iterate through the noProxyList until it finds a match. return noProxyList.map(parseNoProxyZone).some(function (noProxyZone) { var isMatchedAt = hostname.indexOf(noProxyZone.hostname) var hostnameMatched = ( isMatchedAt > -1 && (isMatchedAt === hostname.length - noProxyZone.hostname.length) ) if (noProxyZone.hasPort) { return (port === noProxyZone.port) && hostnameMatched } return hostnameMatched }) } function getProxyFromURI (uri) { // Decide the proper request proxy to use based on the request URI object and the // environmental variables (NO_PROXY, HTTP_PROXY, etc.) // respect NO_PROXY environment variables (see: http://lynx.isc.org/current/breakout/lynx_help/keystrokes/environments.html) var noProxy = process.env.NO_PROXY || process.env.no_proxy || '' // if the noProxy is a wildcard then return null if (noProxy === '*') { return null } // if the noProxy is not empty and the uri is found return null if (noProxy !== '' && uriInNoProxy(uri, noProxy)) { return null } // Check for HTTP or HTTPS Proxy in environment Else default to null if (uri.protocol === 'http:') { return process.env.HTTP_PROXY || process.env.http_proxy || null } if (uri.protocol === 'https:') { return process.env.HTTPS_PROXY || process.env.https_proxy || process.env.HTTP_PROXY || process.env.http_proxy || null } // if none of that works, return null // (What uri protocol are you using then?) return null } module.exports = getProxyFromURI /***/ }), /* 182 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var qs = __webpack_require__(183) var querystring = __webpack_require__(104) function Querystring (request) { this.request = request this.lib = null this.useQuerystring = null this.parseOptions = null this.stringifyOptions = null } Querystring.prototype.init = function (options) { if (this.lib) { return } this.useQuerystring = options.useQuerystring this.lib = (this.useQuerystring ? querystring : qs) this.parseOptions = options.qsParseOptions || {} this.stringifyOptions = options.qsStringifyOptions || {} } Querystring.prototype.stringify = function (obj) { return (this.useQuerystring) ? this.rfc3986(this.lib.stringify(obj, this.stringifyOptions.sep || null, this.stringifyOptions.eq || null, this.stringifyOptions)) : this.lib.stringify(obj, this.stringifyOptions) } Querystring.prototype.parse = function (str) { return (this.useQuerystring) ? this.lib.parse(str, this.parseOptions.sep || null, this.parseOptions.eq || null, this.parseOptions) : this.lib.parse(str, this.parseOptions) } Querystring.prototype.rfc3986 = function (str) { return str.replace(/[!'()*]/g, function (c) { return '%' + c.charCodeAt(0).toString(16).toUpperCase() }) } Querystring.prototype.unescape = querystring.unescape exports.Querystring = Querystring /***/ }), /* 183 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var stringify = __webpack_require__(184); var parse = __webpack_require__(187); var formats = __webpack_require__(186); module.exports = { formats: formats, parse: parse, stringify: stringify }; /***/ }), /* 184 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var utils = __webpack_require__(185); var formats = __webpack_require__(186); var arrayPrefixGenerators = { brackets: function brackets(prefix) { // eslint-disable-line func-name-matching return prefix + '[]'; }, indices: function indices(prefix, key) { // eslint-disable-line func-name-matching return prefix + '[' + key + ']'; }, repeat: function repeat(prefix) { // eslint-disable-line func-name-matching return prefix; } }; var toISO = Date.prototype.toISOString; var defaults = { delimiter: '&', encode: true, encoder: utils.encode, encodeValuesOnly: false, serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching return toISO.call(date); }, skipNulls: false, strictNullHandling: false }; var stringify = function stringify( // eslint-disable-line func-name-matching object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly ) { var obj = object; if (typeof filter === 'function') { obj = filter(prefix, obj); } else if (obj instanceof Date) { obj = serializeDate(obj); } else if (obj === null) { if (strictNullHandling) { return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix; } obj = ''; } if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) { if (encoder) { var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder); return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder))]; } return [formatter(prefix) + '=' + formatter(String(obj))]; } var values = []; if (typeof obj === 'undefined') { return values; } var objKeys; if (Array.isArray(filter)) { objKeys = filter; } else { var keys = Object.keys(obj); objKeys = sort ? keys.sort(sort) : keys; } for (var i = 0; i < objKeys.length; ++i) { var key = objKeys[i]; if (skipNulls && obj[key] === null) { continue; } if (Array.isArray(obj)) { values = values.concat(stringify( obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly )); } else { values = values.concat(stringify( obj[key], prefix + (allowDots ? '.' + key : '[' + key + ']'), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly )); } } return values; }; module.exports = function (object, opts) { var obj = object; var options = opts ? utils.assign({}, opts) : {}; if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') { throw new TypeError('Encoder has to be a function.'); } var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter; var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls; var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode; var encoder = typeof options.encoder === 'function' ? options.encoder : defaults.encoder; var sort = typeof options.sort === 'function' ? options.sort : null; var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots; var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults.serializeDate; var encodeValuesOnly = typeof options.encodeValuesOnly === 'boolean' ? options.encodeValuesOnly : defaults.encodeValuesOnly; if (typeof options.format === 'undefined') { options.format = formats['default']; } else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) { throw new TypeError('Unknown format option provided.'); } var formatter = formats.formatters[options.format]; var objKeys; var filter; if (typeof options.filter === 'function') { filter = options.filter; obj = filter('', obj); } else if (Array.isArray(options.filter)) { filter = options.filter; objKeys = filter; } var keys = []; if (typeof obj !== 'object' || obj === null) { return ''; } var arrayFormat; if (options.arrayFormat in arrayPrefixGenerators) { arrayFormat = options.arrayFormat; } else if ('indices' in options) { arrayFormat = options.indices ? 'indices' : 'repeat'; } else { arrayFormat = 'indices'; } var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; if (!objKeys) { objKeys = Object.keys(obj); } if (sort) { objKeys.sort(sort); } for (var i = 0; i < objKeys.length; ++i) { var key = objKeys[i]; if (skipNulls && obj[key] === null) { continue; } keys = keys.concat(stringify( obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode ? encoder : null, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly )); } var joined = keys.join(delimiter); var prefix = options.addQueryPrefix === true ? '?' : ''; return joined.length > 0 ? prefix + joined : ''; }; /***/ }), /* 185 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var has = Object.prototype.hasOwnProperty; var hexTable = (function () { var array = []; for (var i = 0; i < 256; ++i) { array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); } return array; }()); var compactQueue = function compactQueue(queue) { var obj; while (queue.length) { var item = queue.pop(); obj = item.obj[item.prop]; if (Array.isArray(obj)) { var compacted = []; for (var j = 0; j < obj.length; ++j) { if (typeof obj[j] !== 'undefined') { compacted.push(obj[j]); } } item.obj[item.prop] = compacted; } } return obj; }; var arrayToObject = function arrayToObject(source, options) { var obj = options && options.plainObjects ? Object.create(null) : {}; for (var i = 0; i < source.length; ++i) { if (typeof source[i] !== 'undefined') { obj[i] = source[i]; } } return obj; }; var merge = function merge(target, source, options) { if (!source) { return target; } if (typeof source !== 'object') { if (Array.isArray(target)) { target.push(source); } else if (typeof target === 'object') { if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) { target[source] = true; } } else { return [target, source]; } return target; } if (typeof target !== 'object') { return [target].concat(source); } var mergeTarget = target; if (Array.isArray(target) && !Array.isArray(source)) { mergeTarget = arrayToObject(target, options); } if (Array.isArray(target) && Array.isArray(source)) { source.forEach(function (item, i) { if (has.call(target, i)) { if (target[i] && typeof target[i] === 'object') { target[i] = merge(target[i], item, options); } else { target.push(item); } } else { target[i] = item; } }); return target; } return Object.keys(source).reduce(function (acc, key) { var value = source[key]; if (has.call(acc, key)) { acc[key] = merge(acc[key], value, options); } else { acc[key] = value; } return acc; }, mergeTarget); }; var assign = function assignSingleSource(target, source) { return Object.keys(source).reduce(function (acc, key) { acc[key] = source[key]; return acc; }, target); }; var decode = function (str) { try { return decodeURIComponent(str.replace(/\+/g, ' ')); } catch (e) { return str; } }; var encode = function encode(str) { // This code was originally written by Brian White (mscdex) for the io.js core querystring library. // It has been adapted here for stricter adherence to RFC 3986 if (str.length === 0) { return str; } var string = typeof str === 'string' ? str : String(str); var out = ''; for (var i = 0; i < string.length; ++i) { var c = string.charCodeAt(i); if ( c === 0x2D // - || c === 0x2E // . || c === 0x5F // _ || c === 0x7E // ~ || (c >= 0x30 && c <= 0x39) // 0-9 || (c >= 0x41 && c <= 0x5A) // a-z || (c >= 0x61 && c <= 0x7A) // A-Z ) { out += string.charAt(i); continue; } if (c < 0x80) { out = out + hexTable[c]; continue; } if (c < 0x800) { out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]); continue; } if (c < 0xD800 || c >= 0xE000) { out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); continue; } i += 1; c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); out += hexTable[0xF0 | (c >> 18)] + hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]; } return out; }; var compact = function compact(value) { var queue = [{ obj: { o: value }, prop: 'o' }]; var refs = []; for (var i = 0; i < queue.length; ++i) { var item = queue[i]; var obj = item.obj[item.prop]; var keys = Object.keys(obj); for (var j = 0; j < keys.length; ++j) { var key = keys[j]; var val = obj[key]; if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { queue.push({ obj: obj, prop: key }); refs.push(val); } } } return compactQueue(queue); }; var isRegExp = function isRegExp(obj) { return Object.prototype.toString.call(obj) === '[object RegExp]'; }; var isBuffer = function isBuffer(obj) { if (obj === null || typeof obj === 'undefined') { return false; } return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); }; module.exports = { arrayToObject: arrayToObject, assign: assign, compact: compact, decode: decode, encode: encode, isBuffer: isBuffer, isRegExp: isRegExp, merge: merge }; /***/ }), /* 186 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var replace = String.prototype.replace; var percentTwenties = /%20/g; module.exports = { 'default': 'RFC3986', formatters: { RFC1738: function (value) { return replace.call(value, percentTwenties, '+'); }, RFC3986: function (value) { return value; } }, RFC1738: 'RFC1738', RFC3986: 'RFC3986' }; /***/ }), /* 187 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var utils = __webpack_require__(185); var has = Object.prototype.hasOwnProperty; var defaults = { allowDots: false, allowPrototypes: false, arrayLimit: 20, decoder: utils.decode, delimiter: '&', depth: 5, parameterLimit: 1000, plainObjects: false, strictNullHandling: false }; var parseValues = function parseQueryStringValues(str, options) { var obj = {}; var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; var parts = cleanStr.split(options.delimiter, limit); for (var i = 0; i < parts.length; ++i) { var part = parts[i]; var bracketEqualsPos = part.indexOf(']='); var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1; var key, val; if (pos === -1) { key = options.decoder(part, defaults.decoder); val = options.strictNullHandling ? null : ''; } else { key = options.decoder(part.slice(0, pos), defaults.decoder); val = options.decoder(part.slice(pos + 1), defaults.decoder); } if (has.call(obj, key)) { obj[key] = [].concat(obj[key]).concat(val); } else { obj[key] = val; } } return obj; }; var parseObject = function (chain, val, options) { var leaf = val; for (var i = chain.length - 1; i >= 0; --i) { var obj; var root = chain[i]; if (root === '[]') { obj = []; obj = obj.concat(leaf); } else { obj = options.plainObjects ? Object.create(null) : {}; var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; var index = parseInt(cleanRoot, 10); if ( !isNaN(index) && root !== cleanRoot && String(index) === cleanRoot && index >= 0 && (options.parseArrays && index <= options.arrayLimit) ) { obj = []; obj[index] = leaf; } else { obj[cleanRoot] = leaf; } } leaf = obj; } return leaf; }; var parseKeys = function parseQueryStringKeys(givenKey, val, options) { if (!givenKey) { return; } // Transform dot notation to bracket notation var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey; // The regex chunks var brackets = /(\[[^[\]]*])/; var child = /(\[[^[\]]*])/g; // Get the parent var segment = brackets.exec(key); var parent = segment ? key.slice(0, segment.index) : key; // Stash the parent if it exists var keys = []; if (parent) { // If we aren't using plain objects, optionally prefix keys // that would overwrite object prototype properties if (!options.plainObjects && has.call(Object.prototype, parent)) { if (!options.allowPrototypes) { return; } } keys.push(parent); } // Loop through children appending to the array until we hit depth var i = 0; while ((segment = child.exec(key)) !== null && i < options.depth) { i += 1; if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { if (!options.allowPrototypes) { return; } } keys.push(segment[1]); } // If there's a remainder, just add whatever is left if (segment) { keys.push('[' + key.slice(segment.index) + ']'); } return parseObject(keys, val, options); }; module.exports = function (str, opts) { var options = opts ? utils.assign({}, opts) : {}; if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') { throw new TypeError('Decoder has to be a function.'); } options.ignoreQueryPrefix = options.ignoreQueryPrefix === true; options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter; options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth; options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit; options.parseArrays = options.parseArrays !== false; options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder; options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots; options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects; options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes; options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit; options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; if (str === '' || str === null || typeof str === 'undefined') { return options.plainObjects ? Object.create(null) : {}; } var tempObj = typeof str === 'string' ? parseValues(str, options) : str; var obj = options.plainObjects ? Object.create(null) : {}; // Iterate over the keys and setup the new object var keys = Object.keys(tempObj); for (var i = 0; i < keys.length; ++i) { var key = keys[i]; var newObj = parseKeys(key, tempObj[key], options); obj = utils.merge(obj, newObj, options); } return utils.compact(obj); }; /***/ }), /* 188 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var fs = __webpack_require__(167) var qs = __webpack_require__(104) var validate = __webpack_require__(189) var extend = __webpack_require__(79) function Har (request) { this.request = request } Har.prototype.reducer = function (obj, pair) { // new property ? if (obj[pair.name] === undefined) { obj[pair.name] = pair.value return obj } // existing? convert to array var arr = [ obj[pair.name], pair.value ] obj[pair.name] = arr return obj } Har.prototype.prep = function (data) { // construct utility properties data.queryObj = {} data.headersObj = {} data.postData.jsonObj = false data.postData.paramsObj = false // construct query objects if (data.queryString && data.queryString.length) { data.queryObj = data.queryString.reduce(this.reducer, {}) } // construct headers objects if (data.headers && data.headers.length) { // loweCase header keys data.headersObj = data.headers.reduceRight(function (headers, header) { headers[header.name] = header.value return headers }, {}) } // construct Cookie header if (data.cookies && data.cookies.length) { var cookies = data.cookies.map(function (cookie) { return cookie.name + '=' + cookie.value }) if (cookies.length) { data.headersObj.cookie = cookies.join('; ') } } // prep body function some (arr) { return arr.some(function (type) { return data.postData.mimeType.indexOf(type) === 0 }) } if (some([ 'multipart/mixed', 'multipart/related', 'multipart/form-data', 'multipart/alternative'])) { // reset values data.postData.mimeType = 'multipart/form-data' } else if (some([ 'application/x-www-form-urlencoded'])) { if (!data.postData.params) { data.postData.text = '' } else { data.postData.paramsObj = data.postData.params.reduce(this.reducer, {}) // always overwrite data.postData.text = qs.stringify(data.postData.paramsObj) } } else if (some([ 'text/json', 'text/x-json', 'application/json', 'application/x-json'])) { data.postData.mimeType = 'application/json' if (data.postData.text) { try { data.postData.jsonObj = JSON.parse(data.postData.text) } catch (e) { this.request.debug(e) // force back to text/plain data.postData.mimeType = 'text/plain' } } } return data } Har.prototype.options = function (options) { // skip if no har property defined if (!options.har) { return options } var har = {} extend(har, options.har) // only process the first entry if (har.log && har.log.entries) { har = har.log.entries[0] } // add optional properties to make validation successful har.url = har.url || options.url || options.uri || options.baseUrl || '/' har.httpVersion = har.httpVersion || 'HTTP/1.1' har.queryString = har.queryString || [] har.headers = har.headers || [] har.cookies = har.cookies || [] har.postData = har.postData || {} har.postData.mimeType = har.postData.mimeType || 'application/octet-stream' har.bodySize = 0 har.headersSize = 0 har.postData.size = 0 if (!validate.request(har)) { return options } // clean up and get some utility properties var req = this.prep(har) // construct new options if (req.url) { options.url = req.url } if (req.method) { options.method = req.method } if (Object.keys(req.queryObj).length) { options.qs = req.queryObj } if (Object.keys(req.headersObj).length) { options.headers = req.headersObj } function test (type) { return req.postData.mimeType.indexOf(type) === 0 } if (test('application/x-www-form-urlencoded')) { options.form = req.postData.paramsObj } else if (test('application/json')) { if (req.postData.jsonObj) { options.body = req.postData.jsonObj options.json = true } } else if (test('multipart/form-data')) { options.formData = {} req.postData.params.forEach(function (param) { var attachment = {} if (!param.fileName && !param.fileName && !param.contentType) { options.formData[param.name] = param.value return } // attempt to read from disk! if (param.fileName && !param.value) { attachment.value = fs.createReadStream(param.fileName) } else if (param.value) { attachment.value = param.value } if (param.fileName) { attachment.options = { filename: param.fileName, contentType: param.contentType ? param.contentType : null } } options.formData[param.name] = attachment }) } else { if (req.postData.text) { options.body = req.postData.text } } return options } exports.Har = Har /***/ }), /* 189 */ /***/ (function(module, exports, __webpack_require__) { var Ajv = __webpack_require__(190) var HARError = __webpack_require__(236) var schemas = __webpack_require__(237) var ajv function createAjvInstance () { var ajv = new Ajv({ allErrors: true }) ajv.addMetaSchema(__webpack_require__(256)) ajv.addSchema(schemas) return ajv } function validate (name, data) { data = data || {} // validator config ajv = ajv || createAjvInstance() var validate = ajv.getSchema(name + '.json') return new Promise(function (resolve, reject) { var valid = validate(data) !valid ? reject(new HARError(validate.errors)) : resolve(data) }) } exports.afterRequest = function (data) { return validate('afterRequest', data) } exports.beforeRequest = function (data) { return validate('beforeRequest', data) } exports.browser = function (data) { return validate('browser', data) } exports.cache = function (data) { return validate('cache', data) } exports.content = function (data) { return validate('content', data) } exports.cookie = function (data) { return validate('cookie', data) } exports.creator = function (data) { return validate('creator', data) } exports.entry = function (data) { return validate('entry', data) } exports.har = function (data) { return validate('har', data) } exports.header = function (data) { return validate('header', data) } exports.log = function (data) { return validate('log', data) } exports.page = function (data) { return validate('page', data) } exports.pageTimings = function (data) { return validate('pageTimings', data) } exports.postData = function (data) { return validate('postData', data) } exports.query = function (data) { return validate('query', data) } exports.request = function (data) { return validate('request', data) } exports.response = function (data) { return validate('response', data) } exports.timings = function (data) { return validate('timings', data) } /***/ }), /* 190 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var compileSchema = __webpack_require__(191) , resolve = __webpack_require__(192) , Cache = __webpack_require__(202) , SchemaObject = __webpack_require__(197) , stableStringify = __webpack_require__(200) , formats = __webpack_require__(203) , rules = __webpack_require__(204) , $dataMetaSchema = __webpack_require__(229) , util = __webpack_require__(195); module.exports = Ajv; Ajv.prototype.validate = validate; Ajv.prototype.compile = compile; Ajv.prototype.addSchema = addSchema; Ajv.prototype.addMetaSchema = addMetaSchema; Ajv.prototype.validateSchema = validateSchema; Ajv.prototype.getSchema = getSchema; Ajv.prototype.removeSchema = removeSchema; Ajv.prototype.addFormat = addFormat; Ajv.prototype.errorsText = errorsText; Ajv.prototype._addSchema = _addSchema; Ajv.prototype._compile = _compile; Ajv.prototype.compileAsync = __webpack_require__(230); var customKeyword = __webpack_require__(231); Ajv.prototype.addKeyword = customKeyword.add; Ajv.prototype.getKeyword = customKeyword.get; Ajv.prototype.removeKeyword = customKeyword.remove; Ajv.prototype.validateKeyword = customKeyword.validate; var errorClasses = __webpack_require__(199); Ajv.ValidationError = errorClasses.Validation; Ajv.MissingRefError = errorClasses.MissingRef; Ajv.$dataMetaSchema = $dataMetaSchema; var META_SCHEMA_ID = 'http://json-schema.org/draft-07/schema'; var META_IGNORE_OPTIONS = [ 'removeAdditional', 'useDefaults', 'coerceTypes', 'strictDefaults' ]; var META_SUPPORT_DATA = ['/properties']; /** * Creates validator instance. * Usage: `Ajv(opts)` * @param {Object} opts optional options * @return {Object} ajv instance */ function Ajv(opts) { if (!(this instanceof Ajv)) return new Ajv(opts); opts = this._opts = util.copy(opts) || {}; setLogger(this); this._schemas = {}; this._refs = {}; this._fragments = {}; this._formats = formats(opts.format); this._cache = opts.cache || new Cache; this._loadingSchemas = {}; this._compilations = []; this.RULES = rules(); this._getId = chooseGetId(opts); opts.loopRequired = opts.loopRequired || Infinity; if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true; if (opts.serialize === undefined) opts.serialize = stableStringify; this._metaOpts = getMetaSchemaOptions(this); if (opts.formats) addInitialFormats(this); addDefaultMetaSchema(this); if (typeof opts.meta == 'object') this.addMetaSchema(opts.meta); if (opts.nullable) this.addKeyword('nullable', {metaSchema: {type: 'boolean'}}); addInitialSchemas(this); } /** * Validate data using schema * Schema will be compiled and cached (using serialized JSON as key. [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used to serialize. * @this Ajv * @param {String|Object} schemaKeyRef key, ref or schema object * @param {Any} data to be validated * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`). */ function validate(schemaKeyRef, data) { var v; if (typeof schemaKeyRef == 'string') { v = this.getSchema(schemaKeyRef); if (!v) throw new Error('no schema with key or ref "' + schemaKeyRef + '"'); } else { var schemaObj = this._addSchema(schemaKeyRef); v = schemaObj.validate || this._compile(schemaObj); } var valid = v(data); if (v.$async !== true) this.errors = v.errors; return valid; } /** * Create validating function for passed schema. * @this Ajv * @param {Object} schema schema object * @param {Boolean} _meta true if schema is a meta-schema. Used internally to compile meta schemas of custom keywords. * @return {Function} validating function */ function compile(schema, _meta) { var schemaObj = this._addSchema(schema, undefined, _meta); return schemaObj.validate || this._compile(schemaObj); } /** * Adds schema to the instance. * @this Ajv * @param {Object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored. * @param {String} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. * @param {Boolean} _skipValidation true to skip schema validation. Used internally, option validateSchema should be used instead. * @param {Boolean} _meta true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. * @return {Ajv} this for method chaining */ function addSchema(schema, key, _skipValidation, _meta) { if (Array.isArray(schema)){ for (var i=0; i<schema.length; i++) this.addSchema(schema[i], undefined, _skipValidation, _meta); return this; } var id = this._getId(schema); if (id !== undefined && typeof id != 'string') throw new Error('schema id must be string'); key = resolve.normalizeId(key || id); checkUnique(this, key); this._schemas[key] = this._addSchema(schema, _skipValidation, _meta, true); return this; } /** * Add schema that will be used to validate other schemas * options in META_IGNORE_OPTIONS are alway set to false * @this Ajv * @param {Object} schema schema object * @param {String} key optional schema key * @param {Boolean} skipValidation true to skip schema validation, can be used to override validateSchema option for meta-schema * @return {Ajv} this for method chaining */ function addMetaSchema(schema, key, skipValidation) { this.addSchema(schema, key, skipValidation, true); return this; } /** * Validate schema * @this Ajv * @param {Object} schema schema to validate * @param {Boolean} throwOrLogError pass true to throw (or log) an error if invalid * @return {Boolean} true if schema is valid */ function validateSchema(schema, throwOrLogError) { var $schema = schema.$schema; if ($schema !== undefined && typeof $schema != 'string') throw new Error('$schema must be a string'); $schema = $schema || this._opts.defaultMeta || defaultMeta(this); if (!$schema) { this.logger.warn('meta-schema not available'); this.errors = null; return true; } var valid = this.validate($schema, schema); if (!valid && throwOrLogError) { var message = 'schema is invalid: ' + this.errorsText(); if (this._opts.validateSchema == 'log') this.logger.error(message); else throw new Error(message); } return valid; } function defaultMeta(self) { var meta = self._opts.meta; self._opts.defaultMeta = typeof meta == 'object' ? self._getId(meta) || meta : self.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined; return self._opts.defaultMeta; } /** * Get compiled schema from the instance by `key` or `ref`. * @this Ajv * @param {String} keyRef `key` that was passed to `addSchema` or full schema reference (`schema.id` or resolved id). * @return {Function} schema validating function (with property `schema`). */ function getSchema(keyRef) { var schemaObj = _getSchemaObj(this, keyRef); switch (typeof schemaObj) { case 'object': return schemaObj.validate || this._compile(schemaObj); case 'string': return this.getSchema(schemaObj); case 'undefined': return _getSchemaFragment(this, keyRef); } } function _getSchemaFragment(self, ref) { var res = resolve.schema.call(self, { schema: {} }, ref); if (res) { var schema = res.schema , root = res.root , baseId = res.baseId; var v = compileSchema.call(self, schema, root, undefined, baseId); self._fragments[ref] = new SchemaObject({ ref: ref, fragment: true, schema: schema, root: root, baseId: baseId, validate: v }); return v; } } function _getSchemaObj(self, keyRef) { keyRef = resolve.normalizeId(keyRef); return self._schemas[keyRef] || self._refs[keyRef] || self._fragments[keyRef]; } /** * Remove cached schema(s). * If no parameter is passed all schemas but meta-schemas are removed. * If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed. * Even if schema is referenced by other schemas it still can be removed as other schemas have local references. * @this Ajv * @param {String|Object|RegExp} schemaKeyRef key, ref, pattern to match key/ref or schema object * @return {Ajv} this for method chaining */ function removeSchema(schemaKeyRef) { if (schemaKeyRef instanceof RegExp) { _removeAllSchemas(this, this._schemas, schemaKeyRef); _removeAllSchemas(this, this._refs, schemaKeyRef); return this; } switch (typeof schemaKeyRef) { case 'undefined': _removeAllSchemas(this, this._schemas); _removeAllSchemas(this, this._refs); this._cache.clear(); return this; case 'string': var schemaObj = _getSchemaObj(this, schemaKeyRef); if (schemaObj) this._cache.del(schemaObj.cacheKey); delete this._schemas[schemaKeyRef]; delete this._refs[schemaKeyRef]; return this; case 'object': var serialize = this._opts.serialize; var cacheKey = serialize ? serialize(schemaKeyRef) : schemaKeyRef; this._cache.del(cacheKey); var id = this._getId(schemaKeyRef); if (id) { id = resolve.normalizeId(id); delete this._schemas[id]; delete this._refs[id]; } } return this; } function _removeAllSchemas(self, schemas, regex) { for (var keyRef in schemas) { var schemaObj = schemas[keyRef]; if (!schemaObj.meta && (!regex || regex.test(keyRef))) { self._cache.del(schemaObj.cacheKey); delete schemas[keyRef]; } } } /* @this Ajv */ function _addSchema(schema, skipValidation, meta, shouldAddSchema) { if (typeof schema != 'object' && typeof schema != 'boolean') throw new Error('schema should be object or boolean'); var serialize = this._opts.serialize; var cacheKey = serialize ? serialize(schema) : schema; var cached = this._cache.get(cacheKey); if (cached) return cached; shouldAddSchema = shouldAddSchema || this._opts.addUsedSchema !== false; var id = resolve.normalizeId(this._getId(schema)); if (id && shouldAddSchema) checkUnique(this, id); var willValidate = this._opts.validateSchema !== false && !skipValidation; var recursiveMeta; if (willValidate && !(recursiveMeta = id && id == resolve.normalizeId(schema.$schema))) this.validateSchema(schema, true); var localRefs = resolve.ids.call(this, schema); var schemaObj = new SchemaObject({ id: id, schema: schema, localRefs: localRefs, cacheKey: cacheKey, meta: meta }); if (id[0] != '#' && shouldAddSchema) this._refs[id] = schemaObj; this._cache.put(cacheKey, schemaObj); if (willValidate && recursiveMeta) this.validateSchema(schema, true); return schemaObj; } /* @this Ajv */ function _compile(schemaObj, root) { if (schemaObj.compiling) { schemaObj.validate = callValidate; callValidate.schema = schemaObj.schema; callValidate.errors = null; callValidate.root = root ? root : callValidate; if (schemaObj.schema.$async === true) callValidate.$async = true; return callValidate; } schemaObj.compiling = true; var currentOpts; if (schemaObj.meta) { currentOpts = this._opts; this._opts = this._metaOpts; } var v; try { v = compileSchema.call(this, schemaObj.schema, root, schemaObj.localRefs); } catch(e) { delete schemaObj.validate; throw e; } finally { schemaObj.compiling = false; if (schemaObj.meta) this._opts = currentOpts; } schemaObj.validate = v; schemaObj.refs = v.refs; schemaObj.refVal = v.refVal; schemaObj.root = v.root; return v; /* @this {*} - custom context, see passContext option */ function callValidate() { /* jshint validthis: true */ var _validate = schemaObj.validate; var result = _validate.apply(this, arguments); callValidate.errors = _validate.errors; return result; } } function chooseGetId(opts) { switch (opts.schemaId) { case 'auto': return _get$IdOrId; case 'id': return _getId; default: return _get$Id; } } /* @this Ajv */ function _getId(schema) { if (schema.$id) this.logger.warn('schema $id ignored', schema.$id); return schema.id; } /* @this Ajv */ function _get$Id(schema) { if (schema.id) this.logger.warn('schema id ignored', schema.id); return schema.$id; } function _get$IdOrId(schema) { if (schema.$id && schema.id && schema.$id != schema.id) throw new Error('schema $id is different from id'); return schema.$id || schema.id; } /** * Convert array of error message objects to string * @this Ajv * @param {Array<Object>} errors optional array of validation errors, if not passed errors from the instance are used. * @param {Object} options optional options with properties `separator` and `dataVar`. * @return {String} human readable string with all errors descriptions */ function errorsText(errors, options) { errors = errors || this.errors; if (!errors) return 'No errors'; options = options || {}; var separator = options.separator === undefined ? ', ' : options.separator; var dataVar = options.dataVar === undefined ? 'data' : options.dataVar; var text = ''; for (var i=0; i<errors.length; i++) { var e = errors[i]; if (e) text += dataVar + e.dataPath + ' ' + e.message + separator; } return text.slice(0, -separator.length); } /** * Add custom format * @this Ajv * @param {String} name format name * @param {String|RegExp|Function} format string is converted to RegExp; function should return boolean (true when valid) * @return {Ajv} this for method chaining */ function addFormat(name, format) { if (typeof format == 'string') format = new RegExp(format); this._formats[name] = format; return this; } function addDefaultMetaSchema(self) { var $dataSchema; if (self._opts.$data) { $dataSchema = __webpack_require__(235); self.addMetaSchema($dataSchema, $dataSchema.$id, true); } if (self._opts.meta === false) return; var metaSchema = __webpack_require__(234); if (self._opts.$data) metaSchema = $dataMetaSchema(metaSchema, META_SUPPORT_DATA); self.addMetaSchema(metaSchema, META_SCHEMA_ID, true); self._refs['http://json-schema.org/schema'] = META_SCHEMA_ID; } function addInitialSchemas(self) { var optsSchemas = self._opts.schemas; if (!optsSchemas) return; if (Array.isArray(optsSchemas)) self.addSchema(optsSchemas); else for (var key in optsSchemas) self.addSchema(optsSchemas[key], key); } function addInitialFormats(self) { for (var name in self._opts.formats) { var format = self._opts.formats[name]; self.addFormat(name, format); } } function checkUnique(self, id) { if (self._schemas[id] || self._refs[id]) throw new Error('schema with key or id "' + id + '" already exists'); } function getMetaSchemaOptions(self) { var metaOpts = util.copy(self._opts); for (var i=0; i<META_IGNORE_OPTIONS.length; i++) delete metaOpts[META_IGNORE_OPTIONS[i]]; return metaOpts; } function setLogger(self) { var logger = self._opts.logger; if (logger === false) { self.logger = {log: noop, warn: noop, error: noop}; } else { if (logger === undefined) logger = console; if (!(typeof logger == 'object' && logger.log && logger.warn && logger.error)) throw new Error('logger must implement log, warn and error methods'); self.logger = logger; } } function noop() {} /***/ }), /* 191 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var resolve = __webpack_require__(192) , util = __webpack_require__(195) , errorClasses = __webpack_require__(199) , stableStringify = __webpack_require__(200); var validateGenerator = __webpack_require__(201); /** * Functions below are used inside compiled validations function */ var ucs2length = util.ucs2length; var equal = __webpack_require__(194); // this error is thrown by async schemas to return validation errors via exception var ValidationError = errorClasses.Validation; module.exports = compile; /** * Compiles schema to validation function * @this Ajv * @param {Object} schema schema object * @param {Object} root object with information about the root schema for this schema * @param {Object} localRefs the hash of local references inside the schema (created by resolve.id), used for inline resolution * @param {String} baseId base ID for IDs in the schema * @return {Function} validation function */ function compile(schema, root, localRefs, baseId) { /* jshint validthis: true, evil: true */ /* eslint no-shadow: 0 */ var self = this , opts = this._opts , refVal = [ undefined ] , refs = {} , patterns = [] , patternsHash = {} , defaults = [] , defaultsHash = {} , customRules = []; root = root || { schema: schema, refVal: refVal, refs: refs }; var c = checkCompiling.call(this, schema, root, baseId); var compilation = this._compilations[c.index]; if (c.compiling) return (compilation.callValidate = callValidate); var formats = this._formats; var RULES = this.RULES; try { var v = localCompile(schema, root, localRefs, baseId); compilation.validate = v; var cv = compilation.callValidate; if (cv) { cv.schema = v.schema; cv.errors = null; cv.refs = v.refs; cv.refVal = v.refVal; cv.root = v.root; cv.$async = v.$async; if (opts.sourceCode) cv.source = v.source; } return v; } finally { endCompiling.call(this, schema, root, baseId); } /* @this {*} - custom context, see passContext option */ function callValidate() { /* jshint validthis: true */ var validate = compilation.validate; var result = validate.apply(this, arguments); callValidate.errors = validate.errors; return result; } function localCompile(_schema, _root, localRefs, baseId) { var isRoot = !_root || (_root && _root.schema == _schema); if (_root.schema != root.schema) return compile.call(self, _schema, _root, localRefs, baseId); var $async = _schema.$async === true; var sourceCode = validateGenerator({ isTop: true, schema: _schema, isRoot: isRoot, baseId: baseId, root: _root, schemaPath: '', errSchemaPath: '#', errorPath: '""', MissingRefError: errorClasses.MissingRef, RULES: RULES, validate: validateGenerator, util: util, resolve: resolve, resolveRef: resolveRef, usePattern: usePattern, useDefault: useDefault, useCustomRule: useCustomRule, opts: opts, formats: formats, logger: self.logger, self: self }); sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode) + vars(defaults, defaultCode) + vars(customRules, customRuleCode) + sourceCode; if (opts.processCode) sourceCode = opts.processCode(sourceCode); // console.log('\n\n\n *** \n', JSON.stringify(sourceCode)); var validate; try { var makeValidate = new Function( 'self', 'RULES', 'formats', 'root', 'refVal', 'defaults', 'customRules', 'equal', 'ucs2length', 'ValidationError', sourceCode ); validate = makeValidate( self, RULES, formats, root, refVal, defaults, customRules, equal, ucs2length, ValidationError ); refVal[0] = validate; } catch(e) { self.logger.error('Error compiling schema, function code:', sourceCode); throw e; } validate.schema = _schema; validate.errors = null; validate.refs = refs; validate.refVal = refVal; validate.root = isRoot ? validate : _root; if ($async) validate.$async = true; if (opts.sourceCode === true) { validate.source = { code: sourceCode, patterns: patterns, defaults: defaults }; } return validate; } function resolveRef(baseId, ref, isRoot) { ref = resolve.url(baseId, ref); var refIndex = refs[ref]; var _refVal, refCode; if (refIndex !== undefined) { _refVal = refVal[refIndex]; refCode = 'refVal[' + refIndex + ']'; return resolvedRef(_refVal, refCode); } if (!isRoot && root.refs) { var rootRefId = root.refs[ref]; if (rootRefId !== undefined) { _refVal = root.refVal[rootRefId]; refCode = addLocalRef(ref, _refVal); return resolvedRef(_refVal, refCode); } } refCode = addLocalRef(ref); var v = resolve.call(self, localCompile, root, ref); if (v === undefined) { var localSchema = localRefs && localRefs[ref]; if (localSchema) { v = resolve.inlineRef(localSchema, opts.inlineRefs) ? localSchema : compile.call(self, localSchema, root, localRefs, baseId); } } if (v === undefined) { removeLocalRef(ref); } else { replaceLocalRef(ref, v); return resolvedRef(v, refCode); } } function addLocalRef(ref, v) { var refId = refVal.length; refVal[refId] = v; refs[ref] = refId; return 'refVal' + refId; } function removeLocalRef(ref) { delete refs[ref]; } function replaceLocalRef(ref, v) { var refId = refs[ref]; refVal[refId] = v; } function resolvedRef(refVal, code) { return typeof refVal == 'object' || typeof refVal == 'boolean' ? { code: code, schema: refVal, inline: true } : { code: code, $async: refVal && !!refVal.$async }; } function usePattern(regexStr) { var index = patternsHash[regexStr]; if (index === undefined) { index = patternsHash[regexStr] = patterns.length; patterns[index] = regexStr; } return 'pattern' + index; } function useDefault(value) { switch (typeof value) { case 'boolean': case 'number': return '' + value; case 'string': return util.toQuotedString(value); case 'object': if (value === null) return 'null'; var valueStr = stableStringify(value); var index = defaultsHash[valueStr]; if (index === undefined) { index = defaultsHash[valueStr] = defaults.length; defaults[index] = value; } return 'default' + index; } } function useCustomRule(rule, schema, parentSchema, it) { if (self._opts.validateSchema !== false) { var deps = rule.definition.dependencies; if (deps && !deps.every(function(keyword) { return Object.prototype.hasOwnProperty.call(parentSchema, keyword); })) throw new Error('parent schema must have all required keywords: ' + deps.join(',')); var validateSchema = rule.definition.validateSchema; if (validateSchema) { var valid = validateSchema(schema); if (!valid) { var message = 'keyword schema is invalid: ' + self.errorsText(validateSchema.errors); if (self._opts.validateSchema == 'log') self.logger.error(message); else throw new Error(message); } } } var compile = rule.definition.compile , inline = rule.definition.inline , macro = rule.definition.macro; var validate; if (compile) { validate = compile.call(self, schema, parentSchema, it); } else if (macro) { validate = macro.call(self, schema, parentSchema, it); if (opts.validateSchema !== false) self.validateSchema(validate, true); } else if (inline) { validate = inline.call(self, it, rule.keyword, schema, parentSchema); } else { validate = rule.definition.validate; if (!validate) return; } if (validate === undefined) throw new Error('custom keyword "' + rule.keyword + '"failed to compile'); var index = customRules.length; customRules[index] = validate; return { code: 'customRule' + index, validate: validate }; } } /** * Checks if the schema is currently compiled * @this Ajv * @param {Object} schema schema to compile * @param {Object} root root object * @param {String} baseId base schema ID * @return {Object} object with properties "index" (compilation index) and "compiling" (boolean) */ function checkCompiling(schema, root, baseId) { /* jshint validthis: true */ var index = compIndex.call(this, schema, root, baseId); if (index >= 0) return { index: index, compiling: true }; index = this._compilations.length; this._compilations[index] = { schema: schema, root: root, baseId: baseId }; return { index: index, compiling: false }; } /** * Removes the schema from the currently compiled list * @this Ajv * @param {Object} schema schema to compile * @param {Object} root root object * @param {String} baseId base schema ID */ function endCompiling(schema, root, baseId) { /* jshint validthis: true */ var i = compIndex.call(this, schema, root, baseId); if (i >= 0) this._compilations.splice(i, 1); } /** * Index of schema compilation in the currently compiled list * @this Ajv * @param {Object} schema schema to compile * @param {Object} root root object * @param {String} baseId base schema ID * @return {Integer} compilation index */ function compIndex(schema, root, baseId) { /* jshint validthis: true */ for (var i=0; i<this._compilations.length; i++) { var c = this._compilations[i]; if (c.schema == schema && c.root == root && c.baseId == baseId) return i; } return -1; } function patternCode(i, patterns) { return 'var pattern' + i + ' = new RegExp(' + util.toQuotedString(patterns[i]) + ');'; } function defaultCode(i) { return 'var default' + i + ' = defaults[' + i + '];'; } function refValCode(i, refVal) { return refVal[i] === undefined ? '' : 'var refVal' + i + ' = refVal[' + i + '];'; } function customRuleCode(i) { return 'var customRule' + i + ' = customRules[' + i + '];'; } function vars(arr, statement) { if (!arr.length) return ''; var code = ''; for (var i=0; i<arr.length; i++) code += statement(i, arr); return code; } /***/ }), /* 192 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var URI = __webpack_require__(193) , equal = __webpack_require__(194) , util = __webpack_require__(195) , SchemaObject = __webpack_require__(197) , traverse = __webpack_require__(198); module.exports = resolve; resolve.normalizeId = normalizeId; resolve.fullPath = getFullPath; resolve.url = resolveUrl; resolve.ids = resolveIds; resolve.inlineRef = inlineRef; resolve.schema = resolveSchema; /** * [resolve and compile the references ($ref)] * @this Ajv * @param {Function} compile reference to schema compilation funciton (localCompile) * @param {Object} root object with information about the root schema for the current schema * @param {String} ref reference to resolve * @return {Object|Function} schema object (if the schema can be inlined) or validation function */ function resolve(compile, root, ref) { /* jshint validthis: true */ var refVal = this._refs[ref]; if (typeof refVal == 'string') { if (this._refs[refVal]) refVal = this._refs[refVal]; else return resolve.call(this, compile, root, refVal); } refVal = refVal || this._schemas[ref]; if (refVal instanceof SchemaObject) { return inlineRef(refVal.schema, this._opts.inlineRefs) ? refVal.schema : refVal.validate || this._compile(refVal); } var res = resolveSchema.call(this, root, ref); var schema, v, baseId; if (res) { schema = res.schema; root = res.root; baseId = res.baseId; } if (schema instanceof SchemaObject) { v = schema.validate || compile.call(this, schema.schema, root, undefined, baseId); } else if (schema !== undefined) { v = inlineRef(schema, this._opts.inlineRefs) ? schema : compile.call(this, schema, root, undefined, baseId); } return v; } /** * Resolve schema, its root and baseId * @this Ajv * @param {Object} root root object with properties schema, refVal, refs * @param {String} ref reference to resolve * @return {Object} object with properties schema, root, baseId */ function resolveSchema(root, ref) { /* jshint validthis: true */ var p = URI.parse(ref) , refPath = _getFullPath(p) , baseId = getFullPath(this._getId(root.schema)); if (Object.keys(root.schema).length === 0 || refPath !== baseId) { var id = normalizeId(refPath); var refVal = this._refs[id]; if (typeof refVal == 'string') { return resolveRecursive.call(this, root, refVal, p); } else if (refVal instanceof SchemaObject) { if (!refVal.validate) this._compile(refVal); root = refVal; } else { refVal = this._schemas[id]; if (refVal instanceof SchemaObject) { if (!refVal.validate) this._compile(refVal); if (id == normalizeId(ref)) return { schema: refVal, root: root, baseId: baseId }; root = refVal; } else { return; } } if (!root.schema) return; baseId = getFullPath(this._getId(root.schema)); } return getJsonPointer.call(this, p, baseId, root.schema, root); } /* @this Ajv */ function resolveRecursive(root, ref, parsedRef) { /* jshint validthis: true */ var res = resolveSchema.call(this, root, ref); if (res) { var schema = res.schema; var baseId = res.baseId; root = res.root; var id = this._getId(schema); if (id) baseId = resolveUrl(baseId, id); return getJsonPointer.call(this, parsedRef, baseId, schema, root); } } var PREVENT_SCOPE_CHANGE = util.toHash(['properties', 'patternProperties', 'enum', 'dependencies', 'definitions']); /* @this Ajv */ function getJsonPointer(parsedRef, baseId, schema, root) { /* jshint validthis: true */ parsedRef.fragment = parsedRef.fragment || ''; if (parsedRef.fragment.slice(0,1) != '/') return; var parts = parsedRef.fragment.split('/'); for (var i = 1; i < parts.length; i++) { var part = parts[i]; if (part) { part = util.unescapeFragment(part); schema = schema[part]; if (schema === undefined) break; var id; if (!PREVENT_SCOPE_CHANGE[part]) { id = this._getId(schema); if (id) baseId = resolveUrl(baseId, id); if (schema.$ref) { var $ref = resolveUrl(baseId, schema.$ref); var res = resolveSchema.call(this, root, $ref); if (res) { schema = res.schema; root = res.root; baseId = res.baseId; } } } } } if (schema !== undefined && schema !== root.schema) return { schema: schema, root: root, baseId: baseId }; } var SIMPLE_INLINED = util.toHash([ 'type', 'format', 'pattern', 'maxLength', 'minLength', 'maxProperties', 'minProperties', 'maxItems', 'minItems', 'maximum', 'minimum', 'uniqueItems', 'multipleOf', 'required', 'enum' ]); function inlineRef(schema, limit) { if (limit === false) return false; if (limit === undefined || limit === true) return checkNoRef(schema); else if (limit) return countKeys(schema) <= limit; } function checkNoRef(schema) { var item; if (Array.isArray(schema)) { for (var i=0; i<schema.length; i++) { item = schema[i]; if (typeof item == 'object' && !checkNoRef(item)) return false; } } else { for (var key in schema) { if (key == '$ref') return false; item = schema[key]; if (typeof item == 'object' && !checkNoRef(item)) return false; } } return true; } function countKeys(schema) { var count = 0, item; if (Array.isArray(schema)) { for (var i=0; i<schema.length; i++) { item = schema[i]; if (typeof item == 'object') count += countKeys(item); if (count == Infinity) return Infinity; } } else { for (var key in schema) { if (key == '$ref') return Infinity; if (SIMPLE_INLINED[key]) { count++; } else { item = schema[key]; if (typeof item == 'object') count += countKeys(item) + 1; if (count == Infinity) return Infinity; } } } return count; } function getFullPath(id, normalize) { if (normalize !== false) id = normalizeId(id); var p = URI.parse(id); return _getFullPath(p); } function _getFullPath(p) { return URI.serialize(p).split('#')[0] + '#'; } var TRAILING_SLASH_HASH = /#\/?$/; function normalizeId(id) { return id ? id.replace(TRAILING_SLASH_HASH, '') : ''; } function resolveUrl(baseId, id) { id = normalizeId(id); return URI.resolve(baseId, id); } /* @this Ajv */ function resolveIds(schema) { var schemaId = normalizeId(this._getId(schema)); var baseIds = {'': schemaId}; var fullPaths = {'': getFullPath(schemaId, false)}; var localRefs = {}; var self = this; traverse(schema, {allKeys: true}, function(sch, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { if (jsonPtr === '') return; var id = self._getId(sch); var baseId = baseIds[parentJsonPtr]; var fullPath = fullPaths[parentJsonPtr] + '/' + parentKeyword; if (keyIndex !== undefined) fullPath += '/' + (typeof keyIndex == 'number' ? keyIndex : util.escapeFragment(keyIndex)); if (typeof id == 'string') { id = baseId = normalizeId(baseId ? URI.resolve(baseId, id) : id); var refVal = self._refs[id]; if (typeof refVal == 'string') refVal = self._refs[refVal]; if (refVal && refVal.schema) { if (!equal(sch, refVal.schema)) throw new Error('id "' + id + '" resolves to more than one schema'); } else if (id != normalizeId(fullPath)) { if (id[0] == '#') { if (localRefs[id] && !equal(sch, localRefs[id])) throw new Error('id "' + id + '" resolves to more than one schema'); localRefs[id] = sch; } else { self._refs[id] = fullPath; } } } baseIds[jsonPtr] = baseId; fullPaths[jsonPtr] = fullPath; }); return localRefs; } /***/ }), /* 193 */ /***/ (function(module, exports, __webpack_require__) { /** @license URI.js v4.2.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ (function (global, factory) { true ? factory(exports) : undefined; }(this, (function (exports) { 'use strict'; function merge() { for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) { sets[_key] = arguments[_key]; } if (sets.length > 1) { sets[0] = sets[0].slice(0, -1); var xl = sets.length - 1; for (var x = 1; x < xl; ++x) { sets[x] = sets[x].slice(1, -1); } sets[xl] = sets[xl].slice(1); return sets.join(''); } else { return sets[0]; } } function subexp(str) { return "(?:" + str + ")"; } function typeOf(o) { return o === undefined ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase(); } function toUpperCase(str) { return str.toUpperCase(); } function toArray(obj) { return obj !== undefined && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : []; } function assign(target, source) { var obj = target; if (source) { for (var key in source) { obj[key] = source[key]; } } return obj; } function buildExps(isIRI) { var ALPHA$$ = "[A-Za-z]", CR$ = "[\\x0D]", DIGIT$$ = "[0-9]", DQUOTE$$ = "[\\x22]", HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"), //case-insensitive LF$$ = "[\\x0A]", SP$$ = "[\\x20]", PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)), //expanded GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", //subset, excludes bidi control characters IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]", //subset UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"), DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$), //relaxed parsing rules IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), H16$ = subexp(HEXDIG$$ + "{1,4}"), LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), // 6( h16 ":" ) ls32 IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), // "::" 5( h16 ":" ) ls32 IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), //[ h16 ] "::" 4( h16 ":" ) ls32 IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), //[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), //[ *4( h16 ":" ) h16 ] "::" ls32 IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), //[ *5( h16 ":" ) h16 ] "::" h16 IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), //[ *6( h16 ":" ) h16 ] "::" IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"), //RFC 6874 IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), //RFC 6874 IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$), //RFC 6874, with relaxed parsing rules IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"), IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), //RFC 6874 REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"), HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")" + "|" + REG_NAME$), PORT$ = subexp(DIGIT$$ + "*"), AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")), SEGMENT$ = subexp(PCHAR$ + "*"), SEGMENT_NZ$ = subexp(PCHAR$ + "+"), SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"), PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), //simplified PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified PATH_EMPTY$ = "(?!" + PCHAR$ + ")", PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"), FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$"; return { NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"), NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"), NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"), ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"), UNRESERVED: new RegExp(UNRESERVED$$, "g"), OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"), PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"), IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"), IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules }; } var URI_PROTOCOL = buildExps(false); var IRI_PROTOCOL = buildExps(true); var slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var toConsumableArray = function (arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }; /** Highest positive signed 32-bit float value */ var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 /** Bootstring parameters */ var base = 36; var tMin = 1; var tMax = 26; var skew = 38; var damp = 700; var initialBias = 72; var initialN = 128; // 0x80 var delimiter = '-'; // '\x2D' /** Regular expressions */ var regexPunycode = /^xn--/; var regexNonASCII = /[^\0-\x7E]/; // non-ASCII chars var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators /** Error messages */ var errors = { 'overflow': 'Overflow: input needs wider integers to process', 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', 'invalid-input': 'Invalid input' }; /** Convenience shortcuts */ var baseMinusTMin = base - tMin; var floor = Math.floor; var stringFromCharCode = String.fromCharCode; /*--------------------------------------------------------------------------*/ /** * A generic error utility function. * @private * @param {String} type The error type. * @returns {Error} Throws a `RangeError` with the applicable error message. */ function error$1(type) { throw new RangeError(errors[type]); } /** * A generic `Array#map` utility function. * @private * @param {Array} array The array to iterate over. * @param {Function} callback The function that gets called for every array * item. * @returns {Array} A new array of values returned by the callback function. */ function map(array, fn) { var result = []; var length = array.length; while (length--) { result[length] = fn(array[length]); } return result; } /** * A simple `Array#map`-like wrapper to work with domain name strings or email * addresses. * @private * @param {String} domain The domain name or email address. * @param {Function} callback The function that gets called for every * character. * @returns {Array} A new string of characters returned by the callback * function. */ function mapDomain(string, fn) { var parts = string.split('@'); var result = ''; if (parts.length > 1) { // In email addresses, only the domain name should be punycoded. Leave // the local part (i.e. everything up to `@`) intact. result = parts[0] + '@'; string = parts[1]; } // Avoid `split(regex)` for IE8 compatibility. See #17. string = string.replace(regexSeparators, '\x2E'); var labels = string.split('.'); var encoded = map(labels, fn).join('.'); return result + encoded; } /** * Creates an array containing the numeric code points of each Unicode * character in the string. While JavaScript uses UCS-2 internally, * this function will convert a pair of surrogate halves (each of which * UCS-2 exposes as separate characters) into a single code point, * matching UTF-16. * @see `punycode.ucs2.encode` * @see <https://mathiasbynens.be/notes/javascript-encoding> * @memberOf punycode.ucs2 * @name decode * @param {String} string The Unicode input string (UCS-2). * @returns {Array} The new array of code points. */ function ucs2decode(string) { var output = []; var counter = 0; var length = string.length; while (counter < length) { var value = string.charCodeAt(counter++); if (value >= 0xD800 && value <= 0xDBFF && counter < length) { // It's a high surrogate, and there is a next character. var extra = string.charCodeAt(counter++); if ((extra & 0xFC00) == 0xDC00) { // Low surrogate. output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); } else { // It's an unmatched surrogate; only append this code unit, in case the // next code unit is the high surrogate of a surrogate pair. output.push(value); counter--; } } else { output.push(value); } } return output; } /** * Creates a string based on an array of numeric code points. * @see `punycode.ucs2.decode` * @memberOf punycode.ucs2 * @name encode * @param {Array} codePoints The array of numeric code points. * @returns {String} The new Unicode string (UCS-2). */ var ucs2encode = function ucs2encode(array) { return String.fromCodePoint.apply(String, toConsumableArray(array)); }; /** * Converts a basic code point into a digit/integer. * @see `digitToBasic()` * @private * @param {Number} codePoint The basic numeric code point value. * @returns {Number} The numeric value of a basic code point (for use in * representing integers) in the range `0` to `base - 1`, or `base` if * the code point does not represent a value. */ var basicToDigit = function basicToDigit(codePoint) { if (codePoint - 0x30 < 0x0A) { return codePoint - 0x16; } if (codePoint - 0x41 < 0x1A) { return codePoint - 0x41; } if (codePoint - 0x61 < 0x1A) { return codePoint - 0x61; } return base; }; /** * Converts a digit/integer into a basic code point. * @see `basicToDigit()` * @private * @param {Number} digit The numeric value of a basic code point. * @returns {Number} The basic code point whose value (when used for * representing integers) is `digit`, which needs to be in the range * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is * used; else, the lowercase form is used. The behavior is undefined * if `flag` is non-zero and `digit` has no uppercase form. */ var digitToBasic = function digitToBasic(digit, flag) { // 0..25 map to ASCII a..z or A..Z // 26..35 map to ASCII 0..9 return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); }; /** * Bias adaptation function as per section 3.4 of RFC 3492. * https://tools.ietf.org/html/rfc3492#section-3.4 * @private */ var adapt = function adapt(delta, numPoints, firstTime) { var k = 0; delta = firstTime ? floor(delta / damp) : delta >> 1; delta += floor(delta / numPoints); for (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) { delta = floor(delta / baseMinusTMin); } return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); }; /** * Converts a Punycode string of ASCII-only symbols to a string of Unicode * symbols. * @memberOf punycode * @param {String} input The Punycode string of ASCII-only symbols. * @returns {String} The resulting string of Unicode symbols. */ var decode = function decode(input) { // Don't use UCS-2. var output = []; var inputLength = input.length; var i = 0; var n = initialN; var bias = initialBias; // Handle the basic code points: let `basic` be the number of input code // points before the last delimiter, or `0` if there is none, then copy // the first basic code points to the output. var basic = input.lastIndexOf(delimiter); if (basic < 0) { basic = 0; } for (var j = 0; j < basic; ++j) { // if it's not a basic code point if (input.charCodeAt(j) >= 0x80) { error$1('not-basic'); } output.push(input.charCodeAt(j)); } // Main decoding loop: start just after the last delimiter if any basic code // points were copied; start at the beginning otherwise. for (var index = basic > 0 ? basic + 1 : 0; index < inputLength;) /* no final expression */{ // `index` is the index of the next character to be consumed. // Decode a generalized variable-length integer into `delta`, // which gets added to `i`. The overflow checking is easier // if we increase `i` as we go, then subtract off its starting // value at the end to obtain `delta`. var oldi = i; for (var w = 1, k = base;; /* no condition */k += base) { if (index >= inputLength) { error$1('invalid-input'); } var digit = basicToDigit(input.charCodeAt(index++)); if (digit >= base || digit > floor((maxInt - i) / w)) { error$1('overflow'); } i += digit * w; var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; if (digit < t) { break; } var baseMinusT = base - t; if (w > floor(maxInt / baseMinusT)) { error$1('overflow'); } w *= baseMinusT; } var out = output.length + 1; bias = adapt(i - oldi, out, oldi == 0); // `i` was supposed to wrap around from `out` to `0`, // incrementing `n` each time, so we'll fix that now: if (floor(i / out) > maxInt - n) { error$1('overflow'); } n += floor(i / out); i %= out; // Insert `n` at position `i` of the output. output.splice(i++, 0, n); } return String.fromCodePoint.apply(String, output); }; /** * Converts a string of Unicode symbols (e.g. a domain name label) to a * Punycode string of ASCII-only symbols. * @memberOf punycode * @param {String} input The string of Unicode symbols. * @returns {String} The resulting Punycode string of ASCII-only symbols. */ var encode = function encode(input) { var output = []; // Convert the input in UCS-2 to an array of Unicode code points. input = ucs2decode(input); // Cache the length. var inputLength = input.length; // Initialize the state. var n = initialN; var delta = 0; var bias = initialBias; // Handle the basic code points. var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var _currentValue2 = _step.value; if (_currentValue2 < 0x80) { output.push(stringFromCharCode(_currentValue2)); } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } var basicLength = output.length; var handledCPCount = basicLength; // `handledCPCount` is the number of code points that have been handled; // `basicLength` is the number of basic code points. // Finish the basic string with a delimiter unless it's empty. if (basicLength) { output.push(delimiter); } // Main encoding loop: while (handledCPCount < inputLength) { // All non-basic code points < n have been handled already. Find the next // larger one: var m = maxInt; var _iteratorNormalCompletion2 = true; var _didIteratorError2 = false; var _iteratorError2 = undefined; try { for (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { var currentValue = _step2.value; if (currentValue >= n && currentValue < m) { m = currentValue; } } // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>, // but guard against overflow. } catch (err) { _didIteratorError2 = true; _iteratorError2 = err; } finally { try { if (!_iteratorNormalCompletion2 && _iterator2.return) { _iterator2.return(); } } finally { if (_didIteratorError2) { throw _iteratorError2; } } } var handledCPCountPlusOne = handledCPCount + 1; if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { error$1('overflow'); } delta += (m - n) * handledCPCountPlusOne; n = m; var _iteratorNormalCompletion3 = true; var _didIteratorError3 = false; var _iteratorError3 = undefined; try { for (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { var _currentValue = _step3.value; if (_currentValue < n && ++delta > maxInt) { error$1('overflow'); } if (_currentValue == n) { // Represent delta as a generalized variable-length integer. var q = delta; for (var k = base;; /* no condition */k += base) { var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; if (q < t) { break; } var qMinusT = q - t; var baseMinusT = base - t; output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))); q = floor(qMinusT / baseMinusT); } output.push(stringFromCharCode(digitToBasic(q, 0))); bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); delta = 0; ++handledCPCount; } } } catch (err) { _didIteratorError3 = true; _iteratorError3 = err; } finally { try { if (!_iteratorNormalCompletion3 && _iterator3.return) { _iterator3.return(); } } finally { if (_didIteratorError3) { throw _iteratorError3; } } } ++delta; ++n; } return output.join(''); }; /** * Converts a Punycode string representing a domain name or an email address * to Unicode. Only the Punycoded parts of the input will be converted, i.e. * it doesn't matter if you call it on a string that has already been * converted to Unicode. * @memberOf punycode * @param {String} input The Punycoded domain name or email address to * convert to Unicode. * @returns {String} The Unicode representation of the given Punycode * string. */ var toUnicode = function toUnicode(input) { return mapDomain(input, function (string) { return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string; }); }; /** * Converts a Unicode string representing a domain name or an email address to * Punycode. Only the non-ASCII parts of the domain name will be converted, * i.e. it doesn't matter if you call it with a domain that's already in * ASCII. * @memberOf punycode * @param {String} input The domain name or email address to convert, as a * Unicode string. * @returns {String} The Punycode representation of the given domain name or * email address. */ var toASCII = function toASCII(input) { return mapDomain(input, function (string) { return regexNonASCII.test(string) ? 'xn--' + encode(string) : string; }); }; /*--------------------------------------------------------------------------*/ /** Define the public API */ var punycode = { /** * A string representing the current Punycode.js version number. * @memberOf punycode * @type String */ 'version': '2.1.0', /** * An object of methods to convert from JavaScript's internal character * representation (UCS-2) to Unicode code points, and back. * @see <https://mathiasbynens.be/notes/javascript-encoding> * @memberOf punycode * @type Object */ 'ucs2': { 'decode': ucs2decode, 'encode': ucs2encode }, 'decode': decode, 'encode': encode, 'toASCII': toASCII, 'toUnicode': toUnicode }; /** * URI.js * * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript. * @author <a href="mailto:gary.court@gmail.com">Gary Court</a> * @see http://github.com/garycourt/uri-js */ /** * Copyright 2011 Gary Court. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of Gary Court. */ var SCHEMES = {}; function pctEncChar(chr) { var c = chr.charCodeAt(0); var e = void 0; if (c < 16) e = "%0" + c.toString(16).toUpperCase();else if (c < 128) e = "%" + c.toString(16).toUpperCase();else if (c < 2048) e = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();else e = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase(); return e; } function pctDecChars(str) { var newStr = ""; var i = 0; var il = str.length; while (i < il) { var c = parseInt(str.substr(i + 1, 2), 16); if (c < 128) { newStr += String.fromCharCode(c); i += 3; } else if (c >= 194 && c < 224) { if (il - i >= 6) { var c2 = parseInt(str.substr(i + 4, 2), 16); newStr += String.fromCharCode((c & 31) << 6 | c2 & 63); } else { newStr += str.substr(i, 6); } i += 6; } else if (c >= 224) { if (il - i >= 9) { var _c = parseInt(str.substr(i + 4, 2), 16); var c3 = parseInt(str.substr(i + 7, 2), 16); newStr += String.fromCharCode((c & 15) << 12 | (_c & 63) << 6 | c3 & 63); } else { newStr += str.substr(i, 9); } i += 9; } else { newStr += str.substr(i, 3); i += 3; } } return newStr; } function _normalizeComponentEncoding(components, protocol) { function decodeUnreserved(str) { var decStr = pctDecChars(str); return !decStr.match(protocol.UNRESERVED) ? str : decStr; } if (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, ""); if (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); if (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); if (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); if (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); if (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); return components; } function _stripLeadingZeros(str) { return str.replace(/^0*(.*)/, "$1") || "0"; } function _normalizeIPv4(host, protocol) { var matches = host.match(protocol.IPV4ADDRESS) || []; var _matches = slicedToArray(matches, 2), address = _matches[1]; if (address) { return address.split(".").map(_stripLeadingZeros).join("."); } else { return host; } } function _normalizeIPv6(host, protocol) { var matches = host.match(protocol.IPV6ADDRESS) || []; var _matches2 = slicedToArray(matches, 3), address = _matches2[1], zone = _matches2[2]; if (address) { var _address$toLowerCase$ = address.toLowerCase().split('::').reverse(), _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2), last = _address$toLowerCase$2[0], first = _address$toLowerCase$2[1]; var firstFields = first ? first.split(":").map(_stripLeadingZeros) : []; var lastFields = last.split(":").map(_stripLeadingZeros); var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]); var fieldCount = isLastFieldIPv4Address ? 7 : 8; var lastFieldsStart = lastFields.length - fieldCount; var fields = Array(fieldCount); for (var x = 0; x < fieldCount; ++x) { fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || ''; } if (isLastFieldIPv4Address) { fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol); } var allZeroFields = fields.reduce(function (acc, field, index) { if (!field || field === "0") { var lastLongest = acc[acc.length - 1]; if (lastLongest && lastLongest.index + lastLongest.length === index) { lastLongest.length++; } else { acc.push({ index: index, length: 1 }); } } return acc; }, []); var longestZeroFields = allZeroFields.sort(function (a, b) { return b.length - a.length; })[0]; var newHost = void 0; if (longestZeroFields && longestZeroFields.length > 1) { var newFirst = fields.slice(0, longestZeroFields.index); var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length); newHost = newFirst.join(":") + "::" + newLast.join(":"); } else { newHost = fields.join(":"); } if (zone) { newHost += "%" + zone; } return newHost; } else { return host; } } var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i; var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === undefined; function parse(uriString) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var components = {}; var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; if (options.reference === "suffix") uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString; var matches = uriString.match(URI_PARSE); if (matches) { if (NO_MATCH_IS_UNDEFINED) { //store each component components.scheme = matches[1]; components.userinfo = matches[3]; components.host = matches[4]; components.port = parseInt(matches[5], 10); components.path = matches[6] || ""; components.query = matches[7]; components.fragment = matches[8]; //fix port number if (isNaN(components.port)) { components.port = matches[5]; } } else { //IE FIX for improper RegExp matching //store each component components.scheme = matches[1] || undefined; components.userinfo = uriString.indexOf("@") !== -1 ? matches[3] : undefined; components.host = uriString.indexOf("//") !== -1 ? matches[4] : undefined; components.port = parseInt(matches[5], 10); components.path = matches[6] || ""; components.query = uriString.indexOf("?") !== -1 ? matches[7] : undefined; components.fragment = uriString.indexOf("#") !== -1 ? matches[8] : undefined; //fix port number if (isNaN(components.port)) { components.port = uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined; } } if (components.host) { //normalize IP hosts components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol); } //determine reference type if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) { components.reference = "same-document"; } else if (components.scheme === undefined) { components.reference = "relative"; } else if (components.fragment === undefined) { components.reference = "absolute"; } else { components.reference = "uri"; } //check for reference errors if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) { components.error = components.error || "URI is not a " + options.reference + " reference."; } //find scheme handler var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; //check if scheme can't handle IRIs if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) { //if host component is a domain name if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) { //convert Unicode IDN -> ASCII IDN try { components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()); } catch (e) { components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e; } } //convert IRI -> URI _normalizeComponentEncoding(components, URI_PROTOCOL); } else { //normalize encodings _normalizeComponentEncoding(components, protocol); } //perform scheme specific parsing if (schemeHandler && schemeHandler.parse) { schemeHandler.parse(components, options); } } else { components.error = components.error || "URI can not be parsed."; } return components; } function _recomposeAuthority(components, options) { var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; var uriTokens = []; if (components.userinfo !== undefined) { uriTokens.push(components.userinfo); uriTokens.push("@"); } if (components.host !== undefined) { //normalize IP hosts, add brackets and escape zone separator for IPv6 uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function (_, $1, $2) { return "[" + $1 + ($2 ? "%25" + $2 : "") + "]"; })); } if (typeof components.port === "number") { uriTokens.push(":"); uriTokens.push(components.port.toString(10)); } return uriTokens.length ? uriTokens.join("") : undefined; } var RDS1 = /^\.\.?\//; var RDS2 = /^\/\.(\/|$)/; var RDS3 = /^\/\.\.(\/|$)/; var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/; function removeDotSegments(input) { var output = []; while (input.length) { if (input.match(RDS1)) { input = input.replace(RDS1, ""); } else if (input.match(RDS2)) { input = input.replace(RDS2, "/"); } else if (input.match(RDS3)) { input = input.replace(RDS3, "/"); output.pop(); } else if (input === "." || input === "..") { input = ""; } else { var im = input.match(RDS5); if (im) { var s = im[0]; input = input.slice(s.length); output.push(s); } else { throw new Error("Unexpected dot segment condition"); } } } return output.join(""); } function serialize(components) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL; var uriTokens = []; //find scheme handler var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; //perform scheme specific serialization if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options); if (components.host) { //if host component is an IPv6 address if (protocol.IPV6ADDRESS.test(components.host)) {} //TODO: normalize IPv6 address as per RFC 5952 //if host component is a domain name else if (options.domainHost || schemeHandler && schemeHandler.domainHost) { //convert IDN via punycode try { components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host); } catch (e) { components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; } } } //normalize encoding _normalizeComponentEncoding(components, protocol); if (options.reference !== "suffix" && components.scheme) { uriTokens.push(components.scheme); uriTokens.push(":"); } var authority = _recomposeAuthority(components, options); if (authority !== undefined) { if (options.reference !== "suffix") { uriTokens.push("//"); } uriTokens.push(authority); if (components.path && components.path.charAt(0) !== "/") { uriTokens.push("/"); } } if (components.path !== undefined) { var s = components.path; if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) { s = removeDotSegments(s); } if (authority === undefined) { s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//" } uriTokens.push(s); } if (components.query !== undefined) { uriTokens.push("?"); uriTokens.push(components.query); } if (components.fragment !== undefined) { uriTokens.push("#"); uriTokens.push(components.fragment); } return uriTokens.join(""); //merge tokens into a string } function resolveComponents(base, relative) { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var skipNormalization = arguments[3]; var target = {}; if (!skipNormalization) { base = parse(serialize(base, options), options); //normalize base components relative = parse(serialize(relative, options), options); //normalize relative components } options = options || {}; if (!options.tolerant && relative.scheme) { target.scheme = relative.scheme; //target.authority = relative.authority; target.userinfo = relative.userinfo; target.host = relative.host; target.port = relative.port; target.path = removeDotSegments(relative.path || ""); target.query = relative.query; } else { if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) { //target.authority = relative.authority; target.userinfo = relative.userinfo; target.host = relative.host; target.port = relative.port; target.path = removeDotSegments(relative.path || ""); target.query = relative.query; } else { if (!relative.path) { target.path = base.path; if (relative.query !== undefined) { target.query = relative.query; } else { target.query = base.query; } } else { if (relative.path.charAt(0) === "/") { target.path = removeDotSegments(relative.path); } else { if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) { target.path = "/" + relative.path; } else if (!base.path) { target.path = relative.path; } else { target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path; } target.path = removeDotSegments(target.path); } target.query = relative.query; } //target.authority = base.authority; target.userinfo = base.userinfo; target.host = base.host; target.port = base.port; } target.scheme = base.scheme; } target.fragment = relative.fragment; return target; } function resolve(baseURI, relativeURI, options) { var schemelessOptions = assign({ scheme: 'null' }, options); return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions); } function normalize(uri, options) { if (typeof uri === "string") { uri = serialize(parse(uri, options), options); } else if (typeOf(uri) === "object") { uri = parse(serialize(uri, options), options); } return uri; } function equal(uriA, uriB, options) { if (typeof uriA === "string") { uriA = serialize(parse(uriA, options), options); } else if (typeOf(uriA) === "object") { uriA = serialize(uriA, options); } if (typeof uriB === "string") { uriB = serialize(parse(uriB, options), options); } else if (typeOf(uriB) === "object") { uriB = serialize(uriB, options); } return uriA === uriB; } function escapeComponent(str, options) { return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar); } function unescapeComponent(str, options) { return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars); } var handler = { scheme: "http", domainHost: true, parse: function parse(components, options) { //report missing host if (!components.host) { components.error = components.error || "HTTP URIs must have a host."; } return components; }, serialize: function serialize(components, options) { //normalize the default port if (components.port === (String(components.scheme).toLowerCase() !== "https" ? 80 : 443) || components.port === "") { components.port = undefined; } //normalize the empty path if (!components.path) { components.path = "/"; } //NOTE: We do not parse query strings for HTTP URIs //as WWW Form Url Encoded query strings are part of the HTML4+ spec, //and not the HTTP spec. return components; } }; var handler$1 = { scheme: "https", domainHost: handler.domainHost, parse: handler.parse, serialize: handler.serialize }; var O = {}; var isIRI = true; //RFC 3986 var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]"; var HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded //RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; = //const ATEXT$$ = "[A-Za-z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]"; //const WSP$$ = "[\\x20\\x09]"; //const OBS_QTEXT$$ = "[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]"; //(%d1-8 / %d11-12 / %d14-31 / %d127) //const QTEXT$$ = merge("[\\x21\\x23-\\x5B\\x5D-\\x7E]", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext //const VCHAR$$ = "[\\x21-\\x7E]"; //const WSP$$ = "[\\x20\\x09]"; //const OBS_QP$ = subexp("\\\\" + merge("[\\x00\\x0D\\x0A]", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext //const FWS$ = subexp(subexp(WSP$$ + "*" + "\\x0D\\x0A") + "?" + WSP$$ + "+"); //const QUOTED_PAIR$ = subexp(subexp("\\\\" + subexp(VCHAR$$ + "|" + WSP$$)) + "|" + OBS_QP$); //const QUOTED_STRING$ = subexp('\\"' + subexp(FWS$ + "?" + QCONTENT$) + "*" + FWS$ + "?" + '\\"'); var ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]"; var QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]"; var VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]"); var SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"; var UNRESERVED = new RegExp(UNRESERVED$$, "g"); var PCT_ENCODED = new RegExp(PCT_ENCODED$, "g"); var NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g"); var NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g"); var NOT_HFVALUE = NOT_HFNAME; function decodeUnreserved(str) { var decStr = pctDecChars(str); return !decStr.match(UNRESERVED) ? str : decStr; } var handler$2 = { scheme: "mailto", parse: function parse$$1(components, options) { var mailtoComponents = components; var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : []; mailtoComponents.path = undefined; if (mailtoComponents.query) { var unknownHeaders = false; var headers = {}; var hfields = mailtoComponents.query.split("&"); for (var x = 0, xl = hfields.length; x < xl; ++x) { var hfield = hfields[x].split("="); switch (hfield[0]) { case "to": var toAddrs = hfield[1].split(","); for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) { to.push(toAddrs[_x]); } break; case "subject": mailtoComponents.subject = unescapeComponent(hfield[1], options); break; case "body": mailtoComponents.body = unescapeComponent(hfield[1], options); break; default: unknownHeaders = true; headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options); break; } } if (unknownHeaders) mailtoComponents.headers = headers; } mailtoComponents.query = undefined; for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) { var addr = to[_x2].split("@"); addr[0] = unescapeComponent(addr[0]); if (!options.unicodeSupport) { //convert Unicode IDN -> ASCII IDN try { addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase()); } catch (e) { mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e; } } else { addr[1] = unescapeComponent(addr[1], options).toLowerCase(); } to[_x2] = addr.join("@"); } return mailtoComponents; }, serialize: function serialize$$1(mailtoComponents, options) { var components = mailtoComponents; var to = toArray(mailtoComponents.to); if (to) { for (var x = 0, xl = to.length; x < xl; ++x) { var toAddr = String(to[x]); var atIdx = toAddr.lastIndexOf("@"); var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar); var domain = toAddr.slice(atIdx + 1); //convert IDN via punycode try { domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain); } catch (e) { components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; } to[x] = localPart + "@" + domain; } components.path = to.join(","); } var headers = mailtoComponents.headers = mailtoComponents.headers || {}; if (mailtoComponents.subject) headers["subject"] = mailtoComponents.subject; if (mailtoComponents.body) headers["body"] = mailtoComponents.body; var fields = []; for (var name in headers) { if (headers[name] !== O[name]) { fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)); } } if (fields.length) { components.query = fields.join("&"); } return components; } }; var URN_PARSE = /^([^\:]+)\:(.*)/; //RFC 2141 var handler$3 = { scheme: "urn", parse: function parse$$1(components, options) { var matches = components.path && components.path.match(URN_PARSE); var urnComponents = components; if (matches) { var scheme = options.scheme || urnComponents.scheme || "urn"; var nid = matches[1].toLowerCase(); var nss = matches[2]; var urnScheme = scheme + ":" + (options.nid || nid); var schemeHandler = SCHEMES[urnScheme]; urnComponents.nid = nid; urnComponents.nss = nss; urnComponents.path = undefined; if (schemeHandler) { urnComponents = schemeHandler.parse(urnComponents, options); } } else { urnComponents.error = urnComponents.error || "URN can not be parsed."; } return urnComponents; }, serialize: function serialize$$1(urnComponents, options) { var scheme = options.scheme || urnComponents.scheme || "urn"; var nid = urnComponents.nid; var urnScheme = scheme + ":" + (options.nid || nid); var schemeHandler = SCHEMES[urnScheme]; if (schemeHandler) { urnComponents = schemeHandler.serialize(urnComponents, options); } var uriComponents = urnComponents; var nss = urnComponents.nss; uriComponents.path = (nid || options.nid) + ":" + nss; return uriComponents; } }; var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/; //RFC 4122 var handler$4 = { scheme: "urn:uuid", parse: function parse(urnComponents, options) { var uuidComponents = urnComponents; uuidComponents.uuid = uuidComponents.nss; uuidComponents.nss = undefined; if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) { uuidComponents.error = uuidComponents.error || "UUID is not valid."; } return uuidComponents; }, serialize: function serialize(uuidComponents, options) { var urnComponents = uuidComponents; //normalize UUID urnComponents.nss = (uuidComponents.uuid || "").toLowerCase(); return urnComponents; } }; SCHEMES[handler.scheme] = handler; SCHEMES[handler$1.scheme] = handler$1; SCHEMES[handler$2.scheme] = handler$2; SCHEMES[handler$3.scheme] = handler$3; SCHEMES[handler$4.scheme] = handler$4; exports.SCHEMES = SCHEMES; exports.pctEncChar = pctEncChar; exports.pctDecChars = pctDecChars; exports.parse = parse; exports.removeDotSegments = removeDotSegments; exports.serialize = serialize; exports.resolveComponents = resolveComponents; exports.resolve = resolve; exports.normalize = normalize; exports.equal = equal; exports.escapeComponent = escapeComponent; exports.unescapeComponent = unescapeComponent; Object.defineProperty(exports, '__esModule', { value: true }); }))); //# sourceMappingURL=uri.all.js.map /***/ }), /* 194 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isArray = Array.isArray; var keyList = Object.keys; var hasProp = Object.prototype.hasOwnProperty; module.exports = function equal(a, b) { if (a === b) return true; if (a && b && typeof a == 'object' && typeof b == 'object') { var arrA = isArray(a) , arrB = isArray(b) , i , length , key; if (arrA && arrB) { length = a.length; if (length != b.length) return false; for (i = length; i-- !== 0;) if (!equal(a[i], b[i])) return false; return true; } if (arrA != arrB) return false; var dateA = a instanceof Date , dateB = b instanceof Date; if (dateA != dateB) return false; if (dateA && dateB) return a.getTime() == b.getTime(); var regexpA = a instanceof RegExp , regexpB = b instanceof RegExp; if (regexpA != regexpB) return false; if (regexpA && regexpB) return a.toString() == b.toString(); var keys = keyList(a); length = keys.length; if (length !== keyList(b).length) return false; for (i = length; i-- !== 0;) if (!hasProp.call(b, keys[i])) return false; for (i = length; i-- !== 0;) { key = keys[i]; if (!equal(a[key], b[key])) return false; } return true; } return a!==a && b!==b; }; /***/ }), /* 195 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = { copy: copy, checkDataType: checkDataType, checkDataTypes: checkDataTypes, coerceToTypes: coerceToTypes, toHash: toHash, getProperty: getProperty, escapeQuotes: escapeQuotes, equal: __webpack_require__(194), ucs2length: __webpack_require__(196), varOccurences: varOccurences, varReplace: varReplace, cleanUpCode: cleanUpCode, finalCleanUpCode: finalCleanUpCode, schemaHasRules: schemaHasRules, schemaHasRulesExcept: schemaHasRulesExcept, schemaUnknownRules: schemaUnknownRules, toQuotedString: toQuotedString, getPathExpr: getPathExpr, getPath: getPath, getData: getData, unescapeFragment: unescapeFragment, unescapeJsonPointer: unescapeJsonPointer, escapeFragment: escapeFragment, escapeJsonPointer: escapeJsonPointer }; function copy(o, to) { to = to || {}; for (var key in o) to[key] = o[key]; return to; } 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 + '"'; } } function checkDataTypes(dataTypes, data) { switch (dataTypes.length) { case 1: return checkDataType(dataTypes[0], data, true); default: var code = ''; var types = toHash(dataTypes); if (types.array && types.object) { code = types.null ? '(': '(!' + data + ' || '; code += 'typeof ' + data + ' !== "object")'; delete types.null; delete types.array; delete types.object; } if (types.number) delete types.integer; for (var t in types) code += (code ? ' && ' : '' ) + checkDataType(t, data, true); return code; } } var COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]); function coerceToTypes(optionCoerceTypes, dataTypes) { if (Array.isArray(dataTypes)) { var types = []; for (var i=0; i<dataTypes.length; i++) { var t = dataTypes[i]; if (COERCE_TO_TYPES[t]) types[types.length] = t; else if (optionCoerceTypes === 'array' && t === 'array') types[types.length] = t; } if (types.length) return types; } else if (COERCE_TO_TYPES[dataTypes]) { return [dataTypes]; } else if (optionCoerceTypes === 'array' && dataTypes === 'array') { return ['array']; } } function toHash(arr) { var hash = {}; for (var i=0; i<arr.length; i++) hash[arr[i]] = true; return hash; } var IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i; var SINGLE_QUOTE = /'|\\/g; function getProperty(key) { return typeof key == 'number' ? '[' + 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'); } function varOccurences(str, dataVar) { dataVar += '[^0-9]'; var matches = str.match(new RegExp(dataVar, 'g')); return matches ? matches.length : 0; } function varReplace(str, dataVar, expr) { dataVar += '([^0-9])'; expr = expr.replace(/\$/g, '$$$$'); return str.replace(new RegExp(dataVar, 'g'), expr + '$1'); } 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; function cleanUpCode(out) { return out.replace(EMPTY_ELSE, '') .replace(EMPTY_IF_NO_ELSE, '') .replace(EMPTY_IF_WITH_ELSE, 'if (!($1))'); } var 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_VALID = 'return errors === 0;' , RETURN_TRUE = 'validate.errors = null; return true;' , RETURN_ASYNC = /if \(errors === 0\) return data;\s*else throw new ValidationError\(vErrors\);/ , RETURN_DATA_ASYNC = 'return data;' , ROOTDATA_REGEXP = /[^A-Za-z_$]rootData[^A-Za-z0-9_$]/g , REMOVE_ROOTDATA = /if \(rootData === undefined\) rootData = data;/; function finalCleanUpCode(out, async) { var matches = out.match(ERRORS_REGEXP); if (matches && matches.length == 2) { out = async ? out.replace(REMOVE_ERRORS_ASYNC, '') .replace(RETURN_ASYNC, RETURN_DATA_ASYNC) : out.replace(REMOVE_ERRORS, '') .replace(RETURN_VALID, RETURN_TRUE); } matches = out.match(ROOTDATA_REGEXP); if (!matches || matches.length !== 3) return out; return out.replace(REMOVE_ROOTDATA, ''); } function schemaHasRules(schema, rules) { if (typeof schema == 'boolean') return !schema; for (var key in schema) if (rules[key]) return true; } function schemaHasRulesExcept(schema, rules, exceptKeyword) { if (typeof schema == 'boolean') return !schema && exceptKeyword != 'not'; for (var key in schema) if (key != exceptKeyword && rules[key]) return true; } function schemaUnknownRules(schema, rules) { if (typeof schema == 'boolean') return; for (var key in schema) if (!rules[key]) return key; } function toQuotedString(str) { return '\'' + escapeQuotes(str) + '\''; } function getPathExpr(currentPath, expr, jsonPointers, isNumber) { var path = jsonPointers // false by default ? '\'/\' + ' + expr + (isNumber ? '' : '.replace(/~/g, \'~0\').replace(/\\//g, \'~1\')') : (isNumber ? '\'[\' + ' + expr + ' + \']\'' : '\'[\\\'\' + ' + expr + ' + \'\\\']\''); return joinPaths(currentPath, path); } function getPath(currentPath, prop, jsonPointers) { var path = jsonPointers // false by default ? toQuotedString('/' + escapeJsonPointer(prop)) : toQuotedString(getProperty(prop)); return joinPaths(currentPath, path); } var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/; var RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/; function getData($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 { matches = $data.match(RELATIVE_JSON_POINTER); if (!matches) throw new Error('Invalid JSON-pointer: ' + $data); up = +matches[1]; jsonPointer = matches[2]; if (jsonPointer == '#') { 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); data = 'data' + ((lvl - up) || ''); if (!jsonPointer) return data; } var expr = data; var segments = jsonPointer.split('/'); for (var i=0; i<segments.length; i++) { var segment = segments[i]; if (segment) { data += getProperty(unescapeJsonPointer(segment)); expr += ' && ' + data; } } return expr; } function joinPaths (a, b) { if (a == '""') return b; return (a + ' + ' + b).replace(/' \+ '/g, ''); } function unescapeFragment(str) { return unescapeJsonPointer(decodeURIComponent(str)); } function escapeFragment(str) { return encodeURIComponent(escapeJsonPointer(str)); } function escapeJsonPointer(str) { return str.replace(/~/g, '~0').replace(/\//g, '~1'); } function unescapeJsonPointer(str) { return str.replace(/~1/g, '/').replace(/~0/g, '~'); } /***/ }), /* 196 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // https://mathiasbynens.be/notes/javascript-encoding // https://github.com/bestiejs/punycode.js - punycode.ucs2.decode module.exports = function ucs2length(str) { var length = 0 , len = str.length , pos = 0 , value; while (pos < len) { length++; value = str.charCodeAt(pos++); if (value >= 0xD800 && value <= 0xDBFF && pos < len) { // high surrogate, and there is a next character value = str.charCodeAt(pos); if ((value & 0xFC00) == 0xDC00) pos++; // low surrogate } } return length; }; /***/ }), /* 197 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(195); module.exports = SchemaObject; function SchemaObject(obj) { util.copy(obj, this); } /***/ }), /* 198 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var traverse = module.exports = function (schema, opts, cb) { // Legacy support for v0.3.1 and earlier. if (typeof opts == 'function') { cb = opts; opts = {}; } cb = opts.cb || cb; var pre = (typeof cb == 'function') ? cb : cb.pre || function() {}; var post = cb.post || function() {}; _traverse(opts, pre, post, schema, '', schema); }; traverse.keywords = { additionalItems: true, items: true, contains: true, additionalProperties: true, propertyNames: true, not: true }; traverse.arrayKeywords = { items: true, allOf: true, anyOf: true, oneOf: true }; traverse.propsKeywords = { definitions: true, properties: true, patternProperties: true, dependencies: true }; traverse.skipKeywords = { default: true, enum: true, const: true, required: true, maximum: true, minimum: true, exclusiveMaximum: true, exclusiveMinimum: true, multipleOf: true, maxLength: true, minLength: true, pattern: true, format: true, maxItems: true, minItems: true, uniqueItems: true, maxProperties: true, minProperties: true }; function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { if (schema && typeof schema == 'object' && !Array.isArray(schema)) { pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex); for (var key in schema) { var sch = schema[key]; if (Array.isArray(sch)) { if (key in traverse.arrayKeywords) { for (var i=0; i<sch.length; i++) _traverse(opts, pre, post, sch[i], jsonPtr + '/' + key + '/' + i, rootSchema, jsonPtr, key, schema, i); } } else if (key in traverse.propsKeywords) { if (sch && typeof sch == 'object') { for (var prop in sch) _traverse(opts, pre, post, sch[prop], jsonPtr + '/' + key + '/' + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop); } } else if (key in traverse.keywords || (opts.allKeys && !(key in traverse.skipKeywords))) { _traverse(opts, pre, post, sch, jsonPtr + '/' + key, rootSchema, jsonPtr, key, schema); } } post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex); } } function escapeJsonPtr(str) { return str.replace(/~/g, '~0').replace(/\//g, '~1'); } /***/ }), /* 199 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var resolve = __webpack_require__(192); module.exports = { Validation: errorSubclass(ValidationError), MissingRef: errorSubclass(MissingRefError) }; function ValidationError(errors) { this.message = 'validation failed'; this.errors = errors; this.ajv = this.validation = true; } MissingRefError.message = function (baseId, ref) { return 'can\'t resolve reference ' + ref + ' from id ' + baseId; }; function MissingRefError(baseId, ref, message) { this.message = message || MissingRefError.message(baseId, ref); this.missingRef = resolve.url(baseId, ref); this.missingSchema = resolve.normalizeId(resolve.fullPath(this.missingRef)); } function errorSubclass(Subclass) { Subclass.prototype = Object.create(Error.prototype); Subclass.prototype.constructor = Subclass; return Subclass; } /***/ }), /* 200 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function (data, opts) { if (!opts) opts = {}; if (typeof opts === 'function') opts = { cmp: opts }; var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false; var cmp = opts.cmp && (function (f) { return function (node) { return function (a, b) { var aobj = { key: a, value: node[a] }; var bobj = { key: b, value: node[b] }; return f(aobj, bobj); }; }; })(opts.cmp); var seen = []; return (function stringify (node) { if (node && node.toJSON && typeof node.toJSON === 'function') { node = node.toJSON(); } if (node === undefined) return; if (typeof node == 'number') return isFinite(node) ? '' + node : 'null'; if (typeof node !== 'object') return JSON.stringify(node); var i, out; if (Array.isArray(node)) { out = '['; for (i = 0; i < node.length; i++) { if (i) out += ','; out += stringify(node[i]) || 'null'; } return out + ']'; } if (node === null) return 'null'; if (seen.indexOf(node) !== -1) { if (cycles) return JSON.stringify('__cycle__'); throw new TypeError('Converting circular structure to JSON'); } var seenIndex = seen.push(node) - 1; var keys = Object.keys(node).sort(cmp && cmp(node)); out = ''; for (i = 0; i < keys.length; i++) { var key = keys[i]; var value = stringify(node[key]); if (!value) continue; if (out) out += ','; out += JSON.stringify(key) + ':' + value; } seen.splice(seenIndex, 1); return '{' + out + '}'; })(data); }; /***/ }), /* 201 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function generate_validate(it, $keyword, $ruleType) { var out = ''; var $async = it.schema.$async === true, $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref'), $id = it.self._getId(it.schema); if (it.opts.strictKeywords) { var $unknownKwd = it.util.schemaUnknownRules(it.schema, it.RULES.keywords); if ($unknownKwd) { var $keywordsMsg = 'unknown keyword: ' + $unknownKwd; if (it.opts.strictKeywords === 'log') it.logger.warn($keywordsMsg); else throw new Error($keywordsMsg); } } if (it.isTop) { out += ' var validate = '; if ($async) { it.async = true; out += 'async '; } out += 'function(data, dataPath, parentData, parentDataProperty, rootData) { \'use strict\'; '; if ($id && (it.opts.sourceCode || it.opts.processCode)) { out += ' ' + ('/\*# sourceURL=' + $id + ' */') + ' '; } } if (typeof it.schema == 'boolean' || !($refKeywords || it.schema.$ref)) { var $keyword = 'false schema'; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $errorKeyword; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; if (it.schema === false) { if (it.isTop) { $breakOnError = true; } else { out += ' var ' + ($valid) + ' = false; '; } var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || 'false schema') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; if (it.opts.messages !== false) { out += ' , message: \'boolean schema is false\' '; } if (it.opts.verbose) { out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } } else { if (it.isTop) { if ($async) { out += ' return data; '; } else { out += ' validate.errors = null; return true; '; } } else { out += ' var ' + ($valid) + ' = true; '; } } if (it.isTop) { out += ' }; return validate; '; } return out; } if (it.isTop) { var $top = it.isTop, $lvl = it.level = 0, $dataLvl = it.dataLevel = 0, $data = 'data'; it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema)); it.baseId = it.baseId || it.rootId; delete it.isTop; it.dataPathArr = [undefined]; if (it.schema.default !== undefined && it.opts.useDefaults && it.opts.strictDefaults) { var $defaultMsg = 'default is ignored in the schema root'; if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); else throw new Error($defaultMsg); } out += ' var vErrors = null; '; out += ' var errors = 0; '; out += ' if (rootData === undefined) rootData = data; '; } else { var $lvl = it.level, $dataLvl = it.dataLevel, $data = 'data' + ($dataLvl || ''); if ($id) it.baseId = it.resolve.url(it.baseId, $id); if ($async && !it.async) throw new Error('async schema in sync schema'); out += ' var errs_' + ($lvl) + ' = errors;'; } var $valid = 'valid' + $lvl, $breakOnError = !it.opts.allErrors, $closingBraces1 = '', $closingBraces2 = ''; var $errorKeyword; var $typeSchema = it.schema.type, $typeIsArray = Array.isArray($typeSchema); if ($typeSchema && it.opts.nullable && it.schema.nullable === true) { if ($typeIsArray) { if ($typeSchema.indexOf('null') == -1) $typeSchema = $typeSchema.concat('null'); } else if ($typeSchema != 'null') { $typeSchema = [$typeSchema, 'null']; $typeIsArray = true; } } if ($typeIsArray && $typeSchema.length == 1) { $typeSchema = $typeSchema[0]; $typeIsArray = false; } if (it.schema.$ref && $refKeywords) { if (it.opts.extendRefs == 'fail') { throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '" (see option extendRefs)'); } else if (it.opts.extendRefs !== true) { $refKeywords = false; it.logger.warn('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"'); } } if (it.schema.$comment && it.opts.$comment) { out += ' ' + (it.RULES.all.$comment.code(it, '$comment')); } if ($typeSchema) { if (it.opts.coerceTypes) { var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema); } var $rulesGroup = it.RULES.types[$typeSchema]; if ($coerceToTypes || $typeIsArray || $rulesGroup === true || ($rulesGroup && !$shouldUseGroup($rulesGroup))) { var $schemaPath = it.schemaPath + '.type', $errSchemaPath = it.errSchemaPath + '/type'; var $schemaPath = it.schemaPath + '.type', $errSchemaPath = it.errSchemaPath + '/type', $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType'; out += ' if (' + (it.util[$method]($typeSchema, $data, true)) + ') { '; if ($coerceToTypes) { var $dataType = 'dataType' + $lvl, $coerced = 'coerced' + $lvl; out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; '; if (it.opts.coerceTypes == 'array') { out += ' if (' + ($dataType) + ' == \'object\' && Array.isArray(' + ($data) + ')) ' + ($dataType) + ' = \'array\'; '; } out += ' var ' + ($coerced) + ' = undefined; '; var $bracesCoercion = ''; var arr1 = $coerceToTypes; if (arr1) { var $type, $i = -1, l1 = arr1.length - 1; while ($i < l1) { $type = arr1[$i += 1]; if ($i) { out += ' if (' + ($coerced) + ' === undefined) { '; $bracesCoercion += '}'; } if (it.opts.coerceTypes == 'array' && $type != 'array') { out += ' if (' + ($dataType) + ' == \'array\' && ' + ($data) + '.length == 1) { ' + ($coerced) + ' = ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; } '; } if ($type == 'string') { out += ' if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; '; } else if ($type == 'number' || $type == 'integer') { out += ' if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' '; if ($type == 'integer') { out += ' && !(' + ($data) + ' % 1)'; } out += ')) ' + ($coerced) + ' = +' + ($data) + '; '; } else if ($type == 'boolean') { out += ' if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; '; } else if ($type == 'null') { out += ' if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; '; } else if (it.opts.coerceTypes == 'array' && $type == 'array') { out += ' if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; '; } } } out += ' ' + ($bracesCoercion) + ' if (' + ($coerced) + ' === undefined) { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; if ($typeIsArray) { out += '' + ($typeSchema.join(",")); } else { out += '' + ($typeSchema); } out += '\' } '; if (it.opts.messages !== false) { out += ' , message: \'should be '; if ($typeIsArray) { out += '' + ($typeSchema.join(",")); } else { out += '' + ($typeSchema); } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } else { '; var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; out += ' ' + ($data) + ' = ' + ($coerced) + '; '; if (!$dataLvl) { out += 'if (' + ($parentData) + ' !== undefined)'; } out += ' ' + ($parentData) + '[' + ($parentDataProperty) + '] = ' + ($coerced) + '; } '; } else { var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; if ($typeIsArray) { out += '' + ($typeSchema.join(",")); } else { out += '' + ($typeSchema); } out += '\' } '; if (it.opts.messages !== false) { out += ' , message: \'should be '; if ($typeIsArray) { out += '' + ($typeSchema.join(",")); } else { out += '' + ($typeSchema); } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } } out += ' } '; } } if (it.schema.$ref && !$refKeywords) { out += ' ' + (it.RULES.all.$ref.code(it, '$ref')) + ' '; if ($breakOnError) { out += ' } if (errors === '; if ($top) { out += '0'; } else { out += 'errs_' + ($lvl); } out += ') { '; $closingBraces2 += '}'; } } else { var arr2 = it.RULES; if (arr2) { var $rulesGroup, i2 = -1, l2 = arr2.length - 1; while (i2 < l2) { $rulesGroup = arr2[i2 += 1]; if ($shouldUseGroup($rulesGroup)) { if ($rulesGroup.type) { out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data)) + ') { '; } if (it.opts.useDefaults) { if ($rulesGroup.type == 'object' && it.schema.properties) { var $schema = it.schema.properties, $schemaKeys = Object.keys($schema); var arr3 = $schemaKeys; if (arr3) { var $propertyKey, i3 = -1, l3 = arr3.length - 1; while (i3 < l3) { $propertyKey = arr3[i3 += 1]; var $sch = $schema[$propertyKey]; if ($sch.default !== undefined) { var $passData = $data + it.util.getProperty($propertyKey); if (it.compositeRule) { if (it.opts.strictDefaults) { var $defaultMsg = 'default is ignored for: ' + $passData; if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); else throw new Error($defaultMsg); } } else { out += ' if (' + ($passData) + ' === undefined '; if (it.opts.useDefaults == 'empty') { out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \'\' '; } out += ' ) ' + ($passData) + ' = '; if (it.opts.useDefaults == 'shared') { out += ' ' + (it.useDefault($sch.default)) + ' '; } else { out += ' ' + (JSON.stringify($sch.default)) + ' '; } out += '; '; } } } } } else if ($rulesGroup.type == 'array' && Array.isArray(it.schema.items)) { var arr4 = it.schema.items; if (arr4) { var $sch, $i = -1, l4 = arr4.length - 1; while ($i < l4) { $sch = arr4[$i += 1]; if ($sch.default !== undefined) { var $passData = $data + '[' + $i + ']'; if (it.compositeRule) { if (it.opts.strictDefaults) { var $defaultMsg = 'default is ignored for: ' + $passData; if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); else throw new Error($defaultMsg); } } else { out += ' if (' + ($passData) + ' === undefined '; if (it.opts.useDefaults == 'empty') { out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \'\' '; } out += ' ) ' + ($passData) + ' = '; if (it.opts.useDefaults == 'shared') { out += ' ' + (it.useDefault($sch.default)) + ' '; } else { out += ' ' + (JSON.stringify($sch.default)) + ' '; } out += '; '; } } } } } } var arr5 = $rulesGroup.rules; if (arr5) { var $rule, i5 = -1, l5 = arr5.length - 1; while (i5 < l5) { $rule = arr5[i5 += 1]; if ($shouldUseRule($rule)) { var $code = $rule.code(it, $rule.keyword, $rulesGroup.type); if ($code) { out += ' ' + ($code) + ' '; if ($breakOnError) { $closingBraces1 += '}'; } } } } } if ($breakOnError) { out += ' ' + ($closingBraces1) + ' '; $closingBraces1 = ''; } if ($rulesGroup.type) { out += ' } '; if ($typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes) { out += ' else { '; var $schemaPath = it.schemaPath + '.type', $errSchemaPath = it.errSchemaPath + '/type'; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; if ($typeIsArray) { out += '' + ($typeSchema.join(",")); } else { out += '' + ($typeSchema); } out += '\' } '; if (it.opts.messages !== false) { out += ' , message: \'should be '; if ($typeIsArray) { out += '' + ($typeSchema.join(",")); } else { out += '' + ($typeSchema); } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } '; } } if ($breakOnError) { out += ' if (errors === '; if ($top) { out += '0'; } else { out += 'errs_' + ($lvl); } out += ') { '; $closingBraces2 += '}'; } } } } } if ($breakOnError) { out += ' ' + ($closingBraces2) + ' '; } if ($top) { if ($async) { out += ' if (errors === 0) return data; '; out += ' else throw new ValidationError(vErrors); '; } else { out += ' validate.errors = vErrors; '; out += ' return errors === 0; '; } out += ' }; return validate;'; } else { out += ' var ' + ($valid) + ' = errors === errs_' + ($lvl) + ';'; } out = it.util.cleanUpCode(out); if ($top) { out = it.util.finalCleanUpCode(out, $async); } function $shouldUseGroup($rulesGroup) { var rules = $rulesGroup.rules; for (var i = 0; i < rules.length; i++) if ($shouldUseRule(rules[i])) return true; } function $shouldUseRule($rule) { return it.schema[$rule.keyword] !== undefined || ($rule.implements && $ruleImplementsSomeKeyword($rule)); } function $ruleImplementsSomeKeyword($rule) { var impl = $rule.implements; for (var i = 0; i < impl.length; i++) if (it.schema[impl[i]] !== undefined) return true; } return out; } /***/ }), /* 202 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Cache = module.exports = function Cache() { this._cache = {}; }; Cache.prototype.put = function Cache_put(key, value) { this._cache[key] = value; }; Cache.prototype.get = function Cache_get(key) { return this._cache[key]; }; Cache.prototype.del = function Cache_del(key) { delete this._cache[key]; }; Cache.prototype.clear = function Cache_clear() { this._cache = {}; }; /***/ }), /* 203 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(195); var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/; var DAYS = [0,31,28,31,30,31,30,31,31,30,31,30,31]; var TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d:\d\d)?$/i; var HOSTNAME = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*$/i; var URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i; var URIREF = /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i; // uri-template: https://tools.ietf.org/html/rfc6570 var URITEMPLATE = /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i; // For the source: https://gist.github.com/dperini/729294 // For test cases: https://mathiasbynens.be/demo/url-regex // @todo Delete current URL in favour of the commented out URL rule when this issue is fixed https://github.com/eslint/eslint/issues/7983. // var URL = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu; var URL = /^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i; var UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i; var JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$/; var JSON_POINTER_URI_FRAGMENT = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i; var RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/; module.exports = formats; function formats(mode) { mode = mode == 'full' ? 'full' : 'fast'; return util.copy(formats[mode]); } formats.fast = { // date: http://tools.ietf.org/html/rfc3339#section-5.6 date: /^\d\d\d\d-[0-1]\d-[0-3]\d$/, // date-time: http://tools.ietf.org/html/rfc3339#section-5.6 time: /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i, 'date-time': /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i, // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js uri: /^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i, 'uri-reference': /^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i, 'uri-template': URITEMPLATE, url: URL, // email (sources from jsen validator): // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363 // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation') email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i, hostname: HOSTNAME, // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, // optimized http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, regex: regex, // uuid: http://tools.ietf.org/html/rfc4122 uuid: UUID, // JSON-pointer: https://tools.ietf.org/html/rfc6901 // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A 'json-pointer': JSON_POINTER, 'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT, // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00 'relative-json-pointer': RELATIVE_JSON_POINTER }; formats.full = { date: date, time: time, 'date-time': date_time, uri: uri, 'uri-reference': URIREF, 'uri-template': URITEMPLATE, url: URL, email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i, hostname: hostname, ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, regex: regex, uuid: UUID, 'json-pointer': JSON_POINTER, 'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT, 'relative-json-pointer': RELATIVE_JSON_POINTER }; function isLeapYear(year) { // https://tools.ietf.org/html/rfc3339#appendix-C return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); } function date(str) { // full-date from http://tools.ietf.org/html/rfc3339#section-5.6 var matches = str.match(DATE); if (!matches) return false; var year = +matches[1]; var month = +matches[2]; var day = +matches[3]; return month >= 1 && month <= 12 && day >= 1 && day <= (month == 2 && isLeapYear(year) ? 29 : DAYS[month]); } function time(str, full) { var matches = str.match(TIME); if (!matches) return false; var hour = matches[1]; var minute = matches[2]; var second = matches[3]; var timeZone = matches[5]; return ((hour <= 23 && minute <= 59 && second <= 59) || (hour == 23 && minute == 59 && second == 60)) && (!full || timeZone); } var DATE_TIME_SEPARATOR = /t|\s/i; function date_time(str) { // http://tools.ietf.org/html/rfc3339#section-5.6 var dateTime = str.split(DATE_TIME_SEPARATOR); return dateTime.length == 2 && date(dateTime[0]) && time(dateTime[1], true); } function hostname(str) { // https://tools.ietf.org/html/rfc1034#section-3.5 // https://tools.ietf.org/html/rfc1123#section-2 return str.length <= 255 && HOSTNAME.test(str); } var NOT_URI_FRAGMENT = /\/|:/; function uri(str) { // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "." return NOT_URI_FRAGMENT.test(str) && URI.test(str); } var Z_ANCHOR = /[^\\]\\Z/; function regex(str) { if (Z_ANCHOR.test(str)) return false; try { new RegExp(str); return true; } catch(e) { return false; } } /***/ }), /* 204 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var ruleModules = __webpack_require__(205) , toHash = __webpack_require__(195).toHash; module.exports = function rules() { var RULES = [ { type: 'number', rules: [ { 'maximum': ['exclusiveMaximum'] }, { 'minimum': ['exclusiveMinimum'] }, 'multipleOf', 'format'] }, { type: 'string', rules: [ 'maxLength', 'minLength', 'pattern', 'format' ] }, { type: 'array', rules: [ 'maxItems', 'minItems', 'items', 'contains', 'uniqueItems' ] }, { type: 'object', rules: [ 'maxProperties', 'minProperties', 'required', 'dependencies', 'propertyNames', { 'properties': ['additionalProperties', 'patternProperties'] } ] }, { rules: [ '$ref', 'const', 'enum', 'not', 'anyOf', 'oneOf', 'allOf', 'if' ] } ]; var ALL = [ 'type', '$comment' ]; var KEYWORDS = [ '$schema', '$id', 'id', '$data', '$async', 'title', 'description', 'default', 'definitions', 'examples', 'readOnly', 'writeOnly', 'contentMediaType', 'contentEncoding', 'additionalItems', 'then', 'else' ]; var TYPES = [ 'number', 'integer', 'string', 'array', 'object', 'boolean', 'null' ]; RULES.all = toHash(ALL); RULES.types = toHash(TYPES); RULES.forEach(function (group) { group.rules = group.rules.map(function (keyword) { var implKeywords; if (typeof keyword == 'object') { var key = Object.keys(keyword)[0]; implKeywords = keyword[key]; keyword = key; implKeywords.forEach(function (k) { ALL.push(k); RULES.all[k] = true; }); } ALL.push(keyword); var rule = RULES.all[keyword] = { keyword: keyword, code: ruleModules[keyword], implements: implKeywords }; return rule; }); RULES.all.$comment = { keyword: '$comment', code: ruleModules.$comment }; if (group.type) RULES.types[group.type] = group; }); RULES.keywords = toHash(ALL.concat(KEYWORDS)); RULES.custom = {}; return RULES; }; /***/ }), /* 205 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; //all requires must be explicit because browserify won't work with dynamic requires module.exports = { '$ref': __webpack_require__(206), allOf: __webpack_require__(207), anyOf: __webpack_require__(208), '$comment': __webpack_require__(209), const: __webpack_require__(210), contains: __webpack_require__(211), dependencies: __webpack_require__(212), 'enum': __webpack_require__(213), format: __webpack_require__(214), 'if': __webpack_require__(215), items: __webpack_require__(216), maximum: __webpack_require__(217), minimum: __webpack_require__(217), maxItems: __webpack_require__(218), minItems: __webpack_require__(218), maxLength: __webpack_require__(219), minLength: __webpack_require__(219), maxProperties: __webpack_require__(220), minProperties: __webpack_require__(220), multipleOf: __webpack_require__(221), not: __webpack_require__(222), oneOf: __webpack_require__(223), pattern: __webpack_require__(224), properties: __webpack_require__(225), propertyNames: __webpack_require__(226), required: __webpack_require__(227), uniqueItems: __webpack_require__(228), validate: __webpack_require__(201) }; /***/ }), /* 206 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function generate_ref(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $async, $refCode; if ($schema == '#' || $schema == '#/') { if (it.isRoot) { $async = it.async; $refCode = 'validate'; } else { $async = it.root.schema.$async === true; $refCode = 'root.refVal[0]'; } } else { var $refVal = it.resolveRef(it.baseId, $schema, it.isRoot); if ($refVal === undefined) { var $message = it.MissingRefError.message(it.baseId, $schema); if (it.opts.missingRefs == 'fail') { it.logger.error($message); var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('$ref') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { ref: \'' + (it.util.escapeQuotes($schema)) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \'can\\\'t resolve reference ' + (it.util.escapeQuotes($schema)) + '\' '; } if (it.opts.verbose) { out += ' , schema: ' + (it.util.toQuotedString($schema)) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } if ($breakOnError) { out += ' if (false) { '; } } else if (it.opts.missingRefs == 'ignore') { it.logger.warn($message); if ($breakOnError) { out += ' if (true) { '; } } else { throw new it.MissingRefError(it.baseId, $schema, $message); } } else if ($refVal.inline) { var $it = it.util.copy(it); $it.level++; var $nextValid = 'valid' + $it.level; $it.schema = $refVal.schema; $it.schemaPath = ''; $it.errSchemaPath = $schema; var $code = it.validate($it).replace(/validate\.schema/g, $refVal.code); out += ' ' + ($code) + ' '; if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; } } else { $async = $refVal.$async === true || (it.async && $refVal.$async !== false); $refCode = $refVal.code; } } if ($refCode) { var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; if (it.opts.passContext) { out += ' ' + ($refCode) + '.call(this, '; } else { out += ' ' + ($refCode) + '( '; } out += ' ' + ($data) + ', (dataPath || \'\')'; if (it.errorPath != '""') { out += ' + ' + (it.errorPath); } var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ', rootData) '; var __callValidate = out; out = $$outStack.pop(); if ($async) { if (!it.async) throw new Error('async schema referenced by sync schema'); if ($breakOnError) { out += ' var ' + ($valid) + '; '; } out += ' try { await ' + (__callValidate) + '; '; if ($breakOnError) { out += ' ' + ($valid) + ' = true; '; } out += ' } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; '; if ($breakOnError) { out += ' ' + ($valid) + ' = false; '; } out += ' } '; if ($breakOnError) { out += ' if (' + ($valid) + ') { '; } } else { out += ' if (!' + (__callValidate) + ') { if (vErrors === null) vErrors = ' + ($refCode) + '.errors; else vErrors = vErrors.concat(' + ($refCode) + '.errors); errors = vErrors.length; } '; if ($breakOnError) { out += ' else { '; } } } return out; } /***/ }), /* 207 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function generate_allOf(it, $keyword, $ruleType) { var out = ' '; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; var $currentBaseId = $it.baseId, $allSchemasEmpty = true; var arr1 = $schema; if (arr1) { var $sch, $i = -1, l1 = arr1.length - 1; while ($i < l1) { $sch = arr1[$i += 1]; if ((it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all))) { $allSchemasEmpty = false; $it.schema = $sch; $it.schemaPath = $schemaPath + '[' + $i + ']'; $it.errSchemaPath = $errSchemaPath + '/' + $i; out += ' ' + (it.validate($it)) + ' '; $it.baseId = $currentBaseId; if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; $closingBraces += '}'; } } } } if ($breakOnError) { if ($allSchemasEmpty) { out += ' if (true) { '; } else { out += ' ' + ($closingBraces.slice(0, -1)) + ' '; } } out = it.util.cleanUpCode(out); return out; } /***/ }), /* 208 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function generate_anyOf(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; var $noEmptySchema = $schema.every(function($sch) { return (it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all)); }); if ($noEmptySchema) { var $currentBaseId = $it.baseId; out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = false; '; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; var arr1 = $schema; if (arr1) { var $sch, $i = -1, l1 = arr1.length - 1; while ($i < l1) { $sch = arr1[$i += 1]; $it.schema = $sch; $it.schemaPath = $schemaPath + '[' + $i + ']'; $it.errSchemaPath = $errSchemaPath + '/' + $i; out += ' ' + (it.validate($it)) + ' '; $it.baseId = $currentBaseId; out += ' ' + ($valid) + ' = ' + ($valid) + ' || ' + ($nextValid) + '; if (!' + ($valid) + ') { '; $closingBraces += '}'; } } it.compositeRule = $it.compositeRule = $wasComposite; out += ' ' + ($closingBraces) + ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('anyOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; if (it.opts.messages !== false) { out += ' , message: \'should match some schema in anyOf\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError(vErrors); '; } else { out += ' validate.errors = vErrors; return false; '; } } out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; if (it.opts.allErrors) { out += ' } '; } out = it.util.cleanUpCode(out); } else { if ($breakOnError) { out += ' if (true) { '; } } return out; } /***/ }), /* 209 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function generate_comment(it, $keyword, $ruleType) { var out = ' '; var $schema = it.schema[$keyword]; var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $comment = it.util.toQuotedString($schema); if (it.opts.$comment === true) { out += ' console.log(' + ($comment) + ');'; } else if (typeof it.opts.$comment == 'function') { out += ' self._opts.$comment(' + ($comment) + ', ' + (it.util.toQuotedString($errSchemaPath)) + ', validate.root.schema);'; } return out; } /***/ }), /* 210 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function generate_const(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } if (!$isData) { out += ' var schema' + ($lvl) + ' = validate.schema' + ($schemaPath) + ';'; } out += 'var ' + ($valid) + ' = equal(' + ($data) + ', schema' + ($lvl) + '); if (!' + ($valid) + ') { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('const') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValue: schema' + ($lvl) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should be equal to constant\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' }'; if ($breakOnError) { out += ' else { '; } return out; } /***/ }), /* 211 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function generate_contains(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; var $idx = 'i' + $lvl, $dataNxt = $it.dataLevel = it.dataLevel + 1, $nextData = 'data' + $dataNxt, $currentBaseId = it.baseId, $nonEmptySchema = (it.opts.strictKeywords ? typeof $schema == 'object' && Object.keys($schema).length > 0 : it.util.schemaHasRules($schema, it.RULES.all)); out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; if ($nonEmptySchema) { var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; $it.schema = $schema; $it.schemaPath = $schemaPath; $it.errSchemaPath = $errSchemaPath; out += ' var ' + ($nextValid) + ' = false; for (var ' + ($idx) + ' = 0; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); var $passData = $data + '[' + $idx + ']'; $it.dataPathArr[$dataNxt] = $idx; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } out += ' if (' + ($nextValid) + ') break; } '; it.compositeRule = $it.compositeRule = $wasComposite; out += ' ' + ($closingBraces) + ' if (!' + ($nextValid) + ') {'; } else { out += ' if (' + ($data) + '.length == 0) {'; } var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('contains') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; if (it.opts.messages !== false) { out += ' , message: \'should contain a valid item\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } else { '; if ($nonEmptySchema) { out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; } if (it.opts.allErrors) { out += ' } '; } out = it.util.cleanUpCode(out); return out; } /***/ }), /* 212 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function generate_dependencies(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; var $schemaDeps = {}, $propertyDeps = {}, $ownProperties = it.opts.ownProperties; for ($property in $schema) { var $sch = $schema[$property]; var $deps = Array.isArray($sch) ? $propertyDeps : $schemaDeps; $deps[$property] = $sch; } out += 'var ' + ($errs) + ' = errors;'; var $currentErrorPath = it.errorPath; out += 'var missing' + ($lvl) + ';'; for (var $property in $propertyDeps) { $deps = $propertyDeps[$property]; if ($deps.length) { out += ' if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined '; if ($ownProperties) { out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') '; } if ($breakOnError) { out += ' && ( '; var arr1 = $deps; if (arr1) { var $propertyKey, $i = -1, l1 = arr1.length - 1; while ($i < l1) { $propertyKey = arr1[$i += 1]; if ($i) { out += ' || '; } var $prop = it.util.getProperty($propertyKey), $useData = $data + $prop; out += ' ( ( ' + ($useData) + ' === undefined '; if ($ownProperties) { out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; } out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) '; } } out += ')) { '; var $propertyPath = 'missing' + $lvl, $missingProperty = '\' + ' + $propertyPath + ' + \''; if (it.opts._errorDataPathProperty) { it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath; } var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('dependencies') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { property: \'' + (it.util.escapeQuotes($property)) + '\', missingProperty: \'' + ($missingProperty) + '\', depsCount: ' + ($deps.length) + ', deps: \'' + (it.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(", "))) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \'should have '; if ($deps.length == 1) { out += 'property ' + (it.util.escapeQuotes($deps[0])); } else { out += 'properties ' + (it.util.escapeQuotes($deps.join(", "))); } out += ' when property ' + (it.util.escapeQuotes($property)) + ' is present\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } } else { out += ' ) { '; var arr2 = $deps; if (arr2) { var $propertyKey, i2 = -1, l2 = arr2.length - 1; while (i2 < l2) { $propertyKey = arr2[i2 += 1]; var $prop = it.util.getProperty($propertyKey), $missingProperty = it.util.escapeQuotes($propertyKey), $useData = $data + $prop; if (it.opts._errorDataPathProperty) { it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); } out += ' if ( ' + ($useData) + ' === undefined '; if ($ownProperties) { out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; } out += ') { var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('dependencies') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { property: \'' + (it.util.escapeQuotes($property)) + '\', missingProperty: \'' + ($missingProperty) + '\', depsCount: ' + ($deps.length) + ', deps: \'' + (it.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(", "))) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \'should have '; if ($deps.length == 1) { out += 'property ' + (it.util.escapeQuotes($deps[0])); } else { out += 'properties ' + (it.util.escapeQuotes($deps.join(", "))); } out += ' when property ' + (it.util.escapeQuotes($property)) + ' is present\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } '; } } } out += ' } '; if ($breakOnError) { $closingBraces += '}'; out += ' else { '; } } } it.errorPath = $currentErrorPath; var $currentBaseId = $it.baseId; for (var $property in $schemaDeps) { var $sch = $schemaDeps[$property]; if ((it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all))) { out += ' ' + ($nextValid) + ' = true; if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined '; if ($ownProperties) { out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') '; } out += ') { '; $it.schema = $sch; $it.schemaPath = $schemaPath + it.util.getProperty($property); $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($property); out += ' ' + (it.validate($it)) + ' '; $it.baseId = $currentBaseId; out += ' } '; if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; $closingBraces += '}'; } } } if ($breakOnError) { out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; } out = it.util.cleanUpCode(out); return out; } /***/ }), /* 213 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function generate_enum(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } var $i = 'i' + $lvl, $vSchema = 'schema' + $lvl; if (!$isData) { out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + ';'; } out += 'var ' + ($valid) + ';'; if ($isData) { out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {'; } out += '' + ($valid) + ' = false;for (var ' + ($i) + '=0; ' + ($i) + '<' + ($vSchema) + '.length; ' + ($i) + '++) if (equal(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + '])) { ' + ($valid) + ' = true; break; }'; if ($isData) { out += ' } '; } out += ' if (!' + ($valid) + ') { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('enum') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValues: schema' + ($lvl) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should be equal to one of the allowed values\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' }'; if ($breakOnError) { out += ' else { '; } return out; } /***/ }), /* 214 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function generate_format(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); if (it.opts.format === false) { if ($breakOnError) { out += ' if (true) { '; } return out; } var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } var $unknownFormats = it.opts.unknownFormats, $allowUnknown = Array.isArray($unknownFormats); if ($isData) { var $format = 'format' + $lvl, $isObject = 'isObject' + $lvl, $formatType = 'formatType' + $lvl; out += ' var ' + ($format) + ' = formats[' + ($schemaValue) + ']; var ' + ($isObject) + ' = typeof ' + ($format) + ' == \'object\' && !(' + ($format) + ' instanceof RegExp) && ' + ($format) + '.validate; var ' + ($formatType) + ' = ' + ($isObject) + ' && ' + ($format) + '.type || \'string\'; if (' + ($isObject) + ') { '; if (it.async) { out += ' var async' + ($lvl) + ' = ' + ($format) + '.async; '; } out += ' ' + ($format) + ' = ' + ($format) + '.validate; } if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || '; } out += ' ('; if ($unknownFormats != 'ignore') { out += ' (' + ($schemaValue) + ' && !' + ($format) + ' '; if ($allowUnknown) { out += ' && self._opts.unknownFormats.indexOf(' + ($schemaValue) + ') == -1 '; } out += ') || '; } out += ' (' + ($format) + ' && ' + ($formatType) + ' == \'' + ($ruleType) + '\' && !(typeof ' + ($format) + ' == \'function\' ? '; if (it.async) { out += ' (async' + ($lvl) + ' ? await ' + ($format) + '(' + ($data) + ') : ' + ($format) + '(' + ($data) + ')) '; } else { out += ' ' + ($format) + '(' + ($data) + ') '; } out += ' : ' + ($format) + '.test(' + ($data) + '))))) {'; } else { var $format = it.formats[$schema]; if (!$format) { if ($unknownFormats == 'ignore') { it.logger.warn('unknown format "' + $schema + '" ignored in schema at path "' + it.errSchemaPath + '"'); if ($breakOnError) { out += ' if (true) { '; } return out; } else if ($allowUnknown && $unknownFormats.indexOf($schema) >= 0) { if ($breakOnError) { out += ' if (true) { '; } return out; } else { throw new Error('unknown format "' + $schema + '" is used in schema at path "' + it.errSchemaPath + '"'); } } var $isObject = typeof $format == 'object' && !($format instanceof RegExp) && $format.validate; var $formatType = $isObject && $format.type || 'string'; if ($isObject) { var $async = $format.async === true; $format = $format.validate; } if ($formatType != $ruleType) { if ($breakOnError) { out += ' if (true) { '; } return out; } if ($async) { if (!it.async) throw new Error('async format in sync schema'); var $formatRef = 'formats' + it.util.getProperty($schema) + '.validate'; out += ' if (!(await ' + ($formatRef) + '(' + ($data) + '))) { '; } else { out += ' if (! '; var $formatRef = 'formats' + it.util.getProperty($schema); if ($isObject) $formatRef += '.validate'; if (typeof $format == 'function') { out += ' ' + ($formatRef) + '(' + ($data) + ') '; } else { out += ' ' + ($formatRef) + '.test(' + ($data) + ') '; } out += ') { '; } } var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('format') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { format: '; if ($isData) { out += '' + ($schemaValue); } else { out += '' + (it.util.toQuotedString($schema)); } out += ' } '; if (it.opts.messages !== false) { out += ' , message: \'should match format "'; if ($isData) { out += '\' + ' + ($schemaValue) + ' + \''; } else { out += '' + (it.util.escapeQuotes($schema)); } out += '"\' '; } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + (it.util.toQuotedString($schema)); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } '; if ($breakOnError) { out += ' else { '; } return out; } /***/ }), /* 215 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function generate_if(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); $it.level++; var $nextValid = 'valid' + $it.level; var $thenSch = it.schema['then'], $elseSch = it.schema['else'], $thenPresent = $thenSch !== undefined && (it.opts.strictKeywords ? typeof $thenSch == 'object' && Object.keys($thenSch).length > 0 : it.util.schemaHasRules($thenSch, it.RULES.all)), $elsePresent = $elseSch !== undefined && (it.opts.strictKeywords ? typeof $elseSch == 'object' && Object.keys($elseSch).length > 0 : it.util.schemaHasRules($elseSch, it.RULES.all)), $currentBaseId = $it.baseId; if ($thenPresent || $elsePresent) { var $ifClause; $it.createErrors = false; $it.schema = $schema; $it.schemaPath = $schemaPath; $it.errSchemaPath = $errSchemaPath; out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = true; '; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; out += ' ' + (it.validate($it)) + ' '; $it.baseId = $currentBaseId; $it.createErrors = true; out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; it.compositeRule = $it.compositeRule = $wasComposite; if ($thenPresent) { out += ' if (' + ($nextValid) + ') { '; $it.schema = it.schema['then']; $it.schemaPath = it.schemaPath + '.then'; $it.errSchemaPath = it.errSchemaPath + '/then'; out += ' ' + (it.validate($it)) + ' '; $it.baseId = $currentBaseId; out += ' ' + ($valid) + ' = ' + ($nextValid) + '; '; if ($thenPresent && $elsePresent) { $ifClause = 'ifClause' + $lvl; out += ' var ' + ($ifClause) + ' = \'then\'; '; } else { $ifClause = '\'then\''; } out += ' } '; if ($elsePresent) { out += ' else { '; } } else { out += ' if (!' + ($nextValid) + ') { '; } if ($elsePresent) { $it.schema = it.schema['else']; $it.schemaPath = it.schemaPath + '.else'; $it.errSchemaPath = it.errSchemaPath + '/else'; out += ' ' + (it.validate($it)) + ' '; $it.baseId = $currentBaseId; out += ' ' + ($valid) + ' = ' + ($nextValid) + '; '; if ($thenPresent && $elsePresent) { $ifClause = 'ifClause' + $lvl; out += ' var ' + ($ifClause) + ' = \'else\'; '; } else { $ifClause = '\'else\''; } out += ' } '; } out += ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('if') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { failingKeyword: ' + ($ifClause) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should match "\' + ' + ($ifClause) + ' + \'" schema\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError(vErrors); '; } else { out += ' validate.errors = vErrors; return false; '; } } out += ' } '; if ($breakOnError) { out += ' else { '; } out = it.util.cleanUpCode(out); } else { if ($breakOnError) { out += ' if (true) { '; } } return out; } /***/ }), /* 216 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function generate_items(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; var $idx = 'i' + $lvl, $dataNxt = $it.dataLevel = it.dataLevel + 1, $nextData = 'data' + $dataNxt, $currentBaseId = it.baseId; out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; if (Array.isArray($schema)) { var $additionalItems = it.schema.additionalItems; if ($additionalItems === false) { out += ' ' + ($valid) + ' = ' + ($data) + '.length <= ' + ($schema.length) + '; '; var $currErrSchemaPath = $errSchemaPath; $errSchemaPath = it.errSchemaPath + '/additionalItems'; out += ' if (!' + ($valid) + ') { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('additionalItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schema.length) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should NOT have more than ' + ($schema.length) + ' items\' '; } if (it.opts.verbose) { out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } '; $errSchemaPath = $currErrSchemaPath; if ($breakOnError) { $closingBraces += '}'; out += ' else { '; } } var arr1 = $schema; if (arr1) { var $sch, $i = -1, l1 = arr1.length - 1; while ($i < l1) { $sch = arr1[$i += 1]; if ((it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all))) { out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($i) + ') { '; var $passData = $data + '[' + $i + ']'; $it.schema = $sch; $it.schemaPath = $schemaPath + '[' + $i + ']'; $it.errSchemaPath = $errSchemaPath + '/' + $i; $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true); $it.dataPathArr[$dataNxt] = $i; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } out += ' } '; if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; $closingBraces += '}'; } } } } if (typeof $additionalItems == 'object' && (it.opts.strictKeywords ? typeof $additionalItems == 'object' && Object.keys($additionalItems).length > 0 : it.util.schemaHasRules($additionalItems, it.RULES.all))) { $it.schema = $additionalItems; $it.schemaPath = it.schemaPath + '.additionalItems'; $it.errSchemaPath = it.errSchemaPath + '/additionalItems'; out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($schema.length) + ') { for (var ' + ($idx) + ' = ' + ($schema.length) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); var $passData = $data + '[' + $idx + ']'; $it.dataPathArr[$dataNxt] = $idx; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } if ($breakOnError) { out += ' if (!' + ($nextValid) + ') break; '; } out += ' } } '; if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; $closingBraces += '}'; } } } else if ((it.opts.strictKeywords ? typeof $schema == 'object' && Object.keys($schema).length > 0 : it.util.schemaHasRules($schema, it.RULES.all))) { $it.schema = $schema; $it.schemaPath = $schemaPath; $it.errSchemaPath = $errSchemaPath; out += ' for (var ' + ($idx) + ' = ' + (0) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); var $passData = $data + '[' + $idx + ']'; $it.dataPathArr[$dataNxt] = $idx; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } if ($breakOnError) { out += ' if (!' + ($nextValid) + ') break; '; } out += ' }'; } if ($breakOnError) { out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; } out = it.util.cleanUpCode(out); return out; } /***/ }), /* 217 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function generate__limit(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $errorKeyword; var $data = 'data' + ($dataLvl || ''); var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } var $isMax = $keyword == 'maximum', $exclusiveKeyword = $isMax ? 'exclusiveMaximum' : 'exclusiveMinimum', $schemaExcl = it.schema[$exclusiveKeyword], $isDataExcl = it.opts.$data && $schemaExcl && $schemaExcl.$data, $op = $isMax ? '<' : '>', $notOp = $isMax ? '>' : '<', $errorKeyword = undefined; if ($isDataExcl) { var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr), $exclusive = 'exclusive' + $lvl, $exclType = 'exclType' + $lvl, $exclIsNumber = 'exclIsNumber' + $lvl, $opExpr = 'op' + $lvl, $opStr = '\' + ' + $opExpr + ' + \''; out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; '; $schemaValueExcl = 'schemaExcl' + $lvl; out += ' var ' + ($exclusive) + '; var ' + ($exclType) + ' = typeof ' + ($schemaValueExcl) + '; if (' + ($exclType) + ' != \'boolean\' && ' + ($exclType) + ' != \'undefined\' && ' + ($exclType) + ' != \'number\') { '; var $errorKeyword = $exclusiveKeyword; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || '_exclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; if (it.opts.messages !== false) { out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } else if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; } out += ' ' + ($exclType) + ' == \'number\' ? ( (' + ($exclusive) + ' = ' + ($schemaValue) + ' === undefined || ' + ($schemaValueExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ') ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValueExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) : ( (' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true) ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValue) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\'; '; if ($schema === undefined) { $errorKeyword = $exclusiveKeyword; $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; $schemaValue = $schemaValueExcl; $isData = $isDataExcl; } } else { var $exclIsNumber = typeof $schemaExcl == 'number', $opStr = $op; if ($exclIsNumber && $isData) { var $opExpr = '\'' + $opStr + '\''; out += ' if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; } out += ' ( ' + ($schemaValue) + ' === undefined || ' + ($schemaExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ' ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { '; } else { if ($exclIsNumber && $schema === undefined) { $exclusive = true; $errorKeyword = $exclusiveKeyword; $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; $schemaValue = $schemaExcl; $notOp += '='; } else { if ($exclIsNumber) $schemaValue = Math[$isMax ? 'min' : 'max']($schemaExcl, $schema); if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) { $exclusive = true; $errorKeyword = $exclusiveKeyword; $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; $notOp += '='; } else { $exclusive = false; $opStr += '='; } } var $opExpr = '\'' + $opStr + '\''; out += ' if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; } out += ' ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' || ' + ($data) + ' !== ' + ($data) + ') { '; } } $errorKeyword = $errorKeyword || $keyword; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || '_limit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: ' + ($schemaValue) + ', exclusive: ' + ($exclusive) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should be ' + ($opStr) + ' '; if ($isData) { out += '\' + ' + ($schemaValue); } else { out += '' + ($schemaValue) + '\''; } } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + ($schema); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } '; if ($breakOnError) { out += ' else { '; } return out; } /***/ }), /* 218 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function generate__limitItems(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $errorKeyword; var $data = 'data' + ($dataLvl || ''); var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } var $op = $keyword == 'maxItems' ? '>' : '<'; out += 'if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; } out += ' ' + ($data) + '.length ' + ($op) + ' ' + ($schemaValue) + ') { '; var $errorKeyword = $keyword; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || '_limitItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should NOT have '; if ($keyword == 'maxItems') { out += 'more'; } else { out += 'fewer'; } out += ' than '; if ($isData) { out += '\' + ' + ($schemaValue) + ' + \''; } else { out += '' + ($schema); } out += ' items\' '; } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + ($schema); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += '} '; if ($breakOnError) { out += ' else { '; } return out; } /***/ }), /* 219 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function generate__limitLength(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $errorKeyword; var $data = 'data' + ($dataLvl || ''); var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } var $op = $keyword == 'maxLength' ? '>' : '<'; out += 'if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; } if (it.opts.unicode === false) { out += ' ' + ($data) + '.length '; } else { out += ' ucs2length(' + ($data) + ') '; } out += ' ' + ($op) + ' ' + ($schemaValue) + ') { '; var $errorKeyword = $keyword; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || '_limitLength') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should NOT be '; if ($keyword == 'maxLength') { out += 'longer'; } else { out += 'shorter'; } out += ' than '; if ($isData) { out += '\' + ' + ($schemaValue) + ' + \''; } else { out += '' + ($schema); } out += ' characters\' '; } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + ($schema); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += '} '; if ($breakOnError) { out += ' else { '; } return out; } /***/ }), /* 220 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function generate__limitProperties(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $errorKeyword; var $data = 'data' + ($dataLvl || ''); var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } var $op = $keyword == 'maxProperties' ? '>' : '<'; out += 'if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; } out += ' Object.keys(' + ($data) + ').length ' + ($op) + ' ' + ($schemaValue) + ') { '; var $errorKeyword = $keyword; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || '_limitProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should NOT have '; if ($keyword == 'maxProperties') { out += 'more'; } else { out += 'fewer'; } out += ' than '; if ($isData) { out += '\' + ' + ($schemaValue) + ' + \''; } else { out += '' + ($schema); } out += ' properties\' '; } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + ($schema); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += '} '; if ($breakOnError) { out += ' else { '; } return out; } /***/ }), /* 221 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function generate_multipleOf(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } out += 'var division' + ($lvl) + ';if ('; if ($isData) { out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \'number\' || '; } out += ' (division' + ($lvl) + ' = ' + ($data) + ' / ' + ($schemaValue) + ', '; if (it.opts.multipleOfPrecision) { out += ' Math.abs(Math.round(division' + ($lvl) + ') - division' + ($lvl) + ') > 1e-' + (it.opts.multipleOfPrecision) + ' '; } else { out += ' division' + ($lvl) + ' !== parseInt(division' + ($lvl) + ') '; } out += ' ) '; if ($isData) { out += ' ) '; } out += ' ) { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('multipleOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { multipleOf: ' + ($schemaValue) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should be multiple of '; if ($isData) { out += '\' + ' + ($schemaValue); } else { out += '' + ($schemaValue) + '\''; } } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + ($schema); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += '} '; if ($breakOnError) { out += ' else { '; } return out; } /***/ }), /* 222 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function generate_not(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); $it.level++; var $nextValid = 'valid' + $it.level; if ((it.opts.strictKeywords ? typeof $schema == 'object' && Object.keys($schema).length > 0 : it.util.schemaHasRules($schema, it.RULES.all))) { $it.schema = $schema; $it.schemaPath = $schemaPath; $it.errSchemaPath = $errSchemaPath; out += ' var ' + ($errs) + ' = errors; '; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; $it.createErrors = false; var $allErrorsOption; if ($it.opts.allErrors) { $allErrorsOption = $it.opts.allErrors; $it.opts.allErrors = false; } out += ' ' + (it.validate($it)) + ' '; $it.createErrors = true; if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption; it.compositeRule = $it.compositeRule = $wasComposite; out += ' if (' + ($nextValid) + ') { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; if (it.opts.messages !== false) { out += ' , message: \'should NOT be valid\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; if (it.opts.allErrors) { out += ' } '; } } else { out += ' var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; if (it.opts.messages !== false) { out += ' , message: \'should NOT be valid\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; if ($breakOnError) { out += ' if (false) { '; } } return out; } /***/ }), /* 223 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function generate_oneOf(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; var $currentBaseId = $it.baseId, $prevValid = 'prevValid' + $lvl, $passingSchemas = 'passingSchemas' + $lvl; out += 'var ' + ($errs) + ' = errors , ' + ($prevValid) + ' = false , ' + ($valid) + ' = false , ' + ($passingSchemas) + ' = null; '; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; var arr1 = $schema; if (arr1) { var $sch, $i = -1, l1 = arr1.length - 1; while ($i < l1) { $sch = arr1[$i += 1]; if ((it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all))) { $it.schema = $sch; $it.schemaPath = $schemaPath + '[' + $i + ']'; $it.errSchemaPath = $errSchemaPath + '/' + $i; out += ' ' + (it.validate($it)) + ' '; $it.baseId = $currentBaseId; } else { out += ' var ' + ($nextValid) + ' = true; '; } if ($i) { out += ' if (' + ($nextValid) + ' && ' + ($prevValid) + ') { ' + ($valid) + ' = false; ' + ($passingSchemas) + ' = [' + ($passingSchemas) + ', ' + ($i) + ']; } else { '; $closingBraces += '}'; } out += ' if (' + ($nextValid) + ') { ' + ($valid) + ' = ' + ($prevValid) + ' = true; ' + ($passingSchemas) + ' = ' + ($i) + '; }'; } } it.compositeRule = $it.compositeRule = $wasComposite; out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('oneOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { passingSchemas: ' + ($passingSchemas) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should match exactly one schema in oneOf\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError(vErrors); '; } else { out += ' validate.errors = vErrors; return false; '; } } out += '} else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; }'; if (it.opts.allErrors) { out += ' } '; } return out; } /***/ }), /* 224 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function generate_pattern(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } var $regexp = $isData ? '(new RegExp(' + $schemaValue + '))' : it.usePattern($schema); out += 'if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || '; } out += ' !' + ($regexp) + '.test(' + ($data) + ') ) { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('pattern') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { pattern: '; if ($isData) { out += '' + ($schemaValue); } else { out += '' + (it.util.toQuotedString($schema)); } out += ' } '; if (it.opts.messages !== false) { out += ' , message: \'should match pattern "'; if ($isData) { out += '\' + ' + ($schemaValue) + ' + \''; } else { out += '' + (it.util.escapeQuotes($schema)); } out += '"\' '; } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + (it.util.toQuotedString($schema)); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += '} '; if ($breakOnError) { out += ' else { '; } return out; } /***/ }), /* 225 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function generate_properties(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; var $key = 'key' + $lvl, $idx = 'idx' + $lvl, $dataNxt = $it.dataLevel = it.dataLevel + 1, $nextData = 'data' + $dataNxt, $dataProperties = 'dataProperties' + $lvl; var $schemaKeys = Object.keys($schema || {}), $pProperties = it.schema.patternProperties || {}, $pPropertyKeys = Object.keys($pProperties), $aProperties = it.schema.additionalProperties, $someProperties = $schemaKeys.length || $pPropertyKeys.length, $noAdditional = $aProperties === false, $additionalIsSchema = typeof $aProperties == 'object' && Object.keys($aProperties).length, $removeAdditional = it.opts.removeAdditional, $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional, $ownProperties = it.opts.ownProperties, $currentBaseId = it.baseId; var $required = it.schema.required; if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired) var $requiredHash = it.util.toHash($required); out += 'var ' + ($errs) + ' = errors;var ' + ($nextValid) + ' = true;'; if ($ownProperties) { out += ' var ' + ($dataProperties) + ' = undefined;'; } if ($checkAdditional) { if ($ownProperties) { out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; } else { out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; } if ($someProperties) { out += ' var isAdditional' + ($lvl) + ' = !(false '; if ($schemaKeys.length) { if ($schemaKeys.length > 8) { out += ' || validate.schema' + ($schemaPath) + '.hasOwnProperty(' + ($key) + ') '; } else { var arr1 = $schemaKeys; if (arr1) { var $propertyKey, i1 = -1, l1 = arr1.length - 1; while (i1 < l1) { $propertyKey = arr1[i1 += 1]; out += ' || ' + ($key) + ' == ' + (it.util.toQuotedString($propertyKey)) + ' '; } } } } if ($pPropertyKeys.length) { var arr2 = $pPropertyKeys; if (arr2) { var $pProperty, $i = -1, l2 = arr2.length - 1; while ($i < l2) { $pProperty = arr2[$i += 1]; out += ' || ' + (it.usePattern($pProperty)) + '.test(' + ($key) + ') '; } } } out += ' ); if (isAdditional' + ($lvl) + ') { '; } if ($removeAdditional == 'all') { out += ' delete ' + ($data) + '[' + ($key) + ']; '; } else { var $currentErrorPath = it.errorPath; var $additionalProperty = '\' + ' + $key + ' + \''; if (it.opts._errorDataPathProperty) { it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); } if ($noAdditional) { if ($removeAdditional) { out += ' delete ' + ($data) + '[' + ($key) + ']; '; } else { out += ' ' + ($nextValid) + ' = false; '; var $currErrSchemaPath = $errSchemaPath; $errSchemaPath = it.errSchemaPath + '/additionalProperties'; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('additionalProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { additionalProperty: \'' + ($additionalProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is an invalid additional property'; } else { out += 'should NOT have additional properties'; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } $errSchemaPath = $currErrSchemaPath; if ($breakOnError) { out += ' break; '; } } } else if ($additionalIsSchema) { if ($removeAdditional == 'failing') { out += ' var ' + ($errs) + ' = errors; '; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; $it.schema = $aProperties; $it.schemaPath = it.schemaPath + '.additionalProperties'; $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); var $passData = $data + '[' + $key + ']'; $it.dataPathArr[$dataNxt] = $key; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } out += ' if (!' + ($nextValid) + ') { errors = ' + ($errs) + '; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete ' + ($data) + '[' + ($key) + ']; } '; it.compositeRule = $it.compositeRule = $wasComposite; } else { $it.schema = $aProperties; $it.schemaPath = it.schemaPath + '.additionalProperties'; $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); var $passData = $data + '[' + $key + ']'; $it.dataPathArr[$dataNxt] = $key; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } if ($breakOnError) { out += ' if (!' + ($nextValid) + ') break; '; } } } it.errorPath = $currentErrorPath; } if ($someProperties) { out += ' } '; } out += ' } '; if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; $closingBraces += '}'; } } var $useDefaults = it.opts.useDefaults && !it.compositeRule; if ($schemaKeys.length) { var arr3 = $schemaKeys; if (arr3) { var $propertyKey, i3 = -1, l3 = arr3.length - 1; while (i3 < l3) { $propertyKey = arr3[i3 += 1]; var $sch = $schema[$propertyKey]; if ((it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all))) { var $prop = it.util.getProperty($propertyKey), $passData = $data + $prop, $hasDefault = $useDefaults && $sch.default !== undefined; $it.schema = $sch; $it.schemaPath = $schemaPath + $prop; $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey); $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers); $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey); var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { $code = it.util.varReplace($code, $nextData, $passData); var $useData = $passData; } else { var $useData = $nextData; out += ' var ' + ($nextData) + ' = ' + ($passData) + '; '; } if ($hasDefault) { out += ' ' + ($code) + ' '; } else { if ($requiredHash && $requiredHash[$propertyKey]) { out += ' if ( ' + ($useData) + ' === undefined '; if ($ownProperties) { out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; } out += ') { ' + ($nextValid) + ' = false; '; var $currentErrorPath = it.errorPath, $currErrSchemaPath = $errSchemaPath, $missingProperty = it.util.escapeQuotes($propertyKey); if (it.opts._errorDataPathProperty) { it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); } $errSchemaPath = it.errSchemaPath + '/required'; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is a required property'; } else { out += 'should have required property \\\'' + ($missingProperty) + '\\\''; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } $errSchemaPath = $currErrSchemaPath; it.errorPath = $currentErrorPath; out += ' } else { '; } else { if ($breakOnError) { out += ' if ( ' + ($useData) + ' === undefined '; if ($ownProperties) { out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; } out += ') { ' + ($nextValid) + ' = true; } else { '; } else { out += ' if (' + ($useData) + ' !== undefined '; if ($ownProperties) { out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; } out += ' ) { '; } } out += ' ' + ($code) + ' } '; } } if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; $closingBraces += '}'; } } } } if ($pPropertyKeys.length) { var arr4 = $pPropertyKeys; if (arr4) { var $pProperty, i4 = -1, l4 = arr4.length - 1; while (i4 < l4) { $pProperty = arr4[i4 += 1]; var $sch = $pProperties[$pProperty]; if ((it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all))) { $it.schema = $sch; $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty); $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty); if ($ownProperties) { out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; } else { out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; } out += ' if (' + (it.usePattern($pProperty)) + '.test(' + ($key) + ')) { '; $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); var $passData = $data + '[' + $key + ']'; $it.dataPathArr[$dataNxt] = $key; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } if ($breakOnError) { out += ' if (!' + ($nextValid) + ') break; '; } out += ' } '; if ($breakOnError) { out += ' else ' + ($nextValid) + ' = true; '; } out += ' } '; if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; $closingBraces += '}'; } } } } } if ($breakOnError) { out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; } out = it.util.cleanUpCode(out); return out; } /***/ }), /* 226 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function generate_propertyNames(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; out += 'var ' + ($errs) + ' = errors;'; if ((it.opts.strictKeywords ? typeof $schema == 'object' && Object.keys($schema).length > 0 : it.util.schemaHasRules($schema, it.RULES.all))) { $it.schema = $schema; $it.schemaPath = $schemaPath; $it.errSchemaPath = $errSchemaPath; var $key = 'key' + $lvl, $idx = 'idx' + $lvl, $i = 'i' + $lvl, $invalidName = '\' + ' + $key + ' + \'', $dataNxt = $it.dataLevel = it.dataLevel + 1, $nextData = 'data' + $dataNxt, $dataProperties = 'dataProperties' + $lvl, $ownProperties = it.opts.ownProperties, $currentBaseId = it.baseId; if ($ownProperties) { out += ' var ' + ($dataProperties) + ' = undefined; '; } if ($ownProperties) { out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; } else { out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; } out += ' var startErrs' + ($lvl) + ' = errors; '; var $passData = $key; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } it.compositeRule = $it.compositeRule = $wasComposite; out += ' if (!' + ($nextValid) + ') { for (var ' + ($i) + '=startErrs' + ($lvl) + '; ' + ($i) + '<errors; ' + ($i) + '++) { vErrors[' + ($i) + '].propertyName = ' + ($key) + '; } var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('propertyNames') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { propertyName: \'' + ($invalidName) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \'property name \\\'' + ($invalidName) + '\\\' is invalid\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError(vErrors); '; } else { out += ' validate.errors = vErrors; return false; '; } } if ($breakOnError) { out += ' break; '; } out += ' } }'; } if ($breakOnError) { out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; } out = it.util.cleanUpCode(out); return out; } /***/ }), /* 227 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function generate_required(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } var $vSchema = 'schema' + $lvl; if (!$isData) { if ($schema.length < it.opts.loopRequired && it.schema.properties && Object.keys(it.schema.properties).length) { var $required = []; var arr1 = $schema; if (arr1) { var $property, i1 = -1, l1 = arr1.length - 1; while (i1 < l1) { $property = arr1[i1 += 1]; var $propertySch = it.schema.properties[$property]; if (!($propertySch && (it.opts.strictKeywords ? typeof $propertySch == 'object' && Object.keys($propertySch).length > 0 : it.util.schemaHasRules($propertySch, it.RULES.all)))) { $required[$required.length] = $property; } } } } else { var $required = $schema; } } if ($isData || $required.length) { var $currentErrorPath = it.errorPath, $loopRequired = $isData || $required.length >= it.opts.loopRequired, $ownProperties = it.opts.ownProperties; if ($breakOnError) { out += ' var missing' + ($lvl) + '; '; if ($loopRequired) { if (!$isData) { out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; } var $i = 'i' + $lvl, $propertyPath = 'schema' + $lvl + '[' + $i + ']', $missingProperty = '\' + ' + $propertyPath + ' + \''; if (it.opts._errorDataPathProperty) { it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); } out += ' var ' + ($valid) + ' = true; '; if ($isData) { out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {'; } out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { ' + ($valid) + ' = ' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] !== undefined '; if ($ownProperties) { out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) '; } out += '; if (!' + ($valid) + ') break; } '; if ($isData) { out += ' } '; } out += ' if (!' + ($valid) + ') { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is a required property'; } else { out += 'should have required property \\\'' + ($missingProperty) + '\\\''; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } else { '; } else { out += ' if ( '; var arr2 = $required; if (arr2) { var $propertyKey, $i = -1, l2 = arr2.length - 1; while ($i < l2) { $propertyKey = arr2[$i += 1]; if ($i) { out += ' || '; } var $prop = it.util.getProperty($propertyKey), $useData = $data + $prop; out += ' ( ( ' + ($useData) + ' === undefined '; if ($ownProperties) { out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; } out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) '; } } out += ') { '; var $propertyPath = 'missing' + $lvl, $missingProperty = '\' + ' + $propertyPath + ' + \''; if (it.opts._errorDataPathProperty) { it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath; } var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is a required property'; } else { out += 'should have required property \\\'' + ($missingProperty) + '\\\''; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } else { '; } } else { if ($loopRequired) { if (!$isData) { out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; } var $i = 'i' + $lvl, $propertyPath = 'schema' + $lvl + '[' + $i + ']', $missingProperty = '\' + ' + $propertyPath + ' + \''; if (it.opts._errorDataPathProperty) { it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); } if ($isData) { out += ' if (' + ($vSchema) + ' && !Array.isArray(' + ($vSchema) + ')) { var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is a required property'; } else { out += 'should have required property \\\'' + ($missingProperty) + '\\\''; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (' + ($vSchema) + ' !== undefined) { '; } out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { if (' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] === undefined '; if ($ownProperties) { out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) '; } out += ') { var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is a required property'; } else { out += 'should have required property \\\'' + ($missingProperty) + '\\\''; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } '; if ($isData) { out += ' } '; } } else { var arr3 = $required; if (arr3) { var $propertyKey, i3 = -1, l3 = arr3.length - 1; while (i3 < l3) { $propertyKey = arr3[i3 += 1]; var $prop = it.util.getProperty($propertyKey), $missingProperty = it.util.escapeQuotes($propertyKey), $useData = $data + $prop; if (it.opts._errorDataPathProperty) { it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); } out += ' if ( ' + ($useData) + ' === undefined '; if ($ownProperties) { out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; } out += ') { var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is a required property'; } else { out += 'should have required property \\\'' + ($missingProperty) + '\\\''; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } '; } } } } it.errorPath = $currentErrorPath; } else if ($breakOnError) { out += ' if (true) {'; } return out; } /***/ }), /* 228 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function generate_uniqueItems(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } if (($schema || $isData) && it.opts.uniqueItems !== false) { if ($isData) { out += ' var ' + ($valid) + '; if (' + ($schemaValue) + ' === false || ' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'boolean\') ' + ($valid) + ' = false; else { '; } out += ' var i = ' + ($data) + '.length , ' + ($valid) + ' = true , j; if (i > 1) { '; var $itemType = it.schema.items && it.schema.items.type, $typeIsArray = Array.isArray($itemType); if (!$itemType || $itemType == 'object' || $itemType == 'array' || ($typeIsArray && ($itemType.indexOf('object') >= 0 || $itemType.indexOf('array') >= 0))) { out += ' outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' + ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } } '; } else { out += ' var itemIndices = {}, item; for (;i--;) { var item = ' + ($data) + '[i]; '; var $method = 'checkDataType' + ($typeIsArray ? 's' : ''); out += ' if (' + (it.util[$method]($itemType, 'item', true)) + ') continue; '; if ($typeIsArray) { out += ' if (typeof item == \'string\') item = \'"\' + item; '; } out += ' if (typeof itemIndices[item] == \'number\') { ' + ($valid) + ' = false; j = itemIndices[item]; break; } itemIndices[item] = i; } '; } out += ' } '; if ($isData) { out += ' } '; } out += ' if (!' + ($valid) + ') { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('uniqueItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { i: i, j: j } '; if (it.opts.messages !== false) { out += ' , message: \'should NOT have duplicate items (items ## \' + j + \' and \' + i + \' are identical)\' '; } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + ($schema); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } '; if ($breakOnError) { out += ' else { '; } } else { if ($breakOnError) { out += ' if (true) { '; } } return out; } /***/ }), /* 229 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var KEYWORDS = [ 'multipleOf', 'maximum', 'exclusiveMaximum', 'minimum', 'exclusiveMinimum', 'maxLength', 'minLength', 'pattern', 'additionalItems', 'maxItems', 'minItems', 'uniqueItems', 'maxProperties', 'minProperties', 'required', 'additionalProperties', 'enum', 'format', 'const' ]; module.exports = function (metaSchema, keywordsJsonPointers) { for (var i=0; i<keywordsJsonPointers.length; i++) { metaSchema = JSON.parse(JSON.stringify(metaSchema)); var segments = keywordsJsonPointers[i].split('/'); var keywords = metaSchema; var j; for (j=1; j<segments.length; j++) keywords = keywords[segments[j]]; for (j=0; j<KEYWORDS.length; j++) { var key = KEYWORDS[j]; var schema = keywords[key]; if (schema) { keywords[key] = { anyOf: [ schema, { $ref: 'https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/data.json#' } ] }; } } } return metaSchema; }; /***/ }), /* 230 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var MissingRefError = __webpack_require__(199).MissingRef; module.exports = compileAsync; /** * Creates validating function for passed schema with asynchronous loading of missing schemas. * `loadSchema` option should be a function that accepts schema uri and returns promise that resolves with the schema. * @this Ajv * @param {Object} schema schema object * @param {Boolean} meta optional true to compile meta-schema; this parameter can be skipped * @param {Function} callback an optional node-style callback, it is called with 2 parameters: error (or null) and validating function. * @return {Promise} promise that resolves with a validating function. */ function compileAsync(schema, meta, callback) { /* eslint no-shadow: 0 */ /* global Promise */ /* jshint validthis: true */ var self = this; if (typeof this._opts.loadSchema != 'function') throw new Error('options.loadSchema should be a function'); if (typeof meta == 'function') { callback = meta; meta = undefined; } var p = loadMetaSchemaOf(schema).then(function () { var schemaObj = self._addSchema(schema, undefined, meta); return schemaObj.validate || _compileAsync(schemaObj); }); if (callback) { p.then( function(v) { callback(null, v); }, callback ); } return p; function loadMetaSchemaOf(sch) { var $schema = sch.$schema; return $schema && !self.getSchema($schema) ? compileAsync.call(self, { $ref: $schema }, true) : Promise.resolve(); } function _compileAsync(schemaObj) { try { return self._compile(schemaObj); } catch(e) { if (e instanceof MissingRefError) return loadMissingSchema(e); throw e; } function loadMissingSchema(e) { var ref = e.missingSchema; if (added(ref)) throw new Error('Schema ' + ref + ' is loaded but ' + e.missingRef + ' cannot be resolved'); var schemaPromise = self._loadingSchemas[ref]; if (!schemaPromise) { schemaPromise = self._loadingSchemas[ref] = self._opts.loadSchema(ref); schemaPromise.then(removePromise, removePromise); } return schemaPromise.then(function (sch) { if (!added(ref)) { return loadMetaSchemaOf(sch).then(function () { if (!added(ref)) self.addSchema(sch, ref, undefined, meta); }); } }).then(function() { return _compileAsync(schemaObj); }); function removePromise() { delete self._loadingSchemas[ref]; } function added(ref) { return self._refs[ref] || self._schemas[ref]; } } } } /***/ }), /* 231 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var IDENTIFIER = /^[a-z_$][a-z0-9_$-]*$/i; var customRuleCode = __webpack_require__(232); var definitionSchema = __webpack_require__(233); module.exports = { add: addKeyword, get: getKeyword, remove: removeKeyword, validate: validateKeyword }; /** * Define custom keyword * @this Ajv * @param {String} keyword custom keyword, should be unique (including different from all standard, custom and macro keywords). * @param {Object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`. * @return {Ajv} this for method chaining */ function addKeyword(keyword, definition) { /* jshint validthis: true */ /* eslint no-shadow: 0 */ var RULES = this.RULES; if (RULES.keywords[keyword]) throw new Error('Keyword ' + keyword + ' is already defined'); if (!IDENTIFIER.test(keyword)) throw new Error('Keyword ' + keyword + ' is not a valid identifier'); if (definition) { this.validateKeyword(definition, true); var dataType = definition.type; if (Array.isArray(dataType)) { for (var i=0; i<dataType.length; i++) _addRule(keyword, dataType[i], definition); } else { _addRule(keyword, dataType, definition); } var metaSchema = definition.metaSchema; if (metaSchema) { if (definition.$data && this._opts.$data) { metaSchema = { anyOf: [ metaSchema, { '$ref': 'https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/data.json#' } ] }; } definition.validateSchema = this.compile(metaSchema, true); } } RULES.keywords[keyword] = RULES.all[keyword] = true; function _addRule(keyword, dataType, definition) { var ruleGroup; for (var i=0; i<RULES.length; i++) { var rg = RULES[i]; if (rg.type == dataType) { ruleGroup = rg; break; } } if (!ruleGroup) { ruleGroup = { type: dataType, rules: [] }; RULES.push(ruleGroup); } var rule = { keyword: keyword, definition: definition, custom: true, code: customRuleCode, implements: definition.implements }; ruleGroup.rules.push(rule); RULES.custom[keyword] = rule; } return this; } /** * Get keyword * @this Ajv * @param {String} keyword pre-defined or custom keyword. * @return {Object|Boolean} custom keyword definition, `true` if it is a predefined keyword, `false` otherwise. */ function getKeyword(keyword) { /* jshint validthis: true */ var rule = this.RULES.custom[keyword]; return rule ? rule.definition : this.RULES.keywords[keyword] || false; } /** * Remove keyword * @this Ajv * @param {String} keyword pre-defined or custom keyword. * @return {Ajv} this for method chaining */ function removeKeyword(keyword) { /* jshint validthis: true */ var RULES = this.RULES; delete RULES.keywords[keyword]; delete RULES.all[keyword]; delete RULES.custom[keyword]; for (var i=0; i<RULES.length; i++) { var rules = RULES[i].rules; for (var j=0; j<rules.length; j++) { if (rules[j].keyword == keyword) { rules.splice(j, 1); break; } } } return this; } /** * Validate keyword definition * @this Ajv * @param {Object} definition keyword definition object. * @param {Boolean} throwError true to throw exception if definition is invalid * @return {boolean} validation result */ function validateKeyword(definition, throwError) { validateKeyword.errors = null; var v = this._validateKeyword = this._validateKeyword || this.compile(definitionSchema, true); if (v(definition)) return true; validateKeyword.errors = v.errors; if (throwError) throw new Error('custom keyword definition is invalid: ' + this.errorsText(v.errors)); else return false; } /***/ }), /* 232 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function generate_custom(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $errorKeyword; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $errs = 'errs__' + $lvl; var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } var $rule = this, $definition = 'definition' + $lvl, $rDef = $rule.definition, $closingBraces = ''; var $compile, $inline, $macro, $ruleValidate, $validateCode; if ($isData && $rDef.$data) { $validateCode = 'keywordValidate' + $lvl; var $validateSchema = $rDef.validateSchema; out += ' var ' + ($definition) + ' = RULES.custom[\'' + ($keyword) + '\'].definition; var ' + ($validateCode) + ' = ' + ($definition) + '.validate;'; } else { $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it); if (!$ruleValidate) return; $schemaValue = 'validate.schema' + $schemaPath; $validateCode = $ruleValidate.code; $compile = $rDef.compile; $inline = $rDef.inline; $macro = $rDef.macro; } var $ruleErrs = $validateCode + '.errors', $i = 'i' + $lvl, $ruleErr = 'ruleErr' + $lvl, $asyncKeyword = $rDef.async; if ($asyncKeyword && !it.async) throw new Error('async keyword in sync schema'); if (!($inline || $macro)) { out += '' + ($ruleErrs) + ' = null;'; } out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; if ($isData && $rDef.$data) { $closingBraces += '}'; out += ' if (' + ($schemaValue) + ' === undefined) { ' + ($valid) + ' = true; } else { '; if ($validateSchema) { $closingBraces += '}'; out += ' ' + ($valid) + ' = ' + ($definition) + '.validateSchema(' + ($schemaValue) + '); if (' + ($valid) + ') { '; } } if ($inline) { if ($rDef.statements) { out += ' ' + ($ruleValidate.validate) + ' '; } else { out += ' ' + ($valid) + ' = ' + ($ruleValidate.validate) + '; '; } } else if ($macro) { var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; $it.schema = $ruleValidate.validate; $it.schemaPath = ''; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; var $code = it.validate($it).replace(/validate\.schema/g, $validateCode); it.compositeRule = $it.compositeRule = $wasComposite; out += ' ' + ($code); } else { var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; out += ' ' + ($validateCode) + '.call( '; if (it.opts.passContext) { out += 'this'; } else { out += 'self'; } if ($compile || $rDef.schema === false) { out += ' , ' + ($data) + ' '; } else { out += ' , ' + ($schemaValue) + ' , ' + ($data) + ' , validate.schema' + (it.schemaPath) + ' '; } out += ' , (dataPath || \'\')'; if (it.errorPath != '""') { out += ' + ' + (it.errorPath); } var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ' , rootData ) '; var def_callRuleValidate = out; out = $$outStack.pop(); if ($rDef.errors === false) { out += ' ' + ($valid) + ' = '; if ($asyncKeyword) { out += 'await '; } out += '' + (def_callRuleValidate) + '; '; } else { if ($asyncKeyword) { $ruleErrs = 'customErrors' + $lvl; out += ' var ' + ($ruleErrs) + ' = null; try { ' + ($valid) + ' = await ' + (def_callRuleValidate) + '; } catch (e) { ' + ($valid) + ' = false; if (e instanceof ValidationError) ' + ($ruleErrs) + ' = e.errors; else throw e; } '; } else { out += ' ' + ($ruleErrs) + ' = null; ' + ($valid) + ' = ' + (def_callRuleValidate) + '; '; } } } if ($rDef.modifying) { out += ' if (' + ($parentData) + ') ' + ($data) + ' = ' + ($parentData) + '[' + ($parentDataProperty) + '];'; } out += '' + ($closingBraces); if ($rDef.valid) { if ($breakOnError) { out += ' if (true) { '; } } else { out += ' if ( '; if ($rDef.valid === undefined) { out += ' !'; if ($macro) { out += '' + ($nextValid); } else { out += '' + ($valid); } } else { out += ' ' + (!$rDef.valid) + ' '; } out += ') { '; $errorKeyword = $rule.keyword; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } var def_customError = out; out = $$outStack.pop(); if ($inline) { if ($rDef.errors) { if ($rDef.errors != 'full') { out += ' for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \'\') + ' + (it.errorPath) + '; if (' + ($ruleErr) + '.schemaPath === undefined) { ' + ($ruleErr) + '.schemaPath = "' + ($errSchemaPath) + '"; } '; if (it.opts.verbose) { out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; '; } out += ' } '; } } else { if ($rDef.errors === false) { out += ' ' + (def_customError) + ' '; } else { out += ' if (' + ($errs) + ' == errors) { ' + (def_customError) + ' } else { for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \'\') + ' + (it.errorPath) + '; if (' + ($ruleErr) + '.schemaPath === undefined) { ' + ($ruleErr) + '.schemaPath = "' + ($errSchemaPath) + '"; } '; if (it.opts.verbose) { out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; '; } out += ' } } '; } } } else if ($macro) { out += ' var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError(vErrors); '; } else { out += ' validate.errors = vErrors; return false; '; } } } else { if ($rDef.errors === false) { out += ' ' + (def_customError) + ' '; } else { out += ' if (Array.isArray(' + ($ruleErrs) + ')) { if (vErrors === null) vErrors = ' + ($ruleErrs) + '; else vErrors = vErrors.concat(' + ($ruleErrs) + '); errors = vErrors.length; for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \'\') + ' + (it.errorPath) + '; ' + ($ruleErr) + '.schemaPath = "' + ($errSchemaPath) + '"; '; if (it.opts.verbose) { out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; '; } out += ' } } else { ' + (def_customError) + ' } '; } } out += ' } '; if ($breakOnError) { out += ' else { '; } } return out; } /***/ }), /* 233 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var metaSchema = __webpack_require__(234); module.exports = { $id: 'https://github.com/epoberezkin/ajv/blob/master/lib/definition_schema.js', definitions: { simpleTypes: metaSchema.definitions.simpleTypes }, type: 'object', dependencies: { schema: ['validate'], $data: ['validate'], statements: ['inline'], valid: {not: {required: ['macro']}} }, properties: { type: metaSchema.properties.type, schema: {type: 'boolean'}, statements: {type: 'boolean'}, dependencies: { type: 'array', items: {type: 'string'} }, metaSchema: {type: 'object'}, modifying: {type: 'boolean'}, valid: {type: 'boolean'}, $data: {type: 'boolean'}, async: {type: 'boolean'}, errors: { anyOf: [ {type: 'boolean'}, {const: 'full'} ] } } }; /***/ }), /* 234 */ /***/ (function(module) { module.exports = JSON.parse("{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"$id\":\"http://json-schema.org/draft-07/schema#\",\"title\":\"Core schema meta-schema\",\"definitions\":{\"schemaArray\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#\"}},\"nonNegativeInteger\":{\"type\":\"integer\",\"minimum\":0},\"nonNegativeIntegerDefault0\":{\"allOf\":[{\"$ref\":\"#/definitions/nonNegativeInteger\"},{\"default\":0}]},\"simpleTypes\":{\"enum\":[\"array\",\"boolean\",\"integer\",\"null\",\"number\",\"object\",\"string\"]},\"stringArray\":{\"type\":\"array\",\"items\":{\"type\":\"string\"},\"uniqueItems\":true,\"default\":[]}},\"type\":[\"object\",\"boolean\"],\"properties\":{\"$id\":{\"type\":\"string\",\"format\":\"uri-reference\"},\"$schema\":{\"type\":\"string\",\"format\":\"uri\"},\"$ref\":{\"type\":\"string\",\"format\":\"uri-reference\"},\"$comment\":{\"type\":\"string\"},\"title\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"default\":true,\"readOnly\":{\"type\":\"boolean\",\"default\":false},\"examples\":{\"type\":\"array\",\"items\":true},\"multipleOf\":{\"type\":\"number\",\"exclusiveMinimum\":0},\"maximum\":{\"type\":\"number\"},\"exclusiveMaximum\":{\"type\":\"number\"},\"minimum\":{\"type\":\"number\"},\"exclusiveMinimum\":{\"type\":\"number\"},\"maxLength\":{\"$ref\":\"#/definitions/nonNegativeInteger\"},\"minLength\":{\"$ref\":\"#/definitions/nonNegativeIntegerDefault0\"},\"pattern\":{\"type\":\"string\",\"format\":\"regex\"},\"additionalItems\":{\"$ref\":\"#\"},\"items\":{\"anyOf\":[{\"$ref\":\"#\"},{\"$ref\":\"#/definitions/schemaArray\"}],\"default\":true},\"maxItems\":{\"$ref\":\"#/definitions/nonNegativeInteger\"},\"minItems\":{\"$ref\":\"#/definitions/nonNegativeIntegerDefault0\"},\"uniqueItems\":{\"type\":\"boolean\",\"default\":false},\"contains\":{\"$ref\":\"#\"},\"maxProperties\":{\"$ref\":\"#/definitions/nonNegativeInteger\"},\"minProperties\":{\"$ref\":\"#/definitions/nonNegativeIntegerDefault0\"},\"required\":{\"$ref\":\"#/definitions/stringArray\"},\"additionalProperties\":{\"$ref\":\"#\"},\"definitions\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#\"},\"default\":{}},\"properties\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#\"},\"default\":{}},\"patternProperties\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#\"},\"propertyNames\":{\"format\":\"regex\"},\"default\":{}},\"dependencies\":{\"type\":\"object\",\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#\"},{\"$ref\":\"#/definitions/stringArray\"}]}},\"propertyNames\":{\"$ref\":\"#\"},\"const\":true,\"enum\":{\"type\":\"array\",\"items\":true,\"minItems\":1,\"uniqueItems\":true},\"type\":{\"anyOf\":[{\"$ref\":\"#/definitions/simpleTypes\"},{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/simpleTypes\"},\"minItems\":1,\"uniqueItems\":true}]},\"format\":{\"type\":\"string\"},\"contentMediaType\":{\"type\":\"string\"},\"contentEncoding\":{\"type\":\"string\"},\"if\":{\"$ref\":\"#\"},\"then\":{\"$ref\":\"#\"},\"else\":{\"$ref\":\"#\"},\"allOf\":{\"$ref\":\"#/definitions/schemaArray\"},\"anyOf\":{\"$ref\":\"#/definitions/schemaArray\"},\"oneOf\":{\"$ref\":\"#/definitions/schemaArray\"},\"not\":{\"$ref\":\"#\"}},\"default\":true}"); /***/ }), /* 235 */ /***/ (function(module) { module.exports = JSON.parse("{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"$id\":\"https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/data.json#\",\"description\":\"Meta-schema for $data reference (JSON Schema extension proposal)\",\"type\":\"object\",\"required\":[\"$data\"],\"properties\":{\"$data\":{\"type\":\"string\",\"anyOf\":[{\"format\":\"relative-json-pointer\"},{\"format\":\"json-pointer\"}]}},\"additionalProperties\":false}"); /***/ }), /* 236 */ /***/ (function(module, exports) { function HARError (errors) { var message = 'validation failed' this.name = 'HARError' this.message = message this.errors = errors if (typeof Error.captureStackTrace === 'function') { Error.captureStackTrace(this, this.constructor) } else { this.stack = (new Error(message)).stack } } HARError.prototype = Error.prototype module.exports = HARError /***/ }), /* 237 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = { afterRequest: __webpack_require__(238), beforeRequest: __webpack_require__(239), browser: __webpack_require__(240), cache: __webpack_require__(241), content: __webpack_require__(242), cookie: __webpack_require__(243), creator: __webpack_require__(244), entry: __webpack_require__(245), har: __webpack_require__(246), header: __webpack_require__(247), log: __webpack_require__(248), page: __webpack_require__(249), pageTimings: __webpack_require__(250), postData: __webpack_require__(251), query: __webpack_require__(252), request: __webpack_require__(253), response: __webpack_require__(254), timings: __webpack_require__(255) } /***/ }), /* 238 */ /***/ (function(module) { module.exports = JSON.parse("{\"$id\":\"afterRequest.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"optional\":true,\"required\":[\"lastAccess\",\"eTag\",\"hitCount\"],\"properties\":{\"expires\":{\"type\":\"string\",\"pattern\":\"^(\\\\d{4})(-)?(\\\\d\\\\d)(-)?(\\\\d\\\\d)(T)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(\\\\.\\\\d+)?(Z|([+-])(\\\\d\\\\d)(:)?(\\\\d\\\\d))?\"},\"lastAccess\":{\"type\":\"string\",\"pattern\":\"^(\\\\d{4})(-)?(\\\\d\\\\d)(-)?(\\\\d\\\\d)(T)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(\\\\.\\\\d+)?(Z|([+-])(\\\\d\\\\d)(:)?(\\\\d\\\\d))?\"},\"eTag\":{\"type\":\"string\"},\"hitCount\":{\"type\":\"integer\"},\"comment\":{\"type\":\"string\"}}}"); /***/ }), /* 239 */ /***/ (function(module) { module.exports = JSON.parse("{\"$id\":\"beforeRequest.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"optional\":true,\"required\":[\"lastAccess\",\"eTag\",\"hitCount\"],\"properties\":{\"expires\":{\"type\":\"string\",\"pattern\":\"^(\\\\d{4})(-)?(\\\\d\\\\d)(-)?(\\\\d\\\\d)(T)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(\\\\.\\\\d+)?(Z|([+-])(\\\\d\\\\d)(:)?(\\\\d\\\\d))?\"},\"lastAccess\":{\"type\":\"string\",\"pattern\":\"^(\\\\d{4})(-)?(\\\\d\\\\d)(-)?(\\\\d\\\\d)(T)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(\\\\.\\\\d+)?(Z|([+-])(\\\\d\\\\d)(:)?(\\\\d\\\\d))?\"},\"eTag\":{\"type\":\"string\"},\"hitCount\":{\"type\":\"integer\"},\"comment\":{\"type\":\"string\"}}}"); /***/ }), /* 240 */ /***/ (function(module) { module.exports = JSON.parse("{\"$id\":\"browser.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"required\":[\"name\",\"version\"],\"properties\":{\"name\":{\"type\":\"string\"},\"version\":{\"type\":\"string\"},\"comment\":{\"type\":\"string\"}}}"); /***/ }), /* 241 */ /***/ (function(module) { module.exports = JSON.parse("{\"$id\":\"cache.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"properties\":{\"beforeRequest\":{\"oneOf\":[{\"type\":\"null\"},{\"$ref\":\"beforeRequest.json#\"}]},\"afterRequest\":{\"oneOf\":[{\"type\":\"null\"},{\"$ref\":\"afterRequest.json#\"}]},\"comment\":{\"type\":\"string\"}}}"); /***/ }), /* 242 */ /***/ (function(module) { module.exports = JSON.parse("{\"$id\":\"content.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"required\":[\"size\",\"mimeType\"],\"properties\":{\"size\":{\"type\":\"integer\"},\"compression\":{\"type\":\"integer\"},\"mimeType\":{\"type\":\"string\"},\"text\":{\"type\":\"string\"},\"encoding\":{\"type\":\"string\"},\"comment\":{\"type\":\"string\"}}}"); /***/ }), /* 243 */ /***/ (function(module) { module.exports = JSON.parse("{\"$id\":\"cookie.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"required\":[\"name\",\"value\"],\"properties\":{\"name\":{\"type\":\"string\"},\"value\":{\"type\":\"string\"},\"path\":{\"type\":\"string\"},\"domain\":{\"type\":\"string\"},\"expires\":{\"type\":[\"string\",\"null\"],\"format\":\"date-time\"},\"httpOnly\":{\"type\":\"boolean\"},\"secure\":{\"type\":\"boolean\"},\"comment\":{\"type\":\"string\"}}}"); /***/ }), /* 244 */ /***/ (function(module) { module.exports = JSON.parse("{\"$id\":\"creator.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"required\":[\"name\",\"version\"],\"properties\":{\"name\":{\"type\":\"string\"},\"version\":{\"type\":\"string\"},\"comment\":{\"type\":\"string\"}}}"); /***/ }), /* 245 */ /***/ (function(module) { module.exports = JSON.parse("{\"$id\":\"entry.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"optional\":true,\"required\":[\"startedDateTime\",\"time\",\"request\",\"response\",\"cache\",\"timings\"],\"properties\":{\"pageref\":{\"type\":\"string\"},\"startedDateTime\":{\"type\":\"string\",\"format\":\"date-time\",\"pattern\":\"^(\\\\d{4})(-)?(\\\\d\\\\d)(-)?(\\\\d\\\\d)(T)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(\\\\.\\\\d+)?(Z|([+-])(\\\\d\\\\d)(:)?(\\\\d\\\\d))\"},\"time\":{\"type\":\"number\",\"min\":0},\"request\":{\"$ref\":\"request.json#\"},\"response\":{\"$ref\":\"response.json#\"},\"cache\":{\"$ref\":\"cache.json#\"},\"timings\":{\"$ref\":\"timings.json#\"},\"serverIPAddress\":{\"type\":\"string\",\"oneOf\":[{\"format\":\"ipv4\"},{\"format\":\"ipv6\"}]},\"connection\":{\"type\":\"string\"},\"comment\":{\"type\":\"string\"}}}"); /***/ }), /* 246 */ /***/ (function(module) { module.exports = JSON.parse("{\"$id\":\"har.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"required\":[\"log\"],\"properties\":{\"log\":{\"$ref\":\"log.json#\"}}}"); /***/ }), /* 247 */ /***/ (function(module) { module.exports = JSON.parse("{\"$id\":\"header.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"required\":[\"name\",\"value\"],\"properties\":{\"name\":{\"type\":\"string\"},\"value\":{\"type\":\"string\"},\"comment\":{\"type\":\"string\"}}}"); /***/ }), /* 248 */ /***/ (function(module) { module.exports = JSON.parse("{\"$id\":\"log.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"required\":[\"version\",\"creator\",\"entries\"],\"properties\":{\"version\":{\"type\":\"string\"},\"creator\":{\"$ref\":\"creator.json#\"},\"browser\":{\"$ref\":\"browser.json#\"},\"pages\":{\"type\":\"array\",\"items\":{\"$ref\":\"page.json#\"}},\"entries\":{\"type\":\"array\",\"items\":{\"$ref\":\"entry.json#\"}},\"comment\":{\"type\":\"string\"}}}"); /***/ }), /* 249 */ /***/ (function(module) { module.exports = JSON.parse("{\"$id\":\"page.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"optional\":true,\"required\":[\"startedDateTime\",\"id\",\"title\",\"pageTimings\"],\"properties\":{\"startedDateTime\":{\"type\":\"string\",\"format\":\"date-time\",\"pattern\":\"^(\\\\d{4})(-)?(\\\\d\\\\d)(-)?(\\\\d\\\\d)(T)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(\\\\.\\\\d+)?(Z|([+-])(\\\\d\\\\d)(:)?(\\\\d\\\\d))\"},\"id\":{\"type\":\"string\",\"unique\":true},\"title\":{\"type\":\"string\"},\"pageTimings\":{\"$ref\":\"pageTimings.json#\"},\"comment\":{\"type\":\"string\"}}}"); /***/ }), /* 250 */ /***/ (function(module) { module.exports = JSON.parse("{\"$id\":\"pageTimings.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"properties\":{\"onContentLoad\":{\"type\":\"number\",\"min\":-1},\"onLoad\":{\"type\":\"number\",\"min\":-1},\"comment\":{\"type\":\"string\"}}}"); /***/ }), /* 251 */ /***/ (function(module) { module.exports = JSON.parse("{\"$id\":\"postData.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"optional\":true,\"required\":[\"mimeType\"],\"properties\":{\"mimeType\":{\"type\":\"string\"},\"text\":{\"type\":\"string\"},\"params\":{\"type\":\"array\",\"required\":[\"name\"],\"properties\":{\"name\":{\"type\":\"string\"},\"value\":{\"type\":\"string\"},\"fileName\":{\"type\":\"string\"},\"contentType\":{\"type\":\"string\"},\"comment\":{\"type\":\"string\"}}},\"comment\":{\"type\":\"string\"}}}"); /***/ }), /* 252 */ /***/ (function(module) { module.exports = JSON.parse("{\"$id\":\"query.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"required\":[\"name\",\"value\"],\"properties\":{\"name\":{\"type\":\"string\"},\"value\":{\"type\":\"string\"},\"comment\":{\"type\":\"string\"}}}"); /***/ }), /* 253 */ /***/ (function(module) { module.exports = JSON.parse("{\"$id\":\"request.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"required\":[\"method\",\"url\",\"httpVersion\",\"cookies\",\"headers\",\"queryString\",\"headersSize\",\"bodySize\"],\"properties\":{\"method\":{\"type\":\"string\"},\"url\":{\"type\":\"string\",\"format\":\"uri\"},\"httpVersion\":{\"type\":\"string\"},\"cookies\":{\"type\":\"array\",\"items\":{\"$ref\":\"cookie.json#\"}},\"headers\":{\"type\":\"array\",\"items\":{\"$ref\":\"header.json#\"}},\"queryString\":{\"type\":\"array\",\"items\":{\"$ref\":\"query.json#\"}},\"postData\":{\"$ref\":\"postData.json#\"},\"headersSize\":{\"type\":\"integer\"},\"bodySize\":{\"type\":\"integer\"},\"comment\":{\"type\":\"string\"}}}"); /***/ }), /* 254 */ /***/ (function(module) { module.exports = JSON.parse("{\"$id\":\"response.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"required\":[\"status\",\"statusText\",\"httpVersion\",\"cookies\",\"headers\",\"content\",\"redirectURL\",\"headersSize\",\"bodySize\"],\"properties\":{\"status\":{\"type\":\"integer\"},\"statusText\":{\"type\":\"string\"},\"httpVersion\":{\"type\":\"string\"},\"cookies\":{\"type\":\"array\",\"items\":{\"$ref\":\"cookie.json#\"}},\"headers\":{\"type\":\"array\",\"items\":{\"$ref\":\"header.json#\"}},\"content\":{\"$ref\":\"content.json#\"},\"redirectURL\":{\"type\":\"string\"},\"headersSize\":{\"type\":\"integer\"},\"bodySize\":{\"type\":\"integer\"},\"comment\":{\"type\":\"string\"}}}"); /***/ }), /* 255 */ /***/ (function(module) { module.exports = JSON.parse("{\"$id\":\"timings.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"required\":[\"send\",\"wait\",\"receive\"],\"properties\":{\"dns\":{\"type\":\"number\",\"min\":-1},\"connect\":{\"type\":\"number\",\"min\":-1},\"blocked\":{\"type\":\"number\",\"min\":-1},\"send\":{\"type\":\"number\",\"min\":-1},\"wait\":{\"type\":\"number\",\"min\":-1},\"receive\":{\"type\":\"number\",\"min\":-1},\"ssl\":{\"type\":\"number\",\"min\":-1},\"comment\":{\"type\":\"string\"}}}"); /***/ }), /* 256 */ /***/ (function(module) { module.exports = JSON.parse("{\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"$id\":\"http://json-schema.org/draft-06/schema#\",\"title\":\"Core schema meta-schema\",\"definitions\":{\"schemaArray\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#\"}},\"nonNegativeInteger\":{\"type\":\"integer\",\"minimum\":0},\"nonNegativeIntegerDefault0\":{\"allOf\":[{\"$ref\":\"#/definitions/nonNegativeInteger\"},{\"default\":0}]},\"simpleTypes\":{\"enum\":[\"array\",\"boolean\",\"integer\",\"null\",\"number\",\"object\",\"string\"]},\"stringArray\":{\"type\":\"array\",\"items\":{\"type\":\"string\"},\"uniqueItems\":true,\"default\":[]}},\"type\":[\"object\",\"boolean\"],\"properties\":{\"$id\":{\"type\":\"string\",\"format\":\"uri-reference\"},\"$schema\":{\"type\":\"string\",\"format\":\"uri\"},\"$ref\":{\"type\":\"string\",\"format\":\"uri-reference\"},\"title\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"default\":{},\"examples\":{\"type\":\"array\",\"items\":{}},\"multipleOf\":{\"type\":\"number\",\"exclusiveMinimum\":0},\"maximum\":{\"type\":\"number\"},\"exclusiveMaximum\":{\"type\":\"number\"},\"minimum\":{\"type\":\"number\"},\"exclusiveMinimum\":{\"type\":\"number\"},\"maxLength\":{\"$ref\":\"#/definitions/nonNegativeInteger\"},\"minLength\":{\"$ref\":\"#/definitions/nonNegativeIntegerDefault0\"},\"pattern\":{\"type\":\"string\",\"format\":\"regex\"},\"additionalItems\":{\"$ref\":\"#\"},\"items\":{\"anyOf\":[{\"$ref\":\"#\"},{\"$ref\":\"#/definitions/schemaArray\"}],\"default\":{}},\"maxItems\":{\"$ref\":\"#/definitions/nonNegativeInteger\"},\"minItems\":{\"$ref\":\"#/definitions/nonNegativeIntegerDefault0\"},\"uniqueItems\":{\"type\":\"boolean\",\"default\":false},\"contains\":{\"$ref\":\"#\"},\"maxProperties\":{\"$ref\":\"#/definitions/nonNegativeInteger\"},\"minProperties\":{\"$ref\":\"#/definitions/nonNegativeIntegerDefault0\"},\"required\":{\"$ref\":\"#/definitions/stringArray\"},\"additionalProperties\":{\"$ref\":\"#\"},\"definitions\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#\"},\"default\":{}},\"properties\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#\"},\"default\":{}},\"patternProperties\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#\"},\"default\":{}},\"dependencies\":{\"type\":\"object\",\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#\"},{\"$ref\":\"#/definitions/stringArray\"}]}},\"propertyNames\":{\"$ref\":\"#\"},\"const\":{},\"enum\":{\"type\":\"array\",\"minItems\":1,\"uniqueItems\":true},\"type\":{\"anyOf\":[{\"$ref\":\"#/definitions/simpleTypes\"},{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/simpleTypes\"},\"minItems\":1,\"uniqueItems\":true}]},\"format\":{\"type\":\"string\"},\"allOf\":{\"$ref\":\"#/definitions/schemaArray\"},\"anyOf\":{\"$ref\":\"#/definitions/schemaArray\"},\"oneOf\":{\"$ref\":\"#/definitions/schemaArray\"},\"not\":{\"$ref\":\"#\"}},\"default\":{}}"); /***/ }), /* 257 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var caseless = __webpack_require__(161) var uuid = __webpack_require__(258) var helpers = __webpack_require__(93) var md5 = helpers.md5 var toBase64 = helpers.toBase64 function Auth (request) { // define all public properties here this.request = request this.hasAuth = false this.sentAuth = false this.bearerToken = null this.user = null this.pass = null } Auth.prototype.basic = function (user, pass, sendImmediately) { var self = this if (typeof user !== 'string' || (pass !== undefined && typeof pass !== 'string')) { self.request.emit('error', new Error('auth() received invalid user or password')) } self.user = user self.pass = pass self.hasAuth = true var header = user + ':' + (pass || '') if (sendImmediately || typeof sendImmediately === 'undefined') { var authHeader = 'Basic ' + toBase64(header) self.sentAuth = true return authHeader } } Auth.prototype.bearer = function (bearer, sendImmediately) { var self = this self.bearerToken = bearer self.hasAuth = true if (sendImmediately || typeof sendImmediately === 'undefined') { if (typeof bearer === 'function') { bearer = bearer() } var authHeader = 'Bearer ' + (bearer || '') self.sentAuth = true return authHeader } } Auth.prototype.digest = function (method, path, authHeader) { // TODO: More complete implementation of RFC 2617. // - handle challenge.domain // - support qop="auth-int" only // - handle Authentication-Info (not necessarily?) // - check challenge.stale (not necessarily?) // - increase nc (not necessarily?) // For reference: // http://tools.ietf.org/html/rfc2617#section-3 // https://github.com/bagder/curl/blob/master/lib/http_digest.c var self = this var challenge = {} var re = /([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi for (;;) { var match = re.exec(authHeader) if (!match) { break } challenge[match[1]] = match[2] || match[3] } /** * RFC 2617: handle both MD5 and MD5-sess algorithms. * * If the algorithm directive's value is "MD5" or unspecified, then HA1 is * HA1=MD5(username:realm:password) * If the algorithm directive's value is "MD5-sess", then HA1 is * HA1=MD5(MD5(username:realm:password):nonce:cnonce) */ var ha1Compute = function (algorithm, user, realm, pass, nonce, cnonce) { var ha1 = md5(user + ':' + realm + ':' + pass) if (algorithm && algorithm.toLowerCase() === 'md5-sess') { return md5(ha1 + ':' + nonce + ':' + cnonce) } else { return ha1 } } var qop = /(^|,)\s*auth\s*($|,)/.test(challenge.qop) && 'auth' var nc = qop && '00000001' var cnonce = qop && uuid().replace(/-/g, '') var ha1 = ha1Compute(challenge.algorithm, self.user, challenge.realm, self.pass, challenge.nonce, cnonce) var ha2 = md5(method + ':' + path) var digestResponse = qop ? md5(ha1 + ':' + challenge.nonce + ':' + nc + ':' + cnonce + ':' + qop + ':' + ha2) : md5(ha1 + ':' + challenge.nonce + ':' + ha2) var authValues = { username: self.user, realm: challenge.realm, nonce: challenge.nonce, uri: path, qop: qop, response: digestResponse, nc: nc, cnonce: cnonce, algorithm: challenge.algorithm, opaque: challenge.opaque } authHeader = [] for (var k in authValues) { if (authValues[k]) { if (k === 'qop' || k === 'nc' || k === 'algorithm') { authHeader.push(k + '=' + authValues[k]) } else { authHeader.push(k + '="' + authValues[k] + '"') } } } authHeader = 'Digest ' + authHeader.join(', ') self.sentAuth = true return authHeader } Auth.prototype.onRequest = function (user, pass, sendImmediately, bearer) { var self = this var request = self.request var authHeader if (bearer === undefined && user === undefined) { self.request.emit('error', new Error('no auth mechanism defined')) } else if (bearer !== undefined) { authHeader = self.bearer(bearer, sendImmediately) } else { authHeader = self.basic(user, pass, sendImmediately) } if (authHeader) { request.setHeader('authorization', authHeader) } } Auth.prototype.onResponse = function (response) { var self = this var request = self.request if (!self.hasAuth || self.sentAuth) { return null } var c = caseless(response.headers) var authHeader = c.get('www-authenticate') var authVerb = authHeader && authHeader.split(' ')[0].toLowerCase() request.debug('reauth', authVerb) switch (authVerb) { case 'basic': return self.basic(self.user, self.pass, true) case 'bearer': return self.bearer(self.bearerToken, true) case 'digest': return self.digest(request.method, request.path, authHeader) } } exports.Auth = Auth /***/ }), /* 258 */ /***/ (function(module, exports, __webpack_require__) { var rng = __webpack_require__(259); var bytesToUuid = __webpack_require__(260); function v4(options, buf, offset) { var i = buf && offset || 0; if (typeof(options) == 'string') { buf = options === 'binary' ? new Array(16) : null; options = null; } options = options || {}; var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` rnds[6] = (rnds[6] & 0x0f) | 0x40; rnds[8] = (rnds[8] & 0x3f) | 0x80; // Copy bytes to buffer, if provided if (buf) { for (var ii = 0; ii < 16; ++ii) { buf[i + ii] = rnds[ii]; } } return buf || bytesToUuid(rnds); } module.exports = v4; /***/ }), /* 259 */ /***/ (function(module, exports, __webpack_require__) { // Unique ID creation requires a high quality random # generator. In node.js // this is pretty straight-forward - we use the crypto API. var crypto = __webpack_require__(94); module.exports = function nodeRNG() { return crypto.randomBytes(16); }; /***/ }), /* 260 */ /***/ (function(module, exports) { /** * Convert array of 16 byte values to UUID string format of the form: * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */ var byteToHex = []; for (var i = 0; i < 256; ++i) { byteToHex[i] = (i + 0x100).toString(16).substr(1); } function bytesToUuid(buf, offset) { var i = offset || 0; var bth = byteToHex; // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4 return ([bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]]]).join(''); } module.exports = bytesToUuid; /***/ }), /* 261 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var url = __webpack_require__(83) var qs = __webpack_require__(183) var caseless = __webpack_require__(161) var uuid = __webpack_require__(258) var oauth = __webpack_require__(262) var crypto = __webpack_require__(94) var Buffer = __webpack_require__(95).Buffer function OAuth (request) { this.request = request this.params = null } OAuth.prototype.buildParams = function (_oauth, uri, method, query, form, qsLib) { var oa = {} for (var i in _oauth) { oa['oauth_' + i] = _oauth[i] } if (!oa.oauth_version) { oa.oauth_version = '1.0' } if (!oa.oauth_timestamp) { oa.oauth_timestamp = Math.floor(Date.now() / 1000).toString() } if (!oa.oauth_nonce) { oa.oauth_nonce = uuid().replace(/-/g, '') } if (!oa.oauth_signature_method) { oa.oauth_signature_method = 'HMAC-SHA1' } var consumer_secret_or_private_key = oa.oauth_consumer_secret || oa.oauth_private_key // eslint-disable-line camelcase delete oa.oauth_consumer_secret delete oa.oauth_private_key var token_secret = oa.oauth_token_secret // eslint-disable-line camelcase delete oa.oauth_token_secret var realm = oa.oauth_realm delete oa.oauth_realm delete oa.oauth_transport_method var baseurl = uri.protocol + '//' + uri.host + uri.pathname var params = qsLib.parse([].concat(query, form, qsLib.stringify(oa)).join('&')) oa.oauth_signature = oauth.sign( oa.oauth_signature_method, method, baseurl, params, consumer_secret_or_private_key, // eslint-disable-line camelcase token_secret // eslint-disable-line camelcase ) if (realm) { oa.realm = realm } return oa } OAuth.prototype.buildBodyHash = function (_oauth, body) { if (['HMAC-SHA1', 'RSA-SHA1'].indexOf(_oauth.signature_method || 'HMAC-SHA1') < 0) { this.request.emit('error', new Error('oauth: ' + _oauth.signature_method + ' signature_method not supported with body_hash signing.')) } var shasum = crypto.createHash('sha1') shasum.update(body || '') var sha1 = shasum.digest('hex') return Buffer.from(sha1, 'hex').toString('base64') } OAuth.prototype.concatParams = function (oa, sep, wrap) { wrap = wrap || '' var params = Object.keys(oa).filter(function (i) { return i !== 'realm' && i !== 'oauth_signature' }).sort() if (oa.realm) { params.splice(0, 0, 'realm') } params.push('oauth_signature') return params.map(function (i) { return i + '=' + wrap + oauth.rfc3986(oa[i]) + wrap }).join(sep) } OAuth.prototype.onRequest = function (_oauth) { var self = this self.params = _oauth var uri = self.request.uri || {} var method = self.request.method || '' var headers = caseless(self.request.headers) var body = self.request.body || '' var qsLib = self.request.qsLib || qs var form var query var contentType = headers.get('content-type') || '' var formContentType = 'application/x-www-form-urlencoded' var transport = _oauth.transport_method || 'header' if (contentType.slice(0, formContentType.length) === formContentType) { contentType = formContentType form = body } if (uri.query) { query = uri.query } if (transport === 'body' && (method !== 'POST' || contentType !== formContentType)) { self.request.emit('error', new Error('oauth: transport_method of body requires POST ' + 'and content-type ' + formContentType)) } if (!form && typeof _oauth.body_hash === 'boolean') { _oauth.body_hash = self.buildBodyHash(_oauth, self.request.body.toString()) } var oa = self.buildParams(_oauth, uri, method, query, form, qsLib) switch (transport) { case 'header': self.request.setHeader('Authorization', 'OAuth ' + self.concatParams(oa, ',', '"')) break case 'query': var href = self.request.uri.href += (query ? '&' : '?') + self.concatParams(oa, '&') self.request.uri = url.parse(href) self.request.path = self.request.uri.path break case 'body': self.request.body = (form ? form + '&' : '') + self.concatParams(oa, '&') break default: self.request.emit('error', new Error('oauth: transport_method invalid')) } } exports.OAuth = OAuth /***/ }), /* 262 */ /***/ (function(module, exports, __webpack_require__) { var crypto = __webpack_require__(94) function sha (key, body, algorithm) { return crypto.createHmac(algorithm, key).update(body).digest('base64') } function rsa (key, body) { return crypto.createSign('RSA-SHA1').update(body).sign(key, 'base64') } function rfc3986 (str) { return encodeURIComponent(str) .replace(/!/g,'%21') .replace(/\*/g,'%2A') .replace(/\(/g,'%28') .replace(/\)/g,'%29') .replace(/'/g,'%27') } // Maps object to bi-dimensional array // Converts { foo: 'A', bar: [ 'b', 'B' ]} to // [ ['foo', 'A'], ['bar', 'b'], ['bar', 'B'] ] function map (obj) { var key, val, arr = [] for (key in obj) { val = obj[key] if (Array.isArray(val)) for (var i = 0; i < val.length; i++) arr.push([key, val[i]]) else if (typeof val === 'object') for (var prop in val) arr.push([key + '[' + prop + ']', val[prop]]) else arr.push([key, val]) } return arr } // Compare function for sort function compare (a, b) { return a > b ? 1 : a < b ? -1 : 0 } function generateBase (httpMethod, base_uri, params) { // adapted from https://dev.twitter.com/docs/auth/oauth and // https://dev.twitter.com/docs/auth/creating-signature // Parameter normalization // http://tools.ietf.org/html/rfc5849#section-3.4.1.3.2 var normalized = map(params) // 1. First, the name and value of each parameter are encoded .map(function (p) { return [ rfc3986(p[0]), rfc3986(p[1] || '') ] }) // 2. The parameters are sorted by name, using ascending byte value // ordering. If two or more parameters share the same name, they // are sorted by their value. .sort(function (a, b) { return compare(a[0], b[0]) || compare(a[1], b[1]) }) // 3. The name of each parameter is concatenated to its corresponding // value using an "=" character (ASCII code 61) as a separator, even // if the value is empty. .map(function (p) { return p.join('=') }) // 4. The sorted name/value pairs are concatenated together into a // single string by using an "&" character (ASCII code 38) as // separator. .join('&') var base = [ rfc3986(httpMethod ? httpMethod.toUpperCase() : 'GET'), rfc3986(base_uri), rfc3986(normalized) ].join('&') return base } function hmacsign (httpMethod, base_uri, params, consumer_secret, token_secret) { var base = generateBase(httpMethod, base_uri, params) var key = [ consumer_secret || '', token_secret || '' ].map(rfc3986).join('&') return sha(key, base, 'sha1') } function hmacsign256 (httpMethod, base_uri, params, consumer_secret, token_secret) { var base = generateBase(httpMethod, base_uri, params) var key = [ consumer_secret || '', token_secret || '' ].map(rfc3986).join('&') return sha(key, base, 'sha256') } function rsasign (httpMethod, base_uri, params, private_key, token_secret) { var base = generateBase(httpMethod, base_uri, params) var key = private_key || '' return rsa(key, base) } function plaintext (consumer_secret, token_secret) { var key = [ consumer_secret || '', token_secret || '' ].map(rfc3986).join('&') return key } function sign (signMethod, httpMethod, base_uri, params, consumer_secret, token_secret) { var method var skipArgs = 1 switch (signMethod) { case 'RSA-SHA1': method = rsasign break case 'HMAC-SHA1': method = hmacsign break case 'HMAC-SHA256': method = hmacsign256 break case 'PLAINTEXT': method = plaintext skipArgs = 4 break default: throw new Error('Signature method not supported: ' + signMethod) } return method.apply(null, [].slice.call(arguments, skipArgs)) } exports.hmacsign = hmacsign exports.hmacsign256 = hmacsign256 exports.rsasign = rsasign exports.plaintext = plaintext exports.sign = sign exports.rfc3986 = rfc3986 exports.generateBase = generateBase /***/ }), /* 263 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var crypto = __webpack_require__(94) function randomString (size) { var bits = (size + 1) * 6 var buffer = crypto.randomBytes(Math.ceil(bits / 8)) var string = buffer.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '') return string.slice(0, size) } function calculatePayloadHash (payload, algorithm, contentType) { var hash = crypto.createHash(algorithm) hash.update('hawk.1.payload\n') hash.update((contentType ? contentType.split(';')[0].trim().toLowerCase() : '') + '\n') hash.update(payload || '') hash.update('\n') return hash.digest('base64') } exports.calculateMac = function (credentials, opts) { var normalized = 'hawk.1.header\n' + opts.ts + '\n' + opts.nonce + '\n' + (opts.method || '').toUpperCase() + '\n' + opts.resource + '\n' + opts.host.toLowerCase() + '\n' + opts.port + '\n' + (opts.hash || '') + '\n' if (opts.ext) { normalized = normalized + opts.ext.replace('\\', '\\\\').replace('\n', '\\n') } normalized = normalized + '\n' if (opts.app) { normalized = normalized + opts.app + '\n' + (opts.dlg || '') + '\n' } var hmac = crypto.createHmac(credentials.algorithm, credentials.key).update(normalized) var digest = hmac.digest('base64') return digest } exports.header = function (uri, method, opts) { var timestamp = opts.timestamp || Math.floor((Date.now() + (opts.localtimeOffsetMsec || 0)) / 1000) var credentials = opts.credentials if (!credentials || !credentials.id || !credentials.key || !credentials.algorithm) { return '' } if (['sha1', 'sha256'].indexOf(credentials.algorithm) === -1) { return '' } var artifacts = { ts: timestamp, nonce: opts.nonce || randomString(6), method: method, resource: uri.pathname + (uri.search || ''), host: uri.hostname, port: uri.port || (uri.protocol === 'http:' ? 80 : 443), hash: opts.hash, ext: opts.ext, app: opts.app, dlg: opts.dlg } if (!artifacts.hash && (opts.payload || opts.payload === '')) { artifacts.hash = calculatePayloadHash(opts.payload, credentials.algorithm, opts.contentType) } var mac = exports.calculateMac(credentials, artifacts) var hasExt = artifacts.ext !== null && artifacts.ext !== undefined && artifacts.ext !== '' var header = 'Hawk id="' + credentials.id + '", ts="' + artifacts.ts + '", nonce="' + artifacts.nonce + (artifacts.hash ? '", hash="' + artifacts.hash : '') + (hasExt ? '", ext="' + artifacts.ext.replace(/\\/g, '\\\\').replace(/"/g, '\\"') : '') + '", mac="' + mac + '"' if (artifacts.app) { header = header + ', app="' + artifacts.app + (artifacts.dlg ? '", dlg="' + artifacts.dlg : '') + '"' } return header } /***/ }), /* 264 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uuid = __webpack_require__(258) var CombinedStream = __webpack_require__(165) var isstream = __webpack_require__(179) var Buffer = __webpack_require__(95).Buffer function Multipart (request) { this.request = request this.boundary = uuid() this.chunked = false this.body = null } Multipart.prototype.isChunked = function (options) { var self = this var chunked = false var parts = options.data || options if (!parts.forEach) { self.request.emit('error', new Error('Argument error, options.multipart.')) } if (options.chunked !== undefined) { chunked = options.chunked } if (self.request.getHeader('transfer-encoding') === 'chunked') { chunked = true } if (!chunked) { parts.forEach(function (part) { if (typeof part.body === 'undefined') { self.request.emit('error', new Error('Body attribute missing in multipart.')) } if (isstream(part.body)) { chunked = true } }) } return chunked } Multipart.prototype.setHeaders = function (chunked) { var self = this if (chunked && !self.request.hasHeader('transfer-encoding')) { self.request.setHeader('transfer-encoding', 'chunked') } var header = self.request.getHeader('content-type') if (!header || header.indexOf('multipart') === -1) { self.request.setHeader('content-type', 'multipart/related; boundary=' + self.boundary) } else { if (header.indexOf('boundary') !== -1) { self.boundary = header.replace(/.*boundary=([^\s;]+).*/, '$1') } else { self.request.setHeader('content-type', header + '; boundary=' + self.boundary) } } } Multipart.prototype.build = function (parts, chunked) { var self = this var body = chunked ? new CombinedStream() : [] function add (part) { if (typeof part === 'number') { part = part.toString() } return chunked ? body.append(part) : body.push(Buffer.from(part)) } if (self.request.preambleCRLF) { add('\r\n') } parts.forEach(function (part) { var preamble = '--' + self.boundary + '\r\n' Object.keys(part).forEach(function (key) { if (key === 'body') { return } preamble += key + ': ' + part[key] + '\r\n' }) preamble += '\r\n' add(preamble) add(part.body) add('\r\n') }) add('--' + self.boundary + '--') if (self.request.postambleCRLF) { add('\r\n') } return body } Multipart.prototype.onRequest = function (options) { var self = this var chunked = self.isChunked(options) var parts = options.data || options self.setHeaders(chunked) self.chunked = chunked self.body = self.build(parts, chunked) } exports.Multipart = Multipart /***/ }), /* 265 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var url = __webpack_require__(83) var isUrl = /^https?:/ function Redirect (request) { this.request = request this.followRedirect = true this.followRedirects = true this.followAllRedirects = false this.followOriginalHttpMethod = false this.allowRedirect = function () { return true } this.maxRedirects = 10 this.redirects = [] this.redirectsFollowed = 0 this.removeRefererHeader = false } Redirect.prototype.onRequest = function (options) { var self = this if (options.maxRedirects !== undefined) { self.maxRedirects = options.maxRedirects } if (typeof options.followRedirect === 'function') { self.allowRedirect = options.followRedirect } if (options.followRedirect !== undefined) { self.followRedirects = !!options.followRedirect } if (options.followAllRedirects !== undefined) { self.followAllRedirects = options.followAllRedirects } if (self.followRedirects || self.followAllRedirects) { self.redirects = self.redirects || [] } if (options.removeRefererHeader !== undefined) { self.removeRefererHeader = options.removeRefererHeader } if (options.followOriginalHttpMethod !== undefined) { self.followOriginalHttpMethod = options.followOriginalHttpMethod } } Redirect.prototype.redirectTo = function (response) { var self = this var request = self.request var redirectTo = null if (response.statusCode >= 300 && response.statusCode < 400 && response.caseless.has('location')) { var location = response.caseless.get('location') request.debug('redirect', location) if (self.followAllRedirects) { redirectTo = location } else if (self.followRedirects) { switch (request.method) { case 'PATCH': case 'PUT': case 'POST': case 'DELETE': // Do not follow redirects break default: redirectTo = location break } } } else if (response.statusCode === 401) { var authHeader = request._auth.onResponse(response) if (authHeader) { request.setHeader('authorization', authHeader) redirectTo = request.uri } } return redirectTo } Redirect.prototype.onResponse = function (response) { var self = this var request = self.request var redirectTo = self.redirectTo(response) if (!redirectTo || !self.allowRedirect.call(request, response)) { return false } request.debug('redirect to', redirectTo) // ignore any potential response body. it cannot possibly be useful // to us at this point. // response.resume should be defined, but check anyway before calling. Workaround for browserify. if (response.resume) { response.resume() } if (self.redirectsFollowed >= self.maxRedirects) { request.emit('error', new Error('Exceeded maxRedirects. Probably stuck in a redirect loop ' + request.uri.href)) return false } self.redirectsFollowed += 1 if (!isUrl.test(redirectTo)) { redirectTo = url.resolve(request.uri.href, redirectTo) } var uriPrev = request.uri request.uri = url.parse(redirectTo) // handle the case where we change protocol from https to http or vice versa if (request.uri.protocol !== uriPrev.protocol) { delete request.agent } self.redirects.push({ statusCode: response.statusCode, redirectUri: redirectTo }) if (self.followAllRedirects && request.method !== 'HEAD' && response.statusCode !== 401 && response.statusCode !== 307) { request.method = self.followOriginalHttpMethod ? request.method : 'GET' } // request.method = 'GET' // Force all redirects to use GET || commented out fixes #215 delete request.src delete request.req delete request._started if (response.statusCode !== 401 && response.statusCode !== 307) { // Remove parameters from the previous response, unless this is the second request // for a server that requires digest authentication. delete request.body delete request._form if (request.headers) { request.removeHeader('host') request.removeHeader('content-type') request.removeHeader('content-length') if (request.uri.hostname !== request.originalHost.split(':')[0]) { // Remove authorization if changing hostnames (but not if just // changing ports or protocols). This matches the behavior of curl: // https://github.com/bagder/curl/blob/6beb0eee/lib/http.c#L710 request.removeHeader('authorization') } } } if (!self.removeRefererHeader) { request.setHeader('referer', uriPrev.href) } request.emit('redirect') request.init() return true } exports.Redirect = Redirect /***/ }), /* 266 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var url = __webpack_require__(83) var tunnel = __webpack_require__(267) var defaultProxyHeaderWhiteList = [ 'accept', 'accept-charset', 'accept-encoding', 'accept-language', 'accept-ranges', 'cache-control', 'content-encoding', 'content-language', 'content-location', 'content-md5', 'content-range', 'content-type', 'connection', 'date', 'expect', 'max-forwards', 'pragma', 'referer', 'te', 'user-agent', 'via' ] var defaultProxyHeaderExclusiveList = [ 'proxy-authorization' ] function constructProxyHost (uriObject) { var port = uriObject.port var protocol = uriObject.protocol var proxyHost = uriObject.hostname + ':' if (port) { proxyHost += port } else if (protocol === 'https:') { proxyHost += '443' } else { proxyHost += '80' } return proxyHost } function constructProxyHeaderWhiteList (headers, proxyHeaderWhiteList) { var whiteList = proxyHeaderWhiteList .reduce(function (set, header) { set[header.toLowerCase()] = true return set }, {}) return Object.keys(headers) .filter(function (header) { return whiteList[header.toLowerCase()] }) .reduce(function (set, header) { set[header] = headers[header] return set }, {}) } function constructTunnelOptions (request, proxyHeaders) { var proxy = request.proxy var tunnelOptions = { proxy: { host: proxy.hostname, port: +proxy.port, proxyAuth: proxy.auth, headers: proxyHeaders }, headers: request.headers, ca: request.ca, cert: request.cert, key: request.key, passphrase: request.passphrase, pfx: request.pfx, ciphers: request.ciphers, rejectUnauthorized: request.rejectUnauthorized, secureOptions: request.secureOptions, secureProtocol: request.secureProtocol } return tunnelOptions } function constructTunnelFnName (uri, proxy) { var uriProtocol = (uri.protocol === 'https:' ? 'https' : 'http') var proxyProtocol = (proxy.protocol === 'https:' ? 'Https' : 'Http') return [uriProtocol, proxyProtocol].join('Over') } function getTunnelFn (request) { var uri = request.uri var proxy = request.proxy var tunnelFnName = constructTunnelFnName(uri, proxy) return tunnel[tunnelFnName] } function Tunnel (request) { this.request = request this.proxyHeaderWhiteList = defaultProxyHeaderWhiteList this.proxyHeaderExclusiveList = [] if (typeof request.tunnel !== 'undefined') { this.tunnelOverride = request.tunnel } } Tunnel.prototype.isEnabled = function () { var self = this var request = self.request // Tunnel HTTPS by default. Allow the user to override this setting. // If self.tunnelOverride is set (the user specified a value), use it. if (typeof self.tunnelOverride !== 'undefined') { return self.tunnelOverride } // If the destination is HTTPS, tunnel. if (request.uri.protocol === 'https:') { return true } // Otherwise, do not use tunnel. return false } Tunnel.prototype.setup = function (options) { var self = this var request = self.request options = options || {} if (typeof request.proxy === 'string') { request.proxy = url.parse(request.proxy) } if (!request.proxy || !request.tunnel) { return false } // Setup Proxy Header Exclusive List and White List if (options.proxyHeaderWhiteList) { self.proxyHeaderWhiteList = options.proxyHeaderWhiteList } if (options.proxyHeaderExclusiveList) { self.proxyHeaderExclusiveList = options.proxyHeaderExclusiveList } var proxyHeaderExclusiveList = self.proxyHeaderExclusiveList.concat(defaultProxyHeaderExclusiveList) var proxyHeaderWhiteList = self.proxyHeaderWhiteList.concat(proxyHeaderExclusiveList) // Setup Proxy Headers and Proxy Headers Host // Only send the Proxy White Listed Header names var proxyHeaders = constructProxyHeaderWhiteList(request.headers, proxyHeaderWhiteList) proxyHeaders.host = constructProxyHost(request.uri) proxyHeaderExclusiveList.forEach(request.removeHeader, request) // Set Agent from Tunnel Data var tunnelFn = getTunnelFn(request) var tunnelOptions = constructTunnelOptions(request, proxyHeaders) request.agent = tunnelFn(tunnelOptions) return true } Tunnel.defaultProxyHeaderWhiteList = defaultProxyHeaderWhiteList Tunnel.defaultProxyHeaderExclusiveList = defaultProxyHeaderExclusiveList exports.Tunnel = Tunnel /***/ }), /* 267 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var net = __webpack_require__(82) , tls = __webpack_require__(163) , http = __webpack_require__(98) , https = __webpack_require__(99) , events = __webpack_require__(268) , assert = __webpack_require__(109) , util = __webpack_require__(9) , Buffer = __webpack_require__(95).Buffer ; exports.httpOverHttp = httpOverHttp exports.httpsOverHttp = httpsOverHttp exports.httpOverHttps = httpOverHttps exports.httpsOverHttps = httpsOverHttps function httpOverHttp(options) { var agent = new TunnelingAgent(options) agent.request = http.request return agent } function httpsOverHttp(options) { var agent = new TunnelingAgent(options) agent.request = http.request agent.createSocket = createSecureSocket agent.defaultPort = 443 return agent } function httpOverHttps(options) { var agent = new TunnelingAgent(options) agent.request = https.request return agent } function httpsOverHttps(options) { var agent = new TunnelingAgent(options) agent.request = https.request agent.createSocket = createSecureSocket agent.defaultPort = 443 return agent } function TunnelingAgent(options) { var self = this self.options = options || {} self.proxyOptions = self.options.proxy || {} self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets self.requests = [] self.sockets = [] self.on('free', function onFree(socket, host, port) { for (var i = 0, len = self.requests.length; i < len; ++i) { var pending = self.requests[i] if (pending.host === host && pending.port === port) { // Detect the request to connect same origin server, // reuse the connection. self.requests.splice(i, 1) pending.request.onSocket(socket) return } } socket.destroy() self.removeSocket(socket) }) } util.inherits(TunnelingAgent, events.EventEmitter) TunnelingAgent.prototype.addRequest = function addRequest(req, options) { var self = this // Legacy API: addRequest(req, host, port, path) if (typeof options === 'string') { options = { host: options, port: arguments[2], path: arguments[3] }; } if (self.sockets.length >= this.maxSockets) { // We are over limit so we'll add it to the queue. self.requests.push({host: options.host, port: options.port, request: req}) return } // If we are under maxSockets create a new one. self.createConnection({host: options.host, port: options.port, request: req}) } TunnelingAgent.prototype.createConnection = function createConnection(pending) { var self = this self.createSocket(pending, function(socket) { socket.on('free', onFree) socket.on('close', onCloseOrRemove) socket.on('agentRemove', onCloseOrRemove) pending.request.onSocket(socket) function onFree() { self.emit('free', socket, pending.host, pending.port) } function onCloseOrRemove(err) { self.removeSocket(socket) socket.removeListener('free', onFree) socket.removeListener('close', onCloseOrRemove) socket.removeListener('agentRemove', onCloseOrRemove) } }) } TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { var self = this var placeholder = {} self.sockets.push(placeholder) var connectOptions = mergeOptions({}, self.proxyOptions, { method: 'CONNECT' , path: options.host + ':' + options.port , agent: false } ) if (connectOptions.proxyAuth) { connectOptions.headers = connectOptions.headers || {} connectOptions.headers['Proxy-Authorization'] = 'Basic ' + Buffer.from(connectOptions.proxyAuth).toString('base64') } debug('making CONNECT request') var connectReq = self.request(connectOptions) connectReq.useChunkedEncodingByDefault = false // for v0.6 connectReq.once('response', onResponse) // for v0.6 connectReq.once('upgrade', onUpgrade) // for v0.6 connectReq.once('connect', onConnect) // for v0.7 or later connectReq.once('error', onError) connectReq.end() function onResponse(res) { // Very hacky. This is necessary to avoid http-parser leaks. res.upgrade = true } function onUpgrade(res, socket, head) { // Hacky. process.nextTick(function() { onConnect(res, socket, head) }) } function onConnect(res, socket, head) { connectReq.removeAllListeners() socket.removeAllListeners() if (res.statusCode === 200) { assert.equal(head.length, 0) debug('tunneling connection has established') self.sockets[self.sockets.indexOf(placeholder)] = socket cb(socket) } else { debug('tunneling socket could not be established, statusCode=%d', res.statusCode) var error = new Error('tunneling socket could not be established, ' + 'statusCode=' + res.statusCode) error.code = 'ECONNRESET' options.request.emit('error', error) self.removeSocket(placeholder) } } function onError(cause) { connectReq.removeAllListeners() debug('tunneling socket could not be established, cause=%s\n', cause.message, cause.stack) var error = new Error('tunneling socket could not be established, ' + 'cause=' + cause.message) error.code = 'ECONNRESET' options.request.emit('error', error) self.removeSocket(placeholder) } } TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { var pos = this.sockets.indexOf(socket) if (pos === -1) return this.sockets.splice(pos, 1) var pending = this.requests.shift() if (pending) { // If we have pending requests and a socket gets closed a new one // needs to be created to take over in the pool for the one that closed. this.createConnection(pending) } } function createSecureSocket(options, cb) { var self = this TunnelingAgent.prototype.createSocket.call(self, options, function(socket) { // 0 is dummy port for v0.6 var secureSocket = tls.connect(0, mergeOptions({}, self.options, { servername: options.host , socket: socket } )) self.sockets[self.sockets.indexOf(socket)] = secureSocket cb(secureSocket) }) } function mergeOptions(target) { for (var i = 1, len = arguments.length; i < len; ++i) { var overrides = arguments[i] if (typeof overrides === 'object') { var keys = Object.keys(overrides) for (var j = 0, keyLen = keys.length; j < keyLen; ++j) { var k = keys[j] if (overrides[k] !== undefined) { target[k] = overrides[k] } } } } return target } var debug if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { debug = function() { var args = Array.prototype.slice.call(arguments) if (typeof args[0] === 'string') { args[0] = 'TUNNEL: ' + args[0] } else { args.unshift('TUNNEL:') } console.error.apply(console, args) } } else { debug = function() {} } exports.debug = debug // for test /***/ }), /* 268 */ /***/ (function(module, exports) { module.exports = require("events"); /***/ }), /* 269 */ /***/ (function(module, exports) { // Generated by CoffeeScript 1.12.2 (function() { var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime; if ((typeof performance !== "undefined" && performance !== null) && performance.now) { module.exports = function() { return performance.now(); }; } else if ((typeof process !== "undefined" && process !== null) && process.hrtime) { module.exports = function() { return (getNanoSeconds() - nodeLoadTime) / 1e6; }; hrtime = process.hrtime; getNanoSeconds = function() { var hr; hr = hrtime(); return hr[0] * 1e9 + hr[1]; }; moduleLoadTime = getNanoSeconds(); upTime = process.uptime() * 1e9; nodeLoadTime = moduleLoadTime - upTime; } else if (Date.now) { module.exports = function() { return Date.now() - loadTime; }; loadTime = Date.now(); } else { module.exports = function() { return new Date().getTime() - loadTime; }; loadTime = new Date().getTime(); } }).call(this); //# sourceMappingURL=performance-now.js.map /***/ }), /* 270 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * Copyright (c) 2015, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ var net = __webpack_require__(82); var urlParse = __webpack_require__(83).parse; var util = __webpack_require__(9); var pubsuffix = __webpack_require__(271); var Store = __webpack_require__(272).Store; var MemoryCookieStore = __webpack_require__(273).MemoryCookieStore; var pathMatch = __webpack_require__(275).pathMatch; var VERSION = __webpack_require__(276); var punycode; try { punycode = __webpack_require__(86); } catch(e) { console.warn("tough-cookie: can't load punycode; won't use punycode for domain normalization"); } // From RFC6265 S4.1.1 // note that it excludes \x3B ";" var COOKIE_OCTETS = /^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]+$/; var CONTROL_CHARS = /[\x00-\x1F]/; // From Chromium // '\r', '\n' and '\0' should be treated as a terminator in // the "relaxed" mode, see: // https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L60 var TERMINATORS = ['\n', '\r', '\0']; // RFC6265 S4.1.1 defines path value as 'any CHAR except CTLs or ";"' // Note ';' is \x3B var PATH_VALUE = /[\x20-\x3A\x3C-\x7E]+/; // date-time parsing constants (RFC6265 S5.1.1) var DATE_DELIM = /[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]/; var MONTH_TO_NUM = { jan:0, feb:1, mar:2, apr:3, may:4, jun:5, jul:6, aug:7, sep:8, oct:9, nov:10, dec:11 }; var NUM_TO_MONTH = [ 'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec' ]; var NUM_TO_DAY = [ 'Sun','Mon','Tue','Wed','Thu','Fri','Sat' ]; var MAX_TIME = 2147483647000; // 31-bit max var MIN_TIME = 0; // 31-bit min /* * Parses a Natural number (i.e., non-negative integer) with either the * <min>*<max>DIGIT ( non-digit *OCTET ) * or * <min>*<max>DIGIT * grammar (RFC6265 S5.1.1). * * The "trailingOK" boolean controls if the grammar accepts a * "( non-digit *OCTET )" trailer. */ function parseDigits(token, minDigits, maxDigits, trailingOK) { var count = 0; while (count < token.length) { var c = token.charCodeAt(count); // "non-digit = %x00-2F / %x3A-FF" if (c <= 0x2F || c >= 0x3A) { break; } count++; } // constrain to a minimum and maximum number of digits. if (count < minDigits || count > maxDigits) { return null; } if (!trailingOK && count != token.length) { return null; } return parseInt(token.substr(0,count), 10); } function parseTime(token) { var parts = token.split(':'); var result = [0,0,0]; /* RF6256 S5.1.1: * time = hms-time ( non-digit *OCTET ) * hms-time = time-field ":" time-field ":" time-field * time-field = 1*2DIGIT */ if (parts.length !== 3) { return null; } for (var i = 0; i < 3; i++) { // "time-field" must be strictly "1*2DIGIT", HOWEVER, "hms-time" can be // followed by "( non-digit *OCTET )" so therefore the last time-field can // have a trailer var trailingOK = (i == 2); var num = parseDigits(parts[i], 1, 2, trailingOK); if (num === null) { return null; } result[i] = num; } return result; } function parseMonth(token) { token = String(token).substr(0,3).toLowerCase(); var num = MONTH_TO_NUM[token]; return num >= 0 ? num : null; } /* * RFC6265 S5.1.1 date parser (see RFC for full grammar) */ function parseDate(str) { if (!str) { return; } /* RFC6265 S5.1.1: * 2. Process each date-token sequentially in the order the date-tokens * appear in the cookie-date */ var tokens = str.split(DATE_DELIM); if (!tokens) { return; } var hour = null; var minute = null; var second = null; var dayOfMonth = null; var month = null; var year = null; for (var i=0; i<tokens.length; i++) { var token = tokens[i].trim(); if (!token.length) { continue; } var result; /* 2.1. If the found-time flag is not set and the token matches the time * production, set the found-time flag and set the hour- value, * minute-value, and second-value to the numbers denoted by the digits in * the date-token, respectively. Skip the remaining sub-steps and continue * to the next date-token. */ if (second === null) { result = parseTime(token); if (result) { hour = result[0]; minute = result[1]; second = result[2]; continue; } } /* 2.2. If the found-day-of-month flag is not set and the date-token matches * the day-of-month production, set the found-day-of- month flag and set * the day-of-month-value to the number denoted by the date-token. Skip * the remaining sub-steps and continue to the next date-token. */ if (dayOfMonth === null) { // "day-of-month = 1*2DIGIT ( non-digit *OCTET )" result = parseDigits(token, 1, 2, true); if (result !== null) { dayOfMonth = result; continue; } } /* 2.3. If the found-month flag is not set and the date-token matches the * month production, set the found-month flag and set the month-value to * the month denoted by the date-token. Skip the remaining sub-steps and * continue to the next date-token. */ if (month === null) { result = parseMonth(token); if (result !== null) { month = result; continue; } } /* 2.4. If the found-year flag is not set and the date-token matches the * year production, set the found-year flag and set the year-value to the * number denoted by the date-token. Skip the remaining sub-steps and * continue to the next date-token. */ if (year === null) { // "year = 2*4DIGIT ( non-digit *OCTET )" result = parseDigits(token, 2, 4, true); if (result !== null) { year = result; /* From S5.1.1: * 3. If the year-value is greater than or equal to 70 and less * than or equal to 99, increment the year-value by 1900. * 4. If the year-value is greater than or equal to 0 and less * than or equal to 69, increment the year-value by 2000. */ if (year >= 70 && year <= 99) { year += 1900; } else if (year >= 0 && year <= 69) { year += 2000; } } } } /* RFC 6265 S5.1.1 * "5. Abort these steps and fail to parse the cookie-date if: * * at least one of the found-day-of-month, found-month, found- * year, or found-time flags is not set, * * the day-of-month-value is less than 1 or greater than 31, * * the year-value is less than 1601, * * the hour-value is greater than 23, * * the minute-value is greater than 59, or * * the second-value is greater than 59. * (Note that leap seconds cannot be represented in this syntax.)" * * So, in order as above: */ if ( dayOfMonth === null || month === null || year === null || second === null || dayOfMonth < 1 || dayOfMonth > 31 || year < 1601 || hour > 23 || minute > 59 || second > 59 ) { return; } return new Date(Date.UTC(year, month, dayOfMonth, hour, minute, second)); } function formatDate(date) { var d = date.getUTCDate(); d = d >= 10 ? d : '0'+d; var h = date.getUTCHours(); h = h >= 10 ? h : '0'+h; var m = date.getUTCMinutes(); m = m >= 10 ? m : '0'+m; var s = date.getUTCSeconds(); s = s >= 10 ? s : '0'+s; return NUM_TO_DAY[date.getUTCDay()] + ', ' + d+' '+ NUM_TO_MONTH[date.getUTCMonth()] +' '+ date.getUTCFullYear() +' '+ h+':'+m+':'+s+' GMT'; } // S5.1.2 Canonicalized Host Names function canonicalDomain(str) { if (str == null) { return null; } str = str.trim().replace(/^\./,''); // S4.1.2.3 & S5.2.3: ignore leading . // convert to IDN if any non-ASCII characters if (punycode && /[^\u0001-\u007f]/.test(str)) { str = punycode.toASCII(str); } return str.toLowerCase(); } // S5.1.3 Domain Matching function domainMatch(str, domStr, canonicalize) { if (str == null || domStr == null) { return null; } if (canonicalize !== false) { str = canonicalDomain(str); domStr = canonicalDomain(domStr); } /* * "The domain string and the string are identical. (Note that both the * domain string and the string will have been canonicalized to lower case at * this point)" */ if (str == domStr) { return true; } /* "All of the following [three] conditions hold:" (order adjusted from the RFC) */ /* "* The string is a host name (i.e., not an IP address)." */ if (net.isIP(str)) { return false; } /* "* The domain string is a suffix of the string" */ var idx = str.indexOf(domStr); if (idx <= 0) { return false; // it's a non-match (-1) or prefix (0) } // e.g "a.b.c".indexOf("b.c") === 2 // 5 === 3+2 if (str.length !== domStr.length + idx) { // it's not a suffix return false; } /* "* The last character of the string that is not included in the domain * string is a %x2E (".") character." */ if (str.substr(idx-1,1) !== '.') { return false; } return true; } // RFC6265 S5.1.4 Paths and Path-Match /* * "The user agent MUST use an algorithm equivalent to the following algorithm * to compute the default-path of a cookie:" * * Assumption: the path (and not query part or absolute uri) is passed in. */ function defaultPath(path) { // "2. If the uri-path is empty or if the first character of the uri-path is not // a %x2F ("/") character, output %x2F ("/") and skip the remaining steps. if (!path || path.substr(0,1) !== "/") { return "/"; } // "3. If the uri-path contains no more than one %x2F ("/") character, output // %x2F ("/") and skip the remaining step." if (path === "/") { return path; } var rightSlash = path.lastIndexOf("/"); if (rightSlash === 0) { return "/"; } // "4. Output the characters of the uri-path from the first character up to, // but not including, the right-most %x2F ("/")." return path.slice(0, rightSlash); } function trimTerminator(str) { for (var t = 0; t < TERMINATORS.length; t++) { var terminatorIdx = str.indexOf(TERMINATORS[t]); if (terminatorIdx !== -1) { str = str.substr(0,terminatorIdx); } } return str; } function parseCookiePair(cookiePair, looseMode) { cookiePair = trimTerminator(cookiePair); var firstEq = cookiePair.indexOf('='); if (looseMode) { if (firstEq === 0) { // '=' is immediately at start cookiePair = cookiePair.substr(1); firstEq = cookiePair.indexOf('='); // might still need to split on '=' } } else { // non-loose mode if (firstEq <= 0) { // no '=' or is at start return; // needs to have non-empty "cookie-name" } } var cookieName, cookieValue; if (firstEq <= 0) { cookieName = ""; cookieValue = cookiePair.trim(); } else { cookieName = cookiePair.substr(0, firstEq).trim(); cookieValue = cookiePair.substr(firstEq+1).trim(); } if (CONTROL_CHARS.test(cookieName) || CONTROL_CHARS.test(cookieValue)) { return; } var c = new Cookie(); c.key = cookieName; c.value = cookieValue; return c; } function parse(str, options) { if (!options || typeof options !== 'object') { options = {}; } str = str.trim(); // We use a regex to parse the "name-value-pair" part of S5.2 var firstSemi = str.indexOf(';'); // S5.2 step 1 var cookiePair = (firstSemi === -1) ? str : str.substr(0, firstSemi); var c = parseCookiePair(cookiePair, !!options.loose); if (!c) { return; } if (firstSemi === -1) { return c; } // S5.2.3 "unparsed-attributes consist of the remainder of the set-cookie-string // (including the %x3B (";") in question)." plus later on in the same section // "discard the first ";" and trim". var unparsed = str.slice(firstSemi + 1).trim(); // "If the unparsed-attributes string is empty, skip the rest of these // steps." if (unparsed.length === 0) { return c; } /* * S5.2 says that when looping over the items "[p]rocess the attribute-name * and attribute-value according to the requirements in the following * subsections" for every item. Plus, for many of the individual attributes * in S5.3 it says to use the "attribute-value of the last attribute in the * cookie-attribute-list". Therefore, in this implementation, we overwrite * the previous value. */ var cookie_avs = unparsed.split(';'); while (cookie_avs.length) { var av = cookie_avs.shift().trim(); if (av.length === 0) { // happens if ";;" appears continue; } var av_sep = av.indexOf('='); var av_key, av_value; if (av_sep === -1) { av_key = av; av_value = null; } else { av_key = av.substr(0,av_sep); av_value = av.substr(av_sep+1); } av_key = av_key.trim().toLowerCase(); if (av_value) { av_value = av_value.trim(); } switch(av_key) { case 'expires': // S5.2.1 if (av_value) { var exp = parseDate(av_value); // "If the attribute-value failed to parse as a cookie date, ignore the // cookie-av." if (exp) { // over and underflow not realistically a concern: V8's getTime() seems to // store something larger than a 32-bit time_t (even with 32-bit node) c.expires = exp; } } break; case 'max-age': // S5.2.2 if (av_value) { // "If the first character of the attribute-value is not a DIGIT or a "-" // character ...[or]... If the remainder of attribute-value contains a // non-DIGIT character, ignore the cookie-av." if (/^-?[0-9]+$/.test(av_value)) { var delta = parseInt(av_value, 10); // "If delta-seconds is less than or equal to zero (0), let expiry-time // be the earliest representable date and time." c.setMaxAge(delta); } } break; case 'domain': // S5.2.3 // "If the attribute-value is empty, the behavior is undefined. However, // the user agent SHOULD ignore the cookie-av entirely." if (av_value) { // S5.2.3 "Let cookie-domain be the attribute-value without the leading %x2E // (".") character." var domain = av_value.trim().replace(/^\./, ''); if (domain) { // "Convert the cookie-domain to lower case." c.domain = domain.toLowerCase(); } } break; case 'path': // S5.2.4 /* * "If the attribute-value is empty or if the first character of the * attribute-value is not %x2F ("/"): * Let cookie-path be the default-path. * Otherwise: * Let cookie-path be the attribute-value." * * We'll represent the default-path as null since it depends on the * context of the parsing. */ c.path = av_value && av_value[0] === "/" ? av_value : null; break; case 'secure': // S5.2.5 /* * "If the attribute-name case-insensitively matches the string "Secure", * the user agent MUST append an attribute to the cookie-attribute-list * with an attribute-name of Secure and an empty attribute-value." */ c.secure = true; break; case 'httponly': // S5.2.6 -- effectively the same as 'secure' c.httpOnly = true; break; default: c.extensions = c.extensions || []; c.extensions.push(av); break; } } return c; } // avoid the V8 deoptimization monster! function jsonParse(str) { var obj; try { obj = JSON.parse(str); } catch (e) { return e; } return obj; } function fromJSON(str) { if (!str) { return null; } var obj; if (typeof str === 'string') { obj = jsonParse(str); if (obj instanceof Error) { return null; } } else { // assume it's an Object obj = str; } var c = new Cookie(); for (var i=0; i<Cookie.serializableProperties.length; i++) { var prop = Cookie.serializableProperties[i]; if (obj[prop] === undefined || obj[prop] === Cookie.prototype[prop]) { continue; // leave as prototype default } if (prop === 'expires' || prop === 'creation' || prop === 'lastAccessed') { if (obj[prop] === null) { c[prop] = null; } else { c[prop] = obj[prop] == "Infinity" ? "Infinity" : new Date(obj[prop]); } } else { c[prop] = obj[prop]; } } return c; } /* Section 5.4 part 2: * "* Cookies with longer paths are listed before cookies with * shorter paths. * * * Among cookies that have equal-length path fields, cookies with * earlier creation-times are listed before cookies with later * creation-times." */ function cookieCompare(a,b) { var cmp = 0; // descending for length: b CMP a var aPathLen = a.path ? a.path.length : 0; var bPathLen = b.path ? b.path.length : 0; cmp = bPathLen - aPathLen; if (cmp !== 0) { return cmp; } // ascending for time: a CMP b var aTime = a.creation ? a.creation.getTime() : MAX_TIME; var bTime = b.creation ? b.creation.getTime() : MAX_TIME; cmp = aTime - bTime; if (cmp !== 0) { return cmp; } // break ties for the same millisecond (precision of JavaScript's clock) cmp = a.creationIndex - b.creationIndex; return cmp; } // Gives the permutation of all possible pathMatch()es of a given path. The // array is in longest-to-shortest order. Handy for indexing. function permutePath(path) { if (path === '/') { return ['/']; } if (path.lastIndexOf('/') === path.length-1) { path = path.substr(0,path.length-1); } var permutations = [path]; while (path.length > 1) { var lindex = path.lastIndexOf('/'); if (lindex === 0) { break; } path = path.substr(0,lindex); permutations.push(path); } permutations.push('/'); return permutations; } function getCookieContext(url) { if (url instanceof Object) { return url; } // NOTE: decodeURI will throw on malformed URIs (see GH-32). // Therefore, we will just skip decoding for such URIs. try { url = decodeURI(url); } catch(err) { // Silently swallow error } return urlParse(url); } function Cookie(options) { options = options || {}; Object.keys(options).forEach(function(prop) { if (Cookie.prototype.hasOwnProperty(prop) && Cookie.prototype[prop] !== options[prop] && prop.substr(0,1) !== '_') { this[prop] = options[prop]; } }, this); this.creation = this.creation || new Date(); // used to break creation ties in cookieCompare(): Object.defineProperty(this, 'creationIndex', { configurable: false, enumerable: false, // important for assert.deepEqual checks writable: true, value: ++Cookie.cookiesCreated }); } Cookie.cookiesCreated = 0; // incremented each time a cookie is created Cookie.parse = parse; Cookie.fromJSON = fromJSON; Cookie.prototype.key = ""; Cookie.prototype.value = ""; // the order in which the RFC has them: Cookie.prototype.expires = "Infinity"; // coerces to literal Infinity Cookie.prototype.maxAge = null; // takes precedence over expires for TTL Cookie.prototype.domain = null; Cookie.prototype.path = null; Cookie.prototype.secure = false; Cookie.prototype.httpOnly = false; Cookie.prototype.extensions = null; // set by the CookieJar: Cookie.prototype.hostOnly = null; // boolean when set Cookie.prototype.pathIsDefault = null; // boolean when set Cookie.prototype.creation = null; // Date when set; defaulted by Cookie.parse Cookie.prototype.lastAccessed = null; // Date when set Object.defineProperty(Cookie.prototype, 'creationIndex', { configurable: true, enumerable: false, writable: true, value: 0 }); Cookie.serializableProperties = Object.keys(Cookie.prototype) .filter(function(prop) { return !( Cookie.prototype[prop] instanceof Function || prop === 'creationIndex' || prop.substr(0,1) === '_' ); }); Cookie.prototype.inspect = function inspect() { var now = Date.now(); return 'Cookie="'+this.toString() + '; hostOnly='+(this.hostOnly != null ? this.hostOnly : '?') + '; aAge='+(this.lastAccessed ? (now-this.lastAccessed.getTime())+'ms' : '?') + '; cAge='+(this.creation ? (now-this.creation.getTime())+'ms' : '?') + '"'; }; // Use the new custom inspection symbol to add the custom inspect function if // available. if (util.inspect.custom) { Cookie.prototype[util.inspect.custom] = Cookie.prototype.inspect; } Cookie.prototype.toJSON = function() { var obj = {}; var props = Cookie.serializableProperties; for (var i=0; i<props.length; i++) { var prop = props[i]; if (this[prop] === Cookie.prototype[prop]) { continue; // leave as prototype default } if (prop === 'expires' || prop === 'creation' || prop === 'lastAccessed') { if (this[prop] === null) { obj[prop] = null; } else { obj[prop] = this[prop] == "Infinity" ? // intentionally not === "Infinity" : this[prop].toISOString(); } } else if (prop === 'maxAge') { if (this[prop] !== null) { // again, intentionally not === obj[prop] = (this[prop] == Infinity || this[prop] == -Infinity) ? this[prop].toString() : this[prop]; } } else { if (this[prop] !== Cookie.prototype[prop]) { obj[prop] = this[prop]; } } } return obj; }; Cookie.prototype.clone = function() { return fromJSON(this.toJSON()); }; Cookie.prototype.validate = function validate() { if (!COOKIE_OCTETS.test(this.value)) { return false; } if (this.expires != Infinity && !(this.expires instanceof Date) && !parseDate(this.expires)) { return false; } if (this.maxAge != null && this.maxAge <= 0) { return false; // "Max-Age=" non-zero-digit *DIGIT } if (this.path != null && !PATH_VALUE.test(this.path)) { return false; } var cdomain = this.cdomain(); if (cdomain) { if (cdomain.match(/\.$/)) { return false; // S4.1.2.3 suggests that this is bad. domainMatch() tests confirm this } var suffix = pubsuffix.getPublicSuffix(cdomain); if (suffix == null) { // it's a public suffix return false; } } return true; }; Cookie.prototype.setExpires = function setExpires(exp) { if (exp instanceof Date) { this.expires = exp; } else { this.expires = parseDate(exp) || "Infinity"; } }; Cookie.prototype.setMaxAge = function setMaxAge(age) { if (age === Infinity || age === -Infinity) { this.maxAge = age.toString(); // so JSON.stringify() works } else { this.maxAge = age; } }; // gives Cookie header format Cookie.prototype.cookieString = function cookieString() { var val = this.value; if (val == null) { val = ''; } if (this.key === '') { return val; } return this.key+'='+val; }; // gives Set-Cookie header format Cookie.prototype.toString = function toString() { var str = this.cookieString(); if (this.expires != Infinity) { if (this.expires instanceof Date) { str += '; Expires='+formatDate(this.expires); } else { str += '; Expires='+this.expires; } } if (this.maxAge != null && this.maxAge != Infinity) { str += '; Max-Age='+this.maxAge; } if (this.domain && !this.hostOnly) { str += '; Domain='+this.domain; } if (this.path) { str += '; Path='+this.path; } if (this.secure) { str += '; Secure'; } if (this.httpOnly) { str += '; HttpOnly'; } if (this.extensions) { this.extensions.forEach(function(ext) { str += '; '+ext; }); } return str; }; // TTL() partially replaces the "expiry-time" parts of S5.3 step 3 (setCookie() // elsewhere) // S5.3 says to give the "latest representable date" for which we use Infinity // For "expired" we use 0 Cookie.prototype.TTL = function TTL(now) { /* RFC6265 S4.1.2.2 If a cookie has both the Max-Age and the Expires * attribute, the Max-Age attribute has precedence and controls the * expiration date of the cookie. * (Concurs with S5.3 step 3) */ if (this.maxAge != null) { return this.maxAge<=0 ? 0 : this.maxAge*1000; } var expires = this.expires; if (expires != Infinity) { if (!(expires instanceof Date)) { expires = parseDate(expires) || Infinity; } if (expires == Infinity) { return Infinity; } return expires.getTime() - (now || Date.now()); } return Infinity; }; // expiryTime() replaces the "expiry-time" parts of S5.3 step 3 (setCookie() // elsewhere) Cookie.prototype.expiryTime = function expiryTime(now) { if (this.maxAge != null) { var relativeTo = now || this.creation || new Date(); var age = (this.maxAge <= 0) ? -Infinity : this.maxAge*1000; return relativeTo.getTime() + age; } if (this.expires == Infinity) { return Infinity; } return this.expires.getTime(); }; // expiryDate() replaces the "expiry-time" parts of S5.3 step 3 (setCookie() // elsewhere), except it returns a Date Cookie.prototype.expiryDate = function expiryDate(now) { var millisec = this.expiryTime(now); if (millisec == Infinity) { return new Date(MAX_TIME); } else if (millisec == -Infinity) { return new Date(MIN_TIME); } else { return new Date(millisec); } }; // This replaces the "persistent-flag" parts of S5.3 step 3 Cookie.prototype.isPersistent = function isPersistent() { return (this.maxAge != null || this.expires != Infinity); }; // Mostly S5.1.2 and S5.2.3: Cookie.prototype.cdomain = Cookie.prototype.canonicalizedDomain = function canonicalizedDomain() { if (this.domain == null) { return null; } return canonicalDomain(this.domain); }; function CookieJar(store, options) { if (typeof options === "boolean") { options = {rejectPublicSuffixes: options}; } else if (options == null) { options = {}; } if (options.rejectPublicSuffixes != null) { this.rejectPublicSuffixes = options.rejectPublicSuffixes; } if (options.looseMode != null) { this.enableLooseMode = options.looseMode; } if (!store) { store = new MemoryCookieStore(); } this.store = store; } CookieJar.prototype.store = null; CookieJar.prototype.rejectPublicSuffixes = true; CookieJar.prototype.enableLooseMode = false; var CAN_BE_SYNC = []; CAN_BE_SYNC.push('setCookie'); CookieJar.prototype.setCookie = function(cookie, url, options, cb) { var err; var context = getCookieContext(url); if (options instanceof Function) { cb = options; options = {}; } var host = canonicalDomain(context.hostname); var loose = this.enableLooseMode; if (options.loose != null) { loose = options.loose; } // S5.3 step 1 if (!(cookie instanceof Cookie)) { cookie = Cookie.parse(cookie, { loose: loose }); } if (!cookie) { err = new Error("Cookie failed to parse"); return cb(options.ignoreError ? null : err); } // S5.3 step 2 var now = options.now || new Date(); // will assign later to save effort in the face of errors // S5.3 step 3: NOOP; persistent-flag and expiry-time is handled by getCookie() // S5.3 step 4: NOOP; domain is null by default // S5.3 step 5: public suffixes if (this.rejectPublicSuffixes && cookie.domain) { var suffix = pubsuffix.getPublicSuffix(cookie.cdomain()); if (suffix == null) { // e.g. "com" err = new Error("Cookie has domain set to a public suffix"); return cb(options.ignoreError ? null : err); } } // S5.3 step 6: if (cookie.domain) { if (!domainMatch(host, cookie.cdomain(), false)) { err = new Error("Cookie not in this host's domain. Cookie:"+cookie.cdomain()+" Request:"+host); return cb(options.ignoreError ? null : err); } if (cookie.hostOnly == null) { // don't reset if already set cookie.hostOnly = false; } } else { cookie.hostOnly = true; cookie.domain = host; } //S5.2.4 If the attribute-value is empty or if the first character of the //attribute-value is not %x2F ("/"): //Let cookie-path be the default-path. if (!cookie.path || cookie.path[0] !== '/') { cookie.path = defaultPath(context.pathname); cookie.pathIsDefault = true; } // S5.3 step 8: NOOP; secure attribute // S5.3 step 9: NOOP; httpOnly attribute // S5.3 step 10 if (options.http === false && cookie.httpOnly) { err = new Error("Cookie is HttpOnly and this isn't an HTTP API"); return cb(options.ignoreError ? null : err); } var store = this.store; if (!store.updateCookie) { store.updateCookie = function(oldCookie, newCookie, cb) { this.putCookie(newCookie, cb); }; } function withCookie(err, oldCookie) { if (err) { return cb(err); } var next = function(err) { if (err) { return cb(err); } else { cb(null, cookie); } }; if (oldCookie) { // S5.3 step 11 - "If the cookie store contains a cookie with the same name, // domain, and path as the newly created cookie:" if (options.http === false && oldCookie.httpOnly) { // step 11.2 err = new Error("old Cookie is HttpOnly and this isn't an HTTP API"); return cb(options.ignoreError ? null : err); } cookie.creation = oldCookie.creation; // step 11.3 cookie.creationIndex = oldCookie.creationIndex; // preserve tie-breaker cookie.lastAccessed = now; // Step 11.4 (delete cookie) is implied by just setting the new one: store.updateCookie(oldCookie, cookie, next); // step 12 } else { cookie.creation = cookie.lastAccessed = now; store.putCookie(cookie, next); // step 12 } } store.findCookie(cookie.domain, cookie.path, cookie.key, withCookie); }; // RFC6365 S5.4 CAN_BE_SYNC.push('getCookies'); CookieJar.prototype.getCookies = function(url, options, cb) { var context = getCookieContext(url); if (options instanceof Function) { cb = options; options = {}; } var host = canonicalDomain(context.hostname); var path = context.pathname || '/'; var secure = options.secure; if (secure == null && context.protocol && (context.protocol == 'https:' || context.protocol == 'wss:')) { secure = true; } var http = options.http; if (http == null) { http = true; } var now = options.now || Date.now(); var expireCheck = options.expire !== false; var allPaths = !!options.allPaths; var store = this.store; function matchingCookie(c) { // "Either: // The cookie's host-only-flag is true and the canonicalized // request-host is identical to the cookie's domain. // Or: // The cookie's host-only-flag is false and the canonicalized // request-host domain-matches the cookie's domain." if (c.hostOnly) { if (c.domain != host) { return false; } } else { if (!domainMatch(host, c.domain, false)) { return false; } } // "The request-uri's path path-matches the cookie's path." if (!allPaths && !pathMatch(path, c.path)) { return false; } // "If the cookie's secure-only-flag is true, then the request-uri's // scheme must denote a "secure" protocol" if (c.secure && !secure) { return false; } // "If the cookie's http-only-flag is true, then exclude the cookie if the // cookie-string is being generated for a "non-HTTP" API" if (c.httpOnly && !http) { return false; } // deferred from S5.3 // non-RFC: allow retention of expired cookies by choice if (expireCheck && c.expiryTime() <= now) { store.removeCookie(c.domain, c.path, c.key, function(){}); // result ignored return false; } return true; } store.findCookies(host, allPaths ? null : path, function(err,cookies) { if (err) { return cb(err); } cookies = cookies.filter(matchingCookie); // sorting of S5.4 part 2 if (options.sort !== false) { cookies = cookies.sort(cookieCompare); } // S5.4 part 3 var now = new Date(); cookies.forEach(function(c) { c.lastAccessed = now; }); // TODO persist lastAccessed cb(null,cookies); }); }; CAN_BE_SYNC.push('getCookieString'); CookieJar.prototype.getCookieString = function(/*..., cb*/) { var args = Array.prototype.slice.call(arguments,0); var cb = args.pop(); var next = function(err,cookies) { if (err) { cb(err); } else { cb(null, cookies .sort(cookieCompare) .map(function(c){ return c.cookieString(); }) .join('; ')); } }; args.push(next); this.getCookies.apply(this,args); }; CAN_BE_SYNC.push('getSetCookieStrings'); CookieJar.prototype.getSetCookieStrings = function(/*..., cb*/) { var args = Array.prototype.slice.call(arguments,0); var cb = args.pop(); var next = function(err,cookies) { if (err) { cb(err); } else { cb(null, cookies.map(function(c){ return c.toString(); })); } }; args.push(next); this.getCookies.apply(this,args); }; CAN_BE_SYNC.push('serialize'); CookieJar.prototype.serialize = function(cb) { var type = this.store.constructor.name; if (type === 'Object') { type = null; } // update README.md "Serialization Format" if you change this, please! var serialized = { // The version of tough-cookie that serialized this jar. Generally a good // practice since future versions can make data import decisions based on // known past behavior. When/if this matters, use `semver`. version: 'tough-cookie@'+VERSION, // add the store type, to make humans happy: storeType: type, // CookieJar configuration: rejectPublicSuffixes: !!this.rejectPublicSuffixes, // this gets filled from getAllCookies: cookies: [] }; if (!(this.store.getAllCookies && typeof this.store.getAllCookies === 'function')) { return cb(new Error('store does not support getAllCookies and cannot be serialized')); } this.store.getAllCookies(function(err,cookies) { if (err) { return cb(err); } serialized.cookies = cookies.map(function(cookie) { // convert to serialized 'raw' cookies cookie = (cookie instanceof Cookie) ? cookie.toJSON() : cookie; // Remove the index so new ones get assigned during deserialization delete cookie.creationIndex; return cookie; }); return cb(null, serialized); }); }; // well-known name that JSON.stringify calls CookieJar.prototype.toJSON = function() { return this.serializeSync(); }; // use the class method CookieJar.deserialize instead of calling this directly CAN_BE_SYNC.push('_importCookies'); CookieJar.prototype._importCookies = function(serialized, cb) { var jar = this; var cookies = serialized.cookies; if (!cookies || !Array.isArray(cookies)) { return cb(new Error('serialized jar has no cookies array')); } cookies = cookies.slice(); // do not modify the original function putNext(err) { if (err) { return cb(err); } if (!cookies.length) { return cb(err, jar); } var cookie; try { cookie = fromJSON(cookies.shift()); } catch (e) { return cb(e); } if (cookie === null) { return putNext(null); // skip this cookie } jar.store.putCookie(cookie, putNext); } putNext(); }; CookieJar.deserialize = function(strOrObj, store, cb) { if (arguments.length !== 3) { // store is optional cb = store; store = null; } var serialized; if (typeof strOrObj === 'string') { serialized = jsonParse(strOrObj); if (serialized instanceof Error) { return cb(serialized); } } else { serialized = strOrObj; } var jar = new CookieJar(store, serialized.rejectPublicSuffixes); jar._importCookies(serialized, function(err) { if (err) { return cb(err); } cb(null, jar); }); }; CookieJar.deserializeSync = function(strOrObj, store) { var serialized = typeof strOrObj === 'string' ? JSON.parse(strOrObj) : strOrObj; var jar = new CookieJar(store, serialized.rejectPublicSuffixes); // catch this mistake early: if (!jar.store.synchronous) { throw new Error('CookieJar store is not synchronous; use async API instead.'); } jar._importCookiesSync(serialized); return jar; }; CookieJar.fromJSON = CookieJar.deserializeSync; CookieJar.prototype.clone = function(newStore, cb) { if (arguments.length === 1) { cb = newStore; newStore = null; } this.serialize(function(err,serialized) { if (err) { return cb(err); } CookieJar.deserialize(serialized, newStore, cb); }); }; CAN_BE_SYNC.push('removeAllCookies'); CookieJar.prototype.removeAllCookies = function(cb) { var store = this.store; // Check that the store implements its own removeAllCookies(). The default // implementation in Store will immediately call the callback with a "not // implemented" Error. if (store.removeAllCookies instanceof Function && store.removeAllCookies !== Store.prototype.removeAllCookies) { return store.removeAllCookies(cb); } store.getAllCookies(function(err, cookies) { if (err) { return cb(err); } if (cookies.length === 0) { return cb(null); } var completedCount = 0; var removeErrors = []; function removeCookieCb(removeErr) { if (removeErr) { removeErrors.push(removeErr); } completedCount++; if (completedCount === cookies.length) { return cb(removeErrors.length ? removeErrors[0] : null); } } cookies.forEach(function(cookie) { store.removeCookie(cookie.domain, cookie.path, cookie.key, removeCookieCb); }); }); }; CookieJar.prototype._cloneSync = syncWrap('clone'); CookieJar.prototype.cloneSync = function(newStore) { if (!newStore.synchronous) { throw new Error('CookieJar clone destination store is not synchronous; use async API instead.'); } return this._cloneSync(newStore); }; // Use a closure to provide a true imperative API for synchronous stores. function syncWrap(method) { return function() { if (!this.store.synchronous) { throw new Error('CookieJar store is not synchronous; use async API instead.'); } var args = Array.prototype.slice.call(arguments); var syncErr, syncResult; args.push(function syncCb(err, result) { syncErr = err; syncResult = result; }); this[method].apply(this, args); if (syncErr) { throw syncErr; } return syncResult; }; } // wrap all declared CAN_BE_SYNC methods in the sync wrapper CAN_BE_SYNC.forEach(function(method) { CookieJar.prototype[method+'Sync'] = syncWrap(method); }); exports.version = VERSION; exports.CookieJar = CookieJar; exports.Cookie = Cookie; exports.Store = Store; exports.MemoryCookieStore = MemoryCookieStore; exports.parseDate = parseDate; exports.formatDate = formatDate; exports.parse = parse; exports.fromJSON = fromJSON; exports.domainMatch = domainMatch; exports.defaultPath = defaultPath; exports.pathMatch = pathMatch; exports.getPublicSuffix = pubsuffix.getPublicSuffix; exports.cookieCompare = cookieCompare; exports.permuteDomain = __webpack_require__(274).permuteDomain; exports.permutePath = permutePath; exports.canonicalDomain = canonicalDomain; /***/ }), /* 271 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * Copyright (c) 2018, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ var psl = __webpack_require__(85); function getPublicSuffix(domain) { return psl.get(domain); } exports.getPublicSuffix = getPublicSuffix; /***/ }), /* 272 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * Copyright (c) 2015, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /*jshint unused:false */ function Store() { } exports.Store = Store; // Stores may be synchronous, but are still required to use a // Continuation-Passing Style API. The CookieJar itself will expose a "*Sync" // API that converts from synchronous-callbacks to imperative style. Store.prototype.synchronous = false; Store.prototype.findCookie = function(domain, path, key, cb) { throw new Error('findCookie is not implemented'); }; Store.prototype.findCookies = function(domain, path, cb) { throw new Error('findCookies is not implemented'); }; Store.prototype.putCookie = function(cookie, cb) { throw new Error('putCookie is not implemented'); }; Store.prototype.updateCookie = function(oldCookie, newCookie, cb) { // recommended default implementation: // return this.putCookie(newCookie, cb); throw new Error('updateCookie is not implemented'); }; Store.prototype.removeCookie = function(domain, path, key, cb) { throw new Error('removeCookie is not implemented'); }; Store.prototype.removeCookies = function(domain, path, cb) { throw new Error('removeCookies is not implemented'); }; Store.prototype.removeAllCookies = function(cb) { throw new Error('removeAllCookies is not implemented'); } Store.prototype.getAllCookies = function(cb) { throw new Error('getAllCookies is not implemented (therefore jar cannot be serialized)'); }; /***/ }), /* 273 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * Copyright (c) 2015, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ var Store = __webpack_require__(272).Store; var permuteDomain = __webpack_require__(274).permuteDomain; var pathMatch = __webpack_require__(275).pathMatch; var util = __webpack_require__(9); function MemoryCookieStore() { Store.call(this); this.idx = {}; } util.inherits(MemoryCookieStore, Store); exports.MemoryCookieStore = MemoryCookieStore; MemoryCookieStore.prototype.idx = null; // Since it's just a struct in RAM, this Store is synchronous MemoryCookieStore.prototype.synchronous = true; // force a default depth: MemoryCookieStore.prototype.inspect = function() { return "{ idx: "+util.inspect(this.idx, false, 2)+' }'; }; // Use the new custom inspection symbol to add the custom inspect function if // available. if (util.inspect.custom) { MemoryCookieStore.prototype[util.inspect.custom] = MemoryCookieStore.prototype.inspect; } MemoryCookieStore.prototype.findCookie = function(domain, path, key, cb) { if (!this.idx[domain]) { return cb(null,undefined); } if (!this.idx[domain][path]) { return cb(null,undefined); } return cb(null,this.idx[domain][path][key]||null); }; MemoryCookieStore.prototype.findCookies = function(domain, path, cb) { var results = []; if (!domain) { return cb(null,[]); } var pathMatcher; if (!path) { // null means "all paths" pathMatcher = function matchAll(domainIndex) { for (var curPath in domainIndex) { var pathIndex = domainIndex[curPath]; for (var key in pathIndex) { results.push(pathIndex[key]); } } }; } else { pathMatcher = function matchRFC(domainIndex) { //NOTE: we should use path-match algorithm from S5.1.4 here //(see : https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/canonical_cookie.cc#L299) Object.keys(domainIndex).forEach(function (cookiePath) { if (pathMatch(path, cookiePath)) { var pathIndex = domainIndex[cookiePath]; for (var key in pathIndex) { results.push(pathIndex[key]); } } }); }; } var domains = permuteDomain(domain) || [domain]; var idx = this.idx; domains.forEach(function(curDomain) { var domainIndex = idx[curDomain]; if (!domainIndex) { return; } pathMatcher(domainIndex); }); cb(null,results); }; MemoryCookieStore.prototype.putCookie = function(cookie, cb) { if (!this.idx[cookie.domain]) { this.idx[cookie.domain] = {}; } if (!this.idx[cookie.domain][cookie.path]) { this.idx[cookie.domain][cookie.path] = {}; } this.idx[cookie.domain][cookie.path][cookie.key] = cookie; cb(null); }; MemoryCookieStore.prototype.updateCookie = function(oldCookie, newCookie, cb) { // updateCookie() may avoid updating cookies that are identical. For example, // lastAccessed may not be important to some stores and an equality // comparison could exclude that field. this.putCookie(newCookie,cb); }; MemoryCookieStore.prototype.removeCookie = function(domain, path, key, cb) { if (this.idx[domain] && this.idx[domain][path] && this.idx[domain][path][key]) { delete this.idx[domain][path][key]; } cb(null); }; MemoryCookieStore.prototype.removeCookies = function(domain, path, cb) { if (this.idx[domain]) { if (path) { delete this.idx[domain][path]; } else { delete this.idx[domain]; } } return cb(null); }; MemoryCookieStore.prototype.removeAllCookies = function(cb) { this.idx = {}; return cb(null); } MemoryCookieStore.prototype.getAllCookies = function(cb) { var cookies = []; var idx = this.idx; var domains = Object.keys(idx); domains.forEach(function(domain) { var paths = Object.keys(idx[domain]); paths.forEach(function(path) { var keys = Object.keys(idx[domain][path]); keys.forEach(function(key) { if (key !== null) { cookies.push(idx[domain][path][key]); } }); }); }); // Sort by creationIndex so deserializing retains the creation order. // When implementing your own store, this SHOULD retain the order too cookies.sort(function(a,b) { return (a.creationIndex||0) - (b.creationIndex||0); }); cb(null, cookies); }; /***/ }), /* 274 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * Copyright (c) 2015, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ var pubsuffix = __webpack_require__(271); // Gives the permutation of all possible domainMatch()es of a given domain. The // array is in shortest-to-longest order. Handy for indexing. function permuteDomain (domain) { var pubSuf = pubsuffix.getPublicSuffix(domain); if (!pubSuf) { return null; } if (pubSuf == domain) { return [domain]; } var prefix = domain.slice(0, -(pubSuf.length + 1)); // ".example.com" var parts = prefix.split('.').reverse(); var cur = pubSuf; var permutations = [cur]; while (parts.length) { cur = parts.shift() + '.' + cur; permutations.push(cur); } return permutations; } exports.permuteDomain = permuteDomain; /***/ }), /* 275 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * Copyright (c) 2015, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /* * "A request-path path-matches a given cookie-path if at least one of the * following conditions holds:" */ function pathMatch (reqPath, cookiePath) { // "o The cookie-path and the request-path are identical." if (cookiePath === reqPath) { return true; } var idx = reqPath.indexOf(cookiePath); if (idx === 0) { // "o The cookie-path is a prefix of the request-path, and the last // character of the cookie-path is %x2F ("/")." if (cookiePath.substr(-1) === "/") { return true; } // " o The cookie-path is a prefix of the request-path, and the first // character of the request-path that is not included in the cookie- path // is a %x2F ("/") character." if (reqPath.substr(cookiePath.length, 1) === "/") { return true; } } return false; } exports.pathMatch = pathMatch; /***/ }), /* 276 */ /***/ (function(module, exports) { // generated by genversion module.exports = '2.5.0' /***/ }), /* 277 */ /***/ (function(module, exports, __webpack_require__) { var clone = __webpack_require__(278); var debugId = 0 module.exports = exports = function(request, log) { log = log || exports.log var proto if (request.Request) { proto = request.Request.prototype } else if (request.get && request.post) { // The object returned by request.defaults() doesn't include the // Request property, so do this horrible thing to get at it. Per // Wikipedia, port 4 is unassigned. var req = request('http://localhost:4').on('error', function() { }) proto = req.constructor.prototype } else { throw new Error( "Pass the object returned by require('request') to this function.") } if (!proto._initBeforeDebug) { proto._initBeforeDebug = proto.init proto.init = function() { if (!this._debugId) { this.on('request', function(req) { var data = { debugId : this._debugId, uri : this.uri.href, method : this.method, headers : clone(this.headers) } if (this.body) { data.body = this.body.toString('utf8') } log('request', data, this) }).on('response', function(res) { if (this.callback) { // callback specified, request will buffer the body for // us, so wait until the complete event to do anything } else { // cannot get body since no callback specified log('response', { debugId : this._debugId, headers : clone(res.headers), statusCode : res.statusCode }, this) } }).on('complete', function(res, body) { if (this.callback) { log('response', { debugId : this._debugId, headers : clone(res.headers), statusCode : res.statusCode, body : res.body }, this) } }).on('redirect', function() { var type = (this.response.statusCode == 401 ? 'auth' : 'redirect') log(type, { debugId : this._debugId, statusCode : this.response.statusCode, headers : clone(this.response.headers), uri : this.uri.href }, this) }) this._debugId = ++debugId } return proto._initBeforeDebug.apply(this, arguments) } } if (!request.stopDebugging) { request.stopDebugging = function() { proto.init = proto._initBeforeDebug delete proto._initBeforeDebug } } } exports.log = function(type, data, r) { var toLog = {} toLog[type] = data console.error(toLog) } /***/ }), /* 278 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function (obj) { return JSON.parse(JSON.stringify(obj)) } /***/ }), /* 279 */ /***/ (function(module, exports, __webpack_require__) { /** * Export cheerio (with ) */ exports = module.exports = __webpack_require__(280); /* Export the version */ exports.version = __webpack_require__(610).version; /***/ }), /* 280 */ /***/ (function(module, exports, __webpack_require__) { /* Module dependencies */ var parse = __webpack_require__(281), defaultOptions = __webpack_require__(363).default, flattenOptions = __webpack_require__(363).flatten, isHtml = __webpack_require__(404).isHtml, _ = { extend: __webpack_require__(409), bind: __webpack_require__(413), forEach: __webpack_require__(458), defaults: __webpack_require__(465) }; /* * The API */ var api = [ __webpack_require__(466), __webpack_require__(589), __webpack_require__(597), __webpack_require__(601), __webpack_require__(607) ]; /* * Instance of cheerio */ var Cheerio = module.exports = function(selector, context, root, options) { if (!(this instanceof Cheerio)) return new Cheerio(selector, context, root, options); this.options = _.defaults(flattenOptions(options), this.options, defaultOptions); // $(), $(null), $(undefined), $(false) if (!selector) return this; if (root) { if (typeof root === 'string') root = parse(root, this.options, false); this._root = Cheerio.call(this, root); } // $($) if (selector.cheerio) return selector; // $(dom) if (isNode(selector)) selector = [selector]; // $([dom]) if (Array.isArray(selector)) { _.forEach(selector, _.bind(function(elem, idx) { this[idx] = elem; }, this)); this.length = selector.length; return this; } // $(<html>) if (typeof selector === 'string' && isHtml(selector)) { return Cheerio.call(this, parse(selector, this.options, false).children); } // If we don't have a context, maybe we have a root, from loading if (!context) { context = this._root; } else if (typeof context === 'string') { if (isHtml(context)) { // $('li', '<ul>...</ul>') context = parse(context, this.options, false); context = Cheerio.call(this, context); } else { // $('li', 'ul') selector = [context, selector].join(' '); context = this._root; } // $('li', node), $('li', [nodes]) } else if (!context.cheerio) { context = Cheerio.call(this, context); } // If we still don't have a context, return if (!context) return this; // #id, .class, tag return context.find(selector); }; /** * Mix in `static` */ _.extend(Cheerio, __webpack_require__(467)); /* * Set a signature of the object */ Cheerio.prototype.cheerio = '[cheerio object]'; /* * Make cheerio an array-like object */ Cheerio.prototype.length = 0; Cheerio.prototype.splice = Array.prototype.splice; /* * Make a cheerio object * * @api private */ Cheerio.prototype._make = function(dom, context) { var cheerio = new this.constructor(dom, context, this._root, this.options); cheerio.prevObject = this; return cheerio; }; /** * Turn a cheerio object into an array */ Cheerio.prototype.toArray = function() { return this.get(); }; /** * Plug in the API */ api.forEach(function(mod) { _.extend(Cheerio.prototype, mod); }); var isNode = function(obj) { return obj.name || obj.type === 'text' || obj.type === 'comment'; }; /***/ }), /* 281 */ /***/ (function(module, exports, __webpack_require__) { /* Module Dependencies */ var htmlparser = __webpack_require__(282), parse5 = __webpack_require__(337); /* Parser */ exports = module.exports = function(content, options, isDocument) { var dom = exports.evaluate(content, options, isDocument), // Generic root element root = exports.evaluate('<root></root>', options, false)[0]; root.type = 'root'; root.parent = null; // Update the dom using the root exports.update(dom, root); return root; }; function parseWithParse5 (content, isDocument) { var parse = isDocument ? parse5.parse : parse5.parseFragment, root = parse(content, { treeAdapter: parse5.treeAdapters.htmlparser2 }); return root.children; } exports.evaluate = function(content, options, isDocument) { // options = options || $.fn.options; var dom; if (Buffer.isBuffer(content)) content = content.toString(); if (typeof content === 'string') { var useHtmlParser2 = options.xmlMode || options._useHtmlParser2; dom = useHtmlParser2 ? htmlparser.parseDOM(content, options) : parseWithParse5(content, isDocument); } else { dom = content; } return dom; }; /* Update the dom structure, for one changed layer */ exports.update = function(arr, parent) { // normalize if (!Array.isArray(arr)) arr = [arr]; // Update parent if (parent) { parent.children = arr; } else { parent = null; } // Update neighbors for (var i = 0; i < arr.length; i++) { var node = arr[i]; // Cleanly remove existing nodes from their previous structures. var oldParent = node.parent || node.root, oldSiblings = oldParent && oldParent.children; if (oldSiblings && oldSiblings !== arr) { oldSiblings.splice(oldSiblings.indexOf(node), 1); if (node.prev) { node.prev.next = node.next; } if (node.next) { node.next.prev = node.prev; } } if (parent) { node.prev = arr[i - 1] || null; node.next = arr[i + 1] || null; } else { node.prev = node.next = null; } if (parent && parent.type === 'root') { node.root = parent; node.parent = null; } else { node.root = null; node.parent = parent; } } return parent; }; // module.exports = $.extend(exports); /***/ }), /* 282 */ /***/ (function(module, exports, __webpack_require__) { var Parser = __webpack_require__(283); var DomHandler = __webpack_require__(292); function defineProp(name, value) { delete module.exports[name]; module.exports[name] = value; return value; } module.exports = { Parser: Parser, Tokenizer: __webpack_require__(284), ElementType: __webpack_require__(293), DomHandler: DomHandler, get FeedHandler() { return defineProp("FeedHandler", __webpack_require__(296)); }, get Stream() { return defineProp("Stream", __webpack_require__(315)); }, get WritableStream() { return defineProp("WritableStream", __webpack_require__(316)); }, get ProxyHandler() { return defineProp("ProxyHandler", __webpack_require__(335)); }, get DomUtils() { return defineProp("DomUtils", __webpack_require__(297)); }, get CollectingHandler() { return defineProp( "CollectingHandler", __webpack_require__(336) ); }, // For legacy support DefaultHandler: DomHandler, get RssHandler() { return defineProp("RssHandler", this.FeedHandler); }, //helper methods parseDOM: function(data, options) { var handler = new DomHandler(options); new Parser(handler, options).end(data); return handler.dom; }, parseFeed: function(feed, options) { var handler = new module.exports.FeedHandler(options); new Parser(handler, options).end(feed); return handler.dom; }, createDomStream: function(cb, options, elementCb) { var handler = new DomHandler(cb, options, elementCb); return new Parser(handler, options); }, // List of all events that the parser emits EVENTS: { /* Format: eventname: number of arguments */ attribute: 2, cdatastart: 0, cdataend: 0, text: 1, processinginstruction: 2, comment: 1, commentend: 0, closetag: 1, opentag: 2, opentagname: 1, error: 1, end: 0 } }; /***/ }), /* 283 */ /***/ (function(module, exports, __webpack_require__) { var Tokenizer = __webpack_require__(284); /* Options: xmlMode: Disables the special behavior for script/style tags (false by default) lowerCaseAttributeNames: call .toLowerCase for each attribute name (true if xmlMode is `false`) lowerCaseTags: call .toLowerCase for each tag name (true if xmlMode is `false`) */ /* Callbacks: oncdataend, oncdatastart, onclosetag, oncomment, oncommentend, onerror, onopentag, onprocessinginstruction, onreset, ontext */ var formTags = { input: true, option: true, optgroup: true, select: true, button: true, datalist: true, textarea: true }; var openImpliesClose = { tr: { tr: true, th: true, td: true }, th: { th: true }, td: { thead: true, th: true, td: true }, body: { head: true, link: true, script: true }, li: { li: true }, p: { p: true }, h1: { p: true }, h2: { p: true }, h3: { p: true }, h4: { p: true }, h5: { p: true }, h6: { p: true }, select: formTags, input: formTags, output: formTags, button: formTags, datalist: formTags, textarea: formTags, option: { option: true }, optgroup: { optgroup: true } }; var voidElements = { __proto__: null, area: true, base: true, basefont: true, br: true, col: true, command: true, embed: true, frame: true, hr: true, img: true, input: true, isindex: true, keygen: true, link: true, meta: true, param: true, source: true, track: true, wbr: true }; var foreignContextElements = { __proto__: null, math: true, svg: true }; var htmlIntegrationElements = { __proto__: null, mi: true, mo: true, mn: true, ms: true, mtext: true, "annotation-xml": true, foreignObject: true, desc: true, title: true }; var re_nameEnd = /\s|\//; function Parser(cbs, options) { this._options = options || {}; this._cbs = cbs || {}; this._tagname = ""; this._attribname = ""; this._attribvalue = ""; this._attribs = null; this._stack = []; this._foreignContext = []; this.startIndex = 0; this.endIndex = null; this._lowerCaseTagNames = "lowerCaseTags" in this._options ? !!this._options.lowerCaseTags : !this._options.xmlMode; this._lowerCaseAttributeNames = "lowerCaseAttributeNames" in this._options ? !!this._options.lowerCaseAttributeNames : !this._options.xmlMode; if (this._options.Tokenizer) { Tokenizer = this._options.Tokenizer; } this._tokenizer = new Tokenizer(this._options, this); if (this._cbs.onparserinit) this._cbs.onparserinit(this); } __webpack_require__(290)(Parser, __webpack_require__(268).EventEmitter); Parser.prototype._updatePosition = function(initialOffset) { if (this.endIndex === null) { if (this._tokenizer._sectionStart <= initialOffset) { this.startIndex = 0; } else { this.startIndex = this._tokenizer._sectionStart - initialOffset; } } else this.startIndex = this.endIndex + 1; this.endIndex = this._tokenizer.getAbsoluteIndex(); }; //Tokenizer event handlers Parser.prototype.ontext = function(data) { this._updatePosition(1); this.endIndex--; if (this._cbs.ontext) this._cbs.ontext(data); }; Parser.prototype.onopentagname = function(name) { if (this._lowerCaseTagNames) { name = name.toLowerCase(); } this._tagname = name; if (!this._options.xmlMode && name in openImpliesClose) { for ( var el; (el = this._stack[this._stack.length - 1]) in openImpliesClose[name]; this.onclosetag(el) ); } if (this._options.xmlMode || !(name in voidElements)) { this._stack.push(name); if (name in foreignContextElements) this._foreignContext.push(true); else if (name in htmlIntegrationElements) this._foreignContext.push(false); } if (this._cbs.onopentagname) this._cbs.onopentagname(name); if (this._cbs.onopentag) this._attribs = {}; }; Parser.prototype.onopentagend = function() { this._updatePosition(1); if (this._attribs) { if (this._cbs.onopentag) this._cbs.onopentag(this._tagname, this._attribs); this._attribs = null; } if ( !this._options.xmlMode && this._cbs.onclosetag && this._tagname in voidElements ) { this._cbs.onclosetag(this._tagname); } this._tagname = ""; }; Parser.prototype.onclosetag = function(name) { this._updatePosition(1); if (this._lowerCaseTagNames) { name = name.toLowerCase(); } if (name in foreignContextElements || name in htmlIntegrationElements) { this._foreignContext.pop(); } if ( this._stack.length && (!(name in voidElements) || this._options.xmlMode) ) { var pos = this._stack.lastIndexOf(name); if (pos !== -1) { if (this._cbs.onclosetag) { pos = this._stack.length - pos; while (pos--) this._cbs.onclosetag(this._stack.pop()); } else this._stack.length = pos; } else if (name === "p" && !this._options.xmlMode) { this.onopentagname(name); this._closeCurrentTag(); } } else if (!this._options.xmlMode && (name === "br" || name === "p")) { this.onopentagname(name); this._closeCurrentTag(); } }; Parser.prototype.onselfclosingtag = function() { if ( this._options.xmlMode || this._options.recognizeSelfClosing || this._foreignContext[this._foreignContext.length - 1] ) { this._closeCurrentTag(); } else { this.onopentagend(); } }; Parser.prototype._closeCurrentTag = function() { var name = this._tagname; this.onopentagend(); //self-closing tags will be on the top of the stack //(cheaper check than in onclosetag) if (this._stack[this._stack.length - 1] === name) { if (this._cbs.onclosetag) { this._cbs.onclosetag(name); } this._stack.pop(); } }; Parser.prototype.onattribname = function(name) { if (this._lowerCaseAttributeNames) { name = name.toLowerCase(); } this._attribname = name; }; Parser.prototype.onattribdata = function(value) { this._attribvalue += value; }; Parser.prototype.onattribend = function() { if (this._cbs.onattribute) this._cbs.onattribute(this._attribname, this._attribvalue); if ( this._attribs && !Object.prototype.hasOwnProperty.call(this._attribs, this._attribname) ) { this._attribs[this._attribname] = this._attribvalue; } this._attribname = ""; this._attribvalue = ""; }; Parser.prototype._getInstructionName = function(value) { var idx = value.search(re_nameEnd), name = idx < 0 ? value : value.substr(0, idx); if (this._lowerCaseTagNames) { name = name.toLowerCase(); } return name; }; Parser.prototype.ondeclaration = function(value) { if (this._cbs.onprocessinginstruction) { var name = this._getInstructionName(value); this._cbs.onprocessinginstruction("!" + name, "!" + value); } }; Parser.prototype.onprocessinginstruction = function(value) { if (this._cbs.onprocessinginstruction) { var name = this._getInstructionName(value); this._cbs.onprocessinginstruction("?" + name, "?" + value); } }; Parser.prototype.oncomment = function(value) { this._updatePosition(4); if (this._cbs.oncomment) this._cbs.oncomment(value); if (this._cbs.oncommentend) this._cbs.oncommentend(); }; Parser.prototype.oncdata = function(value) { this._updatePosition(1); if (this._options.xmlMode || this._options.recognizeCDATA) { if (this._cbs.oncdatastart) this._cbs.oncdatastart(); if (this._cbs.ontext) this._cbs.ontext(value); if (this._cbs.oncdataend) this._cbs.oncdataend(); } else { this.oncomment("[CDATA[" + value + "]]"); } }; Parser.prototype.onerror = function(err) { if (this._cbs.onerror) this._cbs.onerror(err); }; Parser.prototype.onend = function() { if (this._cbs.onclosetag) { for ( var i = this._stack.length; i > 0; this._cbs.onclosetag(this._stack[--i]) ); } if (this._cbs.onend) this._cbs.onend(); }; //Resets the parser to a blank state, ready to parse a new HTML document Parser.prototype.reset = function() { if (this._cbs.onreset) this._cbs.onreset(); this._tokenizer.reset(); this._tagname = ""; this._attribname = ""; this._attribs = null; this._stack = []; if (this._cbs.onparserinit) this._cbs.onparserinit(this); }; //Parses a complete HTML document and pushes it to the handler Parser.prototype.parseComplete = function(data) { this.reset(); this.end(data); }; Parser.prototype.write = function(chunk) { this._tokenizer.write(chunk); }; Parser.prototype.end = function(chunk) { this._tokenizer.end(chunk); }; Parser.prototype.pause = function() { this._tokenizer.pause(); }; Parser.prototype.resume = function() { this._tokenizer.resume(); }; //alias for backwards compat Parser.prototype.parseChunk = Parser.prototype.write; Parser.prototype.done = Parser.prototype.end; module.exports = Parser; /***/ }), /* 284 */ /***/ (function(module, exports, __webpack_require__) { module.exports = Tokenizer; var decodeCodePoint = __webpack_require__(285); var entityMap = __webpack_require__(287); var legacyMap = __webpack_require__(288); var xmlMap = __webpack_require__(289); var i = 0; var TEXT = i++; var BEFORE_TAG_NAME = i++; //after < var IN_TAG_NAME = i++; var IN_SELF_CLOSING_TAG = i++; var BEFORE_CLOSING_TAG_NAME = i++; var IN_CLOSING_TAG_NAME = i++; var AFTER_CLOSING_TAG_NAME = i++; //attributes var BEFORE_ATTRIBUTE_NAME = i++; var IN_ATTRIBUTE_NAME = i++; var AFTER_ATTRIBUTE_NAME = i++; var BEFORE_ATTRIBUTE_VALUE = i++; var IN_ATTRIBUTE_VALUE_DQ = i++; // " var IN_ATTRIBUTE_VALUE_SQ = i++; // ' var IN_ATTRIBUTE_VALUE_NQ = i++; //declarations var BEFORE_DECLARATION = i++; // ! var IN_DECLARATION = i++; //processing instructions var IN_PROCESSING_INSTRUCTION = i++; // ? //comments var BEFORE_COMMENT = i++; var IN_COMMENT = i++; var AFTER_COMMENT_1 = i++; var AFTER_COMMENT_2 = i++; //cdata var BEFORE_CDATA_1 = i++; // [ var BEFORE_CDATA_2 = i++; // C var BEFORE_CDATA_3 = i++; // D var BEFORE_CDATA_4 = i++; // A var BEFORE_CDATA_5 = i++; // T var BEFORE_CDATA_6 = i++; // A var IN_CDATA = i++; // [ var AFTER_CDATA_1 = i++; // ] var AFTER_CDATA_2 = i++; // ] //special tags var BEFORE_SPECIAL = i++; //S var BEFORE_SPECIAL_END = i++; //S var BEFORE_SCRIPT_1 = i++; //C var BEFORE_SCRIPT_2 = i++; //R var BEFORE_SCRIPT_3 = i++; //I var BEFORE_SCRIPT_4 = i++; //P var BEFORE_SCRIPT_5 = i++; //T var AFTER_SCRIPT_1 = i++; //C var AFTER_SCRIPT_2 = i++; //R var AFTER_SCRIPT_3 = i++; //I var AFTER_SCRIPT_4 = i++; //P var AFTER_SCRIPT_5 = i++; //T var BEFORE_STYLE_1 = i++; //T var BEFORE_STYLE_2 = i++; //Y var BEFORE_STYLE_3 = i++; //L var BEFORE_STYLE_4 = i++; //E var AFTER_STYLE_1 = i++; //T var AFTER_STYLE_2 = i++; //Y var AFTER_STYLE_3 = i++; //L var AFTER_STYLE_4 = i++; //E var BEFORE_ENTITY = i++; //& var BEFORE_NUMERIC_ENTITY = i++; //# var IN_NAMED_ENTITY = i++; var IN_NUMERIC_ENTITY = i++; var IN_HEX_ENTITY = i++; //X var j = 0; var SPECIAL_NONE = j++; var SPECIAL_SCRIPT = j++; var SPECIAL_STYLE = j++; function whitespace(c) { return c === " " || c === "\n" || c === "\t" || c === "\f" || c === "\r"; } function ifElseState(upper, SUCCESS, FAILURE) { var lower = upper.toLowerCase(); if (upper === lower) { return function(c) { if (c === lower) { this._state = SUCCESS; } else { this._state = FAILURE; this._index--; } }; } else { return function(c) { if (c === lower || c === upper) { this._state = SUCCESS; } else { this._state = FAILURE; this._index--; } }; } } function consumeSpecialNameChar(upper, NEXT_STATE) { var lower = upper.toLowerCase(); return function(c) { if (c === lower || c === upper) { this._state = NEXT_STATE; } else { this._state = IN_TAG_NAME; this._index--; //consume the token again } }; } function Tokenizer(options, cbs) { this._state = TEXT; this._buffer = ""; this._sectionStart = 0; this._index = 0; this._bufferOffset = 0; //chars removed from _buffer this._baseState = TEXT; this._special = SPECIAL_NONE; this._cbs = cbs; this._running = true; this._ended = false; this._xmlMode = !!(options && options.xmlMode); this._decodeEntities = !!(options && options.decodeEntities); } Tokenizer.prototype._stateText = function(c) { if (c === "<") { if (this._index > this._sectionStart) { this._cbs.ontext(this._getSection()); } this._state = BEFORE_TAG_NAME; this._sectionStart = this._index; } else if ( this._decodeEntities && this._special === SPECIAL_NONE && c === "&" ) { if (this._index > this._sectionStart) { this._cbs.ontext(this._getSection()); } this._baseState = TEXT; this._state = BEFORE_ENTITY; this._sectionStart = this._index; } }; Tokenizer.prototype._stateBeforeTagName = function(c) { if (c === "/") { this._state = BEFORE_CLOSING_TAG_NAME; } else if (c === "<") { this._cbs.ontext(this._getSection()); this._sectionStart = this._index; } else if (c === ">" || this._special !== SPECIAL_NONE || whitespace(c)) { this._state = TEXT; } else if (c === "!") { this._state = BEFORE_DECLARATION; this._sectionStart = this._index + 1; } else if (c === "?") { this._state = IN_PROCESSING_INSTRUCTION; this._sectionStart = this._index + 1; } else { this._state = !this._xmlMode && (c === "s" || c === "S") ? BEFORE_SPECIAL : IN_TAG_NAME; this._sectionStart = this._index; } }; Tokenizer.prototype._stateInTagName = function(c) { if (c === "/" || c === ">" || whitespace(c)) { this._emitToken("onopentagname"); this._state = BEFORE_ATTRIBUTE_NAME; this._index--; } }; Tokenizer.prototype._stateBeforeCloseingTagName = function(c) { if (whitespace(c)); else if (c === ">") { this._state = TEXT; } else if (this._special !== SPECIAL_NONE) { if (c === "s" || c === "S") { this._state = BEFORE_SPECIAL_END; } else { this._state = TEXT; this._index--; } } else { this._state = IN_CLOSING_TAG_NAME; this._sectionStart = this._index; } }; Tokenizer.prototype._stateInCloseingTagName = function(c) { if (c === ">" || whitespace(c)) { this._emitToken("onclosetag"); this._state = AFTER_CLOSING_TAG_NAME; this._index--; } }; Tokenizer.prototype._stateAfterCloseingTagName = function(c) { //skip everything until ">" if (c === ">") { this._state = TEXT; this._sectionStart = this._index + 1; } }; Tokenizer.prototype._stateBeforeAttributeName = function(c) { if (c === ">") { this._cbs.onopentagend(); this._state = TEXT; this._sectionStart = this._index + 1; } else if (c === "/") { this._state = IN_SELF_CLOSING_TAG; } else if (!whitespace(c)) { this._state = IN_ATTRIBUTE_NAME; this._sectionStart = this._index; } }; Tokenizer.prototype._stateInSelfClosingTag = function(c) { if (c === ">") { this._cbs.onselfclosingtag(); this._state = TEXT; this._sectionStart = this._index + 1; } else if (!whitespace(c)) { this._state = BEFORE_ATTRIBUTE_NAME; this._index--; } }; Tokenizer.prototype._stateInAttributeName = function(c) { if (c === "=" || c === "/" || c === ">" || whitespace(c)) { this._cbs.onattribname(this._getSection()); this._sectionStart = -1; this._state = AFTER_ATTRIBUTE_NAME; this._index--; } }; Tokenizer.prototype._stateAfterAttributeName = function(c) { if (c === "=") { this._state = BEFORE_ATTRIBUTE_VALUE; } else if (c === "/" || c === ">") { this._cbs.onattribend(); this._state = BEFORE_ATTRIBUTE_NAME; this._index--; } else if (!whitespace(c)) { this._cbs.onattribend(); this._state = IN_ATTRIBUTE_NAME; this._sectionStart = this._index; } }; Tokenizer.prototype._stateBeforeAttributeValue = function(c) { if (c === '"') { this._state = IN_ATTRIBUTE_VALUE_DQ; this._sectionStart = this._index + 1; } else if (c === "'") { this._state = IN_ATTRIBUTE_VALUE_SQ; this._sectionStart = this._index + 1; } else if (!whitespace(c)) { this._state = IN_ATTRIBUTE_VALUE_NQ; this._sectionStart = this._index; this._index--; //reconsume token } }; Tokenizer.prototype._stateInAttributeValueDoubleQuotes = function(c) { if (c === '"') { this._emitToken("onattribdata"); this._cbs.onattribend(); this._state = BEFORE_ATTRIBUTE_NAME; } else if (this._decodeEntities && c === "&") { this._emitToken("onattribdata"); this._baseState = this._state; this._state = BEFORE_ENTITY; this._sectionStart = this._index; } }; Tokenizer.prototype._stateInAttributeValueSingleQuotes = function(c) { if (c === "'") { this._emitToken("onattribdata"); this._cbs.onattribend(); this._state = BEFORE_ATTRIBUTE_NAME; } else if (this._decodeEntities && c === "&") { this._emitToken("onattribdata"); this._baseState = this._state; this._state = BEFORE_ENTITY; this._sectionStart = this._index; } }; Tokenizer.prototype._stateInAttributeValueNoQuotes = function(c) { if (whitespace(c) || c === ">") { this._emitToken("onattribdata"); this._cbs.onattribend(); this._state = BEFORE_ATTRIBUTE_NAME; this._index--; } else if (this._decodeEntities && c === "&") { this._emitToken("onattribdata"); this._baseState = this._state; this._state = BEFORE_ENTITY; this._sectionStart = this._index; } }; Tokenizer.prototype._stateBeforeDeclaration = function(c) { this._state = c === "[" ? BEFORE_CDATA_1 : c === "-" ? BEFORE_COMMENT : IN_DECLARATION; }; Tokenizer.prototype._stateInDeclaration = function(c) { if (c === ">") { this._cbs.ondeclaration(this._getSection()); this._state = TEXT; this._sectionStart = this._index + 1; } }; Tokenizer.prototype._stateInProcessingInstruction = function(c) { if (c === ">") { this._cbs.onprocessinginstruction(this._getSection()); this._state = TEXT; this._sectionStart = this._index + 1; } }; Tokenizer.prototype._stateBeforeComment = function(c) { if (c === "-") { this._state = IN_COMMENT; this._sectionStart = this._index + 1; } else { this._state = IN_DECLARATION; } }; Tokenizer.prototype._stateInComment = function(c) { if (c === "-") this._state = AFTER_COMMENT_1; }; Tokenizer.prototype._stateAfterComment1 = function(c) { if (c === "-") { this._state = AFTER_COMMENT_2; } else { this._state = IN_COMMENT; } }; Tokenizer.prototype._stateAfterComment2 = function(c) { if (c === ">") { //remove 2 trailing chars this._cbs.oncomment( this._buffer.substring(this._sectionStart, this._index - 2) ); this._state = TEXT; this._sectionStart = this._index + 1; } else if (c !== "-") { this._state = IN_COMMENT; } // else: stay in AFTER_COMMENT_2 (`--->`) }; Tokenizer.prototype._stateBeforeCdata1 = ifElseState( "C", BEFORE_CDATA_2, IN_DECLARATION ); Tokenizer.prototype._stateBeforeCdata2 = ifElseState( "D", BEFORE_CDATA_3, IN_DECLARATION ); Tokenizer.prototype._stateBeforeCdata3 = ifElseState( "A", BEFORE_CDATA_4, IN_DECLARATION ); Tokenizer.prototype._stateBeforeCdata4 = ifElseState( "T", BEFORE_CDATA_5, IN_DECLARATION ); Tokenizer.prototype._stateBeforeCdata5 = ifElseState( "A", BEFORE_CDATA_6, IN_DECLARATION ); Tokenizer.prototype._stateBeforeCdata6 = function(c) { if (c === "[") { this._state = IN_CDATA; this._sectionStart = this._index + 1; } else { this._state = IN_DECLARATION; this._index--; } }; Tokenizer.prototype._stateInCdata = function(c) { if (c === "]") this._state = AFTER_CDATA_1; }; Tokenizer.prototype._stateAfterCdata1 = function(c) { if (c === "]") this._state = AFTER_CDATA_2; else this._state = IN_CDATA; }; Tokenizer.prototype._stateAfterCdata2 = function(c) { if (c === ">") { //remove 2 trailing chars this._cbs.oncdata( this._buffer.substring(this._sectionStart, this._index - 2) ); this._state = TEXT; this._sectionStart = this._index + 1; } else if (c !== "]") { this._state = IN_CDATA; } //else: stay in AFTER_CDATA_2 (`]]]>`) }; Tokenizer.prototype._stateBeforeSpecial = function(c) { if (c === "c" || c === "C") { this._state = BEFORE_SCRIPT_1; } else if (c === "t" || c === "T") { this._state = BEFORE_STYLE_1; } else { this._state = IN_TAG_NAME; this._index--; //consume the token again } }; Tokenizer.prototype._stateBeforeSpecialEnd = function(c) { if (this._special === SPECIAL_SCRIPT && (c === "c" || c === "C")) { this._state = AFTER_SCRIPT_1; } else if (this._special === SPECIAL_STYLE && (c === "t" || c === "T")) { this._state = AFTER_STYLE_1; } else this._state = TEXT; }; Tokenizer.prototype._stateBeforeScript1 = consumeSpecialNameChar( "R", BEFORE_SCRIPT_2 ); Tokenizer.prototype._stateBeforeScript2 = consumeSpecialNameChar( "I", BEFORE_SCRIPT_3 ); Tokenizer.prototype._stateBeforeScript3 = consumeSpecialNameChar( "P", BEFORE_SCRIPT_4 ); Tokenizer.prototype._stateBeforeScript4 = consumeSpecialNameChar( "T", BEFORE_SCRIPT_5 ); Tokenizer.prototype._stateBeforeScript5 = function(c) { if (c === "/" || c === ">" || whitespace(c)) { this._special = SPECIAL_SCRIPT; } this._state = IN_TAG_NAME; this._index--; //consume the token again }; Tokenizer.prototype._stateAfterScript1 = ifElseState("R", AFTER_SCRIPT_2, TEXT); Tokenizer.prototype._stateAfterScript2 = ifElseState("I", AFTER_SCRIPT_3, TEXT); Tokenizer.prototype._stateAfterScript3 = ifElseState("P", AFTER_SCRIPT_4, TEXT); Tokenizer.prototype._stateAfterScript4 = ifElseState("T", AFTER_SCRIPT_5, TEXT); Tokenizer.prototype._stateAfterScript5 = function(c) { if (c === ">" || whitespace(c)) { this._special = SPECIAL_NONE; this._state = IN_CLOSING_TAG_NAME; this._sectionStart = this._index - 6; this._index--; //reconsume the token } else this._state = TEXT; }; Tokenizer.prototype._stateBeforeStyle1 = consumeSpecialNameChar( "Y", BEFORE_STYLE_2 ); Tokenizer.prototype._stateBeforeStyle2 = consumeSpecialNameChar( "L", BEFORE_STYLE_3 ); Tokenizer.prototype._stateBeforeStyle3 = consumeSpecialNameChar( "E", BEFORE_STYLE_4 ); Tokenizer.prototype._stateBeforeStyle4 = function(c) { if (c === "/" || c === ">" || whitespace(c)) { this._special = SPECIAL_STYLE; } this._state = IN_TAG_NAME; this._index--; //consume the token again }; Tokenizer.prototype._stateAfterStyle1 = ifElseState("Y", AFTER_STYLE_2, TEXT); Tokenizer.prototype._stateAfterStyle2 = ifElseState("L", AFTER_STYLE_3, TEXT); Tokenizer.prototype._stateAfterStyle3 = ifElseState("E", AFTER_STYLE_4, TEXT); Tokenizer.prototype._stateAfterStyle4 = function(c) { if (c === ">" || whitespace(c)) { this._special = SPECIAL_NONE; this._state = IN_CLOSING_TAG_NAME; this._sectionStart = this._index - 5; this._index--; //reconsume the token } else this._state = TEXT; }; Tokenizer.prototype._stateBeforeEntity = ifElseState( "#", BEFORE_NUMERIC_ENTITY, IN_NAMED_ENTITY ); Tokenizer.prototype._stateBeforeNumericEntity = ifElseState( "X", IN_HEX_ENTITY, IN_NUMERIC_ENTITY ); //for entities terminated with a semicolon Tokenizer.prototype._parseNamedEntityStrict = function() { //offset = 1 if (this._sectionStart + 1 < this._index) { var entity = this._buffer.substring( this._sectionStart + 1, this._index ), map = this._xmlMode ? xmlMap : entityMap; if (map.hasOwnProperty(entity)) { this._emitPartial(map[entity]); this._sectionStart = this._index + 1; } } }; //parses legacy entities (without trailing semicolon) Tokenizer.prototype._parseLegacyEntity = function() { var start = this._sectionStart + 1, limit = this._index - start; if (limit > 6) limit = 6; //the max length of legacy entities is 6 while (limit >= 2) { //the min length of legacy entities is 2 var entity = this._buffer.substr(start, limit); if (legacyMap.hasOwnProperty(entity)) { this._emitPartial(legacyMap[entity]); this._sectionStart += limit + 1; return; } else { limit--; } } }; Tokenizer.prototype._stateInNamedEntity = function(c) { if (c === ";") { this._parseNamedEntityStrict(); if (this._sectionStart + 1 < this._index && !this._xmlMode) { this._parseLegacyEntity(); } this._state = this._baseState; } else if ( (c < "a" || c > "z") && (c < "A" || c > "Z") && (c < "0" || c > "9") ) { if (this._xmlMode); else if (this._sectionStart + 1 === this._index); else if (this._baseState !== TEXT) { if (c !== "=") { this._parseNamedEntityStrict(); } } else { this._parseLegacyEntity(); } this._state = this._baseState; this._index--; } }; Tokenizer.prototype._decodeNumericEntity = function(offset, base) { var sectionStart = this._sectionStart + offset; if (sectionStart !== this._index) { //parse entity var entity = this._buffer.substring(sectionStart, this._index); var parsed = parseInt(entity, base); this._emitPartial(decodeCodePoint(parsed)); this._sectionStart = this._index; } else { this._sectionStart--; } this._state = this._baseState; }; Tokenizer.prototype._stateInNumericEntity = function(c) { if (c === ";") { this._decodeNumericEntity(2, 10); this._sectionStart++; } else if (c < "0" || c > "9") { if (!this._xmlMode) { this._decodeNumericEntity(2, 10); } else { this._state = this._baseState; } this._index--; } }; Tokenizer.prototype._stateInHexEntity = function(c) { if (c === ";") { this._decodeNumericEntity(3, 16); this._sectionStart++; } else if ( (c < "a" || c > "f") && (c < "A" || c > "F") && (c < "0" || c > "9") ) { if (!this._xmlMode) { this._decodeNumericEntity(3, 16); } else { this._state = this._baseState; } this._index--; } }; Tokenizer.prototype._cleanup = function() { if (this._sectionStart < 0) { this._buffer = ""; this._bufferOffset += this._index; this._index = 0; } else if (this._running) { if (this._state === TEXT) { if (this._sectionStart !== this._index) { this._cbs.ontext(this._buffer.substr(this._sectionStart)); } this._buffer = ""; this._bufferOffset += this._index; this._index = 0; } else if (this._sectionStart === this._index) { //the section just started this._buffer = ""; this._bufferOffset += this._index; this._index = 0; } else { //remove everything unnecessary this._buffer = this._buffer.substr(this._sectionStart); this._index -= this._sectionStart; this._bufferOffset += this._sectionStart; } this._sectionStart = 0; } }; //TODO make events conditional Tokenizer.prototype.write = function(chunk) { if (this._ended) this._cbs.onerror(Error(".write() after done!")); this._buffer += chunk; this._parse(); }; Tokenizer.prototype._parse = function() { while (this._index < this._buffer.length && this._running) { var c = this._buffer.charAt(this._index); if (this._state === TEXT) { this._stateText(c); } else if (this._state === BEFORE_TAG_NAME) { this._stateBeforeTagName(c); } else if (this._state === IN_TAG_NAME) { this._stateInTagName(c); } else if (this._state === BEFORE_CLOSING_TAG_NAME) { this._stateBeforeCloseingTagName(c); } else if (this._state === IN_CLOSING_TAG_NAME) { this._stateInCloseingTagName(c); } else if (this._state === AFTER_CLOSING_TAG_NAME) { this._stateAfterCloseingTagName(c); } else if (this._state === IN_SELF_CLOSING_TAG) { this._stateInSelfClosingTag(c); } else if (this._state === BEFORE_ATTRIBUTE_NAME) { /* * attributes */ this._stateBeforeAttributeName(c); } else if (this._state === IN_ATTRIBUTE_NAME) { this._stateInAttributeName(c); } else if (this._state === AFTER_ATTRIBUTE_NAME) { this._stateAfterAttributeName(c); } else if (this._state === BEFORE_ATTRIBUTE_VALUE) { this._stateBeforeAttributeValue(c); } else if (this._state === IN_ATTRIBUTE_VALUE_DQ) { this._stateInAttributeValueDoubleQuotes(c); } else if (this._state === IN_ATTRIBUTE_VALUE_SQ) { this._stateInAttributeValueSingleQuotes(c); } else if (this._state === IN_ATTRIBUTE_VALUE_NQ) { this._stateInAttributeValueNoQuotes(c); } else if (this._state === BEFORE_DECLARATION) { /* * declarations */ this._stateBeforeDeclaration(c); } else if (this._state === IN_DECLARATION) { this._stateInDeclaration(c); } else if (this._state === IN_PROCESSING_INSTRUCTION) { /* * processing instructions */ this._stateInProcessingInstruction(c); } else if (this._state === BEFORE_COMMENT) { /* * comments */ this._stateBeforeComment(c); } else if (this._state === IN_COMMENT) { this._stateInComment(c); } else if (this._state === AFTER_COMMENT_1) { this._stateAfterComment1(c); } else if (this._state === AFTER_COMMENT_2) { this._stateAfterComment2(c); } else if (this._state === BEFORE_CDATA_1) { /* * cdata */ this._stateBeforeCdata1(c); } else if (this._state === BEFORE_CDATA_2) { this._stateBeforeCdata2(c); } else if (this._state === BEFORE_CDATA_3) { this._stateBeforeCdata3(c); } else if (this._state === BEFORE_CDATA_4) { this._stateBeforeCdata4(c); } else if (this._state === BEFORE_CDATA_5) { this._stateBeforeCdata5(c); } else if (this._state === BEFORE_CDATA_6) { this._stateBeforeCdata6(c); } else if (this._state === IN_CDATA) { this._stateInCdata(c); } else if (this._state === AFTER_CDATA_1) { this._stateAfterCdata1(c); } else if (this._state === AFTER_CDATA_2) { this._stateAfterCdata2(c); } else if (this._state === BEFORE_SPECIAL) { /* * special tags */ this._stateBeforeSpecial(c); } else if (this._state === BEFORE_SPECIAL_END) { this._stateBeforeSpecialEnd(c); } else if (this._state === BEFORE_SCRIPT_1) { /* * script */ this._stateBeforeScript1(c); } else if (this._state === BEFORE_SCRIPT_2) { this._stateBeforeScript2(c); } else if (this._state === BEFORE_SCRIPT_3) { this._stateBeforeScript3(c); } else if (this._state === BEFORE_SCRIPT_4) { this._stateBeforeScript4(c); } else if (this._state === BEFORE_SCRIPT_5) { this._stateBeforeScript5(c); } else if (this._state === AFTER_SCRIPT_1) { this._stateAfterScript1(c); } else if (this._state === AFTER_SCRIPT_2) { this._stateAfterScript2(c); } else if (this._state === AFTER_SCRIPT_3) { this._stateAfterScript3(c); } else if (this._state === AFTER_SCRIPT_4) { this._stateAfterScript4(c); } else if (this._state === AFTER_SCRIPT_5) { this._stateAfterScript5(c); } else if (this._state === BEFORE_STYLE_1) { /* * style */ this._stateBeforeStyle1(c); } else if (this._state === BEFORE_STYLE_2) { this._stateBeforeStyle2(c); } else if (this._state === BEFORE_STYLE_3) { this._stateBeforeStyle3(c); } else if (this._state === BEFORE_STYLE_4) { this._stateBeforeStyle4(c); } else if (this._state === AFTER_STYLE_1) { this._stateAfterStyle1(c); } else if (this._state === AFTER_STYLE_2) { this._stateAfterStyle2(c); } else if (this._state === AFTER_STYLE_3) { this._stateAfterStyle3(c); } else if (this._state === AFTER_STYLE_4) { this._stateAfterStyle4(c); } else if (this._state === BEFORE_ENTITY) { /* * entities */ this._stateBeforeEntity(c); } else if (this._state === BEFORE_NUMERIC_ENTITY) { this._stateBeforeNumericEntity(c); } else if (this._state === IN_NAMED_ENTITY) { this._stateInNamedEntity(c); } else if (this._state === IN_NUMERIC_ENTITY) { this._stateInNumericEntity(c); } else if (this._state === IN_HEX_ENTITY) { this._stateInHexEntity(c); } else { this._cbs.onerror(Error("unknown _state"), this._state); } this._index++; } this._cleanup(); }; Tokenizer.prototype.pause = function() { this._running = false; }; Tokenizer.prototype.resume = function() { this._running = true; if (this._index < this._buffer.length) { this._parse(); } if (this._ended) { this._finish(); } }; Tokenizer.prototype.end = function(chunk) { if (this._ended) this._cbs.onerror(Error(".end() after done!")); if (chunk) this.write(chunk); this._ended = true; if (this._running) this._finish(); }; Tokenizer.prototype._finish = function() { //if there is remaining data, emit it in a reasonable way if (this._sectionStart < this._index) { this._handleTrailingData(); } this._cbs.onend(); }; Tokenizer.prototype._handleTrailingData = function() { var data = this._buffer.substr(this._sectionStart); if ( this._state === IN_CDATA || this._state === AFTER_CDATA_1 || this._state === AFTER_CDATA_2 ) { this._cbs.oncdata(data); } else if ( this._state === IN_COMMENT || this._state === AFTER_COMMENT_1 || this._state === AFTER_COMMENT_2 ) { this._cbs.oncomment(data); } else if (this._state === IN_NAMED_ENTITY && !this._xmlMode) { this._parseLegacyEntity(); if (this._sectionStart < this._index) { this._state = this._baseState; this._handleTrailingData(); } } else if (this._state === IN_NUMERIC_ENTITY && !this._xmlMode) { this._decodeNumericEntity(2, 10); if (this._sectionStart < this._index) { this._state = this._baseState; this._handleTrailingData(); } } else if (this._state === IN_HEX_ENTITY && !this._xmlMode) { this._decodeNumericEntity(3, 16); if (this._sectionStart < this._index) { this._state = this._baseState; this._handleTrailingData(); } } else if ( this._state !== IN_TAG_NAME && this._state !== BEFORE_ATTRIBUTE_NAME && this._state !== BEFORE_ATTRIBUTE_VALUE && this._state !== AFTER_ATTRIBUTE_NAME && this._state !== IN_ATTRIBUTE_NAME && this._state !== IN_ATTRIBUTE_VALUE_SQ && this._state !== IN_ATTRIBUTE_VALUE_DQ && this._state !== IN_ATTRIBUTE_VALUE_NQ && this._state !== IN_CLOSING_TAG_NAME ) { this._cbs.ontext(data); } //else, ignore remaining data //TODO add a way to remove current tag }; Tokenizer.prototype.reset = function() { Tokenizer.call( this, { xmlMode: this._xmlMode, decodeEntities: this._decodeEntities }, this._cbs ); }; Tokenizer.prototype.getAbsoluteIndex = function() { return this._bufferOffset + this._index; }; Tokenizer.prototype._getSection = function() { return this._buffer.substring(this._sectionStart, this._index); }; Tokenizer.prototype._emitToken = function(name) { this._cbs[name](this._getSection()); this._sectionStart = -1; }; Tokenizer.prototype._emitPartial = function(value) { if (this._baseState !== TEXT) { this._cbs.onattribdata(value); //TODO implement the new event } else { this._cbs.ontext(value); } }; /***/ }), /* 285 */ /***/ (function(module, exports, __webpack_require__) { var decodeMap = __webpack_require__(286); module.exports = decodeCodePoint; // modified version of https://github.com/mathiasbynens/he/blob/master/src/he.js#L94-L119 function decodeCodePoint(codePoint) { if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) { return "\uFFFD"; } if (codePoint in decodeMap) { codePoint = decodeMap[codePoint]; } var output = ""; if (codePoint > 0xffff) { codePoint -= 0x10000; output += String.fromCharCode(((codePoint >>> 10) & 0x3ff) | 0xd800); codePoint = 0xdc00 | (codePoint & 0x3ff); } output += String.fromCharCode(codePoint); return output; } /***/ }), /* 286 */ /***/ (function(module) { module.exports = JSON.parse("{\"0\":65533,\"128\":8364,\"130\":8218,\"131\":402,\"132\":8222,\"133\":8230,\"134\":8224,\"135\":8225,\"136\":710,\"137\":8240,\"138\":352,\"139\":8249,\"140\":338,\"142\":381,\"145\":8216,\"146\":8217,\"147\":8220,\"148\":8221,\"149\":8226,\"150\":8211,\"151\":8212,\"152\":732,\"153\":8482,\"154\":353,\"155\":8250,\"156\":339,\"158\":382,\"159\":376}"); /***/ }), /* 287 */ /***/ (function(module) { module.exports = JSON.parse("{\"Aacute\":\"Á\",\"aacute\":\"á\",\"Abreve\":\"Ă\",\"abreve\":\"ă\",\"ac\":\"∾\",\"acd\":\"∿\",\"acE\":\"∾̳\",\"Acirc\":\"Â\",\"acirc\":\"â\",\"acute\":\"´\",\"Acy\":\"А\",\"acy\":\"а\",\"AElig\":\"Æ\",\"aelig\":\"æ\",\"af\":\"\",\"Afr\":\"𝔄\",\"afr\":\"𝔞\",\"Agrave\":\"À\",\"agrave\":\"à\",\"alefsym\":\"ℵ\",\"aleph\":\"ℵ\",\"Alpha\":\"Α\",\"alpha\":\"α\",\"Amacr\":\"Ā\",\"amacr\":\"ā\",\"amalg\":\"⨿\",\"amp\":\"&\",\"AMP\":\"&\",\"andand\":\"⩕\",\"And\":\"⩓\",\"and\":\"∧\",\"andd\":\"⩜\",\"andslope\":\"⩘\",\"andv\":\"⩚\",\"ang\":\"∠\",\"ange\":\"⦤\",\"angle\":\"∠\",\"angmsdaa\":\"⦨\",\"angmsdab\":\"⦩\",\"angmsdac\":\"⦪\",\"angmsdad\":\"⦫\",\"angmsdae\":\"⦬\",\"angmsdaf\":\"⦭\",\"angmsdag\":\"⦮\",\"angmsdah\":\"⦯\",\"angmsd\":\"∡\",\"angrt\":\"∟\",\"angrtvb\":\"⊾\",\"angrtvbd\":\"⦝\",\"angsph\":\"∢\",\"angst\":\"Å\",\"angzarr\":\"⍼\",\"Aogon\":\"Ą\",\"aogon\":\"ą\",\"Aopf\":\"𝔸\",\"aopf\":\"𝕒\",\"apacir\":\"⩯\",\"ap\":\"≈\",\"apE\":\"⩰\",\"ape\":\"≊\",\"apid\":\"≋\",\"apos\":\"'\",\"ApplyFunction\":\"\",\"approx\":\"≈\",\"approxeq\":\"≊\",\"Aring\":\"Å\",\"aring\":\"å\",\"Ascr\":\"𝒜\",\"ascr\":\"𝒶\",\"Assign\":\"≔\",\"ast\":\"*\",\"asymp\":\"≈\",\"asympeq\":\"≍\",\"Atilde\":\"Ã\",\"atilde\":\"ã\",\"Auml\":\"Ä\",\"auml\":\"ä\",\"awconint\":\"∳\",\"awint\":\"⨑\",\"backcong\":\"≌\",\"backepsilon\":\"϶\",\"backprime\":\"‵\",\"backsim\":\"∽\",\"backsimeq\":\"⋍\",\"Backslash\":\"∖\",\"Barv\":\"⫧\",\"barvee\":\"⊽\",\"barwed\":\"⌅\",\"Barwed\":\"⌆\",\"barwedge\":\"⌅\",\"bbrk\":\"⎵\",\"bbrktbrk\":\"⎶\",\"bcong\":\"≌\",\"Bcy\":\"Б\",\"bcy\":\"б\",\"bdquo\":\"„\",\"becaus\":\"∵\",\"because\":\"∵\",\"Because\":\"∵\",\"bemptyv\":\"⦰\",\"bepsi\":\"϶\",\"bernou\":\"ℬ\",\"Bernoullis\":\"ℬ\",\"Beta\":\"Β\",\"beta\":\"β\",\"beth\":\"ℶ\",\"between\":\"≬\",\"Bfr\":\"𝔅\",\"bfr\":\"𝔟\",\"bigcap\":\"⋂\",\"bigcirc\":\"◯\",\"bigcup\":\"⋃\",\"bigodot\":\"⨀\",\"bigoplus\":\"⨁\",\"bigotimes\":\"⨂\",\"bigsqcup\":\"⨆\",\"bigstar\":\"★\",\"bigtriangledown\":\"▽\",\"bigtriangleup\":\"△\",\"biguplus\":\"⨄\",\"bigvee\":\"⋁\",\"bigwedge\":\"⋀\",\"bkarow\":\"⤍\",\"blacklozenge\":\"⧫\",\"blacksquare\":\"▪\",\"blacktriangle\":\"▴\",\"blacktriangledown\":\"▾\",\"blacktriangleleft\":\"◂\",\"blacktriangleright\":\"▸\",\"blank\":\"␣\",\"blk12\":\"▒\",\"blk14\":\"░\",\"blk34\":\"▓\",\"block\":\"█\",\"bne\":\"=⃥\",\"bnequiv\":\"≡⃥\",\"bNot\":\"⫭\",\"bnot\":\"⌐\",\"Bopf\":\"𝔹\",\"bopf\":\"𝕓\",\"bot\":\"⊥\",\"bottom\":\"⊥\",\"bowtie\":\"⋈\",\"boxbox\":\"⧉\",\"boxdl\":\"┐\",\"boxdL\":\"╕\",\"boxDl\":\"╖\",\"boxDL\":\"╗\",\"boxdr\":\"┌\",\"boxdR\":\"╒\",\"boxDr\":\"╓\",\"boxDR\":\"╔\",\"boxh\":\"─\",\"boxH\":\"═\",\"boxhd\":\"┬\",\"boxHd\":\"╤\",\"boxhD\":\"╥\",\"boxHD\":\"╦\",\"boxhu\":\"┴\",\"boxHu\":\"╧\",\"boxhU\":\"╨\",\"boxHU\":\"╩\",\"boxminus\":\"⊟\",\"boxplus\":\"⊞\",\"boxtimes\":\"⊠\",\"boxul\":\"┘\",\"boxuL\":\"╛\",\"boxUl\":\"╜\",\"boxUL\":\"╝\",\"boxur\":\"└\",\"boxuR\":\"╘\",\"boxUr\":\"╙\",\"boxUR\":\"╚\",\"boxv\":\"│\",\"boxV\":\"║\",\"boxvh\":\"┼\",\"boxvH\":\"╪\",\"boxVh\":\"╫\",\"boxVH\":\"╬\",\"boxvl\":\"┤\",\"boxvL\":\"╡\",\"boxVl\":\"╢\",\"boxVL\":\"╣\",\"boxvr\":\"├\",\"boxvR\":\"╞\",\"boxVr\":\"╟\",\"boxVR\":\"╠\",\"bprime\":\"‵\",\"breve\":\"˘\",\"Breve\":\"˘\",\"brvbar\":\"¦\",\"bscr\":\"𝒷\",\"Bscr\":\"ℬ\",\"bsemi\":\"⁏\",\"bsim\":\"∽\",\"bsime\":\"⋍\",\"bsolb\":\"⧅\",\"bsol\":\"\\\\\",\"bsolhsub\":\"⟈\",\"bull\":\"•\",\"bullet\":\"•\",\"bump\":\"≎\",\"bumpE\":\"⪮\",\"bumpe\":\"≏\",\"Bumpeq\":\"≎\",\"bumpeq\":\"≏\",\"Cacute\":\"Ć\",\"cacute\":\"ć\",\"capand\":\"⩄\",\"capbrcup\":\"⩉\",\"capcap\":\"⩋\",\"cap\":\"∩\",\"Cap\":\"⋒\",\"capcup\":\"⩇\",\"capdot\":\"⩀\",\"CapitalDifferentialD\":\"ⅅ\",\"caps\":\"∩︀\",\"caret\":\"⁁\",\"caron\":\"ˇ\",\"Cayleys\":\"ℭ\",\"ccaps\":\"⩍\",\"Ccaron\":\"Č\",\"ccaron\":\"č\",\"Ccedil\":\"Ç\",\"ccedil\":\"ç\",\"Ccirc\":\"Ĉ\",\"ccirc\":\"ĉ\",\"Cconint\":\"∰\",\"ccups\":\"⩌\",\"ccupssm\":\"⩐\",\"Cdot\":\"Ċ\",\"cdot\":\"ċ\",\"cedil\":\"¸\",\"Cedilla\":\"¸\",\"cemptyv\":\"⦲\",\"cent\":\"¢\",\"centerdot\":\"·\",\"CenterDot\":\"·\",\"cfr\":\"𝔠\",\"Cfr\":\"ℭ\",\"CHcy\":\"Ч\",\"chcy\":\"ч\",\"check\":\"✓\",\"checkmark\":\"✓\",\"Chi\":\"Χ\",\"chi\":\"χ\",\"circ\":\"ˆ\",\"circeq\":\"≗\",\"circlearrowleft\":\"↺\",\"circlearrowright\":\"↻\",\"circledast\":\"⊛\",\"circledcirc\":\"⊚\",\"circleddash\":\"⊝\",\"CircleDot\":\"⊙\",\"circledR\":\"®\",\"circledS\":\"Ⓢ\",\"CircleMinus\":\"⊖\",\"CirclePlus\":\"⊕\",\"CircleTimes\":\"⊗\",\"cir\":\"○\",\"cirE\":\"⧃\",\"cire\":\"≗\",\"cirfnint\":\"⨐\",\"cirmid\":\"⫯\",\"cirscir\":\"⧂\",\"ClockwiseContourIntegral\":\"∲\",\"CloseCurlyDoubleQuote\":\"”\",\"CloseCurlyQuote\":\"’\",\"clubs\":\"♣\",\"clubsuit\":\"♣\",\"colon\":\":\",\"Colon\":\"∷\",\"Colone\":\"⩴\",\"colone\":\"≔\",\"coloneq\":\"≔\",\"comma\":\",\",\"commat\":\"@\",\"comp\":\"∁\",\"compfn\":\"∘\",\"complement\":\"∁\",\"complexes\":\"ℂ\",\"cong\":\"≅\",\"congdot\":\"⩭\",\"Congruent\":\"≡\",\"conint\":\"∮\",\"Conint\":\"∯\",\"ContourIntegral\":\"∮\",\"copf\":\"𝕔\",\"Copf\":\"ℂ\",\"coprod\":\"∐\",\"Coproduct\":\"∐\",\"copy\":\"©\",\"COPY\":\"©\",\"copysr\":\"℗\",\"CounterClockwiseContourIntegral\":\"∳\",\"crarr\":\"↵\",\"cross\":\"✗\",\"Cross\":\"⨯\",\"Cscr\":\"𝒞\",\"cscr\":\"𝒸\",\"csub\":\"⫏\",\"csube\":\"⫑\",\"csup\":\"⫐\",\"csupe\":\"⫒\",\"ctdot\":\"⋯\",\"cudarrl\":\"⤸\",\"cudarrr\":\"⤵\",\"cuepr\":\"⋞\",\"cuesc\":\"⋟\",\"cularr\":\"↶\",\"cularrp\":\"⤽\",\"cupbrcap\":\"⩈\",\"cupcap\":\"⩆\",\"CupCap\":\"≍\",\"cup\":\"∪\",\"Cup\":\"⋓\",\"cupcup\":\"⩊\",\"cupdot\":\"⊍\",\"cupor\":\"⩅\",\"cups\":\"∪︀\",\"curarr\":\"↷\",\"curarrm\":\"⤼\",\"curlyeqprec\":\"⋞\",\"curlyeqsucc\":\"⋟\",\"curlyvee\":\"⋎\",\"curlywedge\":\"⋏\",\"curren\":\"¤\",\"curvearrowleft\":\"↶\",\"curvearrowright\":\"↷\",\"cuvee\":\"⋎\",\"cuwed\":\"⋏\",\"cwconint\":\"∲\",\"cwint\":\"∱\",\"cylcty\":\"⌭\",\"dagger\":\"†\",\"Dagger\":\"‡\",\"daleth\":\"ℸ\",\"darr\":\"↓\",\"Darr\":\"↡\",\"dArr\":\"⇓\",\"dash\":\"‐\",\"Dashv\":\"⫤\",\"dashv\":\"⊣\",\"dbkarow\":\"⤏\",\"dblac\":\"˝\",\"Dcaron\":\"Ď\",\"dcaron\":\"ď\",\"Dcy\":\"Д\",\"dcy\":\"д\",\"ddagger\":\"‡\",\"ddarr\":\"⇊\",\"DD\":\"ⅅ\",\"dd\":\"ⅆ\",\"DDotrahd\":\"⤑\",\"ddotseq\":\"⩷\",\"deg\":\"°\",\"Del\":\"∇\",\"Delta\":\"Δ\",\"delta\":\"δ\",\"demptyv\":\"⦱\",\"dfisht\":\"⥿\",\"Dfr\":\"𝔇\",\"dfr\":\"𝔡\",\"dHar\":\"⥥\",\"dharl\":\"⇃\",\"dharr\":\"⇂\",\"DiacriticalAcute\":\"´\",\"DiacriticalDot\":\"˙\",\"DiacriticalDoubleAcute\":\"˝\",\"DiacriticalGrave\":\"`\",\"DiacriticalTilde\":\"˜\",\"diam\":\"⋄\",\"diamond\":\"⋄\",\"Diamond\":\"⋄\",\"diamondsuit\":\"♦\",\"diams\":\"♦\",\"die\":\"¨\",\"DifferentialD\":\"ⅆ\",\"digamma\":\"ϝ\",\"disin\":\"⋲\",\"div\":\"÷\",\"divide\":\"÷\",\"divideontimes\":\"⋇\",\"divonx\":\"⋇\",\"DJcy\":\"Ђ\",\"djcy\":\"ђ\",\"dlcorn\":\"⌞\",\"dlcrop\":\"⌍\",\"dollar\":\"$\",\"Dopf\":\"𝔻\",\"dopf\":\"𝕕\",\"Dot\":\"¨\",\"dot\":\"˙\",\"DotDot\":\"⃜\",\"doteq\":\"≐\",\"doteqdot\":\"≑\",\"DotEqual\":\"≐\",\"dotminus\":\"∸\",\"dotplus\":\"∔\",\"dotsquare\":\"⊡\",\"doublebarwedge\":\"⌆\",\"DoubleContourIntegral\":\"∯\",\"DoubleDot\":\"¨\",\"DoubleDownArrow\":\"⇓\",\"DoubleLeftArrow\":\"⇐\",\"DoubleLeftRightArrow\":\"⇔\",\"DoubleLeftTee\":\"⫤\",\"DoubleLongLeftArrow\":\"⟸\",\"DoubleLongLeftRightArrow\":\"⟺\",\"DoubleLongRightArrow\":\"⟹\",\"DoubleRightArrow\":\"⇒\",\"DoubleRightTee\":\"⊨\",\"DoubleUpArrow\":\"⇑\",\"DoubleUpDownArrow\":\"⇕\",\"DoubleVerticalBar\":\"∥\",\"DownArrowBar\":\"⤓\",\"downarrow\":\"↓\",\"DownArrow\":\"↓\",\"Downarrow\":\"⇓\",\"DownArrowUpArrow\":\"⇵\",\"DownBreve\":\"̑\",\"downdownarrows\":\"⇊\",\"downharpoonleft\":\"⇃\",\"downharpoonright\":\"⇂\",\"DownLeftRightVector\":\"⥐\",\"DownLeftTeeVector\":\"⥞\",\"DownLeftVectorBar\":\"⥖\",\"DownLeftVector\":\"↽\",\"DownRightTeeVector\":\"⥟\",\"DownRightVectorBar\":\"⥗\",\"DownRightVector\":\"⇁\",\"DownTeeArrow\":\"↧\",\"DownTee\":\"⊤\",\"drbkarow\":\"⤐\",\"drcorn\":\"⌟\",\"drcrop\":\"⌌\",\"Dscr\":\"𝒟\",\"dscr\":\"𝒹\",\"DScy\":\"Ѕ\",\"dscy\":\"ѕ\",\"dsol\":\"⧶\",\"Dstrok\":\"Đ\",\"dstrok\":\"đ\",\"dtdot\":\"⋱\",\"dtri\":\"▿\",\"dtrif\":\"▾\",\"duarr\":\"⇵\",\"duhar\":\"⥯\",\"dwangle\":\"⦦\",\"DZcy\":\"Џ\",\"dzcy\":\"џ\",\"dzigrarr\":\"⟿\",\"Eacute\":\"É\",\"eacute\":\"é\",\"easter\":\"⩮\",\"Ecaron\":\"Ě\",\"ecaron\":\"ě\",\"Ecirc\":\"Ê\",\"ecirc\":\"ê\",\"ecir\":\"≖\",\"ecolon\":\"≕\",\"Ecy\":\"Э\",\"ecy\":\"э\",\"eDDot\":\"⩷\",\"Edot\":\"Ė\",\"edot\":\"ė\",\"eDot\":\"≑\",\"ee\":\"ⅇ\",\"efDot\":\"≒\",\"Efr\":\"𝔈\",\"efr\":\"𝔢\",\"eg\":\"⪚\",\"Egrave\":\"È\",\"egrave\":\"è\",\"egs\":\"⪖\",\"egsdot\":\"⪘\",\"el\":\"⪙\",\"Element\":\"∈\",\"elinters\":\"⏧\",\"ell\":\"ℓ\",\"els\":\"⪕\",\"elsdot\":\"⪗\",\"Emacr\":\"Ē\",\"emacr\":\"ē\",\"empty\":\"∅\",\"emptyset\":\"∅\",\"EmptySmallSquare\":\"◻\",\"emptyv\":\"∅\",\"EmptyVerySmallSquare\":\"▫\",\"emsp13\":\" \",\"emsp14\":\" \",\"emsp\":\" \",\"ENG\":\"Ŋ\",\"eng\":\"ŋ\",\"ensp\":\" \",\"Eogon\":\"Ę\",\"eogon\":\"ę\",\"Eopf\":\"𝔼\",\"eopf\":\"𝕖\",\"epar\":\"⋕\",\"eparsl\":\"⧣\",\"eplus\":\"⩱\",\"epsi\":\"ε\",\"Epsilon\":\"Ε\",\"epsilon\":\"ε\",\"epsiv\":\"ϵ\",\"eqcirc\":\"≖\",\"eqcolon\":\"≕\",\"eqsim\":\"≂\",\"eqslantgtr\":\"⪖\",\"eqslantless\":\"⪕\",\"Equal\":\"⩵\",\"equals\":\"=\",\"EqualTilde\":\"≂\",\"equest\":\"≟\",\"Equilibrium\":\"⇌\",\"equiv\":\"≡\",\"equivDD\":\"⩸\",\"eqvparsl\":\"⧥\",\"erarr\":\"⥱\",\"erDot\":\"≓\",\"escr\":\"ℯ\",\"Escr\":\"ℰ\",\"esdot\":\"≐\",\"Esim\":\"⩳\",\"esim\":\"≂\",\"Eta\":\"Η\",\"eta\":\"η\",\"ETH\":\"Ð\",\"eth\":\"ð\",\"Euml\":\"Ë\",\"euml\":\"ë\",\"euro\":\"€\",\"excl\":\"!\",\"exist\":\"∃\",\"Exists\":\"∃\",\"expectation\":\"ℰ\",\"exponentiale\":\"ⅇ\",\"ExponentialE\":\"ⅇ\",\"fallingdotseq\":\"≒\",\"Fcy\":\"Ф\",\"fcy\":\"ф\",\"female\":\"♀\",\"ffilig\":\"ffi\",\"fflig\":\"ff\",\"ffllig\":\"ffl\",\"Ffr\":\"𝔉\",\"ffr\":\"𝔣\",\"filig\":\"fi\",\"FilledSmallSquare\":\"◼\",\"FilledVerySmallSquare\":\"▪\",\"fjlig\":\"fj\",\"flat\":\"♭\",\"fllig\":\"fl\",\"fltns\":\"▱\",\"fnof\":\"ƒ\",\"Fopf\":\"𝔽\",\"fopf\":\"𝕗\",\"forall\":\"∀\",\"ForAll\":\"∀\",\"fork\":\"⋔\",\"forkv\":\"⫙\",\"Fouriertrf\":\"ℱ\",\"fpartint\":\"⨍\",\"frac12\":\"½\",\"frac13\":\"⅓\",\"frac14\":\"¼\",\"frac15\":\"⅕\",\"frac16\":\"⅙\",\"frac18\":\"⅛\",\"frac23\":\"⅔\",\"frac25\":\"⅖\",\"frac34\":\"¾\",\"frac35\":\"⅗\",\"frac38\":\"⅜\",\"frac45\":\"⅘\",\"frac56\":\"⅚\",\"frac58\":\"⅝\",\"frac78\":\"⅞\",\"frasl\":\"⁄\",\"frown\":\"⌢\",\"fscr\":\"𝒻\",\"Fscr\":\"ℱ\",\"gacute\":\"ǵ\",\"Gamma\":\"Γ\",\"gamma\":\"γ\",\"Gammad\":\"Ϝ\",\"gammad\":\"ϝ\",\"gap\":\"⪆\",\"Gbreve\":\"Ğ\",\"gbreve\":\"ğ\",\"Gcedil\":\"Ģ\",\"Gcirc\":\"Ĝ\",\"gcirc\":\"ĝ\",\"Gcy\":\"Г\",\"gcy\":\"г\",\"Gdot\":\"Ġ\",\"gdot\":\"ġ\",\"ge\":\"≥\",\"gE\":\"≧\",\"gEl\":\"⪌\",\"gel\":\"⋛\",\"geq\":\"≥\",\"geqq\":\"≧\",\"geqslant\":\"⩾\",\"gescc\":\"⪩\",\"ges\":\"⩾\",\"gesdot\":\"⪀\",\"gesdoto\":\"⪂\",\"gesdotol\":\"⪄\",\"gesl\":\"⋛︀\",\"gesles\":\"⪔\",\"Gfr\":\"𝔊\",\"gfr\":\"𝔤\",\"gg\":\"≫\",\"Gg\":\"⋙\",\"ggg\":\"⋙\",\"gimel\":\"ℷ\",\"GJcy\":\"Ѓ\",\"gjcy\":\"ѓ\",\"gla\":\"⪥\",\"gl\":\"≷\",\"glE\":\"⪒\",\"glj\":\"⪤\",\"gnap\":\"⪊\",\"gnapprox\":\"⪊\",\"gne\":\"⪈\",\"gnE\":\"≩\",\"gneq\":\"⪈\",\"gneqq\":\"≩\",\"gnsim\":\"⋧\",\"Gopf\":\"𝔾\",\"gopf\":\"𝕘\",\"grave\":\"`\",\"GreaterEqual\":\"≥\",\"GreaterEqualLess\":\"⋛\",\"GreaterFullEqual\":\"≧\",\"GreaterGreater\":\"⪢\",\"GreaterLess\":\"≷\",\"GreaterSlantEqual\":\"⩾\",\"GreaterTilde\":\"≳\",\"Gscr\":\"𝒢\",\"gscr\":\"ℊ\",\"gsim\":\"≳\",\"gsime\":\"⪎\",\"gsiml\":\"⪐\",\"gtcc\":\"⪧\",\"gtcir\":\"⩺\",\"gt\":\">\",\"GT\":\">\",\"Gt\":\"≫\",\"gtdot\":\"⋗\",\"gtlPar\":\"⦕\",\"gtquest\":\"⩼\",\"gtrapprox\":\"⪆\",\"gtrarr\":\"⥸\",\"gtrdot\":\"⋗\",\"gtreqless\":\"⋛\",\"gtreqqless\":\"⪌\",\"gtrless\":\"≷\",\"gtrsim\":\"≳\",\"gvertneqq\":\"≩︀\",\"gvnE\":\"≩︀\",\"Hacek\":\"ˇ\",\"hairsp\":\" \",\"half\":\"½\",\"hamilt\":\"ℋ\",\"HARDcy\":\"Ъ\",\"hardcy\":\"ъ\",\"harrcir\":\"⥈\",\"harr\":\"↔\",\"hArr\":\"⇔\",\"harrw\":\"↭\",\"Hat\":\"^\",\"hbar\":\"ℏ\",\"Hcirc\":\"Ĥ\",\"hcirc\":\"ĥ\",\"hearts\":\"♥\",\"heartsuit\":\"♥\",\"hellip\":\"…\",\"hercon\":\"⊹\",\"hfr\":\"𝔥\",\"Hfr\":\"ℌ\",\"HilbertSpace\":\"ℋ\",\"hksearow\":\"⤥\",\"hkswarow\":\"⤦\",\"hoarr\":\"⇿\",\"homtht\":\"∻\",\"hookleftarrow\":\"↩\",\"hookrightarrow\":\"↪\",\"hopf\":\"𝕙\",\"Hopf\":\"ℍ\",\"horbar\":\"―\",\"HorizontalLine\":\"─\",\"hscr\":\"𝒽\",\"Hscr\":\"ℋ\",\"hslash\":\"ℏ\",\"Hstrok\":\"Ħ\",\"hstrok\":\"ħ\",\"HumpDownHump\":\"≎\",\"HumpEqual\":\"≏\",\"hybull\":\"⁃\",\"hyphen\":\"‐\",\"Iacute\":\"Í\",\"iacute\":\"í\",\"ic\":\"\",\"Icirc\":\"Î\",\"icirc\":\"î\",\"Icy\":\"И\",\"icy\":\"и\",\"Idot\":\"İ\",\"IEcy\":\"Е\",\"iecy\":\"е\",\"iexcl\":\"¡\",\"iff\":\"⇔\",\"ifr\":\"𝔦\",\"Ifr\":\"ℑ\",\"Igrave\":\"Ì\",\"igrave\":\"ì\",\"ii\":\"ⅈ\",\"iiiint\":\"⨌\",\"iiint\":\"∭\",\"iinfin\":\"⧜\",\"iiota\":\"℩\",\"IJlig\":\"IJ\",\"ijlig\":\"ij\",\"Imacr\":\"Ī\",\"imacr\":\"ī\",\"image\":\"ℑ\",\"ImaginaryI\":\"ⅈ\",\"imagline\":\"ℐ\",\"imagpart\":\"ℑ\",\"imath\":\"ı\",\"Im\":\"ℑ\",\"imof\":\"⊷\",\"imped\":\"Ƶ\",\"Implies\":\"⇒\",\"incare\":\"℅\",\"in\":\"∈\",\"infin\":\"∞\",\"infintie\":\"⧝\",\"inodot\":\"ı\",\"intcal\":\"⊺\",\"int\":\"∫\",\"Int\":\"∬\",\"integers\":\"ℤ\",\"Integral\":\"∫\",\"intercal\":\"⊺\",\"Intersection\":\"⋂\",\"intlarhk\":\"⨗\",\"intprod\":\"⨼\",\"InvisibleComma\":\"\",\"InvisibleTimes\":\"\",\"IOcy\":\"Ё\",\"iocy\":\"ё\",\"Iogon\":\"Į\",\"iogon\":\"į\",\"Iopf\":\"𝕀\",\"iopf\":\"𝕚\",\"Iota\":\"Ι\",\"iota\":\"ι\",\"iprod\":\"⨼\",\"iquest\":\"¿\",\"iscr\":\"𝒾\",\"Iscr\":\"ℐ\",\"isin\":\"∈\",\"isindot\":\"⋵\",\"isinE\":\"⋹\",\"isins\":\"⋴\",\"isinsv\":\"⋳\",\"isinv\":\"∈\",\"it\":\"\",\"Itilde\":\"Ĩ\",\"itilde\":\"ĩ\",\"Iukcy\":\"І\",\"iukcy\":\"і\",\"Iuml\":\"Ï\",\"iuml\":\"ï\",\"Jcirc\":\"Ĵ\",\"jcirc\":\"ĵ\",\"Jcy\":\"Й\",\"jcy\":\"й\",\"Jfr\":\"𝔍\",\"jfr\":\"𝔧\",\"jmath\":\"ȷ\",\"Jopf\":\"𝕁\",\"jopf\":\"𝕛\",\"Jscr\":\"𝒥\",\"jscr\":\"𝒿\",\"Jsercy\":\"Ј\",\"jsercy\":\"ј\",\"Jukcy\":\"Є\",\"jukcy\":\"є\",\"Kappa\":\"Κ\",\"kappa\":\"κ\",\"kappav\":\"ϰ\",\"Kcedil\":\"Ķ\",\"kcedil\":\"ķ\",\"Kcy\":\"К\",\"kcy\":\"к\",\"Kfr\":\"𝔎\",\"kfr\":\"𝔨\",\"kgreen\":\"ĸ\",\"KHcy\":\"Х\",\"khcy\":\"х\",\"KJcy\":\"Ќ\",\"kjcy\":\"ќ\",\"Kopf\":\"𝕂\",\"kopf\":\"𝕜\",\"Kscr\":\"𝒦\",\"kscr\":\"𝓀\",\"lAarr\":\"⇚\",\"Lacute\":\"Ĺ\",\"lacute\":\"ĺ\",\"laemptyv\":\"⦴\",\"lagran\":\"ℒ\",\"Lambda\":\"Λ\",\"lambda\":\"λ\",\"lang\":\"⟨\",\"Lang\":\"⟪\",\"langd\":\"⦑\",\"langle\":\"⟨\",\"lap\":\"⪅\",\"Laplacetrf\":\"ℒ\",\"laquo\":\"«\",\"larrb\":\"⇤\",\"larrbfs\":\"⤟\",\"larr\":\"←\",\"Larr\":\"↞\",\"lArr\":\"⇐\",\"larrfs\":\"⤝\",\"larrhk\":\"↩\",\"larrlp\":\"↫\",\"larrpl\":\"⤹\",\"larrsim\":\"⥳\",\"larrtl\":\"↢\",\"latail\":\"⤙\",\"lAtail\":\"⤛\",\"lat\":\"⪫\",\"late\":\"⪭\",\"lates\":\"⪭︀\",\"lbarr\":\"⤌\",\"lBarr\":\"⤎\",\"lbbrk\":\"❲\",\"lbrace\":\"{\",\"lbrack\":\"[\",\"lbrke\":\"⦋\",\"lbrksld\":\"⦏\",\"lbrkslu\":\"⦍\",\"Lcaron\":\"Ľ\",\"lcaron\":\"ľ\",\"Lcedil\":\"Ļ\",\"lcedil\":\"ļ\",\"lceil\":\"⌈\",\"lcub\":\"{\",\"Lcy\":\"Л\",\"lcy\":\"л\",\"ldca\":\"⤶\",\"ldquo\":\"“\",\"ldquor\":\"„\",\"ldrdhar\":\"⥧\",\"ldrushar\":\"⥋\",\"ldsh\":\"↲\",\"le\":\"≤\",\"lE\":\"≦\",\"LeftAngleBracket\":\"⟨\",\"LeftArrowBar\":\"⇤\",\"leftarrow\":\"←\",\"LeftArrow\":\"←\",\"Leftarrow\":\"⇐\",\"LeftArrowRightArrow\":\"⇆\",\"leftarrowtail\":\"↢\",\"LeftCeiling\":\"⌈\",\"LeftDoubleBracket\":\"⟦\",\"LeftDownTeeVector\":\"⥡\",\"LeftDownVectorBar\":\"⥙\",\"LeftDownVector\":\"⇃\",\"LeftFloor\":\"⌊\",\"leftharpoondown\":\"↽\",\"leftharpoonup\":\"↼\",\"leftleftarrows\":\"⇇\",\"leftrightarrow\":\"↔\",\"LeftRightArrow\":\"↔\",\"Leftrightarrow\":\"⇔\",\"leftrightarrows\":\"⇆\",\"leftrightharpoons\":\"⇋\",\"leftrightsquigarrow\":\"↭\",\"LeftRightVector\":\"⥎\",\"LeftTeeArrow\":\"↤\",\"LeftTee\":\"⊣\",\"LeftTeeVector\":\"⥚\",\"leftthreetimes\":\"⋋\",\"LeftTriangleBar\":\"⧏\",\"LeftTriangle\":\"⊲\",\"LeftTriangleEqual\":\"⊴\",\"LeftUpDownVector\":\"⥑\",\"LeftUpTeeVector\":\"⥠\",\"LeftUpVectorBar\":\"⥘\",\"LeftUpVector\":\"↿\",\"LeftVectorBar\":\"⥒\",\"LeftVector\":\"↼\",\"lEg\":\"⪋\",\"leg\":\"⋚\",\"leq\":\"≤\",\"leqq\":\"≦\",\"leqslant\":\"⩽\",\"lescc\":\"⪨\",\"les\":\"⩽\",\"lesdot\":\"⩿\",\"lesdoto\":\"⪁\",\"lesdotor\":\"⪃\",\"lesg\":\"⋚︀\",\"lesges\":\"⪓\",\"lessapprox\":\"⪅\",\"lessdot\":\"⋖\",\"lesseqgtr\":\"⋚\",\"lesseqqgtr\":\"⪋\",\"LessEqualGreater\":\"⋚\",\"LessFullEqual\":\"≦\",\"LessGreater\":\"≶\",\"lessgtr\":\"≶\",\"LessLess\":\"⪡\",\"lesssim\":\"≲\",\"LessSlantEqual\":\"⩽\",\"LessTilde\":\"≲\",\"lfisht\":\"⥼\",\"lfloor\":\"⌊\",\"Lfr\":\"𝔏\",\"lfr\":\"𝔩\",\"lg\":\"≶\",\"lgE\":\"⪑\",\"lHar\":\"⥢\",\"lhard\":\"↽\",\"lharu\":\"↼\",\"lharul\":\"⥪\",\"lhblk\":\"▄\",\"LJcy\":\"Љ\",\"ljcy\":\"љ\",\"llarr\":\"⇇\",\"ll\":\"≪\",\"Ll\":\"⋘\",\"llcorner\":\"⌞\",\"Lleftarrow\":\"⇚\",\"llhard\":\"⥫\",\"lltri\":\"◺\",\"Lmidot\":\"Ŀ\",\"lmidot\":\"ŀ\",\"lmoustache\":\"⎰\",\"lmoust\":\"⎰\",\"lnap\":\"⪉\",\"lnapprox\":\"⪉\",\"lne\":\"⪇\",\"lnE\":\"≨\",\"lneq\":\"⪇\",\"lneqq\":\"≨\",\"lnsim\":\"⋦\",\"loang\":\"⟬\",\"loarr\":\"⇽\",\"lobrk\":\"⟦\",\"longleftarrow\":\"⟵\",\"LongLeftArrow\":\"⟵\",\"Longleftarrow\":\"⟸\",\"longleftrightarrow\":\"⟷\",\"LongLeftRightArrow\":\"⟷\",\"Longleftrightarrow\":\"⟺\",\"longmapsto\":\"⟼\",\"longrightarrow\":\"⟶\",\"LongRightArrow\":\"⟶\",\"Longrightarrow\":\"⟹\",\"looparrowleft\":\"↫\",\"looparrowright\":\"↬\",\"lopar\":\"⦅\",\"Lopf\":\"𝕃\",\"lopf\":\"𝕝\",\"loplus\":\"⨭\",\"lotimes\":\"⨴\",\"lowast\":\"∗\",\"lowbar\":\"_\",\"LowerLeftArrow\":\"↙\",\"LowerRightArrow\":\"↘\",\"loz\":\"◊\",\"lozenge\":\"◊\",\"lozf\":\"⧫\",\"lpar\":\"(\",\"lparlt\":\"⦓\",\"lrarr\":\"⇆\",\"lrcorner\":\"⌟\",\"lrhar\":\"⇋\",\"lrhard\":\"⥭\",\"lrm\":\"\",\"lrtri\":\"⊿\",\"lsaquo\":\"‹\",\"lscr\":\"𝓁\",\"Lscr\":\"ℒ\",\"lsh\":\"↰\",\"Lsh\":\"↰\",\"lsim\":\"≲\",\"lsime\":\"⪍\",\"lsimg\":\"⪏\",\"lsqb\":\"[\",\"lsquo\":\"‘\",\"lsquor\":\"‚\",\"Lstrok\":\"Ł\",\"lstrok\":\"ł\",\"ltcc\":\"⪦\",\"ltcir\":\"⩹\",\"lt\":\"<\",\"LT\":\"<\",\"Lt\":\"≪\",\"ltdot\":\"⋖\",\"lthree\":\"⋋\",\"ltimes\":\"⋉\",\"ltlarr\":\"⥶\",\"ltquest\":\"⩻\",\"ltri\":\"◃\",\"ltrie\":\"⊴\",\"ltrif\":\"◂\",\"ltrPar\":\"⦖\",\"lurdshar\":\"⥊\",\"luruhar\":\"⥦\",\"lvertneqq\":\"≨︀\",\"lvnE\":\"≨︀\",\"macr\":\"¯\",\"male\":\"♂\",\"malt\":\"✠\",\"maltese\":\"✠\",\"Map\":\"⤅\",\"map\":\"↦\",\"mapsto\":\"↦\",\"mapstodown\":\"↧\",\"mapstoleft\":\"↤\",\"mapstoup\":\"↥\",\"marker\":\"▮\",\"mcomma\":\"⨩\",\"Mcy\":\"М\",\"mcy\":\"м\",\"mdash\":\"—\",\"mDDot\":\"∺\",\"measuredangle\":\"∡\",\"MediumSpace\":\" \",\"Mellintrf\":\"ℳ\",\"Mfr\":\"𝔐\",\"mfr\":\"𝔪\",\"mho\":\"℧\",\"micro\":\"µ\",\"midast\":\"*\",\"midcir\":\"⫰\",\"mid\":\"∣\",\"middot\":\"·\",\"minusb\":\"⊟\",\"minus\":\"−\",\"minusd\":\"∸\",\"minusdu\":\"⨪\",\"MinusPlus\":\"∓\",\"mlcp\":\"⫛\",\"mldr\":\"…\",\"mnplus\":\"∓\",\"models\":\"⊧\",\"Mopf\":\"𝕄\",\"mopf\":\"𝕞\",\"mp\":\"∓\",\"mscr\":\"𝓂\",\"Mscr\":\"ℳ\",\"mstpos\":\"∾\",\"Mu\":\"Μ\",\"mu\":\"μ\",\"multimap\":\"⊸\",\"mumap\":\"⊸\",\"nabla\":\"∇\",\"Nacute\":\"Ń\",\"nacute\":\"ń\",\"nang\":\"∠⃒\",\"nap\":\"≉\",\"napE\":\"⩰̸\",\"napid\":\"≋̸\",\"napos\":\"ʼn\",\"napprox\":\"≉\",\"natural\":\"♮\",\"naturals\":\"ℕ\",\"natur\":\"♮\",\"nbsp\":\" \",\"nbump\":\"≎̸\",\"nbumpe\":\"≏̸\",\"ncap\":\"⩃\",\"Ncaron\":\"Ň\",\"ncaron\":\"ň\",\"Ncedil\":\"Ņ\",\"ncedil\":\"ņ\",\"ncong\":\"≇\",\"ncongdot\":\"⩭̸\",\"ncup\":\"⩂\",\"Ncy\":\"Н\",\"ncy\":\"н\",\"ndash\":\"–\",\"nearhk\":\"⤤\",\"nearr\":\"↗\",\"neArr\":\"⇗\",\"nearrow\":\"↗\",\"ne\":\"≠\",\"nedot\":\"≐̸\",\"NegativeMediumSpace\":\"\",\"NegativeThickSpace\":\"\",\"NegativeThinSpace\":\"\",\"NegativeVeryThinSpace\":\"\",\"nequiv\":\"≢\",\"nesear\":\"⤨\",\"nesim\":\"≂̸\",\"NestedGreaterGreater\":\"≫\",\"NestedLessLess\":\"≪\",\"NewLine\":\"\\n\",\"nexist\":\"∄\",\"nexists\":\"∄\",\"Nfr\":\"𝔑\",\"nfr\":\"𝔫\",\"ngE\":\"≧̸\",\"nge\":\"≱\",\"ngeq\":\"≱\",\"ngeqq\":\"≧̸\",\"ngeqslant\":\"⩾̸\",\"nges\":\"⩾̸\",\"nGg\":\"⋙̸\",\"ngsim\":\"≵\",\"nGt\":\"≫⃒\",\"ngt\":\"≯\",\"ngtr\":\"≯\",\"nGtv\":\"≫̸\",\"nharr\":\"↮\",\"nhArr\":\"⇎\",\"nhpar\":\"⫲\",\"ni\":\"∋\",\"nis\":\"⋼\",\"nisd\":\"⋺\",\"niv\":\"∋\",\"NJcy\":\"Њ\",\"njcy\":\"њ\",\"nlarr\":\"↚\",\"nlArr\":\"⇍\",\"nldr\":\"‥\",\"nlE\":\"≦̸\",\"nle\":\"≰\",\"nleftarrow\":\"↚\",\"nLeftarrow\":\"⇍\",\"nleftrightarrow\":\"↮\",\"nLeftrightarrow\":\"⇎\",\"nleq\":\"≰\",\"nleqq\":\"≦̸\",\"nleqslant\":\"⩽̸\",\"nles\":\"⩽̸\",\"nless\":\"≮\",\"nLl\":\"⋘̸\",\"nlsim\":\"≴\",\"nLt\":\"≪⃒\",\"nlt\":\"≮\",\"nltri\":\"⋪\",\"nltrie\":\"⋬\",\"nLtv\":\"≪̸\",\"nmid\":\"∤\",\"NoBreak\":\"\",\"NonBreakingSpace\":\" \",\"nopf\":\"𝕟\",\"Nopf\":\"ℕ\",\"Not\":\"⫬\",\"not\":\"¬\",\"NotCongruent\":\"≢\",\"NotCupCap\":\"≭\",\"NotDoubleVerticalBar\":\"∦\",\"NotElement\":\"∉\",\"NotEqual\":\"≠\",\"NotEqualTilde\":\"≂̸\",\"NotExists\":\"∄\",\"NotGreater\":\"≯\",\"NotGreaterEqual\":\"≱\",\"NotGreaterFullEqual\":\"≧̸\",\"NotGreaterGreater\":\"≫̸\",\"NotGreaterLess\":\"≹\",\"NotGreaterSlantEqual\":\"⩾̸\",\"NotGreaterTilde\":\"≵\",\"NotHumpDownHump\":\"≎̸\",\"NotHumpEqual\":\"≏̸\",\"notin\":\"∉\",\"notindot\":\"⋵̸\",\"notinE\":\"⋹̸\",\"notinva\":\"∉\",\"notinvb\":\"⋷\",\"notinvc\":\"⋶\",\"NotLeftTriangleBar\":\"⧏̸\",\"NotLeftTriangle\":\"⋪\",\"NotLeftTriangleEqual\":\"⋬\",\"NotLess\":\"≮\",\"NotLessEqual\":\"≰\",\"NotLessGreater\":\"≸\",\"NotLessLess\":\"≪̸\",\"NotLessSlantEqual\":\"⩽̸\",\"NotLessTilde\":\"≴\",\"NotNestedGreaterGreater\":\"⪢̸\",\"NotNestedLessLess\":\"⪡̸\",\"notni\":\"∌\",\"notniva\":\"∌\",\"notnivb\":\"⋾\",\"notnivc\":\"⋽\",\"NotPrecedes\":\"⊀\",\"NotPrecedesEqual\":\"⪯̸\",\"NotPrecedesSlantEqual\":\"⋠\",\"NotReverseElement\":\"∌\",\"NotRightTriangleBar\":\"⧐̸\",\"NotRightTriangle\":\"⋫\",\"NotRightTriangleEqual\":\"⋭\",\"NotSquareSubset\":\"⊏̸\",\"NotSquareSubsetEqual\":\"⋢\",\"NotSquareSuperset\":\"⊐̸\",\"NotSquareSupersetEqual\":\"⋣\",\"NotSubset\":\"⊂⃒\",\"NotSubsetEqual\":\"⊈\",\"NotSucceeds\":\"⊁\",\"NotSucceedsEqual\":\"⪰̸\",\"NotSucceedsSlantEqual\":\"⋡\",\"NotSucceedsTilde\":\"≿̸\",\"NotSuperset\":\"⊃⃒\",\"NotSupersetEqual\":\"⊉\",\"NotTilde\":\"≁\",\"NotTildeEqual\":\"≄\",\"NotTildeFullEqual\":\"≇\",\"NotTildeTilde\":\"≉\",\"NotVerticalBar\":\"∤\",\"nparallel\":\"∦\",\"npar\":\"∦\",\"nparsl\":\"⫽⃥\",\"npart\":\"∂̸\",\"npolint\":\"⨔\",\"npr\":\"⊀\",\"nprcue\":\"⋠\",\"nprec\":\"⊀\",\"npreceq\":\"⪯̸\",\"npre\":\"⪯̸\",\"nrarrc\":\"⤳̸\",\"nrarr\":\"↛\",\"nrArr\":\"⇏\",\"nrarrw\":\"↝̸\",\"nrightarrow\":\"↛\",\"nRightarrow\":\"⇏\",\"nrtri\":\"⋫\",\"nrtrie\":\"⋭\",\"nsc\":\"⊁\",\"nsccue\":\"⋡\",\"nsce\":\"⪰̸\",\"Nscr\":\"𝒩\",\"nscr\":\"𝓃\",\"nshortmid\":\"∤\",\"nshortparallel\":\"∦\",\"nsim\":\"≁\",\"nsime\":\"≄\",\"nsimeq\":\"≄\",\"nsmid\":\"∤\",\"nspar\":\"∦\",\"nsqsube\":\"⋢\",\"nsqsupe\":\"⋣\",\"nsub\":\"⊄\",\"nsubE\":\"⫅̸\",\"nsube\":\"⊈\",\"nsubset\":\"⊂⃒\",\"nsubseteq\":\"⊈\",\"nsubseteqq\":\"⫅̸\",\"nsucc\":\"⊁\",\"nsucceq\":\"⪰̸\",\"nsup\":\"⊅\",\"nsupE\":\"⫆̸\",\"nsupe\":\"⊉\",\"nsupset\":\"⊃⃒\",\"nsupseteq\":\"⊉\",\"nsupseteqq\":\"⫆̸\",\"ntgl\":\"≹\",\"Ntilde\":\"Ñ\",\"ntilde\":\"ñ\",\"ntlg\":\"≸\",\"ntriangleleft\":\"⋪\",\"ntrianglelefteq\":\"⋬\",\"ntriangleright\":\"⋫\",\"ntrianglerighteq\":\"⋭\",\"Nu\":\"Ν\",\"nu\":\"ν\",\"num\":\"#\",\"numero\":\"№\",\"numsp\":\" \",\"nvap\":\"≍⃒\",\"nvdash\":\"⊬\",\"nvDash\":\"⊭\",\"nVdash\":\"⊮\",\"nVDash\":\"⊯\",\"nvge\":\"≥⃒\",\"nvgt\":\">⃒\",\"nvHarr\":\"⤄\",\"nvinfin\":\"⧞\",\"nvlArr\":\"⤂\",\"nvle\":\"≤⃒\",\"nvlt\":\"<⃒\",\"nvltrie\":\"⊴⃒\",\"nvrArr\":\"⤃\",\"nvrtrie\":\"⊵⃒\",\"nvsim\":\"∼⃒\",\"nwarhk\":\"⤣\",\"nwarr\":\"↖\",\"nwArr\":\"⇖\",\"nwarrow\":\"↖\",\"nwnear\":\"⤧\",\"Oacute\":\"Ó\",\"oacute\":\"ó\",\"oast\":\"⊛\",\"Ocirc\":\"Ô\",\"ocirc\":\"ô\",\"ocir\":\"⊚\",\"Ocy\":\"О\",\"ocy\":\"о\",\"odash\":\"⊝\",\"Odblac\":\"Ő\",\"odblac\":\"ő\",\"odiv\":\"⨸\",\"odot\":\"⊙\",\"odsold\":\"⦼\",\"OElig\":\"Œ\",\"oelig\":\"œ\",\"ofcir\":\"⦿\",\"Ofr\":\"𝔒\",\"ofr\":\"𝔬\",\"ogon\":\"˛\",\"Ograve\":\"Ò\",\"ograve\":\"ò\",\"ogt\":\"⧁\",\"ohbar\":\"⦵\",\"ohm\":\"Ω\",\"oint\":\"∮\",\"olarr\":\"↺\",\"olcir\":\"⦾\",\"olcross\":\"⦻\",\"oline\":\"‾\",\"olt\":\"⧀\",\"Omacr\":\"Ō\",\"omacr\":\"ō\",\"Omega\":\"Ω\",\"omega\":\"ω\",\"Omicron\":\"Ο\",\"omicron\":\"ο\",\"omid\":\"⦶\",\"ominus\":\"⊖\",\"Oopf\":\"𝕆\",\"oopf\":\"𝕠\",\"opar\":\"⦷\",\"OpenCurlyDoubleQuote\":\"“\",\"OpenCurlyQuote\":\"‘\",\"operp\":\"⦹\",\"oplus\":\"⊕\",\"orarr\":\"↻\",\"Or\":\"⩔\",\"or\":\"∨\",\"ord\":\"⩝\",\"order\":\"ℴ\",\"orderof\":\"ℴ\",\"ordf\":\"ª\",\"ordm\":\"º\",\"origof\":\"⊶\",\"oror\":\"⩖\",\"orslope\":\"⩗\",\"orv\":\"⩛\",\"oS\":\"Ⓢ\",\"Oscr\":\"𝒪\",\"oscr\":\"ℴ\",\"Oslash\":\"Ø\",\"oslash\":\"ø\",\"osol\":\"⊘\",\"Otilde\":\"Õ\",\"otilde\":\"õ\",\"otimesas\":\"⨶\",\"Otimes\":\"⨷\",\"otimes\":\"⊗\",\"Ouml\":\"Ö\",\"ouml\":\"ö\",\"ovbar\":\"⌽\",\"OverBar\":\"‾\",\"OverBrace\":\"⏞\",\"OverBracket\":\"⎴\",\"OverParenthesis\":\"⏜\",\"para\":\"¶\",\"parallel\":\"∥\",\"par\":\"∥\",\"parsim\":\"⫳\",\"parsl\":\"⫽\",\"part\":\"∂\",\"PartialD\":\"∂\",\"Pcy\":\"П\",\"pcy\":\"п\",\"percnt\":\"%\",\"period\":\".\",\"permil\":\"‰\",\"perp\":\"⊥\",\"pertenk\":\"‱\",\"Pfr\":\"𝔓\",\"pfr\":\"𝔭\",\"Phi\":\"Φ\",\"phi\":\"φ\",\"phiv\":\"ϕ\",\"phmmat\":\"ℳ\",\"phone\":\"☎\",\"Pi\":\"Π\",\"pi\":\"π\",\"pitchfork\":\"⋔\",\"piv\":\"ϖ\",\"planck\":\"ℏ\",\"planckh\":\"ℎ\",\"plankv\":\"ℏ\",\"plusacir\":\"⨣\",\"plusb\":\"⊞\",\"pluscir\":\"⨢\",\"plus\":\"+\",\"plusdo\":\"∔\",\"plusdu\":\"⨥\",\"pluse\":\"⩲\",\"PlusMinus\":\"±\",\"plusmn\":\"±\",\"plussim\":\"⨦\",\"plustwo\":\"⨧\",\"pm\":\"±\",\"Poincareplane\":\"ℌ\",\"pointint\":\"⨕\",\"popf\":\"𝕡\",\"Popf\":\"ℙ\",\"pound\":\"£\",\"prap\":\"⪷\",\"Pr\":\"⪻\",\"pr\":\"≺\",\"prcue\":\"≼\",\"precapprox\":\"⪷\",\"prec\":\"≺\",\"preccurlyeq\":\"≼\",\"Precedes\":\"≺\",\"PrecedesEqual\":\"⪯\",\"PrecedesSlantEqual\":\"≼\",\"PrecedesTilde\":\"≾\",\"preceq\":\"⪯\",\"precnapprox\":\"⪹\",\"precneqq\":\"⪵\",\"precnsim\":\"⋨\",\"pre\":\"⪯\",\"prE\":\"⪳\",\"precsim\":\"≾\",\"prime\":\"′\",\"Prime\":\"″\",\"primes\":\"ℙ\",\"prnap\":\"⪹\",\"prnE\":\"⪵\",\"prnsim\":\"⋨\",\"prod\":\"∏\",\"Product\":\"∏\",\"profalar\":\"⌮\",\"profline\":\"⌒\",\"profsurf\":\"⌓\",\"prop\":\"∝\",\"Proportional\":\"∝\",\"Proportion\":\"∷\",\"propto\":\"∝\",\"prsim\":\"≾\",\"prurel\":\"⊰\",\"Pscr\":\"𝒫\",\"pscr\":\"𝓅\",\"Psi\":\"Ψ\",\"psi\":\"ψ\",\"puncsp\":\" \",\"Qfr\":\"𝔔\",\"qfr\":\"𝔮\",\"qint\":\"⨌\",\"qopf\":\"𝕢\",\"Qopf\":\"ℚ\",\"qprime\":\"⁗\",\"Qscr\":\"𝒬\",\"qscr\":\"𝓆\",\"quaternions\":\"ℍ\",\"quatint\":\"⨖\",\"quest\":\"?\",\"questeq\":\"≟\",\"quot\":\"\\\"\",\"QUOT\":\"\\\"\",\"rAarr\":\"⇛\",\"race\":\"∽̱\",\"Racute\":\"Ŕ\",\"racute\":\"ŕ\",\"radic\":\"√\",\"raemptyv\":\"⦳\",\"rang\":\"⟩\",\"Rang\":\"⟫\",\"rangd\":\"⦒\",\"range\":\"⦥\",\"rangle\":\"⟩\",\"raquo\":\"»\",\"rarrap\":\"⥵\",\"rarrb\":\"⇥\",\"rarrbfs\":\"⤠\",\"rarrc\":\"⤳\",\"rarr\":\"→\",\"Rarr\":\"↠\",\"rArr\":\"⇒\",\"rarrfs\":\"⤞\",\"rarrhk\":\"↪\",\"rarrlp\":\"↬\",\"rarrpl\":\"⥅\",\"rarrsim\":\"⥴\",\"Rarrtl\":\"⤖\",\"rarrtl\":\"↣\",\"rarrw\":\"↝\",\"ratail\":\"⤚\",\"rAtail\":\"⤜\",\"ratio\":\"∶\",\"rationals\":\"ℚ\",\"rbarr\":\"⤍\",\"rBarr\":\"⤏\",\"RBarr\":\"⤐\",\"rbbrk\":\"❳\",\"rbrace\":\"}\",\"rbrack\":\"]\",\"rbrke\":\"⦌\",\"rbrksld\":\"⦎\",\"rbrkslu\":\"⦐\",\"Rcaron\":\"Ř\",\"rcaron\":\"ř\",\"Rcedil\":\"Ŗ\",\"rcedil\":\"ŗ\",\"rceil\":\"⌉\",\"rcub\":\"}\",\"Rcy\":\"Р\",\"rcy\":\"р\",\"rdca\":\"⤷\",\"rdldhar\":\"⥩\",\"rdquo\":\"”\",\"rdquor\":\"”\",\"rdsh\":\"↳\",\"real\":\"ℜ\",\"realine\":\"ℛ\",\"realpart\":\"ℜ\",\"reals\":\"ℝ\",\"Re\":\"ℜ\",\"rect\":\"▭\",\"reg\":\"®\",\"REG\":\"®\",\"ReverseElement\":\"∋\",\"ReverseEquilibrium\":\"⇋\",\"ReverseUpEquilibrium\":\"⥯\",\"rfisht\":\"⥽\",\"rfloor\":\"⌋\",\"rfr\":\"𝔯\",\"Rfr\":\"ℜ\",\"rHar\":\"⥤\",\"rhard\":\"⇁\",\"rharu\":\"⇀\",\"rharul\":\"⥬\",\"Rho\":\"Ρ\",\"rho\":\"ρ\",\"rhov\":\"ϱ\",\"RightAngleBracket\":\"⟩\",\"RightArrowBar\":\"⇥\",\"rightarrow\":\"→\",\"RightArrow\":\"→\",\"Rightarrow\":\"⇒\",\"RightArrowLeftArrow\":\"⇄\",\"rightarrowtail\":\"↣\",\"RightCeiling\":\"⌉\",\"RightDoubleBracket\":\"⟧\",\"RightDownTeeVector\":\"⥝\",\"RightDownVectorBar\":\"⥕\",\"RightDownVector\":\"⇂\",\"RightFloor\":\"⌋\",\"rightharpoondown\":\"⇁\",\"rightharpoonup\":\"⇀\",\"rightleftarrows\":\"⇄\",\"rightleftharpoons\":\"⇌\",\"rightrightarrows\":\"⇉\",\"rightsquigarrow\":\"↝\",\"RightTeeArrow\":\"↦\",\"RightTee\":\"⊢\",\"RightTeeVector\":\"⥛\",\"rightthreetimes\":\"⋌\",\"RightTriangleBar\":\"⧐\",\"RightTriangle\":\"⊳\",\"RightTriangleEqual\":\"⊵\",\"RightUpDownVector\":\"⥏\",\"RightUpTeeVector\":\"⥜\",\"RightUpVectorBar\":\"⥔\",\"RightUpVector\":\"↾\",\"RightVectorBar\":\"⥓\",\"RightVector\":\"⇀\",\"ring\":\"˚\",\"risingdotseq\":\"≓\",\"rlarr\":\"⇄\",\"rlhar\":\"⇌\",\"rlm\":\"\",\"rmoustache\":\"⎱\",\"rmoust\":\"⎱\",\"rnmid\":\"⫮\",\"roang\":\"⟭\",\"roarr\":\"⇾\",\"robrk\":\"⟧\",\"ropar\":\"⦆\",\"ropf\":\"𝕣\",\"Ropf\":\"ℝ\",\"roplus\":\"⨮\",\"rotimes\":\"⨵\",\"RoundImplies\":\"⥰\",\"rpar\":\")\",\"rpargt\":\"⦔\",\"rppolint\":\"⨒\",\"rrarr\":\"⇉\",\"Rrightarrow\":\"⇛\",\"rsaquo\":\"›\",\"rscr\":\"𝓇\",\"Rscr\":\"ℛ\",\"rsh\":\"↱\",\"Rsh\":\"↱\",\"rsqb\":\"]\",\"rsquo\":\"’\",\"rsquor\":\"’\",\"rthree\":\"⋌\",\"rtimes\":\"⋊\",\"rtri\":\"▹\",\"rtrie\":\"⊵\",\"rtrif\":\"▸\",\"rtriltri\":\"⧎\",\"RuleDelayed\":\"⧴\",\"ruluhar\":\"⥨\",\"rx\":\"℞\",\"Sacute\":\"Ś\",\"sacute\":\"ś\",\"sbquo\":\"‚\",\"scap\":\"⪸\",\"Scaron\":\"Š\",\"scaron\":\"š\",\"Sc\":\"⪼\",\"sc\":\"≻\",\"sccue\":\"≽\",\"sce\":\"⪰\",\"scE\":\"⪴\",\"Scedil\":\"Ş\",\"scedil\":\"ş\",\"Scirc\":\"Ŝ\",\"scirc\":\"ŝ\",\"scnap\":\"⪺\",\"scnE\":\"⪶\",\"scnsim\":\"⋩\",\"scpolint\":\"⨓\",\"scsim\":\"≿\",\"Scy\":\"С\",\"scy\":\"с\",\"sdotb\":\"⊡\",\"sdot\":\"⋅\",\"sdote\":\"⩦\",\"searhk\":\"⤥\",\"searr\":\"↘\",\"seArr\":\"⇘\",\"searrow\":\"↘\",\"sect\":\"§\",\"semi\":\";\",\"seswar\":\"⤩\",\"setminus\":\"∖\",\"setmn\":\"∖\",\"sext\":\"✶\",\"Sfr\":\"𝔖\",\"sfr\":\"𝔰\",\"sfrown\":\"⌢\",\"sharp\":\"♯\",\"SHCHcy\":\"Щ\",\"shchcy\":\"щ\",\"SHcy\":\"Ш\",\"shcy\":\"ш\",\"ShortDownArrow\":\"↓\",\"ShortLeftArrow\":\"←\",\"shortmid\":\"∣\",\"shortparallel\":\"∥\",\"ShortRightArrow\":\"→\",\"ShortUpArrow\":\"↑\",\"shy\":\"\",\"Sigma\":\"Σ\",\"sigma\":\"σ\",\"sigmaf\":\"ς\",\"sigmav\":\"ς\",\"sim\":\"∼\",\"simdot\":\"⩪\",\"sime\":\"≃\",\"simeq\":\"≃\",\"simg\":\"⪞\",\"simgE\":\"⪠\",\"siml\":\"⪝\",\"simlE\":\"⪟\",\"simne\":\"≆\",\"simplus\":\"⨤\",\"simrarr\":\"⥲\",\"slarr\":\"←\",\"SmallCircle\":\"∘\",\"smallsetminus\":\"∖\",\"smashp\":\"⨳\",\"smeparsl\":\"⧤\",\"smid\":\"∣\",\"smile\":\"⌣\",\"smt\":\"⪪\",\"smte\":\"⪬\",\"smtes\":\"⪬︀\",\"SOFTcy\":\"Ь\",\"softcy\":\"ь\",\"solbar\":\"⌿\",\"solb\":\"⧄\",\"sol\":\"/\",\"Sopf\":\"𝕊\",\"sopf\":\"𝕤\",\"spades\":\"♠\",\"spadesuit\":\"♠\",\"spar\":\"∥\",\"sqcap\":\"⊓\",\"sqcaps\":\"⊓︀\",\"sqcup\":\"⊔\",\"sqcups\":\"⊔︀\",\"Sqrt\":\"√\",\"sqsub\":\"⊏\",\"sqsube\":\"⊑\",\"sqsubset\":\"⊏\",\"sqsubseteq\":\"⊑\",\"sqsup\":\"⊐\",\"sqsupe\":\"⊒\",\"sqsupset\":\"⊐\",\"sqsupseteq\":\"⊒\",\"square\":\"□\",\"Square\":\"□\",\"SquareIntersection\":\"⊓\",\"SquareSubset\":\"⊏\",\"SquareSubsetEqual\":\"⊑\",\"SquareSuperset\":\"⊐\",\"SquareSupersetEqual\":\"⊒\",\"SquareUnion\":\"⊔\",\"squarf\":\"▪\",\"squ\":\"□\",\"squf\":\"▪\",\"srarr\":\"→\",\"Sscr\":\"𝒮\",\"sscr\":\"𝓈\",\"ssetmn\":\"∖\",\"ssmile\":\"⌣\",\"sstarf\":\"⋆\",\"Star\":\"⋆\",\"star\":\"☆\",\"starf\":\"★\",\"straightepsilon\":\"ϵ\",\"straightphi\":\"ϕ\",\"strns\":\"¯\",\"sub\":\"⊂\",\"Sub\":\"⋐\",\"subdot\":\"⪽\",\"subE\":\"⫅\",\"sube\":\"⊆\",\"subedot\":\"⫃\",\"submult\":\"⫁\",\"subnE\":\"⫋\",\"subne\":\"⊊\",\"subplus\":\"⪿\",\"subrarr\":\"⥹\",\"subset\":\"⊂\",\"Subset\":\"⋐\",\"subseteq\":\"⊆\",\"subseteqq\":\"⫅\",\"SubsetEqual\":\"⊆\",\"subsetneq\":\"⊊\",\"subsetneqq\":\"⫋\",\"subsim\":\"⫇\",\"subsub\":\"⫕\",\"subsup\":\"⫓\",\"succapprox\":\"⪸\",\"succ\":\"≻\",\"succcurlyeq\":\"≽\",\"Succeeds\":\"≻\",\"SucceedsEqual\":\"⪰\",\"SucceedsSlantEqual\":\"≽\",\"SucceedsTilde\":\"≿\",\"succeq\":\"⪰\",\"succnapprox\":\"⪺\",\"succneqq\":\"⪶\",\"succnsim\":\"⋩\",\"succsim\":\"≿\",\"SuchThat\":\"∋\",\"sum\":\"∑\",\"Sum\":\"∑\",\"sung\":\"♪\",\"sup1\":\"¹\",\"sup2\":\"²\",\"sup3\":\"³\",\"sup\":\"⊃\",\"Sup\":\"⋑\",\"supdot\":\"⪾\",\"supdsub\":\"⫘\",\"supE\":\"⫆\",\"supe\":\"⊇\",\"supedot\":\"⫄\",\"Superset\":\"⊃\",\"SupersetEqual\":\"⊇\",\"suphsol\":\"⟉\",\"suphsub\":\"⫗\",\"suplarr\":\"⥻\",\"supmult\":\"⫂\",\"supnE\":\"⫌\",\"supne\":\"⊋\",\"supplus\":\"⫀\",\"supset\":\"⊃\",\"Supset\":\"⋑\",\"supseteq\":\"⊇\",\"supseteqq\":\"⫆\",\"supsetneq\":\"⊋\",\"supsetneqq\":\"⫌\",\"supsim\":\"⫈\",\"supsub\":\"⫔\",\"supsup\":\"⫖\",\"swarhk\":\"⤦\",\"swarr\":\"↙\",\"swArr\":\"⇙\",\"swarrow\":\"↙\",\"swnwar\":\"⤪\",\"szlig\":\"ß\",\"Tab\":\"\\t\",\"target\":\"⌖\",\"Tau\":\"Τ\",\"tau\":\"τ\",\"tbrk\":\"⎴\",\"Tcaron\":\"Ť\",\"tcaron\":\"ť\",\"Tcedil\":\"Ţ\",\"tcedil\":\"ţ\",\"Tcy\":\"Т\",\"tcy\":\"т\",\"tdot\":\"⃛\",\"telrec\":\"⌕\",\"Tfr\":\"𝔗\",\"tfr\":\"𝔱\",\"there4\":\"∴\",\"therefore\":\"∴\",\"Therefore\":\"∴\",\"Theta\":\"Θ\",\"theta\":\"θ\",\"thetasym\":\"ϑ\",\"thetav\":\"ϑ\",\"thickapprox\":\"≈\",\"thicksim\":\"∼\",\"ThickSpace\":\" \",\"ThinSpace\":\" \",\"thinsp\":\" \",\"thkap\":\"≈\",\"thksim\":\"∼\",\"THORN\":\"Þ\",\"thorn\":\"þ\",\"tilde\":\"˜\",\"Tilde\":\"∼\",\"TildeEqual\":\"≃\",\"TildeFullEqual\":\"≅\",\"TildeTilde\":\"≈\",\"timesbar\":\"⨱\",\"timesb\":\"⊠\",\"times\":\"×\",\"timesd\":\"⨰\",\"tint\":\"∭\",\"toea\":\"⤨\",\"topbot\":\"⌶\",\"topcir\":\"⫱\",\"top\":\"⊤\",\"Topf\":\"𝕋\",\"topf\":\"𝕥\",\"topfork\":\"⫚\",\"tosa\":\"⤩\",\"tprime\":\"‴\",\"trade\":\"™\",\"TRADE\":\"™\",\"triangle\":\"▵\",\"triangledown\":\"▿\",\"triangleleft\":\"◃\",\"trianglelefteq\":\"⊴\",\"triangleq\":\"≜\",\"triangleright\":\"▹\",\"trianglerighteq\":\"⊵\",\"tridot\":\"◬\",\"trie\":\"≜\",\"triminus\":\"⨺\",\"TripleDot\":\"⃛\",\"triplus\":\"⨹\",\"trisb\":\"⧍\",\"tritime\":\"⨻\",\"trpezium\":\"⏢\",\"Tscr\":\"𝒯\",\"tscr\":\"𝓉\",\"TScy\":\"Ц\",\"tscy\":\"ц\",\"TSHcy\":\"Ћ\",\"tshcy\":\"ћ\",\"Tstrok\":\"Ŧ\",\"tstrok\":\"ŧ\",\"twixt\":\"≬\",\"twoheadleftarrow\":\"↞\",\"twoheadrightarrow\":\"↠\",\"Uacute\":\"Ú\",\"uacute\":\"ú\",\"uarr\":\"↑\",\"Uarr\":\"↟\",\"uArr\":\"⇑\",\"Uarrocir\":\"⥉\",\"Ubrcy\":\"Ў\",\"ubrcy\":\"ў\",\"Ubreve\":\"Ŭ\",\"ubreve\":\"ŭ\",\"Ucirc\":\"Û\",\"ucirc\":\"û\",\"Ucy\":\"У\",\"ucy\":\"у\",\"udarr\":\"⇅\",\"Udblac\":\"Ű\",\"udblac\":\"ű\",\"udhar\":\"⥮\",\"ufisht\":\"⥾\",\"Ufr\":\"𝔘\",\"ufr\":\"𝔲\",\"Ugrave\":\"Ù\",\"ugrave\":\"ù\",\"uHar\":\"⥣\",\"uharl\":\"↿\",\"uharr\":\"↾\",\"uhblk\":\"▀\",\"ulcorn\":\"⌜\",\"ulcorner\":\"⌜\",\"ulcrop\":\"⌏\",\"ultri\":\"◸\",\"Umacr\":\"Ū\",\"umacr\":\"ū\",\"uml\":\"¨\",\"UnderBar\":\"_\",\"UnderBrace\":\"⏟\",\"UnderBracket\":\"⎵\",\"UnderParenthesis\":\"⏝\",\"Union\":\"⋃\",\"UnionPlus\":\"⊎\",\"Uogon\":\"Ų\",\"uogon\":\"ų\",\"Uopf\":\"𝕌\",\"uopf\":\"𝕦\",\"UpArrowBar\":\"⤒\",\"uparrow\":\"↑\",\"UpArrow\":\"↑\",\"Uparrow\":\"⇑\",\"UpArrowDownArrow\":\"⇅\",\"updownarrow\":\"↕\",\"UpDownArrow\":\"↕\",\"Updownarrow\":\"⇕\",\"UpEquilibrium\":\"⥮\",\"upharpoonleft\":\"↿\",\"upharpoonright\":\"↾\",\"uplus\":\"⊎\",\"UpperLeftArrow\":\"↖\",\"UpperRightArrow\":\"↗\",\"upsi\":\"υ\",\"Upsi\":\"ϒ\",\"upsih\":\"ϒ\",\"Upsilon\":\"Υ\",\"upsilon\":\"υ\",\"UpTeeArrow\":\"↥\",\"UpTee\":\"⊥\",\"upuparrows\":\"⇈\",\"urcorn\":\"⌝\",\"urcorner\":\"⌝\",\"urcrop\":\"⌎\",\"Uring\":\"Ů\",\"uring\":\"ů\",\"urtri\":\"◹\",\"Uscr\":\"𝒰\",\"uscr\":\"𝓊\",\"utdot\":\"⋰\",\"Utilde\":\"Ũ\",\"utilde\":\"ũ\",\"utri\":\"▵\",\"utrif\":\"▴\",\"uuarr\":\"⇈\",\"Uuml\":\"Ü\",\"uuml\":\"ü\",\"uwangle\":\"⦧\",\"vangrt\":\"⦜\",\"varepsilon\":\"ϵ\",\"varkappa\":\"ϰ\",\"varnothing\":\"∅\",\"varphi\":\"ϕ\",\"varpi\":\"ϖ\",\"varpropto\":\"∝\",\"varr\":\"↕\",\"vArr\":\"⇕\",\"varrho\":\"ϱ\",\"varsigma\":\"ς\",\"varsubsetneq\":\"⊊︀\",\"varsubsetneqq\":\"⫋︀\",\"varsupsetneq\":\"⊋︀\",\"varsupsetneqq\":\"⫌︀\",\"vartheta\":\"ϑ\",\"vartriangleleft\":\"⊲\",\"vartriangleright\":\"⊳\",\"vBar\":\"⫨\",\"Vbar\":\"⫫\",\"vBarv\":\"⫩\",\"Vcy\":\"В\",\"vcy\":\"в\",\"vdash\":\"⊢\",\"vDash\":\"⊨\",\"Vdash\":\"⊩\",\"VDash\":\"⊫\",\"Vdashl\":\"⫦\",\"veebar\":\"⊻\",\"vee\":\"∨\",\"Vee\":\"⋁\",\"veeeq\":\"≚\",\"vellip\":\"⋮\",\"verbar\":\"|\",\"Verbar\":\"‖\",\"vert\":\"|\",\"Vert\":\"‖\",\"VerticalBar\":\"∣\",\"VerticalLine\":\"|\",\"VerticalSeparator\":\"❘\",\"VerticalTilde\":\"≀\",\"VeryThinSpace\":\" \",\"Vfr\":\"𝔙\",\"vfr\":\"𝔳\",\"vltri\":\"⊲\",\"vnsub\":\"⊂⃒\",\"vnsup\":\"⊃⃒\",\"Vopf\":\"𝕍\",\"vopf\":\"𝕧\",\"vprop\":\"∝\",\"vrtri\":\"⊳\",\"Vscr\":\"𝒱\",\"vscr\":\"𝓋\",\"vsubnE\":\"⫋︀\",\"vsubne\":\"⊊︀\",\"vsupnE\":\"⫌︀\",\"vsupne\":\"⊋︀\",\"Vvdash\":\"⊪\",\"vzigzag\":\"⦚\",\"Wcirc\":\"Ŵ\",\"wcirc\":\"ŵ\",\"wedbar\":\"⩟\",\"wedge\":\"∧\",\"Wedge\":\"⋀\",\"wedgeq\":\"≙\",\"weierp\":\"℘\",\"Wfr\":\"𝔚\",\"wfr\":\"𝔴\",\"Wopf\":\"𝕎\",\"wopf\":\"𝕨\",\"wp\":\"℘\",\"wr\":\"≀\",\"wreath\":\"≀\",\"Wscr\":\"𝒲\",\"wscr\":\"𝓌\",\"xcap\":\"⋂\",\"xcirc\":\"◯\",\"xcup\":\"⋃\",\"xdtri\":\"▽\",\"Xfr\":\"𝔛\",\"xfr\":\"𝔵\",\"xharr\":\"⟷\",\"xhArr\":\"⟺\",\"Xi\":\"Ξ\",\"xi\":\"ξ\",\"xlarr\":\"⟵\",\"xlArr\":\"⟸\",\"xmap\":\"⟼\",\"xnis\":\"⋻\",\"xodot\":\"⨀\",\"Xopf\":\"𝕏\",\"xopf\":\"𝕩\",\"xoplus\":\"⨁\",\"xotime\":\"⨂\",\"xrarr\":\"⟶\",\"xrArr\":\"⟹\",\"Xscr\":\"𝒳\",\"xscr\":\"𝓍\",\"xsqcup\":\"⨆\",\"xuplus\":\"⨄\",\"xutri\":\"△\",\"xvee\":\"⋁\",\"xwedge\":\"⋀\",\"Yacute\":\"Ý\",\"yacute\":\"ý\",\"YAcy\":\"Я\",\"yacy\":\"я\",\"Ycirc\":\"Ŷ\",\"ycirc\":\"ŷ\",\"Ycy\":\"Ы\",\"ycy\":\"ы\",\"yen\":\"¥\",\"Yfr\":\"𝔜\",\"yfr\":\"𝔶\",\"YIcy\":\"Ї\",\"yicy\":\"ї\",\"Yopf\":\"𝕐\",\"yopf\":\"𝕪\",\"Yscr\":\"𝒴\",\"yscr\":\"𝓎\",\"YUcy\":\"Ю\",\"yucy\":\"ю\",\"yuml\":\"ÿ\",\"Yuml\":\"Ÿ\",\"Zacute\":\"Ź\",\"zacute\":\"ź\",\"Zcaron\":\"Ž\",\"zcaron\":\"ž\",\"Zcy\":\"З\",\"zcy\":\"з\",\"Zdot\":\"Ż\",\"zdot\":\"ż\",\"zeetrf\":\"ℨ\",\"ZeroWidthSpace\":\"\",\"Zeta\":\"Ζ\",\"zeta\":\"ζ\",\"zfr\":\"𝔷\",\"Zfr\":\"ℨ\",\"ZHcy\":\"Ж\",\"zhcy\":\"ж\",\"zigrarr\":\"⇝\",\"zopf\":\"𝕫\",\"Zopf\":\"ℤ\",\"Zscr\":\"𝒵\",\"zscr\":\"𝓏\",\"zwj\":\"\",\"zwnj\":\"\"}"); /***/ }), /* 288 */ /***/ (function(module) { module.exports = JSON.parse("{\"Aacute\":\"Á\",\"aacute\":\"á\",\"Acirc\":\"Â\",\"acirc\":\"â\",\"acute\":\"´\",\"AElig\":\"Æ\",\"aelig\":\"æ\",\"Agrave\":\"À\",\"agrave\":\"à\",\"amp\":\"&\",\"AMP\":\"&\",\"Aring\":\"Å\",\"aring\":\"å\",\"Atilde\":\"Ã\",\"atilde\":\"ã\",\"Auml\":\"Ä\",\"auml\":\"ä\",\"brvbar\":\"¦\",\"Ccedil\":\"Ç\",\"ccedil\":\"ç\",\"cedil\":\"¸\",\"cent\":\"¢\",\"copy\":\"©\",\"COPY\":\"©\",\"curren\":\"¤\",\"deg\":\"°\",\"divide\":\"÷\",\"Eacute\":\"É\",\"eacute\":\"é\",\"Ecirc\":\"Ê\",\"ecirc\":\"ê\",\"Egrave\":\"È\",\"egrave\":\"è\",\"ETH\":\"Ð\",\"eth\":\"ð\",\"Euml\":\"Ë\",\"euml\":\"ë\",\"frac12\":\"½\",\"frac14\":\"¼\",\"frac34\":\"¾\",\"gt\":\">\",\"GT\":\">\",\"Iacute\":\"Í\",\"iacute\":\"í\",\"Icirc\":\"Î\",\"icirc\":\"î\",\"iexcl\":\"¡\",\"Igrave\":\"Ì\",\"igrave\":\"ì\",\"iquest\":\"¿\",\"Iuml\":\"Ï\",\"iuml\":\"ï\",\"laquo\":\"«\",\"lt\":\"<\",\"LT\":\"<\",\"macr\":\"¯\",\"micro\":\"µ\",\"middot\":\"·\",\"nbsp\":\" \",\"not\":\"¬\",\"Ntilde\":\"Ñ\",\"ntilde\":\"ñ\",\"Oacute\":\"Ó\",\"oacute\":\"ó\",\"Ocirc\":\"Ô\",\"ocirc\":\"ô\",\"Ograve\":\"Ò\",\"ograve\":\"ò\",\"ordf\":\"ª\",\"ordm\":\"º\",\"Oslash\":\"Ø\",\"oslash\":\"ø\",\"Otilde\":\"Õ\",\"otilde\":\"õ\",\"Ouml\":\"Ö\",\"ouml\":\"ö\",\"para\":\"¶\",\"plusmn\":\"±\",\"pound\":\"£\",\"quot\":\"\\\"\",\"QUOT\":\"\\\"\",\"raquo\":\"»\",\"reg\":\"®\",\"REG\":\"®\",\"sect\":\"§\",\"shy\":\"\",\"sup1\":\"¹\",\"sup2\":\"²\",\"sup3\":\"³\",\"szlig\":\"ß\",\"THORN\":\"Þ\",\"thorn\":\"þ\",\"times\":\"×\",\"Uacute\":\"Ú\",\"uacute\":\"ú\",\"Ucirc\":\"Û\",\"ucirc\":\"û\",\"Ugrave\":\"Ù\",\"ugrave\":\"ù\",\"uml\":\"¨\",\"Uuml\":\"Ü\",\"uuml\":\"ü\",\"Yacute\":\"Ý\",\"yacute\":\"ý\",\"yen\":\"¥\",\"yuml\":\"ÿ\"}"); /***/ }), /* 289 */ /***/ (function(module) { module.exports = JSON.parse("{\"amp\":\"&\",\"apos\":\"'\",\"gt\":\">\",\"lt\":\"<\",\"quot\":\"\\\"\"}"); /***/ }), /* 290 */ /***/ (function(module, exports, __webpack_require__) { try { var util = __webpack_require__(9); /* istanbul ignore next */ if (typeof util.inherits !== 'function') throw ''; module.exports = util.inherits; } catch (e) { /* istanbul ignore next */ module.exports = __webpack_require__(291); } /***/ }), /* 291 */ /***/ (function(module, exports) { if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { if (superCtor) { ctor.super_ = superCtor ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }) } }; } else { // old school shim for old browsers module.exports = function inherits(ctor, superCtor) { if (superCtor) { ctor.super_ = superCtor var TempCtor = function () {} TempCtor.prototype = superCtor.prototype ctor.prototype = new TempCtor() ctor.prototype.constructor = ctor } } } /***/ }), /* 292 */ /***/ (function(module, exports, __webpack_require__) { var ElementType = __webpack_require__(293); var re_whitespace = /\s+/g; var NodePrototype = __webpack_require__(294); var ElementPrototype = __webpack_require__(295); function DomHandler(callback, options, elementCB){ if(typeof callback === "object"){ elementCB = options; options = callback; callback = null; } else if(typeof options === "function"){ elementCB = options; options = defaultOpts; } this._callback = callback; this._options = options || defaultOpts; this._elementCB = elementCB; this.dom = []; this._done = false; this._tagStack = []; this._parser = this._parser || null; } //default options var defaultOpts = { normalizeWhitespace: false, //Replace all whitespace with single spaces withStartIndices: false, //Add startIndex properties to nodes withEndIndices: false, //Add endIndex properties to nodes }; DomHandler.prototype.onparserinit = function(parser){ this._parser = parser; }; //Resets the handler back to starting state DomHandler.prototype.onreset = function(){ DomHandler.call(this, this._callback, this._options, this._elementCB); }; //Signals the handler that parsing is done DomHandler.prototype.onend = function(){ if(this._done) return; this._done = true; this._parser = null; this._handleCallback(null); }; DomHandler.prototype._handleCallback = DomHandler.prototype.onerror = function(error){ if(typeof this._callback === "function"){ this._callback(error, this.dom); } else { if(error) throw error; } }; DomHandler.prototype.onclosetag = function(){ //if(this._tagStack.pop().name !== name) this._handleCallback(Error("Tagname didn't match!")); var elem = this._tagStack.pop(); if(this._options.withEndIndices && elem){ elem.endIndex = this._parser.endIndex; } if(this._elementCB) this._elementCB(elem); }; DomHandler.prototype._createDomElement = function(properties){ if (!this._options.withDomLvl1) return properties; var element; if (properties.type === "tag") { element = Object.create(ElementPrototype); } else { element = Object.create(NodePrototype); } for (var key in properties) { if (properties.hasOwnProperty(key)) { element[key] = properties[key]; } } return element; }; DomHandler.prototype._addDomElement = function(element){ var parent = this._tagStack[this._tagStack.length - 1]; var siblings = parent ? parent.children : this.dom; var previousSibling = siblings[siblings.length - 1]; element.next = null; if(this._options.withStartIndices){ element.startIndex = this._parser.startIndex; } if(this._options.withEndIndices){ element.endIndex = this._parser.endIndex; } if(previousSibling){ element.prev = previousSibling; previousSibling.next = element; } else { element.prev = null; } siblings.push(element); element.parent = parent || null; }; DomHandler.prototype.onopentag = function(name, attribs){ var properties = { type: name === "script" ? ElementType.Script : name === "style" ? ElementType.Style : ElementType.Tag, name: name, attribs: attribs, children: [] }; var element = this._createDomElement(properties); this._addDomElement(element); this._tagStack.push(element); }; DomHandler.prototype.ontext = function(data){ //the ignoreWhitespace is officially dropped, but for now, //it's an alias for normalizeWhitespace var normalize = this._options.normalizeWhitespace || this._options.ignoreWhitespace; var lastTag; if(!this._tagStack.length && this.dom.length && (lastTag = this.dom[this.dom.length-1]).type === ElementType.Text){ if(normalize){ lastTag.data = (lastTag.data + data).replace(re_whitespace, " "); } else { lastTag.data += data; } } else { if( this._tagStack.length && (lastTag = this._tagStack[this._tagStack.length - 1]) && (lastTag = lastTag.children[lastTag.children.length - 1]) && lastTag.type === ElementType.Text ){ if(normalize){ lastTag.data = (lastTag.data + data).replace(re_whitespace, " "); } else { lastTag.data += data; } } else { if(normalize){ data = data.replace(re_whitespace, " "); } var element = this._createDomElement({ data: data, type: ElementType.Text }); this._addDomElement(element); } } }; DomHandler.prototype.oncomment = function(data){ var lastTag = this._tagStack[this._tagStack.length - 1]; if(lastTag && lastTag.type === ElementType.Comment){ lastTag.data += data; return; } var properties = { data: data, type: ElementType.Comment }; var element = this._createDomElement(properties); this._addDomElement(element); this._tagStack.push(element); }; DomHandler.prototype.oncdatastart = function(){ var properties = { children: [{ data: "", type: ElementType.Text }], type: ElementType.CDATA }; var element = this._createDomElement(properties); this._addDomElement(element); this._tagStack.push(element); }; DomHandler.prototype.oncommentend = DomHandler.prototype.oncdataend = function(){ this._tagStack.pop(); }; DomHandler.prototype.onprocessinginstruction = function(name, data){ var element = this._createDomElement({ name: name, data: data, type: ElementType.Directive }); this._addDomElement(element); }; module.exports = DomHandler; /***/ }), /* 293 */ /***/ (function(module, exports) { //Types of elements found in the DOM module.exports = { Text: "text", //Text Directive: "directive", //<? ... ?> Comment: "comment", //<!-- ... --> Script: "script", //<script> tags Style: "style", //<style> tags Tag: "tag", //Any tag CDATA: "cdata", //<![CDATA[ ... ]]> Doctype: "doctype", isTag: function(elem){ return elem.type === "tag" || elem.type === "script" || elem.type === "style"; } }; /***/ }), /* 294 */ /***/ (function(module, exports) { // This object will be used as the prototype for Nodes when creating a // DOM-Level-1-compliant structure. var NodePrototype = module.exports = { get firstChild() { var children = this.children; return children && children[0] || null; }, get lastChild() { var children = this.children; return children && children[children.length - 1] || null; }, get nodeType() { return nodeTypes[this.type] || nodeTypes.element; } }; var domLvl1 = { tagName: "name", childNodes: "children", parentNode: "parent", previousSibling: "prev", nextSibling: "next", nodeValue: "data" }; var nodeTypes = { element: 1, text: 3, cdata: 4, comment: 8 }; Object.keys(domLvl1).forEach(function(key) { var shorthand = domLvl1[key]; Object.defineProperty(NodePrototype, key, { get: function() { return this[shorthand] || null; }, set: function(val) { this[shorthand] = val; return val; } }); }); /***/ }), /* 295 */ /***/ (function(module, exports, __webpack_require__) { // DOM-Level-1-compliant structure var NodePrototype = __webpack_require__(294); var ElementPrototype = module.exports = Object.create(NodePrototype); var domLvl1 = { tagName: "name" }; Object.keys(domLvl1).forEach(function(key) { var shorthand = domLvl1[key]; Object.defineProperty(ElementPrototype, key, { get: function() { return this[shorthand] || null; }, set: function(val) { this[shorthand] = val; return val; } }); }); /***/ }), /* 296 */ /***/ (function(module, exports, __webpack_require__) { var DomHandler = __webpack_require__(292); var DomUtils = __webpack_require__(297); //TODO: make this a streamable handler function FeedHandler(callback, options) { this.init(callback, options); } __webpack_require__(290)(FeedHandler, DomHandler); FeedHandler.prototype.init = DomHandler; function getElements(what, where) { return DomUtils.getElementsByTagName(what, where, true); } function getOneElement(what, where) { return DomUtils.getElementsByTagName(what, where, true, 1)[0]; } function fetch(what, where, recurse) { return DomUtils.getText( DomUtils.getElementsByTagName(what, where, recurse, 1) ).trim(); } function addConditionally(obj, prop, what, where, recurse) { var tmp = fetch(what, where, recurse); if (tmp) obj[prop] = tmp; } var isValidFeed = function(value) { return value === "rss" || value === "feed" || value === "rdf:RDF"; }; FeedHandler.prototype.onend = function() { var feed = {}, feedRoot = getOneElement(isValidFeed, this.dom), tmp, childs; if (feedRoot) { if (feedRoot.name === "feed") { childs = feedRoot.children; feed.type = "atom"; addConditionally(feed, "id", "id", childs); addConditionally(feed, "title", "title", childs); if ( (tmp = getOneElement("link", childs)) && (tmp = tmp.attribs) && (tmp = tmp.href) ) feed.link = tmp; addConditionally(feed, "description", "subtitle", childs); if ((tmp = fetch("updated", childs))) feed.updated = new Date(tmp); addConditionally(feed, "author", "email", childs, true); feed.items = getElements("entry", childs).map(function(item) { var entry = {}, tmp; item = item.children; addConditionally(entry, "id", "id", item); addConditionally(entry, "title", "title", item); if ( (tmp = getOneElement("link", item)) && (tmp = tmp.attribs) && (tmp = tmp.href) ) entry.link = tmp; if ((tmp = fetch("summary", item) || fetch("content", item))) entry.description = tmp; if ((tmp = fetch("updated", item))) entry.pubDate = new Date(tmp); return entry; }); } else { childs = getOneElement("channel", feedRoot.children).children; feed.type = feedRoot.name.substr(0, 3); feed.id = ""; addConditionally(feed, "title", "title", childs); addConditionally(feed, "link", "link", childs); addConditionally(feed, "description", "description", childs); if ((tmp = fetch("lastBuildDate", childs))) feed.updated = new Date(tmp); addConditionally(feed, "author", "managingEditor", childs, true); feed.items = getElements("item", feedRoot.children).map(function( item ) { var entry = {}, tmp; item = item.children; addConditionally(entry, "id", "guid", item); addConditionally(entry, "title", "title", item); addConditionally(entry, "link", "link", item); addConditionally(entry, "description", "description", item); if ((tmp = fetch("pubDate", item))) entry.pubDate = new Date(tmp); return entry; }); } } this.dom = feed; DomHandler.prototype._handleCallback.call( this, feedRoot ? null : Error("couldn't find root of feed") ); }; module.exports = FeedHandler; /***/ }), /* 297 */ /***/ (function(module, exports, __webpack_require__) { var DomUtils = module.exports; [ __webpack_require__(298), __webpack_require__(310), __webpack_require__(311), __webpack_require__(312), __webpack_require__(313), __webpack_require__(314) ].forEach(function(ext){ Object.keys(ext).forEach(function(key){ DomUtils[key] = ext[key].bind(DomUtils); }); }); /***/ }), /* 298 */ /***/ (function(module, exports, __webpack_require__) { var ElementType = __webpack_require__(293), getOuterHTML = __webpack_require__(299), isTag = ElementType.isTag; module.exports = { getInnerHTML: getInnerHTML, getOuterHTML: getOuterHTML, getText: getText }; function getInnerHTML(elem, opts){ return elem.children ? elem.children.map(function(elem){ return getOuterHTML(elem, opts); }).join("") : ""; } function getText(elem){ if(Array.isArray(elem)) return elem.map(getText).join(""); if(isTag(elem)) return elem.name === "br" ? "\n" : getText(elem.children); if(elem.type === ElementType.CDATA) return getText(elem.children); if(elem.type === ElementType.Text) return elem.data; return ""; } /***/ }), /* 299 */ /***/ (function(module, exports, __webpack_require__) { /* Module dependencies */ var ElementType = __webpack_require__(300); var entities = __webpack_require__(301); /* mixed-case SVG and MathML tags & attributes recognized by the HTML parser, see https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign */ var foreignNames = __webpack_require__(309); foreignNames.elementNames.__proto__ = null; /* use as a simple dictionary */ foreignNames.attributeNames.__proto__ = null; var unencodedElements = { __proto__: null, style: true, script: true, xmp: true, iframe: true, noembed: true, noframes: true, plaintext: true, noscript: true }; /* Format attributes */ function formatAttrs(attributes, opts) { if (!attributes) return; var output = ''; var value; // Loop through the attributes for (var key in attributes) { value = attributes[key]; if (output) { output += ' '; } if (opts.xmlMode === 'foreign') { /* fix up mixed-case attribute names */ key = foreignNames.attributeNames[key] || key; } output += key; if ((value !== null && value !== '') || opts.xmlMode) { output += '="' + (opts.decodeEntities ? entities.encodeXML(value) : value.replace(/\"/g, '"')) + '"'; } } return output; } /* Self-enclosing tags (stolen from node-htmlparser) */ var singleTag = { __proto__: null, area: true, base: true, basefont: true, br: true, col: true, command: true, embed: true, frame: true, hr: true, img: true, input: true, isindex: true, keygen: true, link: true, meta: true, param: true, source: true, track: true, wbr: true }; var render = (module.exports = function(dom, opts) { if (!Array.isArray(dom) && !dom.cheerio) dom = [dom]; opts = opts || {}; var output = ''; for (var i = 0; i < dom.length; i++) { var elem = dom[i]; if (elem.type === 'root') output += render(elem.children, opts); else if (ElementType.isTag(elem)) output += renderTag(elem, opts); else if (elem.type === ElementType.Directive) output += renderDirective(elem); else if (elem.type === ElementType.Comment) output += renderComment(elem); else if (elem.type === ElementType.CDATA) output += renderCdata(elem); else output += renderText(elem, opts); } return output; }); const foreignModeIntegrationPoints = [ 'mi', 'mo', 'mn', 'ms', 'mtext', 'annotation-xml', 'foreignObject', 'desc', 'title' ]; function renderTag(elem, opts) { // Handle SVG / MathML in HTML if (opts.xmlMode === 'foreign') { /* fix up mixed-case element names */ elem.name = foreignNames.elementNames[elem.name] || elem.name; /* exit foreign mode at integration points */ if ( elem.parent && foreignModeIntegrationPoints.indexOf(elem.parent.name) >= 0 ) opts = Object.assign({}, opts, { xmlMode: false }); } if (!opts.xmlMode && ['svg', 'math'].indexOf(elem.name) >= 0) { opts = Object.assign({}, opts, { xmlMode: 'foreign' }); } var tag = '<' + elem.name; var attribs = formatAttrs(elem.attribs, opts); if (attribs) { tag += ' ' + attribs; } if (opts.xmlMode && (!elem.children || elem.children.length === 0)) { tag += '/>'; } else { tag += '>'; if (elem.children) { tag += render(elem.children, opts); } if (!singleTag[elem.name] || opts.xmlMode) { tag += '</' + elem.name + '>'; } } return tag; } function renderDirective(elem) { return '<' + elem.data + '>'; } function renderText(elem, opts) { var data = elem.data || ''; // if entities weren't decoded, no need to encode them back if ( opts.decodeEntities && !(elem.parent && elem.parent.name in unencodedElements) ) { data = entities.encodeXML(data); } return data; } function renderCdata(elem) { return '<![CDATA[' + elem.children[0].data + ']]>'; } function renderComment(elem) { return '<!--' + elem.data + '-->'; } /***/ }), /* 300 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Tests whether an element is a tag or not. * * @param elem Element to test */ function isTag(elem) { return (elem.type === "tag" /* Tag */ || elem.type === "script" /* Script */ || elem.type === "style" /* Style */); } exports.isTag = isTag; // Exports for backwards compatibility exports.Text = "text" /* Text */; //Text exports.Directive = "directive" /* Directive */; //<? ... ?> exports.Comment = "comment" /* Comment */; //<!-- ... --> exports.Script = "script" /* Script */; //<script> tags exports.Style = "style" /* Style */; //<style> tags exports.Tag = "tag" /* Tag */; //Any tag exports.CDATA = "cdata" /* CDATA */; //<![CDATA[ ... ]]> exports.Doctype = "doctype" /* Doctype */; /***/ }), /* 301 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var decode_1 = __webpack_require__(302); var encode_1 = __webpack_require__(308); function decode(data, level) { return (!level || level <= 0 ? decode_1.decodeXML : decode_1.decodeHTML)(data); } exports.decode = decode; function decodeStrict(data, level) { return (!level || level <= 0 ? decode_1.decodeXML : decode_1.decodeHTMLStrict)(data); } exports.decodeStrict = decodeStrict; function encode(data, level) { return (!level || level <= 0 ? encode_1.encodeXML : encode_1.encodeHTML)(data); } exports.encode = encode; var encode_2 = __webpack_require__(308); exports.encodeXML = encode_2.encodeXML; exports.encodeHTML = encode_2.encodeHTML; exports.escape = encode_2.escape; // Legacy aliases exports.encodeHTML4 = encode_2.encodeHTML; exports.encodeHTML5 = encode_2.encodeHTML; var decode_2 = __webpack_require__(302); exports.decodeXML = decode_2.decodeXML; exports.decodeHTML = decode_2.decodeHTML; exports.decodeHTMLStrict = decode_2.decodeHTMLStrict; // Legacy aliases exports.decodeHTML4 = decode_2.decodeHTML; exports.decodeHTML5 = decode_2.decodeHTML; exports.decodeHTML4Strict = decode_2.decodeHTMLStrict; exports.decodeHTML5Strict = decode_2.decodeHTMLStrict; exports.decodeXMLStrict = decode_2.decodeXML; /***/ }), /* 302 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var entities_json_1 = __importDefault(__webpack_require__(303)); var legacy_json_1 = __importDefault(__webpack_require__(304)); var xml_json_1 = __importDefault(__webpack_require__(305)); var decode_codepoint_1 = __importDefault(__webpack_require__(306)); exports.decodeXML = getStrictDecoder(xml_json_1.default); exports.decodeHTMLStrict = getStrictDecoder(entities_json_1.default); function getStrictDecoder(map) { var keys = Object.keys(map).join("|"); var replace = getReplacer(map); keys += "|#[xX][\\da-fA-F]+|#\\d+"; var re = new RegExp("&(?:" + keys + ");", "g"); return function (str) { return String(str).replace(re, replace); }; } var sorter = function (a, b) { return (a < b ? 1 : -1); }; exports.decodeHTML = (function () { var legacy = Object.keys(legacy_json_1.default).sort(sorter); var keys = Object.keys(entities_json_1.default).sort(sorter); for (var i = 0, j = 0; i < keys.length; i++) { if (legacy[j] === keys[i]) { keys[i] += ";?"; j++; } else { keys[i] += ";"; } } var re = new RegExp("&(?:" + keys.join("|") + "|#[xX][\\da-fA-F]+;?|#\\d+;?)", "g"); var replace = getReplacer(entities_json_1.default); function replacer(str) { if (str.substr(-1) !== ";") str += ";"; return replace(str); } //TODO consider creating a merged map return function (str) { return String(str).replace(re, replacer); }; })(); function getReplacer(map) { return function replace(str) { if (str.charAt(1) === "#") { if (str.charAt(2) === "X" || str.charAt(2) === "x") { return decode_codepoint_1.default(parseInt(str.substr(3), 16)); } return decode_codepoint_1.default(parseInt(str.substr(2), 10)); } return map[str.slice(1, -1)]; }; } /***/ }), /* 303 */ /***/ (function(module) { module.exports = JSON.parse("{\"Aacute\":\"Á\",\"aacute\":\"á\",\"Abreve\":\"Ă\",\"abreve\":\"ă\",\"ac\":\"∾\",\"acd\":\"∿\",\"acE\":\"∾̳\",\"Acirc\":\"Â\",\"acirc\":\"â\",\"acute\":\"´\",\"Acy\":\"А\",\"acy\":\"а\",\"AElig\":\"Æ\",\"aelig\":\"æ\",\"af\":\"\",\"Afr\":\"𝔄\",\"afr\":\"𝔞\",\"Agrave\":\"À\",\"agrave\":\"à\",\"alefsym\":\"ℵ\",\"aleph\":\"ℵ\",\"Alpha\":\"Α\",\"alpha\":\"α\",\"Amacr\":\"Ā\",\"amacr\":\"ā\",\"amalg\":\"⨿\",\"amp\":\"&\",\"AMP\":\"&\",\"andand\":\"⩕\",\"And\":\"⩓\",\"and\":\"∧\",\"andd\":\"⩜\",\"andslope\":\"⩘\",\"andv\":\"⩚\",\"ang\":\"∠\",\"ange\":\"⦤\",\"angle\":\"∠\",\"angmsdaa\":\"⦨\",\"angmsdab\":\"⦩\",\"angmsdac\":\"⦪\",\"angmsdad\":\"⦫\",\"angmsdae\":\"⦬\",\"angmsdaf\":\"⦭\",\"angmsdag\":\"⦮\",\"angmsdah\":\"⦯\",\"angmsd\":\"∡\",\"angrt\":\"∟\",\"angrtvb\":\"⊾\",\"angrtvbd\":\"⦝\",\"angsph\":\"∢\",\"angst\":\"Å\",\"angzarr\":\"⍼\",\"Aogon\":\"Ą\",\"aogon\":\"ą\",\"Aopf\":\"𝔸\",\"aopf\":\"𝕒\",\"apacir\":\"⩯\",\"ap\":\"≈\",\"apE\":\"⩰\",\"ape\":\"≊\",\"apid\":\"≋\",\"apos\":\"'\",\"ApplyFunction\":\"\",\"approx\":\"≈\",\"approxeq\":\"≊\",\"Aring\":\"Å\",\"aring\":\"å\",\"Ascr\":\"𝒜\",\"ascr\":\"𝒶\",\"Assign\":\"≔\",\"ast\":\"*\",\"asymp\":\"≈\",\"asympeq\":\"≍\",\"Atilde\":\"Ã\",\"atilde\":\"ã\",\"Auml\":\"Ä\",\"auml\":\"ä\",\"awconint\":\"∳\",\"awint\":\"⨑\",\"backcong\":\"≌\",\"backepsilon\":\"϶\",\"backprime\":\"‵\",\"backsim\":\"∽\",\"backsimeq\":\"⋍\",\"Backslash\":\"∖\",\"Barv\":\"⫧\",\"barvee\":\"⊽\",\"barwed\":\"⌅\",\"Barwed\":\"⌆\",\"barwedge\":\"⌅\",\"bbrk\":\"⎵\",\"bbrktbrk\":\"⎶\",\"bcong\":\"≌\",\"Bcy\":\"Б\",\"bcy\":\"б\",\"bdquo\":\"„\",\"becaus\":\"∵\",\"because\":\"∵\",\"Because\":\"∵\",\"bemptyv\":\"⦰\",\"bepsi\":\"϶\",\"bernou\":\"ℬ\",\"Bernoullis\":\"ℬ\",\"Beta\":\"Β\",\"beta\":\"β\",\"beth\":\"ℶ\",\"between\":\"≬\",\"Bfr\":\"𝔅\",\"bfr\":\"𝔟\",\"bigcap\":\"⋂\",\"bigcirc\":\"◯\",\"bigcup\":\"⋃\",\"bigodot\":\"⨀\",\"bigoplus\":\"⨁\",\"bigotimes\":\"⨂\",\"bigsqcup\":\"⨆\",\"bigstar\":\"★\",\"bigtriangledown\":\"▽\",\"bigtriangleup\":\"△\",\"biguplus\":\"⨄\",\"bigvee\":\"⋁\",\"bigwedge\":\"⋀\",\"bkarow\":\"⤍\",\"blacklozenge\":\"⧫\",\"blacksquare\":\"▪\",\"blacktriangle\":\"▴\",\"blacktriangledown\":\"▾\",\"blacktriangleleft\":\"◂\",\"blacktriangleright\":\"▸\",\"blank\":\"␣\",\"blk12\":\"▒\",\"blk14\":\"░\",\"blk34\":\"▓\",\"block\":\"█\",\"bne\":\"=⃥\",\"bnequiv\":\"≡⃥\",\"bNot\":\"⫭\",\"bnot\":\"⌐\",\"Bopf\":\"𝔹\",\"bopf\":\"𝕓\",\"bot\":\"⊥\",\"bottom\":\"⊥\",\"bowtie\":\"⋈\",\"boxbox\":\"⧉\",\"boxdl\":\"┐\",\"boxdL\":\"╕\",\"boxDl\":\"╖\",\"boxDL\":\"╗\",\"boxdr\":\"┌\",\"boxdR\":\"╒\",\"boxDr\":\"╓\",\"boxDR\":\"╔\",\"boxh\":\"─\",\"boxH\":\"═\",\"boxhd\":\"┬\",\"boxHd\":\"╤\",\"boxhD\":\"╥\",\"boxHD\":\"╦\",\"boxhu\":\"┴\",\"boxHu\":\"╧\",\"boxhU\":\"╨\",\"boxHU\":\"╩\",\"boxminus\":\"⊟\",\"boxplus\":\"⊞\",\"boxtimes\":\"⊠\",\"boxul\":\"┘\",\"boxuL\":\"╛\",\"boxUl\":\"╜\",\"boxUL\":\"╝\",\"boxur\":\"└\",\"boxuR\":\"╘\",\"boxUr\":\"╙\",\"boxUR\":\"╚\",\"boxv\":\"│\",\"boxV\":\"║\",\"boxvh\":\"┼\",\"boxvH\":\"╪\",\"boxVh\":\"╫\",\"boxVH\":\"╬\",\"boxvl\":\"┤\",\"boxvL\":\"╡\",\"boxVl\":\"╢\",\"boxVL\":\"╣\",\"boxvr\":\"├\",\"boxvR\":\"╞\",\"boxVr\":\"╟\",\"boxVR\":\"╠\",\"bprime\":\"‵\",\"breve\":\"˘\",\"Breve\":\"˘\",\"brvbar\":\"¦\",\"bscr\":\"𝒷\",\"Bscr\":\"ℬ\",\"bsemi\":\"⁏\",\"bsim\":\"∽\",\"bsime\":\"⋍\",\"bsolb\":\"⧅\",\"bsol\":\"\\\\\",\"bsolhsub\":\"⟈\",\"bull\":\"•\",\"bullet\":\"•\",\"bump\":\"≎\",\"bumpE\":\"⪮\",\"bumpe\":\"≏\",\"Bumpeq\":\"≎\",\"bumpeq\":\"≏\",\"Cacute\":\"Ć\",\"cacute\":\"ć\",\"capand\":\"⩄\",\"capbrcup\":\"⩉\",\"capcap\":\"⩋\",\"cap\":\"∩\",\"Cap\":\"⋒\",\"capcup\":\"⩇\",\"capdot\":\"⩀\",\"CapitalDifferentialD\":\"ⅅ\",\"caps\":\"∩︀\",\"caret\":\"⁁\",\"caron\":\"ˇ\",\"Cayleys\":\"ℭ\",\"ccaps\":\"⩍\",\"Ccaron\":\"Č\",\"ccaron\":\"č\",\"Ccedil\":\"Ç\",\"ccedil\":\"ç\",\"Ccirc\":\"Ĉ\",\"ccirc\":\"ĉ\",\"Cconint\":\"∰\",\"ccups\":\"⩌\",\"ccupssm\":\"⩐\",\"Cdot\":\"Ċ\",\"cdot\":\"ċ\",\"cedil\":\"¸\",\"Cedilla\":\"¸\",\"cemptyv\":\"⦲\",\"cent\":\"¢\",\"centerdot\":\"·\",\"CenterDot\":\"·\",\"cfr\":\"𝔠\",\"Cfr\":\"ℭ\",\"CHcy\":\"Ч\",\"chcy\":\"ч\",\"check\":\"✓\",\"checkmark\":\"✓\",\"Chi\":\"Χ\",\"chi\":\"χ\",\"circ\":\"ˆ\",\"circeq\":\"≗\",\"circlearrowleft\":\"↺\",\"circlearrowright\":\"↻\",\"circledast\":\"⊛\",\"circledcirc\":\"⊚\",\"circleddash\":\"⊝\",\"CircleDot\":\"⊙\",\"circledR\":\"®\",\"circledS\":\"Ⓢ\",\"CircleMinus\":\"⊖\",\"CirclePlus\":\"⊕\",\"CircleTimes\":\"⊗\",\"cir\":\"○\",\"cirE\":\"⧃\",\"cire\":\"≗\",\"cirfnint\":\"⨐\",\"cirmid\":\"⫯\",\"cirscir\":\"⧂\",\"ClockwiseContourIntegral\":\"∲\",\"CloseCurlyDoubleQuote\":\"”\",\"CloseCurlyQuote\":\"’\",\"clubs\":\"♣\",\"clubsuit\":\"♣\",\"colon\":\":\",\"Colon\":\"∷\",\"Colone\":\"⩴\",\"colone\":\"≔\",\"coloneq\":\"≔\",\"comma\":\",\",\"commat\":\"@\",\"comp\":\"∁\",\"compfn\":\"∘\",\"complement\":\"∁\",\"complexes\":\"ℂ\",\"cong\":\"≅\",\"congdot\":\"⩭\",\"Congruent\":\"≡\",\"conint\":\"∮\",\"Conint\":\"∯\",\"ContourIntegral\":\"∮\",\"copf\":\"𝕔\",\"Copf\":\"ℂ\",\"coprod\":\"∐\",\"Coproduct\":\"∐\",\"copy\":\"©\",\"COPY\":\"©\",\"copysr\":\"℗\",\"CounterClockwiseContourIntegral\":\"∳\",\"crarr\":\"↵\",\"cross\":\"✗\",\"Cross\":\"⨯\",\"Cscr\":\"𝒞\",\"cscr\":\"𝒸\",\"csub\":\"⫏\",\"csube\":\"⫑\",\"csup\":\"⫐\",\"csupe\":\"⫒\",\"ctdot\":\"⋯\",\"cudarrl\":\"⤸\",\"cudarrr\":\"⤵\",\"cuepr\":\"⋞\",\"cuesc\":\"⋟\",\"cularr\":\"↶\",\"cularrp\":\"⤽\",\"cupbrcap\":\"⩈\",\"cupcap\":\"⩆\",\"CupCap\":\"≍\",\"cup\":\"∪\",\"Cup\":\"⋓\",\"cupcup\":\"⩊\",\"cupdot\":\"⊍\",\"cupor\":\"⩅\",\"cups\":\"∪︀\",\"curarr\":\"↷\",\"curarrm\":\"⤼\",\"curlyeqprec\":\"⋞\",\"curlyeqsucc\":\"⋟\",\"curlyvee\":\"⋎\",\"curlywedge\":\"⋏\",\"curren\":\"¤\",\"curvearrowleft\":\"↶\",\"curvearrowright\":\"↷\",\"cuvee\":\"⋎\",\"cuwed\":\"⋏\",\"cwconint\":\"∲\",\"cwint\":\"∱\",\"cylcty\":\"⌭\",\"dagger\":\"†\",\"Dagger\":\"‡\",\"daleth\":\"ℸ\",\"darr\":\"↓\",\"Darr\":\"↡\",\"dArr\":\"⇓\",\"dash\":\"‐\",\"Dashv\":\"⫤\",\"dashv\":\"⊣\",\"dbkarow\":\"⤏\",\"dblac\":\"˝\",\"Dcaron\":\"Ď\",\"dcaron\":\"ď\",\"Dcy\":\"Д\",\"dcy\":\"д\",\"ddagger\":\"‡\",\"ddarr\":\"⇊\",\"DD\":\"ⅅ\",\"dd\":\"ⅆ\",\"DDotrahd\":\"⤑\",\"ddotseq\":\"⩷\",\"deg\":\"°\",\"Del\":\"∇\",\"Delta\":\"Δ\",\"delta\":\"δ\",\"demptyv\":\"⦱\",\"dfisht\":\"⥿\",\"Dfr\":\"𝔇\",\"dfr\":\"𝔡\",\"dHar\":\"⥥\",\"dharl\":\"⇃\",\"dharr\":\"⇂\",\"DiacriticalAcute\":\"´\",\"DiacriticalDot\":\"˙\",\"DiacriticalDoubleAcute\":\"˝\",\"DiacriticalGrave\":\"`\",\"DiacriticalTilde\":\"˜\",\"diam\":\"⋄\",\"diamond\":\"⋄\",\"Diamond\":\"⋄\",\"diamondsuit\":\"♦\",\"diams\":\"♦\",\"die\":\"¨\",\"DifferentialD\":\"ⅆ\",\"digamma\":\"ϝ\",\"disin\":\"⋲\",\"div\":\"÷\",\"divide\":\"÷\",\"divideontimes\":\"⋇\",\"divonx\":\"⋇\",\"DJcy\":\"Ђ\",\"djcy\":\"ђ\",\"dlcorn\":\"⌞\",\"dlcrop\":\"⌍\",\"dollar\":\"$\",\"Dopf\":\"𝔻\",\"dopf\":\"𝕕\",\"Dot\":\"¨\",\"dot\":\"˙\",\"DotDot\":\"⃜\",\"doteq\":\"≐\",\"doteqdot\":\"≑\",\"DotEqual\":\"≐\",\"dotminus\":\"∸\",\"dotplus\":\"∔\",\"dotsquare\":\"⊡\",\"doublebarwedge\":\"⌆\",\"DoubleContourIntegral\":\"∯\",\"DoubleDot\":\"¨\",\"DoubleDownArrow\":\"⇓\",\"DoubleLeftArrow\":\"⇐\",\"DoubleLeftRightArrow\":\"⇔\",\"DoubleLeftTee\":\"⫤\",\"DoubleLongLeftArrow\":\"⟸\",\"DoubleLongLeftRightArrow\":\"⟺\",\"DoubleLongRightArrow\":\"⟹\",\"DoubleRightArrow\":\"⇒\",\"DoubleRightTee\":\"⊨\",\"DoubleUpArrow\":\"⇑\",\"DoubleUpDownArrow\":\"⇕\",\"DoubleVerticalBar\":\"∥\",\"DownArrowBar\":\"⤓\",\"downarrow\":\"↓\",\"DownArrow\":\"↓\",\"Downarrow\":\"⇓\",\"DownArrowUpArrow\":\"⇵\",\"DownBreve\":\"̑\",\"downdownarrows\":\"⇊\",\"downharpoonleft\":\"⇃\",\"downharpoonright\":\"⇂\",\"DownLeftRightVector\":\"⥐\",\"DownLeftTeeVector\":\"⥞\",\"DownLeftVectorBar\":\"⥖\",\"DownLeftVector\":\"↽\",\"DownRightTeeVector\":\"⥟\",\"DownRightVectorBar\":\"⥗\",\"DownRightVector\":\"⇁\",\"DownTeeArrow\":\"↧\",\"DownTee\":\"⊤\",\"drbkarow\":\"⤐\",\"drcorn\":\"⌟\",\"drcrop\":\"⌌\",\"Dscr\":\"𝒟\",\"dscr\":\"𝒹\",\"DScy\":\"Ѕ\",\"dscy\":\"ѕ\",\"dsol\":\"⧶\",\"Dstrok\":\"Đ\",\"dstrok\":\"đ\",\"dtdot\":\"⋱\",\"dtri\":\"▿\",\"dtrif\":\"▾\",\"duarr\":\"⇵\",\"duhar\":\"⥯\",\"dwangle\":\"⦦\",\"DZcy\":\"Џ\",\"dzcy\":\"џ\",\"dzigrarr\":\"⟿\",\"Eacute\":\"É\",\"eacute\":\"é\",\"easter\":\"⩮\",\"Ecaron\":\"Ě\",\"ecaron\":\"ě\",\"Ecirc\":\"Ê\",\"ecirc\":\"ê\",\"ecir\":\"≖\",\"ecolon\":\"≕\",\"Ecy\":\"Э\",\"ecy\":\"э\",\"eDDot\":\"⩷\",\"Edot\":\"Ė\",\"edot\":\"ė\",\"eDot\":\"≑\",\"ee\":\"ⅇ\",\"efDot\":\"≒\",\"Efr\":\"𝔈\",\"efr\":\"𝔢\",\"eg\":\"⪚\",\"Egrave\":\"È\",\"egrave\":\"è\",\"egs\":\"⪖\",\"egsdot\":\"⪘\",\"el\":\"⪙\",\"Element\":\"∈\",\"elinters\":\"⏧\",\"ell\":\"ℓ\",\"els\":\"⪕\",\"elsdot\":\"⪗\",\"Emacr\":\"Ē\",\"emacr\":\"ē\",\"empty\":\"∅\",\"emptyset\":\"∅\",\"EmptySmallSquare\":\"◻\",\"emptyv\":\"∅\",\"EmptyVerySmallSquare\":\"▫\",\"emsp13\":\" \",\"emsp14\":\" \",\"emsp\":\" \",\"ENG\":\"Ŋ\",\"eng\":\"ŋ\",\"ensp\":\" \",\"Eogon\":\"Ę\",\"eogon\":\"ę\",\"Eopf\":\"𝔼\",\"eopf\":\"𝕖\",\"epar\":\"⋕\",\"eparsl\":\"⧣\",\"eplus\":\"⩱\",\"epsi\":\"ε\",\"Epsilon\":\"Ε\",\"epsilon\":\"ε\",\"epsiv\":\"ϵ\",\"eqcirc\":\"≖\",\"eqcolon\":\"≕\",\"eqsim\":\"≂\",\"eqslantgtr\":\"⪖\",\"eqslantless\":\"⪕\",\"Equal\":\"⩵\",\"equals\":\"=\",\"EqualTilde\":\"≂\",\"equest\":\"≟\",\"Equilibrium\":\"⇌\",\"equiv\":\"≡\",\"equivDD\":\"⩸\",\"eqvparsl\":\"⧥\",\"erarr\":\"⥱\",\"erDot\":\"≓\",\"escr\":\"ℯ\",\"Escr\":\"ℰ\",\"esdot\":\"≐\",\"Esim\":\"⩳\",\"esim\":\"≂\",\"Eta\":\"Η\",\"eta\":\"η\",\"ETH\":\"Ð\",\"eth\":\"ð\",\"Euml\":\"Ë\",\"euml\":\"ë\",\"euro\":\"€\",\"excl\":\"!\",\"exist\":\"∃\",\"Exists\":\"∃\",\"expectation\":\"ℰ\",\"exponentiale\":\"ⅇ\",\"ExponentialE\":\"ⅇ\",\"fallingdotseq\":\"≒\",\"Fcy\":\"Ф\",\"fcy\":\"ф\",\"female\":\"♀\",\"ffilig\":\"ffi\",\"fflig\":\"ff\",\"ffllig\":\"ffl\",\"Ffr\":\"𝔉\",\"ffr\":\"𝔣\",\"filig\":\"fi\",\"FilledSmallSquare\":\"◼\",\"FilledVerySmallSquare\":\"▪\",\"fjlig\":\"fj\",\"flat\":\"♭\",\"fllig\":\"fl\",\"fltns\":\"▱\",\"fnof\":\"ƒ\",\"Fopf\":\"𝔽\",\"fopf\":\"𝕗\",\"forall\":\"∀\",\"ForAll\":\"∀\",\"fork\":\"⋔\",\"forkv\":\"⫙\",\"Fouriertrf\":\"ℱ\",\"fpartint\":\"⨍\",\"frac12\":\"½\",\"frac13\":\"⅓\",\"frac14\":\"¼\",\"frac15\":\"⅕\",\"frac16\":\"⅙\",\"frac18\":\"⅛\",\"frac23\":\"⅔\",\"frac25\":\"⅖\",\"frac34\":\"¾\",\"frac35\":\"⅗\",\"frac38\":\"⅜\",\"frac45\":\"⅘\",\"frac56\":\"⅚\",\"frac58\":\"⅝\",\"frac78\":\"⅞\",\"frasl\":\"⁄\",\"frown\":\"⌢\",\"fscr\":\"𝒻\",\"Fscr\":\"ℱ\",\"gacute\":\"ǵ\",\"Gamma\":\"Γ\",\"gamma\":\"γ\",\"Gammad\":\"Ϝ\",\"gammad\":\"ϝ\",\"gap\":\"⪆\",\"Gbreve\":\"Ğ\",\"gbreve\":\"ğ\",\"Gcedil\":\"Ģ\",\"Gcirc\":\"Ĝ\",\"gcirc\":\"ĝ\",\"Gcy\":\"Г\",\"gcy\":\"г\",\"Gdot\":\"Ġ\",\"gdot\":\"ġ\",\"ge\":\"≥\",\"gE\":\"≧\",\"gEl\":\"⪌\",\"gel\":\"⋛\",\"geq\":\"≥\",\"geqq\":\"≧\",\"geqslant\":\"⩾\",\"gescc\":\"⪩\",\"ges\":\"⩾\",\"gesdot\":\"⪀\",\"gesdoto\":\"⪂\",\"gesdotol\":\"⪄\",\"gesl\":\"⋛︀\",\"gesles\":\"⪔\",\"Gfr\":\"𝔊\",\"gfr\":\"𝔤\",\"gg\":\"≫\",\"Gg\":\"⋙\",\"ggg\":\"⋙\",\"gimel\":\"ℷ\",\"GJcy\":\"Ѓ\",\"gjcy\":\"ѓ\",\"gla\":\"⪥\",\"gl\":\"≷\",\"glE\":\"⪒\",\"glj\":\"⪤\",\"gnap\":\"⪊\",\"gnapprox\":\"⪊\",\"gne\":\"⪈\",\"gnE\":\"≩\",\"gneq\":\"⪈\",\"gneqq\":\"≩\",\"gnsim\":\"⋧\",\"Gopf\":\"𝔾\",\"gopf\":\"𝕘\",\"grave\":\"`\",\"GreaterEqual\":\"≥\",\"GreaterEqualLess\":\"⋛\",\"GreaterFullEqual\":\"≧\",\"GreaterGreater\":\"⪢\",\"GreaterLess\":\"≷\",\"GreaterSlantEqual\":\"⩾\",\"GreaterTilde\":\"≳\",\"Gscr\":\"𝒢\",\"gscr\":\"ℊ\",\"gsim\":\"≳\",\"gsime\":\"⪎\",\"gsiml\":\"⪐\",\"gtcc\":\"⪧\",\"gtcir\":\"⩺\",\"gt\":\">\",\"GT\":\">\",\"Gt\":\"≫\",\"gtdot\":\"⋗\",\"gtlPar\":\"⦕\",\"gtquest\":\"⩼\",\"gtrapprox\":\"⪆\",\"gtrarr\":\"⥸\",\"gtrdot\":\"⋗\",\"gtreqless\":\"⋛\",\"gtreqqless\":\"⪌\",\"gtrless\":\"≷\",\"gtrsim\":\"≳\",\"gvertneqq\":\"≩︀\",\"gvnE\":\"≩︀\",\"Hacek\":\"ˇ\",\"hairsp\":\" \",\"half\":\"½\",\"hamilt\":\"ℋ\",\"HARDcy\":\"Ъ\",\"hardcy\":\"ъ\",\"harrcir\":\"⥈\",\"harr\":\"↔\",\"hArr\":\"⇔\",\"harrw\":\"↭\",\"Hat\":\"^\",\"hbar\":\"ℏ\",\"Hcirc\":\"Ĥ\",\"hcirc\":\"ĥ\",\"hearts\":\"♥\",\"heartsuit\":\"♥\",\"hellip\":\"…\",\"hercon\":\"⊹\",\"hfr\":\"𝔥\",\"Hfr\":\"ℌ\",\"HilbertSpace\":\"ℋ\",\"hksearow\":\"⤥\",\"hkswarow\":\"⤦\",\"hoarr\":\"⇿\",\"homtht\":\"∻\",\"hookleftarrow\":\"↩\",\"hookrightarrow\":\"↪\",\"hopf\":\"𝕙\",\"Hopf\":\"ℍ\",\"horbar\":\"―\",\"HorizontalLine\":\"─\",\"hscr\":\"𝒽\",\"Hscr\":\"ℋ\",\"hslash\":\"ℏ\",\"Hstrok\":\"Ħ\",\"hstrok\":\"ħ\",\"HumpDownHump\":\"≎\",\"HumpEqual\":\"≏\",\"hybull\":\"⁃\",\"hyphen\":\"‐\",\"Iacute\":\"Í\",\"iacute\":\"í\",\"ic\":\"\",\"Icirc\":\"Î\",\"icirc\":\"î\",\"Icy\":\"И\",\"icy\":\"и\",\"Idot\":\"İ\",\"IEcy\":\"Е\",\"iecy\":\"е\",\"iexcl\":\"¡\",\"iff\":\"⇔\",\"ifr\":\"𝔦\",\"Ifr\":\"ℑ\",\"Igrave\":\"Ì\",\"igrave\":\"ì\",\"ii\":\"ⅈ\",\"iiiint\":\"⨌\",\"iiint\":\"∭\",\"iinfin\":\"⧜\",\"iiota\":\"℩\",\"IJlig\":\"IJ\",\"ijlig\":\"ij\",\"Imacr\":\"Ī\",\"imacr\":\"ī\",\"image\":\"ℑ\",\"ImaginaryI\":\"ⅈ\",\"imagline\":\"ℐ\",\"imagpart\":\"ℑ\",\"imath\":\"ı\",\"Im\":\"ℑ\",\"imof\":\"⊷\",\"imped\":\"Ƶ\",\"Implies\":\"⇒\",\"incare\":\"℅\",\"in\":\"∈\",\"infin\":\"∞\",\"infintie\":\"⧝\",\"inodot\":\"ı\",\"intcal\":\"⊺\",\"int\":\"∫\",\"Int\":\"∬\",\"integers\":\"ℤ\",\"Integral\":\"∫\",\"intercal\":\"⊺\",\"Intersection\":\"⋂\",\"intlarhk\":\"⨗\",\"intprod\":\"⨼\",\"InvisibleComma\":\"\",\"InvisibleTimes\":\"\",\"IOcy\":\"Ё\",\"iocy\":\"ё\",\"Iogon\":\"Į\",\"iogon\":\"į\",\"Iopf\":\"𝕀\",\"iopf\":\"𝕚\",\"Iota\":\"Ι\",\"iota\":\"ι\",\"iprod\":\"⨼\",\"iquest\":\"¿\",\"iscr\":\"𝒾\",\"Iscr\":\"ℐ\",\"isin\":\"∈\",\"isindot\":\"⋵\",\"isinE\":\"⋹\",\"isins\":\"⋴\",\"isinsv\":\"⋳\",\"isinv\":\"∈\",\"it\":\"\",\"Itilde\":\"Ĩ\",\"itilde\":\"ĩ\",\"Iukcy\":\"І\",\"iukcy\":\"і\",\"Iuml\":\"Ï\",\"iuml\":\"ï\",\"Jcirc\":\"Ĵ\",\"jcirc\":\"ĵ\",\"Jcy\":\"Й\",\"jcy\":\"й\",\"Jfr\":\"𝔍\",\"jfr\":\"𝔧\",\"jmath\":\"ȷ\",\"Jopf\":\"𝕁\",\"jopf\":\"𝕛\",\"Jscr\":\"𝒥\",\"jscr\":\"𝒿\",\"Jsercy\":\"Ј\",\"jsercy\":\"ј\",\"Jukcy\":\"Є\",\"jukcy\":\"є\",\"Kappa\":\"Κ\",\"kappa\":\"κ\",\"kappav\":\"ϰ\",\"Kcedil\":\"Ķ\",\"kcedil\":\"ķ\",\"Kcy\":\"К\",\"kcy\":\"к\",\"Kfr\":\"𝔎\",\"kfr\":\"𝔨\",\"kgreen\":\"ĸ\",\"KHcy\":\"Х\",\"khcy\":\"х\",\"KJcy\":\"Ќ\",\"kjcy\":\"ќ\",\"Kopf\":\"𝕂\",\"kopf\":\"𝕜\",\"Kscr\":\"𝒦\",\"kscr\":\"𝓀\",\"lAarr\":\"⇚\",\"Lacute\":\"Ĺ\",\"lacute\":\"ĺ\",\"laemptyv\":\"⦴\",\"lagran\":\"ℒ\",\"Lambda\":\"Λ\",\"lambda\":\"λ\",\"lang\":\"⟨\",\"Lang\":\"⟪\",\"langd\":\"⦑\",\"langle\":\"⟨\",\"lap\":\"⪅\",\"Laplacetrf\":\"ℒ\",\"laquo\":\"«\",\"larrb\":\"⇤\",\"larrbfs\":\"⤟\",\"larr\":\"←\",\"Larr\":\"↞\",\"lArr\":\"⇐\",\"larrfs\":\"⤝\",\"larrhk\":\"↩\",\"larrlp\":\"↫\",\"larrpl\":\"⤹\",\"larrsim\":\"⥳\",\"larrtl\":\"↢\",\"latail\":\"⤙\",\"lAtail\":\"⤛\",\"lat\":\"⪫\",\"late\":\"⪭\",\"lates\":\"⪭︀\",\"lbarr\":\"⤌\",\"lBarr\":\"⤎\",\"lbbrk\":\"❲\",\"lbrace\":\"{\",\"lbrack\":\"[\",\"lbrke\":\"⦋\",\"lbrksld\":\"⦏\",\"lbrkslu\":\"⦍\",\"Lcaron\":\"Ľ\",\"lcaron\":\"ľ\",\"Lcedil\":\"Ļ\",\"lcedil\":\"ļ\",\"lceil\":\"⌈\",\"lcub\":\"{\",\"Lcy\":\"Л\",\"lcy\":\"л\",\"ldca\":\"⤶\",\"ldquo\":\"“\",\"ldquor\":\"„\",\"ldrdhar\":\"⥧\",\"ldrushar\":\"⥋\",\"ldsh\":\"↲\",\"le\":\"≤\",\"lE\":\"≦\",\"LeftAngleBracket\":\"⟨\",\"LeftArrowBar\":\"⇤\",\"leftarrow\":\"←\",\"LeftArrow\":\"←\",\"Leftarrow\":\"⇐\",\"LeftArrowRightArrow\":\"⇆\",\"leftarrowtail\":\"↢\",\"LeftCeiling\":\"⌈\",\"LeftDoubleBracket\":\"⟦\",\"LeftDownTeeVector\":\"⥡\",\"LeftDownVectorBar\":\"⥙\",\"LeftDownVector\":\"⇃\",\"LeftFloor\":\"⌊\",\"leftharpoondown\":\"↽\",\"leftharpoonup\":\"↼\",\"leftleftarrows\":\"⇇\",\"leftrightarrow\":\"↔\",\"LeftRightArrow\":\"↔\",\"Leftrightarrow\":\"⇔\",\"leftrightarrows\":\"⇆\",\"leftrightharpoons\":\"⇋\",\"leftrightsquigarrow\":\"↭\",\"LeftRightVector\":\"⥎\",\"LeftTeeArrow\":\"↤\",\"LeftTee\":\"⊣\",\"LeftTeeVector\":\"⥚\",\"leftthreetimes\":\"⋋\",\"LeftTriangleBar\":\"⧏\",\"LeftTriangle\":\"⊲\",\"LeftTriangleEqual\":\"⊴\",\"LeftUpDownVector\":\"⥑\",\"LeftUpTeeVector\":\"⥠\",\"LeftUpVectorBar\":\"⥘\",\"LeftUpVector\":\"↿\",\"LeftVectorBar\":\"⥒\",\"LeftVector\":\"↼\",\"lEg\":\"⪋\",\"leg\":\"⋚\",\"leq\":\"≤\",\"leqq\":\"≦\",\"leqslant\":\"⩽\",\"lescc\":\"⪨\",\"les\":\"⩽\",\"lesdot\":\"⩿\",\"lesdoto\":\"⪁\",\"lesdotor\":\"⪃\",\"lesg\":\"⋚︀\",\"lesges\":\"⪓\",\"lessapprox\":\"⪅\",\"lessdot\":\"⋖\",\"lesseqgtr\":\"⋚\",\"lesseqqgtr\":\"⪋\",\"LessEqualGreater\":\"⋚\",\"LessFullEqual\":\"≦\",\"LessGreater\":\"≶\",\"lessgtr\":\"≶\",\"LessLess\":\"⪡\",\"lesssim\":\"≲\",\"LessSlantEqual\":\"⩽\",\"LessTilde\":\"≲\",\"lfisht\":\"⥼\",\"lfloor\":\"⌊\",\"Lfr\":\"𝔏\",\"lfr\":\"𝔩\",\"lg\":\"≶\",\"lgE\":\"⪑\",\"lHar\":\"⥢\",\"lhard\":\"↽\",\"lharu\":\"↼\",\"lharul\":\"⥪\",\"lhblk\":\"▄\",\"LJcy\":\"Љ\",\"ljcy\":\"љ\",\"llarr\":\"⇇\",\"ll\":\"≪\",\"Ll\":\"⋘\",\"llcorner\":\"⌞\",\"Lleftarrow\":\"⇚\",\"llhard\":\"⥫\",\"lltri\":\"◺\",\"Lmidot\":\"Ŀ\",\"lmidot\":\"ŀ\",\"lmoustache\":\"⎰\",\"lmoust\":\"⎰\",\"lnap\":\"⪉\",\"lnapprox\":\"⪉\",\"lne\":\"⪇\",\"lnE\":\"≨\",\"lneq\":\"⪇\",\"lneqq\":\"≨\",\"lnsim\":\"⋦\",\"loang\":\"⟬\",\"loarr\":\"⇽\",\"lobrk\":\"⟦\",\"longleftarrow\":\"⟵\",\"LongLeftArrow\":\"⟵\",\"Longleftarrow\":\"⟸\",\"longleftrightarrow\":\"⟷\",\"LongLeftRightArrow\":\"⟷\",\"Longleftrightarrow\":\"⟺\",\"longmapsto\":\"⟼\",\"longrightarrow\":\"⟶\",\"LongRightArrow\":\"⟶\",\"Longrightarrow\":\"⟹\",\"looparrowleft\":\"↫\",\"looparrowright\":\"↬\",\"lopar\":\"⦅\",\"Lopf\":\"𝕃\",\"lopf\":\"𝕝\",\"loplus\":\"⨭\",\"lotimes\":\"⨴\",\"lowast\":\"∗\",\"lowbar\":\"_\",\"LowerLeftArrow\":\"↙\",\"LowerRightArrow\":\"↘\",\"loz\":\"◊\",\"lozenge\":\"◊\",\"lozf\":\"⧫\",\"lpar\":\"(\",\"lparlt\":\"⦓\",\"lrarr\":\"⇆\",\"lrcorner\":\"⌟\",\"lrhar\":\"⇋\",\"lrhard\":\"⥭\",\"lrm\":\"\",\"lrtri\":\"⊿\",\"lsaquo\":\"‹\",\"lscr\":\"𝓁\",\"Lscr\":\"ℒ\",\"lsh\":\"↰\",\"Lsh\":\"↰\",\"lsim\":\"≲\",\"lsime\":\"⪍\",\"lsimg\":\"⪏\",\"lsqb\":\"[\",\"lsquo\":\"‘\",\"lsquor\":\"‚\",\"Lstrok\":\"Ł\",\"lstrok\":\"ł\",\"ltcc\":\"⪦\",\"ltcir\":\"⩹\",\"lt\":\"<\",\"LT\":\"<\",\"Lt\":\"≪\",\"ltdot\":\"⋖\",\"lthree\":\"⋋\",\"ltimes\":\"⋉\",\"ltlarr\":\"⥶\",\"ltquest\":\"⩻\",\"ltri\":\"◃\",\"ltrie\":\"⊴\",\"ltrif\":\"◂\",\"ltrPar\":\"⦖\",\"lurdshar\":\"⥊\",\"luruhar\":\"⥦\",\"lvertneqq\":\"≨︀\",\"lvnE\":\"≨︀\",\"macr\":\"¯\",\"male\":\"♂\",\"malt\":\"✠\",\"maltese\":\"✠\",\"Map\":\"⤅\",\"map\":\"↦\",\"mapsto\":\"↦\",\"mapstodown\":\"↧\",\"mapstoleft\":\"↤\",\"mapstoup\":\"↥\",\"marker\":\"▮\",\"mcomma\":\"⨩\",\"Mcy\":\"М\",\"mcy\":\"м\",\"mdash\":\"—\",\"mDDot\":\"∺\",\"measuredangle\":\"∡\",\"MediumSpace\":\" \",\"Mellintrf\":\"ℳ\",\"Mfr\":\"𝔐\",\"mfr\":\"𝔪\",\"mho\":\"℧\",\"micro\":\"µ\",\"midast\":\"*\",\"midcir\":\"⫰\",\"mid\":\"∣\",\"middot\":\"·\",\"minusb\":\"⊟\",\"minus\":\"−\",\"minusd\":\"∸\",\"minusdu\":\"⨪\",\"MinusPlus\":\"∓\",\"mlcp\":\"⫛\",\"mldr\":\"…\",\"mnplus\":\"∓\",\"models\":\"⊧\",\"Mopf\":\"𝕄\",\"mopf\":\"𝕞\",\"mp\":\"∓\",\"mscr\":\"𝓂\",\"Mscr\":\"ℳ\",\"mstpos\":\"∾\",\"Mu\":\"Μ\",\"mu\":\"μ\",\"multimap\":\"⊸\",\"mumap\":\"⊸\",\"nabla\":\"∇\",\"Nacute\":\"Ń\",\"nacute\":\"ń\",\"nang\":\"∠⃒\",\"nap\":\"≉\",\"napE\":\"⩰̸\",\"napid\":\"≋̸\",\"napos\":\"ʼn\",\"napprox\":\"≉\",\"natural\":\"♮\",\"naturals\":\"ℕ\",\"natur\":\"♮\",\"nbsp\":\" \",\"nbump\":\"≎̸\",\"nbumpe\":\"≏̸\",\"ncap\":\"⩃\",\"Ncaron\":\"Ň\",\"ncaron\":\"ň\",\"Ncedil\":\"Ņ\",\"ncedil\":\"ņ\",\"ncong\":\"≇\",\"ncongdot\":\"⩭̸\",\"ncup\":\"⩂\",\"Ncy\":\"Н\",\"ncy\":\"н\",\"ndash\":\"–\",\"nearhk\":\"⤤\",\"nearr\":\"↗\",\"neArr\":\"⇗\",\"nearrow\":\"↗\",\"ne\":\"≠\",\"nedot\":\"≐̸\",\"NegativeMediumSpace\":\"\",\"NegativeThickSpace\":\"\",\"NegativeThinSpace\":\"\",\"NegativeVeryThinSpace\":\"\",\"nequiv\":\"≢\",\"nesear\":\"⤨\",\"nesim\":\"≂̸\",\"NestedGreaterGreater\":\"≫\",\"NestedLessLess\":\"≪\",\"NewLine\":\"\\n\",\"nexist\":\"∄\",\"nexists\":\"∄\",\"Nfr\":\"𝔑\",\"nfr\":\"𝔫\",\"ngE\":\"≧̸\",\"nge\":\"≱\",\"ngeq\":\"≱\",\"ngeqq\":\"≧̸\",\"ngeqslant\":\"⩾̸\",\"nges\":\"⩾̸\",\"nGg\":\"⋙̸\",\"ngsim\":\"≵\",\"nGt\":\"≫⃒\",\"ngt\":\"≯\",\"ngtr\":\"≯\",\"nGtv\":\"≫̸\",\"nharr\":\"↮\",\"nhArr\":\"⇎\",\"nhpar\":\"⫲\",\"ni\":\"∋\",\"nis\":\"⋼\",\"nisd\":\"⋺\",\"niv\":\"∋\",\"NJcy\":\"Њ\",\"njcy\":\"њ\",\"nlarr\":\"↚\",\"nlArr\":\"⇍\",\"nldr\":\"‥\",\"nlE\":\"≦̸\",\"nle\":\"≰\",\"nleftarrow\":\"↚\",\"nLeftarrow\":\"⇍\",\"nleftrightarrow\":\"↮\",\"nLeftrightarrow\":\"⇎\",\"nleq\":\"≰\",\"nleqq\":\"≦̸\",\"nleqslant\":\"⩽̸\",\"nles\":\"⩽̸\",\"nless\":\"≮\",\"nLl\":\"⋘̸\",\"nlsim\":\"≴\",\"nLt\":\"≪⃒\",\"nlt\":\"≮\",\"nltri\":\"⋪\",\"nltrie\":\"⋬\",\"nLtv\":\"≪̸\",\"nmid\":\"∤\",\"NoBreak\":\"\",\"NonBreakingSpace\":\" \",\"nopf\":\"𝕟\",\"Nopf\":\"ℕ\",\"Not\":\"⫬\",\"not\":\"¬\",\"NotCongruent\":\"≢\",\"NotCupCap\":\"≭\",\"NotDoubleVerticalBar\":\"∦\",\"NotElement\":\"∉\",\"NotEqual\":\"≠\",\"NotEqualTilde\":\"≂̸\",\"NotExists\":\"∄\",\"NotGreater\":\"≯\",\"NotGreaterEqual\":\"≱\",\"NotGreaterFullEqual\":\"≧̸\",\"NotGreaterGreater\":\"≫̸\",\"NotGreaterLess\":\"≹\",\"NotGreaterSlantEqual\":\"⩾̸\",\"NotGreaterTilde\":\"≵\",\"NotHumpDownHump\":\"≎̸\",\"NotHumpEqual\":\"≏̸\",\"notin\":\"∉\",\"notindot\":\"⋵̸\",\"notinE\":\"⋹̸\",\"notinva\":\"∉\",\"notinvb\":\"⋷\",\"notinvc\":\"⋶\",\"NotLeftTriangleBar\":\"⧏̸\",\"NotLeftTriangle\":\"⋪\",\"NotLeftTriangleEqual\":\"⋬\",\"NotLess\":\"≮\",\"NotLessEqual\":\"≰\",\"NotLessGreater\":\"≸\",\"NotLessLess\":\"≪̸\",\"NotLessSlantEqual\":\"⩽̸\",\"NotLessTilde\":\"≴\",\"NotNestedGreaterGreater\":\"⪢̸\",\"NotNestedLessLess\":\"⪡̸\",\"notni\":\"∌\",\"notniva\":\"∌\",\"notnivb\":\"⋾\",\"notnivc\":\"⋽\",\"NotPrecedes\":\"⊀\",\"NotPrecedesEqual\":\"⪯̸\",\"NotPrecedesSlantEqual\":\"⋠\",\"NotReverseElement\":\"∌\",\"NotRightTriangleBar\":\"⧐̸\",\"NotRightTriangle\":\"⋫\",\"NotRightTriangleEqual\":\"⋭\",\"NotSquareSubset\":\"⊏̸\",\"NotSquareSubsetEqual\":\"⋢\",\"NotSquareSuperset\":\"⊐̸\",\"NotSquareSupersetEqual\":\"⋣\",\"NotSubset\":\"⊂⃒\",\"NotSubsetEqual\":\"⊈\",\"NotSucceeds\":\"⊁\",\"NotSucceedsEqual\":\"⪰̸\",\"NotSucceedsSlantEqual\":\"⋡\",\"NotSucceedsTilde\":\"≿̸\",\"NotSuperset\":\"⊃⃒\",\"NotSupersetEqual\":\"⊉\",\"NotTilde\":\"≁\",\"NotTildeEqual\":\"≄\",\"NotTildeFullEqual\":\"≇\",\"NotTildeTilde\":\"≉\",\"NotVerticalBar\":\"∤\",\"nparallel\":\"∦\",\"npar\":\"∦\",\"nparsl\":\"⫽⃥\",\"npart\":\"∂̸\",\"npolint\":\"⨔\",\"npr\":\"⊀\",\"nprcue\":\"⋠\",\"nprec\":\"⊀\",\"npreceq\":\"⪯̸\",\"npre\":\"⪯̸\",\"nrarrc\":\"⤳̸\",\"nrarr\":\"↛\",\"nrArr\":\"⇏\",\"nrarrw\":\"↝̸\",\"nrightarrow\":\"↛\",\"nRightarrow\":\"⇏\",\"nrtri\":\"⋫\",\"nrtrie\":\"⋭\",\"nsc\":\"⊁\",\"nsccue\":\"⋡\",\"nsce\":\"⪰̸\",\"Nscr\":\"𝒩\",\"nscr\":\"𝓃\",\"nshortmid\":\"∤\",\"nshortparallel\":\"∦\",\"nsim\":\"≁\",\"nsime\":\"≄\",\"nsimeq\":\"≄\",\"nsmid\":\"∤\",\"nspar\":\"∦\",\"nsqsube\":\"⋢\",\"nsqsupe\":\"⋣\",\"nsub\":\"⊄\",\"nsubE\":\"⫅̸\",\"nsube\":\"⊈\",\"nsubset\":\"⊂⃒\",\"nsubseteq\":\"⊈\",\"nsubseteqq\":\"⫅̸\",\"nsucc\":\"⊁\",\"nsucceq\":\"⪰̸\",\"nsup\":\"⊅\",\"nsupE\":\"⫆̸\",\"nsupe\":\"⊉\",\"nsupset\":\"⊃⃒\",\"nsupseteq\":\"⊉\",\"nsupseteqq\":\"⫆̸\",\"ntgl\":\"≹\",\"Ntilde\":\"Ñ\",\"ntilde\":\"ñ\",\"ntlg\":\"≸\",\"ntriangleleft\":\"⋪\",\"ntrianglelefteq\":\"⋬\",\"ntriangleright\":\"⋫\",\"ntrianglerighteq\":\"⋭\",\"Nu\":\"Ν\",\"nu\":\"ν\",\"num\":\"#\",\"numero\":\"№\",\"numsp\":\" \",\"nvap\":\"≍⃒\",\"nvdash\":\"⊬\",\"nvDash\":\"⊭\",\"nVdash\":\"⊮\",\"nVDash\":\"⊯\",\"nvge\":\"≥⃒\",\"nvgt\":\">⃒\",\"nvHarr\":\"⤄\",\"nvinfin\":\"⧞\",\"nvlArr\":\"⤂\",\"nvle\":\"≤⃒\",\"nvlt\":\"<⃒\",\"nvltrie\":\"⊴⃒\",\"nvrArr\":\"⤃\",\"nvrtrie\":\"⊵⃒\",\"nvsim\":\"∼⃒\",\"nwarhk\":\"⤣\",\"nwarr\":\"↖\",\"nwArr\":\"⇖\",\"nwarrow\":\"↖\",\"nwnear\":\"⤧\",\"Oacute\":\"Ó\",\"oacute\":\"ó\",\"oast\":\"⊛\",\"Ocirc\":\"Ô\",\"ocirc\":\"ô\",\"ocir\":\"⊚\",\"Ocy\":\"О\",\"ocy\":\"о\",\"odash\":\"⊝\",\"Odblac\":\"Ő\",\"odblac\":\"ő\",\"odiv\":\"⨸\",\"odot\":\"⊙\",\"odsold\":\"⦼\",\"OElig\":\"Œ\",\"oelig\":\"œ\",\"ofcir\":\"⦿\",\"Ofr\":\"𝔒\",\"ofr\":\"𝔬\",\"ogon\":\"˛\",\"Ograve\":\"Ò\",\"ograve\":\"ò\",\"ogt\":\"⧁\",\"ohbar\":\"⦵\",\"ohm\":\"Ω\",\"oint\":\"∮\",\"olarr\":\"↺\",\"olcir\":\"⦾\",\"olcross\":\"⦻\",\"oline\":\"‾\",\"olt\":\"⧀\",\"Omacr\":\"Ō\",\"omacr\":\"ō\",\"Omega\":\"Ω\",\"omega\":\"ω\",\"Omicron\":\"Ο\",\"omicron\":\"ο\",\"omid\":\"⦶\",\"ominus\":\"⊖\",\"Oopf\":\"𝕆\",\"oopf\":\"𝕠\",\"opar\":\"⦷\",\"OpenCurlyDoubleQuote\":\"“\",\"OpenCurlyQuote\":\"‘\",\"operp\":\"⦹\",\"oplus\":\"⊕\",\"orarr\":\"↻\",\"Or\":\"⩔\",\"or\":\"∨\",\"ord\":\"⩝\",\"order\":\"ℴ\",\"orderof\":\"ℴ\",\"ordf\":\"ª\",\"ordm\":\"º\",\"origof\":\"⊶\",\"oror\":\"⩖\",\"orslope\":\"⩗\",\"orv\":\"⩛\",\"oS\":\"Ⓢ\",\"Oscr\":\"𝒪\",\"oscr\":\"ℴ\",\"Oslash\":\"Ø\",\"oslash\":\"ø\",\"osol\":\"⊘\",\"Otilde\":\"Õ\",\"otilde\":\"õ\",\"otimesas\":\"⨶\",\"Otimes\":\"⨷\",\"otimes\":\"⊗\",\"Ouml\":\"Ö\",\"ouml\":\"ö\",\"ovbar\":\"⌽\",\"OverBar\":\"‾\",\"OverBrace\":\"⏞\",\"OverBracket\":\"⎴\",\"OverParenthesis\":\"⏜\",\"para\":\"¶\",\"parallel\":\"∥\",\"par\":\"∥\",\"parsim\":\"⫳\",\"parsl\":\"⫽\",\"part\":\"∂\",\"PartialD\":\"∂\",\"Pcy\":\"П\",\"pcy\":\"п\",\"percnt\":\"%\",\"period\":\".\",\"permil\":\"‰\",\"perp\":\"⊥\",\"pertenk\":\"‱\",\"Pfr\":\"𝔓\",\"pfr\":\"𝔭\",\"Phi\":\"Φ\",\"phi\":\"φ\",\"phiv\":\"ϕ\",\"phmmat\":\"ℳ\",\"phone\":\"☎\",\"Pi\":\"Π\",\"pi\":\"π\",\"pitchfork\":\"⋔\",\"piv\":\"ϖ\",\"planck\":\"ℏ\",\"planckh\":\"ℎ\",\"plankv\":\"ℏ\",\"plusacir\":\"⨣\",\"plusb\":\"⊞\",\"pluscir\":\"⨢\",\"plus\":\"+\",\"plusdo\":\"∔\",\"plusdu\":\"⨥\",\"pluse\":\"⩲\",\"PlusMinus\":\"±\",\"plusmn\":\"±\",\"plussim\":\"⨦\",\"plustwo\":\"⨧\",\"pm\":\"±\",\"Poincareplane\":\"ℌ\",\"pointint\":\"⨕\",\"popf\":\"𝕡\",\"Popf\":\"ℙ\",\"pound\":\"£\",\"prap\":\"⪷\",\"Pr\":\"⪻\",\"pr\":\"≺\",\"prcue\":\"≼\",\"precapprox\":\"⪷\",\"prec\":\"≺\",\"preccurlyeq\":\"≼\",\"Precedes\":\"≺\",\"PrecedesEqual\":\"⪯\",\"PrecedesSlantEqual\":\"≼\",\"PrecedesTilde\":\"≾\",\"preceq\":\"⪯\",\"precnapprox\":\"⪹\",\"precneqq\":\"⪵\",\"precnsim\":\"⋨\",\"pre\":\"⪯\",\"prE\":\"⪳\",\"precsim\":\"≾\",\"prime\":\"′\",\"Prime\":\"″\",\"primes\":\"ℙ\",\"prnap\":\"⪹\",\"prnE\":\"⪵\",\"prnsim\":\"⋨\",\"prod\":\"∏\",\"Product\":\"∏\",\"profalar\":\"⌮\",\"profline\":\"⌒\",\"profsurf\":\"⌓\",\"prop\":\"∝\",\"Proportional\":\"∝\",\"Proportion\":\"∷\",\"propto\":\"∝\",\"prsim\":\"≾\",\"prurel\":\"⊰\",\"Pscr\":\"𝒫\",\"pscr\":\"𝓅\",\"Psi\":\"Ψ\",\"psi\":\"ψ\",\"puncsp\":\" \",\"Qfr\":\"𝔔\",\"qfr\":\"𝔮\",\"qint\":\"⨌\",\"qopf\":\"𝕢\",\"Qopf\":\"ℚ\",\"qprime\":\"⁗\",\"Qscr\":\"𝒬\",\"qscr\":\"𝓆\",\"quaternions\":\"ℍ\",\"quatint\":\"⨖\",\"quest\":\"?\",\"questeq\":\"≟\",\"quot\":\"\\\"\",\"QUOT\":\"\\\"\",\"rAarr\":\"⇛\",\"race\":\"∽̱\",\"Racute\":\"Ŕ\",\"racute\":\"ŕ\",\"radic\":\"√\",\"raemptyv\":\"⦳\",\"rang\":\"⟩\",\"Rang\":\"⟫\",\"rangd\":\"⦒\",\"range\":\"⦥\",\"rangle\":\"⟩\",\"raquo\":\"»\",\"rarrap\":\"⥵\",\"rarrb\":\"⇥\",\"rarrbfs\":\"⤠\",\"rarrc\":\"⤳\",\"rarr\":\"→\",\"Rarr\":\"↠\",\"rArr\":\"⇒\",\"rarrfs\":\"⤞\",\"rarrhk\":\"↪\",\"rarrlp\":\"↬\",\"rarrpl\":\"⥅\",\"rarrsim\":\"⥴\",\"Rarrtl\":\"⤖\",\"rarrtl\":\"↣\",\"rarrw\":\"↝\",\"ratail\":\"⤚\",\"rAtail\":\"⤜\",\"ratio\":\"∶\",\"rationals\":\"ℚ\",\"rbarr\":\"⤍\",\"rBarr\":\"⤏\",\"RBarr\":\"⤐\",\"rbbrk\":\"❳\",\"rbrace\":\"}\",\"rbrack\":\"]\",\"rbrke\":\"⦌\",\"rbrksld\":\"⦎\",\"rbrkslu\":\"⦐\",\"Rcaron\":\"Ř\",\"rcaron\":\"ř\",\"Rcedil\":\"Ŗ\",\"rcedil\":\"ŗ\",\"rceil\":\"⌉\",\"rcub\":\"}\",\"Rcy\":\"Р\",\"rcy\":\"р\",\"rdca\":\"⤷\",\"rdldhar\":\"⥩\",\"rdquo\":\"”\",\"rdquor\":\"”\",\"rdsh\":\"↳\",\"real\":\"ℜ\",\"realine\":\"ℛ\",\"realpart\":\"ℜ\",\"reals\":\"ℝ\",\"Re\":\"ℜ\",\"rect\":\"▭\",\"reg\":\"®\",\"REG\":\"®\",\"ReverseElement\":\"∋\",\"ReverseEquilibrium\":\"⇋\",\"ReverseUpEquilibrium\":\"⥯\",\"rfisht\":\"⥽\",\"rfloor\":\"⌋\",\"rfr\":\"𝔯\",\"Rfr\":\"ℜ\",\"rHar\":\"⥤\",\"rhard\":\"⇁\",\"rharu\":\"⇀\",\"rharul\":\"⥬\",\"Rho\":\"Ρ\",\"rho\":\"ρ\",\"rhov\":\"ϱ\",\"RightAngleBracket\":\"⟩\",\"RightArrowBar\":\"⇥\",\"rightarrow\":\"→\",\"RightArrow\":\"→\",\"Rightarrow\":\"⇒\",\"RightArrowLeftArrow\":\"⇄\",\"rightarrowtail\":\"↣\",\"RightCeiling\":\"⌉\",\"RightDoubleBracket\":\"⟧\",\"RightDownTeeVector\":\"⥝\",\"RightDownVectorBar\":\"⥕\",\"RightDownVector\":\"⇂\",\"RightFloor\":\"⌋\",\"rightharpoondown\":\"⇁\",\"rightharpoonup\":\"⇀\",\"rightleftarrows\":\"⇄\",\"rightleftharpoons\":\"⇌\",\"rightrightarrows\":\"⇉\",\"rightsquigarrow\":\"↝\",\"RightTeeArrow\":\"↦\",\"RightTee\":\"⊢\",\"RightTeeVector\":\"⥛\",\"rightthreetimes\":\"⋌\",\"RightTriangleBar\":\"⧐\",\"RightTriangle\":\"⊳\",\"RightTriangleEqual\":\"⊵\",\"RightUpDownVector\":\"⥏\",\"RightUpTeeVector\":\"⥜\",\"RightUpVectorBar\":\"⥔\",\"RightUpVector\":\"↾\",\"RightVectorBar\":\"⥓\",\"RightVector\":\"⇀\",\"ring\":\"˚\",\"risingdotseq\":\"≓\",\"rlarr\":\"⇄\",\"rlhar\":\"⇌\",\"rlm\":\"\",\"rmoustache\":\"⎱\",\"rmoust\":\"⎱\",\"rnmid\":\"⫮\",\"roang\":\"⟭\",\"roarr\":\"⇾\",\"robrk\":\"⟧\",\"ropar\":\"⦆\",\"ropf\":\"𝕣\",\"Ropf\":\"ℝ\",\"roplus\":\"⨮\",\"rotimes\":\"⨵\",\"RoundImplies\":\"⥰\",\"rpar\":\")\",\"rpargt\":\"⦔\",\"rppolint\":\"⨒\",\"rrarr\":\"⇉\",\"Rrightarrow\":\"⇛\",\"rsaquo\":\"›\",\"rscr\":\"𝓇\",\"Rscr\":\"ℛ\",\"rsh\":\"↱\",\"Rsh\":\"↱\",\"rsqb\":\"]\",\"rsquo\":\"’\",\"rsquor\":\"’\",\"rthree\":\"⋌\",\"rtimes\":\"⋊\",\"rtri\":\"▹\",\"rtrie\":\"⊵\",\"rtrif\":\"▸\",\"rtriltri\":\"⧎\",\"RuleDelayed\":\"⧴\",\"ruluhar\":\"⥨\",\"rx\":\"℞\",\"Sacute\":\"Ś\",\"sacute\":\"ś\",\"sbquo\":\"‚\",\"scap\":\"⪸\",\"Scaron\":\"Š\",\"scaron\":\"š\",\"Sc\":\"⪼\",\"sc\":\"≻\",\"sccue\":\"≽\",\"sce\":\"⪰\",\"scE\":\"⪴\",\"Scedil\":\"Ş\",\"scedil\":\"ş\",\"Scirc\":\"Ŝ\",\"scirc\":\"ŝ\",\"scnap\":\"⪺\",\"scnE\":\"⪶\",\"scnsim\":\"⋩\",\"scpolint\":\"⨓\",\"scsim\":\"≿\",\"Scy\":\"С\",\"scy\":\"с\",\"sdotb\":\"⊡\",\"sdot\":\"⋅\",\"sdote\":\"⩦\",\"searhk\":\"⤥\",\"searr\":\"↘\",\"seArr\":\"⇘\",\"searrow\":\"↘\",\"sect\":\"§\",\"semi\":\";\",\"seswar\":\"⤩\",\"setminus\":\"∖\",\"setmn\":\"∖\",\"sext\":\"✶\",\"Sfr\":\"𝔖\",\"sfr\":\"𝔰\",\"sfrown\":\"⌢\",\"sharp\":\"♯\",\"SHCHcy\":\"Щ\",\"shchcy\":\"щ\",\"SHcy\":\"Ш\",\"shcy\":\"ш\",\"ShortDownArrow\":\"↓\",\"ShortLeftArrow\":\"←\",\"shortmid\":\"∣\",\"shortparallel\":\"∥\",\"ShortRightArrow\":\"→\",\"ShortUpArrow\":\"↑\",\"shy\":\"\",\"Sigma\":\"Σ\",\"sigma\":\"σ\",\"sigmaf\":\"ς\",\"sigmav\":\"ς\",\"sim\":\"∼\",\"simdot\":\"⩪\",\"sime\":\"≃\",\"simeq\":\"≃\",\"simg\":\"⪞\",\"simgE\":\"⪠\",\"siml\":\"⪝\",\"simlE\":\"⪟\",\"simne\":\"≆\",\"simplus\":\"⨤\",\"simrarr\":\"⥲\",\"slarr\":\"←\",\"SmallCircle\":\"∘\",\"smallsetminus\":\"∖\",\"smashp\":\"⨳\",\"smeparsl\":\"⧤\",\"smid\":\"∣\",\"smile\":\"⌣\",\"smt\":\"⪪\",\"smte\":\"⪬\",\"smtes\":\"⪬︀\",\"SOFTcy\":\"Ь\",\"softcy\":\"ь\",\"solbar\":\"⌿\",\"solb\":\"⧄\",\"sol\":\"/\",\"Sopf\":\"𝕊\",\"sopf\":\"𝕤\",\"spades\":\"♠\",\"spadesuit\":\"♠\",\"spar\":\"∥\",\"sqcap\":\"⊓\",\"sqcaps\":\"⊓︀\",\"sqcup\":\"⊔\",\"sqcups\":\"⊔︀\",\"Sqrt\":\"√\",\"sqsub\":\"⊏\",\"sqsube\":\"⊑\",\"sqsubset\":\"⊏\",\"sqsubseteq\":\"⊑\",\"sqsup\":\"⊐\",\"sqsupe\":\"⊒\",\"sqsupset\":\"⊐\",\"sqsupseteq\":\"⊒\",\"square\":\"□\",\"Square\":\"□\",\"SquareIntersection\":\"⊓\",\"SquareSubset\":\"⊏\",\"SquareSubsetEqual\":\"⊑\",\"SquareSuperset\":\"⊐\",\"SquareSupersetEqual\":\"⊒\",\"SquareUnion\":\"⊔\",\"squarf\":\"▪\",\"squ\":\"□\",\"squf\":\"▪\",\"srarr\":\"→\",\"Sscr\":\"𝒮\",\"sscr\":\"𝓈\",\"ssetmn\":\"∖\",\"ssmile\":\"⌣\",\"sstarf\":\"⋆\",\"Star\":\"⋆\",\"star\":\"☆\",\"starf\":\"★\",\"straightepsilon\":\"ϵ\",\"straightphi\":\"ϕ\",\"strns\":\"¯\",\"sub\":\"⊂\",\"Sub\":\"⋐\",\"subdot\":\"⪽\",\"subE\":\"⫅\",\"sube\":\"⊆\",\"subedot\":\"⫃\",\"submult\":\"⫁\",\"subnE\":\"⫋\",\"subne\":\"⊊\",\"subplus\":\"⪿\",\"subrarr\":\"⥹\",\"subset\":\"⊂\",\"Subset\":\"⋐\",\"subseteq\":\"⊆\",\"subseteqq\":\"⫅\",\"SubsetEqual\":\"⊆\",\"subsetneq\":\"⊊\",\"subsetneqq\":\"⫋\",\"subsim\":\"⫇\",\"subsub\":\"⫕\",\"subsup\":\"⫓\",\"succapprox\":\"⪸\",\"succ\":\"≻\",\"succcurlyeq\":\"≽\",\"Succeeds\":\"≻\",\"SucceedsEqual\":\"⪰\",\"SucceedsSlantEqual\":\"≽\",\"SucceedsTilde\":\"≿\",\"succeq\":\"⪰\",\"succnapprox\":\"⪺\",\"succneqq\":\"⪶\",\"succnsim\":\"⋩\",\"succsim\":\"≿\",\"SuchThat\":\"∋\",\"sum\":\"∑\",\"Sum\":\"∑\",\"sung\":\"♪\",\"sup1\":\"¹\",\"sup2\":\"²\",\"sup3\":\"³\",\"sup\":\"⊃\",\"Sup\":\"⋑\",\"supdot\":\"⪾\",\"supdsub\":\"⫘\",\"supE\":\"⫆\",\"supe\":\"⊇\",\"supedot\":\"⫄\",\"Superset\":\"⊃\",\"SupersetEqual\":\"⊇\",\"suphsol\":\"⟉\",\"suphsub\":\"⫗\",\"suplarr\":\"⥻\",\"supmult\":\"⫂\",\"supnE\":\"⫌\",\"supne\":\"⊋\",\"supplus\":\"⫀\",\"supset\":\"⊃\",\"Supset\":\"⋑\",\"supseteq\":\"⊇\",\"supseteqq\":\"⫆\",\"supsetneq\":\"⊋\",\"supsetneqq\":\"⫌\",\"supsim\":\"⫈\",\"supsub\":\"⫔\",\"supsup\":\"⫖\",\"swarhk\":\"⤦\",\"swarr\":\"↙\",\"swArr\":\"⇙\",\"swarrow\":\"↙\",\"swnwar\":\"⤪\",\"szlig\":\"ß\",\"Tab\":\"\\t\",\"target\":\"⌖\",\"Tau\":\"Τ\",\"tau\":\"τ\",\"tbrk\":\"⎴\",\"Tcaron\":\"Ť\",\"tcaron\":\"ť\",\"Tcedil\":\"Ţ\",\"tcedil\":\"ţ\",\"Tcy\":\"Т\",\"tcy\":\"т\",\"tdot\":\"⃛\",\"telrec\":\"⌕\",\"Tfr\":\"𝔗\",\"tfr\":\"𝔱\",\"there4\":\"∴\",\"therefore\":\"∴\",\"Therefore\":\"∴\",\"Theta\":\"Θ\",\"theta\":\"θ\",\"thetasym\":\"ϑ\",\"thetav\":\"ϑ\",\"thickapprox\":\"≈\",\"thicksim\":\"∼\",\"ThickSpace\":\" \",\"ThinSpace\":\" \",\"thinsp\":\" \",\"thkap\":\"≈\",\"thksim\":\"∼\",\"THORN\":\"Þ\",\"thorn\":\"þ\",\"tilde\":\"˜\",\"Tilde\":\"∼\",\"TildeEqual\":\"≃\",\"TildeFullEqual\":\"≅\",\"TildeTilde\":\"≈\",\"timesbar\":\"⨱\",\"timesb\":\"⊠\",\"times\":\"×\",\"timesd\":\"⨰\",\"tint\":\"∭\",\"toea\":\"⤨\",\"topbot\":\"⌶\",\"topcir\":\"⫱\",\"top\":\"⊤\",\"Topf\":\"𝕋\",\"topf\":\"𝕥\",\"topfork\":\"⫚\",\"tosa\":\"⤩\",\"tprime\":\"‴\",\"trade\":\"™\",\"TRADE\":\"™\",\"triangle\":\"▵\",\"triangledown\":\"▿\",\"triangleleft\":\"◃\",\"trianglelefteq\":\"⊴\",\"triangleq\":\"≜\",\"triangleright\":\"▹\",\"trianglerighteq\":\"⊵\",\"tridot\":\"◬\",\"trie\":\"≜\",\"triminus\":\"⨺\",\"TripleDot\":\"⃛\",\"triplus\":\"⨹\",\"trisb\":\"⧍\",\"tritime\":\"⨻\",\"trpezium\":\"⏢\",\"Tscr\":\"𝒯\",\"tscr\":\"𝓉\",\"TScy\":\"Ц\",\"tscy\":\"ц\",\"TSHcy\":\"Ћ\",\"tshcy\":\"ћ\",\"Tstrok\":\"Ŧ\",\"tstrok\":\"ŧ\",\"twixt\":\"≬\",\"twoheadleftarrow\":\"↞\",\"twoheadrightarrow\":\"↠\",\"Uacute\":\"Ú\",\"uacute\":\"ú\",\"uarr\":\"↑\",\"Uarr\":\"↟\",\"uArr\":\"⇑\",\"Uarrocir\":\"⥉\",\"Ubrcy\":\"Ў\",\"ubrcy\":\"ў\",\"Ubreve\":\"Ŭ\",\"ubreve\":\"ŭ\",\"Ucirc\":\"Û\",\"ucirc\":\"û\",\"Ucy\":\"У\",\"ucy\":\"у\",\"udarr\":\"⇅\",\"Udblac\":\"Ű\",\"udblac\":\"ű\",\"udhar\":\"⥮\",\"ufisht\":\"⥾\",\"Ufr\":\"𝔘\",\"ufr\":\"𝔲\",\"Ugrave\":\"Ù\",\"ugrave\":\"ù\",\"uHar\":\"⥣\",\"uharl\":\"↿\",\"uharr\":\"↾\",\"uhblk\":\"▀\",\"ulcorn\":\"⌜\",\"ulcorner\":\"⌜\",\"ulcrop\":\"⌏\",\"ultri\":\"◸\",\"Umacr\":\"Ū\",\"umacr\":\"ū\",\"uml\":\"¨\",\"UnderBar\":\"_\",\"UnderBrace\":\"⏟\",\"UnderBracket\":\"⎵\",\"UnderParenthesis\":\"⏝\",\"Union\":\"⋃\",\"UnionPlus\":\"⊎\",\"Uogon\":\"Ų\",\"uogon\":\"ų\",\"Uopf\":\"𝕌\",\"uopf\":\"𝕦\",\"UpArrowBar\":\"⤒\",\"uparrow\":\"↑\",\"UpArrow\":\"↑\",\"Uparrow\":\"⇑\",\"UpArrowDownArrow\":\"⇅\",\"updownarrow\":\"↕\",\"UpDownArrow\":\"↕\",\"Updownarrow\":\"⇕\",\"UpEquilibrium\":\"⥮\",\"upharpoonleft\":\"↿\",\"upharpoonright\":\"↾\",\"uplus\":\"⊎\",\"UpperLeftArrow\":\"↖\",\"UpperRightArrow\":\"↗\",\"upsi\":\"υ\",\"Upsi\":\"ϒ\",\"upsih\":\"ϒ\",\"Upsilon\":\"Υ\",\"upsilon\":\"υ\",\"UpTeeArrow\":\"↥\",\"UpTee\":\"⊥\",\"upuparrows\":\"⇈\",\"urcorn\":\"⌝\",\"urcorner\":\"⌝\",\"urcrop\":\"⌎\",\"Uring\":\"Ů\",\"uring\":\"ů\",\"urtri\":\"◹\",\"Uscr\":\"𝒰\",\"uscr\":\"𝓊\",\"utdot\":\"⋰\",\"Utilde\":\"Ũ\",\"utilde\":\"ũ\",\"utri\":\"▵\",\"utrif\":\"▴\",\"uuarr\":\"⇈\",\"Uuml\":\"Ü\",\"uuml\":\"ü\",\"uwangle\":\"⦧\",\"vangrt\":\"⦜\",\"varepsilon\":\"ϵ\",\"varkappa\":\"ϰ\",\"varnothing\":\"∅\",\"varphi\":\"ϕ\",\"varpi\":\"ϖ\",\"varpropto\":\"∝\",\"varr\":\"↕\",\"vArr\":\"⇕\",\"varrho\":\"ϱ\",\"varsigma\":\"ς\",\"varsubsetneq\":\"⊊︀\",\"varsubsetneqq\":\"⫋︀\",\"varsupsetneq\":\"⊋︀\",\"varsupsetneqq\":\"⫌︀\",\"vartheta\":\"ϑ\",\"vartriangleleft\":\"⊲\",\"vartriangleright\":\"⊳\",\"vBar\":\"⫨\",\"Vbar\":\"⫫\",\"vBarv\":\"⫩\",\"Vcy\":\"В\",\"vcy\":\"в\",\"vdash\":\"⊢\",\"vDash\":\"⊨\",\"Vdash\":\"⊩\",\"VDash\":\"⊫\",\"Vdashl\":\"⫦\",\"veebar\":\"⊻\",\"vee\":\"∨\",\"Vee\":\"⋁\",\"veeeq\":\"≚\",\"vellip\":\"⋮\",\"verbar\":\"|\",\"Verbar\":\"‖\",\"vert\":\"|\",\"Vert\":\"‖\",\"VerticalBar\":\"∣\",\"VerticalLine\":\"|\",\"VerticalSeparator\":\"❘\",\"VerticalTilde\":\"≀\",\"VeryThinSpace\":\" \",\"Vfr\":\"𝔙\",\"vfr\":\"𝔳\",\"vltri\":\"⊲\",\"vnsub\":\"⊂⃒\",\"vnsup\":\"⊃⃒\",\"Vopf\":\"𝕍\",\"vopf\":\"𝕧\",\"vprop\":\"∝\",\"vrtri\":\"⊳\",\"Vscr\":\"𝒱\",\"vscr\":\"𝓋\",\"vsubnE\":\"⫋︀\",\"vsubne\":\"⊊︀\",\"vsupnE\":\"⫌︀\",\"vsupne\":\"⊋︀\",\"Vvdash\":\"⊪\",\"vzigzag\":\"⦚\",\"Wcirc\":\"Ŵ\",\"wcirc\":\"ŵ\",\"wedbar\":\"⩟\",\"wedge\":\"∧\",\"Wedge\":\"⋀\",\"wedgeq\":\"≙\",\"weierp\":\"℘\",\"Wfr\":\"𝔚\",\"wfr\":\"𝔴\",\"Wopf\":\"𝕎\",\"wopf\":\"𝕨\",\"wp\":\"℘\",\"wr\":\"≀\",\"wreath\":\"≀\",\"Wscr\":\"𝒲\",\"wscr\":\"𝓌\",\"xcap\":\"⋂\",\"xcirc\":\"◯\",\"xcup\":\"⋃\",\"xdtri\":\"▽\",\"Xfr\":\"𝔛\",\"xfr\":\"𝔵\",\"xharr\":\"⟷\",\"xhArr\":\"⟺\",\"Xi\":\"Ξ\",\"xi\":\"ξ\",\"xlarr\":\"⟵\",\"xlArr\":\"⟸\",\"xmap\":\"⟼\",\"xnis\":\"⋻\",\"xodot\":\"⨀\",\"Xopf\":\"𝕏\",\"xopf\":\"𝕩\",\"xoplus\":\"⨁\",\"xotime\":\"⨂\",\"xrarr\":\"⟶\",\"xrArr\":\"⟹\",\"Xscr\":\"𝒳\",\"xscr\":\"𝓍\",\"xsqcup\":\"⨆\",\"xuplus\":\"⨄\",\"xutri\":\"△\",\"xvee\":\"⋁\",\"xwedge\":\"⋀\",\"Yacute\":\"Ý\",\"yacute\":\"ý\",\"YAcy\":\"Я\",\"yacy\":\"я\",\"Ycirc\":\"Ŷ\",\"ycirc\":\"ŷ\",\"Ycy\":\"Ы\",\"ycy\":\"ы\",\"yen\":\"¥\",\"Yfr\":\"𝔜\",\"yfr\":\"𝔶\",\"YIcy\":\"Ї\",\"yicy\":\"ї\",\"Yopf\":\"𝕐\",\"yopf\":\"𝕪\",\"Yscr\":\"𝒴\",\"yscr\":\"𝓎\",\"YUcy\":\"Ю\",\"yucy\":\"ю\",\"yuml\":\"ÿ\",\"Yuml\":\"Ÿ\",\"Zacute\":\"Ź\",\"zacute\":\"ź\",\"Zcaron\":\"Ž\",\"zcaron\":\"ž\",\"Zcy\":\"З\",\"zcy\":\"з\",\"Zdot\":\"Ż\",\"zdot\":\"ż\",\"zeetrf\":\"ℨ\",\"ZeroWidthSpace\":\"\",\"Zeta\":\"Ζ\",\"zeta\":\"ζ\",\"zfr\":\"𝔷\",\"Zfr\":\"ℨ\",\"ZHcy\":\"Ж\",\"zhcy\":\"ж\",\"zigrarr\":\"⇝\",\"zopf\":\"𝕫\",\"Zopf\":\"ℤ\",\"Zscr\":\"𝒵\",\"zscr\":\"𝓏\",\"zwj\":\"\",\"zwnj\":\"\"}"); /***/ }), /* 304 */ /***/ (function(module) { module.exports = JSON.parse("{\"Aacute\":\"Á\",\"aacute\":\"á\",\"Acirc\":\"Â\",\"acirc\":\"â\",\"acute\":\"´\",\"AElig\":\"Æ\",\"aelig\":\"æ\",\"Agrave\":\"À\",\"agrave\":\"à\",\"amp\":\"&\",\"AMP\":\"&\",\"Aring\":\"Å\",\"aring\":\"å\",\"Atilde\":\"Ã\",\"atilde\":\"ã\",\"Auml\":\"Ä\",\"auml\":\"ä\",\"brvbar\":\"¦\",\"Ccedil\":\"Ç\",\"ccedil\":\"ç\",\"cedil\":\"¸\",\"cent\":\"¢\",\"copy\":\"©\",\"COPY\":\"©\",\"curren\":\"¤\",\"deg\":\"°\",\"divide\":\"÷\",\"Eacute\":\"É\",\"eacute\":\"é\",\"Ecirc\":\"Ê\",\"ecirc\":\"ê\",\"Egrave\":\"È\",\"egrave\":\"è\",\"ETH\":\"Ð\",\"eth\":\"ð\",\"Euml\":\"Ë\",\"euml\":\"ë\",\"frac12\":\"½\",\"frac14\":\"¼\",\"frac34\":\"¾\",\"gt\":\">\",\"GT\":\">\",\"Iacute\":\"Í\",\"iacute\":\"í\",\"Icirc\":\"Î\",\"icirc\":\"î\",\"iexcl\":\"¡\",\"Igrave\":\"Ì\",\"igrave\":\"ì\",\"iquest\":\"¿\",\"Iuml\":\"Ï\",\"iuml\":\"ï\",\"laquo\":\"«\",\"lt\":\"<\",\"LT\":\"<\",\"macr\":\"¯\",\"micro\":\"µ\",\"middot\":\"·\",\"nbsp\":\" \",\"not\":\"¬\",\"Ntilde\":\"Ñ\",\"ntilde\":\"ñ\",\"Oacute\":\"Ó\",\"oacute\":\"ó\",\"Ocirc\":\"Ô\",\"ocirc\":\"ô\",\"Ograve\":\"Ò\",\"ograve\":\"ò\",\"ordf\":\"ª\",\"ordm\":\"º\",\"Oslash\":\"Ø\",\"oslash\":\"ø\",\"Otilde\":\"Õ\",\"otilde\":\"õ\",\"Ouml\":\"Ö\",\"ouml\":\"ö\",\"para\":\"¶\",\"plusmn\":\"±\",\"pound\":\"£\",\"quot\":\"\\\"\",\"QUOT\":\"\\\"\",\"raquo\":\"»\",\"reg\":\"®\",\"REG\":\"®\",\"sect\":\"§\",\"shy\":\"\",\"sup1\":\"¹\",\"sup2\":\"²\",\"sup3\":\"³\",\"szlig\":\"ß\",\"THORN\":\"Þ\",\"thorn\":\"þ\",\"times\":\"×\",\"Uacute\":\"Ú\",\"uacute\":\"ú\",\"Ucirc\":\"Û\",\"ucirc\":\"û\",\"Ugrave\":\"Ù\",\"ugrave\":\"ù\",\"uml\":\"¨\",\"Uuml\":\"Ü\",\"uuml\":\"ü\",\"Yacute\":\"Ý\",\"yacute\":\"ý\",\"yen\":\"¥\",\"yuml\":\"ÿ\"}"); /***/ }), /* 305 */ /***/ (function(module) { module.exports = JSON.parse("{\"amp\":\"&\",\"apos\":\"'\",\"gt\":\">\",\"lt\":\"<\",\"quot\":\"\\\"\"}"); /***/ }), /* 306 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var decode_json_1 = __importDefault(__webpack_require__(307)); // modified version of https://github.com/mathiasbynens/he/blob/master/src/he.js#L94-L119 function decodeCodePoint(codePoint) { if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) { return "\uFFFD"; } if (codePoint in decode_json_1.default) { // @ts-ignore codePoint = decode_json_1.default[codePoint]; } var output = ""; if (codePoint > 0xffff) { codePoint -= 0x10000; output += String.fromCharCode(((codePoint >>> 10) & 0x3ff) | 0xd800); codePoint = 0xdc00 | (codePoint & 0x3ff); } output += String.fromCharCode(codePoint); return output; } exports.default = decodeCodePoint; /***/ }), /* 307 */ /***/ (function(module) { module.exports = JSON.parse("{\"0\":65533,\"128\":8364,\"130\":8218,\"131\":402,\"132\":8222,\"133\":8230,\"134\":8224,\"135\":8225,\"136\":710,\"137\":8240,\"138\":352,\"139\":8249,\"140\":338,\"142\":381,\"145\":8216,\"146\":8217,\"147\":8220,\"148\":8221,\"149\":8226,\"150\":8211,\"151\":8212,\"152\":732,\"153\":8482,\"154\":353,\"155\":8250,\"156\":339,\"158\":382,\"159\":376}"); /***/ }), /* 308 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var xml_json_1 = __importDefault(__webpack_require__(305)); var inverseXML = getInverseObj(xml_json_1.default); var xmlReplacer = getInverseReplacer(inverseXML); exports.encodeXML = getInverse(inverseXML, xmlReplacer); var entities_json_1 = __importDefault(__webpack_require__(303)); var inverseHTML = getInverseObj(entities_json_1.default); var htmlReplacer = getInverseReplacer(inverseHTML); exports.encodeHTML = getInverse(inverseHTML, htmlReplacer); function getInverseObj(obj) { return Object.keys(obj) .sort() .reduce(function (inverse, name) { inverse[obj[name]] = "&" + name + ";"; return inverse; }, {}); } function getInverseReplacer(inverse) { var single = []; var multiple = []; Object.keys(inverse).forEach(function (k) { return k.length === 1 ? // Add value to single array single.push("\\" + k) : // Add value to multiple array multiple.push(k); }); //TODO add ranges multiple.unshift("[" + single.join("") + "]"); return new RegExp(multiple.join("|"), "g"); } var reNonASCII = /[^\0-\x7F]/g; var reAstralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; function singleCharReplacer(c) { return "&#x" + c .charCodeAt(0) .toString(16) .toUpperCase() + ";"; } // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any function astralReplacer(c, _) { // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae var high = c.charCodeAt(0); var low = c.charCodeAt(1); var codePoint = (high - 0xd800) * 0x400 + low - 0xdc00 + 0x10000; return "&#x" + codePoint.toString(16).toUpperCase() + ";"; } function getInverse(inverse, re) { return function (data) { return data .replace(re, function (name) { return inverse[name]; }) .replace(reAstralSymbols, astralReplacer) .replace(reNonASCII, singleCharReplacer); }; } var reXmlChars = getInverseReplacer(inverseXML); function escape(data) { return data .replace(reXmlChars, singleCharReplacer) .replace(reAstralSymbols, astralReplacer) .replace(reNonASCII, singleCharReplacer); } exports.escape = escape; /***/ }), /* 309 */ /***/ (function(module) { module.exports = JSON.parse("{\"elementNames\":{\"altglyph\":\"altGlyph\",\"altglyphdef\":\"altGlyphDef\",\"altglyphitem\":\"altGlyphItem\",\"animatecolor\":\"animateColor\",\"animatemotion\":\"animateMotion\",\"animatetransform\":\"animateTransform\",\"clippath\":\"clipPath\",\"feblend\":\"feBlend\",\"fecolormatrix\":\"feColorMatrix\",\"fecomponenttransfer\":\"feComponentTransfer\",\"fecomposite\":\"feComposite\",\"feconvolvematrix\":\"feConvolveMatrix\",\"fediffuselighting\":\"feDiffuseLighting\",\"fedisplacementmap\":\"feDisplacementMap\",\"fedistantlight\":\"feDistantLight\",\"fedropshadow\":\"feDropShadow\",\"feflood\":\"feFlood\",\"fefunca\":\"feFuncA\",\"fefuncb\":\"feFuncB\",\"fefuncg\":\"feFuncG\",\"fefuncr\":\"feFuncR\",\"fegaussianblur\":\"feGaussianBlur\",\"feimage\":\"feImage\",\"femerge\":\"feMerge\",\"femergenode\":\"feMergeNode\",\"femorphology\":\"feMorphology\",\"feoffset\":\"feOffset\",\"fepointlight\":\"fePointLight\",\"fespecularlighting\":\"feSpecularLighting\",\"fespotlight\":\"feSpotLight\",\"fetile\":\"feTile\",\"feturbulence\":\"feTurbulence\",\"foreignobject\":\"foreignObject\",\"glyphref\":\"glyphRef\",\"lineargradient\":\"linearGradient\",\"radialgradient\":\"radialGradient\",\"textpath\":\"textPath\"},\"attributeNames\":{\"definitionurl\":\"definitionURL\",\"attributename\":\"attributeName\",\"attributetype\":\"attributeType\",\"basefrequency\":\"baseFrequency\",\"baseprofile\":\"baseProfile\",\"calcmode\":\"calcMode\",\"clippathunits\":\"clipPathUnits\",\"diffuseconstant\":\"diffuseConstant\",\"edgemode\":\"edgeMode\",\"filterunits\":\"filterUnits\",\"glyphref\":\"glyphRef\",\"gradienttransform\":\"gradientTransform\",\"gradientunits\":\"gradientUnits\",\"kernelmatrix\":\"kernelMatrix\",\"kernelunitlength\":\"kernelUnitLength\",\"keypoints\":\"keyPoints\",\"keysplines\":\"keySplines\",\"keytimes\":\"keyTimes\",\"lengthadjust\":\"lengthAdjust\",\"limitingconeangle\":\"limitingConeAngle\",\"markerheight\":\"markerHeight\",\"markerunits\":\"markerUnits\",\"markerwidth\":\"markerWidth\",\"maskcontentunits\":\"maskContentUnits\",\"maskunits\":\"maskUnits\",\"numoctaves\":\"numOctaves\",\"pathlength\":\"pathLength\",\"patterncontentunits\":\"patternContentUnits\",\"patterntransform\":\"patternTransform\",\"patternunits\":\"patternUnits\",\"pointsatx\":\"pointsAtX\",\"pointsaty\":\"pointsAtY\",\"pointsatz\":\"pointsAtZ\",\"preservealpha\":\"preserveAlpha\",\"preserveaspectratio\":\"preserveAspectRatio\",\"primitiveunits\":\"primitiveUnits\",\"refx\":\"refX\",\"refy\":\"refY\",\"repeatcount\":\"repeatCount\",\"repeatdur\":\"repeatDur\",\"requiredextensions\":\"requiredExtensions\",\"requiredfeatures\":\"requiredFeatures\",\"specularconstant\":\"specularConstant\",\"specularexponent\":\"specularExponent\",\"spreadmethod\":\"spreadMethod\",\"startoffset\":\"startOffset\",\"stddeviation\":\"stdDeviation\",\"stitchtiles\":\"stitchTiles\",\"surfacescale\":\"surfaceScale\",\"systemlanguage\":\"systemLanguage\",\"tablevalues\":\"tableValues\",\"targetx\":\"targetX\",\"targety\":\"targetY\",\"textlength\":\"textLength\",\"viewbox\":\"viewBox\",\"viewtarget\":\"viewTarget\",\"xchannelselector\":\"xChannelSelector\",\"ychannelselector\":\"yChannelSelector\",\"zoomandpan\":\"zoomAndPan\"}}"); /***/ }), /* 310 */ /***/ (function(module, exports) { var getChildren = exports.getChildren = function(elem){ return elem.children; }; var getParent = exports.getParent = function(elem){ return elem.parent; }; exports.getSiblings = function(elem){ var parent = getParent(elem); return parent ? getChildren(parent) : [elem]; }; exports.getAttributeValue = function(elem, name){ return elem.attribs && elem.attribs[name]; }; exports.hasAttrib = function(elem, name){ return !!elem.attribs && hasOwnProperty.call(elem.attribs, name); }; exports.getName = function(elem){ return elem.name; }; /***/ }), /* 311 */ /***/ (function(module, exports) { exports.removeElement = function(elem){ if(elem.prev) elem.prev.next = elem.next; if(elem.next) elem.next.prev = elem.prev; if(elem.parent){ var childs = elem.parent.children; childs.splice(childs.lastIndexOf(elem), 1); } }; exports.replaceElement = function(elem, replacement){ var prev = replacement.prev = elem.prev; if(prev){ prev.next = replacement; } var next = replacement.next = elem.next; if(next){ next.prev = replacement; } var parent = replacement.parent = elem.parent; if(parent){ var childs = parent.children; childs[childs.lastIndexOf(elem)] = replacement; } }; exports.appendChild = function(elem, child){ child.parent = elem; if(elem.children.push(child) !== 1){ var sibling = elem.children[elem.children.length - 2]; sibling.next = child; child.prev = sibling; child.next = null; } }; exports.append = function(elem, next){ var parent = elem.parent, currNext = elem.next; next.next = currNext; next.prev = elem; elem.next = next; next.parent = parent; if(currNext){ currNext.prev = next; if(parent){ var childs = parent.children; childs.splice(childs.lastIndexOf(currNext), 0, next); } } else if(parent){ parent.children.push(next); } }; exports.prepend = function(elem, prev){ var parent = elem.parent; if(parent){ var childs = parent.children; childs.splice(childs.lastIndexOf(elem), 0, prev); } if(elem.prev){ elem.prev.next = prev; } prev.parent = parent; prev.prev = elem.prev; prev.next = elem; elem.prev = prev; }; /***/ }), /* 312 */ /***/ (function(module, exports, __webpack_require__) { var isTag = __webpack_require__(293).isTag; module.exports = { filter: filter, find: find, findOneChild: findOneChild, findOne: findOne, existsOne: existsOne, findAll: findAll }; function filter(test, element, recurse, limit){ if(!Array.isArray(element)) element = [element]; if(typeof limit !== "number" || !isFinite(limit)){ limit = Infinity; } return find(test, element, recurse !== false, limit); } function find(test, elems, recurse, limit){ var result = [], childs; for(var i = 0, j = elems.length; i < j; i++){ if(test(elems[i])){ result.push(elems[i]); if(--limit <= 0) break; } childs = elems[i].children; if(recurse && childs && childs.length > 0){ childs = find(test, childs, recurse, limit); result = result.concat(childs); limit -= childs.length; if(limit <= 0) break; } } return result; } function findOneChild(test, elems){ for(var i = 0, l = elems.length; i < l; i++){ if(test(elems[i])) return elems[i]; } return null; } function findOne(test, elems){ var elem = null; for(var i = 0, l = elems.length; i < l && !elem; i++){ if(!isTag(elems[i])){ continue; } else if(test(elems[i])){ elem = elems[i]; } else if(elems[i].children.length > 0){ elem = findOne(test, elems[i].children); } } return elem; } function existsOne(test, elems){ for(var i = 0, l = elems.length; i < l; i++){ if( isTag(elems[i]) && ( test(elems[i]) || ( elems[i].children.length > 0 && existsOne(test, elems[i].children) ) ) ){ return true; } } return false; } function findAll(test, rootElems){ var result = []; var stack = rootElems.slice(); while(stack.length){ var elem = stack.shift(); if(!isTag(elem)) continue; if (elem.children && elem.children.length > 0) { stack.unshift.apply(stack, elem.children); } if(test(elem)) result.push(elem); } return result; } /***/ }), /* 313 */ /***/ (function(module, exports, __webpack_require__) { var ElementType = __webpack_require__(293); var isTag = exports.isTag = ElementType.isTag; exports.testElement = function(options, element){ for(var key in options){ if(!options.hasOwnProperty(key)); else if(key === "tag_name"){ if(!isTag(element) || !options.tag_name(element.name)){ return false; } } else if(key === "tag_type"){ if(!options.tag_type(element.type)) return false; } else if(key === "tag_contains"){ if(isTag(element) || !options.tag_contains(element.data)){ return false; } } else if(!element.attribs || !options[key](element.attribs[key])){ return false; } } return true; }; var Checks = { tag_name: function(name){ if(typeof name === "function"){ return function(elem){ return isTag(elem) && name(elem.name); }; } else if(name === "*"){ return isTag; } else { return function(elem){ return isTag(elem) && elem.name === name; }; } }, tag_type: function(type){ if(typeof type === "function"){ return function(elem){ return type(elem.type); }; } else { return function(elem){ return elem.type === type; }; } }, tag_contains: function(data){ if(typeof data === "function"){ return function(elem){ return !isTag(elem) && data(elem.data); }; } else { return function(elem){ return !isTag(elem) && elem.data === data; }; } } }; function getAttribCheck(attrib, value){ if(typeof value === "function"){ return function(elem){ return elem.attribs && value(elem.attribs[attrib]); }; } else { return function(elem){ return elem.attribs && elem.attribs[attrib] === value; }; } } function combineFuncs(a, b){ return function(elem){ return a(elem) || b(elem); }; } exports.getElements = function(options, element, recurse, limit){ var funcs = Object.keys(options).map(function(key){ var value = options[key]; return key in Checks ? Checks[key](value) : getAttribCheck(key, value); }); return funcs.length === 0 ? [] : this.filter( funcs.reduce(combineFuncs), element, recurse, limit ); }; exports.getElementById = function(id, element, recurse){ if(!Array.isArray(element)) element = [element]; return this.findOne(getAttribCheck("id", id), element, recurse !== false); }; exports.getElementsByTagName = function(name, element, recurse, limit){ return this.filter(Checks.tag_name(name), element, recurse, limit); }; exports.getElementsByTagType = function(type, element, recurse, limit){ return this.filter(Checks.tag_type(type), element, recurse, limit); }; /***/ }), /* 314 */ /***/ (function(module, exports) { // removeSubsets // Given an array of nodes, remove any member that is contained by another. exports.removeSubsets = function(nodes) { var idx = nodes.length, node, ancestor, replace; // Check if each node (or one of its ancestors) is already contained in the // array. while (--idx > -1) { node = ancestor = nodes[idx]; // Temporarily remove the node under consideration nodes[idx] = null; replace = true; while (ancestor) { if (nodes.indexOf(ancestor) > -1) { replace = false; nodes.splice(idx, 1); break; } ancestor = ancestor.parent; } // If the node has been found to be unique, re-insert it. if (replace) { nodes[idx] = node; } } return nodes; }; // Source: http://dom.spec.whatwg.org/#dom-node-comparedocumentposition var POSITION = { DISCONNECTED: 1, PRECEDING: 2, FOLLOWING: 4, CONTAINS: 8, CONTAINED_BY: 16 }; // Compare the position of one node against another node in any other document. // The return value is a bitmask with the following values: // // document order: // > There is an ordering, document order, defined on all the nodes in the // > document corresponding to the order in which the first character of the // > XML representation of each node occurs in the XML representation of the // > document after expansion of general entities. Thus, the document element // > node will be the first node. Element nodes occur before their children. // > Thus, document order orders element nodes in order of the occurrence of // > their start-tag in the XML (after expansion of entities). The attribute // > nodes of an element occur after the element and before its children. The // > relative order of attribute nodes is implementation-dependent./ // Source: // http://www.w3.org/TR/DOM-Level-3-Core/glossary.html#dt-document-order // // @argument {Node} nodaA The first node to use in the comparison // @argument {Node} nodeB The second node to use in the comparison // // @return {Number} A bitmask describing the input nodes' relative position. // See http://dom.spec.whatwg.org/#dom-node-comparedocumentposition for // a description of these values. var comparePos = exports.compareDocumentPosition = function(nodeA, nodeB) { var aParents = []; var bParents = []; var current, sharedParent, siblings, aSibling, bSibling, idx; if (nodeA === nodeB) { return 0; } current = nodeA; while (current) { aParents.unshift(current); current = current.parent; } current = nodeB; while (current) { bParents.unshift(current); current = current.parent; } idx = 0; while (aParents[idx] === bParents[idx]) { idx++; } if (idx === 0) { return POSITION.DISCONNECTED; } sharedParent = aParents[idx - 1]; siblings = sharedParent.children; aSibling = aParents[idx]; bSibling = bParents[idx]; if (siblings.indexOf(aSibling) > siblings.indexOf(bSibling)) { if (sharedParent === nodeB) { return POSITION.FOLLOWING | POSITION.CONTAINED_BY; } return POSITION.FOLLOWING; } else { if (sharedParent === nodeA) { return POSITION.PRECEDING | POSITION.CONTAINS; } return POSITION.PRECEDING; } }; // Sort an array of nodes based on their relative position in the document and // remove any duplicate nodes. If the array contains nodes that do not belong // to the same document, sort order is unspecified. // // @argument {Array} nodes Array of DOM nodes // // @returns {Array} collection of unique nodes, sorted in document order exports.uniqueSort = function(nodes) { var idx = nodes.length, node, position; nodes = nodes.slice(); while (--idx > -1) { node = nodes[idx]; position = nodes.indexOf(node); if (position > -1 && position < idx) { nodes.splice(idx, 1); } } nodes.sort(function(a, b) { var relative = comparePos(a, b); if (relative & POSITION.PRECEDING) { return -1; } else if (relative & POSITION.FOLLOWING) { return 1; } return 0; }); return nodes; }; /***/ }), /* 315 */ /***/ (function(module, exports, __webpack_require__) { module.exports = Stream; var Parser = __webpack_require__(316); function Stream(options) { Parser.call(this, new Cbs(this), options); } __webpack_require__(290)(Stream, Parser); Stream.prototype.readable = true; function Cbs(scope) { this.scope = scope; } var EVENTS = __webpack_require__(282).EVENTS; Object.keys(EVENTS).forEach(function(name) { if (EVENTS[name] === 0) { Cbs.prototype["on" + name] = function() { this.scope.emit(name); }; } else if (EVENTS[name] === 1) { Cbs.prototype["on" + name] = function(a) { this.scope.emit(name, a); }; } else if (EVENTS[name] === 2) { Cbs.prototype["on" + name] = function(a, b) { this.scope.emit(name, a, b); }; } else { throw Error("wrong number of arguments!"); } }); /***/ }), /* 316 */ /***/ (function(module, exports, __webpack_require__) { module.exports = Stream; var Parser = __webpack_require__(283); var WritableStream = __webpack_require__(317).Writable; var StringDecoder = __webpack_require__(334).StringDecoder; var Buffer = __webpack_require__(96).Buffer; function Stream(cbs, options) { var parser = (this._parser = new Parser(cbs, options)); var decoder = (this._decoder = new StringDecoder()); WritableStream.call(this, { decodeStrings: false }); this.once("finish", function() { parser.end(decoder.end()); }); } __webpack_require__(290)(Stream, WritableStream); Stream.prototype._write = function(chunk, encoding, cb) { if (chunk instanceof Buffer) chunk = this._decoder.write(chunk); this._parser.write(chunk); cb(); }; /***/ }), /* 317 */ /***/ (function(module, exports, __webpack_require__) { var Stream = __webpack_require__(100); if (process.env.READABLE_STREAM === 'disable' && Stream) { module.exports = Stream.Readable; Object.assign(module.exports, Stream); module.exports.Stream = Stream; } else { exports = module.exports = __webpack_require__(318); exports.Stream = Stream || exports; exports.Readable = exports; exports.Writable = __webpack_require__(326); exports.Duplex = __webpack_require__(325); exports.Transform = __webpack_require__(331); exports.PassThrough = __webpack_require__(332); exports.finished = __webpack_require__(330); exports.pipeline = __webpack_require__(333); } /***/ }), /* 318 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. module.exports = Readable; /*<replacement>*/ var Duplex; /*</replacement>*/ Readable.ReadableState = ReadableState; /*<replacement>*/ var EE = __webpack_require__(268).EventEmitter; var EElistenerCount = function EElistenerCount(emitter, type) { return emitter.listeners(type).length; }; /*</replacement>*/ /*<replacement>*/ var Stream = __webpack_require__(319); /*</replacement>*/ var Buffer = __webpack_require__(96).Buffer; var OurUint8Array = global.Uint8Array || function () {}; function _uint8ArrayToBuffer(chunk) { return Buffer.from(chunk); } function _isUint8Array(obj) { return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; } /*<replacement>*/ var debugUtil = __webpack_require__(9); var debug; if (debugUtil && debugUtil.debuglog) { debug = debugUtil.debuglog('stream'); } else { debug = function debug() {}; } /*</replacement>*/ var BufferList = __webpack_require__(320); var destroyImpl = __webpack_require__(321); var _require = __webpack_require__(322), getHighWaterMark = _require.getHighWaterMark; var _require$codes = __webpack_require__(323).codes, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; var _require2 = __webpack_require__(324), emitExperimentalWarning = _require2.emitExperimentalWarning; // Lazy loaded to improve the startup performance. var StringDecoder; var createReadableStreamAsyncIterator; __webpack_require__(290)(Readable, Stream); var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; function prependListener(emitter, event, fn) { // Sadly this is not cacheable as some libraries bundle their own // event emitter implementation with them. if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); // This is a hack to make sure that our error handler is attached before any // userland ones. NEVER DO THIS. This is here only because this code needs // to continue to work with older versions of Node.js that do not include // the prependListener() method. The goal is to eventually remove this hack. if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; } function ReadableState(options, stream, isDuplex) { Duplex = Duplex || __webpack_require__(325); options = options || {}; // Duplex streams are both readable and writable, but share // the same options object. // However, some cases require setting options to different // values for the readable and the writable sides of the duplex stream. // These options can be provided separately as readableXXX and writableXXX. if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag. Used to make read(n) ignore n and to // make all the buffer merging and length checks go away this.objectMode = !!options.objectMode; if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer // Note: 0 is a valid value, means "don't call _read preemptively ever" this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); // A linked list is used to store data chunks instead of an array because the // linked list can remove elements from the beginning faster than // array.shift() this.buffer = new BufferList(); this.length = 0; this.pipes = null; this.pipesCount = 0; this.flowing = null; this.ended = false; this.endEmitted = false; this.reading = false; // a flag to be able to tell if the event 'readable'/'data' is emitted // immediately, or on a later tick. We set this to true at first, because // any actions that shouldn't happen until "later" should generally also // not happen before the first read call. this.sync = true; // whenever we return null, then we set a flag to say // that we're awaiting a 'readable' event emission. this.needReadable = false; this.emittedReadable = false; this.readableListening = false; this.resumeScheduled = false; this.paused = true; // Should close be emitted on destroy. Defaults to true. this.emitClose = options.emitClose !== false; // has it been destroyed this.destroyed = false; // Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. // Everything else in the universe uses 'utf8', though. this.defaultEncoding = options.defaultEncoding || 'utf8'; // the number of writers that are awaiting a drain event in .pipe()s this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled this.readingMore = false; this.decoder = null; this.encoding = null; if (options.encoding) { if (!StringDecoder) StringDecoder = __webpack_require__(328).StringDecoder; this.decoder = new StringDecoder(options.encoding); this.encoding = options.encoding; } } function Readable(options) { Duplex = Duplex || __webpack_require__(325); if (!(this instanceof Readable)) return new Readable(options); // Checking for a Stream.Duplex instance is faster here instead of inside // the ReadableState constructor, at least with V8 6.5 var isDuplex = this instanceof Duplex; this._readableState = new ReadableState(options, this, isDuplex); // legacy this.readable = true; if (options) { if (typeof options.read === 'function') this._read = options.read; if (typeof options.destroy === 'function') this._destroy = options.destroy; } Stream.call(this); } Object.defineProperty(Readable.prototype, 'destroyed', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { if (this._readableState === undefined) { return false; } return this._readableState.destroyed; }, set: function set(value) { // we ignore the value if the stream // has not been initialized yet if (!this._readableState) { return; } // backward compatibility, the user is explicitly // managing destroyed this._readableState.destroyed = value; } }); Readable.prototype.destroy = destroyImpl.destroy; Readable.prototype._undestroy = destroyImpl.undestroy; Readable.prototype._destroy = function (err, cb) { cb(err); }; // Manually shove something into the read() buffer. // This returns true if the highWaterMark has not been hit yet, // similar to how Writable.write() returns true if you should // write() some more. Readable.prototype.push = function (chunk, encoding) { var state = this._readableState; var skipChunkCheck; if (!state.objectMode) { if (typeof chunk === 'string') { encoding = encoding || state.defaultEncoding; if (encoding !== state.encoding) { chunk = Buffer.from(chunk, encoding); encoding = ''; } skipChunkCheck = true; } } else { skipChunkCheck = true; } return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); }; // Unshift should *always* be something directly out of read() Readable.prototype.unshift = function (chunk) { return readableAddChunk(this, chunk, null, true, false); }; function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { debug('readableAddChunk', chunk); var state = stream._readableState; if (chunk === null) { state.reading = false; onEofChunk(stream, state); } else { var er; if (!skipChunkCheck) er = chunkInvalid(state, chunk); if (er) { stream.emit('error', er); } else if (state.objectMode || chunk && chunk.length > 0) { if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { chunk = _uint8ArrayToBuffer(chunk); } if (addToFront) { if (state.endEmitted) stream.emit('error', new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true); } else if (state.ended) { stream.emit('error', new ERR_STREAM_PUSH_AFTER_EOF()); } else if (state.destroyed) { return false; } else { state.reading = false; if (state.decoder && !encoding) { chunk = state.decoder.write(chunk); if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); } else { addChunk(stream, state, chunk, false); } } } else if (!addToFront) { state.reading = false; maybeReadMore(stream, state); } } // We can push more data if we are below the highWaterMark. // Also, if we have no data yet, we can stand some more bytes. // This is to work around cases where hwm=0, such as the repl. return !state.ended && (state.length < state.highWaterMark || state.length === 0); } function addChunk(stream, state, chunk, addToFront) { if (state.flowing && state.length === 0 && !state.sync) { state.awaitDrain = 0; stream.emit('data', chunk); } else { // update the buffer info. state.length += state.objectMode ? 1 : chunk.length; if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); if (state.needReadable) emitReadable(stream); } maybeReadMore(stream, state); } function chunkInvalid(state, chunk) { var er; if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk); } return er; } Readable.prototype.isPaused = function () { return this._readableState.flowing === false; }; // backwards compatibility. Readable.prototype.setEncoding = function (enc) { if (!StringDecoder) StringDecoder = __webpack_require__(328).StringDecoder; this._readableState.decoder = new StringDecoder(enc); // if setEncoding(null), decoder.encoding equals utf8 this._readableState.encoding = this._readableState.decoder.encoding; return this; }; // Don't raise the hwm > 8MB var MAX_HWM = 0x800000; function computeNewHighWaterMark(n) { if (n >= MAX_HWM) { n = MAX_HWM; } else { // Get the next highest power of 2 to prevent increasing hwm excessively in // tiny amounts n--; n |= n >>> 1; n |= n >>> 2; n |= n >>> 4; n |= n >>> 8; n |= n >>> 16; n++; } return n; } // This function is designed to be inlinable, so please take care when making // changes to the function body. function howMuchToRead(n, state) { if (n <= 0 || state.length === 0 && state.ended) return 0; if (state.objectMode) return 1; if (n !== n) { // Only flow one buffer at a time if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; } // If we're asking for more than the current hwm, then raise the hwm. if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); if (n <= state.length) return n; // Don't have enough if (!state.ended) { state.needReadable = true; return 0; } return state.length; } // you can override either this method, or the async _read(n) below. Readable.prototype.read = function (n) { debug('read', n); n = parseInt(n, 10); var state = this._readableState; var nOrig = n; if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we // already have a bunch of data in the buffer, then just trigger // the 'readable' event and move on. if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { debug('read: emitReadable', state.length, state.ended); if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); return null; } n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up. if (n === 0 && state.ended) { if (state.length === 0) endReadable(this); return null; } // All the actual chunk generation logic needs to be // *below* the call to _read. The reason is that in certain // synthetic stream cases, such as passthrough streams, _read // may be a completely synchronous operation which may change // the state of the read buffer, providing enough data when // before there was *not* enough. // // So, the steps are: // 1. Figure out what the state of things will be after we do // a read from the buffer. // // 2. If that resulting state will trigger a _read, then call _read. // Note that this may be asynchronous, or synchronous. Yes, it is // deeply ugly to write APIs this way, but that still doesn't mean // that the Readable class should behave improperly, as streams are // designed to be sync/async agnostic. // Take note if the _read call is sync or async (ie, if the read call // has returned yet), so that we know whether or not it's safe to emit // 'readable' etc. // // 3. Actually pull the requested chunks out of the buffer and return. // if we need a readable event, then we need to do some reading. var doRead = state.needReadable; debug('need readable', doRead); // if we currently have less than the highWaterMark, then also read some if (state.length === 0 || state.length - n < state.highWaterMark) { doRead = true; debug('length less than watermark', doRead); } // however, if we've ended, then there's no point, and if we're already // reading, then it's unnecessary. if (state.ended || state.reading) { doRead = false; debug('reading or ended', doRead); } else if (doRead) { debug('do read'); state.reading = true; state.sync = true; // if the length is currently zero, then we *need* a readable event. if (state.length === 0) state.needReadable = true; // call internal read method this._read(state.highWaterMark); state.sync = false; // If _read pushed data synchronously, then `reading` will be false, // and we need to re-evaluate how much data we can return to the user. if (!state.reading) n = howMuchToRead(nOrig, state); } var ret; if (n > 0) ret = fromList(n, state);else ret = null; if (ret === null) { state.needReadable = true; n = 0; } else { state.length -= n; state.awaitDrain = 0; } if (state.length === 0) { // If we have nothing in the buffer, then we want to know // as soon as we *do* get something into the buffer. if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick. if (nOrig !== n && state.ended) endReadable(this); } if (ret !== null) this.emit('data', ret); return ret; }; function onEofChunk(stream, state) { if (state.ended) return; if (state.decoder) { var chunk = state.decoder.end(); if (chunk && chunk.length) { state.buffer.push(chunk); state.length += state.objectMode ? 1 : chunk.length; } } state.ended = true; if (state.sync) { // if we are sync, wait until next tick to emit the data. // Otherwise we risk emitting data in the flow() // the readable code triggers during a read() call emitReadable(stream); } else { // emit 'readable' now to make sure it gets picked up. state.needReadable = false; if (!state.emittedReadable) { state.emittedReadable = true; emitReadable_(stream); } } } // Don't emit readable right away in sync mode, because this can trigger // another read() call => stack overflow. This way, it might trigger // a nextTick recursion warning, but that's not so bad. function emitReadable(stream) { var state = stream._readableState; state.needReadable = false; if (!state.emittedReadable) { debug('emitReadable', state.flowing); state.emittedReadable = true; process.nextTick(emitReadable_, stream); } } function emitReadable_(stream) { var state = stream._readableState; debug('emitReadable_', state.destroyed, state.length, state.ended); if (!state.destroyed && (state.length || state.ended)) { stream.emit('readable'); } // The stream needs another readable event if // 1. It is not flowing, as the flow mechanism will take // care of it. // 2. It is not ended. // 3. It is below the highWaterMark, so we can schedule // another readable later. state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; flow(stream); } // at this point, the user has presumably seen the 'readable' event, // and called read() to consume some data. that may have triggered // in turn another _read(n) call, in which case reading = true if // it's in progress. // However, if we're not ended, or reading, and the length < hwm, // then go ahead and try to read some more preemptively. function maybeReadMore(stream, state) { if (!state.readingMore) { state.readingMore = true; process.nextTick(maybeReadMore_, stream, state); } } function maybeReadMore_(stream, state) { // Attempt to read more data if we should. // // The conditions for reading more data are (one of): // - Not enough data buffered (state.length < state.highWaterMark). The loop // is responsible for filling the buffer with enough data if such data // is available. If highWaterMark is 0 and we are not in the flowing mode // we should _not_ attempt to buffer any extra data. We'll get more data // when the stream consumer calls read() instead. // - No data in the buffer, and the stream is in flowing mode. In this mode // the loop below is responsible for ensuring read() is called. Failing to // call read here would abort the flow and there's no other mechanism for // continuing the flow if the stream consumer has just subscribed to the // 'data' event. // // In addition to the above conditions to keep reading data, the following // conditions prevent the data from being read: // - The stream has ended (state.ended). // - There is already a pending 'read' operation (state.reading). This is a // case where the the stream has called the implementation defined _read() // method, but they are processing the call asynchronously and have _not_ // called push() with new data. In this case we skip performing more // read()s. The execution ends in this method again after the _read() ends // up calling push() with more data. while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { var len = state.length; debug('maybeReadMore read 0'); stream.read(0); if (len === state.length) // didn't get any data, stop spinning. break; } state.readingMore = false; } // abstract method. to be overridden in specific implementation classes. // call cb(er, data) where data is <= n in length. // for virtual (non-string, non-buffer) streams, "length" is somewhat // arbitrary, and perhaps not very meaningful. Readable.prototype._read = function (n) { this.emit('error', new ERR_METHOD_NOT_IMPLEMENTED('_read()')); }; Readable.prototype.pipe = function (dest, pipeOpts) { var src = this; var state = this._readableState; switch (state.pipesCount) { case 0: state.pipes = dest; break; case 1: state.pipes = [state.pipes, dest]; break; default: state.pipes.push(dest); break; } state.pipesCount += 1; debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; var endFn = doEnd ? onend : unpipe; if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn); dest.on('unpipe', onunpipe); function onunpipe(readable, unpipeInfo) { debug('onunpipe'); if (readable === src) { if (unpipeInfo && unpipeInfo.hasUnpiped === false) { unpipeInfo.hasUnpiped = true; cleanup(); } } } function onend() { debug('onend'); dest.end(); } // when the dest drains, it reduces the awaitDrain counter // on the source. This would be more elegant with a .once() // handler in flow(), but adding and removing repeatedly is // too slow. var ondrain = pipeOnDrain(src); dest.on('drain', ondrain); var cleanedUp = false; function cleanup() { debug('cleanup'); // cleanup event handlers once the pipe is broken dest.removeListener('close', onclose); dest.removeListener('finish', onfinish); dest.removeListener('drain', ondrain); dest.removeListener('error', onerror); dest.removeListener('unpipe', onunpipe); src.removeListener('end', onend); src.removeListener('end', unpipe); src.removeListener('data', ondata); cleanedUp = true; // if the reader is waiting for a drain event from this // specific writer, then it would cause it to never start // flowing again. // So, if this is awaiting a drain, then we just call it now. // If we don't know, then assume that we are waiting for one. if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); } src.on('data', ondata); function ondata(chunk) { debug('ondata'); var ret = dest.write(chunk); debug('dest.write', ret); if (ret === false) { // If the user unpiped during `dest.write()`, it is possible // to get stuck in a permanently paused state if that write // also returned false. // => Check whether `dest` is still a piping destination. if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { debug('false write response, pause', state.awaitDrain); state.awaitDrain++; } src.pause(); } } // if the dest has an error, then stop piping into it. // however, don't suppress the throwing behavior for this. function onerror(er) { debug('onerror', er); unpipe(); dest.removeListener('error', onerror); if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); } // Make sure our error handler is attached before userland ones. prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once. function onclose() { dest.removeListener('finish', onfinish); unpipe(); } dest.once('close', onclose); function onfinish() { debug('onfinish'); dest.removeListener('close', onclose); unpipe(); } dest.once('finish', onfinish); function unpipe() { debug('unpipe'); src.unpipe(dest); } // tell the dest that it's being piped to dest.emit('pipe', src); // start the flow if it hasn't been started already. if (!state.flowing) { debug('pipe resume'); src.resume(); } return dest; }; function pipeOnDrain(src) { return function pipeOnDrainFunctionResult() { var state = src._readableState; debug('pipeOnDrain', state.awaitDrain); if (state.awaitDrain) state.awaitDrain--; if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { state.flowing = true; flow(src); } }; } Readable.prototype.unpipe = function (dest) { var state = this._readableState; var unpipeInfo = { hasUnpiped: false }; // if we're not piping anywhere, then do nothing. if (state.pipesCount === 0) return this; // just one destination. most common case. if (state.pipesCount === 1) { // passed in one, but it's not the right one. if (dest && dest !== state.pipes) return this; if (!dest) dest = state.pipes; // got a match. state.pipes = null; state.pipesCount = 0; state.flowing = false; if (dest) dest.emit('unpipe', this, unpipeInfo); return this; } // slow case. multiple pipe destinations. if (!dest) { // remove all. var dests = state.pipes; var len = state.pipesCount; state.pipes = null; state.pipesCount = 0; state.flowing = false; for (var i = 0; i < len; i++) { dests[i].emit('unpipe', this, { hasUnpiped: false }); } return this; } // try to find the right one. var index = indexOf(state.pipes, dest); if (index === -1) return this; state.pipes.splice(index, 1); state.pipesCount -= 1; if (state.pipesCount === 1) state.pipes = state.pipes[0]; dest.emit('unpipe', this, unpipeInfo); return this; }; // set up data events if they are asked for // Ensure readable listeners eventually get something Readable.prototype.on = function (ev, fn) { var res = Stream.prototype.on.call(this, ev, fn); var state = this._readableState; if (ev === 'data') { // update readableListening so that resume() may be a no-op // a few lines down. This is needed to support once('readable'). state.readableListening = this.listenerCount('readable') > 0; // Try start flowing on next tick if stream isn't explicitly paused if (state.flowing !== false) this.resume(); } else if (ev === 'readable') { if (!state.endEmitted && !state.readableListening) { state.readableListening = state.needReadable = true; state.flowing = false; state.emittedReadable = false; debug('on readable', state.length, state.reading); if (state.length) { emitReadable(this); } else if (!state.reading) { process.nextTick(nReadingNextTick, this); } } } return res; }; Readable.prototype.addListener = Readable.prototype.on; Readable.prototype.removeListener = function (ev, fn) { var res = Stream.prototype.removeListener.call(this, ev, fn); if (ev === 'readable') { // We need to check if there is someone still listening to // readable and reset the state. However this needs to happen // after readable has been emitted but before I/O (nextTick) to // support once('readable', fn) cycles. This means that calling // resume within the same tick will have no // effect. process.nextTick(updateReadableListening, this); } return res; }; Readable.prototype.removeAllListeners = function (ev) { var res = Stream.prototype.removeAllListeners.apply(this, arguments); if (ev === 'readable' || ev === undefined) { // We need to check if there is someone still listening to // readable and reset the state. However this needs to happen // after readable has been emitted but before I/O (nextTick) to // support once('readable', fn) cycles. This means that calling // resume within the same tick will have no // effect. process.nextTick(updateReadableListening, this); } return res; }; function updateReadableListening(self) { var state = self._readableState; state.readableListening = self.listenerCount('readable') > 0; if (state.resumeScheduled && !state.paused) { // flowing needs to be set to true now, otherwise // the upcoming resume will not flow. state.flowing = true; // crude way to check if we should resume } else if (self.listenerCount('data') > 0) { self.resume(); } } function nReadingNextTick(self) { debug('readable nexttick read 0'); self.read(0); } // pause() and resume() are remnants of the legacy readable stream API // If the user uses them, then switch into old mode. Readable.prototype.resume = function () { var state = this._readableState; if (!state.flowing) { debug('resume'); // we flow only if there is no one listening // for readable, but we still have to call // resume() state.flowing = !state.readableListening; resume(this, state); } state.paused = false; return this; }; function resume(stream, state) { if (!state.resumeScheduled) { state.resumeScheduled = true; process.nextTick(resume_, stream, state); } } function resume_(stream, state) { debug('resume', state.reading); if (!state.reading) { stream.read(0); } state.resumeScheduled = false; stream.emit('resume'); flow(stream); if (state.flowing && !state.reading) stream.read(0); } Readable.prototype.pause = function () { debug('call pause flowing=%j', this._readableState.flowing); if (this._readableState.flowing !== false) { debug('pause'); this._readableState.flowing = false; this.emit('pause'); } this._readableState.paused = true; return this; }; function flow(stream) { var state = stream._readableState; debug('flow', state.flowing); while (state.flowing && stream.read() !== null) { ; } } // wrap an old-style stream as the async data source. // This is *not* part of the readable stream interface. // It is an ugly unfortunate mess of history. Readable.prototype.wrap = function (stream) { var _this = this; var state = this._readableState; var paused = false; stream.on('end', function () { debug('wrapped end'); if (state.decoder && !state.ended) { var chunk = state.decoder.end(); if (chunk && chunk.length) _this.push(chunk); } _this.push(null); }); stream.on('data', function (chunk) { debug('wrapped data'); if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; var ret = _this.push(chunk); if (!ret) { paused = true; stream.pause(); } }); // proxy all the other methods. // important when wrapping filters and duplexes. for (var i in stream) { if (this[i] === undefined && typeof stream[i] === 'function') { this[i] = function methodWrap(method) { return function methodWrapReturnFunction() { return stream[method].apply(stream, arguments); }; }(i); } } // proxy certain important events. for (var n = 0; n < kProxyEvents.length; n++) { stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); } // when we try to consume some more bytes, simply unpause the // underlying stream. this._read = function (n) { debug('wrapped _read', n); if (paused) { paused = false; stream.resume(); } }; return this; }; if (typeof Symbol === 'function') { Readable.prototype[Symbol.asyncIterator] = function () { emitExperimentalWarning('Readable[Symbol.asyncIterator]'); if (createReadableStreamAsyncIterator === undefined) { createReadableStreamAsyncIterator = __webpack_require__(329); } return createReadableStreamAsyncIterator(this); }; } Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._readableState.highWaterMark; } }); Object.defineProperty(Readable.prototype, 'readableBuffer', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._readableState && this._readableState.buffer; } }); Object.defineProperty(Readable.prototype, 'readableFlowing', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._readableState.flowing; }, set: function set(state) { if (this._readableState) { this._readableState.flowing = state; } } }); // exposed for testing purposes only. Readable._fromList = fromList; Object.defineProperty(Readable.prototype, 'readableLength', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._readableState.length; } }); // Pluck off n bytes from an array of buffers. // Length is the combined lengths of all the buffers in the list. // This function is designed to be inlinable, so please take care when making // changes to the function body. function fromList(n, state) { // nothing buffered if (state.length === 0) return null; var ret; if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { // read it all, truncate the list if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length); state.buffer.clear(); } else { // read part of list ret = state.buffer.consume(n, state.decoder); } return ret; } function endReadable(stream) { var state = stream._readableState; debug('endReadable', state.endEmitted); if (!state.endEmitted) { state.ended = true; process.nextTick(endReadableNT, state, stream); } } function endReadableNT(state, stream) { debug('endReadableNT', state.endEmitted, state.length); // Check that we didn't get one last unshift. if (!state.endEmitted && state.length === 0) { state.endEmitted = true; stream.readable = false; stream.emit('end'); } } function indexOf(xs, x) { for (var i = 0, l = xs.length; i < l; i++) { if (xs[i] === x) return i; } return -1; } /***/ }), /* 319 */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(100); /***/ }), /* 320 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var _require = __webpack_require__(96), Buffer = _require.Buffer; var _require2 = __webpack_require__(9), inspect = _require2.inspect; var custom = inspect && inspect.custom || 'inspect'; function copyBuffer(src, target, offset) { Buffer.prototype.copy.call(src, target, offset); } module.exports = /*#__PURE__*/ function () { function BufferList() { this.head = null; this.tail = null; this.length = 0; } var _proto = BufferList.prototype; _proto.push = function push(v) { var entry = { data: v, next: null }; if (this.length > 0) this.tail.next = entry;else this.head = entry; this.tail = entry; ++this.length; }; _proto.unshift = function unshift(v) { var entry = { data: v, next: this.head }; if (this.length === 0) this.tail = entry; this.head = entry; ++this.length; }; _proto.shift = function shift() { if (this.length === 0) return; var ret = this.head.data; if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; --this.length; return ret; }; _proto.clear = function clear() { this.head = this.tail = null; this.length = 0; }; _proto.join = function join(s) { if (this.length === 0) return ''; var p = this.head; var ret = '' + p.data; while (p = p.next) { ret += s + p.data; } return ret; }; _proto.concat = function concat(n) { if (this.length === 0) return Buffer.alloc(0); var ret = Buffer.allocUnsafe(n >>> 0); var p = this.head; var i = 0; while (p) { copyBuffer(p.data, ret, i); i += p.data.length; p = p.next; } return ret; } // Consumes a specified amount of bytes or characters from the buffered data. ; _proto.consume = function consume(n, hasStrings) { var ret; if (n < this.head.data.length) { // `slice` is the same for buffers and strings. ret = this.head.data.slice(0, n); this.head.data = this.head.data.slice(n); } else if (n === this.head.data.length) { // First chunk is a perfect match. ret = this.shift(); } else { // Result spans more than one buffer. ret = hasStrings ? this._getString(n) : this._getBuffer(n); } return ret; }; _proto.first = function first() { return this.head.data; } // Consumes a specified amount of characters from the buffered data. ; _proto._getString = function _getString(n) { var p = this.head; var c = 1; var ret = p.data; n -= ret.length; while (p = p.next) { var str = p.data; var nb = n > str.length ? str.length : n; if (nb === str.length) ret += str;else ret += str.slice(0, n); n -= nb; if (n === 0) { if (nb === str.length) { ++c; if (p.next) this.head = p.next;else this.head = this.tail = null; } else { this.head = p; p.data = str.slice(nb); } break; } ++c; } this.length -= c; return ret; } // Consumes a specified amount of bytes from the buffered data. ; _proto._getBuffer = function _getBuffer(n) { var ret = Buffer.allocUnsafe(n); var p = this.head; var c = 1; p.data.copy(ret); n -= p.data.length; while (p = p.next) { var buf = p.data; var nb = n > buf.length ? buf.length : n; buf.copy(ret, ret.length - n, 0, nb); n -= nb; if (n === 0) { if (nb === buf.length) { ++c; if (p.next) this.head = p.next;else this.head = this.tail = null; } else { this.head = p; p.data = buf.slice(nb); } break; } ++c; } this.length -= c; return ret; } // Make sure the linked list only shows the minimal necessary information. ; _proto[custom] = function (_, options) { return inspect(this, _objectSpread({}, options, { // Only inspect one level. depth: 0, // It should not recurse. customInspect: false })); }; return BufferList; }(); /***/ }), /* 321 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // undocumented cb() API, needed for core, not for public API function destroy(err, cb) { var _this = this; var readableDestroyed = this._readableState && this._readableState.destroyed; var writableDestroyed = this._writableState && this._writableState.destroyed; if (readableDestroyed || writableDestroyed) { if (cb) { cb(err); } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { process.nextTick(emitErrorNT, this, err); } return this; } // we set destroyed to true before firing error callbacks in order // to make it re-entrance safe in case destroy() is called within callbacks if (this._readableState) { this._readableState.destroyed = true; } // if this is a duplex stream mark the writable part as destroyed as well if (this._writableState) { this._writableState.destroyed = true; } this._destroy(err || null, function (err) { if (!cb && err) { process.nextTick(emitErrorAndCloseNT, _this, err); if (_this._writableState) { _this._writableState.errorEmitted = true; } } else if (cb) { process.nextTick(emitCloseNT, _this); cb(err); } else { process.nextTick(emitCloseNT, _this); } }); return this; } function emitErrorAndCloseNT(self, err) { emitErrorNT(self, err); emitCloseNT(self); } function emitCloseNT(self) { if (self._writableState && !self._writableState.emitClose) return; if (self._readableState && !self._readableState.emitClose) return; self.emit('close'); } function undestroy() { if (this._readableState) { this._readableState.destroyed = false; this._readableState.reading = false; this._readableState.ended = false; this._readableState.endEmitted = false; } if (this._writableState) { this._writableState.destroyed = false; this._writableState.ended = false; this._writableState.ending = false; this._writableState.finalCalled = false; this._writableState.prefinished = false; this._writableState.finished = false; this._writableState.errorEmitted = false; } } function emitErrorNT(self, err) { self.emit('error', err); } module.exports = { destroy: destroy, undestroy: undestroy }; /***/ }), /* 322 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var ERR_INVALID_OPT_VALUE = __webpack_require__(323).codes.ERR_INVALID_OPT_VALUE; function highWaterMarkFrom(options, isDuplex, duplexKey) { return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; } function getHighWaterMark(state, options, duplexKey, isDuplex) { var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); if (hwm != null) { if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { var name = isDuplex ? duplexKey : 'highWaterMark'; throw new ERR_INVALID_OPT_VALUE(name, hwm); } return Math.floor(hwm); } // Default value return state.objectMode ? 16 : 16 * 1024; } module.exports = { getHighWaterMark: getHighWaterMark }; /***/ }), /* 323 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const codes = {}; function createErrorType(code, message, Base) { if (!Base) { Base = Error } function getMessage (arg1, arg2, arg3) { if (typeof message === 'string') { return message } else { return message(arg1, arg2, arg3) } } class NodeError extends Base { constructor (arg1, arg2, arg3) { super(getMessage(arg1, arg2, arg3)); } } NodeError.prototype.name = Base.name; NodeError.prototype.code = code; codes[code] = NodeError; } // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js function oneOf(expected, thing) { if (Array.isArray(expected)) { const len = expected.length; expected = expected.map((i) => String(i)); if (len > 2) { return `one of ${thing} ${expected.slice(0, len - 1).join(', ')}, or ` + expected[len - 1]; } else if (len === 2) { return `one of ${thing} ${expected[0]} or ${expected[1]}`; } else { return `of ${thing} ${expected[0]}`; } } else { return `of ${thing} ${String(expected)}`; } } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith function startsWith(str, search, pos) { return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith function endsWith(str, search, this_len) { if (this_len === undefined || this_len > str.length) { this_len = str.length; } return str.substring(this_len - search.length, this_len) === search; } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes function includes(str, search, start) { if (typeof start !== 'number') { start = 0; } if (start + search.length > str.length) { return false; } else { return str.indexOf(search, start) !== -1; } } 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) { // determiner: 'must be' or 'must not be' let determiner; if (typeof expected === 'string' && startsWith(expected, 'not ')) { determiner = 'must not be'; expected = expected.replace(/^not /, ''); } else { determiner = 'must be'; } let msg; if (endsWith(name, ' argument')) { // For cases like 'first argument' msg = `The ${name} ${determiner} ${oneOf(expected, 'type')}`; } else { const type = includes(name, '.') ? 'property' : 'argument'; msg = `The "${name}" ${type} ${determiner} ${oneOf(expected, 'type')}`; } msg += `. Received type ${typeof actual}`; return 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; /***/ }), /* 324 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var experimentalWarnings = new Set(); function emitExperimentalWarning(feature) { if (experimentalWarnings.has(feature)) return; var msg = feature + ' is an experimental feature. This feature could ' + 'change at any time'; experimentalWarnings.add(feature); process.emitWarning(msg, 'ExperimentalWarning'); } function noop() {} module.exports.emitExperimentalWarning = process.emitWarning ? emitExperimentalWarning : noop; /***/ }), /* 325 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // a duplex stream is just a stream that is both readable and writable. // Since JS doesn't have multiple prototypal inheritance, this class // prototypally inherits from Readable, and then parasitically from // Writable. /*<replacement>*/ var objectKeys = Object.keys || function (obj) { var keys = []; for (var key in obj) { keys.push(key); } return keys; }; /*</replacement>*/ module.exports = Duplex; var Readable = __webpack_require__(318); var Writable = __webpack_require__(326); __webpack_require__(290)(Duplex, Readable); { // Allow the keys array to be GC'ed. var keys = objectKeys(Writable.prototype); for (var v = 0; v < keys.length; v++) { var method = keys[v]; if (!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 = true; if (options) { if (options.readable === false) this.readable = false; if (options.writable === false) this.writable = false; if (options.allowHalfOpen === false) { this.allowHalfOpen = false; this.once('end', onend); } } } Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState.highWaterMark; } }); Object.defineProperty(Duplex.prototype, 'writableBuffer', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState && this._writableState.getBuffer(); } }); Object.defineProperty(Duplex.prototype, 'writableLength', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState.length; } }); // the no-half-open enforcer function onend() { // If the writable side ended, then we're ok. if (this._writableState.ended) return; // no more data can be written. // But allow more writes to happen in this tick. process.nextTick(onEndNT, this); } function onEndNT(self) { self.end(); } Object.defineProperty(Duplex.prototype, 'destroyed', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { if (this._readableState === undefined || this._writableState === undefined) { return false; } return this._readableState.destroyed && this._writableState.destroyed; }, set: function set(value) { // we ignore the value if the stream // has not been initialized yet if (this._readableState === undefined || this._writableState === undefined) { return; } // backward compatibility, the user is explicitly // managing destroyed this._readableState.destroyed = value; this._writableState.destroyed = value; } }); /***/ }), /* 326 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // A bit simpler than readable streams. // Implement an async ._write(chunk, encoding, cb), and it'll handle all // the drain event emission and buffering. module.exports = Writable; /* <replacement> */ function WriteReq(chunk, encoding, cb) { this.chunk = chunk; this.encoding = encoding; this.callback = cb; this.next = null; } // It seems a linked list but it is not // there will be only 2 of these for each stream function CorkedRequest(state) { var _this = this; this.next = null; this.entry = null; this.finish = function () { onCorkedFinish(_this, state); }; } /* </replacement> */ /*<replacement>*/ var Duplex; /*</replacement>*/ Writable.WritableState = WritableState; /*<replacement>*/ var internalUtil = { deprecate: __webpack_require__(327) }; /*</replacement>*/ /*<replacement>*/ var Stream = __webpack_require__(319); /*</replacement>*/ var Buffer = __webpack_require__(96).Buffer; var OurUint8Array = global.Uint8Array || function () {}; function _uint8ArrayToBuffer(chunk) { return Buffer.from(chunk); } function _isUint8Array(obj) { return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; } var destroyImpl = __webpack_require__(321); var _require = __webpack_require__(322), getHighWaterMark = _require.getHighWaterMark; var _require$codes = __webpack_require__(323).codes, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; __webpack_require__(290)(Writable, Stream); function nop() {} function WritableState(options, stream, isDuplex) { Duplex = Duplex || __webpack_require__(325); options = options || {}; // Duplex streams are both readable and writable, but share // the same options object. // However, some cases require setting options to different // values for the readable and the writable sides of the duplex stream, // e.g. options.readableObjectMode vs. options.writableObjectMode, etc. if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag to indicate whether or not this stream // contains buffers or objects. this.objectMode = !!options.objectMode; if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; // the point at which write() starts returning false // Note: 0 is a valid value, means that we always return false if // the entire buffer is not flushed immediately on write() this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex); // if _final has been called this.finalCalled = false; // drain event flag. this.needDrain = false; // at the start of calling end() this.ending = false; // when end() has been called, and returned this.ended = false; // when 'finish' is emitted this.finished = false; // has it been destroyed this.destroyed = false; // should we decode strings into buffers before passing to _write? // this is here so that some node-core streams can optimize string // handling at a lower level. var noDecode = options.decodeStrings === false; this.decodeStrings = !noDecode; // Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. // Everything else in the universe uses 'utf8', though. this.defaultEncoding = options.defaultEncoding || 'utf8'; // not an actual buffer we keep track of, but a measurement // of how much we're waiting to get pushed to some underlying // socket or file. this.length = 0; // a flag to see when we're in the middle of a write. this.writing = false; // when true all writes will be buffered until .uncork() call this.corked = 0; // a flag to be able to tell if the onwrite cb is called immediately, // or on a later tick. We set this to true at first, because any // actions that shouldn't happen until "later" should generally also // not happen before the first write call. this.sync = true; // a flag to know if we're processing previously buffered items, which // may call the _write() callback in the same tick, so that we don't // end up in an overlapped onwrite situation. this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb) this.onwrite = function (er) { onwrite(stream, er); }; // the callback that the user supplies to write(chunk,encoding,cb) this.writecb = null; // the amount that is being written when _write is called. this.writelen = 0; this.bufferedRequest = null; this.lastBufferedRequest = null; // number of pending user-supplied write callbacks // this must be 0 before 'finish' can be emitted this.pendingcb = 0; // emit prefinish if the only thing we're waiting for is _write cbs // This is relevant for synchronous Transform streams this.prefinished = false; // True if the error was already emitted and should not be thrown again this.errorEmitted = false; // Should close be emitted on destroy. Defaults to true. this.emitClose = options.emitClose !== false; // count buffered requests this.bufferedRequestCount = 0; // allocate the first CorkedRequest, there is always // one allocated and free to use, and we maintain at most two this.corkedRequestsFree = new CorkedRequest(this); } WritableState.prototype.getBuffer = function getBuffer() { var current = this.bufferedRequest; var out = []; while (current) { out.push(current); current = current.next; } return out; }; (function () { try { Object.defineProperty(WritableState.prototype, 'buffer', { get: internalUtil.deprecate(function writableStateBufferGetter() { return this.getBuffer(); }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') }); } catch (_) {} })(); // Test _writableState for inheritance to account for Duplex streams, // whose prototype chain only points to Readable. var realHasInstance; if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { realHasInstance = Function.prototype[Symbol.hasInstance]; Object.defineProperty(Writable, Symbol.hasInstance, { value: function value(object) { if (realHasInstance.call(this, object)) return true; if (this !== Writable) return false; return object && object._writableState instanceof WritableState; } }); } else { realHasInstance = function realHasInstance(object) { return object instanceof this; }; } function Writable(options) { Duplex = Duplex || __webpack_require__(325); // Writable ctor is applied to Duplexes, too. // `realHasInstance` is necessary because using plain `instanceof` // would return false, as no `_writableState` property is attached. // Trying to use the custom `instanceof` for Writable here will also break the // Node.js LazyTransform implementation, which has a non-trivial getter for // `_writableState` that would lead to infinite recursion. // Checking for a Stream.Duplex instance is faster here instead of inside // the WritableState constructor, at least with V8 6.5 var isDuplex = this instanceof Duplex; if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options); this._writableState = new WritableState(options, this, isDuplex); // legacy. this.writable = true; if (options) { if (typeof options.write === 'function') this._write = options.write; if (typeof options.writev === 'function') this._writev = options.writev; if (typeof options.destroy === 'function') this._destroy = options.destroy; if (typeof options.final === 'function') this._final = options.final; } Stream.call(this); } // Otherwise people can pipe Writable streams, which is just wrong. Writable.prototype.pipe = function () { this.emit('error', new ERR_STREAM_CANNOT_PIPE()); }; function writeAfterEnd(stream, cb) { var er = new ERR_STREAM_WRITE_AFTER_END(); // TODO: defer error events consistently everywhere, not just the cb stream.emit('error', er); process.nextTick(cb, er); } // Checks that a user-supplied chunk is valid, especially for the particular // mode the stream is in. Currently this means that `null` is never accepted // and undefined/non-string values are only allowed in object mode. function validChunk(stream, state, chunk, cb) { var er; if (chunk === null) { er = new ERR_STREAM_NULL_VALUES(); } else if (typeof chunk !== 'string' && !state.objectMode) { er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk); } if (er) { stream.emit('error', er); process.nextTick(cb, er); return false; } return true; } Writable.prototype.write = function (chunk, encoding, cb) { var state = this._writableState; var ret = false; var isBuf = !state.objectMode && _isUint8Array(chunk); if (isBuf && !Buffer.isBuffer(chunk)) { chunk = _uint8ArrayToBuffer(chunk); } if (typeof encoding === 'function') { cb = encoding; encoding = null; } if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; if (typeof cb !== 'function') cb = nop; if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { state.pendingcb++; ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); } return ret; }; Writable.prototype.cork = function () { this._writableState.corked++; }; Writable.prototype.uncork = function () { var state = this._writableState; if (state.corked) { state.corked--; if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); } }; Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { // node::ParseEncoding() requires lower case. if (typeof encoding === 'string') encoding = encoding.toLowerCase(); if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding); this._writableState.defaultEncoding = encoding; return this; }; Object.defineProperty(Writable.prototype, 'writableBuffer', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState && this._writableState.getBuffer(); } }); function decodeChunk(state, chunk, encoding) { if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { chunk = Buffer.from(chunk, encoding); } return chunk; } Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState.highWaterMark; } }); // if we're already writing something, then just put this // in the queue, and wait our turn. Otherwise, call _write // If we return false, then we need a drain event, so set that flag. function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { if (!isBuf) { var newChunk = decodeChunk(state, chunk, encoding); if (chunk !== newChunk) { isBuf = true; encoding = 'buffer'; chunk = newChunk; } } var len = state.objectMode ? 1 : chunk.length; state.length += len; var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false. if (!ret) state.needDrain = true; if (state.writing || state.corked) { var last = state.lastBufferedRequest; state.lastBufferedRequest = { chunk: chunk, encoding: encoding, isBuf: isBuf, callback: cb, next: null }; if (last) { last.next = state.lastBufferedRequest; } else { state.bufferedRequest = state.lastBufferedRequest; } state.bufferedRequestCount += 1; } else { doWrite(stream, state, false, len, chunk, encoding, cb); } return ret; } function doWrite(stream, state, writev, len, chunk, encoding, cb) { state.writelen = len; state.writecb = cb; state.writing = true; state.sync = true; if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); state.sync = false; } function onwriteError(stream, state, sync, er, cb) { --state.pendingcb; if (sync) { // defer the callback if we are being called synchronously // to avoid piling up things on the stack process.nextTick(cb, er); // this can emit finish, and it will always happen // after error process.nextTick(finishMaybe, stream, state); stream._writableState.errorEmitted = true; stream.emit('error', er); } else { // the caller expect this to happen before if // it is async cb(er); stream._writableState.errorEmitted = true; stream.emit('error', er); // this can emit finish, but finish must // always follow error finishMaybe(stream, state); } } function onwriteStateUpdate(state) { state.writing = false; state.writecb = null; state.length -= state.writelen; state.writelen = 0; } function onwrite(stream, er) { var state = stream._writableState; var sync = state.sync; var cb = state.writecb; if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK(); onwriteStateUpdate(state); if (er) onwriteError(stream, state, sync, er, cb);else { // Check if we're actually ready to finish, but don't emit yet var finished = needFinish(state) || stream.destroyed; if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { clearBuffer(stream, state); } if (sync) { process.nextTick(afterWrite, stream, state, finished, cb); } else { afterWrite(stream, state, finished, cb); } } } function afterWrite(stream, state, finished, cb) { if (!finished) onwriteDrain(stream, state); state.pendingcb--; cb(); finishMaybe(stream, state); } // Must force callback to be called on nextTick, so that we don't // emit 'drain' before the write() consumer gets the 'false' return // value, and has a chance to attach a 'drain' listener. function onwriteDrain(stream, state) { if (state.length === 0 && state.needDrain) { state.needDrain = false; stream.emit('drain'); } } // if there's something in the buffer waiting, then process it function clearBuffer(stream, state) { state.bufferProcessing = true; var entry = state.bufferedRequest; if (stream._writev && entry && entry.next) { // Fast case, write everything using _writev() var l = state.bufferedRequestCount; var buffer = new Array(l); var holder = state.corkedRequestsFree; holder.entry = entry; var count = 0; var allBuffers = true; while (entry) { buffer[count] = entry; if (!entry.isBuf) allBuffers = false; entry = entry.next; count += 1; } buffer.allBuffers = allBuffers; doWrite(stream, state, true, state.length, buffer, '', holder.finish); // doWrite is almost always async, defer these to save a bit of time // as the hot path ends with doWrite state.pendingcb++; state.lastBufferedRequest = null; if (holder.next) { state.corkedRequestsFree = holder.next; holder.next = null; } else { state.corkedRequestsFree = new CorkedRequest(state); } state.bufferedRequestCount = 0; } else { // Slow case, write chunks one-by-one while (entry) { var chunk = entry.chunk; var encoding = entry.encoding; var cb = entry.callback; var len = state.objectMode ? 1 : chunk.length; doWrite(stream, state, false, len, chunk, encoding, cb); entry = entry.next; state.bufferedRequestCount--; // if we didn't call the onwrite immediately, then // it means that we need to wait until it does. // also, that means that the chunk and cb are currently // being processed, so move the buffer counter past them. if (state.writing) { break; } } if (entry === null) state.lastBufferedRequest = null; } state.bufferedRequest = entry; state.bufferProcessing = false; } Writable.prototype._write = function (chunk, encoding, cb) { cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()')); }; Writable.prototype._writev = null; Writable.prototype.end = function (chunk, encoding, cb) { var state = this._writableState; if (typeof chunk === 'function') { cb = chunk; chunk = null; encoding = null; } else if (typeof encoding === 'function') { cb = encoding; encoding = null; } if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks if (state.corked) { state.corked = 1; this.uncork(); } // ignore unnecessary end() calls. if (!state.ending) endWritable(this, state, cb); return this; }; Object.defineProperty(Writable.prototype, 'writableLength', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState.length; } }); function needFinish(state) { return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; } function callFinal(stream, state) { stream._final(function (err) { state.pendingcb--; if (err) { stream.emit('error', err); } state.prefinished = true; stream.emit('prefinish'); finishMaybe(stream, state); }); } function prefinish(stream, state) { if (!state.prefinished && !state.finalCalled) { if (typeof stream._final === 'function' && !state.destroyed) { state.pendingcb++; state.finalCalled = true; process.nextTick(callFinal, stream, state); } else { state.prefinished = true; stream.emit('prefinish'); } } } function finishMaybe(stream, state) { var need = needFinish(state); if (need) { prefinish(stream, state); if (state.pendingcb === 0) { state.finished = true; stream.emit('finish'); } } return need; } function endWritable(stream, state, cb) { state.ending = true; finishMaybe(stream, state); if (cb) { if (state.finished) process.nextTick(cb);else stream.once('finish', cb); } state.ended = true; stream.writable = false; } function onCorkedFinish(corkReq, state, err) { var entry = corkReq.entry; corkReq.entry = null; while (entry) { var cb = entry.callback; state.pendingcb--; cb(err); entry = entry.next; } // reuse the free corkReq. state.corkedRequestsFree.next = corkReq; } Object.defineProperty(Writable.prototype, 'destroyed', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { if (this._writableState === undefined) { return false; } return this._writableState.destroyed; }, set: function set(value) { // we ignore the value if the stream // has not been initialized yet if (!this._writableState) { return; } // backward compatibility, the user is explicitly // managing destroyed this._writableState.destroyed = value; } }); Writable.prototype.destroy = destroyImpl.destroy; Writable.prototype._undestroy = destroyImpl.undestroy; Writable.prototype._destroy = function (err, cb) { cb(err); }; /***/ }), /* 327 */ /***/ (function(module, exports, __webpack_require__) { /** * For Node.js, simply re-export the core `util.deprecate` function. */ module.exports = __webpack_require__(9).deprecate; /***/ }), /* 328 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. /*<replacement>*/ var Buffer = __webpack_require__(95).Buffer; /*</replacement>*/ var isEncoding = Buffer.isEncoding || function (encoding) { encoding = '' + encoding; switch (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 true; default: return false; } }; function _normalizeEncoding(enc) { if (!enc) return 'utf8'; var retried; while (true) { 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; // undefined enc = ('' + enc).toLowerCase(); retried = true; } } }; // Do not cache `Buffer.isEncoding` when checking encoding names as some // modules monkey-patch it to support additional encodings function normalizeEncoding(enc) { var nenc = _normalizeEncoding(enc); if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); return nenc || enc; } // StringDecoder provides an interface for efficiently splitting a series of // buffers into a series of JS strings without breaking apart multi-byte // characters. exports.StringDecoder = StringDecoder; function StringDecoder(encoding) { this.encoding = normalizeEncoding(encoding); var nb; switch (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: this.write = simpleWrite; this.end = simpleEnd; return; } this.lastNeed = 0; this.lastTotal = 0; this.lastChar = Buffer.allocUnsafe(nb); } StringDecoder.prototype.write = function (buf) { if (buf.length === 0) return ''; var r; var i; if (this.lastNeed) { r = this.fillLast(buf); if (r === undefined) return ''; i = this.lastNeed; this.lastNeed = 0; } else { i = 0; } if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); return r || ''; }; StringDecoder.prototype.end = utf8End; // Returns only complete characters in a Buffer StringDecoder.prototype.text = utf8Text; // Attempts to complete a partial non-UTF-8 character using bytes from a Buffer StringDecoder.prototype.fillLast = function (buf) { if (this.lastNeed <= buf.length) { buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); return this.lastChar.toString(this.encoding, 0, this.lastTotal); } buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); this.lastNeed -= buf.length; }; // Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a // continuation byte. If an invalid byte is detected, -2 is returned. function utf8CheckByte(byte) { if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; return byte >> 6 === 0x02 ? -1 : -2; } // Checks at most 3 bytes at the end of a Buffer in order to detect an // incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) // needed to complete the UTF-8 character (if applicable) are returned. function utf8CheckIncomplete(self, buf, i) { var j = buf.length - 1; if (j < i) return 0; var nb = utf8CheckByte(buf[j]); if (nb >= 0) { if (nb > 0) self.lastNeed = nb - 1; return nb; } if (--j < i || nb === -2) return 0; nb = utf8CheckByte(buf[j]); if (nb >= 0) { if (nb > 0) self.lastNeed = nb - 2; return nb; } if (--j < i || nb === -2) return 0; nb = utf8CheckByte(buf[j]); if (nb >= 0) { if (nb > 0) { if (nb === 2) nb = 0;else self.lastNeed = nb - 3; } return nb; } return 0; } // Validates as many continuation bytes for a multi-byte UTF-8 character as // needed or are available. If we see a non-continuation byte where we expect // one, we "replace" the validated continuation bytes we've seen so far with // a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding // behavior. The continuation byte check is included three times in the case // where all of the continuation bytes for a character exist in the same buffer. // It is also done this way as a slight performance increase instead of using a // loop. function utf8CheckExtraBytes(self, buf, p) { if ((buf[0] & 0xC0) !== 0x80) { self.lastNeed = 0; return '\ufffd'; } if (self.lastNeed > 1 && buf.length > 1) { if ((buf[1] & 0xC0) !== 0x80) { self.lastNeed = 1; return '\ufffd'; } if (self.lastNeed > 2 && buf.length > 2) { if ((buf[2] & 0xC0) !== 0x80) { self.lastNeed = 2; return '\ufffd'; } } } } // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. function utf8FillLast(buf) { var p = this.lastTotal - this.lastNeed; var r = utf8CheckExtraBytes(this, buf, p); if (r !== undefined) return r; if (this.lastNeed <= buf.length) { buf.copy(this.lastChar, p, 0, this.lastNeed); return this.lastChar.toString(this.encoding, 0, this.lastTotal); } buf.copy(this.lastChar, p, 0, buf.length); this.lastNeed -= buf.length; } // Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a // partial character, the character's bytes are buffered until the required // number of bytes are available. function utf8Text(buf, i) { var total = utf8CheckIncomplete(this, buf, i); if (!this.lastNeed) return buf.toString('utf8', i); this.lastTotal = total; var end = buf.length - (total - this.lastNeed); buf.copy(this.lastChar, 0, end); return buf.toString('utf8', i, end); } // For UTF-8, a replacement character is added when ending on a partial // character. function utf8End(buf) { var r = buf && buf.length ? this.write(buf) : ''; if (this.lastNeed) return r + '\ufffd'; return r; } // UTF-16LE typically needs two bytes per character, but even if we have an even // number of bytes available, we need to check if we end on a leading/high // surrogate. In that case, we need to wait for the next two bytes in order to // decode the last character properly. 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 >= 0xD800 && c <= 0xDBFF) { this.lastNeed = 2; this.lastTotal = 4; this.lastChar[0] = buf[buf.length - 2]; this.lastChar[1] = buf[buf.length - 1]; return r.slice(0, -1); } } return r; } this.lastNeed = 1; this.lastTotal = 2; this.lastChar[0] = buf[buf.length - 1]; return buf.toString('utf16le', i, buf.length - 1); } // For UTF-16LE we do not explicitly append special replacement characters if we // end on a partial character, we simply let v8 handle that. 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; if (n === 0) return buf.toString('base64', i); this.lastNeed = 3 - n; this.lastTotal = 3; if (n === 1) { this.lastChar[0] = buf[buf.length - 1]; } else { this.lastChar[0] = buf[buf.length - 2]; this.lastChar[1] = buf[buf.length - 1]; } return buf.toString('base64', i, buf.length - n); } function base64End(buf) { var r = buf && buf.length ? this.write(buf) : ''; if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); return r; } // Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) function simpleWrite(buf) { return buf.toString(this.encoding); } function simpleEnd(buf) { return buf && buf.length ? this.write(buf) : ''; } /***/ }), /* 329 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _Object$setPrototypeO; function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var finished = __webpack_require__(330); var kLastResolve = Symbol('lastResolve'); var kLastReject = Symbol('lastReject'); var kError = Symbol('error'); var kEnded = Symbol('ended'); var kLastPromise = Symbol('lastPromise'); var kHandlePromise = Symbol('handlePromise'); var kStream = Symbol('stream'); function createIterResult(value, done) { return { value: value, done: done }; } function readAndResolve(iter) { var resolve = iter[kLastResolve]; if (resolve !== null) { var data = iter[kStream].read(); // we defer if data is null // we can be expecting either 'end' or // 'error' if (data !== null) { iter[kLastPromise] = null; iter[kLastResolve] = null; iter[kLastReject] = null; resolve(createIterResult(data, false)); } } } function onReadable(iter) { // we wait for the next tick, because it might // emit an error with process.nextTick process.nextTick(readAndResolve, iter); } function wrapForNext(lastPromise, iter) { return function (resolve, reject) { lastPromise.then(function () { if (iter[kEnded]) { resolve(createIterResult(undefined, true)); return; } iter[kHandlePromise](resolve, reject); }, reject); }; } var AsyncIteratorPrototype = Object.getPrototypeOf(function () {}); var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { get stream() { return this[kStream]; }, next: function next() { var _this = this; // if we have detected an error in the meanwhile // reject straight away var error = this[kError]; if (error !== null) { return Promise.reject(error); } if (this[kEnded]) { return Promise.resolve(createIterResult(undefined, true)); } if (this[kStream].destroyed) { // We need to defer via nextTick because if .destroy(err) is // called, the error will be emitted via nextTick, and // we cannot guarantee that there is no error lingering around // waiting to be emitted. return new Promise(function (resolve, reject) { process.nextTick(function () { if (_this[kError]) { reject(_this[kError]); } else { resolve(createIterResult(undefined, true)); } }); }); } // if we have multiple next() calls // we will wait for the previous Promise to finish // this logic is optimized to support for await loops, // where next() is only called once at a time var lastPromise = this[kLastPromise]; var promise; if (lastPromise) { promise = new Promise(wrapForNext(lastPromise, this)); } else { // fast path needed to support multiple this.push() // without triggering the next() queue var data = this[kStream].read(); if (data !== null) { return Promise.resolve(createIterResult(data, false)); } promise = new Promise(this[kHandlePromise]); } this[kLastPromise] = promise; return promise; } }, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () { return this; }), _defineProperty(_Object$setPrototypeO, "return", function _return() { var _this2 = this; // destroy(err, cb) is a private API // we can guarantee we have that here, because we control the // Readable class this is attached to return new Promise(function (resolve, reject) { _this2[kStream].destroy(null, function (err) { if (err) { reject(err); return; } resolve(createIterResult(undefined, true)); }); }); }), _Object$setPrototypeO), AsyncIteratorPrototype); var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) { var _Object$create; var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { value: stream, writable: true }), _defineProperty(_Object$create, kLastResolve, { value: null, writable: true }), _defineProperty(_Object$create, kLastReject, { value: null, writable: true }), _defineProperty(_Object$create, kError, { value: null, writable: true }), _defineProperty(_Object$create, kEnded, { value: stream._readableState.endEmitted, writable: true }), _defineProperty(_Object$create, kHandlePromise, { value: function value(resolve, reject) { var data = iterator[kStream].read(); if (data) { iterator[kLastPromise] = null; iterator[kLastResolve] = null; iterator[kLastReject] = null; resolve(createIterResult(data, false)); } else { iterator[kLastResolve] = resolve; iterator[kLastReject] = reject; } }, writable: true }), _Object$create)); iterator[kLastPromise] = null; finished(stream, function (err) { if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') { var reject = iterator[kLastReject]; // reject if we are waiting for data in the Promise // returned by next() and store the error if (reject !== null) { iterator[kLastPromise] = null; iterator[kLastResolve] = null; iterator[kLastReject] = null; reject(err); } iterator[kError] = err; return; } var resolve = iterator[kLastResolve]; if (resolve !== null) { iterator[kLastPromise] = null; iterator[kLastResolve] = null; iterator[kLastReject] = null; resolve(createIterResult(undefined, true)); } iterator[kEnded] = true; }); stream.on('readable', onReadable.bind(null, iterator)); return iterator; }; module.exports = createReadableStreamAsyncIterator; /***/ }), /* 330 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Ported from https://github.com/mafintosh/end-of-stream with // permission from the author, Mathias Buus (@mafintosh). var ERR_STREAM_PREMATURE_CLOSE = __webpack_require__(323).codes.ERR_STREAM_PREMATURE_CLOSE; function once(callback) { var called = false; return function () { if (called) return; called = true; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } callback.apply(this, args); }; } function noop() {} function isRequest(stream) { return stream.setHeader && typeof stream.abort === 'function'; } function eos(stream, opts, callback) { if (typeof opts === 'function') return eos(stream, null, opts); if (!opts) opts = {}; callback = once(callback || noop); var readable = opts.readable || opts.readable !== false && stream.readable; var writable = opts.writable || opts.writable !== false && stream.writable; var onlegacyfinish = function onlegacyfinish() { if (!stream.writable) onfinish(); }; var writableEnded = stream._writableState && stream._writableState.finished; var onfinish = function onfinish() { writable = false; writableEnded = true; if (!readable) callback.call(stream); }; var readableEnded = stream._readableState && stream._readableState.endEmitted; var onend = function onend() { readable = false; readableEnded = true; if (!writable) callback.call(stream); }; var onerror = function onerror(err) { callback.call(stream, err); }; var onclose = function onclose() { var err; if (readable && !readableEnded) { if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); return callback.call(stream, err); } if (writable && !writableEnded) { if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); return callback.call(stream, err); } }; var onrequest = function onrequest() { stream.req.on('finish', onfinish); }; if (isRequest(stream)) { stream.on('complete', onfinish); stream.on('abort', onclose); if (stream.req) onrequest();else stream.on('request', onrequest); } else if (writable && !stream._writableState) { // legacy streams stream.on('end', onlegacyfinish); stream.on('close', onlegacyfinish); } stream.on('end', onend); stream.on('finish', onfinish); if (opts.error !== false) stream.on('error', onerror); stream.on('close', onclose); return function () { stream.removeListener('complete', onfinish); stream.removeListener('abort', onclose); stream.removeListener('request', onrequest); if (stream.req) stream.req.removeListener('finish', onfinish); stream.removeListener('end', onlegacyfinish); stream.removeListener('close', onlegacyfinish); stream.removeListener('finish', onfinish); stream.removeListener('end', onend); stream.removeListener('error', onerror); stream.removeListener('close', onclose); }; } module.exports = eos; /***/ }), /* 331 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // a transform stream is a readable/writable stream where you do // something with the data. Sometimes it's called a "filter", // but that's not a great name for it, since that implies a thing where // some bits pass through, and others are simply ignored. (That would // be a valid example of a transform, of course.) // // While the output is causally related to the input, it's not a // necessarily symmetric or synchronous transformation. For example, // a zlib stream might take multiple plain-text writes(), and then // emit a single compressed chunk some time in the future. // // Here's how this works: // // The Transform stream has all the aspects of the readable and writable // stream classes. When you write(chunk), that calls _write(chunk,cb) // internally, and returns false if there's a lot of pending writes // buffered up. When you call read(), that calls _read(n) until // there's enough pending readable data buffered up. // // In a transform stream, the written data is placed in a buffer. When // _read(n) is called, it transforms the queued up data, calling the // buffered _write cb's as it consumes chunks. If consuming a single // written chunk would result in multiple output chunks, then the first // outputted bit calls the readcb, and subsequent chunks just go into // the read buffer, and will cause it to emit 'readable' if necessary. // // This way, back-pressure is actually determined by the reading side, // since _read has to be called to start processing a new chunk. However, // a pathological inflate type of transform can cause excessive buffering // here. For example, imagine a stream where every byte of input is // interpreted as an integer from 0-255, and then results in that many // bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in // 1kb of data being output. In this case, you could write a very small // amount of input, and end up with a very large amount of output. In // such a pathological inflating mechanism, there'd be no way to tell // the system to stop doing the transform. A single 4MB write could // cause the system to run out of memory. // // However, even in such a pathological case, only a single written chunk // would be consumed, and then the rest would wait (un-transformed) until // the results of the previous transformed chunk were consumed. module.exports = Transform; var _require$codes = __webpack_require__(323).codes, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; var Duplex = __webpack_require__(325); __webpack_require__(290)(Transform, Duplex); function afterTransform(er, data) { var ts = this._transformState; ts.transforming = false; var cb = ts.writecb; if (cb === null) { return this.emit('error', new ERR_MULTIPLE_CALLBACK()); } ts.writechunk = null; ts.writecb = null; if (data != null) // single equals check for both `null` and `undefined` this.push(data); cb(er); var rs = this._readableState; rs.reading = false; if (rs.needReadable || rs.length < rs.highWaterMark) { this._read(rs.highWaterMark); } } function Transform(options) { if (!(this instanceof Transform)) return new Transform(options); Duplex.call(this, options); this._transformState = { afterTransform: afterTransform.bind(this), needTransform: false, transforming: false, writecb: null, writechunk: null, writeencoding: null }; // start out asking for a readable event once data is transformed. this._readableState.needReadable = true; // we have implemented the _read method, and done the other things // that Readable wants before the first _read call, so unset the // sync guard flag. this._readableState.sync = false; if (options) { if (typeof options.transform === 'function') this._transform = options.transform; if (typeof options.flush === 'function') this._flush = options.flush; } // When the writable side finishes, then flush out anything remaining. this.on('prefinish', prefinish); } function prefinish() { var _this = this; if (typeof this._flush === 'function' && !this._readableState.destroyed) { this._flush(function (er, data) { done(_this, er, data); }); } else { done(this, null, null); } } Transform.prototype.push = function (chunk, encoding) { this._transformState.needTransform = false; return Duplex.prototype.push.call(this, chunk, encoding); }; // This is the part where you do stuff! // override this function in implementation classes. // 'chunk' is an input chunk. // // Call `push(newChunk)` to pass along transformed output // to the readable side. You may call 'push' zero or more times. // // Call `cb(err)` when you are done with this chunk. If you pass // an error, then that'll put the hurt on the whole operation. If you // never call cb(), then you'll never get another chunk. Transform.prototype._transform = function (chunk, encoding, cb) { cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()')); }; Transform.prototype._write = function (chunk, encoding, cb) { var ts = this._transformState; ts.writecb = cb; ts.writechunk = chunk; ts.writeencoding = encoding; if (!ts.transforming) { var rs = this._readableState; if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); } }; // Doesn't matter what the args are here. // _transform does all the work. // That we got here means that the readable side wants more data. Transform.prototype._read = function (n) { var ts = this._transformState; if (ts.writechunk !== null && !ts.transforming) { ts.transforming = true; this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); } else { // mark that we need a transform, so that any data that comes in // will get processed, now that we've asked for it. ts.needTransform = true; } }; Transform.prototype._destroy = function (err, cb) { Duplex.prototype._destroy.call(this, err, function (err2) { cb(err2); }); }; function done(stream, er, data) { if (er) return stream.emit('error', er); if (data != null) // single equals check for both `null` and `undefined` stream.push(data); // TODO(BridgeAR): Write a test for these two error cases // if there's nothing in the write buffer, then that means // that nothing more will ever be provided if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0(); if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); return stream.push(null); } /***/ }), /* 332 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // a passthrough stream. // basically just the most minimal sort of Transform stream. // Every written chunk gets output as-is. module.exports = PassThrough; var Transform = __webpack_require__(331); __webpack_require__(290)(PassThrough, Transform); function PassThrough(options) { if (!(this instanceof PassThrough)) return new PassThrough(options); Transform.call(this, options); } PassThrough.prototype._transform = function (chunk, encoding, cb) { cb(null, chunk); }; /***/ }), /* 333 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Ported from https://github.com/mafintosh/pump with // permission from the author, Mathias Buus (@mafintosh). var eos; function once(callback) { var called = false; return function () { if (called) return; called = true; callback.apply(void 0, arguments); }; } var _require$codes = __webpack_require__(323).codes, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; function noop(err) { // Rethrow the error if it exists to avoid swallowing it if (err) throw err; } function isRequest(stream) { return stream.setHeader && typeof stream.abort === 'function'; } function destroyer(stream, reading, writing, callback) { callback = once(callback); var closed = false; stream.on('close', function () { closed = true; }); if (eos === undefined) eos = __webpack_require__(330); eos(stream, { readable: reading, writable: writing }, function (err) { if (err) return callback(err); closed = true; callback(); }); var destroyed = false; return function (err) { if (closed) return; if (destroyed) return; destroyed = true; // request.destroy just do .end - .abort is what we want if (isRequest(stream)) return stream.abort(); if (typeof stream.destroy === 'function') return stream.destroy(); callback(err || new ERR_STREAM_DESTROYED('pipe')); }; } function call(fn) { fn(); } function pipe(from, to) { return from.pipe(to); } function popCallback(streams) { if (!streams.length) return noop; if (typeof streams[streams.length - 1] !== 'function') return noop; return streams.pop(); } function pipeline() { for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { streams[_key] = arguments[_key]; } var callback = popCallback(streams); if (Array.isArray(streams[0])) streams = streams[0]; if (streams.length < 2) { throw new ERR_MISSING_ARGS('streams'); } var error; var destroys = streams.map(function (stream, i) { var reading = i < streams.length - 1; var writing = i > 0; return destroyer(stream, reading, writing, function (err) { if (!error) error = err; if (err) destroys.forEach(call); if (reading) return; destroys.forEach(call); callback(error); }); }); return streams.reduce(pipe); } module.exports = pipeline; /***/ }), /* 334 */ /***/ (function(module, exports) { module.exports = require("string_decoder"); /***/ }), /* 335 */ /***/ (function(module, exports, __webpack_require__) { module.exports = ProxyHandler; function ProxyHandler(cbs) { this._cbs = cbs || {}; } var EVENTS = __webpack_require__(282).EVENTS; Object.keys(EVENTS).forEach(function(name) { if (EVENTS[name] === 0) { name = "on" + name; ProxyHandler.prototype[name] = function() { if (this._cbs[name]) this._cbs[name](); }; } else if (EVENTS[name] === 1) { name = "on" + name; ProxyHandler.prototype[name] = function(a) { if (this._cbs[name]) this._cbs[name](a); }; } else if (EVENTS[name] === 2) { name = "on" + name; ProxyHandler.prototype[name] = function(a, b) { if (this._cbs[name]) this._cbs[name](a, b); }; } else { throw Error("wrong number of arguments"); } }); /***/ }), /* 336 */ /***/ (function(module, exports, __webpack_require__) { module.exports = CollectingHandler; function CollectingHandler(cbs) { this._cbs = cbs || {}; this.events = []; } var EVENTS = __webpack_require__(282).EVENTS; Object.keys(EVENTS).forEach(function(name) { if (EVENTS[name] === 0) { name = "on" + name; CollectingHandler.prototype[name] = function() { this.events.push([name]); if (this._cbs[name]) this._cbs[name](); }; } else if (EVENTS[name] === 1) { name = "on" + name; CollectingHandler.prototype[name] = function(a) { this.events.push([name, a]); if (this._cbs[name]) this._cbs[name](a); }; } else if (EVENTS[name] === 2) { name = "on" + name; CollectingHandler.prototype[name] = function(a, b) { this.events.push([name, a, b]); if (this._cbs[name]) this._cbs[name](a, b); }; } else { throw Error("wrong number of arguments"); } }); CollectingHandler.prototype.onreset = function() { this.events = []; if (this._cbs.onreset) this._cbs.onreset(); }; CollectingHandler.prototype.restart = function() { if (this._cbs.onreset) this._cbs.onreset(); for (var i = 0, len = this.events.length; i < len; i++) { if (this._cbs[this.events[i][0]]) { var num = this.events[i].length; if (num === 1) { this._cbs[this.events[i][0]](); } else if (num === 2) { this._cbs[this.events[i][0]](this.events[i][1]); } else { this._cbs[this.events[i][0]]( this.events[i][1], this.events[i][2] ); } } } }; /***/ }), /* 337 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Parser = __webpack_require__(338), Serializer = __webpack_require__(355); // Shorthands exports.parse = function parse(html, options) { var parser = new Parser(options); return parser.parse(html); }; exports.parseFragment = function parseFragment(fragmentContext, html, options) { if (typeof fragmentContext === 'string') { options = html; html = fragmentContext; fragmentContext = null; } var parser = new Parser(options); return parser.parseFragment(html, fragmentContext); }; exports.serialize = function (node, options) { var serializer = new Serializer(node, options); return serializer.serialize(); }; // Tree adapters exports.treeAdapters = { default: __webpack_require__(351), htmlparser2: __webpack_require__(356) }; // Streaming exports.ParserStream = __webpack_require__(357); exports.PlainTextConversionStream = __webpack_require__(358); exports.SerializerStream = __webpack_require__(359); exports.SAXParser = __webpack_require__(360); /***/ }), /* 338 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Tokenizer = __webpack_require__(339), OpenElementStack = __webpack_require__(343), FormattingElementList = __webpack_require__(345), LocationInfoParserMixin = __webpack_require__(346), defaultTreeAdapter = __webpack_require__(351), mergeOptions = __webpack_require__(352), doctype = __webpack_require__(353), foreignContent = __webpack_require__(354), UNICODE = __webpack_require__(341), HTML = __webpack_require__(344); //Aliases var $ = HTML.TAG_NAMES, NS = HTML.NAMESPACES, ATTRS = HTML.ATTRS; var DEFAULT_OPTIONS = { locationInfo: false, treeAdapter: defaultTreeAdapter }; //Misc constants var HIDDEN_INPUT_TYPE = 'hidden'; //Adoption agency loops iteration count var AA_OUTER_LOOP_ITER = 8, AA_INNER_LOOP_ITER = 3; //Insertion modes var INITIAL_MODE = 'INITIAL_MODE', BEFORE_HTML_MODE = 'BEFORE_HTML_MODE', BEFORE_HEAD_MODE = 'BEFORE_HEAD_MODE', IN_HEAD_MODE = 'IN_HEAD_MODE', AFTER_HEAD_MODE = 'AFTER_HEAD_MODE', IN_BODY_MODE = 'IN_BODY_MODE', TEXT_MODE = 'TEXT_MODE', IN_TABLE_MODE = 'IN_TABLE_MODE', IN_TABLE_TEXT_MODE = 'IN_TABLE_TEXT_MODE', IN_CAPTION_MODE = 'IN_CAPTION_MODE', IN_COLUMN_GROUP_MODE = 'IN_COLUMN_GROUP_MODE', IN_TABLE_BODY_MODE = 'IN_TABLE_BODY_MODE', IN_ROW_MODE = 'IN_ROW_MODE', IN_CELL_MODE = 'IN_CELL_MODE', IN_SELECT_MODE = 'IN_SELECT_MODE', IN_SELECT_IN_TABLE_MODE = 'IN_SELECT_IN_TABLE_MODE', IN_TEMPLATE_MODE = 'IN_TEMPLATE_MODE', AFTER_BODY_MODE = 'AFTER_BODY_MODE', IN_FRAMESET_MODE = 'IN_FRAMESET_MODE', AFTER_FRAMESET_MODE = 'AFTER_FRAMESET_MODE', AFTER_AFTER_BODY_MODE = 'AFTER_AFTER_BODY_MODE', AFTER_AFTER_FRAMESET_MODE = 'AFTER_AFTER_FRAMESET_MODE'; //Insertion mode reset map var INSERTION_MODE_RESET_MAP = Object.create(null); INSERTION_MODE_RESET_MAP[$.TR] = IN_ROW_MODE; INSERTION_MODE_RESET_MAP[$.TBODY] = INSERTION_MODE_RESET_MAP[$.THEAD] = INSERTION_MODE_RESET_MAP[$.TFOOT] = IN_TABLE_BODY_MODE; INSERTION_MODE_RESET_MAP[$.CAPTION] = IN_CAPTION_MODE; INSERTION_MODE_RESET_MAP[$.COLGROUP] = IN_COLUMN_GROUP_MODE; INSERTION_MODE_RESET_MAP[$.TABLE] = IN_TABLE_MODE; INSERTION_MODE_RESET_MAP[$.BODY] = IN_BODY_MODE; INSERTION_MODE_RESET_MAP[$.FRAMESET] = IN_FRAMESET_MODE; //Template insertion mode switch map var TEMPLATE_INSERTION_MODE_SWITCH_MAP = Object.create(null); TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.CAPTION] = TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.COLGROUP] = TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.TBODY] = TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.TFOOT] = TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.THEAD] = IN_TABLE_MODE; TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.COL] = IN_COLUMN_GROUP_MODE; TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.TR] = IN_TABLE_BODY_MODE; TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.TD] = TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.TH] = IN_ROW_MODE; //Token handlers map for insertion modes var _ = Object.create(null); _[INITIAL_MODE] = Object.create(null); _[INITIAL_MODE][Tokenizer.CHARACTER_TOKEN] = _[INITIAL_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenInInitialMode; _[INITIAL_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = ignoreToken; _[INITIAL_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; _[INITIAL_MODE][Tokenizer.DOCTYPE_TOKEN] = doctypeInInitialMode; _[INITIAL_MODE][Tokenizer.START_TAG_TOKEN] = _[INITIAL_MODE][Tokenizer.END_TAG_TOKEN] = _[INITIAL_MODE][Tokenizer.EOF_TOKEN] = tokenInInitialMode; _[BEFORE_HTML_MODE] = Object.create(null); _[BEFORE_HTML_MODE][Tokenizer.CHARACTER_TOKEN] = _[BEFORE_HTML_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenBeforeHtml; _[BEFORE_HTML_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = ignoreToken; _[BEFORE_HTML_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; _[BEFORE_HTML_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; _[BEFORE_HTML_MODE][Tokenizer.START_TAG_TOKEN] = startTagBeforeHtml; _[BEFORE_HTML_MODE][Tokenizer.END_TAG_TOKEN] = endTagBeforeHtml; _[BEFORE_HTML_MODE][Tokenizer.EOF_TOKEN] = tokenBeforeHtml; _[BEFORE_HEAD_MODE] = Object.create(null); _[BEFORE_HEAD_MODE][Tokenizer.CHARACTER_TOKEN] = _[BEFORE_HEAD_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenBeforeHead; _[BEFORE_HEAD_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = ignoreToken; _[BEFORE_HEAD_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; _[BEFORE_HEAD_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; _[BEFORE_HEAD_MODE][Tokenizer.START_TAG_TOKEN] = startTagBeforeHead; _[BEFORE_HEAD_MODE][Tokenizer.END_TAG_TOKEN] = endTagBeforeHead; _[BEFORE_HEAD_MODE][Tokenizer.EOF_TOKEN] = tokenBeforeHead; _[IN_HEAD_MODE] = Object.create(null); _[IN_HEAD_MODE][Tokenizer.CHARACTER_TOKEN] = _[IN_HEAD_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenInHead; _[IN_HEAD_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; _[IN_HEAD_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; _[IN_HEAD_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; _[IN_HEAD_MODE][Tokenizer.START_TAG_TOKEN] = startTagInHead; _[IN_HEAD_MODE][Tokenizer.END_TAG_TOKEN] = endTagInHead; _[IN_HEAD_MODE][Tokenizer.EOF_TOKEN] = tokenInHead; _[AFTER_HEAD_MODE] = Object.create(null); _[AFTER_HEAD_MODE][Tokenizer.CHARACTER_TOKEN] = _[AFTER_HEAD_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenAfterHead; _[AFTER_HEAD_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; _[AFTER_HEAD_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; _[AFTER_HEAD_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; _[AFTER_HEAD_MODE][Tokenizer.START_TAG_TOKEN] = startTagAfterHead; _[AFTER_HEAD_MODE][Tokenizer.END_TAG_TOKEN] = endTagAfterHead; _[AFTER_HEAD_MODE][Tokenizer.EOF_TOKEN] = tokenAfterHead; _[IN_BODY_MODE] = Object.create(null); _[IN_BODY_MODE][Tokenizer.CHARACTER_TOKEN] = characterInBody; _[IN_BODY_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; _[IN_BODY_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody; _[IN_BODY_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; _[IN_BODY_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; _[IN_BODY_MODE][Tokenizer.START_TAG_TOKEN] = startTagInBody; _[IN_BODY_MODE][Tokenizer.END_TAG_TOKEN] = endTagInBody; _[IN_BODY_MODE][Tokenizer.EOF_TOKEN] = eofInBody; _[TEXT_MODE] = Object.create(null); _[TEXT_MODE][Tokenizer.CHARACTER_TOKEN] = _[TEXT_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = _[TEXT_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; _[TEXT_MODE][Tokenizer.COMMENT_TOKEN] = _[TEXT_MODE][Tokenizer.DOCTYPE_TOKEN] = _[TEXT_MODE][Tokenizer.START_TAG_TOKEN] = ignoreToken; _[TEXT_MODE][Tokenizer.END_TAG_TOKEN] = endTagInText; _[TEXT_MODE][Tokenizer.EOF_TOKEN] = eofInText; _[IN_TABLE_MODE] = Object.create(null); _[IN_TABLE_MODE][Tokenizer.CHARACTER_TOKEN] = _[IN_TABLE_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = _[IN_TABLE_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = characterInTable; _[IN_TABLE_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; _[IN_TABLE_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; _[IN_TABLE_MODE][Tokenizer.START_TAG_TOKEN] = startTagInTable; _[IN_TABLE_MODE][Tokenizer.END_TAG_TOKEN] = endTagInTable; _[IN_TABLE_MODE][Tokenizer.EOF_TOKEN] = eofInBody; _[IN_TABLE_TEXT_MODE] = Object.create(null); _[IN_TABLE_TEXT_MODE][Tokenizer.CHARACTER_TOKEN] = characterInTableText; _[IN_TABLE_TEXT_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; _[IN_TABLE_TEXT_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInTableText; _[IN_TABLE_TEXT_MODE][Tokenizer.COMMENT_TOKEN] = _[IN_TABLE_TEXT_MODE][Tokenizer.DOCTYPE_TOKEN] = _[IN_TABLE_TEXT_MODE][Tokenizer.START_TAG_TOKEN] = _[IN_TABLE_TEXT_MODE][Tokenizer.END_TAG_TOKEN] = _[IN_TABLE_TEXT_MODE][Tokenizer.EOF_TOKEN] = tokenInTableText; _[IN_CAPTION_MODE] = Object.create(null); _[IN_CAPTION_MODE][Tokenizer.CHARACTER_TOKEN] = characterInBody; _[IN_CAPTION_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; _[IN_CAPTION_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody; _[IN_CAPTION_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; _[IN_CAPTION_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; _[IN_CAPTION_MODE][Tokenizer.START_TAG_TOKEN] = startTagInCaption; _[IN_CAPTION_MODE][Tokenizer.END_TAG_TOKEN] = endTagInCaption; _[IN_CAPTION_MODE][Tokenizer.EOF_TOKEN] = eofInBody; _[IN_COLUMN_GROUP_MODE] = Object.create(null); _[IN_COLUMN_GROUP_MODE][Tokenizer.CHARACTER_TOKEN] = _[IN_COLUMN_GROUP_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenInColumnGroup; _[IN_COLUMN_GROUP_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; _[IN_COLUMN_GROUP_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; _[IN_COLUMN_GROUP_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; _[IN_COLUMN_GROUP_MODE][Tokenizer.START_TAG_TOKEN] = startTagInColumnGroup; _[IN_COLUMN_GROUP_MODE][Tokenizer.END_TAG_TOKEN] = endTagInColumnGroup; _[IN_COLUMN_GROUP_MODE][Tokenizer.EOF_TOKEN] = eofInBody; _[IN_TABLE_BODY_MODE] = Object.create(null); _[IN_TABLE_BODY_MODE][Tokenizer.CHARACTER_TOKEN] = _[IN_TABLE_BODY_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = _[IN_TABLE_BODY_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = characterInTable; _[IN_TABLE_BODY_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; _[IN_TABLE_BODY_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; _[IN_TABLE_BODY_MODE][Tokenizer.START_TAG_TOKEN] = startTagInTableBody; _[IN_TABLE_BODY_MODE][Tokenizer.END_TAG_TOKEN] = endTagInTableBody; _[IN_TABLE_BODY_MODE][Tokenizer.EOF_TOKEN] = eofInBody; _[IN_ROW_MODE] = Object.create(null); _[IN_ROW_MODE][Tokenizer.CHARACTER_TOKEN] = _[IN_ROW_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = _[IN_ROW_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = characterInTable; _[IN_ROW_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; _[IN_ROW_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; _[IN_ROW_MODE][Tokenizer.START_TAG_TOKEN] = startTagInRow; _[IN_ROW_MODE][Tokenizer.END_TAG_TOKEN] = endTagInRow; _[IN_ROW_MODE][Tokenizer.EOF_TOKEN] = eofInBody; _[IN_CELL_MODE] = Object.create(null); _[IN_CELL_MODE][Tokenizer.CHARACTER_TOKEN] = characterInBody; _[IN_CELL_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; _[IN_CELL_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody; _[IN_CELL_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; _[IN_CELL_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; _[IN_CELL_MODE][Tokenizer.START_TAG_TOKEN] = startTagInCell; _[IN_CELL_MODE][Tokenizer.END_TAG_TOKEN] = endTagInCell; _[IN_CELL_MODE][Tokenizer.EOF_TOKEN] = eofInBody; _[IN_SELECT_MODE] = Object.create(null); _[IN_SELECT_MODE][Tokenizer.CHARACTER_TOKEN] = insertCharacters; _[IN_SELECT_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; _[IN_SELECT_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; _[IN_SELECT_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; _[IN_SELECT_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; _[IN_SELECT_MODE][Tokenizer.START_TAG_TOKEN] = startTagInSelect; _[IN_SELECT_MODE][Tokenizer.END_TAG_TOKEN] = endTagInSelect; _[IN_SELECT_MODE][Tokenizer.EOF_TOKEN] = eofInBody; _[IN_SELECT_IN_TABLE_MODE] = Object.create(null); _[IN_SELECT_IN_TABLE_MODE][Tokenizer.CHARACTER_TOKEN] = insertCharacters; _[IN_SELECT_IN_TABLE_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; _[IN_SELECT_IN_TABLE_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; _[IN_SELECT_IN_TABLE_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; _[IN_SELECT_IN_TABLE_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; _[IN_SELECT_IN_TABLE_MODE][Tokenizer.START_TAG_TOKEN] = startTagInSelectInTable; _[IN_SELECT_IN_TABLE_MODE][Tokenizer.END_TAG_TOKEN] = endTagInSelectInTable; _[IN_SELECT_IN_TABLE_MODE][Tokenizer.EOF_TOKEN] = eofInBody; _[IN_TEMPLATE_MODE] = Object.create(null); _[IN_TEMPLATE_MODE][Tokenizer.CHARACTER_TOKEN] = characterInBody; _[IN_TEMPLATE_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; _[IN_TEMPLATE_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody; _[IN_TEMPLATE_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; _[IN_TEMPLATE_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; _[IN_TEMPLATE_MODE][Tokenizer.START_TAG_TOKEN] = startTagInTemplate; _[IN_TEMPLATE_MODE][Tokenizer.END_TAG_TOKEN] = endTagInTemplate; _[IN_TEMPLATE_MODE][Tokenizer.EOF_TOKEN] = eofInTemplate; _[AFTER_BODY_MODE] = Object.create(null); _[AFTER_BODY_MODE][Tokenizer.CHARACTER_TOKEN] = _[AFTER_BODY_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenAfterBody; _[AFTER_BODY_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody; _[AFTER_BODY_MODE][Tokenizer.COMMENT_TOKEN] = appendCommentToRootHtmlElement; _[AFTER_BODY_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; _[AFTER_BODY_MODE][Tokenizer.START_TAG_TOKEN] = startTagAfterBody; _[AFTER_BODY_MODE][Tokenizer.END_TAG_TOKEN] = endTagAfterBody; _[AFTER_BODY_MODE][Tokenizer.EOF_TOKEN] = stopParsing; _[IN_FRAMESET_MODE] = Object.create(null); _[IN_FRAMESET_MODE][Tokenizer.CHARACTER_TOKEN] = _[IN_FRAMESET_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; _[IN_FRAMESET_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; _[IN_FRAMESET_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; _[IN_FRAMESET_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; _[IN_FRAMESET_MODE][Tokenizer.START_TAG_TOKEN] = startTagInFrameset; _[IN_FRAMESET_MODE][Tokenizer.END_TAG_TOKEN] = endTagInFrameset; _[IN_FRAMESET_MODE][Tokenizer.EOF_TOKEN] = stopParsing; _[AFTER_FRAMESET_MODE] = Object.create(null); _[AFTER_FRAMESET_MODE][Tokenizer.CHARACTER_TOKEN] = _[AFTER_FRAMESET_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; _[AFTER_FRAMESET_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; _[AFTER_FRAMESET_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; _[AFTER_FRAMESET_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; _[AFTER_FRAMESET_MODE][Tokenizer.START_TAG_TOKEN] = startTagAfterFrameset; _[AFTER_FRAMESET_MODE][Tokenizer.END_TAG_TOKEN] = endTagAfterFrameset; _[AFTER_FRAMESET_MODE][Tokenizer.EOF_TOKEN] = stopParsing; _[AFTER_AFTER_BODY_MODE] = Object.create(null); _[AFTER_AFTER_BODY_MODE][Tokenizer.CHARACTER_TOKEN] = tokenAfterAfterBody; _[AFTER_AFTER_BODY_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenAfterAfterBody; _[AFTER_AFTER_BODY_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody; _[AFTER_AFTER_BODY_MODE][Tokenizer.COMMENT_TOKEN] = appendCommentToDocument; _[AFTER_AFTER_BODY_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; _[AFTER_AFTER_BODY_MODE][Tokenizer.START_TAG_TOKEN] = startTagAfterAfterBody; _[AFTER_AFTER_BODY_MODE][Tokenizer.END_TAG_TOKEN] = tokenAfterAfterBody; _[AFTER_AFTER_BODY_MODE][Tokenizer.EOF_TOKEN] = stopParsing; _[AFTER_AFTER_FRAMESET_MODE] = Object.create(null); _[AFTER_AFTER_FRAMESET_MODE][Tokenizer.CHARACTER_TOKEN] = _[AFTER_AFTER_FRAMESET_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; _[AFTER_AFTER_FRAMESET_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody; _[AFTER_AFTER_FRAMESET_MODE][Tokenizer.COMMENT_TOKEN] = appendCommentToDocument; _[AFTER_AFTER_FRAMESET_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; _[AFTER_AFTER_FRAMESET_MODE][Tokenizer.START_TAG_TOKEN] = startTagAfterAfterFrameset; _[AFTER_AFTER_FRAMESET_MODE][Tokenizer.END_TAG_TOKEN] = ignoreToken; _[AFTER_AFTER_FRAMESET_MODE][Tokenizer.EOF_TOKEN] = stopParsing; //Parser var Parser = module.exports = function (options) { this.options = mergeOptions(DEFAULT_OPTIONS, options); this.treeAdapter = this.options.treeAdapter; this.pendingScript = null; if (this.options.locationInfo) new LocationInfoParserMixin(this); }; // API Parser.prototype.parse = function (html) { var document = this.treeAdapter.createDocument(); this._bootstrap(document, null); this.tokenizer.write(html, true); this._runParsingLoop(null); return document; }; Parser.prototype.parseFragment = function (html, fragmentContext) { //NOTE: use <template> element as a fragment context if context element was not provided, //so we will parse in "forgiving" manner if (!fragmentContext) fragmentContext = this.treeAdapter.createElement($.TEMPLATE, NS.HTML, []); //NOTE: create fake element which will be used as 'document' for fragment parsing. //This is important for jsdom there 'document' can't be recreated, therefore //fragment parsing causes messing of the main `document`. var documentMock = this.treeAdapter.createElement('documentmock', NS.HTML, []); this._bootstrap(documentMock, fragmentContext); if (this.treeAdapter.getTagName(fragmentContext) === $.TEMPLATE) this._pushTmplInsertionMode(IN_TEMPLATE_MODE); this._initTokenizerForFragmentParsing(); this._insertFakeRootElement(); this._resetInsertionMode(); this._findFormInFragmentContext(); this.tokenizer.write(html, true); this._runParsingLoop(null); var rootElement = this.treeAdapter.getFirstChild(documentMock), fragment = this.treeAdapter.createDocumentFragment(); this._adoptNodes(rootElement, fragment); return fragment; }; //Bootstrap parser Parser.prototype._bootstrap = function (document, fragmentContext) { this.tokenizer = new Tokenizer(this.options); this.stopped = false; this.insertionMode = INITIAL_MODE; this.originalInsertionMode = ''; this.document = document; this.fragmentContext = fragmentContext; this.headElement = null; this.formElement = null; this.openElements = new OpenElementStack(this.document, this.treeAdapter); this.activeFormattingElements = new FormattingElementList(this.treeAdapter); this.tmplInsertionModeStack = []; this.tmplInsertionModeStackTop = -1; this.currentTmplInsertionMode = null; this.pendingCharacterTokens = []; this.hasNonWhitespacePendingCharacterToken = false; this.framesetOk = true; this.skipNextNewLine = false; this.fosterParentingEnabled = false; }; //Parsing loop Parser.prototype._runParsingLoop = function (scriptHandler) { while (!this.stopped) { this._setupTokenizerCDATAMode(); var token = this.tokenizer.getNextToken(); if (token.type === Tokenizer.HIBERNATION_TOKEN) break; if (this.skipNextNewLine) { this.skipNextNewLine = false; if (token.type === Tokenizer.WHITESPACE_CHARACTER_TOKEN && token.chars[0] === '\n') { if (token.chars.length === 1) continue; token.chars = token.chars.substr(1); } } this._processInputToken(token); if (scriptHandler && this.pendingScript) break; } }; Parser.prototype.runParsingLoopForCurrentChunk = function (writeCallback, scriptHandler) { this._runParsingLoop(scriptHandler); if (scriptHandler && this.pendingScript) { var script = this.pendingScript; this.pendingScript = null; scriptHandler(script); return; } if (writeCallback) writeCallback(); }; //Text parsing Parser.prototype._setupTokenizerCDATAMode = function () { var current = this._getAdjustedCurrentElement(); this.tokenizer.allowCDATA = current && current !== this.document && this.treeAdapter.getNamespaceURI(current) !== NS.HTML && !this._isIntegrationPoint(current); }; Parser.prototype._switchToTextParsing = function (currentToken, nextTokenizerState) { this._insertElement(currentToken, NS.HTML); this.tokenizer.state = nextTokenizerState; this.originalInsertionMode = this.insertionMode; this.insertionMode = TEXT_MODE; }; Parser.prototype.switchToPlaintextParsing = function () { this.insertionMode = TEXT_MODE; this.originalInsertionMode = IN_BODY_MODE; this.tokenizer.state = Tokenizer.MODE.PLAINTEXT; }; //Fragment parsing Parser.prototype._getAdjustedCurrentElement = function () { return this.openElements.stackTop === 0 && this.fragmentContext ? this.fragmentContext : this.openElements.current; }; Parser.prototype._findFormInFragmentContext = function () { var node = this.fragmentContext; do { if (this.treeAdapter.getTagName(node) === $.FORM) { this.formElement = node; break; } node = this.treeAdapter.getParentNode(node); } while (node); }; Parser.prototype._initTokenizerForFragmentParsing = function () { if (this.treeAdapter.getNamespaceURI(this.fragmentContext) === NS.HTML) { var tn = this.treeAdapter.getTagName(this.fragmentContext); if (tn === $.TITLE || tn === $.TEXTAREA) this.tokenizer.state = Tokenizer.MODE.RCDATA; else if (tn === $.STYLE || tn === $.XMP || tn === $.IFRAME || tn === $.NOEMBED || tn === $.NOFRAMES || tn === $.NOSCRIPT) this.tokenizer.state = Tokenizer.MODE.RAWTEXT; else if (tn === $.SCRIPT) this.tokenizer.state = Tokenizer.MODE.SCRIPT_DATA; else if (tn === $.PLAINTEXT) this.tokenizer.state = Tokenizer.MODE.PLAINTEXT; } }; //Tree mutation Parser.prototype._setDocumentType = function (token) { this.treeAdapter.setDocumentType(this.document, token.name, token.publicId, token.systemId); }; Parser.prototype._attachElementToTree = function (element) { if (this._shouldFosterParentOnInsertion()) this._fosterParentElement(element); else { var parent = this.openElements.currentTmplContent || this.openElements.current; this.treeAdapter.appendChild(parent, element); } }; Parser.prototype._appendElement = function (token, namespaceURI) { var element = this.treeAdapter.createElement(token.tagName, namespaceURI, token.attrs); this._attachElementToTree(element); }; Parser.prototype._insertElement = function (token, namespaceURI) { var element = this.treeAdapter.createElement(token.tagName, namespaceURI, token.attrs); this._attachElementToTree(element); this.openElements.push(element); }; Parser.prototype._insertFakeElement = function (tagName) { var element = this.treeAdapter.createElement(tagName, NS.HTML, []); this._attachElementToTree(element); this.openElements.push(element); }; Parser.prototype._insertTemplate = function (token) { var tmpl = this.treeAdapter.createElement(token.tagName, NS.HTML, token.attrs), content = this.treeAdapter.createDocumentFragment(); this.treeAdapter.setTemplateContent(tmpl, content); this._attachElementToTree(tmpl); this.openElements.push(tmpl); }; Parser.prototype._insertFakeRootElement = function () { var element = this.treeAdapter.createElement($.HTML, NS.HTML, []); this.treeAdapter.appendChild(this.openElements.current, element); this.openElements.push(element); }; Parser.prototype._appendCommentNode = function (token, parent) { var commentNode = this.treeAdapter.createCommentNode(token.data); this.treeAdapter.appendChild(parent, commentNode); }; Parser.prototype._insertCharacters = function (token) { if (this._shouldFosterParentOnInsertion()) this._fosterParentText(token.chars); else { var parent = this.openElements.currentTmplContent || this.openElements.current; this.treeAdapter.insertText(parent, token.chars); } }; Parser.prototype._adoptNodes = function (donor, recipient) { while (true) { var child = this.treeAdapter.getFirstChild(donor); if (!child) break; this.treeAdapter.detachNode(child); this.treeAdapter.appendChild(recipient, child); } }; //Token processing Parser.prototype._shouldProcessTokenInForeignContent = function (token) { var current = this._getAdjustedCurrentElement(); if (!current || current === this.document) return false; var ns = this.treeAdapter.getNamespaceURI(current); if (ns === NS.HTML) return false; if (this.treeAdapter.getTagName(current) === $.ANNOTATION_XML && ns === NS.MATHML && token.type === Tokenizer.START_TAG_TOKEN && token.tagName === $.SVG) return false; var isCharacterToken = token.type === Tokenizer.CHARACTER_TOKEN || token.type === Tokenizer.NULL_CHARACTER_TOKEN || token.type === Tokenizer.WHITESPACE_CHARACTER_TOKEN, isMathMLTextStartTag = token.type === Tokenizer.START_TAG_TOKEN && token.tagName !== $.MGLYPH && token.tagName !== $.MALIGNMARK; if ((isMathMLTextStartTag || isCharacterToken) && this._isIntegrationPoint(current, NS.MATHML)) return false; if ((token.type === Tokenizer.START_TAG_TOKEN || isCharacterToken) && this._isIntegrationPoint(current, NS.HTML)) return false; return token.type !== Tokenizer.EOF_TOKEN; }; Parser.prototype._processToken = function (token) { _[this.insertionMode][token.type](this, token); }; Parser.prototype._processTokenInBodyMode = function (token) { _[IN_BODY_MODE][token.type](this, token); }; Parser.prototype._processTokenInForeignContent = function (token) { if (token.type === Tokenizer.CHARACTER_TOKEN) characterInForeignContent(this, token); else if (token.type === Tokenizer.NULL_CHARACTER_TOKEN) nullCharacterInForeignContent(this, token); else if (token.type === Tokenizer.WHITESPACE_CHARACTER_TOKEN) insertCharacters(this, token); else if (token.type === Tokenizer.COMMENT_TOKEN) appendComment(this, token); else if (token.type === Tokenizer.START_TAG_TOKEN) startTagInForeignContent(this, token); else if (token.type === Tokenizer.END_TAG_TOKEN) endTagInForeignContent(this, token); }; Parser.prototype._processInputToken = function (token) { if (this._shouldProcessTokenInForeignContent(token)) this._processTokenInForeignContent(token); else this._processToken(token); }; //Integration points Parser.prototype._isIntegrationPoint = function (element, foreignNS) { var tn = this.treeAdapter.getTagName(element), ns = this.treeAdapter.getNamespaceURI(element), attrs = this.treeAdapter.getAttrList(element); return foreignContent.isIntegrationPoint(tn, ns, attrs, foreignNS); }; //Active formatting elements reconstruction Parser.prototype._reconstructActiveFormattingElements = function () { var listLength = this.activeFormattingElements.length; if (listLength) { var unopenIdx = listLength, entry = null; do { unopenIdx--; entry = this.activeFormattingElements.entries[unopenIdx]; if (entry.type === FormattingElementList.MARKER_ENTRY || this.openElements.contains(entry.element)) { unopenIdx++; break; } } while (unopenIdx > 0); for (var i = unopenIdx; i < listLength; i++) { entry = this.activeFormattingElements.entries[i]; this._insertElement(entry.token, this.treeAdapter.getNamespaceURI(entry.element)); entry.element = this.openElements.current; } } }; //Close elements Parser.prototype._closeTableCell = function () { this.openElements.generateImpliedEndTags(); this.openElements.popUntilTableCellPopped(); this.activeFormattingElements.clearToLastMarker(); this.insertionMode = IN_ROW_MODE; }; Parser.prototype._closePElement = function () { this.openElements.generateImpliedEndTagsWithExclusion($.P); this.openElements.popUntilTagNamePopped($.P); }; //Insertion modes Parser.prototype._resetInsertionMode = function () { for (var i = this.openElements.stackTop, last = false; i >= 0; i--) { var element = this.openElements.items[i]; if (i === 0) { last = true; if (this.fragmentContext) element = this.fragmentContext; } var tn = this.treeAdapter.getTagName(element), newInsertionMode = INSERTION_MODE_RESET_MAP[tn]; if (newInsertionMode) { this.insertionMode = newInsertionMode; break; } else if (!last && (tn === $.TD || tn === $.TH)) { this.insertionMode = IN_CELL_MODE; break; } else if (!last && tn === $.HEAD) { this.insertionMode = IN_HEAD_MODE; break; } else if (tn === $.SELECT) { this._resetInsertionModeForSelect(i); break; } else if (tn === $.TEMPLATE) { this.insertionMode = this.currentTmplInsertionMode; break; } else if (tn === $.HTML) { this.insertionMode = this.headElement ? AFTER_HEAD_MODE : BEFORE_HEAD_MODE; break; } else if (last) { this.insertionMode = IN_BODY_MODE; break; } } }; Parser.prototype._resetInsertionModeForSelect = function (selectIdx) { if (selectIdx > 0) { for (var i = selectIdx - 1; i > 0; i--) { var ancestor = this.openElements.items[i], tn = this.treeAdapter.getTagName(ancestor); if (tn === $.TEMPLATE) break; else if (tn === $.TABLE) { this.insertionMode = IN_SELECT_IN_TABLE_MODE; return; } } } this.insertionMode = IN_SELECT_MODE; }; Parser.prototype._pushTmplInsertionMode = function (mode) { this.tmplInsertionModeStack.push(mode); this.tmplInsertionModeStackTop++; this.currentTmplInsertionMode = mode; }; Parser.prototype._popTmplInsertionMode = function () { this.tmplInsertionModeStack.pop(); this.tmplInsertionModeStackTop--; this.currentTmplInsertionMode = this.tmplInsertionModeStack[this.tmplInsertionModeStackTop]; }; //Foster parenting Parser.prototype._isElementCausesFosterParenting = function (element) { var tn = this.treeAdapter.getTagName(element); return tn === $.TABLE || tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD || tn === $.TR; }; Parser.prototype._shouldFosterParentOnInsertion = function () { return this.fosterParentingEnabled && this._isElementCausesFosterParenting(this.openElements.current); }; Parser.prototype._findFosterParentingLocation = function () { var location = { parent: null, beforeElement: null }; for (var i = this.openElements.stackTop; i >= 0; i--) { var openElement = this.openElements.items[i], tn = this.treeAdapter.getTagName(openElement), ns = this.treeAdapter.getNamespaceURI(openElement); if (tn === $.TEMPLATE && ns === NS.HTML) { location.parent = this.treeAdapter.getTemplateContent(openElement); break; } else if (tn === $.TABLE) { location.parent = this.treeAdapter.getParentNode(openElement); if (location.parent) location.beforeElement = openElement; else location.parent = this.openElements.items[i - 1]; break; } } if (!location.parent) location.parent = this.openElements.items[0]; return location; }; Parser.prototype._fosterParentElement = function (element) { var location = this._findFosterParentingLocation(); if (location.beforeElement) this.treeAdapter.insertBefore(location.parent, element, location.beforeElement); else this.treeAdapter.appendChild(location.parent, element); }; Parser.prototype._fosterParentText = function (chars) { var location = this._findFosterParentingLocation(); if (location.beforeElement) this.treeAdapter.insertTextBefore(location.parent, chars, location.beforeElement); else this.treeAdapter.insertText(location.parent, chars); }; //Special elements Parser.prototype._isSpecialElement = function (element) { var tn = this.treeAdapter.getTagName(element), ns = this.treeAdapter.getNamespaceURI(element); return HTML.SPECIAL_ELEMENTS[ns][tn]; }; //Adoption agency algorithm //(see: http://www.whatwg.org/specs/web-apps/current-work/multipage/tree-construction.html#adoptionAgency) //------------------------------------------------------------------ //Steps 5-8 of the algorithm function aaObtainFormattingElementEntry(p, token) { var formattingElementEntry = p.activeFormattingElements.getElementEntryInScopeWithTagName(token.tagName); if (formattingElementEntry) { if (!p.openElements.contains(formattingElementEntry.element)) { p.activeFormattingElements.removeEntry(formattingElementEntry); formattingElementEntry = null; } else if (!p.openElements.hasInScope(token.tagName)) formattingElementEntry = null; } else genericEndTagInBody(p, token); return formattingElementEntry; } //Steps 9 and 10 of the algorithm function aaObtainFurthestBlock(p, formattingElementEntry) { var furthestBlock = null; for (var i = p.openElements.stackTop; i >= 0; i--) { var element = p.openElements.items[i]; if (element === formattingElementEntry.element) break; if (p._isSpecialElement(element)) furthestBlock = element; } if (!furthestBlock) { p.openElements.popUntilElementPopped(formattingElementEntry.element); p.activeFormattingElements.removeEntry(formattingElementEntry); } return furthestBlock; } //Step 13 of the algorithm function aaInnerLoop(p, furthestBlock, formattingElement) { var lastElement = furthestBlock, nextElement = p.openElements.getCommonAncestor(furthestBlock); for (var i = 0, element = nextElement; element !== formattingElement; i++, element = nextElement) { //NOTE: store next element for the next loop iteration (it may be deleted from the stack by step 9.5) nextElement = p.openElements.getCommonAncestor(element); var elementEntry = p.activeFormattingElements.getElementEntry(element), counterOverflow = elementEntry && i >= AA_INNER_LOOP_ITER, shouldRemoveFromOpenElements = !elementEntry || counterOverflow; if (shouldRemoveFromOpenElements) { if (counterOverflow) p.activeFormattingElements.removeEntry(elementEntry); p.openElements.remove(element); } else { element = aaRecreateElementFromEntry(p, elementEntry); if (lastElement === furthestBlock) p.activeFormattingElements.bookmark = elementEntry; p.treeAdapter.detachNode(lastElement); p.treeAdapter.appendChild(element, lastElement); lastElement = element; } } return lastElement; } //Step 13.7 of the algorithm function aaRecreateElementFromEntry(p, elementEntry) { var ns = p.treeAdapter.getNamespaceURI(elementEntry.element), newElement = p.treeAdapter.createElement(elementEntry.token.tagName, ns, elementEntry.token.attrs); p.openElements.replace(elementEntry.element, newElement); elementEntry.element = newElement; return newElement; } //Step 14 of the algorithm function aaInsertLastNodeInCommonAncestor(p, commonAncestor, lastElement) { if (p._isElementCausesFosterParenting(commonAncestor)) p._fosterParentElement(lastElement); else { var tn = p.treeAdapter.getTagName(commonAncestor), ns = p.treeAdapter.getNamespaceURI(commonAncestor); if (tn === $.TEMPLATE && ns === NS.HTML) commonAncestor = p.treeAdapter.getTemplateContent(commonAncestor); p.treeAdapter.appendChild(commonAncestor, lastElement); } } //Steps 15-19 of the algorithm function aaReplaceFormattingElement(p, furthestBlock, formattingElementEntry) { var ns = p.treeAdapter.getNamespaceURI(formattingElementEntry.element), token = formattingElementEntry.token, newElement = p.treeAdapter.createElement(token.tagName, ns, token.attrs); p._adoptNodes(furthestBlock, newElement); p.treeAdapter.appendChild(furthestBlock, newElement); p.activeFormattingElements.insertElementAfterBookmark(newElement, formattingElementEntry.token); p.activeFormattingElements.removeEntry(formattingElementEntry); p.openElements.remove(formattingElementEntry.element); p.openElements.insertAfter(furthestBlock, newElement); } //Algorithm entry point function callAdoptionAgency(p, token) { var formattingElementEntry; for (var i = 0; i < AA_OUTER_LOOP_ITER; i++) { formattingElementEntry = aaObtainFormattingElementEntry(p, token, formattingElementEntry); if (!formattingElementEntry) break; var furthestBlock = aaObtainFurthestBlock(p, formattingElementEntry); if (!furthestBlock) break; p.activeFormattingElements.bookmark = formattingElementEntry; var lastElement = aaInnerLoop(p, furthestBlock, formattingElementEntry.element), commonAncestor = p.openElements.getCommonAncestor(formattingElementEntry.element); p.treeAdapter.detachNode(lastElement); aaInsertLastNodeInCommonAncestor(p, commonAncestor, lastElement); aaReplaceFormattingElement(p, furthestBlock, formattingElementEntry); } } //Generic token handlers //------------------------------------------------------------------ function ignoreToken() { //NOTE: do nothing =) } function appendComment(p, token) { p._appendCommentNode(token, p.openElements.currentTmplContent || p.openElements.current); } function appendCommentToRootHtmlElement(p, token) { p._appendCommentNode(token, p.openElements.items[0]); } function appendCommentToDocument(p, token) { p._appendCommentNode(token, p.document); } function insertCharacters(p, token) { p._insertCharacters(token); } function stopParsing(p) { p.stopped = true; } //12.2.5.4.1 The "initial" insertion mode //------------------------------------------------------------------ function doctypeInInitialMode(p, token) { p._setDocumentType(token); var mode = token.forceQuirks ? HTML.DOCUMENT_MODE.QUIRKS : doctype.getDocumentMode(token.name, token.publicId, token.systemId); p.treeAdapter.setDocumentMode(p.document, mode); p.insertionMode = BEFORE_HTML_MODE; } function tokenInInitialMode(p, token) { p.treeAdapter.setDocumentMode(p.document, HTML.DOCUMENT_MODE.QUIRKS); p.insertionMode = BEFORE_HTML_MODE; p._processToken(token); } //12.2.5.4.2 The "before html" insertion mode //------------------------------------------------------------------ function startTagBeforeHtml(p, token) { if (token.tagName === $.HTML) { p._insertElement(token, NS.HTML); p.insertionMode = BEFORE_HEAD_MODE; } else tokenBeforeHtml(p, token); } function endTagBeforeHtml(p, token) { var tn = token.tagName; if (tn === $.HTML || tn === $.HEAD || tn === $.BODY || tn === $.BR) tokenBeforeHtml(p, token); } function tokenBeforeHtml(p, token) { p._insertFakeRootElement(); p.insertionMode = BEFORE_HEAD_MODE; p._processToken(token); } //12.2.5.4.3 The "before head" insertion mode //------------------------------------------------------------------ function startTagBeforeHead(p, token) { var tn = token.tagName; if (tn === $.HTML) startTagInBody(p, token); else if (tn === $.HEAD) { p._insertElement(token, NS.HTML); p.headElement = p.openElements.current; p.insertionMode = IN_HEAD_MODE; } else tokenBeforeHead(p, token); } function endTagBeforeHead(p, token) { var tn = token.tagName; if (tn === $.HEAD || tn === $.BODY || tn === $.HTML || tn === $.BR) tokenBeforeHead(p, token); } function tokenBeforeHead(p, token) { p._insertFakeElement($.HEAD); p.headElement = p.openElements.current; p.insertionMode = IN_HEAD_MODE; p._processToken(token); } //12.2.5.4.4 The "in head" insertion mode //------------------------------------------------------------------ function startTagInHead(p, token) { var tn = token.tagName; if (tn === $.HTML) startTagInBody(p, token); else if (tn === $.BASE || tn === $.BASEFONT || tn === $.BGSOUND || tn === $.LINK || tn === $.META) p._appendElement(token, NS.HTML); else if (tn === $.TITLE) p._switchToTextParsing(token, Tokenizer.MODE.RCDATA); //NOTE: here we assume that we always act as an interactive user agent with enabled scripting, so we parse //<noscript> as a rawtext. else if (tn === $.NOSCRIPT || tn === $.NOFRAMES || tn === $.STYLE) p._switchToTextParsing(token, Tokenizer.MODE.RAWTEXT); else if (tn === $.SCRIPT) p._switchToTextParsing(token, Tokenizer.MODE.SCRIPT_DATA); else if (tn === $.TEMPLATE) { p._insertTemplate(token, NS.HTML); p.activeFormattingElements.insertMarker(); p.framesetOk = false; p.insertionMode = IN_TEMPLATE_MODE; p._pushTmplInsertionMode(IN_TEMPLATE_MODE); } else if (tn !== $.HEAD) tokenInHead(p, token); } function endTagInHead(p, token) { var tn = token.tagName; if (tn === $.HEAD) { p.openElements.pop(); p.insertionMode = AFTER_HEAD_MODE; } else if (tn === $.BODY || tn === $.BR || tn === $.HTML) tokenInHead(p, token); else if (tn === $.TEMPLATE && p.openElements.tmplCount > 0) { p.openElements.generateImpliedEndTags(); p.openElements.popUntilTagNamePopped($.TEMPLATE); p.activeFormattingElements.clearToLastMarker(); p._popTmplInsertionMode(); p._resetInsertionMode(); } } function tokenInHead(p, token) { p.openElements.pop(); p.insertionMode = AFTER_HEAD_MODE; p._processToken(token); } //12.2.5.4.6 The "after head" insertion mode //------------------------------------------------------------------ function startTagAfterHead(p, token) { var tn = token.tagName; if (tn === $.HTML) startTagInBody(p, token); else if (tn === $.BODY) { p._insertElement(token, NS.HTML); p.framesetOk = false; p.insertionMode = IN_BODY_MODE; } else if (tn === $.FRAMESET) { p._insertElement(token, NS.HTML); p.insertionMode = IN_FRAMESET_MODE; } else if (tn === $.BASE || tn === $.BASEFONT || tn === $.BGSOUND || tn === $.LINK || tn === $.META || tn === $.NOFRAMES || tn === $.SCRIPT || tn === $.STYLE || tn === $.TEMPLATE || tn === $.TITLE) { p.openElements.push(p.headElement); startTagInHead(p, token); p.openElements.remove(p.headElement); } else if (tn !== $.HEAD) tokenAfterHead(p, token); } function endTagAfterHead(p, token) { var tn = token.tagName; if (tn === $.BODY || tn === $.HTML || tn === $.BR) tokenAfterHead(p, token); else if (tn === $.TEMPLATE) endTagInHead(p, token); } function tokenAfterHead(p, token) { p._insertFakeElement($.BODY); p.insertionMode = IN_BODY_MODE; p._processToken(token); } //12.2.5.4.7 The "in body" insertion mode //------------------------------------------------------------------ function whitespaceCharacterInBody(p, token) { p._reconstructActiveFormattingElements(); p._insertCharacters(token); } function characterInBody(p, token) { p._reconstructActiveFormattingElements(); p._insertCharacters(token); p.framesetOk = false; } function htmlStartTagInBody(p, token) { if (p.openElements.tmplCount === 0) p.treeAdapter.adoptAttributes(p.openElements.items[0], token.attrs); } function bodyStartTagInBody(p, token) { var bodyElement = p.openElements.tryPeekProperlyNestedBodyElement(); if (bodyElement && p.openElements.tmplCount === 0) { p.framesetOk = false; p.treeAdapter.adoptAttributes(bodyElement, token.attrs); } } function framesetStartTagInBody(p, token) { var bodyElement = p.openElements.tryPeekProperlyNestedBodyElement(); if (p.framesetOk && bodyElement) { p.treeAdapter.detachNode(bodyElement); p.openElements.popAllUpToHtmlElement(); p._insertElement(token, NS.HTML); p.insertionMode = IN_FRAMESET_MODE; } } function addressStartTagInBody(p, token) { if (p.openElements.hasInButtonScope($.P)) p._closePElement(); p._insertElement(token, NS.HTML); } function numberedHeaderStartTagInBody(p, token) { if (p.openElements.hasInButtonScope($.P)) p._closePElement(); var tn = p.openElements.currentTagName; if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6) p.openElements.pop(); p._insertElement(token, NS.HTML); } function preStartTagInBody(p, token) { if (p.openElements.hasInButtonScope($.P)) p._closePElement(); p._insertElement(token, NS.HTML); //NOTE: If the next token is a U+000A LINE FEED (LF) character token, then ignore that token and move //on to the next one. (Newlines at the start of pre blocks are ignored as an authoring convenience.) p.skipNextNewLine = true; p.framesetOk = false; } function formStartTagInBody(p, token) { var inTemplate = p.openElements.tmplCount > 0; if (!p.formElement || inTemplate) { if (p.openElements.hasInButtonScope($.P)) p._closePElement(); p._insertElement(token, NS.HTML); if (!inTemplate) p.formElement = p.openElements.current; } } function listItemStartTagInBody(p, token) { p.framesetOk = false; var tn = token.tagName; for (var i = p.openElements.stackTop; i >= 0; i--) { var element = p.openElements.items[i], elementTn = p.treeAdapter.getTagName(element), closeTn = null; if (tn === $.LI && elementTn === $.LI) closeTn = $.LI; else if ((tn === $.DD || tn === $.DT) && (elementTn === $.DD || elementTn === $.DT)) closeTn = elementTn; if (closeTn) { p.openElements.generateImpliedEndTagsWithExclusion(closeTn); p.openElements.popUntilTagNamePopped(closeTn); break; } if (elementTn !== $.ADDRESS && elementTn !== $.DIV && elementTn !== $.P && p._isSpecialElement(element)) break; } if (p.openElements.hasInButtonScope($.P)) p._closePElement(); p._insertElement(token, NS.HTML); } function plaintextStartTagInBody(p, token) { if (p.openElements.hasInButtonScope($.P)) p._closePElement(); p._insertElement(token, NS.HTML); p.tokenizer.state = Tokenizer.MODE.PLAINTEXT; } function buttonStartTagInBody(p, token) { if (p.openElements.hasInScope($.BUTTON)) { p.openElements.generateImpliedEndTags(); p.openElements.popUntilTagNamePopped($.BUTTON); } p._reconstructActiveFormattingElements(); p._insertElement(token, NS.HTML); p.framesetOk = false; } function aStartTagInBody(p, token) { var activeElementEntry = p.activeFormattingElements.getElementEntryInScopeWithTagName($.A); if (activeElementEntry) { callAdoptionAgency(p, token); p.openElements.remove(activeElementEntry.element); p.activeFormattingElements.removeEntry(activeElementEntry); } p._reconstructActiveFormattingElements(); p._insertElement(token, NS.HTML); p.activeFormattingElements.pushElement(p.openElements.current, token); } function bStartTagInBody(p, token) { p._reconstructActiveFormattingElements(); p._insertElement(token, NS.HTML); p.activeFormattingElements.pushElement(p.openElements.current, token); } function nobrStartTagInBody(p, token) { p._reconstructActiveFormattingElements(); if (p.openElements.hasInScope($.NOBR)) { callAdoptionAgency(p, token); p._reconstructActiveFormattingElements(); } p._insertElement(token, NS.HTML); p.activeFormattingElements.pushElement(p.openElements.current, token); } function appletStartTagInBody(p, token) { p._reconstructActiveFormattingElements(); p._insertElement(token, NS.HTML); p.activeFormattingElements.insertMarker(); p.framesetOk = false; } function tableStartTagInBody(p, token) { if (p.treeAdapter.getDocumentMode(p.document) !== HTML.DOCUMENT_MODE.QUIRKS && p.openElements.hasInButtonScope($.P)) p._closePElement(); p._insertElement(token, NS.HTML); p.framesetOk = false; p.insertionMode = IN_TABLE_MODE; } function areaStartTagInBody(p, token) { p._reconstructActiveFormattingElements(); p._appendElement(token, NS.HTML); p.framesetOk = false; } function inputStartTagInBody(p, token) { p._reconstructActiveFormattingElements(); p._appendElement(token, NS.HTML); var inputType = Tokenizer.getTokenAttr(token, ATTRS.TYPE); if (!inputType || inputType.toLowerCase() !== HIDDEN_INPUT_TYPE) p.framesetOk = false; } function paramStartTagInBody(p, token) { p._appendElement(token, NS.HTML); } function hrStartTagInBody(p, token) { if (p.openElements.hasInButtonScope($.P)) p._closePElement(); if (p.openElements.currentTagName === $.MENUITEM) p.openElements.pop(); p._appendElement(token, NS.HTML); p.framesetOk = false; } function imageStartTagInBody(p, token) { token.tagName = $.IMG; areaStartTagInBody(p, token); } function textareaStartTagInBody(p, token) { p._insertElement(token, NS.HTML); //NOTE: If the next token is a U+000A LINE FEED (LF) character token, then ignore that token and move //on to the next one. (Newlines at the start of textarea elements are ignored as an authoring convenience.) p.skipNextNewLine = true; p.tokenizer.state = Tokenizer.MODE.RCDATA; p.originalInsertionMode = p.insertionMode; p.framesetOk = false; p.insertionMode = TEXT_MODE; } function xmpStartTagInBody(p, token) { if (p.openElements.hasInButtonScope($.P)) p._closePElement(); p._reconstructActiveFormattingElements(); p.framesetOk = false; p._switchToTextParsing(token, Tokenizer.MODE.RAWTEXT); } function iframeStartTagInBody(p, token) { p.framesetOk = false; p._switchToTextParsing(token, Tokenizer.MODE.RAWTEXT); } //NOTE: here we assume that we always act as an user agent with enabled plugins, so we parse //<noembed> as a rawtext. function noembedStartTagInBody(p, token) { p._switchToTextParsing(token, Tokenizer.MODE.RAWTEXT); } function selectStartTagInBody(p, token) { p._reconstructActiveFormattingElements(); p._insertElement(token, NS.HTML); p.framesetOk = false; if (p.insertionMode === IN_TABLE_MODE || p.insertionMode === IN_CAPTION_MODE || p.insertionMode === IN_TABLE_BODY_MODE || p.insertionMode === IN_ROW_MODE || p.insertionMode === IN_CELL_MODE) p.insertionMode = IN_SELECT_IN_TABLE_MODE; else p.insertionMode = IN_SELECT_MODE; } function optgroupStartTagInBody(p, token) { if (p.openElements.currentTagName === $.OPTION) p.openElements.pop(); p._reconstructActiveFormattingElements(); p._insertElement(token, NS.HTML); } function rbStartTagInBody(p, token) { if (p.openElements.hasInScope($.RUBY)) p.openElements.generateImpliedEndTags(); p._insertElement(token, NS.HTML); } function rtStartTagInBody(p, token) { if (p.openElements.hasInScope($.RUBY)) p.openElements.generateImpliedEndTagsWithExclusion($.RTC); p._insertElement(token, NS.HTML); } function menuitemStartTagInBody(p, token) { if (p.openElements.currentTagName === $.MENUITEM) p.openElements.pop(); // TODO needs clarification, see https://github.com/whatwg/html/pull/907/files#r73505877 p._reconstructActiveFormattingElements(); p._insertElement(token, NS.HTML); } function menuStartTagInBody(p, token) { if (p.openElements.hasInButtonScope($.P)) p._closePElement(); if (p.openElements.currentTagName === $.MENUITEM) p.openElements.pop(); p._insertElement(token, NS.HTML); } function mathStartTagInBody(p, token) { p._reconstructActiveFormattingElements(); foreignContent.adjustTokenMathMLAttrs(token); foreignContent.adjustTokenXMLAttrs(token); if (token.selfClosing) p._appendElement(token, NS.MATHML); else p._insertElement(token, NS.MATHML); } function svgStartTagInBody(p, token) { p._reconstructActiveFormattingElements(); foreignContent.adjustTokenSVGAttrs(token); foreignContent.adjustTokenXMLAttrs(token); if (token.selfClosing) p._appendElement(token, NS.SVG); else p._insertElement(token, NS.SVG); } function genericStartTagInBody(p, token) { p._reconstructActiveFormattingElements(); p._insertElement(token, NS.HTML); } //OPTIMIZATION: Integer comparisons are low-cost, so we can use very fast tag name length filters here. //It's faster than using dictionary. function startTagInBody(p, token) { var tn = token.tagName; switch (tn.length) { case 1: if (tn === $.I || tn === $.S || tn === $.B || tn === $.U) bStartTagInBody(p, token); else if (tn === $.P) addressStartTagInBody(p, token); else if (tn === $.A) aStartTagInBody(p, token); else genericStartTagInBody(p, token); break; case 2: if (tn === $.DL || tn === $.OL || tn === $.UL) addressStartTagInBody(p, token); else if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6) numberedHeaderStartTagInBody(p, token); else if (tn === $.LI || tn === $.DD || tn === $.DT) listItemStartTagInBody(p, token); else if (tn === $.EM || tn === $.TT) bStartTagInBody(p, token); else if (tn === $.BR) areaStartTagInBody(p, token); else if (tn === $.HR) hrStartTagInBody(p, token); else if (tn === $.RB) rbStartTagInBody(p, token); else if (tn === $.RT || tn === $.RP) rtStartTagInBody(p, token); else if (tn !== $.TH && tn !== $.TD && tn !== $.TR) genericStartTagInBody(p, token); break; case 3: if (tn === $.DIV || tn === $.DIR || tn === $.NAV) addressStartTagInBody(p, token); else if (tn === $.PRE) preStartTagInBody(p, token); else if (tn === $.BIG) bStartTagInBody(p, token); else if (tn === $.IMG || tn === $.WBR) areaStartTagInBody(p, token); else if (tn === $.XMP) xmpStartTagInBody(p, token); else if (tn === $.SVG) svgStartTagInBody(p, token); else if (tn === $.RTC) rbStartTagInBody(p, token); else if (tn !== $.COL) genericStartTagInBody(p, token); break; case 4: if (tn === $.HTML) htmlStartTagInBody(p, token); else if (tn === $.BASE || tn === $.LINK || tn === $.META) startTagInHead(p, token); else if (tn === $.BODY) bodyStartTagInBody(p, token); else if (tn === $.MAIN) addressStartTagInBody(p, token); else if (tn === $.FORM) formStartTagInBody(p, token); else if (tn === $.CODE || tn === $.FONT) bStartTagInBody(p, token); else if (tn === $.NOBR) nobrStartTagInBody(p, token); else if (tn === $.AREA) areaStartTagInBody(p, token); else if (tn === $.MATH) mathStartTagInBody(p, token); else if (tn === $.MENU) menuStartTagInBody(p, token); else if (tn !== $.HEAD) genericStartTagInBody(p, token); break; case 5: if (tn === $.STYLE || tn === $.TITLE) startTagInHead(p, token); else if (tn === $.ASIDE) addressStartTagInBody(p, token); else if (tn === $.SMALL) bStartTagInBody(p, token); else if (tn === $.TABLE) tableStartTagInBody(p, token); else if (tn === $.EMBED) areaStartTagInBody(p, token); else if (tn === $.INPUT) inputStartTagInBody(p, token); else if (tn === $.PARAM || tn === $.TRACK) paramStartTagInBody(p, token); else if (tn === $.IMAGE) imageStartTagInBody(p, token); else if (tn !== $.FRAME && tn !== $.TBODY && tn !== $.TFOOT && tn !== $.THEAD) genericStartTagInBody(p, token); break; case 6: if (tn === $.SCRIPT) startTagInHead(p, token); else if (tn === $.CENTER || tn === $.FIGURE || tn === $.FOOTER || tn === $.HEADER || tn === $.HGROUP) addressStartTagInBody(p, token); else if (tn === $.BUTTON) buttonStartTagInBody(p, token); else if (tn === $.STRIKE || tn === $.STRONG) bStartTagInBody(p, token); else if (tn === $.APPLET || tn === $.OBJECT) appletStartTagInBody(p, token); else if (tn === $.KEYGEN) areaStartTagInBody(p, token); else if (tn === $.SOURCE) paramStartTagInBody(p, token); else if (tn === $.IFRAME) iframeStartTagInBody(p, token); else if (tn === $.SELECT) selectStartTagInBody(p, token); else if (tn === $.OPTION) optgroupStartTagInBody(p, token); else genericStartTagInBody(p, token); break; case 7: if (tn === $.BGSOUND) startTagInHead(p, token); else if (tn === $.DETAILS || tn === $.ADDRESS || tn === $.ARTICLE || tn === $.SECTION || tn === $.SUMMARY) addressStartTagInBody(p, token); else if (tn === $.LISTING) preStartTagInBody(p, token); else if (tn === $.MARQUEE) appletStartTagInBody(p, token); else if (tn === $.NOEMBED) noembedStartTagInBody(p, token); else if (tn !== $.CAPTION) genericStartTagInBody(p, token); break; case 8: if (tn === $.BASEFONT) startTagInHead(p, token); else if (tn === $.MENUITEM) menuitemStartTagInBody(p, token); else if (tn === $.FRAMESET) framesetStartTagInBody(p, token); else if (tn === $.FIELDSET) addressStartTagInBody(p, token); else if (tn === $.TEXTAREA) textareaStartTagInBody(p, token); else if (tn === $.TEMPLATE) startTagInHead(p, token); else if (tn === $.NOSCRIPT) noembedStartTagInBody(p, token); else if (tn === $.OPTGROUP) optgroupStartTagInBody(p, token); else if (tn !== $.COLGROUP) genericStartTagInBody(p, token); break; case 9: if (tn === $.PLAINTEXT) plaintextStartTagInBody(p, token); else genericStartTagInBody(p, token); break; case 10: if (tn === $.BLOCKQUOTE || tn === $.FIGCAPTION) addressStartTagInBody(p, token); else genericStartTagInBody(p, token); break; default: genericStartTagInBody(p, token); } } function bodyEndTagInBody(p) { if (p.openElements.hasInScope($.BODY)) p.insertionMode = AFTER_BODY_MODE; } function htmlEndTagInBody(p, token) { if (p.openElements.hasInScope($.BODY)) { p.insertionMode = AFTER_BODY_MODE; p._processToken(token); } } function addressEndTagInBody(p, token) { var tn = token.tagName; if (p.openElements.hasInScope(tn)) { p.openElements.generateImpliedEndTags(); p.openElements.popUntilTagNamePopped(tn); } } function formEndTagInBody(p) { var inTemplate = p.openElements.tmplCount > 0, formElement = p.formElement; if (!inTemplate) p.formElement = null; if ((formElement || inTemplate) && p.openElements.hasInScope($.FORM)) { p.openElements.generateImpliedEndTags(); if (inTemplate) p.openElements.popUntilTagNamePopped($.FORM); else p.openElements.remove(formElement); } } function pEndTagInBody(p) { if (!p.openElements.hasInButtonScope($.P)) p._insertFakeElement($.P); p._closePElement(); } function liEndTagInBody(p) { if (p.openElements.hasInListItemScope($.LI)) { p.openElements.generateImpliedEndTagsWithExclusion($.LI); p.openElements.popUntilTagNamePopped($.LI); } } function ddEndTagInBody(p, token) { var tn = token.tagName; if (p.openElements.hasInScope(tn)) { p.openElements.generateImpliedEndTagsWithExclusion(tn); p.openElements.popUntilTagNamePopped(tn); } } function numberedHeaderEndTagInBody(p) { if (p.openElements.hasNumberedHeaderInScope()) { p.openElements.generateImpliedEndTags(); p.openElements.popUntilNumberedHeaderPopped(); } } function appletEndTagInBody(p, token) { var tn = token.tagName; if (p.openElements.hasInScope(tn)) { p.openElements.generateImpliedEndTags(); p.openElements.popUntilTagNamePopped(tn); p.activeFormattingElements.clearToLastMarker(); } } function brEndTagInBody(p) { p._reconstructActiveFormattingElements(); p._insertFakeElement($.BR); p.openElements.pop(); p.framesetOk = false; } function genericEndTagInBody(p, token) { var tn = token.tagName; for (var i = p.openElements.stackTop; i > 0; i--) { var element = p.openElements.items[i]; if (p.treeAdapter.getTagName(element) === tn) { p.openElements.generateImpliedEndTagsWithExclusion(tn); p.openElements.popUntilElementPopped(element); break; } if (p._isSpecialElement(element)) break; } } //OPTIMIZATION: Integer comparisons are low-cost, so we can use very fast tag name length filters here. //It's faster than using dictionary. function endTagInBody(p, token) { var tn = token.tagName; switch (tn.length) { case 1: if (tn === $.A || tn === $.B || tn === $.I || tn === $.S || tn === $.U) callAdoptionAgency(p, token); else if (tn === $.P) pEndTagInBody(p, token); else genericEndTagInBody(p, token); break; case 2: if (tn === $.DL || tn === $.UL || tn === $.OL) addressEndTagInBody(p, token); else if (tn === $.LI) liEndTagInBody(p, token); else if (tn === $.DD || tn === $.DT) ddEndTagInBody(p, token); else if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6) numberedHeaderEndTagInBody(p, token); else if (tn === $.BR) brEndTagInBody(p, token); else if (tn === $.EM || tn === $.TT) callAdoptionAgency(p, token); else genericEndTagInBody(p, token); break; case 3: if (tn === $.BIG) callAdoptionAgency(p, token); else if (tn === $.DIR || tn === $.DIV || tn === $.NAV) addressEndTagInBody(p, token); else genericEndTagInBody(p, token); break; case 4: if (tn === $.BODY) bodyEndTagInBody(p, token); else if (tn === $.HTML) htmlEndTagInBody(p, token); else if (tn === $.FORM) formEndTagInBody(p, token); else if (tn === $.CODE || tn === $.FONT || tn === $.NOBR) callAdoptionAgency(p, token); else if (tn === $.MAIN || tn === $.MENU) addressEndTagInBody(p, token); else genericEndTagInBody(p, token); break; case 5: if (tn === $.ASIDE) addressEndTagInBody(p, token); else if (tn === $.SMALL) callAdoptionAgency(p, token); else genericEndTagInBody(p, token); break; case 6: if (tn === $.CENTER || tn === $.FIGURE || tn === $.FOOTER || tn === $.HEADER || tn === $.HGROUP) addressEndTagInBody(p, token); else if (tn === $.APPLET || tn === $.OBJECT) appletEndTagInBody(p, token); else if (tn === $.STRIKE || tn === $.STRONG) callAdoptionAgency(p, token); else genericEndTagInBody(p, token); break; case 7: if (tn === $.ADDRESS || tn === $.ARTICLE || tn === $.DETAILS || tn === $.SECTION || tn === $.SUMMARY) addressEndTagInBody(p, token); else if (tn === $.MARQUEE) appletEndTagInBody(p, token); else genericEndTagInBody(p, token); break; case 8: if (tn === $.FIELDSET) addressEndTagInBody(p, token); else if (tn === $.TEMPLATE) endTagInHead(p, token); else genericEndTagInBody(p, token); break; case 10: if (tn === $.BLOCKQUOTE || tn === $.FIGCAPTION) addressEndTagInBody(p, token); else genericEndTagInBody(p, token); break; default : genericEndTagInBody(p, token); } } function eofInBody(p, token) { if (p.tmplInsertionModeStackTop > -1) eofInTemplate(p, token); else p.stopped = true; } //12.2.5.4.8 The "text" insertion mode //------------------------------------------------------------------ function endTagInText(p, token) { if (token.tagName === $.SCRIPT) p.pendingScript = p.openElements.current; p.openElements.pop(); p.insertionMode = p.originalInsertionMode; } function eofInText(p, token) { p.openElements.pop(); p.insertionMode = p.originalInsertionMode; p._processToken(token); } //12.2.5.4.9 The "in table" insertion mode //------------------------------------------------------------------ function characterInTable(p, token) { var curTn = p.openElements.currentTagName; if (curTn === $.TABLE || curTn === $.TBODY || curTn === $.TFOOT || curTn === $.THEAD || curTn === $.TR) { p.pendingCharacterTokens = []; p.hasNonWhitespacePendingCharacterToken = false; p.originalInsertionMode = p.insertionMode; p.insertionMode = IN_TABLE_TEXT_MODE; p._processToken(token); } else tokenInTable(p, token); } function captionStartTagInTable(p, token) { p.openElements.clearBackToTableContext(); p.activeFormattingElements.insertMarker(); p._insertElement(token, NS.HTML); p.insertionMode = IN_CAPTION_MODE; } function colgroupStartTagInTable(p, token) { p.openElements.clearBackToTableContext(); p._insertElement(token, NS.HTML); p.insertionMode = IN_COLUMN_GROUP_MODE; } function colStartTagInTable(p, token) { p.openElements.clearBackToTableContext(); p._insertFakeElement($.COLGROUP); p.insertionMode = IN_COLUMN_GROUP_MODE; p._processToken(token); } function tbodyStartTagInTable(p, token) { p.openElements.clearBackToTableContext(); p._insertElement(token, NS.HTML); p.insertionMode = IN_TABLE_BODY_MODE; } function tdStartTagInTable(p, token) { p.openElements.clearBackToTableContext(); p._insertFakeElement($.TBODY); p.insertionMode = IN_TABLE_BODY_MODE; p._processToken(token); } function tableStartTagInTable(p, token) { if (p.openElements.hasInTableScope($.TABLE)) { p.openElements.popUntilTagNamePopped($.TABLE); p._resetInsertionMode(); p._processToken(token); } } function inputStartTagInTable(p, token) { var inputType = Tokenizer.getTokenAttr(token, ATTRS.TYPE); if (inputType && inputType.toLowerCase() === HIDDEN_INPUT_TYPE) p._appendElement(token, NS.HTML); else tokenInTable(p, token); } function formStartTagInTable(p, token) { if (!p.formElement && p.openElements.tmplCount === 0) { p._insertElement(token, NS.HTML); p.formElement = p.openElements.current; p.openElements.pop(); } } function startTagInTable(p, token) { var tn = token.tagName; switch (tn.length) { case 2: if (tn === $.TD || tn === $.TH || tn === $.TR) tdStartTagInTable(p, token); else tokenInTable(p, token); break; case 3: if (tn === $.COL) colStartTagInTable(p, token); else tokenInTable(p, token); break; case 4: if (tn === $.FORM) formStartTagInTable(p, token); else tokenInTable(p, token); break; case 5: if (tn === $.TABLE) tableStartTagInTable(p, token); else if (tn === $.STYLE) startTagInHead(p, token); else if (tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD) tbodyStartTagInTable(p, token); else if (tn === $.INPUT) inputStartTagInTable(p, token); else tokenInTable(p, token); break; case 6: if (tn === $.SCRIPT) startTagInHead(p, token); else tokenInTable(p, token); break; case 7: if (tn === $.CAPTION) captionStartTagInTable(p, token); else tokenInTable(p, token); break; case 8: if (tn === $.COLGROUP) colgroupStartTagInTable(p, token); else if (tn === $.TEMPLATE) startTagInHead(p, token); else tokenInTable(p, token); break; default: tokenInTable(p, token); } } function endTagInTable(p, token) { var tn = token.tagName; if (tn === $.TABLE) { if (p.openElements.hasInTableScope($.TABLE)) { p.openElements.popUntilTagNamePopped($.TABLE); p._resetInsertionMode(); } } else if (tn === $.TEMPLATE) endTagInHead(p, token); else if (tn !== $.BODY && tn !== $.CAPTION && tn !== $.COL && tn !== $.COLGROUP && tn !== $.HTML && tn !== $.TBODY && tn !== $.TD && tn !== $.TFOOT && tn !== $.TH && tn !== $.THEAD && tn !== $.TR) tokenInTable(p, token); } function tokenInTable(p, token) { var savedFosterParentingState = p.fosterParentingEnabled; p.fosterParentingEnabled = true; p._processTokenInBodyMode(token); p.fosterParentingEnabled = savedFosterParentingState; } //12.2.5.4.10 The "in table text" insertion mode //------------------------------------------------------------------ function whitespaceCharacterInTableText(p, token) { p.pendingCharacterTokens.push(token); } function characterInTableText(p, token) { p.pendingCharacterTokens.push(token); p.hasNonWhitespacePendingCharacterToken = true; } function tokenInTableText(p, token) { var i = 0; if (p.hasNonWhitespacePendingCharacterToken) { for (; i < p.pendingCharacterTokens.length; i++) tokenInTable(p, p.pendingCharacterTokens[i]); } else { for (; i < p.pendingCharacterTokens.length; i++) p._insertCharacters(p.pendingCharacterTokens[i]); } p.insertionMode = p.originalInsertionMode; p._processToken(token); } //12.2.5.4.11 The "in caption" insertion mode //------------------------------------------------------------------ function startTagInCaption(p, token) { var tn = token.tagName; if (tn === $.CAPTION || tn === $.COL || tn === $.COLGROUP || tn === $.TBODY || tn === $.TD || tn === $.TFOOT || tn === $.TH || tn === $.THEAD || tn === $.TR) { if (p.openElements.hasInTableScope($.CAPTION)) { p.openElements.generateImpliedEndTags(); p.openElements.popUntilTagNamePopped($.CAPTION); p.activeFormattingElements.clearToLastMarker(); p.insertionMode = IN_TABLE_MODE; p._processToken(token); } } else startTagInBody(p, token); } function endTagInCaption(p, token) { var tn = token.tagName; if (tn === $.CAPTION || tn === $.TABLE) { if (p.openElements.hasInTableScope($.CAPTION)) { p.openElements.generateImpliedEndTags(); p.openElements.popUntilTagNamePopped($.CAPTION); p.activeFormattingElements.clearToLastMarker(); p.insertionMode = IN_TABLE_MODE; if (tn === $.TABLE) p._processToken(token); } } else if (tn !== $.BODY && tn !== $.COL && tn !== $.COLGROUP && tn !== $.HTML && tn !== $.TBODY && tn !== $.TD && tn !== $.TFOOT && tn !== $.TH && tn !== $.THEAD && tn !== $.TR) endTagInBody(p, token); } //12.2.5.4.12 The "in column group" insertion mode //------------------------------------------------------------------ function startTagInColumnGroup(p, token) { var tn = token.tagName; if (tn === $.HTML) startTagInBody(p, token); else if (tn === $.COL) p._appendElement(token, NS.HTML); else if (tn === $.TEMPLATE) startTagInHead(p, token); else tokenInColumnGroup(p, token); } function endTagInColumnGroup(p, token) { var tn = token.tagName; if (tn === $.COLGROUP) { if (p.openElements.currentTagName === $.COLGROUP) { p.openElements.pop(); p.insertionMode = IN_TABLE_MODE; } } else if (tn === $.TEMPLATE) endTagInHead(p, token); else if (tn !== $.COL) tokenInColumnGroup(p, token); } function tokenInColumnGroup(p, token) { if (p.openElements.currentTagName === $.COLGROUP) { p.openElements.pop(); p.insertionMode = IN_TABLE_MODE; p._processToken(token); } } //12.2.5.4.13 The "in table body" insertion mode //------------------------------------------------------------------ function startTagInTableBody(p, token) { var tn = token.tagName; if (tn === $.TR) { p.openElements.clearBackToTableBodyContext(); p._insertElement(token, NS.HTML); p.insertionMode = IN_ROW_MODE; } else if (tn === $.TH || tn === $.TD) { p.openElements.clearBackToTableBodyContext(); p._insertFakeElement($.TR); p.insertionMode = IN_ROW_MODE; p._processToken(token); } else if (tn === $.CAPTION || tn === $.COL || tn === $.COLGROUP || tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD) { if (p.openElements.hasTableBodyContextInTableScope()) { p.openElements.clearBackToTableBodyContext(); p.openElements.pop(); p.insertionMode = IN_TABLE_MODE; p._processToken(token); } } else startTagInTable(p, token); } function endTagInTableBody(p, token) { var tn = token.tagName; if (tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD) { if (p.openElements.hasInTableScope(tn)) { p.openElements.clearBackToTableBodyContext(); p.openElements.pop(); p.insertionMode = IN_TABLE_MODE; } } else if (tn === $.TABLE) { if (p.openElements.hasTableBodyContextInTableScope()) { p.openElements.clearBackToTableBodyContext(); p.openElements.pop(); p.insertionMode = IN_TABLE_MODE; p._processToken(token); } } else if (tn !== $.BODY && tn !== $.CAPTION && tn !== $.COL && tn !== $.COLGROUP || tn !== $.HTML && tn !== $.TD && tn !== $.TH && tn !== $.TR) endTagInTable(p, token); } //12.2.5.4.14 The "in row" insertion mode //------------------------------------------------------------------ function startTagInRow(p, token) { var tn = token.tagName; if (tn === $.TH || tn === $.TD) { p.openElements.clearBackToTableRowContext(); p._insertElement(token, NS.HTML); p.insertionMode = IN_CELL_MODE; p.activeFormattingElements.insertMarker(); } else if (tn === $.CAPTION || tn === $.COL || tn === $.COLGROUP || tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD || tn === $.TR) { if (p.openElements.hasInTableScope($.TR)) { p.openElements.clearBackToTableRowContext(); p.openElements.pop(); p.insertionMode = IN_TABLE_BODY_MODE; p._processToken(token); } } else startTagInTable(p, token); } function endTagInRow(p, token) { var tn = token.tagName; if (tn === $.TR) { if (p.openElements.hasInTableScope($.TR)) { p.openElements.clearBackToTableRowContext(); p.openElements.pop(); p.insertionMode = IN_TABLE_BODY_MODE; } } else if (tn === $.TABLE) { if (p.openElements.hasInTableScope($.TR)) { p.openElements.clearBackToTableRowContext(); p.openElements.pop(); p.insertionMode = IN_TABLE_BODY_MODE; p._processToken(token); } } else if (tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD) { if (p.openElements.hasInTableScope(tn) || p.openElements.hasInTableScope($.TR)) { p.openElements.clearBackToTableRowContext(); p.openElements.pop(); p.insertionMode = IN_TABLE_BODY_MODE; p._processToken(token); } } else if (tn !== $.BODY && tn !== $.CAPTION && tn !== $.COL && tn !== $.COLGROUP || tn !== $.HTML && tn !== $.TD && tn !== $.TH) endTagInTable(p, token); } //12.2.5.4.15 The "in cell" insertion mode //------------------------------------------------------------------ function startTagInCell(p, token) { var tn = token.tagName; if (tn === $.CAPTION || tn === $.COL || tn === $.COLGROUP || tn === $.TBODY || tn === $.TD || tn === $.TFOOT || tn === $.TH || tn === $.THEAD || tn === $.TR) { if (p.openElements.hasInTableScope($.TD) || p.openElements.hasInTableScope($.TH)) { p._closeTableCell(); p._processToken(token); } } else startTagInBody(p, token); } function endTagInCell(p, token) { var tn = token.tagName; if (tn === $.TD || tn === $.TH) { if (p.openElements.hasInTableScope(tn)) { p.openElements.generateImpliedEndTags(); p.openElements.popUntilTagNamePopped(tn); p.activeFormattingElements.clearToLastMarker(); p.insertionMode = IN_ROW_MODE; } } else if (tn === $.TABLE || tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD || tn === $.TR) { if (p.openElements.hasInTableScope(tn)) { p._closeTableCell(); p._processToken(token); } } else if (tn !== $.BODY && tn !== $.CAPTION && tn !== $.COL && tn !== $.COLGROUP && tn !== $.HTML) endTagInBody(p, token); } //12.2.5.4.16 The "in select" insertion mode //------------------------------------------------------------------ function startTagInSelect(p, token) { var tn = token.tagName; if (tn === $.HTML) startTagInBody(p, token); else if (tn === $.OPTION) { if (p.openElements.currentTagName === $.OPTION) p.openElements.pop(); p._insertElement(token, NS.HTML); } else if (tn === $.OPTGROUP) { if (p.openElements.currentTagName === $.OPTION) p.openElements.pop(); if (p.openElements.currentTagName === $.OPTGROUP) p.openElements.pop(); p._insertElement(token, NS.HTML); } else if (tn === $.INPUT || tn === $.KEYGEN || tn === $.TEXTAREA || tn === $.SELECT) { if (p.openElements.hasInSelectScope($.SELECT)) { p.openElements.popUntilTagNamePopped($.SELECT); p._resetInsertionMode(); if (tn !== $.SELECT) p._processToken(token); } } else if (tn === $.SCRIPT || tn === $.TEMPLATE) startTagInHead(p, token); } function endTagInSelect(p, token) { var tn = token.tagName; if (tn === $.OPTGROUP) { var prevOpenElement = p.openElements.items[p.openElements.stackTop - 1], prevOpenElementTn = prevOpenElement && p.treeAdapter.getTagName(prevOpenElement); if (p.openElements.currentTagName === $.OPTION && prevOpenElementTn === $.OPTGROUP) p.openElements.pop(); if (p.openElements.currentTagName === $.OPTGROUP) p.openElements.pop(); } else if (tn === $.OPTION) { if (p.openElements.currentTagName === $.OPTION) p.openElements.pop(); } else if (tn === $.SELECT && p.openElements.hasInSelectScope($.SELECT)) { p.openElements.popUntilTagNamePopped($.SELECT); p._resetInsertionMode(); } else if (tn === $.TEMPLATE) endTagInHead(p, token); } //12.2.5.4.17 The "in select in table" insertion mode //------------------------------------------------------------------ function startTagInSelectInTable(p, token) { var tn = token.tagName; if (tn === $.CAPTION || tn === $.TABLE || tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD || tn === $.TR || tn === $.TD || tn === $.TH) { p.openElements.popUntilTagNamePopped($.SELECT); p._resetInsertionMode(); p._processToken(token); } else startTagInSelect(p, token); } function endTagInSelectInTable(p, token) { var tn = token.tagName; if (tn === $.CAPTION || tn === $.TABLE || tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD || tn === $.TR || tn === $.TD || tn === $.TH) { if (p.openElements.hasInTableScope(tn)) { p.openElements.popUntilTagNamePopped($.SELECT); p._resetInsertionMode(); p._processToken(token); } } else endTagInSelect(p, token); } //12.2.5.4.18 The "in template" insertion mode //------------------------------------------------------------------ function startTagInTemplate(p, token) { var tn = token.tagName; if (tn === $.BASE || tn === $.BASEFONT || tn === $.BGSOUND || tn === $.LINK || tn === $.META || tn === $.NOFRAMES || tn === $.SCRIPT || tn === $.STYLE || tn === $.TEMPLATE || tn === $.TITLE) startTagInHead(p, token); else { var newInsertionMode = TEMPLATE_INSERTION_MODE_SWITCH_MAP[tn] || IN_BODY_MODE; p._popTmplInsertionMode(); p._pushTmplInsertionMode(newInsertionMode); p.insertionMode = newInsertionMode; p._processToken(token); } } function endTagInTemplate(p, token) { if (token.tagName === $.TEMPLATE) endTagInHead(p, token); } function eofInTemplate(p, token) { if (p.openElements.tmplCount > 0) { p.openElements.popUntilTagNamePopped($.TEMPLATE); p.activeFormattingElements.clearToLastMarker(); p._popTmplInsertionMode(); p._resetInsertionMode(); p._processToken(token); } else p.stopped = true; } //12.2.5.4.19 The "after body" insertion mode //------------------------------------------------------------------ function startTagAfterBody(p, token) { if (token.tagName === $.HTML) startTagInBody(p, token); else tokenAfterBody(p, token); } function endTagAfterBody(p, token) { if (token.tagName === $.HTML) { if (!p.fragmentContext) p.insertionMode = AFTER_AFTER_BODY_MODE; } else tokenAfterBody(p, token); } function tokenAfterBody(p, token) { p.insertionMode = IN_BODY_MODE; p._processToken(token); } //12.2.5.4.20 The "in frameset" insertion mode //------------------------------------------------------------------ function startTagInFrameset(p, token) { var tn = token.tagName; if (tn === $.HTML) startTagInBody(p, token); else if (tn === $.FRAMESET) p._insertElement(token, NS.HTML); else if (tn === $.FRAME) p._appendElement(token, NS.HTML); else if (tn === $.NOFRAMES) startTagInHead(p, token); } function endTagInFrameset(p, token) { if (token.tagName === $.FRAMESET && !p.openElements.isRootHtmlElementCurrent()) { p.openElements.pop(); if (!p.fragmentContext && p.openElements.currentTagName !== $.FRAMESET) p.insertionMode = AFTER_FRAMESET_MODE; } } //12.2.5.4.21 The "after frameset" insertion mode //------------------------------------------------------------------ function startTagAfterFrameset(p, token) { var tn = token.tagName; if (tn === $.HTML) startTagInBody(p, token); else if (tn === $.NOFRAMES) startTagInHead(p, token); } function endTagAfterFrameset(p, token) { if (token.tagName === $.HTML) p.insertionMode = AFTER_AFTER_FRAMESET_MODE; } //12.2.5.4.22 The "after after body" insertion mode //------------------------------------------------------------------ function startTagAfterAfterBody(p, token) { if (token.tagName === $.HTML) startTagInBody(p, token); else tokenAfterAfterBody(p, token); } function tokenAfterAfterBody(p, token) { p.insertionMode = IN_BODY_MODE; p._processToken(token); } //12.2.5.4.23 The "after after frameset" insertion mode //------------------------------------------------------------------ function startTagAfterAfterFrameset(p, token) { var tn = token.tagName; if (tn === $.HTML) startTagInBody(p, token); else if (tn === $.NOFRAMES) startTagInHead(p, token); } //12.2.5.5 The rules for parsing tokens in foreign content //------------------------------------------------------------------ function nullCharacterInForeignContent(p, token) { token.chars = UNICODE.REPLACEMENT_CHARACTER; p._insertCharacters(token); } function characterInForeignContent(p, token) { p._insertCharacters(token); p.framesetOk = false; } function startTagInForeignContent(p, token) { if (foreignContent.causesExit(token) && !p.fragmentContext) { while (p.treeAdapter.getNamespaceURI(p.openElements.current) !== NS.HTML && !p._isIntegrationPoint(p.openElements.current)) p.openElements.pop(); p._processToken(token); } else { var current = p._getAdjustedCurrentElement(), currentNs = p.treeAdapter.getNamespaceURI(current); if (currentNs === NS.MATHML) foreignContent.adjustTokenMathMLAttrs(token); else if (currentNs === NS.SVG) { foreignContent.adjustTokenSVGTagName(token); foreignContent.adjustTokenSVGAttrs(token); } foreignContent.adjustTokenXMLAttrs(token); if (token.selfClosing) p._appendElement(token, currentNs); else p._insertElement(token, currentNs); } } function endTagInForeignContent(p, token) { for (var i = p.openElements.stackTop; i > 0; i--) { var element = p.openElements.items[i]; if (p.treeAdapter.getNamespaceURI(element) === NS.HTML) { p._processToken(token); break; } if (p.treeAdapter.getTagName(element).toLowerCase() === token.tagName) { p.openElements.popUntilElementPopped(element); break; } } } /***/ }), /* 339 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Preprocessor = __webpack_require__(340), UNICODE = __webpack_require__(341), neTree = __webpack_require__(342); //Aliases var $ = UNICODE.CODE_POINTS, $$ = UNICODE.CODE_POINT_SEQUENCES; //Replacement code points for numeric entities var NUMERIC_ENTITY_REPLACEMENTS = { 0x00: 0xFFFD, 0x0D: 0x000D, 0x80: 0x20AC, 0x81: 0x0081, 0x82: 0x201A, 0x83: 0x0192, 0x84: 0x201E, 0x85: 0x2026, 0x86: 0x2020, 0x87: 0x2021, 0x88: 0x02C6, 0x89: 0x2030, 0x8A: 0x0160, 0x8B: 0x2039, 0x8C: 0x0152, 0x8D: 0x008D, 0x8E: 0x017D, 0x8F: 0x008F, 0x90: 0x0090, 0x91: 0x2018, 0x92: 0x2019, 0x93: 0x201C, 0x94: 0x201D, 0x95: 0x2022, 0x96: 0x2013, 0x97: 0x2014, 0x98: 0x02DC, 0x99: 0x2122, 0x9A: 0x0161, 0x9B: 0x203A, 0x9C: 0x0153, 0x9D: 0x009D, 0x9E: 0x017E, 0x9F: 0x0178 }; // Named entity tree flags var HAS_DATA_FLAG = 1 << 0; var DATA_DUPLET_FLAG = 1 << 1; var HAS_BRANCHES_FLAG = 1 << 2; var MAX_BRANCH_MARKER_VALUE = HAS_DATA_FLAG | DATA_DUPLET_FLAG | HAS_BRANCHES_FLAG; //States var DATA_STATE = 'DATA_STATE', CHARACTER_REFERENCE_IN_DATA_STATE = 'CHARACTER_REFERENCE_IN_DATA_STATE', RCDATA_STATE = 'RCDATA_STATE', CHARACTER_REFERENCE_IN_RCDATA_STATE = 'CHARACTER_REFERENCE_IN_RCDATA_STATE', RAWTEXT_STATE = 'RAWTEXT_STATE', SCRIPT_DATA_STATE = 'SCRIPT_DATA_STATE', PLAINTEXT_STATE = 'PLAINTEXT_STATE', TAG_OPEN_STATE = 'TAG_OPEN_STATE', END_TAG_OPEN_STATE = 'END_TAG_OPEN_STATE', TAG_NAME_STATE = 'TAG_NAME_STATE', RCDATA_LESS_THAN_SIGN_STATE = 'RCDATA_LESS_THAN_SIGN_STATE', RCDATA_END_TAG_OPEN_STATE = 'RCDATA_END_TAG_OPEN_STATE', RCDATA_END_TAG_NAME_STATE = 'RCDATA_END_TAG_NAME_STATE', RAWTEXT_LESS_THAN_SIGN_STATE = 'RAWTEXT_LESS_THAN_SIGN_STATE', RAWTEXT_END_TAG_OPEN_STATE = 'RAWTEXT_END_TAG_OPEN_STATE', RAWTEXT_END_TAG_NAME_STATE = 'RAWTEXT_END_TAG_NAME_STATE', SCRIPT_DATA_LESS_THAN_SIGN_STATE = 'SCRIPT_DATA_LESS_THAN_SIGN_STATE', SCRIPT_DATA_END_TAG_OPEN_STATE = 'SCRIPT_DATA_END_TAG_OPEN_STATE', SCRIPT_DATA_END_TAG_NAME_STATE = 'SCRIPT_DATA_END_TAG_NAME_STATE', SCRIPT_DATA_ESCAPE_START_STATE = 'SCRIPT_DATA_ESCAPE_START_STATE', SCRIPT_DATA_ESCAPE_START_DASH_STATE = 'SCRIPT_DATA_ESCAPE_START_DASH_STATE', SCRIPT_DATA_ESCAPED_STATE = 'SCRIPT_DATA_ESCAPED_STATE', SCRIPT_DATA_ESCAPED_DASH_STATE = 'SCRIPT_DATA_ESCAPED_DASH_STATE', SCRIPT_DATA_ESCAPED_DASH_DASH_STATE = 'SCRIPT_DATA_ESCAPED_DASH_DASH_STATE', SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE = 'SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE', SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE = 'SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE', SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE = 'SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE', SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE = 'SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE', SCRIPT_DATA_DOUBLE_ESCAPED_STATE = 'SCRIPT_DATA_DOUBLE_ESCAPED_STATE', SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE = 'SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE', SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE = 'SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE', SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE = 'SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE', SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE = 'SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE', BEFORE_ATTRIBUTE_NAME_STATE = 'BEFORE_ATTRIBUTE_NAME_STATE', ATTRIBUTE_NAME_STATE = 'ATTRIBUTE_NAME_STATE', AFTER_ATTRIBUTE_NAME_STATE = 'AFTER_ATTRIBUTE_NAME_STATE', BEFORE_ATTRIBUTE_VALUE_STATE = 'BEFORE_ATTRIBUTE_VALUE_STATE', ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE = 'ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE', ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE = 'ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE', ATTRIBUTE_VALUE_UNQUOTED_STATE = 'ATTRIBUTE_VALUE_UNQUOTED_STATE', CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE = 'CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE', AFTER_ATTRIBUTE_VALUE_QUOTED_STATE = 'AFTER_ATTRIBUTE_VALUE_QUOTED_STATE', SELF_CLOSING_START_TAG_STATE = 'SELF_CLOSING_START_TAG_STATE', BOGUS_COMMENT_STATE = 'BOGUS_COMMENT_STATE', BOGUS_COMMENT_STATE_CONTINUATION = 'BOGUS_COMMENT_STATE_CONTINUATION', MARKUP_DECLARATION_OPEN_STATE = 'MARKUP_DECLARATION_OPEN_STATE', COMMENT_START_STATE = 'COMMENT_START_STATE', COMMENT_START_DASH_STATE = 'COMMENT_START_DASH_STATE', COMMENT_STATE = 'COMMENT_STATE', COMMENT_END_DASH_STATE = 'COMMENT_END_DASH_STATE', COMMENT_END_STATE = 'COMMENT_END_STATE', COMMENT_END_BANG_STATE = 'COMMENT_END_BANG_STATE', DOCTYPE_STATE = 'DOCTYPE_STATE', DOCTYPE_NAME_STATE = 'DOCTYPE_NAME_STATE', AFTER_DOCTYPE_NAME_STATE = 'AFTER_DOCTYPE_NAME_STATE', BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE = 'BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE', DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE = 'DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE', DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE = 'DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE', BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE = 'BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE', BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE = 'BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE', DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE = 'DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE', DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE = 'DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE', AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE = 'AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE', BOGUS_DOCTYPE_STATE = 'BOGUS_DOCTYPE_STATE', CDATA_SECTION_STATE = 'CDATA_SECTION_STATE'; //Utils //OPTIMIZATION: these utility functions should not be moved out of this module. V8 Crankshaft will not inline //this functions if they will be situated in another module due to context switch. //Always perform inlining check before modifying this functions ('node --trace-inlining'). function isWhitespace(cp) { return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED; } function isAsciiDigit(cp) { return cp >= $.DIGIT_0 && cp <= $.DIGIT_9; } function isAsciiUpper(cp) { return cp >= $.LATIN_CAPITAL_A && cp <= $.LATIN_CAPITAL_Z; } function isAsciiLower(cp) { return cp >= $.LATIN_SMALL_A && cp <= $.LATIN_SMALL_Z; } function isAsciiLetter(cp) { return isAsciiLower(cp) || isAsciiUpper(cp); } function isAsciiAlphaNumeric(cp) { return isAsciiLetter(cp) || isAsciiDigit(cp); } function isDigit(cp, isHex) { return isAsciiDigit(cp) || isHex && (cp >= $.LATIN_CAPITAL_A && cp <= $.LATIN_CAPITAL_F || cp >= $.LATIN_SMALL_A && cp <= $.LATIN_SMALL_F); } function isReservedCodePoint(cp) { return cp >= 0xD800 && cp <= 0xDFFF || cp > 0x10FFFF; } function toAsciiLowerCodePoint(cp) { return cp + 0x0020; } //NOTE: String.fromCharCode() function can handle only characters from BMP subset. //So, we need to workaround this manually. //(see: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/fromCharCode#Getting_it_to_work_with_higher_values) function toChar(cp) { if (cp <= 0xFFFF) return String.fromCharCode(cp); cp -= 0x10000; return String.fromCharCode(cp >>> 10 & 0x3FF | 0xD800) + String.fromCharCode(0xDC00 | cp & 0x3FF); } function toAsciiLowerChar(cp) { return String.fromCharCode(toAsciiLowerCodePoint(cp)); } function findNamedEntityTreeBranch(nodeIx, cp) { var branchCount = neTree[++nodeIx], lo = ++nodeIx, hi = lo + branchCount - 1; while (lo <= hi) { var mid = lo + hi >>> 1, midCp = neTree[mid]; if (midCp < cp) lo = mid + 1; else if (midCp > cp) hi = mid - 1; else return neTree[mid + branchCount]; } return -1; } //Tokenizer var Tokenizer = module.exports = function () { this.preprocessor = new Preprocessor(); this.tokenQueue = []; this.allowCDATA = false; this.state = DATA_STATE; this.returnState = ''; this.tempBuff = []; this.additionalAllowedCp = void 0; this.lastStartTagName = ''; this.consumedAfterSnapshot = -1; this.active = false; this.currentCharacterToken = null; this.currentToken = null; this.currentAttr = null; }; //Token types Tokenizer.CHARACTER_TOKEN = 'CHARACTER_TOKEN'; Tokenizer.NULL_CHARACTER_TOKEN = 'NULL_CHARACTER_TOKEN'; Tokenizer.WHITESPACE_CHARACTER_TOKEN = 'WHITESPACE_CHARACTER_TOKEN'; Tokenizer.START_TAG_TOKEN = 'START_TAG_TOKEN'; Tokenizer.END_TAG_TOKEN = 'END_TAG_TOKEN'; Tokenizer.COMMENT_TOKEN = 'COMMENT_TOKEN'; Tokenizer.DOCTYPE_TOKEN = 'DOCTYPE_TOKEN'; Tokenizer.EOF_TOKEN = 'EOF_TOKEN'; Tokenizer.HIBERNATION_TOKEN = 'HIBERNATION_TOKEN'; //Tokenizer initial states for different modes Tokenizer.MODE = { DATA: DATA_STATE, RCDATA: RCDATA_STATE, RAWTEXT: RAWTEXT_STATE, SCRIPT_DATA: SCRIPT_DATA_STATE, PLAINTEXT: PLAINTEXT_STATE }; //Static Tokenizer.getTokenAttr = function (token, attrName) { for (var i = token.attrs.length - 1; i >= 0; i--) { if (token.attrs[i].name === attrName) return token.attrs[i].value; } return null; }; //API Tokenizer.prototype.getNextToken = function () { while (!this.tokenQueue.length && this.active) { this._hibernationSnapshot(); var cp = this._consume(); if (!this._ensureHibernation()) this[this.state](cp); } return this.tokenQueue.shift(); }; Tokenizer.prototype.write = function (chunk, isLastChunk) { this.active = true; this.preprocessor.write(chunk, isLastChunk); }; Tokenizer.prototype.insertHtmlAtCurrentPos = function (chunk) { this.active = true; this.preprocessor.insertHtmlAtCurrentPos(chunk); }; //Hibernation Tokenizer.prototype._hibernationSnapshot = function () { this.consumedAfterSnapshot = 0; }; Tokenizer.prototype._ensureHibernation = function () { if (this.preprocessor.endOfChunkHit) { for (; this.consumedAfterSnapshot > 0; this.consumedAfterSnapshot--) this.preprocessor.retreat(); this.active = false; this.tokenQueue.push({type: Tokenizer.HIBERNATION_TOKEN}); return true; } return false; }; //Consumption Tokenizer.prototype._consume = function () { this.consumedAfterSnapshot++; return this.preprocessor.advance(); }; Tokenizer.prototype._unconsume = function () { this.consumedAfterSnapshot--; this.preprocessor.retreat(); }; Tokenizer.prototype._unconsumeSeveral = function (count) { while (count--) this._unconsume(); }; Tokenizer.prototype._reconsumeInState = function (state) { this.state = state; this._unconsume(); }; Tokenizer.prototype._consumeSubsequentIfMatch = function (pattern, startCp, caseSensitive) { var consumedCount = 0, isMatch = true, patternLength = pattern.length, patternPos = 0, cp = startCp, patternCp = void 0; for (; patternPos < patternLength; patternPos++) { if (patternPos > 0) { cp = this._consume(); consumedCount++; } if (cp === $.EOF) { isMatch = false; break; } patternCp = pattern[patternPos]; if (cp !== patternCp && (caseSensitive || cp !== toAsciiLowerCodePoint(patternCp))) { isMatch = false; break; } } if (!isMatch) this._unconsumeSeveral(consumedCount); return isMatch; }; //Lookahead Tokenizer.prototype._lookahead = function () { var cp = this._consume(); this._unconsume(); return cp; }; //Temp buffer Tokenizer.prototype.isTempBufferEqualToScriptString = function () { if (this.tempBuff.length !== $$.SCRIPT_STRING.length) return false; for (var i = 0; i < this.tempBuff.length; i++) { if (this.tempBuff[i] !== $$.SCRIPT_STRING[i]) return false; } return true; }; //Token creation Tokenizer.prototype._createStartTagToken = function () { this.currentToken = { type: Tokenizer.START_TAG_TOKEN, tagName: '', selfClosing: false, attrs: [] }; }; Tokenizer.prototype._createEndTagToken = function () { this.currentToken = { type: Tokenizer.END_TAG_TOKEN, tagName: '', attrs: [] }; }; Tokenizer.prototype._createCommentToken = function () { this.currentToken = { type: Tokenizer.COMMENT_TOKEN, data: '' }; }; Tokenizer.prototype._createDoctypeToken = function (initialName) { this.currentToken = { type: Tokenizer.DOCTYPE_TOKEN, name: initialName, forceQuirks: false, publicId: null, systemId: null }; }; Tokenizer.prototype._createCharacterToken = function (type, ch) { this.currentCharacterToken = { type: type, chars: ch }; }; //Tag attributes Tokenizer.prototype._createAttr = function (attrNameFirstCh) { this.currentAttr = { name: attrNameFirstCh, value: '' }; }; Tokenizer.prototype._isDuplicateAttr = function () { return Tokenizer.getTokenAttr(this.currentToken, this.currentAttr.name) !== null; }; Tokenizer.prototype._leaveAttrName = function (toState) { this.state = toState; if (!this._isDuplicateAttr()) this.currentToken.attrs.push(this.currentAttr); }; Tokenizer.prototype._leaveAttrValue = function (toState) { this.state = toState; }; //Appropriate end tag token //(see: http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#appropriate-end-tag-token) Tokenizer.prototype._isAppropriateEndTagToken = function () { return this.lastStartTagName === this.currentToken.tagName; }; //Token emission Tokenizer.prototype._emitCurrentToken = function () { this._emitCurrentCharacterToken(); //NOTE: store emited start tag's tagName to determine is the following end tag token is appropriate. if (this.currentToken.type === Tokenizer.START_TAG_TOKEN) this.lastStartTagName = this.currentToken.tagName; this.tokenQueue.push(this.currentToken); this.currentToken = null; }; Tokenizer.prototype._emitCurrentCharacterToken = function () { if (this.currentCharacterToken) { this.tokenQueue.push(this.currentCharacterToken); this.currentCharacterToken = null; } }; Tokenizer.prototype._emitEOFToken = function () { this._emitCurrentCharacterToken(); this.tokenQueue.push({type: Tokenizer.EOF_TOKEN}); }; //Characters emission //OPTIMIZATION: specification uses only one type of character tokens (one token per character). //This causes a huge memory overhead and a lot of unnecessary parser loops. parse5 uses 3 groups of characters. //If we have a sequence of characters that belong to the same group, parser can process it //as a single solid character token. //So, there are 3 types of character tokens in parse5: //1)NULL_CHARACTER_TOKEN - \u0000-character sequences (e.g. '\u0000\u0000\u0000') //2)WHITESPACE_CHARACTER_TOKEN - any whitespace/new-line character sequences (e.g. '\n \r\t \f') //3)CHARACTER_TOKEN - any character sequence which don't belong to groups 1 and 2 (e.g. 'abcdef1234@@#$%^') Tokenizer.prototype._appendCharToCurrentCharacterToken = function (type, ch) { if (this.currentCharacterToken && this.currentCharacterToken.type !== type) this._emitCurrentCharacterToken(); if (this.currentCharacterToken) this.currentCharacterToken.chars += ch; else this._createCharacterToken(type, ch); }; Tokenizer.prototype._emitCodePoint = function (cp) { var type = Tokenizer.CHARACTER_TOKEN; if (isWhitespace(cp)) type = Tokenizer.WHITESPACE_CHARACTER_TOKEN; else if (cp === $.NULL) type = Tokenizer.NULL_CHARACTER_TOKEN; this._appendCharToCurrentCharacterToken(type, toChar(cp)); }; Tokenizer.prototype._emitSeveralCodePoints = function (codePoints) { for (var i = 0; i < codePoints.length; i++) this._emitCodePoint(codePoints[i]); }; //NOTE: used then we emit character explicitly. This is always a non-whitespace and a non-null character. //So we can avoid additional checks here. Tokenizer.prototype._emitChar = function (ch) { this._appendCharToCurrentCharacterToken(Tokenizer.CHARACTER_TOKEN, ch); }; //Character reference tokenization Tokenizer.prototype._consumeNumericEntity = function (isHex) { var digits = '', nextCp = void 0; do { digits += toChar(this._consume()); nextCp = this._lookahead(); } while (nextCp !== $.EOF && isDigit(nextCp, isHex)); if (this._lookahead() === $.SEMICOLON) this._consume(); var referencedCp = parseInt(digits, isHex ? 16 : 10), replacement = NUMERIC_ENTITY_REPLACEMENTS[referencedCp]; if (replacement) return replacement; if (isReservedCodePoint(referencedCp)) return $.REPLACEMENT_CHARACTER; return referencedCp; }; // NOTE: for the details on this algorithm see // https://github.com/inikulin/parse5/tree/master/scripts/generate_named_entity_data/README.md Tokenizer.prototype._consumeNamedEntity = function (inAttr) { var referencedCodePoints = null, referenceSize = 0, cp = null, consumedCount = 0, semicolonTerminated = false; for (var i = 0; i > -1;) { var current = neTree[i], inNode = current < MAX_BRANCH_MARKER_VALUE, nodeWithData = inNode && current & HAS_DATA_FLAG; if (nodeWithData) { referencedCodePoints = current & DATA_DUPLET_FLAG ? [neTree[++i], neTree[++i]] : [neTree[++i]]; referenceSize = consumedCount; if (cp === $.SEMICOLON) { semicolonTerminated = true; break; } } cp = this._consume(); consumedCount++; if (cp === $.EOF) break; if (inNode) i = current & HAS_BRANCHES_FLAG ? findNamedEntityTreeBranch(i, cp) : -1; else i = cp === current ? ++i : -1; } if (referencedCodePoints) { if (!semicolonTerminated) { //NOTE: unconsume excess (e.g. 'it' in '¬it') this._unconsumeSeveral(consumedCount - referenceSize); //NOTE: If the character reference is being consumed as part of an attribute and the next character //is either a U+003D EQUALS SIGN character (=) or an alphanumeric ASCII character, then, for historical //reasons, all the characters that were matched after the U+0026 AMPERSAND character (&) must be //unconsumed, and nothing is returned. //However, if this next character is in fact a U+003D EQUALS SIGN character (=), then this is a //parse error, because some legacy user agents will misinterpret the markup in those cases. //(see: http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#tokenizing-character-references) if (inAttr) { var nextCp = this._lookahead(); if (nextCp === $.EQUALS_SIGN || isAsciiAlphaNumeric(nextCp)) { this._unconsumeSeveral(referenceSize); return null; } } } return referencedCodePoints; } this._unconsumeSeveral(consumedCount); return null; }; Tokenizer.prototype._consumeCharacterReference = function (startCp, inAttr) { if (isWhitespace(startCp) || startCp === $.GREATER_THAN_SIGN || startCp === $.AMPERSAND || startCp === this.additionalAllowedCp || startCp === $.EOF) { //NOTE: not a character reference. No characters are consumed, and nothing is returned. this._unconsume(); return null; } if (startCp === $.NUMBER_SIGN) { //NOTE: we have a numeric entity candidate, now we should determine if it's hex or decimal var isHex = false, nextCp = this._lookahead(); if (nextCp === $.LATIN_SMALL_X || nextCp === $.LATIN_CAPITAL_X) { this._consume(); isHex = true; } nextCp = this._lookahead(); //NOTE: if we have at least one digit this is a numeric entity for sure, so we consume it if (nextCp !== $.EOF && isDigit(nextCp, isHex)) return [this._consumeNumericEntity(isHex)]; //NOTE: otherwise this is a bogus number entity and a parse error. Unconsume the number sign //and the 'x'-character if appropriate. this._unconsumeSeveral(isHex ? 2 : 1); return null; } this._unconsume(); return this._consumeNamedEntity(inAttr); }; //State machine var _ = Tokenizer.prototype; //12.2.4.1 Data state //------------------------------------------------------------------ _[DATA_STATE] = function dataState(cp) { this.preprocessor.dropParsedChunk(); if (cp === $.AMPERSAND) this.state = CHARACTER_REFERENCE_IN_DATA_STATE; else if (cp === $.LESS_THAN_SIGN) this.state = TAG_OPEN_STATE; else if (cp === $.NULL) this._emitCodePoint(cp); else if (cp === $.EOF) this._emitEOFToken(); else this._emitCodePoint(cp); }; //12.2.4.2 Character reference in data state //------------------------------------------------------------------ _[CHARACTER_REFERENCE_IN_DATA_STATE] = function characterReferenceInDataState(cp) { this.additionalAllowedCp = void 0; var referencedCodePoints = this._consumeCharacterReference(cp, false); if (!this._ensureHibernation()) { if (referencedCodePoints) this._emitSeveralCodePoints(referencedCodePoints); else this._emitChar('&'); this.state = DATA_STATE; } }; //12.2.4.3 RCDATA state //------------------------------------------------------------------ _[RCDATA_STATE] = function rcdataState(cp) { this.preprocessor.dropParsedChunk(); if (cp === $.AMPERSAND) this.state = CHARACTER_REFERENCE_IN_RCDATA_STATE; else if (cp === $.LESS_THAN_SIGN) this.state = RCDATA_LESS_THAN_SIGN_STATE; else if (cp === $.NULL) this._emitChar(UNICODE.REPLACEMENT_CHARACTER); else if (cp === $.EOF) this._emitEOFToken(); else this._emitCodePoint(cp); }; //12.2.4.4 Character reference in RCDATA state //------------------------------------------------------------------ _[CHARACTER_REFERENCE_IN_RCDATA_STATE] = function characterReferenceInRcdataState(cp) { this.additionalAllowedCp = void 0; var referencedCodePoints = this._consumeCharacterReference(cp, false); if (!this._ensureHibernation()) { if (referencedCodePoints) this._emitSeveralCodePoints(referencedCodePoints); else this._emitChar('&'); this.state = RCDATA_STATE; } }; //12.2.4.5 RAWTEXT state //------------------------------------------------------------------ _[RAWTEXT_STATE] = function rawtextState(cp) { this.preprocessor.dropParsedChunk(); if (cp === $.LESS_THAN_SIGN) this.state = RAWTEXT_LESS_THAN_SIGN_STATE; else if (cp === $.NULL) this._emitChar(UNICODE.REPLACEMENT_CHARACTER); else if (cp === $.EOF) this._emitEOFToken(); else this._emitCodePoint(cp); }; //12.2.4.6 Script data state //------------------------------------------------------------------ _[SCRIPT_DATA_STATE] = function scriptDataState(cp) { this.preprocessor.dropParsedChunk(); if (cp === $.LESS_THAN_SIGN) this.state = SCRIPT_DATA_LESS_THAN_SIGN_STATE; else if (cp === $.NULL) this._emitChar(UNICODE.REPLACEMENT_CHARACTER); else if (cp === $.EOF) this._emitEOFToken(); else this._emitCodePoint(cp); }; //12.2.4.7 PLAINTEXT state //------------------------------------------------------------------ _[PLAINTEXT_STATE] = function plaintextState(cp) { this.preprocessor.dropParsedChunk(); if (cp === $.NULL) this._emitChar(UNICODE.REPLACEMENT_CHARACTER); else if (cp === $.EOF) this._emitEOFToken(); else this._emitCodePoint(cp); }; //12.2.4.8 Tag open state //------------------------------------------------------------------ _[TAG_OPEN_STATE] = function tagOpenState(cp) { if (cp === $.EXCLAMATION_MARK) this.state = MARKUP_DECLARATION_OPEN_STATE; else if (cp === $.SOLIDUS) this.state = END_TAG_OPEN_STATE; else if (isAsciiLetter(cp)) { this._createStartTagToken(); this._reconsumeInState(TAG_NAME_STATE); } else if (cp === $.QUESTION_MARK) this._reconsumeInState(BOGUS_COMMENT_STATE); else { this._emitChar('<'); this._reconsumeInState(DATA_STATE); } }; //12.2.4.9 End tag open state //------------------------------------------------------------------ _[END_TAG_OPEN_STATE] = function endTagOpenState(cp) { if (isAsciiLetter(cp)) { this._createEndTagToken(); this._reconsumeInState(TAG_NAME_STATE); } else if (cp === $.GREATER_THAN_SIGN) this.state = DATA_STATE; else if (cp === $.EOF) { this._reconsumeInState(DATA_STATE); this._emitChar('<'); this._emitChar('/'); } else this._reconsumeInState(BOGUS_COMMENT_STATE); }; //12.2.4.10 Tag name state //------------------------------------------------------------------ _[TAG_NAME_STATE] = function tagNameState(cp) { if (isWhitespace(cp)) this.state = BEFORE_ATTRIBUTE_NAME_STATE; else if (cp === $.SOLIDUS) this.state = SELF_CLOSING_START_TAG_STATE; else if (cp === $.GREATER_THAN_SIGN) { this.state = DATA_STATE; this._emitCurrentToken(); } else if (isAsciiUpper(cp)) this.currentToken.tagName += toAsciiLowerChar(cp); else if (cp === $.NULL) this.currentToken.tagName += UNICODE.REPLACEMENT_CHARACTER; else if (cp === $.EOF) this._reconsumeInState(DATA_STATE); else this.currentToken.tagName += toChar(cp); }; //12.2.4.11 RCDATA less-than sign state //------------------------------------------------------------------ _[RCDATA_LESS_THAN_SIGN_STATE] = function rcdataLessThanSignState(cp) { if (cp === $.SOLIDUS) { this.tempBuff = []; this.state = RCDATA_END_TAG_OPEN_STATE; } else { this._emitChar('<'); this._reconsumeInState(RCDATA_STATE); } }; //12.2.4.12 RCDATA end tag open state //------------------------------------------------------------------ _[RCDATA_END_TAG_OPEN_STATE] = function rcdataEndTagOpenState(cp) { if (isAsciiLetter(cp)) { this._createEndTagToken(); this._reconsumeInState(RCDATA_END_TAG_NAME_STATE); } else { this._emitChar('<'); this._emitChar('/'); this._reconsumeInState(RCDATA_STATE); } }; //12.2.4.13 RCDATA end tag name state //------------------------------------------------------------------ _[RCDATA_END_TAG_NAME_STATE] = function rcdataEndTagNameState(cp) { if (isAsciiUpper(cp)) { this.currentToken.tagName += toAsciiLowerChar(cp); this.tempBuff.push(cp); } else if (isAsciiLower(cp)) { this.currentToken.tagName += toChar(cp); this.tempBuff.push(cp); } else { if (this._isAppropriateEndTagToken()) { if (isWhitespace(cp)) { this.state = BEFORE_ATTRIBUTE_NAME_STATE; return; } if (cp === $.SOLIDUS) { this.state = SELF_CLOSING_START_TAG_STATE; return; } if (cp === $.GREATER_THAN_SIGN) { this.state = DATA_STATE; this._emitCurrentToken(); return; } } this._emitChar('<'); this._emitChar('/'); this._emitSeveralCodePoints(this.tempBuff); this._reconsumeInState(RCDATA_STATE); } }; //12.2.4.14 RAWTEXT less-than sign state //------------------------------------------------------------------ _[RAWTEXT_LESS_THAN_SIGN_STATE] = function rawtextLessThanSignState(cp) { if (cp === $.SOLIDUS) { this.tempBuff = []; this.state = RAWTEXT_END_TAG_OPEN_STATE; } else { this._emitChar('<'); this._reconsumeInState(RAWTEXT_STATE); } }; //12.2.4.15 RAWTEXT end tag open state //------------------------------------------------------------------ _[RAWTEXT_END_TAG_OPEN_STATE] = function rawtextEndTagOpenState(cp) { if (isAsciiLetter(cp)) { this._createEndTagToken(); this._reconsumeInState(RAWTEXT_END_TAG_NAME_STATE); } else { this._emitChar('<'); this._emitChar('/'); this._reconsumeInState(RAWTEXT_STATE); } }; //12.2.4.16 RAWTEXT end tag name state //------------------------------------------------------------------ _[RAWTEXT_END_TAG_NAME_STATE] = function rawtextEndTagNameState(cp) { if (isAsciiUpper(cp)) { this.currentToken.tagName += toAsciiLowerChar(cp); this.tempBuff.push(cp); } else if (isAsciiLower(cp)) { this.currentToken.tagName += toChar(cp); this.tempBuff.push(cp); } else { if (this._isAppropriateEndTagToken()) { if (isWhitespace(cp)) { this.state = BEFORE_ATTRIBUTE_NAME_STATE; return; } if (cp === $.SOLIDUS) { this.state = SELF_CLOSING_START_TAG_STATE; return; } if (cp === $.GREATER_THAN_SIGN) { this._emitCurrentToken(); this.state = DATA_STATE; return; } } this._emitChar('<'); this._emitChar('/'); this._emitSeveralCodePoints(this.tempBuff); this._reconsumeInState(RAWTEXT_STATE); } }; //12.2.4.17 Script data less-than sign state //------------------------------------------------------------------ _[SCRIPT_DATA_LESS_THAN_SIGN_STATE] = function scriptDataLessThanSignState(cp) { if (cp === $.SOLIDUS) { this.tempBuff = []; this.state = SCRIPT_DATA_END_TAG_OPEN_STATE; } else if (cp === $.EXCLAMATION_MARK) { this.state = SCRIPT_DATA_ESCAPE_START_STATE; this._emitChar('<'); this._emitChar('!'); } else { this._emitChar('<'); this._reconsumeInState(SCRIPT_DATA_STATE); } }; //12.2.4.18 Script data end tag open state //------------------------------------------------------------------ _[SCRIPT_DATA_END_TAG_OPEN_STATE] = function scriptDataEndTagOpenState(cp) { if (isAsciiLetter(cp)) { this._createEndTagToken(); this._reconsumeInState(SCRIPT_DATA_END_TAG_NAME_STATE); } else { this._emitChar('<'); this._emitChar('/'); this._reconsumeInState(SCRIPT_DATA_STATE); } }; //12.2.4.19 Script data end tag name state //------------------------------------------------------------------ _[SCRIPT_DATA_END_TAG_NAME_STATE] = function scriptDataEndTagNameState(cp) { if (isAsciiUpper(cp)) { this.currentToken.tagName += toAsciiLowerChar(cp); this.tempBuff.push(cp); } else if (isAsciiLower(cp)) { this.currentToken.tagName += toChar(cp); this.tempBuff.push(cp); } else { if (this._isAppropriateEndTagToken()) { if (isWhitespace(cp)) { this.state = BEFORE_ATTRIBUTE_NAME_STATE; return; } else if (cp === $.SOLIDUS) { this.state = SELF_CLOSING_START_TAG_STATE; return; } else if (cp === $.GREATER_THAN_SIGN) { this._emitCurrentToken(); this.state = DATA_STATE; return; } } this._emitChar('<'); this._emitChar('/'); this._emitSeveralCodePoints(this.tempBuff); this._reconsumeInState(SCRIPT_DATA_STATE); } }; //12.2.4.20 Script data escape start state //------------------------------------------------------------------ _[SCRIPT_DATA_ESCAPE_START_STATE] = function scriptDataEscapeStartState(cp) { if (cp === $.HYPHEN_MINUS) { this.state = SCRIPT_DATA_ESCAPE_START_DASH_STATE; this._emitChar('-'); } else this._reconsumeInState(SCRIPT_DATA_STATE); }; //12.2.4.21 Script data escape start dash state //------------------------------------------------------------------ _[SCRIPT_DATA_ESCAPE_START_DASH_STATE] = function scriptDataEscapeStartDashState(cp) { if (cp === $.HYPHEN_MINUS) { this.state = SCRIPT_DATA_ESCAPED_DASH_DASH_STATE; this._emitChar('-'); } else this._reconsumeInState(SCRIPT_DATA_STATE); }; //12.2.4.22 Script data escaped state //------------------------------------------------------------------ _[SCRIPT_DATA_ESCAPED_STATE] = function scriptDataEscapedState(cp) { if (cp === $.HYPHEN_MINUS) { this.state = SCRIPT_DATA_ESCAPED_DASH_STATE; this._emitChar('-'); } else if (cp === $.LESS_THAN_SIGN) this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE; else if (cp === $.NULL) this._emitChar(UNICODE.REPLACEMENT_CHARACTER); else if (cp === $.EOF) this._reconsumeInState(DATA_STATE); else this._emitCodePoint(cp); }; //12.2.4.23 Script data escaped dash state //------------------------------------------------------------------ _[SCRIPT_DATA_ESCAPED_DASH_STATE] = function scriptDataEscapedDashState(cp) { if (cp === $.HYPHEN_MINUS) { this.state = SCRIPT_DATA_ESCAPED_DASH_DASH_STATE; this._emitChar('-'); } else if (cp === $.LESS_THAN_SIGN) this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE; else if (cp === $.NULL) { this.state = SCRIPT_DATA_ESCAPED_STATE; this._emitChar(UNICODE.REPLACEMENT_CHARACTER); } else if (cp === $.EOF) this._reconsumeInState(DATA_STATE); else { this.state = SCRIPT_DATA_ESCAPED_STATE; this._emitCodePoint(cp); } }; //12.2.4.24 Script data escaped dash dash state //------------------------------------------------------------------ _[SCRIPT_DATA_ESCAPED_DASH_DASH_STATE] = function scriptDataEscapedDashDashState(cp) { if (cp === $.HYPHEN_MINUS) this._emitChar('-'); else if (cp === $.LESS_THAN_SIGN) this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE; else if (cp === $.GREATER_THAN_SIGN) { this.state = SCRIPT_DATA_STATE; this._emitChar('>'); } else if (cp === $.NULL) { this.state = SCRIPT_DATA_ESCAPED_STATE; this._emitChar(UNICODE.REPLACEMENT_CHARACTER); } else if (cp === $.EOF) this._reconsumeInState(DATA_STATE); else { this.state = SCRIPT_DATA_ESCAPED_STATE; this._emitCodePoint(cp); } }; //12.2.4.25 Script data escaped less-than sign state //------------------------------------------------------------------ _[SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE] = function scriptDataEscapedLessThanSignState(cp) { if (cp === $.SOLIDUS) { this.tempBuff = []; this.state = SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE; } else if (isAsciiLetter(cp)) { this.tempBuff = []; this._emitChar('<'); this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE); } else { this._emitChar('<'); this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE); } }; //12.2.4.26 Script data escaped end tag open state //------------------------------------------------------------------ _[SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE] = function scriptDataEscapedEndTagOpenState(cp) { if (isAsciiLetter(cp)) { this._createEndTagToken(); this._reconsumeInState(SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE); } else { this._emitChar('<'); this._emitChar('/'); this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE); } }; //12.2.4.27 Script data escaped end tag name state //------------------------------------------------------------------ _[SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE] = function scriptDataEscapedEndTagNameState(cp) { if (isAsciiUpper(cp)) { this.currentToken.tagName += toAsciiLowerChar(cp); this.tempBuff.push(cp); } else if (isAsciiLower(cp)) { this.currentToken.tagName += toChar(cp); this.tempBuff.push(cp); } else { if (this._isAppropriateEndTagToken()) { if (isWhitespace(cp)) { this.state = BEFORE_ATTRIBUTE_NAME_STATE; return; } if (cp === $.SOLIDUS) { this.state = SELF_CLOSING_START_TAG_STATE; return; } if (cp === $.GREATER_THAN_SIGN) { this._emitCurrentToken(); this.state = DATA_STATE; return; } } this._emitChar('<'); this._emitChar('/'); this._emitSeveralCodePoints(this.tempBuff); this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE); } }; //12.2.4.28 Script data double escape start state //------------------------------------------------------------------ _[SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE] = function scriptDataDoubleEscapeStartState(cp) { if (isWhitespace(cp) || cp === $.SOLIDUS || cp === $.GREATER_THAN_SIGN) { this.state = this.isTempBufferEqualToScriptString() ? SCRIPT_DATA_DOUBLE_ESCAPED_STATE : SCRIPT_DATA_ESCAPED_STATE; this._emitCodePoint(cp); } else if (isAsciiUpper(cp)) { this.tempBuff.push(toAsciiLowerCodePoint(cp)); this._emitCodePoint(cp); } else if (isAsciiLower(cp)) { this.tempBuff.push(cp); this._emitCodePoint(cp); } else this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE); }; //12.2.4.29 Script data double escaped state //------------------------------------------------------------------ _[SCRIPT_DATA_DOUBLE_ESCAPED_STATE] = function scriptDataDoubleEscapedState(cp) { if (cp === $.HYPHEN_MINUS) { this.state = SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE; this._emitChar('-'); } else if (cp === $.LESS_THAN_SIGN) { this.state = SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE; this._emitChar('<'); } else if (cp === $.NULL) this._emitChar(UNICODE.REPLACEMENT_CHARACTER); else if (cp === $.EOF) this._reconsumeInState(DATA_STATE); else this._emitCodePoint(cp); }; //12.2.4.30 Script data double escaped dash state //------------------------------------------------------------------ _[SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE] = function scriptDataDoubleEscapedDashState(cp) { if (cp === $.HYPHEN_MINUS) { this.state = SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE; this._emitChar('-'); } else if (cp === $.LESS_THAN_SIGN) { this.state = SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE; this._emitChar('<'); } else if (cp === $.NULL) { this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE; this._emitChar(UNICODE.REPLACEMENT_CHARACTER); } else if (cp === $.EOF) this._reconsumeInState(DATA_STATE); else { this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE; this._emitCodePoint(cp); } }; //12.2.4.31 Script data double escaped dash dash state //------------------------------------------------------------------ _[SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE] = function scriptDataDoubleEscapedDashDashState(cp) { if (cp === $.HYPHEN_MINUS) this._emitChar('-'); else if (cp === $.LESS_THAN_SIGN) { this.state = SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE; this._emitChar('<'); } else if (cp === $.GREATER_THAN_SIGN) { this.state = SCRIPT_DATA_STATE; this._emitChar('>'); } else if (cp === $.NULL) { this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE; this._emitChar(UNICODE.REPLACEMENT_CHARACTER); } else if (cp === $.EOF) this._reconsumeInState(DATA_STATE); else { this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE; this._emitCodePoint(cp); } }; //12.2.4.32 Script data double escaped less-than sign state //------------------------------------------------------------------ _[SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE] = function scriptDataDoubleEscapedLessThanSignState(cp) { if (cp === $.SOLIDUS) { this.tempBuff = []; this.state = SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE; this._emitChar('/'); } else this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPED_STATE); }; //12.2.4.33 Script data double escape end state //------------------------------------------------------------------ _[SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE] = function scriptDataDoubleEscapeEndState(cp) { if (isWhitespace(cp) || cp === $.SOLIDUS || cp === $.GREATER_THAN_SIGN) { this.state = this.isTempBufferEqualToScriptString() ? SCRIPT_DATA_ESCAPED_STATE : SCRIPT_DATA_DOUBLE_ESCAPED_STATE; this._emitCodePoint(cp); } else if (isAsciiUpper(cp)) { this.tempBuff.push(toAsciiLowerCodePoint(cp)); this._emitCodePoint(cp); } else if (isAsciiLower(cp)) { this.tempBuff.push(cp); this._emitCodePoint(cp); } else this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPED_STATE); }; //12.2.4.34 Before attribute name state //------------------------------------------------------------------ _[BEFORE_ATTRIBUTE_NAME_STATE] = function beforeAttributeNameState(cp) { if (isWhitespace(cp)) return; if (cp === $.SOLIDUS || cp === $.GREATER_THAN_SIGN || cp === $.EOF) this._reconsumeInState(AFTER_ATTRIBUTE_NAME_STATE); else if (cp === $.EQUALS_SIGN) { this._createAttr('='); this.state = ATTRIBUTE_NAME_STATE; } else { this._createAttr(''); this._reconsumeInState(ATTRIBUTE_NAME_STATE); } }; //12.2.4.35 Attribute name state //------------------------------------------------------------------ _[ATTRIBUTE_NAME_STATE] = function attributeNameState(cp) { if (isWhitespace(cp) || cp === $.SOLIDUS || cp === $.GREATER_THAN_SIGN || cp === $.EOF) { this._leaveAttrName(AFTER_ATTRIBUTE_NAME_STATE); this._unconsume(); } else if (cp === $.EQUALS_SIGN) this._leaveAttrName(BEFORE_ATTRIBUTE_VALUE_STATE); else if (isAsciiUpper(cp)) this.currentAttr.name += toAsciiLowerChar(cp); else if (cp === $.QUOTATION_MARK || cp === $.APOSTROPHE || cp === $.LESS_THAN_SIGN) this.currentAttr.name += toChar(cp); else if (cp === $.NULL) this.currentAttr.name += UNICODE.REPLACEMENT_CHARACTER; else this.currentAttr.name += toChar(cp); }; //12.2.4.36 After attribute name state //------------------------------------------------------------------ _[AFTER_ATTRIBUTE_NAME_STATE] = function afterAttributeNameState(cp) { if (isWhitespace(cp)) return; if (cp === $.SOLIDUS) this.state = SELF_CLOSING_START_TAG_STATE; else if (cp === $.EQUALS_SIGN) this.state = BEFORE_ATTRIBUTE_VALUE_STATE; else if (cp === $.GREATER_THAN_SIGN) { this.state = DATA_STATE; this._emitCurrentToken(); } else if (cp === $.EOF) this._reconsumeInState(DATA_STATE); else { this._createAttr(''); this._reconsumeInState(ATTRIBUTE_NAME_STATE); } }; //12.2.4.37 Before attribute value state //------------------------------------------------------------------ _[BEFORE_ATTRIBUTE_VALUE_STATE] = function beforeAttributeValueState(cp) { if (isWhitespace(cp)) return; if (cp === $.QUOTATION_MARK) this.state = ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE; else if (cp === $.APOSTROPHE) this.state = ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE; else this._reconsumeInState(ATTRIBUTE_VALUE_UNQUOTED_STATE); }; //12.2.4.38 Attribute value (double-quoted) state //------------------------------------------------------------------ _[ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE] = function attributeValueDoubleQuotedState(cp) { if (cp === $.QUOTATION_MARK) this.state = AFTER_ATTRIBUTE_VALUE_QUOTED_STATE; else if (cp === $.AMPERSAND) { this.additionalAllowedCp = $.QUOTATION_MARK; this.returnState = this.state; this.state = CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE; } else if (cp === $.NULL) this.currentAttr.value += UNICODE.REPLACEMENT_CHARACTER; else if (cp === $.EOF) this._reconsumeInState(DATA_STATE); else this.currentAttr.value += toChar(cp); }; //12.2.4.39 Attribute value (single-quoted) state //------------------------------------------------------------------ _[ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE] = function attributeValueSingleQuotedState(cp) { if (cp === $.APOSTROPHE) this.state = AFTER_ATTRIBUTE_VALUE_QUOTED_STATE; else if (cp === $.AMPERSAND) { this.additionalAllowedCp = $.APOSTROPHE; this.returnState = this.state; this.state = CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE; } else if (cp === $.NULL) this.currentAttr.value += UNICODE.REPLACEMENT_CHARACTER; else if (cp === $.EOF) this._reconsumeInState(DATA_STATE); else this.currentAttr.value += toChar(cp); }; //12.2.4.40 Attribute value (unquoted) state //------------------------------------------------------------------ _[ATTRIBUTE_VALUE_UNQUOTED_STATE] = function attributeValueUnquotedState(cp) { if (isWhitespace(cp)) this._leaveAttrValue(BEFORE_ATTRIBUTE_NAME_STATE); else if (cp === $.AMPERSAND) { this.additionalAllowedCp = $.GREATER_THAN_SIGN; this.returnState = this.state; this.state = CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE; } else if (cp === $.GREATER_THAN_SIGN) { this._leaveAttrValue(DATA_STATE); this._emitCurrentToken(); } else if (cp === $.NULL) this.currentAttr.value += UNICODE.REPLACEMENT_CHARACTER; else if (cp === $.QUOTATION_MARK || cp === $.APOSTROPHE || cp === $.LESS_THAN_SIGN || cp === $.EQUALS_SIGN || cp === $.GRAVE_ACCENT) this.currentAttr.value += toChar(cp); else if (cp === $.EOF) this._reconsumeInState(DATA_STATE); else this.currentAttr.value += toChar(cp); }; //12.2.4.41 Character reference in attribute value state //------------------------------------------------------------------ _[CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE] = function characterReferenceInAttributeValueState(cp) { var referencedCodePoints = this._consumeCharacterReference(cp, true); if (!this._ensureHibernation()) { if (referencedCodePoints) { for (var i = 0; i < referencedCodePoints.length; i++) this.currentAttr.value += toChar(referencedCodePoints[i]); } else this.currentAttr.value += '&'; this.state = this.returnState; } }; //12.2.4.42 After attribute value (quoted) state //------------------------------------------------------------------ _[AFTER_ATTRIBUTE_VALUE_QUOTED_STATE] = function afterAttributeValueQuotedState(cp) { if (isWhitespace(cp)) this._leaveAttrValue(BEFORE_ATTRIBUTE_NAME_STATE); else if (cp === $.SOLIDUS) this._leaveAttrValue(SELF_CLOSING_START_TAG_STATE); else if (cp === $.GREATER_THAN_SIGN) { this._leaveAttrValue(DATA_STATE); this._emitCurrentToken(); } else if (cp === $.EOF) this._reconsumeInState(DATA_STATE); else this._reconsumeInState(BEFORE_ATTRIBUTE_NAME_STATE); }; //12.2.4.43 Self-closing start tag state //------------------------------------------------------------------ _[SELF_CLOSING_START_TAG_STATE] = function selfClosingStartTagState(cp) { if (cp === $.GREATER_THAN_SIGN) { this.currentToken.selfClosing = true; this.state = DATA_STATE; this._emitCurrentToken(); } else if (cp === $.EOF) this._reconsumeInState(DATA_STATE); else this._reconsumeInState(BEFORE_ATTRIBUTE_NAME_STATE); }; //12.2.4.44 Bogus comment state //------------------------------------------------------------------ _[BOGUS_COMMENT_STATE] = function bogusCommentState() { this._createCommentToken(); this._reconsumeInState(BOGUS_COMMENT_STATE_CONTINUATION); }; //HACK: to support streaming and make BOGUS_COMMENT_STATE reentrant we've //introduced BOGUS_COMMENT_STATE_CONTINUATION state which will not produce //comment token on each call. _[BOGUS_COMMENT_STATE_CONTINUATION] = function bogusCommentStateContinuation(cp) { while (true) { if (cp === $.GREATER_THAN_SIGN) { this.state = DATA_STATE; break; } else if (cp === $.EOF) { this._reconsumeInState(DATA_STATE); break; } else { this.currentToken.data += cp === $.NULL ? UNICODE.REPLACEMENT_CHARACTER : toChar(cp); this._hibernationSnapshot(); cp = this._consume(); if (this._ensureHibernation()) return; } } this._emitCurrentToken(); }; //12.2.4.45 Markup declaration open state //------------------------------------------------------------------ _[MARKUP_DECLARATION_OPEN_STATE] = function markupDeclarationOpenState(cp) { var dashDashMatch = this._consumeSubsequentIfMatch($$.DASH_DASH_STRING, cp, true), doctypeMatch = !dashDashMatch && this._consumeSubsequentIfMatch($$.DOCTYPE_STRING, cp, false), cdataMatch = !dashDashMatch && !doctypeMatch && this.allowCDATA && this._consumeSubsequentIfMatch($$.CDATA_START_STRING, cp, true); if (!this._ensureHibernation()) { if (dashDashMatch) { this._createCommentToken(); this.state = COMMENT_START_STATE; } else if (doctypeMatch) this.state = DOCTYPE_STATE; else if (cdataMatch) this.state = CDATA_SECTION_STATE; else this._reconsumeInState(BOGUS_COMMENT_STATE); } }; //12.2.4.46 Comment start state //------------------------------------------------------------------ _[COMMENT_START_STATE] = function commentStartState(cp) { if (cp === $.HYPHEN_MINUS) this.state = COMMENT_START_DASH_STATE; else if (cp === $.NULL) { this.currentToken.data += UNICODE.REPLACEMENT_CHARACTER; this.state = COMMENT_STATE; } else if (cp === $.GREATER_THAN_SIGN) { this.state = DATA_STATE; this._emitCurrentToken(); } else if (cp === $.EOF) { this._emitCurrentToken(); this._reconsumeInState(DATA_STATE); } else { this.currentToken.data += toChar(cp); this.state = COMMENT_STATE; } }; //12.2.4.47 Comment start dash state //------------------------------------------------------------------ _[COMMENT_START_DASH_STATE] = function commentStartDashState(cp) { if (cp === $.HYPHEN_MINUS) this.state = COMMENT_END_STATE; else if (cp === $.NULL) { this.currentToken.data += '-'; this.currentToken.data += UNICODE.REPLACEMENT_CHARACTER; this.state = COMMENT_STATE; } else if (cp === $.GREATER_THAN_SIGN) { this.state = DATA_STATE; this._emitCurrentToken(); } else if (cp === $.EOF) { this._emitCurrentToken(); this._reconsumeInState(DATA_STATE); } else { this.currentToken.data += '-'; this.currentToken.data += toChar(cp); this.state = COMMENT_STATE; } }; //12.2.4.48 Comment state //------------------------------------------------------------------ _[COMMENT_STATE] = function commentState(cp) { if (cp === $.HYPHEN_MINUS) this.state = COMMENT_END_DASH_STATE; else if (cp === $.NULL) this.currentToken.data += UNICODE.REPLACEMENT_CHARACTER; else if (cp === $.EOF) { this._emitCurrentToken(); this._reconsumeInState(DATA_STATE); } else this.currentToken.data += toChar(cp); }; //12.2.4.49 Comment end dash state //------------------------------------------------------------------ _[COMMENT_END_DASH_STATE] = function commentEndDashState(cp) { if (cp === $.HYPHEN_MINUS) this.state = COMMENT_END_STATE; else if (cp === $.NULL) { this.currentToken.data += '-'; this.currentToken.data += UNICODE.REPLACEMENT_CHARACTER; this.state = COMMENT_STATE; } else if (cp === $.EOF) { this._emitCurrentToken(); this._reconsumeInState(DATA_STATE); } else { this.currentToken.data += '-'; this.currentToken.data += toChar(cp); this.state = COMMENT_STATE; } }; //12.2.4.50 Comment end state //------------------------------------------------------------------ _[COMMENT_END_STATE] = function commentEndState(cp) { if (cp === $.GREATER_THAN_SIGN) { this.state = DATA_STATE; this._emitCurrentToken(); } else if (cp === $.EXCLAMATION_MARK) this.state = COMMENT_END_BANG_STATE; else if (cp === $.HYPHEN_MINUS) this.currentToken.data += '-'; else if (cp === $.NULL) { this.currentToken.data += '--'; this.currentToken.data += UNICODE.REPLACEMENT_CHARACTER; this.state = COMMENT_STATE; } else if (cp === $.EOF) { this._reconsumeInState(DATA_STATE); this._emitCurrentToken(); } else { this.currentToken.data += '--'; this.currentToken.data += toChar(cp); this.state = COMMENT_STATE; } }; //12.2.4.51 Comment end bang state //------------------------------------------------------------------ _[COMMENT_END_BANG_STATE] = function commentEndBangState(cp) { if (cp === $.HYPHEN_MINUS) { this.currentToken.data += '--!'; this.state = COMMENT_END_DASH_STATE; } else if (cp === $.GREATER_THAN_SIGN) { this.state = DATA_STATE; this._emitCurrentToken(); } else if (cp === $.NULL) { this.currentToken.data += '--!'; this.currentToken.data += UNICODE.REPLACEMENT_CHARACTER; this.state = COMMENT_STATE; } else if (cp === $.EOF) { this._emitCurrentToken(); this._reconsumeInState(DATA_STATE); } else { this.currentToken.data += '--!'; this.currentToken.data += toChar(cp); this.state = COMMENT_STATE; } }; //12.2.4.52 DOCTYPE state //------------------------------------------------------------------ _[DOCTYPE_STATE] = function doctypeState(cp) { if (isWhitespace(cp)) return; else if (cp === $.GREATER_THAN_SIGN) { this._createDoctypeToken(null); this.currentToken.forceQuirks = true; this._emitCurrentToken(); this.state = DATA_STATE; } else if (cp === $.EOF) { this._createDoctypeToken(null); this.currentToken.forceQuirks = true; this._emitCurrentToken(); this._reconsumeInState(DATA_STATE); } else { this._createDoctypeToken(''); this._reconsumeInState(DOCTYPE_NAME_STATE); } }; //12.2.4.54 DOCTYPE name state //------------------------------------------------------------------ _[DOCTYPE_NAME_STATE] = function doctypeNameState(cp) { if (isWhitespace(cp) || cp === $.GREATER_THAN_SIGN || cp === $.EOF) this._reconsumeInState(AFTER_DOCTYPE_NAME_STATE); else if (isAsciiUpper(cp)) this.currentToken.name += toAsciiLowerChar(cp); else if (cp === $.NULL) this.currentToken.name += UNICODE.REPLACEMENT_CHARACTER; else this.currentToken.name += toChar(cp); }; //12.2.4.55 After DOCTYPE name state //------------------------------------------------------------------ _[AFTER_DOCTYPE_NAME_STATE] = function afterDoctypeNameState(cp) { if (isWhitespace(cp)) return; if (cp === $.GREATER_THAN_SIGN) { this.state = DATA_STATE; this._emitCurrentToken(); } else { var publicMatch = this._consumeSubsequentIfMatch($$.PUBLIC_STRING, cp, false), systemMatch = !publicMatch && this._consumeSubsequentIfMatch($$.SYSTEM_STRING, cp, false); if (!this._ensureHibernation()) { if (publicMatch) this.state = BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE; else if (systemMatch) this.state = BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE; else { this.currentToken.forceQuirks = true; this.state = BOGUS_DOCTYPE_STATE; } } } }; //12.2.4.57 Before DOCTYPE public identifier state //------------------------------------------------------------------ _[BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE] = function beforeDoctypePublicIdentifierState(cp) { if (isWhitespace(cp)) return; if (cp === $.QUOTATION_MARK) { this.currentToken.publicId = ''; this.state = DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE; } else if (cp === $.APOSTROPHE) { this.currentToken.publicId = ''; this.state = DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE; } else { this.currentToken.forceQuirks = true; this._reconsumeInState(BOGUS_DOCTYPE_STATE); } }; //12.2.4.58 DOCTYPE public identifier (double-quoted) state //------------------------------------------------------------------ _[DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE] = function doctypePublicIdentifierDoubleQuotedState(cp) { if (cp === $.QUOTATION_MARK) this.state = BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE; else if (cp === $.NULL) this.currentToken.publicId += UNICODE.REPLACEMENT_CHARACTER; else if (cp === $.GREATER_THAN_SIGN) { this.currentToken.forceQuirks = true; this._emitCurrentToken(); this.state = DATA_STATE; } else if (cp === $.EOF) { this.currentToken.forceQuirks = true; this._emitCurrentToken(); this._reconsumeInState(DATA_STATE); } else this.currentToken.publicId += toChar(cp); }; //12.2.4.59 DOCTYPE public identifier (single-quoted) state //------------------------------------------------------------------ _[DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE] = function doctypePublicIdentifierSingleQuotedState(cp) { if (cp === $.APOSTROPHE) this.state = BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE; else if (cp === $.NULL) this.currentToken.publicId += UNICODE.REPLACEMENT_CHARACTER; else if (cp === $.GREATER_THAN_SIGN) { this.currentToken.forceQuirks = true; this._emitCurrentToken(); this.state = DATA_STATE; } else if (cp === $.EOF) { this.currentToken.forceQuirks = true; this._emitCurrentToken(); this._reconsumeInState(DATA_STATE); } else this.currentToken.publicId += toChar(cp); }; //12.2.4.61 Between DOCTYPE public and system identifiers state //------------------------------------------------------------------ _[BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE] = function betweenDoctypePublicAndSystemIdentifiersState(cp) { if (isWhitespace(cp)) return; if (cp === $.GREATER_THAN_SIGN) { this._emitCurrentToken(); this.state = DATA_STATE; } else if (cp === $.QUOTATION_MARK) { this.currentToken.systemId = ''; this.state = DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE; } else if (cp === $.APOSTROPHE) { this.currentToken.systemId = ''; this.state = DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE; } else { this.currentToken.forceQuirks = true; this._reconsumeInState(BOGUS_DOCTYPE_STATE); } }; //12.2.4.63 Before DOCTYPE system identifier state //------------------------------------------------------------------ _[BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE] = function beforeDoctypeSystemIdentifierState(cp) { if (isWhitespace(cp)) return; if (cp === $.QUOTATION_MARK) { this.currentToken.systemId = ''; this.state = DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE; } else if (cp === $.APOSTROPHE) { this.currentToken.systemId = ''; this.state = DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE; } else { this.currentToken.forceQuirks = true; this._reconsumeInState(BOGUS_DOCTYPE_STATE); } }; //12.2.4.64 DOCTYPE system identifier (double-quoted) state //------------------------------------------------------------------ _[DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE] = function doctypeSystemIdentifierDoubleQuotedState(cp) { if (cp === $.QUOTATION_MARK) this.state = AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE; else if (cp === $.GREATER_THAN_SIGN) { this.currentToken.forceQuirks = true; this._emitCurrentToken(); this.state = DATA_STATE; } else if (cp === $.NULL) this.currentToken.systemId += UNICODE.REPLACEMENT_CHARACTER; else if (cp === $.EOF) { this.currentToken.forceQuirks = true; this._emitCurrentToken(); this._reconsumeInState(DATA_STATE); } else this.currentToken.systemId += toChar(cp); }; //12.2.4.65 DOCTYPE system identifier (single-quoted) state //------------------------------------------------------------------ _[DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE] = function doctypeSystemIdentifierSingleQuotedState(cp) { if (cp === $.APOSTROPHE) this.state = AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE; else if (cp === $.GREATER_THAN_SIGN) { this.currentToken.forceQuirks = true; this._emitCurrentToken(); this.state = DATA_STATE; } else if (cp === $.NULL) this.currentToken.systemId += UNICODE.REPLACEMENT_CHARACTER; else if (cp === $.EOF) { this.currentToken.forceQuirks = true; this._emitCurrentToken(); this._reconsumeInState(DATA_STATE); } else this.currentToken.systemId += toChar(cp); }; //12.2.4.66 After DOCTYPE system identifier state //------------------------------------------------------------------ _[AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE] = function afterDoctypeSystemIdentifierState(cp) { if (isWhitespace(cp)) return; if (cp === $.GREATER_THAN_SIGN) { this._emitCurrentToken(); this.state = DATA_STATE; } else if (cp === $.EOF) { this.currentToken.forceQuirks = true; this._emitCurrentToken(); this._reconsumeInState(DATA_STATE); } else this.state = BOGUS_DOCTYPE_STATE; }; //12.2.4.67 Bogus DOCTYPE state //------------------------------------------------------------------ _[BOGUS_DOCTYPE_STATE] = function bogusDoctypeState(cp) { if (cp === $.GREATER_THAN_SIGN) { this._emitCurrentToken(); this.state = DATA_STATE; } else if (cp === $.EOF) { this._emitCurrentToken(); this._reconsumeInState(DATA_STATE); } }; //12.2.4.68 CDATA section state //------------------------------------------------------------------ _[CDATA_SECTION_STATE] = function cdataSectionState(cp) { while (true) { if (cp === $.EOF) { this._reconsumeInState(DATA_STATE); break; } else { var cdataEndMatch = this._consumeSubsequentIfMatch($$.CDATA_END_STRING, cp, true); if (this._ensureHibernation()) break; if (cdataEndMatch) { this.state = DATA_STATE; break; } this._emitCodePoint(cp); this._hibernationSnapshot(); cp = this._consume(); if (this._ensureHibernation()) break; } } }; /***/ }), /* 340 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var UNICODE = __webpack_require__(341); //Aliases var $ = UNICODE.CODE_POINTS; //Utils //OPTIMIZATION: these utility functions should not be moved out of this module. V8 Crankshaft will not inline //this functions if they will be situated in another module due to context switch. //Always perform inlining check before modifying this functions ('node --trace-inlining'). function isSurrogatePair(cp1, cp2) { return cp1 >= 0xD800 && cp1 <= 0xDBFF && cp2 >= 0xDC00 && cp2 <= 0xDFFF; } function getSurrogatePairCodePoint(cp1, cp2) { return (cp1 - 0xD800) * 0x400 + 0x2400 + cp2; } //Const var DEFAULT_BUFFER_WATERLINE = 1 << 16; //Preprocessor //NOTE: HTML input preprocessing //(see: http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#preprocessing-the-input-stream) var Preprocessor = module.exports = function () { this.html = null; this.pos = -1; this.lastGapPos = -1; this.lastCharPos = -1; this.gapStack = []; this.skipNextNewLine = false; this.lastChunkWritten = false; this.endOfChunkHit = false; this.bufferWaterline = DEFAULT_BUFFER_WATERLINE; }; Preprocessor.prototype.dropParsedChunk = function () { if (this.pos > this.bufferWaterline) { this.lastCharPos -= this.pos; this.html = this.html.substring(this.pos); this.pos = 0; this.lastGapPos = -1; this.gapStack = []; } }; Preprocessor.prototype._addGap = function () { this.gapStack.push(this.lastGapPos); this.lastGapPos = this.pos; }; Preprocessor.prototype._processHighRangeCodePoint = function (cp) { //NOTE: try to peek a surrogate pair if (this.pos !== this.lastCharPos) { var nextCp = this.html.charCodeAt(this.pos + 1); if (isSurrogatePair(cp, nextCp)) { //NOTE: we have a surrogate pair. Peek pair character and recalculate code point. this.pos++; cp = getSurrogatePairCodePoint(cp, nextCp); //NOTE: add gap that should be avoided during retreat this._addGap(); } } // NOTE: we've hit the end of chunk, stop processing at this point else if (!this.lastChunkWritten) { this.endOfChunkHit = true; return $.EOF; } return cp; }; Preprocessor.prototype.write = function (chunk, isLastChunk) { if (this.html) this.html += chunk; else this.html = chunk; this.lastCharPos = this.html.length - 1; this.endOfChunkHit = false; this.lastChunkWritten = isLastChunk; }; Preprocessor.prototype.insertHtmlAtCurrentPos = function (chunk) { this.html = this.html.substring(0, this.pos + 1) + chunk + this.html.substring(this.pos + 1, this.html.length); this.lastCharPos = this.html.length - 1; this.endOfChunkHit = false; }; Preprocessor.prototype.advance = function () { this.pos++; if (this.pos > this.lastCharPos) { if (!this.lastChunkWritten) this.endOfChunkHit = true; return $.EOF; } var cp = this.html.charCodeAt(this.pos); //NOTE: any U+000A LINE FEED (LF) characters that immediately follow a U+000D CARRIAGE RETURN (CR) character //must be ignored. if (this.skipNextNewLine && cp === $.LINE_FEED) { this.skipNextNewLine = false; this._addGap(); return this.advance(); } //NOTE: all U+000D CARRIAGE RETURN (CR) characters must be converted to U+000A LINE FEED (LF) characters if (cp === $.CARRIAGE_RETURN) { this.skipNextNewLine = true; return $.LINE_FEED; } this.skipNextNewLine = false; //OPTIMIZATION: first perform check if the code point in the allowed range that covers most common //HTML input (e.g. ASCII codes) to avoid performance-cost operations for high-range code points. return cp >= 0xD800 ? this._processHighRangeCodePoint(cp) : cp; }; Preprocessor.prototype.retreat = function () { if (this.pos === this.lastGapPos) { this.lastGapPos = this.gapStack.pop(); this.pos--; } this.pos--; }; /***/ }), /* 341 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.REPLACEMENT_CHARACTER = '\uFFFD'; exports.CODE_POINTS = { EOF: -1, NULL: 0x00, TABULATION: 0x09, CARRIAGE_RETURN: 0x0D, LINE_FEED: 0x0A, FORM_FEED: 0x0C, SPACE: 0x20, EXCLAMATION_MARK: 0x21, QUOTATION_MARK: 0x22, NUMBER_SIGN: 0x23, AMPERSAND: 0x26, APOSTROPHE: 0x27, HYPHEN_MINUS: 0x2D, SOLIDUS: 0x2F, DIGIT_0: 0x30, DIGIT_9: 0x39, SEMICOLON: 0x3B, LESS_THAN_SIGN: 0x3C, EQUALS_SIGN: 0x3D, GREATER_THAN_SIGN: 0x3E, QUESTION_MARK: 0x3F, LATIN_CAPITAL_A: 0x41, LATIN_CAPITAL_F: 0x46, LATIN_CAPITAL_X: 0x58, LATIN_CAPITAL_Z: 0x5A, GRAVE_ACCENT: 0x60, LATIN_SMALL_A: 0x61, LATIN_SMALL_F: 0x66, LATIN_SMALL_X: 0x78, LATIN_SMALL_Z: 0x7A, REPLACEMENT_CHARACTER: 0xFFFD }; exports.CODE_POINT_SEQUENCES = { DASH_DASH_STRING: [0x2D, 0x2D], //-- DOCTYPE_STRING: [0x44, 0x4F, 0x43, 0x54, 0x59, 0x50, 0x45], //DOCTYPE CDATA_START_STRING: [0x5B, 0x43, 0x44, 0x41, 0x54, 0x41, 0x5B], //[CDATA[ CDATA_END_STRING: [0x5D, 0x5D, 0x3E], //]]> SCRIPT_STRING: [0x73, 0x63, 0x72, 0x69, 0x70, 0x74], //script PUBLIC_STRING: [0x50, 0x55, 0x42, 0x4C, 0x49, 0x43], //PUBLIC SYSTEM_STRING: [0x53, 0x59, 0x53, 0x54, 0x45, 0x4D] //SYSTEM }; /***/ }), /* 342 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; //NOTE: this file contains auto-generated array mapped radix tree that is used for the named entity references consumption //(details: https://github.com/inikulin/parse5/tree/master/scripts/generate_named_entity_data/README.md) module.exports = new Uint16Array([4,52,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,106,303,412,810,1432,1701,1796,1987,2114,2360,2420,2484,3170,3251,4140,4393,4575,4610,5106,5512,5728,6117,6274,6315,6345,6427,6516,7002,7910,8733,9323,9870,10170,10631,10893,11318,11386,11467,12773,13092,14474,14922,15448,15542,16419,17666,18166,18611,19004,19095,19298,19397,4,16,69,77,97,98,99,102,103,108,109,110,111,112,114,115,116,117,140,150,158,169,176,194,199,210,216,222,226,242,256,266,283,294,108,105,103,5,198,1,59,148,1,198,80,5,38,1,59,156,1,38,99,117,116,101,5,193,1,59,167,1,193,114,101,118,101,59,1,258,4,2,105,121,182,191,114,99,5,194,1,59,189,1,194,59,1,1040,114,59,3,55349,56580,114,97,118,101,5,192,1,59,208,1,192,112,104,97,59,1,913,97,99,114,59,1,256,100,59,1,10835,4,2,103,112,232,237,111,110,59,1,260,102,59,3,55349,56632,112,108,121,70,117,110,99,116,105,111,110,59,1,8289,105,110,103,5,197,1,59,264,1,197,4,2,99,115,272,277,114,59,3,55349,56476,105,103,110,59,1,8788,105,108,100,101,5,195,1,59,292,1,195,109,108,5,196,1,59,301,1,196,4,8,97,99,101,102,111,114,115,117,321,350,354,383,388,394,400,405,4,2,99,114,327,336,107,115,108,97,115,104,59,1,8726,4,2,118,119,342,345,59,1,10983,101,100,59,1,8966,121,59,1,1041,4,3,99,114,116,362,369,379,97,117,115,101,59,1,8757,110,111,117,108,108,105,115,59,1,8492,97,59,1,914,114,59,3,55349,56581,112,102,59,3,55349,56633,101,118,101,59,1,728,99,114,59,1,8492,109,112,101,113,59,1,8782,4,14,72,79,97,99,100,101,102,104,105,108,111,114,115,117,442,447,456,504,542,547,569,573,577,616,678,784,790,796,99,121,59,1,1063,80,89,5,169,1,59,454,1,169,4,3,99,112,121,464,470,497,117,116,101,59,1,262,4,2,59,105,476,478,1,8914,116,97,108,68,105,102,102,101,114,101,110,116,105,97,108,68,59,1,8517,108,101,121,115,59,1,8493,4,4,97,101,105,111,514,520,530,535,114,111,110,59,1,268,100,105,108,5,199,1,59,528,1,199,114,99,59,1,264,110,105,110,116,59,1,8752,111,116,59,1,266,4,2,100,110,553,560,105,108,108,97,59,1,184,116,101,114,68,111,116,59,1,183,114,59,1,8493,105,59,1,935,114,99,108,101,4,4,68,77,80,84,591,596,603,609,111,116,59,1,8857,105,110,117,115,59,1,8854,108,117,115,59,1,8853,105,109,101,115,59,1,8855,111,4,2,99,115,623,646,107,119,105,115,101,67,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,1,8754,101,67,117,114,108,121,4,2,68,81,658,671,111,117,98,108,101,81,117,111,116,101,59,1,8221,117,111,116,101,59,1,8217,4,4,108,110,112,117,688,701,736,753,111,110,4,2,59,101,696,698,1,8759,59,1,10868,4,3,103,105,116,709,717,722,114,117,101,110,116,59,1,8801,110,116,59,1,8751,111,117,114,73,110,116,101,103,114,97,108,59,1,8750,4,2,102,114,742,745,59,1,8450,111,100,117,99,116,59,1,8720,110,116,101,114,67,108,111,99,107,119,105,115,101,67,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,1,8755,111,115,115,59,1,10799,99,114,59,3,55349,56478,112,4,2,59,67,803,805,1,8915,97,112,59,1,8781,4,11,68,74,83,90,97,99,101,102,105,111,115,834,850,855,860,865,888,903,916,921,1011,1415,4,2,59,111,840,842,1,8517,116,114,97,104,100,59,1,10513,99,121,59,1,1026,99,121,59,1,1029,99,121,59,1,1039,4,3,103,114,115,873,879,883,103,101,114,59,1,8225,114,59,1,8609,104,118,59,1,10980,4,2,97,121,894,900,114,111,110,59,1,270,59,1,1044,108,4,2,59,116,910,912,1,8711,97,59,1,916,114,59,3,55349,56583,4,2,97,102,927,998,4,2,99,109,933,992,114,105,116,105,99,97,108,4,4,65,68,71,84,950,957,978,985,99,117,116,101,59,1,180,111,4,2,116,117,964,967,59,1,729,98,108,101,65,99,117,116,101,59,1,733,114,97,118,101,59,1,96,105,108,100,101,59,1,732,111,110,100,59,1,8900,102,101,114,101,110,116,105,97,108,68,59,1,8518,4,4,112,116,117,119,1021,1026,1048,1249,102,59,3,55349,56635,4,3,59,68,69,1034,1036,1041,1,168,111,116,59,1,8412,113,117,97,108,59,1,8784,98,108,101,4,6,67,68,76,82,85,86,1065,1082,1101,1189,1211,1236,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,1,8751,111,4,2,116,119,1089,1092,59,1,168,110,65,114,114,111,119,59,1,8659,4,2,101,111,1107,1141,102,116,4,3,65,82,84,1117,1124,1136,114,114,111,119,59,1,8656,105,103,104,116,65,114,114,111,119,59,1,8660,101,101,59,1,10980,110,103,4,2,76,82,1149,1177,101,102,116,4,2,65,82,1158,1165,114,114,111,119,59,1,10232,105,103,104,116,65,114,114,111,119,59,1,10234,105,103,104,116,65,114,114,111,119,59,1,10233,105,103,104,116,4,2,65,84,1199,1206,114,114,111,119,59,1,8658,101,101,59,1,8872,112,4,2,65,68,1218,1225,114,114,111,119,59,1,8657,111,119,110,65,114,114,111,119,59,1,8661,101,114,116,105,99,97,108,66,97,114,59,1,8741,110,4,6,65,66,76,82,84,97,1264,1292,1299,1352,1391,1408,114,114,111,119,4,3,59,66,85,1276,1278,1283,1,8595,97,114,59,1,10515,112,65,114,114,111,119,59,1,8693,114,101,118,101,59,1,785,101,102,116,4,3,82,84,86,1310,1323,1334,105,103,104,116,86,101,99,116,111,114,59,1,10576,101,101,86,101,99,116,111,114,59,1,10590,101,99,116,111,114,4,2,59,66,1345,1347,1,8637,97,114,59,1,10582,105,103,104,116,4,2,84,86,1362,1373,101,101,86,101,99,116,111,114,59,1,10591,101,99,116,111,114,4,2,59,66,1384,1386,1,8641,97,114,59,1,10583,101,101,4,2,59,65,1399,1401,1,8868,114,114,111,119,59,1,8615,114,114,111,119,59,1,8659,4,2,99,116,1421,1426,114,59,3,55349,56479,114,111,107,59,1,272,4,16,78,84,97,99,100,102,103,108,109,111,112,113,115,116,117,120,1466,1470,1478,1489,1515,1520,1525,1536,1544,1593,1609,1617,1650,1664,1668,1677,71,59,1,330,72,5,208,1,59,1476,1,208,99,117,116,101,5,201,1,59,1487,1,201,4,3,97,105,121,1497,1503,1512,114,111,110,59,1,282,114,99,5,202,1,59,1510,1,202,59,1,1069,111,116,59,1,278,114,59,3,55349,56584,114,97,118,101,5,200,1,59,1534,1,200,101,109,101,110,116,59,1,8712,4,2,97,112,1550,1555,99,114,59,1,274,116,121,4,2,83,86,1563,1576,109,97,108,108,83,113,117,97,114,101,59,1,9723,101,114,121,83,109,97,108,108,83,113,117,97,114,101,59,1,9643,4,2,103,112,1599,1604,111,110,59,1,280,102,59,3,55349,56636,115,105,108,111,110,59,1,917,117,4,2,97,105,1624,1640,108,4,2,59,84,1631,1633,1,10869,105,108,100,101,59,1,8770,108,105,98,114,105,117,109,59,1,8652,4,2,99,105,1656,1660,114,59,1,8496,109,59,1,10867,97,59,1,919,109,108,5,203,1,59,1675,1,203,4,2,105,112,1683,1689,115,116,115,59,1,8707,111,110,101,110,116,105,97,108,69,59,1,8519,4,5,99,102,105,111,115,1713,1717,1722,1762,1791,121,59,1,1060,114,59,3,55349,56585,108,108,101,100,4,2,83,86,1732,1745,109,97,108,108,83,113,117,97,114,101,59,1,9724,101,114,121,83,109,97,108,108,83,113,117,97,114,101,59,1,9642,4,3,112,114,117,1770,1775,1781,102,59,3,55349,56637,65,108,108,59,1,8704,114,105,101,114,116,114,102,59,1,8497,99,114,59,1,8497,4,12,74,84,97,98,99,100,102,103,111,114,115,116,1822,1827,1834,1848,1855,1877,1882,1887,1890,1896,1978,1984,99,121,59,1,1027,5,62,1,59,1832,1,62,109,109,97,4,2,59,100,1843,1845,1,915,59,1,988,114,101,118,101,59,1,286,4,3,101,105,121,1863,1869,1874,100,105,108,59,1,290,114,99,59,1,284,59,1,1043,111,116,59,1,288,114,59,3,55349,56586,59,1,8921,112,102,59,3,55349,56638,101,97,116,101,114,4,6,69,70,71,76,83,84,1915,1933,1944,1953,1959,1971,113,117,97,108,4,2,59,76,1925,1927,1,8805,101,115,115,59,1,8923,117,108,108,69,113,117,97,108,59,1,8807,114,101,97,116,101,114,59,1,10914,101,115,115,59,1,8823,108,97,110,116,69,113,117,97,108,59,1,10878,105,108,100,101,59,1,8819,99,114,59,3,55349,56482,59,1,8811,4,8,65,97,99,102,105,111,115,117,2005,2012,2026,2032,2036,2049,2073,2089,82,68,99,121,59,1,1066,4,2,99,116,2018,2023,101,107,59,1,711,59,1,94,105,114,99,59,1,292,114,59,1,8460,108,98,101,114,116,83,112,97,99,101,59,1,8459,4,2,112,114,2055,2059,102,59,1,8461,105,122,111,110,116,97,108,76,105,110,101,59,1,9472,4,2,99,116,2079,2083,114,59,1,8459,114,111,107,59,1,294,109,112,4,2,68,69,2097,2107,111,119,110,72,117,109,112,59,1,8782,113,117,97,108,59,1,8783,4,14,69,74,79,97,99,100,102,103,109,110,111,115,116,117,2144,2149,2155,2160,2171,2189,2194,2198,2209,2245,2307,2329,2334,2341,99,121,59,1,1045,108,105,103,59,1,306,99,121,59,1,1025,99,117,116,101,5,205,1,59,2169,1,205,4,2,105,121,2177,2186,114,99,5,206,1,59,2184,1,206,59,1,1048,111,116,59,1,304,114,59,1,8465,114,97,118,101,5,204,1,59,2207,1,204,4,3,59,97,112,2217,2219,2238,1,8465,4,2,99,103,2225,2229,114,59,1,298,105,110,97,114,121,73,59,1,8520,108,105,101,115,59,1,8658,4,2,116,118,2251,2281,4,2,59,101,2257,2259,1,8748,4,2,103,114,2265,2271,114,97,108,59,1,8747,115,101,99,116,105,111,110,59,1,8898,105,115,105,98,108,101,4,2,67,84,2293,2300,111,109,109,97,59,1,8291,105,109,101,115,59,1,8290,4,3,103,112,116,2315,2320,2325,111,110,59,1,302,102,59,3,55349,56640,97,59,1,921,99,114,59,1,8464,105,108,100,101,59,1,296,4,2,107,109,2347,2352,99,121,59,1,1030,108,5,207,1,59,2358,1,207,4,5,99,102,111,115,117,2372,2386,2391,2397,2414,4,2,105,121,2378,2383,114,99,59,1,308,59,1,1049,114,59,3,55349,56589,112,102,59,3,55349,56641,4,2,99,101,2403,2408,114,59,3,55349,56485,114,99,121,59,1,1032,107,99,121,59,1,1028,4,7,72,74,97,99,102,111,115,2436,2441,2446,2452,2467,2472,2478,99,121,59,1,1061,99,121,59,1,1036,112,112,97,59,1,922,4,2,101,121,2458,2464,100,105,108,59,1,310,59,1,1050,114,59,3,55349,56590,112,102,59,3,55349,56642,99,114,59,3,55349,56486,4,11,74,84,97,99,101,102,108,109,111,115,116,2508,2513,2520,2562,2585,2981,2986,3004,3011,3146,3167,99,121,59,1,1033,5,60,1,59,2518,1,60,4,5,99,109,110,112,114,2532,2538,2544,2548,2558,117,116,101,59,1,313,98,100,97,59,1,923,103,59,1,10218,108,97,99,101,116,114,102,59,1,8466,114,59,1,8606,4,3,97,101,121,2570,2576,2582,114,111,110,59,1,317,100,105,108,59,1,315,59,1,1051,4,2,102,115,2591,2907,116,4,10,65,67,68,70,82,84,85,86,97,114,2614,2663,2672,2728,2735,2760,2820,2870,2888,2895,4,2,110,114,2620,2633,103,108,101,66,114,97,99,107,101,116,59,1,10216,114,111,119,4,3,59,66,82,2644,2646,2651,1,8592,97,114,59,1,8676,105,103,104,116,65,114,114,111,119,59,1,8646,101,105,108,105,110,103,59,1,8968,111,4,2,117,119,2679,2692,98,108,101,66,114,97,99,107,101,116,59,1,10214,110,4,2,84,86,2699,2710,101,101,86,101,99,116,111,114,59,1,10593,101,99,116,111,114,4,2,59,66,2721,2723,1,8643,97,114,59,1,10585,108,111,111,114,59,1,8970,105,103,104,116,4,2,65,86,2745,2752,114,114,111,119,59,1,8596,101,99,116,111,114,59,1,10574,4,2,101,114,2766,2792,101,4,3,59,65,86,2775,2777,2784,1,8867,114,114,111,119,59,1,8612,101,99,116,111,114,59,1,10586,105,97,110,103,108,101,4,3,59,66,69,2806,2808,2813,1,8882,97,114,59,1,10703,113,117,97,108,59,1,8884,112,4,3,68,84,86,2829,2841,2852,111,119,110,86,101,99,116,111,114,59,1,10577,101,101,86,101,99,116,111,114,59,1,10592,101,99,116,111,114,4,2,59,66,2863,2865,1,8639,97,114,59,1,10584,101,99,116,111,114,4,2,59,66,2881,2883,1,8636,97,114,59,1,10578,114,114,111,119,59,1,8656,105,103,104,116,97,114,114,111,119,59,1,8660,115,4,6,69,70,71,76,83,84,2922,2936,2947,2956,2962,2974,113,117,97,108,71,114,101,97,116,101,114,59,1,8922,117,108,108,69,113,117,97,108,59,1,8806,114,101,97,116,101,114,59,1,8822,101,115,115,59,1,10913,108,97,110,116,69,113,117,97,108,59,1,10877,105,108,100,101,59,1,8818,114,59,3,55349,56591,4,2,59,101,2992,2994,1,8920,102,116,97,114,114,111,119,59,1,8666,105,100,111,116,59,1,319,4,3,110,112,119,3019,3110,3115,103,4,4,76,82,108,114,3030,3058,3070,3098,101,102,116,4,2,65,82,3039,3046,114,114,111,119,59,1,10229,105,103,104,116,65,114,114,111,119,59,1,10231,105,103,104,116,65,114,114,111,119,59,1,10230,101,102,116,4,2,97,114,3079,3086,114,114,111,119,59,1,10232,105,103,104,116,97,114,114,111,119,59,1,10234,105,103,104,116,97,114,114,111,119,59,1,10233,102,59,3,55349,56643,101,114,4,2,76,82,3123,3134,101,102,116,65,114,114,111,119,59,1,8601,105,103,104,116,65,114,114,111,119,59,1,8600,4,3,99,104,116,3154,3158,3161,114,59,1,8466,59,1,8624,114,111,107,59,1,321,59,1,8810,4,8,97,99,101,102,105,111,115,117,3188,3192,3196,3222,3227,3237,3243,3248,112,59,1,10501,121,59,1,1052,4,2,100,108,3202,3213,105,117,109,83,112,97,99,101,59,1,8287,108,105,110,116,114,102,59,1,8499,114,59,3,55349,56592,110,117,115,80,108,117,115,59,1,8723,112,102,59,3,55349,56644,99,114,59,1,8499,59,1,924,4,9,74,97,99,101,102,111,115,116,117,3271,3276,3283,3306,3422,3427,4120,4126,4137,99,121,59,1,1034,99,117,116,101,59,1,323,4,3,97,101,121,3291,3297,3303,114,111,110,59,1,327,100,105,108,59,1,325,59,1,1053,4,3,103,115,119,3314,3380,3415,97,116,105,118,101,4,3,77,84,86,3327,3340,3365,101,100,105,117,109,83,112,97,99,101,59,1,8203,104,105,4,2,99,110,3348,3357,107,83,112,97,99,101,59,1,8203,83,112,97,99,101,59,1,8203,101,114,121,84,104,105,110,83,112,97,99,101,59,1,8203,116,101,100,4,2,71,76,3389,3405,114,101,97,116,101,114,71,114,101,97,116,101,114,59,1,8811,101,115,115,76,101,115,115,59,1,8810,76,105,110,101,59,1,10,114,59,3,55349,56593,4,4,66,110,112,116,3437,3444,3460,3464,114,101,97,107,59,1,8288,66,114,101,97,107,105,110,103,83,112,97,99,101,59,1,160,102,59,1,8469,4,13,59,67,68,69,71,72,76,78,80,82,83,84,86,3492,3494,3517,3536,3578,3657,3685,3784,3823,3860,3915,4066,4107,1,10988,4,2,111,117,3500,3510,110,103,114,117,101,110,116,59,1,8802,112,67,97,112,59,1,8813,111,117,98,108,101,86,101,114,116,105,99,97,108,66,97,114,59,1,8742,4,3,108,113,120,3544,3552,3571,101,109,101,110,116,59,1,8713,117,97,108,4,2,59,84,3561,3563,1,8800,105,108,100,101,59,3,8770,824,105,115,116,115,59,1,8708,114,101,97,116,101,114,4,7,59,69,70,71,76,83,84,3600,3602,3609,3621,3631,3637,3650,1,8815,113,117,97,108,59,1,8817,117,108,108,69,113,117,97,108,59,3,8807,824,114,101,97,116,101,114,59,3,8811,824,101,115,115,59,1,8825,108,97,110,116,69,113,117,97,108,59,3,10878,824,105,108,100,101,59,1,8821,117,109,112,4,2,68,69,3666,3677,111,119,110,72,117,109,112,59,3,8782,824,113,117,97,108,59,3,8783,824,101,4,2,102,115,3692,3724,116,84,114,105,97,110,103,108,101,4,3,59,66,69,3709,3711,3717,1,8938,97,114,59,3,10703,824,113,117,97,108,59,1,8940,115,4,6,59,69,71,76,83,84,3739,3741,3748,3757,3764,3777,1,8814,113,117,97,108,59,1,8816,114,101,97,116,101,114,59,1,8824,101,115,115,59,3,8810,824,108,97,110,116,69,113,117,97,108,59,3,10877,824,105,108,100,101,59,1,8820,101,115,116,101,100,4,2,71,76,3795,3812,114,101,97,116,101,114,71,114,101,97,116,101,114,59,3,10914,824,101,115,115,76,101,115,115,59,3,10913,824,114,101,99,101,100,101,115,4,3,59,69,83,3838,3840,3848,1,8832,113,117,97,108,59,3,10927,824,108,97,110,116,69,113,117,97,108,59,1,8928,4,2,101,105,3866,3881,118,101,114,115,101,69,108,101,109,101,110,116,59,1,8716,103,104,116,84,114,105,97,110,103,108,101,4,3,59,66,69,3900,3902,3908,1,8939,97,114,59,3,10704,824,113,117,97,108,59,1,8941,4,2,113,117,3921,3973,117,97,114,101,83,117,4,2,98,112,3933,3952,115,101,116,4,2,59,69,3942,3945,3,8847,824,113,117,97,108,59,1,8930,101,114,115,101,116,4,2,59,69,3963,3966,3,8848,824,113,117,97,108,59,1,8931,4,3,98,99,112,3981,4000,4045,115,101,116,4,2,59,69,3990,3993,3,8834,8402,113,117,97,108,59,1,8840,99,101,101,100,115,4,4,59,69,83,84,4015,4017,4025,4037,1,8833,113,117,97,108,59,3,10928,824,108,97,110,116,69,113,117,97,108,59,1,8929,105,108,100,101,59,3,8831,824,101,114,115,101,116,4,2,59,69,4056,4059,3,8835,8402,113,117,97,108,59,1,8841,105,108,100,101,4,4,59,69,70,84,4080,4082,4089,4100,1,8769,113,117,97,108,59,1,8772,117,108,108,69,113,117,97,108,59,1,8775,105,108,100,101,59,1,8777,101,114,116,105,99,97,108,66,97,114,59,1,8740,99,114,59,3,55349,56489,105,108,100,101,5,209,1,59,4135,1,209,59,1,925,4,14,69,97,99,100,102,103,109,111,112,114,115,116,117,118,4170,4176,4187,4205,4212,4217,4228,4253,4259,4292,4295,4316,4337,4346,108,105,103,59,1,338,99,117,116,101,5,211,1,59,4185,1,211,4,2,105,121,4193,4202,114,99,5,212,1,59,4200,1,212,59,1,1054,98,108,97,99,59,1,336,114,59,3,55349,56594,114,97,118,101,5,210,1,59,4226,1,210,4,3,97,101,105,4236,4241,4246,99,114,59,1,332,103,97,59,1,937,99,114,111,110,59,1,927,112,102,59,3,55349,56646,101,110,67,117,114,108,121,4,2,68,81,4272,4285,111,117,98,108,101,81,117,111,116,101,59,1,8220,117,111,116,101,59,1,8216,59,1,10836,4,2,99,108,4301,4306,114,59,3,55349,56490,97,115,104,5,216,1,59,4314,1,216,105,4,2,108,109,4323,4332,100,101,5,213,1,59,4330,1,213,101,115,59,1,10807,109,108,5,214,1,59,4344,1,214,101,114,4,2,66,80,4354,4380,4,2,97,114,4360,4364,114,59,1,8254,97,99,4,2,101,107,4372,4375,59,1,9182,101,116,59,1,9140,97,114,101,110,116,104,101,115,105,115,59,1,9180,4,9,97,99,102,104,105,108,111,114,115,4413,4422,4426,4431,4435,4438,4448,4471,4561,114,116,105,97,108,68,59,1,8706,121,59,1,1055,114,59,3,55349,56595,105,59,1,934,59,1,928,117,115,77,105,110,117,115,59,1,177,4,2,105,112,4454,4467,110,99,97,114,101,112,108,97,110,101,59,1,8460,102,59,1,8473,4,4,59,101,105,111,4481,4483,4526,4531,1,10939,99,101,100,101,115,4,4,59,69,83,84,4498,4500,4507,4519,1,8826,113,117,97,108,59,1,10927,108,97,110,116,69,113,117,97,108,59,1,8828,105,108,100,101,59,1,8830,109,101,59,1,8243,4,2,100,112,4537,4543,117,99,116,59,1,8719,111,114,116,105,111,110,4,2,59,97,4555,4557,1,8759,108,59,1,8733,4,2,99,105,4567,4572,114,59,3,55349,56491,59,1,936,4,4,85,102,111,115,4585,4594,4599,4604,79,84,5,34,1,59,4592,1,34,114,59,3,55349,56596,112,102,59,1,8474,99,114,59,3,55349,56492,4,12,66,69,97,99,101,102,104,105,111,114,115,117,4636,4642,4650,4681,4704,4763,4767,4771,5047,5069,5081,5094,97,114,114,59,1,10512,71,5,174,1,59,4648,1,174,4,3,99,110,114,4658,4664,4668,117,116,101,59,1,340,103,59,1,10219,114,4,2,59,116,4675,4677,1,8608,108,59,1,10518,4,3,97,101,121,4689,4695,4701,114,111,110,59,1,344,100,105,108,59,1,342,59,1,1056,4,2,59,118,4710,4712,1,8476,101,114,115,101,4,2,69,85,4722,4748,4,2,108,113,4728,4736,101,109,101,110,116,59,1,8715,117,105,108,105,98,114,105,117,109,59,1,8651,112,69,113,117,105,108,105,98,114,105,117,109,59,1,10607,114,59,1,8476,111,59,1,929,103,104,116,4,8,65,67,68,70,84,85,86,97,4792,4840,4849,4905,4912,4972,5022,5040,4,2,110,114,4798,4811,103,108,101,66,114,97,99,107,101,116,59,1,10217,114,111,119,4,3,59,66,76,4822,4824,4829,1,8594,97,114,59,1,8677,101,102,116,65,114,114,111,119,59,1,8644,101,105,108,105,110,103,59,1,8969,111,4,2,117,119,4856,4869,98,108,101,66,114,97,99,107,101,116,59,1,10215,110,4,2,84,86,4876,4887,101,101,86,101,99,116,111,114,59,1,10589,101,99,116,111,114,4,2,59,66,4898,4900,1,8642,97,114,59,1,10581,108,111,111,114,59,1,8971,4,2,101,114,4918,4944,101,4,3,59,65,86,4927,4929,4936,1,8866,114,114,111,119,59,1,8614,101,99,116,111,114,59,1,10587,105,97,110,103,108,101,4,3,59,66,69,4958,4960,4965,1,8883,97,114,59,1,10704,113,117,97,108,59,1,8885,112,4,3,68,84,86,4981,4993,5004,111,119,110,86,101,99,116,111,114,59,1,10575,101,101,86,101,99,116,111,114,59,1,10588,101,99,116,111,114,4,2,59,66,5015,5017,1,8638,97,114,59,1,10580,101,99,116,111,114,4,2,59,66,5033,5035,1,8640,97,114,59,1,10579,114,114,111,119,59,1,8658,4,2,112,117,5053,5057,102,59,1,8477,110,100,73,109,112,108,105,101,115,59,1,10608,105,103,104,116,97,114,114,111,119,59,1,8667,4,2,99,104,5087,5091,114,59,1,8475,59,1,8625,108,101,68,101,108,97,121,101,100,59,1,10740,4,13,72,79,97,99,102,104,105,109,111,113,115,116,117,5134,5150,5157,5164,5198,5203,5259,5265,5277,5283,5374,5380,5385,4,2,67,99,5140,5146,72,99,121,59,1,1065,121,59,1,1064,70,84,99,121,59,1,1068,99,117,116,101,59,1,346,4,5,59,97,101,105,121,5176,5178,5184,5190,5195,1,10940,114,111,110,59,1,352,100,105,108,59,1,350,114,99,59,1,348,59,1,1057,114,59,3,55349,56598,111,114,116,4,4,68,76,82,85,5216,5227,5238,5250,111,119,110,65,114,114,111,119,59,1,8595,101,102,116,65,114,114,111,119,59,1,8592,105,103,104,116,65,114,114,111,119,59,1,8594,112,65,114,114,111,119,59,1,8593,103,109,97,59,1,931,97,108,108,67,105,114,99,108,101,59,1,8728,112,102,59,3,55349,56650,4,2,114,117,5289,5293,116,59,1,8730,97,114,101,4,4,59,73,83,85,5306,5308,5322,5367,1,9633,110,116,101,114,115,101,99,116,105,111,110,59,1,8851,117,4,2,98,112,5329,5347,115,101,116,4,2,59,69,5338,5340,1,8847,113,117,97,108,59,1,8849,101,114,115,101,116,4,2,59,69,5358,5360,1,8848,113,117,97,108,59,1,8850,110,105,111,110,59,1,8852,99,114,59,3,55349,56494,97,114,59,1,8902,4,4,98,99,109,112,5395,5420,5475,5478,4,2,59,115,5401,5403,1,8912,101,116,4,2,59,69,5411,5413,1,8912,113,117,97,108,59,1,8838,4,2,99,104,5426,5468,101,101,100,115,4,4,59,69,83,84,5440,5442,5449,5461,1,8827,113,117,97,108,59,1,10928,108,97,110,116,69,113,117,97,108,59,1,8829,105,108,100,101,59,1,8831,84,104,97,116,59,1,8715,59,1,8721,4,3,59,101,115,5486,5488,5507,1,8913,114,115,101,116,4,2,59,69,5498,5500,1,8835,113,117,97,108,59,1,8839,101,116,59,1,8913,4,11,72,82,83,97,99,102,104,105,111,114,115,5536,5546,5552,5567,5579,5602,5607,5655,5695,5701,5711,79,82,78,5,222,1,59,5544,1,222,65,68,69,59,1,8482,4,2,72,99,5558,5563,99,121,59,1,1035,121,59,1,1062,4,2,98,117,5573,5576,59,1,9,59,1,932,4,3,97,101,121,5587,5593,5599,114,111,110,59,1,356,100,105,108,59,1,354,59,1,1058,114,59,3,55349,56599,4,2,101,105,5613,5631,4,2,114,116,5619,5627,101,102,111,114,101,59,1,8756,97,59,1,920,4,2,99,110,5637,5647,107,83,112,97,99,101,59,3,8287,8202,83,112,97,99,101,59,1,8201,108,100,101,4,4,59,69,70,84,5668,5670,5677,5688,1,8764,113,117,97,108,59,1,8771,117,108,108,69,113,117,97,108,59,1,8773,105,108,100,101,59,1,8776,112,102,59,3,55349,56651,105,112,108,101,68,111,116,59,1,8411,4,2,99,116,5717,5722,114,59,3,55349,56495,114,111,107,59,1,358,4,14,97,98,99,100,102,103,109,110,111,112,114,115,116,117,5758,5789,5805,5823,5830,5835,5846,5852,5921,5937,6089,6095,6101,6108,4,2,99,114,5764,5774,117,116,101,5,218,1,59,5772,1,218,114,4,2,59,111,5781,5783,1,8607,99,105,114,59,1,10569,114,4,2,99,101,5796,5800,121,59,1,1038,118,101,59,1,364,4,2,105,121,5811,5820,114,99,5,219,1,59,5818,1,219,59,1,1059,98,108,97,99,59,1,368,114,59,3,55349,56600,114,97,118,101,5,217,1,59,5844,1,217,97,99,114,59,1,362,4,2,100,105,5858,5905,101,114,4,2,66,80,5866,5892,4,2,97,114,5872,5876,114,59,1,95,97,99,4,2,101,107,5884,5887,59,1,9183,101,116,59,1,9141,97,114,101,110,116,104,101,115,105,115,59,1,9181,111,110,4,2,59,80,5913,5915,1,8899,108,117,115,59,1,8846,4,2,103,112,5927,5932,111,110,59,1,370,102,59,3,55349,56652,4,8,65,68,69,84,97,100,112,115,5955,5985,5996,6009,6026,6033,6044,6075,114,114,111,119,4,3,59,66,68,5967,5969,5974,1,8593,97,114,59,1,10514,111,119,110,65,114,114,111,119,59,1,8645,111,119,110,65,114,114,111,119,59,1,8597,113,117,105,108,105,98,114,105,117,109,59,1,10606,101,101,4,2,59,65,6017,6019,1,8869,114,114,111,119,59,1,8613,114,114,111,119,59,1,8657,111,119,110,97,114,114,111,119,59,1,8661,101,114,4,2,76,82,6052,6063,101,102,116,65,114,114,111,119,59,1,8598,105,103,104,116,65,114,114,111,119,59,1,8599,105,4,2,59,108,6082,6084,1,978,111,110,59,1,933,105,110,103,59,1,366,99,114,59,3,55349,56496,105,108,100,101,59,1,360,109,108,5,220,1,59,6115,1,220,4,9,68,98,99,100,101,102,111,115,118,6137,6143,6148,6152,6166,6250,6255,6261,6267,97,115,104,59,1,8875,97,114,59,1,10987,121,59,1,1042,97,115,104,4,2,59,108,6161,6163,1,8873,59,1,10982,4,2,101,114,6172,6175,59,1,8897,4,3,98,116,121,6183,6188,6238,97,114,59,1,8214,4,2,59,105,6194,6196,1,8214,99,97,108,4,4,66,76,83,84,6209,6214,6220,6231,97,114,59,1,8739,105,110,101,59,1,124,101,112,97,114,97,116,111,114,59,1,10072,105,108,100,101,59,1,8768,84,104,105,110,83,112,97,99,101,59,1,8202,114,59,3,55349,56601,112,102,59,3,55349,56653,99,114,59,3,55349,56497,100,97,115,104,59,1,8874,4,5,99,101,102,111,115,6286,6292,6298,6303,6309,105,114,99,59,1,372,100,103,101,59,1,8896,114,59,3,55349,56602,112,102,59,3,55349,56654,99,114,59,3,55349,56498,4,4,102,105,111,115,6325,6330,6333,6339,114,59,3,55349,56603,59,1,926,112,102,59,3,55349,56655,99,114,59,3,55349,56499,4,9,65,73,85,97,99,102,111,115,117,6365,6370,6375,6380,6391,6405,6410,6416,6422,99,121,59,1,1071,99,121,59,1,1031,99,121,59,1,1070,99,117,116,101,5,221,1,59,6389,1,221,4,2,105,121,6397,6402,114,99,59,1,374,59,1,1067,114,59,3,55349,56604,112,102,59,3,55349,56656,99,114,59,3,55349,56500,109,108,59,1,376,4,8,72,97,99,100,101,102,111,115,6445,6450,6457,6472,6477,6501,6505,6510,99,121,59,1,1046,99,117,116,101,59,1,377,4,2,97,121,6463,6469,114,111,110,59,1,381,59,1,1047,111,116,59,1,379,4,2,114,116,6483,6497,111,87,105,100,116,104,83,112,97,99,101,59,1,8203,97,59,1,918,114,59,1,8488,112,102,59,1,8484,99,114,59,3,55349,56501,4,16,97,98,99,101,102,103,108,109,110,111,112,114,115,116,117,119,6550,6561,6568,6612,6622,6634,6645,6672,6699,6854,6870,6923,6933,6963,6974,6983,99,117,116,101,5,225,1,59,6559,1,225,114,101,118,101,59,1,259,4,6,59,69,100,105,117,121,6582,6584,6588,6591,6600,6609,1,8766,59,3,8766,819,59,1,8767,114,99,5,226,1,59,6598,1,226,116,101,5,180,1,59,6607,1,180,59,1,1072,108,105,103,5,230,1,59,6620,1,230,4,2,59,114,6628,6630,1,8289,59,3,55349,56606,114,97,118,101,5,224,1,59,6643,1,224,4,2,101,112,6651,6667,4,2,102,112,6657,6663,115,121,109,59,1,8501,104,59,1,8501,104,97,59,1,945,4,2,97,112,6678,6692,4,2,99,108,6684,6688,114,59,1,257,103,59,1,10815,5,38,1,59,6697,1,38,4,2,100,103,6705,6737,4,5,59,97,100,115,118,6717,6719,6724,6727,6734,1,8743,110,100,59,1,10837,59,1,10844,108,111,112,101,59,1,10840,59,1,10842,4,7,59,101,108,109,114,115,122,6753,6755,6758,6762,6814,6835,6848,1,8736,59,1,10660,101,59,1,8736,115,100,4,2,59,97,6770,6772,1,8737,4,8,97,98,99,100,101,102,103,104,6790,6793,6796,6799,6802,6805,6808,6811,59,1,10664,59,1,10665,59,1,10666,59,1,10667,59,1,10668,59,1,10669,59,1,10670,59,1,10671,116,4,2,59,118,6821,6823,1,8735,98,4,2,59,100,6830,6832,1,8894,59,1,10653,4,2,112,116,6841,6845,104,59,1,8738,59,1,197,97,114,114,59,1,9084,4,2,103,112,6860,6865,111,110,59,1,261,102,59,3,55349,56658,4,7,59,69,97,101,105,111,112,6886,6888,6891,6897,6900,6904,6908,1,8776,59,1,10864,99,105,114,59,1,10863,59,1,8778,100,59,1,8779,115,59,1,39,114,111,120,4,2,59,101,6917,6919,1,8776,113,59,1,8778,105,110,103,5,229,1,59,6931,1,229,4,3,99,116,121,6941,6946,6949,114,59,3,55349,56502,59,1,42,109,112,4,2,59,101,6957,6959,1,8776,113,59,1,8781,105,108,100,101,5,227,1,59,6972,1,227,109,108,5,228,1,59,6981,1,228,4,2,99,105,6989,6997,111,110,105,110,116,59,1,8755,110,116,59,1,10769,4,16,78,97,98,99,100,101,102,105,107,108,110,111,112,114,115,117,7036,7041,7119,7135,7149,7155,7219,7224,7347,7354,7463,7489,7786,7793,7814,7866,111,116,59,1,10989,4,2,99,114,7047,7094,107,4,4,99,101,112,115,7058,7064,7073,7080,111,110,103,59,1,8780,112,115,105,108,111,110,59,1,1014,114,105,109,101,59,1,8245,105,109,4,2,59,101,7088,7090,1,8765,113,59,1,8909,4,2,118,119,7100,7105,101,101,59,1,8893,101,100,4,2,59,103,7113,7115,1,8965,101,59,1,8965,114,107,4,2,59,116,7127,7129,1,9141,98,114,107,59,1,9142,4,2,111,121,7141,7146,110,103,59,1,8780,59,1,1073,113,117,111,59,1,8222,4,5,99,109,112,114,116,7167,7181,7188,7193,7199,97,117,115,4,2,59,101,7176,7178,1,8757,59,1,8757,112,116,121,118,59,1,10672,115,105,59,1,1014,110,111,117,59,1,8492,4,3,97,104,119,7207,7210,7213,59,1,946,59,1,8502,101,101,110,59,1,8812,114,59,3,55349,56607,103,4,7,99,111,115,116,117,118,119,7241,7262,7288,7305,7328,7335,7340,4,3,97,105,117,7249,7253,7258,112,59,1,8898,114,99,59,1,9711,112,59,1,8899,4,3,100,112,116,7270,7275,7281,111,116,59,1,10752,108,117,115,59,1,10753,105,109,101,115,59,1,10754,4,2,113,116,7294,7300,99,117,112,59,1,10758,97,114,59,1,9733,114,105,97,110,103,108,101,4,2,100,117,7318,7324,111,119,110,59,1,9661,112,59,1,9651,112,108,117,115,59,1,10756,101,101,59,1,8897,101,100,103,101,59,1,8896,97,114,111,119,59,1,10509,4,3,97,107,111,7362,7436,7458,4,2,99,110,7368,7432,107,4,3,108,115,116,7377,7386,7394,111,122,101,110,103,101,59,1,10731,113,117,97,114,101,59,1,9642,114,105,97,110,103,108,101,4,4,59,100,108,114,7411,7413,7419,7425,1,9652,111,119,110,59,1,9662,101,102,116,59,1,9666,105,103,104,116,59,1,9656,107,59,1,9251,4,2,49,51,7442,7454,4,2,50,52,7448,7451,59,1,9618,59,1,9617,52,59,1,9619,99,107,59,1,9608,4,2,101,111,7469,7485,4,2,59,113,7475,7478,3,61,8421,117,105,118,59,3,8801,8421,116,59,1,8976,4,4,112,116,119,120,7499,7504,7517,7523,102,59,3,55349,56659,4,2,59,116,7510,7512,1,8869,111,109,59,1,8869,116,105,101,59,1,8904,4,12,68,72,85,86,98,100,104,109,112,116,117,118,7549,7571,7597,7619,7655,7660,7682,7708,7715,7721,7728,7750,4,4,76,82,108,114,7559,7562,7565,7568,59,1,9559,59,1,9556,59,1,9558,59,1,9555,4,5,59,68,85,100,117,7583,7585,7588,7591,7594,1,9552,59,1,9574,59,1,9577,59,1,9572,59,1,9575,4,4,76,82,108,114,7607,7610,7613,7616,59,1,9565,59,1,9562,59,1,9564,59,1,9561,4,7,59,72,76,82,104,108,114,7635,7637,7640,7643,7646,7649,7652,1,9553,59,1,9580,59,1,9571,59,1,9568,59,1,9579,59,1,9570,59,1,9567,111,120,59,1,10697,4,4,76,82,108,114,7670,7673,7676,7679,59,1,9557,59,1,9554,59,1,9488,59,1,9484,4,5,59,68,85,100,117,7694,7696,7699,7702,7705,1,9472,59,1,9573,59,1,9576,59,1,9516,59,1,9524,105,110,117,115,59,1,8863,108,117,115,59,1,8862,105,109,101,115,59,1,8864,4,4,76,82,108,114,7738,7741,7744,7747,59,1,9563,59,1,9560,59,1,9496,59,1,9492,4,7,59,72,76,82,104,108,114,7766,7768,7771,7774,7777,7780,7783,1,9474,59,1,9578,59,1,9569,59,1,9566,59,1,9532,59,1,9508,59,1,9500,114,105,109,101,59,1,8245,4,2,101,118,7799,7804,118,101,59,1,728,98,97,114,5,166,1,59,7812,1,166,4,4,99,101,105,111,7824,7829,7834,7846,114,59,3,55349,56503,109,105,59,1,8271,109,4,2,59,101,7841,7843,1,8765,59,1,8909,108,4,3,59,98,104,7855,7857,7860,1,92,59,1,10693,115,117,98,59,1,10184,4,2,108,109,7872,7885,108,4,2,59,101,7879,7881,1,8226,116,59,1,8226,112,4,3,59,69,101,7894,7896,7899,1,8782,59,1,10926,4,2,59,113,7905,7907,1,8783,59,1,8783,4,15,97,99,100,101,102,104,105,108,111,114,115,116,117,119,121,7942,8021,8075,8080,8121,8126,8157,8279,8295,8430,8446,8485,8491,8707,8726,4,3,99,112,114,7950,7956,8007,117,116,101,59,1,263,4,6,59,97,98,99,100,115,7970,7972,7977,7984,7998,8003,1,8745,110,100,59,1,10820,114,99,117,112,59,1,10825,4,2,97,117,7990,7994,112,59,1,10827,112,59,1,10823,111,116,59,1,10816,59,3,8745,65024,4,2,101,111,8013,8017,116,59,1,8257,110,59,1,711,4,4,97,101,105,117,8031,8046,8056,8061,4,2,112,114,8037,8041,115,59,1,10829,111,110,59,1,269,100,105,108,5,231,1,59,8054,1,231,114,99,59,1,265,112,115,4,2,59,115,8069,8071,1,10828,109,59,1,10832,111,116,59,1,267,4,3,100,109,110,8088,8097,8104,105,108,5,184,1,59,8095,1,184,112,116,121,118,59,1,10674,116,5,162,2,59,101,8112,8114,1,162,114,100,111,116,59,1,183,114,59,3,55349,56608,4,3,99,101,105,8134,8138,8154,121,59,1,1095,99,107,4,2,59,109,8146,8148,1,10003,97,114,107,59,1,10003,59,1,967,114,4,7,59,69,99,101,102,109,115,8174,8176,8179,8258,8261,8268,8273,1,9675,59,1,10691,4,3,59,101,108,8187,8189,8193,1,710,113,59,1,8791,101,4,2,97,100,8200,8223,114,114,111,119,4,2,108,114,8210,8216,101,102,116,59,1,8634,105,103,104,116,59,1,8635,4,5,82,83,97,99,100,8235,8238,8241,8246,8252,59,1,174,59,1,9416,115,116,59,1,8859,105,114,99,59,1,8858,97,115,104,59,1,8861,59,1,8791,110,105,110,116,59,1,10768,105,100,59,1,10991,99,105,114,59,1,10690,117,98,115,4,2,59,117,8288,8290,1,9827,105,116,59,1,9827,4,4,108,109,110,112,8305,8326,8376,8400,111,110,4,2,59,101,8313,8315,1,58,4,2,59,113,8321,8323,1,8788,59,1,8788,4,2,109,112,8332,8344,97,4,2,59,116,8339,8341,1,44,59,1,64,4,3,59,102,108,8352,8354,8358,1,8705,110,59,1,8728,101,4,2,109,120,8365,8371,101,110,116,59,1,8705,101,115,59,1,8450,4,2,103,105,8382,8395,4,2,59,100,8388,8390,1,8773,111,116,59,1,10861,110,116,59,1,8750,4,3,102,114,121,8408,8412,8417,59,3,55349,56660,111,100,59,1,8720,5,169,2,59,115,8424,8426,1,169,114,59,1,8471,4,2,97,111,8436,8441,114,114,59,1,8629,115,115,59,1,10007,4,2,99,117,8452,8457,114,59,3,55349,56504,4,2,98,112,8463,8474,4,2,59,101,8469,8471,1,10959,59,1,10961,4,2,59,101,8480,8482,1,10960,59,1,10962,100,111,116,59,1,8943,4,7,100,101,108,112,114,118,119,8507,8522,8536,8550,8600,8697,8702,97,114,114,4,2,108,114,8516,8519,59,1,10552,59,1,10549,4,2,112,115,8528,8532,114,59,1,8926,99,59,1,8927,97,114,114,4,2,59,112,8545,8547,1,8630,59,1,10557,4,6,59,98,99,100,111,115,8564,8566,8573,8587,8592,8596,1,8746,114,99,97,112,59,1,10824,4,2,97,117,8579,8583,112,59,1,10822,112,59,1,10826,111,116,59,1,8845,114,59,1,10821,59,3,8746,65024,4,4,97,108,114,118,8610,8623,8663,8672,114,114,4,2,59,109,8618,8620,1,8631,59,1,10556,121,4,3,101,118,119,8632,8651,8656,113,4,2,112,115,8639,8645,114,101,99,59,1,8926,117,99,99,59,1,8927,101,101,59,1,8910,101,100,103,101,59,1,8911,101,110,5,164,1,59,8670,1,164,101,97,114,114,111,119,4,2,108,114,8684,8690,101,102,116,59,1,8630,105,103,104,116,59,1,8631,101,101,59,1,8910,101,100,59,1,8911,4,2,99,105,8713,8721,111,110,105,110,116,59,1,8754,110,116,59,1,8753,108,99,116,121,59,1,9005,4,19,65,72,97,98,99,100,101,102,104,105,106,108,111,114,115,116,117,119,122,8773,8778,8783,8821,8839,8854,8887,8914,8930,8944,9036,9041,9058,9197,9227,9258,9281,9297,9305,114,114,59,1,8659,97,114,59,1,10597,4,4,103,108,114,115,8793,8799,8805,8809,103,101,114,59,1,8224,101,116,104,59,1,8504,114,59,1,8595,104,4,2,59,118,8816,8818,1,8208,59,1,8867,4,2,107,108,8827,8834,97,114,111,119,59,1,10511,97,99,59,1,733,4,2,97,121,8845,8851,114,111,110,59,1,271,59,1,1076,4,3,59,97,111,8862,8864,8880,1,8518,4,2,103,114,8870,8876,103,101,114,59,1,8225,114,59,1,8650,116,115,101,113,59,1,10871,4,3,103,108,109,8895,8902,8907,5,176,1,59,8900,1,176,116,97,59,1,948,112,116,121,118,59,1,10673,4,2,105,114,8920,8926,115,104,116,59,1,10623,59,3,55349,56609,97,114,4,2,108,114,8938,8941,59,1,8643,59,1,8642,4,5,97,101,103,115,118,8956,8986,8989,8996,9001,109,4,3,59,111,115,8965,8967,8983,1,8900,110,100,4,2,59,115,8975,8977,1,8900,117,105,116,59,1,9830,59,1,9830,59,1,168,97,109,109,97,59,1,989,105,110,59,1,8946,4,3,59,105,111,9009,9011,9031,1,247,100,101,5,247,2,59,111,9020,9022,1,247,110,116,105,109,101,115,59,1,8903,110,120,59,1,8903,99,121,59,1,1106,99,4,2,111,114,9048,9053,114,110,59,1,8990,111,112,59,1,8973,4,5,108,112,116,117,119,9070,9076,9081,9130,9144,108,97,114,59,1,36,102,59,3,55349,56661,4,5,59,101,109,112,115,9093,9095,9109,9116,9122,1,729,113,4,2,59,100,9102,9104,1,8784,111,116,59,1,8785,105,110,117,115,59,1,8760,108,117,115,59,1,8724,113,117,97,114,101,59,1,8865,98,108,101,98,97,114,119,101,100,103,101,59,1,8966,110,4,3,97,100,104,9153,9160,9172,114,114,111,119,59,1,8595,111,119,110,97,114,114,111,119,115,59,1,8650,97,114,112,111,111,110,4,2,108,114,9184,9190,101,102,116,59,1,8643,105,103,104,116,59,1,8642,4,2,98,99,9203,9211,107,97,114,111,119,59,1,10512,4,2,111,114,9217,9222,114,110,59,1,8991,111,112,59,1,8972,4,3,99,111,116,9235,9248,9252,4,2,114,121,9241,9245,59,3,55349,56505,59,1,1109,108,59,1,10742,114,111,107,59,1,273,4,2,100,114,9264,9269,111,116,59,1,8945,105,4,2,59,102,9276,9278,1,9663,59,1,9662,4,2,97,104,9287,9292,114,114,59,1,8693,97,114,59,1,10607,97,110,103,108,101,59,1,10662,4,2,99,105,9311,9315,121,59,1,1119,103,114,97,114,114,59,1,10239,4,18,68,97,99,100,101,102,103,108,109,110,111,112,113,114,115,116,117,120,9361,9376,9398,9439,9444,9447,9462,9495,9531,9585,9598,9614,9659,9755,9771,9792,9808,9826,4,2,68,111,9367,9372,111,116,59,1,10871,116,59,1,8785,4,2,99,115,9382,9392,117,116,101,5,233,1,59,9390,1,233,116,101,114,59,1,10862,4,4,97,105,111,121,9408,9414,9430,9436,114,111,110,59,1,283,114,4,2,59,99,9421,9423,1,8790,5,234,1,59,9428,1,234,108,111,110,59,1,8789,59,1,1101,111,116,59,1,279,59,1,8519,4,2,68,114,9453,9458,111,116,59,1,8786,59,3,55349,56610,4,3,59,114,115,9470,9472,9482,1,10906,97,118,101,5,232,1,59,9480,1,232,4,2,59,100,9488,9490,1,10902,111,116,59,1,10904,4,4,59,105,108,115,9505,9507,9515,9518,1,10905,110,116,101,114,115,59,1,9191,59,1,8467,4,2,59,100,9524,9526,1,10901,111,116,59,1,10903,4,3,97,112,115,9539,9544,9564,99,114,59,1,275,116,121,4,3,59,115,118,9554,9556,9561,1,8709,101,116,59,1,8709,59,1,8709,112,4,2,49,59,9571,9583,4,2,51,52,9577,9580,59,1,8196,59,1,8197,1,8195,4,2,103,115,9591,9594,59,1,331,112,59,1,8194,4,2,103,112,9604,9609,111,110,59,1,281,102,59,3,55349,56662,4,3,97,108,115,9622,9635,9640,114,4,2,59,115,9629,9631,1,8917,108,59,1,10723,117,115,59,1,10865,105,4,3,59,108,118,9649,9651,9656,1,949,111,110,59,1,949,59,1,1013,4,4,99,115,117,118,9669,9686,9716,9747,4,2,105,111,9675,9680,114,99,59,1,8790,108,111,110,59,1,8789,4,2,105,108,9692,9696,109,59,1,8770,97,110,116,4,2,103,108,9705,9710,116,114,59,1,10902,101,115,115,59,1,10901,4,3,97,101,105,9724,9729,9734,108,115,59,1,61,115,116,59,1,8799,118,4,2,59,68,9741,9743,1,8801,68,59,1,10872,112,97,114,115,108,59,1,10725,4,2,68,97,9761,9766,111,116,59,1,8787,114,114,59,1,10609,4,3,99,100,105,9779,9783,9788,114,59,1,8495,111,116,59,1,8784,109,59,1,8770,4,2,97,104,9798,9801,59,1,951,5,240,1,59,9806,1,240,4,2,109,114,9814,9822,108,5,235,1,59,9820,1,235,111,59,1,8364,4,3,99,105,112,9834,9838,9843,108,59,1,33,115,116,59,1,8707,4,2,101,111,9849,9859,99,116,97,116,105,111,110,59,1,8496,110,101,110,116,105,97,108,101,59,1,8519,4,12,97,99,101,102,105,106,108,110,111,112,114,115,9896,9910,9914,9921,9954,9960,9967,9989,9994,10027,10036,10164,108,108,105,110,103,100,111,116,115,101,113,59,1,8786,121,59,1,1092,109,97,108,101,59,1,9792,4,3,105,108,114,9929,9935,9950,108,105,103,59,1,64259,4,2,105,108,9941,9945,103,59,1,64256,105,103,59,1,64260,59,3,55349,56611,108,105,103,59,1,64257,108,105,103,59,3,102,106,4,3,97,108,116,9975,9979,9984,116,59,1,9837,105,103,59,1,64258,110,115,59,1,9649,111,102,59,1,402,4,2,112,114,10000,10005,102,59,3,55349,56663,4,2,97,107,10011,10016,108,108,59,1,8704,4,2,59,118,10022,10024,1,8916,59,1,10969,97,114,116,105,110,116,59,1,10765,4,2,97,111,10042,10159,4,2,99,115,10048,10155,4,6,49,50,51,52,53,55,10062,10102,10114,10135,10139,10151,4,6,50,51,52,53,54,56,10076,10083,10086,10093,10096,10099,5,189,1,59,10081,1,189,59,1,8531,5,188,1,59,10091,1,188,59,1,8533,59,1,8537,59,1,8539,4,2,51,53,10108,10111,59,1,8532,59,1,8534,4,3,52,53,56,10122,10129,10132,5,190,1,59,10127,1,190,59,1,8535,59,1,8540,53,59,1,8536,4,2,54,56,10145,10148,59,1,8538,59,1,8541,56,59,1,8542,108,59,1,8260,119,110,59,1,8994,99,114,59,3,55349,56507,4,17,69,97,98,99,100,101,102,103,105,106,108,110,111,114,115,116,118,10206,10217,10247,10254,10268,10273,10358,10363,10374,10380,10385,10406,10458,10464,10470,10497,10610,4,2,59,108,10212,10214,1,8807,59,1,10892,4,3,99,109,112,10225,10231,10244,117,116,101,59,1,501,109,97,4,2,59,100,10239,10241,1,947,59,1,989,59,1,10886,114,101,118,101,59,1,287,4,2,105,121,10260,10265,114,99,59,1,285,59,1,1075,111,116,59,1,289,4,4,59,108,113,115,10283,10285,10288,10308,1,8805,59,1,8923,4,3,59,113,115,10296,10298,10301,1,8805,59,1,8807,108,97,110,116,59,1,10878,4,4,59,99,100,108,10318,10320,10324,10345,1,10878,99,59,1,10921,111,116,4,2,59,111,10332,10334,1,10880,4,2,59,108,10340,10342,1,10882,59,1,10884,4,2,59,101,10351,10354,3,8923,65024,115,59,1,10900,114,59,3,55349,56612,4,2,59,103,10369,10371,1,8811,59,1,8921,109,101,108,59,1,8503,99,121,59,1,1107,4,4,59,69,97,106,10395,10397,10400,10403,1,8823,59,1,10898,59,1,10917,59,1,10916,4,4,69,97,101,115,10416,10419,10434,10453,59,1,8809,112,4,2,59,112,10426,10428,1,10890,114,111,120,59,1,10890,4,2,59,113,10440,10442,1,10888,4,2,59,113,10448,10450,1,10888,59,1,8809,105,109,59,1,8935,112,102,59,3,55349,56664,97,118,101,59,1,96,4,2,99,105,10476,10480,114,59,1,8458,109,4,3,59,101,108,10489,10491,10494,1,8819,59,1,10894,59,1,10896,5,62,6,59,99,100,108,113,114,10512,10514,10527,10532,10538,10545,1,62,4,2,99,105,10520,10523,59,1,10919,114,59,1,10874,111,116,59,1,8919,80,97,114,59,1,10645,117,101,115,116,59,1,10876,4,5,97,100,101,108,115,10557,10574,10579,10599,10605,4,2,112,114,10563,10570,112,114,111,120,59,1,10886,114,59,1,10616,111,116,59,1,8919,113,4,2,108,113,10586,10592,101,115,115,59,1,8923,108,101,115,115,59,1,10892,101,115,115,59,1,8823,105,109,59,1,8819,4,2,101,110,10616,10626,114,116,110,101,113,113,59,3,8809,65024,69,59,3,8809,65024,4,10,65,97,98,99,101,102,107,111,115,121,10653,10658,10713,10718,10724,10760,10765,10786,10850,10875,114,114,59,1,8660,4,4,105,108,109,114,10668,10674,10678,10684,114,115,112,59,1,8202,102,59,1,189,105,108,116,59,1,8459,4,2,100,114,10690,10695,99,121,59,1,1098,4,3,59,99,119,10703,10705,10710,1,8596,105,114,59,1,10568,59,1,8621,97,114,59,1,8463,105,114,99,59,1,293,4,3,97,108,114,10732,10748,10754,114,116,115,4,2,59,117,10741,10743,1,9829,105,116,59,1,9829,108,105,112,59,1,8230,99,111,110,59,1,8889,114,59,3,55349,56613,115,4,2,101,119,10772,10779,97,114,111,119,59,1,10533,97,114,111,119,59,1,10534,4,5,97,109,111,112,114,10798,10803,10809,10839,10844,114,114,59,1,8703,116,104,116,59,1,8763,107,4,2,108,114,10816,10827,101,102,116,97,114,114,111,119,59,1,8617,105,103,104,116,97,114,114,111,119,59,1,8618,102,59,3,55349,56665,98,97,114,59,1,8213,4,3,99,108,116,10858,10863,10869,114,59,3,55349,56509,97,115,104,59,1,8463,114,111,107,59,1,295,4,2,98,112,10881,10887,117,108,108,59,1,8259,104,101,110,59,1,8208,4,15,97,99,101,102,103,105,106,109,110,111,112,113,115,116,117,10925,10936,10958,10977,10990,11001,11039,11045,11101,11192,11220,11226,11237,11285,11299,99,117,116,101,5,237,1,59,10934,1,237,4,3,59,105,121,10944,10946,10955,1,8291,114,99,5,238,1,59,10953,1,238,59,1,1080,4,2,99,120,10964,10968,121,59,1,1077,99,108,5,161,1,59,10975,1,161,4,2,102,114,10983,10986,59,1,8660,59,3,55349,56614,114,97,118,101,5,236,1,59,10999,1,236,4,4,59,105,110,111,11011,11013,11028,11034,1,8520,4,2,105,110,11019,11024,110,116,59,1,10764,116,59,1,8749,102,105,110,59,1,10716,116,97,59,1,8489,108,105,103,59,1,307,4,3,97,111,112,11053,11092,11096,4,3,99,103,116,11061,11065,11088,114,59,1,299,4,3,101,108,112,11073,11076,11082,59,1,8465,105,110,101,59,1,8464,97,114,116,59,1,8465,104,59,1,305,102,59,1,8887,101,100,59,1,437,4,5,59,99,102,111,116,11113,11115,11121,11136,11142,1,8712,97,114,101,59,1,8453,105,110,4,2,59,116,11129,11131,1,8734,105,101,59,1,10717,100,111,116,59,1,305,4,5,59,99,101,108,112,11154,11156,11161,11179,11186,1,8747,97,108,59,1,8890,4,2,103,114,11167,11173,101,114,115,59,1,8484,99,97,108,59,1,8890,97,114,104,107,59,1,10775,114,111,100,59,1,10812,4,4,99,103,112,116,11202,11206,11211,11216,121,59,1,1105,111,110,59,1,303,102,59,3,55349,56666,97,59,1,953,114,111,100,59,1,10812,117,101,115,116,5,191,1,59,11235,1,191,4,2,99,105,11243,11248,114,59,3,55349,56510,110,4,5,59,69,100,115,118,11261,11263,11266,11271,11282,1,8712,59,1,8953,111,116,59,1,8949,4,2,59,118,11277,11279,1,8948,59,1,8947,59,1,8712,4,2,59,105,11291,11293,1,8290,108,100,101,59,1,297,4,2,107,109,11305,11310,99,121,59,1,1110,108,5,239,1,59,11316,1,239,4,6,99,102,109,111,115,117,11332,11346,11351,11357,11363,11380,4,2,105,121,11338,11343,114,99,59,1,309,59,1,1081,114,59,3,55349,56615,97,116,104,59,1,567,112,102,59,3,55349,56667,4,2,99,101,11369,11374,114,59,3,55349,56511,114,99,121,59,1,1112,107,99,121,59,1,1108,4,8,97,99,102,103,104,106,111,115,11404,11418,11433,11438,11445,11450,11455,11461,112,112,97,4,2,59,118,11413,11415,1,954,59,1,1008,4,2,101,121,11424,11430,100,105,108,59,1,311,59,1,1082,114,59,3,55349,56616,114,101,101,110,59,1,312,99,121,59,1,1093,99,121,59,1,1116,112,102,59,3,55349,56668,99,114,59,3,55349,56512,4,23,65,66,69,72,97,98,99,100,101,102,103,104,106,108,109,110,111,112,114,115,116,117,118,11515,11538,11544,11555,11560,11721,11780,11818,11868,12136,12160,12171,12203,12208,12246,12275,12327,12509,12523,12569,12641,12732,12752,4,3,97,114,116,11523,11528,11532,114,114,59,1,8666,114,59,1,8656,97,105,108,59,1,10523,97,114,114,59,1,10510,4,2,59,103,11550,11552,1,8806,59,1,10891,97,114,59,1,10594,4,9,99,101,103,109,110,112,113,114,116,11580,11586,11594,11600,11606,11624,11627,11636,11694,117,116,101,59,1,314,109,112,116,121,118,59,1,10676,114,97,110,59,1,8466,98,100,97,59,1,955,103,4,3,59,100,108,11615,11617,11620,1,10216,59,1,10641,101,59,1,10216,59,1,10885,117,111,5,171,1,59,11634,1,171,114,4,8,59,98,102,104,108,112,115,116,11655,11657,11669,11673,11677,11681,11685,11690,1,8592,4,2,59,102,11663,11665,1,8676,115,59,1,10527,115,59,1,10525,107,59,1,8617,112,59,1,8619,108,59,1,10553,105,109,59,1,10611,108,59,1,8610,4,3,59,97,101,11702,11704,11709,1,10923,105,108,59,1,10521,4,2,59,115,11715,11717,1,10925,59,3,10925,65024,4,3,97,98,114,11729,11734,11739,114,114,59,1,10508,114,107,59,1,10098,4,2,97,107,11745,11758,99,4,2,101,107,11752,11755,59,1,123,59,1,91,4,2,101,115,11764,11767,59,1,10635,108,4,2,100,117,11774,11777,59,1,10639,59,1,10637,4,4,97,101,117,121,11790,11796,11811,11815,114,111,110,59,1,318,4,2,100,105,11802,11807,105,108,59,1,316,108,59,1,8968,98,59,1,123,59,1,1083,4,4,99,113,114,115,11828,11832,11845,11864,97,59,1,10550,117,111,4,2,59,114,11840,11842,1,8220,59,1,8222,4,2,100,117,11851,11857,104,97,114,59,1,10599,115,104,97,114,59,1,10571,104,59,1,8626,4,5,59,102,103,113,115,11880,11882,12008,12011,12031,1,8804,116,4,5,97,104,108,114,116,11895,11913,11935,11947,11996,114,114,111,119,4,2,59,116,11905,11907,1,8592,97,105,108,59,1,8610,97,114,112,111,111,110,4,2,100,117,11925,11931,111,119,110,59,1,8637,112,59,1,8636,101,102,116,97,114,114,111,119,115,59,1,8647,105,103,104,116,4,3,97,104,115,11959,11974,11984,114,114,111,119,4,2,59,115,11969,11971,1,8596,59,1,8646,97,114,112,111,111,110,115,59,1,8651,113,117,105,103,97,114,114,111,119,59,1,8621,104,114,101,101,116,105,109,101,115,59,1,8907,59,1,8922,4,3,59,113,115,12019,12021,12024,1,8804,59,1,8806,108,97,110,116,59,1,10877,4,5,59,99,100,103,115,12043,12045,12049,12070,12083,1,10877,99,59,1,10920,111,116,4,2,59,111,12057,12059,1,10879,4,2,59,114,12065,12067,1,10881,59,1,10883,4,2,59,101,12076,12079,3,8922,65024,115,59,1,10899,4,5,97,100,101,103,115,12095,12103,12108,12126,12131,112,112,114,111,120,59,1,10885,111,116,59,1,8918,113,4,2,103,113,12115,12120,116,114,59,1,8922,103,116,114,59,1,10891,116,114,59,1,8822,105,109,59,1,8818,4,3,105,108,114,12144,12150,12156,115,104,116,59,1,10620,111,111,114,59,1,8970,59,3,55349,56617,4,2,59,69,12166,12168,1,8822,59,1,10897,4,2,97,98,12177,12198,114,4,2,100,117,12184,12187,59,1,8637,4,2,59,108,12193,12195,1,8636,59,1,10602,108,107,59,1,9604,99,121,59,1,1113,4,5,59,97,99,104,116,12220,12222,12227,12235,12241,1,8810,114,114,59,1,8647,111,114,110,101,114,59,1,8990,97,114,100,59,1,10603,114,105,59,1,9722,4,2,105,111,12252,12258,100,111,116,59,1,320,117,115,116,4,2,59,97,12267,12269,1,9136,99,104,101,59,1,9136,4,4,69,97,101,115,12285,12288,12303,12322,59,1,8808,112,4,2,59,112,12295,12297,1,10889,114,111,120,59,1,10889,4,2,59,113,12309,12311,1,10887,4,2,59,113,12317,12319,1,10887,59,1,8808,105,109,59,1,8934,4,8,97,98,110,111,112,116,119,122,12345,12359,12364,12421,12446,12467,12474,12490,4,2,110,114,12351,12355,103,59,1,10220,114,59,1,8701,114,107,59,1,10214,103,4,3,108,109,114,12373,12401,12409,101,102,116,4,2,97,114,12382,12389,114,114,111,119,59,1,10229,105,103,104,116,97,114,114,111,119,59,1,10231,97,112,115,116,111,59,1,10236,105,103,104,116,97,114,114,111,119,59,1,10230,112,97,114,114,111,119,4,2,108,114,12433,12439,101,102,116,59,1,8619,105,103,104,116,59,1,8620,4,3,97,102,108,12454,12458,12462,114,59,1,10629,59,3,55349,56669,117,115,59,1,10797,105,109,101,115,59,1,10804,4,2,97,98,12480,12485,115,116,59,1,8727,97,114,59,1,95,4,3,59,101,102,12498,12500,12506,1,9674,110,103,101,59,1,9674,59,1,10731,97,114,4,2,59,108,12517,12519,1,40,116,59,1,10643,4,5,97,99,104,109,116,12535,12540,12548,12561,12564,114,114,59,1,8646,111,114,110,101,114,59,1,8991,97,114,4,2,59,100,12556,12558,1,8651,59,1,10605,59,1,8206,114,105,59,1,8895,4,6,97,99,104,105,113,116,12583,12589,12594,12597,12614,12635,113,117,111,59,1,8249,114,59,3,55349,56513,59,1,8624,109,4,3,59,101,103,12606,12608,12611,1,8818,59,1,10893,59,1,10895,4,2,98,117,12620,12623,59,1,91,111,4,2,59,114,12630,12632,1,8216,59,1,8218,114,111,107,59,1,322,5,60,8,59,99,100,104,105,108,113,114,12660,12662,12675,12680,12686,12692,12698,12705,1,60,4,2,99,105,12668,12671,59,1,10918,114,59,1,10873,111,116,59,1,8918,114,101,101,59,1,8907,109,101,115,59,1,8905,97,114,114,59,1,10614,117,101,115,116,59,1,10875,4,2,80,105,12711,12716,97,114,59,1,10646,4,3,59,101,102,12724,12726,12729,1,9667,59,1,8884,59,1,9666,114,4,2,100,117,12739,12746,115,104,97,114,59,1,10570,104,97,114,59,1,10598,4,2,101,110,12758,12768,114,116,110,101,113,113,59,3,8808,65024,69,59,3,8808,65024,4,14,68,97,99,100,101,102,104,105,108,110,111,112,115,117,12803,12809,12893,12908,12914,12928,12933,12937,13011,13025,13032,13049,13052,13069,68,111,116,59,1,8762,4,4,99,108,112,114,12819,12827,12849,12887,114,5,175,1,59,12825,1,175,4,2,101,116,12833,12836,59,1,9794,4,2,59,101,12842,12844,1,10016,115,101,59,1,10016,4,2,59,115,12855,12857,1,8614,116,111,4,4,59,100,108,117,12869,12871,12877,12883,1,8614,111,119,110,59,1,8615,101,102,116,59,1,8612,112,59,1,8613,107,101,114,59,1,9646,4,2,111,121,12899,12905,109,109,97,59,1,10793,59,1,1084,97,115,104,59,1,8212,97,115,117,114,101,100,97,110,103,108,101,59,1,8737,114,59,3,55349,56618,111,59,1,8487,4,3,99,100,110,12945,12954,12985,114,111,5,181,1,59,12952,1,181,4,4,59,97,99,100,12964,12966,12971,12976,1,8739,115,116,59,1,42,105,114,59,1,10992,111,116,5,183,1,59,12983,1,183,117,115,4,3,59,98,100,12995,12997,13000,1,8722,59,1,8863,4,2,59,117,13006,13008,1,8760,59,1,10794,4,2,99,100,13017,13021,112,59,1,10971,114,59,1,8230,112,108,117,115,59,1,8723,4,2,100,112,13038,13044,101,108,115,59,1,8871,102,59,3,55349,56670,59,1,8723,4,2,99,116,13058,13063,114,59,3,55349,56514,112,111,115,59,1,8766,4,3,59,108,109,13077,13079,13087,1,956,116,105,109,97,112,59,1,8888,97,112,59,1,8888,4,24,71,76,82,86,97,98,99,100,101,102,103,104,105,106,108,109,111,112,114,115,116,117,118,119,13142,13165,13217,13229,13247,13330,13359,13414,13420,13508,13513,13579,13602,13626,13631,13762,13767,13855,13936,13995,14214,14285,14312,14432,4,2,103,116,13148,13152,59,3,8921,824,4,2,59,118,13158,13161,3,8811,8402,59,3,8811,824,4,3,101,108,116,13173,13200,13204,102,116,4,2,97,114,13181,13188,114,114,111,119,59,1,8653,105,103,104,116,97,114,114,111,119,59,1,8654,59,3,8920,824,4,2,59,118,13210,13213,3,8810,8402,59,3,8810,824,105,103,104,116,97,114,114,111,119,59,1,8655,4,2,68,100,13235,13241,97,115,104,59,1,8879,97,115,104,59,1,8878,4,5,98,99,110,112,116,13259,13264,13270,13275,13308,108,97,59,1,8711,117,116,101,59,1,324,103,59,3,8736,8402,4,5,59,69,105,111,112,13287,13289,13293,13298,13302,1,8777,59,3,10864,824,100,59,3,8779,824,115,59,1,329,114,111,120,59,1,8777,117,114,4,2,59,97,13316,13318,1,9838,108,4,2,59,115,13325,13327,1,9838,59,1,8469,4,2,115,117,13336,13344,112,5,160,1,59,13342,1,160,109,112,4,2,59,101,13352,13355,3,8782,824,59,3,8783,824,4,5,97,101,111,117,121,13371,13385,13391,13407,13411,4,2,112,114,13377,13380,59,1,10819,111,110,59,1,328,100,105,108,59,1,326,110,103,4,2,59,100,13399,13401,1,8775,111,116,59,3,10861,824,112,59,1,10818,59,1,1085,97,115,104,59,1,8211,4,7,59,65,97,100,113,115,120,13436,13438,13443,13466,13472,13478,13494,1,8800,114,114,59,1,8663,114,4,2,104,114,13450,13454,107,59,1,10532,4,2,59,111,13460,13462,1,8599,119,59,1,8599,111,116,59,3,8784,824,117,105,118,59,1,8802,4,2,101,105,13484,13489,97,114,59,1,10536,109,59,3,8770,824,105,115,116,4,2,59,115,13503,13505,1,8708,59,1,8708,114,59,3,55349,56619,4,4,69,101,115,116,13523,13527,13563,13568,59,3,8807,824,4,3,59,113,115,13535,13537,13559,1,8817,4,3,59,113,115,13545,13547,13551,1,8817,59,3,8807,824,108,97,110,116,59,3,10878,824,59,3,10878,824,105,109,59,1,8821,4,2,59,114,13574,13576,1,8815,59,1,8815,4,3,65,97,112,13587,13592,13597,114,114,59,1,8654,114,114,59,1,8622,97,114,59,1,10994,4,3,59,115,118,13610,13612,13623,1,8715,4,2,59,100,13618,13620,1,8956,59,1,8954,59,1,8715,99,121,59,1,1114,4,7,65,69,97,100,101,115,116,13647,13652,13656,13661,13665,13737,13742,114,114,59,1,8653,59,3,8806,824,114,114,59,1,8602,114,59,1,8229,4,4,59,102,113,115,13675,13677,13703,13725,1,8816,116,4,2,97,114,13684,13691,114,114,111,119,59,1,8602,105,103,104,116,97,114,114,111,119,59,1,8622,4,3,59,113,115,13711,13713,13717,1,8816,59,3,8806,824,108,97,110,116,59,3,10877,824,4,2,59,115,13731,13734,3,10877,824,59,1,8814,105,109,59,1,8820,4,2,59,114,13748,13750,1,8814,105,4,2,59,101,13757,13759,1,8938,59,1,8940,105,100,59,1,8740,4,2,112,116,13773,13778,102,59,3,55349,56671,5,172,3,59,105,110,13787,13789,13829,1,172,110,4,4,59,69,100,118,13800,13802,13806,13812,1,8713,59,3,8953,824,111,116,59,3,8949,824,4,3,97,98,99,13820,13823,13826,59,1,8713,59,1,8951,59,1,8950,105,4,2,59,118,13836,13838,1,8716,4,3,97,98,99,13846,13849,13852,59,1,8716,59,1,8958,59,1,8957,4,3,97,111,114,13863,13892,13899,114,4,4,59,97,115,116,13874,13876,13883,13888,1,8742,108,108,101,108,59,1,8742,108,59,3,11005,8421,59,3,8706,824,108,105,110,116,59,1,10772,4,3,59,99,101,13907,13909,13914,1,8832,117,101,59,1,8928,4,2,59,99,13920,13923,3,10927,824,4,2,59,101,13929,13931,1,8832,113,59,3,10927,824,4,4,65,97,105,116,13946,13951,13971,13982,114,114,59,1,8655,114,114,4,3,59,99,119,13961,13963,13967,1,8603,59,3,10547,824,59,3,8605,824,103,104,116,97,114,114,111,119,59,1,8603,114,105,4,2,59,101,13990,13992,1,8939,59,1,8941,4,7,99,104,105,109,112,113,117,14011,14036,14060,14080,14085,14090,14106,4,4,59,99,101,114,14021,14023,14028,14032,1,8833,117,101,59,1,8929,59,3,10928,824,59,3,55349,56515,111,114,116,4,2,109,112,14045,14050,105,100,59,1,8740,97,114,97,108,108,101,108,59,1,8742,109,4,2,59,101,14067,14069,1,8769,4,2,59,113,14075,14077,1,8772,59,1,8772,105,100,59,1,8740,97,114,59,1,8742,115,117,4,2,98,112,14098,14102,101,59,1,8930,101,59,1,8931,4,3,98,99,112,14114,14157,14171,4,4,59,69,101,115,14124,14126,14130,14133,1,8836,59,3,10949,824,59,1,8840,101,116,4,2,59,101,14141,14144,3,8834,8402,113,4,2,59,113,14151,14153,1,8840,59,3,10949,824,99,4,2,59,101,14164,14166,1,8833,113,59,3,10928,824,4,4,59,69,101,115,14181,14183,14187,14190,1,8837,59,3,10950,824,59,1,8841,101,116,4,2,59,101,14198,14201,3,8835,8402,113,4,2,59,113,14208,14210,1,8841,59,3,10950,824,4,4,103,105,108,114,14224,14228,14238,14242,108,59,1,8825,108,100,101,5,241,1,59,14236,1,241,103,59,1,8824,105,97,110,103,108,101,4,2,108,114,14254,14269,101,102,116,4,2,59,101,14263,14265,1,8938,113,59,1,8940,105,103,104,116,4,2,59,101,14279,14281,1,8939,113,59,1,8941,4,2,59,109,14291,14293,1,957,4,3,59,101,115,14301,14303,14308,1,35,114,111,59,1,8470,112,59,1,8199,4,9,68,72,97,100,103,105,108,114,115,14332,14338,14344,14349,14355,14369,14376,14408,14426,97,115,104,59,1,8877,97,114,114,59,1,10500,112,59,3,8781,8402,97,115,104,59,1,8876,4,2,101,116,14361,14365,59,3,8805,8402,59,3,62,8402,110,102,105,110,59,1,10718,4,3,65,101,116,14384,14389,14393,114,114,59,1,10498,59,3,8804,8402,4,2,59,114,14399,14402,3,60,8402,105,101,59,3,8884,8402,4,2,65,116,14414,14419,114,114,59,1,10499,114,105,101,59,3,8885,8402,105,109,59,3,8764,8402,4,3,65,97,110,14440,14445,14468,114,114,59,1,8662,114,4,2,104,114,14452,14456,107,59,1,10531,4,2,59,111,14462,14464,1,8598,119,59,1,8598,101,97,114,59,1,10535,4,18,83,97,99,100,101,102,103,104,105,108,109,111,112,114,115,116,117,118,14512,14515,14535,14560,14597,14603,14618,14643,14657,14662,14701,14741,14747,14769,14851,14877,14907,14916,59,1,9416,4,2,99,115,14521,14531,117,116,101,5,243,1,59,14529,1,243,116,59,1,8859,4,2,105,121,14541,14557,114,4,2,59,99,14548,14550,1,8858,5,244,1,59,14555,1,244,59,1,1086,4,5,97,98,105,111,115,14572,14577,14583,14587,14591,115,104,59,1,8861,108,97,99,59,1,337,118,59,1,10808,116,59,1,8857,111,108,100,59,1,10684,108,105,103,59,1,339,4,2,99,114,14609,14614,105,114,59,1,10687,59,3,55349,56620,4,3,111,114,116,14626,14630,14640,110,59,1,731,97,118,101,5,242,1,59,14638,1,242,59,1,10689,4,2,98,109,14649,14654,97,114,59,1,10677,59,1,937,110,116,59,1,8750,4,4,97,99,105,116,14672,14677,14693,14698,114,114,59,1,8634,4,2,105,114,14683,14687,114,59,1,10686,111,115,115,59,1,10683,110,101,59,1,8254,59,1,10688,4,3,97,101,105,14709,14714,14719,99,114,59,1,333,103,97,59,1,969,4,3,99,100,110,14727,14733,14736,114,111,110,59,1,959,59,1,10678,117,115,59,1,8854,112,102,59,3,55349,56672,4,3,97,101,108,14755,14759,14764,114,59,1,10679,114,112,59,1,10681,117,115,59,1,8853,4,7,59,97,100,105,111,115,118,14785,14787,14792,14831,14837,14841,14848,1,8744,114,114,59,1,8635,4,4,59,101,102,109,14802,14804,14817,14824,1,10845,114,4,2,59,111,14811,14813,1,8500,102,59,1,8500,5,170,1,59,14822,1,170,5,186,1,59,14829,1,186,103,111,102,59,1,8886,114,59,1,10838,108,111,112,101,59,1,10839,59,1,10843,4,3,99,108,111,14859,14863,14873,114,59,1,8500,97,115,104,5,248,1,59,14871,1,248,108,59,1,8856,105,4,2,108,109,14884,14893,100,101,5,245,1,59,14891,1,245,101,115,4,2,59,97,14901,14903,1,8855,115,59,1,10806,109,108,5,246,1,59,14914,1,246,98,97,114,59,1,9021,4,12,97,99,101,102,104,105,108,109,111,114,115,117,14948,14992,14996,15033,15038,15068,15090,15189,15192,15222,15427,15441,114,4,4,59,97,115,116,14959,14961,14976,14989,1,8741,5,182,2,59,108,14968,14970,1,182,108,101,108,59,1,8741,4,2,105,108,14982,14986,109,59,1,10995,59,1,11005,59,1,8706,121,59,1,1087,114,4,5,99,105,109,112,116,15009,15014,15019,15024,15027,110,116,59,1,37,111,100,59,1,46,105,108,59,1,8240,59,1,8869,101,110,107,59,1,8241,114,59,3,55349,56621,4,3,105,109,111,15046,15057,15063,4,2,59,118,15052,15054,1,966,59,1,981,109,97,116,59,1,8499,110,101,59,1,9742,4,3,59,116,118,15076,15078,15087,1,960,99,104,102,111,114,107,59,1,8916,59,1,982,4,2,97,117,15096,15119,110,4,2,99,107,15103,15115,107,4,2,59,104,15110,15112,1,8463,59,1,8462,118,59,1,8463,115,4,9,59,97,98,99,100,101,109,115,116,15140,15142,15148,15151,15156,15168,15171,15179,15184,1,43,99,105,114,59,1,10787,59,1,8862,105,114,59,1,10786,4,2,111,117,15162,15165,59,1,8724,59,1,10789,59,1,10866,110,5,177,1,59,15177,1,177,105,109,59,1,10790,119,111,59,1,10791,59,1,177,4,3,105,112,117,15200,15208,15213,110,116,105,110,116,59,1,10773,102,59,3,55349,56673,110,100,5,163,1,59,15220,1,163,4,10,59,69,97,99,101,105,110,111,115,117,15244,15246,15249,15253,15258,15334,15347,15367,15416,15421,1,8826,59,1,10931,112,59,1,10935,117,101,59,1,8828,4,2,59,99,15264,15266,1,10927,4,6,59,97,99,101,110,115,15280,15282,15290,15299,15303,15329,1,8826,112,112,114,111,120,59,1,10935,117,114,108,121,101,113,59,1,8828,113,59,1,10927,4,3,97,101,115,15311,15319,15324,112,112,114,111,120,59,1,10937,113,113,59,1,10933,105,109,59,1,8936,105,109,59,1,8830,109,101,4,2,59,115,15342,15344,1,8242,59,1,8473,4,3,69,97,115,15355,15358,15362,59,1,10933,112,59,1,10937,105,109,59,1,8936,4,3,100,102,112,15375,15378,15404,59,1,8719,4,3,97,108,115,15386,15392,15398,108,97,114,59,1,9006,105,110,101,59,1,8978,117,114,102,59,1,8979,4,2,59,116,15410,15412,1,8733,111,59,1,8733,105,109,59,1,8830,114,101,108,59,1,8880,4,2,99,105,15433,15438,114,59,3,55349,56517,59,1,968,110,99,115,112,59,1,8200,4,6,102,105,111,112,115,117,15462,15467,15472,15478,15485,15491,114,59,3,55349,56622,110,116,59,1,10764,112,102,59,3,55349,56674,114,105,109,101,59,1,8279,99,114,59,3,55349,56518,4,3,97,101,111,15499,15520,15534,116,4,2,101,105,15506,15515,114,110,105,111,110,115,59,1,8461,110,116,59,1,10774,115,116,4,2,59,101,15528,15530,1,63,113,59,1,8799,116,5,34,1,59,15540,1,34,4,21,65,66,72,97,98,99,100,101,102,104,105,108,109,110,111,112,114,115,116,117,120,15586,15609,15615,15620,15796,15855,15893,15931,15977,16001,16039,16183,16204,16222,16228,16285,16312,16318,16363,16408,16416,4,3,97,114,116,15594,15599,15603,114,114,59,1,8667,114,59,1,8658,97,105,108,59,1,10524,97,114,114,59,1,10511,97,114,59,1,10596,4,7,99,100,101,110,113,114,116,15636,15651,15656,15664,15687,15696,15770,4,2,101,117,15642,15646,59,3,8765,817,116,101,59,1,341,105,99,59,1,8730,109,112,116,121,118,59,1,10675,103,4,4,59,100,101,108,15675,15677,15680,15683,1,10217,59,1,10642,59,1,10661,101,59,1,10217,117,111,5,187,1,59,15694,1,187,114,4,11,59,97,98,99,102,104,108,112,115,116,119,15721,15723,15727,15739,15742,15746,15750,15754,15758,15763,15767,1,8594,112,59,1,10613,4,2,59,102,15733,15735,1,8677,115,59,1,10528,59,1,10547,115,59,1,10526,107,59,1,8618,112,59,1,8620,108,59,1,10565,105,109,59,1,10612,108,59,1,8611,59,1,8605,4,2,97,105,15776,15781,105,108,59,1,10522,111,4,2,59,110,15788,15790,1,8758,97,108,115,59,1,8474,4,3,97,98,114,15804,15809,15814,114,114,59,1,10509,114,107,59,1,10099,4,2,97,107,15820,15833,99,4,2,101,107,15827,15830,59,1,125,59,1,93,4,2,101,115,15839,15842,59,1,10636,108,4,2,100,117,15849,15852,59,1,10638,59,1,10640,4,4,97,101,117,121,15865,15871,15886,15890,114,111,110,59,1,345,4,2,100,105,15877,15882,105,108,59,1,343,108,59,1,8969,98,59,1,125,59,1,1088,4,4,99,108,113,115,15903,15907,15914,15927,97,59,1,10551,100,104,97,114,59,1,10601,117,111,4,2,59,114,15922,15924,1,8221,59,1,8221,104,59,1,8627,4,3,97,99,103,15939,15966,15970,108,4,4,59,105,112,115,15950,15952,15957,15963,1,8476,110,101,59,1,8475,97,114,116,59,1,8476,59,1,8477,116,59,1,9645,5,174,1,59,15975,1,174,4,3,105,108,114,15985,15991,15997,115,104,116,59,1,10621,111,111,114,59,1,8971,59,3,55349,56623,4,2,97,111,16007,16028,114,4,2,100,117,16014,16017,59,1,8641,4,2,59,108,16023,16025,1,8640,59,1,10604,4,2,59,118,16034,16036,1,961,59,1,1009,4,3,103,110,115,16047,16167,16171,104,116,4,6,97,104,108,114,115,116,16063,16081,16103,16130,16143,16155,114,114,111,119,4,2,59,116,16073,16075,1,8594,97,105,108,59,1,8611,97,114,112,111,111,110,4,2,100,117,16093,16099,111,119,110,59,1,8641,112,59,1,8640,101,102,116,4,2,97,104,16112,16120,114,114,111,119,115,59,1,8644,97,114,112,111,111,110,115,59,1,8652,105,103,104,116,97,114,114,111,119,115,59,1,8649,113,117,105,103,97,114,114,111,119,59,1,8605,104,114,101,101,116,105,109,101,115,59,1,8908,103,59,1,730,105,110,103,100,111,116,115,101,113,59,1,8787,4,3,97,104,109,16191,16196,16201,114,114,59,1,8644,97,114,59,1,8652,59,1,8207,111,117,115,116,4,2,59,97,16214,16216,1,9137,99,104,101,59,1,9137,109,105,100,59,1,10990,4,4,97,98,112,116,16238,16252,16257,16278,4,2,110,114,16244,16248,103,59,1,10221,114,59,1,8702,114,107,59,1,10215,4,3,97,102,108,16265,16269,16273,114,59,1,10630,59,3,55349,56675,117,115,59,1,10798,105,109,101,115,59,1,10805,4,2,97,112,16291,16304,114,4,2,59,103,16298,16300,1,41,116,59,1,10644,111,108,105,110,116,59,1,10770,97,114,114,59,1,8649,4,4,97,99,104,113,16328,16334,16339,16342,113,117,111,59,1,8250,114,59,3,55349,56519,59,1,8625,4,2,98,117,16348,16351,59,1,93,111,4,2,59,114,16358,16360,1,8217,59,1,8217,4,3,104,105,114,16371,16377,16383,114,101,101,59,1,8908,109,101,115,59,1,8906,105,4,4,59,101,102,108,16394,16396,16399,16402,1,9657,59,1,8885,59,1,9656,116,114,105,59,1,10702,108,117,104,97,114,59,1,10600,59,1,8478,4,19,97,98,99,100,101,102,104,105,108,109,111,112,113,114,115,116,117,119,122,16459,16466,16472,16572,16590,16672,16687,16746,16844,16850,16924,16963,16988,17115,17121,17154,17206,17614,17656,99,117,116,101,59,1,347,113,117,111,59,1,8218,4,10,59,69,97,99,101,105,110,112,115,121,16494,16496,16499,16513,16518,16531,16536,16556,16564,16569,1,8827,59,1,10932,4,2,112,114,16505,16508,59,1,10936,111,110,59,1,353,117,101,59,1,8829,4,2,59,100,16524,16526,1,10928,105,108,59,1,351,114,99,59,1,349,4,3,69,97,115,16544,16547,16551,59,1,10934,112,59,1,10938,105,109,59,1,8937,111,108,105,110,116,59,1,10771,105,109,59,1,8831,59,1,1089,111,116,4,3,59,98,101,16582,16584,16587,1,8901,59,1,8865,59,1,10854,4,7,65,97,99,109,115,116,120,16606,16611,16634,16642,16646,16652,16668,114,114,59,1,8664,114,4,2,104,114,16618,16622,107,59,1,10533,4,2,59,111,16628,16630,1,8600,119,59,1,8600,116,5,167,1,59,16640,1,167,105,59,1,59,119,97,114,59,1,10537,109,4,2,105,110,16659,16665,110,117,115,59,1,8726,59,1,8726,116,59,1,10038,114,4,2,59,111,16679,16682,3,55349,56624,119,110,59,1,8994,4,4,97,99,111,121,16697,16702,16716,16739,114,112,59,1,9839,4,2,104,121,16708,16713,99,121,59,1,1097,59,1,1096,114,116,4,2,109,112,16724,16729,105,100,59,1,8739,97,114,97,108,108,101,108,59,1,8741,5,173,1,59,16744,1,173,4,2,103,109,16752,16770,109,97,4,3,59,102,118,16762,16764,16767,1,963,59,1,962,59,1,962,4,8,59,100,101,103,108,110,112,114,16788,16790,16795,16806,16817,16828,16832,16838,1,8764,111,116,59,1,10858,4,2,59,113,16801,16803,1,8771,59,1,8771,4,2,59,69,16812,16814,1,10910,59,1,10912,4,2,59,69,16823,16825,1,10909,59,1,10911,101,59,1,8774,108,117,115,59,1,10788,97,114,114,59,1,10610,97,114,114,59,1,8592,4,4,97,101,105,116,16860,16883,16891,16904,4,2,108,115,16866,16878,108,115,101,116,109,105,110,117,115,59,1,8726,104,112,59,1,10803,112,97,114,115,108,59,1,10724,4,2,100,108,16897,16900,59,1,8739,101,59,1,8995,4,2,59,101,16910,16912,1,10922,4,2,59,115,16918,16920,1,10924,59,3,10924,65024,4,3,102,108,112,16932,16938,16958,116,99,121,59,1,1100,4,2,59,98,16944,16946,1,47,4,2,59,97,16952,16954,1,10692,114,59,1,9023,102,59,3,55349,56676,97,4,2,100,114,16970,16985,101,115,4,2,59,117,16978,16980,1,9824,105,116,59,1,9824,59,1,8741,4,3,99,115,117,16996,17028,17089,4,2,97,117,17002,17015,112,4,2,59,115,17009,17011,1,8851,59,3,8851,65024,112,4,2,59,115,17022,17024,1,8852,59,3,8852,65024,117,4,2,98,112,17035,17062,4,3,59,101,115,17043,17045,17048,1,8847,59,1,8849,101,116,4,2,59,101,17056,17058,1,8847,113,59,1,8849,4,3,59,101,115,17070,17072,17075,1,8848,59,1,8850,101,116,4,2,59,101,17083,17085,1,8848,113,59,1,8850,4,3,59,97,102,17097,17099,17112,1,9633,114,4,2,101,102,17106,17109,59,1,9633,59,1,9642,59,1,9642,97,114,114,59,1,8594,4,4,99,101,109,116,17131,17136,17142,17148,114,59,3,55349,56520,116,109,110,59,1,8726,105,108,101,59,1,8995,97,114,102,59,1,8902,4,2,97,114,17160,17172,114,4,2,59,102,17167,17169,1,9734,59,1,9733,4,2,97,110,17178,17202,105,103,104,116,4,2,101,112,17188,17197,112,115,105,108,111,110,59,1,1013,104,105,59,1,981,115,59,1,175,4,5,98,99,109,110,112,17218,17351,17420,17423,17427,4,9,59,69,100,101,109,110,112,114,115,17238,17240,17243,17248,17261,17267,17279,17285,17291,1,8834,59,1,10949,111,116,59,1,10941,4,2,59,100,17254,17256,1,8838,111,116,59,1,10947,117,108,116,59,1,10945,4,2,69,101,17273,17276,59,1,10955,59,1,8842,108,117,115,59,1,10943,97,114,114,59,1,10617,4,3,101,105,117,17299,17335,17339,116,4,3,59,101,110,17308,17310,17322,1,8834,113,4,2,59,113,17317,17319,1,8838,59,1,10949,101,113,4,2,59,113,17330,17332,1,8842,59,1,10955,109,59,1,10951,4,2,98,112,17345,17348,59,1,10965,59,1,10963,99,4,6,59,97,99,101,110,115,17366,17368,17376,17385,17389,17415,1,8827,112,112,114,111,120,59,1,10936,117,114,108,121,101,113,59,1,8829,113,59,1,10928,4,3,97,101,115,17397,17405,17410,112,112,114,111,120,59,1,10938,113,113,59,1,10934,105,109,59,1,8937,105,109,59,1,8831,59,1,8721,103,59,1,9834,4,13,49,50,51,59,69,100,101,104,108,109,110,112,115,17455,17462,17469,17476,17478,17481,17496,17509,17524,17530,17536,17548,17554,5,185,1,59,17460,1,185,5,178,1,59,17467,1,178,5,179,1,59,17474,1,179,1,8835,59,1,10950,4,2,111,115,17487,17491,116,59,1,10942,117,98,59,1,10968,4,2,59,100,17502,17504,1,8839,111,116,59,1,10948,115,4,2,111,117,17516,17520,108,59,1,10185,98,59,1,10967,97,114,114,59,1,10619,117,108,116,59,1,10946,4,2,69,101,17542,17545,59,1,10956,59,1,8843,108,117,115,59,1,10944,4,3,101,105,117,17562,17598,17602,116,4,3,59,101,110,17571,17573,17585,1,8835,113,4,2,59,113,17580,17582,1,8839,59,1,10950,101,113,4,2,59,113,17593,17595,1,8843,59,1,10956,109,59,1,10952,4,2,98,112,17608,17611,59,1,10964,59,1,10966,4,3,65,97,110,17622,17627,17650,114,114,59,1,8665,114,4,2,104,114,17634,17638,107,59,1,10534,4,2,59,111,17644,17646,1,8601,119,59,1,8601,119,97,114,59,1,10538,108,105,103,5,223,1,59,17664,1,223,4,13,97,98,99,100,101,102,104,105,111,112,114,115,119,17694,17709,17714,17737,17742,17749,17754,17860,17905,17957,17964,18090,18122,4,2,114,117,17700,17706,103,101,116,59,1,8982,59,1,964,114,107,59,1,9140,4,3,97,101,121,17722,17728,17734,114,111,110,59,1,357,100,105,108,59,1,355,59,1,1090,111,116,59,1,8411,108,114,101,99,59,1,8981,114,59,3,55349,56625,4,4,101,105,107,111,17764,17805,17836,17851,4,2,114,116,17770,17786,101,4,2,52,102,17777,17780,59,1,8756,111,114,101,59,1,8756,97,4,3,59,115,118,17795,17797,17802,1,952,121,109,59,1,977,59,1,977,4,2,99,110,17811,17831,107,4,2,97,115,17818,17826,112,112,114,111,120,59,1,8776,105,109,59,1,8764,115,112,59,1,8201,4,2,97,115,17842,17846,112,59,1,8776,105,109,59,1,8764,114,110,5,254,1,59,17858,1,254,4,3,108,109,110,17868,17873,17901,100,101,59,1,732,101,115,5,215,3,59,98,100,17884,17886,17898,1,215,4,2,59,97,17892,17894,1,8864,114,59,1,10801,59,1,10800,116,59,1,8749,4,3,101,112,115,17913,17917,17953,97,59,1,10536,4,4,59,98,99,102,17927,17929,17934,17939,1,8868,111,116,59,1,9014,105,114,59,1,10993,4,2,59,111,17945,17948,3,55349,56677,114,107,59,1,10970,97,59,1,10537,114,105,109,101,59,1,8244,4,3,97,105,112,17972,17977,18082,100,101,59,1,8482,4,7,97,100,101,109,112,115,116,17993,18051,18056,18059,18066,18072,18076,110,103,108,101,4,5,59,100,108,113,114,18009,18011,18017,18032,18035,1,9653,111,119,110,59,1,9663,101,102,116,4,2,59,101,18026,18028,1,9667,113,59,1,8884,59,1,8796,105,103,104,116,4,2,59,101,18045,18047,1,9657,113,59,1,8885,111,116,59,1,9708,59,1,8796,105,110,117,115,59,1,10810,108,117,115,59,1,10809,98,59,1,10701,105,109,101,59,1,10811,101,122,105,117,109,59,1,9186,4,3,99,104,116,18098,18111,18116,4,2,114,121,18104,18108,59,3,55349,56521,59,1,1094,99,121,59,1,1115,114,111,107,59,1,359,4,2,105,111,18128,18133,120,116,59,1,8812,104,101,97,100,4,2,108,114,18143,18154,101,102,116,97,114,114,111,119,59,1,8606,105,103,104,116,97,114,114,111,119,59,1,8608,4,18,65,72,97,98,99,100,102,103,104,108,109,111,112,114,115,116,117,119,18204,18209,18214,18234,18250,18268,18292,18308,18319,18343,18379,18397,18413,18504,18547,18553,18584,18603,114,114,59,1,8657,97,114,59,1,10595,4,2,99,114,18220,18230,117,116,101,5,250,1,59,18228,1,250,114,59,1,8593,114,4,2,99,101,18241,18245,121,59,1,1118,118,101,59,1,365,4,2,105,121,18256,18265,114,99,5,251,1,59,18263,1,251,59,1,1091,4,3,97,98,104,18276,18281,18287,114,114,59,1,8645,108,97,99,59,1,369,97,114,59,1,10606,4,2,105,114,18298,18304,115,104,116,59,1,10622,59,3,55349,56626,114,97,118,101,5,249,1,59,18317,1,249,4,2,97,98,18325,18338,114,4,2,108,114,18332,18335,59,1,8639,59,1,8638,108,107,59,1,9600,4,2,99,116,18349,18374,4,2,111,114,18355,18369,114,110,4,2,59,101,18363,18365,1,8988,114,59,1,8988,111,112,59,1,8975,114,105,59,1,9720,4,2,97,108,18385,18390,99,114,59,1,363,5,168,1,59,18395,1,168,4,2,103,112,18403,18408,111,110,59,1,371,102,59,3,55349,56678,4,6,97,100,104,108,115,117,18427,18434,18445,18470,18475,18494,114,114,111,119,59,1,8593,111,119,110,97,114,114,111,119,59,1,8597,97,114,112,111,111,110,4,2,108,114,18457,18463,101,102,116,59,1,8639,105,103,104,116,59,1,8638,117,115,59,1,8846,105,4,3,59,104,108,18484,18486,18489,1,965,59,1,978,111,110,59,1,965,112,97,114,114,111,119,115,59,1,8648,4,3,99,105,116,18512,18537,18542,4,2,111,114,18518,18532,114,110,4,2,59,101,18526,18528,1,8989,114,59,1,8989,111,112,59,1,8974,110,103,59,1,367,114,105,59,1,9721,99,114,59,3,55349,56522,4,3,100,105,114,18561,18566,18572,111,116,59,1,8944,108,100,101,59,1,361,105,4,2,59,102,18579,18581,1,9653,59,1,9652,4,2,97,109,18590,18595,114,114,59,1,8648,108,5,252,1,59,18601,1,252,97,110,103,108,101,59,1,10663,4,15,65,66,68,97,99,100,101,102,108,110,111,112,114,115,122,18643,18648,18661,18667,18847,18851,18857,18904,18909,18915,18931,18937,18943,18949,18996,114,114,59,1,8661,97,114,4,2,59,118,18656,18658,1,10984,59,1,10985,97,115,104,59,1,8872,4,2,110,114,18673,18679,103,114,116,59,1,10652,4,7,101,107,110,112,114,115,116,18695,18704,18711,18720,18742,18754,18810,112,115,105,108,111,110,59,1,1013,97,112,112,97,59,1,1008,111,116,104,105,110,103,59,1,8709,4,3,104,105,114,18728,18732,18735,105,59,1,981,59,1,982,111,112,116,111,59,1,8733,4,2,59,104,18748,18750,1,8597,111,59,1,1009,4,2,105,117,18760,18766,103,109,97,59,1,962,4,2,98,112,18772,18791,115,101,116,110,101,113,4,2,59,113,18784,18787,3,8842,65024,59,3,10955,65024,115,101,116,110,101,113,4,2,59,113,18803,18806,3,8843,65024,59,3,10956,65024,4,2,104,114,18816,18822,101,116,97,59,1,977,105,97,110,103,108,101,4,2,108,114,18834,18840,101,102,116,59,1,8882,105,103,104,116,59,1,8883,121,59,1,1074,97,115,104,59,1,8866,4,3,101,108,114,18865,18884,18890,4,3,59,98,101,18873,18875,18880,1,8744,97,114,59,1,8891,113,59,1,8794,108,105,112,59,1,8942,4,2,98,116,18896,18901,97,114,59,1,124,59,1,124,114,59,3,55349,56627,116,114,105,59,1,8882,115,117,4,2,98,112,18923,18927,59,3,8834,8402,59,3,8835,8402,112,102,59,3,55349,56679,114,111,112,59,1,8733,116,114,105,59,1,8883,4,2,99,117,18955,18960,114,59,3,55349,56523,4,2,98,112,18966,18981,110,4,2,69,101,18973,18977,59,3,10955,65024,59,3,8842,65024,110,4,2,69,101,18988,18992,59,3,10956,65024,59,3,8843,65024,105,103,122,97,103,59,1,10650,4,7,99,101,102,111,112,114,115,19020,19026,19061,19066,19072,19075,19089,105,114,99,59,1,373,4,2,100,105,19032,19055,4,2,98,103,19038,19043,97,114,59,1,10847,101,4,2,59,113,19050,19052,1,8743,59,1,8793,101,114,112,59,1,8472,114,59,3,55349,56628,112,102,59,3,55349,56680,59,1,8472,4,2,59,101,19081,19083,1,8768,97,116,104,59,1,8768,99,114,59,3,55349,56524,4,14,99,100,102,104,105,108,109,110,111,114,115,117,118,119,19125,19146,19152,19157,19173,19176,19192,19197,19202,19236,19252,19269,19286,19291,4,3,97,105,117,19133,19137,19142,112,59,1,8898,114,99,59,1,9711,112,59,1,8899,116,114,105,59,1,9661,114,59,3,55349,56629,4,2,65,97,19163,19168,114,114,59,1,10234,114,114,59,1,10231,59,1,958,4,2,65,97,19182,19187,114,114,59,1,10232,114,114,59,1,10229,97,112,59,1,10236,105,115,59,1,8955,4,3,100,112,116,19210,19215,19230,111,116,59,1,10752,4,2,102,108,19221,19225,59,3,55349,56681,117,115,59,1,10753,105,109,101,59,1,10754,4,2,65,97,19242,19247,114,114,59,1,10233,114,114,59,1,10230,4,2,99,113,19258,19263,114,59,3,55349,56525,99,117,112,59,1,10758,4,2,112,116,19275,19281,108,117,115,59,1,10756,114,105,59,1,9651,101,101,59,1,8897,101,100,103,101,59,1,8896,4,8,97,99,101,102,105,111,115,117,19316,19335,19349,19357,19362,19367,19373,19379,99,4,2,117,121,19323,19332,116,101,5,253,1,59,19330,1,253,59,1,1103,4,2,105,121,19341,19346,114,99,59,1,375,59,1,1099,110,5,165,1,59,19355,1,165,114,59,3,55349,56630,99,121,59,1,1111,112,102,59,3,55349,56682,99,114,59,3,55349,56526,4,2,99,109,19385,19389,121,59,1,1102,108,5,255,1,59,19395,1,255,4,10,97,99,100,101,102,104,105,111,115,119,19419,19426,19441,19446,19462,19467,19472,19480,19486,19492,99,117,116,101,59,1,378,4,2,97,121,19432,19438,114,111,110,59,1,382,59,1,1079,111,116,59,1,380,4,2,101,116,19452,19458,116,114,102,59,1,8488,97,59,1,950,114,59,3,55349,56631,99,121,59,1,1078,103,114,97,114,114,59,1,8669,112,102,59,3,55349,56683,99,114,59,3,55349,56527,4,2,106,110,19498,19501,59,1,8205,106,59,1,8204]); /***/ }), /* 343 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var HTML = __webpack_require__(344); //Aliases var $ = HTML.TAG_NAMES, NS = HTML.NAMESPACES; //Element utils //OPTIMIZATION: Integer comparisons are low-cost, so we can use very fast tag name length filters here. //It's faster than using dictionary. function isImpliedEndTagRequired(tn) { switch (tn.length) { case 1: return tn === $.P; case 2: return tn === $.RB || tn === $.RP || tn === $.RT || tn === $.DD || tn === $.DT || tn === $.LI; case 3: return tn === $.RTC; case 6: return tn === $.OPTION; case 8: return tn === $.OPTGROUP || tn === $.MENUITEM; } return false; } function isScopingElement(tn, ns) { switch (tn.length) { case 2: if (tn === $.TD || tn === $.TH) return ns === NS.HTML; else if (tn === $.MI || tn === $.MO || tn === $.MN || tn === $.MS) return ns === NS.MATHML; break; case 4: if (tn === $.HTML) return ns === NS.HTML; else if (tn === $.DESC) return ns === NS.SVG; break; case 5: if (tn === $.TABLE) return ns === NS.HTML; else if (tn === $.MTEXT) return ns === NS.MATHML; else if (tn === $.TITLE) return ns === NS.SVG; break; case 6: return (tn === $.APPLET || tn === $.OBJECT) && ns === NS.HTML; case 7: return (tn === $.CAPTION || tn === $.MARQUEE) && ns === NS.HTML; case 8: return tn === $.TEMPLATE && ns === NS.HTML; case 13: return tn === $.FOREIGN_OBJECT && ns === NS.SVG; case 14: return tn === $.ANNOTATION_XML && ns === NS.MATHML; } return false; } //Stack of open elements var OpenElementStack = module.exports = function (document, treeAdapter) { this.stackTop = -1; this.items = []; this.current = document; this.currentTagName = null; this.currentTmplContent = null; this.tmplCount = 0; this.treeAdapter = treeAdapter; }; //Index of element OpenElementStack.prototype._indexOf = function (element) { var idx = -1; for (var i = this.stackTop; i >= 0; i--) { if (this.items[i] === element) { idx = i; break; } } return idx; }; //Update current element OpenElementStack.prototype._isInTemplate = function () { return this.currentTagName === $.TEMPLATE && this.treeAdapter.getNamespaceURI(this.current) === NS.HTML; }; OpenElementStack.prototype._updateCurrentElement = function () { this.current = this.items[this.stackTop]; this.currentTagName = this.current && this.treeAdapter.getTagName(this.current); this.currentTmplContent = this._isInTemplate() ? this.treeAdapter.getTemplateContent(this.current) : null; }; //Mutations OpenElementStack.prototype.push = function (element) { this.items[++this.stackTop] = element; this._updateCurrentElement(); if (this._isInTemplate()) this.tmplCount++; }; OpenElementStack.prototype.pop = function () { this.stackTop--; if (this.tmplCount > 0 && this._isInTemplate()) this.tmplCount--; this._updateCurrentElement(); }; OpenElementStack.prototype.replace = function (oldElement, newElement) { var idx = this._indexOf(oldElement); this.items[idx] = newElement; if (idx === this.stackTop) this._updateCurrentElement(); }; OpenElementStack.prototype.insertAfter = function (referenceElement, newElement) { var insertionIdx = this._indexOf(referenceElement) + 1; this.items.splice(insertionIdx, 0, newElement); if (insertionIdx === ++this.stackTop) this._updateCurrentElement(); }; OpenElementStack.prototype.popUntilTagNamePopped = function (tagName) { while (this.stackTop > -1) { var tn = this.currentTagName, ns = this.treeAdapter.getNamespaceURI(this.current); this.pop(); if (tn === tagName && ns === NS.HTML) break; } }; OpenElementStack.prototype.popUntilElementPopped = function (element) { while (this.stackTop > -1) { var poppedElement = this.current; this.pop(); if (poppedElement === element) break; } }; OpenElementStack.prototype.popUntilNumberedHeaderPopped = function () { while (this.stackTop > -1) { var tn = this.currentTagName, ns = this.treeAdapter.getNamespaceURI(this.current); this.pop(); if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6 && ns === NS.HTML) break; } }; OpenElementStack.prototype.popUntilTableCellPopped = function () { while (this.stackTop > -1) { var tn = this.currentTagName, ns = this.treeAdapter.getNamespaceURI(this.current); this.pop(); if (tn === $.TD || tn === $.TH && ns === NS.HTML) break; } }; OpenElementStack.prototype.popAllUpToHtmlElement = function () { //NOTE: here we assume that root <html> element is always first in the open element stack, so //we perform this fast stack clean up. this.stackTop = 0; this._updateCurrentElement(); }; OpenElementStack.prototype.clearBackToTableContext = function () { while (this.currentTagName !== $.TABLE && this.currentTagName !== $.TEMPLATE && this.currentTagName !== $.HTML || this.treeAdapter.getNamespaceURI(this.current) !== NS.HTML) this.pop(); }; OpenElementStack.prototype.clearBackToTableBodyContext = function () { while (this.currentTagName !== $.TBODY && this.currentTagName !== $.TFOOT && this.currentTagName !== $.THEAD && this.currentTagName !== $.TEMPLATE && this.currentTagName !== $.HTML || this.treeAdapter.getNamespaceURI(this.current) !== NS.HTML) this.pop(); }; OpenElementStack.prototype.clearBackToTableRowContext = function () { while (this.currentTagName !== $.TR && this.currentTagName !== $.TEMPLATE && this.currentTagName !== $.HTML || this.treeAdapter.getNamespaceURI(this.current) !== NS.HTML) this.pop(); }; OpenElementStack.prototype.remove = function (element) { for (var i = this.stackTop; i >= 0; i--) { if (this.items[i] === element) { this.items.splice(i, 1); this.stackTop--; this._updateCurrentElement(); break; } } }; //Search OpenElementStack.prototype.tryPeekProperlyNestedBodyElement = function () { //Properly nested <body> element (should be second element in stack). var element = this.items[1]; return element && this.treeAdapter.getTagName(element) === $.BODY ? element : null; }; OpenElementStack.prototype.contains = function (element) { return this._indexOf(element) > -1; }; OpenElementStack.prototype.getCommonAncestor = function (element) { var elementIdx = this._indexOf(element); return --elementIdx >= 0 ? this.items[elementIdx] : null; }; OpenElementStack.prototype.isRootHtmlElementCurrent = function () { return this.stackTop === 0 && this.currentTagName === $.HTML; }; //Element in scope OpenElementStack.prototype.hasInScope = function (tagName) { for (var i = this.stackTop; i >= 0; i--) { var tn = this.treeAdapter.getTagName(this.items[i]), ns = this.treeAdapter.getNamespaceURI(this.items[i]); if (tn === tagName && ns === NS.HTML) return true; if (isScopingElement(tn, ns)) return false; } return true; }; OpenElementStack.prototype.hasNumberedHeaderInScope = function () { for (var i = this.stackTop; i >= 0; i--) { var tn = this.treeAdapter.getTagName(this.items[i]), ns = this.treeAdapter.getNamespaceURI(this.items[i]); if ((tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6) && ns === NS.HTML) return true; if (isScopingElement(tn, ns)) return false; } return true; }; OpenElementStack.prototype.hasInListItemScope = function (tagName) { for (var i = this.stackTop; i >= 0; i--) { var tn = this.treeAdapter.getTagName(this.items[i]), ns = this.treeAdapter.getNamespaceURI(this.items[i]); if (tn === tagName && ns === NS.HTML) return true; if ((tn === $.UL || tn === $.OL) && ns === NS.HTML || isScopingElement(tn, ns)) return false; } return true; }; OpenElementStack.prototype.hasInButtonScope = function (tagName) { for (var i = this.stackTop; i >= 0; i--) { var tn = this.treeAdapter.getTagName(this.items[i]), ns = this.treeAdapter.getNamespaceURI(this.items[i]); if (tn === tagName && ns === NS.HTML) return true; if (tn === $.BUTTON && ns === NS.HTML || isScopingElement(tn, ns)) return false; } return true; }; OpenElementStack.prototype.hasInTableScope = function (tagName) { for (var i = this.stackTop; i >= 0; i--) { var tn = this.treeAdapter.getTagName(this.items[i]), ns = this.treeAdapter.getNamespaceURI(this.items[i]); if (ns !== NS.HTML) continue; if (tn === tagName) return true; if (tn === $.TABLE || tn === $.TEMPLATE || tn === $.HTML) return false; } return true; }; OpenElementStack.prototype.hasTableBodyContextInTableScope = function () { for (var i = this.stackTop; i >= 0; i--) { var tn = this.treeAdapter.getTagName(this.items[i]), ns = this.treeAdapter.getNamespaceURI(this.items[i]); if (ns !== NS.HTML) continue; if (tn === $.TBODY || tn === $.THEAD || tn === $.TFOOT) return true; if (tn === $.TABLE || tn === $.HTML) return false; } return true; }; OpenElementStack.prototype.hasInSelectScope = function (tagName) { for (var i = this.stackTop; i >= 0; i--) { var tn = this.treeAdapter.getTagName(this.items[i]), ns = this.treeAdapter.getNamespaceURI(this.items[i]); if (ns !== NS.HTML) continue; if (tn === tagName) return true; if (tn !== $.OPTION && tn !== $.OPTGROUP) return false; } return true; }; //Implied end tags OpenElementStack.prototype.generateImpliedEndTags = function () { while (isImpliedEndTagRequired(this.currentTagName)) this.pop(); }; OpenElementStack.prototype.generateImpliedEndTagsWithExclusion = function (exclusionTagName) { while (isImpliedEndTagRequired(this.currentTagName) && this.currentTagName !== exclusionTagName) this.pop(); }; /***/ }), /* 344 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var NS = exports.NAMESPACES = { HTML: 'http://www.w3.org/1999/xhtml', MATHML: 'http://www.w3.org/1998/Math/MathML', SVG: 'http://www.w3.org/2000/svg', XLINK: 'http://www.w3.org/1999/xlink', XML: 'http://www.w3.org/XML/1998/namespace', XMLNS: 'http://www.w3.org/2000/xmlns/' }; exports.ATTRS = { TYPE: 'type', ACTION: 'action', ENCODING: 'encoding', PROMPT: 'prompt', NAME: 'name', COLOR: 'color', FACE: 'face', SIZE: 'size' }; exports.DOCUMENT_MODE = { NO_QUIRKS: 'no-quirks', QUIRKS: 'quirks', LIMITED_QUIRKS: 'limited-quirks' }; var $ = exports.TAG_NAMES = { A: 'a', ADDRESS: 'address', ANNOTATION_XML: 'annotation-xml', APPLET: 'applet', AREA: 'area', ARTICLE: 'article', ASIDE: 'aside', B: 'b', BASE: 'base', BASEFONT: 'basefont', BGSOUND: 'bgsound', BIG: 'big', BLOCKQUOTE: 'blockquote', BODY: 'body', BR: 'br', BUTTON: 'button', CAPTION: 'caption', CENTER: 'center', CODE: 'code', COL: 'col', COLGROUP: 'colgroup', DD: 'dd', DESC: 'desc', DETAILS: 'details', DIALOG: 'dialog', DIR: 'dir', DIV: 'div', DL: 'dl', DT: 'dt', EM: 'em', EMBED: 'embed', FIELDSET: 'fieldset', FIGCAPTION: 'figcaption', FIGURE: 'figure', FONT: 'font', FOOTER: 'footer', FOREIGN_OBJECT: 'foreignObject', FORM: 'form', FRAME: 'frame', FRAMESET: 'frameset', H1: 'h1', H2: 'h2', H3: 'h3', H4: 'h4', H5: 'h5', H6: 'h6', HEAD: 'head', HEADER: 'header', HGROUP: 'hgroup', HR: 'hr', HTML: 'html', I: 'i', IMG: 'img', IMAGE: 'image', INPUT: 'input', IFRAME: 'iframe', KEYGEN: 'keygen', LABEL: 'label', LI: 'li', LINK: 'link', LISTING: 'listing', MAIN: 'main', MALIGNMARK: 'malignmark', MARQUEE: 'marquee', MATH: 'math', MENU: 'menu', MENUITEM: 'menuitem', META: 'meta', MGLYPH: 'mglyph', MI: 'mi', MO: 'mo', MN: 'mn', MS: 'ms', MTEXT: 'mtext', NAV: 'nav', NOBR: 'nobr', NOFRAMES: 'noframes', NOEMBED: 'noembed', NOSCRIPT: 'noscript', OBJECT: 'object', OL: 'ol', OPTGROUP: 'optgroup', OPTION: 'option', P: 'p', PARAM: 'param', PLAINTEXT: 'plaintext', PRE: 'pre', RB: 'rb', RP: 'rp', RT: 'rt', RTC: 'rtc', RUBY: 'ruby', S: 's', SCRIPT: 'script', SECTION: 'section', SELECT: 'select', SOURCE: 'source', SMALL: 'small', SPAN: 'span', STRIKE: 'strike', STRONG: 'strong', STYLE: 'style', SUB: 'sub', SUMMARY: 'summary', SUP: 'sup', TABLE: 'table', TBODY: 'tbody', TEMPLATE: 'template', TEXTAREA: 'textarea', TFOOT: 'tfoot', TD: 'td', TH: 'th', THEAD: 'thead', TITLE: 'title', TR: 'tr', TRACK: 'track', TT: 'tt', U: 'u', UL: 'ul', SVG: 'svg', VAR: 'var', WBR: 'wbr', XMP: 'xmp' }; var SPECIAL_ELEMENTS = exports.SPECIAL_ELEMENTS = Object.create(null); SPECIAL_ELEMENTS[NS.HTML] = Object.create(null); SPECIAL_ELEMENTS[NS.HTML][$.ADDRESS] = true; SPECIAL_ELEMENTS[NS.HTML][$.APPLET] = true; SPECIAL_ELEMENTS[NS.HTML][$.AREA] = true; SPECIAL_ELEMENTS[NS.HTML][$.ARTICLE] = true; SPECIAL_ELEMENTS[NS.HTML][$.ASIDE] = true; SPECIAL_ELEMENTS[NS.HTML][$.BASE] = true; SPECIAL_ELEMENTS[NS.HTML][$.BASEFONT] = true; SPECIAL_ELEMENTS[NS.HTML][$.BGSOUND] = true; SPECIAL_ELEMENTS[NS.HTML][$.BLOCKQUOTE] = true; SPECIAL_ELEMENTS[NS.HTML][$.BODY] = true; SPECIAL_ELEMENTS[NS.HTML][$.BR] = true; SPECIAL_ELEMENTS[NS.HTML][$.BUTTON] = true; SPECIAL_ELEMENTS[NS.HTML][$.CAPTION] = true; SPECIAL_ELEMENTS[NS.HTML][$.CENTER] = true; SPECIAL_ELEMENTS[NS.HTML][$.COL] = true; SPECIAL_ELEMENTS[NS.HTML][$.COLGROUP] = true; SPECIAL_ELEMENTS[NS.HTML][$.DD] = true; SPECIAL_ELEMENTS[NS.HTML][$.DETAILS] = true; SPECIAL_ELEMENTS[NS.HTML][$.DIR] = true; SPECIAL_ELEMENTS[NS.HTML][$.DIV] = true; SPECIAL_ELEMENTS[NS.HTML][$.DL] = true; SPECIAL_ELEMENTS[NS.HTML][$.DT] = true; SPECIAL_ELEMENTS[NS.HTML][$.EMBED] = true; SPECIAL_ELEMENTS[NS.HTML][$.FIELDSET] = true; SPECIAL_ELEMENTS[NS.HTML][$.FIGCAPTION] = true; SPECIAL_ELEMENTS[NS.HTML][$.FIGURE] = true; SPECIAL_ELEMENTS[NS.HTML][$.FOOTER] = true; SPECIAL_ELEMENTS[NS.HTML][$.FORM] = true; SPECIAL_ELEMENTS[NS.HTML][$.FRAME] = true; SPECIAL_ELEMENTS[NS.HTML][$.FRAMESET] = true; SPECIAL_ELEMENTS[NS.HTML][$.H1] = true; SPECIAL_ELEMENTS[NS.HTML][$.H2] = true; SPECIAL_ELEMENTS[NS.HTML][$.H3] = true; SPECIAL_ELEMENTS[NS.HTML][$.H4] = true; SPECIAL_ELEMENTS[NS.HTML][$.H5] = true; SPECIAL_ELEMENTS[NS.HTML][$.H6] = true; SPECIAL_ELEMENTS[NS.HTML][$.HEAD] = true; SPECIAL_ELEMENTS[NS.HTML][$.HEADER] = true; SPECIAL_ELEMENTS[NS.HTML][$.HGROUP] = true; SPECIAL_ELEMENTS[NS.HTML][$.HR] = true; SPECIAL_ELEMENTS[NS.HTML][$.HTML] = true; SPECIAL_ELEMENTS[NS.HTML][$.IFRAME] = true; SPECIAL_ELEMENTS[NS.HTML][$.IMG] = true; SPECIAL_ELEMENTS[NS.HTML][$.INPUT] = true; SPECIAL_ELEMENTS[NS.HTML][$.LI] = true; SPECIAL_ELEMENTS[NS.HTML][$.LINK] = true; SPECIAL_ELEMENTS[NS.HTML][$.LISTING] = true; SPECIAL_ELEMENTS[NS.HTML][$.MAIN] = true; SPECIAL_ELEMENTS[NS.HTML][$.MARQUEE] = true; SPECIAL_ELEMENTS[NS.HTML][$.MENU] = true; SPECIAL_ELEMENTS[NS.HTML][$.META] = true; SPECIAL_ELEMENTS[NS.HTML][$.NAV] = true; SPECIAL_ELEMENTS[NS.HTML][$.NOEMBED] = true; SPECIAL_ELEMENTS[NS.HTML][$.NOFRAMES] = true; SPECIAL_ELEMENTS[NS.HTML][$.NOSCRIPT] = true; SPECIAL_ELEMENTS[NS.HTML][$.OBJECT] = true; SPECIAL_ELEMENTS[NS.HTML][$.OL] = true; SPECIAL_ELEMENTS[NS.HTML][$.P] = true; SPECIAL_ELEMENTS[NS.HTML][$.PARAM] = true; SPECIAL_ELEMENTS[NS.HTML][$.PLAINTEXT] = true; SPECIAL_ELEMENTS[NS.HTML][$.PRE] = true; SPECIAL_ELEMENTS[NS.HTML][$.SCRIPT] = true; SPECIAL_ELEMENTS[NS.HTML][$.SECTION] = true; SPECIAL_ELEMENTS[NS.HTML][$.SELECT] = true; SPECIAL_ELEMENTS[NS.HTML][$.SOURCE] = true; SPECIAL_ELEMENTS[NS.HTML][$.STYLE] = true; SPECIAL_ELEMENTS[NS.HTML][$.SUMMARY] = true; SPECIAL_ELEMENTS[NS.HTML][$.TABLE] = true; SPECIAL_ELEMENTS[NS.HTML][$.TBODY] = true; SPECIAL_ELEMENTS[NS.HTML][$.TD] = true; SPECIAL_ELEMENTS[NS.HTML][$.TEMPLATE] = true; SPECIAL_ELEMENTS[NS.HTML][$.TEXTAREA] = true; SPECIAL_ELEMENTS[NS.HTML][$.TFOOT] = true; SPECIAL_ELEMENTS[NS.HTML][$.TH] = true; SPECIAL_ELEMENTS[NS.HTML][$.THEAD] = true; SPECIAL_ELEMENTS[NS.HTML][$.TITLE] = true; SPECIAL_ELEMENTS[NS.HTML][$.TR] = true; SPECIAL_ELEMENTS[NS.HTML][$.TRACK] = true; SPECIAL_ELEMENTS[NS.HTML][$.UL] = true; SPECIAL_ELEMENTS[NS.HTML][$.WBR] = true; SPECIAL_ELEMENTS[NS.HTML][$.XMP] = true; SPECIAL_ELEMENTS[NS.MATHML] = Object.create(null); SPECIAL_ELEMENTS[NS.MATHML][$.MI] = true; SPECIAL_ELEMENTS[NS.MATHML][$.MO] = true; SPECIAL_ELEMENTS[NS.MATHML][$.MN] = true; SPECIAL_ELEMENTS[NS.MATHML][$.MS] = true; SPECIAL_ELEMENTS[NS.MATHML][$.MTEXT] = true; SPECIAL_ELEMENTS[NS.MATHML][$.ANNOTATION_XML] = true; SPECIAL_ELEMENTS[NS.SVG] = Object.create(null); SPECIAL_ELEMENTS[NS.SVG][$.TITLE] = true; SPECIAL_ELEMENTS[NS.SVG][$.FOREIGN_OBJECT] = true; SPECIAL_ELEMENTS[NS.SVG][$.DESC] = true; /***/ }), /* 345 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; //Const var NOAH_ARK_CAPACITY = 3; //List of formatting elements var FormattingElementList = module.exports = function (treeAdapter) { this.length = 0; this.entries = []; this.treeAdapter = treeAdapter; this.bookmark = null; }; //Entry types FormattingElementList.MARKER_ENTRY = 'MARKER_ENTRY'; FormattingElementList.ELEMENT_ENTRY = 'ELEMENT_ENTRY'; //Noah Ark's condition //OPTIMIZATION: at first we try to find possible candidates for exclusion using //lightweight heuristics without thorough attributes check. FormattingElementList.prototype._getNoahArkConditionCandidates = function (newElement) { var candidates = []; if (this.length >= NOAH_ARK_CAPACITY) { var neAttrsLength = this.treeAdapter.getAttrList(newElement).length, neTagName = this.treeAdapter.getTagName(newElement), neNamespaceURI = this.treeAdapter.getNamespaceURI(newElement); for (var i = this.length - 1; i >= 0; i--) { var entry = this.entries[i]; if (entry.type === FormattingElementList.MARKER_ENTRY) break; var element = entry.element, elementAttrs = this.treeAdapter.getAttrList(element), isCandidate = this.treeAdapter.getTagName(element) === neTagName && this.treeAdapter.getNamespaceURI(element) === neNamespaceURI && elementAttrs.length === neAttrsLength; if (isCandidate) candidates.push({idx: i, attrs: elementAttrs}); } } return candidates.length < NOAH_ARK_CAPACITY ? [] : candidates; }; FormattingElementList.prototype._ensureNoahArkCondition = function (newElement) { var candidates = this._getNoahArkConditionCandidates(newElement), cLength = candidates.length; if (cLength) { var neAttrs = this.treeAdapter.getAttrList(newElement), neAttrsLength = neAttrs.length, neAttrsMap = Object.create(null); //NOTE: build attrs map for the new element so we can perform fast lookups for (var i = 0; i < neAttrsLength; i++) { var neAttr = neAttrs[i]; neAttrsMap[neAttr.name] = neAttr.value; } for (i = 0; i < neAttrsLength; i++) { for (var j = 0; j < cLength; j++) { var cAttr = candidates[j].attrs[i]; if (neAttrsMap[cAttr.name] !== cAttr.value) { candidates.splice(j, 1); cLength--; } if (candidates.length < NOAH_ARK_CAPACITY) return; } } //NOTE: remove bottommost candidates until Noah's Ark condition will not be met for (i = cLength - 1; i >= NOAH_ARK_CAPACITY - 1; i--) { this.entries.splice(candidates[i].idx, 1); this.length--; } } }; //Mutations FormattingElementList.prototype.insertMarker = function () { this.entries.push({type: FormattingElementList.MARKER_ENTRY}); this.length++; }; FormattingElementList.prototype.pushElement = function (element, token) { this._ensureNoahArkCondition(element); this.entries.push({ type: FormattingElementList.ELEMENT_ENTRY, element: element, token: token }); this.length++; }; FormattingElementList.prototype.insertElementAfterBookmark = function (element, token) { var bookmarkIdx = this.length - 1; for (; bookmarkIdx >= 0; bookmarkIdx--) { if (this.entries[bookmarkIdx] === this.bookmark) break; } this.entries.splice(bookmarkIdx + 1, 0, { type: FormattingElementList.ELEMENT_ENTRY, element: element, token: token }); this.length++; }; FormattingElementList.prototype.removeEntry = function (entry) { for (var i = this.length - 1; i >= 0; i--) { if (this.entries[i] === entry) { this.entries.splice(i, 1); this.length--; break; } } }; FormattingElementList.prototype.clearToLastMarker = function () { while (this.length) { var entry = this.entries.pop(); this.length--; if (entry.type === FormattingElementList.MARKER_ENTRY) break; } }; //Search FormattingElementList.prototype.getElementEntryInScopeWithTagName = function (tagName) { for (var i = this.length - 1; i >= 0; i--) { var entry = this.entries[i]; if (entry.type === FormattingElementList.MARKER_ENTRY) return null; if (this.treeAdapter.getTagName(entry.element) === tagName) return entry; } return null; }; FormattingElementList.prototype.getElementEntry = function (element) { for (var i = this.length - 1; i >= 0; i--) { var entry = this.entries[i]; if (entry.type === FormattingElementList.ELEMENT_ENTRY && entry.element === element) return entry; } return null; }; /***/ }), /* 346 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Mixin = __webpack_require__(347), Tokenizer = __webpack_require__(339), LocationInfoTokenizerMixin = __webpack_require__(348), PositionTrackingPreprocessorMixin = __webpack_require__(349), LocationInfoOpenElementStackMixin = __webpack_require__(350), HTML = __webpack_require__(344), inherits = __webpack_require__(9).inherits; //Aliases var $ = HTML.TAG_NAMES; var LocationInfoParserMixin = module.exports = function (parser) { Mixin.call(this, parser); this.parser = parser; this.posTracker = null; this.lastStartTagToken = null; this.lastFosterParentingLocation = null; this.currentToken = null; }; inherits(LocationInfoParserMixin, Mixin); LocationInfoParserMixin.prototype._setStartLocation = function (element) { if (this.lastStartTagToken) { element.__location = Object.create(this.lastStartTagToken.location); element.__location.startTag = this.lastStartTagToken.location; } else element.__location = null; }; LocationInfoParserMixin.prototype._setEndLocation = function (element, closingToken) { var loc = element.__location; if (loc) { if (closingToken.location) { var ctLoc = closingToken.location, tn = this.parser.treeAdapter.getTagName(element); // NOTE: For cases like <p> <p> </p> - First 'p' closes without a closing // tag and for cases like <td> <p> </td> - 'p' closes without a closing tag. var isClosingEndTag = closingToken.type === Tokenizer.END_TAG_TOKEN && tn === closingToken.tagName; if (isClosingEndTag) { loc.endTag = Object.create(ctLoc); loc.endOffset = ctLoc.endOffset; } else loc.endOffset = ctLoc.startOffset; } else if (closingToken.type === Tokenizer.EOF_TOKEN) loc.endOffset = this.posTracker.offset; } }; LocationInfoParserMixin.prototype._getOverriddenMethods = function (mxn, orig) { return { _bootstrap: function (document, fragmentContext) { orig._bootstrap.call(this, document, fragmentContext); mxn.lastStartTagToken = null; mxn.lastFosterParentingLocation = null; mxn.currentToken = null; mxn.posTracker = new PositionTrackingPreprocessorMixin(this.tokenizer.preprocessor); new LocationInfoTokenizerMixin(this.tokenizer); new LocationInfoOpenElementStackMixin(this.openElements, { onItemPop: function (element) { mxn._setEndLocation(element, mxn.currentToken); } }); }, _runParsingLoop: function (scriptHandler) { orig._runParsingLoop.call(this, scriptHandler); // NOTE: generate location info for elements // that remains on open element stack for (var i = this.openElements.stackTop; i >= 0; i--) mxn._setEndLocation(this.openElements.items[i], mxn.currentToken); }, //Token processing _processTokenInForeignContent: function (token) { mxn.currentToken = token; orig._processTokenInForeignContent.call(this, token); }, _processToken: function (token) { mxn.currentToken = token; orig._processToken.call(this, token); //NOTE: <body> and <html> are never popped from the stack, so we need to updated //their end location explicitly. var requireExplicitUpdate = token.type === Tokenizer.END_TAG_TOKEN && (token.tagName === $.HTML || token.tagName === $.BODY && this.openElements.hasInScope($.BODY)); if (requireExplicitUpdate) { for (var i = this.openElements.stackTop; i >= 0; i--) { var element = this.openElements.items[i]; if (this.treeAdapter.getTagName(element) === token.tagName) { mxn._setEndLocation(element, token); break; } } } }, //Doctype _setDocumentType: function (token) { orig._setDocumentType.call(this, token); var documentChildren = this.treeAdapter.getChildNodes(this.document), cnLength = documentChildren.length; for (var i = 0; i < cnLength; i++) { var node = documentChildren[i]; if (this.treeAdapter.isDocumentTypeNode(node)) { node.__location = token.location; break; } } }, //Elements _attachElementToTree: function (element) { //NOTE: _attachElementToTree is called from _appendElement, _insertElement and _insertTemplate methods. //So we will use token location stored in this methods for the element. mxn._setStartLocation(element); mxn.lastStartTagToken = null; orig._attachElementToTree.call(this, element); }, _appendElement: function (token, namespaceURI) { mxn.lastStartTagToken = token; orig._appendElement.call(this, token, namespaceURI); }, _insertElement: function (token, namespaceURI) { mxn.lastStartTagToken = token; orig._insertElement.call(this, token, namespaceURI); }, _insertTemplate: function (token) { mxn.lastStartTagToken = token; orig._insertTemplate.call(this, token); var tmplContent = this.treeAdapter.getTemplateContent(this.openElements.current); tmplContent.__location = null; }, _insertFakeRootElement: function () { orig._insertFakeRootElement.call(this); this.openElements.current.__location = null; }, //Comments _appendCommentNode: function (token, parent) { orig._appendCommentNode.call(this, token, parent); var children = this.treeAdapter.getChildNodes(parent), commentNode = children[children.length - 1]; commentNode.__location = token.location; }, //Text _findFosterParentingLocation: function () { //NOTE: store last foster parenting location, so we will be able to find inserted text //in case of foster parenting mxn.lastFosterParentingLocation = orig._findFosterParentingLocation.call(this); return mxn.lastFosterParentingLocation; }, _insertCharacters: function (token) { orig._insertCharacters.call(this, token); var hasFosterParent = this._shouldFosterParentOnInsertion(), parent = hasFosterParent && mxn.lastFosterParentingLocation.parent || this.openElements.currentTmplContent || this.openElements.current, siblings = this.treeAdapter.getChildNodes(parent), textNodeIdx = hasFosterParent && mxn.lastFosterParentingLocation.beforeElement ? siblings.indexOf(mxn.lastFosterParentingLocation.beforeElement) - 1 : siblings.length - 1, textNode = siblings[textNodeIdx]; //NOTE: if we have location assigned by another token, then just update end position if (textNode.__location) textNode.__location.endOffset = token.location.endOffset; else textNode.__location = token.location; } }; }; /***/ }), /* 347 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Mixin = module.exports = function (host) { var originalMethods = {}, overriddenMethods = this._getOverriddenMethods(this, originalMethods); Object.keys(overriddenMethods).forEach(function (key) { if (typeof overriddenMethods[key] === 'function') { originalMethods[key] = host[key]; host[key] = overriddenMethods[key]; } }); }; Mixin.prototype._getOverriddenMethods = function () { throw new Error('Not implemented'); }; /***/ }), /* 348 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Mixin = __webpack_require__(347), Tokenizer = __webpack_require__(339), PositionTrackingPreprocessorMixin = __webpack_require__(349), inherits = __webpack_require__(9).inherits; var LocationInfoTokenizerMixin = module.exports = function (tokenizer) { Mixin.call(this, tokenizer); this.tokenizer = tokenizer; this.posTracker = new PositionTrackingPreprocessorMixin(tokenizer.preprocessor); this.currentAttrLocation = null; this.currentTokenLocation = null; }; inherits(LocationInfoTokenizerMixin, Mixin); LocationInfoTokenizerMixin.prototype._getCurrentLocation = function () { return { line: this.posTracker.line, col: this.posTracker.col, startOffset: this.posTracker.offset, endOffset: -1 }; }; LocationInfoTokenizerMixin.prototype._attachCurrentAttrLocationInfo = function () { this.currentAttrLocation.endOffset = this.posTracker.offset; var currentToken = this.tokenizer.currentToken, currentAttr = this.tokenizer.currentAttr; if (!currentToken.location.attrs) currentToken.location.attrs = Object.create(null); currentToken.location.attrs[currentAttr.name] = this.currentAttrLocation; }; LocationInfoTokenizerMixin.prototype._getOverriddenMethods = function (mxn, orig) { var methods = { _createStartTagToken: function () { orig._createStartTagToken.call(this); this.currentToken.location = mxn.currentTokenLocation; }, _createEndTagToken: function () { orig._createEndTagToken.call(this); this.currentToken.location = mxn.currentTokenLocation; }, _createCommentToken: function () { orig._createCommentToken.call(this); this.currentToken.location = mxn.currentTokenLocation; }, _createDoctypeToken: function (initialName) { orig._createDoctypeToken.call(this, initialName); this.currentToken.location = mxn.currentTokenLocation; }, _createCharacterToken: function (type, ch) { orig._createCharacterToken.call(this, type, ch); this.currentCharacterToken.location = mxn.currentTokenLocation; }, _createAttr: function (attrNameFirstCh) { orig._createAttr.call(this, attrNameFirstCh); mxn.currentAttrLocation = mxn._getCurrentLocation(); }, _leaveAttrName: function (toState) { orig._leaveAttrName.call(this, toState); mxn._attachCurrentAttrLocationInfo(); }, _leaveAttrValue: function (toState) { orig._leaveAttrValue.call(this, toState); mxn._attachCurrentAttrLocationInfo(); }, _emitCurrentToken: function () { //NOTE: if we have pending character token make it's end location equal to the //current token's start location. if (this.currentCharacterToken) this.currentCharacterToken.location.endOffset = this.currentToken.location.startOffset; this.currentToken.location.endOffset = mxn.posTracker.offset + 1; orig._emitCurrentToken.call(this); }, _emitCurrentCharacterToken: function () { //NOTE: if we have character token and it's location wasn't set in the _emitCurrentToken(), //then set it's location at the current preprocessor position. //We don't need to increment preprocessor position, since character token //emission is always forced by the start of the next character token here. //So, we already have advanced position. if (this.currentCharacterToken && this.currentCharacterToken.location.endOffset === -1) this.currentCharacterToken.location.endOffset = mxn.posTracker.offset; orig._emitCurrentCharacterToken.call(this); } }; //NOTE: patch initial states for each mode to obtain token start position Object.keys(Tokenizer.MODE).forEach(function (modeName) { var state = Tokenizer.MODE[modeName]; methods[state] = function (cp) { mxn.currentTokenLocation = mxn._getCurrentLocation(); orig[state].call(this, cp); }; }); return methods; }; /***/ }), /* 349 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Mixin = __webpack_require__(347), inherits = __webpack_require__(9).inherits, UNICODE = __webpack_require__(341); //Aliases var $ = UNICODE.CODE_POINTS; var PositionTrackingPreprocessorMixin = module.exports = function (preprocessor) { // NOTE: avoid installing tracker twice if (!preprocessor.__locTracker) { preprocessor.__locTracker = this; Mixin.call(this, preprocessor); this.preprocessor = preprocessor; this.isEol = false; this.lineStartPos = 0; this.droppedBufferSize = 0; this.col = -1; this.line = 1; } return preprocessor.__locTracker; }; inherits(PositionTrackingPreprocessorMixin, Mixin); Object.defineProperty(PositionTrackingPreprocessorMixin.prototype, 'offset', { get: function () { return this.droppedBufferSize + this.preprocessor.pos; } }); PositionTrackingPreprocessorMixin.prototype._getOverriddenMethods = function (mxn, orig) { return { advance: function () { var cp = orig.advance.call(this); //NOTE: LF should be in the last column of the line if (mxn.isEol) { mxn.isEol = false; mxn.line++; mxn.lineStartPos = mxn.offset; } if (cp === $.LINE_FEED) mxn.isEol = true; mxn.col = mxn.offset - mxn.lineStartPos + 1; return cp; }, retreat: function () { orig.retreat.call(this); mxn.isEol = false; mxn.col = mxn.offset - mxn.lineStartPos + 1; }, dropParsedChunk: function () { var prevPos = this.pos; orig.dropParsedChunk.call(this); mxn.droppedBufferSize += prevPos - this.pos; } }; }; /***/ }), /* 350 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Mixin = __webpack_require__(347), inherits = __webpack_require__(9).inherits; var LocationInfoOpenElementStackMixin = module.exports = function (stack, options) { Mixin.call(this, stack); this.onItemPop = options.onItemPop; }; inherits(LocationInfoOpenElementStackMixin, Mixin); LocationInfoOpenElementStackMixin.prototype._getOverriddenMethods = function (mxn, orig) { return { pop: function () { mxn.onItemPop(this.current); orig.pop.call(this); }, popAllUpToHtmlElement: function () { for (var i = this.stackTop; i > 0; i--) mxn.onItemPop(this.items[i]); orig.popAllUpToHtmlElement.call(this); }, remove: function (element) { mxn.onItemPop(this.current); orig.remove.call(this, element); } }; }; /***/ }), /* 351 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var DOCUMENT_MODE = __webpack_require__(344).DOCUMENT_MODE; //Node construction exports.createDocument = function () { return { nodeName: '#document', mode: DOCUMENT_MODE.NO_QUIRKS, childNodes: [] }; }; exports.createDocumentFragment = function () { return { nodeName: '#document-fragment', childNodes: [] }; }; exports.createElement = function (tagName, namespaceURI, attrs) { return { nodeName: tagName, tagName: tagName, attrs: attrs, namespaceURI: namespaceURI, childNodes: [], parentNode: null }; }; exports.createCommentNode = function (data) { return { nodeName: '#comment', data: data, parentNode: null }; }; var createTextNode = function (value) { return { nodeName: '#text', value: value, parentNode: null }; }; //Tree mutation var appendChild = exports.appendChild = function (parentNode, newNode) { parentNode.childNodes.push(newNode); newNode.parentNode = parentNode; }; var insertBefore = exports.insertBefore = function (parentNode, newNode, referenceNode) { var insertionIdx = parentNode.childNodes.indexOf(referenceNode); parentNode.childNodes.splice(insertionIdx, 0, newNode); newNode.parentNode = parentNode; }; exports.setTemplateContent = function (templateElement, contentElement) { templateElement.content = contentElement; }; exports.getTemplateContent = function (templateElement) { return templateElement.content; }; exports.setDocumentType = function (document, name, publicId, systemId) { var doctypeNode = null; for (var i = 0; i < document.childNodes.length; i++) { if (document.childNodes[i].nodeName === '#documentType') { doctypeNode = document.childNodes[i]; break; } } if (doctypeNode) { doctypeNode.name = name; doctypeNode.publicId = publicId; doctypeNode.systemId = systemId; } else { appendChild(document, { nodeName: '#documentType', name: name, publicId: publicId, systemId: systemId }); } }; exports.setDocumentMode = function (document, mode) { document.mode = mode; }; exports.getDocumentMode = function (document) { return document.mode; }; exports.detachNode = function (node) { if (node.parentNode) { var idx = node.parentNode.childNodes.indexOf(node); node.parentNode.childNodes.splice(idx, 1); node.parentNode = null; } }; exports.insertText = function (parentNode, text) { if (parentNode.childNodes.length) { var prevNode = parentNode.childNodes[parentNode.childNodes.length - 1]; if (prevNode.nodeName === '#text') { prevNode.value += text; return; } } appendChild(parentNode, createTextNode(text)); }; exports.insertTextBefore = function (parentNode, text, referenceNode) { var prevNode = parentNode.childNodes[parentNode.childNodes.indexOf(referenceNode) - 1]; if (prevNode && prevNode.nodeName === '#text') prevNode.value += text; else insertBefore(parentNode, createTextNode(text), referenceNode); }; exports.adoptAttributes = function (recipient, attrs) { var recipientAttrsMap = []; for (var i = 0; i < recipient.attrs.length; i++) recipientAttrsMap.push(recipient.attrs[i].name); for (var j = 0; j < attrs.length; j++) { if (recipientAttrsMap.indexOf(attrs[j].name) === -1) recipient.attrs.push(attrs[j]); } }; //Tree traversing exports.getFirstChild = function (node) { return node.childNodes[0]; }; exports.getChildNodes = function (node) { return node.childNodes; }; exports.getParentNode = function (node) { return node.parentNode; }; exports.getAttrList = function (element) { return element.attrs; }; //Node data exports.getTagName = function (element) { return element.tagName; }; exports.getNamespaceURI = function (element) { return element.namespaceURI; }; exports.getTextNodeContent = function (textNode) { return textNode.value; }; exports.getCommentNodeContent = function (commentNode) { return commentNode.data; }; exports.getDocumentTypeNodeName = function (doctypeNode) { return doctypeNode.name; }; exports.getDocumentTypeNodePublicId = function (doctypeNode) { return doctypeNode.publicId; }; exports.getDocumentTypeNodeSystemId = function (doctypeNode) { return doctypeNode.systemId; }; //Node types exports.isTextNode = function (node) { return node.nodeName === '#text'; }; exports.isCommentNode = function (node) { return node.nodeName === '#comment'; }; exports.isDocumentTypeNode = function (node) { return node.nodeName === '#documentType'; }; exports.isElementNode = function (node) { return !!node.tagName; }; /***/ }), /* 352 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function mergeOptions(defaults, options) { options = options || Object.create(null); return [defaults, options].reduce(function (merged, optObj) { Object.keys(optObj).forEach(function (key) { merged[key] = optObj[key]; }); return merged; }, Object.create(null)); }; /***/ }), /* 353 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var DOCUMENT_MODE = __webpack_require__(344).DOCUMENT_MODE; //Const var VALID_DOCTYPE_NAME = 'html', QUIRKS_MODE_SYSTEM_ID = 'http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd', QUIRKS_MODE_PUBLIC_ID_PREFIXES = [ '+//silmaril//dtd html pro v0r11 19970101//en', '-//advasoft ltd//dtd html 3.0 aswedit + extensions//en', '-//as//dtd html 3.0 aswedit + extensions//en', '-//ietf//dtd html 2.0 level 1//en', '-//ietf//dtd html 2.0 level 2//en', '-//ietf//dtd html 2.0 strict level 1//en', '-//ietf//dtd html 2.0 strict level 2//en', '-//ietf//dtd html 2.0 strict//en', '-//ietf//dtd html 2.0//en', '-//ietf//dtd html 2.1e//en', '-//ietf//dtd html 3.0//en', '-//ietf//dtd html 3.0//en//', '-//ietf//dtd html 3.2 final//en', '-//ietf//dtd html 3.2//en', '-//ietf//dtd html 3//en', '-//ietf//dtd html level 0//en', '-//ietf//dtd html level 0//en//2.0', '-//ietf//dtd html level 1//en', '-//ietf//dtd html level 1//en//2.0', '-//ietf//dtd html level 2//en', '-//ietf//dtd html level 2//en//2.0', '-//ietf//dtd html level 3//en', '-//ietf//dtd html level 3//en//3.0', '-//ietf//dtd html strict level 0//en', '-//ietf//dtd html strict level 0//en//2.0', '-//ietf//dtd html strict level 1//en', '-//ietf//dtd html strict level 1//en//2.0', '-//ietf//dtd html strict level 2//en', '-//ietf//dtd html strict level 2//en//2.0', '-//ietf//dtd html strict level 3//en', '-//ietf//dtd html strict level 3//en//3.0', '-//ietf//dtd html strict//en', '-//ietf//dtd html strict//en//2.0', '-//ietf//dtd html strict//en//3.0', '-//ietf//dtd html//en', '-//ietf//dtd html//en//2.0', '-//ietf//dtd html//en//3.0', '-//metrius//dtd metrius presentational//en', '-//microsoft//dtd internet explorer 2.0 html strict//en', '-//microsoft//dtd internet explorer 2.0 html//en', '-//microsoft//dtd internet explorer 2.0 tables//en', '-//microsoft//dtd internet explorer 3.0 html strict//en', '-//microsoft//dtd internet explorer 3.0 html//en', '-//microsoft//dtd internet explorer 3.0 tables//en', '-//netscape comm. corp.//dtd html//en', '-//netscape comm. corp.//dtd strict html//en', '-//o\'reilly and associates//dtd html 2.0//en', '-//o\'reilly and associates//dtd html extended 1.0//en', '-//spyglass//dtd html 2.0 extended//en', '-//sq//dtd html 2.0 hotmetal + extensions//en', '-//sun microsystems corp.//dtd hotjava html//en', '-//sun microsystems corp.//dtd hotjava strict html//en', '-//w3c//dtd html 3 1995-03-24//en', '-//w3c//dtd html 3.2 draft//en', '-//w3c//dtd html 3.2 final//en', '-//w3c//dtd html 3.2//en', '-//w3c//dtd html 3.2s draft//en', '-//w3c//dtd html 4.0 frameset//en', '-//w3c//dtd html 4.0 transitional//en', '-//w3c//dtd html experimental 19960712//en', '-//w3c//dtd html experimental 970421//en', '-//w3c//dtd w3 html//en', '-//w3o//dtd w3 html 3.0//en', '-//w3o//dtd w3 html 3.0//en//', '-//webtechs//dtd mozilla html 2.0//en', '-//webtechs//dtd mozilla html//en' ], QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES = QUIRKS_MODE_PUBLIC_ID_PREFIXES.concat([ '-//w3c//dtd html 4.01 frameset//', '-//w3c//dtd html 4.01 transitional//' ]), QUIRKS_MODE_PUBLIC_IDS = [ '-//w3o//dtd w3 html strict 3.0//en//', '-/w3c/dtd html 4.0 transitional/en', 'html' ], LIMITED_QUIRKS_PUBLIC_ID_PREFIXES = [ '-//W3C//DTD XHTML 1.0 Frameset//', '-//W3C//DTD XHTML 1.0 Transitional//' ], LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES = LIMITED_QUIRKS_PUBLIC_ID_PREFIXES.concat([ '-//W3C//DTD HTML 4.01 Frameset//', '-//W3C//DTD HTML 4.01 Transitional//' ]); //Utils function enquoteDoctypeId(id) { var quote = id.indexOf('"') !== -1 ? '\'' : '"'; return quote + id + quote; } function hasPrefix(publicId, prefixes) { for (var i = 0; i < prefixes.length; i++) { if (publicId.indexOf(prefixes[i]) === 0) return true; } return false; } //API exports.getDocumentMode = function (name, publicId, systemId) { if (name !== VALID_DOCTYPE_NAME) return DOCUMENT_MODE.QUIRKS; if (systemId && systemId.toLowerCase() === QUIRKS_MODE_SYSTEM_ID) return DOCUMENT_MODE.QUIRKS; if (publicId !== null) { publicId = publicId.toLowerCase(); if (QUIRKS_MODE_PUBLIC_IDS.indexOf(publicId) > -1) return DOCUMENT_MODE.QUIRKS; var prefixes = systemId === null ? QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES : QUIRKS_MODE_PUBLIC_ID_PREFIXES; if (hasPrefix(publicId, prefixes)) return DOCUMENT_MODE.QUIRKS; prefixes = systemId === null ? LIMITED_QUIRKS_PUBLIC_ID_PREFIXES : LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES; if (hasPrefix(publicId, prefixes)) return DOCUMENT_MODE.LIMITED_QUIRKS; } return DOCUMENT_MODE.NO_QUIRKS; }; exports.serializeContent = function (name, publicId, systemId) { var str = '!DOCTYPE '; if (name) str += name; if (publicId !== null) str += ' PUBLIC ' + enquoteDoctypeId(publicId); else if (systemId !== null) str += ' SYSTEM'; if (systemId !== null) str += ' ' + enquoteDoctypeId(systemId); return str; }; /***/ }), /* 354 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Tokenizer = __webpack_require__(339), HTML = __webpack_require__(344); //Aliases var $ = HTML.TAG_NAMES, NS = HTML.NAMESPACES, ATTRS = HTML.ATTRS; //MIME types var MIME_TYPES = { TEXT_HTML: 'text/html', APPLICATION_XML: 'application/xhtml+xml' }; //Attributes var DEFINITION_URL_ATTR = 'definitionurl', ADJUSTED_DEFINITION_URL_ATTR = 'definitionURL', SVG_ATTRS_ADJUSTMENT_MAP = { 'attributename': 'attributeName', 'attributetype': 'attributeType', 'basefrequency': 'baseFrequency', 'baseprofile': 'baseProfile', 'calcmode': 'calcMode', 'clippathunits': 'clipPathUnits', 'diffuseconstant': 'diffuseConstant', 'edgemode': 'edgeMode', 'filterunits': 'filterUnits', 'glyphref': 'glyphRef', 'gradienttransform': 'gradientTransform', 'gradientunits': 'gradientUnits', 'kernelmatrix': 'kernelMatrix', 'kernelunitlength': 'kernelUnitLength', 'keypoints': 'keyPoints', 'keysplines': 'keySplines', 'keytimes': 'keyTimes', 'lengthadjust': 'lengthAdjust', 'limitingconeangle': 'limitingConeAngle', 'markerheight': 'markerHeight', 'markerunits': 'markerUnits', 'markerwidth': 'markerWidth', 'maskcontentunits': 'maskContentUnits', 'maskunits': 'maskUnits', 'numoctaves': 'numOctaves', 'pathlength': 'pathLength', 'patterncontentunits': 'patternContentUnits', 'patterntransform': 'patternTransform', 'patternunits': 'patternUnits', 'pointsatx': 'pointsAtX', 'pointsaty': 'pointsAtY', 'pointsatz': 'pointsAtZ', 'preservealpha': 'preserveAlpha', 'preserveaspectratio': 'preserveAspectRatio', 'primitiveunits': 'primitiveUnits', 'refx': 'refX', 'refy': 'refY', 'repeatcount': 'repeatCount', 'repeatdur': 'repeatDur', 'requiredextensions': 'requiredExtensions', 'requiredfeatures': 'requiredFeatures', 'specularconstant': 'specularConstant', 'specularexponent': 'specularExponent', 'spreadmethod': 'spreadMethod', 'startoffset': 'startOffset', 'stddeviation': 'stdDeviation', 'stitchtiles': 'stitchTiles', 'surfacescale': 'surfaceScale', 'systemlanguage': 'systemLanguage', 'tablevalues': 'tableValues', 'targetx': 'targetX', 'targety': 'targetY', 'textlength': 'textLength', 'viewbox': 'viewBox', 'viewtarget': 'viewTarget', 'xchannelselector': 'xChannelSelector', 'ychannelselector': 'yChannelSelector', 'zoomandpan': 'zoomAndPan' }, XML_ATTRS_ADJUSTMENT_MAP = { 'xlink:actuate': {prefix: 'xlink', name: 'actuate', namespace: NS.XLINK}, 'xlink:arcrole': {prefix: 'xlink', name: 'arcrole', namespace: NS.XLINK}, 'xlink:href': {prefix: 'xlink', name: 'href', namespace: NS.XLINK}, 'xlink:role': {prefix: 'xlink', name: 'role', namespace: NS.XLINK}, 'xlink:show': {prefix: 'xlink', name: 'show', namespace: NS.XLINK}, 'xlink:title': {prefix: 'xlink', name: 'title', namespace: NS.XLINK}, 'xlink:type': {prefix: 'xlink', name: 'type', namespace: NS.XLINK}, 'xml:base': {prefix: 'xml', name: 'base', namespace: NS.XML}, 'xml:lang': {prefix: 'xml', name: 'lang', namespace: NS.XML}, 'xml:space': {prefix: 'xml', name: 'space', namespace: NS.XML}, 'xmlns': {prefix: '', name: 'xmlns', namespace: NS.XMLNS}, 'xmlns:xlink': {prefix: 'xmlns', name: 'xlink', namespace: NS.XMLNS} }; //SVG tag names adjustment map var SVG_TAG_NAMES_ADJUSTMENT_MAP = exports.SVG_TAG_NAMES_ADJUSTMENT_MAP = { 'altglyph': 'altGlyph', 'altglyphdef': 'altGlyphDef', 'altglyphitem': 'altGlyphItem', 'animatecolor': 'animateColor', 'animatemotion': 'animateMotion', 'animatetransform': 'animateTransform', 'clippath': 'clipPath', 'feblend': 'feBlend', 'fecolormatrix': 'feColorMatrix', 'fecomponenttransfer': 'feComponentTransfer', 'fecomposite': 'feComposite', 'feconvolvematrix': 'feConvolveMatrix', 'fediffuselighting': 'feDiffuseLighting', 'fedisplacementmap': 'feDisplacementMap', 'fedistantlight': 'feDistantLight', 'feflood': 'feFlood', 'fefunca': 'feFuncA', 'fefuncb': 'feFuncB', 'fefuncg': 'feFuncG', 'fefuncr': 'feFuncR', 'fegaussianblur': 'feGaussianBlur', 'feimage': 'feImage', 'femerge': 'feMerge', 'femergenode': 'feMergeNode', 'femorphology': 'feMorphology', 'feoffset': 'feOffset', 'fepointlight': 'fePointLight', 'fespecularlighting': 'feSpecularLighting', 'fespotlight': 'feSpotLight', 'fetile': 'feTile', 'feturbulence': 'feTurbulence', 'foreignobject': 'foreignObject', 'glyphref': 'glyphRef', 'lineargradient': 'linearGradient', 'radialgradient': 'radialGradient', 'textpath': 'textPath' }; //Tags that causes exit from foreign content var EXITS_FOREIGN_CONTENT = Object.create(null); EXITS_FOREIGN_CONTENT[$.B] = true; EXITS_FOREIGN_CONTENT[$.BIG] = true; EXITS_FOREIGN_CONTENT[$.BLOCKQUOTE] = true; EXITS_FOREIGN_CONTENT[$.BODY] = true; EXITS_FOREIGN_CONTENT[$.BR] = true; EXITS_FOREIGN_CONTENT[$.CENTER] = true; EXITS_FOREIGN_CONTENT[$.CODE] = true; EXITS_FOREIGN_CONTENT[$.DD] = true; EXITS_FOREIGN_CONTENT[$.DIV] = true; EXITS_FOREIGN_CONTENT[$.DL] = true; EXITS_FOREIGN_CONTENT[$.DT] = true; EXITS_FOREIGN_CONTENT[$.EM] = true; EXITS_FOREIGN_CONTENT[$.EMBED] = true; EXITS_FOREIGN_CONTENT[$.H1] = true; EXITS_FOREIGN_CONTENT[$.H2] = true; EXITS_FOREIGN_CONTENT[$.H3] = true; EXITS_FOREIGN_CONTENT[$.H4] = true; EXITS_FOREIGN_CONTENT[$.H5] = true; EXITS_FOREIGN_CONTENT[$.H6] = true; EXITS_FOREIGN_CONTENT[$.HEAD] = true; EXITS_FOREIGN_CONTENT[$.HR] = true; EXITS_FOREIGN_CONTENT[$.I] = true; EXITS_FOREIGN_CONTENT[$.IMG] = true; EXITS_FOREIGN_CONTENT[$.LI] = true; EXITS_FOREIGN_CONTENT[$.LISTING] = true; EXITS_FOREIGN_CONTENT[$.MENU] = true; EXITS_FOREIGN_CONTENT[$.META] = true; EXITS_FOREIGN_CONTENT[$.NOBR] = true; EXITS_FOREIGN_CONTENT[$.OL] = true; EXITS_FOREIGN_CONTENT[$.P] = true; EXITS_FOREIGN_CONTENT[$.PRE] = true; EXITS_FOREIGN_CONTENT[$.RUBY] = true; EXITS_FOREIGN_CONTENT[$.S] = true; EXITS_FOREIGN_CONTENT[$.SMALL] = true; EXITS_FOREIGN_CONTENT[$.SPAN] = true; EXITS_FOREIGN_CONTENT[$.STRONG] = true; EXITS_FOREIGN_CONTENT[$.STRIKE] = true; EXITS_FOREIGN_CONTENT[$.SUB] = true; EXITS_FOREIGN_CONTENT[$.SUP] = true; EXITS_FOREIGN_CONTENT[$.TABLE] = true; EXITS_FOREIGN_CONTENT[$.TT] = true; EXITS_FOREIGN_CONTENT[$.U] = true; EXITS_FOREIGN_CONTENT[$.UL] = true; EXITS_FOREIGN_CONTENT[$.VAR] = true; //Check exit from foreign content exports.causesExit = function (startTagToken) { var tn = startTagToken.tagName; var isFontWithAttrs = tn === $.FONT && (Tokenizer.getTokenAttr(startTagToken, ATTRS.COLOR) !== null || Tokenizer.getTokenAttr(startTagToken, ATTRS.SIZE) !== null || Tokenizer.getTokenAttr(startTagToken, ATTRS.FACE) !== null); return isFontWithAttrs ? true : EXITS_FOREIGN_CONTENT[tn]; }; //Token adjustments exports.adjustTokenMathMLAttrs = function (token) { for (var i = 0; i < token.attrs.length; i++) { if (token.attrs[i].name === DEFINITION_URL_ATTR) { token.attrs[i].name = ADJUSTED_DEFINITION_URL_ATTR; break; } } }; exports.adjustTokenSVGAttrs = function (token) { for (var i = 0; i < token.attrs.length; i++) { var adjustedAttrName = SVG_ATTRS_ADJUSTMENT_MAP[token.attrs[i].name]; if (adjustedAttrName) token.attrs[i].name = adjustedAttrName; } }; exports.adjustTokenXMLAttrs = function (token) { for (var i = 0; i < token.attrs.length; i++) { var adjustedAttrEntry = XML_ATTRS_ADJUSTMENT_MAP[token.attrs[i].name]; if (adjustedAttrEntry) { token.attrs[i].prefix = adjustedAttrEntry.prefix; token.attrs[i].name = adjustedAttrEntry.name; token.attrs[i].namespace = adjustedAttrEntry.namespace; } } }; exports.adjustTokenSVGTagName = function (token) { var adjustedTagName = SVG_TAG_NAMES_ADJUSTMENT_MAP[token.tagName]; if (adjustedTagName) token.tagName = adjustedTagName; }; //Integration points function isMathMLTextIntegrationPoint(tn, ns) { return ns === NS.MATHML && (tn === $.MI || tn === $.MO || tn === $.MN || tn === $.MS || tn === $.MTEXT); } function isHtmlIntegrationPoint(tn, ns, attrs) { if (ns === NS.MATHML && tn === $.ANNOTATION_XML) { for (var i = 0; i < attrs.length; i++) { if (attrs[i].name === ATTRS.ENCODING) { var value = attrs[i].value.toLowerCase(); return value === MIME_TYPES.TEXT_HTML || value === MIME_TYPES.APPLICATION_XML; } } } return ns === NS.SVG && (tn === $.FOREIGN_OBJECT || tn === $.DESC || tn === $.TITLE); } exports.isIntegrationPoint = function (tn, ns, attrs, foreignNS) { if ((!foreignNS || foreignNS === NS.HTML) && isHtmlIntegrationPoint(tn, ns, attrs)) return true; if ((!foreignNS || foreignNS === NS.MATHML) && isMathMLTextIntegrationPoint(tn, ns)) return true; return false; }; /***/ }), /* 355 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var defaultTreeAdapter = __webpack_require__(351), mergeOptions = __webpack_require__(352), doctype = __webpack_require__(353), HTML = __webpack_require__(344); //Aliases var $ = HTML.TAG_NAMES, NS = HTML.NAMESPACES; //Default serializer options var DEFAULT_OPTIONS = { treeAdapter: defaultTreeAdapter }; //Escaping regexes var AMP_REGEX = /&/g, NBSP_REGEX = /\u00a0/g, DOUBLE_QUOTE_REGEX = /"/g, LT_REGEX = /</g, GT_REGEX = />/g; //Serializer var Serializer = module.exports = function (node, options) { this.options = mergeOptions(DEFAULT_OPTIONS, options); this.treeAdapter = this.options.treeAdapter; this.html = ''; this.startNode = node; }; // NOTE: exported as static method for the testing purposes Serializer.escapeString = function (str, attrMode) { str = str .replace(AMP_REGEX, '&') .replace(NBSP_REGEX, ' '); if (attrMode) str = str.replace(DOUBLE_QUOTE_REGEX, '"'); else { str = str .replace(LT_REGEX, '<') .replace(GT_REGEX, '>'); } return str; }; //API Serializer.prototype.serialize = function () { this._serializeChildNodes(this.startNode); return this.html; }; //Internals Serializer.prototype._serializeChildNodes = function (parentNode) { var childNodes = this.treeAdapter.getChildNodes(parentNode); if (childNodes) { for (var i = 0, cnLength = childNodes.length; i < cnLength; i++) { var currentNode = childNodes[i]; if (this.treeAdapter.isElementNode(currentNode)) this._serializeElement(currentNode); else if (this.treeAdapter.isTextNode(currentNode)) this._serializeTextNode(currentNode); else if (this.treeAdapter.isCommentNode(currentNode)) this._serializeCommentNode(currentNode); else if (this.treeAdapter.isDocumentTypeNode(currentNode)) this._serializeDocumentTypeNode(currentNode); } } }; Serializer.prototype._serializeElement = function (node) { var tn = this.treeAdapter.getTagName(node), ns = this.treeAdapter.getNamespaceURI(node); this.html += '<' + tn; this._serializeAttributes(node); this.html += '>'; if (tn !== $.AREA && tn !== $.BASE && tn !== $.BASEFONT && tn !== $.BGSOUND && tn !== $.BR && tn !== $.BR && tn !== $.COL && tn !== $.EMBED && tn !== $.FRAME && tn !== $.HR && tn !== $.IMG && tn !== $.INPUT && tn !== $.KEYGEN && tn !== $.LINK && tn !== $.MENUITEM && tn !== $.META && tn !== $.PARAM && tn !== $.SOURCE && tn !== $.TRACK && tn !== $.WBR) { var childNodesHolder = tn === $.TEMPLATE && ns === NS.HTML ? this.treeAdapter.getTemplateContent(node) : node; this._serializeChildNodes(childNodesHolder); this.html += '</' + tn + '>'; } }; Serializer.prototype._serializeAttributes = function (node) { var attrs = this.treeAdapter.getAttrList(node); for (var i = 0, attrsLength = attrs.length; i < attrsLength; i++) { var attr = attrs[i], value = Serializer.escapeString(attr.value, true); this.html += ' '; if (!attr.namespace) this.html += attr.name; else if (attr.namespace === NS.XML) this.html += 'xml:' + attr.name; else if (attr.namespace === NS.XMLNS) { if (attr.name !== 'xmlns') this.html += 'xmlns:'; this.html += attr.name; } else if (attr.namespace === NS.XLINK) this.html += 'xlink:' + attr.name; else this.html += attr.namespace + ':' + attr.name; this.html += '="' + value + '"'; } }; Serializer.prototype._serializeTextNode = function (node) { var content = this.treeAdapter.getTextNodeContent(node), parent = this.treeAdapter.getParentNode(node), parentTn = void 0; if (parent && this.treeAdapter.isElementNode(parent)) parentTn = this.treeAdapter.getTagName(parent); if (parentTn === $.STYLE || parentTn === $.SCRIPT || parentTn === $.XMP || parentTn === $.IFRAME || parentTn === $.NOEMBED || parentTn === $.NOFRAMES || parentTn === $.PLAINTEXT || parentTn === $.NOSCRIPT) this.html += content; else this.html += Serializer.escapeString(content, false); }; Serializer.prototype._serializeCommentNode = function (node) { this.html += '<!--' + this.treeAdapter.getCommentNodeContent(node) + '-->'; }; Serializer.prototype._serializeDocumentTypeNode = function (node) { var name = this.treeAdapter.getDocumentTypeNodeName(node); this.html += '<' + doctype.serializeContent(name, null, null) + '>'; }; /***/ }), /* 356 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var doctype = __webpack_require__(353), DOCUMENT_MODE = __webpack_require__(344).DOCUMENT_MODE; //Conversion tables for DOM Level1 structure emulation var nodeTypes = { element: 1, text: 3, cdata: 4, comment: 8 }; var nodePropertyShorthands = { tagName: 'name', childNodes: 'children', parentNode: 'parent', previousSibling: 'prev', nextSibling: 'next', nodeValue: 'data' }; //Node var Node = function (props) { for (var key in props) { if (props.hasOwnProperty(key)) this[key] = props[key]; } }; Node.prototype = { get firstChild() { var children = this.children; return children && children[0] || null; }, get lastChild() { var children = this.children; return children && children[children.length - 1] || null; }, get nodeType() { return nodeTypes[this.type] || nodeTypes.element; } }; Object.keys(nodePropertyShorthands).forEach(function (key) { var shorthand = nodePropertyShorthands[key]; Object.defineProperty(Node.prototype, key, { get: function () { return this[shorthand] || null; }, set: function (val) { this[shorthand] = val; return val; } }); }); //Node construction exports.createDocument = function () { return new Node({ type: 'root', name: 'root', parent: null, prev: null, next: null, children: [], 'x-mode': DOCUMENT_MODE.NO_QUIRKS }); }; exports.createDocumentFragment = function () { return new Node({ type: 'root', name: 'root', parent: null, prev: null, next: null, children: [] }); }; exports.createElement = function (tagName, namespaceURI, attrs) { var attribs = Object.create(null), attribsNamespace = Object.create(null), attribsPrefix = Object.create(null); for (var i = 0; i < attrs.length; i++) { var attrName = attrs[i].name; attribs[attrName] = attrs[i].value; attribsNamespace[attrName] = attrs[i].namespace; attribsPrefix[attrName] = attrs[i].prefix; } return new Node({ type: tagName === 'script' || tagName === 'style' ? tagName : 'tag', name: tagName, namespace: namespaceURI, attribs: attribs, 'x-attribsNamespace': attribsNamespace, 'x-attribsPrefix': attribsPrefix, children: [], parent: null, prev: null, next: null }); }; exports.createCommentNode = function (data) { return new Node({ type: 'comment', data: data, parent: null, prev: null, next: null }); }; var createTextNode = function (value) { return new Node({ type: 'text', data: value, parent: null, prev: null, next: null }); }; //Tree mutation var appendChild = exports.appendChild = function (parentNode, newNode) { var prev = parentNode.children[parentNode.children.length - 1]; if (prev) { prev.next = newNode; newNode.prev = prev; } parentNode.children.push(newNode); newNode.parent = parentNode; }; var insertBefore = exports.insertBefore = function (parentNode, newNode, referenceNode) { var insertionIdx = parentNode.children.indexOf(referenceNode), prev = referenceNode.prev; if (prev) { prev.next = newNode; newNode.prev = prev; } referenceNode.prev = newNode; newNode.next = referenceNode; parentNode.children.splice(insertionIdx, 0, newNode); newNode.parent = parentNode; }; exports.setTemplateContent = function (templateElement, contentElement) { appendChild(templateElement, contentElement); }; exports.getTemplateContent = function (templateElement) { return templateElement.children[0]; }; exports.setDocumentType = function (document, name, publicId, systemId) { var data = doctype.serializeContent(name, publicId, systemId), doctypeNode = null; for (var i = 0; i < document.children.length; i++) { if (document.children[i].type === 'directive' && document.children[i].name === '!doctype') { doctypeNode = document.children[i]; break; } } if (doctypeNode) { doctypeNode.data = data; doctypeNode['x-name'] = name; doctypeNode['x-publicId'] = publicId; doctypeNode['x-systemId'] = systemId; } else { appendChild(document, new Node({ type: 'directive', name: '!doctype', data: data, 'x-name': name, 'x-publicId': publicId, 'x-systemId': systemId })); } }; exports.setDocumentMode = function (document, mode) { document['x-mode'] = mode; }; exports.getDocumentMode = function (document) { return document['x-mode']; }; exports.detachNode = function (node) { if (node.parent) { var idx = node.parent.children.indexOf(node), prev = node.prev, next = node.next; node.prev = null; node.next = null; if (prev) prev.next = next; if (next) next.prev = prev; node.parent.children.splice(idx, 1); node.parent = null; } }; exports.insertText = function (parentNode, text) { var lastChild = parentNode.children[parentNode.children.length - 1]; if (lastChild && lastChild.type === 'text') lastChild.data += text; else appendChild(parentNode, createTextNode(text)); }; exports.insertTextBefore = function (parentNode, text, referenceNode) { var prevNode = parentNode.children[parentNode.children.indexOf(referenceNode) - 1]; if (prevNode && prevNode.type === 'text') prevNode.data += text; else insertBefore(parentNode, createTextNode(text), referenceNode); }; exports.adoptAttributes = function (recipient, attrs) { for (var i = 0; i < attrs.length; i++) { var attrName = attrs[i].name; if (typeof recipient.attribs[attrName] === 'undefined') { recipient.attribs[attrName] = attrs[i].value; recipient['x-attribsNamespace'][attrName] = attrs[i].namespace; recipient['x-attribsPrefix'][attrName] = attrs[i].prefix; } } }; //Tree traversing exports.getFirstChild = function (node) { return node.children[0]; }; exports.getChildNodes = function (node) { return node.children; }; exports.getParentNode = function (node) { return node.parent; }; exports.getAttrList = function (element) { var attrList = []; for (var name in element.attribs) { attrList.push({ name: name, value: element.attribs[name], namespace: element['x-attribsNamespace'][name], prefix: element['x-attribsPrefix'][name] }); } return attrList; }; //Node data exports.getTagName = function (element) { return element.name; }; exports.getNamespaceURI = function (element) { return element.namespace; }; exports.getTextNodeContent = function (textNode) { return textNode.data; }; exports.getCommentNodeContent = function (commentNode) { return commentNode.data; }; exports.getDocumentTypeNodeName = function (doctypeNode) { return doctypeNode['x-name']; }; exports.getDocumentTypeNodePublicId = function (doctypeNode) { return doctypeNode['x-publicId']; }; exports.getDocumentTypeNodeSystemId = function (doctypeNode) { return doctypeNode['x-systemId']; }; //Node types exports.isTextNode = function (node) { return node.type === 'text'; }; exports.isCommentNode = function (node) { return node.type === 'comment'; }; exports.isDocumentTypeNode = function (node) { return node.type === 'directive' && node.name === '!doctype'; }; exports.isElementNode = function (node) { return !!node.attribs; }; /***/ }), /* 357 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var WritableStream = __webpack_require__(100).Writable, inherits = __webpack_require__(9).inherits, Parser = __webpack_require__(338); var ParserStream = module.exports = function (options) { WritableStream.call(this); this.parser = new Parser(options); this.lastChunkWritten = false; this.writeCallback = null; this.pausedByScript = false; this.document = this.parser.treeAdapter.createDocument(); this.pendingHtmlInsertions = []; this._resume = this._resume.bind(this); this._documentWrite = this._documentWrite.bind(this); this._scriptHandler = this._scriptHandler.bind(this); this.parser._bootstrap(this.document, null); }; inherits(ParserStream, WritableStream); //WritableStream implementation ParserStream.prototype._write = function (chunk, encoding, callback) { this.writeCallback = callback; this.parser.tokenizer.write(chunk.toString('utf8'), this.lastChunkWritten); this._runParsingLoop(); }; ParserStream.prototype.end = function (chunk, encoding, callback) { this.lastChunkWritten = true; WritableStream.prototype.end.call(this, chunk || '', encoding, callback); }; //Scriptable parser implementation ParserStream.prototype._runParsingLoop = function () { this.parser.runParsingLoopForCurrentChunk(this.writeCallback, this._scriptHandler); }; ParserStream.prototype._resume = function () { if (!this.pausedByScript) throw new Error('Parser was already resumed'); while (this.pendingHtmlInsertions.length) { var html = this.pendingHtmlInsertions.pop(); this.parser.tokenizer.insertHtmlAtCurrentPos(html); } this.pausedByScript = false; //NOTE: keep parsing if we don't wait for the next input chunk if (this.parser.tokenizer.active) this._runParsingLoop(); }; ParserStream.prototype._documentWrite = function (html) { if (!this.parser.stopped) this.pendingHtmlInsertions.push(html); }; ParserStream.prototype._scriptHandler = function (scriptElement) { if (this.listeners('script').length) { this.pausedByScript = true; this.emit('script', scriptElement, this._documentWrite, this._resume); } else this._runParsingLoop(); }; /***/ }), /* 358 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var ParserStream = __webpack_require__(357), inherits = __webpack_require__(9).inherits, $ = __webpack_require__(344).TAG_NAMES; var PlainTextConversionStream = module.exports = function (options) { ParserStream.call(this, options); // NOTE: see https://html.spec.whatwg.org/#read-text this.parser._insertFakeElement($.HTML); this.parser._insertFakeElement($.HEAD); this.parser.openElements.pop(); this.parser._insertFakeElement($.BODY); this.parser._insertFakeElement($.PRE); this.parser.treeAdapter.insertText(this.parser.openElements.current, '\n'); this.parser.switchToPlaintextParsing(); }; inherits(PlainTextConversionStream, ParserStream); /***/ }), /* 359 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var ReadableStream = __webpack_require__(100).Readable, inherits = __webpack_require__(9).inherits, Serializer = __webpack_require__(355); var SerializerStream = module.exports = function (node, options) { ReadableStream.call(this); this.serializer = new Serializer(node, options); Object.defineProperty(this.serializer, 'html', { //NOTE: To make `+=` concat operator work properly we define //getter which always returns empty string get: function () { return ''; }, set: this.push.bind(this) }); }; inherits(SerializerStream, ReadableStream); //Readable stream implementation SerializerStream.prototype._read = function () { this.serializer.serialize(); this.push(null); }; /***/ }), /* 360 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var TransformStream = __webpack_require__(100).Transform, DevNullStream = __webpack_require__(361), inherits = __webpack_require__(9).inherits, Tokenizer = __webpack_require__(339), LocationInfoTokenizerMixin = __webpack_require__(348), ParserFeedbackSimulator = __webpack_require__(362), mergeOptions = __webpack_require__(352); var DEFAULT_OPTIONS = { locationInfo: false }; var SAXParser = module.exports = function (options) { TransformStream.call(this); this.options = mergeOptions(DEFAULT_OPTIONS, options); this.tokenizer = new Tokenizer(options); if (this.options.locationInfo) new LocationInfoTokenizerMixin(this.tokenizer); this.parserFeedbackSimulator = new ParserFeedbackSimulator(this.tokenizer); this.pendingText = null; this.currentTokenLocation = void 0; this.lastChunkWritten = false; this.stopped = false; // NOTE: always pipe stream to the /dev/null stream to avoid // `highWaterMark` hit even if we don't have consumers. // (see: https://github.com/inikulin/parse5/issues/97#issuecomment-171940774) this.pipe(new DevNullStream()); }; inherits(SAXParser, TransformStream); //TransformStream implementation SAXParser.prototype._transform = function (chunk, encoding, callback) { if (!this.stopped) { this.tokenizer.write(chunk.toString('utf8'), this.lastChunkWritten); this._runParsingLoop(); } this.push(chunk); callback(); }; SAXParser.prototype._flush = function (callback) { callback(); }; SAXParser.prototype.end = function (chunk, encoding, callback) { this.lastChunkWritten = true; TransformStream.prototype.end.call(this, chunk, encoding, callback); }; SAXParser.prototype.stop = function () { this.stopped = true; }; //Internals SAXParser.prototype._runParsingLoop = function () { do { var token = this.parserFeedbackSimulator.getNextToken(); if (token.type === Tokenizer.HIBERNATION_TOKEN) break; if (token.type === Tokenizer.CHARACTER_TOKEN || token.type === Tokenizer.WHITESPACE_CHARACTER_TOKEN || token.type === Tokenizer.NULL_CHARACTER_TOKEN) { if (this.options.locationInfo) { if (this.pendingText === null) this.currentTokenLocation = token.location; else this.currentTokenLocation.endOffset = token.location.endOffset; } this.pendingText = (this.pendingText || '') + token.chars; } else { this._emitPendingText(); this._handleToken(token); } } while (!this.stopped && token.type !== Tokenizer.EOF_TOKEN); }; SAXParser.prototype._handleToken = function (token) { if (this.options.locationInfo) this.currentTokenLocation = token.location; if (token.type === Tokenizer.START_TAG_TOKEN) this.emit('startTag', token.tagName, token.attrs, token.selfClosing, this.currentTokenLocation); else if (token.type === Tokenizer.END_TAG_TOKEN) this.emit('endTag', token.tagName, this.currentTokenLocation); else if (token.type === Tokenizer.COMMENT_TOKEN) this.emit('comment', token.data, this.currentTokenLocation); else if (token.type === Tokenizer.DOCTYPE_TOKEN) this.emit('doctype', token.name, token.publicId, token.systemId, this.currentTokenLocation); }; SAXParser.prototype._emitPendingText = function () { if (this.pendingText !== null) { this.emit('text', this.pendingText, this.currentTokenLocation); this.pendingText = null; } }; /***/ }), /* 361 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var WritableStream = __webpack_require__(100).Writable, util = __webpack_require__(9); var DevNullStream = module.exports = function () { WritableStream.call(this); }; util.inherits(DevNullStream, WritableStream); DevNullStream.prototype._write = function (chunk, encoding, cb) { cb(); }; /***/ }), /* 362 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Tokenizer = __webpack_require__(339), foreignContent = __webpack_require__(354), UNICODE = __webpack_require__(341), HTML = __webpack_require__(344); //Aliases var $ = HTML.TAG_NAMES, NS = HTML.NAMESPACES; //ParserFeedbackSimulator //Simulates adjustment of the Tokenizer which performed by standard parser during tree construction. var ParserFeedbackSimulator = module.exports = function (tokenizer) { this.tokenizer = tokenizer; this.namespaceStack = []; this.namespaceStackTop = -1; this._enterNamespace(NS.HTML); }; ParserFeedbackSimulator.prototype.getNextToken = function () { var token = this.tokenizer.getNextToken(); if (token.type === Tokenizer.START_TAG_TOKEN) this._handleStartTagToken(token); else if (token.type === Tokenizer.END_TAG_TOKEN) this._handleEndTagToken(token); else if (token.type === Tokenizer.NULL_CHARACTER_TOKEN && this.inForeignContent) { token.type = Tokenizer.CHARACTER_TOKEN; token.chars = UNICODE.REPLACEMENT_CHARACTER; } else if (this.skipNextNewLine) { if (token.type !== Tokenizer.HIBERNATION_TOKEN) this.skipNextNewLine = false; if (token.type === Tokenizer.WHITESPACE_CHARACTER_TOKEN && token.chars[0] === '\n') { if (token.chars.length === 1) return this.getNextToken(); token.chars = token.chars.substr(1); } } return token; }; //Namespace stack mutations ParserFeedbackSimulator.prototype._enterNamespace = function (namespace) { this.namespaceStackTop++; this.namespaceStack.push(namespace); this.inForeignContent = namespace !== NS.HTML; this.currentNamespace = namespace; this.tokenizer.allowCDATA = this.inForeignContent; }; ParserFeedbackSimulator.prototype._leaveCurrentNamespace = function () { this.namespaceStackTop--; this.namespaceStack.pop(); this.currentNamespace = this.namespaceStack[this.namespaceStackTop]; this.inForeignContent = this.currentNamespace !== NS.HTML; this.tokenizer.allowCDATA = this.inForeignContent; }; //Token handlers ParserFeedbackSimulator.prototype._ensureTokenizerMode = function (tn) { if (tn === $.TEXTAREA || tn === $.TITLE) this.tokenizer.state = Tokenizer.MODE.RCDATA; else if (tn === $.PLAINTEXT) this.tokenizer.state = Tokenizer.MODE.PLAINTEXT; else if (tn === $.SCRIPT) this.tokenizer.state = Tokenizer.MODE.SCRIPT_DATA; else if (tn === $.STYLE || tn === $.IFRAME || tn === $.XMP || tn === $.NOEMBED || tn === $.NOFRAMES || tn === $.NOSCRIPT) this.tokenizer.state = Tokenizer.MODE.RAWTEXT; }; ParserFeedbackSimulator.prototype._handleStartTagToken = function (token) { var tn = token.tagName; if (tn === $.SVG) this._enterNamespace(NS.SVG); else if (tn === $.MATH) this._enterNamespace(NS.MATHML); if (this.inForeignContent) { if (foreignContent.causesExit(token)) { this._leaveCurrentNamespace(); return; } var currentNs = this.currentNamespace; if (currentNs === NS.MATHML) foreignContent.adjustTokenMathMLAttrs(token); else if (currentNs === NS.SVG) { foreignContent.adjustTokenSVGTagName(token); foreignContent.adjustTokenSVGAttrs(token); } foreignContent.adjustTokenXMLAttrs(token); tn = token.tagName; if (!token.selfClosing && foreignContent.isIntegrationPoint(tn, currentNs, token.attrs)) this._enterNamespace(NS.HTML); } else { if (tn === $.PRE || tn === $.TEXTAREA || tn === $.LISTING) this.skipNextNewLine = true; else if (tn === $.IMAGE) token.tagName = $.IMG; this._ensureTokenizerMode(tn); } }; ParserFeedbackSimulator.prototype._handleEndTagToken = function (token) { var tn = token.tagName; if (!this.inForeignContent) { var previousNs = this.namespaceStack[this.namespaceStackTop - 1]; if (previousNs === NS.SVG && foreignContent.SVG_TAG_NAMES_ADJUSTMENT_MAP[tn]) tn = foreignContent.SVG_TAG_NAMES_ADJUSTMENT_MAP[tn]; //NOTE: check for exit from integration point if (foreignContent.isIntegrationPoint(tn, previousNs, token.attrs)) this._leaveCurrentNamespace(); } else if (tn === $.SVG && this.currentNamespace === NS.SVG || tn === $.MATH && this.currentNamespace === NS.MATHML) this._leaveCurrentNamespace(); // NOTE: adjust end tag name as well for consistency if (this.currentNamespace === NS.SVG) foreignContent.adjustTokenSVGTagName(token); }; /***/ }), /* 363 */ /***/ (function(module, exports, __webpack_require__) { var assign = __webpack_require__(364); /* * Cheerio default options */ exports.default = { withDomLvl1: true, normalizeWhitespace: false, xml: false, decodeEntities: true }; exports.flatten = function(options) { return options && options.xml ? assign({xmlMode: true}, options.xml) : options; }; /***/ }), /* 364 */ /***/ (function(module, exports, __webpack_require__) { var assignValue = __webpack_require__(365), copyObject = __webpack_require__(375), createAssigner = __webpack_require__(376), isArrayLike = __webpack_require__(386), isPrototype = __webpack_require__(389), keys = __webpack_require__(390); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Assigns own enumerable string keyed properties of source objects to the * destination object. Source objects are applied from left to right. * Subsequent sources overwrite property assignments of previous sources. * * **Note:** This method mutates `object` and is loosely based on * [`Object.assign`](https://mdn.io/Object/assign). * * @static * @memberOf _ * @since 0.10.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.assignIn * @example * * function Foo() { * this.a = 1; * } * * function Bar() { * this.c = 3; * } * * Foo.prototype.b = 2; * Bar.prototype.d = 4; * * _.assign({ 'a': 0 }, new Foo, new Bar); * // => { 'a': 1, 'c': 3 } */ var assign = createAssigner(function(object, source) { if (isPrototype(source) || isArrayLike(source)) { copyObject(source, keys(source), object); return; } for (var key in source) { if (hasOwnProperty.call(source, key)) { assignValue(object, key, source[key]); } } }); module.exports = assign; /***/ }), /* 365 */ /***/ (function(module, exports, __webpack_require__) { var baseAssignValue = __webpack_require__(366), eq = __webpack_require__(374); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Assigns `value` to `key` of `object` if the existing value is not equivalent * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignValue(object, key, value) { var objValue = object[key]; if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || (value === undefined && !(key in object))) { baseAssignValue(object, key, value); } } module.exports = assignValue; /***/ }), /* 366 */ /***/ (function(module, exports, __webpack_require__) { var defineProperty = __webpack_require__(367); /** * The base implementation of `assignValue` and `assignMergeValue` without * value checks. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function baseAssignValue(object, key, value) { if (key == '__proto__' && defineProperty) { defineProperty(object, key, { 'configurable': true, 'enumerable': true, 'value': value, 'writable': true }); } else { object[key] = value; } } module.exports = baseAssignValue; /***/ }), /* 367 */ /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(368); var defineProperty = (function() { try { var func = getNative(Object, 'defineProperty'); func({}, '', {}); return func; } catch (e) {} }()); module.exports = defineProperty; /***/ }), /* 368 */ /***/ (function(module, exports, __webpack_require__) { var baseIsNative = __webpack_require__(369), getValue = __webpack_require__(373); /** * Gets the native function at `key` of `object`. * * @private * @param {Object} object The object to query. * @param {string} key The key of the method to get. * @returns {*} Returns the function if it's native, else `undefined`. */ function getNative(object, key) { var value = getValue(object, key); return baseIsNative(value) ? value : undefined; } module.exports = getNative; /***/ }), /* 369 */ /***/ (function(module, exports, __webpack_require__) { var isFunction = __webpack_require__(65), isMasked = __webpack_require__(370), isObject = __webpack_require__(72), toSource = __webpack_require__(372); /** * Used to match `RegExp` * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; /** Used to detect host constructors (Safari). */ var reIsHostCtor = /^\[object .+?Constructor\]$/; /** Used for built-in method references. */ var funcProto = Function.prototype, objectProto = Object.prototype; /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** Used to detect if a method is native. */ var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' ); /** * The base implementation of `_.isNative` without bad shim checks. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, * else `false`. */ function baseIsNative(value) { if (!isObject(value) || isMasked(value)) { return false; } var pattern = isFunction(value) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } module.exports = baseIsNative; /***/ }), /* 370 */ /***/ (function(module, exports, __webpack_require__) { var coreJsData = __webpack_require__(371); /** Used to detect methods masquerading as native. */ var maskSrcKey = (function() { var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); return uid ? ('Symbol(src)_1.' + uid) : ''; }()); /** * Checks if `func` has its source masked. * * @private * @param {Function} func The function to check. * @returns {boolean} Returns `true` if `func` is masked, else `false`. */ function isMasked(func) { return !!maskSrcKey && (maskSrcKey in func); } module.exports = isMasked; /***/ }), /* 371 */ /***/ (function(module, exports, __webpack_require__) { var root = __webpack_require__(68); /** Used to detect overreaching core-js shims. */ var coreJsData = root['__core-js_shared__']; module.exports = coreJsData; /***/ }), /* 372 */ /***/ (function(module, exports) { /** Used for built-in method references. */ var funcProto = Function.prototype; /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** * Converts `func` to its source code. * * @private * @param {Function} func The function to convert. * @returns {string} Returns the source code. */ function toSource(func) { if (func != null) { try { return funcToString.call(func); } catch (e) {} try { return (func + ''); } catch (e) {} } return ''; } module.exports = toSource; /***/ }), /* 373 */ /***/ (function(module, exports) { /** * Gets the value at `key` of `object`. * * @private * @param {Object} [object] The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function getValue(object, key) { return object == null ? undefined : object[key]; } module.exports = getValue; /***/ }), /* 374 */ /***/ (function(module, exports) { /** * Performs a * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.eq(object, object); * // => true * * _.eq(object, other); * // => false * * _.eq('a', 'a'); * // => true * * _.eq('a', Object('a')); * // => false * * _.eq(NaN, NaN); * // => true */ function eq(value, other) { return value === other || (value !== value && other !== other); } module.exports = eq; /***/ }), /* 375 */ /***/ (function(module, exports, __webpack_require__) { var assignValue = __webpack_require__(365), baseAssignValue = __webpack_require__(366); /** * Copies properties of `source` to `object`. * * @private * @param {Object} source The object to copy properties from. * @param {Array} props The property identifiers to copy. * @param {Object} [object={}] The object to copy properties to. * @param {Function} [customizer] The function to customize copied values. * @returns {Object} Returns `object`. */ function copyObject(source, props, object, customizer) { var isNew = !object; object || (object = {}); var index = -1, length = props.length; while (++index < length) { var key = props[index]; var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined; if (newValue === undefined) { newValue = source[key]; } if (isNew) { baseAssignValue(object, key, newValue); } else { assignValue(object, key, newValue); } } return object; } module.exports = copyObject; /***/ }), /* 376 */ /***/ (function(module, exports, __webpack_require__) { var baseRest = __webpack_require__(377), isIterateeCall = __webpack_require__(385); /** * Creates a function like `_.assign`. * * @private * @param {Function} assigner The function to assign values. * @returns {Function} Returns the new assigner function. */ function createAssigner(assigner) { return baseRest(function(object, sources) { var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined, guard = length > 2 ? sources[2] : undefined; customizer = (assigner.length > 3 && typeof customizer == 'function') ? (length--, customizer) : undefined; if (guard && isIterateeCall(sources[0], sources[1], guard)) { customizer = length < 3 ? undefined : customizer; length = 1; } object = Object(object); while (++index < length) { var source = sources[index]; if (source) { assigner(object, source, index, customizer); } } return object; }); } module.exports = createAssigner; /***/ }), /* 377 */ /***/ (function(module, exports, __webpack_require__) { var identity = __webpack_require__(378), overRest = __webpack_require__(379), setToString = __webpack_require__(381); /** * The base implementation of `_.rest` which doesn't validate or coerce arguments. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @returns {Function} Returns the new function. */ function baseRest(func, start) { return setToString(overRest(func, start, identity), func + ''); } module.exports = baseRest; /***/ }), /* 378 */ /***/ (function(module, exports) { /** * This method returns the first argument it receives. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {*} value Any value. * @returns {*} Returns `value`. * @example * * var object = { 'a': 1 }; * * console.log(_.identity(object) === object); * // => true */ function identity(value) { return value; } module.exports = identity; /***/ }), /* 379 */ /***/ (function(module, exports, __webpack_require__) { var apply = __webpack_require__(380); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max; /** * A specialized version of `baseRest` which transforms the rest array. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @param {Function} transform The rest array transform. * @returns {Function} Returns the new function. */ function overRest(func, start, transform) { start = nativeMax(start === undefined ? (func.length - 1) : start, 0); return function() { var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length); while (++index < length) { array[index] = args[start + index]; } index = -1; var otherArgs = Array(start + 1); while (++index < start) { otherArgs[index] = args[index]; } otherArgs[start] = transform(array); return apply(func, this, otherArgs); }; } module.exports = overRest; /***/ }), /* 380 */ /***/ (function(module, exports) { /** * A faster alternative to `Function#apply`, this function invokes `func` * with the `this` binding of `thisArg` and the arguments of `args`. * * @private * @param {Function} func The function to invoke. * @param {*} thisArg The `this` binding of `func`. * @param {Array} args The arguments to invoke `func` with. * @returns {*} Returns the result of `func`. */ function apply(func, thisArg, args) { switch (args.length) { case 0: return func.call(thisArg); case 1: return func.call(thisArg, args[0]); case 2: return func.call(thisArg, args[0], args[1]); case 3: return func.call(thisArg, args[0], args[1], args[2]); } return func.apply(thisArg, args); } module.exports = apply; /***/ }), /* 381 */ /***/ (function(module, exports, __webpack_require__) { var baseSetToString = __webpack_require__(382), shortOut = __webpack_require__(384); /** * Sets the `toString` method of `func` to return `string`. * * @private * @param {Function} func The function to modify. * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ var setToString = shortOut(baseSetToString); module.exports = setToString; /***/ }), /* 382 */ /***/ (function(module, exports, __webpack_require__) { var constant = __webpack_require__(383), defineProperty = __webpack_require__(367), identity = __webpack_require__(378); /** * The base implementation of `setToString` without support for hot loop shorting. * * @private * @param {Function} func The function to modify. * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ var baseSetToString = !defineProperty ? identity : function(func, string) { return defineProperty(func, 'toString', { 'configurable': true, 'enumerable': false, 'value': constant(string), 'writable': true }); }; module.exports = baseSetToString; /***/ }), /* 383 */ /***/ (function(module, exports) { /** * Creates a function that returns `value`. * * @static * @memberOf _ * @since 2.4.0 * @category Util * @param {*} value The value to return from the new function. * @returns {Function} Returns the new constant function. * @example * * var objects = _.times(2, _.constant({ 'a': 1 })); * * console.log(objects); * // => [{ 'a': 1 }, { 'a': 1 }] * * console.log(objects[0] === objects[1]); * // => true */ function constant(value) { return function() { return value; }; } module.exports = constant; /***/ }), /* 384 */ /***/ (function(module, exports) { /** Used to detect hot functions by number of calls within a span of milliseconds. */ var HOT_COUNT = 800, HOT_SPAN = 16; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeNow = Date.now; /** * Creates a function that'll short out and invoke `identity` instead * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` * milliseconds. * * @private * @param {Function} func The function to restrict. * @returns {Function} Returns the new shortable function. */ function shortOut(func) { var count = 0, lastCalled = 0; return function() { var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); lastCalled = stamp; if (remaining > 0) { if (++count >= HOT_COUNT) { return arguments[0]; } } else { count = 0; } return func.apply(undefined, arguments); }; } module.exports = shortOut; /***/ }), /* 385 */ /***/ (function(module, exports, __webpack_require__) { var eq = __webpack_require__(374), isArrayLike = __webpack_require__(386), isIndex = __webpack_require__(388), isObject = __webpack_require__(72); /** * Checks if the given arguments are from an iteratee call. * * @private * @param {*} value The potential iteratee value argument. * @param {*} index The potential iteratee index or key argument. * @param {*} object The potential iteratee object argument. * @returns {boolean} Returns `true` if the arguments are from an iteratee call, * else `false`. */ function isIterateeCall(value, index, object) { if (!isObject(object)) { return false; } var type = typeof index; if (type == 'number' ? (isArrayLike(object) && isIndex(index, object.length)) : (type == 'string' && index in object) ) { return eq(object[index], value); } return false; } module.exports = isIterateeCall; /***/ }), /* 386 */ /***/ (function(module, exports, __webpack_require__) { var isFunction = __webpack_require__(65), isLength = __webpack_require__(387); /** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @example * * _.isArrayLike([1, 2, 3]); * // => true * * _.isArrayLike(document.body.children); * // => true * * _.isArrayLike('abc'); * // => true * * _.isArrayLike(_.noop); * // => false */ function isArrayLike(value) { return value != null && isLength(value.length) && !isFunction(value); } module.exports = isArrayLike; /***/ }), /* 387 */ /***/ (function(module, exports) { /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; /** * Checks if `value` is a valid array-like length. * * **Note:** This method is loosely based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); * // => true * * _.isLength(Number.MIN_VALUE); * // => false * * _.isLength(Infinity); * // => false * * _.isLength('3'); * // => false */ function isLength(value) { return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } module.exports = isLength; /***/ }), /* 388 */ /***/ (function(module, exports) { /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; /** Used to detect unsigned integer values. */ var reIsUint = /^(?:0|[1-9]\d*)$/; /** * Checks if `value` is a valid array-like index. * * @private * @param {*} value The value to check. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ function isIndex(value, length) { var type = typeof value; length = length == null ? MAX_SAFE_INTEGER : length; return !!length && (type == 'number' || (type != 'symbol' && reIsUint.test(value))) && (value > -1 && value % 1 == 0 && value < length); } module.exports = isIndex; /***/ }), /* 389 */ /***/ (function(module, exports) { /** Used for built-in method references. */ var objectProto = Object.prototype; /** * Checks if `value` is likely a prototype object. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. */ function isPrototype(value) { var Ctor = value && value.constructor, proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; return value === proto; } module.exports = isPrototype; /***/ }), /* 390 */ /***/ (function(module, exports, __webpack_require__) { var arrayLikeKeys = __webpack_require__(391), baseKeys = __webpack_require__(401), isArrayLike = __webpack_require__(386); /** * Creates an array of the own enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. See the * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * for more details. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keys(new Foo); * // => ['a', 'b'] (iteration order is not guaranteed) * * _.keys('hi'); * // => ['0', '1'] */ function keys(object) { return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); } module.exports = keys; /***/ }), /* 391 */ /***/ (function(module, exports, __webpack_require__) { var baseTimes = __webpack_require__(392), isArguments = __webpack_require__(393), isArray = __webpack_require__(75), isBuffer = __webpack_require__(395), isIndex = __webpack_require__(388), isTypedArray = __webpack_require__(397); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Creates an array of the enumerable property names of the array-like `value`. * * @private * @param {*} value The value to query. * @param {boolean} inherited Specify returning inherited property names. * @returns {Array} Returns the array of property names. */ function arrayLikeKeys(value, inherited) { var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length; for (var key in value) { if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && ( // Safari 9 has enumerable `arguments.length` in strict mode. key == 'length' || // Node.js 0.10 has enumerable non-index properties on buffers. (isBuff && (key == 'offset' || key == 'parent')) || // PhantomJS 2 has enumerable non-index properties on typed arrays. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || // Skip index properties. isIndex(key, length) ))) { result.push(key); } } return result; } module.exports = arrayLikeKeys; /***/ }), /* 392 */ /***/ (function(module, exports) { /** * The base implementation of `_.times` without support for iteratee shorthands * or max array length checks. * * @private * @param {number} n The number of times to invoke `iteratee`. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the array of results. */ function baseTimes(n, iteratee) { var index = -1, result = Array(n); while (++index < n) { result[index] = iteratee(index); } return result; } module.exports = baseTimes; /***/ }), /* 393 */ /***/ (function(module, exports, __webpack_require__) { var baseIsArguments = __webpack_require__(394), isObjectLike = __webpack_require__(73); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** Built-in value references. */ var propertyIsEnumerable = objectProto.propertyIsEnumerable; /** * Checks if `value` is likely an `arguments` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, * else `false`. * @example * * _.isArguments(function() { return arguments; }()); * // => true * * _.isArguments([1, 2, 3]); * // => false */ var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee'); }; module.exports = isArguments; /***/ }), /* 394 */ /***/ (function(module, exports, __webpack_require__) { var baseGetTag = __webpack_require__(66), isObjectLike = __webpack_require__(73); /** `Object#toString` result references. */ var argsTag = '[object Arguments]'; /** * The base implementation of `_.isArguments`. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, */ function baseIsArguments(value) { return isObjectLike(value) && baseGetTag(value) == argsTag; } module.exports = baseIsArguments; /***/ }), /* 395 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(68), stubFalse = __webpack_require__(396); /** Detect free variable `exports`. */ var freeExports = true && exports && !exports.nodeType && exports; /** Detect free variable `module`. */ var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; /** Built-in value references. */ var Buffer = moduleExports ? root.Buffer : undefined; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; /** * Checks if `value` is a buffer. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. * @example * * _.isBuffer(new Buffer(2)); * // => true * * _.isBuffer(new Uint8Array(2)); * // => false */ var isBuffer = nativeIsBuffer || stubFalse; module.exports = isBuffer; /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(13)(module))) /***/ }), /* 396 */ /***/ (function(module, exports) { /** * This method returns `false`. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {boolean} Returns `false`. * @example * * _.times(2, _.stubFalse); * // => [false, false] */ function stubFalse() { return false; } module.exports = stubFalse; /***/ }), /* 397 */ /***/ (function(module, exports, __webpack_require__) { var baseIsTypedArray = __webpack_require__(398), baseUnary = __webpack_require__(399), nodeUtil = __webpack_require__(400); /* Node.js helper references. */ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; /** * Checks if `value` is classified as a typed array. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. * @example * * _.isTypedArray(new Uint8Array); * // => true * * _.isTypedArray([]); * // => false */ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; module.exports = isTypedArray; /***/ }), /* 398 */ /***/ (function(module, exports, __webpack_require__) { var baseGetTag = __webpack_require__(66), isLength = __webpack_require__(387), isObjectLike = __webpack_require__(73); /** `Object#toString` result references. */ var argsTag = '[object Arguments]', arrayTag = '[object Array]', boolTag = '[object Boolean]', dateTag = '[object Date]', errorTag = '[object Error]', funcTag = '[object Function]', mapTag = '[object Map]', numberTag = '[object Number]', objectTag = '[object Object]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', weakMapTag = '[object WeakMap]'; var arrayBufferTag = '[object ArrayBuffer]', dataViewTag = '[object DataView]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', int16Tag = '[object Int16Array]', int32Tag = '[object Int32Array]', uint8Tag = '[object Uint8Array]', uint8ClampedTag = '[object Uint8ClampedArray]', uint16Tag = '[object Uint16Array]', uint32Tag = '[object Uint32Array]'; /** Used to identify `toStringTag` values of typed arrays. */ var typedArrayTags = {}; typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; /** * The base implementation of `_.isTypedArray` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. */ function baseIsTypedArray(value) { return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; } module.exports = baseIsTypedArray; /***/ }), /* 399 */ /***/ (function(module, exports) { /** * The base implementation of `_.unary` without support for storing metadata. * * @private * @param {Function} func The function to cap arguments for. * @returns {Function} Returns the new capped function. */ function baseUnary(func) { return function(value) { return func(value); }; } module.exports = baseUnary; /***/ }), /* 400 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__(69); /** Detect free variable `exports`. */ var freeExports = true && exports && !exports.nodeType && exports; /** Detect free variable `module`. */ var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; /** Detect free variable `process` from Node.js. */ var freeProcess = moduleExports && freeGlobal.process; /** Used to access faster Node.js helpers. */ var nodeUtil = (function() { try { // Use `util.types` for Node.js 10+. var types = freeModule && freeModule.require && freeModule.require('util').types; if (types) { return types; } // Legacy `process.binding('util')` for Node.js < 10. return freeProcess && freeProcess.binding && freeProcess.binding('util'); } catch (e) {} }()); module.exports = nodeUtil; /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(13)(module))) /***/ }), /* 401 */ /***/ (function(module, exports, __webpack_require__) { var isPrototype = __webpack_require__(389), nativeKeys = __webpack_require__(402); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function baseKeys(object) { if (!isPrototype(object)) { return nativeKeys(object); } var result = []; for (var key in Object(object)) { if (hasOwnProperty.call(object, key) && key != 'constructor') { result.push(key); } } return result; } module.exports = baseKeys; /***/ }), /* 402 */ /***/ (function(module, exports, __webpack_require__) { var overArg = __webpack_require__(403); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeKeys = overArg(Object.keys, Object); module.exports = nativeKeys; /***/ }), /* 403 */ /***/ (function(module, exports) { /** * Creates a unary function that invokes `func` with its argument transformed. * * @private * @param {Function} func The function to wrap. * @param {Function} transform The argument transform. * @returns {Function} Returns the new function. */ function overArg(func, transform) { return function(arg) { return func(transform(arg)); }; } module.exports = overArg; /***/ }), /* 404 */ /***/ (function(module, exports, __webpack_require__) { var parse = __webpack_require__(281), render = __webpack_require__(405), assign = __webpack_require__(364); /** * HTML Tags */ var tags = { tag: true, script: true, style: true }; /** * Check if the DOM element is a tag * * isTag(type) includes <script> and <style> tags */ exports.isTag = function(type) { if (type.type) type = type.type; return tags[type] || false; }; /** * Convert a string to camel case notation. * @param {String} str String to be converted. * @return {String} String in camel case notation. */ exports.camelCase = function(str) { return str.replace(/[_.-](\w|$)/g, function(_, x) { return x.toUpperCase(); }); }; /** * Convert a string from camel case to "CSS case", where word boundaries are * described by hyphens ("-") and all characters are lower-case. * @param {String} str String to be converted. * @return {string} String in "CSS case". */ exports.cssCase = function(str) { return str.replace(/[A-Z]/g, '-$&').toLowerCase(); }; /** * Iterate over each DOM element without creating intermediary Cheerio instances. * * This is indented for use internally to avoid otherwise unnecessary memory pressure introduced * by _make. */ exports.domEach = function(cheerio, fn) { var i = 0, len = cheerio.length; while (i < len && fn.call(cheerio, i, cheerio[i]) !== false) ++i; return cheerio; }; /** * Create a deep copy of the given DOM structure by first rendering it to a * string and then parsing the resultant markup. * * @argument {Object} dom - The htmlparser2-compliant DOM structure * @argument {Object} options - The parsing/rendering options */ exports.cloneDom = function(dom, options) { options = assign({}, options, { _useHtmlParser2: true }); return parse(render(dom, options), options, false).children; }; /* * A simple way to check for HTML strings or ID strings */ var quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/; /* * Check if string is HTML */ exports.isHtml = function(str) { // Faster than running regex, if str starts with `<` and ends with `>`, assume it's HTML if (str.charAt(0) === '<' && str.charAt(str.length - 1) === '>' && str.length >= 3) return true; // Run the regex var match = quickExpr.exec(str); return !!(match && match[1]); }; /***/ }), /* 405 */ /***/ (function(module, exports, __webpack_require__) { /* Module dependencies */ var ElementType = __webpack_require__(293); var entities = __webpack_require__(406); var unencodedElements = { __proto__: null, style: true, script: true, xmp: true, iframe: true, noembed: true, noframes: true, plaintext: true, noscript: true }; /* Format attributes */ function formatAttrs(attributes, opts) { if (!attributes) return; var output = '', value; // Loop through the attributes for (var key in attributes) { value = attributes[key]; if (output) { output += ' '; } output += key; if ((value !== null && value !== '') || opts.xmlMode) { output += '="' + (opts.decodeEntities ? entities.encodeXML(value) : value) + '"'; } } return output; } /* Self-enclosing tags (stolen from node-htmlparser) */ var singleTag = { __proto__: null, area: true, base: true, basefont: true, br: true, col: true, command: true, embed: true, frame: true, hr: true, img: true, input: true, isindex: true, keygen: true, link: true, meta: true, param: true, source: true, track: true, wbr: true, }; var render = module.exports = function(dom, opts) { if (!Array.isArray(dom) && !dom.cheerio) dom = [dom]; opts = opts || {}; var output = ''; for(var i = 0; i < dom.length; i++){ var elem = dom[i]; if (elem.type === 'root') output += render(elem.children, opts); else if (ElementType.isTag(elem)) output += renderTag(elem, opts); else if (elem.type === ElementType.Directive) output += renderDirective(elem); else if (elem.type === ElementType.Comment) output += renderComment(elem); else if (elem.type === ElementType.CDATA) output += renderCdata(elem); else output += renderText(elem, opts); } return output; }; function renderTag(elem, opts) { // Handle SVG if (elem.name === "svg") opts = {decodeEntities: opts.decodeEntities, xmlMode: true}; var tag = '<' + elem.name, attribs = formatAttrs(elem.attribs, opts); if (attribs) { tag += ' ' + attribs; } if ( opts.xmlMode && (!elem.children || elem.children.length === 0) ) { tag += '/>'; } else { tag += '>'; if (elem.children) { tag += render(elem.children, opts); } if (!singleTag[elem.name] || opts.xmlMode) { tag += '</' + elem.name + '>'; } } return tag; } function renderDirective(elem) { return '<' + elem.data + '>'; } function renderText(elem, opts) { var data = elem.data || ''; // if entities weren't decoded, no need to encode them back if (opts.decodeEntities && !(elem.parent && elem.parent.name in unencodedElements)) { data = entities.encodeXML(data); } return data; } function renderCdata(elem) { return '<![CDATA[' + elem.children[0].data + ']]>'; } function renderComment(elem) { return '<!--' + elem.data + '-->'; } /***/ }), /* 406 */ /***/ (function(module, exports, __webpack_require__) { var encode = __webpack_require__(407), decode = __webpack_require__(408); exports.decode = function(data, level) { return (!level || level <= 0 ? decode.XML : decode.HTML)(data); }; exports.decodeStrict = function(data, level) { return (!level || level <= 0 ? decode.XML : decode.HTMLStrict)(data); }; exports.encode = function(data, level) { return (!level || level <= 0 ? encode.XML : encode.HTML)(data); }; exports.encodeXML = encode.XML; exports.encodeHTML4 = exports.encodeHTML5 = exports.encodeHTML = encode.HTML; exports.decodeXML = exports.decodeXMLStrict = decode.XML; exports.decodeHTML4 = exports.decodeHTML5 = exports.decodeHTML = decode.HTML; exports.decodeHTML4Strict = exports.decodeHTML5Strict = exports.decodeHTMLStrict = decode.HTMLStrict; exports.escape = encode.escape; /***/ }), /* 407 */ /***/ (function(module, exports, __webpack_require__) { var inverseXML = getInverseObj(__webpack_require__(289)), xmlReplacer = getInverseReplacer(inverseXML); exports.XML = getInverse(inverseXML, xmlReplacer); var inverseHTML = getInverseObj(__webpack_require__(287)), htmlReplacer = getInverseReplacer(inverseHTML); exports.HTML = getInverse(inverseHTML, htmlReplacer); function getInverseObj(obj) { return Object.keys(obj) .sort() .reduce(function(inverse, name) { inverse[obj[name]] = "&" + name + ";"; return inverse; }, {}); } function getInverseReplacer(inverse) { var single = [], multiple = []; Object.keys(inverse).forEach(function(k) { if (k.length === 1) { single.push("\\" + k); } else { multiple.push(k); } }); //TODO add ranges multiple.unshift("[" + single.join("") + "]"); return new RegExp(multiple.join("|"), "g"); } var re_nonASCII = /[^\0-\x7F]/g, re_astralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; function singleCharReplacer(c) { return ( "&#x" + c .charCodeAt(0) .toString(16) .toUpperCase() + ";" ); } function astralReplacer(c) { // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae var high = c.charCodeAt(0); var low = c.charCodeAt(1); var codePoint = (high - 0xd800) * 0x400 + low - 0xdc00 + 0x10000; return "&#x" + codePoint.toString(16).toUpperCase() + ";"; } function getInverse(inverse, re) { function func(name) { return inverse[name]; } return function(data) { return data .replace(re, func) .replace(re_astralSymbols, astralReplacer) .replace(re_nonASCII, singleCharReplacer); }; } var re_xmlChars = getInverseReplacer(inverseXML); function escapeXML(data) { return data .replace(re_xmlChars, singleCharReplacer) .replace(re_astralSymbols, astralReplacer) .replace(re_nonASCII, singleCharReplacer); } exports.escape = escapeXML; /***/ }), /* 408 */ /***/ (function(module, exports, __webpack_require__) { var entityMap = __webpack_require__(287), legacyMap = __webpack_require__(288), xmlMap = __webpack_require__(289), decodeCodePoint = __webpack_require__(285); var decodeXMLStrict = getStrictDecoder(xmlMap), decodeHTMLStrict = getStrictDecoder(entityMap); function getStrictDecoder(map) { var keys = Object.keys(map).join("|"), replace = getReplacer(map); keys += "|#[xX][\\da-fA-F]+|#\\d+"; var re = new RegExp("&(?:" + keys + ");", "g"); return function(str) { return String(str).replace(re, replace); }; } var decodeHTML = (function() { var legacy = Object.keys(legacyMap).sort(sorter); var keys = Object.keys(entityMap).sort(sorter); for (var i = 0, j = 0; i < keys.length; i++) { if (legacy[j] === keys[i]) { keys[i] += ";?"; j++; } else { keys[i] += ";"; } } var re = new RegExp("&(?:" + keys.join("|") + "|#[xX][\\da-fA-F]+;?|#\\d+;?)", "g"), replace = getReplacer(entityMap); function replacer(str) { if (str.substr(-1) !== ";") str += ";"; return replace(str); } //TODO consider creating a merged map return function(str) { return String(str).replace(re, replacer); }; })(); function sorter(a, b) { return a < b ? 1 : -1; } function getReplacer(map) { return function replace(str) { if (str.charAt(1) === "#") { if (str.charAt(2) === "X" || str.charAt(2) === "x") { return decodeCodePoint(parseInt(str.substr(3), 16)); } return decodeCodePoint(parseInt(str.substr(2), 10)); } return map[str.slice(1, -1)]; }; } module.exports = { XML: decodeXMLStrict, HTML: decodeHTML, HTMLStrict: decodeHTMLStrict }; /***/ }), /* 409 */ /***/ (function(module, exports, __webpack_require__) { var copyObject = __webpack_require__(375), createAssigner = __webpack_require__(376), keysIn = __webpack_require__(410); /** * This method is like `_.assign` except that it iterates over own and * inherited source properties. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @alias extend * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.assign * @example * * function Foo() { * this.a = 1; * } * * function Bar() { * this.c = 3; * } * * Foo.prototype.b = 2; * Bar.prototype.d = 4; * * _.assignIn({ 'a': 0 }, new Foo, new Bar); * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } */ var assignIn = createAssigner(function(object, source) { copyObject(source, keysIn(source), object); }); module.exports = assignIn; /***/ }), /* 410 */ /***/ (function(module, exports, __webpack_require__) { var arrayLikeKeys = __webpack_require__(391), baseKeysIn = __webpack_require__(411), isArrayLike = __webpack_require__(386); /** * Creates an array of the own and inherited enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @memberOf _ * @since 3.0.0 * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keysIn(new Foo); * // => ['a', 'b', 'c'] (iteration order is not guaranteed) */ function keysIn(object) { return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); } module.exports = keysIn; /***/ }), /* 411 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(72), isPrototype = __webpack_require__(389), nativeKeysIn = __webpack_require__(412); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function baseKeysIn(object) { if (!isObject(object)) { return nativeKeysIn(object); } var isProto = isPrototype(object), result = []; for (var key in object) { if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { result.push(key); } } return result; } module.exports = baseKeysIn; /***/ }), /* 412 */ /***/ (function(module, exports) { /** * This function is like * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * except that it includes inherited enumerable properties. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function nativeKeysIn(object) { var result = []; if (object != null) { for (var key in Object(object)) { result.push(key); } } return result; } module.exports = nativeKeysIn; /***/ }), /* 413 */ /***/ (function(module, exports, __webpack_require__) { var baseRest = __webpack_require__(377), createWrap = __webpack_require__(414), getHolder = __webpack_require__(449), replaceHolders = __webpack_require__(451); /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG = 1, WRAP_PARTIAL_FLAG = 32; /** * Creates a function that invokes `func` with the `this` binding of `thisArg` * and `partials` prepended to the arguments it receives. * * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, * may be used as a placeholder for partially applied arguments. * * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" * property of bound functions. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to bind. * @param {*} thisArg The `this` binding of `func`. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new bound function. * @example * * function greet(greeting, punctuation) { * return greeting + ' ' + this.user + punctuation; * } * * var object = { 'user': 'fred' }; * * var bound = _.bind(greet, object, 'hi'); * bound('!'); * // => 'hi fred!' * * // Bound with placeholders. * var bound = _.bind(greet, object, _, '!'); * bound('hi'); * // => 'hi fred!' */ var bind = baseRest(function(func, thisArg, partials) { var bitmask = WRAP_BIND_FLAG; if (partials.length) { var holders = replaceHolders(partials, getHolder(bind)); bitmask |= WRAP_PARTIAL_FLAG; } return createWrap(func, bitmask, thisArg, partials, holders); }); // Assign default placeholders. bind.placeholder = {}; module.exports = bind; /***/ }), /* 414 */ /***/ (function(module, exports, __webpack_require__) { var baseSetData = __webpack_require__(415), createBind = __webpack_require__(418), createCurry = __webpack_require__(421), createHybrid = __webpack_require__(422), createPartial = __webpack_require__(452), getData = __webpack_require__(430), mergeData = __webpack_require__(453), setData = __webpack_require__(438), setWrapToString = __webpack_require__(439), toInteger = __webpack_require__(454); /** Error message constants. */ var FUNC_ERROR_TEXT = 'Expected a function'; /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max; /** * Creates a function that either curries or invokes `func` with optional * `this` binding and partially applied arguments. * * @private * @param {Function|string} func The function or method name to wrap. * @param {number} bitmask The bitmask flags. * 1 - `_.bind` * 2 - `_.bindKey` * 4 - `_.curry` or `_.curryRight` of a bound function * 8 - `_.curry` * 16 - `_.curryRight` * 32 - `_.partial` * 64 - `_.partialRight` * 128 - `_.rearg` * 256 - `_.ary` * 512 - `_.flip` * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to be partially applied. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; if (!isBindKey && typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } var length = partials ? partials.length : 0; if (!length) { bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); partials = holders = undefined; } ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); arity = arity === undefined ? arity : toInteger(arity); length -= holders ? holders.length : 0; if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { var partialsRight = partials, holdersRight = holders; partials = holders = undefined; } var data = isBindKey ? undefined : getData(func); var newData = [ func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity ]; if (data) { mergeData(newData, data); } func = newData[0]; bitmask = newData[1]; thisArg = newData[2]; partials = newData[3]; holders = newData[4]; arity = newData[9] = newData[9] === undefined ? (isBindKey ? 0 : func.length) : nativeMax(newData[9] - length, 0); if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); } if (!bitmask || bitmask == WRAP_BIND_FLAG) { var result = createBind(func, bitmask, thisArg); } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { result = createCurry(func, bitmask, arity); } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { result = createPartial(func, bitmask, thisArg, partials); } else { result = createHybrid.apply(undefined, newData); } var setter = data ? baseSetData : setData; return setWrapToString(setter(result, newData), func, bitmask); } module.exports = createWrap; /***/ }), /* 415 */ /***/ (function(module, exports, __webpack_require__) { var identity = __webpack_require__(378), metaMap = __webpack_require__(416); /** * The base implementation of `setData` without support for hot loop shorting. * * @private * @param {Function} func The function to associate metadata with. * @param {*} data The metadata. * @returns {Function} Returns `func`. */ var baseSetData = !metaMap ? identity : function(func, data) { metaMap.set(func, data); return func; }; module.exports = baseSetData; /***/ }), /* 416 */ /***/ (function(module, exports, __webpack_require__) { var WeakMap = __webpack_require__(417); /** Used to store function metadata. */ var metaMap = WeakMap && new WeakMap; module.exports = metaMap; /***/ }), /* 417 */ /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(368), root = __webpack_require__(68); /* Built-in method references that are verified to be native. */ var WeakMap = getNative(root, 'WeakMap'); module.exports = WeakMap; /***/ }), /* 418 */ /***/ (function(module, exports, __webpack_require__) { var createCtor = __webpack_require__(419), root = __webpack_require__(68); /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG = 1; /** * Creates a function that wraps `func` to invoke it with the optional `this` * binding of `thisArg`. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} [thisArg] The `this` binding of `func`. * @returns {Function} Returns the new wrapped function. */ function createBind(func, bitmask, thisArg) { var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func); function wrapper() { var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; return fn.apply(isBind ? thisArg : this, arguments); } return wrapper; } module.exports = createBind; /***/ }), /* 419 */ /***/ (function(module, exports, __webpack_require__) { var baseCreate = __webpack_require__(420), isObject = __webpack_require__(72); /** * Creates a function that produces an instance of `Ctor` regardless of * whether it was invoked as part of a `new` expression or by `call` or `apply`. * * @private * @param {Function} Ctor The constructor to wrap. * @returns {Function} Returns the new wrapped function. */ function createCtor(Ctor) { return function() { // Use a `switch` statement to work with class constructors. See // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist // for more details. var args = arguments; switch (args.length) { case 0: return new Ctor; case 1: return new Ctor(args[0]); case 2: return new Ctor(args[0], args[1]); case 3: return new Ctor(args[0], args[1], args[2]); case 4: return new Ctor(args[0], args[1], args[2], args[3]); case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); } var thisBinding = baseCreate(Ctor.prototype), result = Ctor.apply(thisBinding, args); // Mimic the constructor's `return` behavior. // See https://es5.github.io/#x13.2.2 for more details. return isObject(result) ? result : thisBinding; }; } module.exports = createCtor; /***/ }), /* 420 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(72); /** Built-in value references. */ var objectCreate = Object.create; /** * The base implementation of `_.create` without support for assigning * properties to the created object. * * @private * @param {Object} proto The object to inherit from. * @returns {Object} Returns the new object. */ var baseCreate = (function() { function object() {} return function(proto) { if (!isObject(proto)) { return {}; } if (objectCreate) { return objectCreate(proto); } object.prototype = proto; var result = new object; object.prototype = undefined; return result; }; }()); module.exports = baseCreate; /***/ }), /* 421 */ /***/ (function(module, exports, __webpack_require__) { var apply = __webpack_require__(380), createCtor = __webpack_require__(419), createHybrid = __webpack_require__(422), createRecurry = __webpack_require__(426), getHolder = __webpack_require__(449), replaceHolders = __webpack_require__(451), root = __webpack_require__(68); /** * Creates a function that wraps `func` to enable currying. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {number} arity The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createCurry(func, bitmask, arity) { var Ctor = createCtor(func); function wrapper() { var length = arguments.length, args = Array(length), index = length, placeholder = getHolder(wrapper); while (index--) { args[index] = arguments[index]; } var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) ? [] : replaceHolders(args, placeholder); length -= holders.length; if (length < arity) { return createRecurry( func, bitmask, createHybrid, wrapper.placeholder, undefined, args, holders, undefined, undefined, arity - length); } var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; return apply(fn, this, args); } return wrapper; } module.exports = createCurry; /***/ }), /* 422 */ /***/ (function(module, exports, __webpack_require__) { var composeArgs = __webpack_require__(423), composeArgsRight = __webpack_require__(424), countHolders = __webpack_require__(425), createCtor = __webpack_require__(419), createRecurry = __webpack_require__(426), getHolder = __webpack_require__(449), reorder = __webpack_require__(450), replaceHolders = __webpack_require__(451), root = __webpack_require__(68); /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_ARY_FLAG = 128, WRAP_FLIP_FLAG = 512; /** * Creates a function that wraps `func` to invoke it with optional `this` * binding of `thisArg`, partial application, and currying. * * @private * @param {Function|string} func The function or method name to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to prepend to those provided to * the new function. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [partialsRight] The arguments to append to those provided * to the new function. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { var isAry = bitmask & WRAP_ARY_FLAG, isBind = bitmask & WRAP_BIND_FLAG, isBindKey = bitmask & WRAP_BIND_KEY_FLAG, isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), isFlip = bitmask & WRAP_FLIP_FLAG, Ctor = isBindKey ? undefined : createCtor(func); function wrapper() { var length = arguments.length, args = Array(length), index = length; while (index--) { args[index] = arguments[index]; } if (isCurried) { var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder); } if (partials) { args = composeArgs(args, partials, holders, isCurried); } if (partialsRight) { args = composeArgsRight(args, partialsRight, holdersRight, isCurried); } length -= holdersCount; if (isCurried && length < arity) { var newHolders = replaceHolders(args, placeholder); return createRecurry( func, bitmask, createHybrid, wrapper.placeholder, thisArg, args, newHolders, argPos, ary, arity - length ); } var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func; length = args.length; if (argPos) { args = reorder(args, argPos); } else if (isFlip && length > 1) { args.reverse(); } if (isAry && ary < length) { args.length = ary; } if (this && this !== root && this instanceof wrapper) { fn = Ctor || createCtor(fn); } return fn.apply(thisBinding, args); } return wrapper; } module.exports = createHybrid; /***/ }), /* 423 */ /***/ (function(module, exports) { /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max; /** * Creates an array that is the composition of partially applied arguments, * placeholders, and provided arguments into a single array of arguments. * * @private * @param {Array} args The provided arguments. * @param {Array} partials The arguments to prepend to those provided. * @param {Array} holders The `partials` placeholder indexes. * @params {boolean} [isCurried] Specify composing for a curried function. * @returns {Array} Returns the new array of composed arguments. */ function composeArgs(args, partials, holders, isCurried) { var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result = Array(leftLength + rangeLength), isUncurried = !isCurried; while (++leftIndex < leftLength) { result[leftIndex] = partials[leftIndex]; } while (++argsIndex < holdersLength) { if (isUncurried || argsIndex < argsLength) { result[holders[argsIndex]] = args[argsIndex]; } } while (rangeLength--) { result[leftIndex++] = args[argsIndex++]; } return result; } module.exports = composeArgs; /***/ }), /* 424 */ /***/ (function(module, exports) { /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max; /** * This function is like `composeArgs` except that the arguments composition * is tailored for `_.partialRight`. * * @private * @param {Array} args The provided arguments. * @param {Array} partials The arguments to append to those provided. * @param {Array} holders The `partials` placeholder indexes. * @params {boolean} [isCurried] Specify composing for a curried function. * @returns {Array} Returns the new array of composed arguments. */ function composeArgsRight(args, partials, holders, isCurried) { var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result = Array(rangeLength + rightLength), isUncurried = !isCurried; while (++argsIndex < rangeLength) { result[argsIndex] = args[argsIndex]; } var offset = argsIndex; while (++rightIndex < rightLength) { result[offset + rightIndex] = partials[rightIndex]; } while (++holdersIndex < holdersLength) { if (isUncurried || argsIndex < argsLength) { result[offset + holders[holdersIndex]] = args[argsIndex++]; } } return result; } module.exports = composeArgsRight; /***/ }), /* 425 */ /***/ (function(module, exports) { /** * Gets the number of `placeholder` occurrences in `array`. * * @private * @param {Array} array The array to inspect. * @param {*} placeholder The placeholder to search for. * @returns {number} Returns the placeholder count. */ function countHolders(array, placeholder) { var length = array.length, result = 0; while (length--) { if (array[length] === placeholder) { ++result; } } return result; } module.exports = countHolders; /***/ }), /* 426 */ /***/ (function(module, exports, __webpack_require__) { var isLaziable = __webpack_require__(427), setData = __webpack_require__(438), setWrapToString = __webpack_require__(439); /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64; /** * Creates a function that wraps `func` to continue currying. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {Function} wrapFunc The function to create the `func` wrapper. * @param {*} placeholder The placeholder value. * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to prepend to those provided to * the new function. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { var isCurry = bitmask & WRAP_CURRY_FLAG, newHolders = isCurry ? holders : undefined, newHoldersRight = isCurry ? undefined : holders, newPartials = isCurry ? partials : undefined, newPartialsRight = isCurry ? undefined : partials; bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); } var newData = [ func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, newHoldersRight, argPos, ary, arity ]; var result = wrapFunc.apply(undefined, newData); if (isLaziable(func)) { setData(result, newData); } result.placeholder = placeholder; return setWrapToString(result, func, bitmask); } module.exports = createRecurry; /***/ }), /* 427 */ /***/ (function(module, exports, __webpack_require__) { var LazyWrapper = __webpack_require__(428), getData = __webpack_require__(430), getFuncName = __webpack_require__(432), lodash = __webpack_require__(434); /** * Checks if `func` has a lazy counterpart. * * @private * @param {Function} func The function to check. * @returns {boolean} Returns `true` if `func` has a lazy counterpart, * else `false`. */ function isLaziable(func) { var funcName = getFuncName(func), other = lodash[funcName]; if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { return false; } if (func === other) { return true; } var data = getData(other); return !!data && func === data[0]; } module.exports = isLaziable; /***/ }), /* 428 */ /***/ (function(module, exports, __webpack_require__) { var baseCreate = __webpack_require__(420), baseLodash = __webpack_require__(429); /** Used as references for the maximum length and index of an array. */ var MAX_ARRAY_LENGTH = 4294967295; /** * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. * * @private * @constructor * @param {*} value The value to wrap. */ function LazyWrapper(value) { this.__wrapped__ = value; this.__actions__ = []; this.__dir__ = 1; this.__filtered__ = false; this.__iteratees__ = []; this.__takeCount__ = MAX_ARRAY_LENGTH; this.__views__ = []; } // Ensure `LazyWrapper` is an instance of `baseLodash`. LazyWrapper.prototype = baseCreate(baseLodash.prototype); LazyWrapper.prototype.constructor = LazyWrapper; module.exports = LazyWrapper; /***/ }), /* 429 */ /***/ (function(module, exports) { /** * The function whose prototype chain sequence wrappers inherit from. * * @private */ function baseLodash() { // No operation performed. } module.exports = baseLodash; /***/ }), /* 430 */ /***/ (function(module, exports, __webpack_require__) { var metaMap = __webpack_require__(416), noop = __webpack_require__(431); /** * Gets metadata for `func`. * * @private * @param {Function} func The function to query. * @returns {*} Returns the metadata for `func`. */ var getData = !metaMap ? noop : function(func) { return metaMap.get(func); }; module.exports = getData; /***/ }), /* 431 */ /***/ (function(module, exports) { /** * This method returns `undefined`. * * @static * @memberOf _ * @since 2.3.0 * @category Util * @example * * _.times(2, _.noop); * // => [undefined, undefined] */ function noop() { // No operation performed. } module.exports = noop; /***/ }), /* 432 */ /***/ (function(module, exports, __webpack_require__) { var realNames = __webpack_require__(433); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Gets the name of `func`. * * @private * @param {Function} func The function to query. * @returns {string} Returns the function name. */ function getFuncName(func) { var result = (func.name + ''), array = realNames[result], length = hasOwnProperty.call(realNames, result) ? array.length : 0; while (length--) { var data = array[length], otherFunc = data.func; if (otherFunc == null || otherFunc == func) { return data.name; } } return result; } module.exports = getFuncName; /***/ }), /* 433 */ /***/ (function(module, exports) { /** Used to lookup unminified function names. */ var realNames = {}; module.exports = realNames; /***/ }), /* 434 */ /***/ (function(module, exports, __webpack_require__) { var LazyWrapper = __webpack_require__(428), LodashWrapper = __webpack_require__(435), baseLodash = __webpack_require__(429), isArray = __webpack_require__(75), isObjectLike = __webpack_require__(73), wrapperClone = __webpack_require__(436); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Creates a `lodash` object which wraps `value` to enable implicit method * chain sequences. Methods that operate on and return arrays, collections, * and functions can be chained together. Methods that retrieve a single value * or may return a primitive value will automatically end the chain sequence * and return the unwrapped value. Otherwise, the value must be unwrapped * with `_#value`. * * Explicit chain sequences, which must be unwrapped with `_#value`, may be * enabled using `_.chain`. * * The execution of chained methods is lazy, that is, it's deferred until * `_#value` is implicitly or explicitly called. * * Lazy evaluation allows several methods to support shortcut fusion. * Shortcut fusion is an optimization to merge iteratee calls; this avoids * the creation of intermediate arrays and can greatly reduce the number of * iteratee executions. Sections of a chain sequence qualify for shortcut * fusion if the section is applied to an array and iteratees accept only * one argument. The heuristic for whether a section qualifies for shortcut * fusion is subject to change. * * Chaining is supported in custom builds as long as the `_#value` method is * directly or indirectly included in the build. * * In addition to lodash methods, wrappers have `Array` and `String` methods. * * The wrapper `Array` methods are: * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` * * The wrapper `String` methods are: * `replace` and `split` * * The wrapper methods that support shortcut fusion are: * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` * * The chainable wrapper methods are: * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, * `zipObject`, `zipObjectDeep`, and `zipWith` * * The wrapper methods that are **not** chainable by default are: * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, * `upperFirst`, `value`, and `words` * * @name _ * @constructor * @category Seq * @param {*} value The value to wrap in a `lodash` instance. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * function square(n) { * return n * n; * } * * var wrapped = _([1, 2, 3]); * * // Returns an unwrapped value. * wrapped.reduce(_.add); * // => 6 * * // Returns a wrapped value. * var squares = wrapped.map(square); * * _.isArray(squares); * // => false * * _.isArray(squares.value()); * // => true */ function lodash(value) { if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { if (value instanceof LodashWrapper) { return value; } if (hasOwnProperty.call(value, '__wrapped__')) { return wrapperClone(value); } } return new LodashWrapper(value); } // Ensure wrappers are instances of `baseLodash`. lodash.prototype = baseLodash.prototype; lodash.prototype.constructor = lodash; module.exports = lodash; /***/ }), /* 435 */ /***/ (function(module, exports, __webpack_require__) { var baseCreate = __webpack_require__(420), baseLodash = __webpack_require__(429); /** * The base constructor for creating `lodash` wrapper objects. * * @private * @param {*} value The value to wrap. * @param {boolean} [chainAll] Enable explicit method chain sequences. */ function LodashWrapper(value, chainAll) { this.__wrapped__ = value; this.__actions__ = []; this.__chain__ = !!chainAll; this.__index__ = 0; this.__values__ = undefined; } LodashWrapper.prototype = baseCreate(baseLodash.prototype); LodashWrapper.prototype.constructor = LodashWrapper; module.exports = LodashWrapper; /***/ }), /* 436 */ /***/ (function(module, exports, __webpack_require__) { var LazyWrapper = __webpack_require__(428), LodashWrapper = __webpack_require__(435), copyArray = __webpack_require__(437); /** * Creates a clone of `wrapper`. * * @private * @param {Object} wrapper The wrapper to clone. * @returns {Object} Returns the cloned wrapper. */ function wrapperClone(wrapper) { if (wrapper instanceof LazyWrapper) { return wrapper.clone(); } var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); result.__actions__ = copyArray(wrapper.__actions__); result.__index__ = wrapper.__index__; result.__values__ = wrapper.__values__; return result; } module.exports = wrapperClone; /***/ }), /* 437 */ /***/ (function(module, exports) { /** * Copies the values of `source` to `array`. * * @private * @param {Array} source The array to copy values from. * @param {Array} [array=[]] The array to copy values to. * @returns {Array} Returns `array`. */ function copyArray(source, array) { var index = -1, length = source.length; array || (array = Array(length)); while (++index < length) { array[index] = source[index]; } return array; } module.exports = copyArray; /***/ }), /* 438 */ /***/ (function(module, exports, __webpack_require__) { var baseSetData = __webpack_require__(415), shortOut = __webpack_require__(384); /** * Sets metadata for `func`. * * **Note:** If this function becomes hot, i.e. is invoked a lot in a short * period of time, it will trip its breaker and transition to an identity * function to avoid garbage collection pauses in V8. See * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) * for more details. * * @private * @param {Function} func The function to associate metadata with. * @param {*} data The metadata. * @returns {Function} Returns `func`. */ var setData = shortOut(baseSetData); module.exports = setData; /***/ }), /* 439 */ /***/ (function(module, exports, __webpack_require__) { var getWrapDetails = __webpack_require__(440), insertWrapDetails = __webpack_require__(441), setToString = __webpack_require__(381), updateWrapDetails = __webpack_require__(442); /** * Sets the `toString` method of `wrapper` to mimic the source of `reference` * with wrapper details in a comment at the top of the source body. * * @private * @param {Function} wrapper The function to modify. * @param {Function} reference The reference function. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @returns {Function} Returns `wrapper`. */ function setWrapToString(wrapper, reference, bitmask) { var source = (reference + ''); return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); } module.exports = setWrapToString; /***/ }), /* 440 */ /***/ (function(module, exports) { /** Used to match wrap detail comments. */ var reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /; /** * Extracts wrapper details from the `source` body comment. * * @private * @param {string} source The source to inspect. * @returns {Array} Returns the wrapper details. */ function getWrapDetails(source) { var match = source.match(reWrapDetails); return match ? match[1].split(reSplitDetails) : []; } module.exports = getWrapDetails; /***/ }), /* 441 */ /***/ (function(module, exports) { /** Used to match wrap detail comments. */ var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/; /** * Inserts wrapper `details` in a comment at the top of the `source` body. * * @private * @param {string} source The source to modify. * @returns {Array} details The details to insert. * @returns {string} Returns the modified source. */ function insertWrapDetails(source, details) { var length = details.length; if (!length) { return source; } var lastIndex = length - 1; details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; details = details.join(length > 2 ? ', ' : ' '); return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); } module.exports = insertWrapDetails; /***/ }), /* 442 */ /***/ (function(module, exports, __webpack_require__) { var arrayEach = __webpack_require__(443), arrayIncludes = __webpack_require__(444); /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512; /** Used to associate wrap methods with their bit flags. */ var wrapFlags = [ ['ary', WRAP_ARY_FLAG], ['bind', WRAP_BIND_FLAG], ['bindKey', WRAP_BIND_KEY_FLAG], ['curry', WRAP_CURRY_FLAG], ['curryRight', WRAP_CURRY_RIGHT_FLAG], ['flip', WRAP_FLIP_FLAG], ['partial', WRAP_PARTIAL_FLAG], ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], ['rearg', WRAP_REARG_FLAG] ]; /** * Updates wrapper `details` based on `bitmask` flags. * * @private * @returns {Array} details The details to modify. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @returns {Array} Returns `details`. */ function updateWrapDetails(details, bitmask) { arrayEach(wrapFlags, function(pair) { var value = '_.' + pair[0]; if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { details.push(value); } }); return details.sort(); } module.exports = updateWrapDetails; /***/ }), /* 443 */ /***/ (function(module, exports) { /** * A specialized version of `_.forEach` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ function arrayEach(array, iteratee) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (iteratee(array[index], index, array) === false) { break; } } return array; } module.exports = arrayEach; /***/ }), /* 444 */ /***/ (function(module, exports, __webpack_require__) { var baseIndexOf = __webpack_require__(445); /** * A specialized version of `_.includes` for arrays without support for * specifying an index to search from. * * @private * @param {Array} [array] The array to inspect. * @param {*} target The value to search for. * @returns {boolean} Returns `true` if `target` is found, else `false`. */ function arrayIncludes(array, value) { var length = array == null ? 0 : array.length; return !!length && baseIndexOf(array, value, 0) > -1; } module.exports = arrayIncludes; /***/ }), /* 445 */ /***/ (function(module, exports, __webpack_require__) { var baseFindIndex = __webpack_require__(446), baseIsNaN = __webpack_require__(447), strictIndexOf = __webpack_require__(448); /** * The base implementation of `_.indexOf` without `fromIndex` bounds checks. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseIndexOf(array, value, fromIndex) { return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex); } module.exports = baseIndexOf; /***/ }), /* 446 */ /***/ (function(module, exports) { /** * The base implementation of `_.findIndex` and `_.findLastIndex` without * support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Function} predicate The function invoked per iteration. * @param {number} fromIndex The index to search from. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseFindIndex(array, predicate, fromIndex, fromRight) { var length = array.length, index = fromIndex + (fromRight ? 1 : -1); while ((fromRight ? index-- : ++index < length)) { if (predicate(array[index], index, array)) { return index; } } return -1; } module.exports = baseFindIndex; /***/ }), /* 447 */ /***/ (function(module, exports) { /** * The base implementation of `_.isNaN` without support for number objects. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. */ function baseIsNaN(value) { return value !== value; } module.exports = baseIsNaN; /***/ }), /* 448 */ /***/ (function(module, exports) { /** * A specialized version of `_.indexOf` which performs strict equality * comparisons of values, i.e. `===`. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function strictIndexOf(array, value, fromIndex) { var index = fromIndex - 1, length = array.length; while (++index < length) { if (array[index] === value) { return index; } } return -1; } module.exports = strictIndexOf; /***/ }), /* 449 */ /***/ (function(module, exports) { /** * Gets the argument placeholder value for `func`. * * @private * @param {Function} func The function to inspect. * @returns {*} Returns the placeholder value. */ function getHolder(func) { var object = func; return object.placeholder; } module.exports = getHolder; /***/ }), /* 450 */ /***/ (function(module, exports, __webpack_require__) { var copyArray = __webpack_require__(437), isIndex = __webpack_require__(388); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMin = Math.min; /** * Reorder `array` according to the specified indexes where the element at * the first index is assigned as the first element, the element at * the second index is assigned as the second element, and so on. * * @private * @param {Array} array The array to reorder. * @param {Array} indexes The arranged array indexes. * @returns {Array} Returns `array`. */ function reorder(array, indexes) { var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array); while (length--) { var index = indexes[length]; array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; } return array; } module.exports = reorder; /***/ }), /* 451 */ /***/ (function(module, exports) { /** Used as the internal argument placeholder. */ var PLACEHOLDER = '__lodash_placeholder__'; /** * Replaces all `placeholder` elements in `array` with an internal placeholder * and returns an array of their indexes. * * @private * @param {Array} array The array to modify. * @param {*} placeholder The placeholder to replace. * @returns {Array} Returns the new array of placeholder indexes. */ function replaceHolders(array, placeholder) { var index = -1, length = array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (value === placeholder || value === PLACEHOLDER) { array[index] = PLACEHOLDER; result[resIndex++] = index; } } return result; } module.exports = replaceHolders; /***/ }), /* 452 */ /***/ (function(module, exports, __webpack_require__) { var apply = __webpack_require__(380), createCtor = __webpack_require__(419), root = __webpack_require__(68); /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG = 1; /** * Creates a function that wraps `func` to invoke it with the `this` binding * of `thisArg` and `partials` prepended to the arguments it receives. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} thisArg The `this` binding of `func`. * @param {Array} partials The arguments to prepend to those provided to * the new function. * @returns {Function} Returns the new wrapped function. */ function createPartial(func, bitmask, thisArg, partials) { var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func); function wrapper() { var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array(leftLength + argsLength), fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; while (++leftIndex < leftLength) { args[leftIndex] = partials[leftIndex]; } while (argsLength--) { args[leftIndex++] = arguments[++argsIndex]; } return apply(fn, isBind ? thisArg : this, args); } return wrapper; } module.exports = createPartial; /***/ }), /* 453 */ /***/ (function(module, exports, __webpack_require__) { var composeArgs = __webpack_require__(423), composeArgsRight = __webpack_require__(424), replaceHolders = __webpack_require__(451); /** Used as the internal argument placeholder. */ var PLACEHOLDER = '__lodash_placeholder__'; /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMin = Math.min; /** * Merges the function metadata of `source` into `data`. * * Merging metadata reduces the number of wrappers used to invoke a function. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` * may be applied regardless of execution order. Methods like `_.ary` and * `_.rearg` modify function arguments, making the order in which they are * executed important, preventing the merging of metadata. However, we make * an exception for a safe combined case where curried functions have `_.ary` * and or `_.rearg` applied. * * @private * @param {Array} data The destination metadata. * @param {Array} source The source metadata. * @returns {Array} Returns `data`. */ function mergeData(data, source) { var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); var isCombo = ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); // Exit early if metadata can't be merged. if (!(isCommon || isCombo)) { return data; } // Use source `thisArg` if available. if (srcBitmask & WRAP_BIND_FLAG) { data[2] = source[2]; // Set when currying a bound function. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; } // Compose partial arguments. var value = source[3]; if (value) { var partials = data[3]; data[3] = partials ? composeArgs(partials, value, source[4]) : value; data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; } // Compose partial right arguments. value = source[5]; if (value) { partials = data[5]; data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; } // Use source `argPos` if available. value = source[7]; if (value) { data[7] = value; } // Use source `ary` if it's smaller. if (srcBitmask & WRAP_ARY_FLAG) { data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); } // Use source `arity` if one is not provided. if (data[9] == null) { data[9] = source[9]; } // Use source `func` and merge bitmasks. data[0] = source[0]; data[1] = newBitmask; return data; } module.exports = mergeData; /***/ }), /* 454 */ /***/ (function(module, exports, __webpack_require__) { var toFinite = __webpack_require__(455); /** * Converts `value` to an integer. * * **Note:** This method is loosely based on * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. * @example * * _.toInteger(3.2); * // => 3 * * _.toInteger(Number.MIN_VALUE); * // => 0 * * _.toInteger(Infinity); * // => 1.7976931348623157e+308 * * _.toInteger('3.2'); * // => 3 */ function toInteger(value) { var result = toFinite(value), remainder = result % 1; return result === result ? (remainder ? result - remainder : result) : 0; } module.exports = toInteger; /***/ }), /* 455 */ /***/ (function(module, exports, __webpack_require__) { var toNumber = __webpack_require__(456); /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0, MAX_INTEGER = 1.7976931348623157e+308; /** * Converts `value` to a finite number. * * @static * @memberOf _ * @since 4.12.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted number. * @example * * _.toFinite(3.2); * // => 3.2 * * _.toFinite(Number.MIN_VALUE); * // => 5e-324 * * _.toFinite(Infinity); * // => 1.7976931348623157e+308 * * _.toFinite('3.2'); * // => 3.2 */ function toFinite(value) { if (!value) { return value === 0 ? value : 0; } value = toNumber(value); if (value === INFINITY || value === -INFINITY) { var sign = (value < 0 ? -1 : 1); return sign * MAX_INTEGER; } return value === value ? value : 0; } module.exports = toFinite; /***/ }), /* 456 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(72), isSymbol = __webpack_require__(457); /** Used as references for various `Number` constants. */ var NAN = 0 / 0; /** Used to match leading and trailing whitespace. */ var reTrim = /^\s+|\s+$/g; /** Used to detect bad signed hexadecimal string values. */ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; /** Used to detect binary string values. */ var reIsBinary = /^0b[01]+$/i; /** Used to detect octal string values. */ var reIsOctal = /^0o[0-7]+$/i; /** Built-in method references without a dependency on `root`. */ var freeParseInt = parseInt; /** * Converts `value` to a number. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to process. * @returns {number} Returns the number. * @example * * _.toNumber(3.2); * // => 3.2 * * _.toNumber(Number.MIN_VALUE); * // => 5e-324 * * _.toNumber(Infinity); * // => Infinity * * _.toNumber('3.2'); * // => 3.2 */ function toNumber(value) { if (typeof value == 'number') { return value; } if (isSymbol(value)) { return NAN; } if (isObject(value)) { var other = typeof value.valueOf == 'function' ? value.valueOf() : value; value = isObject(other) ? (other + '') : other; } if (typeof value != 'string') { return value === 0 ? value : +value; } value = value.replace(reTrim, ''); var isBinary = reIsBinary.test(value); return (isBinary || reIsOctal.test(value)) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : (reIsBadHex.test(value) ? NAN : +value); } module.exports = toNumber; /***/ }), /* 457 */ /***/ (function(module, exports, __webpack_require__) { var baseGetTag = __webpack_require__(66), isObjectLike = __webpack_require__(73); /** `Object#toString` result references. */ var symbolTag = '[object Symbol]'; /** * Checks if `value` is classified as a `Symbol` primitive or object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * _.isSymbol(Symbol.iterator); * // => true * * _.isSymbol('abc'); * // => false */ function isSymbol(value) { return typeof value == 'symbol' || (isObjectLike(value) && baseGetTag(value) == symbolTag); } module.exports = isSymbol; /***/ }), /* 458 */ /***/ (function(module, exports, __webpack_require__) { var arrayEach = __webpack_require__(443), baseEach = __webpack_require__(459), castFunction = __webpack_require__(464), isArray = __webpack_require__(75); /** * Iterates over elements of `collection` and invokes `iteratee` for each element. * The iteratee is invoked with three arguments: (value, index|key, collection). * Iteratee functions may exit iteration early by explicitly returning `false`. * * **Note:** As with other "Collections" methods, objects with a "length" * property are iterated like arrays. To avoid this behavior use `_.forIn` * or `_.forOwn` for object iteration. * * @static * @memberOf _ * @since 0.1.0 * @alias each * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array|Object} Returns `collection`. * @see _.forEachRight * @example * * _.forEach([1, 2], function(value) { * console.log(value); * }); * // => Logs `1` then `2`. * * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { * console.log(key); * }); * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ function forEach(collection, iteratee) { var func = isArray(collection) ? arrayEach : baseEach; return func(collection, castFunction(iteratee)); } module.exports = forEach; /***/ }), /* 459 */ /***/ (function(module, exports, __webpack_require__) { var baseForOwn = __webpack_require__(460), createBaseEach = __webpack_require__(463); /** * The base implementation of `_.forEach` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array|Object} Returns `collection`. */ var baseEach = createBaseEach(baseForOwn); module.exports = baseEach; /***/ }), /* 460 */ /***/ (function(module, exports, __webpack_require__) { var baseFor = __webpack_require__(461), keys = __webpack_require__(390); /** * The base implementation of `_.forOwn` without support for iteratee shorthands. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. */ function baseForOwn(object, iteratee) { return object && baseFor(object, iteratee, keys); } module.exports = baseForOwn; /***/ }), /* 461 */ /***/ (function(module, exports, __webpack_require__) { var createBaseFor = __webpack_require__(462); /** * The base implementation of `baseForOwn` which iterates over `object` * properties returned by `keysFunc` and invokes `iteratee` for each property. * Iteratee functions may exit iteration early by explicitly returning `false`. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ var baseFor = createBaseFor(); module.exports = baseFor; /***/ }), /* 462 */ /***/ (function(module, exports) { /** * Creates a base function for methods like `_.forIn` and `_.forOwn`. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function. */ function createBaseFor(fromRight) { return function(object, iteratee, keysFunc) { var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length; while (length--) { var key = props[fromRight ? length : ++index]; if (iteratee(iterable[key], key, iterable) === false) { break; } } return object; }; } module.exports = createBaseFor; /***/ }), /* 463 */ /***/ (function(module, exports, __webpack_require__) { var isArrayLike = __webpack_require__(386); /** * Creates a `baseEach` or `baseEachRight` function. * * @private * @param {Function} eachFunc The function to iterate over a collection. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function. */ function createBaseEach(eachFunc, fromRight) { return function(collection, iteratee) { if (collection == null) { return collection; } if (!isArrayLike(collection)) { return eachFunc(collection, iteratee); } var length = collection.length, index = fromRight ? length : -1, iterable = Object(collection); while ((fromRight ? index-- : ++index < length)) { if (iteratee(iterable[index], index, iterable) === false) { break; } } return collection; }; } module.exports = createBaseEach; /***/ }), /* 464 */ /***/ (function(module, exports, __webpack_require__) { var identity = __webpack_require__(378); /** * Casts `value` to `identity` if it's not a function. * * @private * @param {*} value The value to inspect. * @returns {Function} Returns cast function. */ function castFunction(value) { return typeof value == 'function' ? value : identity; } module.exports = castFunction; /***/ }), /* 465 */ /***/ (function(module, exports, __webpack_require__) { var baseRest = __webpack_require__(377), eq = __webpack_require__(374), isIterateeCall = __webpack_require__(385), keysIn = __webpack_require__(410); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Assigns own and inherited enumerable string keyed properties of source * objects to the destination object for all destination properties that * resolve to `undefined`. Source objects are applied from left to right. * Once a property is set, additional values of the same property are ignored. * * **Note:** This method mutates `object`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.defaultsDeep * @example * * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ var defaults = baseRest(function(object, sources) { object = Object(object); var index = -1; var length = sources.length; var guard = length > 2 ? sources[2] : undefined; if (guard && isIterateeCall(sources[0], sources[1], guard)) { length = 1; } while (++index < length) { var source = sources[index]; var props = keysIn(source); var propsIndex = -1; var propsLength = props.length; while (++propsIndex < propsLength) { var key = props[propsIndex]; var value = object[key]; if (value === undefined || (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { object[key] = source[key]; } } } return object; }); module.exports = defaults; /***/ }), /* 466 */ /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__(467), utils = __webpack_require__(404), isTag = utils.isTag, domEach = utils.domEach, hasOwn = Object.prototype.hasOwnProperty, camelCase = utils.camelCase, cssCase = utils.cssCase, rspace = /\s+/, dataAttrPrefix = 'data-', _ = { forEach: __webpack_require__(458), extend: __webpack_require__(409), some: __webpack_require__(541) }, // Lookup table for coercing string data-* attributes to their corresponding // JavaScript primitives primitives = { null: null, true: true, false: false }, // Attributes that are booleans rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, // Matches strings that look like JSON objects or arrays rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/; var getAttr = function(elem, name) { if (!elem || !isTag(elem)) return; if (!elem.attribs) { elem.attribs = {}; } // Return the entire attribs object if no attribute specified if (!name) { return elem.attribs; } if (hasOwn.call(elem.attribs, name)) { // Get the (decoded) attribute return rboolean.test(name) ? name : elem.attribs[name]; } // Mimic the DOM and return text content as value for `option's` if (elem.name === 'option' && name === 'value') { return $.text(elem.children); } // Mimic DOM with default value for radios/checkboxes if (elem.name === 'input' && (elem.attribs.type === 'radio' || elem.attribs.type === 'checkbox') && name === 'value') { return 'on'; } }; var setAttr = function(el, name, value) { if (value === null) { removeAttribute(el, name); } else { el.attribs[name] = value+''; } }; exports.attr = function(name, value) { // Set the value (with attr map support) if (typeof name === 'object' || value !== undefined) { if (typeof value === 'function') { return domEach(this, function(i, el) { setAttr(el, name, value.call(el, i, el.attribs[name])); }); } return domEach(this, function(i, el) { if (!isTag(el)) return; if (typeof name === 'object') { _.forEach(name, function(objValue, objName) { setAttr(el, objName, objValue); }); } else { setAttr(el, name, value); } }); } return getAttr(this[0], name); }; var getProp = function (el, name) { if (!el || !isTag(el)) return; return hasOwn.call(el, name) ? el[name] : rboolean.test(name) ? getAttr(el, name) !== undefined : getAttr(el, name); }; var setProp = function (el, name, value) { el[name] = rboolean.test(name) ? !!value : value; }; exports.prop = function (name, value) { var i = 0, property; if (typeof name === 'string' && value === undefined) { switch (name) { case 'style': property = this.css(); _.forEach(property, function (v, p) { property[i++] = p; }); property.length = i; break; case 'tagName': case 'nodeName': property = this[0].name.toUpperCase(); break; default: property = getProp(this[0], name); } return property; } if (typeof name === 'object' || value !== undefined) { if (typeof value === 'function') { return domEach(this, function(j, el) { setProp(el, name, value.call(el, j, getProp(el, name))); }); } return domEach(this, function(__, el) { if (!isTag(el)) return; if (typeof name === 'object') { _.forEach(name, function(val, key) { setProp(el, key, val); }); } else { setProp(el, name, value); } }); } }; var setData = function(el, name, value) { if (!el.data) { el.data = {}; } if (typeof name === 'object') return _.extend(el.data, name); if (typeof name === 'string' && value !== undefined) { el.data[name] = value; } }; // Read the specified attribute from the equivalent HTML5 `data-*` attribute, // and (if present) cache the value in the node's internal data store. If no // attribute name is specified, read *all* HTML5 `data-*` attributes in this // manner. var readData = function(el, name) { var readAll = arguments.length === 1; var domNames, domName, jsNames, jsName, value, idx, length; if (readAll) { domNames = Object.keys(el.attribs).filter(function(attrName) { return attrName.slice(0, dataAttrPrefix.length) === dataAttrPrefix; }); jsNames = domNames.map(function(_domName) { return camelCase(_domName.slice(dataAttrPrefix.length)); }); } else { domNames = [dataAttrPrefix + cssCase(name)]; jsNames = [name]; } for (idx = 0, length = domNames.length; idx < length; ++idx) { domName = domNames[idx]; jsName = jsNames[idx]; if (hasOwn.call(el.attribs, domName)) { value = el.attribs[domName]; if (hasOwn.call(primitives, value)) { value = primitives[value]; } else if (value === String(Number(value))) { value = Number(value); } else if (rbrace.test(value)) { try { value = JSON.parse(value); } catch(e){ } } el.data[jsName] = value; } } return readAll ? el.data : value; }; exports.data = function(name, value) { var elem = this[0]; if (!elem || !isTag(elem)) return; if (!elem.data) { elem.data = {}; } // Return the entire data object if no data specified if (!name) { return readData(elem); } // Set the value (with attr map support) if (typeof name === 'object' || value !== undefined) { domEach(this, function(i, el) { setData(el, name, value); }); return this; } else if (hasOwn.call(elem.data, name)) { return elem.data[name]; } return readData(elem, name); }; /** * Get the value of an element */ exports.val = function(value) { var querying = arguments.length === 0, element = this[0]; if(!element) return; switch (element.name) { case 'textarea': return this.text(value); case 'input': switch (this.attr('type')) { case 'radio': if (querying) { return this.attr('value'); } else { this.attr('value', value); return this; } break; default: return this.attr('value', value); } return; case 'select': var option = this.find('option:selected'), returnValue; if (option === undefined) return undefined; if (!querying) { if (!hasOwn.call(this.attr(), 'multiple') && typeof value == 'object') { return this; } if (typeof value != 'object') { value = [value]; } this.find('option').removeAttr('selected'); for (var i = 0; i < value.length; i++) { this.find('option[value="' + value[i] + '"]').attr('selected', ''); } return this; } returnValue = option.attr('value'); if (hasOwn.call(this.attr(), 'multiple')) { returnValue = []; domEach(option, function(__, el) { returnValue.push(getAttr(el, 'value')); }); } return returnValue; case 'option': if (!querying) { this.attr('value', value); return this; } return this.attr('value'); } }; /** * Remove an attribute */ var removeAttribute = function(elem, name) { if (!elem.attribs || !hasOwn.call(elem.attribs, name)) return; delete elem.attribs[name]; }; exports.removeAttr = function(name) { domEach(this, function(i, elem) { removeAttribute(elem, name); }); return this; }; exports.hasClass = function(className) { return _.some(this, function(elem) { var attrs = elem.attribs, clazz = attrs && attrs['class'], idx = -1, end; if (clazz && className.length) { while ((idx = clazz.indexOf(className, idx+1)) > -1) { end = idx + className.length; if ((idx === 0 || rspace.test(clazz[idx-1])) && (end === clazz.length || rspace.test(clazz[end]))) { return true; } } } }); }; exports.addClass = function(value) { // Support functions if (typeof value === 'function') { return domEach(this, function(i, el) { var className = el.attribs['class'] || ''; exports.addClass.call([el], value.call(el, i, className)); }); } // Return if no value or not a string or function if (!value || typeof value !== 'string') return this; var classNames = value.split(rspace), numElements = this.length; for (var i = 0; i < numElements; i++) { // If selected element isn't a tag, move on if (!isTag(this[i])) continue; // If we don't already have classes var className = getAttr(this[i], 'class'), numClasses, setClass; if (!className) { setAttr(this[i], 'class', classNames.join(' ').trim()); } else { setClass = ' ' + className + ' '; numClasses = classNames.length; // Check if class already exists for (var j = 0; j < numClasses; j++) { var appendClass = classNames[j] + ' '; if (setClass.indexOf(' ' + appendClass) < 0) setClass += appendClass; } setAttr(this[i], 'class', setClass.trim()); } } return this; }; var splitClass = function(className) { return className ? className.trim().split(rspace) : []; }; exports.removeClass = function(value) { var classes, numClasses, removeAll; // Handle if value is a function if (typeof value === 'function') { return domEach(this, function(i, el) { exports.removeClass.call( [el], value.call(el, i, el.attribs['class'] || '') ); }); } classes = splitClass(value); numClasses = classes.length; removeAll = arguments.length === 0; return domEach(this, function(i, el) { if (!isTag(el)) return; if (removeAll) { // Short circuit the remove all case as this is the nice one el.attribs.class = ''; } else { var elClasses = splitClass(el.attribs.class), index, changed; for (var j = 0; j < numClasses; j++) { index = elClasses.indexOf(classes[j]); if (index >= 0) { elClasses.splice(index, 1); changed = true; // We have to do another pass to ensure that there are not duplicate // classes listed j--; } } if (changed) { el.attribs.class = elClasses.join(' '); } } }); }; exports.toggleClass = function(value, stateVal) { // Support functions if (typeof value === 'function') { return domEach(this, function(i, el) { exports.toggleClass.call( [el], value.call(el, i, el.attribs['class'] || '', stateVal), stateVal ); }); } // Return if no value or not a string or function if (!value || typeof value !== 'string') return this; var classNames = value.split(rspace), numClasses = classNames.length, state = typeof stateVal === 'boolean' ? stateVal ? 1 : -1 : 0, numElements = this.length, elementClasses, index; for (var i = 0; i < numElements; i++) { // If selected element isn't a tag, move on if (!isTag(this[i])) continue; elementClasses = splitClass(this[i].attribs.class); // Check if class already exists for (var j = 0; j < numClasses; j++) { // Check if the class name is currently defined index = elementClasses.indexOf(classNames[j]); // Add if stateValue === true or we are toggling and there is no value if (state >= 0 && index < 0) { elementClasses.push(classNames[j]); } else if (state <= 0 && index >= 0) { // Otherwise remove but only if the item exists elementClasses.splice(index, 1); } } this[i].attribs.class = elementClasses.join(' '); } return this; }; exports.is = function (selector) { if (selector) { return this.filter(selector).length > 0; } return false; }; /***/ }), /* 467 */ /***/ (function(module, exports, __webpack_require__) { /** * Module dependencies */ var serialize = __webpack_require__(405), defaultOptions = __webpack_require__(363).default, flattenOptions = __webpack_require__(363).flatten, select = __webpack_require__(468), parse = __webpack_require__(281), _ = { merge: __webpack_require__(498), defaults: __webpack_require__(465) }; /** * $.load(str) */ exports.load = function(content, options, isDocument) { var Cheerio = __webpack_require__(280); options = _.defaults(flattenOptions(options || {}), defaultOptions); if (isDocument === void 0) isDocument = true; var root = parse(content, options, isDocument); var initialize = function(selector, context, r, opts) { if (!(this instanceof initialize)) { return new initialize(selector, context, r, opts); } opts = _.defaults(opts || {}, options); return Cheerio.call(this, selector, context, r || root, opts); }; // Ensure that selections created by the "loaded" `initialize` function are // true Cheerio instances. initialize.prototype = Object.create(Cheerio.prototype); initialize.prototype.constructor = initialize; // Mimic jQuery's prototype alias for plugin authors. initialize.fn = initialize.prototype; // Keep a reference to the top-level scope so we can chain methods that implicitly // resolve selectors; e.g. $("<span>").(".bar"), which otherwise loses ._root initialize.prototype._originalRoot = root; // Add in the static methods _.merge(initialize, exports); // Add in the root initialize._root = root; // store options initialize._options = options; return initialize; }; /* * Helper function */ function render(that, dom, options) { if (!dom) { if (that._root && that._root.children) { dom = that._root.children; } else { return ''; } } else if (typeof dom === 'string') { dom = select(dom, that._root, options); } return serialize(dom, options); } /** * $.html([selector | dom], [options]) */ exports.html = function(dom, options) { // be flexible about parameters, sometimes we call html(), // with options as only parameter // check dom argument for dom element specific properties // assume there is no 'length' or 'type' properties in the options object if (Object.prototype.toString.call(dom) === '[object Object]' && !options && !('length' in dom) && !('type' in dom)) { options = dom; dom = undefined; } // sometimes $.html() used without preloading html // so fallback non existing options to the default ones options = _.defaults(flattenOptions(options || {}), this._options, defaultOptions); return render(this, dom, options); }; /** * $.xml([selector | dom]) */ exports.xml = function(dom) { var options = _.defaults({xml: true}, this._options); return render(this, dom, options); }; /** * $.text(dom) */ exports.text = function(elems) { if (!elems) { elems = this.root(); } var ret = '', len = elems.length, elem; for (var i = 0; i < len; i++) { elem = elems[i]; if (elem.type === 'text') ret += elem.data; else if (elem.children && elem.type !== 'comment' && elem.tagName !== 'script' && elem.tagName !== 'style') { ret += exports.text(elem.children); } } return ret; }; /** * $.parseHTML(data [, context ] [, keepScripts ]) * Parses a string into an array of DOM nodes. The `context` argument has no * meaning for Cheerio, but it is maintained for API compatibility with jQuery. */ exports.parseHTML = function(data, context, keepScripts) { var parsed; if (!data || typeof data !== 'string') { return null; } if (typeof context === 'boolean') { keepScripts = context; } parsed = this.load(data, defaultOptions, false); if (!keepScripts) { parsed('script').remove(); } // The `children` array is used by Cheerio internally to group elements that // share the same parents. When nodes created through `parseHTML` are // inserted into previously-existing DOM structures, they will be removed // from the `children` array. The results of `parseHTML` should remain // constant across these operations, so a shallow copy should be returned. return parsed.root()[0].children.slice(); }; /** * $.root() */ exports.root = function() { return this(this._root); }; /** * $.contains() */ exports.contains = function(container, contained) { // According to the jQuery API, an element does not "contain" itself if (contained === container) { return false; } // Step up the descendants, stopping when the root element is reached // (signaled by `.parent` returning a reference to the same object) while (contained && contained !== contained.parent) { contained = contained.parent; if (contained === container) { return true; } } return false; }; /** * $.merge() */ exports.merge = function(arr1, arr2) { if(!(isArrayLike(arr1) && isArrayLike(arr2))){ return; } var newLength = arr1.length + arr2.length; var i = 0; while(i < arr2.length){ arr1[i + arr1.length] = arr2[i]; i++; } arr1.length = newLength; return arr1; }; function isArrayLike(item){ if(Array.isArray(item)){ return true; } if(typeof item !== 'object'){ return false; } if(!item.hasOwnProperty('length')){ return false; } if(typeof item.length !== 'number') { return false; } if(item.length < 0){ return false; } var i = 0; while(i < item.length){ if(!(i in item)){ return false; } i++; } return true; } /***/ }), /* 468 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = CSSselect; var Pseudos = __webpack_require__(469), DomUtils = __webpack_require__(470), findOne = DomUtils.findOne, findAll = DomUtils.findAll, getChildren = DomUtils.getChildren, removeSubsets = DomUtils.removeSubsets, falseFunc = __webpack_require__(491).falseFunc, compile = __webpack_require__(493), compileUnsafe = compile.compileUnsafe, compileToken = compile.compileToken; function getSelectorFunc(searchFunc){ return function select(query, elems, options){ if(typeof query !== "function") query = compileUnsafe(query, options, elems); if(!Array.isArray(elems)) elems = getChildren(elems); else elems = removeSubsets(elems); return searchFunc(query, elems); }; } var selectAll = getSelectorFunc(function selectAll(query, elems){ return (query === falseFunc || !elems || elems.length === 0) ? [] : findAll(query, elems); }); var selectOne = getSelectorFunc(function selectOne(query, elems){ return (query === falseFunc || !elems || elems.length === 0) ? null : findOne(query, elems); }); function is(elem, query, options){ return (typeof query === "function" ? query : compile(query, options))(elem); } /* the exported interface */ function CSSselect(query, elems, options){ return selectAll(query, elems, options); } CSSselect.compile = compile; CSSselect.filters = Pseudos.filters; CSSselect.pseudos = Pseudos.pseudos; CSSselect.selectAll = selectAll; CSSselect.selectOne = selectOne; CSSselect.is = is; //legacy methods (might be removed) CSSselect.parse = compile; CSSselect.iterate = selectAll; //hooks CSSselect._compileUnsafe = compileUnsafe; CSSselect._compileToken = compileToken; /***/ }), /* 469 */ /***/ (function(module, exports, __webpack_require__) { /* pseudo selectors --- they are available in two forms: * filters called when the selector is compiled and return a function that needs to return next() * pseudos get called on execution they need to return a boolean */ var DomUtils = __webpack_require__(470), isTag = DomUtils.isTag, getText = DomUtils.getText, getParent = DomUtils.getParent, getChildren = DomUtils.getChildren, getSiblings = DomUtils.getSiblings, hasAttrib = DomUtils.hasAttrib, getName = DomUtils.getName, getAttribute= DomUtils.getAttributeValue, getNCheck = __webpack_require__(488), checkAttrib = __webpack_require__(492).rules.equals, BaseFuncs = __webpack_require__(491), trueFunc = BaseFuncs.trueFunc, falseFunc = BaseFuncs.falseFunc; //helper methods function getFirstElement(elems){ for(var i = 0; elems && i < elems.length; i++){ if(isTag(elems[i])) return elems[i]; } } function getAttribFunc(name, value){ var data = {name: name, value: value}; return function attribFunc(next){ return checkAttrib(next, data); }; } function getChildFunc(next){ return function(elem){ return !!getParent(elem) && next(elem); }; } var filters = { contains: function(next, text){ return function contains(elem){ return next(elem) && getText(elem).indexOf(text) >= 0; }; }, icontains: function(next, text){ var itext = text.toLowerCase(); return function icontains(elem){ return next(elem) && getText(elem).toLowerCase().indexOf(itext) >= 0; }; }, //location specific methods "nth-child": function(next, rule){ var func = getNCheck(rule); if(func === falseFunc) return func; if(func === trueFunc) return getChildFunc(next); return function nthChild(elem){ var siblings = getSiblings(elem); for(var i = 0, pos = 0; i < siblings.length; i++){ if(isTag(siblings[i])){ if(siblings[i] === elem) break; else pos++; } } return func(pos) && next(elem); }; }, "nth-last-child": function(next, rule){ var func = getNCheck(rule); if(func === falseFunc) return func; if(func === trueFunc) return getChildFunc(next); return function nthLastChild(elem){ var siblings = getSiblings(elem); for(var pos = 0, i = siblings.length - 1; i >= 0; i--){ if(isTag(siblings[i])){ if(siblings[i] === elem) break; else pos++; } } return func(pos) && next(elem); }; }, "nth-of-type": function(next, rule){ var func = getNCheck(rule); if(func === falseFunc) return func; if(func === trueFunc) return getChildFunc(next); return function nthOfType(elem){ var siblings = getSiblings(elem); for(var pos = 0, i = 0; i < siblings.length; i++){ if(isTag(siblings[i])){ if(siblings[i] === elem) break; if(getName(siblings[i]) === getName(elem)) pos++; } } return func(pos) && next(elem); }; }, "nth-last-of-type": function(next, rule){ var func = getNCheck(rule); if(func === falseFunc) return func; if(func === trueFunc) return getChildFunc(next); return function nthLastOfType(elem){ var siblings = getSiblings(elem); for(var pos = 0, i = siblings.length - 1; i >= 0; i--){ if(isTag(siblings[i])){ if(siblings[i] === elem) break; if(getName(siblings[i]) === getName(elem)) pos++; } } return func(pos) && next(elem); }; }, //TODO determine the actual root element root: function(next){ return function(elem){ return !getParent(elem) && next(elem); }; }, scope: function(next, rule, options, context){ if(!context || context.length === 0){ //equivalent to :root return filters.root(next); } if(context.length === 1){ //NOTE: can't be unpacked, as :has uses this for side-effects return function(elem){ return context[0] === elem && next(elem); }; } return function(elem){ return context.indexOf(elem) >= 0 && next(elem); }; }, //jQuery extensions (others follow as pseudos) checkbox: getAttribFunc("type", "checkbox"), file: getAttribFunc("type", "file"), password: getAttribFunc("type", "password"), radio: getAttribFunc("type", "radio"), reset: getAttribFunc("type", "reset"), image: getAttribFunc("type", "image"), submit: getAttribFunc("type", "submit") }; //while filters are precompiled, pseudos get called when they are needed var pseudos = { empty: function(elem){ return !getChildren(elem).some(function(elem){ return isTag(elem) || elem.type === "text"; }); }, "first-child": function(elem){ return getFirstElement(getSiblings(elem)) === elem; }, "last-child": function(elem){ var siblings = getSiblings(elem); for(var i = siblings.length - 1; i >= 0; i--){ if(siblings[i] === elem) return true; if(isTag(siblings[i])) break; } return false; }, "first-of-type": function(elem){ var siblings = getSiblings(elem); for(var i = 0; i < siblings.length; i++){ if(isTag(siblings[i])){ if(siblings[i] === elem) return true; if(getName(siblings[i]) === getName(elem)) break; } } return false; }, "last-of-type": function(elem){ var siblings = getSiblings(elem); for(var i = siblings.length-1; i >= 0; i--){ if(isTag(siblings[i])){ if(siblings[i] === elem) return true; if(getName(siblings[i]) === getName(elem)) break; } } return false; }, "only-of-type": function(elem){ var siblings = getSiblings(elem); for(var i = 0, j = siblings.length; i < j; i++){ if(isTag(siblings[i])){ if(siblings[i] === elem) continue; if(getName(siblings[i]) === getName(elem)) return false; } } return true; }, "only-child": function(elem){ var siblings = getSiblings(elem); for(var i = 0; i < siblings.length; i++){ if(isTag(siblings[i]) && siblings[i] !== elem) return false; } return true; }, //:matches(a, area, link)[href] link: function(elem){ return hasAttrib(elem, "href"); }, visited: falseFunc, //seems to be a valid implementation //TODO: :any-link once the name is finalized (as an alias of :link) //forms //to consider: :target //:matches([selected], select:not([multiple]):not(> option[selected]) > option:first-of-type) selected: function(elem){ if(hasAttrib(elem, "selected")) return true; else if(getName(elem) !== "option") return false; //the first <option> in a <select> is also selected var parent = getParent(elem); if( !parent || getName(parent) !== "select" || hasAttrib(parent, "multiple") ) return false; var siblings = getChildren(parent), sawElem = false; for(var i = 0; i < siblings.length; i++){ if(isTag(siblings[i])){ if(siblings[i] === elem){ sawElem = true; } else if(!sawElem){ return false; } else if(hasAttrib(siblings[i], "selected")){ return false; } } } return sawElem; }, //https://html.spec.whatwg.org/multipage/scripting.html#disabled-elements //:matches( // :matches(button, input, select, textarea, menuitem, optgroup, option)[disabled], // optgroup[disabled] > option), // fieldset[disabled] * //TODO not child of first <legend> //) disabled: function(elem){ return hasAttrib(elem, "disabled"); }, enabled: function(elem){ return !hasAttrib(elem, "disabled"); }, //:matches(:matches(:radio, :checkbox)[checked], :selected) (TODO menuitem) checked: function(elem){ return hasAttrib(elem, "checked") || pseudos.selected(elem); }, //:matches(input, select, textarea)[required] required: function(elem){ return hasAttrib(elem, "required"); }, //:matches(input, select, textarea):not([required]) optional: function(elem){ return !hasAttrib(elem, "required"); }, //jQuery extensions //:not(:empty) parent: function(elem){ return !pseudos.empty(elem); }, //:matches(h1, h2, h3, h4, h5, h6) header: function(elem){ var name = getName(elem); return name === "h1" || name === "h2" || name === "h3" || name === "h4" || name === "h5" || name === "h6"; }, //:matches(button, input[type=button]) button: function(elem){ var name = getName(elem); return name === "button" || name === "input" && getAttribute(elem, "type") === "button"; }, //:matches(input, textarea, select, button) input: function(elem){ var name = getName(elem); return name === "input" || name === "textarea" || name === "select" || name === "button"; }, //input:matches(:not([type!='']), [type='text' i]) text: function(elem){ var attr; return getName(elem) === "input" && ( !(attr = getAttribute(elem, "type")) || attr.toLowerCase() === "text" ); } }; function verifyArgs(func, name, subselect){ if(subselect === null){ if(func.length > 1 && name !== "scope"){ throw new SyntaxError("pseudo-selector :" + name + " requires an argument"); } } else { if(func.length === 1){ throw new SyntaxError("pseudo-selector :" + name + " doesn't have any arguments"); } } } //FIXME this feels hacky var re_CSS3 = /^(?:(?:nth|last|first|only)-(?:child|of-type)|root|empty|(?:en|dis)abled|checked|not)$/; module.exports = { compile: function(next, data, options, context){ var name = data.name, subselect = data.data; if(options && options.strict && !re_CSS3.test(name)){ throw SyntaxError(":" + name + " isn't part of CSS3"); } if(typeof filters[name] === "function"){ verifyArgs(filters[name], name, subselect); return filters[name](next, subselect, options, context); } else if(typeof pseudos[name] === "function"){ var func = pseudos[name]; verifyArgs(func, name, subselect); if(next === trueFunc) return func; return function pseudoArgs(elem){ return func(elem, subselect) && next(elem); }; } else { throw new SyntaxError("unmatched pseudo-class :" + name); } }, filters: filters, pseudos: pseudos }; /***/ }), /* 470 */ /***/ (function(module, exports, __webpack_require__) { var DomUtils = module.exports; [ __webpack_require__(471), __webpack_require__(483), __webpack_require__(484), __webpack_require__(485), __webpack_require__(486), __webpack_require__(487) ].forEach(function(ext){ Object.keys(ext).forEach(function(key){ DomUtils[key] = ext[key].bind(DomUtils); }); }); /***/ }), /* 471 */ /***/ (function(module, exports, __webpack_require__) { var ElementType = __webpack_require__(293), getOuterHTML = __webpack_require__(472), isTag = ElementType.isTag; module.exports = { getInnerHTML: getInnerHTML, getOuterHTML: getOuterHTML, getText: getText }; function getInnerHTML(elem, opts){ return elem.children ? elem.children.map(function(elem){ return getOuterHTML(elem, opts); }).join("") : ""; } function getText(elem){ if(Array.isArray(elem)) return elem.map(getText).join(""); if(isTag(elem) || elem.type === ElementType.CDATA) return getText(elem.children); if(elem.type === ElementType.Text) return elem.data; return ""; } /***/ }), /* 472 */ /***/ (function(module, exports, __webpack_require__) { /* Module dependencies */ var ElementType = __webpack_require__(473); var entities = __webpack_require__(474); /* mixed-case SVG and MathML tags & attributes recognized by the HTML parser, see https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign */ var foreignNames = __webpack_require__(482); foreignNames.elementNames.__proto__ = null; /* use as a simple dictionary */ foreignNames.attributeNames.__proto__ = null; var unencodedElements = { __proto__: null, style: true, script: true, xmp: true, iframe: true, noembed: true, noframes: true, plaintext: true, noscript: true }; /* Format attributes */ function formatAttrs(attributes, opts) { if (!attributes) return; var output = ''; var value; // Loop through the attributes for (var key in attributes) { value = attributes[key]; if (output) { output += ' '; } if (opts.xmlMode === 'foreign') { /* fix up mixed-case attribute names */ key = foreignNames.attributeNames[key] || key; } output += key; if ((value !== null && value !== '') || opts.xmlMode) { output += '="' + (opts.decodeEntities ? entities.encodeXML(value) : value.replace(/\"/g, '"')) + '"'; } } return output; } /* Self-enclosing tags (stolen from node-htmlparser) */ var singleTag = { __proto__: null, area: true, base: true, basefont: true, br: true, col: true, command: true, embed: true, frame: true, hr: true, img: true, input: true, isindex: true, keygen: true, link: true, meta: true, param: true, source: true, track: true, wbr: true }; var render = (module.exports = function(dom, opts) { if (!Array.isArray(dom) && !dom.cheerio) dom = [dom]; opts = opts || {}; var output = ''; for (var i = 0; i < dom.length; i++) { var elem = dom[i]; if (elem.type === 'root') output += render(elem.children, opts); else if (ElementType.isTag(elem)) output += renderTag(elem, opts); else if (elem.type === ElementType.Directive) output += renderDirective(elem); else if (elem.type === ElementType.Comment) output += renderComment(elem); else if (elem.type === ElementType.CDATA) output += renderCdata(elem); else output += renderText(elem, opts); } return output; }); const foreignModeIntegrationPoints = [ 'mi', 'mo', 'mn', 'ms', 'mtext', 'annotation-xml', 'foreignObject', 'desc', 'title' ]; function renderTag(elem, opts) { // Handle SVG / MathML in HTML if (opts.xmlMode === 'foreign') { /* fix up mixed-case element names */ elem.name = foreignNames.elementNames[elem.name] || elem.name; /* exit foreign mode at integration points */ if ( elem.parent && foreignModeIntegrationPoints.indexOf(elem.parent.name) >= 0 ) opts = Object.assign({}, opts, { xmlMode: false }); } if (!opts.xmlMode && ['svg', 'math'].indexOf(elem.name) >= 0) { opts = Object.assign({}, opts, { xmlMode: 'foreign' }); } var tag = '<' + elem.name; var attribs = formatAttrs(elem.attribs, opts); if (attribs) { tag += ' ' + attribs; } if (opts.xmlMode && (!elem.children || elem.children.length === 0)) { tag += '/>'; } else { tag += '>'; if (elem.children) { tag += render(elem.children, opts); } if (!singleTag[elem.name] || opts.xmlMode) { tag += '</' + elem.name + '>'; } } return tag; } function renderDirective(elem) { return '<' + elem.data + '>'; } function renderText(elem, opts) { var data = elem.data || ''; // if entities weren't decoded, no need to encode them back if ( opts.decodeEntities && !(elem.parent && elem.parent.name in unencodedElements) ) { data = entities.encodeXML(data); } return data; } function renderCdata(elem) { return '<![CDATA[' + elem.children[0].data + ']]>'; } function renderComment(elem) { return '<!--' + elem.data + '-->'; } /***/ }), /* 473 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Tests whether an element is a tag or not. * * @param elem Element to test */ function isTag(elem) { return (elem.type === "tag" /* Tag */ || elem.type === "script" /* Script */ || elem.type === "style" /* Style */); } exports.isTag = isTag; // Exports for backwards compatibility exports.Text = "text" /* Text */; //Text exports.Directive = "directive" /* Directive */; //<? ... ?> exports.Comment = "comment" /* Comment */; //<!-- ... --> exports.Script = "script" /* Script */; //<script> tags exports.Style = "style" /* Style */; //<style> tags exports.Tag = "tag" /* Tag */; //Any tag exports.CDATA = "cdata" /* CDATA */; //<![CDATA[ ... ]]> exports.Doctype = "doctype" /* Doctype */; /***/ }), /* 474 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var decode_1 = __webpack_require__(475); var encode_1 = __webpack_require__(481); function decode(data, level) { return (!level || level <= 0 ? decode_1.decodeXML : decode_1.decodeHTML)(data); } exports.decode = decode; function decodeStrict(data, level) { return (!level || level <= 0 ? decode_1.decodeXML : decode_1.decodeHTMLStrict)(data); } exports.decodeStrict = decodeStrict; function encode(data, level) { return (!level || level <= 0 ? encode_1.encodeXML : encode_1.encodeHTML)(data); } exports.encode = encode; var encode_2 = __webpack_require__(481); exports.encodeXML = encode_2.encodeXML; exports.encodeHTML = encode_2.encodeHTML; exports.escape = encode_2.escape; // Legacy aliases exports.encodeHTML4 = encode_2.encodeHTML; exports.encodeHTML5 = encode_2.encodeHTML; var decode_2 = __webpack_require__(475); exports.decodeXML = decode_2.decodeXML; exports.decodeHTML = decode_2.decodeHTML; exports.decodeHTMLStrict = decode_2.decodeHTMLStrict; // Legacy aliases exports.decodeHTML4 = decode_2.decodeHTML; exports.decodeHTML5 = decode_2.decodeHTML; exports.decodeHTML4Strict = decode_2.decodeHTMLStrict; exports.decodeHTML5Strict = decode_2.decodeHTMLStrict; exports.decodeXMLStrict = decode_2.decodeXML; /***/ }), /* 475 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var entities_json_1 = __importDefault(__webpack_require__(476)); var legacy_json_1 = __importDefault(__webpack_require__(477)); var xml_json_1 = __importDefault(__webpack_require__(478)); var decode_codepoint_1 = __importDefault(__webpack_require__(479)); exports.decodeXML = getStrictDecoder(xml_json_1.default); exports.decodeHTMLStrict = getStrictDecoder(entities_json_1.default); function getStrictDecoder(map) { var keys = Object.keys(map).join("|"); var replace = getReplacer(map); keys += "|#[xX][\\da-fA-F]+|#\\d+"; var re = new RegExp("&(?:" + keys + ");", "g"); return function (str) { return String(str).replace(re, replace); }; } var sorter = function (a, b) { return (a < b ? 1 : -1); }; exports.decodeHTML = (function () { var legacy = Object.keys(legacy_json_1.default).sort(sorter); var keys = Object.keys(entities_json_1.default).sort(sorter); for (var i = 0, j = 0; i < keys.length; i++) { if (legacy[j] === keys[i]) { keys[i] += ";?"; j++; } else { keys[i] += ";"; } } var re = new RegExp("&(?:" + keys.join("|") + "|#[xX][\\da-fA-F]+;?|#\\d+;?)", "g"); var replace = getReplacer(entities_json_1.default); function replacer(str) { if (str.substr(-1) !== ";") str += ";"; return replace(str); } //TODO consider creating a merged map return function (str) { return String(str).replace(re, replacer); }; })(); function getReplacer(map) { return function replace(str) { if (str.charAt(1) === "#") { if (str.charAt(2) === "X" || str.charAt(2) === "x") { return decode_codepoint_1.default(parseInt(str.substr(3), 16)); } return decode_codepoint_1.default(parseInt(str.substr(2), 10)); } return map[str.slice(1, -1)]; }; } /***/ }), /* 476 */ /***/ (function(module) { module.exports = JSON.parse("{\"Aacute\":\"Á\",\"aacute\":\"á\",\"Abreve\":\"Ă\",\"abreve\":\"ă\",\"ac\":\"∾\",\"acd\":\"∿\",\"acE\":\"∾̳\",\"Acirc\":\"Â\",\"acirc\":\"â\",\"acute\":\"´\",\"Acy\":\"А\",\"acy\":\"а\",\"AElig\":\"Æ\",\"aelig\":\"æ\",\"af\":\"\",\"Afr\":\"𝔄\",\"afr\":\"𝔞\",\"Agrave\":\"À\",\"agrave\":\"à\",\"alefsym\":\"ℵ\",\"aleph\":\"ℵ\",\"Alpha\":\"Α\",\"alpha\":\"α\",\"Amacr\":\"Ā\",\"amacr\":\"ā\",\"amalg\":\"⨿\",\"amp\":\"&\",\"AMP\":\"&\",\"andand\":\"⩕\",\"And\":\"⩓\",\"and\":\"∧\",\"andd\":\"⩜\",\"andslope\":\"⩘\",\"andv\":\"⩚\",\"ang\":\"∠\",\"ange\":\"⦤\",\"angle\":\"∠\",\"angmsdaa\":\"⦨\",\"angmsdab\":\"⦩\",\"angmsdac\":\"⦪\",\"angmsdad\":\"⦫\",\"angmsdae\":\"⦬\",\"angmsdaf\":\"⦭\",\"angmsdag\":\"⦮\",\"angmsdah\":\"⦯\",\"angmsd\":\"∡\",\"angrt\":\"∟\",\"angrtvb\":\"⊾\",\"angrtvbd\":\"⦝\",\"angsph\":\"∢\",\"angst\":\"Å\",\"angzarr\":\"⍼\",\"Aogon\":\"Ą\",\"aogon\":\"ą\",\"Aopf\":\"𝔸\",\"aopf\":\"𝕒\",\"apacir\":\"⩯\",\"ap\":\"≈\",\"apE\":\"⩰\",\"ape\":\"≊\",\"apid\":\"≋\",\"apos\":\"'\",\"ApplyFunction\":\"\",\"approx\":\"≈\",\"approxeq\":\"≊\",\"Aring\":\"Å\",\"aring\":\"å\",\"Ascr\":\"𝒜\",\"ascr\":\"𝒶\",\"Assign\":\"≔\",\"ast\":\"*\",\"asymp\":\"≈\",\"asympeq\":\"≍\",\"Atilde\":\"Ã\",\"atilde\":\"ã\",\"Auml\":\"Ä\",\"auml\":\"ä\",\"awconint\":\"∳\",\"awint\":\"⨑\",\"backcong\":\"≌\",\"backepsilon\":\"϶\",\"backprime\":\"‵\",\"backsim\":\"∽\",\"backsimeq\":\"⋍\",\"Backslash\":\"∖\",\"Barv\":\"⫧\",\"barvee\":\"⊽\",\"barwed\":\"⌅\",\"Barwed\":\"⌆\",\"barwedge\":\"⌅\",\"bbrk\":\"⎵\",\"bbrktbrk\":\"⎶\",\"bcong\":\"≌\",\"Bcy\":\"Б\",\"bcy\":\"б\",\"bdquo\":\"„\",\"becaus\":\"∵\",\"because\":\"∵\",\"Because\":\"∵\",\"bemptyv\":\"⦰\",\"bepsi\":\"϶\",\"bernou\":\"ℬ\",\"Bernoullis\":\"ℬ\",\"Beta\":\"Β\",\"beta\":\"β\",\"beth\":\"ℶ\",\"between\":\"≬\",\"Bfr\":\"𝔅\",\"bfr\":\"𝔟\",\"bigcap\":\"⋂\",\"bigcirc\":\"◯\",\"bigcup\":\"⋃\",\"bigodot\":\"⨀\",\"bigoplus\":\"⨁\",\"bigotimes\":\"⨂\",\"bigsqcup\":\"⨆\",\"bigstar\":\"★\",\"bigtriangledown\":\"▽\",\"bigtriangleup\":\"△\",\"biguplus\":\"⨄\",\"bigvee\":\"⋁\",\"bigwedge\":\"⋀\",\"bkarow\":\"⤍\",\"blacklozenge\":\"⧫\",\"blacksquare\":\"▪\",\"blacktriangle\":\"▴\",\"blacktriangledown\":\"▾\",\"blacktriangleleft\":\"◂\",\"blacktriangleright\":\"▸\",\"blank\":\"␣\",\"blk12\":\"▒\",\"blk14\":\"░\",\"blk34\":\"▓\",\"block\":\"█\",\"bne\":\"=⃥\",\"bnequiv\":\"≡⃥\",\"bNot\":\"⫭\",\"bnot\":\"⌐\",\"Bopf\":\"𝔹\",\"bopf\":\"𝕓\",\"bot\":\"⊥\",\"bottom\":\"⊥\",\"bowtie\":\"⋈\",\"boxbox\":\"⧉\",\"boxdl\":\"┐\",\"boxdL\":\"╕\",\"boxDl\":\"╖\",\"boxDL\":\"╗\",\"boxdr\":\"┌\",\"boxdR\":\"╒\",\"boxDr\":\"╓\",\"boxDR\":\"╔\",\"boxh\":\"─\",\"boxH\":\"═\",\"boxhd\":\"┬\",\"boxHd\":\"╤\",\"boxhD\":\"╥\",\"boxHD\":\"╦\",\"boxhu\":\"┴\",\"boxHu\":\"╧\",\"boxhU\":\"╨\",\"boxHU\":\"╩\",\"boxminus\":\"⊟\",\"boxplus\":\"⊞\",\"boxtimes\":\"⊠\",\"boxul\":\"┘\",\"boxuL\":\"╛\",\"boxUl\":\"╜\",\"boxUL\":\"╝\",\"boxur\":\"└\",\"boxuR\":\"╘\",\"boxUr\":\"╙\",\"boxUR\":\"╚\",\"boxv\":\"│\",\"boxV\":\"║\",\"boxvh\":\"┼\",\"boxvH\":\"╪\",\"boxVh\":\"╫\",\"boxVH\":\"╬\",\"boxvl\":\"┤\",\"boxvL\":\"╡\",\"boxVl\":\"╢\",\"boxVL\":\"╣\",\"boxvr\":\"├\",\"boxvR\":\"╞\",\"boxVr\":\"╟\",\"boxVR\":\"╠\",\"bprime\":\"‵\",\"breve\":\"˘\",\"Breve\":\"˘\",\"brvbar\":\"¦\",\"bscr\":\"𝒷\",\"Bscr\":\"ℬ\",\"bsemi\":\"⁏\",\"bsim\":\"∽\",\"bsime\":\"⋍\",\"bsolb\":\"⧅\",\"bsol\":\"\\\\\",\"bsolhsub\":\"⟈\",\"bull\":\"•\",\"bullet\":\"•\",\"bump\":\"≎\",\"bumpE\":\"⪮\",\"bumpe\":\"≏\",\"Bumpeq\":\"≎\",\"bumpeq\":\"≏\",\"Cacute\":\"Ć\",\"cacute\":\"ć\",\"capand\":\"⩄\",\"capbrcup\":\"⩉\",\"capcap\":\"⩋\",\"cap\":\"∩\",\"Cap\":\"⋒\",\"capcup\":\"⩇\",\"capdot\":\"⩀\",\"CapitalDifferentialD\":\"ⅅ\",\"caps\":\"∩︀\",\"caret\":\"⁁\",\"caron\":\"ˇ\",\"Cayleys\":\"ℭ\",\"ccaps\":\"⩍\",\"Ccaron\":\"Č\",\"ccaron\":\"č\",\"Ccedil\":\"Ç\",\"ccedil\":\"ç\",\"Ccirc\":\"Ĉ\",\"ccirc\":\"ĉ\",\"Cconint\":\"∰\",\"ccups\":\"⩌\",\"ccupssm\":\"⩐\",\"Cdot\":\"Ċ\",\"cdot\":\"ċ\",\"cedil\":\"¸\",\"Cedilla\":\"¸\",\"cemptyv\":\"⦲\",\"cent\":\"¢\",\"centerdot\":\"·\",\"CenterDot\":\"·\",\"cfr\":\"𝔠\",\"Cfr\":\"ℭ\",\"CHcy\":\"Ч\",\"chcy\":\"ч\",\"check\":\"✓\",\"checkmark\":\"✓\",\"Chi\":\"Χ\",\"chi\":\"χ\",\"circ\":\"ˆ\",\"circeq\":\"≗\",\"circlearrowleft\":\"↺\",\"circlearrowright\":\"↻\",\"circledast\":\"⊛\",\"circledcirc\":\"⊚\",\"circleddash\":\"⊝\",\"CircleDot\":\"⊙\",\"circledR\":\"®\",\"circledS\":\"Ⓢ\",\"CircleMinus\":\"⊖\",\"CirclePlus\":\"⊕\",\"CircleTimes\":\"⊗\",\"cir\":\"○\",\"cirE\":\"⧃\",\"cire\":\"≗\",\"cirfnint\":\"⨐\",\"cirmid\":\"⫯\",\"cirscir\":\"⧂\",\"ClockwiseContourIntegral\":\"∲\",\"CloseCurlyDoubleQuote\":\"”\",\"CloseCurlyQuote\":\"’\",\"clubs\":\"♣\",\"clubsuit\":\"♣\",\"colon\":\":\",\"Colon\":\"∷\",\"Colone\":\"⩴\",\"colone\":\"≔\",\"coloneq\":\"≔\",\"comma\":\",\",\"commat\":\"@\",\"comp\":\"∁\",\"compfn\":\"∘\",\"complement\":\"∁\",\"complexes\":\"ℂ\",\"cong\":\"≅\",\"congdot\":\"⩭\",\"Congruent\":\"≡\",\"conint\":\"∮\",\"Conint\":\"∯\",\"ContourIntegral\":\"∮\",\"copf\":\"𝕔\",\"Copf\":\"ℂ\",\"coprod\":\"∐\",\"Coproduct\":\"∐\",\"copy\":\"©\",\"COPY\":\"©\",\"copysr\":\"℗\",\"CounterClockwiseContourIntegral\":\"∳\",\"crarr\":\"↵\",\"cross\":\"✗\",\"Cross\":\"⨯\",\"Cscr\":\"𝒞\",\"cscr\":\"𝒸\",\"csub\":\"⫏\",\"csube\":\"⫑\",\"csup\":\"⫐\",\"csupe\":\"⫒\",\"ctdot\":\"⋯\",\"cudarrl\":\"⤸\",\"cudarrr\":\"⤵\",\"cuepr\":\"⋞\",\"cuesc\":\"⋟\",\"cularr\":\"↶\",\"cularrp\":\"⤽\",\"cupbrcap\":\"⩈\",\"cupcap\":\"⩆\",\"CupCap\":\"≍\",\"cup\":\"∪\",\"Cup\":\"⋓\",\"cupcup\":\"⩊\",\"cupdot\":\"⊍\",\"cupor\":\"⩅\",\"cups\":\"∪︀\",\"curarr\":\"↷\",\"curarrm\":\"⤼\",\"curlyeqprec\":\"⋞\",\"curlyeqsucc\":\"⋟\",\"curlyvee\":\"⋎\",\"curlywedge\":\"⋏\",\"curren\":\"¤\",\"curvearrowleft\":\"↶\",\"curvearrowright\":\"↷\",\"cuvee\":\"⋎\",\"cuwed\":\"⋏\",\"cwconint\":\"∲\",\"cwint\":\"∱\",\"cylcty\":\"⌭\",\"dagger\":\"†\",\"Dagger\":\"‡\",\"daleth\":\"ℸ\",\"darr\":\"↓\",\"Darr\":\"↡\",\"dArr\":\"⇓\",\"dash\":\"‐\",\"Dashv\":\"⫤\",\"dashv\":\"⊣\",\"dbkarow\":\"⤏\",\"dblac\":\"˝\",\"Dcaron\":\"Ď\",\"dcaron\":\"ď\",\"Dcy\":\"Д\",\"dcy\":\"д\",\"ddagger\":\"‡\",\"ddarr\":\"⇊\",\"DD\":\"ⅅ\",\"dd\":\"ⅆ\",\"DDotrahd\":\"⤑\",\"ddotseq\":\"⩷\",\"deg\":\"°\",\"Del\":\"∇\",\"Delta\":\"Δ\",\"delta\":\"δ\",\"demptyv\":\"⦱\",\"dfisht\":\"⥿\",\"Dfr\":\"𝔇\",\"dfr\":\"𝔡\",\"dHar\":\"⥥\",\"dharl\":\"⇃\",\"dharr\":\"⇂\",\"DiacriticalAcute\":\"´\",\"DiacriticalDot\":\"˙\",\"DiacriticalDoubleAcute\":\"˝\",\"DiacriticalGrave\":\"`\",\"DiacriticalTilde\":\"˜\",\"diam\":\"⋄\",\"diamond\":\"⋄\",\"Diamond\":\"⋄\",\"diamondsuit\":\"♦\",\"diams\":\"♦\",\"die\":\"¨\",\"DifferentialD\":\"ⅆ\",\"digamma\":\"ϝ\",\"disin\":\"⋲\",\"div\":\"÷\",\"divide\":\"÷\",\"divideontimes\":\"⋇\",\"divonx\":\"⋇\",\"DJcy\":\"Ђ\",\"djcy\":\"ђ\",\"dlcorn\":\"⌞\",\"dlcrop\":\"⌍\",\"dollar\":\"$\",\"Dopf\":\"𝔻\",\"dopf\":\"𝕕\",\"Dot\":\"¨\",\"dot\":\"˙\",\"DotDot\":\"⃜\",\"doteq\":\"≐\",\"doteqdot\":\"≑\",\"DotEqual\":\"≐\",\"dotminus\":\"∸\",\"dotplus\":\"∔\",\"dotsquare\":\"⊡\",\"doublebarwedge\":\"⌆\",\"DoubleContourIntegral\":\"∯\",\"DoubleDot\":\"¨\",\"DoubleDownArrow\":\"⇓\",\"DoubleLeftArrow\":\"⇐\",\"DoubleLeftRightArrow\":\"⇔\",\"DoubleLeftTee\":\"⫤\",\"DoubleLongLeftArrow\":\"⟸\",\"DoubleLongLeftRightArrow\":\"⟺\",\"DoubleLongRightArrow\":\"⟹\",\"DoubleRightArrow\":\"⇒\",\"DoubleRightTee\":\"⊨\",\"DoubleUpArrow\":\"⇑\",\"DoubleUpDownArrow\":\"⇕\",\"DoubleVerticalBar\":\"∥\",\"DownArrowBar\":\"⤓\",\"downarrow\":\"↓\",\"DownArrow\":\"↓\",\"Downarrow\":\"⇓\",\"DownArrowUpArrow\":\"⇵\",\"DownBreve\":\"̑\",\"downdownarrows\":\"⇊\",\"downharpoonleft\":\"⇃\",\"downharpoonright\":\"⇂\",\"DownLeftRightVector\":\"⥐\",\"DownLeftTeeVector\":\"⥞\",\"DownLeftVectorBar\":\"⥖\",\"DownLeftVector\":\"↽\",\"DownRightTeeVector\":\"⥟\",\"DownRightVectorBar\":\"⥗\",\"DownRightVector\":\"⇁\",\"DownTeeArrow\":\"↧\",\"DownTee\":\"⊤\",\"drbkarow\":\"⤐\",\"drcorn\":\"⌟\",\"drcrop\":\"⌌\",\"Dscr\":\"𝒟\",\"dscr\":\"𝒹\",\"DScy\":\"Ѕ\",\"dscy\":\"ѕ\",\"dsol\":\"⧶\",\"Dstrok\":\"Đ\",\"dstrok\":\"đ\",\"dtdot\":\"⋱\",\"dtri\":\"▿\",\"dtrif\":\"▾\",\"duarr\":\"⇵\",\"duhar\":\"⥯\",\"dwangle\":\"⦦\",\"DZcy\":\"Џ\",\"dzcy\":\"џ\",\"dzigrarr\":\"⟿\",\"Eacute\":\"É\",\"eacute\":\"é\",\"easter\":\"⩮\",\"Ecaron\":\"Ě\",\"ecaron\":\"ě\",\"Ecirc\":\"Ê\",\"ecirc\":\"ê\",\"ecir\":\"≖\",\"ecolon\":\"≕\",\"Ecy\":\"Э\",\"ecy\":\"э\",\"eDDot\":\"⩷\",\"Edot\":\"Ė\",\"edot\":\"ė\",\"eDot\":\"≑\",\"ee\":\"ⅇ\",\"efDot\":\"≒\",\"Efr\":\"𝔈\",\"efr\":\"𝔢\",\"eg\":\"⪚\",\"Egrave\":\"È\",\"egrave\":\"è\",\"egs\":\"⪖\",\"egsdot\":\"⪘\",\"el\":\"⪙\",\"Element\":\"∈\",\"elinters\":\"⏧\",\"ell\":\"ℓ\",\"els\":\"⪕\",\"elsdot\":\"⪗\",\"Emacr\":\"Ē\",\"emacr\":\"ē\",\"empty\":\"∅\",\"emptyset\":\"∅\",\"EmptySmallSquare\":\"◻\",\"emptyv\":\"∅\",\"EmptyVerySmallSquare\":\"▫\",\"emsp13\":\" \",\"emsp14\":\" \",\"emsp\":\" \",\"ENG\":\"Ŋ\",\"eng\":\"ŋ\",\"ensp\":\" \",\"Eogon\":\"Ę\",\"eogon\":\"ę\",\"Eopf\":\"𝔼\",\"eopf\":\"𝕖\",\"epar\":\"⋕\",\"eparsl\":\"⧣\",\"eplus\":\"⩱\",\"epsi\":\"ε\",\"Epsilon\":\"Ε\",\"epsilon\":\"ε\",\"epsiv\":\"ϵ\",\"eqcirc\":\"≖\",\"eqcolon\":\"≕\",\"eqsim\":\"≂\",\"eqslantgtr\":\"⪖\",\"eqslantless\":\"⪕\",\"Equal\":\"⩵\",\"equals\":\"=\",\"EqualTilde\":\"≂\",\"equest\":\"≟\",\"Equilibrium\":\"⇌\",\"equiv\":\"≡\",\"equivDD\":\"⩸\",\"eqvparsl\":\"⧥\",\"erarr\":\"⥱\",\"erDot\":\"≓\",\"escr\":\"ℯ\",\"Escr\":\"ℰ\",\"esdot\":\"≐\",\"Esim\":\"⩳\",\"esim\":\"≂\",\"Eta\":\"Η\",\"eta\":\"η\",\"ETH\":\"Ð\",\"eth\":\"ð\",\"Euml\":\"Ë\",\"euml\":\"ë\",\"euro\":\"€\",\"excl\":\"!\",\"exist\":\"∃\",\"Exists\":\"∃\",\"expectation\":\"ℰ\",\"exponentiale\":\"ⅇ\",\"ExponentialE\":\"ⅇ\",\"fallingdotseq\":\"≒\",\"Fcy\":\"Ф\",\"fcy\":\"ф\",\"female\":\"♀\",\"ffilig\":\"ffi\",\"fflig\":\"ff\",\"ffllig\":\"ffl\",\"Ffr\":\"𝔉\",\"ffr\":\"𝔣\",\"filig\":\"fi\",\"FilledSmallSquare\":\"◼\",\"FilledVerySmallSquare\":\"▪\",\"fjlig\":\"fj\",\"flat\":\"♭\",\"fllig\":\"fl\",\"fltns\":\"▱\",\"fnof\":\"ƒ\",\"Fopf\":\"𝔽\",\"fopf\":\"𝕗\",\"forall\":\"∀\",\"ForAll\":\"∀\",\"fork\":\"⋔\",\"forkv\":\"⫙\",\"Fouriertrf\":\"ℱ\",\"fpartint\":\"⨍\",\"frac12\":\"½\",\"frac13\":\"⅓\",\"frac14\":\"¼\",\"frac15\":\"⅕\",\"frac16\":\"⅙\",\"frac18\":\"⅛\",\"frac23\":\"⅔\",\"frac25\":\"⅖\",\"frac34\":\"¾\",\"frac35\":\"⅗\",\"frac38\":\"⅜\",\"frac45\":\"⅘\",\"frac56\":\"⅚\",\"frac58\":\"⅝\",\"frac78\":\"⅞\",\"frasl\":\"⁄\",\"frown\":\"⌢\",\"fscr\":\"𝒻\",\"Fscr\":\"ℱ\",\"gacute\":\"ǵ\",\"Gamma\":\"Γ\",\"gamma\":\"γ\",\"Gammad\":\"Ϝ\",\"gammad\":\"ϝ\",\"gap\":\"⪆\",\"Gbreve\":\"Ğ\",\"gbreve\":\"ğ\",\"Gcedil\":\"Ģ\",\"Gcirc\":\"Ĝ\",\"gcirc\":\"ĝ\",\"Gcy\":\"Г\",\"gcy\":\"г\",\"Gdot\":\"Ġ\",\"gdot\":\"ġ\",\"ge\":\"≥\",\"gE\":\"≧\",\"gEl\":\"⪌\",\"gel\":\"⋛\",\"geq\":\"≥\",\"geqq\":\"≧\",\"geqslant\":\"⩾\",\"gescc\":\"⪩\",\"ges\":\"⩾\",\"gesdot\":\"⪀\",\"gesdoto\":\"⪂\",\"gesdotol\":\"⪄\",\"gesl\":\"⋛︀\",\"gesles\":\"⪔\",\"Gfr\":\"𝔊\",\"gfr\":\"𝔤\",\"gg\":\"≫\",\"Gg\":\"⋙\",\"ggg\":\"⋙\",\"gimel\":\"ℷ\",\"GJcy\":\"Ѓ\",\"gjcy\":\"ѓ\",\"gla\":\"⪥\",\"gl\":\"≷\",\"glE\":\"⪒\",\"glj\":\"⪤\",\"gnap\":\"⪊\",\"gnapprox\":\"⪊\",\"gne\":\"⪈\",\"gnE\":\"≩\",\"gneq\":\"⪈\",\"gneqq\":\"≩\",\"gnsim\":\"⋧\",\"Gopf\":\"𝔾\",\"gopf\":\"𝕘\",\"grave\":\"`\",\"GreaterEqual\":\"≥\",\"GreaterEqualLess\":\"⋛\",\"GreaterFullEqual\":\"≧\",\"GreaterGreater\":\"⪢\",\"GreaterLess\":\"≷\",\"GreaterSlantEqual\":\"⩾\",\"GreaterTilde\":\"≳\",\"Gscr\":\"𝒢\",\"gscr\":\"ℊ\",\"gsim\":\"≳\",\"gsime\":\"⪎\",\"gsiml\":\"⪐\",\"gtcc\":\"⪧\",\"gtcir\":\"⩺\",\"gt\":\">\",\"GT\":\">\",\"Gt\":\"≫\",\"gtdot\":\"⋗\",\"gtlPar\":\"⦕\",\"gtquest\":\"⩼\",\"gtrapprox\":\"⪆\",\"gtrarr\":\"⥸\",\"gtrdot\":\"⋗\",\"gtreqless\":\"⋛\",\"gtreqqless\":\"⪌\",\"gtrless\":\"≷\",\"gtrsim\":\"≳\",\"gvertneqq\":\"≩︀\",\"gvnE\":\"≩︀\",\"Hacek\":\"ˇ\",\"hairsp\":\" \",\"half\":\"½\",\"hamilt\":\"ℋ\",\"HARDcy\":\"Ъ\",\"hardcy\":\"ъ\",\"harrcir\":\"⥈\",\"harr\":\"↔\",\"hArr\":\"⇔\",\"harrw\":\"↭\",\"Hat\":\"^\",\"hbar\":\"ℏ\",\"Hcirc\":\"Ĥ\",\"hcirc\":\"ĥ\",\"hearts\":\"♥\",\"heartsuit\":\"♥\",\"hellip\":\"…\",\"hercon\":\"⊹\",\"hfr\":\"𝔥\",\"Hfr\":\"ℌ\",\"HilbertSpace\":\"ℋ\",\"hksearow\":\"⤥\",\"hkswarow\":\"⤦\",\"hoarr\":\"⇿\",\"homtht\":\"∻\",\"hookleftarrow\":\"↩\",\"hookrightarrow\":\"↪\",\"hopf\":\"𝕙\",\"Hopf\":\"ℍ\",\"horbar\":\"―\",\"HorizontalLine\":\"─\",\"hscr\":\"𝒽\",\"Hscr\":\"ℋ\",\"hslash\":\"ℏ\",\"Hstrok\":\"Ħ\",\"hstrok\":\"ħ\",\"HumpDownHump\":\"≎\",\"HumpEqual\":\"≏\",\"hybull\":\"⁃\",\"hyphen\":\"‐\",\"Iacute\":\"Í\",\"iacute\":\"í\",\"ic\":\"\",\"Icirc\":\"Î\",\"icirc\":\"î\",\"Icy\":\"И\",\"icy\":\"и\",\"Idot\":\"İ\",\"IEcy\":\"Е\",\"iecy\":\"е\",\"iexcl\":\"¡\",\"iff\":\"⇔\",\"ifr\":\"𝔦\",\"Ifr\":\"ℑ\",\"Igrave\":\"Ì\",\"igrave\":\"ì\",\"ii\":\"ⅈ\",\"iiiint\":\"⨌\",\"iiint\":\"∭\",\"iinfin\":\"⧜\",\"iiota\":\"℩\",\"IJlig\":\"IJ\",\"ijlig\":\"ij\",\"Imacr\":\"Ī\",\"imacr\":\"ī\",\"image\":\"ℑ\",\"ImaginaryI\":\"ⅈ\",\"imagline\":\"ℐ\",\"imagpart\":\"ℑ\",\"imath\":\"ı\",\"Im\":\"ℑ\",\"imof\":\"⊷\",\"imped\":\"Ƶ\",\"Implies\":\"⇒\",\"incare\":\"℅\",\"in\":\"∈\",\"infin\":\"∞\",\"infintie\":\"⧝\",\"inodot\":\"ı\",\"intcal\":\"⊺\",\"int\":\"∫\",\"Int\":\"∬\",\"integers\":\"ℤ\",\"Integral\":\"∫\",\"intercal\":\"⊺\",\"Intersection\":\"⋂\",\"intlarhk\":\"⨗\",\"intprod\":\"⨼\",\"InvisibleComma\":\"\",\"InvisibleTimes\":\"\",\"IOcy\":\"Ё\",\"iocy\":\"ё\",\"Iogon\":\"Į\",\"iogon\":\"į\",\"Iopf\":\"𝕀\",\"iopf\":\"𝕚\",\"Iota\":\"Ι\",\"iota\":\"ι\",\"iprod\":\"⨼\",\"iquest\":\"¿\",\"iscr\":\"𝒾\",\"Iscr\":\"ℐ\",\"isin\":\"∈\",\"isindot\":\"⋵\",\"isinE\":\"⋹\",\"isins\":\"⋴\",\"isinsv\":\"⋳\",\"isinv\":\"∈\",\"it\":\"\",\"Itilde\":\"Ĩ\",\"itilde\":\"ĩ\",\"Iukcy\":\"І\",\"iukcy\":\"і\",\"Iuml\":\"Ï\",\"iuml\":\"ï\",\"Jcirc\":\"Ĵ\",\"jcirc\":\"ĵ\",\"Jcy\":\"Й\",\"jcy\":\"й\",\"Jfr\":\"𝔍\",\"jfr\":\"𝔧\",\"jmath\":\"ȷ\",\"Jopf\":\"𝕁\",\"jopf\":\"𝕛\",\"Jscr\":\"𝒥\",\"jscr\":\"𝒿\",\"Jsercy\":\"Ј\",\"jsercy\":\"ј\",\"Jukcy\":\"Є\",\"jukcy\":\"є\",\"Kappa\":\"Κ\",\"kappa\":\"κ\",\"kappav\":\"ϰ\",\"Kcedil\":\"Ķ\",\"kcedil\":\"ķ\",\"Kcy\":\"К\",\"kcy\":\"к\",\"Kfr\":\"𝔎\",\"kfr\":\"𝔨\",\"kgreen\":\"ĸ\",\"KHcy\":\"Х\",\"khcy\":\"х\",\"KJcy\":\"Ќ\",\"kjcy\":\"ќ\",\"Kopf\":\"𝕂\",\"kopf\":\"𝕜\",\"Kscr\":\"𝒦\",\"kscr\":\"𝓀\",\"lAarr\":\"⇚\",\"Lacute\":\"Ĺ\",\"lacute\":\"ĺ\",\"laemptyv\":\"⦴\",\"lagran\":\"ℒ\",\"Lambda\":\"Λ\",\"lambda\":\"λ\",\"lang\":\"⟨\",\"Lang\":\"⟪\",\"langd\":\"⦑\",\"langle\":\"⟨\",\"lap\":\"⪅\",\"Laplacetrf\":\"ℒ\",\"laquo\":\"«\",\"larrb\":\"⇤\",\"larrbfs\":\"⤟\",\"larr\":\"←\",\"Larr\":\"↞\",\"lArr\":\"⇐\",\"larrfs\":\"⤝\",\"larrhk\":\"↩\",\"larrlp\":\"↫\",\"larrpl\":\"⤹\",\"larrsim\":\"⥳\",\"larrtl\":\"↢\",\"latail\":\"⤙\",\"lAtail\":\"⤛\",\"lat\":\"⪫\",\"late\":\"⪭\",\"lates\":\"⪭︀\",\"lbarr\":\"⤌\",\"lBarr\":\"⤎\",\"lbbrk\":\"❲\",\"lbrace\":\"{\",\"lbrack\":\"[\",\"lbrke\":\"⦋\",\"lbrksld\":\"⦏\",\"lbrkslu\":\"⦍\",\"Lcaron\":\"Ľ\",\"lcaron\":\"ľ\",\"Lcedil\":\"Ļ\",\"lcedil\":\"ļ\",\"lceil\":\"⌈\",\"lcub\":\"{\",\"Lcy\":\"Л\",\"lcy\":\"л\",\"ldca\":\"⤶\",\"ldquo\":\"“\",\"ldquor\":\"„\",\"ldrdhar\":\"⥧\",\"ldrushar\":\"⥋\",\"ldsh\":\"↲\",\"le\":\"≤\",\"lE\":\"≦\",\"LeftAngleBracket\":\"⟨\",\"LeftArrowBar\":\"⇤\",\"leftarrow\":\"←\",\"LeftArrow\":\"←\",\"Leftarrow\":\"⇐\",\"LeftArrowRightArrow\":\"⇆\",\"leftarrowtail\":\"↢\",\"LeftCeiling\":\"⌈\",\"LeftDoubleBracket\":\"⟦\",\"LeftDownTeeVector\":\"⥡\",\"LeftDownVectorBar\":\"⥙\",\"LeftDownVector\":\"⇃\",\"LeftFloor\":\"⌊\",\"leftharpoondown\":\"↽\",\"leftharpoonup\":\"↼\",\"leftleftarrows\":\"⇇\",\"leftrightarrow\":\"↔\",\"LeftRightArrow\":\"↔\",\"Leftrightarrow\":\"⇔\",\"leftrightarrows\":\"⇆\",\"leftrightharpoons\":\"⇋\",\"leftrightsquigarrow\":\"↭\",\"LeftRightVector\":\"⥎\",\"LeftTeeArrow\":\"↤\",\"LeftTee\":\"⊣\",\"LeftTeeVector\":\"⥚\",\"leftthreetimes\":\"⋋\",\"LeftTriangleBar\":\"⧏\",\"LeftTriangle\":\"⊲\",\"LeftTriangleEqual\":\"⊴\",\"LeftUpDownVector\":\"⥑\",\"LeftUpTeeVector\":\"⥠\",\"LeftUpVectorBar\":\"⥘\",\"LeftUpVector\":\"↿\",\"LeftVectorBar\":\"⥒\",\"LeftVector\":\"↼\",\"lEg\":\"⪋\",\"leg\":\"⋚\",\"leq\":\"≤\",\"leqq\":\"≦\",\"leqslant\":\"⩽\",\"lescc\":\"⪨\",\"les\":\"⩽\",\"lesdot\":\"⩿\",\"lesdoto\":\"⪁\",\"lesdotor\":\"⪃\",\"lesg\":\"⋚︀\",\"lesges\":\"⪓\",\"lessapprox\":\"⪅\",\"lessdot\":\"⋖\",\"lesseqgtr\":\"⋚\",\"lesseqqgtr\":\"⪋\",\"LessEqualGreater\":\"⋚\",\"LessFullEqual\":\"≦\",\"LessGreater\":\"≶\",\"lessgtr\":\"≶\",\"LessLess\":\"⪡\",\"lesssim\":\"≲\",\"LessSlantEqual\":\"⩽\",\"LessTilde\":\"≲\",\"lfisht\":\"⥼\",\"lfloor\":\"⌊\",\"Lfr\":\"𝔏\",\"lfr\":\"𝔩\",\"lg\":\"≶\",\"lgE\":\"⪑\",\"lHar\":\"⥢\",\"lhard\":\"↽\",\"lharu\":\"↼\",\"lharul\":\"⥪\",\"lhblk\":\"▄\",\"LJcy\":\"Љ\",\"ljcy\":\"љ\",\"llarr\":\"⇇\",\"ll\":\"≪\",\"Ll\":\"⋘\",\"llcorner\":\"⌞\",\"Lleftarrow\":\"⇚\",\"llhard\":\"⥫\",\"lltri\":\"◺\",\"Lmidot\":\"Ŀ\",\"lmidot\":\"ŀ\",\"lmoustache\":\"⎰\",\"lmoust\":\"⎰\",\"lnap\":\"⪉\",\"lnapprox\":\"⪉\",\"lne\":\"⪇\",\"lnE\":\"≨\",\"lneq\":\"⪇\",\"lneqq\":\"≨\",\"lnsim\":\"⋦\",\"loang\":\"⟬\",\"loarr\":\"⇽\",\"lobrk\":\"⟦\",\"longleftarrow\":\"⟵\",\"LongLeftArrow\":\"⟵\",\"Longleftarrow\":\"⟸\",\"longleftrightarrow\":\"⟷\",\"LongLeftRightArrow\":\"⟷\",\"Longleftrightarrow\":\"⟺\",\"longmapsto\":\"⟼\",\"longrightarrow\":\"⟶\",\"LongRightArrow\":\"⟶\",\"Longrightarrow\":\"⟹\",\"looparrowleft\":\"↫\",\"looparrowright\":\"↬\",\"lopar\":\"⦅\",\"Lopf\":\"𝕃\",\"lopf\":\"𝕝\",\"loplus\":\"⨭\",\"lotimes\":\"⨴\",\"lowast\":\"∗\",\"lowbar\":\"_\",\"LowerLeftArrow\":\"↙\",\"LowerRightArrow\":\"↘\",\"loz\":\"◊\",\"lozenge\":\"◊\",\"lozf\":\"⧫\",\"lpar\":\"(\",\"lparlt\":\"⦓\",\"lrarr\":\"⇆\",\"lrcorner\":\"⌟\",\"lrhar\":\"⇋\",\"lrhard\":\"⥭\",\"lrm\":\"\",\"lrtri\":\"⊿\",\"lsaquo\":\"‹\",\"lscr\":\"𝓁\",\"Lscr\":\"ℒ\",\"lsh\":\"↰\",\"Lsh\":\"↰\",\"lsim\":\"≲\",\"lsime\":\"⪍\",\"lsimg\":\"⪏\",\"lsqb\":\"[\",\"lsquo\":\"‘\",\"lsquor\":\"‚\",\"Lstrok\":\"Ł\",\"lstrok\":\"ł\",\"ltcc\":\"⪦\",\"ltcir\":\"⩹\",\"lt\":\"<\",\"LT\":\"<\",\"Lt\":\"≪\",\"ltdot\":\"⋖\",\"lthree\":\"⋋\",\"ltimes\":\"⋉\",\"ltlarr\":\"⥶\",\"ltquest\":\"⩻\",\"ltri\":\"◃\",\"ltrie\":\"⊴\",\"ltrif\":\"◂\",\"ltrPar\":\"⦖\",\"lurdshar\":\"⥊\",\"luruhar\":\"⥦\",\"lvertneqq\":\"≨︀\",\"lvnE\":\"≨︀\",\"macr\":\"¯\",\"male\":\"♂\",\"malt\":\"✠\",\"maltese\":\"✠\",\"Map\":\"⤅\",\"map\":\"↦\",\"mapsto\":\"↦\",\"mapstodown\":\"↧\",\"mapstoleft\":\"↤\",\"mapstoup\":\"↥\",\"marker\":\"▮\",\"mcomma\":\"⨩\",\"Mcy\":\"М\",\"mcy\":\"м\",\"mdash\":\"—\",\"mDDot\":\"∺\",\"measuredangle\":\"∡\",\"MediumSpace\":\" \",\"Mellintrf\":\"ℳ\",\"Mfr\":\"𝔐\",\"mfr\":\"𝔪\",\"mho\":\"℧\",\"micro\":\"µ\",\"midast\":\"*\",\"midcir\":\"⫰\",\"mid\":\"∣\",\"middot\":\"·\",\"minusb\":\"⊟\",\"minus\":\"−\",\"minusd\":\"∸\",\"minusdu\":\"⨪\",\"MinusPlus\":\"∓\",\"mlcp\":\"⫛\",\"mldr\":\"…\",\"mnplus\":\"∓\",\"models\":\"⊧\",\"Mopf\":\"𝕄\",\"mopf\":\"𝕞\",\"mp\":\"∓\",\"mscr\":\"𝓂\",\"Mscr\":\"ℳ\",\"mstpos\":\"∾\",\"Mu\":\"Μ\",\"mu\":\"μ\",\"multimap\":\"⊸\",\"mumap\":\"⊸\",\"nabla\":\"∇\",\"Nacute\":\"Ń\",\"nacute\":\"ń\",\"nang\":\"∠⃒\",\"nap\":\"≉\",\"napE\":\"⩰̸\",\"napid\":\"≋̸\",\"napos\":\"ʼn\",\"napprox\":\"≉\",\"natural\":\"♮\",\"naturals\":\"ℕ\",\"natur\":\"♮\",\"nbsp\":\" \",\"nbump\":\"≎̸\",\"nbumpe\":\"≏̸\",\"ncap\":\"⩃\",\"Ncaron\":\"Ň\",\"ncaron\":\"ň\",\"Ncedil\":\"Ņ\",\"ncedil\":\"ņ\",\"ncong\":\"≇\",\"ncongdot\":\"⩭̸\",\"ncup\":\"⩂\",\"Ncy\":\"Н\",\"ncy\":\"н\",\"ndash\":\"–\",\"nearhk\":\"⤤\",\"nearr\":\"↗\",\"neArr\":\"⇗\",\"nearrow\":\"↗\",\"ne\":\"≠\",\"nedot\":\"≐̸\",\"NegativeMediumSpace\":\"\",\"NegativeThickSpace\":\"\",\"NegativeThinSpace\":\"\",\"NegativeVeryThinSpace\":\"\",\"nequiv\":\"≢\",\"nesear\":\"⤨\",\"nesim\":\"≂̸\",\"NestedGreaterGreater\":\"≫\",\"NestedLessLess\":\"≪\",\"NewLine\":\"\\n\",\"nexist\":\"∄\",\"nexists\":\"∄\",\"Nfr\":\"𝔑\",\"nfr\":\"𝔫\",\"ngE\":\"≧̸\",\"nge\":\"≱\",\"ngeq\":\"≱\",\"ngeqq\":\"≧̸\",\"ngeqslant\":\"⩾̸\",\"nges\":\"⩾̸\",\"nGg\":\"⋙̸\",\"ngsim\":\"≵\",\"nGt\":\"≫⃒\",\"ngt\":\"≯\",\"ngtr\":\"≯\",\"nGtv\":\"≫̸\",\"nharr\":\"↮\",\"nhArr\":\"⇎\",\"nhpar\":\"⫲\",\"ni\":\"∋\",\"nis\":\"⋼\",\"nisd\":\"⋺\",\"niv\":\"∋\",\"NJcy\":\"Њ\",\"njcy\":\"њ\",\"nlarr\":\"↚\",\"nlArr\":\"⇍\",\"nldr\":\"‥\",\"nlE\":\"≦̸\",\"nle\":\"≰\",\"nleftarrow\":\"↚\",\"nLeftarrow\":\"⇍\",\"nleftrightarrow\":\"↮\",\"nLeftrightarrow\":\"⇎\",\"nleq\":\"≰\",\"nleqq\":\"≦̸\",\"nleqslant\":\"⩽̸\",\"nles\":\"⩽̸\",\"nless\":\"≮\",\"nLl\":\"⋘̸\",\"nlsim\":\"≴\",\"nLt\":\"≪⃒\",\"nlt\":\"≮\",\"nltri\":\"⋪\",\"nltrie\":\"⋬\",\"nLtv\":\"≪̸\",\"nmid\":\"∤\",\"NoBreak\":\"\",\"NonBreakingSpace\":\" \",\"nopf\":\"𝕟\",\"Nopf\":\"ℕ\",\"Not\":\"⫬\",\"not\":\"¬\",\"NotCongruent\":\"≢\",\"NotCupCap\":\"≭\",\"NotDoubleVerticalBar\":\"∦\",\"NotElement\":\"∉\",\"NotEqual\":\"≠\",\"NotEqualTilde\":\"≂̸\",\"NotExists\":\"∄\",\"NotGreater\":\"≯\",\"NotGreaterEqual\":\"≱\",\"NotGreaterFullEqual\":\"≧̸\",\"NotGreaterGreater\":\"≫̸\",\"NotGreaterLess\":\"≹\",\"NotGreaterSlantEqual\":\"⩾̸\",\"NotGreaterTilde\":\"≵\",\"NotHumpDownHump\":\"≎̸\",\"NotHumpEqual\":\"≏̸\",\"notin\":\"∉\",\"notindot\":\"⋵̸\",\"notinE\":\"⋹̸\",\"notinva\":\"∉\",\"notinvb\":\"⋷\",\"notinvc\":\"⋶\",\"NotLeftTriangleBar\":\"⧏̸\",\"NotLeftTriangle\":\"⋪\",\"NotLeftTriangleEqual\":\"⋬\",\"NotLess\":\"≮\",\"NotLessEqual\":\"≰\",\"NotLessGreater\":\"≸\",\"NotLessLess\":\"≪̸\",\"NotLessSlantEqual\":\"⩽̸\",\"NotLessTilde\":\"≴\",\"NotNestedGreaterGreater\":\"⪢̸\",\"NotNestedLessLess\":\"⪡̸\",\"notni\":\"∌\",\"notniva\":\"∌\",\"notnivb\":\"⋾\",\"notnivc\":\"⋽\",\"NotPrecedes\":\"⊀\",\"NotPrecedesEqual\":\"⪯̸\",\"NotPrecedesSlantEqual\":\"⋠\",\"NotReverseElement\":\"∌\",\"NotRightTriangleBar\":\"⧐̸\",\"NotRightTriangle\":\"⋫\",\"NotRightTriangleEqual\":\"⋭\",\"NotSquareSubset\":\"⊏̸\",\"NotSquareSubsetEqual\":\"⋢\",\"NotSquareSuperset\":\"⊐̸\",\"NotSquareSupersetEqual\":\"⋣\",\"NotSubset\":\"⊂⃒\",\"NotSubsetEqual\":\"⊈\",\"NotSucceeds\":\"⊁\",\"NotSucceedsEqual\":\"⪰̸\",\"NotSucceedsSlantEqual\":\"⋡\",\"NotSucceedsTilde\":\"≿̸\",\"NotSuperset\":\"⊃⃒\",\"NotSupersetEqual\":\"⊉\",\"NotTilde\":\"≁\",\"NotTildeEqual\":\"≄\",\"NotTildeFullEqual\":\"≇\",\"NotTildeTilde\":\"≉\",\"NotVerticalBar\":\"∤\",\"nparallel\":\"∦\",\"npar\":\"∦\",\"nparsl\":\"⫽⃥\",\"npart\":\"∂̸\",\"npolint\":\"⨔\",\"npr\":\"⊀\",\"nprcue\":\"⋠\",\"nprec\":\"⊀\",\"npreceq\":\"⪯̸\",\"npre\":\"⪯̸\",\"nrarrc\":\"⤳̸\",\"nrarr\":\"↛\",\"nrArr\":\"⇏\",\"nrarrw\":\"↝̸\",\"nrightarrow\":\"↛\",\"nRightarrow\":\"⇏\",\"nrtri\":\"⋫\",\"nrtrie\":\"⋭\",\"nsc\":\"⊁\",\"nsccue\":\"⋡\",\"nsce\":\"⪰̸\",\"Nscr\":\"𝒩\",\"nscr\":\"𝓃\",\"nshortmid\":\"∤\",\"nshortparallel\":\"∦\",\"nsim\":\"≁\",\"nsime\":\"≄\",\"nsimeq\":\"≄\",\"nsmid\":\"∤\",\"nspar\":\"∦\",\"nsqsube\":\"⋢\",\"nsqsupe\":\"⋣\",\"nsub\":\"⊄\",\"nsubE\":\"⫅̸\",\"nsube\":\"⊈\",\"nsubset\":\"⊂⃒\",\"nsubseteq\":\"⊈\",\"nsubseteqq\":\"⫅̸\",\"nsucc\":\"⊁\",\"nsucceq\":\"⪰̸\",\"nsup\":\"⊅\",\"nsupE\":\"⫆̸\",\"nsupe\":\"⊉\",\"nsupset\":\"⊃⃒\",\"nsupseteq\":\"⊉\",\"nsupseteqq\":\"⫆̸\",\"ntgl\":\"≹\",\"Ntilde\":\"Ñ\",\"ntilde\":\"ñ\",\"ntlg\":\"≸\",\"ntriangleleft\":\"⋪\",\"ntrianglelefteq\":\"⋬\",\"ntriangleright\":\"⋫\",\"ntrianglerighteq\":\"⋭\",\"Nu\":\"Ν\",\"nu\":\"ν\",\"num\":\"#\",\"numero\":\"№\",\"numsp\":\" \",\"nvap\":\"≍⃒\",\"nvdash\":\"⊬\",\"nvDash\":\"⊭\",\"nVdash\":\"⊮\",\"nVDash\":\"⊯\",\"nvge\":\"≥⃒\",\"nvgt\":\">⃒\",\"nvHarr\":\"⤄\",\"nvinfin\":\"⧞\",\"nvlArr\":\"⤂\",\"nvle\":\"≤⃒\",\"nvlt\":\"<⃒\",\"nvltrie\":\"⊴⃒\",\"nvrArr\":\"⤃\",\"nvrtrie\":\"⊵⃒\",\"nvsim\":\"∼⃒\",\"nwarhk\":\"⤣\",\"nwarr\":\"↖\",\"nwArr\":\"⇖\",\"nwarrow\":\"↖\",\"nwnear\":\"⤧\",\"Oacute\":\"Ó\",\"oacute\":\"ó\",\"oast\":\"⊛\",\"Ocirc\":\"Ô\",\"ocirc\":\"ô\",\"ocir\":\"⊚\",\"Ocy\":\"О\",\"ocy\":\"о\",\"odash\":\"⊝\",\"Odblac\":\"Ő\",\"odblac\":\"ő\",\"odiv\":\"⨸\",\"odot\":\"⊙\",\"odsold\":\"⦼\",\"OElig\":\"Œ\",\"oelig\":\"œ\",\"ofcir\":\"⦿\",\"Ofr\":\"𝔒\",\"ofr\":\"𝔬\",\"ogon\":\"˛\",\"Ograve\":\"Ò\",\"ograve\":\"ò\",\"ogt\":\"⧁\",\"ohbar\":\"⦵\",\"ohm\":\"Ω\",\"oint\":\"∮\",\"olarr\":\"↺\",\"olcir\":\"⦾\",\"olcross\":\"⦻\",\"oline\":\"‾\",\"olt\":\"⧀\",\"Omacr\":\"Ō\",\"omacr\":\"ō\",\"Omega\":\"Ω\",\"omega\":\"ω\",\"Omicron\":\"Ο\",\"omicron\":\"ο\",\"omid\":\"⦶\",\"ominus\":\"⊖\",\"Oopf\":\"𝕆\",\"oopf\":\"𝕠\",\"opar\":\"⦷\",\"OpenCurlyDoubleQuote\":\"“\",\"OpenCurlyQuote\":\"‘\",\"operp\":\"⦹\",\"oplus\":\"⊕\",\"orarr\":\"↻\",\"Or\":\"⩔\",\"or\":\"∨\",\"ord\":\"⩝\",\"order\":\"ℴ\",\"orderof\":\"ℴ\",\"ordf\":\"ª\",\"ordm\":\"º\",\"origof\":\"⊶\",\"oror\":\"⩖\",\"orslope\":\"⩗\",\"orv\":\"⩛\",\"oS\":\"Ⓢ\",\"Oscr\":\"𝒪\",\"oscr\":\"ℴ\",\"Oslash\":\"Ø\",\"oslash\":\"ø\",\"osol\":\"⊘\",\"Otilde\":\"Õ\",\"otilde\":\"õ\",\"otimesas\":\"⨶\",\"Otimes\":\"⨷\",\"otimes\":\"⊗\",\"Ouml\":\"Ö\",\"ouml\":\"ö\",\"ovbar\":\"⌽\",\"OverBar\":\"‾\",\"OverBrace\":\"⏞\",\"OverBracket\":\"⎴\",\"OverParenthesis\":\"⏜\",\"para\":\"¶\",\"parallel\":\"∥\",\"par\":\"∥\",\"parsim\":\"⫳\",\"parsl\":\"⫽\",\"part\":\"∂\",\"PartialD\":\"∂\",\"Pcy\":\"П\",\"pcy\":\"п\",\"percnt\":\"%\",\"period\":\".\",\"permil\":\"‰\",\"perp\":\"⊥\",\"pertenk\":\"‱\",\"Pfr\":\"𝔓\",\"pfr\":\"𝔭\",\"Phi\":\"Φ\",\"phi\":\"φ\",\"phiv\":\"ϕ\",\"phmmat\":\"ℳ\",\"phone\":\"☎\",\"Pi\":\"Π\",\"pi\":\"π\",\"pitchfork\":\"⋔\",\"piv\":\"ϖ\",\"planck\":\"ℏ\",\"planckh\":\"ℎ\",\"plankv\":\"ℏ\",\"plusacir\":\"⨣\",\"plusb\":\"⊞\",\"pluscir\":\"⨢\",\"plus\":\"+\",\"plusdo\":\"∔\",\"plusdu\":\"⨥\",\"pluse\":\"⩲\",\"PlusMinus\":\"±\",\"plusmn\":\"±\",\"plussim\":\"⨦\",\"plustwo\":\"⨧\",\"pm\":\"±\",\"Poincareplane\":\"ℌ\",\"pointint\":\"⨕\",\"popf\":\"𝕡\",\"Popf\":\"ℙ\",\"pound\":\"£\",\"prap\":\"⪷\",\"Pr\":\"⪻\",\"pr\":\"≺\",\"prcue\":\"≼\",\"precapprox\":\"⪷\",\"prec\":\"≺\",\"preccurlyeq\":\"≼\",\"Precedes\":\"≺\",\"PrecedesEqual\":\"⪯\",\"PrecedesSlantEqual\":\"≼\",\"PrecedesTilde\":\"≾\",\"preceq\":\"⪯\",\"precnapprox\":\"⪹\",\"precneqq\":\"⪵\",\"precnsim\":\"⋨\",\"pre\":\"⪯\",\"prE\":\"⪳\",\"precsim\":\"≾\",\"prime\":\"′\",\"Prime\":\"″\",\"primes\":\"ℙ\",\"prnap\":\"⪹\",\"prnE\":\"⪵\",\"prnsim\":\"⋨\",\"prod\":\"∏\",\"Product\":\"∏\",\"profalar\":\"⌮\",\"profline\":\"⌒\",\"profsurf\":\"⌓\",\"prop\":\"∝\",\"Proportional\":\"∝\",\"Proportion\":\"∷\",\"propto\":\"∝\",\"prsim\":\"≾\",\"prurel\":\"⊰\",\"Pscr\":\"𝒫\",\"pscr\":\"𝓅\",\"Psi\":\"Ψ\",\"psi\":\"ψ\",\"puncsp\":\" \",\"Qfr\":\"𝔔\",\"qfr\":\"𝔮\",\"qint\":\"⨌\",\"qopf\":\"𝕢\",\"Qopf\":\"ℚ\",\"qprime\":\"⁗\",\"Qscr\":\"𝒬\",\"qscr\":\"𝓆\",\"quaternions\":\"ℍ\",\"quatint\":\"⨖\",\"quest\":\"?\",\"questeq\":\"≟\",\"quot\":\"\\\"\",\"QUOT\":\"\\\"\",\"rAarr\":\"⇛\",\"race\":\"∽̱\",\"Racute\":\"Ŕ\",\"racute\":\"ŕ\",\"radic\":\"√\",\"raemptyv\":\"⦳\",\"rang\":\"⟩\",\"Rang\":\"⟫\",\"rangd\":\"⦒\",\"range\":\"⦥\",\"rangle\":\"⟩\",\"raquo\":\"»\",\"rarrap\":\"⥵\",\"rarrb\":\"⇥\",\"rarrbfs\":\"⤠\",\"rarrc\":\"⤳\",\"rarr\":\"→\",\"Rarr\":\"↠\",\"rArr\":\"⇒\",\"rarrfs\":\"⤞\",\"rarrhk\":\"↪\",\"rarrlp\":\"↬\",\"rarrpl\":\"⥅\",\"rarrsim\":\"⥴\",\"Rarrtl\":\"⤖\",\"rarrtl\":\"↣\",\"rarrw\":\"↝\",\"ratail\":\"⤚\",\"rAtail\":\"⤜\",\"ratio\":\"∶\",\"rationals\":\"ℚ\",\"rbarr\":\"⤍\",\"rBarr\":\"⤏\",\"RBarr\":\"⤐\",\"rbbrk\":\"❳\",\"rbrace\":\"}\",\"rbrack\":\"]\",\"rbrke\":\"⦌\",\"rbrksld\":\"⦎\",\"rbrkslu\":\"⦐\",\"Rcaron\":\"Ř\",\"rcaron\":\"ř\",\"Rcedil\":\"Ŗ\",\"rcedil\":\"ŗ\",\"rceil\":\"⌉\",\"rcub\":\"}\",\"Rcy\":\"Р\",\"rcy\":\"р\",\"rdca\":\"⤷\",\"rdldhar\":\"⥩\",\"rdquo\":\"”\",\"rdquor\":\"”\",\"rdsh\":\"↳\",\"real\":\"ℜ\",\"realine\":\"ℛ\",\"realpart\":\"ℜ\",\"reals\":\"ℝ\",\"Re\":\"ℜ\",\"rect\":\"▭\",\"reg\":\"®\",\"REG\":\"®\",\"ReverseElement\":\"∋\",\"ReverseEquilibrium\":\"⇋\",\"ReverseUpEquilibrium\":\"⥯\",\"rfisht\":\"⥽\",\"rfloor\":\"⌋\",\"rfr\":\"𝔯\",\"Rfr\":\"ℜ\",\"rHar\":\"⥤\",\"rhard\":\"⇁\",\"rharu\":\"⇀\",\"rharul\":\"⥬\",\"Rho\":\"Ρ\",\"rho\":\"ρ\",\"rhov\":\"ϱ\",\"RightAngleBracket\":\"⟩\",\"RightArrowBar\":\"⇥\",\"rightarrow\":\"→\",\"RightArrow\":\"→\",\"Rightarrow\":\"⇒\",\"RightArrowLeftArrow\":\"⇄\",\"rightarrowtail\":\"↣\",\"RightCeiling\":\"⌉\",\"RightDoubleBracket\":\"⟧\",\"RightDownTeeVector\":\"⥝\",\"RightDownVectorBar\":\"⥕\",\"RightDownVector\":\"⇂\",\"RightFloor\":\"⌋\",\"rightharpoondown\":\"⇁\",\"rightharpoonup\":\"⇀\",\"rightleftarrows\":\"⇄\",\"rightleftharpoons\":\"⇌\",\"rightrightarrows\":\"⇉\",\"rightsquigarrow\":\"↝\",\"RightTeeArrow\":\"↦\",\"RightTee\":\"⊢\",\"RightTeeVector\":\"⥛\",\"rightthreetimes\":\"⋌\",\"RightTriangleBar\":\"⧐\",\"RightTriangle\":\"⊳\",\"RightTriangleEqual\":\"⊵\",\"RightUpDownVector\":\"⥏\",\"RightUpTeeVector\":\"⥜\",\"RightUpVectorBar\":\"⥔\",\"RightUpVector\":\"↾\",\"RightVectorBar\":\"⥓\",\"RightVector\":\"⇀\",\"ring\":\"˚\",\"risingdotseq\":\"≓\",\"rlarr\":\"⇄\",\"rlhar\":\"⇌\",\"rlm\":\"\",\"rmoustache\":\"⎱\",\"rmoust\":\"⎱\",\"rnmid\":\"⫮\",\"roang\":\"⟭\",\"roarr\":\"⇾\",\"robrk\":\"⟧\",\"ropar\":\"⦆\",\"ropf\":\"𝕣\",\"Ropf\":\"ℝ\",\"roplus\":\"⨮\",\"rotimes\":\"⨵\",\"RoundImplies\":\"⥰\",\"rpar\":\")\",\"rpargt\":\"⦔\",\"rppolint\":\"⨒\",\"rrarr\":\"⇉\",\"Rrightarrow\":\"⇛\",\"rsaquo\":\"›\",\"rscr\":\"𝓇\",\"Rscr\":\"ℛ\",\"rsh\":\"↱\",\"Rsh\":\"↱\",\"rsqb\":\"]\",\"rsquo\":\"’\",\"rsquor\":\"’\",\"rthree\":\"⋌\",\"rtimes\":\"⋊\",\"rtri\":\"▹\",\"rtrie\":\"⊵\",\"rtrif\":\"▸\",\"rtriltri\":\"⧎\",\"RuleDelayed\":\"⧴\",\"ruluhar\":\"⥨\",\"rx\":\"℞\",\"Sacute\":\"Ś\",\"sacute\":\"ś\",\"sbquo\":\"‚\",\"scap\":\"⪸\",\"Scaron\":\"Š\",\"scaron\":\"š\",\"Sc\":\"⪼\",\"sc\":\"≻\",\"sccue\":\"≽\",\"sce\":\"⪰\",\"scE\":\"⪴\",\"Scedil\":\"Ş\",\"scedil\":\"ş\",\"Scirc\":\"Ŝ\",\"scirc\":\"ŝ\",\"scnap\":\"⪺\",\"scnE\":\"⪶\",\"scnsim\":\"⋩\",\"scpolint\":\"⨓\",\"scsim\":\"≿\",\"Scy\":\"С\",\"scy\":\"с\",\"sdotb\":\"⊡\",\"sdot\":\"⋅\",\"sdote\":\"⩦\",\"searhk\":\"⤥\",\"searr\":\"↘\",\"seArr\":\"⇘\",\"searrow\":\"↘\",\"sect\":\"§\",\"semi\":\";\",\"seswar\":\"⤩\",\"setminus\":\"∖\",\"setmn\":\"∖\",\"sext\":\"✶\",\"Sfr\":\"𝔖\",\"sfr\":\"𝔰\",\"sfrown\":\"⌢\",\"sharp\":\"♯\",\"SHCHcy\":\"Щ\",\"shchcy\":\"щ\",\"SHcy\":\"Ш\",\"shcy\":\"ш\",\"ShortDownArrow\":\"↓\",\"ShortLeftArrow\":\"←\",\"shortmid\":\"∣\",\"shortparallel\":\"∥\",\"ShortRightArrow\":\"→\",\"ShortUpArrow\":\"↑\",\"shy\":\"\",\"Sigma\":\"Σ\",\"sigma\":\"σ\",\"sigmaf\":\"ς\",\"sigmav\":\"ς\",\"sim\":\"∼\",\"simdot\":\"⩪\",\"sime\":\"≃\",\"simeq\":\"≃\",\"simg\":\"⪞\",\"simgE\":\"⪠\",\"siml\":\"⪝\",\"simlE\":\"⪟\",\"simne\":\"≆\",\"simplus\":\"⨤\",\"simrarr\":\"⥲\",\"slarr\":\"←\",\"SmallCircle\":\"∘\",\"smallsetminus\":\"∖\",\"smashp\":\"⨳\",\"smeparsl\":\"⧤\",\"smid\":\"∣\",\"smile\":\"⌣\",\"smt\":\"⪪\",\"smte\":\"⪬\",\"smtes\":\"⪬︀\",\"SOFTcy\":\"Ь\",\"softcy\":\"ь\",\"solbar\":\"⌿\",\"solb\":\"⧄\",\"sol\":\"/\",\"Sopf\":\"𝕊\",\"sopf\":\"𝕤\",\"spades\":\"♠\",\"spadesuit\":\"♠\",\"spar\":\"∥\",\"sqcap\":\"⊓\",\"sqcaps\":\"⊓︀\",\"sqcup\":\"⊔\",\"sqcups\":\"⊔︀\",\"Sqrt\":\"√\",\"sqsub\":\"⊏\",\"sqsube\":\"⊑\",\"sqsubset\":\"⊏\",\"sqsubseteq\":\"⊑\",\"sqsup\":\"⊐\",\"sqsupe\":\"⊒\",\"sqsupset\":\"⊐\",\"sqsupseteq\":\"⊒\",\"square\":\"□\",\"Square\":\"□\",\"SquareIntersection\":\"⊓\",\"SquareSubset\":\"⊏\",\"SquareSubsetEqual\":\"⊑\",\"SquareSuperset\":\"⊐\",\"SquareSupersetEqual\":\"⊒\",\"SquareUnion\":\"⊔\",\"squarf\":\"▪\",\"squ\":\"□\",\"squf\":\"▪\",\"srarr\":\"→\",\"Sscr\":\"𝒮\",\"sscr\":\"𝓈\",\"ssetmn\":\"∖\",\"ssmile\":\"⌣\",\"sstarf\":\"⋆\",\"Star\":\"⋆\",\"star\":\"☆\",\"starf\":\"★\",\"straightepsilon\":\"ϵ\",\"straightphi\":\"ϕ\",\"strns\":\"¯\",\"sub\":\"⊂\",\"Sub\":\"⋐\",\"subdot\":\"⪽\",\"subE\":\"⫅\",\"sube\":\"⊆\",\"subedot\":\"⫃\",\"submult\":\"⫁\",\"subnE\":\"⫋\",\"subne\":\"⊊\",\"subplus\":\"⪿\",\"subrarr\":\"⥹\",\"subset\":\"⊂\",\"Subset\":\"⋐\",\"subseteq\":\"⊆\",\"subseteqq\":\"⫅\",\"SubsetEqual\":\"⊆\",\"subsetneq\":\"⊊\",\"subsetneqq\":\"⫋\",\"subsim\":\"⫇\",\"subsub\":\"⫕\",\"subsup\":\"⫓\",\"succapprox\":\"⪸\",\"succ\":\"≻\",\"succcurlyeq\":\"≽\",\"Succeeds\":\"≻\",\"SucceedsEqual\":\"⪰\",\"SucceedsSlantEqual\":\"≽\",\"SucceedsTilde\":\"≿\",\"succeq\":\"⪰\",\"succnapprox\":\"⪺\",\"succneqq\":\"⪶\",\"succnsim\":\"⋩\",\"succsim\":\"≿\",\"SuchThat\":\"∋\",\"sum\":\"∑\",\"Sum\":\"∑\",\"sung\":\"♪\",\"sup1\":\"¹\",\"sup2\":\"²\",\"sup3\":\"³\",\"sup\":\"⊃\",\"Sup\":\"⋑\",\"supdot\":\"⪾\",\"supdsub\":\"⫘\",\"supE\":\"⫆\",\"supe\":\"⊇\",\"supedot\":\"⫄\",\"Superset\":\"⊃\",\"SupersetEqual\":\"⊇\",\"suphsol\":\"⟉\",\"suphsub\":\"⫗\",\"suplarr\":\"⥻\",\"supmult\":\"⫂\",\"supnE\":\"⫌\",\"supne\":\"⊋\",\"supplus\":\"⫀\",\"supset\":\"⊃\",\"Supset\":\"⋑\",\"supseteq\":\"⊇\",\"supseteqq\":\"⫆\",\"supsetneq\":\"⊋\",\"supsetneqq\":\"⫌\",\"supsim\":\"⫈\",\"supsub\":\"⫔\",\"supsup\":\"⫖\",\"swarhk\":\"⤦\",\"swarr\":\"↙\",\"swArr\":\"⇙\",\"swarrow\":\"↙\",\"swnwar\":\"⤪\",\"szlig\":\"ß\",\"Tab\":\"\\t\",\"target\":\"⌖\",\"Tau\":\"Τ\",\"tau\":\"τ\",\"tbrk\":\"⎴\",\"Tcaron\":\"Ť\",\"tcaron\":\"ť\",\"Tcedil\":\"Ţ\",\"tcedil\":\"ţ\",\"Tcy\":\"Т\",\"tcy\":\"т\",\"tdot\":\"⃛\",\"telrec\":\"⌕\",\"Tfr\":\"𝔗\",\"tfr\":\"𝔱\",\"there4\":\"∴\",\"therefore\":\"∴\",\"Therefore\":\"∴\",\"Theta\":\"Θ\",\"theta\":\"θ\",\"thetasym\":\"ϑ\",\"thetav\":\"ϑ\",\"thickapprox\":\"≈\",\"thicksim\":\"∼\",\"ThickSpace\":\" \",\"ThinSpace\":\" \",\"thinsp\":\" \",\"thkap\":\"≈\",\"thksim\":\"∼\",\"THORN\":\"Þ\",\"thorn\":\"þ\",\"tilde\":\"˜\",\"Tilde\":\"∼\",\"TildeEqual\":\"≃\",\"TildeFullEqual\":\"≅\",\"TildeTilde\":\"≈\",\"timesbar\":\"⨱\",\"timesb\":\"⊠\",\"times\":\"×\",\"timesd\":\"⨰\",\"tint\":\"∭\",\"toea\":\"⤨\",\"topbot\":\"⌶\",\"topcir\":\"⫱\",\"top\":\"⊤\",\"Topf\":\"𝕋\",\"topf\":\"𝕥\",\"topfork\":\"⫚\",\"tosa\":\"⤩\",\"tprime\":\"‴\",\"trade\":\"™\",\"TRADE\":\"™\",\"triangle\":\"▵\",\"triangledown\":\"▿\",\"triangleleft\":\"◃\",\"trianglelefteq\":\"⊴\",\"triangleq\":\"≜\",\"triangleright\":\"▹\",\"trianglerighteq\":\"⊵\",\"tridot\":\"◬\",\"trie\":\"≜\",\"triminus\":\"⨺\",\"TripleDot\":\"⃛\",\"triplus\":\"⨹\",\"trisb\":\"⧍\",\"tritime\":\"⨻\",\"trpezium\":\"⏢\",\"Tscr\":\"𝒯\",\"tscr\":\"𝓉\",\"TScy\":\"Ц\",\"tscy\":\"ц\",\"TSHcy\":\"Ћ\",\"tshcy\":\"ћ\",\"Tstrok\":\"Ŧ\",\"tstrok\":\"ŧ\",\"twixt\":\"≬\",\"twoheadleftarrow\":\"↞\",\"twoheadrightarrow\":\"↠\",\"Uacute\":\"Ú\",\"uacute\":\"ú\",\"uarr\":\"↑\",\"Uarr\":\"↟\",\"uArr\":\"⇑\",\"Uarrocir\":\"⥉\",\"Ubrcy\":\"Ў\",\"ubrcy\":\"ў\",\"Ubreve\":\"Ŭ\",\"ubreve\":\"ŭ\",\"Ucirc\":\"Û\",\"ucirc\":\"û\",\"Ucy\":\"У\",\"ucy\":\"у\",\"udarr\":\"⇅\",\"Udblac\":\"Ű\",\"udblac\":\"ű\",\"udhar\":\"⥮\",\"ufisht\":\"⥾\",\"Ufr\":\"𝔘\",\"ufr\":\"𝔲\",\"Ugrave\":\"Ù\",\"ugrave\":\"ù\",\"uHar\":\"⥣\",\"uharl\":\"↿\",\"uharr\":\"↾\",\"uhblk\":\"▀\",\"ulcorn\":\"⌜\",\"ulcorner\":\"⌜\",\"ulcrop\":\"⌏\",\"ultri\":\"◸\",\"Umacr\":\"Ū\",\"umacr\":\"ū\",\"uml\":\"¨\",\"UnderBar\":\"_\",\"UnderBrace\":\"⏟\",\"UnderBracket\":\"⎵\",\"UnderParenthesis\":\"⏝\",\"Union\":\"⋃\",\"UnionPlus\":\"⊎\",\"Uogon\":\"Ų\",\"uogon\":\"ų\",\"Uopf\":\"𝕌\",\"uopf\":\"𝕦\",\"UpArrowBar\":\"⤒\",\"uparrow\":\"↑\",\"UpArrow\":\"↑\",\"Uparrow\":\"⇑\",\"UpArrowDownArrow\":\"⇅\",\"updownarrow\":\"↕\",\"UpDownArrow\":\"↕\",\"Updownarrow\":\"⇕\",\"UpEquilibrium\":\"⥮\",\"upharpoonleft\":\"↿\",\"upharpoonright\":\"↾\",\"uplus\":\"⊎\",\"UpperLeftArrow\":\"↖\",\"UpperRightArrow\":\"↗\",\"upsi\":\"υ\",\"Upsi\":\"ϒ\",\"upsih\":\"ϒ\",\"Upsilon\":\"Υ\",\"upsilon\":\"υ\",\"UpTeeArrow\":\"↥\",\"UpTee\":\"⊥\",\"upuparrows\":\"⇈\",\"urcorn\":\"⌝\",\"urcorner\":\"⌝\",\"urcrop\":\"⌎\",\"Uring\":\"Ů\",\"uring\":\"ů\",\"urtri\":\"◹\",\"Uscr\":\"𝒰\",\"uscr\":\"𝓊\",\"utdot\":\"⋰\",\"Utilde\":\"Ũ\",\"utilde\":\"ũ\",\"utri\":\"▵\",\"utrif\":\"▴\",\"uuarr\":\"⇈\",\"Uuml\":\"Ü\",\"uuml\":\"ü\",\"uwangle\":\"⦧\",\"vangrt\":\"⦜\",\"varepsilon\":\"ϵ\",\"varkappa\":\"ϰ\",\"varnothing\":\"∅\",\"varphi\":\"ϕ\",\"varpi\":\"ϖ\",\"varpropto\":\"∝\",\"varr\":\"↕\",\"vArr\":\"⇕\",\"varrho\":\"ϱ\",\"varsigma\":\"ς\",\"varsubsetneq\":\"⊊︀\",\"varsubsetneqq\":\"⫋︀\",\"varsupsetneq\":\"⊋︀\",\"varsupsetneqq\":\"⫌︀\",\"vartheta\":\"ϑ\",\"vartriangleleft\":\"⊲\",\"vartriangleright\":\"⊳\",\"vBar\":\"⫨\",\"Vbar\":\"⫫\",\"vBarv\":\"⫩\",\"Vcy\":\"В\",\"vcy\":\"в\",\"vdash\":\"⊢\",\"vDash\":\"⊨\",\"Vdash\":\"⊩\",\"VDash\":\"⊫\",\"Vdashl\":\"⫦\",\"veebar\":\"⊻\",\"vee\":\"∨\",\"Vee\":\"⋁\",\"veeeq\":\"≚\",\"vellip\":\"⋮\",\"verbar\":\"|\",\"Verbar\":\"‖\",\"vert\":\"|\",\"Vert\":\"‖\",\"VerticalBar\":\"∣\",\"VerticalLine\":\"|\",\"VerticalSeparator\":\"❘\",\"VerticalTilde\":\"≀\",\"VeryThinSpace\":\" \",\"Vfr\":\"𝔙\",\"vfr\":\"𝔳\",\"vltri\":\"⊲\",\"vnsub\":\"⊂⃒\",\"vnsup\":\"⊃⃒\",\"Vopf\":\"𝕍\",\"vopf\":\"𝕧\",\"vprop\":\"∝\",\"vrtri\":\"⊳\",\"Vscr\":\"𝒱\",\"vscr\":\"𝓋\",\"vsubnE\":\"⫋︀\",\"vsubne\":\"⊊︀\",\"vsupnE\":\"⫌︀\",\"vsupne\":\"⊋︀\",\"Vvdash\":\"⊪\",\"vzigzag\":\"⦚\",\"Wcirc\":\"Ŵ\",\"wcirc\":\"ŵ\",\"wedbar\":\"⩟\",\"wedge\":\"∧\",\"Wedge\":\"⋀\",\"wedgeq\":\"≙\",\"weierp\":\"℘\",\"Wfr\":\"𝔚\",\"wfr\":\"𝔴\",\"Wopf\":\"𝕎\",\"wopf\":\"𝕨\",\"wp\":\"℘\",\"wr\":\"≀\",\"wreath\":\"≀\",\"Wscr\":\"𝒲\",\"wscr\":\"𝓌\",\"xcap\":\"⋂\",\"xcirc\":\"◯\",\"xcup\":\"⋃\",\"xdtri\":\"▽\",\"Xfr\":\"𝔛\",\"xfr\":\"𝔵\",\"xharr\":\"⟷\",\"xhArr\":\"⟺\",\"Xi\":\"Ξ\",\"xi\":\"ξ\",\"xlarr\":\"⟵\",\"xlArr\":\"⟸\",\"xmap\":\"⟼\",\"xnis\":\"⋻\",\"xodot\":\"⨀\",\"Xopf\":\"𝕏\",\"xopf\":\"𝕩\",\"xoplus\":\"⨁\",\"xotime\":\"⨂\",\"xrarr\":\"⟶\",\"xrArr\":\"⟹\",\"Xscr\":\"𝒳\",\"xscr\":\"𝓍\",\"xsqcup\":\"⨆\",\"xuplus\":\"⨄\",\"xutri\":\"△\",\"xvee\":\"⋁\",\"xwedge\":\"⋀\",\"Yacute\":\"Ý\",\"yacute\":\"ý\",\"YAcy\":\"Я\",\"yacy\":\"я\",\"Ycirc\":\"Ŷ\",\"ycirc\":\"ŷ\",\"Ycy\":\"Ы\",\"ycy\":\"ы\",\"yen\":\"¥\",\"Yfr\":\"𝔜\",\"yfr\":\"𝔶\",\"YIcy\":\"Ї\",\"yicy\":\"ї\",\"Yopf\":\"𝕐\",\"yopf\":\"𝕪\",\"Yscr\":\"𝒴\",\"yscr\":\"𝓎\",\"YUcy\":\"Ю\",\"yucy\":\"ю\",\"yuml\":\"ÿ\",\"Yuml\":\"Ÿ\",\"Zacute\":\"Ź\",\"zacute\":\"ź\",\"Zcaron\":\"Ž\",\"zcaron\":\"ž\",\"Zcy\":\"З\",\"zcy\":\"з\",\"Zdot\":\"Ż\",\"zdot\":\"ż\",\"zeetrf\":\"ℨ\",\"ZeroWidthSpace\":\"\",\"Zeta\":\"Ζ\",\"zeta\":\"ζ\",\"zfr\":\"𝔷\",\"Zfr\":\"ℨ\",\"ZHcy\":\"Ж\",\"zhcy\":\"ж\",\"zigrarr\":\"⇝\",\"zopf\":\"𝕫\",\"Zopf\":\"ℤ\",\"Zscr\":\"𝒵\",\"zscr\":\"𝓏\",\"zwj\":\"\",\"zwnj\":\"\"}"); /***/ }), /* 477 */ /***/ (function(module) { module.exports = JSON.parse("{\"Aacute\":\"Á\",\"aacute\":\"á\",\"Acirc\":\"Â\",\"acirc\":\"â\",\"acute\":\"´\",\"AElig\":\"Æ\",\"aelig\":\"æ\",\"Agrave\":\"À\",\"agrave\":\"à\",\"amp\":\"&\",\"AMP\":\"&\",\"Aring\":\"Å\",\"aring\":\"å\",\"Atilde\":\"Ã\",\"atilde\":\"ã\",\"Auml\":\"Ä\",\"auml\":\"ä\",\"brvbar\":\"¦\",\"Ccedil\":\"Ç\",\"ccedil\":\"ç\",\"cedil\":\"¸\",\"cent\":\"¢\",\"copy\":\"©\",\"COPY\":\"©\",\"curren\":\"¤\",\"deg\":\"°\",\"divide\":\"÷\",\"Eacute\":\"É\",\"eacute\":\"é\",\"Ecirc\":\"Ê\",\"ecirc\":\"ê\",\"Egrave\":\"È\",\"egrave\":\"è\",\"ETH\":\"Ð\",\"eth\":\"ð\",\"Euml\":\"Ë\",\"euml\":\"ë\",\"frac12\":\"½\",\"frac14\":\"¼\",\"frac34\":\"¾\",\"gt\":\">\",\"GT\":\">\",\"Iacute\":\"Í\",\"iacute\":\"í\",\"Icirc\":\"Î\",\"icirc\":\"î\",\"iexcl\":\"¡\",\"Igrave\":\"Ì\",\"igrave\":\"ì\",\"iquest\":\"¿\",\"Iuml\":\"Ï\",\"iuml\":\"ï\",\"laquo\":\"«\",\"lt\":\"<\",\"LT\":\"<\",\"macr\":\"¯\",\"micro\":\"µ\",\"middot\":\"·\",\"nbsp\":\" \",\"not\":\"¬\",\"Ntilde\":\"Ñ\",\"ntilde\":\"ñ\",\"Oacute\":\"Ó\",\"oacute\":\"ó\",\"Ocirc\":\"Ô\",\"ocirc\":\"ô\",\"Ograve\":\"Ò\",\"ograve\":\"ò\",\"ordf\":\"ª\",\"ordm\":\"º\",\"Oslash\":\"Ø\",\"oslash\":\"ø\",\"Otilde\":\"Õ\",\"otilde\":\"õ\",\"Ouml\":\"Ö\",\"ouml\":\"ö\",\"para\":\"¶\",\"plusmn\":\"±\",\"pound\":\"£\",\"quot\":\"\\\"\",\"QUOT\":\"\\\"\",\"raquo\":\"»\",\"reg\":\"®\",\"REG\":\"®\",\"sect\":\"§\",\"shy\":\"\",\"sup1\":\"¹\",\"sup2\":\"²\",\"sup3\":\"³\",\"szlig\":\"ß\",\"THORN\":\"Þ\",\"thorn\":\"þ\",\"times\":\"×\",\"Uacute\":\"Ú\",\"uacute\":\"ú\",\"Ucirc\":\"Û\",\"ucirc\":\"û\",\"Ugrave\":\"Ù\",\"ugrave\":\"ù\",\"uml\":\"¨\",\"Uuml\":\"Ü\",\"uuml\":\"ü\",\"Yacute\":\"Ý\",\"yacute\":\"ý\",\"yen\":\"¥\",\"yuml\":\"ÿ\"}"); /***/ }), /* 478 */ /***/ (function(module) { module.exports = JSON.parse("{\"amp\":\"&\",\"apos\":\"'\",\"gt\":\">\",\"lt\":\"<\",\"quot\":\"\\\"\"}"); /***/ }), /* 479 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var decode_json_1 = __importDefault(__webpack_require__(480)); // modified version of https://github.com/mathiasbynens/he/blob/master/src/he.js#L94-L119 function decodeCodePoint(codePoint) { if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) { return "\uFFFD"; } if (codePoint in decode_json_1.default) { // @ts-ignore codePoint = decode_json_1.default[codePoint]; } var output = ""; if (codePoint > 0xffff) { codePoint -= 0x10000; output += String.fromCharCode(((codePoint >>> 10) & 0x3ff) | 0xd800); codePoint = 0xdc00 | (codePoint & 0x3ff); } output += String.fromCharCode(codePoint); return output; } exports.default = decodeCodePoint; /***/ }), /* 480 */ /***/ (function(module) { module.exports = JSON.parse("{\"0\":65533,\"128\":8364,\"130\":8218,\"131\":402,\"132\":8222,\"133\":8230,\"134\":8224,\"135\":8225,\"136\":710,\"137\":8240,\"138\":352,\"139\":8249,\"140\":338,\"142\":381,\"145\":8216,\"146\":8217,\"147\":8220,\"148\":8221,\"149\":8226,\"150\":8211,\"151\":8212,\"152\":732,\"153\":8482,\"154\":353,\"155\":8250,\"156\":339,\"158\":382,\"159\":376}"); /***/ }), /* 481 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var xml_json_1 = __importDefault(__webpack_require__(478)); var inverseXML = getInverseObj(xml_json_1.default); var xmlReplacer = getInverseReplacer(inverseXML); exports.encodeXML = getInverse(inverseXML, xmlReplacer); var entities_json_1 = __importDefault(__webpack_require__(476)); var inverseHTML = getInverseObj(entities_json_1.default); var htmlReplacer = getInverseReplacer(inverseHTML); exports.encodeHTML = getInverse(inverseHTML, htmlReplacer); function getInverseObj(obj) { return Object.keys(obj) .sort() .reduce(function (inverse, name) { inverse[obj[name]] = "&" + name + ";"; return inverse; }, {}); } function getInverseReplacer(inverse) { var single = []; var multiple = []; Object.keys(inverse).forEach(function (k) { return k.length === 1 ? // Add value to single array single.push("\\" + k) : // Add value to multiple array multiple.push(k); }); //TODO add ranges multiple.unshift("[" + single.join("") + "]"); return new RegExp(multiple.join("|"), "g"); } var reNonASCII = /[^\0-\x7F]/g; var reAstralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; function singleCharReplacer(c) { return "&#x" + c .charCodeAt(0) .toString(16) .toUpperCase() + ";"; } // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any function astralReplacer(c, _) { // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae var high = c.charCodeAt(0); var low = c.charCodeAt(1); var codePoint = (high - 0xd800) * 0x400 + low - 0xdc00 + 0x10000; return "&#x" + codePoint.toString(16).toUpperCase() + ";"; } function getInverse(inverse, re) { return function (data) { return data .replace(re, function (name) { return inverse[name]; }) .replace(reAstralSymbols, astralReplacer) .replace(reNonASCII, singleCharReplacer); }; } var reXmlChars = getInverseReplacer(inverseXML); function escape(data) { return data .replace(reXmlChars, singleCharReplacer) .replace(reAstralSymbols, astralReplacer) .replace(reNonASCII, singleCharReplacer); } exports.escape = escape; /***/ }), /* 482 */ /***/ (function(module) { module.exports = JSON.parse("{\"elementNames\":{\"altglyph\":\"altGlyph\",\"altglyphdef\":\"altGlyphDef\",\"altglyphitem\":\"altGlyphItem\",\"animatecolor\":\"animateColor\",\"animatemotion\":\"animateMotion\",\"animatetransform\":\"animateTransform\",\"clippath\":\"clipPath\",\"feblend\":\"feBlend\",\"fecolormatrix\":\"feColorMatrix\",\"fecomponenttransfer\":\"feComponentTransfer\",\"fecomposite\":\"feComposite\",\"feconvolvematrix\":\"feConvolveMatrix\",\"fediffuselighting\":\"feDiffuseLighting\",\"fedisplacementmap\":\"feDisplacementMap\",\"fedistantlight\":\"feDistantLight\",\"fedropshadow\":\"feDropShadow\",\"feflood\":\"feFlood\",\"fefunca\":\"feFuncA\",\"fefuncb\":\"feFuncB\",\"fefuncg\":\"feFuncG\",\"fefuncr\":\"feFuncR\",\"fegaussianblur\":\"feGaussianBlur\",\"feimage\":\"feImage\",\"femerge\":\"feMerge\",\"femergenode\":\"feMergeNode\",\"femorphology\":\"feMorphology\",\"feoffset\":\"feOffset\",\"fepointlight\":\"fePointLight\",\"fespecularlighting\":\"feSpecularLighting\",\"fespotlight\":\"feSpotLight\",\"fetile\":\"feTile\",\"feturbulence\":\"feTurbulence\",\"foreignobject\":\"foreignObject\",\"glyphref\":\"glyphRef\",\"lineargradient\":\"linearGradient\",\"radialgradient\":\"radialGradient\",\"textpath\":\"textPath\"},\"attributeNames\":{\"definitionurl\":\"definitionURL\",\"attributename\":\"attributeName\",\"attributetype\":\"attributeType\",\"basefrequency\":\"baseFrequency\",\"baseprofile\":\"baseProfile\",\"calcmode\":\"calcMode\",\"clippathunits\":\"clipPathUnits\",\"diffuseconstant\":\"diffuseConstant\",\"edgemode\":\"edgeMode\",\"filterunits\":\"filterUnits\",\"glyphref\":\"glyphRef\",\"gradienttransform\":\"gradientTransform\",\"gradientunits\":\"gradientUnits\",\"kernelmatrix\":\"kernelMatrix\",\"kernelunitlength\":\"kernelUnitLength\",\"keypoints\":\"keyPoints\",\"keysplines\":\"keySplines\",\"keytimes\":\"keyTimes\",\"lengthadjust\":\"lengthAdjust\",\"limitingconeangle\":\"limitingConeAngle\",\"markerheight\":\"markerHeight\",\"markerunits\":\"markerUnits\",\"markerwidth\":\"markerWidth\",\"maskcontentunits\":\"maskContentUnits\",\"maskunits\":\"maskUnits\",\"numoctaves\":\"numOctaves\",\"pathlength\":\"pathLength\",\"patterncontentunits\":\"patternContentUnits\",\"patterntransform\":\"patternTransform\",\"patternunits\":\"patternUnits\",\"pointsatx\":\"pointsAtX\",\"pointsaty\":\"pointsAtY\",\"pointsatz\":\"pointsAtZ\",\"preservealpha\":\"preserveAlpha\",\"preserveaspectratio\":\"preserveAspectRatio\",\"primitiveunits\":\"primitiveUnits\",\"refx\":\"refX\",\"refy\":\"refY\",\"repeatcount\":\"repeatCount\",\"repeatdur\":\"repeatDur\",\"requiredextensions\":\"requiredExtensions\",\"requiredfeatures\":\"requiredFeatures\",\"specularconstant\":\"specularConstant\",\"specularexponent\":\"specularExponent\",\"spreadmethod\":\"spreadMethod\",\"startoffset\":\"startOffset\",\"stddeviation\":\"stdDeviation\",\"stitchtiles\":\"stitchTiles\",\"surfacescale\":\"surfaceScale\",\"systemlanguage\":\"systemLanguage\",\"tablevalues\":\"tableValues\",\"targetx\":\"targetX\",\"targety\":\"targetY\",\"textlength\":\"textLength\",\"viewbox\":\"viewBox\",\"viewtarget\":\"viewTarget\",\"xchannelselector\":\"xChannelSelector\",\"ychannelselector\":\"yChannelSelector\",\"zoomandpan\":\"zoomAndPan\"}}"); /***/ }), /* 483 */ /***/ (function(module, exports) { var getChildren = exports.getChildren = function(elem){ return elem.children; }; var getParent = exports.getParent = function(elem){ return elem.parent; }; exports.getSiblings = function(elem){ var parent = getParent(elem); return parent ? getChildren(parent) : [elem]; }; exports.getAttributeValue = function(elem, name){ return elem.attribs && elem.attribs[name]; }; exports.hasAttrib = function(elem, name){ return !!elem.attribs && hasOwnProperty.call(elem.attribs, name); }; exports.getName = function(elem){ return elem.name; }; /***/ }), /* 484 */ /***/ (function(module, exports) { exports.removeElement = function(elem){ if(elem.prev) elem.prev.next = elem.next; if(elem.next) elem.next.prev = elem.prev; if(elem.parent){ var childs = elem.parent.children; childs.splice(childs.lastIndexOf(elem), 1); } }; exports.replaceElement = function(elem, replacement){ var prev = replacement.prev = elem.prev; if(prev){ prev.next = replacement; } var next = replacement.next = elem.next; if(next){ next.prev = replacement; } var parent = replacement.parent = elem.parent; if(parent){ var childs = parent.children; childs[childs.lastIndexOf(elem)] = replacement; } }; exports.appendChild = function(elem, child){ child.parent = elem; if(elem.children.push(child) !== 1){ var sibling = elem.children[elem.children.length - 2]; sibling.next = child; child.prev = sibling; child.next = null; } }; exports.append = function(elem, next){ var parent = elem.parent, currNext = elem.next; next.next = currNext; next.prev = elem; elem.next = next; next.parent = parent; if(currNext){ currNext.prev = next; if(parent){ var childs = parent.children; childs.splice(childs.lastIndexOf(currNext), 0, next); } } else if(parent){ parent.children.push(next); } }; exports.prepend = function(elem, prev){ var parent = elem.parent; if(parent){ var childs = parent.children; childs.splice(childs.lastIndexOf(elem), 0, prev); } if(elem.prev){ elem.prev.next = prev; } prev.parent = parent; prev.prev = elem.prev; prev.next = elem; elem.prev = prev; }; /***/ }), /* 485 */ /***/ (function(module, exports, __webpack_require__) { var isTag = __webpack_require__(293).isTag; module.exports = { filter: filter, find: find, findOneChild: findOneChild, findOne: findOne, existsOne: existsOne, findAll: findAll }; function filter(test, element, recurse, limit){ if(!Array.isArray(element)) element = [element]; if(typeof limit !== "number" || !isFinite(limit)){ limit = Infinity; } return find(test, element, recurse !== false, limit); } function find(test, elems, recurse, limit){ var result = [], childs; for(var i = 0, j = elems.length; i < j; i++){ if(test(elems[i])){ result.push(elems[i]); if(--limit <= 0) break; } childs = elems[i].children; if(recurse && childs && childs.length > 0){ childs = find(test, childs, recurse, limit); result = result.concat(childs); limit -= childs.length; if(limit <= 0) break; } } return result; } function findOneChild(test, elems){ for(var i = 0, l = elems.length; i < l; i++){ if(test(elems[i])) return elems[i]; } return null; } function findOne(test, elems){ var elem = null; for(var i = 0, l = elems.length; i < l && !elem; i++){ if(!isTag(elems[i])){ continue; } else if(test(elems[i])){ elem = elems[i]; } else if(elems[i].children.length > 0){ elem = findOne(test, elems[i].children); } } return elem; } function existsOne(test, elems){ for(var i = 0, l = elems.length; i < l; i++){ if( isTag(elems[i]) && ( test(elems[i]) || ( elems[i].children.length > 0 && existsOne(test, elems[i].children) ) ) ){ return true; } } return false; } function findAll(test, elems){ var result = []; for(var i = 0, j = elems.length; i < j; i++){ if(!isTag(elems[i])) continue; if(test(elems[i])) result.push(elems[i]); if(elems[i].children.length > 0){ result = result.concat(findAll(test, elems[i].children)); } } return result; } /***/ }), /* 486 */ /***/ (function(module, exports, __webpack_require__) { var ElementType = __webpack_require__(293); var isTag = exports.isTag = ElementType.isTag; exports.testElement = function(options, element){ for(var key in options){ if(!options.hasOwnProperty(key)); else if(key === "tag_name"){ if(!isTag(element) || !options.tag_name(element.name)){ return false; } } else if(key === "tag_type"){ if(!options.tag_type(element.type)) return false; } else if(key === "tag_contains"){ if(isTag(element) || !options.tag_contains(element.data)){ return false; } } else if(!element.attribs || !options[key](element.attribs[key])){ return false; } } return true; }; var Checks = { tag_name: function(name){ if(typeof name === "function"){ return function(elem){ return isTag(elem) && name(elem.name); }; } else if(name === "*"){ return isTag; } else { return function(elem){ return isTag(elem) && elem.name === name; }; } }, tag_type: function(type){ if(typeof type === "function"){ return function(elem){ return type(elem.type); }; } else { return function(elem){ return elem.type === type; }; } }, tag_contains: function(data){ if(typeof data === "function"){ return function(elem){ return !isTag(elem) && data(elem.data); }; } else { return function(elem){ return !isTag(elem) && elem.data === data; }; } } }; function getAttribCheck(attrib, value){ if(typeof value === "function"){ return function(elem){ return elem.attribs && value(elem.attribs[attrib]); }; } else { return function(elem){ return elem.attribs && elem.attribs[attrib] === value; }; } } function combineFuncs(a, b){ return function(elem){ return a(elem) || b(elem); }; } exports.getElements = function(options, element, recurse, limit){ var funcs = Object.keys(options).map(function(key){ var value = options[key]; return key in Checks ? Checks[key](value) : getAttribCheck(key, value); }); return funcs.length === 0 ? [] : this.filter( funcs.reduce(combineFuncs), element, recurse, limit ); }; exports.getElementById = function(id, element, recurse){ if(!Array.isArray(element)) element = [element]; return this.findOne(getAttribCheck("id", id), element, recurse !== false); }; exports.getElementsByTagName = function(name, element, recurse, limit){ return this.filter(Checks.tag_name(name), element, recurse, limit); }; exports.getElementsByTagType = function(type, element, recurse, limit){ return this.filter(Checks.tag_type(type), element, recurse, limit); }; /***/ }), /* 487 */ /***/ (function(module, exports) { // removeSubsets // Given an array of nodes, remove any member that is contained by another. exports.removeSubsets = function(nodes) { var idx = nodes.length, node, ancestor, replace; // Check if each node (or one of its ancestors) is already contained in the // array. while (--idx > -1) { node = ancestor = nodes[idx]; // Temporarily remove the node under consideration nodes[idx] = null; replace = true; while (ancestor) { if (nodes.indexOf(ancestor) > -1) { replace = false; nodes.splice(idx, 1); break; } ancestor = ancestor.parent; } // If the node has been found to be unique, re-insert it. if (replace) { nodes[idx] = node; } } return nodes; }; // Source: http://dom.spec.whatwg.org/#dom-node-comparedocumentposition var POSITION = { DISCONNECTED: 1, PRECEDING: 2, FOLLOWING: 4, CONTAINS: 8, CONTAINED_BY: 16 }; // Compare the position of one node against another node in any other document. // The return value is a bitmask with the following values: // // document order: // > There is an ordering, document order, defined on all the nodes in the // > document corresponding to the order in which the first character of the // > XML representation of each node occurs in the XML representation of the // > document after expansion of general entities. Thus, the document element // > node will be the first node. Element nodes occur before their children. // > Thus, document order orders element nodes in order of the occurrence of // > their start-tag in the XML (after expansion of entities). The attribute // > nodes of an element occur after the element and before its children. The // > relative order of attribute nodes is implementation-dependent./ // Source: // http://www.w3.org/TR/DOM-Level-3-Core/glossary.html#dt-document-order // // @argument {Node} nodaA The first node to use in the comparison // @argument {Node} nodeB The second node to use in the comparison // // @return {Number} A bitmask describing the input nodes' relative position. // See http://dom.spec.whatwg.org/#dom-node-comparedocumentposition for // a description of these values. var comparePos = exports.compareDocumentPosition = function(nodeA, nodeB) { var aParents = []; var bParents = []; var current, sharedParent, siblings, aSibling, bSibling, idx; if (nodeA === nodeB) { return 0; } current = nodeA; while (current) { aParents.unshift(current); current = current.parent; } current = nodeB; while (current) { bParents.unshift(current); current = current.parent; } idx = 0; while (aParents[idx] === bParents[idx]) { idx++; } if (idx === 0) { return POSITION.DISCONNECTED; } sharedParent = aParents[idx - 1]; siblings = sharedParent.children; aSibling = aParents[idx]; bSibling = bParents[idx]; if (siblings.indexOf(aSibling) > siblings.indexOf(bSibling)) { if (sharedParent === nodeB) { return POSITION.FOLLOWING | POSITION.CONTAINED_BY; } return POSITION.FOLLOWING; } else { if (sharedParent === nodeA) { return POSITION.PRECEDING | POSITION.CONTAINS; } return POSITION.PRECEDING; } }; // Sort an array of nodes based on their relative position in the document and // remove any duplicate nodes. If the array contains nodes that do not belong // to the same document, sort order is unspecified. // // @argument {Array} nodes Array of DOM nodes // // @returns {Array} collection of unique nodes, sorted in document order exports.uniqueSort = function(nodes) { var idx = nodes.length, node, position; nodes = nodes.slice(); while (--idx > -1) { node = nodes[idx]; position = nodes.indexOf(node); if (position > -1 && position < idx) { nodes.splice(idx, 1); } } nodes.sort(function(a, b) { var relative = comparePos(a, b); if (relative & POSITION.PRECEDING) { return -1; } else if (relative & POSITION.FOLLOWING) { return 1; } return 0; }); return nodes; }; /***/ }), /* 488 */ /***/ (function(module, exports, __webpack_require__) { var parse = __webpack_require__(489), compile = __webpack_require__(490); module.exports = function nthCheck(formula){ return compile(parse(formula)); }; module.exports.parse = parse; module.exports.compile = compile; /***/ }), /* 489 */ /***/ (function(module, exports) { module.exports = parse; //following http://www.w3.org/TR/css3-selectors/#nth-child-pseudo //[ ['-'|'+']? INTEGER? {N} [ S* ['-'|'+'] S* INTEGER ]? var re_nthElement = /^([+\-]?\d*n)?\s*(?:([+\-]?)\s*(\d+))?$/; /* parses a nth-check formula, returns an array of two numbers */ function parse(formula){ formula = formula.trim().toLowerCase(); if(formula === "even"){ return [2, 0]; } else if(formula === "odd"){ return [2, 1]; } else { var parsed = formula.match(re_nthElement); if(!parsed){ throw new SyntaxError("n-th rule couldn't be parsed ('" + formula + "')"); } var a; if(parsed[1]){ a = parseInt(parsed[1], 10); if(isNaN(a)){ if(parsed[1].charAt(0) === "-") a = -1; else a = 1; } } else a = 0; return [ a, parsed[3] ? parseInt((parsed[2] || "") + parsed[3], 10) : 0 ]; } } /***/ }), /* 490 */ /***/ (function(module, exports, __webpack_require__) { module.exports = compile; var BaseFuncs = __webpack_require__(491), trueFunc = BaseFuncs.trueFunc, falseFunc = BaseFuncs.falseFunc; /* returns a function that checks if an elements index matches the given rule highly optimized to return the fastest solution */ function compile(parsed){ var a = parsed[0], b = parsed[1] - 1; //when b <= 0, a*n won't be possible for any matches when a < 0 //besides, the specification says that no element is matched when a and b are 0 if(b < 0 && a <= 0) return falseFunc; //when a is in the range -1..1, it matches any element (so only b is checked) if(a ===-1) return function(pos){ return pos <= b; }; if(a === 0) return function(pos){ return pos === b; }; //when b <= 0 and a === 1, they match any element if(a === 1) return b < 0 ? trueFunc : function(pos){ return pos >= b; }; //when a > 0, modulo can be used to check if there is a match var bMod = b % a; if(bMod < 0) bMod += a; if(a > 1){ return function(pos){ return pos >= b && pos % a === bMod; }; } a *= -1; //make `a` positive return function(pos){ return pos <= b && pos % a === bMod; }; } /***/ }), /* 491 */ /***/ (function(module, exports) { module.exports = { trueFunc: function trueFunc(){ return true; }, falseFunc: function falseFunc(){ return false; } }; /***/ }), /* 492 */ /***/ (function(module, exports, __webpack_require__) { var DomUtils = __webpack_require__(470), hasAttrib = DomUtils.hasAttrib, getAttributeValue = DomUtils.getAttributeValue, falseFunc = __webpack_require__(491).falseFunc; //https://github.com/slevithan/XRegExp/blob/master/src/xregexp.js#L469 var reChars = /[-[\]{}()*+?.,\\^$|#\s]/g; /* attribute selectors */ var attributeRules = { __proto__: null, equals: function(next, data){ var name = data.name, value = data.value; if(data.ignoreCase){ value = value.toLowerCase(); return function equalsIC(elem){ var attr = getAttributeValue(elem, name); return attr != null && attr.toLowerCase() === value && next(elem); }; } return function equals(elem){ return getAttributeValue(elem, name) === value && next(elem); }; }, hyphen: function(next, data){ var name = data.name, value = data.value, len = value.length; if(data.ignoreCase){ value = value.toLowerCase(); return function hyphenIC(elem){ var attr = getAttributeValue(elem, name); return attr != null && (attr.length === len || attr.charAt(len) === "-") && attr.substr(0, len).toLowerCase() === value && next(elem); }; } return function hyphen(elem){ var attr = getAttributeValue(elem, name); return attr != null && attr.substr(0, len) === value && (attr.length === len || attr.charAt(len) === "-") && next(elem); }; }, element: function(next, data){ var name = data.name, value = data.value; if(/\s/.test(value)){ return falseFunc; } value = value.replace(reChars, "\\$&"); var pattern = "(?:^|\\s)" + value + "(?:$|\\s)", flags = data.ignoreCase ? "i" : "", regex = new RegExp(pattern, flags); return function element(elem){ var attr = getAttributeValue(elem, name); return attr != null && regex.test(attr) && next(elem); }; }, exists: function(next, data){ var name = data.name; return function exists(elem){ return hasAttrib(elem, name) && next(elem); }; }, start: function(next, data){ var name = data.name, value = data.value, len = value.length; if(len === 0){ return falseFunc; } if(data.ignoreCase){ value = value.toLowerCase(); return function startIC(elem){ var attr = getAttributeValue(elem, name); return attr != null && attr.substr(0, len).toLowerCase() === value && next(elem); }; } return function start(elem){ var attr = getAttributeValue(elem, name); return attr != null && attr.substr(0, len) === value && next(elem); }; }, end: function(next, data){ var name = data.name, value = data.value, len = -value.length; if(len === 0){ return falseFunc; } if(data.ignoreCase){ value = value.toLowerCase(); return function endIC(elem){ var attr = getAttributeValue(elem, name); return attr != null && attr.substr(len).toLowerCase() === value && next(elem); }; } return function end(elem){ var attr = getAttributeValue(elem, name); return attr != null && attr.substr(len) === value && next(elem); }; }, any: function(next, data){ var name = data.name, value = data.value; if(value === ""){ return falseFunc; } if(data.ignoreCase){ var regex = new RegExp(value.replace(reChars, "\\$&"), "i"); return function anyIC(elem){ var attr = getAttributeValue(elem, name); return attr != null && regex.test(attr) && next(elem); }; } return function any(elem){ var attr = getAttributeValue(elem, name); return attr != null && attr.indexOf(value) >= 0 && next(elem); }; }, not: function(next, data){ var name = data.name, value = data.value; if(value === ""){ return function notEmpty(elem){ return !!getAttributeValue(elem, name) && next(elem); }; } else if(data.ignoreCase){ value = value.toLowerCase(); return function notIC(elem){ var attr = getAttributeValue(elem, name); return attr != null && attr.toLowerCase() !== value && next(elem); }; } return function not(elem){ return getAttributeValue(elem, name) !== value && next(elem); }; } }; module.exports = { compile: function(next, data, options){ if(options && options.strict && ( data.ignoreCase || data.action === "not" )) throw SyntaxError("Unsupported attribute selector"); return attributeRules[data.action](next, data); }, rules: attributeRules }; /***/ }), /* 493 */ /***/ (function(module, exports, __webpack_require__) { /* compiles a selector to an executable function */ module.exports = compile; module.exports.compileUnsafe = compileUnsafe; module.exports.compileToken = compileToken; var parse = __webpack_require__(494), DomUtils = __webpack_require__(470), isTag = DomUtils.isTag, Rules = __webpack_require__(495), sortRules = __webpack_require__(496), BaseFuncs = __webpack_require__(491), trueFunc = BaseFuncs.trueFunc, falseFunc = BaseFuncs.falseFunc, procedure = __webpack_require__(497); function compile(selector, options, context){ var next = compileUnsafe(selector, options, context); return wrap(next); } function wrap(next){ return function base(elem){ return isTag(elem) && next(elem); }; } function compileUnsafe(selector, options, context){ var token = parse(selector, options); return compileToken(token, options, context); } function includesScopePseudo(t){ return t.type === "pseudo" && ( t.name === "scope" || ( Array.isArray(t.data) && t.data.some(function(data){ return data.some(includesScopePseudo); }) ) ); } var DESCENDANT_TOKEN = {type: "descendant"}, SCOPE_TOKEN = {type: "pseudo", name: "scope"}, PLACEHOLDER_ELEMENT = {}, getParent = DomUtils.getParent; //CSS 4 Spec (Draft): 3.3.1. Absolutizing a Scope-relative Selector //http://www.w3.org/TR/selectors4/#absolutizing function absolutize(token, context){ //TODO better check if context is document var hasContext = !!context && !!context.length && context.every(function(e){ return e === PLACEHOLDER_ELEMENT || !!getParent(e); }); token.forEach(function(t){ if(t.length > 0 && isTraversal(t[0]) && t[0].type !== "descendant"){ //don't return in else branch } else if(hasContext && !includesScopePseudo(t)){ t.unshift(DESCENDANT_TOKEN); } else { return; } t.unshift(SCOPE_TOKEN); }); } function compileToken(token, options, context){ token = token.filter(function(t){ return t.length > 0; }); token.forEach(sortRules); var isArrayContext = Array.isArray(context); context = (options && options.context) || context; if(context && !isArrayContext) context = [context]; absolutize(token, context); return token .map(function(rules){ return compileRules(rules, options, context, isArrayContext); }) .reduce(reduceRules, falseFunc); } function isTraversal(t){ return procedure[t.type] < 0; } function compileRules(rules, options, context, isArrayContext){ var acceptSelf = (isArrayContext && rules[0].name === "scope" && rules[1].type === "descendant"); return rules.reduce(function(func, rule, index){ if(func === falseFunc) return func; return Rules[rule.type](func, rule, options, context, acceptSelf && index === 1); }, options && options.rootFunc || trueFunc); } function reduceRules(a, b){ if(b === falseFunc || a === trueFunc){ return a; } if(a === falseFunc || b === trueFunc){ return b; } return function combine(elem){ return a(elem) || b(elem); }; } //:not, :has and :matches have to compile selectors //doing this in lib/pseudos.js would lead to circular dependencies, //so we add them here var Pseudos = __webpack_require__(469), filters = Pseudos.filters, existsOne = DomUtils.existsOne, isTag = DomUtils.isTag, getChildren = DomUtils.getChildren; function containsTraversal(t){ return t.some(isTraversal); } filters.not = function(next, token, options, context){ var opts = { xmlMode: !!(options && options.xmlMode), strict: !!(options && options.strict) }; if(opts.strict){ if(token.length > 1 || token.some(containsTraversal)){ throw new SyntaxError("complex selectors in :not aren't allowed in strict mode"); } } var func = compileToken(token, opts, context); if(func === falseFunc) return next; if(func === trueFunc) return falseFunc; return function(elem){ return !func(elem) && next(elem); }; }; filters.has = function(next, token, options){ var opts = { xmlMode: !!(options && options.xmlMode), strict: !!(options && options.strict) }; //FIXME: Uses an array as a pointer to the current element (side effects) var context = token.some(containsTraversal) ? [PLACEHOLDER_ELEMENT] : null; var func = compileToken(token, opts, context); if(func === falseFunc) return falseFunc; if(func === trueFunc) return function(elem){ return getChildren(elem).some(isTag) && next(elem); }; func = wrap(func); if(context){ return function has(elem){ return next(elem) && ( (context[0] = elem), existsOne(func, getChildren(elem)) ); }; } return function has(elem){ return next(elem) && existsOne(func, getChildren(elem)); }; }; filters.matches = function(next, token, options, context){ var opts = { xmlMode: !!(options && options.xmlMode), strict: !!(options && options.strict), rootFunc: next }; return compileToken(token, opts, context); }; /***/ }), /* 494 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = parse; var re_name = /^(?:\\.|[\w\-\u00b0-\uFFFF])+/, re_escape = /\\([\da-f]{1,6}\s?|(\s)|.)/ig, //modified version of https://github.com/jquery/sizzle/blob/master/src/sizzle.js#L87 re_attr = /^\s*((?:\\.|[\w\u00b0-\uFFFF\-])+)\s*(?:(\S?)=\s*(?:(['"])([^]*?)\3|(#?(?:\\.|[\w\u00b0-\uFFFF\-])*)|)|)\s*(i)?\]/; var actionTypes = { __proto__: null, "undefined": "exists", "": "equals", "~": "element", "^": "start", "$": "end", "*": "any", "!": "not", "|": "hyphen" }; var simpleSelectors = { __proto__: null, ">": "child", "<": "parent", "~": "sibling", "+": "adjacent" }; var attribSelectors = { __proto__: null, "#": ["id", "equals"], ".": ["class", "element"] }; //pseudos, whose data-property is parsed as well var unpackPseudos = { __proto__: null, "has": true, "not": true, "matches": true }; var stripQuotesFromPseudos = { __proto__: null, "contains": true, "icontains": true }; var quotes = { __proto__: null, "\"": true, "'": true }; //unescape function taken from https://github.com/jquery/sizzle/blob/master/src/sizzle.js#L139 function funescape( _, escaped, escapedWhitespace ) { var high = "0x" + escaped - 0x10000; // NaN means non-codepoint // Support: Firefox // Workaround erroneous numeric interpretation of +"0x" return high !== high || escapedWhitespace ? escaped : // BMP codepoint high < 0 ? String.fromCharCode( high + 0x10000 ) : // Supplemental Plane codepoint (surrogate pair) String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); } function unescapeCSS(str){ return str.replace(re_escape, funescape); } function isWhitespace(c){ return c === " " || c === "\n" || c === "\t" || c === "\f" || c === "\r"; } function parse(selector, options){ var subselects = []; selector = parseSelector(subselects, selector + "", options); if(selector !== ""){ throw new SyntaxError("Unmatched selector: " + selector); } return subselects; } function parseSelector(subselects, selector, options){ var tokens = [], sawWS = false, data, firstChar, name, quot; function getName(){ var sub = selector.match(re_name)[0]; selector = selector.substr(sub.length); return unescapeCSS(sub); } function stripWhitespace(start){ while(isWhitespace(selector.charAt(start))) start++; selector = selector.substr(start); } function isEscaped(pos) { var slashCount = 0; while (selector.charAt(--pos) === "\\") slashCount++; return (slashCount & 1) === 1; } stripWhitespace(0); while(selector !== ""){ firstChar = selector.charAt(0); if(isWhitespace(firstChar)){ sawWS = true; stripWhitespace(1); } else if(firstChar in simpleSelectors){ tokens.push({type: simpleSelectors[firstChar]}); sawWS = false; stripWhitespace(1); } else if(firstChar === ","){ if(tokens.length === 0){ throw new SyntaxError("empty sub-selector"); } subselects.push(tokens); tokens = []; sawWS = false; stripWhitespace(1); } else { if(sawWS){ if(tokens.length > 0){ tokens.push({type: "descendant"}); } sawWS = false; } if(firstChar === "*"){ selector = selector.substr(1); tokens.push({type: "universal"}); } else if(firstChar in attribSelectors){ selector = selector.substr(1); tokens.push({ type: "attribute", name: attribSelectors[firstChar][0], action: attribSelectors[firstChar][1], value: getName(), ignoreCase: false }); } else if(firstChar === "["){ selector = selector.substr(1); data = selector.match(re_attr); if(!data){ throw new SyntaxError("Malformed attribute selector: " + selector); } selector = selector.substr(data[0].length); name = unescapeCSS(data[1]); if( !options || ( "lowerCaseAttributeNames" in options ? options.lowerCaseAttributeNames : !options.xmlMode ) ){ name = name.toLowerCase(); } tokens.push({ type: "attribute", name: name, action: actionTypes[data[2]], value: unescapeCSS(data[4] || data[5] || ""), ignoreCase: !!data[6] }); } else if(firstChar === ":"){ if(selector.charAt(1) === ":"){ selector = selector.substr(2); tokens.push({type: "pseudo-element", name: getName().toLowerCase()}); continue; } selector = selector.substr(1); name = getName().toLowerCase(); data = null; if(selector.charAt(0) === "("){ if(name in unpackPseudos){ quot = selector.charAt(1); var quoted = quot in quotes; selector = selector.substr(quoted + 1); data = []; selector = parseSelector(data, selector, options); if(quoted){ if(selector.charAt(0) !== quot){ throw new SyntaxError("unmatched quotes in :" + name); } else { selector = selector.substr(1); } } if(selector.charAt(0) !== ")"){ throw new SyntaxError("missing closing parenthesis in :" + name + " " + selector); } selector = selector.substr(1); } else { var pos = 1, counter = 1; for(; counter > 0 && pos < selector.length; pos++){ if(selector.charAt(pos) === "(" && !isEscaped(pos)) counter++; else if(selector.charAt(pos) === ")" && !isEscaped(pos)) counter--; } if(counter){ throw new SyntaxError("parenthesis not matched"); } data = selector.substr(1, pos - 2); selector = selector.substr(pos); if(name in stripQuotesFromPseudos){ quot = data.charAt(0); if(quot === data.slice(-1) && quot in quotes){ data = data.slice(1, -1); } data = unescapeCSS(data); } } } tokens.push({type: "pseudo", name: name, data: data}); } else if(re_name.test(selector)){ name = getName(); if(!options || ("lowerCaseTags" in options ? options.lowerCaseTags : !options.xmlMode)){ name = name.toLowerCase(); } tokens.push({type: "tag", name: name}); } else { if(tokens.length && tokens[tokens.length - 1].type === "descendant"){ tokens.pop(); } addToken(subselects, tokens); return selector; } } } addToken(subselects, tokens); return selector; } function addToken(subselects, tokens){ if(subselects.length > 0 && tokens.length === 0){ throw new SyntaxError("empty sub-selector"); } subselects.push(tokens); } /***/ }), /* 495 */ /***/ (function(module, exports, __webpack_require__) { var DomUtils = __webpack_require__(470), isTag = DomUtils.isTag, getParent = DomUtils.getParent, getChildren = DomUtils.getChildren, getSiblings = DomUtils.getSiblings, getName = DomUtils.getName; /* all available rules */ module.exports = { __proto__: null, attribute: __webpack_require__(492).compile, pseudo: __webpack_require__(469).compile, //tags tag: function(next, data){ var name = data.name; return function tag(elem){ return getName(elem) === name && next(elem); }; }, //traversal descendant: function(next, rule, options, context, acceptSelf){ return function descendant(elem){ if (acceptSelf && next(elem)) return true; var found = false; while(!found && (elem = getParent(elem))){ found = next(elem); } return found; }; }, parent: function(next, data, options){ if(options && options.strict) throw SyntaxError("Parent selector isn't part of CSS3"); return function parent(elem){ return getChildren(elem).some(test); }; function test(elem){ return isTag(elem) && next(elem); } }, child: function(next){ return function child(elem){ var parent = getParent(elem); return !!parent && next(parent); }; }, sibling: function(next){ return function sibling(elem){ var siblings = getSiblings(elem); for(var i = 0; i < siblings.length; i++){ if(isTag(siblings[i])){ if(siblings[i] === elem) break; if(next(siblings[i])) return true; } } return false; }; }, adjacent: function(next){ return function adjacent(elem){ var siblings = getSiblings(elem), lastElement; for(var i = 0; i < siblings.length; i++){ if(isTag(siblings[i])){ if(siblings[i] === elem) break; lastElement = siblings[i]; } } return !!lastElement && next(lastElement); }; }, universal: function(next){ return next; } }; /***/ }), /* 496 */ /***/ (function(module, exports, __webpack_require__) { module.exports = sortByProcedure; /* sort the parts of the passed selector, as there is potential for optimization (some types of selectors are faster than others) */ var procedure = __webpack_require__(497); var attributes = { __proto__: null, exists: 10, equals: 8, not: 7, start: 6, end: 6, any: 5, hyphen: 4, element: 4 }; function sortByProcedure(arr){ var procs = arr.map(getProcedure); for(var i = 1; i < arr.length; i++){ var procNew = procs[i]; if(procNew < 0) continue; for(var j = i - 1; j >= 0 && procNew < procs[j]; j--){ var token = arr[j + 1]; arr[j + 1] = arr[j]; arr[j] = token; procs[j + 1] = procs[j]; procs[j] = procNew; } } } function getProcedure(token){ var proc = procedure[token.type]; if(proc === procedure.attribute){ proc = attributes[token.action]; if(proc === attributes.equals && token.name === "id"){ //prefer ID selectors (eg. #ID) proc = 9; } if(token.ignoreCase){ //ignoreCase adds some overhead, prefer "normal" token //this is a binary operation, to ensure it's still an int proc >>= 1; } } else if(proc === procedure.pseudo){ if(!token.data){ proc = 3; } else if(token.name === "has" || token.name === "contains"){ proc = 0; //expensive in any case } else if(token.name === "matches" || token.name === "not"){ proc = 0; for(var i = 0; i < token.data.length; i++){ //TODO better handling of complex selectors if(token.data[i].length !== 1) continue; var cur = getProcedure(token.data[i][0]); //avoid executing :has or :contains if(cur === 0){ proc = 0; break; } if(cur > proc) proc = cur; } if(token.data.length > 1 && proc > 0) proc -= 1; } else { proc = 1; } } return proc; } /***/ }), /* 497 */ /***/ (function(module) { module.exports = JSON.parse("{\"universal\":50,\"tag\":30,\"attribute\":1,\"pseudo\":0,\"descendant\":-1,\"child\":-1,\"parent\":-1,\"sibling\":-1,\"adjacent\":-1}"); /***/ }), /* 498 */ /***/ (function(module, exports, __webpack_require__) { var baseMerge = __webpack_require__(499), createAssigner = __webpack_require__(376); /** * This method is like `_.assign` except that it recursively merges own and * inherited enumerable string keyed properties of source objects into the * destination object. Source properties that resolve to `undefined` are * skipped if a destination value exists. Array and plain object properties * are merged recursively. Other objects and value types are overridden by * assignment. Source objects are applied from left to right. Subsequent * sources overwrite property assignments of previous sources. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 0.5.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @example * * var object = { * 'a': [{ 'b': 2 }, { 'd': 4 }] * }; * * var other = { * 'a': [{ 'c': 3 }, { 'e': 5 }] * }; * * _.merge(object, other); * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } */ var merge = createAssigner(function(object, source, srcIndex) { baseMerge(object, source, srcIndex); }); module.exports = merge; /***/ }), /* 499 */ /***/ (function(module, exports, __webpack_require__) { var Stack = __webpack_require__(500), assignMergeValue = __webpack_require__(529), baseFor = __webpack_require__(461), baseMergeDeep = __webpack_require__(530), isObject = __webpack_require__(72), keysIn = __webpack_require__(410), safeGet = __webpack_require__(539); /** * The base implementation of `_.merge` without support for multiple sources. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @param {number} srcIndex The index of `source`. * @param {Function} [customizer] The function to customize merged values. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. */ function baseMerge(object, source, srcIndex, customizer, stack) { if (object === source) { return; } baseFor(source, function(srcValue, key) { stack || (stack = new Stack); if (isObject(srcValue)) { baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); } else { var newValue = customizer ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) : undefined; if (newValue === undefined) { newValue = srcValue; } assignMergeValue(object, key, newValue); } }, keysIn); } module.exports = baseMerge; /***/ }), /* 500 */ /***/ (function(module, exports, __webpack_require__) { var ListCache = __webpack_require__(501), stackClear = __webpack_require__(508), stackDelete = __webpack_require__(509), stackGet = __webpack_require__(510), stackHas = __webpack_require__(511), stackSet = __webpack_require__(512); /** * Creates a stack cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Stack(entries) { var data = this.__data__ = new ListCache(entries); this.size = data.size; } // Add methods to `Stack`. Stack.prototype.clear = stackClear; Stack.prototype['delete'] = stackDelete; Stack.prototype.get = stackGet; Stack.prototype.has = stackHas; Stack.prototype.set = stackSet; module.exports = Stack; /***/ }), /* 501 */ /***/ (function(module, exports, __webpack_require__) { var listCacheClear = __webpack_require__(502), listCacheDelete = __webpack_require__(503), listCacheGet = __webpack_require__(505), listCacheHas = __webpack_require__(506), listCacheSet = __webpack_require__(507); /** * Creates an list cache object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function ListCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } // Add methods to `ListCache`. ListCache.prototype.clear = listCacheClear; ListCache.prototype['delete'] = listCacheDelete; ListCache.prototype.get = listCacheGet; ListCache.prototype.has = listCacheHas; ListCache.prototype.set = listCacheSet; module.exports = ListCache; /***/ }), /* 502 */ /***/ (function(module, exports) { /** * Removes all key-value entries from the list cache. * * @private * @name clear * @memberOf ListCache */ function listCacheClear() { this.__data__ = []; this.size = 0; } module.exports = listCacheClear; /***/ }), /* 503 */ /***/ (function(module, exports, __webpack_require__) { var assocIndexOf = __webpack_require__(504); /** Used for built-in method references. */ var arrayProto = Array.prototype; /** Built-in value references. */ var splice = arrayProto.splice; /** * Removes `key` and its value from the list cache. * * @private * @name delete * @memberOf ListCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function listCacheDelete(key) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { return false; } var lastIndex = data.length - 1; if (index == lastIndex) { data.pop(); } else { splice.call(data, index, 1); } --this.size; return true; } module.exports = listCacheDelete; /***/ }), /* 504 */ /***/ (function(module, exports, __webpack_require__) { var eq = __webpack_require__(374); /** * Gets the index at which the `key` is found in `array` of key-value pairs. * * @private * @param {Array} array The array to inspect. * @param {*} key The key to search for. * @returns {number} Returns the index of the matched value, else `-1`. */ function assocIndexOf(array, key) { var length = array.length; while (length--) { if (eq(array[length][0], key)) { return length; } } return -1; } module.exports = assocIndexOf; /***/ }), /* 505 */ /***/ (function(module, exports, __webpack_require__) { var assocIndexOf = __webpack_require__(504); /** * Gets the list cache value for `key`. * * @private * @name get * @memberOf ListCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function listCacheGet(key) { var data = this.__data__, index = assocIndexOf(data, key); return index < 0 ? undefined : data[index][1]; } module.exports = listCacheGet; /***/ }), /* 506 */ /***/ (function(module, exports, __webpack_require__) { var assocIndexOf = __webpack_require__(504); /** * Checks if a list cache value for `key` exists. * * @private * @name has * @memberOf ListCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function listCacheHas(key) { return assocIndexOf(this.__data__, key) > -1; } module.exports = listCacheHas; /***/ }), /* 507 */ /***/ (function(module, exports, __webpack_require__) { var assocIndexOf = __webpack_require__(504); /** * Sets the list cache `key` to `value`. * * @private * @name set * @memberOf ListCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the list cache instance. */ function listCacheSet(key, value) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { ++this.size; data.push([key, value]); } else { data[index][1] = value; } return this; } module.exports = listCacheSet; /***/ }), /* 508 */ /***/ (function(module, exports, __webpack_require__) { var ListCache = __webpack_require__(501); /** * Removes all key-value entries from the stack. * * @private * @name clear * @memberOf Stack */ function stackClear() { this.__data__ = new ListCache; this.size = 0; } module.exports = stackClear; /***/ }), /* 509 */ /***/ (function(module, exports) { /** * Removes `key` and its value from the stack. * * @private * @name delete * @memberOf Stack * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function stackDelete(key) { var data = this.__data__, result = data['delete'](key); this.size = data.size; return result; } module.exports = stackDelete; /***/ }), /* 510 */ /***/ (function(module, exports) { /** * Gets the stack value for `key`. * * @private * @name get * @memberOf Stack * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function stackGet(key) { return this.__data__.get(key); } module.exports = stackGet; /***/ }), /* 511 */ /***/ (function(module, exports) { /** * Checks if a stack value for `key` exists. * * @private * @name has * @memberOf Stack * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function stackHas(key) { return this.__data__.has(key); } module.exports = stackHas; /***/ }), /* 512 */ /***/ (function(module, exports, __webpack_require__) { var ListCache = __webpack_require__(501), Map = __webpack_require__(513), MapCache = __webpack_require__(514); /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; /** * Sets the stack `key` to `value`. * * @private * @name set * @memberOf Stack * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the stack cache instance. */ function stackSet(key, value) { var data = this.__data__; if (data instanceof ListCache) { var pairs = data.__data__; if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { pairs.push([key, value]); this.size = ++data.size; return this; } data = this.__data__ = new MapCache(pairs); } data.set(key, value); this.size = data.size; return this; } module.exports = stackSet; /***/ }), /* 513 */ /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(368), root = __webpack_require__(68); /* Built-in method references that are verified to be native. */ var Map = getNative(root, 'Map'); module.exports = Map; /***/ }), /* 514 */ /***/ (function(module, exports, __webpack_require__) { var mapCacheClear = __webpack_require__(515), mapCacheDelete = __webpack_require__(523), mapCacheGet = __webpack_require__(526), mapCacheHas = __webpack_require__(527), mapCacheSet = __webpack_require__(528); /** * Creates a map cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function MapCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } // Add methods to `MapCache`. MapCache.prototype.clear = mapCacheClear; MapCache.prototype['delete'] = mapCacheDelete; MapCache.prototype.get = mapCacheGet; MapCache.prototype.has = mapCacheHas; MapCache.prototype.set = mapCacheSet; module.exports = MapCache; /***/ }), /* 515 */ /***/ (function(module, exports, __webpack_require__) { var Hash = __webpack_require__(516), ListCache = __webpack_require__(501), Map = __webpack_require__(513); /** * Removes all key-value entries from the map. * * @private * @name clear * @memberOf MapCache */ function mapCacheClear() { this.size = 0; this.__data__ = { 'hash': new Hash, 'map': new (Map || ListCache), 'string': new Hash }; } module.exports = mapCacheClear; /***/ }), /* 516 */ /***/ (function(module, exports, __webpack_require__) { var hashClear = __webpack_require__(517), hashDelete = __webpack_require__(519), hashGet = __webpack_require__(520), hashHas = __webpack_require__(521), hashSet = __webpack_require__(522); /** * Creates a hash object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Hash(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } // Add methods to `Hash`. Hash.prototype.clear = hashClear; Hash.prototype['delete'] = hashDelete; Hash.prototype.get = hashGet; Hash.prototype.has = hashHas; Hash.prototype.set = hashSet; module.exports = Hash; /***/ }), /* 517 */ /***/ (function(module, exports, __webpack_require__) { var nativeCreate = __webpack_require__(518); /** * Removes all key-value entries from the hash. * * @private * @name clear * @memberOf Hash */ function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; this.size = 0; } module.exports = hashClear; /***/ }), /* 518 */ /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(368); /* Built-in method references that are verified to be native. */ var nativeCreate = getNative(Object, 'create'); module.exports = nativeCreate; /***/ }), /* 519 */ /***/ (function(module, exports) { /** * Removes `key` and its value from the hash. * * @private * @name delete * @memberOf Hash * @param {Object} hash The hash to modify. * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function hashDelete(key) { var result = this.has(key) && delete this.__data__[key]; this.size -= result ? 1 : 0; return result; } module.exports = hashDelete; /***/ }), /* 520 */ /***/ (function(module, exports, __webpack_require__) { var nativeCreate = __webpack_require__(518); /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Gets the hash value for `key`. * * @private * @name get * @memberOf Hash * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function hashGet(key) { var data = this.__data__; if (nativeCreate) { var result = data[key]; return result === HASH_UNDEFINED ? undefined : result; } return hasOwnProperty.call(data, key) ? data[key] : undefined; } module.exports = hashGet; /***/ }), /* 521 */ /***/ (function(module, exports, __webpack_require__) { var nativeCreate = __webpack_require__(518); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Checks if a hash value for `key` exists. * * @private * @name has * @memberOf Hash * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function hashHas(key) { var data = this.__data__; return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); } module.exports = hashHas; /***/ }), /* 522 */ /***/ (function(module, exports, __webpack_require__) { var nativeCreate = __webpack_require__(518); /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; /** * Sets the hash `key` to `value`. * * @private * @name set * @memberOf Hash * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the hash instance. */ function hashSet(key, value) { var data = this.__data__; this.size += this.has(key) ? 0 : 1; data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; return this; } module.exports = hashSet; /***/ }), /* 523 */ /***/ (function(module, exports, __webpack_require__) { var getMapData = __webpack_require__(524); /** * Removes `key` and its value from the map. * * @private * @name delete * @memberOf MapCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function mapCacheDelete(key) { var result = getMapData(this, key)['delete'](key); this.size -= result ? 1 : 0; return result; } module.exports = mapCacheDelete; /***/ }), /* 524 */ /***/ (function(module, exports, __webpack_require__) { var isKeyable = __webpack_require__(525); /** * Gets the data for `map`. * * @private * @param {Object} map The map to query. * @param {string} key The reference key. * @returns {*} Returns the map data. */ function getMapData(map, key) { var data = map.__data__; return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map; } module.exports = getMapData; /***/ }), /* 525 */ /***/ (function(module, exports) { /** * Checks if `value` is suitable for use as unique object key. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is suitable, else `false`. */ function isKeyable(value) { var type = typeof value; return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') ? (value !== '__proto__') : (value === null); } module.exports = isKeyable; /***/ }), /* 526 */ /***/ (function(module, exports, __webpack_require__) { var getMapData = __webpack_require__(524); /** * Gets the map value for `key`. * * @private * @name get * @memberOf MapCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function mapCacheGet(key) { return getMapData(this, key).get(key); } module.exports = mapCacheGet; /***/ }), /* 527 */ /***/ (function(module, exports, __webpack_require__) { var getMapData = __webpack_require__(524); /** * Checks if a map value for `key` exists. * * @private * @name has * @memberOf MapCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function mapCacheHas(key) { return getMapData(this, key).has(key); } module.exports = mapCacheHas; /***/ }), /* 528 */ /***/ (function(module, exports, __webpack_require__) { var getMapData = __webpack_require__(524); /** * Sets the map `key` to `value`. * * @private * @name set * @memberOf MapCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the map cache instance. */ function mapCacheSet(key, value) { var data = getMapData(this, key), size = data.size; data.set(key, value); this.size += data.size == size ? 0 : 1; return this; } module.exports = mapCacheSet; /***/ }), /* 529 */ /***/ (function(module, exports, __webpack_require__) { var baseAssignValue = __webpack_require__(366), eq = __webpack_require__(374); /** * This function is like `assignValue` except that it doesn't assign * `undefined` values. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignMergeValue(object, key, value) { if ((value !== undefined && !eq(object[key], value)) || (value === undefined && !(key in object))) { baseAssignValue(object, key, value); } } module.exports = assignMergeValue; /***/ }), /* 530 */ /***/ (function(module, exports, __webpack_require__) { var assignMergeValue = __webpack_require__(529), cloneBuffer = __webpack_require__(531), cloneTypedArray = __webpack_require__(532), copyArray = __webpack_require__(437), initCloneObject = __webpack_require__(535), isArguments = __webpack_require__(393), isArray = __webpack_require__(75), isArrayLikeObject = __webpack_require__(537), isBuffer = __webpack_require__(395), isFunction = __webpack_require__(65), isObject = __webpack_require__(72), isPlainObject = __webpack_require__(538), isTypedArray = __webpack_require__(397), safeGet = __webpack_require__(539), toPlainObject = __webpack_require__(540); /** * A specialized version of `baseMerge` for arrays and objects which performs * deep merges and tracks traversed objects enabling objects with circular * references to be merged. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @param {string} key The key of the value to merge. * @param {number} srcIndex The index of `source`. * @param {Function} mergeFunc The function to merge values. * @param {Function} [customizer] The function to customize assigned values. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. */ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue); if (stacked) { assignMergeValue(object, key, stacked); return; } var newValue = customizer ? customizer(objValue, srcValue, (key + ''), object, source, stack) : undefined; var isCommon = newValue === undefined; if (isCommon) { var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue); newValue = srcValue; if (isArr || isBuff || isTyped) { if (isArray(objValue)) { newValue = objValue; } else if (isArrayLikeObject(objValue)) { newValue = copyArray(objValue); } else if (isBuff) { isCommon = false; newValue = cloneBuffer(srcValue, true); } else if (isTyped) { isCommon = false; newValue = cloneTypedArray(srcValue, true); } else { newValue = []; } } else if (isPlainObject(srcValue) || isArguments(srcValue)) { newValue = objValue; if (isArguments(objValue)) { newValue = toPlainObject(objValue); } else if (!isObject(objValue) || isFunction(objValue)) { newValue = initCloneObject(srcValue); } } else { isCommon = false; } } if (isCommon) { // Recursively merge objects and arrays (susceptible to call stack limits). stack.set(srcValue, newValue); mergeFunc(newValue, srcValue, srcIndex, customizer, stack); stack['delete'](srcValue); } assignMergeValue(object, key, newValue); } module.exports = baseMergeDeep; /***/ }), /* 531 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(68); /** Detect free variable `exports`. */ var freeExports = true && exports && !exports.nodeType && exports; /** Detect free variable `module`. */ var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; /** Built-in value references. */ var Buffer = moduleExports ? root.Buffer : undefined, allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined; /** * Creates a clone of `buffer`. * * @private * @param {Buffer} buffer The buffer to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Buffer} Returns the cloned buffer. */ function cloneBuffer(buffer, isDeep) { if (isDeep) { return buffer.slice(); } var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); buffer.copy(result); return result; } module.exports = cloneBuffer; /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(13)(module))) /***/ }), /* 532 */ /***/ (function(module, exports, __webpack_require__) { var cloneArrayBuffer = __webpack_require__(533); /** * Creates a clone of `typedArray`. * * @private * @param {Object} typedArray The typed array to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned typed array. */ function cloneTypedArray(typedArray, isDeep) { var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); } module.exports = cloneTypedArray; /***/ }), /* 533 */ /***/ (function(module, exports, __webpack_require__) { var Uint8Array = __webpack_require__(534); /** * Creates a clone of `arrayBuffer`. * * @private * @param {ArrayBuffer} arrayBuffer The array buffer to clone. * @returns {ArrayBuffer} Returns the cloned array buffer. */ function cloneArrayBuffer(arrayBuffer) { var result = new arrayBuffer.constructor(arrayBuffer.byteLength); new Uint8Array(result).set(new Uint8Array(arrayBuffer)); return result; } module.exports = cloneArrayBuffer; /***/ }), /* 534 */ /***/ (function(module, exports, __webpack_require__) { var root = __webpack_require__(68); /** Built-in value references. */ var Uint8Array = root.Uint8Array; module.exports = Uint8Array; /***/ }), /* 535 */ /***/ (function(module, exports, __webpack_require__) { var baseCreate = __webpack_require__(420), getPrototype = __webpack_require__(536), isPrototype = __webpack_require__(389); /** * Initializes an object clone. * * @private * @param {Object} object The object to clone. * @returns {Object} Returns the initialized clone. */ function initCloneObject(object) { return (typeof object.constructor == 'function' && !isPrototype(object)) ? baseCreate(getPrototype(object)) : {}; } module.exports = initCloneObject; /***/ }), /* 536 */ /***/ (function(module, exports, __webpack_require__) { var overArg = __webpack_require__(403); /** Built-in value references. */ var getPrototype = overArg(Object.getPrototypeOf, Object); module.exports = getPrototype; /***/ }), /* 537 */ /***/ (function(module, exports, __webpack_require__) { var isArrayLike = __webpack_require__(386), isObjectLike = __webpack_require__(73); /** * This method is like `_.isArrayLike` except that it also checks if `value` * is an object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array-like object, * else `false`. * @example * * _.isArrayLikeObject([1, 2, 3]); * // => true * * _.isArrayLikeObject(document.body.children); * // => true * * _.isArrayLikeObject('abc'); * // => false * * _.isArrayLikeObject(_.noop); * // => false */ function isArrayLikeObject(value) { return isObjectLike(value) && isArrayLike(value); } module.exports = isArrayLikeObject; /***/ }), /* 538 */ /***/ (function(module, exports, __webpack_require__) { var baseGetTag = __webpack_require__(66), getPrototype = __webpack_require__(536), isObjectLike = __webpack_require__(73); /** `Object#toString` result references. */ var objectTag = '[object Object]'; /** Used for built-in method references. */ var funcProto = Function.prototype, objectProto = Object.prototype; /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** Used to infer the `Object` constructor. */ var objectCtorString = funcToString.call(Object); /** * Checks if `value` is a plain object, that is, an object created by the * `Object` constructor or one with a `[[Prototype]]` of `null`. * * @static * @memberOf _ * @since 0.8.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. * @example * * function Foo() { * this.a = 1; * } * * _.isPlainObject(new Foo); * // => false * * _.isPlainObject([1, 2, 3]); * // => false * * _.isPlainObject({ 'x': 0, 'y': 0 }); * // => true * * _.isPlainObject(Object.create(null)); * // => true */ function isPlainObject(value) { if (!isObjectLike(value) || baseGetTag(value) != objectTag) { return false; } var proto = getPrototype(value); if (proto === null) { return true; } var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; } module.exports = isPlainObject; /***/ }), /* 539 */ /***/ (function(module, exports) { /** * Gets the value at `key`, unless `key` is "__proto__" or "constructor". * * @private * @param {Object} object The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function safeGet(object, key) { if (key === 'constructor' && typeof object[key] === 'function') { return; } if (key == '__proto__') { return; } return object[key]; } module.exports = safeGet; /***/ }), /* 540 */ /***/ (function(module, exports, __webpack_require__) { var copyObject = __webpack_require__(375), keysIn = __webpack_require__(410); /** * Converts `value` to a plain object flattening inherited enumerable string * keyed properties of `value` to own properties of the plain object. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to convert. * @returns {Object} Returns the converted plain object. * @example * * function Foo() { * this.b = 2; * } * * Foo.prototype.c = 3; * * _.assign({ 'a': 1 }, new Foo); * // => { 'a': 1, 'b': 2 } * * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); * // => { 'a': 1, 'b': 2, 'c': 3 } */ function toPlainObject(value) { return copyObject(value, keysIn(value)); } module.exports = toPlainObject; /***/ }), /* 541 */ /***/ (function(module, exports, __webpack_require__) { var arraySome = __webpack_require__(542), baseIteratee = __webpack_require__(543), baseSome = __webpack_require__(588), isArray = __webpack_require__(75), isIterateeCall = __webpack_require__(385); /** * Checks if `predicate` returns truthy for **any** element of `collection`. * Iteration is stopped once `predicate` returns truthy. The predicate is * invoked with three arguments: (value, index|key, collection). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. * @example * * _.some([null, 0, 'yes', false], Boolean); * // => true * * var users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false } * ]; * * // The `_.matches` iteratee shorthand. * _.some(users, { 'user': 'barney', 'active': false }); * // => false * * // The `_.matchesProperty` iteratee shorthand. * _.some(users, ['active', false]); * // => true * * // The `_.property` iteratee shorthand. * _.some(users, 'active'); * // => true */ function some(collection, predicate, guard) { var func = isArray(collection) ? arraySome : baseSome; if (guard && isIterateeCall(collection, predicate, guard)) { predicate = undefined; } return func(collection, baseIteratee(predicate, 3)); } module.exports = some; /***/ }), /* 542 */ /***/ (function(module, exports) { /** * A specialized version of `_.some` for arrays without support for iteratee * shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. */ function arraySome(array, predicate) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (predicate(array[index], index, array)) { return true; } } return false; } module.exports = arraySome; /***/ }), /* 543 */ /***/ (function(module, exports, __webpack_require__) { var baseMatches = __webpack_require__(544), baseMatchesProperty = __webpack_require__(570), identity = __webpack_require__(378), isArray = __webpack_require__(75), property = __webpack_require__(585); /** * The base implementation of `_.iteratee`. * * @private * @param {*} [value=_.identity] The value to convert to an iteratee. * @returns {Function} Returns the iteratee. */ function baseIteratee(value) { // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. if (typeof value == 'function') { return value; } if (value == null) { return identity; } if (typeof value == 'object') { return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); } return property(value); } module.exports = baseIteratee; /***/ }), /* 544 */ /***/ (function(module, exports, __webpack_require__) { var baseIsMatch = __webpack_require__(545), getMatchData = __webpack_require__(567), matchesStrictComparable = __webpack_require__(569); /** * The base implementation of `_.matches` which doesn't clone `source`. * * @private * @param {Object} source The object of property values to match. * @returns {Function} Returns the new spec function. */ function baseMatches(source) { var matchData = getMatchData(source); if (matchData.length == 1 && matchData[0][2]) { return matchesStrictComparable(matchData[0][0], matchData[0][1]); } return function(object) { return object === source || baseIsMatch(object, source, matchData); }; } module.exports = baseMatches; /***/ }), /* 545 */ /***/ (function(module, exports, __webpack_require__) { var Stack = __webpack_require__(500), baseIsEqual = __webpack_require__(546); /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; /** * The base implementation of `_.isMatch` without support for iteratee shorthands. * * @private * @param {Object} object The object to inspect. * @param {Object} source The object of property values to match. * @param {Array} matchData The property names, values, and compare flags to match. * @param {Function} [customizer] The function to customize comparisons. * @returns {boolean} Returns `true` if `object` is a match, else `false`. */ function baseIsMatch(object, source, matchData, customizer) { var index = matchData.length, length = index, noCustomizer = !customizer; if (object == null) { return !length; } object = Object(object); while (index--) { var data = matchData[index]; if ((noCustomizer && data[2]) ? data[1] !== object[data[0]] : !(data[0] in object) ) { return false; } } while (++index < length) { data = matchData[index]; var key = data[0], objValue = object[key], srcValue = data[1]; if (noCustomizer && data[2]) { if (objValue === undefined && !(key in object)) { return false; } } else { var stack = new Stack; if (customizer) { var result = customizer(objValue, srcValue, key, object, source, stack); } if (!(result === undefined ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result )) { return false; } } } return true; } module.exports = baseIsMatch; /***/ }), /* 546 */ /***/ (function(module, exports, __webpack_require__) { var baseIsEqualDeep = __webpack_require__(547), isObjectLike = __webpack_require__(73); /** * The base implementation of `_.isEqual` which supports partial comparisons * and tracks traversed objects. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @param {boolean} bitmask The bitmask flags. * 1 - Unordered comparison * 2 - Partial comparison * @param {Function} [customizer] The function to customize comparisons. * @param {Object} [stack] Tracks traversed `value` and `other` objects. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. */ function baseIsEqual(value, other, bitmask, customizer, stack) { if (value === other) { return true; } if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { return value !== value && other !== other; } return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); } module.exports = baseIsEqual; /***/ }), /* 547 */ /***/ (function(module, exports, __webpack_require__) { var Stack = __webpack_require__(500), equalArrays = __webpack_require__(548), equalByTag = __webpack_require__(553), equalObjects = __webpack_require__(556), getTag = __webpack_require__(563), isArray = __webpack_require__(75), isBuffer = __webpack_require__(395), isTypedArray = __webpack_require__(397); /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG = 1; /** `Object#toString` result references. */ var argsTag = '[object Arguments]', arrayTag = '[object Array]', objectTag = '[object Object]'; /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * A specialized version of `baseIsEqual` for arrays and objects which performs * deep comparisons and tracks traversed objects enabling objects with circular * references to be compared. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} [stack] Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other); objTag = objTag == argsTag ? objectTag : objTag; othTag = othTag == argsTag ? objectTag : othTag; var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag; if (isSameTag && isBuffer(object)) { if (!isBuffer(other)) { return false; } objIsArr = true; objIsObj = false; } if (isSameTag && !objIsObj) { stack || (stack = new Stack); return (objIsArr || isTypedArray(object)) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); } if (!(bitmask & COMPARE_PARTIAL_FLAG)) { var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); if (objIsWrapped || othIsWrapped) { var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other; stack || (stack = new Stack); return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); } } if (!isSameTag) { return false; } stack || (stack = new Stack); return equalObjects(object, other, bitmask, customizer, equalFunc, stack); } module.exports = baseIsEqualDeep; /***/ }), /* 548 */ /***/ (function(module, exports, __webpack_require__) { var SetCache = __webpack_require__(549), arraySome = __webpack_require__(542), cacheHas = __webpack_require__(552); /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; /** * A specialized version of `baseIsEqualDeep` for arrays with support for * partial deep comparisons. * * @private * @param {Array} array The array to compare. * @param {Array} other The other array to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `array` and `other` objects. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. */ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length; if (arrLength != othLength && !(isPartial && othLength > arrLength)) { return false; } // Assume cyclic values are equal. var stacked = stack.get(array); if (stacked && stack.get(other)) { return stacked == other; } var index = -1, result = true, seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; stack.set(array, other); stack.set(other, array); // Ignore non-index properties. while (++index < arrLength) { var arrValue = array[index], othValue = other[index]; if (customizer) { var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack); } if (compared !== undefined) { if (compared) { continue; } result = false; break; } // Recursively compare arrays (susceptible to call stack limits). if (seen) { if (!arraySome(other, function(othValue, othIndex) { if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { return seen.push(othIndex); } })) { result = false; break; } } else if (!( arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack) )) { result = false; break; } } stack['delete'](array); stack['delete'](other); return result; } module.exports = equalArrays; /***/ }), /* 549 */ /***/ (function(module, exports, __webpack_require__) { var MapCache = __webpack_require__(514), setCacheAdd = __webpack_require__(550), setCacheHas = __webpack_require__(551); /** * * Creates an array cache object to store unique values. * * @private * @constructor * @param {Array} [values] The values to cache. */ function SetCache(values) { var index = -1, length = values == null ? 0 : values.length; this.__data__ = new MapCache; while (++index < length) { this.add(values[index]); } } // Add methods to `SetCache`. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; SetCache.prototype.has = setCacheHas; module.exports = SetCache; /***/ }), /* 550 */ /***/ (function(module, exports) { /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; /** * Adds `value` to the array cache. * * @private * @name add * @memberOf SetCache * @alias push * @param {*} value The value to cache. * @returns {Object} Returns the cache instance. */ function setCacheAdd(value) { this.__data__.set(value, HASH_UNDEFINED); return this; } module.exports = setCacheAdd; /***/ }), /* 551 */ /***/ (function(module, exports) { /** * Checks if `value` is in the array cache. * * @private * @name has * @memberOf SetCache * @param {*} value The value to search for. * @returns {number} Returns `true` if `value` is found, else `false`. */ function setCacheHas(value) { return this.__data__.has(value); } module.exports = setCacheHas; /***/ }), /* 552 */ /***/ (function(module, exports) { /** * Checks if a `cache` value for `key` exists. * * @private * @param {Object} cache The cache to query. * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function cacheHas(cache, key) { return cache.has(key); } module.exports = cacheHas; /***/ }), /* 553 */ /***/ (function(module, exports, __webpack_require__) { var Symbol = __webpack_require__(67), Uint8Array = __webpack_require__(534), eq = __webpack_require__(374), equalArrays = __webpack_require__(548), mapToArray = __webpack_require__(554), setToArray = __webpack_require__(555); /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; /** `Object#toString` result references. */ var boolTag = '[object Boolean]', dateTag = '[object Date]', errorTag = '[object Error]', mapTag = '[object Map]', numberTag = '[object Number]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', symbolTag = '[object Symbol]'; var arrayBufferTag = '[object ArrayBuffer]', dataViewTag = '[object DataView]'; /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol ? Symbol.prototype : undefined, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; /** * A specialized version of `baseIsEqualDeep` for comparing objects of * the same `toStringTag`. * * **Note:** This function only supports comparing values with tags of * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {string} tag The `toStringTag` of the objects to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { switch (tag) { case dataViewTag: if ((object.byteLength != other.byteLength) || (object.byteOffset != other.byteOffset)) { return false; } object = object.buffer; other = other.buffer; case arrayBufferTag: if ((object.byteLength != other.byteLength) || !equalFunc(new Uint8Array(object), new Uint8Array(other))) { return false; } return true; case boolTag: case dateTag: case numberTag: // Coerce booleans to `1` or `0` and dates to milliseconds. // Invalid dates are coerced to `NaN`. return eq(+object, +other); case errorTag: return object.name == other.name && object.message == other.message; case regexpTag: case stringTag: // Coerce regexes to strings and treat strings, primitives and objects, // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring // for more details. return object == (other + ''); case mapTag: var convert = mapToArray; case setTag: var isPartial = bitmask & COMPARE_PARTIAL_FLAG; convert || (convert = setToArray); if (object.size != other.size && !isPartial) { return false; } // Assume cyclic values are equal. var stacked = stack.get(object); if (stacked) { return stacked == other; } bitmask |= COMPARE_UNORDERED_FLAG; // Recursively compare objects (susceptible to call stack limits). stack.set(object, other); var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); stack['delete'](object); return result; case symbolTag: if (symbolValueOf) { return symbolValueOf.call(object) == symbolValueOf.call(other); } } return false; } module.exports = equalByTag; /***/ }), /* 554 */ /***/ (function(module, exports) { /** * Converts `map` to its key-value pairs. * * @private * @param {Object} map The map to convert. * @returns {Array} Returns the key-value pairs. */ function mapToArray(map) { var index = -1, result = Array(map.size); map.forEach(function(value, key) { result[++index] = [key, value]; }); return result; } module.exports = mapToArray; /***/ }), /* 555 */ /***/ (function(module, exports) { /** * Converts `set` to an array of its values. * * @private * @param {Object} set The set to convert. * @returns {Array} Returns the values. */ function setToArray(set) { var index = -1, result = Array(set.size); set.forEach(function(value) { result[++index] = value; }); return result; } module.exports = setToArray; /***/ }), /* 556 */ /***/ (function(module, exports, __webpack_require__) { var getAllKeys = __webpack_require__(557); /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG = 1; /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * A specialized version of `baseIsEqualDeep` for objects with support for * partial deep comparisons. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length; if (objLength != othLength && !isPartial) { return false; } var index = objLength; while (index--) { var key = objProps[index]; if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { return false; } } // Assume cyclic values are equal. var stacked = stack.get(object); if (stacked && stack.get(other)) { return stacked == other; } var result = true; stack.set(object, other); stack.set(other, object); var skipCtor = isPartial; while (++index < objLength) { key = objProps[index]; var objValue = object[key], othValue = other[key]; if (customizer) { var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack); } // Recursively compare objects (susceptible to call stack limits). if (!(compared === undefined ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) : compared )) { result = false; break; } skipCtor || (skipCtor = key == 'constructor'); } if (result && !skipCtor) { var objCtor = object.constructor, othCtor = other.constructor; // Non `Object` object instances with different constructors are not equal. if (objCtor != othCtor && ('constructor' in object && 'constructor' in other) && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) { result = false; } } stack['delete'](object); stack['delete'](other); return result; } module.exports = equalObjects; /***/ }), /* 557 */ /***/ (function(module, exports, __webpack_require__) { var baseGetAllKeys = __webpack_require__(558), getSymbols = __webpack_require__(560), keys = __webpack_require__(390); /** * Creates an array of own enumerable property names and symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names and symbols. */ function getAllKeys(object) { return baseGetAllKeys(object, keys, getSymbols); } module.exports = getAllKeys; /***/ }), /* 558 */ /***/ (function(module, exports, __webpack_require__) { var arrayPush = __webpack_require__(559), isArray = __webpack_require__(75); /** * The base implementation of `getAllKeys` and `getAllKeysIn` which uses * `keysFunc` and `symbolsFunc` to get the enumerable property names and * symbols of `object`. * * @private * @param {Object} object The object to query. * @param {Function} keysFunc The function to get the keys of `object`. * @param {Function} symbolsFunc The function to get the symbols of `object`. * @returns {Array} Returns the array of property names and symbols. */ function baseGetAllKeys(object, keysFunc, symbolsFunc) { var result = keysFunc(object); return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); } module.exports = baseGetAllKeys; /***/ }), /* 559 */ /***/ (function(module, exports) { /** * Appends the elements of `values` to `array`. * * @private * @param {Array} array The array to modify. * @param {Array} values The values to append. * @returns {Array} Returns `array`. */ function arrayPush(array, values) { var index = -1, length = values.length, offset = array.length; while (++index < length) { array[offset + index] = values[index]; } return array; } module.exports = arrayPush; /***/ }), /* 560 */ /***/ (function(module, exports, __webpack_require__) { var arrayFilter = __webpack_require__(561), stubArray = __webpack_require__(562); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Built-in value references. */ var propertyIsEnumerable = objectProto.propertyIsEnumerable; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeGetSymbols = Object.getOwnPropertySymbols; /** * Creates an array of the own enumerable symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ var getSymbols = !nativeGetSymbols ? stubArray : function(object) { if (object == null) { return []; } object = Object(object); return arrayFilter(nativeGetSymbols(object), function(symbol) { return propertyIsEnumerable.call(object, symbol); }); }; module.exports = getSymbols; /***/ }), /* 561 */ /***/ (function(module, exports) { /** * A specialized version of `_.filter` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns the new filtered array. */ function arrayFilter(array, predicate) { var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (predicate(value, index, array)) { result[resIndex++] = value; } } return result; } module.exports = arrayFilter; /***/ }), /* 562 */ /***/ (function(module, exports) { /** * This method returns a new empty array. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {Array} Returns the new empty array. * @example * * var arrays = _.times(2, _.stubArray); * * console.log(arrays); * // => [[], []] * * console.log(arrays[0] === arrays[1]); * // => false */ function stubArray() { return []; } module.exports = stubArray; /***/ }), /* 563 */ /***/ (function(module, exports, __webpack_require__) { var DataView = __webpack_require__(564), Map = __webpack_require__(513), Promise = __webpack_require__(565), Set = __webpack_require__(566), WeakMap = __webpack_require__(417), baseGetTag = __webpack_require__(66), toSource = __webpack_require__(372); /** `Object#toString` result references. */ var mapTag = '[object Map]', objectTag = '[object Object]', promiseTag = '[object Promise]', setTag = '[object Set]', weakMapTag = '[object WeakMap]'; var dataViewTag = '[object DataView]'; /** Used to detect maps, sets, and weakmaps. */ var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap); /** * Gets the `toStringTag` of `value`. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ var getTag = baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || (Map && getTag(new Map) != mapTag) || (Promise && getTag(Promise.resolve()) != promiseTag) || (Set && getTag(new Set) != setTag) || (WeakMap && getTag(new WeakMap) != weakMapTag)) { getTag = function(value) { var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : undefined, ctorString = Ctor ? toSource(Ctor) : ''; if (ctorString) { switch (ctorString) { case dataViewCtorString: return dataViewTag; case mapCtorString: return mapTag; case promiseCtorString: return promiseTag; case setCtorString: return setTag; case weakMapCtorString: return weakMapTag; } } return result; }; } module.exports = getTag; /***/ }), /* 564 */ /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(368), root = __webpack_require__(68); /* Built-in method references that are verified to be native. */ var DataView = getNative(root, 'DataView'); module.exports = DataView; /***/ }), /* 565 */ /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(368), root = __webpack_require__(68); /* Built-in method references that are verified to be native. */ var Promise = getNative(root, 'Promise'); module.exports = Promise; /***/ }), /* 566 */ /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(368), root = __webpack_require__(68); /* Built-in method references that are verified to be native. */ var Set = getNative(root, 'Set'); module.exports = Set; /***/ }), /* 567 */ /***/ (function(module, exports, __webpack_require__) { var isStrictComparable = __webpack_require__(568), keys = __webpack_require__(390); /** * Gets the property names, values, and compare flags of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the match data of `object`. */ function getMatchData(object) { var result = keys(object), length = result.length; while (length--) { var key = result[length], value = object[key]; result[length] = [key, value, isStrictComparable(value)]; } return result; } module.exports = getMatchData; /***/ }), /* 568 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(72); /** * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` if suitable for strict * equality comparisons, else `false`. */ function isStrictComparable(value) { return value === value && !isObject(value); } module.exports = isStrictComparable; /***/ }), /* 569 */ /***/ (function(module, exports) { /** * A specialized version of `matchesProperty` for source values suitable * for strict equality comparisons, i.e. `===`. * * @private * @param {string} key The key of the property to get. * @param {*} srcValue The value to match. * @returns {Function} Returns the new spec function. */ function matchesStrictComparable(key, srcValue) { return function(object) { if (object == null) { return false; } return object[key] === srcValue && (srcValue !== undefined || (key in Object(object))); }; } module.exports = matchesStrictComparable; /***/ }), /* 570 */ /***/ (function(module, exports, __webpack_require__) { var baseIsEqual = __webpack_require__(546), get = __webpack_require__(571), hasIn = __webpack_require__(582), isKey = __webpack_require__(574), isStrictComparable = __webpack_require__(568), matchesStrictComparable = __webpack_require__(569), toKey = __webpack_require__(581); /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; /** * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. * * @private * @param {string} path The path of the property to get. * @param {*} srcValue The value to match. * @returns {Function} Returns the new spec function. */ function baseMatchesProperty(path, srcValue) { if (isKey(path) && isStrictComparable(srcValue)) { return matchesStrictComparable(toKey(path), srcValue); } return function(object) { var objValue = get(object, path); return (objValue === undefined && objValue === srcValue) ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); }; } module.exports = baseMatchesProperty; /***/ }), /* 571 */ /***/ (function(module, exports, __webpack_require__) { var baseGet = __webpack_require__(572); /** * Gets the value at `path` of `object`. If the resolved value is * `undefined`, the `defaultValue` is returned in its place. * * @static * @memberOf _ * @since 3.7.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @param {*} [defaultValue] The value returned for `undefined` resolved values. * @returns {*} Returns the resolved value. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.get(object, 'a[0].b.c'); * // => 3 * * _.get(object, ['a', '0', 'b', 'c']); * // => 3 * * _.get(object, 'a.b.c', 'default'); * // => 'default' */ function get(object, path, defaultValue) { var result = object == null ? undefined : baseGet(object, path); return result === undefined ? defaultValue : result; } module.exports = get; /***/ }), /* 572 */ /***/ (function(module, exports, __webpack_require__) { var castPath = __webpack_require__(573), toKey = __webpack_require__(581); /** * The base implementation of `_.get` without support for default values. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @returns {*} Returns the resolved value. */ function baseGet(object, path) { path = castPath(path, object); var index = 0, length = path.length; while (object != null && index < length) { object = object[toKey(path[index++])]; } return (index && index == length) ? object : undefined; } module.exports = baseGet; /***/ }), /* 573 */ /***/ (function(module, exports, __webpack_require__) { var isArray = __webpack_require__(75), isKey = __webpack_require__(574), stringToPath = __webpack_require__(575), toString = __webpack_require__(578); /** * Casts `value` to a path array if it's not one. * * @private * @param {*} value The value to inspect. * @param {Object} [object] The object to query keys on. * @returns {Array} Returns the cast property path array. */ function castPath(value, object) { if (isArray(value)) { return value; } return isKey(value, object) ? [value] : stringToPath(toString(value)); } module.exports = castPath; /***/ }), /* 574 */ /***/ (function(module, exports, __webpack_require__) { var isArray = __webpack_require__(75), isSymbol = __webpack_require__(457); /** Used to match property names within property paths. */ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/; /** * Checks if `value` is a property name and not a property path. * * @private * @param {*} value The value to check. * @param {Object} [object] The object to query keys on. * @returns {boolean} Returns `true` if `value` is a property name, else `false`. */ function isKey(value, object) { if (isArray(value)) { return false; } var type = typeof value; if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) { return true; } return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || (object != null && value in Object(object)); } module.exports = isKey; /***/ }), /* 575 */ /***/ (function(module, exports, __webpack_require__) { var memoizeCapped = __webpack_require__(576); /** Used to match property names within property paths. */ var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; /** Used to match backslashes in property paths. */ var reEscapeChar = /\\(\\)?/g; /** * Converts `string` to a property path array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the property path array. */ var stringToPath = memoizeCapped(function(string) { var result = []; if (string.charCodeAt(0) === 46 /* . */) { result.push(''); } string.replace(rePropName, function(match, number, quote, subString) { result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); }); return result; }); module.exports = stringToPath; /***/ }), /* 576 */ /***/ (function(module, exports, __webpack_require__) { var memoize = __webpack_require__(577); /** Used as the maximum memoize cache size. */ var MAX_MEMOIZE_SIZE = 500; /** * A specialized version of `_.memoize` which clears the memoized function's * cache when it exceeds `MAX_MEMOIZE_SIZE`. * * @private * @param {Function} func The function to have its output memoized. * @returns {Function} Returns the new memoized function. */ function memoizeCapped(func) { var result = memoize(func, function(key) { if (cache.size === MAX_MEMOIZE_SIZE) { cache.clear(); } return key; }); var cache = result.cache; return result; } module.exports = memoizeCapped; /***/ }), /* 577 */ /***/ (function(module, exports, __webpack_require__) { var MapCache = __webpack_require__(514); /** Error message constants. */ var FUNC_ERROR_TEXT = 'Expected a function'; /** * Creates a function that memoizes the result of `func`. If `resolver` is * provided, it determines the cache key for storing the result based on the * arguments provided to the memoized function. By default, the first argument * provided to the memoized function is used as the map cache key. The `func` * is invoked with the `this` binding of the memoized function. * * **Note:** The cache is exposed as the `cache` property on the memoized * function. Its creation may be customized by replacing the `_.memoize.Cache` * constructor with one whose instances implement the * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) * method interface of `clear`, `delete`, `get`, `has`, and `set`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to have its output memoized. * @param {Function} [resolver] The function to resolve the cache key. * @returns {Function} Returns the new memoized function. * @example * * var object = { 'a': 1, 'b': 2 }; * var other = { 'c': 3, 'd': 4 }; * * var values = _.memoize(_.values); * values(object); * // => [1, 2] * * values(other); * // => [3, 4] * * object.a = 2; * values(object); * // => [1, 2] * * // Modify the result cache. * values.cache.set(object, ['a', 'b']); * values(object); * // => ['a', 'b'] * * // Replace `_.memoize.Cache`. * _.memoize.Cache = WeakMap; */ function memoize(func, resolver) { if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { throw new TypeError(FUNC_ERROR_TEXT); } var memoized = function() { var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; if (cache.has(key)) { return cache.get(key); } var result = func.apply(this, args); memoized.cache = cache.set(key, result) || cache; return result; }; memoized.cache = new (memoize.Cache || MapCache); return memoized; } // Expose `MapCache`. memoize.Cache = MapCache; module.exports = memoize; /***/ }), /* 578 */ /***/ (function(module, exports, __webpack_require__) { var baseToString = __webpack_require__(579); /** * Converts `value` to a string. An empty string is returned for `null` * and `undefined` values. The sign of `-0` is preserved. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {string} Returns the converted string. * @example * * _.toString(null); * // => '' * * _.toString(-0); * // => '-0' * * _.toString([1, 2, 3]); * // => '1,2,3' */ function toString(value) { return value == null ? '' : baseToString(value); } module.exports = toString; /***/ }), /* 579 */ /***/ (function(module, exports, __webpack_require__) { var Symbol = __webpack_require__(67), arrayMap = __webpack_require__(580), isArray = __webpack_require__(75), isSymbol = __webpack_require__(457); /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0; /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol ? Symbol.prototype : undefined, symbolToString = symbolProto ? symbolProto.toString : undefined; /** * The base implementation of `_.toString` which doesn't convert nullish * values to empty strings. * * @private * @param {*} value The value to process. * @returns {string} Returns the string. */ function baseToString(value) { // Exit early for strings to avoid a performance hit in some environments. if (typeof value == 'string') { return value; } if (isArray(value)) { // Recursively convert values (susceptible to call stack limits). return arrayMap(value, baseToString) + ''; } if (isSymbol(value)) { return symbolToString ? symbolToString.call(value) : ''; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } module.exports = baseToString; /***/ }), /* 580 */ /***/ (function(module, exports) { /** * A specialized version of `_.map` for arrays without support for iteratee * shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function arrayMap(array, iteratee) { var index = -1, length = array == null ? 0 : array.length, result = Array(length); while (++index < length) { result[index] = iteratee(array[index], index, array); } return result; } module.exports = arrayMap; /***/ }), /* 581 */ /***/ (function(module, exports, __webpack_require__) { var isSymbol = __webpack_require__(457); /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0; /** * Converts `value` to a string key if it's not a string or symbol. * * @private * @param {*} value The value to inspect. * @returns {string|symbol} Returns the key. */ function toKey(value) { if (typeof value == 'string' || isSymbol(value)) { return value; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } module.exports = toKey; /***/ }), /* 582 */ /***/ (function(module, exports, __webpack_require__) { var baseHasIn = __webpack_require__(583), hasPath = __webpack_require__(584); /** * Checks if `path` is a direct or inherited property of `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * * var object = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.hasIn(object, 'a'); * // => true * * _.hasIn(object, 'a.b'); * // => true * * _.hasIn(object, ['a', 'b']); * // => true * * _.hasIn(object, 'b'); * // => false */ function hasIn(object, path) { return object != null && hasPath(object, path, baseHasIn); } module.exports = hasIn; /***/ }), /* 583 */ /***/ (function(module, exports) { /** * The base implementation of `_.hasIn` without support for deep paths. * * @private * @param {Object} [object] The object to query. * @param {Array|string} key The key to check. * @returns {boolean} Returns `true` if `key` exists, else `false`. */ function baseHasIn(object, key) { return object != null && key in Object(object); } module.exports = baseHasIn; /***/ }), /* 584 */ /***/ (function(module, exports, __webpack_require__) { var castPath = __webpack_require__(573), isArguments = __webpack_require__(393), isArray = __webpack_require__(75), isIndex = __webpack_require__(388), isLength = __webpack_require__(387), toKey = __webpack_require__(581); /** * Checks if `path` exists on `object`. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @param {Function} hasFunc The function to check properties. * @returns {boolean} Returns `true` if `path` exists, else `false`. */ function hasPath(object, path, hasFunc) { path = castPath(path, object); var index = -1, length = path.length, result = false; while (++index < length) { var key = toKey(path[index]); if (!(result = object != null && hasFunc(object, key))) { break; } object = object[key]; } if (result || ++index != length) { return result; } length = object == null ? 0 : object.length; return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object)); } module.exports = hasPath; /***/ }), /* 585 */ /***/ (function(module, exports, __webpack_require__) { var baseProperty = __webpack_require__(586), basePropertyDeep = __webpack_require__(587), isKey = __webpack_require__(574), toKey = __webpack_require__(581); /** * Creates a function that returns the value at `path` of a given object. * * @static * @memberOf _ * @since 2.4.0 * @category Util * @param {Array|string} path The path of the property to get. * @returns {Function} Returns the new accessor function. * @example * * var objects = [ * { 'a': { 'b': 2 } }, * { 'a': { 'b': 1 } } * ]; * * _.map(objects, _.property('a.b')); * // => [2, 1] * * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); * // => [1, 2] */ function property(path) { return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); } module.exports = property; /***/ }), /* 586 */ /***/ (function(module, exports) { /** * The base implementation of `_.property` without support for deep paths. * * @private * @param {string} key The key of the property to get. * @returns {Function} Returns the new accessor function. */ function baseProperty(key) { return function(object) { return object == null ? undefined : object[key]; }; } module.exports = baseProperty; /***/ }), /* 587 */ /***/ (function(module, exports, __webpack_require__) { var baseGet = __webpack_require__(572); /** * A specialized version of `baseProperty` which supports deep paths. * * @private * @param {Array|string} path The path of the property to get. * @returns {Function} Returns the new accessor function. */ function basePropertyDeep(path) { return function(object) { return baseGet(object, path); }; } module.exports = basePropertyDeep; /***/ }), /* 588 */ /***/ (function(module, exports, __webpack_require__) { var baseEach = __webpack_require__(459); /** * The base implementation of `_.some` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. */ function baseSome(collection, predicate) { var result; baseEach(collection, function(value, index, collection) { result = predicate(value, index, collection); return !result; }); return !!result; } module.exports = baseSome; /***/ }), /* 589 */ /***/ (function(module, exports, __webpack_require__) { var select = __webpack_require__(468), utils = __webpack_require__(404), domEach = utils.domEach, uniqueSort = __webpack_require__(282).DomUtils.uniqueSort, isTag = utils.isTag, _ = { bind: __webpack_require__(413), forEach: __webpack_require__(458), reject: __webpack_require__(590), filter: __webpack_require__(593), reduce: __webpack_require__(594) }; exports.find = function(selectorOrHaystack) { var elems = _.reduce(this, function(memo, elem) { return memo.concat(_.filter(elem.children, isTag)); }, []); var contains = this.constructor.contains; var haystack; if (selectorOrHaystack && typeof selectorOrHaystack !== 'string') { if (selectorOrHaystack.cheerio) { haystack = selectorOrHaystack.get(); } else { haystack = [selectorOrHaystack]; } return this._make(haystack.filter(function(elem) { var idx, len; for (idx = 0, len = this.length; idx < len; ++idx) { if (contains(this[idx], elem)) { return true; } } }, this)); } var options = {__proto__: this.options, context: this.toArray()}; return this._make(select(selectorOrHaystack, elems, options)); }; // Get the parent of each element in the current set of matched elements, // optionally filtered by a selector. exports.parent = function(selector) { var set = []; domEach(this, function(idx, elem) { var parentElem = elem.parent; if (parentElem && set.indexOf(parentElem) < 0) { set.push(parentElem); } }); if (arguments.length) { set = exports.filter.call(set, selector, this); } return this._make(set); }; exports.parents = function(selector) { var parentNodes = []; // When multiple DOM elements are in the original set, the resulting set will // be in *reverse* order of the original elements as well, with duplicates // removed. this.get().reverse().forEach(function(elem) { traverseParents(this, elem.parent, selector, Infinity) .forEach(function(node) { if (parentNodes.indexOf(node) === -1) { parentNodes.push(node); } } ); }, this); return this._make(parentNodes); }; exports.parentsUntil = function(selector, filter) { var parentNodes = [], untilNode, untilNodes; if (typeof selector === 'string') { untilNode = select(selector, this.parents().toArray(), this.options)[0]; } else if (selector && selector.cheerio) { untilNodes = selector.toArray(); } else if (selector) { untilNode = selector; } // When multiple DOM elements are in the original set, the resulting set will // be in *reverse* order of the original elements as well, with duplicates // removed. this.toArray().reverse().forEach(function(elem) { while ((elem = elem.parent)) { if ((untilNode && elem !== untilNode) || (untilNodes && untilNodes.indexOf(elem) === -1) || (!untilNode && !untilNodes)) { if (isTag(elem) && parentNodes.indexOf(elem) === -1) { parentNodes.push(elem); } } else { break; } } }, this); return this._make(filter ? select(filter, parentNodes, this.options) : parentNodes); }; // For each element in the set, get the first element that matches the selector // by testing the element itself and traversing up through its ancestors in the // DOM tree. exports.closest = function(selector) { var set = []; if (!selector) { return this._make(set); } domEach(this, function(idx, elem) { var closestElem = traverseParents(this, elem, selector, 1)[0]; // Do not add duplicate elements to the set if (closestElem && set.indexOf(closestElem) < 0) { set.push(closestElem); } }.bind(this)); return this._make(set); }; exports.next = function(selector) { if (!this[0]) { return this; } var elems = []; _.forEach(this, function(elem) { while ((elem = elem.next)) { if (isTag(elem)) { elems.push(elem); return; } } }); return selector ? exports.filter.call(elems, selector, this) : this._make(elems); }; exports.nextAll = function(selector) { if (!this[0]) { return this; } var elems = []; _.forEach(this, function(elem) { while ((elem = elem.next)) { if (isTag(elem) && elems.indexOf(elem) === -1) { elems.push(elem); } } }); return selector ? exports.filter.call(elems, selector, this) : this._make(elems); }; exports.nextUntil = function(selector, filterSelector) { if (!this[0]) { return this; } var elems = [], untilNode, untilNodes; if (typeof selector === 'string') { untilNode = select(selector, this.nextAll().get(), this.options)[0]; } else if (selector && selector.cheerio) { untilNodes = selector.get(); } else if (selector) { untilNode = selector; } _.forEach(this, function(elem) { while ((elem = elem.next)) { if ((untilNode && elem !== untilNode) || (untilNodes && untilNodes.indexOf(elem) === -1) || (!untilNode && !untilNodes)) { if (isTag(elem) && elems.indexOf(elem) === -1) { elems.push(elem); } } else { break; } } }); return filterSelector ? exports.filter.call(elems, filterSelector, this) : this._make(elems); }; exports.prev = function(selector) { if (!this[0]) { return this; } var elems = []; _.forEach(this, function(elem) { while ((elem = elem.prev)) { if (isTag(elem)) { elems.push(elem); return; } } }); return selector ? exports.filter.call(elems, selector, this) : this._make(elems); }; exports.prevAll = function(selector) { if (!this[0]) { return this; } var elems = []; _.forEach(this, function(elem) { while ((elem = elem.prev)) { if (isTag(elem) && elems.indexOf(elem) === -1) { elems.push(elem); } } }); return selector ? exports.filter.call(elems, selector, this) : this._make(elems); }; exports.prevUntil = function(selector, filterSelector) { if (!this[0]) { return this; } var elems = [], untilNode, untilNodes; if (typeof selector === 'string') { untilNode = select(selector, this.prevAll().get(), this.options)[0]; } else if (selector && selector.cheerio) { untilNodes = selector.get(); } else if (selector) { untilNode = selector; } _.forEach(this, function(elem) { while ((elem = elem.prev)) { if ((untilNode && elem !== untilNode) || (untilNodes && untilNodes.indexOf(elem) === -1) || (!untilNode && !untilNodes)) { if (isTag(elem) && elems.indexOf(elem) === -1) { elems.push(elem); } } else { break; } } }); return filterSelector ? exports.filter.call(elems, filterSelector, this) : this._make(elems); }; exports.siblings = function(selector) { var parent = this.parent(); var elems = _.filter( parent ? parent.children() : this.siblingsAndMe(), _.bind(function(elem) { return isTag(elem) && !this.is(elem); }, this) ); if (selector !== undefined) { return exports.filter.call(elems, selector, this); } else { return this._make(elems); } }; exports.children = function(selector) { var elems = _.reduce(this, function(memo, elem) { return memo.concat(_.filter(elem.children, isTag)); }, []); if (selector === undefined) return this._make(elems); return exports.filter.call(elems, selector, this); }; exports.contents = function() { return this._make(_.reduce(this, function(all, elem) { all.push.apply(all, elem.children); return all; }, [])); }; exports.each = function(fn) { var i = 0, len = this.length; while (i < len && fn.call(this[i], i, this[i]) !== false) ++i; return this; }; exports.map = function(fn) { return this._make(_.reduce(this, function(memo, el, i) { var val = fn.call(el, i, el); return val == null ? memo : memo.concat(val); }, [])); }; var makeFilterMethod = function(filterFn) { return function(match, container) { var testFn; container = container || this; if (typeof match === 'string') { testFn = select.compile(match, container.options); } else if (typeof match === 'function') { testFn = function(el, i) { return match.call(el, i, el); }; } else if (match.cheerio) { testFn = match.is.bind(match); } else { testFn = function(el) { return match === el; }; } return container._make(filterFn(this, testFn)); }; }; exports.filter = makeFilterMethod(_.filter); exports.not = makeFilterMethod(_.reject); exports.has = function(selectorOrHaystack) { var that = this; return exports.filter.call(this, function() { return that._make(this).find(selectorOrHaystack).length > 0; }); }; exports.first = function() { return this.length > 1 ? this._make(this[0]) : this; }; exports.last = function() { return this.length > 1 ? this._make(this[this.length - 1]) : this; }; // Reduce the set of matched elements to the one at the specified index. exports.eq = function(i) { i = +i; // Use the first identity optimization if possible if (i === 0 && this.length <= 1) return this; if (i < 0) i = this.length + i; return this[i] ? this._make(this[i]) : this._make([]); }; // Retrieve the DOM elements matched by the jQuery object. exports.get = function(i) { if (i == null) { return Array.prototype.slice.call(this); } else { return this[i < 0 ? (this.length + i) : i]; } }; // Search for a given element from among the matched elements. exports.index = function(selectorOrNeedle) { var $haystack, needle; if (arguments.length === 0) { $haystack = this.parent().children(); needle = this[0]; } else if (typeof selectorOrNeedle === 'string') { $haystack = this._make(selectorOrNeedle); needle = this[0]; } else { $haystack = this; needle = selectorOrNeedle.cheerio ? selectorOrNeedle[0] : selectorOrNeedle; } return $haystack.get().indexOf(needle); }; exports.slice = function() { return this._make([].slice.apply(this, arguments)); }; function traverseParents(self, elem, selector, limit) { var elems = []; while (elem && elems.length < limit) { if (!selector || exports.filter.call([elem], selector, self).length) { elems.push(elem); } elem = elem.parent; } return elems; } // End the most recent filtering operation in the current chain and return the // set of matched elements to its previous state. exports.end = function() { return this.prevObject || this._make([]); }; exports.add = function(other, context) { var selection = this._make(other, context); var contents = uniqueSort(selection.get().concat(this.get())); for (var i = 0; i < contents.length; ++i) { selection[i] = contents[i]; } selection.length = contents.length; return selection; }; // Add the previous set of elements on the stack to the current set, optionally // filtered by a selector. exports.addBack = function(selector) { return this.add( arguments.length ? this.prevObject.filter(selector) : this.prevObject ); }; /***/ }), /* 590 */ /***/ (function(module, exports, __webpack_require__) { var arrayFilter = __webpack_require__(561), baseFilter = __webpack_require__(591), baseIteratee = __webpack_require__(543), isArray = __webpack_require__(75), negate = __webpack_require__(592); /** * The opposite of `_.filter`; this method returns the elements of `collection` * that `predicate` does **not** return truthy for. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the new filtered array. * @see _.filter * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': false }, * { 'user': 'fred', 'age': 40, 'active': true } * ]; * * _.reject(users, function(o) { return !o.active; }); * // => objects for ['fred'] * * // The `_.matches` iteratee shorthand. * _.reject(users, { 'age': 40, 'active': true }); * // => objects for ['barney'] * * // The `_.matchesProperty` iteratee shorthand. * _.reject(users, ['active', false]); * // => objects for ['fred'] * * // The `_.property` iteratee shorthand. * _.reject(users, 'active'); * // => objects for ['barney'] */ function reject(collection, predicate) { var func = isArray(collection) ? arrayFilter : baseFilter; return func(collection, negate(baseIteratee(predicate, 3))); } module.exports = reject; /***/ }), /* 591 */ /***/ (function(module, exports, __webpack_require__) { var baseEach = __webpack_require__(459); /** * The base implementation of `_.filter` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns the new filtered array. */ function baseFilter(collection, predicate) { var result = []; baseEach(collection, function(value, index, collection) { if (predicate(value, index, collection)) { result.push(value); } }); return result; } module.exports = baseFilter; /***/ }), /* 592 */ /***/ (function(module, exports) { /** Error message constants. */ var FUNC_ERROR_TEXT = 'Expected a function'; /** * Creates a function that negates the result of the predicate `func`. The * `func` predicate is invoked with the `this` binding and arguments of the * created function. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {Function} predicate The predicate to negate. * @returns {Function} Returns the new negated function. * @example * * function isEven(n) { * return n % 2 == 0; * } * * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); * // => [1, 3, 5] */ function negate(predicate) { if (typeof predicate != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } return function() { var args = arguments; switch (args.length) { case 0: return !predicate.call(this); case 1: return !predicate.call(this, args[0]); case 2: return !predicate.call(this, args[0], args[1]); case 3: return !predicate.call(this, args[0], args[1], args[2]); } return !predicate.apply(this, args); }; } module.exports = negate; /***/ }), /* 593 */ /***/ (function(module, exports, __webpack_require__) { var arrayFilter = __webpack_require__(561), baseFilter = __webpack_require__(591), baseIteratee = __webpack_require__(543), isArray = __webpack_require__(75); /** * Iterates over elements of `collection`, returning an array of all elements * `predicate` returns truthy for. The predicate is invoked with three * arguments: (value, index|key, collection). * * **Note:** Unlike `_.remove`, this method returns a new array. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the new filtered array. * @see _.reject * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': true }, * { 'user': 'fred', 'age': 40, 'active': false } * ]; * * _.filter(users, function(o) { return !o.active; }); * // => objects for ['fred'] * * // The `_.matches` iteratee shorthand. * _.filter(users, { 'age': 36, 'active': true }); * // => objects for ['barney'] * * // The `_.matchesProperty` iteratee shorthand. * _.filter(users, ['active', false]); * // => objects for ['fred'] * * // The `_.property` iteratee shorthand. * _.filter(users, 'active'); * // => objects for ['barney'] */ function filter(collection, predicate) { var func = isArray(collection) ? arrayFilter : baseFilter; return func(collection, baseIteratee(predicate, 3)); } module.exports = filter; /***/ }), /* 594 */ /***/ (function(module, exports, __webpack_require__) { var arrayReduce = __webpack_require__(595), baseEach = __webpack_require__(459), baseIteratee = __webpack_require__(543), baseReduce = __webpack_require__(596), isArray = __webpack_require__(75); /** * Reduces `collection` to a value which is the accumulated result of running * each element in `collection` thru `iteratee`, where each successive * invocation is supplied the return value of the previous. If `accumulator` * is not given, the first element of `collection` is used as the initial * value. The iteratee is invoked with four arguments: * (accumulator, value, index|key, collection). * * Many lodash methods are guarded to work as iteratees for methods like * `_.reduce`, `_.reduceRight`, and `_.transform`. * * The guarded methods are: * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, * and `sortBy` * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {*} [accumulator] The initial value. * @returns {*} Returns the accumulated value. * @see _.reduceRight * @example * * _.reduce([1, 2], function(sum, n) { * return sum + n; * }, 0); * // => 3 * * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { * (result[value] || (result[value] = [])).push(key); * return result; * }, {}); * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) */ function reduce(collection, iteratee, accumulator) { var func = isArray(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3; return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEach); } module.exports = reduce; /***/ }), /* 595 */ /***/ (function(module, exports) { /** * A specialized version of `_.reduce` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {boolean} [initAccum] Specify using the first element of `array` as * the initial value. * @returns {*} Returns the accumulated value. */ function arrayReduce(array, iteratee, accumulator, initAccum) { var index = -1, length = array == null ? 0 : array.length; if (initAccum && length) { accumulator = array[++index]; } while (++index < length) { accumulator = iteratee(accumulator, array[index], index, array); } return accumulator; } module.exports = arrayReduce; /***/ }), /* 596 */ /***/ (function(module, exports) { /** * The base implementation of `_.reduce` and `_.reduceRight`, without support * for iteratee shorthands, which iterates over `collection` using `eachFunc`. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} accumulator The initial value. * @param {boolean} initAccum Specify using the first or last element of * `collection` as the initial value. * @param {Function} eachFunc The function to iterate over `collection`. * @returns {*} Returns the accumulated value. */ function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { eachFunc(collection, function(value, index, collection) { accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection); }); return accumulator; } module.exports = baseReduce; /***/ }), /* 597 */ /***/ (function(module, exports, __webpack_require__) { var parse = __webpack_require__(281), $ = __webpack_require__(467), updateDOM = parse.update, evaluate = parse.evaluate, utils = __webpack_require__(404), domEach = utils.domEach, cloneDom = utils.cloneDom, isHtml = utils.isHtml, slice = Array.prototype.slice, _ = { flatten: __webpack_require__(598), bind: __webpack_require__(413), forEach: __webpack_require__(458) }; // Create an array of nodes, recursing into arrays and parsing strings if // necessary exports._makeDomArray = function makeDomArray(elem, clone) { if (elem == null) { return []; } else if (elem.cheerio) { return clone ? cloneDom(elem.get(), elem.options) : elem.get(); } else if (Array.isArray(elem)) { return _.flatten(elem.map(function(el) { return this._makeDomArray(el, clone); }, this)); } else if (typeof elem === 'string') { return evaluate(elem, this.options, false); } else { return clone ? cloneDom([elem]) : [elem]; } }; var _insert = function(concatenator) { return function() { var elems = slice.call(arguments), lastIdx = this.length - 1; return domEach(this, function(i, el) { var dom, domSrc; if (typeof elems[0] === 'function') { domSrc = elems[0].call(el, i, $.html(el.children)); } else { domSrc = elems; } dom = this._makeDomArray(domSrc, i < lastIdx); concatenator(dom, el.children, el); }); }; }; /* * Modify an array in-place, removing some number of elements and adding new * elements directly following them. * * @param {Array} array Target array to splice. * @param {Number} spliceIdx Index at which to begin changing the array. * @param {Number} spliceCount Number of elements to remove from the array. * @param {Array} newElems Elements to insert into the array. * * @api private */ var uniqueSplice = function(array, spliceIdx, spliceCount, newElems, parent) { var spliceArgs = [spliceIdx, spliceCount].concat(newElems), prev = array[spliceIdx - 1] || null, next = array[spliceIdx] || null; var idx, len, prevIdx, node, oldParent; // Before splicing in new elements, ensure they do not already appear in the // current array. for (idx = 0, len = newElems.length; idx < len; ++idx) { node = newElems[idx]; oldParent = node.parent || node.root; prevIdx = oldParent && oldParent.children.indexOf(newElems[idx]); if (oldParent && prevIdx > -1) { oldParent.children.splice(prevIdx, 1); if (parent === oldParent && spliceIdx > prevIdx) { spliceArgs[0]--; } } node.root = null; node.parent = parent; if (node.prev) { node.prev.next = node.next || null; } if (node.next) { node.next.prev = node.prev || null; } node.prev = newElems[idx - 1] || prev; node.next = newElems[idx + 1] || next; } if (prev) { prev.next = newElems[0]; } if (next) { next.prev = newElems[newElems.length - 1]; } return array.splice.apply(array, spliceArgs); }; exports.appendTo = function(target) { if (!target.cheerio) { target = this.constructor.call(this.constructor, target, null, this._originalRoot); } target.append(this); return this; }; exports.prependTo = function(target) { if (!target.cheerio) { target = this.constructor.call(this.constructor, target, null, this._originalRoot); } target.prepend(this); return this; }; exports.append = _insert(function(dom, children, parent) { uniqueSplice(children, children.length, 0, dom, parent); }); exports.prepend = _insert(function(dom, children, parent) { uniqueSplice(children, 0, 0, dom, parent); }); exports.wrap = function(wrapper) { var wrapperFn = typeof wrapper === 'function' && wrapper, lastIdx = this.length - 1; _.forEach(this, _.bind(function(el, i) { var parent = el.parent || el.root, siblings = parent.children, wrapperDom, elInsertLocation, j, index; if (!parent) { return; } if (wrapperFn) { wrapper = wrapperFn.call(el, i); } if (typeof wrapper === 'string' && !isHtml(wrapper)) { wrapper = this.parents().last().find(wrapper).clone(); } wrapperDom = this._makeDomArray(wrapper, i < lastIdx).slice(0, 1); elInsertLocation = wrapperDom[0]; // Find the deepest child. Only consider the first tag child of each node // (ignore text); stop if no children are found. j = 0; while (elInsertLocation && elInsertLocation.children) { if (j >= elInsertLocation.children.length) { break; } if (elInsertLocation.children[j].type === 'tag') { elInsertLocation = elInsertLocation.children[j]; j=0; } else { j++; } } index = siblings.indexOf(el); updateDOM([el], elInsertLocation); // The previous operation removed the current element from the `siblings` // array, so the `dom` array can be inserted without removing any // additional elements. uniqueSplice(siblings, index, 0, wrapperDom, parent); }, this)); return this; }; exports.after = function() { var elems = slice.call(arguments), lastIdx = this.length - 1; domEach(this, function(i, el) { var parent = el.parent || el.root; if (!parent) { return; } var siblings = parent.children, index = siblings.indexOf(el), domSrc, dom; // If not found, move on if (index < 0) return; if (typeof elems[0] === 'function') { domSrc = elems[0].call(el, i, $.html(el.children)); } else { domSrc = elems; } dom = this._makeDomArray(domSrc, i < lastIdx); // Add element after `this` element uniqueSplice(siblings, index + 1, 0, dom, parent); }); return this; }; exports.insertAfter = function(target) { var clones = [], self = this; if (typeof target === 'string') { target = this.constructor.call(this.constructor, target, null, this._originalRoot); } target = this._makeDomArray(target); self.remove(); domEach(target, function(i, el) { var clonedSelf = self._makeDomArray(self.clone()); var parent = el.parent || el.root; if (!parent) { return; } var siblings = parent.children, index = siblings.indexOf(el); // If not found, move on if (index < 0) return; // Add cloned `this` element(s) after target element uniqueSplice(siblings, index + 1, 0, clonedSelf, parent); clones.push(clonedSelf); }); return this.constructor.call(this.constructor, this._makeDomArray(clones)); }; exports.before = function() { var elems = slice.call(arguments), lastIdx = this.length - 1; domEach(this, function(i, el) { var parent = el.parent || el.root; if (!parent) { return; } var siblings = parent.children, index = siblings.indexOf(el), domSrc, dom; // If not found, move on if (index < 0) return; if (typeof elems[0] === 'function') { domSrc = elems[0].call(el, i, $.html(el.children)); } else { domSrc = elems; } dom = this._makeDomArray(domSrc, i < lastIdx); // Add element before `el` element uniqueSplice(siblings, index, 0, dom, parent); }); return this; }; exports.insertBefore = function(target) { var clones = [], self = this; if (typeof target === 'string') { target = this.constructor.call(this.constructor, target, null, this._originalRoot); } target = this._makeDomArray(target); self.remove(); domEach(target, function(i, el) { var clonedSelf = self._makeDomArray(self.clone()); var parent = el.parent || el.root; if (!parent) { return; } var siblings = parent.children, index = siblings.indexOf(el); // If not found, move on if (index < 0) return; // Add cloned `this` element(s) after target element uniqueSplice(siblings, index, 0, clonedSelf, parent); clones.push(clonedSelf); }); return this.constructor.call(this.constructor, this._makeDomArray(clones)); }; /* remove([selector]) */ exports.remove = function(selector) { var elems = this; // Filter if we have selector if (selector) elems = elems.filter(selector); domEach(elems, function(i, el) { var parent = el.parent || el.root; if (!parent) { return; } var siblings = parent.children, index = siblings.indexOf(el); if (index < 0) return; siblings.splice(index, 1); if (el.prev) { el.prev.next = el.next; } if (el.next) { el.next.prev = el.prev; } el.prev = el.next = el.parent = el.root = null; }); return this; }; exports.replaceWith = function(content) { var self = this; domEach(this, function(i, el) { var parent = el.parent || el.root; if (!parent) { return; } var siblings = parent.children, dom = self._makeDomArray(typeof content === 'function' ? content.call(el, i, el) : content), index; // In the case that `dom` contains nodes that already exist in other // structures, ensure those nodes are properly removed. updateDOM(dom, null); index = siblings.indexOf(el); // Completely remove old element uniqueSplice(siblings, index, 1, dom, parent); el.parent = el.prev = el.next = el.root = null; }); return this; }; exports.empty = function() { domEach(this, function(i, el) { _.forEach(el.children, function(child) { child.next = child.prev = child.parent = null; }); el.children.length = 0; }); return this; }; /** * Set/Get the HTML */ exports.html = function(str) { if (str === undefined) { if (!this[0] || !this[0].children) return null; return $.html(this[0].children, this.options); } var opts = this.options; domEach(this, function(i, el) { _.forEach(el.children, function(child) { child.next = child.prev = child.parent = null; }); var content = str.cheerio ? str.clone().get() : evaluate('' + str, opts, false); updateDOM(content, el); }); return this; }; exports.toString = function() { return $.html(this, this.options); }; exports.text = function(str) { // If `str` is undefined, act as a "getter" if (str === undefined) { return $.text(this); } else if (typeof str === 'function') { // Function support return domEach(this, function(i, el) { var $el = [el]; return exports.text.call($el, str.call(el, i, $.text($el))); }); } // Append text node to each selected elements domEach(this, function(i, el) { _.forEach(el.children, function(child) { child.next = child.prev = child.parent = null; }); var elem = { data: '' + str, type: 'text', parent: el, prev: null, next: null, children: [] }; updateDOM(elem, el); }); return this; }; exports.clone = function() { return this._make(cloneDom(this.get(), this.options)); }; /***/ }), /* 598 */ /***/ (function(module, exports, __webpack_require__) { var baseFlatten = __webpack_require__(599); /** * Flattens `array` a single level deep. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to flatten. * @returns {Array} Returns the new flattened array. * @example * * _.flatten([1, [2, [3, [4]], 5]]); * // => [1, 2, [3, [4]], 5] */ function flatten(array) { var length = array == null ? 0 : array.length; return length ? baseFlatten(array, 1) : []; } module.exports = flatten; /***/ }), /* 599 */ /***/ (function(module, exports, __webpack_require__) { var arrayPush = __webpack_require__(559), isFlattenable = __webpack_require__(600); /** * The base implementation of `_.flatten` with support for restricting flattening. * * @private * @param {Array} array The array to flatten. * @param {number} depth The maximum recursion depth. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. * @param {Array} [result=[]] The initial result value. * @returns {Array} Returns the new flattened array. */ function baseFlatten(array, depth, predicate, isStrict, result) { var index = -1, length = array.length; predicate || (predicate = isFlattenable); result || (result = []); while (++index < length) { var value = array[index]; if (depth > 0 && predicate(value)) { if (depth > 1) { // Recursively flatten arrays (susceptible to call stack limits). baseFlatten(value, depth - 1, predicate, isStrict, result); } else { arrayPush(result, value); } } else if (!isStrict) { result[result.length] = value; } } return result; } module.exports = baseFlatten; /***/ }), /* 600 */ /***/ (function(module, exports, __webpack_require__) { var Symbol = __webpack_require__(67), isArguments = __webpack_require__(393), isArray = __webpack_require__(75); /** Built-in value references. */ var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; /** * Checks if `value` is a flattenable `arguments` object or array. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. */ function isFlattenable(value) { return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]); } module.exports = isFlattenable; /***/ }), /* 601 */ /***/ (function(module, exports, __webpack_require__) { var domEach = __webpack_require__(404).domEach, _ = { pick: __webpack_require__(602), }; var toString = Object.prototype.toString; /** * Set / Get css. * * @param {String|Object} prop * @param {String} val * @return {self} * @api public */ exports.css = function(prop, val) { if (arguments.length === 2 || // When `prop` is a "plain" object (toString.call(prop) === '[object Object]')) { return domEach(this, function(idx, el) { setCss(el, prop, val, idx); }); } else { return getCss(this[0], prop); } }; /** * Set styles of all elements. * * @param {String|Object} prop * @param {String} val * @param {Number} idx - optional index within the selection * @return {self} * @api private */ function setCss(el, prop, val, idx) { if ('string' == typeof prop) { var styles = getCss(el); if (typeof val === 'function') { val = val.call(el, idx, styles[prop]); } if (val === '') { delete styles[prop]; } else if (val != null) { styles[prop] = val; } el.attribs.style = stringify(styles); } else if ('object' == typeof prop) { Object.keys(prop).forEach(function(k){ setCss(el, k, prop[k]); }); } } /** * Get parsed styles of the first element. * * @param {String} prop * @return {Object} * @api private */ function getCss(el, prop) { var styles = parse(el.attribs.style); if (typeof prop === 'string') { return styles[prop]; } else if (Array.isArray(prop)) { return _.pick(styles, prop); } else { return styles; } } /** * Stringify `obj` to styles. * * @param {Object} obj * @return {Object} * @api private */ function stringify(obj) { return Object.keys(obj || {}) .reduce(function(str, prop){ return str += '' + (str ? ' ' : '') + prop + ': ' + obj[prop] + ';'; }, ''); } /** * Parse `styles`. * * @param {String} styles * @return {Object} * @api private */ function parse(styles) { styles = (styles || '').trim(); if (!styles) return {}; return styles .split(';') .reduce(function(obj, str){ var n = str.indexOf(':'); // skip if there is no :, or if it is the first/last character if (n < 1 || n === str.length-1) return obj; obj[str.slice(0,n).trim()] = str.slice(n+1).trim(); return obj; }, {}); } /***/ }), /* 602 */ /***/ (function(module, exports, __webpack_require__) { var basePick = __webpack_require__(603), flatRest = __webpack_require__(606); /** * Creates an object composed of the picked `object` properties. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The source object. * @param {...(string|string[])} [paths] The property paths to pick. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.pick(object, ['a', 'c']); * // => { 'a': 1, 'c': 3 } */ var pick = flatRest(function(object, paths) { return object == null ? {} : basePick(object, paths); }); module.exports = pick; /***/ }), /* 603 */ /***/ (function(module, exports, __webpack_require__) { var basePickBy = __webpack_require__(604), hasIn = __webpack_require__(582); /** * The base implementation of `_.pick` without support for individual * property identifiers. * * @private * @param {Object} object The source object. * @param {string[]} paths The property paths to pick. * @returns {Object} Returns the new object. */ function basePick(object, paths) { return basePickBy(object, paths, function(value, path) { return hasIn(object, path); }); } module.exports = basePick; /***/ }), /* 604 */ /***/ (function(module, exports, __webpack_require__) { var baseGet = __webpack_require__(572), baseSet = __webpack_require__(605), castPath = __webpack_require__(573); /** * The base implementation of `_.pickBy` without support for iteratee shorthands. * * @private * @param {Object} object The source object. * @param {string[]} paths The property paths to pick. * @param {Function} predicate The function invoked per property. * @returns {Object} Returns the new object. */ function basePickBy(object, paths, predicate) { var index = -1, length = paths.length, result = {}; while (++index < length) { var path = paths[index], value = baseGet(object, path); if (predicate(value, path)) { baseSet(result, castPath(path, object), value); } } return result; } module.exports = basePickBy; /***/ }), /* 605 */ /***/ (function(module, exports, __webpack_require__) { var assignValue = __webpack_require__(365), castPath = __webpack_require__(573), isIndex = __webpack_require__(388), isObject = __webpack_require__(72), toKey = __webpack_require__(581); /** * The base implementation of `_.set`. * * @private * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {*} value The value to set. * @param {Function} [customizer] The function to customize path creation. * @returns {Object} Returns `object`. */ function baseSet(object, path, value, customizer) { if (!isObject(object)) { return object; } path = castPath(path, object); var index = -1, length = path.length, lastIndex = length - 1, nested = object; while (nested != null && ++index < length) { var key = toKey(path[index]), newValue = value; if (index != lastIndex) { var objValue = nested[key]; newValue = customizer ? customizer(objValue, key, nested) : undefined; if (newValue === undefined) { newValue = isObject(objValue) ? objValue : (isIndex(path[index + 1]) ? [] : {}); } } assignValue(nested, key, newValue); nested = nested[key]; } return object; } module.exports = baseSet; /***/ }), /* 606 */ /***/ (function(module, exports, __webpack_require__) { var flatten = __webpack_require__(598), overRest = __webpack_require__(379), setToString = __webpack_require__(381); /** * A specialized version of `baseRest` which flattens the rest array. * * @private * @param {Function} func The function to apply a rest parameter to. * @returns {Function} Returns the new function. */ function flatRest(func) { return setToString(overRest(func, undefined, flatten), func + ''); } module.exports = flatRest; /***/ }), /* 607 */ /***/ (function(module, exports, __webpack_require__) { // https://github.com/jquery/jquery/blob/2.1.3/src/manipulation/var/rcheckableType.js // https://github.com/jquery/jquery/blob/2.1.3/src/serialize.js var submittableSelector = 'input,select,textarea,keygen', r20 = /%20/g, rCRLF = /\r?\n/g, _ = { map: __webpack_require__(608) }; exports.serialize = function() { // Convert form elements into name/value objects var arr = this.serializeArray(); // Serialize each element into a key/value string var retArr = _.map(arr, function(data) { return encodeURIComponent(data.name) + '=' + encodeURIComponent(data.value); }); // Return the resulting serialization return retArr.join('&').replace(r20, '+'); }; exports.serializeArray = function() { // Resolve all form elements from either forms or collections of form elements var Cheerio = this.constructor; return this.map(function() { var elem = this; var $elem = Cheerio(elem); if (elem.name === 'form') { return $elem.find(submittableSelector).toArray(); } else { return $elem.filter(submittableSelector).toArray(); } }).filter( // Verify elements have a name (`attr.name`) and are not disabled (`:disabled`) '[name!=""]:not(:disabled)' // and cannot be clicked (`[type=submit]`) or are used in `x-www-form-urlencoded` (`[type=file]`) + ':not(:submit, :button, :image, :reset, :file)' // and are either checked/don't have a checkable state + ':matches([checked], :not(:checkbox, :radio))' // Convert each of the elements to its value(s) ).map(function(i, elem) { var $elem = Cheerio(elem); var name = $elem.attr('name'); var value = $elem.val(); // If there is no value set (e.g. `undefined`, `null`), then default value to empty if (value == null) { value = ''; } // If we have an array of values (e.g. `<select multiple>`), return an array of key/value pairs if (Array.isArray(value)) { return _.map(value, function(val) { // We trim replace any line endings (e.g. `\r` or `\r\n` with `\r\n`) to guarantee consistency across platforms // These can occur inside of `<textarea>'s` return {name: name, value: val.replace( rCRLF, '\r\n' )}; }); // Otherwise (e.g. `<input type="text">`, return only one key/value pair } else { return {name: name, value: value.replace( rCRLF, '\r\n' )}; } // Convert our result to an array }).get(); }; /***/ }), /* 608 */ /***/ (function(module, exports, __webpack_require__) { var arrayMap = __webpack_require__(580), baseIteratee = __webpack_require__(543), baseMap = __webpack_require__(609), isArray = __webpack_require__(75); /** * Creates an array of values by running each element in `collection` thru * `iteratee`. The iteratee is invoked with three arguments: * (value, index|key, collection). * * Many lodash methods are guarded to work as iteratees for methods like * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. * * The guarded methods are: * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, * `template`, `trim`, `trimEnd`, `trimStart`, and `words` * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the new mapped array. * @example * * function square(n) { * return n * n; * } * * _.map([4, 8], square); * // => [16, 64] * * _.map({ 'a': 4, 'b': 8 }, square); * // => [16, 64] (iteration order is not guaranteed) * * var users = [ * { 'user': 'barney' }, * { 'user': 'fred' } * ]; * * // The `_.property` iteratee shorthand. * _.map(users, 'user'); * // => ['barney', 'fred'] */ function map(collection, iteratee) { var func = isArray(collection) ? arrayMap : baseMap; return func(collection, baseIteratee(iteratee, 3)); } module.exports = map; /***/ }), /* 609 */ /***/ (function(module, exports, __webpack_require__) { var baseEach = __webpack_require__(459), isArrayLike = __webpack_require__(386); /** * The base implementation of `_.map` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function baseMap(collection, iteratee) { var index = -1, result = isArrayLike(collection) ? Array(collection.length) : []; baseEach(collection, function(value, key, collection) { result[++index] = iteratee(value, key, collection); }); return result; } module.exports = baseMap; /***/ }), /* 610 */ /***/ (function(module) { module.exports = JSON.parse("{\"name\":\"cheerio\",\"version\":\"1.0.0-rc.3\",\"description\":\"Tiny, fast, and elegant implementation of core jQuery designed specifically for the server\",\"author\":\"Matt Mueller <mattmuelle@gmail.com> (mat.io)\",\"license\":\"MIT\",\"keywords\":[\"htmlparser\",\"jquery\",\"selector\",\"scraper\",\"parser\",\"html\"],\"repository\":{\"type\":\"git\",\"url\":\"git://github.com/cheeriojs/cheerio.git\"},\"main\":\"./index.js\",\"files\":[\"index.js\",\"lib\"],\"engines\":{\"node\":\">= 0.6\"},\"dependencies\":{\"css-select\":\"~1.2.0\",\"dom-serializer\":\"~0.1.1\",\"entities\":\"~1.1.1\",\"htmlparser2\":\"^3.9.1\",\"lodash\":\"^4.15.0\",\"parse5\":\"^3.0.1\"},\"devDependencies\":{\"benchmark\":\"^2.1.0\",\"coveralls\":\"^2.11.9\",\"expect.js\":\"~0.3.1\",\"istanbul\":\"^0.4.3\",\"jquery\":\"^3.0.0\",\"jsdom\":\"^9.2.1\",\"jshint\":\"^2.9.2\",\"mocha\":\"^3.1.2\",\"xyz\":\"~1.1.0\"},\"scripts\":{\"test\":\"make test\"}}"); /***/ }), /* 611 */ /***/ (function(module, exports, __webpack_require__) { /** * Filters the passed array from data already present in the cozy so that there is * not duplicated data in the Cozy. * * @module hydrateAndFilter */ const bluebird = __webpack_require__(25); const log = __webpack_require__(2).namespace('hydrateAndFilter'); const get = __webpack_require__(571); const uniqBy = __webpack_require__(612); const { queryAll } = __webpack_require__(616); /** * Since we can use methods or basic functions for * `shouldSave` and `shouldUpdate` we pass the * appropriate `this` and `arguments`. * * If `funcOrMethod` is a method, it will be called * with args[0] as `this` and the rest as `arguments` * Otherwise, `this` will be null and `args` will be passed * as `arguments`. */ const suitableCall = (funcOrMethod, ...args) => { const arity = funcOrMethod.length; if (arity < args.length) { // must be a method return funcOrMethod.apply(args[0], args.slice(1)); } else { // must be a function return funcOrMethod.apply(null, args); } }; /** * Filters the passed array from data already present in the cozy so that there is * not duplicated data in the Cozy. * * You need at least the `GET` permission for the given doctype in your manifest, to be able to * use this function. * * Parameters: * * * `documents`: an array of objects corresponding to the data you want to save in the cozy * * `doctype` (string): the doctype where you want to save data (ex: 'io.cozy.bills') * * `options` : * - `keys` (array) : List of keys used to check that two items are the same. By default it is set to `['id']'. * - `index` (optionnal) : Return value returned by `cozy.data.defineIndex`, the default will correspond to all documents of the selected doctype. * - `selector` (optionnal object) : Mango request to get records. Default is built from the keys `{selector: {_id: {"$gt": null}}}` to get all the records. * * ```javascript * const documents = [ * { * name: 'toto', * height: 1.8 * }, * { * name: 'titi', * height: 1.7 * } * ] * * return hydrateAndFilter(documents, 'io.cozy.height', { * keys: ['name'] * }).then(filteredDocuments => addData(filteredDocuments, 'io.cozy.height')) * * ``` * * @alias module:hydrateAndFilter */ const hydrateAndFilter = (documents = [], doctype, options = {}) => { const cozy = __webpack_require__(617); log('info', `${documents.length} items before hydrateAndFilter`); if (!doctype) return Promise.reject(new Error(`Doctype is mandatory to filter the connector data.`)); const keys = options.keys ? options.keys : ['_id']; const store = {}; const createHash = item => { return keys.map(key => { let result = get(item, key); if (key === 'date') result = new Date(result); return result; }).join('####'); }; const getIndex = () => { const index = options.index ? Promise.resolve(options.index) : cozy.data.defineIndex(doctype, keys); return index; }; const getItems = async index => { const selector = options.selector ? options.selector : null; return await queryAll(doctype, selector, index); }; const populateStore = store => dbitems => { dbitems.forEach(dbitem => { store[createHash(dbitem)] = dbitem; }); }; // We add _id to `documents` that we find in the database. // This is useful when linking with bank operations (a bill // can already be in the database but not already matched // to an operation) since the linking operation need the _id // of the document const hydrateExistingEntries = store => () => { documents.forEach(document => { const key = createHash(document); if (store[key]) { document._id = store[key]._id; document._rev = store[key]._rev; if (!document.cozyMetadata && store[key].cozyMetadata) document.cozyMetadata = store[key].cozyMetadata; } }); return documents; }; const defaultShouldSave = () => true; const defaultShouldUpdate = existing => false; // eslint-disable-line no-unused-vars const filterEntries = store => async () => { // Filter out items according to shouldSave / shouldUpdate. // Both can be passed as option or can be part of the entry. return uniqBy((await bluebird.filter(documents, entry => { const shouldSave = entry.shouldSave || options.shouldSave || defaultShouldSave; const shouldUpdate = entry.shouldUpdate || options.shouldUpdate || defaultShouldUpdate; const existing = store[createHash(entry)]; if (existing) { return suitableCall(shouldUpdate, entry, existing); } else { return suitableCall(shouldSave, entry); } })), entry => entry && entry._id || entry); }; const formatOutput = entries => { log('info', `${entries.length} items after hydrateAndFilter`); return entries; }; return getIndex().then(getItems).then(populateStore(store)).then(hydrateExistingEntries(store)).then(filterEntries(store)).then(entries => entries.filter(Boolean)) // Filter out wrong entries .then(formatOutput); }; module.exports = hydrateAndFilter; /***/ }), /* 612 */ /***/ (function(module, exports, __webpack_require__) { var baseIteratee = __webpack_require__(543), baseUniq = __webpack_require__(613); /** * This method is like `_.uniq` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the criterion by which * uniqueness is computed. The order of result values is determined by the * order they occur in the array. The iteratee is invoked with one argument: * (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new duplicate free array. * @example * * _.uniqBy([2.1, 1.2, 2.3], Math.floor); * // => [2.1, 1.2] * * // The `_.property` iteratee shorthand. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }, { 'x': 2 }] */ function uniqBy(array, iteratee) { return (array && array.length) ? baseUniq(array, baseIteratee(iteratee, 2)) : []; } module.exports = uniqBy; /***/ }), /* 613 */ /***/ (function(module, exports, __webpack_require__) { var SetCache = __webpack_require__(549), arrayIncludes = __webpack_require__(444), arrayIncludesWith = __webpack_require__(614), cacheHas = __webpack_require__(552), createSet = __webpack_require__(615), setToArray = __webpack_require__(555); /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; /** * The base implementation of `_.uniqBy` without support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new duplicate free array. */ function baseUniq(array, iteratee, comparator) { var index = -1, includes = arrayIncludes, length = array.length, isCommon = true, result = [], seen = result; if (comparator) { isCommon = false; includes = arrayIncludesWith; } else if (length >= LARGE_ARRAY_SIZE) { var set = iteratee ? null : createSet(array); if (set) { return setToArray(set); } isCommon = false; includes = cacheHas; seen = new SetCache; } else { seen = iteratee ? [] : result; } outer: while (++index < length) { var value = array[index], computed = iteratee ? iteratee(value) : value; value = (comparator || value !== 0) ? value : 0; if (isCommon && computed === computed) { var seenIndex = seen.length; while (seenIndex--) { if (seen[seenIndex] === computed) { continue outer; } } if (iteratee) { seen.push(computed); } result.push(value); } else if (!includes(seen, computed, comparator)) { if (seen !== result) { seen.push(computed); } result.push(value); } } return result; } module.exports = baseUniq; /***/ }), /* 614 */ /***/ (function(module, exports) { /** * This function is like `arrayIncludes` except that it accepts a comparator. * * @private * @param {Array} [array] The array to inspect. * @param {*} target The value to search for. * @param {Function} comparator The comparator invoked per element. * @returns {boolean} Returns `true` if `target` is found, else `false`. */ function arrayIncludesWith(array, value, comparator) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (comparator(value, array[index])) { return true; } } return false; } module.exports = arrayIncludesWith; /***/ }), /* 615 */ /***/ (function(module, exports, __webpack_require__) { var Set = __webpack_require__(566), noop = __webpack_require__(431), setToArray = __webpack_require__(555); /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0; /** * Creates a set object of `values`. * * @private * @param {Array} values The values to add to the set. * @returns {Object} Returns the new set. */ var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { return new Set(values); }; module.exports = createSet; /***/ }), /* 616 */ /***/ (function(module, exports, __webpack_require__) { /** * Small utilities helping to develop konnectors. * * @module utils */ const cozyClient = __webpack_require__(617); const groupBy = __webpack_require__(1037); const keyBy = __webpack_require__(910); const sortBy = __webpack_require__(1089); const range = __webpack_require__(1094); const format = __webpack_require__(1097); /** * This function allows to fetch all documents for a given doctype. It is the fastest to get all * documents but without filtering possibilities * deprecated by the findAll method from cozyClient * * Parameters: * * * `doctype` (string): the doctype from which you want to fetch the data * */ const fetchAll = async doctype => { return cozyClient.data.findAll(doctype); }; /** * This function allows to fetch all documents for a given doctype exceeding the 100 limit. * It is slower that fetchAll because it fetches the data 100 by 100 but allows to filter the data * with a selector and an index * * Parameters: * * * `doctype` (string): the doctype from which you want to fetch the data * * `selector` (object): the mango query selector * * `index` (object): (optional) the query selector index. If not defined, the function will * create it's own index with the keys specified in the selector * * * ```javascript * const documents = await queryAll('io.cozy.bills', {vendor: 'Direct Energie'}) * ``` */ const queryAll = async (doctype, selector, index) => { if (!selector) { // fetchAll is faster in this case return await cozyClient.data.findAll(doctype); } if (!index) { index = await cozyClient.data.defineIndex(doctype, Object.keys(selector)); } const result = []; let resp = { next: true }; while (resp && resp.next) { resp = await cozyClient.data.query(index, { selector, wholeResponse: true, skip: result.length }); result.push(...resp.docs); } return result; }; /** * This function find duplicates in a given doctype, filtered by an optional mango selector * * Parameters: * * * `doctype` (string): the doctype from which you want to fetch the data * * `selector` (object): (optional) the mango query selector * * `options` : * - `keys` (array) : List of keys used to check that two items are the same. * - `index` (optionnal) : Return value returned by `cozy.data.defineIndex`, the default will correspond to all documents of the selected doctype. * - `selector` (optionnal object) : Mango request to get records. Gets all the records by default * * Returns an object with the following keys: * * `toKeep`: this is the list of unique documents that you should keep in db * * `toRemove`: this is the list of documents that can remove from db. If this is io.cozy.bills * documents, do not forget to clean linked bank operations * * ```javascript * const {toKeep, toRemove} = await findDuplicates('io.cozy.bills', {selector: {vendor: 'Direct Energie'}}) * ``` */ const findDuplicates = async (doctype, options) => { let hash = null; if (options.keys) { hash = doc => options.keys.map(key => { let result = doc[key]; if (key === 'date') result = new Date(result); return result; }).join(','); } else if (options.hash) { hash = options.hash; } else { throw new Error('findDuplicates: you must specify keys or hash option'); } let documents = await queryAll(doctype, options.selector); if (doctype === 'io.cozy.bills') { // keep the bills with the highest number of operations linked to it const operations = await fetchAll('io.cozy.bank.operations'); documents = sortBillsByLinkedOperationNumber(documents, operations); } const groups = groupBy(documents, hash); const toKeep = []; const toRemove = []; for (let key in groups) { const group = groups[key]; toKeep.push(group[0]); toRemove.push.apply(toRemove, group.slice(1).map(doc => ({ ...doc, original: group[0]._id }))); } return { toKeep, toRemove }; }; const sortBillsByLinkedOperationNumber = (bills, operations) => { bills = bills.map(bill => { bill.opNb = 0; return bill; }); const billsIndex = keyBy(bills, '_id'); if (operations) operations.forEach(op => { if (op.bills) op.bills.forEach(billId => { const bill = billsIndex[billId]; if (bill) bill.opNb++; }); }); const sorted = sortBy(Object.values(billsIndex), 'opNb').reverse(); return sorted; }; /** * This is a shortcut to update multiple documents in one call * * Parameters: * * * `doctype` (string): the doctype from which you want to fetch the data * * `ids` (array): array of ids of documents to update * * `transformation` (object): attributes to change with their values * * `options` : * - `keys` (array) : List of keys used to check that two items are the same. * - `index` (optionnal) : Return value returned by `cozy.data.defineIndex`, the default will correspond to all documents of the selected doctype. * - `selector` (optionnal object) : Mango request to get records. Gets all the records by default * * Returns a promise which resolves with all the return values of updateAttributes * * ```javascript * await batchUpdateAttributes('io.cozy.bills', [1, 2, 3], {vendor: 'Direct Energie'}) * ``` */ const batchUpdateAttributes = async (doctype, ids, transformation) => { const result = []; for (const id of ids) { const updateResult = await cozyClient.data.updateAttributes(doctype, id, transformation); result.push(updateResult); } return result; }; /** * This is a shortcut to delete multiple documents in one call * * Parameters: * * * `doctype` (string): the doctype from which you want to fetch the data * * `documents` (array): documents to delete with their ids * * `transformation` (object): attributes to change with their values * * `options` : * - `keys` (array) : List of keys used to check that two items are the same. * - `index` (optionnal) : Return value returned by `cozy.data.defineIndex`, the default will correspond to all documents of the selected doctype. * - `selector` (optionnal object) : Mango request to get records. Gets all the records by default * * Returns a promise which resolves with all the return values of updateAttributes * * Example to remove all the documents for a given doctype * * ```javascript * const documents = await fetchAll('io.cozy.marvel') * await batchDelete('io.cozy.marvel', documents) * ``` */ const batchDelete = async (doctype, documents) => { const result = []; for (const doc of documents) { const deleteResult = await cozyClient.data.delete(doctype, doc); result.push(deleteResult); } return result; }; /** * This function can read the content of a cozy pdf file and output its text * * Parameters: * * * `fileId` (string): the id of the file in the cozy * * `options` : * - `pages` (array or number) : The list of page you want to interpret * * * You need to add pdfjs-dist package as a dependency to your connector to allow this to work * * Returns a promise which resolves with an object with the following attributes: * - `text` (string) : The full text of the pdf * - `1` : The full pdfjs data for page 1 * - `n` : The full pdfjs data for page n * * Example: * * ```javascript * const pdfText = (await getPdfText('887ABCFE87687')).text * ``` */ const getPdfText = async (fileId, options = {}) => { let pdfjs; try { pdfjs = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module 'pdfjs-dist'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())); } catch (err) { throw new Error('pdfjs-dist dependency is missing. Please add it in your package.json'); } const response = await cozyClient.files.downloadById(fileId); const buffer = await response.buffer(); const document = await pdfjs.getDocument(buffer); let pages; if (options.pages) { pages = Array.isArray(options.pages) ? options.pages : [options.pages]; } else { pages = range(1, document.numPages + 1); } const result = { text: '' }; for (const pageNum of pages) { const page = await document.getPage(pageNum); const pageItems = (await page.getTextContent()).items; result.text += pageItems.map(doc => doc.str).join('\n'); result[pageNum] = pageItems; } return result; }; module.exports = { fetchAll, queryAll, findDuplicates, sortBillsByLinkedOperationNumber, batchUpdateAttributes, batchDelete, getPdfText, formatDate }; /** * This function convert a Date Object to a ISO date string (2018-07-31) * * Parameters: * * * `date` (Date): the id of the file in the cozy * * Returns a string * * Example: * * ```javascript * const date = formatFrenchDate(New Date.now()) * ``` */ function formatDate(date) { return format(date, 'YYYY-MM-DD'); } /***/ }), /* 617 */ /***/ (function(module, exports, __webpack_require__) { /** * [cozy-client-js](https://github.com/cozy/cozy-client-js) instance already * initialized and ready to use. * * @module cozyClient */ /* eslint no-console: off */ const { Client, MemoryStorage } = __webpack_require__(618); const NewCozyClient = __webpack_require__(727).default; const manifest = __webpack_require__(1059); const getCredentials = function (environment) { try { if (environment === 'development') { const credentials = JSON.parse(process.env.COZY_CREDENTIALS); credentials.token.toAuthHeader = function () { return 'Bearer ' + credentials.client.registrationAccessToken; }; return credentials; } else { return process.env.COZY_CREDENTIALS.trim(); } } catch (err) { console.error(`Please provide proper COZY_CREDENTIALS environment variable. ${process.env.COZY_CREDENTIALS} is not OK`); throw err; } }; const getCozyUrl = function () { if (process.env.COZY_URL === undefined) { console.error(`Please provide COZY_URL environment variable.`); throw new Error('COZY_URL environment variable is absent/not valid'); } else { return process.env.COZY_URL; } }; const getCozyClient = function (environment = 'production') { if (environment === 'standalone' || environment === 'test') { return __webpack_require__(1060); } const credentials = getCredentials(environment); const cozyURL = getCozyUrl(); const options = { cozyURL: cozyURL }; if (environment === 'development') { options.oauth = { storage: new MemoryStorage() }; } else if (environment === 'production') { options.token = credentials; } const cozyClient = new Client(options); let token = credentials; if (environment === 'development') { cozyClient.saveCredentials(credentials.client, credentials.token); token = credentials.token.accessToken; } const cozyFields = JSON.parse(process.env.COZY_FIELDS || '{}'); cozyClient.new = new NewCozyClient({ uri: cozyURL, token, appMetadata: { slug: manifest.data.slug, sourceAccount: cozyFields.account, version: manifest.data.version } }); return cozyClient; }; /** * [cozy-client-js](https://github.com/cozy/cozy-client-js) instance already initialized and ready to use. * * If you want to access cozy-client-js directly, this method gives you directly an instance of it, * initialized according to `COZY_URL` and `COZY_CREDENTIALS` environment variable given by cozy-stack * You can refer to the [cozy-client-js documentation](https://github.com/cozy/cozy-client-js) for more information. * * Example : * * ```javascript * const {cozyClient} = require('cozy-konnector-libs') * * cozyClient.data.defineIndex('my.doctype', ['_id']) * ``` * * @alias module:cozyClient */ const cozyClient = getCozyClient( // webpack 4 now changes the NODE_ENV environment variable when you change its 'mode' option // since we do not want to minimize the built file, we recognize the 'none' mode as production mode true ? 'production' : undefined); module.exports = cozyClient; /***/ }), /* 618 */ /***/ (function(module, exports, __webpack_require__) { (function(e, a) { for(var i in a) e[i] = a[i]; }(exports, /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 10); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(fetch) { Object.defineProperty(exports, "__esModule", { value: true }); exports.FetchError = undefined; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); /* global fetch */ exports.cozyFetch = cozyFetch; exports.cozyFetchJSON = cozyFetchJSON; exports.cozyFetchRawJSON = cozyFetchRawJSON; exports.handleInvalidTokenError = handleInvalidTokenError; var _auth_v = __webpack_require__(3); var _utils = __webpack_require__(1); var _jsonapi = __webpack_require__(8); var _jsonapi2 = _interopRequireDefault(_jsonapi); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function cozyFetch(cozy, path) { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; return cozy.fullpath(path).then(function (fullpath) { var resp = void 0; if (options.disableAuth) { resp = fetch(fullpath, options); } else if (options.manualAuthCredentials) { resp = cozyFetchWithAuth(cozy, fullpath, options, options.manualAuthCredentials); } else { resp = cozy.authorize().then(function (credentials) { return cozyFetchWithAuth(cozy, fullpath, options, credentials); }); } return resp.then(function (res) { return handleResponse(res, cozy._invalidTokenErrorHandler); }); }); } function cozyFetchWithAuth(cozy, fullpath, options, credentials) { if (credentials) { options.headers = options.headers || {}; options.headers['Authorization'] = credentials.token.toAuthHeader(); } // the option credentials:include tells fetch to include the cookies in the // request even for cross-origin requests options.credentials = 'include'; return Promise.all([cozy.isV2(), fetch(fullpath, options)]).then(function (_ref) { var _ref2 = _slicedToArray(_ref, 2), isV2 = _ref2[0], res = _ref2[1]; if (res.status !== 400 && res.status !== 401 || isV2 || !credentials || options.dontRetry) { return res; } // we try to refresh the token only for OAuth, ie, the client defined // and the token is an instance of AccessToken. var client = credentials.client, token = credentials.token; if (!client || !(token instanceof _auth_v.AccessToken)) { return res; } options.dontRetry = true; return (0, _utils.retry)(function () { return (0, _auth_v.refreshToken)(cozy, client, token); }, 3)().then(function (newToken) { return cozy.saveCredentials(client, newToken); }).then(function (credentials) { return cozyFetchWithAuth(cozy, fullpath, options, credentials); }); }); } function cozyFetchJSON(cozy, method, path, body) { var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {}; var processJSONAPI = typeof options.processJSONAPI === 'undefined' || options.processJSONAPI; return fetchJSON(cozy, method, path, body, options).then(function (response) { return handleJSONResponse(response, processJSONAPI); }); } function cozyFetchRawJSON(cozy, method, path, body) { var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {}; return fetchJSON(cozy, method, path, body, options).then(function (response) { return handleJSONResponse(response, false); }); } function fetchJSON(cozy, method, path, body) { var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {}; options.method = method; var headers = options.headers = options.headers || {}; headers['Accept'] = 'application/json'; if (method !== 'GET' && method !== 'HEAD' && body !== undefined) { if (headers['Content-Type']) { options.body = body; } else { headers['Content-Type'] = 'application/json'; options.body = JSON.stringify(body); } } return cozyFetch(cozy, path, options); } function handleResponse(res, invalidTokenErrorHandler) { if (res.ok) { return res; } var data = void 0; var contentType = res.headers.get('content-type'); if (contentType && contentType.indexOf('json') >= 0) { data = res.json(); } else { data = res.text(); } return data.then(function (err) { var error = new FetchError(res, err); if (FetchError.isInvalidToken(error) && invalidTokenErrorHandler) { invalidTokenErrorHandler(error); } throw error; }); } function handleJSONResponse(res) { var processJSONAPI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; var contentType = res.headers.get('content-type'); if (!contentType || contentType.indexOf('json') < 0) { return res.text(function (data) { throw new FetchError(res, new Error('Response is not JSON: ' + data)); }); } var json = res.json(); if (contentType.indexOf('application/vnd.api+json') === 0 && processJSONAPI) { return json.then(_jsonapi2.default); } else { return json; } } function handleInvalidTokenError(error) { try { var currentOrigin = window.location.origin; var requestUrl = error.url; if (requestUrl.indexOf(currentOrigin.replace(/^(https?:\/\/\w+)-\w+\./, '$1.')) === 0) { var redirectURL = currentOrigin + '?' + (0, _utils.encodeQuery)({ disconnect: 1 }); window.location = redirectURL; } } catch (e) { console.warn('Unable to handle invalid token error', e, error); } } var FetchError = exports.FetchError = function (_Error) { _inherits(FetchError, _Error); function FetchError(res, reason) { _classCallCheck(this, FetchError); var _this = _possibleConstructorReturn(this, (FetchError.__proto__ || Object.getPrototypeOf(FetchError)).call(this)); if (Error.captureStackTrace) { Error.captureStackTrace(_this, _this.constructor); } // XXX We have to hardcode this because babel doesn't play nice when extending Error _this.name = 'FetchError'; _this.response = res; _this.url = res.url; _this.status = res.status; _this.reason = reason; Object.defineProperty(_this, 'message', { value: reason.message || (typeof reason === 'string' ? reason : JSON.stringify(reason)) }); return _this; } return FetchError; }(Error); FetchError.isUnauthorized = function (err) { // XXX We can't use err instanceof FetchError because of the caveats of babel return err.name === 'FetchError' && err.status === 401; }; FetchError.isNotFound = function (err) { // XXX We can't use err instanceof FetchError because of the caveats of babel return err.name === 'FetchError' && err.status === 404; }; FetchError.isInvalidToken = function (err) { // XXX We can't use err instanceof FetchError because of the caveats of babel return err.name === 'FetchError' && err.status === 400 && err.reason && (err.reason.error === 'Invalid JWT token' || err.reason.error === 'Expired token'); }; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) /***/ }), /* 1 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.unpromiser = unpromiser; exports.isPromise = isPromise; exports.isOnline = isOnline; exports.isOffline = isOffline; exports.sleep = sleep; exports.retry = retry; exports.getFuzzedDelay = getFuzzedDelay; exports.getBackedoffDelay = getBackedoffDelay; exports.createPath = createPath; exports.encodeQuery = encodeQuery; exports.decodeQuery = decodeQuery; exports.warn = warn; /* global navigator */ var FuzzFactor = 0.3; function unpromiser(fn) { return function () { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } var value = fn.apply(this, args); if (!isPromise(value)) { return value; } var l = args.length; if (l === 0 || typeof args[l - 1] !== 'function') { return; } var cb = args[l - 1]; value.then(function (res) { return cb(null, res); }, function (err) { return cb(err, null); }); }; } function isPromise(value) { return !!value && typeof value.then === 'function'; } function isOnline() { return typeof navigator !== 'undefined' ? navigator.onLine : true; } function isOffline() { return !isOnline(); } function sleep(time, args) { return new Promise(function (resolve) { setTimeout(resolve, time, args); }); } function retry(fn, count) { var delay = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 300; return function doTry() { for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } return fn.apply(undefined, args).catch(function (err) { if (--count < 0) { throw err; } return sleep(getBackedoffDelay(delay, count)).then(function () { return doTry.apply(undefined, args); }); }); }; } function getFuzzedDelay(retryDelay) { var fuzzingFactor = (Math.random() * 2 - 1) * FuzzFactor; return retryDelay * (1.0 + fuzzingFactor); } function getBackedoffDelay(retryDelay) { var retryCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; return getFuzzedDelay(retryDelay * Math.pow(2, retryCount - 1)); } function createPath(cozy, isV2, doctype) { var id = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ''; var query = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null; var route = '/data/'; if (!isV2) { route += encodeURIComponent(doctype) + '/'; } if (id !== '') { route += encodeURIComponent(id); } var q = encodeQuery(query); if (q !== '') { route += '?' + q; } return route; } function encodeQuery(query) { if (!query) { return ''; } var q = ''; for (var qname in query) { if (q !== '') { q += '&'; } q += encodeURIComponent(qname) + '=' + encodeURIComponent(query[qname]); } return q; } function decodeQuery(url) { var queryIndex = url.indexOf('?'); if (queryIndex < 0) { queryIndex = url.length; } var queries = {}; var fragIndex = url.indexOf('#'); if (fragIndex < 0) { fragIndex = url.length; } if (fragIndex < queryIndex) { return queries; } var queryStr = url.slice(queryIndex + 1, fragIndex); if (queryStr === '') { return queries; } var parts = queryStr.split('&'); for (var i = 0; i < parts.length; i++) { var pair = parts[i].split('='); if (pair.length === 0 || pair[0] === '') { continue; } var qname = decodeURIComponent(pair[0]); if (queries.hasOwnProperty(qname)) { continue; } if (pair.length === 1) { queries[qname] = true; } else if (pair.length === 2) { queries[qname] = decodeURIComponent(pair[1]); } else { throw new Error('Malformed URL'); } } return queries; } var warned = []; function warn(text) { if (warned.indexOf(text) === -1) { warned.push(text); console.warn('cozy-client-js', text); } } /***/ }), /* 2 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DOCTYPE_FILES = undefined; exports.normalizeDoctype = normalizeDoctype; var _utils = __webpack_require__(1); var DOCTYPE_FILES = exports.DOCTYPE_FILES = 'io.cozy.files'; var KNOWN_DOCTYPES = { files: DOCTYPE_FILES, folder: DOCTYPE_FILES, contact: 'io.cozy.contacts', event: 'io.cozy.events', track: 'io.cozy.labs.music.track', playlist: 'io.cozy.labs.music.playlist' }; var REVERSE_KNOWN = {}; Object.keys(KNOWN_DOCTYPES).forEach(function (k) { REVERSE_KNOWN[KNOWN_DOCTYPES[k]] = k; }); function normalizeDoctype(cozy, isV2, doctype) { var isQualified = doctype.indexOf('.') !== -1; if (isV2 && isQualified) { var known = REVERSE_KNOWN[doctype]; if (known) return known; return doctype.replace(/\./g, '-'); } if (!isV2 && !isQualified) { var _known = KNOWN_DOCTYPES[doctype]; if (_known) { (0, _utils.warn)('you are using a non-qualified doctype ' + doctype + ' assumed to be ' + _known); return _known; } throw new Error('Doctype ' + doctype + ' should be qualified.'); } return doctype; } /***/ }), /* 3 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(btoa) { Object.defineProperty(exports, "__esModule", { value: true }); exports.AppToken = exports.AccessToken = exports.Client = exports.StateKey = exports.CredsKey = undefined; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /* global btoa */ exports.client = client; exports.registerClient = registerClient; exports.updateClient = updateClient; exports.unregisterClient = unregisterClient; exports.getClient = getClient; exports.getAuthCodeURL = getAuthCodeURL; exports.getAccessToken = getAccessToken; exports.refreshToken = refreshToken; exports.oauthFlow = oauthFlow; var _utils = __webpack_require__(1); var _fetch = __webpack_require__(0); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var StateSize = 16; var CredsKey = exports.CredsKey = 'creds'; var StateKey = exports.StateKey = 'state'; var Client = exports.Client = function () { function Client(opts) { _classCallCheck(this, Client); this.clientID = opts.clientID || opts.client_id || ''; this.clientSecret = opts.clientSecret || opts.client_secret || ''; this.registrationAccessToken = opts.registrationAccessToken || opts.registration_access_token || ''; if (opts.redirect_uris) { this.redirectURI = opts.redirect_uris[0] || ''; } else { this.redirectURI = opts.redirectURI || ''; } this.softwareID = opts.softwareID || opts.software_id || ''; this.softwareVersion = opts.softwareVersion || opts.software_version || ''; this.clientName = opts.clientName || opts.client_name || ''; this.clientKind = opts.clientKind || opts.client_kind || ''; this.clientURI = opts.clientURI || opts.client_uri || ''; this.logoURI = opts.logoURI || opts.logo_uri || ''; this.policyURI = opts.policyURI || opts.policy_uri || ''; this.notificationPlatform = opts.notificationPlatform || opts.notification_platform || ''; this.notificationDeviceToken = opts.notificationDeviceToken || opts.notification_device_token || ''; if (!this.registrationAccessToken) { if (this.redirectURI === '') { throw new Error('Missing redirectURI field'); } if (this.softwareID === '') { throw new Error('Missing softwareID field'); } if (this.clientName === '') { throw new Error('Missing clientName field'); } } } _createClass(Client, [{ key: 'isRegistered', value: function isRegistered() { return this.clientID !== ''; } }, { key: 'toRegisterJSON', value: function toRegisterJSON() { return { redirect_uris: [this.redirectURI], software_id: this.softwareID, software_version: this.softwareVersion, client_name: this.clientName, client_kind: this.clientKind, client_uri: this.clientURI, logo_uri: this.logoURI, policy_uri: this.policyURI, notification_platform: this.notificationPlatform, notification_device_token: this.notificationDeviceToken }; } }, { key: 'toAuthHeader', value: function toAuthHeader() { return 'Bearer ' + this.registrationAccessToken; } }]); return Client; }(); var AccessToken = exports.AccessToken = function () { function AccessToken(opts) { _classCallCheck(this, AccessToken); this.tokenType = opts.tokenType || opts.token_type; this.accessToken = opts.accessToken || opts.access_token; this.refreshToken = opts.refreshToken || opts.refresh_token; this.scope = opts.scope; } _createClass(AccessToken, [{ key: 'toAuthHeader', value: function toAuthHeader() { return 'Bearer ' + this.accessToken; } }, { key: 'toBasicAuth', value: function toBasicAuth() { return 'user:' + this.accessToken + '@'; } }]); return AccessToken; }(); var AppToken = exports.AppToken = function () { function AppToken(opts) { _classCallCheck(this, AppToken); this.token = opts.token || ''; } _createClass(AppToken, [{ key: 'toAuthHeader', value: function toAuthHeader() { return 'Bearer ' + this.token; } }, { key: 'toBasicAuth', value: function toBasicAuth() { return 'user:' + this.token + '@'; } }]); return AppToken; }(); function client(cozy, clientParams) { if (!clientParams) { clientParams = cozy._clientParams; } if (clientParams instanceof Client) { return clientParams; } return new Client(clientParams); } function registerClient(cozy, clientParams) { var cli = client(cozy, clientParams); if (cli.isRegistered()) { return Promise.reject(new Error('Client already registered')); } return (0, _fetch.cozyFetchJSON)(cozy, 'POST', '/auth/register', cli.toRegisterJSON(), { disableAuth: true }).then(function (data) { return new Client(data); }); } function updateClient(cozy, clientParams) { var resetSecret = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var cli = client(cozy, clientParams); if (!cli.isRegistered()) { return Promise.reject(new Error('Client not registered')); } var data = cli.toRegisterJSON(); data.client_id = cli.clientID; if (resetSecret) data.client_secret = cli.clientSecret; return (0, _fetch.cozyFetchJSON)(cozy, 'PUT', '/auth/register/' + cli.clientID, data, { manualAuthCredentials: { token: cli } }).then(function (data) { return createClient(data, cli); }); } function unregisterClient(cozy, clientParams) { var cli = client(cozy, clientParams); if (!cli.isRegistered()) { return Promise.reject(new Error('Client not registered')); } return (0, _fetch.cozyFetchJSON)(cozy, 'DELETE', '/auth/register/' + cli.clientID, null, { manualAuthCredentials: { token: cli } }); } // getClient will retrive the registered client informations from the server. function getClient(cozy, clientParams) { var cli = client(cozy, clientParams); if (!cli.isRegistered()) { return Promise.reject(new Error('Client not registered')); } if ((0, _utils.isOffline)()) { return Promise.resolve(cli); } return (0, _fetch.cozyFetchJSON)(cozy, 'GET', '/auth/register/' + cli.clientID, null, { manualAuthCredentials: { token: cli } }).then(function (data) { return createClient(data, cli); }).catch(function (err) { // If we fall into an error while fetching the client (because of a // bad connectivity for instance), we do not bail the whole process // since the client should be able to continue with the persisted // client and token. // // If it is an explicit Unauthorized error though, we bail, clear th // cache and retry. if (_fetch.FetchError.isUnauthorized(err) || _fetch.FetchError.isNotFound(err)) { throw new Error('Client has been revoked'); } throw err; }); } // createClient returns a new Client instance given on object containing the // data of the client, from the API, and an old instance of the client. function createClient(data, oldClient) { var newClient = new Client(data); // we need to keep track of the registrationAccessToken since it is send // only on registration. The GET /auth/register/:client-id endpoint does // not return this token. var shouldPassRegistration = !!oldClient && oldClient.registrationAccessToken !== '' && newClient.registrationAccessToken === ''; if (shouldPassRegistration) { newClient.registrationAccessToken = oldClient.registrationAccessToken; } return newClient; } // getAuthCodeURL returns a pair {authURL,state} given a registered client. The // state should be stored in order to be checked against on the user validation // phase. function getAuthCodeURL(cozy, client) { var scopes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; if (!(client instanceof Client)) { client = new Client(client); } if (!client.isRegistered()) { throw new Error('Client not registered'); } var state = generateRandomState(); var query = { client_id: client.clientID, redirect_uri: client.redirectURI, state: state, response_type: 'code', scope: scopes.join(' ') }; return { url: cozy._url + ('/auth/authorize?' + (0, _utils.encodeQuery)(query)), state: state }; } // getAccessToken perform a request on the access_token entrypoint with the // authorization_code grant type in order to generate a new access token for a // newly registered client. // // This method extracts the access code and state from the given URL. By // default it uses window.location.href. Also, it checks the given state with // the one specified in the URL query parameter to prevent CSRF attacks. function getAccessToken(cozy, client, state) { var pageURL = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ''; if (!state) { return Promise.reject(new Error('Missing state value')); } var grantQueries = getGrantCodeFromPageURL(pageURL); if (grantQueries === null) { return Promise.reject(new Error('Missing states from current URL')); } if (state !== grantQueries.state) { return Promise.reject(new Error('Given state does not match url query state')); } return retrieveToken(cozy, client, null, { grant_type: 'authorization_code', code: grantQueries.code }); } // refreshToken perform a request on the access_token entrypoint with the // refresh_token grant type in order to refresh the given token. function refreshToken(cozy, client, token) { return retrieveToken(cozy, client, token, { grant_type: 'refresh_token', refresh_token: token.refreshToken }); } // oauthFlow performs the stateful registration and access granting of an OAuth // client. function oauthFlow(cozy, storage, clientParams, onRegistered) { var ignoreCachedCredentials = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; if (ignoreCachedCredentials) { return storage.clear().then(function () { return oauthFlow(cozy, storage, clientParams, onRegistered, false); }); } var tryCount = 0; function clearAndRetry(err) { if (tryCount++ > 0) { throw err; } return storage.clear().then(function () { return oauthFlow(cozy, storage, clientParams, onRegistered); }); } function registerNewClient() { return storage.clear().then(function () { return registerClient(cozy, clientParams); }).then(function (client) { var _getAuthCodeURL = getAuthCodeURL(cozy, client, clientParams.scopes), url = _getAuthCodeURL.url, state = _getAuthCodeURL.state; return storage.save(StateKey, { client: client, url: url, state: state }); }); } return Promise.all([storage.load(CredsKey), storage.load(StateKey)]).then(function (_ref) { var _ref2 = _slicedToArray(_ref, 2), credentials = _ref2[0], storedState = _ref2[1]; // If credentials are cached we re-fetch the registered client with the // said token. Fetching the client, if the token is outdated we should try // the token is refreshed. if (credentials) { var oldClient = void 0, _token = void 0; try { oldClient = new Client(credentials.client); _token = new AccessToken(credentials.token); } catch (err) { // bad cache, we should clear and retry the process return clearAndRetry(err); } return getClient(cozy, oldClient).then(function (client) { return { client: client, token: _token }; }).catch(function (err) { // If we fall into an error while fetching the client (because of a // bad connectivity for instance), we do not bail the whole process // since the client should be able to continue with the persisted // client and token. // // If it is an explicit Unauthorized error though, we bail, clear th // cache and retry. if (_fetch.FetchError.isUnauthorized(err) || _fetch.FetchError.isNotFound(err)) { throw new Error('Client has been revoked'); } return { client: oldClient, token: _token }; }); } // Otherwise register a new client if necessary (ie. no client is stored) // and call the onRegistered callback to wait for the user to grant the // access. Finally fetches to access token on success. var statePromise = void 0; if (!storedState) { statePromise = registerNewClient(); } else { statePromise = Promise.resolve(storedState); } var client = void 0, state = void 0, token = void 0; return statePromise.then(function (data) { client = data.client; state = data.state; return Promise.resolve(onRegistered(client, data.url)); }).then(function (pageURL) { return getAccessToken(cozy, client, state, pageURL); }).then(function (t) { token = t; }).then(function () { return storage.delete(StateKey); }).then(function () { return { client: client, token: token }; }); }).then(function (creds) { return storage.save(CredsKey, creds); }, function (err) { if (_fetch.FetchError.isUnauthorized(err)) { return clearAndRetry(err); } else { throw err; } }); } // retrieveToken perform a request on the access_token entrypoint in order to // fetch a token. function retrieveToken(cozy, client, token, query) { if (!(client instanceof Client)) { client = new Client(client); } if (!client.isRegistered()) { return Promise.reject(new Error('Client not registered')); } var body = (0, _utils.encodeQuery)(Object.assign({}, query, { client_id: client.clientID, client_secret: client.clientSecret })); return (0, _fetch.cozyFetchJSON)(cozy, 'POST', '/auth/access_token', body, { disableAuth: token === null, dontRetry: true, manualAuthCredentials: { client: client, token: token }, headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }).then(function (data) { data.refreshToken = data.refreshToken || query.refresh_token; return new AccessToken(data); }); } // getGrantCodeFromPageURL extract the state and code query parameters from the // given url function getGrantCodeFromPageURL() { var pageURL = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; if (pageURL === '' && typeof window !== 'undefined') { pageURL = window.location.href; } var queries = (0, _utils.decodeQuery)(pageURL); if (!queries.hasOwnProperty('state')) { return null; } return { state: queries['state'], code: queries['code'] }; } // generateRandomState will try to generate a 128bits random value from a secure // pseudo random generator. It will fallback on Math.random if it cannot find // such generator. function generateRandomState() { var buffer = void 0; if (typeof window !== 'undefined' && typeof window.crypto !== 'undefined' && typeof window.crypto.getRandomValues === 'function') { buffer = new Uint8Array(StateSize); window.crypto.getRandomValues(buffer); } else { try { buffer = __webpack_require__(14).randomBytes(StateSize); } catch (e) { buffer = null; } } if (!buffer) { buffer = new Array(StateSize); for (var i = 0; i < buffer.length; i++) { buffer[i] = Math.floor(Math.random() * 255); } } return btoa(String.fromCharCode.apply(null, buffer)).replace(/=+$/, '').replace(/\//g, '_').replace(/\+/g, '-'); } /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7))) /***/ }), /* 4 */ /***/ (function(module, exports) { module.exports = __webpack_require__(619); /***/ }), /* 5 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.pickService = pickService; // helper to serialize/deserialize an error for/from postMessage var errorSerializer = exports.errorSerializer = function () { function mapErrorProperties(from, to) { var result = Object.assign(to, from); var nativeProperties = ['name', 'message']; return nativeProperties.reduce(function (result, property) { if (from[property]) { to[property] = from[property]; } return result; }, result); } return { serialize: function serialize(error) { return mapErrorProperties(error, {}); }, deserialize: function deserialize(data) { return mapErrorProperties(data, new Error(data.message)); } }; }(); var first = function first(arr) { return arr && arr[0]; }; // In a far future, the user will have to pick the desired service from a list. // For now it's our job, an easy job as we arbitrary pick the first service of // the list. function pickService(intent, filterServices) { var services = intent.attributes.services; var filteredServices = filterServices ? (services || []).filter(filterServices) : services; return first(filteredServices); } /***/ }), /* 6 */ /***/ (function(module, exports) { module.exports = __webpack_require__(622); /***/ }), /* 7 */ /***/ (function(module, exports) { module.exports = __webpack_require__(654); /***/ }), /* 8 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function indexKey(doc) { return doc.type + '/' + doc.id; } function findByRef(resources, ref) { return resources[indexKey(ref)]; } function handleResource(rawResource, resources, links) { var resource = { _id: rawResource.id, _type: rawResource.type, _rev: rawResource.meta && rawResource.meta.rev, links: Object.assign({}, rawResource.links, links), attributes: rawResource.attributes, relations: function relations(name) { var rels = rawResource.relationships[name]; if (rels === undefined || rels.data === undefined) return undefined; if (rels.data === null) return null; if (!Array.isArray(rels.data)) return findByRef(resources, rels.data); return rels.data.map(function (ref) { return findByRef(resources, ref); }); } }; if (rawResource.relationships) { resource.relationships = rawResource.relationships; } resources[indexKey(rawResource)] = resource; return resource; } function handleTopLevel(doc) { var resources = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; // build an index of included resource by Type & ID var included = doc.included; if (Array.isArray(included)) { included.forEach(function (r) { return handleResource(r, resources, doc.links); }); } if (Array.isArray(doc.data)) { return doc.data.map(function (r) { return handleResource(r, resources, doc.links); }); } else { return handleResource(doc.data, resources, doc.links); } } exports.default = handleTopLevel; /***/ }), /* 9 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.redirect = exports.getRedirectionURL = undefined; var _regenerator = __webpack_require__(4); var _regenerator2 = _interopRequireDefault(_regenerator); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; // Redirect to an app able to handle the doctype // Redirections are more or less a hack of the intent API to retrieve an URL for // accessing a given doctype or a given document. // It needs to use a special action `REDIRECT` var getRedirectionURL = exports.getRedirectionURL = function () { var _ref = _asyncToGenerator( /*#__PURE__*/_regenerator2.default.mark(function _callee(cozy, type, data) { var intent, service, baseURL; return _regenerator2.default.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: if (!(!type && !data)) { _context.next = 2; break; } throw new Error('Cannot retrieve redirection, at least type or doc must be provided'); case 2: _context.next = 4; return create(cozy, 'REDIRECT', type, data); case 4: intent = _context.sent; service = (0, _helpers.pickService)(intent); if (service) { _context.next = 8; break; } throw new Error('Unable to find a service'); case 8: // Intents cannot be deleted now // await deleteIntent(cozy, intent) baseURL = removeQueryString(service.href); return _context.abrupt('return', data ? buildRedirectionURL(baseURL, data) : baseURL); case 10: case 'end': return _context.stop(); } } }, _callee, this); })); return function getRedirectionURL(_x3, _x4, _x5) { return _ref.apply(this, arguments); }; }(); var redirect = exports.redirect = function () { var _ref2 = _asyncToGenerator( /*#__PURE__*/_regenerator2.default.mark(function _callee2(cozy, type, doc, redirectFn) { var redirectionURL; return _regenerator2.default.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: if (window) { _context2.next = 2; break; } throw new Error('redirect() method can only be called in a browser'); case 2: _context2.next = 4; return getRedirectionURL(cozy, type, doc); case 4: redirectionURL = _context2.sent; if (!(redirectFn && typeof redirectFn === 'function')) { _context2.next = 7; break; } return _context2.abrupt('return', redirectFn(redirectionURL)); case 7: window.location.href = redirectionURL; case 8: case 'end': return _context2.stop(); } } }, _callee2, this); })); return function redirect(_x6, _x7, _x8, _x9) { return _ref2.apply(this, arguments); }; }(); exports.create = create; exports.createService = createService; var _fetch = __webpack_require__(0); var _helpers = __webpack_require__(5); var _client = __webpack_require__(18); var client = _interopRequireWildcard(_client); var _service = __webpack_require__(19); var service = _interopRequireWildcard(_service); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } function create(cozy, action, type) { var data = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; var permissions = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : []; if (!action) throw new Error('Misformed intent, "action" property must be provided'); if (!type) throw new Error('Misformed intent, "type" property must be provided'); var createPromise = (0, _fetch.cozyFetchJSON)(cozy, 'POST', '/intents', { data: { type: 'io.cozy.intents', attributes: { action: action, type: type, data: data, permissions: permissions } } }); createPromise.start = function (element, onReadyCallback) { var options = { filteredServices: data.filteredServices, onReadyCallback: onReadyCallback }; delete data.filteredServices; return createPromise.then(function (intent) { return client.start(cozy, intent, element, data, options); }); }; return createPromise; } // returns a service to communicate with intent client function createService(cozy, intentId, serviceWindow) { return service.start(cozy, intentId, serviceWindow); } function removeQueryString(url) { return url.replace(/\?[^/#]*/, ''); } function isSerializable(value) { return !['object', 'function'].includes(typeof value === 'undefined' ? 'undefined' : _typeof(value)); } function buildRedirectionURL(url, data) { var parameterStrings = Object.keys(data).filter(function (key) { return isSerializable(data[key]); }).map(function (key) { return key + '=' + data[key]; }); return parameterStrings.length ? url + '?' + parameterStrings.join('&') : url; } /***/ }), /* 10 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(fetch) { var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /* global fetch URL */ __webpack_require__(11); var _utils = __webpack_require__(1); var _auth_storage = __webpack_require__(12); var _auth_v = __webpack_require__(13); var _auth_v2 = __webpack_require__(3); var auth = _interopRequireWildcard(_auth_v2); var _data = __webpack_require__(15); var data = _interopRequireWildcard(_data); var _fetch2 = __webpack_require__(0); var cozyFetch = _interopRequireWildcard(_fetch2); var _mango = __webpack_require__(16); var mango = _interopRequireWildcard(_mango); var _files = __webpack_require__(17); var files = _interopRequireWildcard(_files); var _intents = __webpack_require__(9); var intents = _interopRequireWildcard(_intents); var _jobs = __webpack_require__(20); var jobs = _interopRequireWildcard(_jobs); var _offline = __webpack_require__(21); var offline = _interopRequireWildcard(_offline); var _settings = __webpack_require__(24); var settings = _interopRequireWildcard(_settings); var _relations = __webpack_require__(25); var relations = _interopRequireWildcard(_relations); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var AppTokenV3 = auth.AppToken, AccessTokenV3 = auth.AccessToken, ClientV3 = auth.Client; var AuthNone = 0; var AuthRunning = 1; var AuthError = 2; var AuthOK = 3; var defaultClientParams = { softwareID: 'github.com/cozy/cozy-client-js' }; var dataProto = { create: data.create, find: data.find, findMany: data.findMany, findAll: data.findAll, update: data.update, delete: data._delete, updateAttributes: data.updateAttributes, changesFeed: data.changesFeed, defineIndex: mango.defineIndex, query: mango.query, addReferencedFiles: relations.addReferencedFiles, removeReferencedFiles: relations.removeReferencedFiles, listReferencedFiles: relations.listReferencedFiles, fetchReferencedFiles: relations.fetchReferencedFiles, destroy: function destroy() { (0, _utils.warn)('destroy is deprecated, use cozy.data.delete instead.'); return data._delete.apply(data, arguments); } }; var authProto = { client: auth.client, registerClient: auth.registerClient, updateClient: auth.updateClient, unregisterClient: auth.unregisterClient, getClient: auth.getClient, getAuthCodeURL: auth.getAuthCodeURL, getAccessToken: auth.getAccessToken, refreshToken: auth.refreshToken }; var filesProto = { create: files.create, createDirectory: files.createDirectory, createDirectoryByPath: files.createDirectoryByPath, updateById: files.updateById, updateAttributesById: files.updateAttributesById, updateAttributesByPath: files.updateAttributesByPath, trashById: files.trashById, statById: files.statById, statByPath: files.statByPath, downloadById: files.downloadById, downloadByPath: files.downloadByPath, getDownloadLinkById: files.getDownloadLinkById, getDownloadLink: files.getDownloadLinkByPath, // DEPRECATED, should be removed very soon getDownloadLinkByPath: files.getDownloadLinkByPath, getArchiveLink: function getArchiveLink() { (0, _utils.warn)('getArchiveLink is deprecated, use cozy.files.getArchiveLinkByPaths instead.'); return files.getArchiveLinkByPaths.apply(files, arguments); }, getArchiveLinkByPaths: files.getArchiveLinkByPaths, getArchiveLinkByIds: files.getArchiveLinkByIds, getFilePath: files.getFilePath, getCollectionShareLink: files.getCollectionShareLink, query: mango.queryFiles, listTrash: files.listTrash, clearTrash: files.clearTrash, restoreById: files.restoreById, destroyById: files.destroyById }; var intentsProto = { create: intents.create, createService: intents.createService, getRedirectionURL: intents.getRedirectionURL, redirect: intents.redirect }; var jobsProto = { create: jobs.create, count: jobs.count, queued: jobs.queued }; var offlineProto = { init: offline.init, getDoctypes: offline.getDoctypes, // database hasDatabase: offline.hasDatabase, getDatabase: offline.getDatabase, createDatabase: offline.createDatabase, migrateDatabase: offline.migrateDatabase, destroyDatabase: offline.destroyDatabase, destroyAllDatabase: offline.destroyAllDatabase, // replication hasReplication: offline.hasReplication, replicateFromCozy: offline.replicateFromCozy, stopReplication: offline.stopReplication, stopAllReplication: offline.stopAllReplication, // repeated replication hasRepeatedReplication: offline.hasRepeatedReplication, startRepeatedReplication: offline.startRepeatedReplication, stopRepeatedReplication: offline.stopRepeatedReplication, stopAllRepeatedReplication: offline.stopAllRepeatedReplication }; var settingsProto = { diskUsage: settings.diskUsage, changePassphrase: settings.changePassphrase, getInstance: settings.getInstance, updateInstance: settings.updateInstance, getClients: settings.getClients, deleteClientById: settings.deleteClientById, updateLastSync: settings.updateLastSync }; var ensureHasReconnectParam = function ensureHasReconnectParam(_url) { var url = new URL(_url); if (url.searchParams && !url.searchParams.has('reconnect')) { url.searchParams.append('reconnect', 1); } else if (!url.search || url.search.indexOf('reconnect') === -1) { // Some old navigators do not have the searchParams API // and it is not polyfilled by babel-polyfill url.search = url.search + '&reconnect=1'; } return url.toString(); }; var Client = function () { function Client(options) { _classCallCheck(this, Client); this.data = {}; this.files = {}; this.intents = {}; this.jobs = {}; this.offline = {}; this.settings = {}; this.auth = { Client: ClientV3, AccessToken: AccessTokenV3, AppToken: AppTokenV3, AppTokenV2: _auth_v.AppToken, LocalStorage: _auth_storage.LocalStorage, MemoryStorage: _auth_storage.MemoryStorage }; this._inited = false; if (options) { this.init(options); } } _createClass(Client, [{ key: 'init', value: function init() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; this._inited = true; this._oauth = false; // is oauth activated or not this._token = null; // application token this._authstate = AuthNone; this._authcreds = null; this._storage = null; this._version = options.version || null; this._offline = null; var token = options.token; var oauth = options.oauth; if (token && oauth) { throw new Error('Cannot specify an application token with a oauth activated'); } if (token) { this._token = new AppTokenV3({ token: token }); } else if (oauth) { this._oauth = true; this._storage = oauth.storage; this._clientParams = Object.assign({}, defaultClientParams, oauth.clientParams); this._onRegistered = oauth.onRegistered || nopOnRegistered; } var url = options.cozyURL || ''; while (url[url.length - 1] === '/') { url = url.slice(0, -1); } this._url = url; this._invalidTokenErrorHandler = options.onInvalidTokenError !== undefined ? options.onInvalidTokenError : cozyFetch.handleInvalidTokenError; var disablePromises = !!options.disablePromises; addToProto(this, this.data, dataProto, disablePromises); addToProto(this, this.auth, authProto, disablePromises); addToProto(this, this.files, filesProto, disablePromises); addToProto(this, this.intents, intentsProto, disablePromises); addToProto(this, this.jobs, jobsProto, disablePromises); addToProto(this, this.offline, offlineProto, disablePromises); addToProto(this, this.settings, settingsProto, disablePromises); if (options.offline) { this.offline.init(options.offline); } this.fetch = function _fetch(method, url) { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; return cozyFetch.cozyFetch(this, url, _extends({}, options, { method: method })); }; this.fetchJSON = function _fetchJSON() { var args = [this].concat(Array.prototype.slice.call(arguments)); return cozyFetch.cozyFetchJSON.apply(this, args); }; } }, { key: 'authorize', value: function authorize() { var _this = this; var forceTokenRefresh = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; var state = this._authstate; if (state === AuthOK || state === AuthRunning) { return this._authcreds; } this._authstate = AuthRunning; this._authcreds = this.isV2().then(function (isV2) { if (isV2 && _this._oauth) { throw new Error('OAuth is not supported on the V2 stack'); } if (_this._oauth) { if (forceTokenRefresh && _this._clientParams.redirectURI) { _this._clientParams.redirectURI = ensureHasReconnectParam(_this._clientParams.redirectURI); } return auth.oauthFlow(_this, _this._storage, _this._clientParams, _this._onRegistered, forceTokenRefresh); } // we expect to be on a client side application running in a browser // with cookie-based authentication. if (isV2) { return (0, _auth_v.getAppToken)(); } else if (_this._token) { return Promise.resolve({ client: null, token: _this._token }); } else { throw new Error('Missing application token'); } }); this._authcreds.then(function () { _this._authstate = AuthOK; }, function () { _this._authstate = AuthError; }); return this._authcreds; } }, { key: 'saveCredentials', value: function saveCredentials(client, token) { var creds = { client: client, token: token }; if (!this._storage || this._authstate === AuthRunning) { return Promise.resolve(creds); } this._storage.save(auth.CredsKey, creds); this._authcreds = Promise.resolve(creds); return this._authcreds; } }, { key: 'fullpath', value: function fullpath(path) { var _this2 = this; return this.isV2().then(function (isV2) { var pathprefix = isV2 ? '/ds-api' : ''; return _this2._url + pathprefix + path; }); } }, { key: 'isV2', value: function isV2() { var _this3 = this; if (!this._version) { return (0, _utils.retry)(function () { return fetch(_this3._url + '/status/'); }, 3)().then(function (res) { if (!res.ok) { throw new Error('Could not fetch cozy status'); } else { return res.json(); } }).then(function (status) { _this3._version = status.datasystem !== undefined ? 2 : 3; return _this3.isV2(); }); } return Promise.resolve(this._version === 2); } }]); return Client; }(); function nopOnRegistered() { throw new Error('Missing onRegistered callback'); } function protoify(context, fn) { return function prototyped() { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return fn.apply(undefined, [context].concat(args)); }; } function addToProto(ctx, obj, proto, disablePromises) { for (var attr in proto) { var fn = protoify(ctx, proto[attr]); if (disablePromises) { fn = (0, _utils.unpromiser)(fn); } obj[attr] = fn; } } module.exports = new Client(); Object.assign(module.exports, { Client: Client, LocalStorage: _auth_storage.LocalStorage, MemoryStorage: _auth_storage.MemoryStorage }); /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) /***/ }), /* 11 */ /***/ (function(module, exports) { module.exports = __webpack_require__(655); /***/ }), /* 12 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var LocalStorage = exports.LocalStorage = function () { function LocalStorage(storage, prefix) { _classCallCheck(this, LocalStorage); if (!storage && typeof window !== 'undefined') { storage = window.localStorage; } this.storage = storage; this.prefix = prefix || 'cozy:oauth:'; } _createClass(LocalStorage, [{ key: 'save', value: function save(key, value) { var _this = this; return new Promise(function (resolve) { _this.storage.setItem(_this.prefix + key, JSON.stringify(value)); resolve(value); }); } }, { key: 'load', value: function load(key) { var _this2 = this; return new Promise(function (resolve) { var item = _this2.storage.getItem(_this2.prefix + key); if (!item) { resolve(); } else { resolve(JSON.parse(item)); } }); } }, { key: 'delete', value: function _delete(key) { var _this3 = this; return new Promise(function (resolve) { return resolve(_this3.storage.removeItem(_this3.prefix + key)); }); } }, { key: 'clear', value: function clear() { var _this4 = this; return new Promise(function (resolve) { var storage = _this4.storage; for (var i = 0; i < storage.length; i++) { var key = storage.key(i); if (key.indexOf(_this4.prefix) === 0) { storage.removeItem(key); } } resolve(); }); } }]); return LocalStorage; }(); var MemoryStorage = exports.MemoryStorage = function () { function MemoryStorage() { _classCallCheck(this, MemoryStorage); this.hash = Object.create(null); } _createClass(MemoryStorage, [{ key: 'save', value: function save(key, value) { this.hash[key] = value; return Promise.resolve(value); } }, { key: 'load', value: function load(key) { return Promise.resolve(this.hash[key]); } }, { key: 'delete', value: function _delete(key) { var deleted = delete this.hash[key]; return Promise.resolve(deleted); } }, { key: 'clear', value: function clear() { this.hash = Object.create(null); return Promise.resolve(); } }]); return MemoryStorage; }(); /***/ }), /* 13 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(btoa) { Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); exports.getAppToken = getAppToken; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /* global btoa */ var V2TOKEN_ABORT_TIMEOUT = 3000; function getAppToken() { return new Promise(function (resolve, reject) { if (typeof window === 'undefined') { return reject(new Error('getV2Token should be used in browser')); } else if (!window.parent) { return reject(new Error('getV2Token should be used in iframe')); } else if (!window.parent.postMessage) { return reject(new Error('getV2Token should be used in modern browser')); } var origin = window.location.origin; var intent = { action: 'getToken' }; var timeout = null; var receiver = function receiver(event) { var token = void 0; try { token = new AppToken({ appName: event.data.appName, token: event.data.token }); } catch (e) { reject(e); return; } window.removeEventListener('message', receiver); clearTimeout(timeout); resolve({ client: null, token: token }); }; window.addEventListener('message', receiver, false); window.parent.postMessage(intent, origin); timeout = setTimeout(function () { reject(new Error('No response from parent iframe after 3s')); }, V2TOKEN_ABORT_TIMEOUT); }); } var AppToken = exports.AppToken = function () { function AppToken(opts) { _classCallCheck(this, AppToken); this.appName = opts.appName || ''; this.token = opts.token || ''; } _createClass(AppToken, [{ key: 'toAuthHeader', value: function toAuthHeader() { return 'Basic ' + btoa(this.appName + ':' + this.token); } }]); return AppToken; }(); /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7))) /***/ }), /* 14 */ /***/ (function(module, exports) { module.exports = __webpack_require__(94); /***/ }), /* 15 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.create = create; exports.find = find; exports.findMany = findMany; exports.findAll = findAll; exports.changesFeed = changesFeed; exports.update = update; exports.updateAttributes = updateAttributes; exports._delete = _delete; var _utils = __webpack_require__(1); var _doctypes = __webpack_require__(2); var _fetch = __webpack_require__(0); var NOREV = 'stack-v2-no-rev'; function create(cozy, doctype, attributes) { return cozy.isV2().then(function (isV2) { doctype = (0, _doctypes.normalizeDoctype)(cozy, isV2, doctype); if (isV2) { attributes.docType = doctype; } var path = (0, _utils.createPath)(cozy, isV2, doctype, attributes._id); var httpVerb = attributes._id ? 'PUT' : 'POST'; delete attributes._id; return (0, _fetch.cozyFetchJSON)(cozy, httpVerb, path, attributes).then(function (resp) { if (isV2) { return find(cozy, doctype, resp._id); } else { return resp.data; } }); }); } function find(cozy, doctype, id) { return cozy.isV2().then(function (isV2) { doctype = (0, _doctypes.normalizeDoctype)(cozy, isV2, doctype); if (!id) { return Promise.reject(new Error('Missing id parameter')); } var path = (0, _utils.createPath)(cozy, isV2, doctype, id); return (0, _fetch.cozyFetchJSON)(cozy, 'GET', path).then(function (resp) { if (isV2) { return Object.assign(resp, { _rev: NOREV }); } else { return resp; } }); }); } function findMany(cozy, doctype, ids) { if (!(ids instanceof Array)) { return Promise.reject(new Error('Parameter ids must be a non-empty array')); } if (ids.length === 0) { // So users don't need to be defensive regarding the array content. // This should not hide issues in user code since the result will be an // empty object anyway. return Promise.resolve({}); } return cozy.isV2().then(function (isV2) { if (isV2) { return Promise.reject(new Error('findMany is not available on v2')); } var path = (0, _utils.createPath)(cozy, isV2, doctype, '_all_docs', { include_docs: true }); return (0, _fetch.cozyFetchJSON)(cozy, 'POST', path, { keys: ids }).then(function (resp) { var docs = {}; var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = resp.rows[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var row = _step.value; var key = row.key, doc = row.doc, error = row.error; docs[key] = error ? { error: error } : { doc: doc }; } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } return docs; }).catch(function (error) { if (error.status !== 404) return Promise.reject(error); // When no doc was ever created and the database does not exist yet, // the response will be a 404 error. var docs = {}; var _iteratorNormalCompletion2 = true; var _didIteratorError2 = false; var _iteratorError2 = undefined; try { for (var _iterator2 = ids[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { var id = _step2.value; docs[id] = { error: error }; } } catch (err) { _didIteratorError2 = true; _iteratorError2 = err; } finally { try { if (!_iteratorNormalCompletion2 && _iterator2.return) { _iterator2.return(); } } finally { if (_didIteratorError2) { throw _iteratorError2; } } } return docs; }); }); } function findAll(cozy, doctype) { return cozy.isV2().then(function (isV2) { if (isV2) { return Promise.reject(new Error('findAll is not available on v2')); } var path = (0, _utils.createPath)(cozy, isV2, doctype, '_all_docs', { include_docs: true }); return (0, _fetch.cozyFetchJSON)(cozy, 'POST', path, {}).then(function (resp) { var docs = []; var _iteratorNormalCompletion3 = true; var _didIteratorError3 = false; var _iteratorError3 = undefined; try { for (var _iterator3 = resp.rows[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { var row = _step3.value; var doc = row.doc; // if not couchDB indexes if (!doc._id.match(/_design\//)) docs.push(doc); } } catch (err) { _didIteratorError3 = true; _iteratorError3 = err; } finally { try { if (!_iteratorNormalCompletion3 && _iterator3.return) { _iterator3.return(); } } finally { if (_didIteratorError3) { throw _iteratorError3; } } } return docs; }).catch(function (error) { // the _all_docs endpoint returns a 404 error if no document with the given // doctype exists. if (error.status === 404) return []; throw error; }); }); } function changesFeed(cozy, doctype, options) { return cozy.isV2().then(function (isV2) { doctype = (0, _doctypes.normalizeDoctype)(cozy, isV2, doctype); var path = (0, _utils.createPath)(cozy, isV2, doctype, '_changes', options); return (0, _fetch.cozyFetchJSON)(cozy, 'GET', path); }); } function update(cozy, doctype, doc, changes) { return cozy.isV2().then(function (isV2) { doctype = (0, _doctypes.normalizeDoctype)(cozy, isV2, doctype); var _id = doc._id, _rev = doc._rev; if (!_id) { return Promise.reject(new Error('Missing _id field in passed document')); } if (!isV2 && !_rev) { return Promise.reject(new Error('Missing _rev field in passed document')); } if (isV2) { changes = Object.assign({ _id: _id }, changes); } else { changes = Object.assign({ _id: _id, _rev: _rev }, changes); } var path = (0, _utils.createPath)(cozy, isV2, doctype, _id); return (0, _fetch.cozyFetchJSON)(cozy, 'PUT', path, changes).then(function (resp) { if (isV2) { return find(cozy, doctype, _id); } else { return resp.data; } }); }); } function updateAttributes(cozy, doctype, _id, changes) { var tries = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 3; return cozy.isV2().then(function (isV2) { doctype = (0, _doctypes.normalizeDoctype)(cozy, isV2, doctype); return find(cozy, doctype, _id).then(function (doc) { return update(cozy, doctype, doc, Object.assign({ _id: _id }, doc, changes)); }).catch(function (err) { if (tries > 0) { return updateAttributes(cozy, doctype, _id, changes, tries - 1); } else { throw err; } }); }); } function _delete(cozy, doctype, doc) { return cozy.isV2().then(function (isV2) { doctype = (0, _doctypes.normalizeDoctype)(cozy, isV2, doctype); var _id = doc._id, _rev = doc._rev; if (!_id) { return Promise.reject(new Error('Missing _id field in passed document')); } if (!isV2 && !_rev) { return Promise.reject(new Error('Missing _rev field in passed document')); } var query = isV2 ? null : { rev: _rev }; var path = (0, _utils.createPath)(cozy, isV2, doctype, _id, query); return (0, _fetch.cozyFetchJSON)(cozy, 'DELETE', path).then(function (resp) { if (isV2) { return { id: _id, rev: NOREV }; } else { return resp; } }); }); } /***/ }), /* 16 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; exports.defineIndex = defineIndex; exports.query = query; exports.queryFiles = queryFiles; exports.parseSelector = parseSelector; exports.normalizeSelector = normalizeSelector; exports.makeMapReduceQuery = makeMapReduceQuery; var _utils = __webpack_require__(1); var _doctypes = __webpack_require__(2); var _fetch = __webpack_require__(0); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function defineIndex(cozy, doctype, fields) { return cozy.isV2().then(function (isV2) { doctype = (0, _doctypes.normalizeDoctype)(cozy, isV2, doctype); if (!Array.isArray(fields) || fields.length === 0) { throw new Error('defineIndex fields should be a non-empty array'); } if (isV2) { return defineIndexV2(cozy, doctype, fields); } else { return defineIndexV3(cozy, doctype, fields); } }); } function query(cozy, indexRef, options) { return cozy.isV2().then(function (isV2) { if (!indexRef) { throw new Error('query should be passed the indexRef'); } if (isV2) { return queryV2(cozy, indexRef, options); } else { return queryV3(cozy, indexRef, options); } }); } function queryFiles(cozy, indexRef, options) { var opts = getV3Options(indexRef, options); return (0, _fetch.cozyFetchRawJSON)(cozy, 'POST', '/files/_find', opts).then(function (response) { return options.wholeResponse ? response : response.docs; }); } // Internals var VALUEOPERATORS = ['$eq', '$gt', '$gte', '$lt', '$lte']; var LOGICOPERATORS = ['$or', '$and', '$not']; /* eslint-disable */ var MAP_TEMPLATE = function (doc) { if (doc.docType.toLowerCase() === 'DOCTYPEPLACEHOLDER') { emit(FIELDSPLACEHOLDER, doc); } }.toString().replace(/ /g, '').replace(/\n/g, ''); var COUCHDB_INFINITY = { '\uFFFF': '\uFFFF' }; var COUCHDB_LOWEST = null; /* eslint-enable */ // defineIndexV2 is equivalent to defineIndex but only works for V2. // It transforms the index fields into a map reduce view. function defineIndexV2(cozy, doctype, fields) { var indexName = 'by' + fields.map(capitalize).join(''); var indexDefinition = { map: makeMapFunction(doctype, fields), reduce: '_count' }; var path = '/request/' + doctype + '/' + indexName + '/'; return (0, _fetch.cozyFetchJSON)(cozy, 'PUT', path, indexDefinition).then(function () { return { doctype: doctype, type: 'mapreduce', name: indexName, fields: fields }; }); } function defineIndexV3(cozy, doctype, fields) { var path = (0, _utils.createPath)(cozy, false, doctype, '_index'); var indexDefinition = { index: { fields: fields } }; return (0, _fetch.cozyFetchJSON)(cozy, 'POST', path, indexDefinition).then(function (response) { var indexResult = { doctype: doctype, type: 'mango', name: response.id, fields: fields }; if (response.result === 'exists') return indexResult; // indexes might not be usable right after being created; so we delay the resolving until they are var selector = {}; selector[fields[0]] = { $gt: null }; var opts = getV3Options(indexResult, { selector: selector }); var path = (0, _utils.createPath)(cozy, false, indexResult.doctype, '_find'); return (0, _fetch.cozyFetchJSON)(cozy, 'POST', path, opts).then(function () { return indexResult; }).catch(function () { // one retry return (0, _utils.sleep)(1000).then(function () { return (0, _fetch.cozyFetchJSON)(cozy, 'POST', path, opts); }).then(function () { return indexResult; }).catch(function () { return (0, _utils.sleep)(500).then(function () { return indexResult; }); }); }); }); } // queryV2 is equivalent to query but only works for V2. // It transforms the query into a _views call using makeMapReduceQuery function queryV2(cozy, indexRef, options) { if (indexRef.type !== 'mapreduce') { throw new Error('query indexRef should be the return value of defineIndexV2'); } if (options.fields) { (0, _utils.warn)('query fields will be ignored on v2'); } var path = '/request/' + indexRef.doctype + '/' + indexRef.name + '/'; var opts = makeMapReduceQuery(indexRef, options); return (0, _fetch.cozyFetchJSON)(cozy, 'POST', path, opts).then(function (response) { return response.map(function (r) { return r.value; }); }); } // queryV3 is equivalent to query but only works for V3 function queryV3(cozy, indexRef, options) { var opts = getV3Options(indexRef, options); var path = (0, _utils.createPath)(cozy, false, indexRef.doctype, '_find'); return (0, _fetch.cozyFetchJSON)(cozy, 'POST', path, opts).then(function (response) { return options.wholeResponse ? response : response.docs; }); } function getV3Options(indexRef, options) { if (indexRef.type !== 'mango') { throw new Error('indexRef should be the return value of defineIndexV3'); } var opts = { use_index: indexRef.name, fields: options.fields, selector: options.selector, limit: options.limit, skip: options.skip, since: options.since, sort: options.sort }; if (options.descending) { opts.sort = indexRef.fields.map(function (f) { return _defineProperty({}, f, 'desc'); }); } return opts; } // misc function capitalize(name) { return name.charAt(0).toUpperCase() + name.slice(1); } function makeMapFunction(doctype, fields) { fields = '[' + fields.map(function (name) { return 'doc.' + name; }).join(',') + ']'; return MAP_TEMPLATE.replace('DOCTYPEPLACEHOLDER', doctype.toLowerCase()).replace('FIELDSPLACEHOLDER', fields); } // parseSelector takes a mango selector and returns it as an array of filter // a filter is [path, operator, value] array // a path is an array of field names // This function is only exported so it can be unit tested. // Example : // parseSelector({"test":{"deep": {"$gt": 3}}}) // [[['test', 'deep'], '$gt', 3 ]] function parseSelector(selector) { var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; var operator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '$eq'; if ((typeof selector === 'undefined' ? 'undefined' : _typeof(selector)) !== 'object') { return [[path, operator, selector]]; } var keys = Object.keys(selector); if (keys.length === 0) { throw new Error('empty selector'); } else { return keys.reduce(function (acc, k) { if (LOGICOPERATORS.indexOf(k) !== -1) { throw new Error('cozy-client-js does not support mango logic ops'); } else if (VALUEOPERATORS.indexOf(k) !== -1) { return acc.concat(parseSelector(selector[k], path, k)); } else { return acc.concat(parseSelector(selector[k], path.concat(k), '$eq')); } }, []); } } // normalizeSelector takes a mango selector and returns it as an object // normalized. // This function is only exported so it can be unit tested. // Example : // parseSelector({"test":{"deep": {"$gt": 3}}}) // {"test.deep": {"$gt": 3}} function normalizeSelector(selector) { var filters = parseSelector(selector); return filters.reduce(function (acc, filter) { var _filter = _slicedToArray(filter, 3), path = _filter[0], op = _filter[1], value = _filter[2]; var field = path.join('.'); acc[field] = acc[field] || {}; acc[field][op] = value; return acc; }, {}); } // applySelector takes the normalized selector for the current field // and append the proper values to opts.startkey, opts.endkey function applySelector(selector, opts) { var value = selector['$eq']; var lower = COUCHDB_LOWEST; var upper = COUCHDB_INFINITY; var inclusiveEnd = void 0; if (value) { opts.startkey.push(value); opts.endkey.push(value); return false; } value = selector['$gt']; if (value) { throw new Error('operator $gt (strict greater than) not supported'); } value = selector['$gte']; if (value) { lower = value; } value = selector['$lte']; if (value) { upper = value; inclusiveEnd = true; } value = selector['$lt']; if (value) { upper = value; inclusiveEnd = false; } opts.startkey.push(lower); opts.endkey.push(upper); if (inclusiveEnd !== undefined) opts.inclusive_end = inclusiveEnd; return true; } // makeMapReduceQuery takes a mango query and generate _views call parameters // to obtain same results depending on fields in the passed indexRef. function makeMapReduceQuery(indexRef, query) { var mrquery = { startkey: [], endkey: [], reduce: false }; var firstFreeValueField = null; var normalizedSelector = normalizeSelector(query.selector); indexRef.fields.forEach(function (field) { var selector = normalizedSelector[field]; if (selector && firstFreeValueField != null) { throw new Error('Selector on field ' + field + ', but not on ' + firstFreeValueField + ' which is higher in index fields.'); } else if (selector) { selector.used = true; var isFreeValue = applySelector(selector, mrquery); if (isFreeValue) firstFreeValueField = field; } else if (firstFreeValueField == null) { firstFreeValueField = field; mrquery.endkey.push(COUCHDB_INFINITY); } }); Object.keys(normalizedSelector).forEach(function (field) { if (!normalizedSelector[field].used) { throw new Error('Cant apply selector on ' + field + ', it is not in index'); } }); if (query.descending) { mrquery = { descending: true, reduce: false, startkey: mrquery.endkey, endkey: mrquery.startkey, inclusive_end: mrquery.inclusive_end }; } return mrquery; } /***/ }), /* 17 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TRASH_DIR_ID = exports.ROOT_DIR_ID = undefined; var _regenerator = __webpack_require__(4); var _regenerator2 = _interopRequireDefault(_regenerator); var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var doUpload = function () { var _ref = _asyncToGenerator( /*#__PURE__*/_regenerator2.default.mark(function _callee(cozy, data, method, path, options) { var isBuffer, isFile, isBlob, isStream, isString, _ref2, contentType, contentLength, checksum, lastModifiedDate, ifMatch, metadata, sourceAccount, sourceAccountIdentifier, headers, finalpath, metadataId; return _regenerator2.default.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: if (data) { _context.next = 2; break; } throw new Error('missing data argument'); case 2: // transform any ArrayBufferView to ArrayBuffer if (data.buffer && data.buffer instanceof ArrayBuffer) { data = data.buffer; } isBuffer = typeof ArrayBuffer !== 'undefined' && data instanceof ArrayBuffer; isFile = typeof File !== 'undefined' && data instanceof File; isBlob = typeof Blob !== 'undefined' && data instanceof Blob; isStream = data.readable === true && typeof data.pipe === 'function'; isString = typeof data === 'string'; if (!(!isBuffer && !isFile && !isBlob && !isStream && !isString)) { _context.next = 10; break; } throw new Error('invalid data type'); case 10: _ref2 = options || {}, contentType = _ref2.contentType, contentLength = _ref2.contentLength, checksum = _ref2.checksum, lastModifiedDate = _ref2.lastModifiedDate, ifMatch = _ref2.ifMatch, metadata = _ref2.metadata, sourceAccount = _ref2.sourceAccount, sourceAccountIdentifier = _ref2.sourceAccountIdentifier; if (!contentType) { if (isBuffer) { contentType = contentTypeOctetStream; } else if (isFile) { contentType = data.type || getFileTypeFromName(data.name.toLowerCase()) || contentTypeOctetStream; if (!lastModifiedDate) { lastModifiedDate = data.lastModifiedDate; } } else if (isBlob) { contentType = data.type || contentTypeOctetStream; } else if (isStream) { contentType = contentTypeOctetStream; } else if (typeof data === 'string') { contentType = 'text/plain'; } } if (lastModifiedDate && typeof lastModifiedDate === 'string') { lastModifiedDate = new Date(lastModifiedDate); } headers = { 'Content-Type': contentType }; if (contentLength) headers['Content-Length'] = String(contentLength); if (checksum) headers['Content-MD5'] = checksum; if (lastModifiedDate) headers['Date'] = lastModifiedDate.toGMTString(); if (ifMatch) headers['If-Match'] = ifMatch; finalpath = path; if (!metadata) { _context.next = 24; break; } _context.next = 22; return sendMetadata(cozy, metadata); case 22: metadataId = _context.sent; if (metadataId) { finalpath = addQuerystringParam(finalpath, 'MetadataID', metadataId); } case 24: if (sourceAccount) { finalpath = addQuerystringParam(finalpath, 'SourceAccount', sourceAccount); } if (sourceAccountIdentifier) { finalpath = addQuerystringParam(finalpath, 'SourceAccountIdentifier', sourceAccountIdentifier); } return _context.abrupt('return', (0, _fetch.cozyFetch)(cozy, finalpath, { method: method, headers: headers, body: data }).then(function (res) { var json = res.json(); if (!res.ok) { return json.then(function (err) { throw err; }); } else { return json.then(_jsonapi2.default); } })); case 27: case 'end': return _context.stop(); } } }, _callee, this); })); return function doUpload(_x, _x2, _x3, _x4, _x5) { return _ref.apply(this, arguments); }; }(); var sendMetadata = function () { var _ref3 = _asyncToGenerator( /*#__PURE__*/_regenerator2.default.mark(function _callee2(cozy, metadata) { var result; return _regenerator2.default.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: _context2.next = 2; return (0, _fetch.cozyFetchJSON)(cozy, 'POST', '/files/upload/metadata', { data: { type: 'io.cozy.files.metadata', attributes: metadata } }); case 2: result = _context2.sent; return _context2.abrupt('return', result && result._id ? result._id : false); case 4: case 'end': return _context2.stop(); } } }, _callee2, this); })); return function sendMetadata(_x6, _x7) { return _ref3.apply(this, arguments); }; }(); exports.create = create; exports.createDirectory = createDirectory; exports.createDirectoryByPath = createDirectoryByPath; exports.updateById = updateById; exports.updateAttributesById = updateAttributesById; exports.updateAttributesByPath = updateAttributesByPath; exports.trashById = trashById; exports.statById = statById; exports.statByPath = statByPath; exports.downloadById = downloadById; exports.downloadByPath = downloadByPath; exports.getDownloadLinkByPath = getDownloadLinkByPath; exports.getDownloadLinkById = getDownloadLinkById; exports.getFilePath = getFilePath; exports.getCollectionShareLink = getCollectionShareLink; exports.getArchiveLinkByPaths = getArchiveLinkByPaths; exports.getArchiveLinkByIds = getArchiveLinkByIds; exports.listTrash = listTrash; exports.clearTrash = clearTrash; exports.restoreById = restoreById; exports.destroyById = destroyById; var _fetch = __webpack_require__(0); var _jsonapi = __webpack_require__(8); var _jsonapi2 = _interopRequireDefault(_jsonapi); var _doctypes = __webpack_require__(2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* global Blob, File */ // global variables var ROOT_DIR_ID = exports.ROOT_DIR_ID = 'io.cozy.files.root-dir'; var TRASH_DIR_ID = exports.TRASH_DIR_ID = 'io.cozy.files.trash-dir'; var contentTypeOctetStream = 'application/octet-stream'; function sanitizeFileName(name) { return name && name.trim(); } function getFileTypeFromName(name) { if (/\.heic$/i.test(name)) return 'image/heic';else if (/\.heif$/i.test(name)) return 'image/heif';else return null; } function create(cozy, data, options) { var _ref4 = options || {}, name = _ref4.name, dirID = _ref4.dirID, executable = _ref4.executable, noSanitize = _ref4.noSanitize; // handle case where data is a file and contains the name if (!name && typeof data.name === 'string') { name = data.name; } if (!noSanitize) { name = sanitizeFileName(name); } if (typeof name !== 'string' || name === '') { throw new Error('missing name argument'); } if (executable === undefined) { executable = false; } var path = '/files/' + encodeURIComponent(dirID || ''); var query = '?Name=' + encodeURIComponent(name) + '&Type=file&Executable=' + executable; return doUpload(cozy, data, 'POST', '' + path + query, options); } function createDirectory(cozy, options) { var _ref5 = options || {}, name = _ref5.name, dirID = _ref5.dirID, lastModifiedDate = _ref5.lastModifiedDate; name = sanitizeFileName(name); if (typeof name !== 'string' || name === '') { throw new Error('missing name argument'); } if (lastModifiedDate && typeof lastModifiedDate === 'string') { lastModifiedDate = new Date(lastModifiedDate); } var path = '/files/' + encodeURIComponent(dirID || ''); var query = '?Name=' + encodeURIComponent(name) + '&Type=directory'; return (0, _fetch.cozyFetchJSON)(cozy, 'POST', '' + path + query, undefined, { headers: { Date: lastModifiedDate ? lastModifiedDate.toGMTString() : '' } }); } function getDirectoryOrCreate(cozy, name, parentDirectory) { if (parentDirectory && !parentDirectory.attributes) throw new Error('Malformed parent directory'); name = sanitizeFileName(name); var path = (parentDirectory._id === ROOT_DIR_ID ? '' : parentDirectory.attributes.path) + '/' + name; return cozy.files.statByPath(path || '/').catch(function (error) { var parsedError = JSON.parse(error.message); var errors = parsedError.errors; if (errors && errors.length && errors[0].status === '404') { return cozy.files.createDirectory({ name: name, dirID: parentDirectory && parentDirectory._id }); } throw errors; }); } function createDirectoryByPath(cozy, path, offline) { var parts = path.split('/').filter(function (part) { return part !== ''; }); var rootDirectoryPromise = cozy.files.statById(ROOT_DIR_ID, offline); return parts.length ? parts.reduce(function (parentDirectoryPromise, part) { return parentDirectoryPromise.then(function (parentDirectory) { return getDirectoryOrCreate(cozy, part, parentDirectory); }); }, rootDirectoryPromise) : rootDirectoryPromise; } function updateById(cozy, id, data, options) { return doUpload(cozy, data, 'PUT', '/files/' + encodeURIComponent(id), options); } function doUpdateAttributes(cozy, attrs, path, options) { if (!attrs || (typeof attrs === 'undefined' ? 'undefined' : _typeof(attrs)) !== 'object') { throw new Error('missing attrs argument'); } var _ref6 = options || {}, ifMatch = _ref6.ifMatch; var body = { data: { attributes: Object.assign({}, attrs, { name: sanitizeFileName(attrs.name) }) } }; return (0, _fetch.cozyFetchJSON)(cozy, 'PATCH', path, body, { headers: { 'If-Match': ifMatch || '' } }); } function updateAttributesById(cozy, id, attrs, options) { return doUpdateAttributes(cozy, attrs, '/files/' + encodeURIComponent(id), options); } function updateAttributesByPath(cozy, path, attrs, options) { return doUpdateAttributes(cozy, attrs, '/files/metadata?Path=' + encodeURIComponent(path), options); } function trashById(cozy, id, options) { if (typeof id !== 'string' || id === '') { throw new Error('missing id argument'); } var _ref7 = options || {}, ifMatch = _ref7.ifMatch; return (0, _fetch.cozyFetchJSON)(cozy, 'DELETE', '/files/' + encodeURIComponent(id), undefined, { headers: { 'If-Match': ifMatch || '' } }); } function statById(cozy, id) { var offline = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; if (offline && cozy.offline.hasDatabase(_doctypes.DOCTYPE_FILES)) { var db = cozy.offline.getDatabase(_doctypes.DOCTYPE_FILES); return Promise.all([db.get(id), db.find(Object.assign({ selector: { dir_id: id } }, options))]).then(function (_ref8) { var _ref9 = _slicedToArray(_ref8, 2), doc = _ref9[0], children = _ref9[1]; if (id === ROOT_DIR_ID) { children.docs = children.docs.filter(function (doc) { return doc._id !== TRASH_DIR_ID; }); } children = sortFiles(children.docs.map(function (doc) { return addIsDir(toJsonApi(cozy, doc)); })); return addIsDir(toJsonApi(cozy, doc, children)); }); } var query = Object.keys(options).length === 0 ? '' : '?' + encodePageOptions(options); return (0, _fetch.cozyFetchJSON)(cozy, 'GET', '/files/' + encodeURIComponent(id) + query).then(addIsDir); } function statByPath(cozy, path) { return (0, _fetch.cozyFetchJSON)(cozy, 'GET', '/files/metadata?Path=' + encodeURIComponent(path)).then(addIsDir); } function downloadById(cozy, id) { return (0, _fetch.cozyFetch)(cozy, '/files/download/' + encodeURIComponent(id)); } function downloadByPath(cozy, path) { return (0, _fetch.cozyFetch)(cozy, '/files/download?Path=' + encodeURIComponent(path)); } function extractResponseLinkRelated(res) { var href = res.links && res.links.related; if (!href) throw new Error('No related link in server response'); return href; } function getDownloadLinkByPath(cozy, path) { return (0, _fetch.cozyFetchJSON)(cozy, 'POST', '/files/downloads?Path=' + encodeURIComponent(path)).then(extractResponseLinkRelated); } function getDownloadLinkById(cozy, id) { return (0, _fetch.cozyFetchJSON)(cozy, 'POST', '/files/downloads?Id=' + encodeURIComponent(id)).then(extractResponseLinkRelated); } function getFilePath(cozy) { var file = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var folder = arguments[2]; if (!folder || !folder.attributes) { throw Error('Folder should be valid with an attributes.path property'); } var folderPath = folder.attributes.path.endsWith('/') ? folder.attributes.path : folder.attributes.path + '/'; return '' + folderPath + file.name; } function getCollectionShareLink(cozy, id, collectionType) { if (!id) { return Promise.reject(Error('An id should be provided to create a share link')); } return (0, _fetch.cozyFetchJSON)(cozy, 'POST', '/permissions?codes=email', { data: { type: 'io.cozy.permissions', attributes: { permissions: { files: { type: 'io.cozy.files', verbs: ['GET'], values: [id], selector: 'referenced_by' }, collection: { type: collectionType, verbs: ['GET'], values: [id] } } } } }).then(function (data) { return { sharecode: 'sharecode=' + data.attributes.codes.email, id: 'id=' + id }; }); } function getArchiveLinkByPaths(cozy, paths) { var name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'files'; var archive = { type: 'io.cozy.archives', attributes: { name: name, files: paths } }; return (0, _fetch.cozyFetchJSON)(cozy, 'POST', '/files/archive', { data: archive }).then(extractResponseLinkRelated); } function getArchiveLinkByIds(cozy, ids) { var name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'files'; var archive = { type: 'io.cozy.archives', attributes: { name: name, ids: ids } }; return (0, _fetch.cozyFetchJSON)(cozy, 'POST', '/files/archive', { data: archive }).then(extractResponseLinkRelated); } function listTrash(cozy) { return (0, _fetch.cozyFetchJSON)(cozy, 'GET', '/files/trash'); } function clearTrash(cozy) { return (0, _fetch.cozyFetchJSON)(cozy, 'DELETE', '/files/trash'); } function restoreById(cozy, id) { return (0, _fetch.cozyFetchJSON)(cozy, 'POST', '/files/trash/' + encodeURIComponent(id)); } function destroyById(cozy, id, options) { var _ref10 = options || {}, ifMatch = _ref10.ifMatch; return (0, _fetch.cozyFetchJSON)(cozy, 'DELETE', '/files/trash/' + encodeURIComponent(id), undefined, { headers: { 'If-Match': ifMatch || '' } }); } function addIsDir(obj) { obj.isDir = obj.attributes.type === 'directory'; return obj; } function encodePageOptions(options) { var opts = []; for (var name in options) { opts.push('page[' + encodeURIComponent(name) + ']=' + encodeURIComponent(options[name])); } return opts.join('&'); } function toJsonApi(cozy, doc) { var contents = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; var clone = JSON.parse(JSON.stringify(doc)); delete clone._id; delete clone._rev; return { _id: doc._id, _rev: doc._rev, _type: _doctypes.DOCTYPE_FILES, attributes: clone, relationships: { contents: { data: contents, meta: { count: contents.length } } }, relations: function relations(name) { if (name === 'contents') { return contents; } } }; } function sortFiles(allFiles) { var folders = allFiles.filter(function (f) { return f.attributes.type === 'directory'; }); var files = allFiles.filter(function (f) { return f.attributes.type !== 'directory'; }); var sort = function sort(files) { return files.sort(function (a, b) { return a.attributes.name.localeCompare(b.attributes.name); }); }; return sort(folders).concat(sort(files)); } function addQuerystringParam(path, key, value) { return '' + path + (path.includes('?') ? '&' : '?') + key + '=' + value; } /***/ }), /* 18 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _regenerator = __webpack_require__(4); var _regenerator2 = _interopRequireDefault(_regenerator); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; exports.start = start; var _helpers = __webpack_require__(5); var _ = __webpack_require__(9); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } var intentClass = 'coz-intent'; function hideIntentIframe(iframe) { iframe.style.display = 'none'; } function showIntentFrame(iframe) { iframe.style.display = 'block'; } function buildIntentIframe(intent, element, url) { var document = element.ownerDocument; if (!document) return Promise.reject(new Error('Cannot retrieve document object from given element')); var iframe = document.createElement('iframe'); // TODO: implement 'title' attribute iframe.setAttribute('id', 'intent-' + intent._id); iframe.setAttribute('src', url); iframe.classList.add(intentClass); return iframe; } function injectIntentIframe(intent, element, url, options) { var onReadyCallback = options.onReadyCallback; var iframe = buildIntentIframe(intent, element, url, options.onReadyCallback); // if callback provided for when iframe is loaded if (typeof onReadyCallback === 'function') iframe.onload = onReadyCallback; element.appendChild(iframe); iframe.focus(); return iframe; } // inject iframe for service in given element function connectIntentIframe(cozy, iframe, element, intent, data) { var _this = this; var compose = function () { var _ref = _asyncToGenerator( /*#__PURE__*/_regenerator2.default.mark(function _callee(cozy, action, doctype, data) { var intent, doc; return _regenerator2.default.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _context.next = 2; return (0, _.create)(cozy, action, doctype, data); case 2: intent = _context.sent; hideIntentIframe(iframe); _context.next = 6; return start(cozy, intent, element, _extends({}, data, { exposeIntentFrameRemoval: false })); case 6: doc = _context.sent; showIntentFrame(iframe); return _context.abrupt('return', doc); case 9: case 'end': return _context.stop(); } } }, _callee, this); })); return function compose(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); }; }(); var document = element.ownerDocument; if (!document) return Promise.reject(new Error('Cannot retrieve document object from given element')); var window = document.defaultView; if (!window) return Promise.reject(new Error('Cannot retrieve window object from document')); // Keeps only http://domain:port/ var serviceOrigin = iframe.src.split('/', 3).join('/'); return new Promise(function (resolve, reject) { var handshaken = false; var messageHandler = function () { var _ref2 = _asyncToGenerator( /*#__PURE__*/_regenerator2.default.mark(function _callee2(event) { var eventType, _event$data, action, doctype, _data, doc, removeIntentFrame; return _regenerator2.default.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: if (!(event.origin !== serviceOrigin)) { _context2.next = 2; break; } return _context2.abrupt('return'); case 2: eventType = event.data.type; if (!(eventType === 'load')) { _context2.next = 6; break; } // Safari 9.1 (At least) send a MessageEvent when the iframe loads, // making the handshake fails. console.warn && console.warn('Cozy Client ignored MessageEvent having data.type `load`.'); return _context2.abrupt('return'); case 6: if (!(eventType === 'intent-' + intent._id + ':ready')) { _context2.next = 9; break; } handshaken = true; return _context2.abrupt('return', event.source.postMessage(data, event.origin)); case 9: if (!(handshaken && eventType === 'intent-' + intent._id + ':resize')) { _context2.next = 13; break; } ;['width', 'height', 'maxWidth', 'maxHeight'].forEach(function (prop) { if (event.data.transition) element.style.transition = event.data.transition; if (event.data.dimensions[prop]) element.style[prop] = event.data.dimensions[prop] + 'px'; }); return _context2.abrupt('return', true); case 13: if (!(handshaken && eventType === 'intent-' + intent._id + ':compose')) { _context2.next = 19; break; } // Let start to name `type` as `doctype`, as `event.data` already have a `type` attribute. _event$data = event.data, action = _event$data.action, doctype = _event$data.doctype, _data = _event$data.data; _context2.next = 17; return compose(cozy, action, doctype, _data); case 17: doc = _context2.sent; return _context2.abrupt('return', event.source.postMessage(doc, event.origin)); case 19: window.removeEventListener('message', messageHandler); removeIntentFrame = function removeIntentFrame() { // check if the parent node has not been already removed from the DOM iframe.parentNode && iframe.parentNode.removeChild(iframe); }; if (!(handshaken && eventType === 'intent-' + intent._id + ':exposeFrameRemoval')) { _context2.next = 23; break; } return _context2.abrupt('return', resolve({ removeIntentFrame: removeIntentFrame, doc: event.data.document })); case 23: removeIntentFrame(); if (!(eventType === 'intent-' + intent._id + ':error')) { _context2.next = 26; break; } return _context2.abrupt('return', reject(_helpers.errorSerializer.deserialize(event.data.error))); case 26: if (!(handshaken && eventType === 'intent-' + intent._id + ':cancel')) { _context2.next = 28; break; } return _context2.abrupt('return', resolve(null)); case 28: if (!(handshaken && eventType === 'intent-' + intent._id + ':done')) { _context2.next = 30; break; } return _context2.abrupt('return', resolve(event.data.document)); case 30: if (handshaken) { _context2.next = 32; break; } return _context2.abrupt('return', reject(new Error('Unexpected handshake message from intent service'))); case 32: case 'end': return _context2.stop(); } } }, _callee2, _this); })); return function messageHandler(_x5) { return _ref2.apply(this, arguments); }; }(); window.addEventListener('message', messageHandler); }); } function start(cozy, intent, element) { var data = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {}; var service = (0, _helpers.pickService)(intent, options.filterServices); if (!service) { throw new Error('Unable to find a service'); } var iframe = injectIntentIframe(intent, element, service.href, options); return connectIntentIframe(cozy, iframe, element, intent, data, options.onReadyCallback); } /***/ }), /* 19 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.start = start; var _fetch = __webpack_require__(0); var _helpers = __webpack_require__(5); function listenClientData(intent, window) { return new Promise(function (resolve) { var messageEventListener = function messageEventListener(event) { if (event.origin !== intent.attributes.client) return; window.removeEventListener('message', messageEventListener); resolve(event.data); }; window.addEventListener('message', messageEventListener); window.parent.postMessage({ type: 'intent-' + intent._id + ':ready' }, intent.attributes.client); }); } // maximize the height of an element function maximize(element) { if (element && element.style) { element.style.height = '100%'; } } function start(cozy, intentId, serviceWindow) { serviceWindow = serviceWindow || typeof window !== 'undefined' && window; if (!serviceWindow || !serviceWindow.document) { return Promise.reject(new Error('Intent service should be used in browser')); } // Maximize document, the whole iframe is handled by intents, clients and // services serviceWindow.addEventListener('load', function () { var _serviceWindow = serviceWindow, document = _serviceWindow.document; [document.documentElement, document.body].forEach(maximize); }); intentId = intentId || serviceWindow.location.search.split('=')[1]; if (!intentId) return Promise.reject(new Error('Cannot retrieve intent from URL')); return (0, _fetch.cozyFetchJSON)(cozy, 'GET', '/intents/' + intentId).then(function (intent) { var terminated = false; var sendMessage = function sendMessage(message) { if (terminated) throw new Error('Intent service has already been terminated'); serviceWindow.parent.postMessage(message, intent.attributes.client); }; var compose = function compose(action, doctype, data) { return new Promise(function (resolve) { var composeEventListener = function composeEventListener(event) { if (event.origin !== intent.attributes.client) return; serviceWindow.removeEventListener('message', composeEventListener); return resolve(event.data); }; serviceWindow.addEventListener('message', composeEventListener); sendMessage({ type: 'intent-' + intent._id + ':compose', action: action, doctype: doctype, data: data }); }); }; var _terminate = function _terminate(message) { sendMessage(message); terminated = true; }; var resizeClient = function resizeClient(dimensions, transitionProperty) { if (terminated) throw new Error('Intent service has been terminated'); sendMessage({ type: 'intent-' + intent._id + ':resize', // if a dom element is passed, calculate its size dimensions: dimensions.element ? Object.assign({}, dimensions, { maxHeight: dimensions.element.clientHeight, maxWidth: dimensions.element.clientWidth }) : dimensions, transition: transitionProperty }); }; var cancel = function cancel() { _terminate({ type: 'intent-' + intent._id + ':cancel' }); }; // Prevent unfulfilled client promises when this window unloads for a // reason or another. serviceWindow.addEventListener('unload', function () { if (!terminated) cancel(); }); return listenClientData(intent, serviceWindow).then(function (data) { return { compose: compose, getData: function getData() { return data; }, getIntent: function getIntent() { return intent; }, terminate: function terminate(doc) { var eventName = data && data.exposeIntentFrameRemoval ? 'exposeFrameRemoval' : 'done'; return _terminate({ type: 'intent-' + intent._id + ':' + eventName, document: doc }); }, throw: function _throw(error) { return _terminate({ type: 'intent-' + intent._id + ':error', error: _helpers.errorSerializer.serialize(error) }); }, resizeClient: resizeClient, cancel: cancel }; }); }); } /***/ }), /* 20 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.count = count; exports.queued = queued; exports.create = create; var _fetch = __webpack_require__(0); function count(cozy, workerType) { return (0, _fetch.cozyFetchJSON)(cozy, 'GET', '/jobs/queue/' + workerType).then(function (data) { return data.length; }); } function queued(cozy, workerType) { return (0, _fetch.cozyFetchJSON)(cozy, 'GET', '/jobs/queue/' + workerType); } function create(cozy, workerType, args, options) { return (0, _fetch.cozyFetchJSON)(cozy, 'POST', '/jobs/queue/' + workerType, { data: { type: 'io.cozy.jobs', attributes: { arguments: args || {}, options: options || {} } } }); } /***/ }), /* 21 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.replicationOfflineError = undefined; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; exports.init = init; exports.getDoctypes = getDoctypes; exports.hasDatabase = hasDatabase; exports.getDatabase = getDatabase; exports.setDatabase = setDatabase; exports.migrateDatabase = migrateDatabase; exports.createDatabase = createDatabase; exports.destroyDatabase = destroyDatabase; exports.destroyAllDatabase = destroyAllDatabase; exports.hasReplication = hasReplication; exports.replicateFromCozy = replicateFromCozy; exports.stopReplication = stopReplication; exports.stopAllReplication = stopAllReplication; exports.hasRepeatedReplication = hasRepeatedReplication; exports.startRepeatedReplication = startRepeatedReplication; exports.stopRepeatedReplication = stopRepeatedReplication; exports.stopAllRepeatedReplication = stopAllRepeatedReplication; var _doctypes = __webpack_require__(2); var _auth_v = __webpack_require__(3); var _utils = __webpack_require__(1); var _pouchdbBrowser = __webpack_require__(22); var _pouchdbBrowser2 = _interopRequireDefault(_pouchdbBrowser); var _pouchdbFind = __webpack_require__(23); var _pouchdbFind2 = _interopRequireDefault(_pouchdbFind); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var replicationOfflineError = exports.replicationOfflineError = 'Replication abort, your device is actually offline.'; var pluginLoaded = false; /* For each doctype we have some parameters: cozy._offline[doctype] = { database: pouchdb database replication: the pouchdb replication replicationPromise: promise of replication interval: repeated replication interval } */ function init(cozy, _ref) { var _ref$options = _ref.options, options = _ref$options === undefined ? {} : _ref$options, _ref$doctypes = _ref.doctypes, doctypes = _ref$doctypes === undefined ? [] : _ref$doctypes; var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = doctypes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var doctype = _step.value; createDatabase(cozy, doctype, options); } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } } // helper function getInfo(cozy, doctype) { cozy._offline = cozy._offline || []; cozy._offline[doctype] = cozy._offline[doctype] || {}; return cozy._offline[doctype]; } function getDoctypes(cozy) { cozy._offline = cozy._offline || []; return Object.keys(cozy._offline); } // // DATABASE // function hasDatabase(cozy, doctype) { return getDatabase(cozy, doctype) !== undefined; } function getDatabase(cozy, doctype) { return getInfo(cozy, doctype).database; } function setDatabase(cozy, doctype, database) { cozy._offline[doctype].database = database; return getDatabase(cozy, doctype); } function migrateDatabase(cozy, doctype) { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var oldDb = getDatabase(cozy, doctype); var newOptions = _extends({ adapter: 'idb' }, options); var newDb = new _pouchdbBrowser2.default(doctype, newOptions); return oldDb.replicate.to(newDb).then(function () { setDatabase(cozy, doctype, newDb); oldDb.destroy(); return newDb; }); } function createDatabase(cozy, doctype) { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; if (!pluginLoaded) { _pouchdbBrowser2.default.plugin(_pouchdbFind2.default); pluginLoaded = true; } if (hasDatabase(cozy, doctype)) { return Promise.resolve(getDatabase(cozy, doctype)); } setDatabase(cozy, doctype, new _pouchdbBrowser2.default(doctype, options)); return createIndexes(cozy, doctype).then(function () { return getDatabase(cozy, doctype); }); } function destroyDatabase(cozy, doctype) { if (!hasDatabase(cozy, doctype)) { return Promise.resolve(false); } return stopRepeatedReplication(cozy, doctype).then(function () { return stopReplication(cozy, doctype); }).then(function () { return getDatabase(cozy, doctype).destroy(); }).then(function (response) { setDatabase(cozy, doctype, undefined); return response; }); } function destroyAllDatabase(cozy) { var doctypes = getDoctypes(cozy); var destroy = function destroy(doctype) { return destroyDatabase(cozy, doctype); }; return Promise.all(doctypes.map(destroy)); } function createIndexes(cozy, doctype) { if (doctype === _doctypes.DOCTYPE_FILES) { return getDatabase(cozy, doctype).createIndex({ index: { fields: ['dir_id'] } }); } return Promise.resolve(); } // // REPLICATION // function hasReplication(cozy, doctype) { return getReplication(cozy, doctype) !== undefined; } function getReplication(cozy, doctype) { return getInfo(cozy, doctype).replication; } function setReplication(cozy, doctype, replication) { cozy._offline[doctype].replication = replication; return getReplication(cozy, doctype); } function getReplicationUrl(cozy, doctype) { return cozy.authorize().then(function (credentials) { var basic = credentials.token.toBasicAuth(); return (cozy._url + '/data/' + doctype).replace('//', '//' + basic); }); } function getReplicationPromise(cozy, doctype) { return getInfo(cozy, doctype).replicationPromise; } function setReplicationPromise(cozy, doctype, promise) { cozy._offline[doctype].replicationPromise = promise; return getReplicationPromise(cozy, doctype); } function replicateFromCozy(cozy, doctype) { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; return setReplicationPromise(cozy, doctype, new Promise(function (resolve, reject) { if (!hasDatabase(cozy, doctype)) { createDatabase(cozy, doctype); } if (options.live === true) { return reject(new Error("You can't use `live` option with Cozy couchdb.")); } if ((0, _utils.isOffline)()) { reject(replicationOfflineError); options.onError && options.onError(replicationOfflineError); return; } getReplicationUrl(cozy, doctype).then(function (url) { return setReplication(cozy, doctype, getDatabase(cozy, doctype).replicate.from(url, options).on('complete', function (info) { setReplication(cozy, doctype, undefined); resolve(info); options.onComplete && options.onComplete(info); }).on('error', function (err) { if (err.error === 'code=400, message=Expired token') { cozy.authorize().then(function (_ref2) { var client = _ref2.client, token = _ref2.token; (0, _auth_v.refreshToken)(cozy, client, token).then(function (newToken) { return cozy.saveCredentials(client, newToken); }).then(function () { return replicateFromCozy(cozy, doctype, options); }); }); } else { console.warn('ReplicateFromCozy \'' + doctype + '\' Error:'); console.warn(err); setReplication(cozy, doctype, undefined); reject(err); options.onError && options.onError(err); } })); }); })); } function stopReplication(cozy, doctype) { if (!getDatabase(cozy, doctype) || !hasReplication(cozy, doctype)) { return Promise.resolve(); } return new Promise(function (resolve) { try { getReplicationPromise(cozy, doctype).then(function () { resolve(); }); getReplication(cozy, doctype).cancel(); // replication is set to undefined by complete replication } catch (e) { resolve(); } }); } function stopAllReplication(cozy) { var doctypes = getDoctypes(cozy); var stop = function stop(doctype) { return stopReplication(cozy, doctype); }; return Promise.all(doctypes.map(stop)); } // // REPEATED REPLICATION // function getRepeatedReplication(cozy, doctype) { return getInfo(cozy, doctype).interval; } function setRepeatedReplication(cozy, doctype, interval) { cozy._offline[doctype].interval = interval; } function hasRepeatedReplication(cozy, doctype) { return getRepeatedReplication(cozy, doctype) !== undefined; } function startRepeatedReplication(cozy, doctype, timer) { var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; // TODO: add timer limitation for not flooding Gozy if (hasRepeatedReplication(cozy, doctype)) { return getRepeatedReplication(cozy, doctype); } return setRepeatedReplication(cozy, doctype, setInterval(function () { if ((0, _utils.isOffline)()) { // network is offline, replication cannot be launched console.info(replicationOfflineError); return; } if (!hasReplication(cozy, doctype)) { replicateFromCozy(cozy, doctype, options); // TODO: add replicationToCozy } }, timer * 1000)); } function stopRepeatedReplication(cozy, doctype) { if (hasRepeatedReplication(cozy, doctype)) { clearInterval(getRepeatedReplication(cozy, doctype)); setRepeatedReplication(cozy, doctype, undefined); } if (hasReplication(cozy, doctype)) { return stopReplication(cozy, doctype); } return Promise.resolve(); } function stopAllRepeatedReplication(cozy) { var doctypes = getDoctypes(cozy); var stop = function stop(doctype) { return stopRepeatedReplication(cozy, doctype); }; return Promise.all(doctypes.map(stop)); } /***/ }), /* 22 */ /***/ (function(module, exports) { module.exports = __webpack_require__(693); /***/ }), /* 23 */ /***/ (function(module, exports) { module.exports = __webpack_require__(705); /***/ }), /* 24 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.diskUsage = diskUsage; exports.changePassphrase = changePassphrase; exports.getInstance = getInstance; exports.updateInstance = updateInstance; exports.getClients = getClients; exports.deleteClientById = deleteClientById; exports.updateLastSync = updateLastSync; var _fetch = __webpack_require__(0); function diskUsage(cozy) { return (0, _fetch.cozyFetchJSON)(cozy, 'GET', '/settings/disk-usage'); } function changePassphrase(cozy, currentPassPhrase, newPassPhrase) { return (0, _fetch.cozyFetchJSON)(cozy, 'PUT', '/settings/passphrase', { current_passphrase: currentPassPhrase, new_passphrase: newPassPhrase }); } function getInstance(cozy) { return (0, _fetch.cozyFetchJSON)(cozy, 'GET', '/settings/instance'); } function updateInstance(cozy, instance) { return (0, _fetch.cozyFetchJSON)(cozy, 'PUT', '/settings/instance', instance); } function getClients(cozy) { return (0, _fetch.cozyFetchJSON)(cozy, 'GET', '/settings/clients'); } function deleteClientById(cozy, id) { return (0, _fetch.cozyFetchJSON)(cozy, 'DELETE', '/settings/clients/' + id); } function updateLastSync(cozy) { return (0, _fetch.cozyFetchJSON)(cozy, 'POST', '/settings/synchronized'); } /***/ }), /* 25 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.removeReferencedFiles = exports.addReferencedFiles = undefined; exports.listReferencedFiles = listReferencedFiles; exports.fetchReferencedFiles = fetchReferencedFiles; var _fetch = __webpack_require__(0); var _doctypes = __webpack_require__(2); function updateRelations(verb) { return function (cozy, doc, ids) { if (!doc) throw new Error('missing doc argument'); if (!Array.isArray(ids)) ids = [ids]; var refs = ids.map(function (id) { return { type: _doctypes.DOCTYPE_FILES, id: id }; }); return (0, _fetch.cozyFetchJSON)(cozy, verb, makeReferencesPath(doc), { data: refs }); }; } var addReferencedFiles = exports.addReferencedFiles = updateRelations('POST'); var removeReferencedFiles = exports.removeReferencedFiles = updateRelations('DELETE'); function listReferencedFiles(cozy, doc) { if (!doc) throw new Error('missing doc argument'); return (0, _fetch.cozyFetchJSON)(cozy, 'GET', makeReferencesPath(doc)).then(function (files) { return files.map(function (file) { return file._id; }); }); } function fetchReferencedFiles(cozy, doc, options, sort) { if (!doc) throw new Error('missing doc argument'); var params = Object.keys(options).map(function (key) { var value = encodeURIComponent(JSON.stringify(options[key])); return '&page[' + key + ']=' + value; }).join(''); // Datetime is the default sort, but 'id' is also available if (!sort) { sort = 'datetime'; } return (0, _fetch.cozyFetchRawJSON)(cozy, 'GET', makeReferencesPath(doc) + '?include=files&sort=' + sort + params); } function makeReferencesPath(doc) { var type = encodeURIComponent(doc._type); var id = encodeURIComponent(doc._id); return '/data/' + type + '/' + id + '/relationships/references'; } /***/ }) /******/ ]))); //# sourceMappingURL=cozy-client.node.js.map /***/ }), /* 619 */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(620); /***/ }), /* 620 */ /***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2014-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ // This method of obtaining a reference to the global object needs to be // kept identical to the way it is obtained in runtime.js var g = (function() { return this })() || Function("return this")(); // Use `getOwnPropertyNames` because not all browsers support calling // `hasOwnProperty` on the global `self` object in a worker. See #183. var hadRuntime = g.regeneratorRuntime && Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0; // Save the old regeneratorRuntime in case it needs to be restored later. var oldRuntime = hadRuntime && g.regeneratorRuntime; // Force reevalutation of runtime.js. g.regeneratorRuntime = undefined; module.exports = __webpack_require__(621); if (hadRuntime) { // Restore the original runtime. g.regeneratorRuntime = oldRuntime; } else { // Remove the global property added by runtime.js. try { delete g.regeneratorRuntime; } catch(e) { g.regeneratorRuntime = undefined; } } /***/ }), /* 621 */ /***/ (function(module, exports) { /** * Copyright (c) 2014-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ !(function(global) { "use strict"; var Op = Object.prototype; var hasOwn = Op.hasOwnProperty; var undefined; // More compressible than void 0. var $Symbol = typeof Symbol === "function" ? Symbol : {}; var iteratorSymbol = $Symbol.iterator || "@@iterator"; var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; var inModule = typeof module === "object"; var runtime = global.regeneratorRuntime; if (runtime) { if (inModule) { // If regeneratorRuntime is defined globally and we're in a module, // make the exports object identical to regeneratorRuntime. module.exports = runtime; } // Don't bother evaluating the rest of this file if the runtime was // already defined globally. return; } // Define the runtime globally (as expected by generated code) as either // module.exports (if we're in a module) or a new, empty object. runtime = global.regeneratorRuntime = inModule ? module.exports : {}; function wrap(innerFn, outerFn, self, tryLocsList) { // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; var generator = Object.create(protoGenerator.prototype); var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next, // .throw, and .return methods. generator._invoke = makeInvokeMethod(innerFn, self, context); return generator; } runtime.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion // record like context.tryEntries[i].completion. This interface could // have been (and was previously) designed to take a closure to be // invoked without arguments, but in all the cases we care about we // already have an existing method we want to call, so there's no need // to create a new function object. We can even get away with assuming // the method takes exactly one argument, since that happens to be true // in every case, so we don't have to touch the arguments object. The // only additional allocation required is the completion record, which // has a stable shape and so hopefully should be cheap to allocate. function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } var GenStateSuspendedStart = "suspendedStart"; var GenStateSuspendedYield = "suspendedYield"; var GenStateExecuting = "executing"; var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as // breaking out of the dispatch switch statement. var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and // .constructor.prototype properties for functions that return Generator // objects. For full spec compliance, you may wish to configure your // minifier not to mangle the names of these two functions. function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that // don't natively support it. var IteratorPrototype = {}; IteratorPrototype[iteratorSymbol] = function () { return this; }; var getProto = Object.getPrototypeOf; var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { // This environment has a native %IteratorPrototype%; use it instead // of the polyfill. IteratorPrototype = NativeIteratorPrototype; } var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; GeneratorFunctionPrototype.constructor = GeneratorFunction; GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = "GeneratorFunction"; // Helper for defining the .next, .throw, and .return methods of the // Iterator interface in terms of a single ._invoke method. function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function(method) { prototype[method] = function(arg) { return this._invoke(method, arg); }; }); } runtime.isGeneratorFunction = function(genFun) { var ctor = typeof genFun === "function" && genFun.constructor; return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can // do is to check its .name property. (ctor.displayName || ctor.name) === "GeneratorFunction" : false; }; runtime.mark = function(genFun) { if (Object.setPrototypeOf) { Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); } else { genFun.__proto__ = GeneratorFunctionPrototype; if (!(toStringTagSymbol in genFun)) { genFun[toStringTagSymbol] = "GeneratorFunction"; } } genFun.prototype = Object.create(Gp); return genFun; }; // Within the body of any async function, `await x` is transformed to // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test // `hasOwn.call(value, "__await")` to determine if the yielded value is // meant to be awaited. runtime.awrap = function(arg) { return { __await: arg }; }; function AsyncIterator(generator) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (record.type === "throw") { reject(record.arg); } else { var result = record.arg; var value = result.value; if (value && typeof value === "object" && hasOwn.call(value, "__await")) { return Promise.resolve(value.__await).then(function(value) { invoke("next", value, resolve, reject); }, function(err) { invoke("throw", err, resolve, reject); }); } return Promise.resolve(value).then(function(unwrapped) { // When a yielded Promise is resolved, its final value becomes // the .value of the Promise<{value,done}> result for the // current iteration. If the Promise is rejected, however, the // result for this iteration will be rejected with the same // reason. Note that rejections of yielded Promises are not // thrown back into the generator function, as is the case // when an awaited Promise is rejected. This difference in // behavior between yield and await is important, because it // allows the consumer to decide what to do with the yielded // rejection (swallow it and continue, manually .throw it back // into the generator, abandon iteration, whatever). With // await, by contrast, there is no opportunity to examine the // rejection reason outside the generator function, so the // only option is to throw it from the await expression, and // let the generator function handle the exception. result.value = unwrapped; resolve(result); }, reject); } } var previousPromise; function enqueue(method, arg) { function callInvokeWithMethodAndArg() { return new Promise(function(resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = // If enqueue has been called before, then we want to wait until // all previous Promises have been resolved before calling invoke, // so that results are always delivered in the correct order. If // enqueue has not been called before, then it is important to // call invoke immediately, without waiting on a callback to fire, // so that the async generator function has the opportunity to do // any necessary setup in a predictable way. This predictability // is why the Promise constructor synchronously invokes its // executor callback, and why async functions synchronously // execute code before the first await. Since we implement simple // async functions in terms of async generators, it is especially // important to get this right, even though it requires care. previousPromise ? previousPromise.then( callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later // invocations of the iterator. callInvokeWithMethodAndArg ) : callInvokeWithMethodAndArg(); } // Define the unified helper method that is used to implement .next, // .throw, and .return (see defineIteratorMethods). this._invoke = enqueue; } defineIteratorMethods(AsyncIterator.prototype); AsyncIterator.prototype[asyncIteratorSymbol] = function () { return this; }; runtime.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of // AsyncIterator objects; they just return a Promise for the value of // the final result produced by the iterator. runtime.async = function(innerFn, outerFn, self, tryLocsList) { var iter = new AsyncIterator( wrap(innerFn, outerFn, self, tryLocsList) ); return runtime.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator. : iter.next().then(function(result) { return result.done ? result.value : iter.next(); }); }; function makeInvokeMethod(innerFn, self, context) { var state = GenStateSuspendedStart; return function invoke(method, arg) { if (state === GenStateExecuting) { throw new Error("Generator is already running"); } if (state === GenStateCompleted) { if (method === "throw") { throw arg; } // Be forgiving, per 25.3.3.3.3 of the spec: // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume return doneResult(); } context.method = method; context.arg = arg; while (true) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (context.method === "next") { // Setting context._sent for legacy support of Babel's // function.sent implementation. context.sent = context._sent = context.arg; } else if (context.method === "throw") { if (state === GenStateSuspendedStart) { state = GenStateCompleted; throw context.arg; } context.dispatchException(context.arg); } else if (context.method === "return") { context.abrupt("return", context.arg); } state = GenStateExecuting; var record = tryCatch(innerFn, self, context); if (record.type === "normal") { // If an exception is thrown from innerFn, we leave state === // GenStateExecuting and loop back for another invocation. state = context.done ? GenStateCompleted : GenStateSuspendedYield; if (record.arg === ContinueSentinel) { continue; } return { value: record.arg, done: context.done }; } else if (record.type === "throw") { state = GenStateCompleted; // Dispatch the exception by looping back around to the // context.dispatchException(context.arg) call above. context.method = "throw"; context.arg = record.arg; } } }; } // Call delegate.iterator[context.method](context.arg) and handle the // result, either by returning a { value, done } result from the // delegate iterator, or by modifying context.method and context.arg, // setting context.delegate to null, and returning the ContinueSentinel. function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (method === undefined) { // A .throw or .return when the delegate iterator has no .throw // method always terminates the yield* loop. context.delegate = null; if (context.method === "throw") { if (delegate.iterator.return) { // If the delegate iterator has a return method, give it a // chance to clean up. context.method = "return"; context.arg = undefined; maybeInvokeDelegate(delegate, context); if (context.method === "throw") { // If maybeInvokeDelegate(context) changed context.method from // "return" to "throw", let that override the TypeError below. return ContinueSentinel; } } context.method = "throw"; context.arg = new TypeError( "The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if (record.type === "throw") { context.method = "throw"; context.arg = record.arg; context.delegate = null; return ContinueSentinel; } var info = record.arg; if (! info) { context.method = "throw"; context.arg = new TypeError("iterator result is not an object"); context.delegate = null; return ContinueSentinel; } if (info.done) { // Assign the result of the finished delegate to the temporary // variable specified by delegate.resultName (see delegateYield). context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield). context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the // exception, let the outer generator proceed normally. If // context.method was "next", forget context.arg since it has been // "consumed" by the delegate iterator. If context.method was // "return", allow the original .return call to continue in the // outer generator. if (context.method !== "return") { context.method = "next"; context.arg = undefined; } } else { // Re-yield the result returned by the delegate method. return info; } // The delegate iterator is finished, so forget it and continue with // the outer generator. context.delegate = null; return ContinueSentinel; } // Define Generator.prototype.{next,throw,return} in terms of the // unified ._invoke helper method. defineIteratorMethods(Gp); Gp[toStringTagSymbol] = "Generator"; // A Generator should always return itself as the iterator object when the // @@iterator function is called on it. Some browsers' implementations of the // iterator prototype chain incorrectly implement this, causing the Generator // object to not be returned from this call. This ensures that doesn't happen. // See https://github.com/facebook/regenerator/issues/274 for more details. Gp[iteratorSymbol] = function() { return this; }; Gp.toString = function() { return "[object Generator]"; }; function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; if (1 in locs) { entry.catchLoc = locs[1]; } if (2 in locs) { entry.finallyLoc = locs[2]; entry.afterLoc = locs[3]; } this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal"; delete record.arg; entry.completion = record; } function Context(tryLocsList) { // The root entry object (effectively a try statement without a catch // or a finally block) gives us a place to store values thrown from // locations where there is no enclosing try statement. this.tryEntries = [{ tryLoc: "root" }]; tryLocsList.forEach(pushTryEntry, this); this.reset(true); } runtime.keys = function(object) { var keys = []; for (var key in object) { keys.push(key); } keys.reverse(); // Rather than returning an object with a next method, we keep // things simple and return the next function itself. return function next() { while (keys.length) { var key = keys.pop(); if (key in object) { next.value = key; next.done = false; return next; } } // To avoid creating an additional object, we just hang the .value // and .done properties off the next function object itself. This // also ensures that the minifier will not anonymize the function. next.done = true; return next; }; }; function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) { return iteratorMethod.call(iterable); } if (typeof iterable.next === "function") { return iterable; } if (!isNaN(iterable.length)) { var i = -1, next = function next() { while (++i < iterable.length) { if (hasOwn.call(iterable, i)) { next.value = iterable[i]; next.done = false; return next; } } next.value = undefined; next.done = true; return next; }; return next.next = next; } } // Return an iterator with no values. return { next: doneResult }; } runtime.values = values; function doneResult() { return { value: undefined, done: true }; } Context.prototype = { constructor: Context, reset: function(skipTempReset) { this.prev = 0; this.next = 0; // Resetting context._sent for legacy support of Babel's // function.sent implementation. this.sent = this._sent = undefined; this.done = false; this.delegate = null; this.method = "next"; this.arg = undefined; this.tryEntries.forEach(resetTryEntry); if (!skipTempReset) { for (var name in this) { // Not sure about the optimal order of these conditions: if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) { this[name] = undefined; } } } }, stop: function() { this.done = true; var rootEntry = this.tryEntries[0]; var rootRecord = rootEntry.completion; if (rootRecord.type === "throw") { throw rootRecord.arg; } return this.rval; }, dispatchException: function(exception) { if (this.done) { throw exception; } var context = this; function handle(loc, caught) { record.type = "throw"; record.arg = exception; context.next = loc; if (caught) { // If the dispatched exception was caught by a catch block, // then let that catch block handle the exception normally. context.method = "next"; context.arg = undefined; } return !! caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; var record = entry.completion; if (entry.tryLoc === "root") { // Exception thrown outside of any try block that could handle // it, so set the completion value of the entire function to // throw the exception. return handle("end"); } if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"); var hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) { return handle(entry.catchLoc, true); } else if (this.prev < entry.finallyLoc) { return handle(entry.finallyLoc); } } else if (hasCatch) { if (this.prev < entry.catchLoc) { return handle(entry.catchLoc, true); } } else if (hasFinally) { if (this.prev < entry.finallyLoc) { return handle(entry.finallyLoc); } } else { throw new Error("try statement without catch or finally"); } } } }, abrupt: function(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) { // Ignore the finally entry if control is not jumping to a // location outside the try/catch block. finallyEntry = null; } var record = finallyEntry ? finallyEntry.completion : {}; record.type = type; record.arg = arg; if (finallyEntry) { this.method = "next"; this.next = finallyEntry.finallyLoc; return ContinueSentinel; } return this.complete(record); }, complete: function(record, afterLoc) { if (record.type === "throw") { throw record.arg; } if (record.type === "break" || record.type === "continue") { this.next = record.arg; } else if (record.type === "return") { this.rval = this.arg = record.arg; this.method = "return"; this.next = "end"; } else if (record.type === "normal" && afterLoc) { this.next = afterLoc; } return ContinueSentinel; }, finish: function(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) { this.complete(entry.completion, entry.afterLoc); resetTryEntry(entry); return ContinueSentinel; } } }, "catch": function(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (record.type === "throw") { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } // The context.catch method must only be called with a location // argument that corresponds to a known catch block. throw new Error("illegal catch attempt"); }, delegateYield: function(iterable, resultName, nextLoc) { this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }; if (this.method === "next") { // Deliberately forget the last sent value so that we don't // accidentally pass it on to the delegate. this.arg = undefined; } return ContinueSentinel; } }; })( // In sloppy mode, unbound `this` refers to the global object, fallback to // Function constructor if we're in global strict mode. That is sadly a form // of indirect eval which violates Content Security Policy. (function() { return this })() || Function("return this")() ); /***/ }), /* 622 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var realFetch = __webpack_require__(623); module.exports = function(url, options) { if (/^\/\//.test(url)) { url = 'https:' + url; } return realFetch.call(this, url, options); }; if (!global.fetch) { global.fetch = module.exports; global.Response = realFetch.Response; global.Headers = realFetch.Headers; global.Request = realFetch.Request; } /***/ }), /* 623 */ /***/ (function(module, exports, __webpack_require__) { /** * index.js * * a request API compatible with window.fetch */ var parse_url = __webpack_require__(83).parse; var resolve_url = __webpack_require__(83).resolve; var http = __webpack_require__(98); var https = __webpack_require__(99); var zlib = __webpack_require__(101); var stream = __webpack_require__(100); var Body = __webpack_require__(624); var Response = __webpack_require__(651); var Headers = __webpack_require__(652); var Request = __webpack_require__(653); var FetchError = __webpack_require__(650); // commonjs module.exports = Fetch; // es6 default export compatibility module.exports.default = module.exports; /** * Fetch class * * @param Mixed url Absolute url or Request instance * @param Object opts Fetch options * @return Promise */ function Fetch(url, opts) { // allow call as function if (!(this instanceof Fetch)) return new Fetch(url, opts); // allow custom promise if (!Fetch.Promise) { throw new Error('native promise missing, set Fetch.Promise to your favorite alternative'); } Body.Promise = Fetch.Promise; var self = this; // wrap http.request into fetch return new Fetch.Promise(function(resolve, reject) { // build request object var options = new Request(url, opts); if (!options.protocol || !options.hostname) { throw new Error('only absolute urls are supported'); } if (options.protocol !== 'http:' && options.protocol !== 'https:') { throw new Error('only http(s) protocols are supported'); } var send; if (options.protocol === 'https:') { send = https.request; } else { send = http.request; } // normalize headers var headers = new Headers(options.headers); if (options.compress) { headers.set('accept-encoding', 'gzip,deflate'); } if (!headers.has('user-agent')) { headers.set('user-agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)'); } if (!headers.has('connection') && !options.agent) { headers.set('connection', 'close'); } if (!headers.has('accept')) { headers.set('accept', '*/*'); } // detect form data input from form-data module, this hack avoid the need to pass multipart header manually if (!headers.has('content-type') && options.body && typeof options.body.getBoundary === 'function') { headers.set('content-type', 'multipart/form-data; boundary=' + options.body.getBoundary()); } // bring node-fetch closer to browser behavior by setting content-length automatically if (!headers.has('content-length') && /post|put|patch|delete/i.test(options.method)) { if (typeof options.body === 'string') { headers.set('content-length', Buffer.byteLength(options.body)); // detect form data input from form-data module, this hack avoid the need to add content-length header manually } else if (options.body && typeof options.body.getLengthSync === 'function') { // for form-data 1.x if (options.body._lengthRetrievers && options.body._lengthRetrievers.length == 0) { headers.set('content-length', options.body.getLengthSync().toString()); // for form-data 2.x } else if (options.body.hasKnownLength && options.body.hasKnownLength()) { headers.set('content-length', options.body.getLengthSync().toString()); } // this is only necessary for older nodejs releases (before iojs merge) } else if (options.body === undefined || options.body === null) { headers.set('content-length', '0'); } } options.headers = headers.raw(); // http.request only support string as host header, this hack make custom host header possible if (options.headers.host) { options.headers.host = options.headers.host[0]; } // send request var req = send(options); var reqTimeout; if (options.timeout) { req.once('socket', function(socket) { reqTimeout = setTimeout(function() { req.abort(); reject(new FetchError('network timeout at: ' + options.url, 'request-timeout')); }, options.timeout); }); } req.on('error', function(err) { clearTimeout(reqTimeout); reject(new FetchError('request to ' + options.url + ' failed, reason: ' + err.message, 'system', err)); }); req.on('response', function(res) { clearTimeout(reqTimeout); // handle redirect if (self.isRedirect(res.statusCode) && options.redirect !== 'manual') { if (options.redirect === 'error') { reject(new FetchError('redirect mode is set to error: ' + options.url, 'no-redirect')); return; } if (options.counter >= options.follow) { reject(new FetchError('maximum redirect reached at: ' + options.url, 'max-redirect')); return; } if (!res.headers.location) { reject(new FetchError('redirect location header missing at: ' + options.url, 'invalid-redirect')); return; } // per fetch spec, for POST request with 301/302 response, or any request with 303 response, use GET when following redirect if (res.statusCode === 303 || ((res.statusCode === 301 || res.statusCode === 302) && options.method === 'POST')) { options.method = 'GET'; delete options.body; delete options.headers['content-length']; } options.counter++; resolve(Fetch(resolve_url(options.url, res.headers.location), options)); return; } // normalize location header for manual redirect mode var headers = new Headers(res.headers); if (options.redirect === 'manual' && headers.has('location')) { headers.set('location', resolve_url(options.url, headers.get('location'))); } // prepare response var body = res.pipe(new stream.PassThrough()); var response_options = { url: options.url , status: res.statusCode , statusText: res.statusMessage , headers: headers , size: options.size , timeout: options.timeout }; // response object var output; // in following scenarios we ignore compression support // 1. compression support is disabled // 2. HEAD request // 3. no content-encoding header // 4. no content response (204) // 5. content not modified response (304) if (!options.compress || options.method === 'HEAD' || !headers.has('content-encoding') || res.statusCode === 204 || res.statusCode === 304) { output = new Response(body, response_options); resolve(output); return; } // otherwise, check for gzip or deflate var name = headers.get('content-encoding'); // for gzip if (name == 'gzip' || name == 'x-gzip') { body = body.pipe(zlib.createGunzip()); output = new Response(body, response_options); resolve(output); return; // for deflate } else if (name == 'deflate' || name == 'x-deflate') { // handle the infamous raw deflate response from old servers // a hack for old IIS and Apache servers var raw = res.pipe(new stream.PassThrough()); raw.once('data', function(chunk) { // see http://stackoverflow.com/questions/37519828 if ((chunk[0] & 0x0F) === 0x08) { body = body.pipe(zlib.createInflate()); } else { body = body.pipe(zlib.createInflateRaw()); } output = new Response(body, response_options); resolve(output); }); return; } // otherwise, use response as-is output = new Response(body, response_options); resolve(output); return; }); // accept string, buffer or readable stream as body // per spec we will call tostring on non-stream objects if (typeof options.body === 'string') { req.write(options.body); req.end(); } else if (options.body instanceof Buffer) { req.write(options.body); req.end(); } else if (typeof options.body === 'object' && options.body.pipe) { options.body.pipe(req); } else if (typeof options.body === 'object') { req.write(options.body.toString()); req.end(); } else { req.end(); } }); }; /** * Redirect code matching * * @param Number code Status code * @return Boolean */ Fetch.prototype.isRedirect = function(code) { return code === 301 || code === 302 || code === 303 || code === 307 || code === 308; } // expose Promise Fetch.Promise = global.Promise; Fetch.Response = Response; Fetch.Headers = Headers; Fetch.Request = Request; /***/ }), /* 624 */ /***/ (function(module, exports, __webpack_require__) { /** * body.js * * Body interface provides common methods for Request and Response */ var convert = __webpack_require__(625).convert; var bodyStream = __webpack_require__(649); var PassThrough = __webpack_require__(100).PassThrough; var FetchError = __webpack_require__(650); module.exports = Body; /** * Body class * * @param Stream body Readable stream * @param Object opts Response options * @return Void */ function Body(body, opts) { opts = opts || {}; this.body = body; this.bodyUsed = false; this.size = opts.size || 0; this.timeout = opts.timeout || 0; this._raw = []; this._abort = false; } /** * Decode response as json * * @return Promise */ Body.prototype.json = function() { var self = this; return this._decode().then(function(buffer) { try { return JSON.parse(buffer.toString()); } catch (err) { return Body.Promise.reject(new FetchError('invalid json response body at ' + self.url + ' reason: ' + err.message, 'invalid-json')); } }); }; /** * Decode response as text * * @return Promise */ Body.prototype.text = function() { return this._decode().then(function(buffer) { return buffer.toString(); }); }; /** * Decode response as buffer (non-spec api) * * @return Promise */ Body.prototype.buffer = function() { return this._decode(); }; /** * Decode buffers into utf-8 string * * @return Promise */ Body.prototype._decode = function() { var self = this; if (this.bodyUsed) { return Body.Promise.reject(new Error('body used already for: ' + this.url)); } this.bodyUsed = true; this._bytes = 0; this._abort = false; this._raw = []; return new Body.Promise(function(resolve, reject) { var resTimeout; // body is string if (typeof self.body === 'string') { self._bytes = self.body.length; self._raw = [new Buffer(self.body)]; return resolve(self._convert()); } // body is buffer if (self.body instanceof Buffer) { self._bytes = self.body.length; self._raw = [self.body]; return resolve(self._convert()); } // allow timeout on slow response body if (self.timeout) { resTimeout = setTimeout(function() { self._abort = true; reject(new FetchError('response timeout at ' + self.url + ' over limit: ' + self.timeout, 'body-timeout')); }, self.timeout); } // handle stream error, such as incorrect content-encoding self.body.on('error', function(err) { reject(new FetchError('invalid response body at: ' + self.url + ' reason: ' + err.message, 'system', err)); }); // body is stream self.body.on('data', function(chunk) { if (self._abort || chunk === null) { return; } if (self.size && self._bytes + chunk.length > self.size) { self._abort = true; reject(new FetchError('content size at ' + self.url + ' over limit: ' + self.size, 'max-size')); return; } self._bytes += chunk.length; self._raw.push(chunk); }); self.body.on('end', function() { if (self._abort) { return; } clearTimeout(resTimeout); resolve(self._convert()); }); }); }; /** * Detect buffer encoding and convert to target encoding * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding * * @param String encoding Target encoding * @return String */ Body.prototype._convert = function(encoding) { encoding = encoding || 'utf-8'; var ct = this.headers.get('content-type'); var charset = 'utf-8'; var res, str; // header if (ct) { // skip encoding detection altogether if not html/xml/plain text if (!/text\/html|text\/plain|\+xml|\/xml/i.test(ct)) { return Buffer.concat(this._raw); } res = /charset=([^;]*)/i.exec(ct); } // no charset in content type, peek at response body for at most 1024 bytes if (!res && this._raw.length > 0) { for (var i = 0; i < this._raw.length; i++) { str += this._raw[i].toString() if (str.length > 1024) { break; } } str = str.substr(0, 1024); } // html5 if (!res && str) { res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str); } // html4 if (!res && str) { res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str); if (res) { res = /charset=(.*)/i.exec(res.pop()); } } // xml if (!res && str) { res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str); } // found charset if (res) { charset = res.pop(); // prevent decode issues when sites use incorrect encoding // ref: https://hsivonen.fi/encoding-menu/ if (charset === 'gb2312' || charset === 'gbk') { charset = 'gb18030'; } } // turn raw buffers into a single utf-8 buffer return convert( Buffer.concat(this._raw) , encoding , charset ); }; /** * Clone body given Res/Req instance * * @param Mixed instance Response or Request instance * @return Mixed */ Body.prototype._clone = function(instance) { var p1, p2; var body = instance.body; // don't allow cloning a used body if (instance.bodyUsed) { throw new Error('cannot clone body after it is used'); } // check that body is a stream and not form-data object // note: we can't clone the form-data object without having it as a dependency if (bodyStream(body) && typeof body.getBoundary !== 'function') { // tee instance body p1 = new PassThrough(); p2 = new PassThrough(); body.pipe(p1); body.pipe(p2); // set instance body to teed body and return the other teed body instance.body = p1; body = p2; } return body; } // expose Promise Body.Promise = global.Promise; /***/ }), /* 625 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var iconvLite = __webpack_require__(626); // Load Iconv from an external file to be able to disable Iconv for webpack // Add /\/iconv-loader$/ to webpack.IgnorePlugin to ignore it var Iconv = __webpack_require__(647); // Expose to the world module.exports.convert = convert; /** * Convert encoding of an UTF-8 string or a buffer * * @param {String|Buffer} str String to be converted * @param {String} to Encoding to be converted to * @param {String} [from='UTF-8'] Encoding to be converted from * @param {Boolean} useLite If set to ture, force to use iconvLite * @return {Buffer} Encoded string */ function convert(str, to, from, useLite) { from = checkEncoding(from || 'UTF-8'); to = checkEncoding(to || 'UTF-8'); str = str || ''; var result; if (from !== 'UTF-8' && typeof str === 'string') { str = new Buffer(str, 'binary'); } if (from === to) { if (typeof str === 'string') { result = new Buffer(str); } else { result = str; } } else if (Iconv && !useLite) { try { result = convertIconv(str, to, from); } catch (E) { console.error(E); try { result = convertIconvLite(str, to, from); } catch (E) { console.error(E); result = str; } } } else { try { result = convertIconvLite(str, to, from); } catch (E) { console.error(E); result = str; } } if (typeof result === 'string') { result = new Buffer(result, 'utf-8'); } return result; } /** * Convert encoding of a string with node-iconv (if available) * * @param {String|Buffer} str String to be converted * @param {String} to Encoding to be converted to * @param {String} [from='UTF-8'] Encoding to be converted from * @return {Buffer} Encoded string */ function convertIconv(str, to, from) { var response, iconv; iconv = new Iconv(from, to + '//TRANSLIT//IGNORE'); response = iconv.convert(str); return response.slice(0, response.length); } /** * Convert encoding of astring with iconv-lite * * @param {String|Buffer} str String to be converted * @param {String} to Encoding to be converted to * @param {String} [from='UTF-8'] Encoding to be converted from * @return {Buffer} Encoded string */ function convertIconvLite(str, to, from) { if (to === 'UTF-8') { return iconvLite.decode(str, from); } else if (from === 'UTF-8') { return iconvLite.encode(str, to); } else { return iconvLite.encode(iconvLite.decode(str, from), to); } } /** * Converts charset name if needed * * @param {String} name Character set * @return {String} Character set name */ function checkEncoding(name) { return (name || '').toString().trim(). replace(/^latin[\-_]?(\d+)$/i, 'ISO-8859-$1'). replace(/^win(?:dows)?[\-_]?(\d+)$/i, 'WINDOWS-$1'). replace(/^utf[\-_]?(\d+)$/i, 'UTF-$1'). replace(/^ks_c_5601\-1987$/i, 'CP949'). replace(/^us[\-_]?ascii$/i, 'ASCII'). toUpperCase(); } /***/ }), /* 626 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Some environments don't have global Buffer (e.g. React Native). // Solution would be installing npm modules "buffer" and "stream" explicitly. var Buffer = __webpack_require__(114).Buffer; var bomHandling = __webpack_require__(627), iconv = module.exports; // All codecs and aliases are kept here, keyed by encoding name/alias. // They are lazy loaded in `iconv.getCodec` from `encodings/index.js`. iconv.encodings = null; // Characters emitted in case of error. iconv.defaultCharUnicode = '�'; iconv.defaultCharSingleByte = '?'; // Public API. iconv.encode = function encode(str, encoding, options) { str = "" + (str || ""); // Ensure string. var encoder = iconv.getEncoder(encoding, options); var res = encoder.write(str); var trail = encoder.end(); return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res; } iconv.decode = function decode(buf, encoding, options) { if (typeof buf === 'string') { if (!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 = true; } buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer. } var decoder = iconv.getDecoder(encoding, options); var res = decoder.write(buf); var trail = decoder.end(); return trail ? (res + trail) : res; } iconv.encodingExists = function encodingExists(enc) { try { iconv.getCodec(enc); return true; } catch (e) { return false; } } // Legacy aliases to convert functions iconv.toEncoding = iconv.encode; iconv.fromEncoding = iconv.decode; // Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache. iconv._codecDataCache = {}; iconv.getCodec = function getCodec(encoding) { if (!iconv.encodings) iconv.encodings = __webpack_require__(628); // Lazy load all encoding definitions. // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. var enc = iconv._canonicalizeEncoding(encoding); // Traverse iconv.encodings to find actual codec. var codecOptions = {}; while (true) { var codec = iconv._codecDataCache[enc]; if (codec) return codec; var codecDef = iconv.encodings[enc]; switch (typeof codecDef) { case "string": // Direct alias to other encoding. enc = codecDef; break; case "object": // Alias with options. Can be layered. for (var key in codecDef) codecOptions[key] = codecDef[key]; if (!codecOptions.encodingName) codecOptions.encodingName = enc; enc = codecDef.type; break; case "function": // Codec itself. if (!codecOptions.encodingName) codecOptions.encodingName = enc; // The codec function must load all tables and return object with .encoder and .decoder methods. // It'll be called only once (for each different options object). codec = new codecDef(codecOptions, iconv); iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later. return codec; default: throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')"); } } } iconv._canonicalizeEncoding = function(encoding) { // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. return (''+encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, ""); } iconv.getEncoder = function getEncoder(encoding, options) { var codec = iconv.getCodec(encoding), encoder = new codec.encoder(options, codec); if (codec.bomAware && options && options.addBOM) encoder = new bomHandling.PrependBOM(encoder, options); return encoder; } iconv.getDecoder = function getDecoder(encoding, options) { var codec = iconv.getCodec(encoding), decoder = new codec.decoder(options, codec); if (codec.bomAware && !(options && options.stripBOM === false)) decoder = new bomHandling.StripBOM(decoder, options); return decoder; } // Load extensions in Node. All of them are omitted in Browserify build via 'browser' field in package.json. var nodeVer = typeof process !== 'undefined' && process.versions && process.versions.node; if (nodeVer) { // Load streaming support in Node v0.10+ var nodeVerArr = nodeVer.split(".").map(Number); if (nodeVerArr[0] > 0 || nodeVerArr[1] >= 10) { __webpack_require__(645)(iconv); } // Load Node primitive extensions. __webpack_require__(646)(iconv); } if (false) {} /***/ }), /* 627 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var BOMChar = '\uFEFF'; exports.PrependBOM = PrependBOMWrapper function PrependBOMWrapper(encoder, options) { this.encoder = encoder; this.addBOM = true; } PrependBOMWrapper.prototype.write = function(str) { if (this.addBOM) { str = BOMChar + str; this.addBOM = false; } return this.encoder.write(str); } PrependBOMWrapper.prototype.end = function() { return this.encoder.end(); } //------------------------------------------------------------------------------ exports.StripBOM = StripBOMWrapper; function StripBOMWrapper(decoder, options) { this.decoder = decoder; this.pass = false; this.options = options || {}; } StripBOMWrapper.prototype.write = function(buf) { var res = this.decoder.write(buf); if (this.pass || !res) return res; if (res[0] === BOMChar) { res = res.slice(1); if (typeof this.options.stripBOM === 'function') this.options.stripBOM(); } this.pass = true; return res; } StripBOMWrapper.prototype.end = function() { return this.decoder.end(); } /***/ }), /* 628 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Update this array if you add/rename/remove files in this directory. // We support Browserify by skipping automatic module discovery and requiring modules directly. var modules = [ __webpack_require__(629), __webpack_require__(630), __webpack_require__(631), __webpack_require__(632), __webpack_require__(633), __webpack_require__(634), __webpack_require__(635), __webpack_require__(636), ]; // Put all encoding/alias/codec definitions to single object and export it. for (var i = 0; i < modules.length; i++) { var module = modules[i]; for (var enc in module) if (Object.prototype.hasOwnProperty.call(module, enc)) exports[enc] = module[enc]; } /***/ }), /* 629 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Buffer = __webpack_require__(114).Buffer; // Export Node.js internal encodings. module.exports = { // Encodings utf8: { type: "_internal", bomAware: true}, cesu8: { type: "_internal", bomAware: true}, unicode11utf8: "utf8", ucs2: { type: "_internal", bomAware: true}, utf16le: "ucs2", binary: { type: "_internal" }, base64: { type: "_internal" }, hex: { type: "_internal" }, // Codec. _internal: InternalCodec, }; //------------------------------------------------------------------------------ function InternalCodec(codecOptions, iconv) { this.enc = codecOptions.encodingName; this.bomAware = codecOptions.bomAware; if (this.enc === "base64") this.encoder = InternalEncoderBase64; else if (this.enc === "cesu8") { this.enc = "utf8"; // Use utf8 for decoding. this.encoder = InternalEncoderCesu8; // Add decoder for versions of Node not supporting CESU-8 if (Buffer.from('eda0bdedb2a9', 'hex').toString() !== '💩') { this.decoder = InternalDecoderCesu8; this.defaultCharUnicode = iconv.defaultCharUnicode; } } } InternalCodec.prototype.encoder = InternalEncoder; InternalCodec.prototype.decoder = InternalDecoder; //------------------------------------------------------------------------------ // We use node.js internal decoder. Its signature is the same as ours. var StringDecoder = __webpack_require__(334).StringDecoder; if (!StringDecoder.prototype.end) // Node v0.8 doesn't have this method. StringDecoder.prototype.end = function() {}; function InternalDecoder(options, codec) { StringDecoder.call(this, codec.enc); } InternalDecoder.prototype = StringDecoder.prototype; //------------------------------------------------------------------------------ // Encoder is mostly trivial function InternalEncoder(options, codec) { this.enc = codec.enc; } InternalEncoder.prototype.write = function(str) { return Buffer.from(str, this.enc); } InternalEncoder.prototype.end = function() { } //------------------------------------------------------------------------------ // Except base64 encoder, which must keep its state. function InternalEncoderBase64(options, codec) { this.prevStr = ''; } InternalEncoderBase64.prototype.write = function(str) { str = this.prevStr + str; var completeQuads = str.length - (str.length % 4); this.prevStr = str.slice(completeQuads); str = str.slice(0, completeQuads); return Buffer.from(str, "base64"); } InternalEncoderBase64.prototype.end = function() { return Buffer.from(this.prevStr, "base64"); } //------------------------------------------------------------------------------ // CESU-8 encoder is also special. function InternalEncoderCesu8(options, codec) { } InternalEncoderCesu8.prototype.write = function(str) { var buf = Buffer.alloc(str.length * 3), bufIdx = 0; for (var i = 0; i < str.length; i++) { var charCode = str.charCodeAt(i); // Naive implementation, but it works because CESU-8 is especially easy // to convert from UTF-16 (which all JS strings are encoded in). if (charCode < 0x80) buf[bufIdx++] = charCode; else if (charCode < 0x800) { buf[bufIdx++] = 0xC0 + (charCode >>> 6); buf[bufIdx++] = 0x80 + (charCode & 0x3f); } else { // charCode will always be < 0x10000 in javascript. buf[bufIdx++] = 0xE0 + (charCode >>> 12); buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f); buf[bufIdx++] = 0x80 + (charCode & 0x3f); } } return buf.slice(0, bufIdx); } InternalEncoderCesu8.prototype.end = function() { } //------------------------------------------------------------------------------ // CESU-8 decoder is not implemented in Node v4.0+ function InternalDecoderCesu8(options, codec) { this.acc = 0; this.contBytes = 0; this.accBytes = 0; this.defaultCharUnicode = codec.defaultCharUnicode; } InternalDecoderCesu8.prototype.write = function(buf) { var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes, res = ''; for (var i = 0; i < buf.length; i++) { var curByte = buf[i]; if ((curByte & 0xC0) !== 0x80) { // Leading byte if (contBytes > 0) { // Previous code is invalid res += this.defaultCharUnicode; contBytes = 0; } if (curByte < 0x80) { // Single-byte code res += String.fromCharCode(curByte); } else if (curByte < 0xE0) { // Two-byte code acc = curByte & 0x1F; contBytes = 1; accBytes = 1; } else if (curByte < 0xF0) { // Three-byte code acc = curByte & 0x0F; contBytes = 2; accBytes = 1; } else { // Four or more are not supported for CESU-8. res += this.defaultCharUnicode; } } else { // Continuation byte if (contBytes > 0) { // We're waiting for it. acc = (acc << 6) | (curByte & 0x3f); contBytes--; accBytes++; if (contBytes === 0) { // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80) if (accBytes === 2 && acc < 0x80 && acc > 0) res += this.defaultCharUnicode; else if (accBytes === 3 && acc < 0x800) res += this.defaultCharUnicode; else // Actually add character. res += String.fromCharCode(acc); } } else { // Unexpected continuation byte res += this.defaultCharUnicode; } } } this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes; return res; } InternalDecoderCesu8.prototype.end = function() { var res = 0; if (this.contBytes > 0) res += this.defaultCharUnicode; return res; } /***/ }), /* 630 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Buffer = __webpack_require__(114).Buffer; // Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js // == UTF16-BE codec. ========================================================== exports.utf16be = Utf16BECodec; function Utf16BECodec() { } Utf16BECodec.prototype.encoder = Utf16BEEncoder; Utf16BECodec.prototype.decoder = Utf16BEDecoder; Utf16BECodec.prototype.bomAware = true; // -- Encoding function Utf16BEEncoder() { } Utf16BEEncoder.prototype.write = function(str) { var buf = Buffer.from(str, 'ucs2'); for (var i = 0; i < buf.length; i += 2) { var tmp = buf[i]; buf[i] = buf[i+1]; buf[i+1] = tmp; } return buf; } Utf16BEEncoder.prototype.end = function() { } // -- Decoding function Utf16BEDecoder() { this.overflowByte = -1; } Utf16BEDecoder.prototype.write = function(buf) { if (buf.length == 0) return ''; var buf2 = Buffer.alloc(buf.length + 1), i = 0, j = 0; if (this.overflowByte !== -1) { buf2[0] = buf[0]; buf2[1] = this.overflowByte; i = 1; j = 2; } for (; i < buf.length-1; i += 2, j+= 2) { buf2[j] = buf[i+1]; buf2[j+1] = buf[i]; } this.overflowByte = (i == buf.length-1) ? buf[buf.length-1] : -1; return buf2.slice(0, j).toString('ucs2'); } Utf16BEDecoder.prototype.end = function() { } // == UTF-16 codec ============================================================= // Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic. // Defaults to UTF-16LE, as it's prevalent and default in Node. // http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le // Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'}); // Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false). exports.utf16 = Utf16Codec; function Utf16Codec(codecOptions, iconv) { this.iconv = iconv; } Utf16Codec.prototype.encoder = Utf16Encoder; Utf16Codec.prototype.decoder = Utf16Decoder; // -- Encoding (pass-through) function Utf16Encoder(options, codec) { options = options || {}; if (options.addBOM === undefined) options.addBOM = true; this.encoder = codec.iconv.getEncoder('utf-16le', options); } Utf16Encoder.prototype.write = function(str) { return this.encoder.write(str); } Utf16Encoder.prototype.end = function() { return this.encoder.end(); } // -- Decoding function Utf16Decoder(options, codec) { this.decoder = null; this.initialBytes = []; this.initialBytesLen = 0; this.options = options || {}; this.iconv = codec.iconv; } Utf16Decoder.prototype.write = function(buf) { if (!this.decoder) { // Codec is not chosen yet. Accumulate initial bytes. this.initialBytes.push(buf); this.initialBytesLen += buf.length; if (this.initialBytesLen < 16) // We need more bytes to use space heuristic (see below) return ''; // We have enough bytes -> detect endianness. var buf = Buffer.concat(this.initialBytes), encoding = detectEncoding(buf, this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(encoding, this.options); this.initialBytes.length = this.initialBytesLen = 0; } return this.decoder.write(buf); } Utf16Decoder.prototype.end = function() { if (!this.decoder) { var buf = Buffer.concat(this.initialBytes), encoding = detectEncoding(buf, this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(encoding, this.options); var res = this.decoder.write(buf), trail = this.decoder.end(); return trail ? (res + trail) : res; } return this.decoder.end(); } function detectEncoding(buf, defaultEncoding) { var enc = defaultEncoding || 'utf-16le'; if (buf.length >= 2) { // Check BOM. if (buf[0] == 0xFE && buf[1] == 0xFF) // UTF-16BE BOM enc = 'utf-16be'; else if (buf[0] == 0xFF && buf[1] == 0xFE) // UTF-16LE BOM enc = 'utf-16le'; else { // No BOM found. Try to deduce encoding from initial content. // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon. // So, we count ASCII as if it was LE or BE, and decide from that. var asciiCharsLE = 0, asciiCharsBE = 0, // Counts of chars in both positions _len = Math.min(buf.length - (buf.length % 2), 64); // Len is always even. for (var i = 0; i < _len; i += 2) { if (buf[i] === 0 && buf[i+1] !== 0) asciiCharsBE++; if (buf[i] !== 0 && buf[i+1] === 0) asciiCharsLE++; } if (asciiCharsBE > asciiCharsLE) enc = 'utf-16be'; else if (asciiCharsBE < asciiCharsLE) enc = 'utf-16le'; } } return enc; } /***/ }), /* 631 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Buffer = __webpack_require__(114).Buffer; // UTF-7 codec, according to https://tools.ietf.org/html/rfc2152 // See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3 exports.utf7 = Utf7Codec; exports.unicode11utf7 = 'utf7'; // Alias UNICODE-1-1-UTF-7 function Utf7Codec(codecOptions, iconv) { this.iconv = iconv; }; Utf7Codec.prototype.encoder = Utf7Encoder; Utf7Codec.prototype.decoder = Utf7Decoder; Utf7Codec.prototype.bomAware = true; // -- Encoding var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g; function Utf7Encoder(options, codec) { this.iconv = codec.iconv; } Utf7Encoder.prototype.write = function(str) { // Naive implementation. // Non-direct chars are encoded as "+<base64>-"; single "+" char is encoded as "+-". return Buffer.from(str.replace(nonDirectChars, function(chunk) { return "+" + (chunk === '+' ? '' : this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, '')) + "-"; }.bind(this))); } Utf7Encoder.prototype.end = function() { } // -- Decoding function Utf7Decoder(options, codec) { this.iconv = codec.iconv; this.inBase64 = false; this.base64Accum = ''; } var base64Regex = /[A-Za-z0-9\/+]/; var base64Chars = []; for (var i = 0; i < 256; i++) base64Chars[i] = base64Regex.test(String.fromCharCode(i)); var plusChar = '+'.charCodeAt(0), minusChar = '-'.charCodeAt(0), andChar = '&'.charCodeAt(0); Utf7Decoder.prototype.write = function(buf) { var res = "", lastI = 0, inBase64 = this.inBase64, base64Accum = this.base64Accum; // The decoder is more involved as we must handle chunks in stream. for (var i = 0; i < buf.length; i++) { if (!inBase64) { // We're in direct mode. // Write direct chars until '+' if (buf[i] == plusChar) { res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. lastI = i+1; inBase64 = true; } } else { // We decode base64. if (!base64Chars[buf[i]]) { // Base64 ended. if (i == lastI && buf[i] == minusChar) {// "+-" -> "+" res += "+"; } else { var b64str = base64Accum + buf.slice(lastI, i).toString(); res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); } if (buf[i] != minusChar) // Minus is absorbed after base64. i--; lastI = i+1; inBase64 = false; base64Accum = ''; } } } if (!inBase64) { res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. } else { var b64str = base64Accum + buf.slice(lastI).toString(); var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. b64str = b64str.slice(0, canBeDecoded); res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); } this.inBase64 = inBase64; this.base64Accum = base64Accum; return res; } Utf7Decoder.prototype.end = function() { var res = ""; if (this.inBase64 && this.base64Accum.length > 0) res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); this.inBase64 = false; this.base64Accum = ''; return res; } // UTF-7-IMAP codec. // RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3) // Differences: // * Base64 part is started by "&" instead of "+" // * Direct characters are 0x20-0x7E, except "&" (0x26) // * In Base64, "," is used instead of "/" // * Base64 must not be used to represent direct characters. // * No implicit shift back from Base64 (should always end with '-') // * String must end in non-shifted position. // * "-&" while in base64 is not allowed. exports.utf7imap = Utf7IMAPCodec; function Utf7IMAPCodec(codecOptions, iconv) { this.iconv = iconv; }; Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder; Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder; Utf7IMAPCodec.prototype.bomAware = true; // -- Encoding function Utf7IMAPEncoder(options, codec) { this.iconv = codec.iconv; this.inBase64 = false; this.base64Accum = Buffer.alloc(6); this.base64AccumIdx = 0; } Utf7IMAPEncoder.prototype.write = function(str) { var inBase64 = this.inBase64, base64Accum = this.base64Accum, base64AccumIdx = this.base64AccumIdx, buf = Buffer.alloc(str.length*5 + 10), bufIdx = 0; for (var i = 0; i < str.length; i++) { var uChar = str.charCodeAt(i); if (0x20 <= uChar && uChar <= 0x7E) { // Direct character or '&'. if (inBase64) { if (base64AccumIdx > 0) { bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); base64AccumIdx = 0; } buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. inBase64 = false; } if (!inBase64) { buf[bufIdx++] = uChar; // Write direct character if (uChar === andChar) // Ampersand -> '&-' buf[bufIdx++] = minusChar; } } else { // Non-direct character if (!inBase64) { buf[bufIdx++] = andChar; // Write '&', then go to base64 mode. inBase64 = true; } if (inBase64) { base64Accum[base64AccumIdx++] = uChar >> 8; base64Accum[base64AccumIdx++] = uChar & 0xFF; if (base64AccumIdx == base64Accum.length) { bufIdx += buf.write(base64Accum.toString('base64').replace(/\//g, ','), bufIdx); base64AccumIdx = 0; } } } } this.inBase64 = inBase64; this.base64AccumIdx = base64AccumIdx; return buf.slice(0, bufIdx); } Utf7IMAPEncoder.prototype.end = function() { var buf = Buffer.alloc(10), bufIdx = 0; if (this.inBase64) { if (this.base64AccumIdx > 0) { bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); this.base64AccumIdx = 0; } buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. this.inBase64 = false; } return buf.slice(0, bufIdx); } // -- Decoding function Utf7IMAPDecoder(options, codec) { this.iconv = codec.iconv; this.inBase64 = false; this.base64Accum = ''; } var base64IMAPChars = base64Chars.slice(); base64IMAPChars[','.charCodeAt(0)] = true; Utf7IMAPDecoder.prototype.write = function(buf) { var res = "", lastI = 0, inBase64 = this.inBase64, base64Accum = this.base64Accum; // The decoder is more involved as we must handle chunks in stream. // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end). for (var i = 0; i < buf.length; i++) { if (!inBase64) { // We're in direct mode. // Write direct chars until '&' if (buf[i] == andChar) { res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. lastI = i+1; inBase64 = true; } } else { // We decode base64. if (!base64IMAPChars[buf[i]]) { // Base64 ended. if (i == lastI && buf[i] == minusChar) { // "&-" -> "&" res += "&"; } else { var b64str = base64Accum + buf.slice(lastI, i).toString().replace(/,/g, '/'); res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); } if (buf[i] != minusChar) // Minus may be absorbed after base64. i--; lastI = i+1; inBase64 = false; base64Accum = ''; } } } if (!inBase64) { res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. } else { var b64str = base64Accum + buf.slice(lastI).toString().replace(/,/g, '/'); var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. b64str = b64str.slice(0, canBeDecoded); res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); } this.inBase64 = inBase64; this.base64Accum = base64Accum; return res; } Utf7IMAPDecoder.prototype.end = function() { var res = ""; if (this.inBase64 && this.base64Accum.length > 0) res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); this.inBase64 = false; this.base64Accum = ''; return res; } /***/ }), /* 632 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Buffer = __webpack_require__(114).Buffer; // Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that // correspond to encoded bytes (if 128 - then lower half is ASCII). exports._sbcs = SBCSCodec; function SBCSCodec(codecOptions, iconv) { if (!codecOptions) throw new Error("SBCS codec is called without the data.") // Prepare char buffer for decoding. if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256)) throw new Error("Encoding '"+codecOptions.type+"' has incorrect 'chars' (must be of len 128 or 256)"); if (codecOptions.chars.length === 128) { var asciiString = ""; for (var i = 0; i < 128; i++) asciiString += String.fromCharCode(i); codecOptions.chars = asciiString + codecOptions.chars; } this.decodeBuf = Buffer.from(codecOptions.chars, 'ucs2'); // Encoding buffer. var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0)); for (var i = 0; i < codecOptions.chars.length; i++) encodeBuf[codecOptions.chars.charCodeAt(i)] = i; this.encodeBuf = encodeBuf; } SBCSCodec.prototype.encoder = SBCSEncoder; SBCSCodec.prototype.decoder = SBCSDecoder; function SBCSEncoder(options, codec) { this.encodeBuf = codec.encodeBuf; } SBCSEncoder.prototype.write = function(str) { var buf = Buffer.alloc(str.length); for (var i = 0; i < str.length; i++) buf[i] = this.encodeBuf[str.charCodeAt(i)]; return buf; } SBCSEncoder.prototype.end = function() { } function SBCSDecoder(options, codec) { this.decodeBuf = codec.decodeBuf; } SBCSDecoder.prototype.write = function(buf) { // Strings are immutable in JS -> we use ucs2 buffer to speed up computations. var decodeBuf = this.decodeBuf; var newBuf = Buffer.alloc(buf.length*2); var idx1 = 0, idx2 = 0; for (var i = 0; i < buf.length; i++) { idx1 = buf[i]*2; idx2 = i*2; newBuf[idx2] = decodeBuf[idx1]; newBuf[idx2+1] = decodeBuf[idx1+1]; } return newBuf.toString('ucs2'); } SBCSDecoder.prototype.end = function() { } /***/ }), /* 633 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Manually added data to be used by sbcs codec in addition to generated one. module.exports = { // Not supported by iconv, not sure why. "10029": "maccenteuro", "maccenteuro": { "type": "_sbcs", "chars": "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ" }, "808": "cp808", "ibm808": "cp808", "cp808": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ " }, "mik": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, // Aliases of generated encodings. "ascii8bit": "ascii", "usascii": "ascii", "ansix34": "ascii", "ansix341968": "ascii", "ansix341986": "ascii", "csascii": "ascii", "cp367": "ascii", "ibm367": "ascii", "isoir6": "ascii", "iso646us": "ascii", "iso646irv": "ascii", "us": "ascii", "latin1": "iso88591", "latin2": "iso88592", "latin3": "iso88593", "latin4": "iso88594", "latin5": "iso88599", "latin6": "iso885910", "latin7": "iso885913", "latin8": "iso885914", "latin9": "iso885915", "latin10": "iso885916", "csisolatin1": "iso88591", "csisolatin2": "iso88592", "csisolatin3": "iso88593", "csisolatin4": "iso88594", "csisolatincyrillic": "iso88595", "csisolatinarabic": "iso88596", "csisolatingreek" : "iso88597", "csisolatinhebrew": "iso88598", "csisolatin5": "iso88599", "csisolatin6": "iso885910", "l1": "iso88591", "l2": "iso88592", "l3": "iso88593", "l4": "iso88594", "l5": "iso88599", "l6": "iso885910", "l7": "iso885913", "l8": "iso885914", "l9": "iso885915", "l10": "iso885916", "isoir14": "iso646jp", "isoir57": "iso646cn", "isoir100": "iso88591", "isoir101": "iso88592", "isoir109": "iso88593", "isoir110": "iso88594", "isoir144": "iso88595", "isoir127": "iso88596", "isoir126": "iso88597", "isoir138": "iso88598", "isoir148": "iso88599", "isoir157": "iso885910", "isoir166": "tis620", "isoir179": "iso885913", "isoir199": "iso885914", "isoir203": "iso885915", "isoir226": "iso885916", "cp819": "iso88591", "ibm819": "iso88591", "cyrillic": "iso88595", "arabic": "iso88596", "arabic8": "iso88596", "ecma114": "iso88596", "asmo708": "iso88596", "greek" : "iso88597", "greek8" : "iso88597", "ecma118" : "iso88597", "elot928" : "iso88597", "hebrew": "iso88598", "hebrew8": "iso88598", "turkish": "iso88599", "turkish8": "iso88599", "thai": "iso885911", "thai8": "iso885911", "celtic": "iso885914", "celtic8": "iso885914", "isoceltic": "iso885914", "tis6200": "tis620", "tis62025291": "tis620", "tis62025330": "tis620", "10000": "macroman", "10006": "macgreek", "10007": "maccyrillic", "10079": "maciceland", "10081": "macturkish", "cspc8codepage437": "cp437", "cspc775baltic": "cp775", "cspc850multilingual": "cp850", "cspcp852": "cp852", "cspc862latinhebrew": "cp862", "cpgr": "cp869", "msee": "cp1250", "mscyrl": "cp1251", "msansi": "cp1252", "msgreek": "cp1253", "msturk": "cp1254", "mshebr": "cp1255", "msarab": "cp1256", "winbaltrim": "cp1257", "cp20866": "koi8r", "20866": "koi8r", "ibm878": "koi8r", "cskoi8r": "koi8r", "cp21866": "koi8u", "21866": "koi8u", "ibm1168": "koi8u", "strk10482002": "rk1048", "tcvn5712": "tcvn", "tcvn57121": "tcvn", "gb198880": "iso646cn", "cn": "iso646cn", "csiso14jisc6220ro": "iso646jp", "jisc62201969ro": "iso646jp", "jp": "iso646jp", "cshproman8": "hproman8", "r8": "hproman8", "roman8": "hproman8", "xroman8": "hproman8", "ibm1051": "hproman8", "mac": "macintosh", "csmacintosh": "macintosh", }; /***/ }), /* 634 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script. module.exports = { "437": "cp437", "737": "cp737", "775": "cp775", "850": "cp850", "852": "cp852", "855": "cp855", "856": "cp856", "857": "cp857", "858": "cp858", "860": "cp860", "861": "cp861", "862": "cp862", "863": "cp863", "864": "cp864", "865": "cp865", "866": "cp866", "869": "cp869", "874": "windows874", "922": "cp922", "1046": "cp1046", "1124": "cp1124", "1125": "cp1125", "1129": "cp1129", "1133": "cp1133", "1161": "cp1161", "1162": "cp1162", "1163": "cp1163", "1250": "windows1250", "1251": "windows1251", "1252": "windows1252", "1253": "windows1253", "1254": "windows1254", "1255": "windows1255", "1256": "windows1256", "1257": "windows1257", "1258": "windows1258", "28591": "iso88591", "28592": "iso88592", "28593": "iso88593", "28594": "iso88594", "28595": "iso88595", "28596": "iso88596", "28597": "iso88597", "28598": "iso88598", "28599": "iso88599", "28600": "iso885910", "28601": "iso885911", "28603": "iso885913", "28604": "iso885914", "28605": "iso885915", "28606": "iso885916", "windows874": { "type": "_sbcs", "chars": "€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" }, "win874": "windows874", "cp874": "windows874", "windows1250": { "type": "_sbcs", "chars": "€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" }, "win1250": "windows1250", "cp1250": "windows1250", "windows1251": { "type": "_sbcs", "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" }, "win1251": "windows1251", "cp1251": "windows1251", "windows1252": { "type": "_sbcs", "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, "win1252": "windows1252", "cp1252": "windows1252", "windows1253": { "type": "_sbcs", "chars": "€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" }, "win1253": "windows1253", "cp1253": "windows1253", "windows1254": { "type": "_sbcs", "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" }, "win1254": "windows1254", "cp1254": "windows1254", "windows1255": { "type": "_sbcs", "chars": "€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת���" }, "win1255": "windows1255", "cp1255": "windows1255", "windows1256": { "type": "_sbcs", "chars": "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œں ،¢£¤¥¦§¨©ھ«¬®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûüے" }, "win1256": "windows1256", "cp1256": "windows1256", "windows1257": { "type": "_sbcs", "chars": "€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙" }, "win1257": "windows1257", "cp1257": "windows1257", "windows1258": { "type": "_sbcs", "chars": "€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" }, "win1258": "windows1258", "cp1258": "windows1258", "iso88591": { "type": "_sbcs", "chars": " ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, "cp28591": "iso88591", "iso88592": { "type": "_sbcs", "chars": " Ą˘Ł¤ĽŚ§¨ŠŞŤŹŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" }, "cp28592": "iso88592", "iso88593": { "type": "_sbcs", "chars": " Ħ˘£¤�Ĥ§¨İŞĞĴ�Ż°ħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙" }, "cp28593": "iso88593", "iso88594": { "type": "_sbcs", "chars": " ĄĸŖ¤ĨĻ§¨ŠĒĢŦŽ¯°ą˛ŗ´ĩļˇ¸šēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖ×ØŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙" }, "cp28594": "iso88594", "iso88595": { "type": "_sbcs", "chars": " ЁЂЃЄЅІЇЈЉЊЋЌЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ" }, "cp28595": "iso88595", "iso88596": { "type": "_sbcs", "chars": " ���¤�������،�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������" }, "cp28596": "iso88596", "iso88597": { "type": "_sbcs", "chars": " ‘’£€₯¦§¨©ͺ«¬�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" }, "cp28597": "iso88597", "iso88598": { "type": "_sbcs", "chars": " �¢£¤¥¦§¨©×«¬®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת���" }, "cp28598": "iso88598", "iso88599": { "type": "_sbcs", "chars": " ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" }, "cp28599": "iso88599", "iso885910": { "type": "_sbcs", "chars": " ĄĒĢĪĨĶ§ĻĐŠŦŽŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ" }, "cp28600": "iso885910", "iso885911": { "type": "_sbcs", "chars": " กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" }, "cp28601": "iso885911", "iso885913": { "type": "_sbcs", "chars": " ”¢£¤„¦§Ø©Ŗ«¬®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’" }, "cp28603": "iso885913", "iso885914": { "type": "_sbcs", "chars": " Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ" }, "cp28604": "iso885914", "iso885915": { "type": "_sbcs", "chars": " ¡¢£€¥Š§š©ª«¬®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, "cp28605": "iso885915", "iso885916": { "type": "_sbcs", "chars": " ĄąŁ€„Š§š©Ș«ŹźŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ" }, "cp28606": "iso885916", "cp437": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm437": "cp437", "csibm437": "cp437", "cp737": { "type": "_sbcs", "chars": "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ " }, "ibm737": "cp737", "csibm737": "cp737", "cp775": { "type": "_sbcs", "chars": "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£ØפĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’±“¾¶§÷„°∙·¹³²■ " }, "ibm775": "cp775", "csibm775": "cp775", "cp850": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´±‗¾¶§÷¸°¨·¹³²■ " }, "ibm850": "cp850", "csibm850": "cp850", "cp852": { "type": "_sbcs", "chars": "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´˝˛ˇ˘§÷¸°¨˙űŘř■ " }, "ibm852": "cp852", "csibm852": "cp852", "cp855": { "type": "_sbcs", "chars": "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№ыЫзЗшШэЭщЩчЧ§■ " }, "ibm855": "cp855", "csibm855": "cp855", "cp856": { "type": "_sbcs", "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´±‗¾¶§÷¸°¨·¹³²■ " }, "ibm856": "cp856", "csibm856": "cp856", "cp857": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´±�¾¶§÷¸°¨·¹³²■ " }, "ibm857": "cp857", "csibm857": "cp857", "cp858": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´±‗¾¶§÷¸°¨·¹³²■ " }, "ibm858": "cp858", "csibm858": "cp858", "cp860": { "type": "_sbcs", "chars": "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm860": "cp860", "csibm860": "cp860", "cp861": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm861": "cp861", "csibm861": "cp861", "cp862": { "type": "_sbcs", "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm862": "cp862", "csibm862": "cp862", "cp863": { "type": "_sbcs", "chars": "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm863": "cp863", "csibm863": "cp863", "cp864": { "type": "_sbcs", "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�" }, "ibm864": "cp864", "csibm864": "cp864", "cp865": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm865": "cp865", "csibm865": "cp865", "cp866": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ " }, "ibm866": "cp866", "csibm866": "cp866", "cp869": { "type": "_sbcs", "chars": "������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄±υφχ§ψ΅°¨ωϋΰώ■ " }, "ibm869": "cp869", "csibm869": "cp869", "cp922": { "type": "_sbcs", "chars": " ¡¢£¤¥¦§¨©ª«¬®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖ×ØÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ" }, "ibm922": "cp922", "csibm922": "cp922", "cp1046": { "type": "_sbcs", "chars": "ﺈ×÷ﹱ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�" }, "ibm1046": "cp1046", "csibm1046": "cp1046", "cp1124": { "type": "_sbcs", "chars": " ЁЂҐЄЅІЇЈЉЊЋЌЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ" }, "ibm1124": "cp1124", "csibm1124": "cp1124", "cp1125": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ " }, "ibm1125": "cp1125", "csibm1125": "cp1125", "cp1129": { "type": "_sbcs", "chars": " ¡¢£¤¥¦§œ©ª«¬®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" }, "ibm1129": "cp1129", "csibm1129": "cp1129", "cp1133": { "type": "_sbcs", "chars": " ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�" }, "ibm1133": "cp1133", "csibm1133": "cp1133", "cp1161": { "type": "_sbcs", "chars": "��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ " }, "ibm1161": "cp1161", "csibm1161": "cp1161", "cp1162": { "type": "_sbcs", "chars": "€…‘’“”•–— กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" }, "ibm1162": "cp1162", "csibm1162": "cp1162", "cp1163": { "type": "_sbcs", "chars": " ¡¢£€¥¦§œ©ª«¬®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" }, "ibm1163": "cp1163", "csibm1163": "cp1163", "maccroatian": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ" }, "maccyrillic": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" }, "macgreek": { "type": "_sbcs", "chars": "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�" }, "maciceland": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, "macroman": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, "macromania": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, "macthai": { "type": "_sbcs", "chars": "«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����" }, "macturkish": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ" }, "macukraine": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" }, "koi8r": { "type": "_sbcs", "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, "koi8u": { "type": "_sbcs", "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, "koi8ru": { "type": "_sbcs", "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, "koi8t": { "type": "_sbcs", "chars": "қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, "armscii8": { "type": "_sbcs", "chars": " �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�" }, "rk1048": { "type": "_sbcs", "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" }, "tcvn": { "type": "_sbcs", "chars": "\u0000ÚỤ\u0003ỪỬỮ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010ỨỰỲỶỸÝỴ\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ" }, "georgianacademy": { "type": "_sbcs", "chars": "‚ƒ„…†‡ˆ‰Š‹Œ‘’“”•–—˜™š›œŸ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, "georgianps": { "type": "_sbcs", "chars": "‚ƒ„…†‡ˆ‰Š‹Œ‘’“”•–—˜™š›œŸ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, "pt154": { "type": "_sbcs", "chars": "ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" }, "viscii": { "type": "_sbcs", "chars": "\u0000\u0001Ẳ\u0003\u0004ẴẪ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013Ỷ\u0015\u0016\u0017\u0018Ỹ\u001a\u001b\u001c\u001dỴ\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ" }, "iso646cn": { "type": "_sbcs", "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" }, "iso646jp": { "type": "_sbcs", "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" }, "hproman8": { "type": "_sbcs", "chars": " ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�" }, "macintosh": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, "ascii": { "type": "_sbcs", "chars": "��������������������������������������������������������������������������������������������������������������������������������" }, "tis620": { "type": "_sbcs", "chars": "���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" } } /***/ }), /* 635 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Buffer = __webpack_require__(114).Buffer; // Multibyte codec. In this scheme, a character is represented by 1 or more bytes. // Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences. // To save memory and loading time, we read table files only when requested. exports._dbcs = DBCSCodec; var UNASSIGNED = -1, GB18030_CODE = -2, SEQ_START = -10, NODE_START = -1000, UNASSIGNED_NODE = new Array(0x100), DEF_CHAR = -1; for (var i = 0; i < 0x100; i++) UNASSIGNED_NODE[i] = UNASSIGNED; // Class DBCSCodec reads and initializes mapping tables. function DBCSCodec(codecOptions, iconv) { this.encodingName = codecOptions.encodingName; if (!codecOptions) throw new Error("DBCS codec is called without the data.") if (!codecOptions.table) throw new Error("Encoding '" + this.encodingName + "' has no data."); // Load tables. var mappingTable = codecOptions.table(); // Decode tables: MBCS -> Unicode. // decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256. // Trie root is decodeTables[0]. // Values: >= 0 -> unicode character code. can be > 0xFFFF // == UNASSIGNED -> unknown/unassigned sequence. // == GB18030_CODE -> this is the end of a GB18030 4-byte sequence. // <= NODE_START -> index of the next node in our trie to process next byte. // <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq. this.decodeTables = []; this.decodeTables[0] = UNASSIGNED_NODE.slice(0); // Create root node. // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here. this.decodeTableSeq = []; // Actual mapping tables consist of chunks. Use them to fill up decode tables. for (var i = 0; i < mappingTable.length; i++) this._addDecodeChunk(mappingTable[i]); this.defaultCharUnicode = iconv.defaultCharUnicode; // Encode tables: Unicode -> DBCS. // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance. // Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null. // Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.). // == UNASSIGNED -> no conversion found. Output a default char. // <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence. this.encodeTable = []; // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key // means end of sequence (needed when one sequence is a strict subsequence of another). // Objects are kept separately from encodeTable to increase performance. this.encodeTableSeq = []; // Some chars can be decoded, but need not be encoded. var skipEncodeChars = {}; if (codecOptions.encodeSkipVals) for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) { var val = codecOptions.encodeSkipVals[i]; if (typeof val === 'number') skipEncodeChars[val] = true; else for (var j = val.from; j <= val.to; j++) skipEncodeChars[j] = true; } // Use decode trie to recursively fill out encode tables. this._fillEncodeTable(0, 0, skipEncodeChars); // Add more encoding pairs when needed. if (codecOptions.encodeAdd) { for (var uChar in codecOptions.encodeAdd) if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar)) this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]); } this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)]; if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]['?']; if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0); // Load & create GB18030 tables when needed. if (typeof codecOptions.gb18030 === 'function') { this.gb18030 = codecOptions.gb18030(); // Load GB18030 ranges. // Add GB18030 decode tables. var thirdByteNodeIdx = this.decodeTables.length; var thirdByteNode = this.decodeTables[thirdByteNodeIdx] = UNASSIGNED_NODE.slice(0); var fourthByteNodeIdx = this.decodeTables.length; var fourthByteNode = this.decodeTables[fourthByteNodeIdx] = UNASSIGNED_NODE.slice(0); for (var i = 0x81; i <= 0xFE; i++) { var secondByteNodeIdx = NODE_START - this.decodeTables[0][i]; var secondByteNode = this.decodeTables[secondByteNodeIdx]; for (var j = 0x30; j <= 0x39; j++) secondByteNode[j] = NODE_START - thirdByteNodeIdx; } for (var i = 0x81; i <= 0xFE; i++) thirdByteNode[i] = NODE_START - fourthByteNodeIdx; for (var i = 0x30; i <= 0x39; i++) fourthByteNode[i] = GB18030_CODE } } DBCSCodec.prototype.encoder = DBCSEncoder; DBCSCodec.prototype.decoder = DBCSDecoder; // Decoder helpers DBCSCodec.prototype._getDecodeTrieNode = function(addr) { var bytes = []; for (; addr > 0; addr >>= 8) bytes.push(addr & 0xFF); if (bytes.length == 0) bytes.push(0); var node = this.decodeTables[0]; for (var i = bytes.length-1; i > 0; i--) { // Traverse nodes deeper into the trie. var val = node[bytes[i]]; if (val == UNASSIGNED) { // Create new node. node[bytes[i]] = NODE_START - this.decodeTables.length; this.decodeTables.push(node = UNASSIGNED_NODE.slice(0)); } else if (val <= NODE_START) { // Existing node. node = this.decodeTables[NODE_START - val]; } else throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16)); } return node; } DBCSCodec.prototype._addDecodeChunk = function(chunk) { // First element of chunk is the hex mbcs code where we start. var curAddr = parseInt(chunk[0], 16); // Choose the decoding node where we'll write our chars. var writeTable = this._getDecodeTrieNode(curAddr); curAddr = curAddr & 0xFF; // Write all other elements of the chunk to the table. for (var k = 1; k < chunk.length; k++) { var part = chunk[k]; if (typeof part === "string") { // String, write as-is. for (var l = 0; l < part.length;) { var code = part.charCodeAt(l++); if (0xD800 <= code && code < 0xDC00) { // Decode surrogate var codeTrail = part.charCodeAt(l++); if (0xDC00 <= codeTrail && codeTrail < 0xE000) writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00); else throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]); } else if (0x0FF0 < code && code <= 0x0FFF) { // Character sequence (our own encoding used) var len = 0xFFF - code + 2; var seq = []; for (var m = 0; m < len; m++) seq.push(part.charCodeAt(l++)); // Simple variation: don't support surrogates or subsequences in seq. writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length; this.decodeTableSeq.push(seq); } else writeTable[curAddr++] = code; // Basic char } } else if (typeof part === "number") { // Integer, meaning increasing sequence starting with prev character. var charCode = writeTable[curAddr - 1] + 1; for (var l = 0; l < part; l++) writeTable[curAddr++] = charCode++; } else throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]); } if (curAddr > 0xFF) throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr); } // Encoder helpers DBCSCodec.prototype._getEncodeBucket = function(uCode) { var high = uCode >> 8; // This could be > 0xFF because of astral characters. if (this.encodeTable[high] === undefined) this.encodeTable[high] = UNASSIGNED_NODE.slice(0); // Create bucket on demand. return this.encodeTable[high]; } DBCSCodec.prototype._setEncodeChar = function(uCode, dbcsCode) { var bucket = this._getEncodeBucket(uCode); var low = uCode & 0xFF; if (bucket[low] <= SEQ_START) this.encodeTableSeq[SEQ_START-bucket[low]][DEF_CHAR] = dbcsCode; // There's already a sequence, set a single-char subsequence of it. else if (bucket[low] == UNASSIGNED) bucket[low] = dbcsCode; } DBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) { // Get the root of character tree according to first character of the sequence. var uCode = seq[0]; var bucket = this._getEncodeBucket(uCode); var low = uCode & 0xFF; var node; if (bucket[low] <= SEQ_START) { // There's already a sequence with - use it. node = this.encodeTableSeq[SEQ_START-bucket[low]]; } else { // There was no sequence object - allocate a new one. node = {}; if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low]; // If a char was set before - make it a single-char subsequence. bucket[low] = SEQ_START - this.encodeTableSeq.length; this.encodeTableSeq.push(node); } // Traverse the character tree, allocating new nodes as needed. for (var j = 1; j < seq.length-1; j++) { var oldVal = node[uCode]; if (typeof oldVal === 'object') node = oldVal; else { node = node[uCode] = {} if (oldVal !== undefined) node[DEF_CHAR] = oldVal } } // Set the leaf to given dbcsCode. uCode = seq[seq.length-1]; node[uCode] = dbcsCode; } DBCSCodec.prototype._fillEncodeTable = function(nodeIdx, prefix, skipEncodeChars) { var node = this.decodeTables[nodeIdx]; for (var i = 0; i < 0x100; i++) { var uCode = node[i]; var mbCode = prefix + i; if (skipEncodeChars[mbCode]) continue; if (uCode >= 0) this._setEncodeChar(uCode, mbCode); else if (uCode <= NODE_START) this._fillEncodeTable(NODE_START - uCode, mbCode << 8, skipEncodeChars); else if (uCode <= SEQ_START) this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode); } } // == Encoder ================================================================== function DBCSEncoder(options, codec) { // Encoder state this.leadSurrogate = -1; this.seqObj = undefined; // Static data this.encodeTable = codec.encodeTable; this.encodeTableSeq = codec.encodeTableSeq; this.defaultCharSingleByte = codec.defCharSB; this.gb18030 = codec.gb18030; } DBCSEncoder.prototype.write = function(str) { var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)), leadSurrogate = this.leadSurrogate, seqObj = this.seqObj, nextChar = -1, i = 0, j = 0; while (true) { // 0. Get next character. if (nextChar === -1) { if (i == str.length) break; var uCode = str.charCodeAt(i++); } else { var uCode = nextChar; nextChar = -1; } // 1. Handle surrogates. if (0xD800 <= uCode && uCode < 0xE000) { // Char is one of surrogates. if (uCode < 0xDC00) { // We've got lead surrogate. if (leadSurrogate === -1) { leadSurrogate = uCode; continue; } else { leadSurrogate = uCode; // Double lead surrogate found. uCode = UNASSIGNED; } } else { // We've got trail surrogate. if (leadSurrogate !== -1) { uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00); leadSurrogate = -1; } else { // Incomplete surrogate pair - only trail surrogate found. uCode = UNASSIGNED; } } } else if (leadSurrogate !== -1) { // Incomplete surrogate pair - only lead surrogate found. nextChar = uCode; uCode = UNASSIGNED; // Write an error, then current char. leadSurrogate = -1; } // 2. Convert uCode character. var dbcsCode = UNASSIGNED; if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence var resCode = seqObj[uCode]; if (typeof resCode === 'object') { // Sequence continues. seqObj = resCode; continue; } else if (typeof resCode == 'number') { // Sequence finished. Write it. dbcsCode = resCode; } else if (resCode == undefined) { // Current character is not part of the sequence. // Try default character for this sequence resCode = seqObj[DEF_CHAR]; if (resCode !== undefined) { dbcsCode = resCode; // Found. Write it. nextChar = uCode; // Current character will be written too in the next iteration. } else { // TODO: What if we have no default? (resCode == undefined) // Then, we should write first char of the sequence as-is and try the rest recursively. // Didn't do it for now because no encoding has this situation yet. // Currently, just skip the sequence and write current char. } } seqObj = undefined; } else if (uCode >= 0) { // Regular character var subtable = this.encodeTable[uCode >> 8]; if (subtable !== undefined) dbcsCode = subtable[uCode & 0xFF]; if (dbcsCode <= SEQ_START) { // Sequence start seqObj = this.encodeTableSeq[SEQ_START-dbcsCode]; continue; } if (dbcsCode == UNASSIGNED && this.gb18030) { // Use GB18030 algorithm to find character(s) to write. var idx = findIdx(this.gb18030.uChars, uCode); if (idx != -1) { var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]); newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600); dbcsCode = dbcsCode % 12600; newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260); dbcsCode = dbcsCode % 1260; newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10); dbcsCode = dbcsCode % 10; newBuf[j++] = 0x30 + dbcsCode; continue; } } } // 3. Write dbcsCode character. if (dbcsCode === UNASSIGNED) dbcsCode = this.defaultCharSingleByte; if (dbcsCode < 0x100) { newBuf[j++] = dbcsCode; } else if (dbcsCode < 0x10000) { newBuf[j++] = dbcsCode >> 8; // high byte newBuf[j++] = dbcsCode & 0xFF; // low byte } else { newBuf[j++] = dbcsCode >> 16; newBuf[j++] = (dbcsCode >> 8) & 0xFF; newBuf[j++] = dbcsCode & 0xFF; } } this.seqObj = seqObj; this.leadSurrogate = leadSurrogate; return newBuf.slice(0, j); } DBCSEncoder.prototype.end = function() { if (this.leadSurrogate === -1 && this.seqObj === undefined) return; // All clean. Most often case. var newBuf = Buffer.alloc(10), j = 0; if (this.seqObj) { // We're in the sequence. var dbcsCode = this.seqObj[DEF_CHAR]; if (dbcsCode !== undefined) { // Write beginning of the sequence. if (dbcsCode < 0x100) { newBuf[j++] = dbcsCode; } else { newBuf[j++] = dbcsCode >> 8; // high byte newBuf[j++] = dbcsCode & 0xFF; // low byte } } else { // See todo above. } this.seqObj = undefined; } if (this.leadSurrogate !== -1) { // Incomplete surrogate pair - only lead surrogate found. newBuf[j++] = this.defaultCharSingleByte; this.leadSurrogate = -1; } return newBuf.slice(0, j); } // Export for testing DBCSEncoder.prototype.findIdx = findIdx; // == Decoder ================================================================== function DBCSDecoder(options, codec) { // Decoder state this.nodeIdx = 0; this.prevBuf = Buffer.alloc(0); // Static data this.decodeTables = codec.decodeTables; this.decodeTableSeq = codec.decodeTableSeq; this.defaultCharUnicode = codec.defaultCharUnicode; this.gb18030 = codec.gb18030; } DBCSDecoder.prototype.write = function(buf) { var newBuf = Buffer.alloc(buf.length*2), nodeIdx = this.nodeIdx, prevBuf = this.prevBuf, prevBufOffset = this.prevBuf.length, seqStart = -this.prevBuf.length, // idx of the start of current parsed sequence. uCode; if (prevBufOffset > 0) // Make prev buf overlap a little to make it easier to slice later. prevBuf = Buffer.concat([prevBuf, buf.slice(0, 10)]); for (var i = 0, j = 0; i < buf.length; i++) { var curByte = (i >= 0) ? buf[i] : prevBuf[i + prevBufOffset]; // Lookup in current trie node. var uCode = this.decodeTables[nodeIdx][curByte]; if (uCode >= 0) { // Normal character, just use it. } else if (uCode === UNASSIGNED) { // Unknown char. // TODO: Callback with seq. //var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset); i = seqStart; // Try to parse again, after skipping first byte of the sequence ('i' will be incremented by 'for' cycle). uCode = this.defaultCharUnicode.charCodeAt(0); } else if (uCode === GB18030_CODE) { var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset); var ptr = (curSeq[0]-0x81)*12600 + (curSeq[1]-0x30)*1260 + (curSeq[2]-0x81)*10 + (curSeq[3]-0x30); var idx = findIdx(this.gb18030.gbChars, ptr); uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx]; } else if (uCode <= NODE_START) { // Go to next trie node. nodeIdx = NODE_START - uCode; continue; } else if (uCode <= SEQ_START) { // Output a sequence of chars. var seq = this.decodeTableSeq[SEQ_START - uCode]; for (var k = 0; k < seq.length - 1; k++) { uCode = seq[k]; newBuf[j++] = uCode & 0xFF; newBuf[j++] = uCode >> 8; } uCode = seq[seq.length-1]; } else throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte); // Write the character to buffer, handling higher planes using surrogate pair. if (uCode > 0xFFFF) { uCode -= 0x10000; var uCodeLead = 0xD800 + Math.floor(uCode / 0x400); newBuf[j++] = uCodeLead & 0xFF; newBuf[j++] = uCodeLead >> 8; uCode = 0xDC00 + uCode % 0x400; } newBuf[j++] = uCode & 0xFF; newBuf[j++] = uCode >> 8; // Reset trie node. nodeIdx = 0; seqStart = i+1; } this.nodeIdx = nodeIdx; this.prevBuf = (seqStart >= 0) ? buf.slice(seqStart) : prevBuf.slice(seqStart + prevBufOffset); return newBuf.slice(0, j).toString('ucs2'); } DBCSDecoder.prototype.end = function() { var ret = ''; // Try to parse all remaining chars. while (this.prevBuf.length > 0) { // Skip 1 character in the buffer. ret += this.defaultCharUnicode; var buf = this.prevBuf.slice(1); // Parse remaining as usual. this.prevBuf = Buffer.alloc(0); this.nodeIdx = 0; if (buf.length > 0) ret += this.write(buf); } this.nodeIdx = 0; return ret; } // Binary search for GB18030. Returns largest i such that table[i] <= val. function findIdx(table, val) { if (table[0] > val) return -1; var l = 0, r = table.length; while (l < r-1) { // always table[l] <= val < table[r] var mid = l + Math.floor((r-l+1)/2); if (table[mid] <= val) l = mid; else r = mid; } return l; } /***/ }), /* 636 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Description of supported double byte encodings and aliases. // Tables are not require()-d until they are needed to speed up library load. // require()-s are direct to support Browserify. module.exports = { // == Japanese/ShiftJIS ==================================================== // All japanese encodings are based on JIS X set of standards: // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF. // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. // Has several variations in 1978, 1983, 1990 and 1997. // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead. // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233. // 2 planes, first is superset of 0208, second - revised 0212. // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx) // Byte encodings are: // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC. // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI. // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes. // 0x00-0x7F - lower part of 0201 // 0x8E, 0xA1-0xDF - upper part of 0201 // (0xA1-0xFE)x2 - 0208 plane (94x94). // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94). // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon. // Used as-is in ISO2022 family. // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, // 0201-1976 Roman, 0208-1978, 0208-1983. // * ISO2022-JP-1: Adds esc seq for 0212-1990. // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7. // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2. // * ISO2022-JP-2004: Adds 0213-2004 Plane 1. // // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes. // // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html 'shiftjis': { type: '_dbcs', table: function() { return __webpack_require__(637) }, encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, encodeSkipVals: [{from: 0xED40, to: 0xF940}], }, 'csshiftjis': 'shiftjis', 'mskanji': 'shiftjis', 'sjis': 'shiftjis', 'windows31j': 'shiftjis', 'ms31j': 'shiftjis', 'xsjis': 'shiftjis', 'windows932': 'shiftjis', 'ms932': 'shiftjis', '932': 'shiftjis', 'cp932': 'shiftjis', 'eucjp': { type: '_dbcs', table: function() { return __webpack_require__(638) }, encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, }, // TODO: KDDI extension to Shift_JIS // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes. // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars. // == Chinese/GBK ========================================================== // http://en.wikipedia.org/wiki/GBK // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936 'gb2312': 'cp936', 'gb231280': 'cp936', 'gb23121980': 'cp936', 'csgb2312': 'cp936', 'csiso58gb231280': 'cp936', 'euccn': 'cp936', // Microsoft's CP936 is a subset and approximation of GBK. 'windows936': 'cp936', 'ms936': 'cp936', '936': 'cp936', 'cp936': { type: '_dbcs', table: function() { return __webpack_require__(639) }, }, // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other. 'gbk': { type: '_dbcs', table: function() { return __webpack_require__(639).concat(__webpack_require__(640)) }, }, 'xgbk': 'gbk', 'isoir58': 'gbk', // GB18030 is an algorithmic extension of GBK. // Main source: https://www.w3.org/TR/encoding/#gbk-encoder // http://icu-project.org/docs/papers/gb18030.html // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0 'gb18030': { type: '_dbcs', table: function() { return __webpack_require__(639).concat(__webpack_require__(640)) }, gb18030: function() { return __webpack_require__(641) }, encodeSkipVals: [0x80], encodeAdd: {'€': 0xA2E3}, }, 'chinese': 'gb18030', // == Korean =============================================================== // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same. 'windows949': 'cp949', 'ms949': 'cp949', '949': 'cp949', 'cp949': { type: '_dbcs', table: function() { return __webpack_require__(642) }, }, 'cseuckr': 'cp949', 'csksc56011987': 'cp949', 'euckr': 'cp949', 'isoir149': 'cp949', 'korean': 'cp949', 'ksc56011987': 'cp949', 'ksc56011989': 'cp949', 'ksc5601': 'cp949', // == Big5/Taiwan/Hong Kong ================================================ // There are lots of tables for Big5 and cp950. Please see the following links for history: // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html // Variations, in roughly number of defined chars: // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/ // * Big5-2003 (Taiwan standard) almost superset of cp950. // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers. // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years. // Plus, it has 4 combining sequences. // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299 // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way. // Implementations are not consistent within browsers; sometimes labeled as just big5. // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied. // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31 // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s. // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt // // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong. 'windows950': 'cp950', 'ms950': 'cp950', '950': 'cp950', 'cp950': { type: '_dbcs', table: function() { return __webpack_require__(643) }, }, // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus. 'big5': 'big5hkscs', 'big5hkscs': { type: '_dbcs', table: function() { return __webpack_require__(643).concat(__webpack_require__(644)) }, encodeSkipVals: [0xa2cc], }, 'cnbig5': 'big5hkscs', 'csbig5': 'big5hkscs', 'xxbig5': 'big5hkscs', }; /***/ }), /* 637 */ /***/ (function(module) { module.exports = JSON.parse("[[\"0\",\"\\u0000\",128],[\"a1\",\"。\",62],[\"8140\",\" 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈\",9,\"+-±×\"],[\"8180\",\"÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓\"],[\"81b8\",\"∈∋⊆⊇⊂⊃∪∩\"],[\"81c8\",\"∧∨¬⇒⇔∀∃\"],[\"81da\",\"∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬\"],[\"81f0\",\"ʼn♯♭♪†‡¶\"],[\"81fc\",\"◯\"],[\"824f\",\"0\",9],[\"8260\",\"A\",25],[\"8281\",\"a\",25],[\"829f\",\"ぁ\",82],[\"8340\",\"ァ\",62],[\"8380\",\"ム\",22],[\"839f\",\"Α\",16,\"Σ\",6],[\"83bf\",\"α\",16,\"σ\",6],[\"8440\",\"А\",5,\"ЁЖ\",25],[\"8470\",\"а\",5,\"ёж\",7],[\"8480\",\"о\",17],[\"849f\",\"─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂\"],[\"8740\",\"①\",19,\"Ⅰ\",9],[\"875f\",\"㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡\"],[\"877e\",\"㍻\"],[\"8780\",\"〝〟№㏍℡㊤\",4,\"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪\"],[\"889f\",\"亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭\"],[\"8940\",\"院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円\"],[\"8980\",\"園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改\"],[\"8a40\",\"魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫\"],[\"8a80\",\"橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄\"],[\"8b40\",\"機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救\"],[\"8b80\",\"朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈\"],[\"8c40\",\"掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨\"],[\"8c80\",\"劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向\"],[\"8d40\",\"后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降\"],[\"8d80\",\"項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷\"],[\"8e40\",\"察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止\"],[\"8e80\",\"死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周\"],[\"8f40\",\"宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳\"],[\"8f80\",\"準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾\"],[\"9040\",\"拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨\"],[\"9080\",\"逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線\"],[\"9140\",\"繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻\"],[\"9180\",\"操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只\"],[\"9240\",\"叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄\"],[\"9280\",\"逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓\"],[\"9340\",\"邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬\"],[\"9380\",\"凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入\"],[\"9440\",\"如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅\"],[\"9480\",\"楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美\"],[\"9540\",\"鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷\"],[\"9580\",\"斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋\"],[\"9640\",\"法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆\"],[\"9680\",\"摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒\"],[\"9740\",\"諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲\"],[\"9780\",\"沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯\"],[\"9840\",\"蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕\"],[\"989f\",\"弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲\"],[\"9940\",\"僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭\"],[\"9980\",\"凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨\"],[\"9a40\",\"咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸\"],[\"9a80\",\"噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩\"],[\"9b40\",\"奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀\"],[\"9b80\",\"它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏\"],[\"9c40\",\"廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠\"],[\"9c80\",\"怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛\"],[\"9d40\",\"戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫\"],[\"9d80\",\"捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼\"],[\"9e40\",\"曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎\"],[\"9e80\",\"梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣\"],[\"9f40\",\"檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯\"],[\"9f80\",\"麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌\"],[\"e040\",\"漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝\"],[\"e080\",\"烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱\"],[\"e140\",\"瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿\"],[\"e180\",\"痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬\"],[\"e240\",\"磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰\"],[\"e280\",\"窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆\"],[\"e340\",\"紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷\"],[\"e380\",\"縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋\"],[\"e440\",\"隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤\"],[\"e480\",\"艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈\"],[\"e540\",\"蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬\"],[\"e580\",\"蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞\"],[\"e640\",\"襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧\"],[\"e680\",\"諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊\"],[\"e740\",\"蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜\"],[\"e780\",\"轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮\"],[\"e840\",\"錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙\"],[\"e880\",\"閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰\"],[\"e940\",\"顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃\"],[\"e980\",\"騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈\"],[\"ea40\",\"鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯\"],[\"ea80\",\"黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠堯槇遙瑤凜熙\"],[\"ed40\",\"纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏\"],[\"ed80\",\"塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱\"],[\"ee40\",\"犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙\"],[\"ee80\",\"蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑\"],[\"eeef\",\"ⅰ\",9,\"¬¦'"\"],[\"f040\",\"\",62],[\"f080\",\"\",124],[\"f140\",\"\",62],[\"f180\",\"\",124],[\"f240\",\"\",62],[\"f280\",\"\",124],[\"f340\",\"\",62],[\"f380\",\"\",124],[\"f440\",\"\",62],[\"f480\",\"\",124],[\"f540\",\"\",62],[\"f580\",\"\",124],[\"f640\",\"\",62],[\"f680\",\"\",124],[\"f740\",\"\",62],[\"f780\",\"\",124],[\"f840\",\"\",62],[\"f880\",\"\",124],[\"f940\",\"\"],[\"fa40\",\"ⅰ\",9,\"Ⅰ\",9,\"¬¦'"㈱№℡∵纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊\"],[\"fa80\",\"兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯\"],[\"fb40\",\"涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神\"],[\"fb80\",\"祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙\"],[\"fc40\",\"髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑\"]]"); /***/ }), /* 638 */ /***/ (function(module) { module.exports = JSON.parse("[[\"0\",\"\\u0000\",127],[\"8ea1\",\"。\",62],[\"a1a1\",\" 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈\",9,\"+-±×÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇\"],[\"a2a1\",\"◆□■△▲▽▼※〒→←↑↓〓\"],[\"a2ba\",\"∈∋⊆⊇⊂⊃∪∩\"],[\"a2ca\",\"∧∨¬⇒⇔∀∃\"],[\"a2dc\",\"∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬\"],[\"a2f2\",\"ʼn♯♭♪†‡¶\"],[\"a2fe\",\"◯\"],[\"a3b0\",\"0\",9],[\"a3c1\",\"A\",25],[\"a3e1\",\"a\",25],[\"a4a1\",\"ぁ\",82],[\"a5a1\",\"ァ\",85],[\"a6a1\",\"Α\",16,\"Σ\",6],[\"a6c1\",\"α\",16,\"σ\",6],[\"a7a1\",\"А\",5,\"ЁЖ\",25],[\"a7d1\",\"а\",5,\"ёж\",25],[\"a8a1\",\"─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂\"],[\"ada1\",\"①\",19,\"Ⅰ\",9],[\"adc0\",\"㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡\"],[\"addf\",\"㍻〝〟№㏍℡㊤\",4,\"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪\"],[\"b0a1\",\"亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭\"],[\"b1a1\",\"院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応\"],[\"b2a1\",\"押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改\"],[\"b3a1\",\"魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱\"],[\"b4a1\",\"粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄\"],[\"b5a1\",\"機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京\"],[\"b6a1\",\"供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈\"],[\"b7a1\",\"掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲\"],[\"b8a1\",\"検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向\"],[\"b9a1\",\"后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込\"],[\"baa1\",\"此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷\"],[\"bba1\",\"察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時\"],[\"bca1\",\"次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周\"],[\"bda1\",\"宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償\"],[\"bea1\",\"勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾\"],[\"bfa1\",\"拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾\"],[\"c0a1\",\"澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線\"],[\"c1a1\",\"繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎\"],[\"c2a1\",\"臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只\"],[\"c3a1\",\"叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵\"],[\"c4a1\",\"帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓\"],[\"c5a1\",\"邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到\"],[\"c6a1\",\"董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入\"],[\"c7a1\",\"如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦\"],[\"c8a1\",\"函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美\"],[\"c9a1\",\"鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服\"],[\"caa1\",\"福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋\"],[\"cba1\",\"法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満\"],[\"cca1\",\"漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒\"],[\"cda1\",\"諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃\"],[\"cea1\",\"痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯\"],[\"cfa1\",\"蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕\"],[\"d0a1\",\"弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲\"],[\"d1a1\",\"僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨\"],[\"d2a1\",\"辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨\"],[\"d3a1\",\"咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉\"],[\"d4a1\",\"圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩\"],[\"d5a1\",\"奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓\"],[\"d6a1\",\"屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏\"],[\"d7a1\",\"廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚\"],[\"d8a1\",\"悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛\"],[\"d9a1\",\"戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼\"],[\"daa1\",\"據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼\"],[\"dba1\",\"曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍\"],[\"dca1\",\"棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣\"],[\"dda1\",\"檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾\"],[\"dea1\",\"沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌\"],[\"dfa1\",\"漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼\"],[\"e0a1\",\"燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱\"],[\"e1a1\",\"瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰\"],[\"e2a1\",\"癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬\"],[\"e3a1\",\"磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐\"],[\"e4a1\",\"筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆\"],[\"e5a1\",\"紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺\"],[\"e6a1\",\"罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋\"],[\"e7a1\",\"隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙\"],[\"e8a1\",\"茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈\"],[\"e9a1\",\"蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙\"],[\"eaa1\",\"蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞\"],[\"eba1\",\"襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫\"],[\"eca1\",\"譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊\"],[\"eda1\",\"蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸\"],[\"eea1\",\"遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮\"],[\"efa1\",\"錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞\"],[\"f0a1\",\"陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰\"],[\"f1a1\",\"顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷\"],[\"f2a1\",\"髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈\"],[\"f3a1\",\"鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠\"],[\"f4a1\",\"堯槇遙瑤凜熙\"],[\"f9a1\",\"纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德\"],[\"faa1\",\"忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱\"],[\"fba1\",\"犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚\"],[\"fca1\",\"釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑\"],[\"fcf1\",\"ⅰ\",9,\"¬¦'"\"],[\"8fa2af\",\"˘ˇ¸˙˝¯˛˚~΄΅\"],[\"8fa2c2\",\"¡¦¿\"],[\"8fa2eb\",\"ºª©®™¤№\"],[\"8fa6e1\",\"ΆΈΉΊΪ\"],[\"8fa6e7\",\"Ό\"],[\"8fa6e9\",\"ΎΫ\"],[\"8fa6ec\",\"Ώ\"],[\"8fa6f1\",\"άέήίϊΐόςύϋΰώ\"],[\"8fa7c2\",\"Ђ\",10,\"ЎЏ\"],[\"8fa7f2\",\"ђ\",10,\"ўџ\"],[\"8fa9a1\",\"ÆĐ\"],[\"8fa9a4\",\"Ħ\"],[\"8fa9a6\",\"IJ\"],[\"8fa9a8\",\"ŁĿ\"],[\"8fa9ab\",\"ŊØŒ\"],[\"8fa9af\",\"ŦÞ\"],[\"8fa9c1\",\"æđðħıijĸłŀʼnŋøœßŧþ\"],[\"8faaa1\",\"ÁÀÄÂĂǍĀĄÅÃĆĈČÇĊĎÉÈËÊĚĖĒĘ\"],[\"8faaba\",\"ĜĞĢĠĤÍÌÏÎǏİĪĮĨĴĶĹĽĻŃŇŅÑÓÒÖÔǑŐŌÕŔŘŖŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙǕŴÝŸŶŹŽŻ\"],[\"8faba1\",\"áàäâăǎāąåãćĉčçċďéèëêěėēęǵĝğ\"],[\"8fabbd\",\"ġĥíìïîǐ\"],[\"8fabc5\",\"īįĩĵķĺľļńňņñóòöôǒőōõŕřŗśŝšşťţúùüûŭǔűūųůũǘǜǚǖŵýÿŷźžż\"],[\"8fb0a1\",\"丂丄丅丌丒丟丣两丨丫丮丯丰丵乀乁乄乇乑乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘佟佣佪佬佮佱佷佸佹佺佽佾侁侂侄\"],[\"8fb1a1\",\"侅侉侊侌侎侐侒侓侔侗侙侚侞侟侲侷侹侻侼侽侾俀俁俅俆俈俉俋俌俍俏俒俜俠俢俰俲俼俽俿倀倁倄倇倊倌倎倐倓倗倘倛倜倝倞倢倧倮倰倲倳倵偀偁偂偅偆偊偌偎偑偒偓偗偙偟偠偢偣偦偧偪偭偰偱倻傁傃傄傆傊傎傏傐\"],[\"8fb2a1\",\"傒傓傔傖傛傜傞\",4,\"傪傯傰傹傺傽僀僃僄僇僌僎僐僓僔僘僜僝僟僢僤僦僨僩僯僱僶僺僾儃儆儇儈儋儌儍儎僲儐儗儙儛儜儝儞儣儧儨儬儭儯儱儳儴儵儸儹兂兊兏兓兕兗兘兟兤兦兾冃冄冋冎冘冝冡冣冭冸冺冼冾冿凂\"],[\"8fb3a1\",\"凈减凑凒凓凕凘凞凢凥凮凲凳凴凷刁刂刅划刓刕刖刘刢刨刱刲刵刼剅剉剕剗剘剚剜剟剠剡剦剮剷剸剹劀劂劅劊劌劓劕劖劗劘劚劜劤劥劦劧劯劰劶劷劸劺劻劽勀勄勆勈勌勏勑勔勖勛勜勡勥勨勩勪勬勰勱勴勶勷匀匃匊匋\"],[\"8fb4a1\",\"匌匑匓匘匛匜匞匟匥匧匨匩匫匬匭匰匲匵匼匽匾卂卌卋卙卛卡卣卥卬卭卲卹卾厃厇厈厎厓厔厙厝厡厤厪厫厯厲厴厵厷厸厺厽叀叅叏叒叓叕叚叝叞叠另叧叵吂吓吚吡吧吨吪启吱吴吵呃呄呇呍呏呞呢呤呦呧呩呫呭呮呴呿\"],[\"8fb5a1\",\"咁咃咅咈咉咍咑咕咖咜咟咡咦咧咩咪咭咮咱咷咹咺咻咿哆哊响哎哠哪哬哯哶哼哾哿唀唁唅唈唉唌唍唎唕唪唫唲唵唶唻唼唽啁啇啉啊啍啐啑啘啚啛啞啠啡啤啦啿喁喂喆喈喎喏喑喒喓喔喗喣喤喭喲喿嗁嗃嗆嗉嗋嗌嗎嗑嗒\"],[\"8fb6a1\",\"嗓嗗嗘嗛嗞嗢嗩嗶嗿嘅嘈嘊嘍\",5,\"嘙嘬嘰嘳嘵嘷嘹嘻嘼嘽嘿噀噁噃噄噆噉噋噍噏噔噞噠噡噢噣噦噩噭噯噱噲噵嚄嚅嚈嚋嚌嚕嚙嚚嚝嚞嚟嚦嚧嚨嚩嚫嚬嚭嚱嚳嚷嚾囅囉囊囋囏囐囌囍囙囜囝囟囡囤\",4,\"囱囫园\"],[\"8fb7a1\",\"囶囷圁圂圇圊圌圑圕圚圛圝圠圢圣圤圥圩圪圬圮圯圳圴圽圾圿坅坆坌坍坒坢坥坧坨坫坭\",4,\"坳坴坵坷坹坺坻坼坾垁垃垌垔垗垙垚垜垝垞垟垡垕垧垨垩垬垸垽埇埈埌埏埕埝埞埤埦埧埩埭埰埵埶埸埽埾埿堃堄堈堉埡\"],[\"8fb8a1\",\"堌堍堛堞堟堠堦堧堭堲堹堿塉塌塍塏塐塕塟塡塤塧塨塸塼塿墀墁墇墈墉墊墌墍墏墐墔墖墝墠墡墢墦墩墱墲壄墼壂壈壍壎壐壒壔壖壚壝壡壢壩壳夅夆夋夌夒夓夔虁夝夡夣夤夨夯夰夳夵夶夿奃奆奒奓奙奛奝奞奟奡奣奫奭\"],[\"8fb9a1\",\"奯奲奵奶她奻奼妋妌妎妒妕妗妟妤妧妭妮妯妰妳妷妺妼姁姃姄姈姊姍姒姝姞姟姣姤姧姮姯姱姲姴姷娀娄娌娍娎娒娓娞娣娤娧娨娪娭娰婄婅婇婈婌婐婕婞婣婥婧婭婷婺婻婾媋媐媓媖媙媜媞媟媠媢媧媬媱媲媳媵媸媺媻媿\"],[\"8fbaa1\",\"嫄嫆嫈嫏嫚嫜嫠嫥嫪嫮嫵嫶嫽嬀嬁嬈嬗嬴嬙嬛嬝嬡嬥嬭嬸孁孋孌孒孖孞孨孮孯孼孽孾孿宁宄宆宊宎宐宑宓宔宖宨宩宬宭宯宱宲宷宺宼寀寁寍寏寖\",4,\"寠寯寱寴寽尌尗尞尟尣尦尩尫尬尮尰尲尵尶屙屚屜屢屣屧屨屩\"],[\"8fbba1\",\"屭屰屴屵屺屻屼屽岇岈岊岏岒岝岟岠岢岣岦岪岲岴岵岺峉峋峒峝峗峮峱峲峴崁崆崍崒崫崣崤崦崧崱崴崹崽崿嵂嵃嵆嵈嵕嵑嵙嵊嵟嵠嵡嵢嵤嵪嵭嵰嵹嵺嵾嵿嶁嶃嶈嶊嶒嶓嶔嶕嶙嶛嶟嶠嶧嶫嶰嶴嶸嶹巃巇巋巐巎巘巙巠巤\"],[\"8fbca1\",\"巩巸巹帀帇帍帒帔帕帘帟帠帮帨帲帵帾幋幐幉幑幖幘幛幜幞幨幪\",4,\"幰庀庋庎庢庤庥庨庪庬庱庳庽庾庿廆廌廋廎廑廒廔廕廜廞廥廫异弆弇弈弎弙弜弝弡弢弣弤弨弫弬弮弰弴弶弻弽弿彀彄彅彇彍彐彔彘彛彠彣彤彧\"],[\"8fbda1\",\"彯彲彴彵彸彺彽彾徉徍徏徖徜徝徢徧徫徤徬徯徰徱徸忄忇忈忉忋忐\",4,\"忞忡忢忨忩忪忬忭忮忯忲忳忶忺忼怇怊怍怓怔怗怘怚怟怤怭怳怵恀恇恈恉恌恑恔恖恗恝恡恧恱恾恿悂悆悈悊悎悑悓悕悘悝悞悢悤悥您悰悱悷\"],[\"8fbea1\",\"悻悾惂惄惈惉惊惋惎惏惔惕惙惛惝惞惢惥惲惵惸惼惽愂愇愊愌愐\",4,\"愖愗愙愜愞愢愪愫愰愱愵愶愷愹慁慅慆慉慞慠慬慲慸慻慼慿憀憁憃憄憋憍憒憓憗憘憜憝憟憠憥憨憪憭憸憹憼懀懁懂懎懏懕懜懝懞懟懡懢懧懩懥\"],[\"8fbfa1\",\"懬懭懯戁戃戄戇戓戕戜戠戢戣戧戩戫戹戽扂扃扄扆扌扐扑扒扔扖扚扜扤扭扯扳扺扽抍抎抏抐抦抨抳抶抷抺抾抿拄拎拕拖拚拪拲拴拼拽挃挄挊挋挍挐挓挖挘挩挪挭挵挶挹挼捁捂捃捄捆捊捋捎捒捓捔捘捛捥捦捬捭捱捴捵\"],[\"8fc0a1\",\"捸捼捽捿掂掄掇掊掐掔掕掙掚掞掤掦掭掮掯掽揁揅揈揎揑揓揔揕揜揠揥揪揬揲揳揵揸揹搉搊搐搒搔搘搞搠搢搤搥搩搪搯搰搵搽搿摋摏摑摒摓摔摚摛摜摝摟摠摡摣摭摳摴摻摽撅撇撏撐撑撘撙撛撝撟撡撣撦撨撬撳撽撾撿\"],[\"8fc1a1\",\"擄擉擊擋擌擎擐擑擕擗擤擥擩擪擭擰擵擷擻擿攁攄攈攉攊攏攓攔攖攙攛攞攟攢攦攩攮攱攺攼攽敃敇敉敐敒敔敟敠敧敫敺敽斁斅斊斒斕斘斝斠斣斦斮斲斳斴斿旂旈旉旎旐旔旖旘旟旰旲旴旵旹旾旿昀昄昈昉昍昑昒昕昖昝\"],[\"8fc2a1\",\"昞昡昢昣昤昦昩昪昫昬昮昰昱昳昹昷晀晅晆晊晌晑晎晗晘晙晛晜晠晡曻晪晫晬晾晳晵晿晷晸晹晻暀晼暋暌暍暐暒暙暚暛暜暟暠暤暭暱暲暵暻暿曀曂曃曈曌曎曏曔曛曟曨曫曬曮曺朅朇朎朓朙朜朠朢朳朾杅杇杈杌杔杕杝\"],[\"8fc3a1\",\"杦杬杮杴杶杻极构枎枏枑枓枖枘枙枛枰枱枲枵枻枼枽柹柀柂柃柅柈柉柒柗柙柜柡柦柰柲柶柷桒栔栙栝栟栨栧栬栭栯栰栱栳栻栿桄桅桊桌桕桗桘桛桫桮\",4,\"桵桹桺桻桼梂梄梆梈梖梘梚梜梡梣梥梩梪梮梲梻棅棈棌棏\"],[\"8fc4a1\",\"棐棑棓棖棙棜棝棥棨棪棫棬棭棰棱棵棶棻棼棽椆椉椊椐椑椓椖椗椱椳椵椸椻楂楅楉楎楗楛楣楤楥楦楨楩楬楰楱楲楺楻楿榀榍榒榖榘榡榥榦榨榫榭榯榷榸榺榼槅槈槑槖槗槢槥槮槯槱槳槵槾樀樁樃樏樑樕樚樝樠樤樨樰樲\"],[\"8fc5a1\",\"樴樷樻樾樿橅橆橉橊橎橐橑橒橕橖橛橤橧橪橱橳橾檁檃檆檇檉檋檑檛檝檞檟檥檫檯檰檱檴檽檾檿櫆櫉櫈櫌櫐櫔櫕櫖櫜櫝櫤櫧櫬櫰櫱櫲櫼櫽欂欃欆欇欉欏欐欑欗欛欞欤欨欫欬欯欵欶欻欿歆歊歍歒歖歘歝歠歧歫歮歰歵歽\"],[\"8fc6a1\",\"歾殂殅殗殛殟殠殢殣殨殩殬殭殮殰殸殹殽殾毃毄毉毌毖毚毡毣毦毧毮毱毷毹毿氂氄氅氉氍氎氐氒氙氟氦氧氨氬氮氳氵氶氺氻氿汊汋汍汏汒汔汙汛汜汫汭汯汴汶汸汹汻沅沆沇沉沔沕沗沘沜沟沰沲沴泂泆泍泏泐泑泒泔泖\"],[\"8fc7a1\",\"泚泜泠泧泩泫泬泮泲泴洄洇洊洎洏洑洓洚洦洧洨汧洮洯洱洹洼洿浗浞浟浡浥浧浯浰浼涂涇涑涒涔涖涗涘涪涬涴涷涹涽涿淄淈淊淎淏淖淛淝淟淠淢淥淩淯淰淴淶淼渀渄渞渢渧渲渶渹渻渼湄湅湈湉湋湏湑湒湓湔湗湜湝湞\"],[\"8fc8a1\",\"湢湣湨湳湻湽溍溓溙溠溧溭溮溱溳溻溿滀滁滃滇滈滊滍滎滏滫滭滮滹滻滽漄漈漊漌漍漖漘漚漛漦漩漪漯漰漳漶漻漼漭潏潑潒潓潗潙潚潝潞潡潢潨潬潽潾澃澇澈澋澌澍澐澒澓澔澖澚澟澠澥澦澧澨澮澯澰澵澶澼濅濇濈濊\"],[\"8fc9a1\",\"濚濞濨濩濰濵濹濼濽瀀瀅瀆瀇瀍瀗瀠瀣瀯瀴瀷瀹瀼灃灄灈灉灊灋灔灕灝灞灎灤灥灬灮灵灶灾炁炅炆炔\",4,\"炛炤炫炰炱炴炷烊烑烓烔烕烖烘烜烤烺焃\",4,\"焋焌焏焞焠焫焭焯焰焱焸煁煅煆煇煊煋煐煒煗煚煜煞煠\"],[\"8fcaa1\",\"煨煹熀熅熇熌熒熚熛熠熢熯熰熲熳熺熿燀燁燄燋燌燓燖燙燚燜燸燾爀爇爈爉爓爗爚爝爟爤爫爯爴爸爹牁牂牃牅牎牏牐牓牕牖牚牜牞牠牣牨牫牮牯牱牷牸牻牼牿犄犉犍犎犓犛犨犭犮犱犴犾狁狇狉狌狕狖狘狟狥狳狴狺狻\"],[\"8fcba1\",\"狾猂猄猅猇猋猍猒猓猘猙猞猢猤猧猨猬猱猲猵猺猻猽獃獍獐獒獖獘獝獞獟獠獦獧獩獫獬獮獯獱獷獹獼玀玁玃玅玆玎玐玓玕玗玘玜玞玟玠玢玥玦玪玫玭玵玷玹玼玽玿珅珆珉珋珌珏珒珓珖珙珝珡珣珦珧珩珴珵珷珹珺珻珽\"],[\"8fcca1\",\"珿琀琁琄琇琊琑琚琛琤琦琨\",9,\"琹瑀瑃瑄瑆瑇瑋瑍瑑瑒瑗瑝瑢瑦瑧瑨瑫瑭瑮瑱瑲璀璁璅璆璇璉璏璐璑璒璘璙璚璜璟璠璡璣璦璨璩璪璫璮璯璱璲璵璹璻璿瓈瓉瓌瓐瓓瓘瓚瓛瓞瓟瓤瓨瓪瓫瓯瓴瓺瓻瓼瓿甆\"],[\"8fcda1\",\"甒甖甗甠甡甤甧甩甪甯甶甹甽甾甿畀畃畇畈畎畐畒畗畞畟畡畯畱畹\",5,\"疁疅疐疒疓疕疙疜疢疤疴疺疿痀痁痄痆痌痎痏痗痜痟痠痡痤痧痬痮痯痱痹瘀瘂瘃瘄瘇瘈瘊瘌瘏瘒瘓瘕瘖瘙瘛瘜瘝瘞瘣瘥瘦瘩瘭瘲瘳瘵瘸瘹\"],[\"8fcea1\",\"瘺瘼癊癀癁癃癄癅癉癋癕癙癟癤癥癭癮癯癱癴皁皅皌皍皕皛皜皝皟皠皢\",6,\"皪皭皽盁盅盉盋盌盎盔盙盠盦盨盬盰盱盶盹盼眀眆眊眎眒眔眕眗眙眚眜眢眨眭眮眯眴眵眶眹眽眾睂睅睆睊睍睎睏睒睖睗睜睞睟睠睢\"],[\"8fcfa1\",\"睤睧睪睬睰睲睳睴睺睽瞀瞄瞌瞍瞔瞕瞖瞚瞟瞢瞧瞪瞮瞯瞱瞵瞾矃矉矑矒矕矙矞矟矠矤矦矪矬矰矱矴矸矻砅砆砉砍砎砑砝砡砢砣砭砮砰砵砷硃硄硇硈硌硎硒硜硞硠硡硣硤硨硪确硺硾碊碏碔碘碡碝碞碟碤碨碬碭碰碱碲碳\"],[\"8fd0a1\",\"碻碽碿磇磈磉磌磎磒磓磕磖磤磛磟磠磡磦磪磲磳礀磶磷磺磻磿礆礌礐礚礜礞礟礠礥礧礩礭礱礴礵礻礽礿祄祅祆祊祋祏祑祔祘祛祜祧祩祫祲祹祻祼祾禋禌禑禓禔禕禖禘禛禜禡禨禩禫禯禱禴禸离秂秄秇秈秊秏秔秖秚秝秞\"],[\"8fd1a1\",\"秠秢秥秪秫秭秱秸秼稂稃稇稉稊稌稑稕稛稞稡稧稫稭稯稰稴稵稸稹稺穄穅穇穈穌穕穖穙穜穝穟穠穥穧穪穭穵穸穾窀窂窅窆窊窋窐窑窔窞窠窣窬窳窵窹窻窼竆竉竌竎竑竛竨竩竫竬竱竴竻竽竾笇笔笟笣笧笩笪笫笭笮笯笰\"],[\"8fd2a1\",\"笱笴笽笿筀筁筇筎筕筠筤筦筩筪筭筯筲筳筷箄箉箎箐箑箖箛箞箠箥箬箯箰箲箵箶箺箻箼箽篂篅篈篊篔篖篗篙篚篛篨篪篲篴篵篸篹篺篼篾簁簂簃簄簆簉簋簌簎簏簙簛簠簥簦簨簬簱簳簴簶簹簺籆籊籕籑籒籓籙\",5],[\"8fd3a1\",\"籡籣籧籩籭籮籰籲籹籼籽粆粇粏粔粞粠粦粰粶粷粺粻粼粿糄糇糈糉糍糏糓糔糕糗糙糚糝糦糩糫糵紃紇紈紉紏紑紒紓紖紝紞紣紦紪紭紱紼紽紾絀絁絇絈絍絑絓絗絙絚絜絝絥絧絪絰絸絺絻絿綁綂綃綅綆綈綋綌綍綑綖綗綝\"],[\"8fd4a1\",\"綞綦綧綪綳綶綷綹緂\",4,\"緌緍緎緗緙縀緢緥緦緪緫緭緱緵緶緹緺縈縐縑縕縗縜縝縠縧縨縬縭縯縳縶縿繄繅繇繎繐繒繘繟繡繢繥繫繮繯繳繸繾纁纆纇纊纍纑纕纘纚纝纞缼缻缽缾缿罃罄罇罏罒罓罛罜罝罡罣罤罥罦罭\"],[\"8fd5a1\",\"罱罽罾罿羀羋羍羏羐羑羖羗羜羡羢羦羪羭羴羼羿翀翃翈翎翏翛翟翣翥翨翬翮翯翲翺翽翾翿耇耈耊耍耎耏耑耓耔耖耝耞耟耠耤耦耬耮耰耴耵耷耹耺耼耾聀聄聠聤聦聭聱聵肁肈肎肜肞肦肧肫肸肹胈胍胏胒胔胕胗胘胠胭胮\"],[\"8fd6a1\",\"胰胲胳胶胹胺胾脃脋脖脗脘脜脞脠脤脧脬脰脵脺脼腅腇腊腌腒腗腠腡腧腨腩腭腯腷膁膐膄膅膆膋膎膖膘膛膞膢膮膲膴膻臋臃臅臊臎臏臕臗臛臝臞臡臤臫臬臰臱臲臵臶臸臹臽臿舀舃舏舓舔舙舚舝舡舢舨舲舴舺艃艄艅艆\"],[\"8fd7a1\",\"艋艎艏艑艖艜艠艣艧艭艴艻艽艿芀芁芃芄芇芉芊芎芑芔芖芘芚芛芠芡芣芤芧芨芩芪芮芰芲芴芷芺芼芾芿苆苐苕苚苠苢苤苨苪苭苯苶苷苽苾茀茁茇茈茊茋荔茛茝茞茟茡茢茬茭茮茰茳茷茺茼茽荂荃荄荇荍荎荑荕荖荗荰荸\"],[\"8fd8a1\",\"荽荿莀莂莄莆莍莒莔莕莘莙莛莜莝莦莧莩莬莾莿菀菇菉菏菐菑菔菝荓菨菪菶菸菹菼萁萆萊萏萑萕萙莭萯萹葅葇葈葊葍葏葑葒葖葘葙葚葜葠葤葥葧葪葰葳葴葶葸葼葽蒁蒅蒒蒓蒕蒞蒦蒨蒩蒪蒯蒱蒴蒺蒽蒾蓀蓂蓇蓈蓌蓏蓓\"],[\"8fd9a1\",\"蓜蓧蓪蓯蓰蓱蓲蓷蔲蓺蓻蓽蔂蔃蔇蔌蔎蔐蔜蔞蔢蔣蔤蔥蔧蔪蔫蔯蔳蔴蔶蔿蕆蕏\",4,\"蕖蕙蕜\",6,\"蕤蕫蕯蕹蕺蕻蕽蕿薁薅薆薉薋薌薏薓薘薝薟薠薢薥薧薴薶薷薸薼薽薾薿藂藇藊藋藎薭藘藚藟藠藦藨藭藳藶藼\"],[\"8fdaa1\",\"藿蘀蘄蘅蘍蘎蘐蘑蘒蘘蘙蘛蘞蘡蘧蘩蘶蘸蘺蘼蘽虀虂虆虒虓虖虗虘虙虝虠\",4,\"虩虬虯虵虶虷虺蚍蚑蚖蚘蚚蚜蚡蚦蚧蚨蚭蚱蚳蚴蚵蚷蚸蚹蚿蛀蛁蛃蛅蛑蛒蛕蛗蛚蛜蛠蛣蛥蛧蚈蛺蛼蛽蜄蜅蜇蜋蜎蜏蜐蜓蜔蜙蜞蜟蜡蜣\"],[\"8fdba1\",\"蜨蜮蜯蜱蜲蜹蜺蜼蜽蜾蝀蝃蝅蝍蝘蝝蝡蝤蝥蝯蝱蝲蝻螃\",6,\"螋螌螐螓螕螗螘螙螞螠螣螧螬螭螮螱螵螾螿蟁蟈蟉蟊蟎蟕蟖蟙蟚蟜蟟蟢蟣蟤蟪蟫蟭蟱蟳蟸蟺蟿蠁蠃蠆蠉蠊蠋蠐蠙蠒蠓蠔蠘蠚蠛蠜蠞蠟蠨蠭蠮蠰蠲蠵\"],[\"8fdca1\",\"蠺蠼衁衃衅衈衉衊衋衎衑衕衖衘衚衜衟衠衤衩衱衹衻袀袘袚袛袜袟袠袨袪袺袽袾裀裊\",4,\"裑裒裓裛裞裧裯裰裱裵裷褁褆褍褎褏褕褖褘褙褚褜褠褦褧褨褰褱褲褵褹褺褾襀襂襅襆襉襏襒襗襚襛襜襡襢襣襫襮襰襳襵襺\"],[\"8fdda1\",\"襻襼襽覉覍覐覔覕覛覜覟覠覥覰覴覵覶覷覼觔\",4,\"觥觩觫觭觱觳觶觹觽觿訄訅訇訏訑訒訔訕訞訠訢訤訦訫訬訯訵訷訽訾詀詃詅詇詉詍詎詓詖詗詘詜詝詡詥詧詵詶詷詹詺詻詾詿誀誃誆誋誏誐誒誖誗誙誟誧誩誮誯誳\"],[\"8fdea1\",\"誶誷誻誾諃諆諈諉諊諑諓諔諕諗諝諟諬諰諴諵諶諼諿謅謆謋謑謜謞謟謊謭謰謷謼譂\",4,\"譈譒譓譔譙譍譞譣譭譶譸譹譼譾讁讄讅讋讍讏讔讕讜讞讟谸谹谽谾豅豇豉豋豏豑豓豔豗豘豛豝豙豣豤豦豨豩豭豳豵豶豻豾貆\"],[\"8fdfa1\",\"貇貋貐貒貓貙貛貜貤貹貺賅賆賉賋賏賖賕賙賝賡賨賬賯賰賲賵賷賸賾賿贁贃贉贒贗贛赥赩赬赮赿趂趄趈趍趐趑趕趞趟趠趦趫趬趯趲趵趷趹趻跀跅跆跇跈跊跎跑跔跕跗跙跤跥跧跬跰趼跱跲跴跽踁踄踅踆踋踑踔踖踠踡踢\"],[\"8fe0a1\",\"踣踦踧踱踳踶踷踸踹踽蹀蹁蹋蹍蹎蹏蹔蹛蹜蹝蹞蹡蹢蹩蹬蹭蹯蹰蹱蹹蹺蹻躂躃躉躐躒躕躚躛躝躞躢躧躩躭躮躳躵躺躻軀軁軃軄軇軏軑軔軜軨軮軰軱軷軹軺軭輀輂輇輈輏輐輖輗輘輞輠輡輣輥輧輨輬輭輮輴輵輶輷輺轀轁\"],[\"8fe1a1\",\"轃轇轏轑\",4,\"轘轝轞轥辝辠辡辤辥辦辵辶辸达迀迁迆迊迋迍运迒迓迕迠迣迤迨迮迱迵迶迻迾适逄逈逌逘逛逨逩逯逪逬逭逳逴逷逿遃遄遌遛遝遢遦遧遬遰遴遹邅邈邋邌邎邐邕邗邘邙邛邠邡邢邥邰邲邳邴邶邽郌邾郃\"],[\"8fe2a1\",\"郄郅郇郈郕郗郘郙郜郝郟郥郒郶郫郯郰郴郾郿鄀鄄鄅鄆鄈鄍鄐鄔鄖鄗鄘鄚鄜鄞鄠鄥鄢鄣鄧鄩鄮鄯鄱鄴鄶鄷鄹鄺鄼鄽酃酇酈酏酓酗酙酚酛酡酤酧酭酴酹酺酻醁醃醅醆醊醎醑醓醔醕醘醞醡醦醨醬醭醮醰醱醲醳醶醻醼醽醿\"],[\"8fe3a1\",\"釂釃釅釓釔釗釙釚釞釤釥釩釪釬\",5,\"釷釹釻釽鈀鈁鈄鈅鈆鈇鈉鈊鈌鈐鈒鈓鈖鈘鈜鈝鈣鈤鈥鈦鈨鈮鈯鈰鈳鈵鈶鈸鈹鈺鈼鈾鉀鉂鉃鉆鉇鉊鉍鉎鉏鉑鉘鉙鉜鉝鉠鉡鉥鉧鉨鉩鉮鉯鉰鉵\",4,\"鉻鉼鉽鉿銈銉銊銍銎銒銗\"],[\"8fe4a1\",\"銙銟銠銤銥銧銨銫銯銲銶銸銺銻銼銽銿\",4,\"鋅鋆鋇鋈鋋鋌鋍鋎鋐鋓鋕鋗鋘鋙鋜鋝鋟鋠鋡鋣鋥鋧鋨鋬鋮鋰鋹鋻鋿錀錂錈錍錑錔錕錜錝錞錟錡錤錥錧錩錪錳錴錶錷鍇鍈鍉鍐鍑鍒鍕鍗鍘鍚鍞鍤鍥鍧鍩鍪鍭鍯鍰鍱鍳鍴鍶\"],[\"8fe5a1\",\"鍺鍽鍿鎀鎁鎂鎈鎊鎋鎍鎏鎒鎕鎘鎛鎞鎡鎣鎤鎦鎨鎫鎴鎵鎶鎺鎩鏁鏄鏅鏆鏇鏉\",4,\"鏓鏙鏜鏞鏟鏢鏦鏧鏹鏷鏸鏺鏻鏽鐁鐂鐄鐈鐉鐍鐎鐏鐕鐖鐗鐟鐮鐯鐱鐲鐳鐴鐻鐿鐽鑃鑅鑈鑊鑌鑕鑙鑜鑟鑡鑣鑨鑫鑭鑮鑯鑱鑲钄钃镸镹\"],[\"8fe6a1\",\"镾閄閈閌閍閎閝閞閟閡閦閩閫閬閴閶閺閽閿闆闈闉闋闐闑闒闓闙闚闝闞闟闠闤闦阝阞阢阤阥阦阬阱阳阷阸阹阺阼阽陁陒陔陖陗陘陡陮陴陻陼陾陿隁隂隃隄隉隑隖隚隝隟隤隥隦隩隮隯隳隺雊雒嶲雘雚雝雞雟雩雯雱雺霂\"],[\"8fe7a1\",\"霃霅霉霚霛霝霡霢霣霨霱霳靁靃靊靎靏靕靗靘靚靛靣靧靪靮靳靶靷靸靻靽靿鞀鞉鞕鞖鞗鞙鞚鞞鞟鞢鞬鞮鞱鞲鞵鞶鞸鞹鞺鞼鞾鞿韁韄韅韇韉韊韌韍韎韐韑韔韗韘韙韝韞韠韛韡韤韯韱韴韷韸韺頇頊頙頍頎頔頖頜頞頠頣頦\"],[\"8fe8a1\",\"頫頮頯頰頲頳頵頥頾顄顇顊顑顒顓顖顗顙顚顢顣顥顦顪顬颫颭颮颰颴颷颸颺颻颿飂飅飈飌飡飣飥飦飧飪飳飶餂餇餈餑餕餖餗餚餛餜餟餢餦餧餫餱\",4,\"餹餺餻餼饀饁饆饇饈饍饎饔饘饙饛饜饞饟饠馛馝馟馦馰馱馲馵\"],[\"8fe9a1\",\"馹馺馽馿駃駉駓駔駙駚駜駞駧駪駫駬駰駴駵駹駽駾騂騃騄騋騌騐騑騖騞騠騢騣騤騧騭騮騳騵騶騸驇驁驄驊驋驌驎驑驔驖驝骪骬骮骯骲骴骵骶骹骻骾骿髁髃髆髈髎髐髒髕髖髗髛髜髠髤髥髧髩髬髲髳髵髹髺髽髿\",4],[\"8feaa1\",\"鬄鬅鬈鬉鬋鬌鬍鬎鬐鬒鬖鬙鬛鬜鬠鬦鬫鬭鬳鬴鬵鬷鬹鬺鬽魈魋魌魕魖魗魛魞魡魣魥魦魨魪\",4,\"魳魵魷魸魹魿鮀鮄鮅鮆鮇鮉鮊鮋鮍鮏鮐鮔鮚鮝鮞鮦鮧鮩鮬鮰鮱鮲鮷鮸鮻鮼鮾鮿鯁鯇鯈鯎鯐鯗鯘鯝鯟鯥鯧鯪鯫鯯鯳鯷鯸\"],[\"8feba1\",\"鯹鯺鯽鯿鰀鰂鰋鰏鰑鰖鰘鰙鰚鰜鰞鰢鰣鰦\",4,\"鰱鰵鰶鰷鰽鱁鱃鱄鱅鱉鱊鱎鱏鱐鱓鱔鱖鱘鱛鱝鱞鱟鱣鱩鱪鱜鱫鱨鱮鱰鱲鱵鱷鱻鳦鳲鳷鳹鴋鴂鴑鴗鴘鴜鴝鴞鴯鴰鴲鴳鴴鴺鴼鵅鴽鵂鵃鵇鵊鵓鵔鵟鵣鵢鵥鵩鵪鵫鵰鵶鵷鵻\"],[\"8feca1\",\"鵼鵾鶃鶄鶆鶊鶍鶎鶒鶓鶕鶖鶗鶘鶡鶪鶬鶮鶱鶵鶹鶼鶿鷃鷇鷉鷊鷔鷕鷖鷗鷚鷞鷟鷠鷥鷧鷩鷫鷮鷰鷳鷴鷾鸊鸂鸇鸎鸐鸑鸒鸕鸖鸙鸜鸝鹺鹻鹼麀麂麃麄麅麇麎麏麖麘麛麞麤麨麬麮麯麰麳麴麵黆黈黋黕黟黤黧黬黭黮黰黱黲黵\"],[\"8feda1\",\"黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃\",4,\"齓齕齖齗齘齚齝齞齨齩齭\",4,\"齳齵齺齽龏龐龑龒龔龖龗龞龡龢龣龥\"]]"); /***/ }), /* 639 */ /***/ (function(module) { module.exports = JSON.parse("[[\"0\",\"\\u0000\",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\",\"兀嗀﨎﨏﨑﨓﨔礼﨟蘒﨡﨣﨤﨧﨨﨩\"]]"); /***/ }), /* 640 */ /***/ (function(module) { module.exports = JSON.parse("[[\"a140\",\"\",62],[\"a180\",\"\",32],[\"a240\",\"\",62],[\"a280\",\"\",32],[\"a2ab\",\"\",5],[\"a2e3\",\"€\"],[\"a2ef\",\"\"],[\"a2fd\",\"\"],[\"a340\",\"\",62],[\"a380\",\"\",31,\" \"],[\"a440\",\"\",62],[\"a480\",\"\",32],[\"a4f4\",\"\",10],[\"a540\",\"\",62],[\"a580\",\"\",32],[\"a5f7\",\"\",7],[\"a640\",\"\",62],[\"a680\",\"\",32],[\"a6b9\",\"\",7],[\"a6d9\",\"\",6],[\"a6ec\",\"\"],[\"a6f3\",\"\"],[\"a6f6\",\"\",8],[\"a740\",\"\",62],[\"a780\",\"\",32],[\"a7c2\",\"\",14],[\"a7f2\",\"\",12],[\"a896\",\"\",10],[\"a8bc\",\"\"],[\"a8bf\",\"ǹ\"],[\"a8c1\",\"\"],[\"a8ea\",\"\",20],[\"a958\",\"\"],[\"a95b\",\"\"],[\"a95d\",\"\"],[\"a989\",\"〾⿰\",11],[\"a997\",\"\",12],[\"a9f0\",\"\",14],[\"aaa1\",\"\",93],[\"aba1\",\"\",93],[\"aca1\",\"\",93],[\"ada1\",\"\",93],[\"aea1\",\"\",93],[\"afa1\",\"\",93],[\"d7fa\",\"\",4],[\"f8a1\",\"\",93],[\"f9a1\",\"\",93],[\"faa1\",\"\",93],[\"fba1\",\"\",93],[\"fca1\",\"\",93],[\"fda1\",\"\",93],[\"fe50\",\"⺁⺄㑳㑇⺈⺋㖞㘚㘎⺌⺗㥮㤘㧏㧟㩳㧐㭎㱮㳠⺧⺪䁖䅟⺮䌷⺳⺶⺷䎱䎬⺻䏝䓖䙡䙌\"],[\"fe80\",\"䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶䲣䲟䲠䲡䱷䲢䴓\",6,\"䶮\",93]]"); /***/ }), /* 641 */ /***/ (function(module) { module.exports = JSON.parse("{\"uChars\":[128,165,169,178,184,216,226,235,238,244,248,251,253,258,276,284,300,325,329,334,364,463,465,467,469,471,473,475,477,506,594,610,712,716,730,930,938,962,970,1026,1104,1106,8209,8215,8218,8222,8231,8241,8244,8246,8252,8365,8452,8454,8458,8471,8482,8556,8570,8596,8602,8713,8720,8722,8726,8731,8737,8740,8742,8748,8751,8760,8766,8777,8781,8787,8802,8808,8816,8854,8858,8870,8896,8979,9322,9372,9548,9588,9616,9622,9634,9652,9662,9672,9676,9680,9702,9735,9738,9793,9795,11906,11909,11913,11917,11928,11944,11947,11951,11956,11960,11964,11979,12284,12292,12312,12319,12330,12351,12436,12447,12535,12543,12586,12842,12850,12964,13200,13215,13218,13253,13263,13267,13270,13384,13428,13727,13839,13851,14617,14703,14801,14816,14964,15183,15471,15585,16471,16736,17208,17325,17330,17374,17623,17997,18018,18212,18218,18301,18318,18760,18811,18814,18820,18823,18844,18848,18872,19576,19620,19738,19887,40870,59244,59336,59367,59413,59417,59423,59431,59437,59443,59452,59460,59478,59493,63789,63866,63894,63976,63986,64016,64018,64021,64025,64034,64037,64042,65074,65093,65107,65112,65127,65132,65375,65510,65536],\"gbChars\":[0,36,38,45,50,81,89,95,96,100,103,104,105,109,126,133,148,172,175,179,208,306,307,308,309,310,311,312,313,341,428,443,544,545,558,741,742,749,750,805,819,820,7922,7924,7925,7927,7934,7943,7944,7945,7950,8062,8148,8149,8152,8164,8174,8236,8240,8262,8264,8374,8380,8381,8384,8388,8390,8392,8393,8394,8396,8401,8406,8416,8419,8424,8437,8439,8445,8482,8485,8496,8521,8603,8936,8946,9046,9050,9063,9066,9076,9092,9100,9108,9111,9113,9131,9162,9164,9218,9219,11329,11331,11334,11336,11346,11361,11363,11366,11370,11372,11375,11389,11682,11686,11687,11692,11694,11714,11716,11723,11725,11730,11736,11982,11989,12102,12336,12348,12350,12384,12393,12395,12397,12510,12553,12851,12962,12973,13738,13823,13919,13933,14080,14298,14585,14698,15583,15847,16318,16434,16438,16481,16729,17102,17122,17315,17320,17402,17418,17859,17909,17911,17915,17916,17936,17939,17961,18664,18703,18814,18962,19043,33469,33470,33471,33484,33485,33490,33497,33501,33505,33513,33520,33536,33550,37845,37921,37948,38029,38038,38064,38065,38066,38069,38075,38076,38078,39108,39109,39113,39114,39115,39116,39265,39394,189000]}"); /***/ }), /* 642 */ /***/ (function(module) { module.exports = JSON.parse("[[\"0\",\"\\u0000\",127],[\"8141\",\"갂갃갅갆갋\",4,\"갘갞갟갡갢갣갥\",6,\"갮갲갳갴\"],[\"8161\",\"갵갶갷갺갻갽갾갿걁\",9,\"걌걎\",5,\"걕\"],[\"8181\",\"걖걗걙걚걛걝\",18,\"걲걳걵걶걹걻\",4,\"겂겇겈겍겎겏겑겒겓겕\",6,\"겞겢\",5,\"겫겭겮겱\",6,\"겺겾겿곀곂곃곅곆곇곉곊곋곍\",7,\"곖곘\",7,\"곢곣곥곦곩곫곭곮곲곴곷\",4,\"곾곿괁괂괃괅괇\",4,\"괎괐괒괓\"],[\"8241\",\"괔괕괖괗괙괚괛괝괞괟괡\",7,\"괪괫괮\",5],[\"8261\",\"괶괷괹괺괻괽\",6,\"굆굈굊\",5,\"굑굒굓굕굖굗\"],[\"8281\",\"굙\",7,\"굢굤\",7,\"굮굯굱굲굷굸굹굺굾궀궃\",4,\"궊궋궍궎궏궑\",10,\"궞\",5,\"궥\",17,\"궸\",7,\"귂귃귅귆귇귉\",6,\"귒귔\",7,\"귝귞귟귡귢귣귥\",18],[\"8341\",\"귺귻귽귾긂\",5,\"긊긌긎\",5,\"긕\",7],[\"8361\",\"긝\",18,\"긲긳긵긶긹긻긼\"],[\"8381\",\"긽긾긿깂깄깇깈깉깋깏깑깒깓깕깗\",4,\"깞깢깣깤깦깧깪깫깭깮깯깱\",6,\"깺깾\",5,\"꺆\",5,\"꺍\",46,\"꺿껁껂껃껅\",6,\"껎껒\",5,\"껚껛껝\",8],[\"8441\",\"껦껧껩껪껬껮\",5,\"껵껶껷껹껺껻껽\",8],[\"8461\",\"꼆꼉꼊꼋꼌꼎꼏꼑\",18],[\"8481\",\"꼤\",7,\"꼮꼯꼱꼳꼵\",6,\"꼾꽀꽄꽅꽆꽇꽊\",5,\"꽑\",10,\"꽞\",5,\"꽦\",18,\"꽺\",5,\"꾁꾂꾃꾅꾆꾇꾉\",6,\"꾒꾓꾔꾖\",5,\"꾝\",26,\"꾺꾻꾽꾾\"],[\"8541\",\"꾿꿁\",5,\"꿊꿌꿏\",4,\"꿕\",6,\"꿝\",4],[\"8561\",\"꿢\",5,\"꿪\",5,\"꿲꿳꿵꿶꿷꿹\",6,\"뀂뀃\"],[\"8581\",\"뀅\",6,\"뀍뀎뀏뀑뀒뀓뀕\",6,\"뀞\",9,\"뀩\",26,\"끆끇끉끋끍끏끐끑끒끖끘끚끛끜끞\",29,\"끾끿낁낂낃낅\",6,\"낎낐낒\",5,\"낛낝낞낣낤\"],[\"8641\",\"낥낦낧낪낰낲낶낷낹낺낻낽\",6,\"냆냊\",5,\"냒\"],[\"8661\",\"냓냕냖냗냙\",6,\"냡냢냣냤냦\",10],[\"8681\",\"냱\",22,\"넊넍넎넏넑넔넕넖넗넚넞\",4,\"넦넧넩넪넫넭\",6,\"넶넺\",5,\"녂녃녅녆녇녉\",6,\"녒녓녖녗녙녚녛녝녞녟녡\",22,\"녺녻녽녾녿놁놃\",4,\"놊놌놎놏놐놑놕놖놗놙놚놛놝\"],[\"8741\",\"놞\",9,\"놩\",15],[\"8761\",\"놹\",18,\"뇍뇎뇏뇑뇒뇓뇕\"],[\"8781\",\"뇖\",5,\"뇞뇠\",7,\"뇪뇫뇭뇮뇯뇱\",7,\"뇺뇼뇾\",5,\"눆눇눉눊눍\",6,\"눖눘눚\",5,\"눡\",18,\"눵\",6,\"눽\",26,\"뉙뉚뉛뉝뉞뉟뉡\",6,\"뉪\",4],[\"8841\",\"뉯\",4,\"뉶\",5,\"뉽\",6,\"늆늇늈늊\",4],[\"8861\",\"늏늒늓늕늖늗늛\",4,\"늢늤늧늨늩늫늭늮늯늱늲늳늵늶늷\"],[\"8881\",\"늸\",15,\"닊닋닍닎닏닑닓\",4,\"닚닜닞닟닠닡닣닧닩닪닰닱닲닶닼닽닾댂댃댅댆댇댉\",6,\"댒댖\",5,\"댝\",54,\"덗덙덚덝덠덡덢덣\"],[\"8941\",\"덦덨덪덬덭덯덲덳덵덶덷덹\",6,\"뎂뎆\",5,\"뎍\"],[\"8961\",\"뎎뎏뎑뎒뎓뎕\",10,\"뎢\",5,\"뎩뎪뎫뎭\"],[\"8981\",\"뎮\",21,\"돆돇돉돊돍돏돑돒돓돖돘돚돜돞돟돡돢돣돥돦돧돩\",18,\"돽\",18,\"됑\",6,\"됙됚됛됝됞됟됡\",6,\"됪됬\",7,\"됵\",15],[\"8a41\",\"둅\",10,\"둒둓둕둖둗둙\",6,\"둢둤둦\"],[\"8a61\",\"둧\",4,\"둭\",18,\"뒁뒂\"],[\"8a81\",\"뒃\",4,\"뒉\",19,\"뒞\",5,\"뒥뒦뒧뒩뒪뒫뒭\",7,\"뒶뒸뒺\",5,\"듁듂듃듅듆듇듉\",6,\"듑듒듓듔듖\",5,\"듞듟듡듢듥듧\",4,\"듮듰듲\",5,\"듹\",26,\"딖딗딙딚딝\"],[\"8b41\",\"딞\",5,\"딦딫\",4,\"딲딳딵딶딷딹\",6,\"땂땆\"],[\"8b61\",\"땇땈땉땊땎땏땑땒땓땕\",6,\"땞땢\",8],[\"8b81\",\"땫\",52,\"떢떣떥떦떧떩떬떭떮떯떲떶\",4,\"떾떿뗁뗂뗃뗅\",6,\"뗎뗒\",5,\"뗙\",18,\"뗭\",18],[\"8c41\",\"똀\",15,\"똒똓똕똖똗똙\",4],[\"8c61\",\"똞\",6,\"똦\",5,\"똭\",6,\"똵\",5],[\"8c81\",\"똻\",12,\"뙉\",26,\"뙥뙦뙧뙩\",50,\"뚞뚟뚡뚢뚣뚥\",5,\"뚭뚮뚯뚰뚲\",16],[\"8d41\",\"뛃\",16,\"뛕\",8],[\"8d61\",\"뛞\",17,\"뛱뛲뛳뛵뛶뛷뛹뛺\"],[\"8d81\",\"뛻\",4,\"뜂뜃뜄뜆\",33,\"뜪뜫뜭뜮뜱\",6,\"뜺뜼\",7,\"띅띆띇띉띊띋띍\",6,\"띖\",9,\"띡띢띣띥띦띧띩\",6,\"띲띴띶\",5,\"띾띿랁랂랃랅\",6,\"랎랓랔랕랚랛랝랞\"],[\"8e41\",\"랟랡\",6,\"랪랮\",5,\"랶랷랹\",8],[\"8e61\",\"럂\",4,\"럈럊\",19],[\"8e81\",\"럞\",13,\"럮럯럱럲럳럵\",6,\"럾렂\",4,\"렊렋렍렎렏렑\",6,\"렚렜렞\",5,\"렦렧렩렪렫렭\",6,\"렶렺\",5,\"롁롂롃롅\",11,\"롒롔\",7,\"롞롟롡롢롣롥\",6,\"롮롰롲\",5,\"롹롺롻롽\",7],[\"8f41\",\"뢅\",7,\"뢎\",17],[\"8f61\",\"뢠\",7,\"뢩\",6,\"뢱뢲뢳뢵뢶뢷뢹\",4],[\"8f81\",\"뢾뢿룂룄룆\",5,\"룍룎룏룑룒룓룕\",7,\"룞룠룢\",5,\"룪룫룭룮룯룱\",6,\"룺룼룾\",5,\"뤅\",18,\"뤙\",6,\"뤡\",26,\"뤾뤿륁륂륃륅\",6,\"륍륎륐륒\",5],[\"9041\",\"륚륛륝륞륟륡\",6,\"륪륬륮\",5,\"륶륷륹륺륻륽\"],[\"9061\",\"륾\",5,\"릆릈릋릌릏\",15],[\"9081\",\"릟\",12,\"릮릯릱릲릳릵\",6,\"릾맀맂\",5,\"맊맋맍맓\",4,\"맚맜맟맠맢맦맧맩맪맫맭\",6,\"맶맻\",4,\"먂\",5,\"먉\",11,\"먖\",33,\"먺먻먽먾먿멁멃멄멅멆\"],[\"9141\",\"멇멊멌멏멐멑멒멖멗멙멚멛멝\",6,\"멦멪\",5],[\"9161\",\"멲멳멵멶멷멹\",9,\"몆몈몉몊몋몍\",5],[\"9181\",\"몓\",20,\"몪몭몮몯몱몳\",4,\"몺몼몾\",5,\"뫅뫆뫇뫉\",14,\"뫚\",33,\"뫽뫾뫿묁묂묃묅\",7,\"묎묐묒\",5,\"묙묚묛묝묞묟묡\",6],[\"9241\",\"묨묪묬\",7,\"묷묹묺묿\",4,\"뭆뭈뭊뭋뭌뭎뭑뭒\"],[\"9261\",\"뭓뭕뭖뭗뭙\",7,\"뭢뭤\",7,\"뭭\",4],[\"9281\",\"뭲\",21,\"뮉뮊뮋뮍뮎뮏뮑\",18,\"뮥뮦뮧뮩뮪뮫뮭\",6,\"뮵뮶뮸\",7,\"믁믂믃믅믆믇믉\",6,\"믑믒믔\",35,\"믺믻믽믾밁\"],[\"9341\",\"밃\",4,\"밊밎밐밒밓밙밚밠밡밢밣밦밨밪밫밬밮밯밲밳밵\"],[\"9361\",\"밶밷밹\",6,\"뱂뱆뱇뱈뱊뱋뱎뱏뱑\",8],[\"9381\",\"뱚뱛뱜뱞\",37,\"벆벇벉벊벍벏\",4,\"벖벘벛\",4,\"벢벣벥벦벩\",6,\"벲벶\",5,\"벾벿볁볂볃볅\",7,\"볎볒볓볔볖볗볙볚볛볝\",22,\"볷볹볺볻볽\"],[\"9441\",\"볾\",5,\"봆봈봊\",5,\"봑봒봓봕\",8],[\"9461\",\"봞\",5,\"봥\",6,\"봭\",12],[\"9481\",\"봺\",5,\"뵁\",6,\"뵊뵋뵍뵎뵏뵑\",6,\"뵚\",9,\"뵥뵦뵧뵩\",22,\"붂붃붅붆붋\",4,\"붒붔붖붗붘붛붝\",6,\"붥\",10,\"붱\",6,\"붹\",24],[\"9541\",\"뷒뷓뷖뷗뷙뷚뷛뷝\",11,\"뷪\",5,\"뷱\"],[\"9561\",\"뷲뷳뷵뷶뷷뷹\",6,\"븁븂븄븆\",5,\"븎븏븑븒븓\"],[\"9581\",\"븕\",6,\"븞븠\",35,\"빆빇빉빊빋빍빏\",4,\"빖빘빜빝빞빟빢빣빥빦빧빩빫\",4,\"빲빶\",4,\"빾빿뺁뺂뺃뺅\",6,\"뺎뺒\",5,\"뺚\",13,\"뺩\",14],[\"9641\",\"뺸\",23,\"뻒뻓\"],[\"9661\",\"뻕뻖뻙\",6,\"뻡뻢뻦\",5,\"뻭\",8],[\"9681\",\"뻶\",10,\"뼂\",5,\"뼊\",13,\"뼚뼞\",33,\"뽂뽃뽅뽆뽇뽉\",6,\"뽒뽓뽔뽖\",44],[\"9741\",\"뾃\",16,\"뾕\",8],[\"9761\",\"뾞\",17,\"뾱\",7],[\"9781\",\"뾹\",11,\"뿆\",5,\"뿎뿏뿑뿒뿓뿕\",6,\"뿝뿞뿠뿢\",89,\"쀽쀾쀿\"],[\"9841\",\"쁀\",16,\"쁒\",5,\"쁙쁚쁛\"],[\"9861\",\"쁝쁞쁟쁡\",6,\"쁪\",15],[\"9881\",\"쁺\",21,\"삒삓삕삖삗삙\",6,\"삢삤삦\",5,\"삮삱삲삷\",4,\"삾샂샃샄샆샇샊샋샍샎샏샑\",6,\"샚샞\",5,\"샦샧샩샪샫샭\",6,\"샶샸샺\",5,\"섁섂섃섅섆섇섉\",6,\"섑섒섓섔섖\",5,\"섡섢섥섨섩섪섫섮\"],[\"9941\",\"섲섳섴섵섷섺섻섽섾섿셁\",6,\"셊셎\",5,\"셖셗\"],[\"9961\",\"셙셚셛셝\",6,\"셦셪\",5,\"셱셲셳셵셶셷셹셺셻\"],[\"9981\",\"셼\",8,\"솆\",5,\"솏솑솒솓솕솗\",4,\"솞솠솢솣솤솦솧솪솫솭솮솯솱\",11,\"솾\",5,\"쇅쇆쇇쇉쇊쇋쇍\",6,\"쇕쇖쇙\",6,\"쇡쇢쇣쇥쇦쇧쇩\",6,\"쇲쇴\",7,\"쇾쇿숁숂숃숅\",6,\"숎숐숒\",5,\"숚숛숝숞숡숢숣\"],[\"9a41\",\"숤숥숦숧숪숬숮숰숳숵\",16],[\"9a61\",\"쉆쉇쉉\",6,\"쉒쉓쉕쉖쉗쉙\",6,\"쉡쉢쉣쉤쉦\"],[\"9a81\",\"쉧\",4,\"쉮쉯쉱쉲쉳쉵\",6,\"쉾슀슂\",5,\"슊\",5,\"슑\",6,\"슙슚슜슞\",5,\"슦슧슩슪슫슮\",5,\"슶슸슺\",33,\"싞싟싡싢싥\",5,\"싮싰싲싳싴싵싷싺싽싾싿쌁\",6,\"쌊쌋쌎쌏\"],[\"9b41\",\"쌐쌑쌒쌖쌗쌙쌚쌛쌝\",6,\"쌦쌧쌪\",8],[\"9b61\",\"쌳\",17,\"썆\",7],[\"9b81\",\"썎\",25,\"썪썫썭썮썯썱썳\",4,\"썺썻썾\",5,\"쎅쎆쎇쎉쎊쎋쎍\",50,\"쏁\",22,\"쏚\"],[\"9c41\",\"쏛쏝쏞쏡쏣\",4,\"쏪쏫쏬쏮\",5,\"쏶쏷쏹\",5],[\"9c61\",\"쏿\",8,\"쐉\",6,\"쐑\",9],[\"9c81\",\"쐛\",8,\"쐥\",6,\"쐭쐮쐯쐱쐲쐳쐵\",6,\"쐾\",9,\"쑉\",26,\"쑦쑧쑩쑪쑫쑭\",6,\"쑶쑷쑸쑺\",5,\"쒁\",18,\"쒕\",6,\"쒝\",12],[\"9d41\",\"쒪\",13,\"쒹쒺쒻쒽\",8],[\"9d61\",\"쓆\",25],[\"9d81\",\"쓠\",8,\"쓪\",5,\"쓲쓳쓵쓶쓷쓹쓻쓼쓽쓾씂\",9,\"씍씎씏씑씒씓씕\",6,\"씝\",10,\"씪씫씭씮씯씱\",6,\"씺씼씾\",5,\"앆앇앋앏앐앑앒앖앚앛앜앟앢앣앥앦앧앩\",6,\"앲앶\",5,\"앾앿얁얂얃얅얆얈얉얊얋얎얐얒얓얔\"],[\"9e41\",\"얖얙얚얛얝얞얟얡\",7,\"얪\",9,\"얶\"],[\"9e61\",\"얷얺얿\",4,\"엋엍엏엒엓엕엖엗엙\",6,\"엢엤엦엧\"],[\"9e81\",\"엨엩엪엫엯엱엲엳엵엸엹엺엻옂옃옄옉옊옋옍옎옏옑\",6,\"옚옝\",6,\"옦옧옩옪옫옯옱옲옶옸옺옼옽옾옿왂왃왅왆왇왉\",6,\"왒왖\",5,\"왞왟왡\",10,\"왭왮왰왲\",5,\"왺왻왽왾왿욁\",6,\"욊욌욎\",5,\"욖욗욙욚욛욝\",6,\"욦\"],[\"9f41\",\"욨욪\",5,\"욲욳욵욶욷욻\",4,\"웂웄웆\",5,\"웎\"],[\"9f61\",\"웏웑웒웓웕\",6,\"웞웟웢\",5,\"웪웫웭웮웯웱웲\"],[\"9f81\",\"웳\",4,\"웺웻웼웾\",5,\"윆윇윉윊윋윍\",6,\"윖윘윚\",5,\"윢윣윥윦윧윩\",6,\"윲윴윶윸윹윺윻윾윿읁읂읃읅\",4,\"읋읎읐읙읚읛읝읞읟읡\",6,\"읩읪읬\",7,\"읶읷읹읺읻읿잀잁잂잆잋잌잍잏잒잓잕잙잛\",4,\"잢잧\",4,\"잮잯잱잲잳잵잶잷\"],[\"a041\",\"잸잹잺잻잾쟂\",5,\"쟊쟋쟍쟏쟑\",6,\"쟙쟚쟛쟜\"],[\"a061\",\"쟞\",5,\"쟥쟦쟧쟩쟪쟫쟭\",13],[\"a081\",\"쟻\",4,\"젂젃젅젆젇젉젋\",4,\"젒젔젗\",4,\"젞젟젡젢젣젥\",6,\"젮젰젲\",5,\"젹젺젻젽젾젿졁\",6,\"졊졋졎\",5,\"졕\",26,\"졲졳졵졶졷졹졻\",4,\"좂좄좈좉좊좎\",5,\"좕\",7,\"좞좠좢좣좤\"],[\"a141\",\"좥좦좧좩\",18,\"좾좿죀죁\"],[\"a161\",\"죂죃죅죆죇죉죊죋죍\",6,\"죖죘죚\",5,\"죢죣죥\"],[\"a181\",\"죦\",14,\"죶\",5,\"죾죿줁줂줃줇\",4,\"줎 、。·‥…¨〃―∥\∼‘’“”〔〕〈\",9,\"±×÷≠≤≥∞∴°′″℃Å¢£¥♂♀∠⊥⌒∂∇≡≒§※☆★○●◎◇◆□■△▲▽▼→←↑↓↔〓≪≫√∽∝∵∫∬∈∋⊆⊇⊂⊃∪∩∧∨¬\"],[\"a241\",\"줐줒\",5,\"줙\",18],[\"a261\",\"줭\",6,\"줵\",18],[\"a281\",\"쥈\",7,\"쥒쥓쥕쥖쥗쥙\",6,\"쥢쥤\",7,\"쥭쥮쥯⇒⇔∀∃´~ˇ˘˝˚˙¸˛¡¿ː∮∑∏¤℉‰◁◀▷▶♤♠♡♥♧♣⊙◈▣◐◑▒▤▥▨▧▦▩♨☏☎☜☞¶†‡↕↗↙↖↘♭♩♪♬㉿㈜№㏇™㏂㏘℡€®\"],[\"a341\",\"쥱쥲쥳쥵\",6,\"쥽\",10,\"즊즋즍즎즏\"],[\"a361\",\"즑\",6,\"즚즜즞\",16],[\"a381\",\"즯\",16,\"짂짃짅짆짉짋\",4,\"짒짔짗짘짛!\",58,\"₩]\",32,\" ̄\"],[\"a441\",\"짞짟짡짣짥짦짨짩짪짫짮짲\",5,\"짺짻짽짾짿쨁쨂쨃쨄\"],[\"a461\",\"쨅쨆쨇쨊쨎\",5,\"쨕쨖쨗쨙\",12],[\"a481\",\"쨦쨧쨨쨪\",28,\"ㄱ\",93],[\"a541\",\"쩇\",4,\"쩎쩏쩑쩒쩓쩕\",6,\"쩞쩢\",5,\"쩩쩪\"],[\"a561\",\"쩫\",17,\"쩾\",5,\"쪅쪆\"],[\"a581\",\"쪇\",16,\"쪙\",14,\"ⅰ\",9],[\"a5b0\",\"Ⅰ\",9],[\"a5c1\",\"Α\",16,\"Σ\",6],[\"a5e1\",\"α\",16,\"σ\",6],[\"a641\",\"쪨\",19,\"쪾쪿쫁쫂쫃쫅\"],[\"a661\",\"쫆\",5,\"쫎쫐쫒쫔쫕쫖쫗쫚\",5,\"쫡\",6],[\"a681\",\"쫨쫩쫪쫫쫭\",6,\"쫵\",18,\"쬉쬊─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂┒┑┚┙┖┕┎┍┞┟┡┢┦┧┩┪┭┮┱┲┵┶┹┺┽┾╀╁╃\",7],[\"a741\",\"쬋\",4,\"쬑쬒쬓쬕쬖쬗쬙\",6,\"쬢\",7],[\"a761\",\"쬪\",22,\"쭂쭃쭄\"],[\"a781\",\"쭅쭆쭇쭊쭋쭍쭎쭏쭑\",6,\"쭚쭛쭜쭞\",5,\"쭥\",7,\"㎕㎖㎗ℓ㎘㏄㎣㎤㎥㎦㎙\",9,\"㏊㎍㎎㎏㏏㎈㎉㏈㎧㎨㎰\",9,\"㎀\",4,\"㎺\",5,\"㎐\",4,\"Ω㏀㏁㎊㎋㎌㏖㏅㎭㎮㎯㏛㎩㎪㎫㎬㏝㏐㏓㏃㏉㏜㏆\"],[\"a841\",\"쭭\",10,\"쭺\",14],[\"a861\",\"쮉\",18,\"쮝\",6],[\"a881\",\"쮤\",19,\"쮹\",11,\"ÆЪĦ\"],[\"a8a6\",\"IJ\"],[\"a8a8\",\"ĿŁØŒºÞŦŊ\"],[\"a8b1\",\"㉠\",27,\"ⓐ\",25,\"①\",14,\"½⅓⅔¼¾⅛⅜⅝⅞\"],[\"a941\",\"쯅\",14,\"쯕\",10],[\"a961\",\"쯠쯡쯢쯣쯥쯦쯨쯪\",18],[\"a981\",\"쯽\",14,\"찎찏찑찒찓찕\",6,\"찞찟찠찣찤æđðħıijĸŀłøœßþŧŋʼn㈀\",27,\"⒜\",25,\"⑴\",14,\"¹²³⁴ⁿ₁₂₃₄\"],[\"aa41\",\"찥찦찪찫찭찯찱\",6,\"찺찿\",4,\"챆챇챉챊챋챍챎\"],[\"aa61\",\"챏\",4,\"챖챚\",5,\"챡챢챣챥챧챩\",6,\"챱챲\"],[\"aa81\",\"챳챴챶\",29,\"ぁ\",82],[\"ab41\",\"첔첕첖첗첚첛첝첞첟첡\",6,\"첪첮\",5,\"첶첷첹\"],[\"ab61\",\"첺첻첽\",6,\"쳆쳈쳊\",5,\"쳑쳒쳓쳕\",5],[\"ab81\",\"쳛\",8,\"쳥\",6,\"쳭쳮쳯쳱\",12,\"ァ\",85],[\"ac41\",\"쳾쳿촀촂\",5,\"촊촋촍촎촏촑\",6,\"촚촜촞촟촠\"],[\"ac61\",\"촡촢촣촥촦촧촩촪촫촭\",11,\"촺\",4],[\"ac81\",\"촿\",28,\"쵝쵞쵟А\",5,\"ЁЖ\",25],[\"acd1\",\"а\",5,\"ёж\",25],[\"ad41\",\"쵡쵢쵣쵥\",6,\"쵮쵰쵲\",5,\"쵹\",7],[\"ad61\",\"춁\",6,\"춉\",10,\"춖춗춙춚춛춝춞춟\"],[\"ad81\",\"춠춡춢춣춦춨춪\",5,\"춱\",18,\"췅\"],[\"ae41\",\"췆\",5,\"췍췎췏췑\",16],[\"ae61\",\"췢\",5,\"췩췪췫췭췮췯췱\",6,\"췺췼췾\",4],[\"ae81\",\"츃츅츆츇츉츊츋츍\",6,\"츕츖츗츘츚\",5,\"츢츣츥츦츧츩츪츫\"],[\"af41\",\"츬츭츮츯츲츴츶\",19],[\"af61\",\"칊\",13,\"칚칛칝칞칢\",5,\"칪칬\"],[\"af81\",\"칮\",5,\"칶칷칹칺칻칽\",6,\"캆캈캊\",5,\"캒캓캕캖캗캙\"],[\"b041\",\"캚\",5,\"캢캦\",5,\"캮\",12],[\"b061\",\"캻\",5,\"컂\",19],[\"b081\",\"컖\",13,\"컦컧컩컪컭\",6,\"컶컺\",5,\"가각간갇갈갉갊감\",7,\"같\",4,\"갠갤갬갭갯갰갱갸갹갼걀걋걍걔걘걜거걱건걷걸걺검겁것겄겅겆겉겊겋게겐겔겜겝겟겠겡겨격겪견겯결겸겹겻겼경곁계곈곌곕곗고곡곤곧골곪곬곯곰곱곳공곶과곽관괄괆\"],[\"b141\",\"켂켃켅켆켇켉\",6,\"켒켔켖\",5,\"켝켞켟켡켢켣\"],[\"b161\",\"켥\",6,\"켮켲\",5,\"켹\",11],[\"b181\",\"콅\",14,\"콖콗콙콚콛콝\",6,\"콦콨콪콫콬괌괍괏광괘괜괠괩괬괭괴괵괸괼굄굅굇굉교굔굘굡굣구국군굳굴굵굶굻굼굽굿궁궂궈궉권궐궜궝궤궷귀귁귄귈귐귑귓규균귤그극근귿글긁금급긋긍긔기긱긴긷길긺김깁깃깅깆깊까깍깎깐깔깖깜깝깟깠깡깥깨깩깬깰깸\"],[\"b241\",\"콭콮콯콲콳콵콶콷콹\",6,\"쾁쾂쾃쾄쾆\",5,\"쾍\"],[\"b261\",\"쾎\",18,\"쾢\",5,\"쾩\"],[\"b281\",\"쾪\",5,\"쾱\",18,\"쿅\",6,\"깹깻깼깽꺄꺅꺌꺼꺽꺾껀껄껌껍껏껐껑께껙껜껨껫껭껴껸껼꼇꼈꼍꼐꼬꼭꼰꼲꼴꼼꼽꼿꽁꽂꽃꽈꽉꽐꽜꽝꽤꽥꽹꾀꾄꾈꾐꾑꾕꾜꾸꾹꾼꿀꿇꿈꿉꿋꿍꿎꿔꿜꿨꿩꿰꿱꿴꿸뀀뀁뀄뀌뀐뀔뀜뀝뀨끄끅끈끊끌끎끓끔끕끗끙\"],[\"b341\",\"쿌\",19,\"쿢쿣쿥쿦쿧쿩\"],[\"b361\",\"쿪\",5,\"쿲쿴쿶\",5,\"쿽쿾쿿퀁퀂퀃퀅\",5],[\"b381\",\"퀋\",5,\"퀒\",5,\"퀙\",19,\"끝끼끽낀낄낌낍낏낑나낙낚난낟날낡낢남납낫\",4,\"낱낳내낵낸낼냄냅냇냈냉냐냑냔냘냠냥너넉넋넌널넒넓넘넙넛넜넝넣네넥넨넬넴넵넷넸넹녀녁년녈념녑녔녕녘녜녠노녹논놀놂놈놉놋농높놓놔놘놜놨뇌뇐뇔뇜뇝\"],[\"b441\",\"퀮\",5,\"퀶퀷퀹퀺퀻퀽\",6,\"큆큈큊\",5],[\"b461\",\"큑큒큓큕큖큗큙\",6,\"큡\",10,\"큮큯\"],[\"b481\",\"큱큲큳큵\",6,\"큾큿킀킂\",18,\"뇟뇨뇩뇬뇰뇹뇻뇽누눅눈눋눌눔눕눗눙눠눴눼뉘뉜뉠뉨뉩뉴뉵뉼늄늅늉느늑는늘늙늚늠늡늣능늦늪늬늰늴니닉닌닐닒님닙닛닝닢다닥닦단닫\",4,\"닳담답닷\",4,\"닿대댁댄댈댐댑댓댔댕댜더덕덖던덛덜덞덟덤덥\"],[\"b541\",\"킕\",14,\"킦킧킩킪킫킭\",5],[\"b561\",\"킳킶킸킺\",5,\"탂탃탅탆탇탊\",5,\"탒탖\",4],[\"b581\",\"탛탞탟탡탢탣탥\",6,\"탮탲\",5,\"탹\",11,\"덧덩덫덮데덱덴델뎀뎁뎃뎄뎅뎌뎐뎔뎠뎡뎨뎬도독돈돋돌돎돐돔돕돗동돛돝돠돤돨돼됐되된될됨됩됫됴두둑둔둘둠둡둣둥둬뒀뒈뒝뒤뒨뒬뒵뒷뒹듀듄듈듐듕드득든듣들듦듬듭듯등듸디딕딘딛딜딤딥딧딨딩딪따딱딴딸\"],[\"b641\",\"턅\",7,\"턎\",17],[\"b661\",\"턠\",15,\"턲턳턵턶턷턹턻턼턽턾\"],[\"b681\",\"턿텂텆\",5,\"텎텏텑텒텓텕\",6,\"텞텠텢\",5,\"텩텪텫텭땀땁땃땄땅땋때땍땐땔땜땝땟땠땡떠떡떤떨떪떫떰떱떳떴떵떻떼떽뗀뗄뗌뗍뗏뗐뗑뗘뗬또똑똔똘똥똬똴뙈뙤뙨뚜뚝뚠뚤뚫뚬뚱뛔뛰뛴뛸뜀뜁뜅뜨뜩뜬뜯뜰뜸뜹뜻띄띈띌띔띕띠띤띨띰띱띳띵라락란랄람랍랏랐랑랒랖랗\"],[\"b741\",\"텮\",13,\"텽\",6,\"톅톆톇톉톊\"],[\"b761\",\"톋\",20,\"톢톣톥톦톧\"],[\"b781\",\"톩\",6,\"톲톴톶톷톸톹톻톽톾톿퇁\",14,\"래랙랜랠램랩랫랬랭랴략랸럇량러럭런럴럼럽럿렀렁렇레렉렌렐렘렙렛렝려력련렬렴렵렷렸령례롄롑롓로록론롤롬롭롯롱롸롼뢍뢨뢰뢴뢸룀룁룃룅료룐룔룝룟룡루룩룬룰룸룹룻룽뤄뤘뤠뤼뤽륀륄륌륏륑류륙륜률륨륩\"],[\"b841\",\"퇐\",7,\"퇙\",17],[\"b861\",\"퇫\",8,\"퇵퇶퇷퇹\",13],[\"b881\",\"툈툊\",5,\"툑\",24,\"륫륭르륵른를름릅릇릉릊릍릎리릭린릴림립릿링마막만많\",4,\"맘맙맛망맞맡맣매맥맨맬맴맵맷맸맹맺먀먁먈먕머먹먼멀멂멈멉멋멍멎멓메멕멘멜멤멥멧멨멩며멱면멸몃몄명몇몌모목몫몬몰몲몸몹못몽뫄뫈뫘뫙뫼\"],[\"b941\",\"툪툫툮툯툱툲툳툵\",6,\"툾퉀퉂\",5,\"퉉퉊퉋퉌\"],[\"b961\",\"퉍\",14,\"퉝\",6,\"퉥퉦퉧퉨\"],[\"b981\",\"퉩\",22,\"튂튃튅튆튇튉튊튋튌묀묄묍묏묑묘묜묠묩묫무묵묶문묻물묽묾뭄뭅뭇뭉뭍뭏뭐뭔뭘뭡뭣뭬뮈뮌뮐뮤뮨뮬뮴뮷므믄믈믐믓미믹민믿밀밂밈밉밋밌밍및밑바\",4,\"받\",4,\"밤밥밧방밭배백밴밸뱀뱁뱃뱄뱅뱉뱌뱍뱐뱝버벅번벋벌벎범법벗\"],[\"ba41\",\"튍튎튏튒튓튔튖\",5,\"튝튞튟튡튢튣튥\",6,\"튭\"],[\"ba61\",\"튮튯튰튲\",5,\"튺튻튽튾틁틃\",4,\"틊틌\",5],[\"ba81\",\"틒틓틕틖틗틙틚틛틝\",6,\"틦\",9,\"틲틳틵틶틷틹틺벙벚베벡벤벧벨벰벱벳벴벵벼벽변별볍볏볐병볕볘볜보복볶본볼봄봅봇봉봐봔봤봬뵀뵈뵉뵌뵐뵘뵙뵤뵨부북분붇불붉붊붐붑붓붕붙붚붜붤붰붸뷔뷕뷘뷜뷩뷰뷴뷸븀븃븅브븍븐블븜븝븟비빅빈빌빎빔빕빗빙빚빛빠빡빤\"],[\"bb41\",\"틻\",4,\"팂팄팆\",5,\"팏팑팒팓팕팗\",4,\"팞팢팣\"],[\"bb61\",\"팤팦팧팪팫팭팮팯팱\",6,\"팺팾\",5,\"퍆퍇퍈퍉\"],[\"bb81\",\"퍊\",31,\"빨빪빰빱빳빴빵빻빼빽뺀뺄뺌뺍뺏뺐뺑뺘뺙뺨뻐뻑뻔뻗뻘뻠뻣뻤뻥뻬뼁뼈뼉뼘뼙뼛뼜뼝뽀뽁뽄뽈뽐뽑뽕뾔뾰뿅뿌뿍뿐뿔뿜뿟뿡쀼쁑쁘쁜쁠쁨쁩삐삑삔삘삠삡삣삥사삭삯산삳살삵삶삼삽삿샀상샅새색샌샐샘샙샛샜생샤\"],[\"bc41\",\"퍪\",17,\"퍾퍿펁펂펃펅펆펇\"],[\"bc61\",\"펈펉펊펋펎펒\",5,\"펚펛펝펞펟펡\",6,\"펪펬펮\"],[\"bc81\",\"펯\",4,\"펵펶펷펹펺펻펽\",6,\"폆폇폊\",5,\"폑\",5,\"샥샨샬샴샵샷샹섀섄섈섐섕서\",4,\"섣설섦섧섬섭섯섰성섶세섹센셀셈셉셋셌셍셔셕션셜셤셥셧셨셩셰셴셸솅소속솎손솔솖솜솝솟송솥솨솩솬솰솽쇄쇈쇌쇔쇗쇘쇠쇤쇨쇰쇱쇳쇼쇽숀숄숌숍숏숑수숙순숟술숨숩숫숭\"],[\"bd41\",\"폗폙\",7,\"폢폤\",7,\"폮폯폱폲폳폵폶폷\"],[\"bd61\",\"폸폹폺폻폾퐀퐂\",5,\"퐉\",13],[\"bd81\",\"퐗\",5,\"퐞\",25,\"숯숱숲숴쉈쉐쉑쉔쉘쉠쉥쉬쉭쉰쉴쉼쉽쉿슁슈슉슐슘슛슝스슥슨슬슭슴습슷승시식신싣실싫심십싯싱싶싸싹싻싼쌀쌈쌉쌌쌍쌓쌔쌕쌘쌜쌤쌥쌨쌩썅써썩썬썰썲썸썹썼썽쎄쎈쎌쏀쏘쏙쏜쏟쏠쏢쏨쏩쏭쏴쏵쏸쐈쐐쐤쐬쐰\"],[\"be41\",\"퐸\",7,\"푁푂푃푅\",14],[\"be61\",\"푔\",7,\"푝푞푟푡푢푣푥\",7,\"푮푰푱푲\"],[\"be81\",\"푳\",4,\"푺푻푽푾풁풃\",4,\"풊풌풎\",5,\"풕\",8,\"쐴쐼쐽쑈쑤쑥쑨쑬쑴쑵쑹쒀쒔쒜쒸쒼쓩쓰쓱쓴쓸쓺쓿씀씁씌씐씔씜씨씩씬씰씸씹씻씽아악안앉않알앍앎앓암압앗았앙앝앞애액앤앨앰앱앳앴앵야약얀얄얇얌얍얏양얕얗얘얜얠얩어억언얹얻얼얽얾엄\",6,\"엌엎\"],[\"bf41\",\"풞\",10,\"풪\",14],[\"bf61\",\"풹\",18,\"퓍퓎퓏퓑퓒퓓퓕\"],[\"bf81\",\"퓖\",5,\"퓝퓞퓠\",7,\"퓩퓪퓫퓭퓮퓯퓱\",6,\"퓹퓺퓼에엑엔엘엠엡엣엥여역엮연열엶엷염\",5,\"옅옆옇예옌옐옘옙옛옜오옥온올옭옮옰옳옴옵옷옹옻와왁완왈왐왑왓왔왕왜왝왠왬왯왱외왹왼욀욈욉욋욍요욕욘욜욤욥욧용우욱운울욹욺움웁웃웅워웍원월웜웝웠웡웨\"],[\"c041\",\"퓾\",5,\"픅픆픇픉픊픋픍\",6,\"픖픘\",5],[\"c061\",\"픞\",25],[\"c081\",\"픸픹픺픻픾픿핁핂핃핅\",6,\"핎핐핒\",5,\"핚핛핝핞핟핡핢핣웩웬웰웸웹웽위윅윈윌윔윕윗윙유육윤율윰윱윳융윷으윽은을읊음읍읏응\",7,\"읜읠읨읫이익인일읽읾잃임입잇있잉잊잎자작잔잖잗잘잚잠잡잣잤장잦재잭잰잴잼잽잿쟀쟁쟈쟉쟌쟎쟐쟘쟝쟤쟨쟬저적전절젊\"],[\"c141\",\"핤핦핧핪핬핮\",5,\"핶핷핹핺핻핽\",6,\"햆햊햋\"],[\"c161\",\"햌햍햎햏햑\",19,\"햦햧\"],[\"c181\",\"햨\",31,\"점접젓정젖제젝젠젤젬젭젯젱져젼졀졈졉졌졍졔조족존졸졺좀좁좃종좆좇좋좌좍좔좝좟좡좨좼좽죄죈죌죔죕죗죙죠죡죤죵주죽준줄줅줆줌줍줏중줘줬줴쥐쥑쥔쥘쥠쥡쥣쥬쥰쥴쥼즈즉즌즐즘즙즛증지직진짇질짊짐집짓\"],[\"c241\",\"헊헋헍헎헏헑헓\",4,\"헚헜헞\",5,\"헦헧헩헪헫헭헮\"],[\"c261\",\"헯\",4,\"헶헸헺\",5,\"혂혃혅혆혇혉\",6,\"혒\"],[\"c281\",\"혖\",5,\"혝혞혟혡혢혣혥\",7,\"혮\",9,\"혺혻징짖짙짚짜짝짠짢짤짧짬짭짯짰짱째짹짼쨀쨈쨉쨋쨌쨍쨔쨘쨩쩌쩍쩐쩔쩜쩝쩟쩠쩡쩨쩽쪄쪘쪼쪽쫀쫄쫌쫍쫏쫑쫓쫘쫙쫠쫬쫴쬈쬐쬔쬘쬠쬡쭁쭈쭉쭌쭐쭘쭙쭝쭤쭸쭹쮜쮸쯔쯤쯧쯩찌찍찐찔찜찝찡찢찧차착찬찮찰참찹찻\"],[\"c341\",\"혽혾혿홁홂홃홄홆홇홊홌홎홏홐홒홓홖홗홙홚홛홝\",4],[\"c361\",\"홢\",4,\"홨홪\",5,\"홲홳홵\",11],[\"c381\",\"횁횂횄횆\",5,\"횎횏횑횒횓횕\",7,\"횞횠횢\",5,\"횩횪찼창찾채책챈챌챔챕챗챘챙챠챤챦챨챰챵처척천철첨첩첫첬청체첵첸첼쳄쳅쳇쳉쳐쳔쳤쳬쳰촁초촉촌촐촘촙촛총촤촨촬촹최쵠쵤쵬쵭쵯쵱쵸춈추축춘출춤춥춧충춰췄췌췐취췬췰췸췹췻췽츄츈츌츔츙츠측츤츨츰츱츳층\"],[\"c441\",\"횫횭횮횯횱\",7,\"횺횼\",7,\"훆훇훉훊훋\"],[\"c461\",\"훍훎훏훐훒훓훕훖훘훚\",5,\"훡훢훣훥훦훧훩\",4],[\"c481\",\"훮훯훱훲훳훴훶\",5,\"훾훿휁휂휃휅\",11,\"휒휓휔치칙친칟칠칡침칩칫칭카칵칸칼캄캅캇캉캐캑캔캘캠캡캣캤캥캬캭컁커컥컨컫컬컴컵컷컸컹케켁켄켈켐켑켓켕켜켠켤켬켭켯켰켱켸코콕콘콜콤콥콧콩콰콱콴콸쾀쾅쾌쾡쾨쾰쿄쿠쿡쿤쿨쿰쿱쿳쿵쿼퀀퀄퀑퀘퀭퀴퀵퀸퀼\"],[\"c541\",\"휕휖휗휚휛휝휞휟휡\",6,\"휪휬휮\",5,\"휶휷휹\"],[\"c561\",\"휺휻휽\",6,\"흅흆흈흊\",5,\"흒흓흕흚\",4],[\"c581\",\"흟흢흤흦흧흨흪흫흭흮흯흱흲흳흵\",6,\"흾흿힀힂\",5,\"힊힋큄큅큇큉큐큔큘큠크큭큰클큼큽킁키킥킨킬킴킵킷킹타탁탄탈탉탐탑탓탔탕태택탠탤탬탭탯탰탱탸턍터턱턴털턺텀텁텃텄텅테텍텐텔템텝텟텡텨텬텼톄톈토톡톤톨톰톱톳통톺톼퇀퇘퇴퇸툇툉툐투툭툰툴툼툽툿퉁퉈퉜\"],[\"c641\",\"힍힎힏힑\",6,\"힚힜힞\",5],[\"c6a1\",\"퉤튀튁튄튈튐튑튕튜튠튤튬튱트특튼튿틀틂틈틉틋틔틘틜틤틥티틱틴틸팀팁팃팅파팍팎판팔팖팜팝팟팠팡팥패팩팬팰팸팹팻팼팽퍄퍅퍼퍽펀펄펌펍펏펐펑페펙펜펠펨펩펫펭펴편펼폄폅폈평폐폘폡폣포폭폰폴폼폽폿퐁\"],[\"c7a1\",\"퐈퐝푀푄표푠푤푭푯푸푹푼푿풀풂품풉풋풍풔풩퓌퓐퓔퓜퓟퓨퓬퓰퓸퓻퓽프픈플픔픕픗피픽핀필핌핍핏핑하학한할핥함합핫항해핵핸핼햄햅햇했행햐향허헉헌헐헒험헙헛헝헤헥헨헬헴헵헷헹혀혁현혈혐협혓혔형혜혠\"],[\"c8a1\",\"혤혭호혹혼홀홅홈홉홋홍홑화확환활홧황홰홱홴횃횅회획횐횔횝횟횡효횬횰횹횻후훅훈훌훑훔훗훙훠훤훨훰훵훼훽휀휄휑휘휙휜휠휨휩휫휭휴휵휸휼흄흇흉흐흑흔흖흗흘흙흠흡흣흥흩희흰흴흼흽힁히힉힌힐힘힙힛힝\"],[\"caa1\",\"伽佳假價加可呵哥嘉嫁家暇架枷柯歌珂痂稼苛茄街袈訶賈跏軻迦駕刻却各恪慤殼珏脚覺角閣侃刊墾奸姦干幹懇揀杆柬桿澗癎看磵稈竿簡肝艮艱諫間乫喝曷渴碣竭葛褐蝎鞨勘坎堪嵌感憾戡敢柑橄減甘疳監瞰紺邯鑑鑒龕\"],[\"cba1\",\"匣岬甲胛鉀閘剛堈姜岡崗康强彊慷江畺疆糠絳綱羌腔舡薑襁講鋼降鱇介价個凱塏愷愾慨改槪漑疥皆盖箇芥蓋豈鎧開喀客坑更粳羹醵倨去居巨拒据據擧渠炬祛距踞車遽鉅鋸乾件健巾建愆楗腱虔蹇鍵騫乞傑杰桀儉劍劒檢\"],[\"cca1\",\"瞼鈐黔劫怯迲偈憩揭擊格檄激膈覡隔堅牽犬甄絹繭肩見譴遣鵑抉決潔結缺訣兼慊箝謙鉗鎌京俓倞傾儆勁勍卿坰境庚徑慶憬擎敬景暻更梗涇炅烱璟璥瓊痙硬磬竟競絅經耕耿脛莖警輕逕鏡頃頸驚鯨係啓堺契季屆悸戒桂械\"],[\"cda1\",\"棨溪界癸磎稽系繫繼計誡谿階鷄古叩告呱固姑孤尻庫拷攷故敲暠枯槁沽痼皐睾稿羔考股膏苦苽菰藁蠱袴誥賈辜錮雇顧高鼓哭斛曲梏穀谷鵠困坤崑昆梱棍滾琨袞鯤汨滑骨供公共功孔工恐恭拱控攻珙空蚣貢鞏串寡戈果瓜\"],[\"cea1\",\"科菓誇課跨過鍋顆廓槨藿郭串冠官寬慣棺款灌琯瓘管罐菅觀貫關館刮恝括适侊光匡壙廣曠洸炚狂珖筐胱鑛卦掛罫乖傀塊壞怪愧拐槐魁宏紘肱轟交僑咬喬嬌嶠巧攪敎校橋狡皎矯絞翹膠蕎蛟較轎郊餃驕鮫丘久九仇俱具勾\"],[\"cfa1\",\"區口句咎嘔坵垢寇嶇廐懼拘救枸柩構歐毆毬求溝灸狗玖球瞿矩究絿耉臼舅舊苟衢謳購軀逑邱鉤銶駒驅鳩鷗龜國局菊鞠鞫麴君窘群裙軍郡堀屈掘窟宮弓穹窮芎躬倦券勸卷圈拳捲權淃眷厥獗蕨蹶闕机櫃潰詭軌饋句晷歸貴\"],[\"d0a1\",\"鬼龜叫圭奎揆槻珪硅窺竅糾葵規赳逵閨勻均畇筠菌鈞龜橘克剋劇戟棘極隙僅劤勤懃斤根槿瑾筋芹菫覲謹近饉契今妗擒昑檎琴禁禽芩衾衿襟金錦伋及急扱汲級給亘兢矜肯企伎其冀嗜器圻基埼夔奇妓寄岐崎己幾忌技旗旣\"],[\"d1a1\",\"朞期杞棋棄機欺氣汽沂淇玘琦琪璂璣畸畿碁磯祁祇祈祺箕紀綺羈耆耭肌記譏豈起錡錤飢饑騎騏驥麒緊佶吉拮桔金喫儺喇奈娜懦懶拏拿癩\",5,\"那樂\",4,\"諾酪駱亂卵暖欄煖爛蘭難鸞捏捺南嵐枏楠湳濫男藍襤拉\"],[\"d2a1\",\"納臘蠟衲囊娘廊\",4,\"乃來內奈柰耐冷女年撚秊念恬拈捻寧寗努勞奴弩怒擄櫓爐瑙盧\",5,\"駑魯\",10,\"濃籠聾膿農惱牢磊腦賂雷尿壘\",7,\"嫩訥杻紐勒\",5,\"能菱陵尼泥匿溺多茶\"],[\"d3a1\",\"丹亶但單團壇彖斷旦檀段湍短端簞緞蛋袒鄲鍛撻澾獺疸達啖坍憺擔曇淡湛潭澹痰聃膽蕁覃談譚錟沓畓答踏遝唐堂塘幢戇撞棠當糖螳黨代垈坮大對岱帶待戴擡玳臺袋貸隊黛宅德悳倒刀到圖堵塗導屠島嶋度徒悼挑掉搗桃\"],[\"d4a1\",\"棹櫂淘渡滔濤燾盜睹禱稻萄覩賭跳蹈逃途道都鍍陶韜毒瀆牘犢獨督禿篤纛讀墩惇敦旽暾沌焞燉豚頓乭突仝冬凍動同憧東桐棟洞潼疼瞳童胴董銅兜斗杜枓痘竇荳讀豆逗頭屯臀芚遁遯鈍得嶝橙燈登等藤謄鄧騰喇懶拏癩羅\"],[\"d5a1\",\"蘿螺裸邏樂洛烙珞絡落諾酪駱丹亂卵欄欒瀾爛蘭鸞剌辣嵐擥攬欖濫籃纜藍襤覽拉臘蠟廊朗浪狼琅瑯螂郞來崍徠萊冷掠略亮倆兩凉梁樑粮粱糧良諒輛量侶儷勵呂廬慮戾旅櫚濾礪藜蠣閭驢驪麗黎力曆歷瀝礫轢靂憐戀攣漣\"],[\"d6a1\",\"煉璉練聯蓮輦連鍊冽列劣洌烈裂廉斂殮濂簾獵令伶囹寧岺嶺怜玲笭羚翎聆逞鈴零靈領齡例澧禮醴隷勞怒撈擄櫓潞瀘爐盧老蘆虜路輅露魯鷺鹵碌祿綠菉錄鹿麓論壟弄朧瀧瓏籠聾儡瀨牢磊賂賚賴雷了僚寮廖料燎療瞭聊蓼\"],[\"d7a1\",\"遼鬧龍壘婁屢樓淚漏瘻累縷蔞褸鏤陋劉旒柳榴流溜瀏琉瑠留瘤硫謬類六戮陸侖倫崙淪綸輪律慄栗率隆勒肋凜凌楞稜綾菱陵俚利厘吏唎履悧李梨浬犁狸理璃異痢籬罹羸莉裏裡里釐離鯉吝潾燐璘藺躪隣鱗麟林淋琳臨霖砬\"],[\"d8a1\",\"立笠粒摩瑪痲碼磨馬魔麻寞幕漠膜莫邈万卍娩巒彎慢挽晩曼滿漫灣瞞萬蔓蠻輓饅鰻唜抹末沫茉襪靺亡妄忘忙望網罔芒茫莽輞邙埋妹媒寐昧枚梅每煤罵買賣邁魅脈貊陌驀麥孟氓猛盲盟萌冪覓免冕勉棉沔眄眠綿緬面麵滅\"],[\"d9a1\",\"蔑冥名命明暝椧溟皿瞑茗蓂螟酩銘鳴袂侮冒募姆帽慕摸摹暮某模母毛牟牡瑁眸矛耗芼茅謀謨貌木沐牧目睦穆鶩歿沒夢朦蒙卯墓妙廟描昴杳渺猫竗苗錨務巫憮懋戊拇撫无楙武毋無珷畝繆舞茂蕪誣貿霧鵡墨默們刎吻問文\"],[\"daa1\",\"汶紊紋聞蚊門雯勿沕物味媚尾嵋彌微未梶楣渼湄眉米美薇謎迷靡黴岷悶愍憫敏旻旼民泯玟珉緡閔密蜜謐剝博拍搏撲朴樸泊珀璞箔粕縛膊舶薄迫雹駁伴半反叛拌搬攀斑槃泮潘班畔瘢盤盼磐磻礬絆般蟠返頒飯勃拔撥渤潑\"],[\"dba1\",\"發跋醱鉢髮魃倣傍坊妨尨幇彷房放方旁昉枋榜滂磅紡肪膀舫芳蒡蚌訪謗邦防龐倍俳北培徘拜排杯湃焙盃背胚裴裵褙賠輩配陪伯佰帛柏栢白百魄幡樊煩燔番磻繁蕃藩飜伐筏罰閥凡帆梵氾汎泛犯範范法琺僻劈壁擘檗璧癖\"],[\"dca1\",\"碧蘗闢霹便卞弁變辨辯邊別瞥鱉鼈丙倂兵屛幷昞昺柄棅炳甁病秉竝輧餠騈保堡報寶普步洑湺潽珤甫菩補褓譜輔伏僕匐卜宓復服福腹茯蔔複覆輹輻馥鰒本乶俸奉封峯峰捧棒烽熢琫縫蓬蜂逢鋒鳳不付俯傅剖副否咐埠夫婦\"],[\"dda1\",\"孚孵富府復扶敷斧浮溥父符簿缶腐腑膚艀芙莩訃負賦賻赴趺部釜阜附駙鳧北分吩噴墳奔奮忿憤扮昐汾焚盆粉糞紛芬賁雰不佛弗彿拂崩朋棚硼繃鵬丕備匕匪卑妃婢庇悲憊扉批斐枇榧比毖毗毘沸泌琵痺砒碑秕秘粃緋翡肥\"],[\"dea1\",\"脾臂菲蜚裨誹譬費鄙非飛鼻嚬嬪彬斌檳殯浜濱瀕牝玭貧賓頻憑氷聘騁乍事些仕伺似使俟僿史司唆嗣四士奢娑寫寺射巳師徙思捨斜斯柶査梭死沙泗渣瀉獅砂社祀祠私篩紗絲肆舍莎蓑蛇裟詐詞謝賜赦辭邪飼駟麝削數朔索\"],[\"dfa1\",\"傘刪山散汕珊産疝算蒜酸霰乷撒殺煞薩三參杉森渗芟蔘衫揷澁鈒颯上傷像償商喪嘗孀尙峠常床庠廂想桑橡湘爽牀狀相祥箱翔裳觴詳象賞霜塞璽賽嗇塞穡索色牲生甥省笙墅壻嶼序庶徐恕抒捿敍暑曙書栖棲犀瑞筮絮緖署\"],[\"e0a1\",\"胥舒薯西誓逝鋤黍鼠夕奭席惜昔晳析汐淅潟石碩蓆釋錫仙僊先善嬋宣扇敾旋渲煽琁瑄璇璿癬禪線繕羨腺膳船蘚蟬詵跣選銑鐥饍鮮卨屑楔泄洩渫舌薛褻設說雪齧剡暹殲纖蟾贍閃陝攝涉燮葉城姓宬性惺成星晟猩珹盛省筬\"],[\"e1a1\",\"聖聲腥誠醒世勢歲洗稅笹細說貰召嘯塑宵小少巢所掃搔昭梳沼消溯瀟炤燒甦疏疎瘙笑篠簫素紹蔬蕭蘇訴逍遡邵銷韶騷俗屬束涑粟續謖贖速孫巽損蓀遜飡率宋悚松淞訟誦送頌刷殺灑碎鎖衰釗修受嗽囚垂壽嫂守岫峀帥愁\"],[\"e2a1\",\"戍手授搜收數樹殊水洙漱燧狩獸琇璲瘦睡秀穗竪粹綏綬繡羞脩茱蒐蓚藪袖誰讐輸遂邃酬銖銹隋隧隨雖需須首髓鬚叔塾夙孰宿淑潚熟琡璹肅菽巡徇循恂旬栒楯橓殉洵淳珣盾瞬筍純脣舜荀蓴蕣詢諄醇錞順馴戌術述鉥崇崧\"],[\"e3a1\",\"嵩瑟膝蝨濕拾習褶襲丞乘僧勝升承昇繩蠅陞侍匙嘶始媤尸屎屍市弑恃施是時枾柴猜矢示翅蒔蓍視試詩諡豕豺埴寔式息拭植殖湜熄篒蝕識軾食飾伸侁信呻娠宸愼新晨燼申神紳腎臣莘薪藎蜃訊身辛辰迅失室實悉審尋心沁\"],[\"e4a1\",\"沈深瀋甚芯諶什十拾雙氏亞俄兒啞娥峨我牙芽莪蛾衙訝阿雅餓鴉鵝堊岳嶽幄惡愕握樂渥鄂鍔顎鰐齷安岸按晏案眼雁鞍顔鮟斡謁軋閼唵岩巖庵暗癌菴闇壓押狎鴨仰央怏昻殃秧鴦厓哀埃崖愛曖涯碍艾隘靄厄扼掖液縊腋額\"],[\"e5a1\",\"櫻罌鶯鸚也倻冶夜惹揶椰爺耶若野弱掠略約若葯蒻藥躍亮佯兩凉壤孃恙揚攘敭暘梁楊樣洋瀁煬痒瘍禳穰糧羊良襄諒讓釀陽量養圄御於漁瘀禦語馭魚齬億憶抑檍臆偃堰彦焉言諺孼蘖俺儼嚴奄掩淹嶪業円予余勵呂女如廬\"],[\"e6a1\",\"旅歟汝濾璵礖礪與艅茹輿轝閭餘驪麗黎亦力域役易曆歷疫繹譯轢逆驛嚥堧姸娟宴年延憐戀捐挻撚椽沇沿涎涓淵演漣烟然煙煉燃燕璉硏硯秊筵緣練縯聯衍軟輦蓮連鉛鍊鳶列劣咽悅涅烈熱裂說閱厭廉念捻染殮炎焰琰艶苒\"],[\"e7a1\",\"簾閻髥鹽曄獵燁葉令囹塋寧嶺嶸影怜映暎楹榮永泳渶潁濚瀛瀯煐營獰玲瑛瑩瓔盈穎纓羚聆英詠迎鈴鍈零霙靈領乂倪例刈叡曳汭濊猊睿穢芮藝蘂禮裔詣譽豫醴銳隸霓預五伍俉傲午吾吳嗚塢墺奧娛寤悟惡懊敖旿晤梧汚澳\"],[\"e8a1\",\"烏熬獒筽蜈誤鰲鼇屋沃獄玉鈺溫瑥瘟穩縕蘊兀壅擁瓮甕癰翁邕雍饔渦瓦窩窪臥蛙蝸訛婉完宛梡椀浣玩琓琬碗緩翫脘腕莞豌阮頑曰往旺枉汪王倭娃歪矮外嵬巍猥畏了僚僥凹堯夭妖姚寥寮尿嶢拗搖撓擾料曜樂橈燎燿瑤療\"],[\"e9a1\",\"窈窯繇繞耀腰蓼蟯要謠遙遼邀饒慾欲浴縟褥辱俑傭冗勇埇墉容庸慂榕涌湧溶熔瑢用甬聳茸蓉踊鎔鏞龍于佑偶優又友右宇寓尤愚憂旴牛玗瑀盂祐禑禹紆羽芋藕虞迂遇郵釪隅雨雩勖彧旭昱栯煜稶郁頊云暈橒殞澐熉耘芸蕓\"],[\"eaa1\",\"運隕雲韻蔚鬱亐熊雄元原員圓園垣媛嫄寃怨愿援沅洹湲源爰猿瑗苑袁轅遠阮院願鴛月越鉞位偉僞危圍委威尉慰暐渭爲瑋緯胃萎葦蔿蝟衛褘謂違韋魏乳侑儒兪劉唯喩孺宥幼幽庾悠惟愈愉揄攸有杻柔柚柳楡楢油洧流游溜\"],[\"eba1\",\"濡猶猷琉瑜由留癒硫紐維臾萸裕誘諛諭踰蹂遊逾遺酉釉鍮類六堉戮毓肉育陸倫允奫尹崙淪潤玧胤贇輪鈗閏律慄栗率聿戎瀜絨融隆垠恩慇殷誾銀隱乙吟淫蔭陰音飮揖泣邑凝應膺鷹依倚儀宜意懿擬椅毅疑矣義艤薏蟻衣誼\"],[\"eca1\",\"議醫二以伊利吏夷姨履已弛彛怡易李梨泥爾珥理異痍痢移罹而耳肄苡荑裏裡貽貳邇里離飴餌匿溺瀷益翊翌翼謚人仁刃印吝咽因姻寅引忍湮燐璘絪茵藺蚓認隣靭靷鱗麟一佚佾壹日溢逸鎰馹任壬妊姙恁林淋稔臨荏賃入卄\"],[\"eda1\",\"立笠粒仍剩孕芿仔刺咨姉姿子字孜恣慈滋炙煮玆瓷疵磁紫者自茨蔗藉諮資雌作勺嚼斫昨灼炸爵綽芍酌雀鵲孱棧殘潺盞岑暫潛箴簪蠶雜丈仗匠場墻壯奬將帳庄張掌暲杖樟檣欌漿牆狀獐璋章粧腸臟臧莊葬蔣薔藏裝贓醬長\"],[\"eea1\",\"障再哉在宰才材栽梓渽滓災縡裁財載齋齎爭箏諍錚佇低儲咀姐底抵杵楮樗沮渚狙猪疽箸紵苧菹著藷詛貯躇這邸雎齟勣吊嫡寂摘敵滴狄炙的積笛籍績翟荻謫賊赤跡蹟迪迹適鏑佃佺傳全典前剪塡塼奠專展廛悛戰栓殿氈澱\"],[\"efa1\",\"煎琠田甸畑癲筌箋箭篆纏詮輾轉鈿銓錢鐫電顚顫餞切截折浙癤竊節絶占岾店漸点粘霑鮎點接摺蝶丁井亭停偵呈姃定幀庭廷征情挺政整旌晶晸柾楨檉正汀淀淨渟湞瀞炡玎珽町睛碇禎程穽精綎艇訂諪貞鄭酊釘鉦鋌錠霆靖\"],[\"f0a1\",\"靜頂鼎制劑啼堤帝弟悌提梯濟祭第臍薺製諸蹄醍除際霽題齊俎兆凋助嘲弔彫措操早晁曺曹朝條棗槽漕潮照燥爪璪眺祖祚租稠窕粗糟組繰肇藻蚤詔調趙躁造遭釣阻雕鳥族簇足鏃存尊卒拙猝倧宗從悰慫棕淙琮種終綜縱腫\"],[\"f1a1\",\"踪踵鍾鐘佐坐左座挫罪主住侏做姝胄呪周嗾奏宙州廚晝朱柱株注洲湊澍炷珠疇籌紂紬綢舟蛛註誅走躊輳週酎酒鑄駐竹粥俊儁准埈寯峻晙樽浚準濬焌畯竣蠢逡遵雋駿茁中仲衆重卽櫛楫汁葺增憎曾拯烝甑症繒蒸證贈之只\"],[\"f2a1\",\"咫地址志持指摯支旨智枝枳止池沚漬知砥祉祗紙肢脂至芝芷蜘誌識贄趾遲直稙稷織職唇嗔塵振搢晉晋桭榛殄津溱珍瑨璡畛疹盡眞瞋秦縉縝臻蔯袗診賑軫辰進鎭陣陳震侄叱姪嫉帙桎瓆疾秩窒膣蛭質跌迭斟朕什執潗緝輯\"],[\"f3a1\",\"鏶集徵懲澄且侘借叉嗟嵯差次此磋箚茶蹉車遮捉搾着窄錯鑿齪撰澯燦璨瓚竄簒纂粲纘讚贊鑽餐饌刹察擦札紮僭參塹慘慙懺斬站讒讖倉倡創唱娼廠彰愴敞昌昶暢槍滄漲猖瘡窓脹艙菖蒼債埰寀寨彩採砦綵菜蔡采釵冊柵策\"],[\"f4a1\",\"責凄妻悽處倜刺剔尺慽戚拓擲斥滌瘠脊蹠陟隻仟千喘天川擅泉淺玔穿舛薦賤踐遷釧闡阡韆凸哲喆徹撤澈綴輟轍鐵僉尖沾添甛瞻簽籤詹諂堞妾帖捷牒疊睫諜貼輒廳晴淸聽菁請靑鯖切剃替涕滯締諦逮遞體初剿哨憔抄招梢\"],[\"f5a1\",\"椒楚樵炒焦硝礁礎秒稍肖艸苕草蕉貂超酢醋醮促囑燭矗蜀觸寸忖村邨叢塚寵悤憁摠總聰蔥銃撮催崔最墜抽推椎楸樞湫皺秋芻萩諏趨追鄒酋醜錐錘鎚雛騶鰍丑畜祝竺筑築縮蓄蹙蹴軸逐春椿瑃出朮黜充忠沖蟲衝衷悴膵萃\"],[\"f6a1\",\"贅取吹嘴娶就炊翠聚脆臭趣醉驟鷲側仄厠惻測層侈値嗤峙幟恥梔治淄熾痔痴癡稚穉緇緻置致蚩輜雉馳齒則勅飭親七柒漆侵寢枕沈浸琛砧針鍼蟄秤稱快他咤唾墮妥惰打拖朶楕舵陀馱駝倬卓啄坼度托拓擢晫柝濁濯琢琸託\"],[\"f7a1\",\"鐸呑嘆坦彈憚歎灘炭綻誕奪脫探眈耽貪塔搭榻宕帑湯糖蕩兌台太怠態殆汰泰笞胎苔跆邰颱宅擇澤撑攄兎吐土討慟桶洞痛筒統通堆槌腿褪退頹偸套妬投透鬪慝特闖坡婆巴把播擺杷波派爬琶破罷芭跛頗判坂板版瓣販辦鈑\"],[\"f8a1\",\"阪八叭捌佩唄悖敗沛浿牌狽稗覇貝彭澎烹膨愎便偏扁片篇編翩遍鞭騙貶坪平枰萍評吠嬖幣廢弊斃肺蔽閉陛佈包匍匏咆哺圃布怖抛抱捕暴泡浦疱砲胞脯苞葡蒲袍褒逋鋪飽鮑幅暴曝瀑爆輻俵剽彪慓杓標漂瓢票表豹飇飄驃\"],[\"f9a1\",\"品稟楓諷豊風馮彼披疲皮被避陂匹弼必泌珌畢疋筆苾馝乏逼下何厦夏廈昰河瑕荷蝦賀遐霞鰕壑學虐謔鶴寒恨悍旱汗漢澣瀚罕翰閑閒限韓割轄函含咸啣喊檻涵緘艦銜陷鹹合哈盒蛤閤闔陜亢伉姮嫦巷恒抗杭桁沆港缸肛航\"],[\"faa1\",\"行降項亥偕咳垓奚孩害懈楷海瀣蟹解該諧邂駭骸劾核倖幸杏荇行享向嚮珦鄕響餉饗香噓墟虛許憲櫶獻軒歇險驗奕爀赫革俔峴弦懸晛泫炫玄玹現眩睍絃絢縣舷衒見賢鉉顯孑穴血頁嫌俠協夾峽挾浹狹脅脇莢鋏頰亨兄刑型\"],[\"fba1\",\"形泂滎瀅灐炯熒珩瑩荊螢衡逈邢鎣馨兮彗惠慧暳蕙蹊醯鞋乎互呼壕壺好岵弧戶扈昊晧毫浩淏湖滸澔濠濩灝狐琥瑚瓠皓祜糊縞胡芦葫蒿虎號蝴護豪鎬頀顥惑或酷婚昏混渾琿魂忽惚笏哄弘汞泓洪烘紅虹訌鴻化和嬅樺火畵\"],[\"fca1\",\"禍禾花華話譁貨靴廓擴攫確碻穫丸喚奐宦幻患換歡晥桓渙煥環紈還驩鰥活滑猾豁闊凰幌徨恍惶愰慌晃晄榥況湟滉潢煌璜皇篁簧荒蝗遑隍黃匯回廻徊恢悔懷晦會檜淮澮灰獪繪膾茴蛔誨賄劃獲宖橫鐄哮嚆孝效斅曉梟涍淆\"],[\"fda1\",\"爻肴酵驍侯候厚后吼喉嗅帿後朽煦珝逅勛勳塤壎焄熏燻薰訓暈薨喧暄煊萱卉喙毁彙徽揮暉煇諱輝麾休携烋畦虧恤譎鷸兇凶匈洶胸黑昕欣炘痕吃屹紇訖欠欽歆吸恰洽翕興僖凞喜噫囍姬嬉希憙憘戱晞曦熙熹熺犧禧稀羲詰\"]]"); /***/ }), /* 643 */ /***/ (function(module) { module.exports = JSON.parse("[[\"0\",\"\\u0000\",127],[\"a140\",\" ,、。.‧;:?!︰…‥﹐﹑﹒·﹔﹕﹖﹗|–︱—︳╴︴﹏()︵︶{}︷︸〔〕︹︺【】︻︼《》︽︾〈〉︿﹀「」﹁﹂『』﹃﹄﹙﹚\"],[\"a1a1\",\"﹛﹜﹝﹞‘’“”〝〞‵′#&*※§〃○●△▲◎☆★◇◆□■▽▼㊣℅¯ ̄_ˍ﹉﹊﹍﹎﹋﹌﹟﹠﹡+-×÷±√<>=≦≧≠∞≒≡﹢\",4,\"~∩∪⊥∠∟⊿㏒㏑∫∮∵∴♀♂⊕⊙↑↓←→↖↗↙↘∥∣/\"],[\"a240\",\"\∕﹨$¥〒¢£%@℃℉﹩﹪﹫㏕㎜㎝㎞㏎㎡㎎㎏㏄°兙兛兞兝兡兣嗧瓩糎▁\",7,\"▏▎▍▌▋▊▉┼┴┬┤├▔─│▕┌┐└┘╭\"],[\"a2a1\",\"╮╰╯═╞╪╡◢◣◥◤╱╲╳0\",9,\"Ⅰ\",9,\"〡\",8,\"十卄卅A\",25,\"a\",21],[\"a340\",\"wxyzΑ\",16,\"Σ\",6,\"α\",16,\"σ\",6,\"ㄅ\",10],[\"a3a1\",\"ㄐ\",25,\"˙ˉˊˇˋ\"],[\"a3e1\",\"€\"],[\"a440\",\"一乙丁七乃九了二人儿入八几刀刁力匕十卜又三下丈上丫丸凡久么也乞于亡兀刃勺千叉口土士夕大女子孑孓寸小尢尸山川工己已巳巾干廾弋弓才\"],[\"a4a1\",\"丑丐不中丰丹之尹予云井互五亢仁什仃仆仇仍今介仄元允內六兮公冗凶分切刈勻勾勿化匹午升卅卞厄友及反壬天夫太夭孔少尤尺屯巴幻廿弔引心戈戶手扎支文斗斤方日曰月木欠止歹毋比毛氏水火爪父爻片牙牛犬王丙\"],[\"a540\",\"世丕且丘主乍乏乎以付仔仕他仗代令仙仞充兄冉冊冬凹出凸刊加功包匆北匝仟半卉卡占卯卮去可古右召叮叩叨叼司叵叫另只史叱台句叭叻四囚外\"],[\"a5a1\",\"央失奴奶孕它尼巨巧左市布平幼弁弘弗必戊打扔扒扑斥旦朮本未末札正母民氐永汁汀氾犯玄玉瓜瓦甘生用甩田由甲申疋白皮皿目矛矢石示禾穴立丞丟乒乓乩亙交亦亥仿伉伙伊伕伍伐休伏仲件任仰仳份企伋光兇兆先全\"],[\"a640\",\"共再冰列刑划刎刖劣匈匡匠印危吉吏同吊吐吁吋各向名合吃后吆吒因回囝圳地在圭圬圯圩夙多夷夸妄奸妃好她如妁字存宇守宅安寺尖屹州帆并年\"],[\"a6a1\",\"式弛忙忖戎戌戍成扣扛托收早旨旬旭曲曳有朽朴朱朵次此死氖汝汗汙江池汐汕污汛汍汎灰牟牝百竹米糸缶羊羽老考而耒耳聿肉肋肌臣自至臼舌舛舟艮色艾虫血行衣西阡串亨位住佇佗佞伴佛何估佐佑伽伺伸佃佔似但佣\"],[\"a740\",\"作你伯低伶余佝佈佚兌克免兵冶冷別判利刪刨劫助努劬匣即卵吝吭吞吾否呎吧呆呃吳呈呂君吩告吹吻吸吮吵吶吠吼呀吱含吟听囪困囤囫坊坑址坍\"],[\"a7a1\",\"均坎圾坐坏圻壯夾妝妒妨妞妣妙妖妍妤妓妊妥孝孜孚孛完宋宏尬局屁尿尾岐岑岔岌巫希序庇床廷弄弟彤形彷役忘忌志忍忱快忸忪戒我抄抗抖技扶抉扭把扼找批扳抒扯折扮投抓抑抆改攻攸旱更束李杏材村杜杖杞杉杆杠\"],[\"a840\",\"杓杗步每求汞沙沁沈沉沅沛汪決沐汰沌汨沖沒汽沃汲汾汴沆汶沍沔沘沂灶灼災灸牢牡牠狄狂玖甬甫男甸皂盯矣私秀禿究系罕肖肓肝肘肛肚育良芒\"],[\"a8a1\",\"芋芍見角言谷豆豕貝赤走足身車辛辰迂迆迅迄巡邑邢邪邦那酉釆里防阮阱阪阬並乖乳事些亞享京佯依侍佳使佬供例來侃佰併侈佩佻侖佾侏侑佺兔兒兕兩具其典冽函刻券刷刺到刮制剁劾劻卒協卓卑卦卷卸卹取叔受味呵\"],[\"a940\",\"咖呸咕咀呻呷咄咒咆呼咐呱呶和咚呢周咋命咎固垃坷坪坩坡坦坤坼夜奉奇奈奄奔妾妻委妹妮姑姆姐姍始姓姊妯妳姒姅孟孤季宗定官宜宙宛尚屈居\"],[\"a9a1\",\"屆岷岡岸岩岫岱岳帘帚帖帕帛帑幸庚店府底庖延弦弧弩往征彿彼忝忠忽念忿怏怔怯怵怖怪怕怡性怩怫怛或戕房戾所承拉拌拄抿拂抹拒招披拓拔拋拈抨抽押拐拙拇拍抵拚抱拘拖拗拆抬拎放斧於旺昔易昌昆昂明昀昏昕昊\"],[\"aa40\",\"昇服朋杭枋枕東果杳杷枇枝林杯杰板枉松析杵枚枓杼杪杲欣武歧歿氓氛泣注泳沱泌泥河沽沾沼波沫法泓沸泄油況沮泗泅泱沿治泡泛泊沬泯泜泖泠\"],[\"aaa1\",\"炕炎炒炊炙爬爭爸版牧物狀狎狙狗狐玩玨玟玫玥甽疝疙疚的盂盲直知矽社祀祁秉秈空穹竺糾罔羌羋者肺肥肢肱股肫肩肴肪肯臥臾舍芳芝芙芭芽芟芹花芬芥芯芸芣芰芾芷虎虱初表軋迎返近邵邸邱邶采金長門阜陀阿阻附\"],[\"ab40\",\"陂隹雨青非亟亭亮信侵侯便俠俑俏保促侶俘俟俊俗侮俐俄係俚俎俞侷兗冒冑冠剎剃削前剌剋則勇勉勃勁匍南卻厚叛咬哀咨哎哉咸咦咳哇哂咽咪品\"],[\"aba1\",\"哄哈咯咫咱咻咩咧咿囿垂型垠垣垢城垮垓奕契奏奎奐姜姘姿姣姨娃姥姪姚姦威姻孩宣宦室客宥封屎屏屍屋峙峒巷帝帥帟幽庠度建弈弭彥很待徊律徇後徉怒思怠急怎怨恍恰恨恢恆恃恬恫恪恤扁拜挖按拼拭持拮拽指拱拷\"],[\"ac40\",\"拯括拾拴挑挂政故斫施既春昭映昧是星昨昱昤曷柿染柱柔某柬架枯柵柩柯柄柑枴柚查枸柏柞柳枰柙柢柝柒歪殃殆段毒毗氟泉洋洲洪流津洌洱洞洗\"],[\"aca1\",\"活洽派洶洛泵洹洧洸洩洮洵洎洫炫為炳炬炯炭炸炮炤爰牲牯牴狩狠狡玷珊玻玲珍珀玳甚甭畏界畎畋疫疤疥疢疣癸皆皇皈盈盆盃盅省盹相眉看盾盼眇矜砂研砌砍祆祉祈祇禹禺科秒秋穿突竿竽籽紂紅紀紉紇約紆缸美羿耄\"],[\"ad40\",\"耐耍耑耶胖胥胚胃胄背胡胛胎胞胤胝致舢苧范茅苣苛苦茄若茂茉苒苗英茁苜苔苑苞苓苟苯茆虐虹虻虺衍衫要觔計訂訃貞負赴赳趴軍軌述迦迢迪迥\"],[\"ada1\",\"迭迫迤迨郊郎郁郃酋酊重閂限陋陌降面革韋韭音頁風飛食首香乘亳倌倍倣俯倦倥俸倩倖倆值借倚倒們俺倀倔倨俱倡個候倘俳修倭倪俾倫倉兼冤冥冢凍凌准凋剖剜剔剛剝匪卿原厝叟哨唐唁唷哼哥哲唆哺唔哩哭員唉哮哪\"],[\"ae40\",\"哦唧唇哽唏圃圄埂埔埋埃堉夏套奘奚娑娘娜娟娛娓姬娠娣娩娥娌娉孫屘宰害家宴宮宵容宸射屑展屐峭峽峻峪峨峰島崁峴差席師庫庭座弱徒徑徐恙\"],[\"aea1\",\"恣恥恐恕恭恩息悄悟悚悍悔悌悅悖扇拳挈拿捎挾振捕捂捆捏捉挺捐挽挪挫挨捍捌效敉料旁旅時晉晏晃晒晌晅晁書朔朕朗校核案框桓根桂桔栩梳栗桌桑栽柴桐桀格桃株桅栓栘桁殊殉殷氣氧氨氦氤泰浪涕消涇浦浸海浙涓\"],[\"af40\",\"浬涉浮浚浴浩涌涊浹涅浥涔烊烘烤烙烈烏爹特狼狹狽狸狷玆班琉珮珠珪珞畔畝畜畚留疾病症疲疳疽疼疹痂疸皋皰益盍盎眩真眠眨矩砰砧砸砝破砷\"],[\"afa1\",\"砥砭砠砟砲祕祐祠祟祖神祝祗祚秤秣秧租秦秩秘窄窈站笆笑粉紡紗紋紊素索純紐紕級紜納紙紛缺罟羔翅翁耆耘耕耙耗耽耿胱脂胰脅胭胴脆胸胳脈能脊胼胯臭臬舀舐航舫舨般芻茫荒荔荊茸荐草茵茴荏茲茹茶茗荀茱茨荃\"],[\"b040\",\"虔蚊蚪蚓蚤蚩蚌蚣蚜衰衷袁袂衽衹記訐討訌訕訊託訓訖訏訑豈豺豹財貢起躬軒軔軏辱送逆迷退迺迴逃追逅迸邕郡郝郢酒配酌釘針釗釜釙閃院陣陡\"],[\"b0a1\",\"陛陝除陘陞隻飢馬骨高鬥鬲鬼乾偺偽停假偃偌做偉健偶偎偕偵側偷偏倏偯偭兜冕凰剪副勒務勘動匐匏匙匿區匾參曼商啪啦啄啞啡啃啊唱啖問啕唯啤唸售啜唬啣唳啁啗圈國圉域堅堊堆埠埤基堂堵執培夠奢娶婁婉婦婪婀\"],[\"b140\",\"娼婢婚婆婊孰寇寅寄寂宿密尉專將屠屜屝崇崆崎崛崖崢崑崩崔崙崤崧崗巢常帶帳帷康庸庶庵庾張強彗彬彩彫得徙從徘御徠徜恿患悉悠您惋悴惦悽\"],[\"b1a1\",\"情悻悵惜悼惘惕惆惟悸惚惇戚戛扈掠控捲掖探接捷捧掘措捱掩掉掃掛捫推掄授掙採掬排掏掀捻捩捨捺敝敖救教敗啟敏敘敕敔斜斛斬族旋旌旎晝晚晤晨晦晞曹勗望梁梯梢梓梵桿桶梱梧梗械梃棄梭梆梅梔條梨梟梡梂欲殺\"],[\"b240\",\"毫毬氫涎涼淳淙液淡淌淤添淺清淇淋涯淑涮淞淹涸混淵淅淒渚涵淚淫淘淪深淮淨淆淄涪淬涿淦烹焉焊烽烯爽牽犁猜猛猖猓猙率琅琊球理現琍瓠瓶\"],[\"b2a1\",\"瓷甜產略畦畢異疏痔痕疵痊痍皎盔盒盛眷眾眼眶眸眺硫硃硎祥票祭移窒窕笠笨笛第符笙笞笮粒粗粕絆絃統紮紹紼絀細紳組累終紲紱缽羞羚翌翎習耜聊聆脯脖脣脫脩脰脤舂舵舷舶船莎莞莘荸莢莖莽莫莒莊莓莉莠荷荻荼\"],[\"b340\",\"莆莧處彪蛇蛀蚶蛄蚵蛆蛋蚱蚯蛉術袞袈被袒袖袍袋覓規訪訝訣訥許設訟訛訢豉豚販責貫貨貪貧赧赦趾趺軛軟這逍通逗連速逝逐逕逞造透逢逖逛途\"],[\"b3a1\",\"部郭都酗野釵釦釣釧釭釩閉陪陵陳陸陰陴陶陷陬雀雪雩章竟頂頃魚鳥鹵鹿麥麻傢傍傅備傑傀傖傘傚最凱割剴創剩勞勝勛博厥啻喀喧啼喊喝喘喂喜喪喔喇喋喃喳單喟唾喲喚喻喬喱啾喉喫喙圍堯堪場堤堰報堡堝堠壹壺奠\"],[\"b440\",\"婷媚婿媒媛媧孳孱寒富寓寐尊尋就嵌嵐崴嵇巽幅帽幀幃幾廊廁廂廄弼彭復循徨惑惡悲悶惠愜愣惺愕惰惻惴慨惱愎惶愉愀愒戟扉掣掌描揀揩揉揆揍\"],[\"b4a1\",\"插揣提握揖揭揮捶援揪換摒揚揹敞敦敢散斑斐斯普晰晴晶景暑智晾晷曾替期朝棺棕棠棘棗椅棟棵森棧棹棒棲棣棋棍植椒椎棉棚楮棻款欺欽殘殖殼毯氮氯氬港游湔渡渲湧湊渠渥渣減湛湘渤湖湮渭渦湯渴湍渺測湃渝渾滋\"],[\"b540\",\"溉渙湎湣湄湲湩湟焙焚焦焰無然煮焜牌犄犀猶猥猴猩琺琪琳琢琥琵琶琴琯琛琦琨甥甦畫番痢痛痣痙痘痞痠登發皖皓皴盜睏短硝硬硯稍稈程稅稀窘\"],[\"b5a1\",\"窗窖童竣等策筆筐筒答筍筋筏筑粟粥絞結絨絕紫絮絲絡給絢絰絳善翔翕耋聒肅腕腔腋腑腎脹腆脾腌腓腴舒舜菩萃菸萍菠菅萋菁華菱菴著萊菰萌菌菽菲菊萸萎萄菜萇菔菟虛蛟蛙蛭蛔蛛蛤蛐蛞街裁裂袱覃視註詠評詞証詁\"],[\"b640\",\"詔詛詐詆訴診訶詖象貂貯貼貳貽賁費賀貴買貶貿貸越超趁跎距跋跚跑跌跛跆軻軸軼辜逮逵週逸進逶鄂郵鄉郾酣酥量鈔鈕鈣鈉鈞鈍鈐鈇鈑閔閏開閑\"],[\"b6a1\",\"間閒閎隊階隋陽隅隆隍陲隄雁雅雄集雇雯雲韌項順須飧飪飯飩飲飭馮馭黃黍黑亂傭債傲傳僅傾催傷傻傯僇剿剷剽募勦勤勢勣匯嗟嗨嗓嗦嗎嗜嗇嗑嗣嗤嗯嗚嗡嗅嗆嗥嗉園圓塞塑塘塗塚塔填塌塭塊塢塒塋奧嫁嫉嫌媾媽媼\"],[\"b740\",\"媳嫂媲嵩嵯幌幹廉廈弒彙徬微愚意慈感想愛惹愁愈慎慌慄慍愾愴愧愍愆愷戡戢搓搾搞搪搭搽搬搏搜搔損搶搖搗搆敬斟新暗暉暇暈暖暄暘暍會榔業\"],[\"b7a1\",\"楚楷楠楔極椰概楊楨楫楞楓楹榆楝楣楛歇歲毀殿毓毽溢溯滓溶滂源溝滇滅溥溘溼溺溫滑準溜滄滔溪溧溴煎煙煩煤煉照煜煬煦煌煥煞煆煨煖爺牒猷獅猿猾瑯瑚瑕瑟瑞瑁琿瑙瑛瑜當畸瘀痰瘁痲痱痺痿痴痳盞盟睛睫睦睞督\"],[\"b840\",\"睹睪睬睜睥睨睢矮碎碰碗碘碌碉硼碑碓硿祺祿禁萬禽稜稚稠稔稟稞窟窠筷節筠筮筧粱粳粵經絹綑綁綏絛置罩罪署義羨群聖聘肆肄腱腰腸腥腮腳腫\"],[\"b8a1\",\"腹腺腦舅艇蒂葷落萱葵葦葫葉葬葛萼萵葡董葩葭葆虞虜號蛹蜓蜈蜇蜀蛾蛻蜂蜃蜆蜊衙裟裔裙補裘裝裡裊裕裒覜解詫該詳試詩詰誇詼詣誠話誅詭詢詮詬詹詻訾詨豢貊貉賊資賈賄貲賃賂賅跡跟跨路跳跺跪跤跦躲較載軾輊\"],[\"b940\",\"辟農運遊道遂達逼違遐遇遏過遍遑逾遁鄒鄗酬酪酩釉鈷鉗鈸鈽鉀鈾鉛鉋鉤鉑鈴鉉鉍鉅鈹鈿鉚閘隘隔隕雍雋雉雊雷電雹零靖靴靶預頑頓頊頒頌飼飴\"],[\"b9a1\",\"飽飾馳馱馴髡鳩麂鼎鼓鼠僧僮僥僖僭僚僕像僑僱僎僩兢凳劃劂匱厭嗾嘀嘛嘗嗽嘔嘆嘉嘍嘎嗷嘖嘟嘈嘐嗶團圖塵塾境墓墊塹墅塽壽夥夢夤奪奩嫡嫦嫩嫗嫖嫘嫣孵寞寧寡寥實寨寢寤察對屢嶄嶇幛幣幕幗幔廓廖弊彆彰徹慇\"],[\"ba40\",\"愿態慷慢慣慟慚慘慵截撇摘摔撤摸摟摺摑摧搴摭摻敲斡旗旖暢暨暝榜榨榕槁榮槓構榛榷榻榫榴槐槍榭槌榦槃榣歉歌氳漳演滾漓滴漩漾漠漬漏漂漢\"],[\"baa1\",\"滿滯漆漱漸漲漣漕漫漯澈漪滬漁滲滌滷熔熙煽熊熄熒爾犒犖獄獐瑤瑣瑪瑰瑭甄疑瘧瘍瘋瘉瘓盡監瞄睽睿睡磁碟碧碳碩碣禎福禍種稱窪窩竭端管箕箋筵算箝箔箏箸箇箄粹粽精綻綰綜綽綾綠緊綴網綱綺綢綿綵綸維緒緇綬\"],[\"bb40\",\"罰翠翡翟聞聚肇腐膀膏膈膊腿膂臧臺與舔舞艋蓉蒿蓆蓄蒙蒞蒲蒜蓋蒸蓀蓓蒐蒼蓑蓊蜿蜜蜻蜢蜥蜴蜘蝕蜷蜩裳褂裴裹裸製裨褚裯誦誌語誣認誡誓誤\"],[\"bba1\",\"說誥誨誘誑誚誧豪貍貌賓賑賒赫趙趕跼輔輒輕輓辣遠遘遜遣遙遞遢遝遛鄙鄘鄞酵酸酷酴鉸銀銅銘銖鉻銓銜銨鉼銑閡閨閩閣閥閤隙障際雌雒需靼鞅韶頗領颯颱餃餅餌餉駁骯骰髦魁魂鳴鳶鳳麼鼻齊億儀僻僵價儂儈儉儅凜\"],[\"bc40\",\"劇劈劉劍劊勰厲嘮嘻嘹嘲嘿嘴嘩噓噎噗噴嘶嘯嘰墀墟增墳墜墮墩墦奭嬉嫻嬋嫵嬌嬈寮寬審寫層履嶝嶔幢幟幡廢廚廟廝廣廠彈影德徵慶慧慮慝慕憂\"],[\"bca1\",\"慼慰慫慾憧憐憫憎憬憚憤憔憮戮摩摯摹撞撲撈撐撰撥撓撕撩撒撮播撫撚撬撙撢撳敵敷數暮暫暴暱樣樟槨樁樞標槽模樓樊槳樂樅槭樑歐歎殤毅毆漿潼澄潑潦潔澆潭潛潸潮澎潺潰潤澗潘滕潯潠潟熟熬熱熨牖犛獎獗瑩璋璃\"],[\"bd40\",\"瑾璀畿瘠瘩瘟瘤瘦瘡瘢皚皺盤瞎瞇瞌瞑瞋磋磅確磊碾磕碼磐稿稼穀稽稷稻窯窮箭箱範箴篆篇篁箠篌糊締練緯緻緘緬緝編緣線緞緩綞緙緲緹罵罷羯\"],[\"bda1\",\"翩耦膛膜膝膠膚膘蔗蔽蔚蓮蔬蔭蔓蔑蔣蔡蔔蓬蔥蓿蔆螂蝴蝶蝠蝦蝸蝨蝙蝗蝌蝓衛衝褐複褒褓褕褊誼諒談諄誕請諸課諉諂調誰論諍誶誹諛豌豎豬賠賞賦賤賬賭賢賣賜質賡赭趟趣踫踐踝踢踏踩踟踡踞躺輝輛輟輩輦輪輜輞\"],[\"be40\",\"輥適遮遨遭遷鄰鄭鄧鄱醇醉醋醃鋅銻銷鋪銬鋤鋁銳銼鋒鋇鋰銲閭閱霄霆震霉靠鞍鞋鞏頡頫頜颳養餓餒餘駝駐駟駛駑駕駒駙骷髮髯鬧魅魄魷魯鴆鴉\"],[\"bea1\",\"鴃麩麾黎墨齒儒儘儔儐儕冀冪凝劑劓勳噙噫噹噩噤噸噪器噥噱噯噬噢噶壁墾壇壅奮嬝嬴學寰導彊憲憑憩憊懍憶憾懊懈戰擅擁擋撻撼據擄擇擂操撿擒擔撾整曆曉暹曄曇暸樽樸樺橙橫橘樹橄橢橡橋橇樵機橈歙歷氅濂澱澡\"],[\"bf40\",\"濃澤濁澧澳激澹澶澦澠澴熾燉燐燒燈燕熹燎燙燜燃燄獨璜璣璘璟璞瓢甌甍瘴瘸瘺盧盥瞠瞞瞟瞥磨磚磬磧禦積穎穆穌穋窺篙簑築篤篛篡篩篦糕糖縊\"],[\"bfa1\",\"縑縈縛縣縞縝縉縐罹羲翰翱翮耨膳膩膨臻興艘艙蕊蕙蕈蕨蕩蕃蕉蕭蕪蕞螃螟螞螢融衡褪褲褥褫褡親覦諦諺諫諱謀諜諧諮諾謁謂諷諭諳諶諼豫豭貓賴蹄踱踴蹂踹踵輻輯輸輳辨辦遵遴選遲遼遺鄴醒錠錶鋸錳錯錢鋼錫錄錚\"],[\"c040\",\"錐錦錡錕錮錙閻隧隨險雕霎霑霖霍霓霏靛靜靦鞘頰頸頻頷頭頹頤餐館餞餛餡餚駭駢駱骸骼髻髭鬨鮑鴕鴣鴦鴨鴒鴛默黔龍龜優償儡儲勵嚎嚀嚐嚅嚇\"],[\"c0a1\",\"嚏壕壓壑壎嬰嬪嬤孺尷屨嶼嶺嶽嶸幫彌徽應懂懇懦懋戲戴擎擊擘擠擰擦擬擱擢擭斂斃曙曖檀檔檄檢檜櫛檣橾檗檐檠歜殮毚氈濘濱濟濠濛濤濫濯澀濬濡濩濕濮濰燧營燮燦燥燭燬燴燠爵牆獰獲璩環璦璨癆療癌盪瞳瞪瞰瞬\"],[\"c140\",\"瞧瞭矯磷磺磴磯礁禧禪穗窿簇簍篾篷簌篠糠糜糞糢糟糙糝縮績繆縷縲繃縫總縱繅繁縴縹繈縵縿縯罄翳翼聱聲聰聯聳臆臃膺臂臀膿膽臉膾臨舉艱薪\"],[\"c1a1\",\"薄蕾薜薑薔薯薛薇薨薊虧蟀蟑螳蟒蟆螫螻螺蟈蟋褻褶襄褸褽覬謎謗謙講謊謠謝謄謐豁谿豳賺賽購賸賻趨蹉蹋蹈蹊轄輾轂轅輿避遽還邁邂邀鄹醣醞醜鍍鎂錨鍵鍊鍥鍋錘鍾鍬鍛鍰鍚鍔闊闋闌闈闆隱隸雖霜霞鞠韓顆颶餵騁\"],[\"c240\",\"駿鮮鮫鮪鮭鴻鴿麋黏點黜黝黛鼾齋叢嚕嚮壙壘嬸彝懣戳擴擲擾攆擺擻擷斷曜朦檳檬櫃檻檸櫂檮檯歟歸殯瀉瀋濾瀆濺瀑瀏燻燼燾燸獷獵璧璿甕癖癘\"],[\"c2a1\",\"癒瞽瞿瞻瞼礎禮穡穢穠竄竅簫簧簪簞簣簡糧織繕繞繚繡繒繙罈翹翻職聶臍臏舊藏薩藍藐藉薰薺薹薦蟯蟬蟲蟠覆覲觴謨謹謬謫豐贅蹙蹣蹦蹤蹟蹕軀轉轍邇邃邈醫醬釐鎔鎊鎖鎢鎳鎮鎬鎰鎘鎚鎗闔闖闐闕離雜雙雛雞霤鞣鞦\"],[\"c340\",\"鞭韹額顏題顎顓颺餾餿餽餮馥騎髁鬃鬆魏魎魍鯊鯉鯽鯈鯀鵑鵝鵠黠鼕鼬儳嚥壞壟壢寵龐廬懲懷懶懵攀攏曠曝櫥櫝櫚櫓瀛瀟瀨瀚瀝瀕瀘爆爍牘犢獸\"],[\"c3a1\",\"獺璽瓊瓣疇疆癟癡矇礙禱穫穩簾簿簸簽簷籀繫繭繹繩繪羅繳羶羹羸臘藩藝藪藕藤藥藷蟻蠅蠍蟹蟾襠襟襖襞譁譜識證譚譎譏譆譙贈贊蹼蹲躇蹶蹬蹺蹴轔轎辭邊邋醱醮鏡鏑鏟鏃鏈鏜鏝鏖鏢鏍鏘鏤鏗鏨關隴難霪霧靡韜韻類\"],[\"c440\",\"願顛颼饅饉騖騙鬍鯨鯧鯖鯛鶉鵡鵲鵪鵬麒麗麓麴勸嚨嚷嚶嚴嚼壤孀孃孽寶巉懸懺攘攔攙曦朧櫬瀾瀰瀲爐獻瓏癢癥礦礪礬礫竇競籌籃籍糯糰辮繽繼\"],[\"c4a1\",\"纂罌耀臚艦藻藹蘑藺蘆蘋蘇蘊蠔蠕襤覺觸議譬警譯譟譫贏贍躉躁躅躂醴釋鐘鐃鏽闡霰飄饒饑馨騫騰騷騵鰓鰍鹹麵黨鼯齟齣齡儷儸囁囀囂夔屬巍懼懾攝攜斕曩櫻欄櫺殲灌爛犧瓖瓔癩矓籐纏續羼蘗蘭蘚蠣蠢蠡蠟襪襬覽譴\"],[\"c540\",\"護譽贓躊躍躋轟辯醺鐮鐳鐵鐺鐸鐲鐫闢霸霹露響顧顥饗驅驃驀騾髏魔魑鰭鰥鶯鶴鷂鶸麝黯鼙齜齦齧儼儻囈囊囉孿巔巒彎懿攤權歡灑灘玀瓤疊癮癬\"],[\"c5a1\",\"禳籠籟聾聽臟襲襯觼讀贖贗躑躓轡酈鑄鑑鑒霽霾韃韁顫饕驕驍髒鬚鱉鰱鰾鰻鷓鷗鼴齬齪龔囌巖戀攣攫攪曬欐瓚竊籤籣籥纓纖纔臢蘸蘿蠱變邐邏鑣鑠鑤靨顯饜驚驛驗髓體髑鱔鱗鱖鷥麟黴囑壩攬灞癱癲矗罐羈蠶蠹衢讓讒\"],[\"c640\",\"讖艷贛釀鑪靂靈靄韆顰驟鬢魘鱟鷹鷺鹼鹽鼇齷齲廳欖灣籬籮蠻觀躡釁鑲鑰顱饞髖鬣黌灤矚讚鑷韉驢驥纜讜躪釅鑽鑾鑼鱷鱸黷豔鑿鸚爨驪鬱鸛鸞籲\"],[\"c940\",\"乂乜凵匚厂万丌乇亍囗兀屮彳丏冇与丮亓仂仉仈冘勼卬厹圠夃夬尐巿旡殳毌气爿丱丼仨仜仩仡仝仚刌匜卌圢圣夗夯宁宄尒尻屴屳帄庀庂忉戉扐氕\"],[\"c9a1\",\"氶汃氿氻犮犰玊禸肊阞伎优伬仵伔仱伀价伈伝伂伅伢伓伄仴伒冱刓刉刐劦匢匟卍厊吇囡囟圮圪圴夼妀奼妅奻奾奷奿孖尕尥屼屺屻屾巟幵庄异弚彴忕忔忏扜扞扤扡扦扢扙扠扚扥旯旮朾朹朸朻机朿朼朳氘汆汒汜汏汊汔汋\"],[\"ca40\",\"汌灱牞犴犵玎甪癿穵网艸艼芀艽艿虍襾邙邗邘邛邔阢阤阠阣佖伻佢佉体佤伾佧佒佟佁佘伭伳伿佡冏冹刜刞刡劭劮匉卣卲厎厏吰吷吪呔呅吙吜吥吘\"],[\"caa1\",\"吽呏呁吨吤呇囮囧囥坁坅坌坉坋坒夆奀妦妘妠妗妎妢妐妏妧妡宎宒尨尪岍岏岈岋岉岒岊岆岓岕巠帊帎庋庉庌庈庍弅弝彸彶忒忑忐忭忨忮忳忡忤忣忺忯忷忻怀忴戺抃抌抎抏抔抇扱扻扺扰抁抈扷扽扲扴攷旰旴旳旲旵杅杇\"],[\"cb40\",\"杙杕杌杈杝杍杚杋毐氙氚汸汧汫沄沋沏汱汯汩沚汭沇沕沜汦汳汥汻沎灴灺牣犿犽狃狆狁犺狅玕玗玓玔玒町甹疔疕皁礽耴肕肙肐肒肜芐芏芅芎芑芓\"],[\"cba1\",\"芊芃芄豸迉辿邟邡邥邞邧邠阰阨阯阭丳侘佼侅佽侀侇佶佴侉侄佷佌侗佪侚佹侁佸侐侜侔侞侒侂侕佫佮冞冼冾刵刲刳剆刱劼匊匋匼厒厔咇呿咁咑咂咈呫呺呾呥呬呴呦咍呯呡呠咘呣呧呤囷囹坯坲坭坫坱坰坶垀坵坻坳坴坢\"],[\"cc40\",\"坨坽夌奅妵妺姏姎妲姌姁妶妼姃姖妱妽姀姈妴姇孢孥宓宕屄屇岮岤岠岵岯岨岬岟岣岭岢岪岧岝岥岶岰岦帗帔帙弨弢弣弤彔徂彾彽忞忥怭怦怙怲怋\"],[\"cca1\",\"怴怊怗怳怚怞怬怢怍怐怮怓怑怌怉怜戔戽抭抴拑抾抪抶拊抮抳抯抻抩抰抸攽斨斻昉旼昄昒昈旻昃昋昍昅旽昑昐曶朊枅杬枎枒杶杻枘枆构杴枍枌杺枟枑枙枃杽极杸杹枔欥殀歾毞氝沓泬泫泮泙沶泔沭泧沷泐泂沺泃泆泭泲\"],[\"cd40\",\"泒泝沴沊沝沀泞泀洰泍泇沰泹泏泩泑炔炘炅炓炆炄炑炖炂炚炃牪狖狋狘狉狜狒狔狚狌狑玤玡玭玦玢玠玬玝瓝瓨甿畀甾疌疘皯盳盱盰盵矸矼矹矻矺\"],[\"cda1\",\"矷祂礿秅穸穻竻籵糽耵肏肮肣肸肵肭舠芠苀芫芚芘芛芵芧芮芼芞芺芴芨芡芩苂芤苃芶芢虰虯虭虮豖迒迋迓迍迖迕迗邲邴邯邳邰阹阽阼阺陃俍俅俓侲俉俋俁俔俜俙侻侳俛俇俖侺俀侹俬剄剉勀勂匽卼厗厖厙厘咺咡咭咥哏\"],[\"ce40\",\"哃茍咷咮哖咶哅哆咠呰咼咢咾呲哞咰垵垞垟垤垌垗垝垛垔垘垏垙垥垚垕壴复奓姡姞姮娀姱姝姺姽姼姶姤姲姷姛姩姳姵姠姾姴姭宨屌峐峘峌峗峋峛\"],[\"cea1\",\"峞峚峉峇峊峖峓峔峏峈峆峎峟峸巹帡帢帣帠帤庰庤庢庛庣庥弇弮彖徆怷怹恔恲恞恅恓恇恉恛恌恀恂恟怤恄恘恦恮扂扃拏挍挋拵挎挃拫拹挏挌拸拶挀挓挔拺挕拻拰敁敃斪斿昶昡昲昵昜昦昢昳昫昺昝昴昹昮朏朐柁柲柈枺\"],[\"cf40\",\"柜枻柸柘柀枷柅柫柤柟枵柍枳柷柶柮柣柂枹柎柧柰枲柼柆柭柌枮柦柛柺柉柊柃柪柋欨殂殄殶毖毘毠氠氡洨洴洭洟洼洿洒洊泚洳洄洙洺洚洑洀洝浂\"],[\"cfa1\",\"洁洘洷洃洏浀洇洠洬洈洢洉洐炷炟炾炱炰炡炴炵炩牁牉牊牬牰牳牮狊狤狨狫狟狪狦狣玅珌珂珈珅玹玶玵玴珫玿珇玾珃珆玸珋瓬瓮甮畇畈疧疪癹盄眈眃眄眅眊盷盻盺矧矨砆砑砒砅砐砏砎砉砃砓祊祌祋祅祄秕种秏秖秎窀\"],[\"d040\",\"穾竑笀笁籺籸籹籿粀粁紃紈紁罘羑羍羾耇耎耏耔耷胘胇胠胑胈胂胐胅胣胙胜胊胕胉胏胗胦胍臿舡芔苙苾苹茇苨茀苕茺苫苖苴苬苡苲苵茌苻苶苰苪\"],[\"d0a1\",\"苤苠苺苳苭虷虴虼虳衁衎衧衪衩觓訄訇赲迣迡迮迠郱邽邿郕郅邾郇郋郈釔釓陔陏陑陓陊陎倞倅倇倓倢倰倛俵俴倳倷倬俶俷倗倜倠倧倵倯倱倎党冔冓凊凄凅凈凎剡剚剒剞剟剕剢勍匎厞唦哢唗唒哧哳哤唚哿唄唈哫唑唅哱\"],[\"d140\",\"唊哻哷哸哠唎唃唋圁圂埌堲埕埒垺埆垽垼垸垶垿埇埐垹埁夎奊娙娖娭娮娕娏娗娊娞娳孬宧宭宬尃屖屔峬峿峮峱峷崀峹帩帨庨庮庪庬弳弰彧恝恚恧\"],[\"d1a1\",\"恁悢悈悀悒悁悝悃悕悛悗悇悜悎戙扆拲挐捖挬捄捅挶捃揤挹捋捊挼挩捁挴捘捔捙挭捇挳捚捑挸捗捀捈敊敆旆旃旄旂晊晟晇晑朒朓栟栚桉栲栳栻桋桏栖栱栜栵栫栭栯桎桄栴栝栒栔栦栨栮桍栺栥栠欬欯欭欱欴歭肂殈毦毤\"],[\"d240\",\"毨毣毢毧氥浺浣浤浶洍浡涒浘浢浭浯涑涍淯浿涆浞浧浠涗浰浼浟涂涘洯浨涋浾涀涄洖涃浻浽浵涐烜烓烑烝烋缹烢烗烒烞烠烔烍烅烆烇烚烎烡牂牸\"],[\"d2a1\",\"牷牶猀狺狴狾狶狳狻猁珓珙珥珖玼珧珣珩珜珒珛珔珝珚珗珘珨瓞瓟瓴瓵甡畛畟疰痁疻痄痀疿疶疺皊盉眝眛眐眓眒眣眑眕眙眚眢眧砣砬砢砵砯砨砮砫砡砩砳砪砱祔祛祏祜祓祒祑秫秬秠秮秭秪秜秞秝窆窉窅窋窌窊窇竘笐\"],[\"d340\",\"笄笓笅笏笈笊笎笉笒粄粑粊粌粈粍粅紞紝紑紎紘紖紓紟紒紏紌罜罡罞罠罝罛羖羒翃翂翀耖耾耹胺胲胹胵脁胻脀舁舯舥茳茭荄茙荑茥荖茿荁茦茜茢\"],[\"d3a1\",\"荂荎茛茪茈茼荍茖茤茠茷茯茩荇荅荌荓茞茬荋茧荈虓虒蚢蚨蚖蚍蚑蚞蚇蚗蚆蚋蚚蚅蚥蚙蚡蚧蚕蚘蚎蚝蚐蚔衃衄衭衵衶衲袀衱衿衯袃衾衴衼訒豇豗豻貤貣赶赸趵趷趶軑軓迾迵适迿迻逄迼迶郖郠郙郚郣郟郥郘郛郗郜郤酐\"],[\"d440\",\"酎酏釕釢釚陜陟隼飣髟鬯乿偰偪偡偞偠偓偋偝偲偈偍偁偛偊偢倕偅偟偩偫偣偤偆偀偮偳偗偑凐剫剭剬剮勖勓匭厜啵啶唼啍啐唴唪啑啢唶唵唰啒啅\"],[\"d4a1\",\"唌唲啥啎唹啈唭唻啀啋圊圇埻堔埢埶埜埴堀埭埽堈埸堋埳埏堇埮埣埲埥埬埡堎埼堐埧堁堌埱埩埰堍堄奜婠婘婕婧婞娸娵婭婐婟婥婬婓婤婗婃婝婒婄婛婈媎娾婍娹婌婰婩婇婑婖婂婜孲孮寁寀屙崞崋崝崚崠崌崨崍崦崥崏\"],[\"d540\",\"崰崒崣崟崮帾帴庱庴庹庲庳弶弸徛徖徟悊悐悆悾悰悺惓惔惏惤惙惝惈悱惛悷惊悿惃惍惀挲捥掊掂捽掽掞掭掝掗掫掎捯掇掐据掯捵掜捭掮捼掤挻掟\"],[\"d5a1\",\"捸掅掁掑掍捰敓旍晥晡晛晙晜晢朘桹梇梐梜桭桮梮梫楖桯梣梬梩桵桴梲梏桷梒桼桫桲梪梀桱桾梛梖梋梠梉梤桸桻梑梌梊桽欶欳欷欸殑殏殍殎殌氪淀涫涴涳湴涬淩淢涷淶淔渀淈淠淟淖涾淥淜淝淛淴淊涽淭淰涺淕淂淏淉\"],[\"d640\",\"淐淲淓淽淗淍淣涻烺焍烷焗烴焌烰焄烳焐烼烿焆焓焀烸烶焋焂焎牾牻牼牿猝猗猇猑猘猊猈狿猏猞玈珶珸珵琄琁珽琇琀珺珼珿琌琋珴琈畤畣痎痒痏\"],[\"d6a1\",\"痋痌痑痐皏皉盓眹眯眭眱眲眴眳眽眥眻眵硈硒硉硍硊硌砦硅硐祤祧祩祪祣祫祡离秺秸秶秷窏窔窐笵筇笴笥笰笢笤笳笘笪笝笱笫笭笯笲笸笚笣粔粘粖粣紵紽紸紶紺絅紬紩絁絇紾紿絊紻紨罣羕羜羝羛翊翋翍翐翑翇翏翉耟\"],[\"d740\",\"耞耛聇聃聈脘脥脙脛脭脟脬脞脡脕脧脝脢舑舸舳舺舴舲艴莐莣莨莍荺荳莤荴莏莁莕莙荵莔莩荽莃莌莝莛莪莋荾莥莯莈莗莰荿莦莇莮荶莚虙虖蚿蚷\"],[\"d7a1\",\"蛂蛁蛅蚺蚰蛈蚹蚳蚸蛌蚴蚻蚼蛃蚽蚾衒袉袕袨袢袪袚袑袡袟袘袧袙袛袗袤袬袌袓袎覂觖觙觕訰訧訬訞谹谻豜豝豽貥赽赻赹趼跂趹趿跁軘軞軝軜軗軠軡逤逋逑逜逌逡郯郪郰郴郲郳郔郫郬郩酖酘酚酓酕釬釴釱釳釸釤釹釪\"],[\"d840\",\"釫釷釨釮镺閆閈陼陭陫陱陯隿靪頄飥馗傛傕傔傞傋傣傃傌傎傝偨傜傒傂傇兟凔匒匑厤厧喑喨喥喭啷噅喢喓喈喏喵喁喣喒喤啽喌喦啿喕喡喎圌堩堷\"],[\"d8a1\",\"堙堞堧堣堨埵塈堥堜堛堳堿堶堮堹堸堭堬堻奡媯媔媟婺媢媞婸媦婼媥媬媕媮娷媄媊媗媃媋媩婻婽媌媜媏媓媝寪寍寋寔寑寊寎尌尰崷嵃嵫嵁嵋崿崵嵑嵎嵕崳崺嵒崽崱嵙嵂崹嵉崸崼崲崶嵀嵅幄幁彘徦徥徫惉悹惌惢惎惄愔\"],[\"d940\",\"惲愊愖愅惵愓惸惼惾惁愃愘愝愐惿愄愋扊掔掱掰揎揥揨揯揃撝揳揊揠揶揕揲揵摡揟掾揝揜揄揘揓揂揇揌揋揈揰揗揙攲敧敪敤敜敨敥斌斝斞斮旐旒\"],[\"d9a1\",\"晼晬晻暀晱晹晪晲朁椌棓椄棜椪棬棪棱椏棖棷棫棤棶椓椐棳棡椇棌椈楰梴椑棯棆椔棸棐棽棼棨椋椊椗棎棈棝棞棦棴棑椆棔棩椕椥棇欹欻欿欼殔殗殙殕殽毰毲毳氰淼湆湇渟湉溈渼渽湅湢渫渿湁湝湳渜渳湋湀湑渻渃渮湞\"],[\"da40\",\"湨湜湡渱渨湠湱湫渹渢渰湓湥渧湸湤湷湕湹湒湦渵渶湚焠焞焯烻焮焱焣焥焢焲焟焨焺焛牋牚犈犉犆犅犋猒猋猰猢猱猳猧猲猭猦猣猵猌琮琬琰琫琖\"],[\"daa1\",\"琚琡琭琱琤琣琝琩琠琲瓻甯畯畬痧痚痡痦痝痟痤痗皕皒盚睆睇睄睍睅睊睎睋睌矞矬硠硤硥硜硭硱硪确硰硩硨硞硢祴祳祲祰稂稊稃稌稄窙竦竤筊笻筄筈筌筎筀筘筅粢粞粨粡絘絯絣絓絖絧絪絏絭絜絫絒絔絩絑絟絎缾缿罥\"],[\"db40\",\"罦羢羠羡翗聑聏聐胾胔腃腊腒腏腇脽腍脺臦臮臷臸臹舄舼舽舿艵茻菏菹萣菀菨萒菧菤菼菶萐菆菈菫菣莿萁菝菥菘菿菡菋菎菖菵菉萉萏菞萑萆菂菳\"],[\"dba1\",\"菕菺菇菑菪萓菃菬菮菄菻菗菢萛菛菾蛘蛢蛦蛓蛣蛚蛪蛝蛫蛜蛬蛩蛗蛨蛑衈衖衕袺裗袹袸裀袾袶袼袷袽袲褁裉覕覘覗觝觚觛詎詍訹詙詀詗詘詄詅詒詈詑詊詌詏豟貁貀貺貾貰貹貵趄趀趉跘跓跍跇跖跜跏跕跙跈跗跅軯軷軺\"],[\"dc40\",\"軹軦軮軥軵軧軨軶軫軱軬軴軩逭逴逯鄆鄬鄄郿郼鄈郹郻鄁鄀鄇鄅鄃酡酤酟酢酠鈁鈊鈥鈃鈚鈦鈏鈌鈀鈒釿釽鈆鈄鈧鈂鈜鈤鈙鈗鈅鈖镻閍閌閐隇陾隈\"],[\"dca1\",\"隉隃隀雂雈雃雱雰靬靰靮頇颩飫鳦黹亃亄亶傽傿僆傮僄僊傴僈僂傰僁傺傱僋僉傶傸凗剺剸剻剼嗃嗛嗌嗐嗋嗊嗝嗀嗔嗄嗩喿嗒喍嗏嗕嗢嗖嗈嗲嗍嗙嗂圔塓塨塤塏塍塉塯塕塎塝塙塥塛堽塣塱壼嫇嫄嫋媺媸媱媵媰媿嫈媻嫆\"],[\"dd40\",\"媷嫀嫊媴媶嫍媹媐寖寘寙尟尳嵱嵣嵊嵥嵲嵬嵞嵨嵧嵢巰幏幎幊幍幋廅廌廆廋廇彀徯徭惷慉慊愫慅愶愲愮慆愯慏愩慀戠酨戣戥戤揅揱揫搐搒搉搠搤\"],[\"dda1\",\"搳摃搟搕搘搹搷搢搣搌搦搰搨摁搵搯搊搚摀搥搧搋揧搛搮搡搎敯斒旓暆暌暕暐暋暊暙暔晸朠楦楟椸楎楢楱椿楅楪椹楂楗楙楺楈楉椵楬椳椽楥棰楸椴楩楀楯楄楶楘楁楴楌椻楋椷楜楏楑椲楒椯楻椼歆歅歃歂歈歁殛嗀毻毼\"],[\"de40\",\"毹毷毸溛滖滈溏滀溟溓溔溠溱溹滆滒溽滁溞滉溷溰滍溦滏溲溾滃滜滘溙溒溎溍溤溡溿溳滐滊溗溮溣煇煔煒煣煠煁煝煢煲煸煪煡煂煘煃煋煰煟煐煓\"],[\"dea1\",\"煄煍煚牏犍犌犑犐犎猼獂猻猺獀獊獉瑄瑊瑋瑒瑑瑗瑀瑏瑐瑎瑂瑆瑍瑔瓡瓿瓾瓽甝畹畷榃痯瘏瘃痷痾痼痹痸瘐痻痶痭痵痽皙皵盝睕睟睠睒睖睚睩睧睔睙睭矠碇碚碔碏碄碕碅碆碡碃硹碙碀碖硻祼禂祽祹稑稘稙稒稗稕稢稓\"],[\"df40\",\"稛稐窣窢窞竫筦筤筭筴筩筲筥筳筱筰筡筸筶筣粲粴粯綈綆綀綍絿綅絺綎絻綃絼綌綔綄絽綒罭罫罧罨罬羦羥羧翛翜耡腤腠腷腜腩腛腢腲朡腞腶腧腯\"],[\"dfa1\",\"腄腡舝艉艄艀艂艅蓱萿葖葶葹蒏蒍葥葑葀蒆葧萰葍葽葚葙葴葳葝蔇葞萷萺萴葺葃葸萲葅萩菙葋萯葂萭葟葰萹葎葌葒葯蓅蒎萻葇萶萳葨葾葄萫葠葔葮葐蜋蜄蛷蜌蛺蛖蛵蝍蛸蜎蜉蜁蛶蜍蜅裖裋裍裎裞裛裚裌裐覅覛觟觥觤\"],[\"e040\",\"觡觠觢觜触詶誆詿詡訿詷誂誄詵誃誁詴詺谼豋豊豥豤豦貆貄貅賌赨赩趑趌趎趏趍趓趔趐趒跰跠跬跱跮跐跩跣跢跧跲跫跴輆軿輁輀輅輇輈輂輋遒逿\"],[\"e0a1\",\"遄遉逽鄐鄍鄏鄑鄖鄔鄋鄎酮酯鉈鉒鈰鈺鉦鈳鉥鉞銃鈮鉊鉆鉭鉬鉏鉠鉧鉯鈶鉡鉰鈱鉔鉣鉐鉲鉎鉓鉌鉖鈲閟閜閞閛隒隓隑隗雎雺雽雸雵靳靷靸靲頏頍頎颬飶飹馯馲馰馵骭骫魛鳪鳭鳧麀黽僦僔僗僨僳僛僪僝僤僓僬僰僯僣僠\"],[\"e140\",\"凘劀劁勩勫匰厬嘧嘕嘌嘒嗼嘏嘜嘁嘓嘂嗺嘝嘄嗿嗹墉塼墐墘墆墁塿塴墋塺墇墑墎塶墂墈塻墔墏壾奫嫜嫮嫥嫕嫪嫚嫭嫫嫳嫢嫠嫛嫬嫞嫝嫙嫨嫟孷寠\"],[\"e1a1\",\"寣屣嶂嶀嵽嶆嵺嶁嵷嶊嶉嶈嵾嵼嶍嵹嵿幘幙幓廘廑廗廎廜廕廙廒廔彄彃彯徶愬愨慁慞慱慳慒慓慲慬憀慴慔慺慛慥愻慪慡慖戩戧戫搫摍摛摝摴摶摲摳摽摵摦撦摎撂摞摜摋摓摠摐摿搿摬摫摙摥摷敳斠暡暠暟朅朄朢榱榶槉\"],[\"e240\",\"榠槎榖榰榬榼榑榙榎榧榍榩榾榯榿槄榽榤槔榹槊榚槏榳榓榪榡榞槙榗榐槂榵榥槆歊歍歋殞殟殠毃毄毾滎滵滱漃漥滸漷滻漮漉潎漙漚漧漘漻漒滭漊\"],[\"e2a1\",\"漶潳滹滮漭潀漰漼漵滫漇漎潃漅滽滶漹漜滼漺漟漍漞漈漡熇熐熉熀熅熂熏煻熆熁熗牄牓犗犕犓獃獍獑獌瑢瑳瑱瑵瑲瑧瑮甀甂甃畽疐瘖瘈瘌瘕瘑瘊瘔皸瞁睼瞅瞂睮瞀睯睾瞃碲碪碴碭碨硾碫碞碥碠碬碢碤禘禊禋禖禕禔禓\"],[\"e340\",\"禗禈禒禐稫穊稰稯稨稦窨窫窬竮箈箜箊箑箐箖箍箌箛箎箅箘劄箙箤箂粻粿粼粺綧綷緂綣綪緁緀緅綝緎緄緆緋緌綯綹綖綼綟綦綮綩綡緉罳翢翣翥翞\"],[\"e3a1\",\"耤聝聜膉膆膃膇膍膌膋舕蒗蒤蒡蒟蒺蓎蓂蒬蒮蒫蒹蒴蓁蓍蒪蒚蒱蓐蒝蒧蒻蒢蒔蓇蓌蒛蒩蒯蒨蓖蒘蒶蓏蒠蓗蓔蓒蓛蒰蒑虡蜳蜣蜨蝫蝀蜮蜞蜡蜙蜛蝃蜬蝁蜾蝆蜠蜲蜪蜭蜼蜒蜺蜱蜵蝂蜦蜧蜸蜤蜚蜰蜑裷裧裱裲裺裾裮裼裶裻\"],[\"e440\",\"裰裬裫覝覡覟覞觩觫觨誫誙誋誒誏誖谽豨豩賕賏賗趖踉踂跿踍跽踊踃踇踆踅跾踀踄輐輑輎輍鄣鄜鄠鄢鄟鄝鄚鄤鄡鄛酺酲酹酳銥銤鉶銛鉺銠銔銪銍\"],[\"e4a1\",\"銦銚銫鉹銗鉿銣鋮銎銂銕銢鉽銈銡銊銆銌銙銧鉾銇銩銝銋鈭隞隡雿靘靽靺靾鞃鞀鞂靻鞄鞁靿韎韍頖颭颮餂餀餇馝馜駃馹馻馺駂馽駇骱髣髧鬾鬿魠魡魟鳱鳲鳵麧僿儃儰僸儆儇僶僾儋儌僽儊劋劌勱勯噈噂噌嘵噁噊噉噆噘\"],[\"e540\",\"噚噀嘳嘽嘬嘾嘸嘪嘺圚墫墝墱墠墣墯墬墥墡壿嫿嫴嫽嫷嫶嬃嫸嬂嫹嬁嬇嬅嬏屧嶙嶗嶟嶒嶢嶓嶕嶠嶜嶡嶚嶞幩幝幠幜緳廛廞廡彉徲憋憃慹憱憰憢憉\"],[\"e5a1\",\"憛憓憯憭憟憒憪憡憍慦憳戭摮摰撖撠撅撗撜撏撋撊撌撣撟摨撱撘敶敺敹敻斲斳暵暰暩暲暷暪暯樀樆樗槥槸樕槱槤樠槿槬槢樛樝槾樧槲槮樔槷槧橀樈槦槻樍槼槫樉樄樘樥樏槶樦樇槴樖歑殥殣殢殦氁氀毿氂潁漦潾澇濆澒\"],[\"e640\",\"澍澉澌潢潏澅潚澖潶潬澂潕潲潒潐潗澔澓潝漀潡潫潽潧澐潓澋潩潿澕潣潷潪潻熲熯熛熰熠熚熩熵熝熥熞熤熡熪熜熧熳犘犚獘獒獞獟獠獝獛獡獚獙\"],[\"e6a1\",\"獢璇璉璊璆璁瑽璅璈瑼瑹甈甇畾瘥瘞瘙瘝瘜瘣瘚瘨瘛皜皝皞皛瞍瞏瞉瞈磍碻磏磌磑磎磔磈磃磄磉禚禡禠禜禢禛歶稹窲窴窳箷篋箾箬篎箯箹篊箵糅糈糌糋緷緛緪緧緗緡縃緺緦緶緱緰緮緟罶羬羰羭翭翫翪翬翦翨聤聧膣膟\"],[\"e740\",\"膞膕膢膙膗舖艏艓艒艐艎艑蔤蔻蔏蔀蔩蔎蔉蔍蔟蔊蔧蔜蓻蔫蓺蔈蔌蓴蔪蓲蔕蓷蓫蓳蓼蔒蓪蓩蔖蓾蔨蔝蔮蔂蓽蔞蓶蔱蔦蓧蓨蓰蓯蓹蔘蔠蔰蔋蔙蔯虢\"],[\"e7a1\",\"蝖蝣蝤蝷蟡蝳蝘蝔蝛蝒蝡蝚蝑蝞蝭蝪蝐蝎蝟蝝蝯蝬蝺蝮蝜蝥蝏蝻蝵蝢蝧蝩衚褅褌褔褋褗褘褙褆褖褑褎褉覢覤覣觭觰觬諏諆誸諓諑諔諕誻諗誾諀諅諘諃誺誽諙谾豍貏賥賟賙賨賚賝賧趠趜趡趛踠踣踥踤踮踕踛踖踑踙踦踧\"],[\"e840\",\"踔踒踘踓踜踗踚輬輤輘輚輠輣輖輗遳遰遯遧遫鄯鄫鄩鄪鄲鄦鄮醅醆醊醁醂醄醀鋐鋃鋄鋀鋙銶鋏鋱鋟鋘鋩鋗鋝鋌鋯鋂鋨鋊鋈鋎鋦鋍鋕鋉鋠鋞鋧鋑鋓\"],[\"e8a1\",\"銵鋡鋆銴镼閬閫閮閰隤隢雓霅霈霂靚鞊鞎鞈韐韏頞頝頦頩頨頠頛頧颲餈飺餑餔餖餗餕駜駍駏駓駔駎駉駖駘駋駗駌骳髬髫髳髲髱魆魃魧魴魱魦魶魵魰魨魤魬鳼鳺鳽鳿鳷鴇鴀鳹鳻鴈鴅鴄麃黓鼏鼐儜儓儗儚儑凞匴叡噰噠噮\"],[\"e940\",\"噳噦噣噭噲噞噷圜圛壈墽壉墿墺壂墼壆嬗嬙嬛嬡嬔嬓嬐嬖嬨嬚嬠嬞寯嶬嶱嶩嶧嶵嶰嶮嶪嶨嶲嶭嶯嶴幧幨幦幯廩廧廦廨廥彋徼憝憨憖懅憴懆懁懌憺\"],[\"e9a1\",\"憿憸憌擗擖擐擏擉撽撉擃擛擳擙攳敿敼斢曈暾曀曊曋曏暽暻暺曌朣樴橦橉橧樲橨樾橝橭橶橛橑樨橚樻樿橁橪橤橐橏橔橯橩橠樼橞橖橕橍橎橆歕歔歖殧殪殫毈毇氄氃氆澭濋澣濇澼濎濈潞濄澽澞濊澨瀄澥澮澺澬澪濏澿澸\"],[\"ea40\",\"澢濉澫濍澯澲澰燅燂熿熸燖燀燁燋燔燊燇燏熽燘熼燆燚燛犝犞獩獦獧獬獥獫獪瑿璚璠璔璒璕璡甋疀瘯瘭瘱瘽瘳瘼瘵瘲瘰皻盦瞚瞝瞡瞜瞛瞢瞣瞕瞙\"],[\"eaa1\",\"瞗磝磩磥磪磞磣磛磡磢磭磟磠禤穄穈穇窶窸窵窱窷篞篣篧篝篕篥篚篨篹篔篪篢篜篫篘篟糒糔糗糐糑縒縡縗縌縟縠縓縎縜縕縚縢縋縏縖縍縔縥縤罃罻罼罺羱翯耪耩聬膱膦膮膹膵膫膰膬膴膲膷膧臲艕艖艗蕖蕅蕫蕍蕓蕡蕘\"],[\"eb40\",\"蕀蕆蕤蕁蕢蕄蕑蕇蕣蔾蕛蕱蕎蕮蕵蕕蕧蕠薌蕦蕝蕔蕥蕬虣虥虤螛螏螗螓螒螈螁螖螘蝹螇螣螅螐螑螝螄螔螜螚螉褞褦褰褭褮褧褱褢褩褣褯褬褟觱諠\"],[\"eba1\",\"諢諲諴諵諝謔諤諟諰諈諞諡諨諿諯諻貑貒貐賵賮賱賰賳赬赮趥趧踳踾踸蹀蹅踶踼踽蹁踰踿躽輶輮輵輲輹輷輴遶遹遻邆郺鄳鄵鄶醓醐醑醍醏錧錞錈錟錆錏鍺錸錼錛錣錒錁鍆錭錎錍鋋錝鋺錥錓鋹鋷錴錂錤鋿錩錹錵錪錔錌\"],[\"ec40\",\"錋鋾錉錀鋻錖閼闍閾閹閺閶閿閵閽隩雔霋霒霐鞙鞗鞔韰韸頵頯頲餤餟餧餩馞駮駬駥駤駰駣駪駩駧骹骿骴骻髶髺髹髷鬳鮀鮅鮇魼魾魻鮂鮓鮒鮐魺鮕\"],[\"eca1\",\"魽鮈鴥鴗鴠鴞鴔鴩鴝鴘鴢鴐鴙鴟麈麆麇麮麭黕黖黺鼒鼽儦儥儢儤儠儩勴嚓嚌嚍嚆嚄嚃噾嚂噿嚁壖壔壏壒嬭嬥嬲嬣嬬嬧嬦嬯嬮孻寱寲嶷幬幪徾徻懃憵憼懧懠懥懤懨懞擯擩擣擫擤擨斁斀斶旚曒檍檖檁檥檉檟檛檡檞檇檓檎\"],[\"ed40\",\"檕檃檨檤檑橿檦檚檅檌檒歛殭氉濌澩濴濔濣濜濭濧濦濞濲濝濢濨燡燱燨燲燤燰燢獳獮獯璗璲璫璐璪璭璱璥璯甐甑甒甏疄癃癈癉癇皤盩瞵瞫瞲瞷瞶\"],[\"eda1\",\"瞴瞱瞨矰磳磽礂磻磼磲礅磹磾礄禫禨穜穛穖穘穔穚窾竀竁簅簏篲簀篿篻簎篴簋篳簂簉簃簁篸篽簆篰篱簐簊糨縭縼繂縳顈縸縪繉繀繇縩繌縰縻縶繄縺罅罿罾罽翴翲耬膻臄臌臊臅臇膼臩艛艚艜薃薀薏薧薕薠薋薣蕻薤薚薞\"],[\"ee40\",\"蕷蕼薉薡蕺蕸蕗薎薖薆薍薙薝薁薢薂薈薅蕹蕶薘薐薟虨螾螪螭蟅螰螬螹螵螼螮蟉蟃蟂蟌螷螯蟄蟊螴螶螿螸螽蟞螲褵褳褼褾襁襒褷襂覭覯覮觲觳謞\"],[\"eea1\",\"謘謖謑謅謋謢謏謒謕謇謍謈謆謜謓謚豏豰豲豱豯貕貔賹赯蹎蹍蹓蹐蹌蹇轃轀邅遾鄸醚醢醛醙醟醡醝醠鎡鎃鎯鍤鍖鍇鍼鍘鍜鍶鍉鍐鍑鍠鍭鎏鍌鍪鍹鍗鍕鍒鍏鍱鍷鍻鍡鍞鍣鍧鎀鍎鍙闇闀闉闃闅閷隮隰隬霠霟霘霝霙鞚鞡鞜\"],[\"ef40\",\"鞞鞝韕韔韱顁顄顊顉顅顃餥餫餬餪餳餲餯餭餱餰馘馣馡騂駺駴駷駹駸駶駻駽駾駼騃骾髾髽鬁髼魈鮚鮨鮞鮛鮦鮡鮥鮤鮆鮢鮠鮯鴳鵁鵧鴶鴮鴯鴱鴸鴰\"],[\"efa1\",\"鵅鵂鵃鴾鴷鵀鴽翵鴭麊麉麍麰黈黚黻黿鼤鼣鼢齔龠儱儭儮嚘嚜嚗嚚嚝嚙奰嬼屩屪巀幭幮懘懟懭懮懱懪懰懫懖懩擿攄擽擸攁攃擼斔旛曚曛曘櫅檹檽櫡櫆檺檶檷櫇檴檭歞毉氋瀇瀌瀍瀁瀅瀔瀎濿瀀濻瀦濼濷瀊爁燿燹爃燽獶\"],[\"f040\",\"璸瓀璵瓁璾璶璻瓂甔甓癜癤癙癐癓癗癚皦皽盬矂瞺磿礌礓礔礉礐礒礑禭禬穟簜簩簙簠簟簭簝簦簨簢簥簰繜繐繖繣繘繢繟繑繠繗繓羵羳翷翸聵臑臒\"],[\"f0a1\",\"臐艟艞薴藆藀藃藂薳薵薽藇藄薿藋藎藈藅薱薶藒蘤薸薷薾虩蟧蟦蟢蟛蟫蟪蟥蟟蟳蟤蟔蟜蟓蟭蟘蟣螤蟗蟙蠁蟴蟨蟝襓襋襏襌襆襐襑襉謪謧謣謳謰謵譇謯謼謾謱謥謷謦謶謮謤謻謽謺豂豵貙貘貗賾贄贂贀蹜蹢蹠蹗蹖蹞蹥蹧\"],[\"f140\",\"蹛蹚蹡蹝蹩蹔轆轇轈轋鄨鄺鄻鄾醨醥醧醯醪鎵鎌鎒鎷鎛鎝鎉鎧鎎鎪鎞鎦鎕鎈鎙鎟鎍鎱鎑鎲鎤鎨鎴鎣鎥闒闓闑隳雗雚巂雟雘雝霣霢霥鞬鞮鞨鞫鞤鞪\"],[\"f1a1\",\"鞢鞥韗韙韖韘韺顐顑顒颸饁餼餺騏騋騉騍騄騑騊騅騇騆髀髜鬈鬄鬅鬩鬵魊魌魋鯇鯆鯃鮿鯁鮵鮸鯓鮶鯄鮹鮽鵜鵓鵏鵊鵛鵋鵙鵖鵌鵗鵒鵔鵟鵘鵚麎麌黟鼁鼀鼖鼥鼫鼪鼩鼨齌齕儴儵劖勷厴嚫嚭嚦嚧嚪嚬壚壝壛夒嬽嬾嬿巃幰\"],[\"f240\",\"徿懻攇攐攍攉攌攎斄旞旝曞櫧櫠櫌櫑櫙櫋櫟櫜櫐櫫櫏櫍櫞歠殰氌瀙瀧瀠瀖瀫瀡瀢瀣瀩瀗瀤瀜瀪爌爊爇爂爅犥犦犤犣犡瓋瓅璷瓃甖癠矉矊矄矱礝礛\"],[\"f2a1\",\"礡礜礗礞禰穧穨簳簼簹簬簻糬糪繶繵繸繰繷繯繺繲繴繨罋罊羃羆羷翽翾聸臗臕艤艡艣藫藱藭藙藡藨藚藗藬藲藸藘藟藣藜藑藰藦藯藞藢蠀蟺蠃蟶蟷蠉蠌蠋蠆蟼蠈蟿蠊蠂襢襚襛襗襡襜襘襝襙覈覷覶觶譐譈譊譀譓譖譔譋譕\"],[\"f340\",\"譑譂譒譗豃豷豶貚贆贇贉趬趪趭趫蹭蹸蹳蹪蹯蹻軂轒轑轏轐轓辴酀鄿醰醭鏞鏇鏏鏂鏚鏐鏹鏬鏌鏙鎩鏦鏊鏔鏮鏣鏕鏄鏎鏀鏒鏧镽闚闛雡霩霫霬霨霦\"],[\"f3a1\",\"鞳鞷鞶韝韞韟顜顙顝顗颿颽颻颾饈饇饃馦馧騚騕騥騝騤騛騢騠騧騣騞騜騔髂鬋鬊鬎鬌鬷鯪鯫鯠鯞鯤鯦鯢鯰鯔鯗鯬鯜鯙鯥鯕鯡鯚鵷鶁鶊鶄鶈鵱鶀鵸鶆鶋鶌鵽鵫鵴鵵鵰鵩鶅鵳鵻鶂鵯鵹鵿鶇鵨麔麑黀黼鼭齀齁齍齖齗齘匷嚲\"],[\"f440\",\"嚵嚳壣孅巆巇廮廯忀忁懹攗攖攕攓旟曨曣曤櫳櫰櫪櫨櫹櫱櫮櫯瀼瀵瀯瀷瀴瀱灂瀸瀿瀺瀹灀瀻瀳灁爓爔犨獽獼璺皫皪皾盭矌矎矏矍矲礥礣礧礨礤礩\"],[\"f4a1\",\"禲穮穬穭竷籉籈籊籇籅糮繻繾纁纀羺翿聹臛臙舋艨艩蘢藿蘁藾蘛蘀藶蘄蘉蘅蘌藽蠙蠐蠑蠗蠓蠖襣襦覹觷譠譪譝譨譣譥譧譭趮躆躈躄轙轖轗轕轘轚邍酃酁醷醵醲醳鐋鐓鏻鐠鐏鐔鏾鐕鐐鐨鐙鐍鏵鐀鏷鐇鐎鐖鐒鏺鐉鏸鐊鏿\"],[\"f540\",\"鏼鐌鏶鐑鐆闞闠闟霮霯鞹鞻韽韾顠顢顣顟飁飂饐饎饙饌饋饓騲騴騱騬騪騶騩騮騸騭髇髊髆鬐鬒鬑鰋鰈鯷鰅鰒鯸鱀鰇鰎鰆鰗鰔鰉鶟鶙鶤鶝鶒鶘鶐鶛\"],[\"f5a1\",\"鶠鶔鶜鶪鶗鶡鶚鶢鶨鶞鶣鶿鶩鶖鶦鶧麙麛麚黥黤黧黦鼰鼮齛齠齞齝齙龑儺儹劘劗囃嚽嚾孈孇巋巏廱懽攛欂櫼欃櫸欀灃灄灊灈灉灅灆爝爚爙獾甗癪矐礭礱礯籔籓糲纊纇纈纋纆纍罍羻耰臝蘘蘪蘦蘟蘣蘜蘙蘧蘮蘡蘠蘩蘞蘥\"],[\"f640\",\"蠩蠝蠛蠠蠤蠜蠫衊襭襩襮襫觺譹譸譅譺譻贐贔趯躎躌轞轛轝酆酄酅醹鐿鐻鐶鐩鐽鐼鐰鐹鐪鐷鐬鑀鐱闥闤闣霵霺鞿韡顤飉飆飀饘饖騹騽驆驄驂驁騺\"],[\"f6a1\",\"騿髍鬕鬗鬘鬖鬺魒鰫鰝鰜鰬鰣鰨鰩鰤鰡鶷鶶鶼鷁鷇鷊鷏鶾鷅鷃鶻鶵鷎鶹鶺鶬鷈鶱鶭鷌鶳鷍鶲鹺麜黫黮黭鼛鼘鼚鼱齎齥齤龒亹囆囅囋奱孋孌巕巑廲攡攠攦攢欋欈欉氍灕灖灗灒爞爟犩獿瓘瓕瓙瓗癭皭礵禴穰穱籗籜籙籛籚\"],[\"f740\",\"糴糱纑罏羇臞艫蘴蘵蘳蘬蘲蘶蠬蠨蠦蠪蠥襱覿覾觻譾讄讂讆讅譿贕躕躔躚躒躐躖躗轠轢酇鑌鑐鑊鑋鑏鑇鑅鑈鑉鑆霿韣顪顩飋饔饛驎驓驔驌驏驈驊\"],[\"f7a1\",\"驉驒驐髐鬙鬫鬻魖魕鱆鱈鰿鱄鰹鰳鱁鰼鰷鰴鰲鰽鰶鷛鷒鷞鷚鷋鷐鷜鷑鷟鷩鷙鷘鷖鷵鷕鷝麶黰鼵鼳鼲齂齫龕龢儽劙壨壧奲孍巘蠯彏戁戃戄攩攥斖曫欑欒欏毊灛灚爢玂玁玃癰矔籧籦纕艬蘺虀蘹蘼蘱蘻蘾蠰蠲蠮蠳襶襴襳觾\"],[\"f840\",\"讌讎讋讈豅贙躘轤轣醼鑢鑕鑝鑗鑞韄韅頀驖驙鬞鬟鬠鱒鱘鱐鱊鱍鱋鱕鱙鱌鱎鷻鷷鷯鷣鷫鷸鷤鷶鷡鷮鷦鷲鷰鷢鷬鷴鷳鷨鷭黂黐黲黳鼆鼜鼸鼷鼶齃齏\"],[\"f8a1\",\"齱齰齮齯囓囍孎屭攭曭曮欓灟灡灝灠爣瓛瓥矕礸禷禶籪纗羉艭虃蠸蠷蠵衋讔讕躞躟躠躝醾醽釂鑫鑨鑩雥靆靃靇韇韥驞髕魙鱣鱧鱦鱢鱞鱠鸂鷾鸇鸃鸆鸅鸀鸁鸉鷿鷽鸄麠鼞齆齴齵齶囔攮斸欘欙欗欚灢爦犪矘矙礹籩籫糶纚\"],[\"f940\",\"纘纛纙臠臡虆虇虈襹襺襼襻觿讘讙躥躤躣鑮鑭鑯鑱鑳靉顲饟鱨鱮鱭鸋鸍鸐鸏鸒鸑麡黵鼉齇齸齻齺齹圞灦籯蠼趲躦釃鑴鑸鑶鑵驠鱴鱳鱱鱵鸔鸓黶鼊\"],[\"f9a1\",\"龤灨灥糷虪蠾蠽蠿讞貜躩軉靋顳顴飌饡馫驤驦驧鬤鸕鸗齈戇欞爧虌躨钂钀钁驩驨鬮鸙爩虋讟钃鱹麷癵驫鱺鸝灩灪麤齾齉龘碁銹裏墻恒粧嫺╔╦╗╠╬╣╚╩╝╒╤╕╞╪╡╘╧╛╓╥╖╟╫╢╙╨╜║═╭╮╰╯▓\"]]"); /***/ }), /* 644 */ /***/ (function(module) { module.exports = JSON.parse("[[\"8740\",\"䏰䰲䘃䖦䕸𧉧䵷䖳𧲱䳢𧳅㮕䜶䝄䱇䱀𤊿𣘗𧍒𦺋𧃒䱗𪍑䝏䗚䲅𧱬䴇䪤䚡𦬣爥𥩔𡩣𣸆𣽡晍囻\"],[\"8767\",\"綕夝𨮹㷴霴𧯯寛𡵞媤㘥𩺰嫑宷峼杮薓𩥅瑡璝㡵𡵓𣚞𦀡㻬\"],[\"87a1\",\"𥣞㫵竼龗𤅡𨤍𣇪𠪊𣉞䌊蒄龖鐯䤰蘓墖靊鈘秐稲晠権袝瑌篅枂稬剏遆㓦珄𥶹瓆鿇垳䤯呌䄱𣚎堘穲𧭥讏䚮𦺈䆁𥶙箮𢒼鿈𢓁𢓉𢓌鿉蔄𣖻䂴鿊䓡𪷿拁灮鿋\"],[\"8840\",\"㇀\",4,\"𠄌㇅𠃑𠃍㇆㇇𠃋𡿨㇈𠃊㇉㇊㇋㇌𠄎㇍㇎ĀÁǍÀĒÉĚÈŌÓǑÒÊ̄ẾÊ̌ỀÊāáǎàɑēéěèīíǐìōóǒòūúǔùǖǘǚ\"],[\"88a1\",\"ǜüê̄ếê̌ềêɡ⏚⏛\"],[\"8940\",\"𪎩𡅅\"],[\"8943\",\"攊\"],[\"8946\",\"丽滝鵎釟\"],[\"894c\",\"𧜵撑会伨侨兖兴农凤务动医华发变团声处备夲头学实実岚庆总斉柾栄桥济炼电纤纬纺织经统缆缷艺苏药视设询车轧轮\"],[\"89a1\",\"琑糼緍楆竉刧\"],[\"89ab\",\"醌碸酞肼\"],[\"89b0\",\"贋胶𠧧\"],[\"89b5\",\"肟黇䳍鷉鸌䰾𩷶𧀎鸊𪄳㗁\"],[\"89c1\",\"溚舾甙\"],[\"89c5\",\"䤑马骏龙禇𨑬𡷊𠗐𢫦两亁亀亇亿仫伷㑌侽㹈倃傈㑽㒓㒥円夅凛凼刅争剹劐匧㗇厩㕑厰㕓参吣㕭㕲㚁咓咣咴咹哐哯唘唣唨㖘唿㖥㖿嗗㗅\"],[\"8a40\",\"𧶄唥\"],[\"8a43\",\"𠱂𠴕𥄫喐𢳆㧬𠍁蹆𤶸𩓥䁓𨂾睺𢰸㨴䟕𨅝𦧲𤷪擝𠵼𠾴𠳕𡃴撍蹾𠺖𠰋𠽤𢲩𨉖𤓓\"],[\"8a64\",\"𠵆𩩍𨃩䟴𤺧𢳂骲㩧𩗴㿭㔆𥋇𩟔𧣈𢵄鵮頕\"],[\"8a76\",\"䏙𦂥撴哣𢵌𢯊𡁷㧻𡁯\"],[\"8aa1\",\"𦛚𦜖𧦠擪𥁒𠱃蹨𢆡𨭌𠜱\"],[\"8aac\",\"䠋𠆩㿺塳𢶍\"],[\"8ab2\",\"𤗈𠓼𦂗𠽌𠶖啹䂻䎺\"],[\"8abb\",\"䪴𢩦𡂝膪飵𠶜捹㧾𢝵跀嚡摼㹃\"],[\"8ac9\",\"𪘁𠸉𢫏𢳉\"],[\"8ace\",\"𡃈𣧂㦒㨆𨊛㕸𥹉𢃇噒𠼱𢲲𩜠㒼氽𤸻\"],[\"8adf\",\"𧕴𢺋𢈈𪙛𨳍𠹺𠰴𦠜羓𡃏𢠃𢤹㗻𥇣𠺌𠾍𠺪㾓𠼰𠵇𡅏𠹌\"],[\"8af6\",\"𠺫𠮩𠵈𡃀𡄽㿹𢚖搲𠾭\"],[\"8b40\",\"𣏴𧘹𢯎𠵾𠵿𢱑𢱕㨘𠺘𡃇𠼮𪘲𦭐𨳒𨶙𨳊閪哌苄喹\"],[\"8b55\",\"𩻃鰦骶𧝞𢷮煀腭胬尜𦕲脴㞗卟𨂽醶𠻺𠸏𠹷𠻻㗝𤷫㘉𠳖嚯𢞵𡃉𠸐𠹸𡁸𡅈𨈇𡑕𠹹𤹐𢶤婔𡀝𡀞𡃵𡃶垜𠸑\"],[\"8ba1\",\"𧚔𨋍𠾵𠹻𥅾㜃𠾶𡆀𥋘𪊽𤧚𡠺𤅷𨉼墙剨㘚𥜽箲孨䠀䬬鼧䧧鰟鮍𥭴𣄽嗻㗲嚉丨夂𡯁屮靑𠂆乛亻㔾尣彑忄㣺扌攵歺氵氺灬爫丬犭𤣩罒礻糹罓𦉪㓁\"],[\"8bde\",\"𦍋耂肀𦘒𦥑卝衤见𧢲讠贝钅镸长门𨸏韦页风飞饣𩠐鱼鸟黄歯龜丷𠂇阝户钢\"],[\"8c40\",\"倻淾𩱳龦㷉袏𤅎灷峵䬠𥇍㕙𥴰愢𨨲辧釶熑朙玺𣊁𪄇㲋𡦀䬐磤琂冮𨜏䀉橣𪊺䈣蘏𠩯稪𩥇𨫪靕灍匤𢁾鏴盙𨧣龧矝亣俰傼丯众龨吴綋墒壐𡶶庒庙忂𢜒斋\"],[\"8ca1\",\"𣏹椙橃𣱣泿\"],[\"8ca7\",\"爀𤔅玌㻛𤨓嬕璹讃𥲤𥚕窓篬糃繬苸薗龩袐龪躹龫迏蕟駠鈡龬𨶹𡐿䁱䊢娚\"],[\"8cc9\",\"顨杫䉶圽\"],[\"8cce\",\"藖𤥻芿𧄍䲁𦵴嵻𦬕𦾾龭龮宖龯曧繛湗秊㶈䓃𣉖𢞖䎚䔶\"],[\"8ce6\",\"峕𣬚諹屸㴒𣕑嵸龲煗䕘𤃬𡸣䱷㥸㑊𠆤𦱁諌侴𠈹妿腬顖𩣺弻\"],[\"8d40\",\"𠮟\"],[\"8d42\",\"𢇁𨥭䄂䚻𩁹㼇龳𪆵䃸㟖䛷𦱆䅼𨚲𧏿䕭㣔𥒚䕡䔛䶉䱻䵶䗪㿈𤬏㙡䓞䒽䇭崾嵈嵖㷼㠏嶤嶹㠠㠸幂庽弥徃㤈㤔㤿㥍惗愽峥㦉憷憹懏㦸戬抐拥挘㧸嚱\"],[\"8da1\",\"㨃揢揻搇摚㩋擀崕嘡龟㪗斆㪽旿晓㫲暒㬢朖㭂枤栀㭘桊梄㭲㭱㭻椉楃牜楤榟榅㮼槖㯝橥橴橱檂㯬檙㯲檫檵櫔櫶殁毁毪汵沪㳋洂洆洦涁㳯涤涱渕渘温溆𨧀溻滢滚齿滨滩漤漴㵆𣽁澁澾㵪㵵熷岙㶊瀬㶑灐灔灯灿炉𠌥䏁㗱𠻘\"],[\"8e40\",\"𣻗垾𦻓焾𥟠㙎榢𨯩孴穉𥣡𩓙穥穽𥦬窻窰竂竃燑𦒍䇊竚竝竪䇯咲𥰁笋筕笩𥌎𥳾箢筯莜𥮴𦱿篐萡箒箸𥴠㶭𥱥蒒篺簆簵𥳁籄粃𤢂粦晽𤕸糉糇糦籴糳糵糎\"],[\"8ea1\",\"繧䔝𦹄絝𦻖璍綉綫焵綳緒𤁗𦀩緤㴓緵𡟹緥𨍭縝𦄡𦅚繮纒䌫鑬縧罀罁罇礶𦋐駡羗𦍑羣𡙡𠁨䕜𣝦䔃𨌺翺𦒉者耈耝耨耯𪂇𦳃耻耼聡𢜔䦉𦘦𣷣𦛨朥肧𨩈脇脚墰𢛶汿𦒘𤾸擧𡒊舘𡡞橓𤩥𤪕䑺舩𠬍𦩒𣵾俹𡓽蓢荢𦬊𤦧𣔰𡝳𣷸芪椛芳䇛\"],[\"8f40\",\"蕋苐茚𠸖𡞴㛁𣅽𣕚艻苢茘𣺋𦶣𦬅𦮗𣗎㶿茝嗬莅䔋𦶥莬菁菓㑾𦻔橗蕚㒖𦹂𢻯葘𥯤葱㷓䓤檧葊𣲵祘蒨𦮖𦹷𦹃蓞萏莑䒠蒓蓤𥲑䉀𥳀䕃蔴嫲𦺙䔧蕳䔖枿蘖\"],[\"8fa1\",\"𨘥𨘻藁𧂈蘂𡖂𧃍䕫䕪蘨㙈𡢢号𧎚虾蝱𪃸蟮𢰧螱蟚蠏噡虬桖䘏衅衆𧗠𣶹𧗤衞袜䙛袴袵揁装睷𧜏覇覊覦覩覧覼𨨥觧𧤤𧪽誜瞓釾誐𧩙竩𧬺𣾏䜓𧬸煼謌謟𥐰𥕥謿譌譍誩𤩺讐讛誯𡛟䘕衏貛𧵔𧶏貫㜥𧵓賖𧶘𧶽贒贃𡤐賛灜贑𤳉㻐起\"],[\"9040\",\"趩𨀂𡀔𤦊㭼𨆼𧄌竧躭躶軃鋔輙輭𨍥𨐒辥錃𪊟𠩐辳䤪𨧞𨔽𣶻廸𣉢迹𪀔𨚼𨔁𢌥㦀𦻗逷𨔼𧪾遡𨕬𨘋邨𨜓郄𨛦邮都酧㫰醩釄粬𨤳𡺉鈎沟鉁鉢𥖹銹𨫆𣲛𨬌𥗛\"],[\"90a1\",\"𠴱錬鍫𨫡𨯫炏嫃𨫢𨫥䥥鉄𨯬𨰹𨯿鍳鑛躼閅閦鐦閠濶䊹𢙺𨛘𡉼𣸮䧟氜陻隖䅬隣𦻕懚隶磵𨫠隽双䦡𦲸𠉴𦐐𩂯𩃥𤫑𡤕𣌊霱虂霶䨏䔽䖅𤫩灵孁霛靜𩇕靗孊𩇫靟鐥僐𣂷𣂼鞉鞟鞱鞾韀韒韠𥑬韮琜𩐳響韵𩐝𧥺䫑頴頳顋顦㬎𧅵㵑𠘰𤅜\"],[\"9140\",\"𥜆飊颷飈飇䫿𦴧𡛓喰飡飦飬鍸餹𤨩䭲𩡗𩤅駵騌騻騐驘𥜥㛄𩂱𩯕髠髢𩬅髴䰎鬔鬭𨘀倴鬴𦦨㣃𣁽魐魀𩴾婅𡡣鮎𤉋鰂鯿鰌𩹨鷔𩾷𪆒𪆫𪃡𪄣𪇟鵾鶃𪄴鸎梈\"],[\"91a1\",\"鷄𢅛𪆓𪈠𡤻𪈳鴹𪂹𪊴麐麕麞麢䴴麪麯𤍤黁㭠㧥㴝伲㞾𨰫鼂鼈䮖鐤𦶢鼗鼖鼹嚟嚊齅馸𩂋韲葿齢齩竜龎爖䮾𤥵𤦻煷𤧸𤍈𤩑玞𨯚𡣺禟𨥾𨸶鍩鏳𨩄鋬鎁鏋𨥬𤒹爗㻫睲穃烐𤑳𤏸煾𡟯炣𡢾𣖙㻇𡢅𥐯𡟸㜢𡛻𡠹㛡𡝴𡣑𥽋㜣𡛀坛𤨥𡏾𡊨\"],[\"9240\",\"𡏆𡒶蔃𣚦蔃葕𤦔𧅥𣸱𥕜𣻻𧁒䓴𣛮𩦝𦼦柹㜳㰕㷧塬𡤢栐䁗𣜿𤃡𤂋𤄏𦰡哋嚞𦚱嚒𠿟𠮨𠸍鏆𨬓鎜仸儫㠙𤐶亼𠑥𠍿佋侊𥙑婨𠆫𠏋㦙𠌊𠐔㐵伩𠋀𨺳𠉵諚𠈌亘\"],[\"92a1\",\"働儍侢伃𤨎𣺊佂倮偬傁俌俥偘僼兙兛兝兞湶𣖕𣸹𣺿浲𡢄𣺉冨凃𠗠䓝𠒣𠒒𠒑赺𨪜𠜎剙劤𠡳勡鍮䙺熌𤎌𠰠𤦬𡃤槑𠸝瑹㻞璙琔瑖玘䮎𤪼𤂍叐㖄爏𤃉喴𠍅响𠯆圝鉝雴鍦埝垍坿㘾壋媙𨩆𡛺𡝯𡜐娬妸銏婾嫏娒𥥆𡧳𡡡𤊕㛵洅瑃娡𥺃\"],[\"9340\",\"媁𨯗𠐓鏠璌𡌃焅䥲鐈𨧻鎽㞠尞岞幞幈𡦖𡥼𣫮廍孏𡤃𡤄㜁𡢠㛝𡛾㛓脪𨩇𡶺𣑲𨦨弌弎𡤧𡞫婫𡜻孄蘔𧗽衠恾𢡠𢘫忛㺸𢖯𢖾𩂈𦽳懀𠀾𠁆𢘛憙憘恵𢲛𢴇𤛔𩅍\"],[\"93a1\",\"摱𤙥𢭪㨩𢬢𣑐𩣪𢹸挷𪑛撶挱揑𤧣𢵧护𢲡搻敫楲㯴𣂎𣊭𤦉𣊫唍𣋠𡣙𩐿曎𣊉𣆳㫠䆐𥖄𨬢𥖏𡛼𥕛𥐥磮𣄃𡠪𣈴㑤𣈏𣆂𤋉暎𦴤晫䮓昰𧡰𡷫晣𣋒𣋡昞𥡲㣑𣠺𣞼㮙𣞢𣏾瓐㮖枏𤘪梶栞㯄檾㡣𣟕𤒇樳橒櫉欅𡤒攑梘橌㯗橺歗𣿀𣲚鎠鋲𨯪𨫋\"],[\"9440\",\"銉𨀞𨧜鑧涥漋𤧬浧𣽿㶏渄𤀼娽渊塇洤硂焻𤌚𤉶烱牐犇犔𤞏𤜥兹𤪤𠗫瑺𣻸𣙟𤩊𤤗𥿡㼆㺱𤫟𨰣𣼵悧㻳瓌琼鎇琷䒟𦷪䕑疃㽣𤳙𤴆㽘畕癳𪗆㬙瑨𨫌𤦫𤦎㫻\"],[\"94a1\",\"㷍𤩎㻿𤧅𤣳釺圲鍂𨫣𡡤僟𥈡𥇧睸𣈲眎眏睻𤚗𣞁㩞𤣰琸璛㺿𤪺𤫇䃈𤪖𦆮錇𥖁砞碍碈磒珐祙𧝁𥛣䄎禛蒖禥樭𣻺稺秴䅮𡛦䄲鈵秱𠵌𤦌𠊙𣶺𡝮㖗啫㕰㚪𠇔𠰍竢婙𢛵𥪯𥪜娍𠉛磰娪𥯆竾䇹籝籭䈑𥮳𥺼𥺦糍𤧹𡞰粎籼粮檲緜縇緓罎𦉡\"],[\"9540\",\"𦅜𧭈綗𥺂䉪𦭵𠤖柖𠁎𣗏埄𦐒𦏸𤥢翝笧𠠬𥫩𥵃笌𥸎駦虅驣樜𣐿㧢𤧷𦖭騟𦖠蒀𧄧𦳑䓪脷䐂胆脉腂𦞴飃𦩂艢艥𦩑葓𦶧蘐𧈛媆䅿𡡀嬫𡢡嫤𡣘蚠蜨𣶏蠭𧐢娂\"],[\"95a1\",\"衮佅袇袿裦襥襍𥚃襔𧞅𧞄𨯵𨯙𨮜𨧹㺭蒣䛵䛏㟲訽訜𩑈彍鈫𤊄旔焩烄𡡅鵭貟賩𧷜妚矃姰䍮㛔踪躧𤰉輰轊䋴汘澻𢌡䢛潹溋𡟚鯩㚵𤤯邻邗啱䤆醻鐄𨩋䁢𨫼鐧𨰝𨰻蓥訫閙閧閗閖𨴴瑅㻂𤣿𤩂𤏪㻧𣈥随𨻧𨹦𨹥㻌𤧭𤩸𣿮琒瑫㻼靁𩂰\"],[\"9640\",\"桇䨝𩂓𥟟靝鍨𨦉𨰦𨬯𦎾銺嬑譩䤼珹𤈛鞛靱餸𠼦巁𨯅𤪲頟𩓚鋶𩗗釥䓀𨭐𤩧𨭤飜𨩅㼀鈪䤥萔餻饍𧬆㷽馛䭯馪驜𨭥𥣈檏騡嫾騯𩣱䮐𩥈馼䮽䮗鍽塲𡌂堢𤦸\"],[\"96a1\",\"𡓨硄𢜟𣶸棅㵽鑘㤧慐𢞁𢥫愇鱏鱓鱻鰵鰐魿鯏𩸭鮟𪇵𪃾鴡䲮𤄄鸘䲰鴌𪆴𪃭𪃳𩤯鶥蒽𦸒𦿟𦮂藼䔳𦶤𦺄𦷰萠藮𦸀𣟗𦁤秢𣖜𣙀䤭𤧞㵢鏛銾鍈𠊿碹鉷鑍俤㑀遤𥕝砽硔碶硋𡝗𣇉𤥁㚚佲濚濙瀞瀞吔𤆵垻壳垊鴖埗焴㒯𤆬燫𦱀𤾗嬨𡞵𨩉\"],[\"9740\",\"愌嫎娋䊼𤒈㜬䭻𨧼鎻鎸𡣖𠼝葲𦳀𡐓𤋺𢰦𤏁妔𣶷𦝁綨𦅛𦂤𤦹𤦋𨧺鋥珢㻩璴𨭣𡢟㻡𤪳櫘珳珻㻖𤨾𤪔𡟙𤩦𠎧𡐤𤧥瑈𤤖炥𤥶銄珦鍟𠓾錱𨫎𨨖鎆𨯧𥗕䤵𨪂煫\"],[\"97a1\",\"𤥃𠳿嚤𠘚𠯫𠲸唂秄𡟺緾𡛂𤩐𡡒䔮鐁㜊𨫀𤦭妰𡢿𡢃𧒄媡㛢𣵛㚰鉟婹𨪁𡡢鍴㳍𠪴䪖㦊僴㵩㵌𡎜煵䋻𨈘渏𩃤䓫浗𧹏灧沯㳖𣿭𣸭渂漌㵯𠏵畑㚼㓈䚀㻚䡱姄鉮䤾轁𨰜𦯀堒埈㛖𡑒烾𤍢𤩱𢿣𡊰𢎽梹楧𡎘𣓥𧯴𣛟𨪃𣟖𣏺𤲟樚𣚭𦲷萾䓟䓎\"],[\"9840\",\"𦴦𦵑𦲂𦿞漗𧄉茽𡜺菭𦲀𧁓𡟛妉媂𡞳婡婱𡤅𤇼㜭姯𡜼㛇熎鎐暚𤊥婮娫𤊓樫𣻹𧜶𤑛𤋊焝𤉙𨧡侰𦴨峂𤓎𧹍𤎽樌𤉖𡌄炦焳𤏩㶥泟勇𤩏繥姫崯㷳彜𤩝𡟟綤萦\"],[\"98a1\",\"咅𣫺𣌀𠈔坾𠣕𠘙㿥𡾞𪊶瀃𩅛嵰玏糓𨩙𩐠俈翧狍猐𧫴猸猹𥛶獁獈㺩𧬘遬燵𤣲珡臶㻊県㻑沢国琙琞琟㻢㻰㻴㻺瓓㼎㽓畂畭畲疍㽼痈痜㿀癍㿗癴㿜発𤽜熈嘣覀塩䀝睃䀹条䁅㗛瞘䁪䁯属瞾矋売砘点砜䂨砹硇硑硦葈𥔵礳栃礲䄃\"],[\"9940\",\"䄉禑禙辻稆込䅧窑䆲窼艹䇄竏竛䇏両筢筬筻簒簛䉠䉺类粜䊌粸䊔糭输烀𠳏総緔緐緽羮羴犟䎗耠耥笹耮耱联㷌垴炠肷胩䏭脌猪脎脒畠脔䐁㬹腖腙腚\"],[\"99a1\",\"䐓堺腼膄䐥膓䐭膥埯臁臤艔䒏芦艶苊苘苿䒰荗险榊萅烵葤惣蒈䔄蒾蓡蓸蔐蔸蕒䔻蕯蕰藠䕷虲蚒蚲蛯际螋䘆䘗袮裿褤襇覑𧥧訩訸誔誴豑賔賲贜䞘塟跃䟭仮踺嗘坔蹱嗵躰䠷軎転軤軭軲辷迁迊迌逳駄䢭飠鈓䤞鈨鉘鉫銱銮銿\"],[\"9a40\",\"鋣鋫鋳鋴鋽鍃鎄鎭䥅䥑麿鐗匁鐝鐭鐾䥪鑔鑹锭関䦧间阳䧥枠䨤靀䨵鞲韂噔䫤惨颹䬙飱塄餎餙冴餜餷饂饝饢䭰駅䮝騼鬏窃魩鮁鯝鯱鯴䱭鰠㝯𡯂鵉鰺\"],[\"9aa1\",\"黾噐鶓鶽鷀鷼银辶鹻麬麱麽黆铜黢黱黸竈齄𠂔𠊷𠎠椚铃妬𠓗塀铁㞹𠗕𠘕𠙶𡚺块煳𠫂𠫍𠮿呪吆𠯋咞𠯻𠰻𠱓𠱥𠱼惧𠲍噺𠲵𠳝𠳭𠵯𠶲𠷈楕鰯螥𠸄𠸎𠻗𠾐𠼭𠹳尠𠾼帋𡁜𡁏𡁶朞𡁻𡂈𡂖㙇𡂿𡃓𡄯𡄻卤蒭𡋣𡍵𡌶讁𡕷𡘙𡟃𡟇乸炻𡠭𡥪\"],[\"9b40\",\"𡨭𡩅𡰪𡱰𡲬𡻈拃𡻕𡼕熘桕𢁅槩㛈𢉼𢏗𢏺𢜪𢡱𢥏苽𢥧𢦓𢫕覥𢫨辠𢬎鞸𢬿顇骽𢱌\"],[\"9b62\",\"𢲈𢲷𥯨𢴈𢴒𢶷𢶕𢹂𢽴𢿌𣀳𣁦𣌟𣏞徱晈暿𧩹𣕧𣗳爁𤦺矗𣘚𣜖纇𠍆墵朎\"],[\"9ba1\",\"椘𣪧𧙗𥿢𣸑𣺹𧗾𢂚䣐䪸𤄙𨪚𤋮𤌍𤀻𤌴𤎖𤩅𠗊凒𠘑妟𡺨㮾𣳿𤐄𤓖垈𤙴㦛𤜯𨗨𩧉㝢𢇃譞𨭎駖𤠒𤣻𤨕爉𤫀𠱸奥𤺥𤾆𠝹軚𥀬劏圿煱𥊙𥐙𣽊𤪧喼𥑆𥑮𦭒釔㑳𥔿𧘲𥕞䜘𥕢𥕦𥟇𤤿𥡝偦㓻𣏌惞𥤃䝼𨥈𥪮𥮉𥰆𡶐垡煑澶𦄂𧰒遖𦆲𤾚譢𦐂𦑊\"],[\"9c40\",\"嵛𦯷輶𦒄𡤜諪𤧶𦒈𣿯𦔒䯀𦖿𦚵𢜛鑥𥟡憕娧晉侻嚹𤔡𦛼乪𤤴陖涏𦲽㘘襷𦞙𦡮𦐑𦡞營𦣇筂𩃀𠨑𦤦鄄𦤹穅鷰𦧺騦𦨭㙟𦑩𠀡禃𦨴𦭛崬𣔙菏𦮝䛐𦲤画补𦶮墶\"],[\"9ca1\",\"㜜𢖍𧁋𧇍㱔𧊀𧊅銁𢅺𧊋錰𧋦𤧐氹钟𧑐𠻸蠧裵𢤦𨑳𡞱溸𤨪𡠠㦤㚹尐秣䔿暶𩲭𩢤襃𧟌𧡘囖䃟𡘊㦡𣜯𨃨𡏅熭荦𧧝𩆨婧䲷𧂯𨦫𧧽𧨊𧬋𧵦𤅺筃祾𨀉澵𪋟樃𨌘厢𦸇鎿栶靝𨅯𨀣𦦵𡏭𣈯𨁈嶅𨰰𨂃圕頣𨥉嶫𤦈斾槕叒𤪥𣾁㰑朶𨂐𨃴𨄮𡾡𨅏\"],[\"9d40\",\"𨆉𨆯𨈚𨌆𨌯𨎊㗊𨑨𨚪䣺揦𨥖砈鉕𨦸䏲𨧧䏟𨧨𨭆𨯔姸𨰉輋𨿅𩃬筑𩄐𩄼㷷𩅞𤫊运犏嚋𩓧𩗩𩖰𩖸𩜲𩣑𩥉𩥪𩧃𩨨𩬎𩵚𩶛纟𩻸𩼣䲤镇𪊓熢𪋿䶑递𪗋䶜𠲜达嗁\"],[\"9da1\",\"辺𢒰边𤪓䔉繿潖檱仪㓤𨬬𧢝㜺躀𡟵𨀤𨭬𨮙𧨾𦚯㷫𧙕𣲷𥘵𥥖亚𥺁𦉘嚿𠹭踎孭𣺈𤲞揞拐𡟶𡡻攰嘭𥱊吚𥌑㷆𩶘䱽嘢嘞罉𥻘奵𣵀蝰东𠿪𠵉𣚺脗鵞贘瘻鱅癎瞹鍅吲腈苷嘥脲萘肽嗪祢噃吖𠺝㗎嘅嗱曱𨋢㘭甴嗰喺咗啲𠱁𠲖廐𥅈𠹶𢱢\"],[\"9e40\",\"𠺢麫絚嗞𡁵抝靭咔賍燶酶揼掹揾啩𢭃鱲𢺳冚㓟𠶧冧呍唞唓癦踭𦢊疱肶蠄螆裇膶萜𡃁䓬猄𤜆宐茋𦢓噻𢛴𧴯𤆣𧵳𦻐𧊶酰𡇙鈈𣳼𪚩𠺬𠻹牦𡲢䝎𤿂𧿹𠿫䃺\"],[\"9ea1\",\"鱝攟𢶠䣳𤟠𩵼𠿬𠸊恢𧖣𠿭\"],[\"9ead\",\"𦁈𡆇熣纎鵐业丄㕷嬍沲卧㚬㧜卽㚥𤘘墚𤭮舭呋垪𥪕𠥹\"],[\"9ec5\",\"㩒𢑥獴𩺬䴉鯭𣳾𩼰䱛𤾩𩖞𩿞葜𣶶𧊲𦞳𣜠挮紥𣻷𣸬㨪逈勌㹴㙺䗩𠒎癀嫰𠺶硺𧼮墧䂿噼鮋嵴癔𪐴麅䳡痹㟻愙𣃚𤏲\"],[\"9ef5\",\"噝𡊩垧𤥣𩸆刴𧂮㖭汊鵼\"],[\"9f40\",\"籖鬹埞𡝬屓擓𩓐𦌵𧅤蚭𠴨𦴢𤫢𠵱\"],[\"9f4f\",\"凾𡼏嶎霃𡷑麁遌笟鬂峑箣扨挵髿篏鬪籾鬮籂粆鰕篼鬉鼗鰛𤤾齚啳寃俽麘俲剠㸆勑坧偖妷帒韈鶫轜呩鞴饀鞺匬愰\"],[\"9fa1\",\"椬叚鰊鴂䰻陁榀傦畆𡝭駚剳\"],[\"9fae\",\"酙隁酜\"],[\"9fb2\",\"酑𨺗捿𦴣櫊嘑醎畺抅𠏼獏籰𥰡𣳽\"],[\"9fc1\",\"𤤙盖鮝个𠳔莾衂\"],[\"9fc9\",\"届槀僭坺刟巵从氱𠇲伹咜哚劚趂㗾弌㗳\"],[\"9fdb\",\"歒酼龥鮗頮颴骺麨麄煺笔\"],[\"9fe7\",\"毺蠘罸\"],[\"9feb\",\"嘠𪙊蹷齓\"],[\"9ff0\",\"跔蹏鸜踁抂𨍽踨蹵竓𤩷稾磘泪詧瘇\"],[\"a040\",\"𨩚鼦泎蟖痃𪊲硓咢贌狢獱謭猂瓱賫𤪻蘯徺袠䒷\"],[\"a055\",\"𡠻𦸅\"],[\"a058\",\"詾𢔛\"],[\"a05b\",\"惽癧髗鵄鍮鮏蟵\"],[\"a063\",\"蠏賷猬霡鮰㗖犲䰇籑饊𦅙慙䰄麖慽\"],[\"a073\",\"坟慯抦戹拎㩜懢厪𣏵捤栂㗒\"],[\"a0a1\",\"嵗𨯂迚𨸹\"],[\"a0a6\",\"僙𡵆礆匲阸𠼻䁥\"],[\"a0ae\",\"矾\"],[\"a0b0\",\"糂𥼚糚稭聦聣絍甅瓲覔舚朌聢𧒆聛瓰脃眤覉𦟌畓𦻑螩蟎臈螌詉貭譃眫瓸蓚㘵榲趦\"],[\"a0d4\",\"覩瑨涹蟁𤀑瓧㷛煶悤憜㳑煢恷\"],[\"a0e2\",\"罱𨬭牐惩䭾删㰘𣳇𥻗𧙖𥔱𡥄𡋾𩤃𦷜𧂭峁𦆭𨨏𣙷𠃮𦡆𤼎䕢嬟𦍌齐麦𦉫\"],[\"a3c0\",\"␀\",31,\"␡\"],[\"c6a1\",\"①\",9,\"⑴\",9,\"ⅰ\",9,\"丶丿亅亠冂冖冫勹匸卩厶夊宀巛⼳广廴彐彡攴无疒癶辵隶¨ˆヽヾゝゞ〃仝々〆〇ー[]✽ぁ\",23],[\"c740\",\"す\",58,\"ァアィイ\"],[\"c7a1\",\"ゥ\",81,\"А\",5,\"ЁЖ\",4],[\"c840\",\"Л\",26,\"ёж\",25,\"⇧↸↹㇏𠃌乚𠂊刂䒑\"],[\"c8a1\",\"龰冈龱𧘇\"],[\"c8cd\",\"¬¦'"㈱№℡゛゜⺀⺄⺆⺇⺈⺊⺌⺍⺕⺜⺝⺥⺧⺪⺬⺮⺶⺼⺾⻆⻊⻌⻍⻏⻖⻗⻞⻣\"],[\"c8f5\",\"ʃɐɛɔɵœøŋʊɪ\"],[\"f9fe\",\"■\"],[\"fa40\",\"𠕇鋛𠗟𣿅蕌䊵珯况㙉𤥂𨧤鍄𡧛苮𣳈砼杄拟𤤳𨦪𠊠𦮳𡌅侫𢓭倈𦴩𧪄𣘀𤪱𢔓倩𠍾徤𠎀𠍇滛𠐟偽儁㑺儎顬㝃萖𤦤𠒇兠𣎴兪𠯿𢃼𠋥𢔰𠖎𣈳𡦃宂蝽𠖳𣲙冲冸\"],[\"faa1\",\"鴴凉减凑㳜凓𤪦决凢卂凭菍椾𣜭彻刋刦刼劵剗劔効勅簕蕂勠蘍𦬓包𨫞啉滙𣾀𠥔𣿬匳卄𠯢泋𡜦栛珕恊㺪㣌𡛨燝䒢卭却𨚫卾卿𡖖𡘓矦厓𨪛厠厫厮玧𥝲㽙玜叁叅汉义埾叙㪫𠮏叠𣿫𢶣叶𠱷吓灹唫晗浛呭𦭓𠵴啝咏咤䞦𡜍𠻝㶴𠵍\"],[\"fb40\",\"𨦼𢚘啇䳭启琗喆喩嘅𡣗𤀺䕒𤐵暳𡂴嘷曍𣊊暤暭噍噏磱囱鞇叾圀囯园𨭦㘣𡉏坆𤆥汮炋坂㚱𦱾埦𡐖堃𡑔𤍣堦𤯵塜墪㕡壠壜𡈼壻寿坃𪅐𤉸鏓㖡够梦㛃湙\"],[\"fba1\",\"𡘾娤啓𡚒蔅姉𠵎𦲁𦴪𡟜姙𡟻𡞲𦶦浱𡠨𡛕姹𦹅媫婣㛦𤦩婷㜈媖瑥嫓𦾡𢕔㶅𡤑㜲𡚸広勐孶斈孼𧨎䀄䡝𠈄寕慠𡨴𥧌𠖥寳宝䴐尅𡭄尓珎尔𡲥𦬨屉䣝岅峩峯嶋𡷹𡸷崐崘嵆𡺤岺巗苼㠭𤤁𢁉𢅳芇㠶㯂帮檊幵幺𤒼𠳓厦亷廐厨𡝱帉廴𨒂\"],[\"fc40\",\"廹廻㢠廼栾鐛弍𠇁弢㫞䢮𡌺强𦢈𢏐彘𢑱彣鞽𦹮彲鍀𨨶徧嶶㵟𥉐𡽪𧃸𢙨釖𠊞𨨩怱暅𡡷㥣㷇㘹垐𢞴祱㹀悞悤悳𤦂𤦏𧩓璤僡媠慤萤慂慈𦻒憁凴𠙖憇宪𣾷\"],[\"fca1\",\"𢡟懓𨮝𩥝懐㤲𢦀𢣁怣慜攞掋𠄘担𡝰拕𢸍捬𤧟㨗搸揸𡎎𡟼撐澊𢸶頔𤂌𥜝擡擥鑻㩦携㩗敍漖𤨨𤨣斅敭敟𣁾斵𤥀䬷旑䃘𡠩无旣忟𣐀昘𣇷𣇸晄𣆤𣆥晋𠹵晧𥇦晳晴𡸽𣈱𨗴𣇈𥌓矅𢣷馤朂𤎜𤨡㬫槺𣟂杞杧杢𤇍𩃭柗䓩栢湐鈼栁𣏦𦶠桝\"],[\"fd40\",\"𣑯槡樋𨫟楳棃𣗍椁椀㴲㨁𣘼㮀枬楡𨩊䋼椶榘㮡𠏉荣傐槹𣙙𢄪橅𣜃檝㯳枱櫈𩆜㰍欝𠤣惞欵歴𢟍溵𣫛𠎵𡥘㝀吡𣭚毡𣻼毜氷𢒋𤣱𦭑汚舦汹𣶼䓅𣶽𤆤𤤌𤤀\"],[\"fda1\",\"𣳉㛥㳫𠴲鮃𣇹𢒑羏样𦴥𦶡𦷫涖浜湼漄𤥿𤂅𦹲蔳𦽴凇沜渝萮𨬡港𣸯瑓𣾂秌湏媑𣁋濸㜍澝𣸰滺𡒗𤀽䕕鏰潄潜㵎潴𩅰㴻澟𤅄濓𤂑𤅕𤀹𣿰𣾴𤄿凟𤅖𤅗𤅀𦇝灋灾炧炁烌烕烖烟䄄㷨熴熖𤉷焫煅媈煊煮岜𤍥煏鍢𤋁焬𤑚𤨧𤨢熺𨯨炽爎\"],[\"fe40\",\"鑂爕夑鑃爤鍁𥘅爮牀𤥴梽牕牗㹕𣁄栍漽犂猪猫𤠣𨠫䣭𨠄猨献珏玪𠰺𦨮珉瑉𤇢𡛧𤨤昣㛅𤦷𤦍𤧻珷琕椃𤨦琹𠗃㻗瑜𢢭瑠𨺲瑇珤瑶莹瑬㜰瑴鏱樬璂䥓𤪌\"],[\"fea1\",\"𤅟𤩹𨮏孆𨰃𡢞瓈𡦈甎瓩甞𨻙𡩋寗𨺬鎅畍畊畧畮𤾂㼄𤴓疎瑝疞疴瘂瘬癑癏癯癶𦏵皐臯㟸𦤑𦤎皡皥皷盌𦾟葢𥂝𥅽𡸜眞眦着撯𥈠睘𣊬瞯𨥤𨥨𡛁矴砉𡍶𤨒棊碯磇磓隥礮𥗠磗礴碱𧘌辸袄𨬫𦂃𢘜禆褀椂禀𥡗禝𧬹礼禩渪𧄦㺨秆𩄍秔\"]]"); /***/ }), /* 645 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Buffer = __webpack_require__(96).Buffer, Transform = __webpack_require__(100).Transform; // == Exports ================================================================== module.exports = function(iconv) { // Additional Public API. iconv.encodeStream = function encodeStream(encoding, options) { return new IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options); } iconv.decodeStream = function decodeStream(encoding, options) { return new IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options); } iconv.supportsStreams = true; // Not published yet. iconv.IconvLiteEncoderStream = IconvLiteEncoderStream; iconv.IconvLiteDecoderStream = IconvLiteDecoderStream; iconv._collect = IconvLiteDecoderStream.prototype.collect; }; // == Encoder stream ======================================================= function IconvLiteEncoderStream(conv, options) { this.conv = conv; options = options || {}; options.decodeStrings = false; // We accept only strings, so we don't need to decode them. Transform.call(this, options); } IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { constructor: { value: IconvLiteEncoderStream } }); IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) { if (typeof chunk != 'string') return done(new Error("Iconv encoding stream needs strings as its input.")); try { var res = this.conv.write(chunk); if (res && res.length) this.push(res); done(); } catch (e) { done(e); } } IconvLiteEncoderStream.prototype._flush = function(done) { try { var res = this.conv.end(); if (res && res.length) this.push(res); done(); } catch (e) { done(e); } } IconvLiteEncoderStream.prototype.collect = function(cb) { var chunks = []; this.on('error', cb); this.on('data', function(chunk) { chunks.push(chunk); }); this.on('end', function() { cb(null, Buffer.concat(chunks)); }); return this; } // == Decoder stream ======================================================= function IconvLiteDecoderStream(conv, options) { this.conv = conv; options = options || {}; options.encoding = this.encoding = 'utf8'; // We output strings. Transform.call(this, options); } IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { constructor: { value: IconvLiteDecoderStream } }); IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) { if (!Buffer.isBuffer(chunk)) return done(new Error("Iconv decoding stream needs buffers as its input.")); try { var res = this.conv.write(chunk); if (res && res.length) this.push(res, this.encoding); done(); } catch (e) { done(e); } } IconvLiteDecoderStream.prototype._flush = function(done) { try { var res = this.conv.end(); if (res && res.length) this.push(res, this.encoding); done(); } catch (e) { done(e); } } IconvLiteDecoderStream.prototype.collect = function(cb) { var res = ''; this.on('error', cb); this.on('data', function(chunk) { res += chunk; }); this.on('end', function() { cb(null, res); }); return this; } /***/ }), /* 646 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Buffer = __webpack_require__(96).Buffer; // Note: not polyfilled with safer-buffer on a purpose, as overrides Buffer // == Extend Node primitives to use iconv-lite ================================= module.exports = function (iconv) { var original = undefined; // Place to keep original methods. // Node authors rewrote Buffer internals to make it compatible with // Uint8Array and we cannot patch key functions since then. // Note: this does use older Buffer API on a purpose iconv.supportsNodeEncodingsExtension = !(Buffer.from || new Buffer(0) instanceof Uint8Array); iconv.extendNodeEncodings = function extendNodeEncodings() { if (original) return; original = {}; if (!iconv.supportsNodeEncodingsExtension) { console.error("ACTION NEEDED: require('iconv-lite').extendNodeEncodings() is not supported in your version of Node"); console.error("See more info at https://github.com/ashtuchkin/iconv-lite/wiki/Node-v4-compatibility"); return; } var nodeNativeEncodings = { 'hex': true, 'utf8': true, 'utf-8': true, 'ascii': true, 'binary': true, 'base64': true, 'ucs2': true, 'ucs-2': true, 'utf16le': true, 'utf-16le': true, }; Buffer.isNativeEncoding = function(enc) { return enc && nodeNativeEncodings[enc.toLowerCase()]; } // -- SlowBuffer ----------------------------------------------------------- var SlowBuffer = __webpack_require__(96).SlowBuffer; original.SlowBufferToString = SlowBuffer.prototype.toString; SlowBuffer.prototype.toString = function(encoding, start, end) { encoding = String(encoding || 'utf8').toLowerCase(); // Use native conversion when possible if (Buffer.isNativeEncoding(encoding)) return original.SlowBufferToString.call(this, encoding, start, end); // Otherwise, use our decoding method. if (typeof start == 'undefined') start = 0; if (typeof end == 'undefined') end = this.length; return iconv.decode(this.slice(start, end), encoding); } original.SlowBufferWrite = SlowBuffer.prototype.write; SlowBuffer.prototype.write = function(string, offset, length, encoding) { // Support both (string, offset, length, encoding) // and the legacy (string, encoding, offset, length) if (isFinite(offset)) { if (!isFinite(length)) { encoding = length; length = undefined; } } else { // legacy var swap = encoding; encoding = offset; offset = length; length = swap; } offset = +offset || 0; var remaining = this.length - offset; if (!length) { length = remaining; } else { length = +length; if (length > remaining) { length = remaining; } } encoding = String(encoding || 'utf8').toLowerCase(); // Use native conversion when possible if (Buffer.isNativeEncoding(encoding)) return original.SlowBufferWrite.call(this, string, offset, length, encoding); if (string.length > 0 && (length < 0 || offset < 0)) throw new RangeError('attempt to write beyond buffer bounds'); // Otherwise, use our encoding method. var buf = iconv.encode(string, encoding); if (buf.length < length) length = buf.length; buf.copy(this, offset, 0, length); return length; } // -- Buffer --------------------------------------------------------------- original.BufferIsEncoding = Buffer.isEncoding; Buffer.isEncoding = function(encoding) { return Buffer.isNativeEncoding(encoding) || iconv.encodingExists(encoding); } original.BufferByteLength = Buffer.byteLength; Buffer.byteLength = SlowBuffer.byteLength = function(str, encoding) { encoding = String(encoding || 'utf8').toLowerCase(); // Use native conversion when possible if (Buffer.isNativeEncoding(encoding)) return original.BufferByteLength.call(this, str, encoding); // Slow, I know, but we don't have a better way yet. return iconv.encode(str, encoding).length; } original.BufferToString = Buffer.prototype.toString; Buffer.prototype.toString = function(encoding, start, end) { encoding = String(encoding || 'utf8').toLowerCase(); // Use native conversion when possible if (Buffer.isNativeEncoding(encoding)) return original.BufferToString.call(this, encoding, start, end); // Otherwise, use our decoding method. if (typeof start == 'undefined') start = 0; if (typeof end == 'undefined') end = this.length; return iconv.decode(this.slice(start, end), encoding); } original.BufferWrite = Buffer.prototype.write; Buffer.prototype.write = function(string, offset, length, encoding) { var _offset = offset, _length = length, _encoding = encoding; // Support both (string, offset, length, encoding) // and the legacy (string, encoding, offset, length) if (isFinite(offset)) { if (!isFinite(length)) { encoding = length; length = undefined; } } else { // legacy var swap = encoding; encoding = offset; offset = length; length = swap; } encoding = String(encoding || 'utf8').toLowerCase(); // Use native conversion when possible if (Buffer.isNativeEncoding(encoding)) return original.BufferWrite.call(this, string, _offset, _length, _encoding); offset = +offset || 0; var remaining = this.length - offset; if (!length) { length = remaining; } else { length = +length; if (length > remaining) { length = remaining; } } if (string.length > 0 && (length < 0 || offset < 0)) throw new RangeError('attempt to write beyond buffer bounds'); // Otherwise, use our encoding method. var buf = iconv.encode(string, encoding); if (buf.length < length) length = buf.length; buf.copy(this, offset, 0, length); return length; // TODO: Set _charsWritten. } // -- Readable ------------------------------------------------------------- if (iconv.supportsStreams) { var Readable = __webpack_require__(100).Readable; original.ReadableSetEncoding = Readable.prototype.setEncoding; Readable.prototype.setEncoding = function setEncoding(enc, options) { // Use our own decoder, it has the same interface. // We cannot use original function as it doesn't handle BOM-s. this._readableState.decoder = iconv.getDecoder(enc, options); this._readableState.encoding = enc; } Readable.prototype.collect = iconv._collect; } } // Remove iconv-lite Node primitive extensions. iconv.undoExtendNodeEncodings = function undoExtendNodeEncodings() { if (!iconv.supportsNodeEncodingsExtension) return; if (!original) throw new Error("require('iconv-lite').undoExtendNodeEncodings(): Nothing to undo; extendNodeEncodings() is not called.") delete Buffer.isNativeEncoding; var SlowBuffer = __webpack_require__(96).SlowBuffer; SlowBuffer.prototype.toString = original.SlowBufferToString; SlowBuffer.prototype.write = original.SlowBufferWrite; Buffer.isEncoding = original.BufferIsEncoding; Buffer.byteLength = original.BufferByteLength; Buffer.prototype.toString = original.BufferToString; Buffer.prototype.write = original.BufferWrite; if (iconv.supportsStreams) { var Readable = __webpack_require__(100).Readable; Readable.prototype.setEncoding = original.ReadableSetEncoding; delete Readable.prototype.collect; } original = undefined; } } /***/ }), /* 647 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var iconv_package; var Iconv; try { // this is to fool browserify so it doesn't try (in vain) to install iconv. iconv_package = 'iconv'; Iconv = __webpack_require__(648)(iconv_package).Iconv; } catch (E) { // node-iconv not present } module.exports = Iconv; /***/ }), /* 648 */ /***/ (function(module, exports) { function webpackEmptyContext(req) { var e = new Error("Cannot find module '" + req + "'"); e.code = 'MODULE_NOT_FOUND'; throw e; } webpackEmptyContext.keys = function() { return []; }; webpackEmptyContext.resolve = webpackEmptyContext; module.exports = webpackEmptyContext; webpackEmptyContext.id = 648; /***/ }), /* 649 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isStream = module.exports = function (stream) { return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function'; }; isStream.writable = function (stream) { return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object'; }; isStream.readable = function (stream) { return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object'; }; isStream.duplex = function (stream) { return isStream.writable(stream) && isStream.readable(stream); }; isStream.transform = function (stream) { return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object'; }; /***/ }), /* 650 */ /***/ (function(module, exports, __webpack_require__) { /** * fetch-error.js * * FetchError interface for operational errors */ module.exports = FetchError; /** * Create FetchError instance * * @param String message Error message for human * @param String type Error type for machine * @param String systemError For Node.js system error * @return FetchError */ function FetchError(message, type, systemError) { this.name = this.constructor.name; this.message = message; this.type = type; // when err.type is `system`, err.code contains system error code if (systemError) { this.code = this.errno = systemError.code; } // hide custom error implementation details from end-users Error.captureStackTrace(this, this.constructor); } __webpack_require__(9).inherits(FetchError, Error); /***/ }), /* 651 */ /***/ (function(module, exports, __webpack_require__) { /** * response.js * * Response class provides content decoding */ var http = __webpack_require__(98); var Headers = __webpack_require__(652); var Body = __webpack_require__(624); module.exports = Response; /** * Response class * * @param Stream body Readable stream * @param Object opts Response options * @return Void */ function Response(body, opts) { opts = opts || {}; this.url = opts.url; this.status = opts.status || 200; this.statusText = opts.statusText || http.STATUS_CODES[this.status]; this.headers = new Headers(opts.headers); this.ok = this.status >= 200 && this.status < 300; Body.call(this, body, opts); } Response.prototype = Object.create(Body.prototype); /** * Clone this response * * @return Response */ Response.prototype.clone = function() { return new Response(this._clone(this), { url: this.url , status: this.status , statusText: this.statusText , headers: this.headers , ok: this.ok }); }; /***/ }), /* 652 */ /***/ (function(module, exports) { /** * headers.js * * Headers class offers convenient helpers */ module.exports = Headers; /** * Headers class * * @param Object headers Response headers * @return Void */ function Headers(headers) { var self = this; this._headers = {}; // Headers if (headers instanceof Headers) { headers = headers.raw(); } // plain object for (var prop in headers) { if (!headers.hasOwnProperty(prop)) { continue; } if (typeof headers[prop] === 'string') { this.set(prop, headers[prop]); } else if (typeof headers[prop] === 'number' && !isNaN(headers[prop])) { this.set(prop, headers[prop].toString()); } else if (Array.isArray(headers[prop])) { headers[prop].forEach(function(item) { self.append(prop, item.toString()); }); } } } /** * Return first header value given name * * @param String name Header name * @return Mixed */ Headers.prototype.get = function(name) { var list = this._headers[name.toLowerCase()]; return list ? list[0] : null; }; /** * Return all header values given name * * @param String name Header name * @return Array */ Headers.prototype.getAll = function(name) { if (!this.has(name)) { return []; } return this._headers[name.toLowerCase()]; }; /** * Iterate over all headers * * @param Function callback Executed for each item with parameters (value, name, thisArg) * @param Boolean thisArg `this` context for callback function * @return Void */ Headers.prototype.forEach = function(callback, thisArg) { Object.getOwnPropertyNames(this._headers).forEach(function(name) { this._headers[name].forEach(function(value) { callback.call(thisArg, value, name, this) }, this) }, this) } /** * Overwrite header values given name * * @param String name Header name * @param String value Header value * @return Void */ Headers.prototype.set = function(name, value) { this._headers[name.toLowerCase()] = [value]; }; /** * Append a value onto existing header * * @param String name Header name * @param String value Header value * @return Void */ Headers.prototype.append = function(name, value) { if (!this.has(name)) { this.set(name, value); return; } this._headers[name.toLowerCase()].push(value); }; /** * Check for header name existence * * @param String name Header name * @return Boolean */ Headers.prototype.has = function(name) { return this._headers.hasOwnProperty(name.toLowerCase()); }; /** * Delete all header values given name * * @param String name Header name * @return Void */ Headers.prototype['delete'] = function(name) { delete this._headers[name.toLowerCase()]; }; /** * Return raw headers (non-spec api) * * @return Object */ Headers.prototype.raw = function() { return this._headers; }; /***/ }), /* 653 */ /***/ (function(module, exports, __webpack_require__) { /** * request.js * * Request class contains server only options */ var parse_url = __webpack_require__(83).parse; var Headers = __webpack_require__(652); var Body = __webpack_require__(624); module.exports = Request; /** * Request class * * @param Mixed input Url or Request instance * @param Object init Custom options * @return Void */ function Request(input, init) { var url, url_parsed; // normalize input if (!(input instanceof Request)) { url = input; url_parsed = parse_url(url); input = {}; } else { url = input.url; url_parsed = parse_url(url); } // normalize init init = init || {}; // fetch spec options this.method = init.method || input.method || 'GET'; this.redirect = init.redirect || input.redirect || 'follow'; this.headers = new Headers(init.headers || input.headers || {}); this.url = url; // server only options this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20; this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true; this.counter = init.counter || input.counter || 0; this.agent = init.agent || input.agent; Body.call(this, init.body || this._clone(input), { timeout: init.timeout || input.timeout || 0, size: init.size || input.size || 0 }); // server request options this.protocol = url_parsed.protocol; this.hostname = url_parsed.hostname; this.port = url_parsed.port; this.path = url_parsed.path; this.auth = url_parsed.auth; } Request.prototype = Object.create(Body.prototype); /** * Clone this request * * @return Request */ Request.prototype.clone = function() { return new Request(this); }; /***/ }), /* 654 */ /***/ (function(module, exports) { (function () { "use strict"; function btoa(str) { var buffer; if (str instanceof Buffer) { buffer = str; } else { buffer = Buffer.from(str.toString(), 'binary'); } return buffer.toString('base64'); } module.exports = btoa; }()); /***/ }), /* 655 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.3.1 Object.assign(target, source) var $export = __webpack_require__(656); $export($export.S + $export.F, 'Object', { assign: __webpack_require__(677) }); /***/ }), /* 656 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(657); var core = __webpack_require__(658); var hide = __webpack_require__(659); var redefine = __webpack_require__(669); var ctx = __webpack_require__(675); var PROTOTYPE = 'prototype'; var $export = function (type, name, source) { var IS_FORCED = type & $export.F; var IS_GLOBAL = type & $export.G; var IS_STATIC = type & $export.S; var IS_PROTO = type & $export.P; var IS_BIND = type & $export.B; var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]; var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); var key, own, out, exp; if (IS_GLOBAL) source = name; for (key in source) { // contains in native own = !IS_FORCED && target && target[key] !== undefined; // export native or passed out = (own ? target : source)[key]; // bind timers to global for call from export context exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; // extend global if (target) redefine(target, key, out, type & $export.U); // export if (exports[key] != out) hide(exports, key, exp); if (IS_PROTO && expProto[key] != out) expProto[key] = out; } }; global.core = core; // type bitmap $export.F = 1; // forced $export.G = 2; // global $export.S = 4; // static $export.P = 8; // proto $export.B = 16; // bind $export.W = 32; // wrap $export.U = 64; // safe $export.R = 128; // real proto method for `library` module.exports = $export; /***/ }), /* 657 */ /***/ (function(module, exports) { // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 var global = module.exports = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self // eslint-disable-next-line no-new-func : Function('return this')(); if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef /***/ }), /* 658 */ /***/ (function(module, exports) { var core = module.exports = { version: '2.6.10' }; if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef /***/ }), /* 659 */ /***/ (function(module, exports, __webpack_require__) { var dP = __webpack_require__(660); var createDesc = __webpack_require__(668); module.exports = __webpack_require__(664) ? function (object, key, value) { return dP.f(object, key, createDesc(1, value)); } : function (object, key, value) { object[key] = value; return object; }; /***/ }), /* 660 */ /***/ (function(module, exports, __webpack_require__) { var anObject = __webpack_require__(661); var IE8_DOM_DEFINE = __webpack_require__(663); var toPrimitive = __webpack_require__(667); var dP = Object.defineProperty; exports.f = __webpack_require__(664) ? Object.defineProperty : function defineProperty(O, P, Attributes) { anObject(O); P = toPrimitive(P, true); anObject(Attributes); if (IE8_DOM_DEFINE) try { return dP(O, P, Attributes); } catch (e) { /* empty */ } if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; /***/ }), /* 661 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(662); module.exports = function (it) { if (!isObject(it)) throw TypeError(it + ' is not an object!'); return it; }; /***/ }), /* 662 */ /***/ (function(module, exports) { module.exports = function (it) { return typeof it === 'object' ? it !== null : typeof it === 'function'; }; /***/ }), /* 663 */ /***/ (function(module, exports, __webpack_require__) { module.exports = !__webpack_require__(664) && !__webpack_require__(665)(function () { return Object.defineProperty(__webpack_require__(666)('div'), 'a', { get: function () { return 7; } }).a != 7; }); /***/ }), /* 664 */ /***/ (function(module, exports, __webpack_require__) { // Thank's IE8 for his funny defineProperty module.exports = !__webpack_require__(665)(function () { return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; }); /***/ }), /* 665 */ /***/ (function(module, exports) { module.exports = function (exec) { try { return !!exec(); } catch (e) { return true; } }; /***/ }), /* 666 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(662); var document = __webpack_require__(657).document; // typeof document.createElement is 'object' in old IE var is = isObject(document) && isObject(document.createElement); module.exports = function (it) { return is ? document.createElement(it) : {}; }; /***/ }), /* 667 */ /***/ (function(module, exports, __webpack_require__) { // 7.1.1 ToPrimitive(input [, PreferredType]) var isObject = __webpack_require__(662); // instead of the ES6 spec version, we didn't implement @@toPrimitive case // and the second argument - flag - preferred type is a string module.exports = function (it, S) { if (!isObject(it)) return it; var fn, val; if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; throw TypeError("Can't convert object to primitive value"); }; /***/ }), /* 668 */ /***/ (function(module, exports) { module.exports = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; /***/ }), /* 669 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(657); var hide = __webpack_require__(659); var has = __webpack_require__(670); var SRC = __webpack_require__(671)('src'); var $toString = __webpack_require__(672); var TO_STRING = 'toString'; var TPL = ('' + $toString).split(TO_STRING); __webpack_require__(658).inspectSource = function (it) { return $toString.call(it); }; (module.exports = function (O, key, val, safe) { var isFunction = typeof val == 'function'; if (isFunction) has(val, 'name') || hide(val, 'name', key); if (O[key] === val) return; if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); if (O === global) { O[key] = val; } else if (!safe) { delete O[key]; hide(O, key, val); } else if (O[key]) { O[key] = val; } else { hide(O, key, val); } // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative })(Function.prototype, TO_STRING, function toString() { return typeof this == 'function' && this[SRC] || $toString.call(this); }); /***/ }), /* 670 */ /***/ (function(module, exports) { var hasOwnProperty = {}.hasOwnProperty; module.exports = function (it, key) { return hasOwnProperty.call(it, key); }; /***/ }), /* 671 */ /***/ (function(module, exports) { var id = 0; var px = Math.random(); module.exports = function (key) { return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); }; /***/ }), /* 672 */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(673)('native-function-to-string', Function.toString); /***/ }), /* 673 */ /***/ (function(module, exports, __webpack_require__) { var core = __webpack_require__(658); var global = __webpack_require__(657); var SHARED = '__core-js_shared__'; var store = global[SHARED] || (global[SHARED] = {}); (module.exports = function (key, value) { return store[key] || (store[key] = value !== undefined ? value : {}); })('versions', []).push({ version: core.version, mode: __webpack_require__(674) ? 'pure' : 'global', copyright: '© 2019 Denis Pushkarev (zloirock.ru)' }); /***/ }), /* 674 */ /***/ (function(module, exports) { module.exports = false; /***/ }), /* 675 */ /***/ (function(module, exports, __webpack_require__) { // optional / simple context binding var aFunction = __webpack_require__(676); module.exports = function (fn, that, length) { aFunction(fn); if (that === undefined) return fn; switch (length) { case 1: return function (a) { return fn.call(that, a); }; case 2: return function (a, b) { return fn.call(that, a, b); }; case 3: return function (a, b, c) { return fn.call(that, a, b, c); }; } return function (/* ...args */) { return fn.apply(that, arguments); }; }; /***/ }), /* 676 */ /***/ (function(module, exports) { module.exports = function (it) { if (typeof it != 'function') throw TypeError(it + ' is not a function!'); return it; }; /***/ }), /* 677 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // 19.1.2.1 Object.assign(target, source, ...) var DESCRIPTORS = __webpack_require__(664); var getKeys = __webpack_require__(678); var gOPS = __webpack_require__(690); var pIE = __webpack_require__(691); var toObject = __webpack_require__(692); var IObject = __webpack_require__(681); var $assign = Object.assign; // should work with symbols and should have deterministic property order (V8 bug) module.exports = !$assign || __webpack_require__(665)(function () { var A = {}; var B = {}; // eslint-disable-next-line no-undef var S = Symbol(); var K = 'abcdefghijklmnopqrst'; A[S] = 7; K.split('').forEach(function (k) { B[k] = k; }); return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; }) ? function assign(target, source) { // eslint-disable-line no-unused-vars var T = toObject(target); var aLen = arguments.length; var index = 1; var getSymbols = gOPS.f; var isEnum = pIE.f; while (aLen > index) { var S = IObject(arguments[index++]); var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S); var length = keys.length; var j = 0; var key; while (length > j) { key = keys[j++]; if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key]; } } return T; } : $assign; /***/ }), /* 678 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.14 / 15.2.3.14 Object.keys(O) var $keys = __webpack_require__(679); var enumBugKeys = __webpack_require__(689); module.exports = Object.keys || function keys(O) { return $keys(O, enumBugKeys); }; /***/ }), /* 679 */ /***/ (function(module, exports, __webpack_require__) { var has = __webpack_require__(670); var toIObject = __webpack_require__(680); var arrayIndexOf = __webpack_require__(684)(false); var IE_PROTO = __webpack_require__(688)('IE_PROTO'); module.exports = function (object, names) { var O = toIObject(object); var i = 0; var result = []; var key; for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key); // Don't enum bug & hidden keys while (names.length > i) if (has(O, key = names[i++])) { ~arrayIndexOf(result, key) || result.push(key); } return result; }; /***/ }), /* 680 */ /***/ (function(module, exports, __webpack_require__) { // to indexed object, toObject with fallback for non-array-like ES3 strings var IObject = __webpack_require__(681); var defined = __webpack_require__(683); module.exports = function (it) { return IObject(defined(it)); }; /***/ }), /* 681 */ /***/ (function(module, exports, __webpack_require__) { // fallback for non-array-like ES3 and non-enumerable old V8 strings var cof = __webpack_require__(682); // eslint-disable-next-line no-prototype-builtins module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { return cof(it) == 'String' ? it.split('') : Object(it); }; /***/ }), /* 682 */ /***/ (function(module, exports) { var toString = {}.toString; module.exports = function (it) { return toString.call(it).slice(8, -1); }; /***/ }), /* 683 */ /***/ (function(module, exports) { // 7.2.1 RequireObjectCoercible(argument) module.exports = function (it) { if (it == undefined) throw TypeError("Can't call method on " + it); return it; }; /***/ }), /* 684 */ /***/ (function(module, exports, __webpack_require__) { // false -> Array#indexOf // true -> Array#includes var toIObject = __webpack_require__(680); var toLength = __webpack_require__(685); var toAbsoluteIndex = __webpack_require__(687); module.exports = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIObject($this); var length = toLength(O.length); var index = toAbsoluteIndex(fromIndex, length); var value; // Array#includes uses SameValueZero equality algorithm // eslint-disable-next-line no-self-compare if (IS_INCLUDES && el != el) while (length > index) { value = O[index++]; // eslint-disable-next-line no-self-compare if (value != value) return true; // Array#indexOf ignores holes, Array#includes - not } else for (;length > index; index++) if (IS_INCLUDES || index in O) { if (O[index] === el) return IS_INCLUDES || index || 0; } return !IS_INCLUDES && -1; }; }; /***/ }), /* 685 */ /***/ (function(module, exports, __webpack_require__) { // 7.1.15 ToLength var toInteger = __webpack_require__(686); var min = Math.min; module.exports = function (it) { return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 }; /***/ }), /* 686 */ /***/ (function(module, exports) { // 7.1.4 ToInteger var ceil = Math.ceil; var floor = Math.floor; module.exports = function (it) { return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); }; /***/ }), /* 687 */ /***/ (function(module, exports, __webpack_require__) { var toInteger = __webpack_require__(686); var max = Math.max; var min = Math.min; module.exports = function (index, length) { index = toInteger(index); return index < 0 ? max(index + length, 0) : min(index, length); }; /***/ }), /* 688 */ /***/ (function(module, exports, __webpack_require__) { var shared = __webpack_require__(673)('keys'); var uid = __webpack_require__(671); module.exports = function (key) { return shared[key] || (shared[key] = uid(key)); }; /***/ }), /* 689 */ /***/ (function(module, exports) { // IE 8- don't enum bug keys module.exports = ( 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' ).split(','); /***/ }), /* 690 */ /***/ (function(module, exports) { exports.f = Object.getOwnPropertySymbols; /***/ }), /* 691 */ /***/ (function(module, exports) { exports.f = {}.propertyIsEnumerable; /***/ }), /* 692 */ /***/ (function(module, exports, __webpack_require__) { // 7.1.13 ToObject(argument) var defined = __webpack_require__(683); module.exports = function (it) { return Object(defined(it)); }; /***/ }), /* 693 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var argsarray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(694); /* harmony import */ var argsarray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(argsarray__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var immediate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(695); /* harmony import */ var immediate__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(immediate__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(268); /* harmony import */ var events__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(events__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(696); /* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(inherits__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var spark_md5__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(698); /* harmony import */ var spark_md5__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(spark_md5__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(699); /* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(uuid__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var vuvuzela__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(704); /* harmony import */ var vuvuzela__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(vuvuzela__WEBPACK_IMPORTED_MODULE_6__); function isBinaryObject(object) { return (typeof ArrayBuffer !== 'undefined' && object instanceof ArrayBuffer) || (typeof Blob !== 'undefined' && object instanceof Blob); } function cloneArrayBuffer(buff) { if (typeof buff.slice === 'function') { return buff.slice(0); } // IE10-11 slice() polyfill var target = new ArrayBuffer(buff.byteLength); var targetArray = new Uint8Array(target); var sourceArray = new Uint8Array(buff); targetArray.set(sourceArray); return target; } function cloneBinaryObject(object) { if (object instanceof ArrayBuffer) { return cloneArrayBuffer(object); } var size = object.size; var type = object.type; // Blob if (typeof object.slice === 'function') { return object.slice(0, size, type); } // PhantomJS slice() replacement return object.webkitSlice(0, size, type); } // most of this is borrowed from lodash.isPlainObject: // https://github.com/fis-components/lodash.isplainobject/ // blob/29c358140a74f252aeb08c9eb28bef86f2217d4a/index.js var funcToString = Function.prototype.toString; var objectCtorString = funcToString.call(Object); function isPlainObject(value) { var proto = Object.getPrototypeOf(value); /* istanbul ignore if */ if (proto === null) { // not sure when this happens, but I guess it can return true; } var Ctor = proto.constructor; return (typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString); } function clone(object) { var newObject; var i; var len; if (!object || typeof object !== 'object') { return object; } if (Array.isArray(object)) { newObject = []; for (i = 0, len = object.length; i < len; i++) { newObject[i] = clone(object[i]); } return newObject; } // special case: to avoid inconsistencies between IndexedDB // and other backends, we automatically stringify Dates if (object instanceof Date) { return object.toISOString(); } if (isBinaryObject(object)) { return cloneBinaryObject(object); } if (!isPlainObject(object)) { return object; // don't clone objects like Workers } newObject = {}; for (i in object) { /* istanbul ignore else */ if (Object.prototype.hasOwnProperty.call(object, i)) { var value = clone(object[i]); if (typeof value !== 'undefined') { newObject[i] = value; } } } return newObject; } function once(fun) { var called = false; return argsarray__WEBPACK_IMPORTED_MODULE_0___default()(function (args) { /* istanbul ignore if */ if (called) { // this is a smoke test and should never actually happen throw new Error('once called more than once'); } else { called = true; fun.apply(this, args); } }); } function toPromise(func) { //create the function we will be returning return argsarray__WEBPACK_IMPORTED_MODULE_0___default()(function (args) { // Clone arguments args = clone(args); var self = this; // if the last argument is a function, assume its a callback var usedCB = (typeof args[args.length - 1] === 'function') ? args.pop() : false; var promise = new Promise(function (fulfill, reject) { var resp; try { var callback = once(function (err, mesg) { if (err) { reject(err); } else { fulfill(mesg); } }); // create a callback for this invocation // apply the function in the orig context args.push(callback); resp = func.apply(self, args); if (resp && typeof resp.then === 'function') { fulfill(resp); } } catch (e) { reject(e); } }); // if there is a callback, call it back if (usedCB) { promise.then(function (result) { usedCB(null, result); }, usedCB); } return promise; }); } function logApiCall(self, name, args) { /* istanbul ignore if */ if (self.constructor.listeners('debug').length) { var logArgs = ['api', self.name, name]; for (var i = 0; i < args.length - 1; i++) { logArgs.push(args[i]); } self.constructor.emit('debug', logArgs); // override the callback itself to log the response var origCallback = args[args.length - 1]; args[args.length - 1] = function (err, res) { var responseArgs = ['api', self.name, name]; responseArgs = responseArgs.concat( err ? ['error', err] : ['success', res] ); self.constructor.emit('debug', responseArgs); origCallback(err, res); }; } } function adapterFun(name, callback) { return toPromise(argsarray__WEBPACK_IMPORTED_MODULE_0___default()(function (args) { if (this._closed) { return Promise.reject(new Error('database is closed')); } if (this._destroyed) { return Promise.reject(new Error('database is destroyed')); } var self = this; logApiCall(self, name, args); if (!this.taskqueue.isReady) { return new Promise(function (fulfill, reject) { self.taskqueue.addTask(function (failed) { if (failed) { reject(failed); } else { fulfill(self[name].apply(self, args)); } }); }); } return callback.apply(this, args); })); } function mangle(key) { return '$' + key; } function unmangle(key) { return key.substring(1); } function Map$1() { this._store = {}; } Map$1.prototype.get = function (key) { var mangled = mangle(key); return this._store[mangled]; }; Map$1.prototype.set = function (key, value) { var mangled = mangle(key); this._store[mangled] = value; return true; }; Map$1.prototype.has = function (key) { var mangled = mangle(key); return mangled in this._store; }; Map$1.prototype.delete = function (key) { var mangled = mangle(key); var res = mangled in this._store; delete this._store[mangled]; return res; }; Map$1.prototype.forEach = function (cb) { var keys = Object.keys(this._store); for (var i = 0, len = keys.length; i < len; i++) { var key = keys[i]; var value = this._store[key]; key = unmangle(key); cb(value, key); } }; Object.defineProperty(Map$1.prototype, 'size', { get: function () { return Object.keys(this._store).length; } }); function Set$1(array) { this._store = new Map$1(); // init with an array if (array && Array.isArray(array)) { for (var i = 0, len = array.length; i < len; i++) { this.add(array[i]); } } } Set$1.prototype.add = function (key) { return this._store.set(key, true); }; Set$1.prototype.has = function (key) { return this._store.has(key); }; Set$1.prototype.forEach = function (cb) { this._store.forEach(function (value, key) { cb(key); }); }; Object.defineProperty(Set$1.prototype, 'size', { get: function () { return this._store.size; } }); /* global Map,Set,Symbol */ // Based on https://kangax.github.io/compat-table/es6/ we can sniff out // incomplete Map/Set implementations which would otherwise cause our tests to fail. // Notably they fail in IE11 and iOS 8.4, which this prevents. function supportsMapAndSet() { if (typeof Symbol === 'undefined' || typeof Map === 'undefined' || typeof Set === 'undefined') { return false; } var prop = Object.getOwnPropertyDescriptor(Map, Symbol.species); return prop && 'get' in prop && Map[Symbol.species] === Map; } // based on https://github.com/montagejs/collections var ExportedSet; var ExportedMap; { if (supportsMapAndSet()) { // prefer built-in Map/Set ExportedSet = Set; ExportedMap = Map; } else { // fall back to our polyfill ExportedSet = Set$1; ExportedMap = Map$1; } } // like underscore/lodash _.pick() function pick(obj, arr) { var res = {}; for (var i = 0, len = arr.length; i < len; i++) { var prop = arr[i]; if (prop in obj) { res[prop] = obj[prop]; } } return res; } // Most browsers throttle concurrent requests at 6, so it's silly // to shim _bulk_get by trying to launch potentially hundreds of requests // and then letting the majority time out. We can handle this ourselves. var MAX_NUM_CONCURRENT_REQUESTS = 6; function identityFunction(x) { return x; } function formatResultForOpenRevsGet(result) { return [{ ok: result }]; } // shim for P/CouchDB adapters that don't directly implement _bulk_get function bulkGet(db, opts, callback) { var requests = opts.docs; // consolidate into one request per doc if possible var requestsById = new ExportedMap(); requests.forEach(function (request) { if (requestsById.has(request.id)) { requestsById.get(request.id).push(request); } else { requestsById.set(request.id, [request]); } }); var numDocs = requestsById.size; var numDone = 0; var perDocResults = new Array(numDocs); function collapseResultsAndFinish() { var results = []; perDocResults.forEach(function (res) { res.docs.forEach(function (info) { results.push({ id: res.id, docs: [info] }); }); }); callback(null, {results: results}); } function checkDone() { if (++numDone === numDocs) { collapseResultsAndFinish(); } } function gotResult(docIndex, id, docs) { perDocResults[docIndex] = {id: id, docs: docs}; checkDone(); } var allRequests = []; requestsById.forEach(function (value, key) { allRequests.push(key); }); var i = 0; function nextBatch() { if (i >= allRequests.length) { return; } var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length); var batch = allRequests.slice(i, upTo); processBatch(batch, i); i += batch.length; } function processBatch(batch, offset) { batch.forEach(function (docId, j) { var docIdx = offset + j; var docRequests = requestsById.get(docId); // just use the first request as the "template" // TODO: The _bulk_get API allows for more subtle use cases than this, // but for now it is unlikely that there will be a mix of different // "atts_since" or "attachments" in the same request, since it's just // replicate.js that is using this for the moment. // Also, atts_since is aspirational, since we don't support it yet. var docOpts = pick(docRequests[0], ['atts_since', 'attachments']); docOpts.open_revs = docRequests.map(function (request) { // rev is optional, open_revs disallowed return request.rev; }); // remove falsey / undefined revisions docOpts.open_revs = docOpts.open_revs.filter(identityFunction); var formatResult = identityFunction; if (docOpts.open_revs.length === 0) { delete docOpts.open_revs; // when fetching only the "winning" leaf, // transform the result so it looks like an open_revs // request formatResult = formatResultForOpenRevsGet; } // globally-supplied options ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) { if (param in opts) { docOpts[param] = opts[param]; } }); db.get(docId, docOpts, function (err, res) { var result; /* istanbul ignore if */ if (err) { result = [{error: err}]; } else { result = formatResult(res); } gotResult(docIdx, docId, result); nextBatch(); }); }); } nextBatch(); } var hasLocal; try { localStorage.setItem('_pouch_check_localstorage', 1); hasLocal = !!localStorage.getItem('_pouch_check_localstorage'); } catch (e) { hasLocal = false; } function hasLocalStorage() { return hasLocal; } // Custom nextTick() shim for browsers. In node, this will just be process.nextTick(). We inherits__WEBPACK_IMPORTED_MODULE_3___default()(Changes, events__WEBPACK_IMPORTED_MODULE_2__["EventEmitter"]); /* istanbul ignore next */ function attachBrowserEvents(self) { if (hasLocalStorage()) { addEventListener("storage", function (e) { self.emit(e.key); }); } } function Changes() { events__WEBPACK_IMPORTED_MODULE_2__["EventEmitter"].call(this); this._listeners = {}; attachBrowserEvents(this); } Changes.prototype.addListener = function (dbName, id, db, opts) { /* istanbul ignore if */ if (this._listeners[id]) { return; } var self = this; var inprogress = false; function eventFunction() { /* istanbul ignore if */ if (!self._listeners[id]) { return; } if (inprogress) { inprogress = 'waiting'; return; } inprogress = true; var changesOpts = pick(opts, [ 'style', 'include_docs', 'attachments', 'conflicts', 'filter', 'doc_ids', 'view', 'since', 'query_params', 'binary', 'return_docs' ]); /* istanbul ignore next */ function onError() { inprogress = false; } db.changes(changesOpts).on('change', function (c) { if (c.seq > opts.since && !opts.cancelled) { opts.since = c.seq; opts.onChange(c); } }).on('complete', function () { if (inprogress === 'waiting') { immediate__WEBPACK_IMPORTED_MODULE_1___default()(eventFunction); } inprogress = false; }).on('error', onError); } this._listeners[id] = eventFunction; this.on(dbName, eventFunction); }; Changes.prototype.removeListener = function (dbName, id) { /* istanbul ignore if */ if (!(id in this._listeners)) { return; } events__WEBPACK_IMPORTED_MODULE_2__["EventEmitter"].prototype.removeListener.call(this, dbName, this._listeners[id]); delete this._listeners[id]; }; /* istanbul ignore next */ Changes.prototype.notifyLocalWindows = function (dbName) { //do a useless change on a storage thing //in order to get other windows's listeners to activate if (hasLocalStorage()) { localStorage[dbName] = (localStorage[dbName] === "a") ? "b" : "a"; } }; Changes.prototype.notify = function (dbName) { this.emit(dbName); this.notifyLocalWindows(dbName); }; function guardedConsole(method) { /* istanbul ignore else */ if (typeof console !== 'undefined' && typeof console[method] === 'function') { var args = Array.prototype.slice.call(arguments, 1); console[method].apply(console, args); } } function randomNumber(min, max) { var maxTimeout = 600000; // Hard-coded default of 10 minutes min = parseInt(min, 10) || 0; max = parseInt(max, 10); if (max !== max || max <= min) { max = (min || 1) << 1; //doubling } else { max = max + 1; } // In order to not exceed maxTimeout, pick a random value between half of maxTimeout and maxTimeout if (max > maxTimeout) { min = maxTimeout >> 1; // divide by two max = maxTimeout; } var ratio = Math.random(); var range = max - min; return ~~(range * ratio + min); // ~~ coerces to an int, but fast. } function defaultBackOff(min) { var max = 0; if (!min) { max = 2000; } return randomNumber(min, max); } // designed to give info to browser users, who are disturbed // when they see http errors in the console function explainError(status, str) { guardedConsole('info', 'The above ' + status + ' is totally normal. ' + str); } var assign; { if (typeof Object.assign === 'function') { assign = Object.assign; } else { // lite Object.assign polyfill based on // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign assign = function (target) { var to = Object(target); for (var index = 1; index < arguments.length; index++) { var nextSource = arguments[index]; if (nextSource != null) { // Skip over if undefined or null for (var nextKey in nextSource) { // Avoid bugs when hasOwnProperty is shadowed if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) { to[nextKey] = nextSource[nextKey]; } } } } return to; }; } } var $inject_Object_assign = assign; inherits__WEBPACK_IMPORTED_MODULE_3___default()(PouchError, Error); function PouchError(status, error, reason) { Error.call(this, reason); this.status = status; this.name = error; this.message = reason; this.error = true; } PouchError.prototype.toString = function () { return JSON.stringify({ status: this.status, name: this.name, message: this.message, reason: this.reason }); }; var UNAUTHORIZED = new PouchError(401, 'unauthorized', "Name or password is incorrect."); var MISSING_BULK_DOCS = new PouchError(400, 'bad_request', "Missing JSON list of 'docs'"); var MISSING_DOC = new PouchError(404, 'not_found', 'missing'); var REV_CONFLICT = new PouchError(409, 'conflict', 'Document update conflict'); var INVALID_ID = new PouchError(400, 'bad_request', '_id field must contain a string'); var MISSING_ID = new PouchError(412, 'missing_id', '_id is required for puts'); var RESERVED_ID = new PouchError(400, 'bad_request', 'Only reserved document ids may start with underscore.'); var NOT_OPEN = new PouchError(412, 'precondition_failed', 'Database not open'); var UNKNOWN_ERROR = new PouchError(500, 'unknown_error', 'Database encountered an unknown error'); var BAD_ARG = new PouchError(500, 'badarg', 'Some query argument is invalid'); var INVALID_REQUEST = new PouchError(400, 'invalid_request', 'Request was invalid'); var QUERY_PARSE_ERROR = new PouchError(400, 'query_parse_error', 'Some query parameter is invalid'); var DOC_VALIDATION = new PouchError(500, 'doc_validation', 'Bad special document member'); var BAD_REQUEST = new PouchError(400, 'bad_request', 'Something wrong with the request'); var NOT_AN_OBJECT = new PouchError(400, 'bad_request', 'Document must be a JSON object'); var DB_MISSING = new PouchError(404, 'not_found', 'Database not found'); var IDB_ERROR = new PouchError(500, 'indexed_db_went_bad', 'unknown'); var WSQ_ERROR = new PouchError(500, 'web_sql_went_bad', 'unknown'); var LDB_ERROR = new PouchError(500, 'levelDB_went_went_bad', 'unknown'); var FORBIDDEN = new PouchError(403, 'forbidden', 'Forbidden by design doc validate_doc_update function'); var INVALID_REV = new PouchError(400, 'bad_request', 'Invalid rev format'); var FILE_EXISTS = new PouchError(412, 'file_exists', 'The database could not be created, the file already exists.'); var MISSING_STUB = new PouchError(412, 'missing_stub', 'A pre-existing attachment stub wasn\'t found'); var INVALID_URL = new PouchError(413, 'invalid_url', 'Provided URL is invalid'); function createError(error, reason) { function CustomPouchError(reason) { // inherit error properties from our parent error manually // so as to allow proper JSON parsing. /* jshint ignore:start */ for (var p in error) { if (typeof error[p] !== 'function') { this[p] = error[p]; } } /* jshint ignore:end */ if (reason !== undefined) { this.reason = reason; } } CustomPouchError.prototype = PouchError.prototype; return new CustomPouchError(reason); } function generateErrorFromResponse(err) { if (typeof err !== 'object') { var data = err; err = UNKNOWN_ERROR; err.data = data; } if ('error' in err && err.error === 'conflict') { err.name = 'conflict'; err.status = 409; } if (!('name' in err)) { err.name = err.error || 'unknown'; } if (!('status' in err)) { err.status = 500; } if (!('message' in err)) { err.message = err.message || err.reason; } return err; } function tryFilter(filter, doc, req) { try { return !filter(doc, req); } catch (err) { var msg = 'Filter function threw: ' + err.toString(); return createError(BAD_REQUEST, msg); } } function filterChange(opts) { var req = {}; var hasFilter = opts.filter && typeof opts.filter === 'function'; req.query = opts.query_params; return function filter(change) { if (!change.doc) { // CSG sends events on the changes feed that don't have documents, // this hack makes a whole lot of existing code robust. change.doc = {}; } var filterReturn = hasFilter && tryFilter(opts.filter, change.doc, req); if (typeof filterReturn === 'object') { return filterReturn; } if (filterReturn) { return false; } if (!opts.include_docs) { delete change.doc; } else if (!opts.attachments) { for (var att in change.doc._attachments) { /* istanbul ignore else */ if (change.doc._attachments.hasOwnProperty(att)) { change.doc._attachments[att].stub = true; } } } return true; }; } function flatten(arrs) { var res = []; for (var i = 0, len = arrs.length; i < len; i++) { res = res.concat(arrs[i]); } return res; } // shim for Function.prototype.name, // Determine id an ID is valid // - invalid IDs begin with an underescore that does not begin '_design' or // '_local' // - any other string value is a valid id // Returns the specific error object for each case function invalidIdError(id) { var err; if (!id) { err = createError(MISSING_ID); } else if (typeof id !== 'string') { err = createError(INVALID_ID); } else if (/^_/.test(id) && !(/^_(design|local)/).test(id)) { err = createError(RESERVED_ID); } if (err) { throw err; } } // Checks if a PouchDB object is "remote" or not. This is function isRemote(db) { if (typeof db._remote === 'boolean') { return db._remote; } /* istanbul ignore next */ if (typeof db.type === 'function') { guardedConsole('warn', 'db.type() is deprecated and will be removed in ' + 'a future version of PouchDB'); return db.type() === 'http'; } /* istanbul ignore next */ return false; } function listenerCount(ee, type) { return 'listenerCount' in ee ? ee.listenerCount(type) : events__WEBPACK_IMPORTED_MODULE_2__["EventEmitter"].listenerCount(ee, type); } function parseDesignDocFunctionName(s) { if (!s) { return null; } var parts = s.split('/'); if (parts.length === 2) { return parts; } if (parts.length === 1) { return [s, s]; } return null; } function normalizeDesignDocFunctionName(s) { var normalized = parseDesignDocFunctionName(s); return normalized ? normalized.join('/') : null; } // originally parseUri 1.2.2, now patched by us // (c) Steven Levithan <stevenlevithan.com> // MIT License var keys = ["source", "protocol", "authority", "userInfo", "user", "password", "host", "port", "relative", "path", "directory", "file", "query", "anchor"]; var qName ="queryKey"; var qParser = /(?:^|&)([^&=]*)=?([^&]*)/g; // use the "loose" parser /* eslint maxlen: 0, no-useless-escape: 0 */ var parser = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/; function parseUri(str) { var m = parser.exec(str); var uri = {}; var i = 14; while (i--) { var key = keys[i]; var value = m[i] || ""; var encoded = ['user', 'password'].indexOf(key) !== -1; uri[key] = encoded ? decodeURIComponent(value) : value; } uri[qName] = {}; uri[keys[12]].replace(qParser, function ($0, $1, $2) { if ($1) { uri[qName][$1] = $2; } }); return uri; } // Based on https://github.com/alexdavid/scope-eval v0.0.3 // (source: https://unpkg.com/scope-eval@0.0.3/scope_eval.js) // This is basically just a wrapper around new Function() function scopeEval(source, scope) { var keys = []; var values = []; for (var key in scope) { if (scope.hasOwnProperty(key)) { keys.push(key); values.push(scope[key]); } } keys.push(source); return Function.apply(null, keys).apply(null, values); } // this is essentially the "update sugar" function from daleharvey/pouchdb#1388 // the diffFun tells us what delta to apply to the doc. it either returns // the doc, or false if it doesn't need to do an update after all function upsert(db, docId, diffFun) { return new Promise(function (fulfill, reject) { db.get(docId, function (err, doc) { if (err) { /* istanbul ignore next */ if (err.status !== 404) { return reject(err); } doc = {}; } // the user might change the _rev, so save it for posterity var docRev = doc._rev; var newDoc = diffFun(doc); if (!newDoc) { // if the diffFun returns falsy, we short-circuit as // an optimization return fulfill({updated: false, rev: docRev}); } // users aren't allowed to modify these values, // so reset them here newDoc._id = docId; newDoc._rev = docRev; fulfill(tryAndPut(db, newDoc, diffFun)); }); }); } function tryAndPut(db, doc, diffFun) { return db.put(doc).then(function (res) { return { updated: true, rev: res.rev }; }, function (err) { /* istanbul ignore next */ if (err.status !== 409) { throw err; } return upsert(db, doc._id, diffFun); }); } var thisAtob = function (str) { return atob(str); }; var thisBtoa = function (str) { return btoa(str); }; // Abstracts constructing a Blob object, so it also works in older // browsers that don't support the native Blob constructor (e.g. // old QtWebKit versions, Android < 4.4). function createBlob(parts, properties) { /* global BlobBuilder,MSBlobBuilder,MozBlobBuilder,WebKitBlobBuilder */ parts = parts || []; properties = properties || {}; try { return new Blob(parts, properties); } catch (e) { if (e.name !== "TypeError") { throw e; } var Builder = typeof BlobBuilder !== 'undefined' ? BlobBuilder : typeof MSBlobBuilder !== 'undefined' ? MSBlobBuilder : typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder : WebKitBlobBuilder; var builder = new Builder(); for (var i = 0; i < parts.length; i += 1) { builder.append(parts[i]); } return builder.getBlob(properties.type); } } // From http://stackoverflow.com/questions/14967647/ (continues on next line) // encode-decode-image-with-base64-breaks-image (2013-04-21) function binaryStringToArrayBuffer(bin) { var length = bin.length; var buf = new ArrayBuffer(length); var arr = new Uint8Array(buf); for (var i = 0; i < length; i++) { arr[i] = bin.charCodeAt(i); } return buf; } function binStringToBluffer(binString, type) { return createBlob([binaryStringToArrayBuffer(binString)], {type: type}); } function b64ToBluffer(b64, type) { return binStringToBluffer(thisAtob(b64), type); } //Can't find original post, but this is close //http://stackoverflow.com/questions/6965107/ (continues on next line) //converting-between-strings-and-arraybuffers function arrayBufferToBinaryString(buffer) { var binary = ''; var bytes = new Uint8Array(buffer); var length = bytes.byteLength; for (var i = 0; i < length; i++) { binary += String.fromCharCode(bytes[i]); } return binary; } // shim for browsers that don't support it function readAsBinaryString(blob, callback) { var reader = new FileReader(); var hasBinaryString = typeof reader.readAsBinaryString === 'function'; reader.onloadend = function (e) { var result = e.target.result || ''; if (hasBinaryString) { return callback(result); } callback(arrayBufferToBinaryString(result)); }; if (hasBinaryString) { reader.readAsBinaryString(blob); } else { reader.readAsArrayBuffer(blob); } } function blobToBinaryString(blobOrBuffer, callback) { readAsBinaryString(blobOrBuffer, function (bin) { callback(bin); }); } function blobToBase64(blobOrBuffer, callback) { blobToBinaryString(blobOrBuffer, function (base64) { callback(thisBtoa(base64)); }); } // simplified API. universal browser support is assumed function readAsArrayBuffer(blob, callback) { var reader = new FileReader(); reader.onloadend = function (e) { var result = e.target.result || new ArrayBuffer(0); callback(result); }; reader.readAsArrayBuffer(blob); } // this is not used in the browser var setImmediateShim = global.setImmediate || global.setTimeout; var MD5_CHUNK_SIZE = 32768; function rawToBase64(raw) { return thisBtoa(raw); } function sliceBlob(blob, start, end) { if (blob.webkitSlice) { return blob.webkitSlice(start, end); } return blob.slice(start, end); } function appendBlob(buffer, blob, start, end, callback) { if (start > 0 || end < blob.size) { // only slice blob if we really need to blob = sliceBlob(blob, start, end); } readAsArrayBuffer(blob, function (arrayBuffer) { buffer.append(arrayBuffer); callback(); }); } function appendString(buffer, string, start, end, callback) { if (start > 0 || end < string.length) { // only create a substring if we really need to string = string.substring(start, end); } buffer.appendBinary(string); callback(); } function binaryMd5(data, callback) { var inputIsString = typeof data === 'string'; var len = inputIsString ? data.length : data.size; var chunkSize = Math.min(MD5_CHUNK_SIZE, len); var chunks = Math.ceil(len / chunkSize); var currentChunk = 0; var buffer = inputIsString ? new spark_md5__WEBPACK_IMPORTED_MODULE_4___default.a() : new spark_md5__WEBPACK_IMPORTED_MODULE_4___default.a.ArrayBuffer(); var append = inputIsString ? appendString : appendBlob; function next() { setImmediateShim(loadNextChunk); } function done() { var raw = buffer.end(true); var base64 = rawToBase64(raw); callback(base64); buffer.destroy(); } function loadNextChunk() { var start = currentChunk * chunkSize; var end = start + chunkSize; currentChunk++; if (currentChunk < chunks) { append(buffer, data, start, end, next); } else { append(buffer, data, start, end, done); } } loadNextChunk(); } function stringMd5(string) { return spark_md5__WEBPACK_IMPORTED_MODULE_4___default.a.hash(string); } function rev$$1(doc, deterministic_revs) { var clonedDoc = clone(doc); if (!deterministic_revs) { return uuid__WEBPACK_IMPORTED_MODULE_5___default.a.v4().replace(/-/g, '').toLowerCase(); } delete clonedDoc._rev_tree; return stringMd5(JSON.stringify(clonedDoc)); } var uuid = uuid__WEBPACK_IMPORTED_MODULE_5___default.a.v4; // We fetch all leafs of the revision tree, and sort them based on tree length // and whether they were deleted, undeleted documents with the longest revision // tree (most edits) win // The final sort algorithm is slightly documented in a sidebar here: // http://guide.couchdb.org/draft/conflicts.html function winningRev(metadata) { var winningId; var winningPos; var winningDeleted; var toVisit = metadata.rev_tree.slice(); var node; while ((node = toVisit.pop())) { var tree = node.ids; var branches = tree[2]; var pos = node.pos; if (branches.length) { // non-leaf for (var i = 0, len = branches.length; i < len; i++) { toVisit.push({pos: pos + 1, ids: branches[i]}); } continue; } var deleted = !!tree[1].deleted; var id = tree[0]; // sort by deleted, then pos, then id if (!winningId || (winningDeleted !== deleted ? winningDeleted : winningPos !== pos ? winningPos < pos : winningId < id)) { winningId = id; winningPos = pos; winningDeleted = deleted; } } return winningPos + '-' + winningId; } // Pretty much all below can be combined into a higher order function to // traverse revisions // The return value from the callback will be passed as context to all // children of that node function traverseRevTree(revs, callback) { var toVisit = revs.slice(); var node; while ((node = toVisit.pop())) { var pos = node.pos; var tree = node.ids; var branches = tree[2]; var newCtx = callback(branches.length === 0, pos, tree[0], node.ctx, tree[1]); for (var i = 0, len = branches.length; i < len; i++) { toVisit.push({pos: pos + 1, ids: branches[i], ctx: newCtx}); } } } function sortByPos(a, b) { return a.pos - b.pos; } function collectLeaves(revs) { var leaves = []; traverseRevTree(revs, function (isLeaf, pos, id, acc, opts) { if (isLeaf) { leaves.push({rev: pos + "-" + id, pos: pos, opts: opts}); } }); leaves.sort(sortByPos).reverse(); for (var i = 0, len = leaves.length; i < len; i++) { delete leaves[i].pos; } return leaves; } // returns revs of all conflicts that is leaves such that // 1. are not deleted and // 2. are different than winning revision function collectConflicts(metadata) { var win = winningRev(metadata); var leaves = collectLeaves(metadata.rev_tree); var conflicts = []; for (var i = 0, len = leaves.length; i < len; i++) { var leaf = leaves[i]; if (leaf.rev !== win && !leaf.opts.deleted) { conflicts.push(leaf.rev); } } return conflicts; } // compact a tree by marking its non-leafs as missing, // and return a list of revs to delete function compactTree(metadata) { var revs = []; traverseRevTree(metadata.rev_tree, function (isLeaf, pos, revHash, ctx, opts) { if (opts.status === 'available' && !isLeaf) { revs.push(pos + '-' + revHash); opts.status = 'missing'; } }); return revs; } // build up a list of all the paths to the leafs in this revision tree function rootToLeaf(revs) { var paths = []; var toVisit = revs.slice(); var node; while ((node = toVisit.pop())) { var pos = node.pos; var tree = node.ids; var id = tree[0]; var opts = tree[1]; var branches = tree[2]; var isLeaf = branches.length === 0; var history = node.history ? node.history.slice() : []; history.push({id: id, opts: opts}); if (isLeaf) { paths.push({pos: (pos + 1 - history.length), ids: history}); } for (var i = 0, len = branches.length; i < len; i++) { toVisit.push({pos: pos + 1, ids: branches[i], history: history}); } } return paths.reverse(); } // for a better overview of what this is doing, read: function sortByPos$1(a, b) { return a.pos - b.pos; } // classic binary search function binarySearch(arr, item, comparator) { var low = 0; var high = arr.length; var mid; while (low < high) { mid = (low + high) >>> 1; if (comparator(arr[mid], item) < 0) { low = mid + 1; } else { high = mid; } } return low; } // assuming the arr is sorted, insert the item in the proper place function insertSorted(arr, item, comparator) { var idx = binarySearch(arr, item, comparator); arr.splice(idx, 0, item); } // Turn a path as a flat array into a tree with a single branch. // If any should be stemmed from the beginning of the array, that's passed // in as the second argument function pathToTree(path, numStemmed) { var root; var leaf; for (var i = numStemmed, len = path.length; i < len; i++) { var node = path[i]; var currentLeaf = [node.id, node.opts, []]; if (leaf) { leaf[2].push(currentLeaf); leaf = currentLeaf; } else { root = leaf = currentLeaf; } } return root; } // compare the IDs of two trees function compareTree(a, b) { return a[0] < b[0] ? -1 : 1; } // Merge two trees together // The roots of tree1 and tree2 must be the same revision function mergeTree(in_tree1, in_tree2) { var queue = [{tree1: in_tree1, tree2: in_tree2}]; var conflicts = false; while (queue.length > 0) { var item = queue.pop(); var tree1 = item.tree1; var tree2 = item.tree2; if (tree1[1].status || tree2[1].status) { tree1[1].status = (tree1[1].status === 'available' || tree2[1].status === 'available') ? 'available' : 'missing'; } for (var i = 0; i < tree2[2].length; i++) { if (!tree1[2][0]) { conflicts = 'new_leaf'; tree1[2][0] = tree2[2][i]; continue; } var merged = false; for (var j = 0; j < tree1[2].length; j++) { if (tree1[2][j][0] === tree2[2][i][0]) { queue.push({tree1: tree1[2][j], tree2: tree2[2][i]}); merged = true; } } if (!merged) { conflicts = 'new_branch'; insertSorted(tree1[2], tree2[2][i], compareTree); } } } return {conflicts: conflicts, tree: in_tree1}; } function doMerge(tree, path, dontExpand) { var restree = []; var conflicts = false; var merged = false; var res; if (!tree.length) { return {tree: [path], conflicts: 'new_leaf'}; } for (var i = 0, len = tree.length; i < len; i++) { var branch = tree[i]; if (branch.pos === path.pos && branch.ids[0] === path.ids[0]) { // Paths start at the same position and have the same root, so they need // merged res = mergeTree(branch.ids, path.ids); restree.push({pos: branch.pos, ids: res.tree}); conflicts = conflicts || res.conflicts; merged = true; } else if (dontExpand !== true) { // The paths start at a different position, take the earliest path and // traverse up until it as at the same point from root as the path we // want to merge. If the keys match we return the longer path with the // other merged After stemming we dont want to expand the trees var t1 = branch.pos < path.pos ? branch : path; var t2 = branch.pos < path.pos ? path : branch; var diff = t2.pos - t1.pos; var candidateParents = []; var trees = []; trees.push({ids: t1.ids, diff: diff, parent: null, parentIdx: null}); while (trees.length > 0) { var item = trees.pop(); if (item.diff === 0) { if (item.ids[0] === t2.ids[0]) { candidateParents.push(item); } continue; } var elements = item.ids[2]; for (var j = 0, elementsLen = elements.length; j < elementsLen; j++) { trees.push({ ids: elements[j], diff: item.diff - 1, parent: item.ids, parentIdx: j }); } } var el = candidateParents[0]; if (!el) { restree.push(branch); } else { res = mergeTree(el.ids, t2.ids); el.parent[2][el.parentIdx] = res.tree; restree.push({pos: t1.pos, ids: t1.ids}); conflicts = conflicts || res.conflicts; merged = true; } } else { restree.push(branch); } } // We didnt find if (!merged) { restree.push(path); } restree.sort(sortByPos$1); return { tree: restree, conflicts: conflicts || 'internal_node' }; } // To ensure we dont grow the revision tree infinitely, we stem old revisions function stem(tree, depth) { // First we break out the tree into a complete list of root to leaf paths var paths = rootToLeaf(tree); var stemmedRevs; var result; for (var i = 0, len = paths.length; i < len; i++) { // Then for each path, we cut off the start of the path based on the // `depth` to stem to, and generate a new set of flat trees var path = paths[i]; var stemmed = path.ids; var node; if (stemmed.length > depth) { // only do the stemming work if we actually need to stem if (!stemmedRevs) { stemmedRevs = {}; // avoid allocating this object unnecessarily } var numStemmed = stemmed.length - depth; node = { pos: path.pos + numStemmed, ids: pathToTree(stemmed, numStemmed) }; for (var s = 0; s < numStemmed; s++) { var rev = (path.pos + s) + '-' + stemmed[s].id; stemmedRevs[rev] = true; } } else { // no need to actually stem node = { pos: path.pos, ids: pathToTree(stemmed, 0) }; } // Then we remerge all those flat trees together, ensuring that we dont // connect trees that would go beyond the depth limit if (result) { result = doMerge(result, node, true).tree; } else { result = [node]; } } // this is memory-heavy per Chrome profiler, avoid unless we actually stemmed if (stemmedRevs) { traverseRevTree(result, function (isLeaf, pos, revHash) { // some revisions may have been removed in a branch but not in another delete stemmedRevs[pos + '-' + revHash]; }); } return { tree: result, revs: stemmedRevs ? Object.keys(stemmedRevs) : [] }; } function merge(tree, path, depth) { var newTree = doMerge(tree, path); var stemmed = stem(newTree.tree, depth); return { tree: stemmed.tree, stemmedRevs: stemmed.revs, conflicts: newTree.conflicts }; } // return true if a rev exists in the rev tree, false otherwise function revExists(revs, rev) { var toVisit = revs.slice(); var splitRev = rev.split('-'); var targetPos = parseInt(splitRev[0], 10); var targetId = splitRev[1]; var node; while ((node = toVisit.pop())) { if (node.pos === targetPos && node.ids[0] === targetId) { return true; } var branches = node.ids[2]; for (var i = 0, len = branches.length; i < len; i++) { toVisit.push({pos: node.pos + 1, ids: branches[i]}); } } return false; } function getTrees(node) { return node.ids; } // check if a specific revision of a doc has been deleted // - metadata: the metadata object from the doc store // - rev: (optional) the revision to check. defaults to winning revision function isDeleted(metadata, rev) { if (!rev) { rev = winningRev(metadata); } var id = rev.substring(rev.indexOf('-') + 1); var toVisit = metadata.rev_tree.map(getTrees); var tree; while ((tree = toVisit.pop())) { if (tree[0] === id) { return !!tree[1].deleted; } toVisit = toVisit.concat(tree[2]); } } function isLocalId(id) { return (/^_local/).test(id); } // returns the current leaf node for a given revision function latest(rev, metadata) { var toVisit = metadata.rev_tree.slice(); var node; while ((node = toVisit.pop())) { var pos = node.pos; var tree = node.ids; var id = tree[0]; var opts = tree[1]; var branches = tree[2]; var isLeaf = branches.length === 0; var history = node.history ? node.history.slice() : []; history.push({id: id, pos: pos, opts: opts}); if (isLeaf) { for (var i = 0, len = history.length; i < len; i++) { var historyNode = history[i]; var historyRev = historyNode.pos + '-' + historyNode.id; if (historyRev === rev) { // return the rev of this leaf return pos + '-' + id; } } } for (var j = 0, l = branches.length; j < l; j++) { toVisit.push({pos: pos + 1, ids: branches[j], history: history}); } } /* istanbul ignore next */ throw new Error('Unable to resolve latest revision for id ' + metadata.id + ', rev ' + rev); } inherits__WEBPACK_IMPORTED_MODULE_3___default()(Changes$1, events__WEBPACK_IMPORTED_MODULE_2__["EventEmitter"]); function tryCatchInChangeListener(self, change, pending, lastSeq) { // isolate try/catches to avoid V8 deoptimizations try { self.emit('change', change, pending, lastSeq); } catch (e) { guardedConsole('error', 'Error in .on("change", function):', e); } } function Changes$1(db, opts, callback) { events__WEBPACK_IMPORTED_MODULE_2__["EventEmitter"].call(this); var self = this; this.db = db; opts = opts ? clone(opts) : {}; var complete = opts.complete = once(function (err, resp) { if (err) { if (listenerCount(self, 'error') > 0) { self.emit('error', err); } } else { self.emit('complete', resp); } self.removeAllListeners(); db.removeListener('destroyed', onDestroy); }); if (callback) { self.on('complete', function (resp) { callback(null, resp); }); self.on('error', callback); } function onDestroy() { self.cancel(); } db.once('destroyed', onDestroy); opts.onChange = function (change, pending, lastSeq) { /* istanbul ignore if */ if (self.isCancelled) { return; } tryCatchInChangeListener(self, change, pending, lastSeq); }; var promise = new Promise(function (fulfill, reject) { opts.complete = function (err, res) { if (err) { reject(err); } else { fulfill(res); } }; }); self.once('cancel', function () { db.removeListener('destroyed', onDestroy); opts.complete(null, {status: 'cancelled'}); }); this.then = promise.then.bind(promise); this['catch'] = promise['catch'].bind(promise); this.then(function (result) { complete(null, result); }, complete); if (!db.taskqueue.isReady) { db.taskqueue.addTask(function (failed) { if (failed) { opts.complete(failed); } else if (self.isCancelled) { self.emit('cancel'); } else { self.validateChanges(opts); } }); } else { self.validateChanges(opts); } } Changes$1.prototype.cancel = function () { this.isCancelled = true; if (this.db.taskqueue.isReady) { this.emit('cancel'); } }; function processChange(doc, metadata, opts) { var changeList = [{rev: doc._rev}]; if (opts.style === 'all_docs') { changeList = collectLeaves(metadata.rev_tree) .map(function (x) { return {rev: x.rev}; }); } var change = { id: metadata.id, changes: changeList, doc: doc }; if (isDeleted(metadata, doc._rev)) { change.deleted = true; } if (opts.conflicts) { change.doc._conflicts = collectConflicts(metadata); if (!change.doc._conflicts.length) { delete change.doc._conflicts; } } return change; } Changes$1.prototype.validateChanges = function (opts) { var callback = opts.complete; var self = this; /* istanbul ignore else */ if (PouchDB._changesFilterPlugin) { PouchDB._changesFilterPlugin.validate(opts, function (err) { if (err) { return callback(err); } self.doChanges(opts); }); } else { self.doChanges(opts); } }; Changes$1.prototype.doChanges = function (opts) { var self = this; var callback = opts.complete; opts = clone(opts); if ('live' in opts && !('continuous' in opts)) { opts.continuous = opts.live; } opts.processChange = processChange; if (opts.since === 'latest') { opts.since = 'now'; } if (!opts.since) { opts.since = 0; } if (opts.since === 'now') { this.db.info().then(function (info) { /* istanbul ignore if */ if (self.isCancelled) { callback(null, {status: 'cancelled'}); return; } opts.since = info.update_seq; self.doChanges(opts); }, callback); return; } /* istanbul ignore else */ if (PouchDB._changesFilterPlugin) { PouchDB._changesFilterPlugin.normalize(opts); if (PouchDB._changesFilterPlugin.shouldFilter(this, opts)) { return PouchDB._changesFilterPlugin.filter(this, opts); } } else { ['doc_ids', 'filter', 'selector', 'view'].forEach(function (key) { if (key in opts) { guardedConsole('warn', 'The "' + key + '" option was passed in to changes/replicate, ' + 'but pouchdb-changes-filter plugin is not installed, so it ' + 'was ignored. Please install the plugin to enable filtering.' ); } }); } if (!('descending' in opts)) { opts.descending = false; } // 0 and 1 should return 1 document opts.limit = opts.limit === 0 ? 1 : opts.limit; opts.complete = callback; var newPromise = this.db._changes(opts); /* istanbul ignore else */ if (newPromise && typeof newPromise.cancel === 'function') { var cancel = self.cancel; self.cancel = argsarray__WEBPACK_IMPORTED_MODULE_0___default()(function (args) { newPromise.cancel(); cancel.apply(this, args); }); } }; /* * A generic pouch adapter */ function compare(left, right) { return left < right ? -1 : left > right ? 1 : 0; } // Wrapper for functions that call the bulkdocs api with a single doc, // if the first result is an error, return an error function yankError(callback, docId) { return function (err, results) { if (err || (results[0] && results[0].error)) { err = err || results[0]; err.docId = docId; callback(err); } else { callback(null, results.length ? results[0] : results); } }; } // clean docs given to us by the user function cleanDocs(docs) { for (var i = 0; i < docs.length; i++) { var doc = docs[i]; if (doc._deleted) { delete doc._attachments; // ignore atts for deleted docs } else if (doc._attachments) { // filter out extraneous keys from _attachments var atts = Object.keys(doc._attachments); for (var j = 0; j < atts.length; j++) { var att = atts[j]; doc._attachments[att] = pick(doc._attachments[att], ['data', 'digest', 'content_type', 'length', 'revpos', 'stub']); } } } } // compare two docs, first by _id then by _rev function compareByIdThenRev(a, b) { var idCompare = compare(a._id, b._id); if (idCompare !== 0) { return idCompare; } var aStart = a._revisions ? a._revisions.start : 0; var bStart = b._revisions ? b._revisions.start : 0; return compare(aStart, bStart); } // for every node in a revision tree computes its distance from the closest // leaf function computeHeight(revs) { var height = {}; var edges = []; traverseRevTree(revs, function (isLeaf, pos, id, prnt) { var rev = pos + "-" + id; if (isLeaf) { height[rev] = 0; } if (prnt !== undefined) { edges.push({from: prnt, to: rev}); } return rev; }); edges.reverse(); edges.forEach(function (edge) { if (height[edge.from] === undefined) { height[edge.from] = 1 + height[edge.to]; } else { height[edge.from] = Math.min(height[edge.from], 1 + height[edge.to]); } }); return height; } function allDocsKeysParse(opts) { var keys = ('limit' in opts) ? opts.keys.slice(opts.skip, opts.limit + opts.skip) : (opts.skip > 0) ? opts.keys.slice(opts.skip) : opts.keys; opts.keys = keys; opts.skip = 0; delete opts.limit; if (opts.descending) { keys.reverse(); opts.descending = false; } } // all compaction is done in a queue, to avoid attaching // too many listeners at once function doNextCompaction(self) { var task = self._compactionQueue[0]; var opts = task.opts; var callback = task.callback; self.get('_local/compaction').catch(function () { return false; }).then(function (doc) { if (doc && doc.last_seq) { opts.last_seq = doc.last_seq; } self._compact(opts, function (err, res) { /* istanbul ignore if */ if (err) { callback(err); } else { callback(null, res); } immediate__WEBPACK_IMPORTED_MODULE_1___default()(function () { self._compactionQueue.shift(); if (self._compactionQueue.length) { doNextCompaction(self); } }); }); }); } function attachmentNameError(name) { if (name.charAt(0) === '_') { return name + ' is not a valid attachment name, attachment ' + 'names cannot start with \'_\''; } return false; } inherits__WEBPACK_IMPORTED_MODULE_3___default()(AbstractPouchDB, events__WEBPACK_IMPORTED_MODULE_2__["EventEmitter"]); function AbstractPouchDB() { events__WEBPACK_IMPORTED_MODULE_2__["EventEmitter"].call(this); // re-bind prototyped methods for (var p in AbstractPouchDB.prototype) { if (typeof this[p] === 'function') { this[p] = this[p].bind(this); } } } AbstractPouchDB.prototype.post = adapterFun('post', function (doc, opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } if (typeof doc !== 'object' || Array.isArray(doc)) { return callback(createError(NOT_AN_OBJECT)); } this.bulkDocs({docs: [doc]}, opts, yankError(callback, doc._id)); }); AbstractPouchDB.prototype.put = adapterFun('put', function (doc, opts, cb) { if (typeof opts === 'function') { cb = opts; opts = {}; } if (typeof doc !== 'object' || Array.isArray(doc)) { return cb(createError(NOT_AN_OBJECT)); } invalidIdError(doc._id); if (isLocalId(doc._id) && typeof this._putLocal === 'function') { if (doc._deleted) { return this._removeLocal(doc, cb); } else { return this._putLocal(doc, cb); } } var self = this; if (opts.force && doc._rev) { transformForceOptionToNewEditsOption(); putDoc(function (err) { var result = err ? null : {ok: true, id: doc._id, rev: doc._rev}; cb(err, result); }); } else { putDoc(cb); } function transformForceOptionToNewEditsOption() { var parts = doc._rev.split('-'); var oldRevId = parts[1]; var oldRevNum = parseInt(parts[0], 10); var newRevNum = oldRevNum + 1; var newRevId = rev$$1(); doc._revisions = { start: newRevNum, ids: [newRevId, oldRevId] }; doc._rev = newRevNum + '-' + newRevId; opts.new_edits = false; } function putDoc(next) { if (typeof self._put === 'function' && opts.new_edits !== false) { self._put(doc, opts, next); } else { self.bulkDocs({docs: [doc]}, opts, yankError(next, doc._id)); } } }); AbstractPouchDB.prototype.putAttachment = adapterFun('putAttachment', function (docId, attachmentId, rev, blob, type) { var api = this; if (typeof type === 'function') { type = blob; blob = rev; rev = null; } // Lets fix in https://github.com/pouchdb/pouchdb/issues/3267 /* istanbul ignore if */ if (typeof type === 'undefined') { type = blob; blob = rev; rev = null; } if (!type) { guardedConsole('warn', 'Attachment', attachmentId, 'on document', docId, 'is missing content_type'); } function createAttachment(doc) { var prevrevpos = '_rev' in doc ? parseInt(doc._rev, 10) : 0; doc._attachments = doc._attachments || {}; doc._attachments[attachmentId] = { content_type: type, data: blob, revpos: ++prevrevpos }; return api.put(doc); } return api.get(docId).then(function (doc) { if (doc._rev !== rev) { throw createError(REV_CONFLICT); } return createAttachment(doc); }, function (err) { // create new doc /* istanbul ignore else */ if (err.reason === MISSING_DOC.message) { return createAttachment({_id: docId}); } else { throw err; } }); }); AbstractPouchDB.prototype.removeAttachment = adapterFun('removeAttachment', function (docId, attachmentId, rev, callback) { var self = this; self.get(docId, function (err, obj) { /* istanbul ignore if */ if (err) { callback(err); return; } if (obj._rev !== rev) { callback(createError(REV_CONFLICT)); return; } /* istanbul ignore if */ if (!obj._attachments) { return callback(); } delete obj._attachments[attachmentId]; if (Object.keys(obj._attachments).length === 0) { delete obj._attachments; } self.put(obj, callback); }); }); AbstractPouchDB.prototype.remove = adapterFun('remove', function (docOrId, optsOrRev, opts, callback) { var doc; if (typeof optsOrRev === 'string') { // id, rev, opts, callback style doc = { _id: docOrId, _rev: optsOrRev }; if (typeof opts === 'function') { callback = opts; opts = {}; } } else { // doc, opts, callback style doc = docOrId; if (typeof optsOrRev === 'function') { callback = optsOrRev; opts = {}; } else { callback = opts; opts = optsOrRev; } } opts = opts || {}; opts.was_delete = true; var newDoc = {_id: doc._id, _rev: (doc._rev || opts.rev)}; newDoc._deleted = true; if (isLocalId(newDoc._id) && typeof this._removeLocal === 'function') { return this._removeLocal(doc, callback); } this.bulkDocs({docs: [newDoc]}, opts, yankError(callback, newDoc._id)); }); AbstractPouchDB.prototype.revsDiff = adapterFun('revsDiff', function (req, opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } var ids = Object.keys(req); if (!ids.length) { return callback(null, {}); } var count = 0; var missing = new ExportedMap(); function addToMissing(id, revId) { if (!missing.has(id)) { missing.set(id, {missing: []}); } missing.get(id).missing.push(revId); } function processDoc(id, rev_tree) { // Is this fast enough? Maybe we should switch to a set simulated by a map var missingForId = req[id].slice(0); traverseRevTree(rev_tree, function (isLeaf, pos, revHash, ctx, opts) { var rev = pos + '-' + revHash; var idx = missingForId.indexOf(rev); if (idx === -1) { return; } missingForId.splice(idx, 1); /* istanbul ignore if */ if (opts.status !== 'available') { addToMissing(id, rev); } }); // Traversing the tree is synchronous, so now `missingForId` contains // revisions that were not found in the tree missingForId.forEach(function (rev) { addToMissing(id, rev); }); } ids.map(function (id) { this._getRevisionTree(id, function (err, rev_tree) { if (err && err.status === 404 && err.message === 'missing') { missing.set(id, {missing: req[id]}); } else if (err) { /* istanbul ignore next */ return callback(err); } else { processDoc(id, rev_tree); } if (++count === ids.length) { // convert LazyMap to object var missingObj = {}; missing.forEach(function (value, key) { missingObj[key] = value; }); return callback(null, missingObj); } }); }, this); }); // _bulk_get API for faster replication, as described in // https://github.com/apache/couchdb-chttpd/pull/33 // At the "abstract" level, it will just run multiple get()s in // parallel, because this isn't much of a performance cost // for local databases (except the cost of multiple transactions, which is // small). The http adapter overrides this in order // to do a more efficient single HTTP request. AbstractPouchDB.prototype.bulkGet = adapterFun('bulkGet', function (opts, callback) { bulkGet(this, opts, callback); }); // compact one document and fire callback // by compacting we mean removing all revisions which // are further from the leaf in revision tree than max_height AbstractPouchDB.prototype.compactDocument = adapterFun('compactDocument', function (docId, maxHeight, callback) { var self = this; this._getRevisionTree(docId, function (err, revTree) { /* istanbul ignore if */ if (err) { return callback(err); } var height = computeHeight(revTree); var candidates = []; var revs = []; Object.keys(height).forEach(function (rev) { if (height[rev] > maxHeight) { candidates.push(rev); } }); traverseRevTree(revTree, function (isLeaf, pos, revHash, ctx, opts) { var rev = pos + '-' + revHash; if (opts.status === 'available' && candidates.indexOf(rev) !== -1) { revs.push(rev); } }); self._doCompaction(docId, revs, callback); }); }); // compact the whole database using single document // compaction AbstractPouchDB.prototype.compact = adapterFun('compact', function (opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } var self = this; opts = opts || {}; self._compactionQueue = self._compactionQueue || []; self._compactionQueue.push({opts: opts, callback: callback}); if (self._compactionQueue.length === 1) { doNextCompaction(self); } }); AbstractPouchDB.prototype._compact = function (opts, callback) { var self = this; var changesOpts = { return_docs: false, last_seq: opts.last_seq || 0 }; var promises = []; function onChange(row) { promises.push(self.compactDocument(row.id, 0)); } function onComplete(resp) { var lastSeq = resp.last_seq; Promise.all(promises).then(function () { return upsert(self, '_local/compaction', function deltaFunc(doc) { if (!doc.last_seq || doc.last_seq < lastSeq) { doc.last_seq = lastSeq; return doc; } return false; // somebody else got here first, don't update }); }).then(function () { callback(null, {ok: true}); }).catch(callback); } self.changes(changesOpts) .on('change', onChange) .on('complete', onComplete) .on('error', callback); }; /* Begin api wrappers. Specific functionality to storage belongs in the _[method] */ AbstractPouchDB.prototype.get = adapterFun('get', function (id, opts, cb) { if (typeof opts === 'function') { cb = opts; opts = {}; } if (typeof id !== 'string') { return cb(createError(INVALID_ID)); } if (isLocalId(id) && typeof this._getLocal === 'function') { return this._getLocal(id, cb); } var leaves = [], self = this; function finishOpenRevs() { var result = []; var count = leaves.length; /* istanbul ignore if */ if (!count) { return cb(null, result); } // order with open_revs is unspecified leaves.forEach(function (leaf) { self.get(id, { rev: leaf, revs: opts.revs, latest: opts.latest, attachments: opts.attachments, binary: opts.binary }, function (err, doc) { if (!err) { // using latest=true can produce duplicates var existing; for (var i = 0, l = result.length; i < l; i++) { if (result[i].ok && result[i].ok._rev === doc._rev) { existing = true; break; } } if (!existing) { result.push({ok: doc}); } } else { result.push({missing: leaf}); } count--; if (!count) { cb(null, result); } }); }); } if (opts.open_revs) { if (opts.open_revs === "all") { this._getRevisionTree(id, function (err, rev_tree) { /* istanbul ignore if */ if (err) { return cb(err); } leaves = collectLeaves(rev_tree).map(function (leaf) { return leaf.rev; }); finishOpenRevs(); }); } else { if (Array.isArray(opts.open_revs)) { leaves = opts.open_revs; for (var i = 0; i < leaves.length; i++) { var l = leaves[i]; // looks like it's the only thing couchdb checks if (!(typeof (l) === "string" && /^\d+-/.test(l))) { return cb(createError(INVALID_REV)); } } finishOpenRevs(); } else { return cb(createError(UNKNOWN_ERROR, 'function_clause')); } } return; // open_revs does not like other options } return this._get(id, opts, function (err, result) { if (err) { err.docId = id; return cb(err); } var doc = result.doc; var metadata = result.metadata; var ctx = result.ctx; if (opts.conflicts) { var conflicts = collectConflicts(metadata); if (conflicts.length) { doc._conflicts = conflicts; } } if (isDeleted(metadata, doc._rev)) { doc._deleted = true; } if (opts.revs || opts.revs_info) { var splittedRev = doc._rev.split('-'); var revNo = parseInt(splittedRev[0], 10); var revHash = splittedRev[1]; var paths = rootToLeaf(metadata.rev_tree); var path = null; for (var i = 0; i < paths.length; i++) { var currentPath = paths[i]; var hashIndex = currentPath.ids.map(function (x) { return x.id; }) .indexOf(revHash); var hashFoundAtRevPos = hashIndex === (revNo - 1); if (hashFoundAtRevPos || (!path && hashIndex !== -1)) { path = currentPath; } } var indexOfRev = path.ids.map(function (x) { return x.id; }) .indexOf(doc._rev.split('-')[1]) + 1; var howMany = path.ids.length - indexOfRev; path.ids.splice(indexOfRev, howMany); path.ids.reverse(); if (opts.revs) { doc._revisions = { start: (path.pos + path.ids.length) - 1, ids: path.ids.map(function (rev) { return rev.id; }) }; } if (opts.revs_info) { var pos = path.pos + path.ids.length; doc._revs_info = path.ids.map(function (rev) { pos--; return { rev: pos + '-' + rev.id, status: rev.opts.status }; }); } } if (opts.attachments && doc._attachments) { var attachments = doc._attachments; var count = Object.keys(attachments).length; if (count === 0) { return cb(null, doc); } Object.keys(attachments).forEach(function (key) { this._getAttachment(doc._id, key, attachments[key], { // Previously the revision handling was done in adapter.js // getAttachment, however since idb-next doesnt we need to // pass the rev through rev: doc._rev, binary: opts.binary, ctx: ctx }, function (err, data) { var att = doc._attachments[key]; att.data = data; delete att.stub; delete att.length; if (!--count) { cb(null, doc); } }); }, self); } else { if (doc._attachments) { for (var key in doc._attachments) { /* istanbul ignore else */ if (doc._attachments.hasOwnProperty(key)) { doc._attachments[key].stub = true; } } } cb(null, doc); } }); }); // TODO: I dont like this, it forces an extra read for every // attachment read and enforces a confusing api between // adapter.js and the adapter implementation AbstractPouchDB.prototype.getAttachment = adapterFun('getAttachment', function (docId, attachmentId, opts, callback) { var self = this; if (opts instanceof Function) { callback = opts; opts = {}; } this._get(docId, opts, function (err, res) { if (err) { return callback(err); } if (res.doc._attachments && res.doc._attachments[attachmentId]) { opts.ctx = res.ctx; opts.binary = true; self._getAttachment(docId, attachmentId, res.doc._attachments[attachmentId], opts, callback); } else { return callback(createError(MISSING_DOC)); } }); }); AbstractPouchDB.prototype.allDocs = adapterFun('allDocs', function (opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } opts.skip = typeof opts.skip !== 'undefined' ? opts.skip : 0; if (opts.start_key) { opts.startkey = opts.start_key; } if (opts.end_key) { opts.endkey = opts.end_key; } if ('keys' in opts) { if (!Array.isArray(opts.keys)) { return callback(new TypeError('options.keys must be an array')); } var incompatibleOpt = ['startkey', 'endkey', 'key'].filter(function (incompatibleOpt) { return incompatibleOpt in opts; })[0]; if (incompatibleOpt) { callback(createError(QUERY_PARSE_ERROR, 'Query parameter `' + incompatibleOpt + '` is not compatible with multi-get' )); return; } if (!isRemote(this)) { allDocsKeysParse(opts); if (opts.keys.length === 0) { return this._allDocs({limit: 0}, callback); } } } return this._allDocs(opts, callback); }); AbstractPouchDB.prototype.changes = function (opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } opts = opts || {}; // By default set return_docs to false if the caller has opts.live = true, // this will prevent us from collecting the set of changes indefinitely // resulting in growing memory opts.return_docs = ('return_docs' in opts) ? opts.return_docs : !opts.live; return new Changes$1(this, opts, callback); }; AbstractPouchDB.prototype.close = adapterFun('close', function (callback) { this._closed = true; this.emit('closed'); return this._close(callback); }); AbstractPouchDB.prototype.info = adapterFun('info', function (callback) { var self = this; this._info(function (err, info) { if (err) { return callback(err); } // assume we know better than the adapter, unless it informs us info.db_name = info.db_name || self.name; info.auto_compaction = !!(self.auto_compaction && !isRemote(self)); info.adapter = self.adapter; callback(null, info); }); }); AbstractPouchDB.prototype.id = adapterFun('id', function (callback) { return this._id(callback); }); /* istanbul ignore next */ AbstractPouchDB.prototype.type = function () { return (typeof this._type === 'function') ? this._type() : this.adapter; }; AbstractPouchDB.prototype.bulkDocs = adapterFun('bulkDocs', function (req, opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } opts = opts || {}; if (Array.isArray(req)) { req = { docs: req }; } if (!req || !req.docs || !Array.isArray(req.docs)) { return callback(createError(MISSING_BULK_DOCS)); } for (var i = 0; i < req.docs.length; ++i) { if (typeof req.docs[i] !== 'object' || Array.isArray(req.docs[i])) { return callback(createError(NOT_AN_OBJECT)); } } var attachmentError; req.docs.forEach(function (doc) { if (doc._attachments) { Object.keys(doc._attachments).forEach(function (name) { attachmentError = attachmentError || attachmentNameError(name); if (!doc._attachments[name].content_type) { guardedConsole('warn', 'Attachment', name, 'on document', doc._id, 'is missing content_type'); } }); } }); if (attachmentError) { return callback(createError(BAD_REQUEST, attachmentError)); } if (!('new_edits' in opts)) { if ('new_edits' in req) { opts.new_edits = req.new_edits; } else { opts.new_edits = true; } } var adapter = this; if (!opts.new_edits && !isRemote(adapter)) { // ensure revisions of the same doc are sorted, so that // the local adapter processes them correctly (#2935) req.docs.sort(compareByIdThenRev); } cleanDocs(req.docs); // in the case of conflicts, we want to return the _ids to the user // however, the underlying adapter may destroy the docs array, so // create a copy here var ids = req.docs.map(function (doc) { return doc._id; }); return this._bulkDocs(req, opts, function (err, res) { if (err) { return callback(err); } if (!opts.new_edits) { // this is what couch does when new_edits is false res = res.filter(function (x) { return x.error; }); } // add ids for error/conflict responses (not required for CouchDB) if (!isRemote(adapter)) { for (var i = 0, l = res.length; i < l; i++) { res[i].id = res[i].id || ids[i]; } } callback(null, res); }); }); AbstractPouchDB.prototype.registerDependentDatabase = adapterFun('registerDependentDatabase', function (dependentDb, callback) { var depDB = new this.constructor(dependentDb, this.__opts); function diffFun(doc) { doc.dependentDbs = doc.dependentDbs || {}; if (doc.dependentDbs[dependentDb]) { return false; // no update required } doc.dependentDbs[dependentDb] = true; return doc; } upsert(this, '_local/_pouch_dependentDbs', diffFun) .then(function () { callback(null, {db: depDB}); }).catch(callback); }); AbstractPouchDB.prototype.destroy = adapterFun('destroy', function (opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } var self = this; var usePrefix = 'use_prefix' in self ? self.use_prefix : true; function destroyDb() { // call destroy method of the particular adaptor self._destroy(opts, function (err, resp) { if (err) { return callback(err); } self._destroyed = true; self.emit('destroyed'); callback(null, resp || { 'ok': true }); }); } if (isRemote(self)) { // no need to check for dependent DBs if it's a remote DB return destroyDb(); } self.get('_local/_pouch_dependentDbs', function (err, localDoc) { if (err) { /* istanbul ignore if */ if (err.status !== 404) { return callback(err); } else { // no dependencies return destroyDb(); } } var dependentDbs = localDoc.dependentDbs; var PouchDB = self.constructor; var deletedMap = Object.keys(dependentDbs).map(function (name) { // use_prefix is only false in the browser /* istanbul ignore next */ var trueName = usePrefix ? name.replace(new RegExp('^' + PouchDB.prefix), '') : name; return new PouchDB(trueName, self.__opts).destroy(); }); Promise.all(deletedMap).then(destroyDb, callback); }); }); function TaskQueue() { this.isReady = false; this.failed = false; this.queue = []; } TaskQueue.prototype.execute = function () { var fun; if (this.failed) { while ((fun = this.queue.shift())) { fun(this.failed); } } else { while ((fun = this.queue.shift())) { fun(); } } }; TaskQueue.prototype.fail = function (err) { this.failed = err; this.execute(); }; TaskQueue.prototype.ready = function (db) { this.isReady = true; this.db = db; this.execute(); }; TaskQueue.prototype.addTask = function (fun) { this.queue.push(fun); if (this.failed) { this.execute(); } }; function parseAdapter(name, opts) { var match = name.match(/([a-z-]*):\/\/(.*)/); if (match) { // the http adapter expects the fully qualified name return { name: /https?/.test(match[1]) ? match[1] + '://' + match[2] : match[2], adapter: match[1] }; } var adapters = PouchDB.adapters; var preferredAdapters = PouchDB.preferredAdapters; var prefix = PouchDB.prefix; var adapterName = opts.adapter; if (!adapterName) { // automatically determine adapter for (var i = 0; i < preferredAdapters.length; ++i) { adapterName = preferredAdapters[i]; // check for browsers that have been upgraded from websql-only to websql+idb /* istanbul ignore if */ if (adapterName === 'idb' && 'websql' in adapters && hasLocalStorage() && localStorage['_pouch__websqldb_' + prefix + name]) { // log it, because this can be confusing during development guardedConsole('log', 'PouchDB is downgrading "' + name + '" to WebSQL to' + ' avoid data loss, because it was already opened with WebSQL.'); continue; // keep using websql to avoid user data loss } break; } } var adapter = adapters[adapterName]; // if adapter is invalid, then an error will be thrown later var usePrefix = (adapter && 'use_prefix' in adapter) ? adapter.use_prefix : true; return { name: usePrefix ? (prefix + name) : name, adapter: adapterName }; } // OK, so here's the deal. Consider this code: // var db1 = new PouchDB('foo'); // var db2 = new PouchDB('foo'); // db1.destroy(); // ^ these two both need to emit 'destroyed' events, // as well as the PouchDB constructor itself. // So we have one db object (whichever one got destroy() called on it) // responsible for emitting the initial event, which then gets emitted // by the constructor, which then broadcasts it to any other dbs // that may have been created with the same name. function prepareForDestruction(self) { function onDestroyed(from_constructor) { self.removeListener('closed', onClosed); if (!from_constructor) { self.constructor.emit('destroyed', self.name); } } function onClosed() { self.removeListener('destroyed', onDestroyed); self.constructor.emit('unref', self); } self.once('destroyed', onDestroyed); self.once('closed', onClosed); self.constructor.emit('ref', self); } inherits__WEBPACK_IMPORTED_MODULE_3___default()(PouchDB, AbstractPouchDB); function PouchDB(name, opts) { // In Node our test suite only tests this for PouchAlt unfortunately /* istanbul ignore if */ if (!(this instanceof PouchDB)) { return new PouchDB(name, opts); } var self = this; opts = opts || {}; if (name && typeof name === 'object') { opts = name; name = opts.name; delete opts.name; } if (opts.deterministic_revs === undefined) { opts.deterministic_revs = true; } this.__opts = opts = clone(opts); self.auto_compaction = opts.auto_compaction; self.prefix = PouchDB.prefix; if (typeof name !== 'string') { throw new Error('Missing/invalid DB name'); } var prefixedName = (opts.prefix || '') + name; var backend = parseAdapter(prefixedName, opts); opts.name = backend.name; opts.adapter = opts.adapter || backend.adapter; self.name = name; self._adapter = opts.adapter; PouchDB.emit('debug', ['adapter', 'Picked adapter: ', opts.adapter]); if (!PouchDB.adapters[opts.adapter] || !PouchDB.adapters[opts.adapter].valid()) { throw new Error('Invalid Adapter: ' + opts.adapter); } AbstractPouchDB.call(self); self.taskqueue = new TaskQueue(); self.adapter = opts.adapter; PouchDB.adapters[opts.adapter].call(self, opts, function (err) { if (err) { return self.taskqueue.fail(err); } prepareForDestruction(self); self.emit('created', self); PouchDB.emit('created', self.name); self.taskqueue.ready(self); }); } // AbortController was introduced quite a while after fetch and // isnt required for PouchDB to function so polyfill if needed var a = (typeof AbortController !== 'undefined') ? AbortController : function () { return {abort: function () {}}; }; var f$1 = fetch; var h = Headers; PouchDB.adapters = {}; PouchDB.preferredAdapters = []; PouchDB.prefix = '_pouch_'; var eventEmitter = new events__WEBPACK_IMPORTED_MODULE_2__["EventEmitter"](); function setUpEventEmitter(Pouch) { Object.keys(events__WEBPACK_IMPORTED_MODULE_2__["EventEmitter"].prototype).forEach(function (key) { if (typeof events__WEBPACK_IMPORTED_MODULE_2__["EventEmitter"].prototype[key] === 'function') { Pouch[key] = eventEmitter[key].bind(eventEmitter); } }); // these are created in constructor.js, and allow us to notify each DB with // the same name that it was destroyed, via the constructor object var destructListeners = Pouch._destructionListeners = new ExportedMap(); Pouch.on('ref', function onConstructorRef(db) { if (!destructListeners.has(db.name)) { destructListeners.set(db.name, []); } destructListeners.get(db.name).push(db); }); Pouch.on('unref', function onConstructorUnref(db) { if (!destructListeners.has(db.name)) { return; } var dbList = destructListeners.get(db.name); var pos = dbList.indexOf(db); if (pos < 0) { /* istanbul ignore next */ return; } dbList.splice(pos, 1); if (dbList.length > 1) { /* istanbul ignore next */ destructListeners.set(db.name, dbList); } else { destructListeners.delete(db.name); } }); Pouch.on('destroyed', function onConstructorDestroyed(name) { if (!destructListeners.has(name)) { return; } var dbList = destructListeners.get(name); destructListeners.delete(name); dbList.forEach(function (db) { db.emit('destroyed',true); }); }); } setUpEventEmitter(PouchDB); PouchDB.adapter = function (id, obj, addToPreferredAdapters) { /* istanbul ignore else */ if (obj.valid()) { PouchDB.adapters[id] = obj; if (addToPreferredAdapters) { PouchDB.preferredAdapters.push(id); } } }; PouchDB.plugin = function (obj) { if (typeof obj === 'function') { // function style for plugins obj(PouchDB); } else if (typeof obj !== 'object' || Object.keys(obj).length === 0) { throw new Error('Invalid plugin: got "' + obj + '", expected an object or a function'); } else { Object.keys(obj).forEach(function (id) { // object style for plugins PouchDB.prototype[id] = obj[id]; }); } if (this.__defaults) { PouchDB.__defaults = $inject_Object_assign({}, this.__defaults); } return PouchDB; }; PouchDB.defaults = function (defaultOpts) { function PouchAlt(name, opts) { if (!(this instanceof PouchAlt)) { return new PouchAlt(name, opts); } opts = opts || {}; if (name && typeof name === 'object') { opts = name; name = opts.name; delete opts.name; } opts = $inject_Object_assign({}, PouchAlt.__defaults, opts); PouchDB.call(this, name, opts); } inherits__WEBPACK_IMPORTED_MODULE_3___default()(PouchAlt, PouchDB); PouchAlt.preferredAdapters = PouchDB.preferredAdapters.slice(); Object.keys(PouchDB).forEach(function (key) { if (!(key in PouchAlt)) { PouchAlt[key] = PouchDB[key]; } }); // make default options transitive // https://github.com/pouchdb/pouchdb/issues/5922 PouchAlt.__defaults = $inject_Object_assign({}, this.__defaults, defaultOpts); return PouchAlt; }; PouchDB.fetch = function (url, opts) { return f$1(url, opts); }; // managed automatically by set-version.js var version = "7.0.0"; // this would just be "return doc[field]", but fields // can be "deep" due to dot notation function getFieldFromDoc(doc, parsedField) { var value = doc; for (var i = 0, len = parsedField.length; i < len; i++) { var key = parsedField[i]; value = value[key]; if (!value) { break; } } return value; } function compare$1(left, right) { return left < right ? -1 : left > right ? 1 : 0; } // Converts a string in dot notation to an array of its components, with backslash escaping function parseField(fieldName) { // fields may be deep (e.g. "foo.bar.baz"), so parse var fields = []; var current = ''; for (var i = 0, len = fieldName.length; i < len; i++) { var ch = fieldName[i]; if (ch === '.') { if (i > 0 && fieldName[i - 1] === '\\') { // escaped delimiter current = current.substring(0, current.length - 1) + '.'; } else { // not escaped, so delimiter fields.push(current); current = ''; } } else { // normal character current += ch; } } fields.push(current); return fields; } var combinationFields = ['$or', '$nor', '$not']; function isCombinationalField(field) { return combinationFields.indexOf(field) > -1; } function getKey(obj) { return Object.keys(obj)[0]; } function getValue(obj) { return obj[getKey(obj)]; } // flatten an array of selectors joined by an $and operator function mergeAndedSelectors(selectors) { // sort to ensure that e.g. if the user specified // $and: [{$gt: 'a'}, {$gt: 'b'}], then it's collapsed into // just {$gt: 'b'} var res = {}; selectors.forEach(function (selector) { Object.keys(selector).forEach(function (field) { var matcher = selector[field]; if (typeof matcher !== 'object') { matcher = {$eq: matcher}; } if (isCombinationalField(field)) { if (matcher instanceof Array) { res[field] = matcher.map(function (m) { return mergeAndedSelectors([m]); }); } else { res[field] = mergeAndedSelectors([matcher]); } } else { var fieldMatchers = res[field] = res[field] || {}; Object.keys(matcher).forEach(function (operator) { var value = matcher[operator]; if (operator === '$gt' || operator === '$gte') { return mergeGtGte(operator, value, fieldMatchers); } else if (operator === '$lt' || operator === '$lte') { return mergeLtLte(operator, value, fieldMatchers); } else if (operator === '$ne') { return mergeNe(value, fieldMatchers); } else if (operator === '$eq') { return mergeEq(value, fieldMatchers); } fieldMatchers[operator] = value; }); } }); }); return res; } // collapse logically equivalent gt/gte values function mergeGtGte(operator, value, fieldMatchers) { if (typeof fieldMatchers.$eq !== 'undefined') { return; // do nothing } if (typeof fieldMatchers.$gte !== 'undefined') { if (operator === '$gte') { if (value > fieldMatchers.$gte) { // more specificity fieldMatchers.$gte = value; } } else { // operator === '$gt' if (value >= fieldMatchers.$gte) { // more specificity delete fieldMatchers.$gte; fieldMatchers.$gt = value; } } } else if (typeof fieldMatchers.$gt !== 'undefined') { if (operator === '$gte') { if (value > fieldMatchers.$gt) { // more specificity delete fieldMatchers.$gt; fieldMatchers.$gte = value; } } else { // operator === '$gt' if (value > fieldMatchers.$gt) { // more specificity fieldMatchers.$gt = value; } } } else { fieldMatchers[operator] = value; } } // collapse logically equivalent lt/lte values function mergeLtLte(operator, value, fieldMatchers) { if (typeof fieldMatchers.$eq !== 'undefined') { return; // do nothing } if (typeof fieldMatchers.$lte !== 'undefined') { if (operator === '$lte') { if (value < fieldMatchers.$lte) { // more specificity fieldMatchers.$lte = value; } } else { // operator === '$gt' if (value <= fieldMatchers.$lte) { // more specificity delete fieldMatchers.$lte; fieldMatchers.$lt = value; } } } else if (typeof fieldMatchers.$lt !== 'undefined') { if (operator === '$lte') { if (value < fieldMatchers.$lt) { // more specificity delete fieldMatchers.$lt; fieldMatchers.$lte = value; } } else { // operator === '$gt' if (value < fieldMatchers.$lt) { // more specificity fieldMatchers.$lt = value; } } } else { fieldMatchers[operator] = value; } } // combine $ne values into one array function mergeNe(value, fieldMatchers) { if ('$ne' in fieldMatchers) { // there are many things this could "not" be fieldMatchers.$ne.push(value); } else { // doesn't exist yet fieldMatchers.$ne = [value]; } } // add $eq into the mix function mergeEq(value, fieldMatchers) { // these all have less specificity than the $eq // TODO: check for user errors here delete fieldMatchers.$gt; delete fieldMatchers.$gte; delete fieldMatchers.$lt; delete fieldMatchers.$lte; delete fieldMatchers.$ne; fieldMatchers.$eq = value; } // // normalize the selector // function massageSelector(input) { var result = clone(input); var wasAnded = false; if ('$and' in result) { result = mergeAndedSelectors(result['$and']); wasAnded = true; } ['$or', '$nor'].forEach(function (orOrNor) { if (orOrNor in result) { // message each individual selector // e.g. {foo: 'bar'} becomes {foo: {$eq: 'bar'}} result[orOrNor].forEach(function (subSelector) { var fields = Object.keys(subSelector); for (var i = 0; i < fields.length; i++) { var field = fields[i]; var matcher = subSelector[field]; if (typeof matcher !== 'object' || matcher === null) { subSelector[field] = {$eq: matcher}; } } }); } }); if ('$not' in result) { //This feels a little like forcing, but it will work for now, //I would like to come back to this and make the merging of selectors a little more generic result['$not'] = mergeAndedSelectors([result['$not']]); } var fields = Object.keys(result); for (var i = 0; i < fields.length; i++) { var field = fields[i]; var matcher = result[field]; if (typeof matcher !== 'object' || matcher === null) { matcher = {$eq: matcher}; } else if ('$ne' in matcher && !wasAnded) { // I put these in an array, since there may be more than one // but in the "mergeAnded" operation, I already take care of that matcher.$ne = [matcher.$ne]; } result[field] = matcher; } return result; } function pad(str, padWith, upToLength) { var padding = ''; var targetLength = upToLength - str.length; /* istanbul ignore next */ while (padding.length < targetLength) { padding += padWith; } return padding; } function padLeft(str, padWith, upToLength) { var padding = pad(str, padWith, upToLength); return padding + str; } var MIN_MAGNITUDE = -324; // verified by -Number.MIN_VALUE var MAGNITUDE_DIGITS = 3; // ditto var SEP = ''; // set to '_' for easier debugging function collate(a, b) { if (a === b) { return 0; } a = normalizeKey(a); b = normalizeKey(b); var ai = collationIndex(a); var bi = collationIndex(b); if ((ai - bi) !== 0) { return ai - bi; } switch (typeof a) { case 'number': return a - b; case 'boolean': return a < b ? -1 : 1; case 'string': return stringCollate(a, b); } return Array.isArray(a) ? arrayCollate(a, b) : objectCollate(a, b); } // couch considers null/NaN/Infinity/-Infinity === undefined, // for the purposes of mapreduce indexes. also, dates get stringified. function normalizeKey(key) { switch (typeof key) { case 'undefined': return null; case 'number': if (key === Infinity || key === -Infinity || isNaN(key)) { return null; } return key; case 'object': var origKey = key; if (Array.isArray(key)) { var len = key.length; key = new Array(len); for (var i = 0; i < len; i++) { key[i] = normalizeKey(origKey[i]); } /* istanbul ignore next */ } else if (key instanceof Date) { return key.toJSON(); } else if (key !== null) { // generic object key = {}; for (var k in origKey) { if (origKey.hasOwnProperty(k)) { var val = origKey[k]; if (typeof val !== 'undefined') { key[k] = normalizeKey(val); } } } } } return key; } function indexify(key) { if (key !== null) { switch (typeof key) { case 'boolean': return key ? 1 : 0; case 'number': return numToIndexableString(key); case 'string': // We've to be sure that key does not contain \u0000 // Do order-preserving replacements: // 0 -> 1, 1 // 1 -> 1, 2 // 2 -> 2, 2 /* eslint-disable no-control-regex */ return key .replace(/\u0002/g, '\u0002\u0002') .replace(/\u0001/g, '\u0001\u0002') .replace(/\u0000/g, '\u0001\u0001'); /* eslint-enable no-control-regex */ case 'object': var isArray = Array.isArray(key); var arr = isArray ? key : Object.keys(key); var i = -1; var len = arr.length; var result = ''; if (isArray) { while (++i < len) { result += toIndexableString(arr[i]); } } else { while (++i < len) { var objKey = arr[i]; result += toIndexableString(objKey) + toIndexableString(key[objKey]); } } return result; } } return ''; } // convert the given key to a string that would be appropriate // for lexical sorting, e.g. within a database, where the // sorting is the same given by the collate() function. function toIndexableString(key) { var zero = '\u0000'; key = normalizeKey(key); return collationIndex(key) + SEP + indexify(key) + zero; } function parseNumber(str, i) { var originalIdx = i; var num; var zero = str[i] === '1'; if (zero) { num = 0; i++; } else { var neg = str[i] === '0'; i++; var numAsString = ''; var magAsString = str.substring(i, i + MAGNITUDE_DIGITS); var magnitude = parseInt(magAsString, 10) + MIN_MAGNITUDE; /* istanbul ignore next */ if (neg) { magnitude = -magnitude; } i += MAGNITUDE_DIGITS; while (true) { var ch = str[i]; if (ch === '\u0000') { break; } else { numAsString += ch; } i++; } numAsString = numAsString.split('.'); if (numAsString.length === 1) { num = parseInt(numAsString, 10); } else { /* istanbul ignore next */ num = parseFloat(numAsString[0] + '.' + numAsString[1]); } /* istanbul ignore next */ if (neg) { num = num - 10; } /* istanbul ignore next */ if (magnitude !== 0) { // parseFloat is more reliable than pow due to rounding errors // e.g. Number.MAX_VALUE would return Infinity if we did // num * Math.pow(10, magnitude); num = parseFloat(num + 'e' + magnitude); } } return {num: num, length : i - originalIdx}; } // move up the stack while parsing // this function moved outside of parseIndexableString for performance function pop(stack, metaStack) { var obj = stack.pop(); if (metaStack.length) { var lastMetaElement = metaStack[metaStack.length - 1]; if (obj === lastMetaElement.element) { // popping a meta-element, e.g. an object whose value is another object metaStack.pop(); lastMetaElement = metaStack[metaStack.length - 1]; } var element = lastMetaElement.element; var lastElementIndex = lastMetaElement.index; if (Array.isArray(element)) { element.push(obj); } else if (lastElementIndex === stack.length - 2) { // obj with key+value var key = stack.pop(); element[key] = obj; } else { stack.push(obj); // obj with key only } } } function parseIndexableString(str) { var stack = []; var metaStack = []; // stack for arrays and objects var i = 0; /*eslint no-constant-condition: ["error", { "checkLoops": false }]*/ while (true) { var collationIndex = str[i++]; if (collationIndex === '\u0000') { if (stack.length === 1) { return stack.pop(); } else { pop(stack, metaStack); continue; } } switch (collationIndex) { case '1': stack.push(null); break; case '2': stack.push(str[i] === '1'); i++; break; case '3': var parsedNum = parseNumber(str, i); stack.push(parsedNum.num); i += parsedNum.length; break; case '4': var parsedStr = ''; /*eslint no-constant-condition: ["error", { "checkLoops": false }]*/ while (true) { var ch = str[i]; if (ch === '\u0000') { break; } parsedStr += ch; i++; } // perform the reverse of the order-preserving replacement // algorithm (see above) /* eslint-disable no-control-regex */ parsedStr = parsedStr.replace(/\u0001\u0001/g, '\u0000') .replace(/\u0001\u0002/g, '\u0001') .replace(/\u0002\u0002/g, '\u0002'); /* eslint-enable no-control-regex */ stack.push(parsedStr); break; case '5': var arrayElement = { element: [], index: stack.length }; stack.push(arrayElement.element); metaStack.push(arrayElement); break; case '6': var objElement = { element: {}, index: stack.length }; stack.push(objElement.element); metaStack.push(objElement); break; /* istanbul ignore next */ default: throw new Error( 'bad collationIndex or unexpectedly reached end of input: ' + collationIndex); } } } function arrayCollate(a, b) { var len = Math.min(a.length, b.length); for (var i = 0; i < len; i++) { var sort = collate(a[i], b[i]); if (sort !== 0) { return sort; } } return (a.length === b.length) ? 0 : (a.length > b.length) ? 1 : -1; } function stringCollate(a, b) { // See: https://github.com/daleharvey/pouchdb/issues/40 // This is incompatible with the CouchDB implementation, but its the // best we can do for now return (a === b) ? 0 : ((a > b) ? 1 : -1); } function objectCollate(a, b) { var ak = Object.keys(a), bk = Object.keys(b); var len = Math.min(ak.length, bk.length); for (var i = 0; i < len; i++) { // First sort the keys var sort = collate(ak[i], bk[i]); if (sort !== 0) { return sort; } // if the keys are equal sort the values sort = collate(a[ak[i]], b[bk[i]]); if (sort !== 0) { return sort; } } return (ak.length === bk.length) ? 0 : (ak.length > bk.length) ? 1 : -1; } // The collation is defined by erlangs ordered terms // the atoms null, true, false come first, then numbers, strings, // arrays, then objects // null/undefined/NaN/Infinity/-Infinity are all considered null function collationIndex(x) { var id = ['boolean', 'number', 'string', 'object']; var idx = id.indexOf(typeof x); //false if -1 otherwise true, but fast!!!!1 if (~idx) { if (x === null) { return 1; } if (Array.isArray(x)) { return 5; } return idx < 3 ? (idx + 2) : (idx + 3); } /* istanbul ignore next */ if (Array.isArray(x)) { return 5; } } // conversion: // x yyy zz...zz // x = 0 for negative, 1 for 0, 2 for positive // y = exponent (for negative numbers negated) moved so that it's >= 0 // z = mantisse function numToIndexableString(num) { if (num === 0) { return '1'; } // convert number to exponential format for easier and // more succinct string sorting var expFormat = num.toExponential().split(/e\+?/); var magnitude = parseInt(expFormat[1], 10); var neg = num < 0; var result = neg ? '0' : '2'; // first sort by magnitude // it's easier if all magnitudes are positive var magForComparison = ((neg ? -magnitude : magnitude) - MIN_MAGNITUDE); var magString = padLeft((magForComparison).toString(), '0', MAGNITUDE_DIGITS); result += SEP + magString; // then sort by the factor var factor = Math.abs(parseFloat(expFormat[0])); // [1..10) /* istanbul ignore next */ if (neg) { // for negative reverse ordering factor = 10 - factor; } var factorStr = factor.toFixed(20); // strip zeros from the end factorStr = factorStr.replace(/\.?0+$/, ''); result += SEP + factorStr; return result; } // create a comparator based on the sort object function createFieldSorter(sort) { function getFieldValuesAsArray(doc) { return sort.map(function (sorting) { var fieldName = getKey(sorting); var parsedField = parseField(fieldName); var docFieldValue = getFieldFromDoc(doc, parsedField); return docFieldValue; }); } return function (aRow, bRow) { var aFieldValues = getFieldValuesAsArray(aRow.doc); var bFieldValues = getFieldValuesAsArray(bRow.doc); var collation = collate(aFieldValues, bFieldValues); if (collation !== 0) { return collation; } // this is what mango seems to do return compare$1(aRow.doc._id, bRow.doc._id); }; } function filterInMemoryFields(rows, requestDef, inMemoryFields) { rows = rows.filter(function (row) { return rowFilter(row.doc, requestDef.selector, inMemoryFields); }); if (requestDef.sort) { // in-memory sort var fieldSorter = createFieldSorter(requestDef.sort); rows = rows.sort(fieldSorter); if (typeof requestDef.sort[0] !== 'string' && getValue(requestDef.sort[0]) === 'desc') { rows = rows.reverse(); } } if ('limit' in requestDef || 'skip' in requestDef) { // have to do the limit in-memory var skip = requestDef.skip || 0; var limit = ('limit' in requestDef ? requestDef.limit : rows.length) + skip; rows = rows.slice(skip, limit); } return rows; } function rowFilter(doc, selector, inMemoryFields) { return inMemoryFields.every(function (field) { var matcher = selector[field]; var parsedField = parseField(field); var docFieldValue = getFieldFromDoc(doc, parsedField); if (isCombinationalField(field)) { return matchCominationalSelector(field, matcher, doc); } return matchSelector(matcher, doc, parsedField, docFieldValue); }); } function matchSelector(matcher, doc, parsedField, docFieldValue) { if (!matcher) { // no filtering necessary; this field is just needed for sorting return true; } return Object.keys(matcher).every(function (userOperator) { var userValue = matcher[userOperator]; return match(userOperator, doc, userValue, parsedField, docFieldValue); }); } function matchCominationalSelector(field, matcher, doc) { if (field === '$or') { return matcher.some(function (orMatchers) { return rowFilter(doc, orMatchers, Object.keys(orMatchers)); }); } if (field === '$not') { return !rowFilter(doc, matcher, Object.keys(matcher)); } //`$nor` return !matcher.find(function (orMatchers) { return rowFilter(doc, orMatchers, Object.keys(orMatchers)); }); } function match(userOperator, doc, userValue, parsedField, docFieldValue) { if (!matchers[userOperator]) { throw new Error('unknown operator "' + userOperator + '" - should be one of $eq, $lte, $lt, $gt, $gte, $exists, $ne, $in, ' + '$nin, $size, $mod, $regex, $elemMatch, $type, $allMatch or $all'); } return matchers[userOperator](doc, userValue, parsedField, docFieldValue); } function fieldExists(docFieldValue) { return typeof docFieldValue !== 'undefined' && docFieldValue !== null; } function fieldIsNotUndefined(docFieldValue) { return typeof docFieldValue !== 'undefined'; } function modField(docFieldValue, userValue) { var divisor = userValue[0]; var mod = userValue[1]; if (divisor === 0) { throw new Error('Bad divisor, cannot divide by zero'); } if (parseInt(divisor, 10) !== divisor ) { throw new Error('Divisor is not an integer'); } if (parseInt(mod, 10) !== mod ) { throw new Error('Modulus is not an integer'); } if (parseInt(docFieldValue, 10) !== docFieldValue) { return false; } return docFieldValue % divisor === mod; } function arrayContainsValue(docFieldValue, userValue) { return userValue.some(function (val) { if (docFieldValue instanceof Array) { return docFieldValue.indexOf(val) > -1; } return docFieldValue === val; }); } function arrayContainsAllValues(docFieldValue, userValue) { return userValue.every(function (val) { return docFieldValue.indexOf(val) > -1; }); } function arraySize(docFieldValue, userValue) { return docFieldValue.length === userValue; } function regexMatch(docFieldValue, userValue) { var re = new RegExp(userValue); return re.test(docFieldValue); } function typeMatch(docFieldValue, userValue) { switch (userValue) { case 'null': return docFieldValue === null; case 'boolean': return typeof (docFieldValue) === 'boolean'; case 'number': return typeof (docFieldValue) === 'number'; case 'string': return typeof (docFieldValue) === 'string'; case 'array': return docFieldValue instanceof Array; case 'object': return ({}).toString.call(docFieldValue) === '[object Object]'; } throw new Error(userValue + ' not supported as a type.' + 'Please use one of object, string, array, number, boolean or null.'); } var matchers = { '$elemMatch': function (doc, userValue, parsedField, docFieldValue) { if (!Array.isArray(docFieldValue)) { return false; } if (docFieldValue.length === 0) { return false; } if (typeof docFieldValue[0] === 'object') { return docFieldValue.some(function (val) { return rowFilter(val, userValue, Object.keys(userValue)); }); } return docFieldValue.some(function (val) { return matchSelector(userValue, doc, parsedField, val); }); }, '$allMatch': function (doc, userValue, parsedField, docFieldValue) { if (!Array.isArray(docFieldValue)) { return false; } /* istanbul ignore next */ if (docFieldValue.length === 0) { return false; } if (typeof docFieldValue[0] === 'object') { return docFieldValue.every(function (val) { return rowFilter(val, userValue, Object.keys(userValue)); }); } return docFieldValue.every(function (val) { return matchSelector(userValue, doc, parsedField, val); }); }, '$eq': function (doc, userValue, parsedField, docFieldValue) { return fieldIsNotUndefined(docFieldValue) && collate(docFieldValue, userValue) === 0; }, '$gte': function (doc, userValue, parsedField, docFieldValue) { return fieldIsNotUndefined(docFieldValue) && collate(docFieldValue, userValue) >= 0; }, '$gt': function (doc, userValue, parsedField, docFieldValue) { return fieldIsNotUndefined(docFieldValue) && collate(docFieldValue, userValue) > 0; }, '$lte': function (doc, userValue, parsedField, docFieldValue) { return fieldIsNotUndefined(docFieldValue) && collate(docFieldValue, userValue) <= 0; }, '$lt': function (doc, userValue, parsedField, docFieldValue) { return fieldIsNotUndefined(docFieldValue) && collate(docFieldValue, userValue) < 0; }, '$exists': function (doc, userValue, parsedField, docFieldValue) { //a field that is null is still considered to exist if (userValue) { return fieldIsNotUndefined(docFieldValue); } return !fieldIsNotUndefined(docFieldValue); }, '$mod': function (doc, userValue, parsedField, docFieldValue) { return fieldExists(docFieldValue) && modField(docFieldValue, userValue); }, '$ne': function (doc, userValue, parsedField, docFieldValue) { return userValue.every(function (neValue) { return collate(docFieldValue, neValue) !== 0; }); }, '$in': function (doc, userValue, parsedField, docFieldValue) { return fieldExists(docFieldValue) && arrayContainsValue(docFieldValue, userValue); }, '$nin': function (doc, userValue, parsedField, docFieldValue) { return fieldExists(docFieldValue) && !arrayContainsValue(docFieldValue, userValue); }, '$size': function (doc, userValue, parsedField, docFieldValue) { return fieldExists(docFieldValue) && arraySize(docFieldValue, userValue); }, '$all': function (doc, userValue, parsedField, docFieldValue) { return Array.isArray(docFieldValue) && arrayContainsAllValues(docFieldValue, userValue); }, '$regex': function (doc, userValue, parsedField, docFieldValue) { return fieldExists(docFieldValue) && regexMatch(docFieldValue, userValue); }, '$type': function (doc, userValue, parsedField, docFieldValue) { return typeMatch(docFieldValue, userValue); } }; // return true if the given doc matches the supplied selector function matchesSelector(doc, selector) { /* istanbul ignore if */ if (typeof selector !== 'object') { // match the CouchDB error message throw new Error('Selector error: expected a JSON object'); } selector = massageSelector(selector); var row = { 'doc': doc }; var rowsMatched = filterInMemoryFields([row], { 'selector': selector }, Object.keys(selector)); return rowsMatched && rowsMatched.length === 1; } function evalFilter(input) { return scopeEval('"use strict";\nreturn ' + input + ';', {}); } function evalView(input) { var code = [ 'return function(doc) {', ' "use strict";', ' var emitted = false;', ' var emit = function (a, b) {', ' emitted = true;', ' };', ' var view = ' + input + ';', ' view(doc);', ' if (emitted) {', ' return true;', ' }', '};' ].join('\n'); return scopeEval(code, {}); } function validate(opts, callback) { if (opts.selector) { if (opts.filter && opts.filter !== '_selector') { var filterName = typeof opts.filter === 'string' ? opts.filter : 'function'; return callback(new Error('selector invalid for filter "' + filterName + '"')); } } callback(); } function normalize(opts) { if (opts.view && !opts.filter) { opts.filter = '_view'; } if (opts.selector && !opts.filter) { opts.filter = '_selector'; } if (opts.filter && typeof opts.filter === 'string') { if (opts.filter === '_view') { opts.view = normalizeDesignDocFunctionName(opts.view); } else { opts.filter = normalizeDesignDocFunctionName(opts.filter); } } } function shouldFilter(changesHandler, opts) { return opts.filter && typeof opts.filter === 'string' && !opts.doc_ids && !isRemote(changesHandler.db); } function filter(changesHandler, opts) { var callback = opts.complete; if (opts.filter === '_view') { if (!opts.view || typeof opts.view !== 'string') { var err = createError(BAD_REQUEST, '`view` filter parameter not found or invalid.'); return callback(err); } // fetch a view from a design doc, make it behave like a filter var viewName = parseDesignDocFunctionName(opts.view); changesHandler.db.get('_design/' + viewName[0], function (err, ddoc) { /* istanbul ignore if */ if (changesHandler.isCancelled) { return callback(null, {status: 'cancelled'}); } /* istanbul ignore next */ if (err) { return callback(generateErrorFromResponse(err)); } var mapFun = ddoc && ddoc.views && ddoc.views[viewName[1]] && ddoc.views[viewName[1]].map; if (!mapFun) { return callback(createError(MISSING_DOC, (ddoc.views ? 'missing json key: ' + viewName[1] : 'missing json key: views'))); } opts.filter = evalView(mapFun); changesHandler.doChanges(opts); }); } else if (opts.selector) { opts.filter = function (doc) { return matchesSelector(doc, opts.selector); }; changesHandler.doChanges(opts); } else { // fetch a filter from a design doc var filterName = parseDesignDocFunctionName(opts.filter); changesHandler.db.get('_design/' + filterName[0], function (err, ddoc) { /* istanbul ignore if */ if (changesHandler.isCancelled) { return callback(null, {status: 'cancelled'}); } /* istanbul ignore next */ if (err) { return callback(generateErrorFromResponse(err)); } var filterFun = ddoc && ddoc.filters && ddoc.filters[filterName[1]]; if (!filterFun) { return callback(createError(MISSING_DOC, ((ddoc && ddoc.filters) ? 'missing json key: ' + filterName[1] : 'missing json key: filters'))); } opts.filter = evalFilter(filterFun); changesHandler.doChanges(opts); }); } } function applyChangesFilterPlugin(PouchDB) { PouchDB._changesFilterPlugin = { validate: validate, normalize: normalize, shouldFilter: shouldFilter, filter: filter }; } // TODO: remove from pouchdb-core (breaking) PouchDB.plugin(applyChangesFilterPlugin); PouchDB.version = version; function toObject(array) { return array.reduce(function (obj, item) { obj[item] = true; return obj; }, {}); } // List of top level reserved words for doc var reservedWords = toObject([ '_id', '_rev', '_attachments', '_deleted', '_revisions', '_revs_info', '_conflicts', '_deleted_conflicts', '_local_seq', '_rev_tree', //replication documents '_replication_id', '_replication_state', '_replication_state_time', '_replication_state_reason', '_replication_stats', // Specific to Couchbase Sync Gateway '_removed' ]); // List of reserved words that should end up the document var dataWords = toObject([ '_attachments', //replication documents '_replication_id', '_replication_state', '_replication_state_time', '_replication_state_reason', '_replication_stats' ]); function parseRevisionInfo(rev) { if (!/^\d+-./.test(rev)) { return createError(INVALID_REV); } var idx = rev.indexOf('-'); var left = rev.substring(0, idx); var right = rev.substring(idx + 1); return { prefix: parseInt(left, 10), id: right }; } function makeRevTreeFromRevisions(revisions, opts) { var pos = revisions.start - revisions.ids.length + 1; var revisionIds = revisions.ids; var ids = [revisionIds[0], opts, []]; for (var i = 1, len = revisionIds.length; i < len; i++) { ids = [revisionIds[i], {status: 'missing'}, [ids]]; } return [{ pos: pos, ids: ids }]; } // Preprocess documents, parse their revisions, assign an id and a // revision for new writes that are missing them, etc function parseDoc(doc, newEdits, dbOpts) { if (!dbOpts) { dbOpts = { deterministic_revs: true }; } var nRevNum; var newRevId; var revInfo; var opts = {status: 'available'}; if (doc._deleted) { opts.deleted = true; } if (newEdits) { if (!doc._id) { doc._id = uuid(); } newRevId = rev$$1(doc, dbOpts.deterministic_revs); if (doc._rev) { revInfo = parseRevisionInfo(doc._rev); if (revInfo.error) { return revInfo; } doc._rev_tree = [{ pos: revInfo.prefix, ids: [revInfo.id, {status: 'missing'}, [[newRevId, opts, []]]] }]; nRevNum = revInfo.prefix + 1; } else { doc._rev_tree = [{ pos: 1, ids : [newRevId, opts, []] }]; nRevNum = 1; } } else { if (doc._revisions) { doc._rev_tree = makeRevTreeFromRevisions(doc._revisions, opts); nRevNum = doc._revisions.start; newRevId = doc._revisions.ids[0]; } if (!doc._rev_tree) { revInfo = parseRevisionInfo(doc._rev); if (revInfo.error) { return revInfo; } nRevNum = revInfo.prefix; newRevId = revInfo.id; doc._rev_tree = [{ pos: nRevNum, ids: [newRevId, opts, []] }]; } } invalidIdError(doc._id); doc._rev = nRevNum + '-' + newRevId; var result = {metadata : {}, data : {}}; for (var key in doc) { /* istanbul ignore else */ if (Object.prototype.hasOwnProperty.call(doc, key)) { var specialKey = key[0] === '_'; if (specialKey && !reservedWords[key]) { var error = createError(DOC_VALIDATION, key); error.message = DOC_VALIDATION.message + ': ' + key; throw error; } else if (specialKey && !dataWords[key]) { result.metadata[key.slice(1)] = doc[key]; } else { result.data[key] = doc[key]; } } } return result; } function parseBase64(data) { try { return thisAtob(data); } catch (e) { var err = createError(BAD_ARG, 'Attachment is not a valid base64 string'); return {error: err}; } } function preprocessString(att, blobType, callback) { var asBinary = parseBase64(att.data); if (asBinary.error) { return callback(asBinary.error); } att.length = asBinary.length; if (blobType === 'blob') { att.data = binStringToBluffer(asBinary, att.content_type); } else if (blobType === 'base64') { att.data = thisBtoa(asBinary); } else { // binary att.data = asBinary; } binaryMd5(asBinary, function (result) { att.digest = 'md5-' + result; callback(); }); } function preprocessBlob(att, blobType, callback) { binaryMd5(att.data, function (md5) { att.digest = 'md5-' + md5; // size is for blobs (browser), length is for buffers (node) att.length = att.data.size || att.data.length || 0; if (blobType === 'binary') { blobToBinaryString(att.data, function (binString) { att.data = binString; callback(); }); } else if (blobType === 'base64') { blobToBase64(att.data, function (b64) { att.data = b64; callback(); }); } else { callback(); } }); } function preprocessAttachment(att, blobType, callback) { if (att.stub) { return callback(); } if (typeof att.data === 'string') { // input is a base64 string preprocessString(att, blobType, callback); } else { // input is a blob preprocessBlob(att, blobType, callback); } } function preprocessAttachments(docInfos, blobType, callback) { if (!docInfos.length) { return callback(); } var docv = 0; var overallErr; docInfos.forEach(function (docInfo) { var attachments = docInfo.data && docInfo.data._attachments ? Object.keys(docInfo.data._attachments) : []; var recv = 0; if (!attachments.length) { return done(); } function processedAttachment(err) { overallErr = err; recv++; if (recv === attachments.length) { done(); } } for (var key in docInfo.data._attachments) { if (docInfo.data._attachments.hasOwnProperty(key)) { preprocessAttachment(docInfo.data._attachments[key], blobType, processedAttachment); } } }); function done() { docv++; if (docInfos.length === docv) { if (overallErr) { callback(overallErr); } else { callback(); } } } } function updateDoc(revLimit, prev, docInfo, results, i, cb, writeDoc, newEdits) { if (revExists(prev.rev_tree, docInfo.metadata.rev) && !newEdits) { results[i] = docInfo; return cb(); } // sometimes this is pre-calculated. historically not always var previousWinningRev = prev.winningRev || winningRev(prev); var previouslyDeleted = 'deleted' in prev ? prev.deleted : isDeleted(prev, previousWinningRev); var deleted = 'deleted' in docInfo.metadata ? docInfo.metadata.deleted : isDeleted(docInfo.metadata); var isRoot = /^1-/.test(docInfo.metadata.rev); if (previouslyDeleted && !deleted && newEdits && isRoot) { var newDoc = docInfo.data; newDoc._rev = previousWinningRev; newDoc._id = docInfo.metadata.id; docInfo = parseDoc(newDoc, newEdits); } var merged = merge(prev.rev_tree, docInfo.metadata.rev_tree[0], revLimit); var inConflict = newEdits && (( (previouslyDeleted && deleted && merged.conflicts !== 'new_leaf') || (!previouslyDeleted && merged.conflicts !== 'new_leaf') || (previouslyDeleted && !deleted && merged.conflicts === 'new_branch'))); if (inConflict) { var err = createError(REV_CONFLICT); results[i] = err; return cb(); } var newRev = docInfo.metadata.rev; docInfo.metadata.rev_tree = merged.tree; docInfo.stemmedRevs = merged.stemmedRevs || []; /* istanbul ignore else */ if (prev.rev_map) { docInfo.metadata.rev_map = prev.rev_map; // used only by leveldb } // recalculate var winningRev$$1 = winningRev(docInfo.metadata); var winningRevIsDeleted = isDeleted(docInfo.metadata, winningRev$$1); // calculate the total number of documents that were added/removed, // from the perspective of total_rows/doc_count var delta = (previouslyDeleted === winningRevIsDeleted) ? 0 : previouslyDeleted < winningRevIsDeleted ? -1 : 1; var newRevIsDeleted; if (newRev === winningRev$$1) { // if the new rev is the same as the winning rev, we can reuse that value newRevIsDeleted = winningRevIsDeleted; } else { // if they're not the same, then we need to recalculate newRevIsDeleted = isDeleted(docInfo.metadata, newRev); } writeDoc(docInfo, winningRev$$1, winningRevIsDeleted, newRevIsDeleted, true, delta, i, cb); } function rootIsMissing(docInfo) { return docInfo.metadata.rev_tree[0].ids[1].status === 'missing'; } function processDocs(revLimit, docInfos, api, fetchedDocs, tx, results, writeDoc, opts, overallCallback) { // Default to 1000 locally revLimit = revLimit || 1000; function insertDoc(docInfo, resultsIdx, callback) { // Cant insert new deleted documents var winningRev$$1 = winningRev(docInfo.metadata); var deleted = isDeleted(docInfo.metadata, winningRev$$1); if ('was_delete' in opts && deleted) { results[resultsIdx] = createError(MISSING_DOC, 'deleted'); return callback(); } // 4712 - detect whether a new document was inserted with a _rev var inConflict = newEdits && rootIsMissing(docInfo); if (inConflict) { var err = createError(REV_CONFLICT); results[resultsIdx] = err; return callback(); } var delta = deleted ? 0 : 1; writeDoc(docInfo, winningRev$$1, deleted, deleted, false, delta, resultsIdx, callback); } var newEdits = opts.new_edits; var idsToDocs = new ExportedMap(); var docsDone = 0; var docsToDo = docInfos.length; function checkAllDocsDone() { if (++docsDone === docsToDo && overallCallback) { overallCallback(); } } docInfos.forEach(function (currentDoc, resultsIdx) { if (currentDoc._id && isLocalId(currentDoc._id)) { var fun = currentDoc._deleted ? '_removeLocal' : '_putLocal'; api[fun](currentDoc, {ctx: tx}, function (err, res) { results[resultsIdx] = err || res; checkAllDocsDone(); }); return; } var id = currentDoc.metadata.id; if (idsToDocs.has(id)) { docsToDo--; // duplicate idsToDocs.get(id).push([currentDoc, resultsIdx]); } else { idsToDocs.set(id, [[currentDoc, resultsIdx]]); } }); // in the case of new_edits, the user can provide multiple docs // with the same id. these need to be processed sequentially idsToDocs.forEach(function (docs, id) { var numDone = 0; function docWritten() { if (++numDone < docs.length) { nextDoc(); } else { checkAllDocsDone(); } } function nextDoc() { var value = docs[numDone]; var currentDoc = value[0]; var resultsIdx = value[1]; if (fetchedDocs.has(id)) { updateDoc(revLimit, fetchedDocs.get(id), currentDoc, results, resultsIdx, docWritten, writeDoc, newEdits); } else { // Ensure stemming applies to new writes as well var merged = merge([], currentDoc.metadata.rev_tree[0], revLimit); currentDoc.metadata.rev_tree = merged.tree; currentDoc.stemmedRevs = merged.stemmedRevs || []; insertDoc(currentDoc, resultsIdx, docWritten); } } nextDoc(); }); } // IndexedDB requires a versioned database structure, so we use the // version here to manage migrations. var ADAPTER_VERSION = 5; // The object stores created for each database // DOC_STORE stores the document meta data, its revision history and state // Keyed by document id var DOC_STORE = 'document-store'; // BY_SEQ_STORE stores a particular version of a document, keyed by its // sequence id var BY_SEQ_STORE = 'by-sequence'; // Where we store attachments var ATTACH_STORE = 'attach-store'; // Where we store many-to-many relations // between attachment digests and seqs var ATTACH_AND_SEQ_STORE = 'attach-seq-store'; // Where we store database-wide meta data in a single record // keyed by id: META_STORE var META_STORE = 'meta-store'; // Where we store local documents var LOCAL_STORE = 'local-store'; // Where we detect blob support var DETECT_BLOB_SUPPORT_STORE = 'detect-blob-support'; function safeJsonParse(str) { // This try/catch guards against stack overflow errors. // JSON.parse() is faster than vuvuzela.parse() but vuvuzela // cannot overflow. try { return JSON.parse(str); } catch (e) { /* istanbul ignore next */ return vuvuzela__WEBPACK_IMPORTED_MODULE_6___default.a.parse(str); } } function safeJsonStringify(json) { try { return JSON.stringify(json); } catch (e) { /* istanbul ignore next */ return vuvuzela__WEBPACK_IMPORTED_MODULE_6___default.a.stringify(json); } } function idbError(callback) { return function (evt) { var message = 'unknown_error'; if (evt.target && evt.target.error) { message = evt.target.error.name || evt.target.error.message; } callback(createError(IDB_ERROR, message, evt.type)); }; } // Unfortunately, the metadata has to be stringified // when it is put into the database, because otherwise // IndexedDB can throw errors for deeply-nested objects. // Originally we just used JSON.parse/JSON.stringify; now // we use this custom vuvuzela library that avoids recursion. // If we could do it all over again, we'd probably use a // format for the revision trees other than JSON. function encodeMetadata(metadata, winningRev, deleted) { return { data: safeJsonStringify(metadata), winningRev: winningRev, deletedOrLocal: deleted ? '1' : '0', seq: metadata.seq, // highest seq for this doc id: metadata.id }; } function decodeMetadata(storedObject) { if (!storedObject) { return null; } var metadata = safeJsonParse(storedObject.data); metadata.winningRev = storedObject.winningRev; metadata.deleted = storedObject.deletedOrLocal === '1'; metadata.seq = storedObject.seq; return metadata; } // read the doc back out from the database. we don't store the // _id or _rev because we already have _doc_id_rev. function decodeDoc(doc) { if (!doc) { return doc; } var idx = doc._doc_id_rev.lastIndexOf(':'); doc._id = doc._doc_id_rev.substring(0, idx - 1); doc._rev = doc._doc_id_rev.substring(idx + 1); delete doc._doc_id_rev; return doc; } // Read a blob from the database, encoding as necessary // and translating from base64 if the IDB doesn't support // native Blobs function readBlobData(body, type, asBlob, callback) { if (asBlob) { if (!body) { callback(createBlob([''], {type: type})); } else if (typeof body !== 'string') { // we have blob support callback(body); } else { // no blob support callback(b64ToBluffer(body, type)); } } else { // as base64 string if (!body) { callback(''); } else if (typeof body !== 'string') { // we have blob support readAsBinaryString(body, function (binary) { callback(thisBtoa(binary)); }); } else { // no blob support callback(body); } } } function fetchAttachmentsIfNecessary(doc, opts, txn, cb) { var attachments = Object.keys(doc._attachments || {}); if (!attachments.length) { return cb && cb(); } var numDone = 0; function checkDone() { if (++numDone === attachments.length && cb) { cb(); } } function fetchAttachment(doc, att) { var attObj = doc._attachments[att]; var digest = attObj.digest; var req = txn.objectStore(ATTACH_STORE).get(digest); req.onsuccess = function (e) { attObj.body = e.target.result.body; checkDone(); }; } attachments.forEach(function (att) { if (opts.attachments && opts.include_docs) { fetchAttachment(doc, att); } else { doc._attachments[att].stub = true; checkDone(); } }); } // IDB-specific postprocessing necessary because // we don't know whether we stored a true Blob or // a base64-encoded string, and if it's a Blob it // needs to be read outside of the transaction context function postProcessAttachments(results, asBlob) { return Promise.all(results.map(function (row) { if (row.doc && row.doc._attachments) { var attNames = Object.keys(row.doc._attachments); return Promise.all(attNames.map(function (att) { var attObj = row.doc._attachments[att]; if (!('body' in attObj)) { // already processed return; } var body = attObj.body; var type = attObj.content_type; return new Promise(function (resolve) { readBlobData(body, type, asBlob, function (data) { row.doc._attachments[att] = $inject_Object_assign( pick(attObj, ['digest', 'content_type']), {data: data} ); resolve(); }); }); })); } })); } function compactRevs(revs, docId, txn) { var possiblyOrphanedDigests = []; var seqStore = txn.objectStore(BY_SEQ_STORE); var attStore = txn.objectStore(ATTACH_STORE); var attAndSeqStore = txn.objectStore(ATTACH_AND_SEQ_STORE); var count = revs.length; function checkDone() { count--; if (!count) { // done processing all revs deleteOrphanedAttachments(); } } function deleteOrphanedAttachments() { if (!possiblyOrphanedDigests.length) { return; } possiblyOrphanedDigests.forEach(function (digest) { var countReq = attAndSeqStore.index('digestSeq').count( IDBKeyRange.bound( digest + '::', digest + '::\uffff', false, false)); countReq.onsuccess = function (e) { var count = e.target.result; if (!count) { // orphaned attStore.delete(digest); } }; }); } revs.forEach(function (rev) { var index = seqStore.index('_doc_id_rev'); var key = docId + "::" + rev; index.getKey(key).onsuccess = function (e) { var seq = e.target.result; if (typeof seq !== 'number') { return checkDone(); } seqStore.delete(seq); var cursor = attAndSeqStore.index('seq') .openCursor(IDBKeyRange.only(seq)); cursor.onsuccess = function (event) { var cursor = event.target.result; if (cursor) { var digest = cursor.value.digestSeq.split('::')[0]; possiblyOrphanedDigests.push(digest); attAndSeqStore.delete(cursor.primaryKey); cursor.continue(); } else { // done checkDone(); } }; }; }); } function openTransactionSafely(idb, stores, mode) { try { return { txn: idb.transaction(stores, mode) }; } catch (err) { return { error: err }; } } var changesHandler = new Changes(); function idbBulkDocs(dbOpts, req, opts, api, idb, callback) { var docInfos = req.docs; var txn; var docStore; var bySeqStore; var attachStore; var attachAndSeqStore; var metaStore; var docInfoError; var metaDoc; for (var i = 0, len = docInfos.length; i < len; i++) { var doc = docInfos[i]; if (doc._id && isLocalId(doc._id)) { continue; } doc = docInfos[i] = parseDoc(doc, opts.new_edits, dbOpts); if (doc.error && !docInfoError) { docInfoError = doc; } } if (docInfoError) { return callback(docInfoError); } var allDocsProcessed = false; var docCountDelta = 0; var results = new Array(docInfos.length); var fetchedDocs = new ExportedMap(); var preconditionErrored = false; var blobType = api._meta.blobSupport ? 'blob' : 'base64'; preprocessAttachments(docInfos, blobType, function (err) { if (err) { return callback(err); } startTransaction(); }); function startTransaction() { var stores = [ DOC_STORE, BY_SEQ_STORE, ATTACH_STORE, LOCAL_STORE, ATTACH_AND_SEQ_STORE, META_STORE ]; var txnResult = openTransactionSafely(idb, stores, 'readwrite'); if (txnResult.error) { return callback(txnResult.error); } txn = txnResult.txn; txn.onabort = idbError(callback); txn.ontimeout = idbError(callback); txn.oncomplete = complete; docStore = txn.objectStore(DOC_STORE); bySeqStore = txn.objectStore(BY_SEQ_STORE); attachStore = txn.objectStore(ATTACH_STORE); attachAndSeqStore = txn.objectStore(ATTACH_AND_SEQ_STORE); metaStore = txn.objectStore(META_STORE); metaStore.get(META_STORE).onsuccess = function (e) { metaDoc = e.target.result; updateDocCountIfReady(); }; verifyAttachments(function (err) { if (err) { preconditionErrored = true; return callback(err); } fetchExistingDocs(); }); } function onAllDocsProcessed() { allDocsProcessed = true; updateDocCountIfReady(); } function idbProcessDocs() { processDocs(dbOpts.revs_limit, docInfos, api, fetchedDocs, txn, results, writeDoc, opts, onAllDocsProcessed); } function updateDocCountIfReady() { if (!metaDoc || !allDocsProcessed) { return; } // caching the docCount saves a lot of time in allDocs() and // info(), which is why we go to all the trouble of doing this metaDoc.docCount += docCountDelta; metaStore.put(metaDoc); } function fetchExistingDocs() { if (!docInfos.length) { return; } var numFetched = 0; function checkDone() { if (++numFetched === docInfos.length) { idbProcessDocs(); } } function readMetadata(event) { var metadata = decodeMetadata(event.target.result); if (metadata) { fetchedDocs.set(metadata.id, metadata); } checkDone(); } for (var i = 0, len = docInfos.length; i < len; i++) { var docInfo = docInfos[i]; if (docInfo._id && isLocalId(docInfo._id)) { checkDone(); // skip local docs continue; } var req = docStore.get(docInfo.metadata.id); req.onsuccess = readMetadata; } } function complete() { if (preconditionErrored) { return; } changesHandler.notify(api._meta.name); callback(null, results); } function verifyAttachment(digest, callback) { var req = attachStore.get(digest); req.onsuccess = function (e) { if (!e.target.result) { var err = createError(MISSING_STUB, 'unknown stub attachment with digest ' + digest); err.status = 412; callback(err); } else { callback(); } }; } function verifyAttachments(finish) { var digests = []; docInfos.forEach(function (docInfo) { if (docInfo.data && docInfo.data._attachments) { Object.keys(docInfo.data._attachments).forEach(function (filename) { var att = docInfo.data._attachments[filename]; if (att.stub) { digests.push(att.digest); } }); } }); if (!digests.length) { return finish(); } var numDone = 0; var err; function checkDone() { if (++numDone === digests.length) { finish(err); } } digests.forEach(function (digest) { verifyAttachment(digest, function (attErr) { if (attErr && !err) { err = attErr; } checkDone(); }); }); } function writeDoc(docInfo, winningRev$$1, winningRevIsDeleted, newRevIsDeleted, isUpdate, delta, resultsIdx, callback) { docInfo.metadata.winningRev = winningRev$$1; docInfo.metadata.deleted = winningRevIsDeleted; var doc = docInfo.data; doc._id = docInfo.metadata.id; doc._rev = docInfo.metadata.rev; if (newRevIsDeleted) { doc._deleted = true; } var hasAttachments = doc._attachments && Object.keys(doc._attachments).length; if (hasAttachments) { return writeAttachments(docInfo, winningRev$$1, winningRevIsDeleted, isUpdate, resultsIdx, callback); } docCountDelta += delta; updateDocCountIfReady(); finishDoc(docInfo, winningRev$$1, winningRevIsDeleted, isUpdate, resultsIdx, callback); } function finishDoc(docInfo, winningRev$$1, winningRevIsDeleted, isUpdate, resultsIdx, callback) { var doc = docInfo.data; var metadata = docInfo.metadata; doc._doc_id_rev = metadata.id + '::' + metadata.rev; delete doc._id; delete doc._rev; function afterPutDoc(e) { var revsToDelete = docInfo.stemmedRevs || []; if (isUpdate && api.auto_compaction) { revsToDelete = revsToDelete.concat(compactTree(docInfo.metadata)); } if (revsToDelete && revsToDelete.length) { compactRevs(revsToDelete, docInfo.metadata.id, txn); } metadata.seq = e.target.result; // Current _rev is calculated from _rev_tree on read // delete metadata.rev; var metadataToStore = encodeMetadata(metadata, winningRev$$1, winningRevIsDeleted); var metaDataReq = docStore.put(metadataToStore); metaDataReq.onsuccess = afterPutMetadata; } function afterPutDocError(e) { // ConstraintError, need to update, not put (see #1638 for details) e.preventDefault(); // avoid transaction abort e.stopPropagation(); // avoid transaction onerror var index = bySeqStore.index('_doc_id_rev'); var getKeyReq = index.getKey(doc._doc_id_rev); getKeyReq.onsuccess = function (e) { var putReq = bySeqStore.put(doc, e.target.result); putReq.onsuccess = afterPutDoc; }; } function afterPutMetadata() { results[resultsIdx] = { ok: true, id: metadata.id, rev: metadata.rev }; fetchedDocs.set(docInfo.metadata.id, docInfo.metadata); insertAttachmentMappings(docInfo, metadata.seq, callback); } var putReq = bySeqStore.put(doc); putReq.onsuccess = afterPutDoc; putReq.onerror = afterPutDocError; } function writeAttachments(docInfo, winningRev$$1, winningRevIsDeleted, isUpdate, resultsIdx, callback) { var doc = docInfo.data; var numDone = 0; var attachments = Object.keys(doc._attachments); function collectResults() { if (numDone === attachments.length) { finishDoc(docInfo, winningRev$$1, winningRevIsDeleted, isUpdate, resultsIdx, callback); } } function attachmentSaved() { numDone++; collectResults(); } attachments.forEach(function (key) { var att = docInfo.data._attachments[key]; if (!att.stub) { var data = att.data; delete att.data; att.revpos = parseInt(winningRev$$1, 10); var digest = att.digest; saveAttachment(digest, data, attachmentSaved); } else { numDone++; collectResults(); } }); } // map seqs to attachment digests, which // we will need later during compaction function insertAttachmentMappings(docInfo, seq, callback) { var attsAdded = 0; var attsToAdd = Object.keys(docInfo.data._attachments || {}); if (!attsToAdd.length) { return callback(); } function checkDone() { if (++attsAdded === attsToAdd.length) { callback(); } } function add(att) { var digest = docInfo.data._attachments[att].digest; var req = attachAndSeqStore.put({ seq: seq, digestSeq: digest + '::' + seq }); req.onsuccess = checkDone; req.onerror = function (e) { // this callback is for a constaint error, which we ignore // because this docid/rev has already been associated with // the digest (e.g. when new_edits == false) e.preventDefault(); // avoid transaction abort e.stopPropagation(); // avoid transaction onerror checkDone(); }; } for (var i = 0; i < attsToAdd.length; i++) { add(attsToAdd[i]); // do in parallel } } function saveAttachment(digest, data, callback) { var getKeyReq = attachStore.count(digest); getKeyReq.onsuccess = function (e) { var count = e.target.result; if (count) { return callback(); // already exists } var newAtt = { digest: digest, body: data }; var putReq = attachStore.put(newAtt); putReq.onsuccess = callback; }; } } // Abstraction over IDBCursor and getAll()/getAllKeys() that allows us to batch our operations // while falling back to a normal IDBCursor operation on browsers that don't support getAll() or // getAllKeys(). This allows for a much faster implementation than just straight-up cursors, because // we're not processing each document one-at-a-time. function runBatchedCursor(objectStore, keyRange, descending, batchSize, onBatch) { if (batchSize === -1) { batchSize = 1000; } // Bail out of getAll()/getAllKeys() in the following cases: // 1) either method is unsupported - we need both // 2) batchSize is 1 (might as well use IDBCursor) // 3) descending – no real way to do this via getAll()/getAllKeys() var useGetAll = typeof objectStore.getAll === 'function' && typeof objectStore.getAllKeys === 'function' && batchSize > 1 && !descending; var keysBatch; var valuesBatch; var pseudoCursor; function onGetAll(e) { valuesBatch = e.target.result; if (keysBatch) { onBatch(keysBatch, valuesBatch, pseudoCursor); } } function onGetAllKeys(e) { keysBatch = e.target.result; if (valuesBatch) { onBatch(keysBatch, valuesBatch, pseudoCursor); } } function continuePseudoCursor() { if (!keysBatch.length) { // no more results return onBatch(); } // fetch next batch, exclusive start var lastKey = keysBatch[keysBatch.length - 1]; var newKeyRange; if (keyRange && keyRange.upper) { try { newKeyRange = IDBKeyRange.bound(lastKey, keyRange.upper, true, keyRange.upperOpen); } catch (e) { if (e.name === "DataError" && e.code === 0) { return onBatch(); // we're done, startkey and endkey are equal } } } else { newKeyRange = IDBKeyRange.lowerBound(lastKey, true); } keyRange = newKeyRange; keysBatch = null; valuesBatch = null; objectStore.getAll(keyRange, batchSize).onsuccess = onGetAll; objectStore.getAllKeys(keyRange, batchSize).onsuccess = onGetAllKeys; } function onCursor(e) { var cursor = e.target.result; if (!cursor) { // done return onBatch(); } // regular IDBCursor acts like a batch where batch size is always 1 onBatch([cursor.key], [cursor.value], cursor); } if (useGetAll) { pseudoCursor = {"continue": continuePseudoCursor}; objectStore.getAll(keyRange, batchSize).onsuccess = onGetAll; objectStore.getAllKeys(keyRange, batchSize).onsuccess = onGetAllKeys; } else if (descending) { objectStore.openCursor(keyRange, 'prev').onsuccess = onCursor; } else { objectStore.openCursor(keyRange).onsuccess = onCursor; } } // simple shim for objectStore.getAll(), falling back to IDBCursor function getAll(objectStore, keyRange, onSuccess) { if (typeof objectStore.getAll === 'function') { // use native getAll objectStore.getAll(keyRange).onsuccess = onSuccess; return; } // fall back to cursors var values = []; function onCursor(e) { var cursor = e.target.result; if (cursor) { values.push(cursor.value); cursor.continue(); } else { onSuccess({ target: { result: values } }); } } objectStore.openCursor(keyRange).onsuccess = onCursor; } function allDocsKeys(keys, docStore, onBatch) { // It's not guaranted to be returned in right order var valuesBatch = new Array(keys.length); var count = 0; keys.forEach(function (key, index) { docStore.get(key).onsuccess = function (event) { if (event.target.result) { valuesBatch[index] = event.target.result; } else { valuesBatch[index] = {key: key, error: 'not_found'}; } count++; if (count === keys.length) { onBatch(keys, valuesBatch, {}); } }; }); } function createKeyRange(start, end, inclusiveEnd, key, descending) { try { if (start && end) { if (descending) { return IDBKeyRange.bound(end, start, !inclusiveEnd, false); } else { return IDBKeyRange.bound(start, end, false, !inclusiveEnd); } } else if (start) { if (descending) { return IDBKeyRange.upperBound(start); } else { return IDBKeyRange.lowerBound(start); } } else if (end) { if (descending) { return IDBKeyRange.lowerBound(end, !inclusiveEnd); } else { return IDBKeyRange.upperBound(end, !inclusiveEnd); } } else if (key) { return IDBKeyRange.only(key); } } catch (e) { return {error: e}; } return null; } function idbAllDocs(opts, idb, callback) { var start = 'startkey' in opts ? opts.startkey : false; var end = 'endkey' in opts ? opts.endkey : false; var key = 'key' in opts ? opts.key : false; var keys = 'keys' in opts ? opts.keys : false; var skip = opts.skip || 0; var limit = typeof opts.limit === 'number' ? opts.limit : -1; var inclusiveEnd = opts.inclusive_end !== false; var keyRange ; var keyRangeError; if (!keys) { keyRange = createKeyRange(start, end, inclusiveEnd, key, opts.descending); keyRangeError = keyRange && keyRange.error; if (keyRangeError && !(keyRangeError.name === "DataError" && keyRangeError.code === 0)) { // DataError with error code 0 indicates start is less than end, so // can just do an empty query. Else need to throw return callback(createError(IDB_ERROR, keyRangeError.name, keyRangeError.message)); } } var stores = [DOC_STORE, BY_SEQ_STORE, META_STORE]; if (opts.attachments) { stores.push(ATTACH_STORE); } var txnResult = openTransactionSafely(idb, stores, 'readonly'); if (txnResult.error) { return callback(txnResult.error); } var txn = txnResult.txn; txn.oncomplete = onTxnComplete; txn.onabort = idbError(callback); var docStore = txn.objectStore(DOC_STORE); var seqStore = txn.objectStore(BY_SEQ_STORE); var metaStore = txn.objectStore(META_STORE); var docIdRevIndex = seqStore.index('_doc_id_rev'); var results = []; var docCount; var updateSeq; metaStore.get(META_STORE).onsuccess = function (e) { docCount = e.target.result.docCount; }; /* istanbul ignore if */ if (opts.update_seq) { getMaxUpdateSeq(seqStore, function (e) { if (e.target.result && e.target.result.length > 0) { updateSeq = e.target.result[0]; } }); } function getMaxUpdateSeq(objectStore, onSuccess) { function onCursor(e) { var cursor = e.target.result; var maxKey = undefined; if (cursor && cursor.key) { maxKey = cursor.key; } return onSuccess({ target: { result: [maxKey] } }); } objectStore.openCursor(null, 'prev').onsuccess = onCursor; } // if the user specifies include_docs=true, then we don't // want to block the main cursor while we're fetching the doc function fetchDocAsynchronously(metadata, row, winningRev$$1) { var key = metadata.id + "::" + winningRev$$1; docIdRevIndex.get(key).onsuccess = function onGetDoc(e) { row.doc = decodeDoc(e.target.result) || {}; if (opts.conflicts) { var conflicts = collectConflicts(metadata); if (conflicts.length) { row.doc._conflicts = conflicts; } } fetchAttachmentsIfNecessary(row.doc, opts, txn); }; } function allDocsInner(winningRev$$1, metadata) { var row = { id: metadata.id, key: metadata.id, value: { rev: winningRev$$1 } }; var deleted = metadata.deleted; if (deleted) { if (keys) { results.push(row); // deleted docs are okay with "keys" requests row.value.deleted = true; row.doc = null; } } else if (skip-- <= 0) { results.push(row); if (opts.include_docs) { fetchDocAsynchronously(metadata, row, winningRev$$1); } } } function processBatch(batchValues) { for (var i = 0, len = batchValues.length; i < len; i++) { if (results.length === limit) { break; } var batchValue = batchValues[i]; if (batchValue.error && keys) { // key was not found with "keys" requests results.push(batchValue); continue; } var metadata = decodeMetadata(batchValue); var winningRev$$1 = metadata.winningRev; allDocsInner(winningRev$$1, metadata); } } function onBatch(batchKeys, batchValues, cursor) { if (!cursor) { return; } processBatch(batchValues); if (results.length < limit) { cursor.continue(); } } function onGetAll(e) { var values = e.target.result; if (opts.descending) { values = values.reverse(); } processBatch(values); } function onResultsReady() { var returnVal = { total_rows: docCount, offset: opts.skip, rows: results }; /* istanbul ignore if */ if (opts.update_seq && updateSeq !== undefined) { returnVal.update_seq = updateSeq; } callback(null, returnVal); } function onTxnComplete() { if (opts.attachments) { postProcessAttachments(results, opts.binary).then(onResultsReady); } else { onResultsReady(); } } // don't bother doing any requests if start > end or limit === 0 if (keyRangeError || limit === 0) { return; } if (keys) { return allDocsKeys(opts.keys, docStore, onBatch); } if (limit === -1) { // just fetch everything return getAll(docStore, keyRange, onGetAll); } // else do a cursor // choose a batch size based on the skip, since we'll need to skip that many runBatchedCursor(docStore, keyRange, opts.descending, limit + skip, onBatch); } // // Blobs are not supported in all versions of IndexedDB, notably // Chrome <37 and Android <5. In those versions, storing a blob will throw. // // Various other blob bugs exist in Chrome v37-42 (inclusive). // Detecting them is expensive and confusing to users, and Chrome 37-42 // is at very low usage worldwide, so we do a hacky userAgent check instead. // // content-type bug: https://code.google.com/p/chromium/issues/detail?id=408120 // 404 bug: https://code.google.com/p/chromium/issues/detail?id=447916 // FileReader bug: https://code.google.com/p/chromium/issues/detail?id=447836 // function checkBlobSupport(txn) { return new Promise(function (resolve) { var blob$$1 = createBlob(['']); var req = txn.objectStore(DETECT_BLOB_SUPPORT_STORE).put(blob$$1, 'key'); req.onsuccess = function () { var matchedChrome = navigator.userAgent.match(/Chrome\/(\d+)/); var matchedEdge = navigator.userAgent.match(/Edge\//); // MS Edge pretends to be Chrome 42: // https://msdn.microsoft.com/en-us/library/hh869301%28v=vs.85%29.aspx resolve(matchedEdge || !matchedChrome || parseInt(matchedChrome[1], 10) >= 43); }; req.onerror = txn.onabort = function (e) { // If the transaction aborts now its due to not being able to // write to the database, likely due to the disk being full e.preventDefault(); e.stopPropagation(); resolve(false); }; }).catch(function () { return false; // error, so assume unsupported }); } function countDocs(txn, cb) { var index = txn.objectStore(DOC_STORE).index('deletedOrLocal'); index.count(IDBKeyRange.only('0')).onsuccess = function (e) { cb(e.target.result); }; } // This task queue ensures that IDB open calls are done in their own tick var running = false; var queue = []; function tryCode(fun, err, res, PouchDB) { try { fun(err, res); } catch (err) { // Shouldn't happen, but in some odd cases // IndexedDB implementations might throw a sync // error, in which case this will at least log it. PouchDB.emit('error', err); } } function applyNext() { if (running || !queue.length) { return; } running = true; queue.shift()(); } function enqueueTask(action, callback, PouchDB) { queue.push(function runAction() { action(function runCallback(err, res) { tryCode(callback, err, res, PouchDB); running = false; immediate__WEBPACK_IMPORTED_MODULE_1___default()(function runNext() { applyNext(PouchDB); }); }); }); applyNext(); } function changes(opts, api, dbName, idb) { opts = clone(opts); if (opts.continuous) { var id = dbName + ':' + uuid(); changesHandler.addListener(dbName, id, api, opts); changesHandler.notify(dbName); return { cancel: function () { changesHandler.removeListener(dbName, id); } }; } var docIds = opts.doc_ids && new ExportedSet(opts.doc_ids); opts.since = opts.since || 0; var lastSeq = opts.since; var limit = 'limit' in opts ? opts.limit : -1; if (limit === 0) { limit = 1; // per CouchDB _changes spec } var results = []; var numResults = 0; var filter = filterChange(opts); var docIdsToMetadata = new ExportedMap(); var txn; var bySeqStore; var docStore; var docIdRevIndex; function onBatch(batchKeys, batchValues, cursor) { if (!cursor || !batchKeys.length) { // done return; } var winningDocs = new Array(batchKeys.length); var metadatas = new Array(batchKeys.length); function processMetadataAndWinningDoc(metadata, winningDoc) { var change = opts.processChange(winningDoc, metadata, opts); lastSeq = change.seq = metadata.seq; var filtered = filter(change); if (typeof filtered === 'object') { // anything but true/false indicates error return Promise.reject(filtered); } if (!filtered) { return Promise.resolve(); } numResults++; if (opts.return_docs) { results.push(change); } // process the attachment immediately // for the benefit of live listeners if (opts.attachments && opts.include_docs) { return new Promise(function (resolve) { fetchAttachmentsIfNecessary(winningDoc, opts, txn, function () { postProcessAttachments([change], opts.binary).then(function () { resolve(change); }); }); }); } else { return Promise.resolve(change); } } function onBatchDone() { var promises = []; for (var i = 0, len = winningDocs.length; i < len; i++) { if (numResults === limit) { break; } var winningDoc = winningDocs[i]; if (!winningDoc) { continue; } var metadata = metadatas[i]; promises.push(processMetadataAndWinningDoc(metadata, winningDoc)); } Promise.all(promises).then(function (changes) { for (var i = 0, len = changes.length; i < len; i++) { if (changes[i]) { opts.onChange(changes[i]); } } }).catch(opts.complete); if (numResults !== limit) { cursor.continue(); } } // Fetch all metadatas/winningdocs from this batch in parallel, then process // them all only once all data has been collected. This is done in parallel // because it's faster than doing it one-at-a-time. var numDone = 0; batchValues.forEach(function (value, i) { var doc = decodeDoc(value); var seq = batchKeys[i]; fetchWinningDocAndMetadata(doc, seq, function (metadata, winningDoc) { metadatas[i] = metadata; winningDocs[i] = winningDoc; if (++numDone === batchKeys.length) { onBatchDone(); } }); }); } function onGetMetadata(doc, seq, metadata, cb) { if (metadata.seq !== seq) { // some other seq is later return cb(); } if (metadata.winningRev === doc._rev) { // this is the winning doc return cb(metadata, doc); } // fetch winning doc in separate request var docIdRev = doc._id + '::' + metadata.winningRev; var req = docIdRevIndex.get(docIdRev); req.onsuccess = function (e) { cb(metadata, decodeDoc(e.target.result)); }; } function fetchWinningDocAndMetadata(doc, seq, cb) { if (docIds && !docIds.has(doc._id)) { return cb(); } var metadata = docIdsToMetadata.get(doc._id); if (metadata) { // cached return onGetMetadata(doc, seq, metadata, cb); } // metadata not cached, have to go fetch it docStore.get(doc._id).onsuccess = function (e) { metadata = decodeMetadata(e.target.result); docIdsToMetadata.set(doc._id, metadata); onGetMetadata(doc, seq, metadata, cb); }; } function finish() { opts.complete(null, { results: results, last_seq: lastSeq }); } function onTxnComplete() { if (!opts.continuous && opts.attachments) { // cannot guarantee that postProcessing was already done, // so do it again postProcessAttachments(results).then(finish); } else { finish(); } } var objectStores = [DOC_STORE, BY_SEQ_STORE]; if (opts.attachments) { objectStores.push(ATTACH_STORE); } var txnResult = openTransactionSafely(idb, objectStores, 'readonly'); if (txnResult.error) { return opts.complete(txnResult.error); } txn = txnResult.txn; txn.onabort = idbError(opts.complete); txn.oncomplete = onTxnComplete; bySeqStore = txn.objectStore(BY_SEQ_STORE); docStore = txn.objectStore(DOC_STORE); docIdRevIndex = bySeqStore.index('_doc_id_rev'); var keyRange = (opts.since && !opts.descending) ? IDBKeyRange.lowerBound(opts.since, true) : null; runBatchedCursor(bySeqStore, keyRange, opts.descending, limit, onBatch); } var cachedDBs = new ExportedMap(); var blobSupportPromise; var openReqList = new ExportedMap(); function IdbPouch(opts, callback) { var api = this; enqueueTask(function (thisCallback) { init(api, opts, thisCallback); }, callback, api.constructor); } function init(api, opts, callback) { var dbName = opts.name; var idb = null; api._meta = null; // called when creating a fresh new database function createSchema(db) { var docStore = db.createObjectStore(DOC_STORE, {keyPath : 'id'}); db.createObjectStore(BY_SEQ_STORE, {autoIncrement: true}) .createIndex('_doc_id_rev', '_doc_id_rev', {unique: true}); db.createObjectStore(ATTACH_STORE, {keyPath: 'digest'}); db.createObjectStore(META_STORE, {keyPath: 'id', autoIncrement: false}); db.createObjectStore(DETECT_BLOB_SUPPORT_STORE); // added in v2 docStore.createIndex('deletedOrLocal', 'deletedOrLocal', {unique : false}); // added in v3 db.createObjectStore(LOCAL_STORE, {keyPath: '_id'}); // added in v4 var attAndSeqStore = db.createObjectStore(ATTACH_AND_SEQ_STORE, {autoIncrement: true}); attAndSeqStore.createIndex('seq', 'seq'); attAndSeqStore.createIndex('digestSeq', 'digestSeq', {unique: true}); } // migration to version 2 // unfortunately "deletedOrLocal" is a misnomer now that we no longer // store local docs in the main doc-store, but whaddyagonnado function addDeletedOrLocalIndex(txn, callback) { var docStore = txn.objectStore(DOC_STORE); docStore.createIndex('deletedOrLocal', 'deletedOrLocal', {unique : false}); docStore.openCursor().onsuccess = function (event) { var cursor = event.target.result; if (cursor) { var metadata = cursor.value; var deleted = isDeleted(metadata); metadata.deletedOrLocal = deleted ? "1" : "0"; docStore.put(metadata); cursor.continue(); } else { callback(); } }; } // migration to version 3 (part 1) function createLocalStoreSchema(db) { db.createObjectStore(LOCAL_STORE, {keyPath: '_id'}) .createIndex('_doc_id_rev', '_doc_id_rev', {unique: true}); } // migration to version 3 (part 2) function migrateLocalStore(txn, cb) { var localStore = txn.objectStore(LOCAL_STORE); var docStore = txn.objectStore(DOC_STORE); var seqStore = txn.objectStore(BY_SEQ_STORE); var cursor = docStore.openCursor(); cursor.onsuccess = function (event) { var cursor = event.target.result; if (cursor) { var metadata = cursor.value; var docId = metadata.id; var local = isLocalId(docId); var rev = winningRev(metadata); if (local) { var docIdRev = docId + "::" + rev; // remove all seq entries // associated with this docId var start = docId + "::"; var end = docId + "::~"; var index = seqStore.index('_doc_id_rev'); var range = IDBKeyRange.bound(start, end, false, false); var seqCursor = index.openCursor(range); seqCursor.onsuccess = function (e) { seqCursor = e.target.result; if (!seqCursor) { // done docStore.delete(cursor.primaryKey); cursor.continue(); } else { var data = seqCursor.value; if (data._doc_id_rev === docIdRev) { localStore.put(data); } seqStore.delete(seqCursor.primaryKey); seqCursor.continue(); } }; } else { cursor.continue(); } } else if (cb) { cb(); } }; } // migration to version 4 (part 1) function addAttachAndSeqStore(db) { var attAndSeqStore = db.createObjectStore(ATTACH_AND_SEQ_STORE, {autoIncrement: true}); attAndSeqStore.createIndex('seq', 'seq'); attAndSeqStore.createIndex('digestSeq', 'digestSeq', {unique: true}); } // migration to version 4 (part 2) function migrateAttsAndSeqs(txn, callback) { var seqStore = txn.objectStore(BY_SEQ_STORE); var attStore = txn.objectStore(ATTACH_STORE); var attAndSeqStore = txn.objectStore(ATTACH_AND_SEQ_STORE); // need to actually populate the table. this is the expensive part, // so as an optimization, check first that this database even // contains attachments var req = attStore.count(); req.onsuccess = function (e) { var count = e.target.result; if (!count) { return callback(); // done } seqStore.openCursor().onsuccess = function (e) { var cursor = e.target.result; if (!cursor) { return callback(); // done } var doc = cursor.value; var seq = cursor.primaryKey; var atts = Object.keys(doc._attachments || {}); var digestMap = {}; for (var j = 0; j < atts.length; j++) { var att = doc._attachments[atts[j]]; digestMap[att.digest] = true; // uniq digests, just in case } var digests = Object.keys(digestMap); for (j = 0; j < digests.length; j++) { var digest = digests[j]; attAndSeqStore.put({ seq: seq, digestSeq: digest + '::' + seq }); } cursor.continue(); }; }; } // migration to version 5 // Instead of relying on on-the-fly migration of metadata, // this brings the doc-store to its modern form: // - metadata.winningrev // - metadata.seq // - stringify the metadata when storing it function migrateMetadata(txn) { function decodeMetadataCompat(storedObject) { if (!storedObject.data) { // old format, when we didn't store it stringified storedObject.deleted = storedObject.deletedOrLocal === '1'; return storedObject; } return decodeMetadata(storedObject); } // ensure that every metadata has a winningRev and seq, // which was previously created on-the-fly but better to migrate var bySeqStore = txn.objectStore(BY_SEQ_STORE); var docStore = txn.objectStore(DOC_STORE); var cursor = docStore.openCursor(); cursor.onsuccess = function (e) { var cursor = e.target.result; if (!cursor) { return; // done } var metadata = decodeMetadataCompat(cursor.value); metadata.winningRev = metadata.winningRev || winningRev(metadata); function fetchMetadataSeq() { // metadata.seq was added post-3.2.0, so if it's missing, // we need to fetch it manually var start = metadata.id + '::'; var end = metadata.id + '::\uffff'; var req = bySeqStore.index('_doc_id_rev').openCursor( IDBKeyRange.bound(start, end)); var metadataSeq = 0; req.onsuccess = function (e) { var cursor = e.target.result; if (!cursor) { metadata.seq = metadataSeq; return onGetMetadataSeq(); } var seq = cursor.primaryKey; if (seq > metadataSeq) { metadataSeq = seq; } cursor.continue(); }; } function onGetMetadataSeq() { var metadataToStore = encodeMetadata(metadata, metadata.winningRev, metadata.deleted); var req = docStore.put(metadataToStore); req.onsuccess = function () { cursor.continue(); }; } if (metadata.seq) { return onGetMetadataSeq(); } fetchMetadataSeq(); }; } api._remote = false; api.type = function () { return 'idb'; }; api._id = toPromise(function (callback) { callback(null, api._meta.instanceId); }); api._bulkDocs = function idb_bulkDocs(req, reqOpts, callback) { idbBulkDocs(opts, req, reqOpts, api, idb, callback); }; // First we look up the metadata in the ids database, then we fetch the // current revision(s) from the by sequence store api._get = function idb_get(id, opts, callback) { var doc; var metadata; var err; var txn = opts.ctx; if (!txn) { var txnResult = openTransactionSafely(idb, [DOC_STORE, BY_SEQ_STORE, ATTACH_STORE], 'readonly'); if (txnResult.error) { return callback(txnResult.error); } txn = txnResult.txn; } function finish() { callback(err, {doc: doc, metadata: metadata, ctx: txn}); } txn.objectStore(DOC_STORE).get(id).onsuccess = function (e) { metadata = decodeMetadata(e.target.result); // we can determine the result here if: // 1. there is no such document // 2. the document is deleted and we don't ask about specific rev // When we ask with opts.rev we expect the answer to be either // doc (possibly with _deleted=true) or missing error if (!metadata) { err = createError(MISSING_DOC, 'missing'); return finish(); } var rev; if (!opts.rev) { rev = metadata.winningRev; var deleted = isDeleted(metadata); if (deleted) { err = createError(MISSING_DOC, "deleted"); return finish(); } } else { rev = opts.latest ? latest(opts.rev, metadata) : opts.rev; } var objectStore = txn.objectStore(BY_SEQ_STORE); var key = metadata.id + '::' + rev; objectStore.index('_doc_id_rev').get(key).onsuccess = function (e) { doc = e.target.result; if (doc) { doc = decodeDoc(doc); } if (!doc) { err = createError(MISSING_DOC, 'missing'); return finish(); } finish(); }; }; }; api._getAttachment = function (docId, attachId, attachment, opts, callback) { var txn; if (opts.ctx) { txn = opts.ctx; } else { var txnResult = openTransactionSafely(idb, [DOC_STORE, BY_SEQ_STORE, ATTACH_STORE], 'readonly'); if (txnResult.error) { return callback(txnResult.error); } txn = txnResult.txn; } var digest = attachment.digest; var type = attachment.content_type; txn.objectStore(ATTACH_STORE).get(digest).onsuccess = function (e) { var body = e.target.result.body; readBlobData(body, type, opts.binary, function (blobData) { callback(null, blobData); }); }; }; api._info = function idb_info(callback) { var updateSeq; var docCount; var txnResult = openTransactionSafely(idb, [META_STORE, BY_SEQ_STORE], 'readonly'); if (txnResult.error) { return callback(txnResult.error); } var txn = txnResult.txn; txn.objectStore(META_STORE).get(META_STORE).onsuccess = function (e) { docCount = e.target.result.docCount; }; txn.objectStore(BY_SEQ_STORE).openCursor(null, 'prev').onsuccess = function (e) { var cursor = e.target.result; updateSeq = cursor ? cursor.key : 0; }; txn.oncomplete = function () { callback(null, { doc_count: docCount, update_seq: updateSeq, // for debugging idb_attachment_format: (api._meta.blobSupport ? 'binary' : 'base64') }); }; }; api._allDocs = function idb_allDocs(opts, callback) { idbAllDocs(opts, idb, callback); }; api._changes = function idbChanges(opts) { return changes(opts, api, dbName, idb); }; api._close = function (callback) { // https://developer.mozilla.org/en-US/docs/IndexedDB/IDBDatabase#close // "Returns immediately and closes the connection in a separate thread..." idb.close(); cachedDBs.delete(dbName); callback(); }; api._getRevisionTree = function (docId, callback) { var txnResult = openTransactionSafely(idb, [DOC_STORE], 'readonly'); if (txnResult.error) { return callback(txnResult.error); } var txn = txnResult.txn; var req = txn.objectStore(DOC_STORE).get(docId); req.onsuccess = function (event) { var doc = decodeMetadata(event.target.result); if (!doc) { callback(createError(MISSING_DOC)); } else { callback(null, doc.rev_tree); } }; }; // This function removes revisions of document docId // which are listed in revs and sets this document // revision to to rev_tree api._doCompaction = function (docId, revs, callback) { var stores = [ DOC_STORE, BY_SEQ_STORE, ATTACH_STORE, ATTACH_AND_SEQ_STORE ]; var txnResult = openTransactionSafely(idb, stores, 'readwrite'); if (txnResult.error) { return callback(txnResult.error); } var txn = txnResult.txn; var docStore = txn.objectStore(DOC_STORE); docStore.get(docId).onsuccess = function (event) { var metadata = decodeMetadata(event.target.result); traverseRevTree(metadata.rev_tree, function (isLeaf, pos, revHash, ctx, opts) { var rev = pos + '-' + revHash; if (revs.indexOf(rev) !== -1) { opts.status = 'missing'; } }); compactRevs(revs, docId, txn); var winningRev$$1 = metadata.winningRev; var deleted = metadata.deleted; txn.objectStore(DOC_STORE).put( encodeMetadata(metadata, winningRev$$1, deleted)); }; txn.onabort = idbError(callback); txn.oncomplete = function () { callback(); }; }; api._getLocal = function (id, callback) { var txnResult = openTransactionSafely(idb, [LOCAL_STORE], 'readonly'); if (txnResult.error) { return callback(txnResult.error); } var tx = txnResult.txn; var req = tx.objectStore(LOCAL_STORE).get(id); req.onerror = idbError(callback); req.onsuccess = function (e) { var doc = e.target.result; if (!doc) { callback(createError(MISSING_DOC)); } else { delete doc['_doc_id_rev']; // for backwards compat callback(null, doc); } }; }; api._putLocal = function (doc, opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } delete doc._revisions; // ignore this, trust the rev var oldRev = doc._rev; var id = doc._id; if (!oldRev) { doc._rev = '0-1'; } else { doc._rev = '0-' + (parseInt(oldRev.split('-')[1], 10) + 1); } var tx = opts.ctx; var ret; if (!tx) { var txnResult = openTransactionSafely(idb, [LOCAL_STORE], 'readwrite'); if (txnResult.error) { return callback(txnResult.error); } tx = txnResult.txn; tx.onerror = idbError(callback); tx.oncomplete = function () { if (ret) { callback(null, ret); } }; } var oStore = tx.objectStore(LOCAL_STORE); var req; if (oldRev) { req = oStore.get(id); req.onsuccess = function (e) { var oldDoc = e.target.result; if (!oldDoc || oldDoc._rev !== oldRev) { callback(createError(REV_CONFLICT)); } else { // update var req = oStore.put(doc); req.onsuccess = function () { ret = {ok: true, id: doc._id, rev: doc._rev}; if (opts.ctx) { // return immediately callback(null, ret); } }; } }; } else { // new doc req = oStore.add(doc); req.onerror = function (e) { // constraint error, already exists callback(createError(REV_CONFLICT)); e.preventDefault(); // avoid transaction abort e.stopPropagation(); // avoid transaction onerror }; req.onsuccess = function () { ret = {ok: true, id: doc._id, rev: doc._rev}; if (opts.ctx) { // return immediately callback(null, ret); } }; } }; api._removeLocal = function (doc, opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } var tx = opts.ctx; if (!tx) { var txnResult = openTransactionSafely(idb, [LOCAL_STORE], 'readwrite'); if (txnResult.error) { return callback(txnResult.error); } tx = txnResult.txn; tx.oncomplete = function () { if (ret) { callback(null, ret); } }; } var ret; var id = doc._id; var oStore = tx.objectStore(LOCAL_STORE); var req = oStore.get(id); req.onerror = idbError(callback); req.onsuccess = function (e) { var oldDoc = e.target.result; if (!oldDoc || oldDoc._rev !== doc._rev) { callback(createError(MISSING_DOC)); } else { oStore.delete(id); ret = {ok: true, id: id, rev: '0-0'}; if (opts.ctx) { // return immediately callback(null, ret); } } }; }; api._destroy = function (opts, callback) { changesHandler.removeAllListeners(dbName); //Close open request for "dbName" database to fix ie delay. var openReq = openReqList.get(dbName); if (openReq && openReq.result) { openReq.result.close(); cachedDBs.delete(dbName); } var req = indexedDB.deleteDatabase(dbName); req.onsuccess = function () { //Remove open request from the list. openReqList.delete(dbName); if (hasLocalStorage() && (dbName in localStorage)) { delete localStorage[dbName]; } callback(null, { 'ok': true }); }; req.onerror = idbError(callback); }; var cached = cachedDBs.get(dbName); if (cached) { idb = cached.idb; api._meta = cached.global; return immediate__WEBPACK_IMPORTED_MODULE_1___default()(function () { callback(null, api); }); } var req = indexedDB.open(dbName, ADAPTER_VERSION); openReqList.set(dbName, req); req.onupgradeneeded = function (e) { var db = e.target.result; if (e.oldVersion < 1) { return createSchema(db); // new db, initial schema } // do migrations var txn = e.currentTarget.transaction; // these migrations have to be done in this function, before // control is returned to the event loop, because IndexedDB if (e.oldVersion < 3) { createLocalStoreSchema(db); // v2 -> v3 } if (e.oldVersion < 4) { addAttachAndSeqStore(db); // v3 -> v4 } var migrations = [ addDeletedOrLocalIndex, // v1 -> v2 migrateLocalStore, // v2 -> v3 migrateAttsAndSeqs, // v3 -> v4 migrateMetadata // v4 -> v5 ]; var i = e.oldVersion; function next() { var migration = migrations[i - 1]; i++; if (migration) { migration(txn, next); } } next(); }; req.onsuccess = function (e) { idb = e.target.result; idb.onversionchange = function () { idb.close(); cachedDBs.delete(dbName); }; idb.onabort = function (e) { guardedConsole('error', 'Database has a global failure', e.target.error); idb.close(); cachedDBs.delete(dbName); }; // Do a few setup operations (in parallel as much as possible): // 1. Fetch meta doc // 2. Check blob support // 3. Calculate docCount // 4. Generate an instanceId if necessary // 5. Store docCount and instanceId on meta doc var txn = idb.transaction([ META_STORE, DETECT_BLOB_SUPPORT_STORE, DOC_STORE ], 'readwrite'); var storedMetaDoc = false; var metaDoc; var docCount; var blobSupport; var instanceId; function completeSetup() { if (typeof blobSupport === 'undefined' || !storedMetaDoc) { return; } api._meta = { name: dbName, instanceId: instanceId, blobSupport: blobSupport }; cachedDBs.set(dbName, { idb: idb, global: api._meta }); callback(null, api); } function storeMetaDocIfReady() { if (typeof docCount === 'undefined' || typeof metaDoc === 'undefined') { return; } var instanceKey = dbName + '_id'; if (instanceKey in metaDoc) { instanceId = metaDoc[instanceKey]; } else { metaDoc[instanceKey] = instanceId = uuid(); } metaDoc.docCount = docCount; txn.objectStore(META_STORE).put(metaDoc); } // // fetch or generate the instanceId // txn.objectStore(META_STORE).get(META_STORE).onsuccess = function (e) { metaDoc = e.target.result || { id: META_STORE }; storeMetaDocIfReady(); }; // // countDocs // countDocs(txn, function (count) { docCount = count; storeMetaDocIfReady(); }); // // check blob support // if (!blobSupportPromise) { // make sure blob support is only checked once blobSupportPromise = checkBlobSupport(txn); } blobSupportPromise.then(function (val) { blobSupport = val; completeSetup(); }); // only when the metadata put transaction has completed, // consider the setup done txn.oncomplete = function () { storedMetaDoc = true; completeSetup(); }; txn.onabort = idbError(callback); }; req.onerror = function () { var msg = 'Failed to open indexedDB, are you in private browsing mode?'; guardedConsole('error', msg); callback(createError(IDB_ERROR, msg)); }; } IdbPouch.valid = function () { // Following #7085 buggy idb versions (typically Safari < 10.1) are // considered valid. // On Firefox SecurityError is thrown while referencing indexedDB if cookies // are not allowed. `typeof indexedDB` also triggers the error. try { // some outdated implementations of IDB that appear on Samsung // and HTC Android devices <4.4 are missing IDBKeyRange return typeof indexedDB !== 'undefined' && typeof IDBKeyRange !== 'undefined'; } catch (e) { return false; } }; function IDBPouch (PouchDB) { PouchDB.adapter('idb', IdbPouch, true); } // dead simple promise pool, inspired by https://github.com/timdp/es6-promise-pool // but much smaller in code size. limits the number of concurrent promises that are executed function pool(promiseFactories, limit) { return new Promise(function (resolve, reject) { var running = 0; var current = 0; var done = 0; var len = promiseFactories.length; var err; function runNext() { running++; promiseFactories[current++]().then(onSuccess, onError); } function doNext() { if (++done === len) { /* istanbul ignore if */ if (err) { reject(err); } else { resolve(); } } else { runNextBatch(); } } function onSuccess() { running--; doNext(); } /* istanbul ignore next */ function onError(thisErr) { running--; err = err || thisErr; doNext(); } function runNextBatch() { while (running < limit && current < len) { runNext(); } } runNextBatch(); }); } var CHANGES_BATCH_SIZE = 25; var MAX_SIMULTANEOUS_REVS = 50; var CHANGES_TIMEOUT_BUFFER = 5000; var DEFAULT_HEARTBEAT = 10000; var supportsBulkGetMap = {}; function readAttachmentsAsBlobOrBuffer(row) { var doc = row.doc || row.ok; var atts = doc._attachments; if (!atts) { return; } Object.keys(atts).forEach(function (filename) { var att = atts[filename]; att.data = b64ToBluffer(att.data, att.content_type); }); } function encodeDocId(id) { if (/^_design/.test(id)) { return '_design/' + encodeURIComponent(id.slice(8)); } if (/^_local/.test(id)) { return '_local/' + encodeURIComponent(id.slice(7)); } return encodeURIComponent(id); } function preprocessAttachments$1(doc) { if (!doc._attachments || !Object.keys(doc._attachments)) { return Promise.resolve(); } return Promise.all(Object.keys(doc._attachments).map(function (key) { var attachment = doc._attachments[key]; if (attachment.data && typeof attachment.data !== 'string') { return new Promise(function (resolve) { blobToBase64(attachment.data, resolve); }).then(function (b64) { attachment.data = b64; }); } })); } function hasUrlPrefix(opts) { if (!opts.prefix) { return false; } var protocol = parseUri(opts.prefix).protocol; return protocol === 'http' || protocol === 'https'; } // Get all the information you possibly can about the URI given by name and // return it as a suitable object. function getHost(name, opts) { // encode db name if opts.prefix is a url (#5574) if (hasUrlPrefix(opts)) { var dbName = opts.name.substr(opts.prefix.length); // Ensure prefix has a trailing slash var prefix = opts.prefix.replace(/\/?$/, '/'); name = prefix + encodeURIComponent(dbName); } var uri = parseUri(name); if (uri.user || uri.password) { uri.auth = {username: uri.user, password: uri.password}; } // Split the path part of the URI into parts using '/' as the delimiter // after removing any leading '/' and any trailing '/' var parts = uri.path.replace(/(^\/|\/$)/g, '').split('/'); uri.db = parts.pop(); // Prevent double encoding of URI component if (uri.db.indexOf('%') === -1) { uri.db = encodeURIComponent(uri.db); } uri.path = parts.join('/'); return uri; } // Generate a URL with the host data given by opts and the given path function genDBUrl(opts, path) { return genUrl(opts, opts.db + '/' + path); } // Generate a URL with the host data given by opts and the given path function genUrl(opts, path) { // If the host already has a path, then we need to have a path delimiter // Otherwise, the path delimiter is the empty string var pathDel = !opts.path ? '' : '/'; // If the host already has a path, then we need to have a path delimiter // Otherwise, the path delimiter is the empty string return opts.protocol + '://' + opts.host + (opts.port ? (':' + opts.port) : '') + '/' + opts.path + pathDel + path; } function paramsToStr(params) { return '?' + Object.keys(params).map(function (k) { return k + '=' + encodeURIComponent(params[k]); }).join('&'); } function shouldCacheBust(opts) { var ua = (typeof navigator !== 'undefined' && navigator.userAgent) ? navigator.userAgent.toLowerCase() : ''; var isIE = ua.indexOf('msie') !== -1; var isTrident = ua.indexOf('trident') !== -1; var isEdge = ua.indexOf('edge') !== -1; var isGET = !('method' in opts) || opts.method === 'GET'; return (isIE || isTrident || isEdge) && isGET; } // Implements the PouchDB API for dealing with CouchDB instances over HTTP function HttpPouch(opts, callback) { // The functions that will be publicly available for HttpPouch var api = this; var host = getHost(opts.name, opts); var dbUrl = genDBUrl(host, ''); opts = clone(opts); var ourFetch = function (url, options) { options = options || {}; options.headers = options.headers || new h(); if (opts.auth || host.auth) { var nAuth = opts.auth || host.auth; var str = nAuth.username + ':' + nAuth.password; var token = thisBtoa(unescape(encodeURIComponent(str))); options.headers.set('Authorization', 'Basic ' + token); } var headers = opts.headers || {}; Object.keys(headers).forEach(function (key) { options.headers.append(key, headers[key]); }); /* istanbul ignore if */ if (shouldCacheBust(options)) { url += (url.indexOf('?') === -1 ? '?' : '&') + '_nonce=' + Date.now(); } var fetchFun = opts.fetch || f$1; return fetchFun(url, options); }; function adapterFun$$1(name, fun) { return adapterFun(name, argsarray__WEBPACK_IMPORTED_MODULE_0___default()(function (args) { setup().then(function () { return fun.apply(this, args); }).catch(function (e) { var callback = args.pop(); callback(e); }); })).bind(api); } function fetchJSON(url, options, callback) { var result = {}; options = options || {}; options.headers = options.headers || new h(); if (!options.headers.get('Content-Type')) { options.headers.set('Content-Type', 'application/json'); } if (!options.headers.get('Accept')) { options.headers.set('Accept', 'application/json'); } return ourFetch(url, options).then(function (response) { result.ok = response.ok; result.status = response.status; return response.json(); }).then(function (json) { result.data = json; if (!result.ok) { result.data.status = result.status; var err = generateErrorFromResponse(result.data); if (callback) { return callback(err); } else { throw err; } } if (Array.isArray(result.data)) { result.data = result.data.map(function (v) { if (v.error || v.missing) { return generateErrorFromResponse(v); } else { return v; } }); } if (callback) { callback(null, result.data); } else { return result; } }); } var setupPromise; function setup() { if (opts.skip_setup) { return Promise.resolve(); } // If there is a setup in process or previous successful setup // done then we will use that // If previous setups have been rejected we will try again if (setupPromise) { return setupPromise; } setupPromise = fetchJSON(dbUrl).catch(function (err) { if (err && err.status && err.status === 404) { // Doesnt exist, create it explainError(404, 'PouchDB is just detecting if the remote exists.'); return fetchJSON(dbUrl, {method: 'PUT'}); } else { return Promise.reject(err); } }).catch(function (err) { // If we try to create a database that already exists, skipped in // istanbul since its catching a race condition. /* istanbul ignore if */ if (err && err.status && err.status === 412) { return true; } return Promise.reject(err); }); setupPromise.catch(function () { setupPromise = null; }); return setupPromise; } immediate__WEBPACK_IMPORTED_MODULE_1___default()(function () { callback(null, api); }); api._remote = true; /* istanbul ignore next */ api.type = function () { return 'http'; }; api.id = adapterFun$$1('id', function (callback) { ourFetch(genUrl(host, '')).then(function (response) { return response.json(); }).then(function (result) { var uuid$$1 = (result && result.uuid) ? (result.uuid + host.db) : genDBUrl(host, ''); callback(null, uuid$$1); }).catch(function (err) { callback(err); }); }); // Sends a POST request to the host calling the couchdb _compact function // version: The version of CouchDB it is running api.compact = adapterFun$$1('compact', function (opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } opts = clone(opts); fetchJSON(genDBUrl(host, '_compact'), {method: 'POST'}).then(function () { function ping() { api.info(function (err, res) { // CouchDB may send a "compact_running:true" if it's // already compacting. PouchDB Server doesn't. /* istanbul ignore else */ if (res && !res.compact_running) { callback(null, {ok: true}); } else { setTimeout(ping, opts.interval || 200); } }); } // Ping the http if it's finished compaction ping(); }); }); api.bulkGet = adapterFun('bulkGet', function (opts, callback) { var self = this; function doBulkGet(cb) { var params = {}; if (opts.revs) { params.revs = true; } if (opts.attachments) { /* istanbul ignore next */ params.attachments = true; } if (opts.latest) { params.latest = true; } fetchJSON(genDBUrl(host, '_bulk_get' + paramsToStr(params)), { method: 'POST', body: JSON.stringify({ docs: opts.docs}) }).then(function (result) { if (opts.attachments && opts.binary) { result.data.results.forEach(function (res) { res.docs.forEach(readAttachmentsAsBlobOrBuffer); }); } cb(null, result.data); }).catch(cb); } /* istanbul ignore next */ function doBulkGetShim() { // avoid "url too long error" by splitting up into multiple requests var batchSize = MAX_SIMULTANEOUS_REVS; var numBatches = Math.ceil(opts.docs.length / batchSize); var numDone = 0; var results = new Array(numBatches); function onResult(batchNum) { return function (err, res) { // err is impossible because shim returns a list of errs in that case results[batchNum] = res.results; if (++numDone === numBatches) { callback(null, {results: flatten(results)}); } }; } for (var i = 0; i < numBatches; i++) { var subOpts = pick(opts, ['revs', 'attachments', 'binary', 'latest']); subOpts.docs = opts.docs.slice(i * batchSize, Math.min(opts.docs.length, (i + 1) * batchSize)); bulkGet(self, subOpts, onResult(i)); } } // mark the whole database as either supporting or not supporting _bulk_get var dbUrl = genUrl(host, ''); var supportsBulkGet = supportsBulkGetMap[dbUrl]; /* istanbul ignore next */ if (typeof supportsBulkGet !== 'boolean') { // check if this database supports _bulk_get doBulkGet(function (err, res) { if (err) { supportsBulkGetMap[dbUrl] = false; explainError( err.status, 'PouchDB is just detecting if the remote ' + 'supports the _bulk_get API.' ); doBulkGetShim(); } else { supportsBulkGetMap[dbUrl] = true; callback(null, res); } }); } else if (supportsBulkGet) { doBulkGet(callback); } else { doBulkGetShim(); } }); // Calls GET on the host, which gets back a JSON string containing // couchdb: A welcome string // version: The version of CouchDB it is running api._info = function (callback) { setup().then(function () { return ourFetch(genDBUrl(host, '')); }).then(function (response) { return response.json(); }).then(function (info) { info.host = genDBUrl(host, ''); callback(null, info); }).catch(callback); }; api.fetch = function (path, options) { return setup().then(function () { return ourFetch(genDBUrl(host, path), options); }); }; // Get the document with the given id from the database given by host. // The id could be solely the _id in the database, or it may be a // _design/ID or _local/ID path api.get = adapterFun$$1('get', function (id, opts, callback) { // If no options were given, set the callback to the second parameter if (typeof opts === 'function') { callback = opts; opts = {}; } opts = clone(opts); // List of parameters to add to the GET request var params = {}; if (opts.revs) { params.revs = true; } if (opts.revs_info) { params.revs_info = true; } if (opts.latest) { params.latest = true; } if (opts.open_revs) { if (opts.open_revs !== "all") { opts.open_revs = JSON.stringify(opts.open_revs); } params.open_revs = opts.open_revs; } if (opts.rev) { params.rev = opts.rev; } if (opts.conflicts) { params.conflicts = opts.conflicts; } /* istanbul ignore if */ if (opts.update_seq) { params.update_seq = opts.update_seq; } id = encodeDocId(id); function fetchAttachments(doc) { var atts = doc._attachments; var filenames = atts && Object.keys(atts); if (!atts || !filenames.length) { return; } // we fetch these manually in separate XHRs, because // Sync Gateway would normally send it back as multipart/mixed, // which we cannot parse. Also, this is more efficient than // receiving attachments as base64-encoded strings. function fetchData(filename) { var att = atts[filename]; var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) + '?rev=' + doc._rev; return ourFetch(genDBUrl(host, path)).then(function (response) { if (typeof process !== 'undefined' && !process.browser) { return response.buffer(); } else { /* istanbul ignore next */ return response.blob(); } }).then(function (blob) { if (opts.binary) { // TODO: Can we remove this? if (typeof process !== 'undefined' && !process.browser) { blob.type = att.content_type; } return blob; } return new Promise(function (resolve) { blobToBase64(blob, resolve); }); }).then(function (data) { delete att.stub; delete att.length; att.data = data; }); } var promiseFactories = filenames.map(function (filename) { return function () { return fetchData(filename); }; }); // This limits the number of parallel xhr requests to 5 any time // to avoid issues with maximum browser request limits return pool(promiseFactories, 5); } function fetchAllAttachments(docOrDocs) { if (Array.isArray(docOrDocs)) { return Promise.all(docOrDocs.map(function (doc) { if (doc.ok) { return fetchAttachments(doc.ok); } })); } return fetchAttachments(docOrDocs); } var url = genDBUrl(host, id + paramsToStr(params)); fetchJSON(url).then(function (res) { return Promise.resolve().then(function () { if (opts.attachments) { return fetchAllAttachments(res.data); } }).then(function () { callback(null, res.data); }); }).catch(function (e) { e.docId = id; callback(e); }); }); // Delete the document given by doc from the database given by host. api.remove = adapterFun$$1('remove', function (docOrId, optsOrRev, opts, cb) { var doc; if (typeof optsOrRev === 'string') { // id, rev, opts, callback style doc = { _id: docOrId, _rev: optsOrRev }; if (typeof opts === 'function') { cb = opts; opts = {}; } } else { // doc, opts, callback style doc = docOrId; if (typeof optsOrRev === 'function') { cb = optsOrRev; opts = {}; } else { cb = opts; opts = optsOrRev; } } var rev = (doc._rev || opts.rev); var url = genDBUrl(host, encodeDocId(doc._id)) + '?rev=' + rev; fetchJSON(url, {method: 'DELETE'}, cb).catch(cb); }); function encodeAttachmentId(attachmentId) { return attachmentId.split("/").map(encodeURIComponent).join("/"); } // Get the attachment api.getAttachment = adapterFun$$1('getAttachment', function (docId, attachmentId, opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } var params = opts.rev ? ('?rev=' + opts.rev) : ''; var url = genDBUrl(host, encodeDocId(docId)) + '/' + encodeAttachmentId(attachmentId) + params; var contentType; ourFetch(url, {method: 'GET'}).then(function (response) { contentType = response.headers.get('content-type'); if (!response.ok) { throw response; } else { if (typeof process !== 'undefined' && !process.browser) { return response.buffer(); } else { /* istanbul ignore next */ return response.blob(); } } }).then(function (blob) { // TODO: also remove if (typeof process !== 'undefined' && !process.browser) { blob.type = contentType; } callback(null, blob); }).catch(function (err) { callback(err); }); }); // Remove the attachment given by the id and rev api.removeAttachment = adapterFun$$1('removeAttachment', function (docId, attachmentId, rev, callback) { var url = genDBUrl(host, encodeDocId(docId) + '/' + encodeAttachmentId(attachmentId)) + '?rev=' + rev; fetchJSON(url, {method: 'DELETE'}, callback).catch(callback); }); // Add the attachment given by blob and its contentType property // to the document with the given id, the revision given by rev, and // add it to the database given by host. api.putAttachment = adapterFun$$1('putAttachment', function (docId, attachmentId, rev, blob, type, callback) { if (typeof type === 'function') { callback = type; type = blob; blob = rev; rev = null; } var id = encodeDocId(docId) + '/' + encodeAttachmentId(attachmentId); var url = genDBUrl(host, id); if (rev) { url += '?rev=' + rev; } if (typeof blob === 'string') { // input is assumed to be a base64 string var binary; try { binary = thisAtob(blob); } catch (err) { return callback(createError(BAD_ARG, 'Attachment is not a valid base64 string')); } blob = binary ? binStringToBluffer(binary, type) : ''; } // Add the attachment fetchJSON(url, { headers: new h({'Content-Type': type}), method: 'PUT', body: blob }, callback).catch(callback); }); // Update/create multiple documents given by req in the database // given by host. api._bulkDocs = function (req, opts, callback) { // If new_edits=false then it prevents the database from creating // new revision numbers for the documents. Instead it just uses // the old ones. This is used in database replication. req.new_edits = opts.new_edits; setup().then(function () { return Promise.all(req.docs.map(preprocessAttachments$1)); }).then(function () { // Update/create the documents return fetchJSON(genDBUrl(host, '_bulk_docs'), { method: 'POST', body: JSON.stringify(req) }, callback); }).catch(callback); }; // Update/create document api._put = function (doc, opts, callback) { setup().then(function () { return preprocessAttachments$1(doc); }).then(function () { return fetchJSON(genDBUrl(host, encodeDocId(doc._id)), { method: 'PUT', body: JSON.stringify(doc) }); }).then(function (result) { callback(null, result.data); }).catch(function (err) { err.docId = doc && doc._id; callback(err); }); }; // Get a listing of the documents in the database given // by host and ordered by increasing id. api.allDocs = adapterFun$$1('allDocs', function (opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } opts = clone(opts); // List of parameters to add to the GET request var params = {}; var body; var method = 'GET'; if (opts.conflicts) { params.conflicts = true; } /* istanbul ignore if */ if (opts.update_seq) { params.update_seq = true; } if (opts.descending) { params.descending = true; } if (opts.include_docs) { params.include_docs = true; } // added in CouchDB 1.6.0 if (opts.attachments) { params.attachments = true; } if (opts.key) { params.key = JSON.stringify(opts.key); } if (opts.start_key) { opts.startkey = opts.start_key; } if (opts.startkey) { params.startkey = JSON.stringify(opts.startkey); } if (opts.end_key) { opts.endkey = opts.end_key; } if (opts.endkey) { params.endkey = JSON.stringify(opts.endkey); } if (typeof opts.inclusive_end !== 'undefined') { params.inclusive_end = !!opts.inclusive_end; } if (typeof opts.limit !== 'undefined') { params.limit = opts.limit; } if (typeof opts.skip !== 'undefined') { params.skip = opts.skip; } var paramStr = paramsToStr(params); if (typeof opts.keys !== 'undefined') { method = 'POST'; body = {keys: opts.keys}; } fetchJSON(genDBUrl(host, '_all_docs' + paramStr), { method: method, body: JSON.stringify(body) }).then(function (result) { if (opts.include_docs && opts.attachments && opts.binary) { result.data.rows.forEach(readAttachmentsAsBlobOrBuffer); } callback(null, result.data); }).catch(callback); }); // Get a list of changes made to documents in the database given by host. // TODO According to the README, there should be two other methods here, // api.changes.addListener and api.changes.removeListener. api._changes = function (opts) { // We internally page the results of a changes request, this means // if there is a large set of changes to be returned we can start // processing them quicker instead of waiting on the entire // set of changes to return and attempting to process them at once var batchSize = 'batch_size' in opts ? opts.batch_size : CHANGES_BATCH_SIZE; opts = clone(opts); if (opts.continuous && !('heartbeat' in opts)) { opts.heartbeat = DEFAULT_HEARTBEAT; } var requestTimeout = ('timeout' in opts) ? opts.timeout : 30 * 1000; // ensure CHANGES_TIMEOUT_BUFFER applies if ('timeout' in opts && opts.timeout && (requestTimeout - opts.timeout) < CHANGES_TIMEOUT_BUFFER) { requestTimeout = opts.timeout + CHANGES_TIMEOUT_BUFFER; } /* istanbul ignore if */ if ('heartbeat' in opts && opts.heartbeat && (requestTimeout - opts.heartbeat) < CHANGES_TIMEOUT_BUFFER) { requestTimeout = opts.heartbeat + CHANGES_TIMEOUT_BUFFER; } var params = {}; if ('timeout' in opts && opts.timeout) { params.timeout = opts.timeout; } var limit = (typeof opts.limit !== 'undefined') ? opts.limit : false; var leftToFetch = limit; if (opts.style) { params.style = opts.style; } if (opts.include_docs || opts.filter && typeof opts.filter === 'function') { params.include_docs = true; } if (opts.attachments) { params.attachments = true; } if (opts.continuous) { params.feed = 'longpoll'; } if (opts.seq_interval) { params.seq_interval = opts.seq_interval; } if (opts.conflicts) { params.conflicts = true; } if (opts.descending) { params.descending = true; } /* istanbul ignore if */ if (opts.update_seq) { params.update_seq = true; } if ('heartbeat' in opts) { // If the heartbeat value is false, it disables the default heartbeat if (opts.heartbeat) { params.heartbeat = opts.heartbeat; } } if (opts.filter && typeof opts.filter === 'string') { params.filter = opts.filter; } if (opts.view && typeof opts.view === 'string') { params.filter = '_view'; params.view = opts.view; } // If opts.query_params exists, pass it through to the changes request. // These parameters may be used by the filter on the source database. if (opts.query_params && typeof opts.query_params === 'object') { for (var param_name in opts.query_params) { /* istanbul ignore else */ if (opts.query_params.hasOwnProperty(param_name)) { params[param_name] = opts.query_params[param_name]; } } } var method = 'GET'; var body; if (opts.doc_ids) { // set this automagically for the user; it's annoying that couchdb // requires both a "filter" and a "doc_ids" param. params.filter = '_doc_ids'; method = 'POST'; body = {doc_ids: opts.doc_ids }; } /* istanbul ignore next */ else if (opts.selector) { // set this automagically for the user, similar to above params.filter = '_selector'; method = 'POST'; body = {selector: opts.selector }; } var controller = new a(); var lastFetchedSeq; // Get all the changes starting wtih the one immediately after the // sequence number given by since. var fetchData = function (since, callback) { if (opts.aborted) { return; } params.since = since; // "since" can be any kind of json object in Cloudant/CouchDB 2.x /* istanbul ignore next */ if (typeof params.since === "object") { params.since = JSON.stringify(params.since); } if (opts.descending) { if (limit) { params.limit = leftToFetch; } } else { params.limit = (!limit || leftToFetch > batchSize) ? batchSize : leftToFetch; } // Set the options for the ajax call var url = genDBUrl(host, '_changes' + paramsToStr(params)); var fetchOpts = { signal: controller.signal, method: method, body: JSON.stringify(body) }; lastFetchedSeq = since; /* istanbul ignore if */ if (opts.aborted) { return; } // Get the changes setup().then(function () { return fetchJSON(url, fetchOpts, callback); }).catch(callback); }; // If opts.since exists, get all the changes from the sequence // number given by opts.since. Otherwise, get all the changes // from the sequence number 0. var results = {results: []}; var fetched = function (err, res) { if (opts.aborted) { return; } var raw_results_length = 0; // If the result of the ajax call (res) contains changes (res.results) if (res && res.results) { raw_results_length = res.results.length; results.last_seq = res.last_seq; var pending = null; var lastSeq = null; // Attach 'pending' property if server supports it (CouchDB 2.0+) /* istanbul ignore if */ if (typeof res.pending === 'number') { pending = res.pending; } if (typeof results.last_seq === 'string' || typeof results.last_seq === 'number') { lastSeq = results.last_seq; } // For each change var req = {}; req.query = opts.query_params; res.results = res.results.filter(function (c) { leftToFetch--; var ret = filterChange(opts)(c); if (ret) { if (opts.include_docs && opts.attachments && opts.binary) { readAttachmentsAsBlobOrBuffer(c); } if (opts.return_docs) { results.results.push(c); } opts.onChange(c, pending, lastSeq); } return ret; }); } else if (err) { // In case of an error, stop listening for changes and call // opts.complete opts.aborted = true; opts.complete(err); return; } // The changes feed may have timed out with no results // if so reuse last update sequence if (res && res.last_seq) { lastFetchedSeq = res.last_seq; } var finished = (limit && leftToFetch <= 0) || (res && raw_results_length < batchSize) || (opts.descending); if ((opts.continuous && !(limit && leftToFetch <= 0)) || !finished) { // Queue a call to fetch again with the newest sequence number immediate__WEBPACK_IMPORTED_MODULE_1___default()(function () { fetchData(lastFetchedSeq, fetched); }); } else { // We're done, call the callback opts.complete(null, results); } }; fetchData(opts.since || 0, fetched); // Return a method to cancel this method from processing any more return { cancel: function () { opts.aborted = true; controller.abort(); } }; }; // Given a set of document/revision IDs (given by req), tets the subset of // those that do NOT correspond to revisions stored in the database. // See http://wiki.apache.org/couchdb/HttpPostRevsDiff api.revsDiff = adapterFun$$1('revsDiff', function (req, opts, callback) { // If no options were given, set the callback to be the second parameter if (typeof opts === 'function') { callback = opts; opts = {}; } // Get the missing document/revision IDs fetchJSON(genDBUrl(host, '_revs_diff'), { method: 'POST', body: JSON.stringify(req) }, callback).catch(callback); }); api._close = function (callback) { callback(); }; api._destroy = function (options, callback) { fetchJSON(genDBUrl(host, ''), {method: 'DELETE'}).then(function (json) { callback(null, json); }).catch(function (err) { /* istanbul ignore if */ if (err.status === 404) { callback(null, {ok: true}); } else { callback(err); } }); }; } // HttpPouch is a valid adapter. HttpPouch.valid = function () { return true; }; function HttpPouch$1 (PouchDB) { PouchDB.adapter('http', HttpPouch, false); PouchDB.adapter('https', HttpPouch, false); } function QueryParseError(message) { this.status = 400; this.name = 'query_parse_error'; this.message = message; this.error = true; try { Error.captureStackTrace(this, QueryParseError); } catch (e) {} } inherits__WEBPACK_IMPORTED_MODULE_3___default()(QueryParseError, Error); function NotFoundError(message) { this.status = 404; this.name = 'not_found'; this.message = message; this.error = true; try { Error.captureStackTrace(this, NotFoundError); } catch (e) {} } inherits__WEBPACK_IMPORTED_MODULE_3___default()(NotFoundError, Error); function BuiltInError(message) { this.status = 500; this.name = 'invalid_value'; this.message = message; this.error = true; try { Error.captureStackTrace(this, BuiltInError); } catch (e) {} } inherits__WEBPACK_IMPORTED_MODULE_3___default()(BuiltInError, Error); function promisedCallback(promise, callback) { if (callback) { promise.then(function (res) { immediate__WEBPACK_IMPORTED_MODULE_1___default()(function () { callback(null, res); }); }, function (reason) { immediate__WEBPACK_IMPORTED_MODULE_1___default()(function () { callback(reason); }); }); } return promise; } function callbackify(fun) { return argsarray__WEBPACK_IMPORTED_MODULE_0___default()(function (args) { var cb = args.pop(); var promise = fun.apply(this, args); if (typeof cb === 'function') { promisedCallback(promise, cb); } return promise; }); } // Promise finally util similar to Q.finally function fin(promise, finalPromiseFactory) { return promise.then(function (res) { return finalPromiseFactory().then(function () { return res; }); }, function (reason) { return finalPromiseFactory().then(function () { throw reason; }); }); } function sequentialize(queue, promiseFactory) { return function () { var args = arguments; var that = this; return queue.add(function () { return promiseFactory.apply(that, args); }); }; } // uniq an array of strings, order not guaranteed // similar to underscore/lodash _.uniq function uniq(arr) { var theSet = new ExportedSet(arr); var result = new Array(theSet.size); var index = -1; theSet.forEach(function (value) { result[++index] = value; }); return result; } function mapToKeysArray(map) { var result = new Array(map.size); var index = -1; map.forEach(function (value, key) { result[++index] = key; }); return result; } function createBuiltInError(name) { var message = 'builtin ' + name + ' function requires map values to be numbers' + ' or number arrays'; return new BuiltInError(message); } function sum(values) { var result = 0; for (var i = 0, len = values.length; i < len; i++) { var num = values[i]; if (typeof num !== 'number') { if (Array.isArray(num)) { // lists of numbers are also allowed, sum them separately result = typeof result === 'number' ? [result] : result; for (var j = 0, jLen = num.length; j < jLen; j++) { var jNum = num[j]; if (typeof jNum !== 'number') { throw createBuiltInError('_sum'); } else if (typeof result[j] === 'undefined') { result.push(jNum); } else { result[j] += jNum; } } } else { // not array/number throw createBuiltInError('_sum'); } } else if (typeof result === 'number') { result += num; } else { // add number to array result[0] += num; } } return result; } var log = guardedConsole.bind(null, 'log'); var isArray = Array.isArray; var toJSON = JSON.parse; function evalFunctionWithEval(func, emit) { return scopeEval( "return (" + func.replace(/;\s*$/, "") + ");", { emit: emit, sum: sum, log: log, isArray: isArray, toJSON: toJSON } ); } /* * Simple task queue to sequentialize actions. Assumes * callbacks will eventually fire (once). */ function TaskQueue$1() { this.promise = new Promise(function (fulfill) {fulfill(); }); } TaskQueue$1.prototype.add = function (promiseFactory) { this.promise = this.promise.catch(function () { // just recover }).then(function () { return promiseFactory(); }); return this.promise; }; TaskQueue$1.prototype.finish = function () { return this.promise; }; function stringify(input) { if (!input) { return 'undefined'; // backwards compat for empty reduce } // for backwards compat with mapreduce, functions/strings are stringified // as-is. everything else is JSON-stringified. switch (typeof input) { case 'function': // e.g. a mapreduce map return input.toString(); case 'string': // e.g. a mapreduce built-in _reduce function return input.toString(); default: // e.g. a JSON object in the case of mango queries return JSON.stringify(input); } } /* create a string signature for a view so we can cache it and uniq it */ function createViewSignature(mapFun, reduceFun) { // the "undefined" part is for backwards compatibility return stringify(mapFun) + stringify(reduceFun) + 'undefined'; } function createView(sourceDB, viewName, mapFun, reduceFun, temporary, localDocName) { var viewSignature = createViewSignature(mapFun, reduceFun); var cachedViews; if (!temporary) { // cache this to ensure we don't try to update the same view twice cachedViews = sourceDB._cachedViews = sourceDB._cachedViews || {}; if (cachedViews[viewSignature]) { return cachedViews[viewSignature]; } } var promiseForView = sourceDB.info().then(function (info) { var depDbName = info.db_name + '-mrview-' + (temporary ? 'temp' : stringMd5(viewSignature)); // save the view name in the source db so it can be cleaned up if necessary // (e.g. when the _design doc is deleted, remove all associated view data) function diffFunction(doc) { doc.views = doc.views || {}; var fullViewName = viewName; if (fullViewName.indexOf('/') === -1) { fullViewName = viewName + '/' + viewName; } var depDbs = doc.views[fullViewName] = doc.views[fullViewName] || {}; /* istanbul ignore if */ if (depDbs[depDbName]) { return; // no update necessary } depDbs[depDbName] = true; return doc; } return upsert(sourceDB, '_local/' + localDocName, diffFunction).then(function () { return sourceDB.registerDependentDatabase(depDbName).then(function (res) { var db = res.db; db.auto_compaction = true; var view = { name: depDbName, db: db, sourceDB: sourceDB, adapter: sourceDB.adapter, mapFun: mapFun, reduceFun: reduceFun }; return view.db.get('_local/lastSeq').catch(function (err) { /* istanbul ignore if */ if (err.status !== 404) { throw err; } }).then(function (lastSeqDoc) { view.seq = lastSeqDoc ? lastSeqDoc.seq : 0; if (cachedViews) { view.db.once('destroyed', function () { delete cachedViews[viewSignature]; }); } return view; }); }); }); }); if (cachedViews) { cachedViews[viewSignature] = promiseForView; } return promiseForView; } var persistentQueues = {}; var tempViewQueue = new TaskQueue$1(); var CHANGES_BATCH_SIZE$1 = 50; function parseViewName(name) { // can be either 'ddocname/viewname' or just 'viewname' // (where the ddoc name is the same) return name.indexOf('/') === -1 ? [name, name] : name.split('/'); } function isGenOne(changes) { // only return true if the current change is 1- // and there are no other leafs return changes.length === 1 && /^1-/.test(changes[0].rev); } function emitError(db, e) { try { db.emit('error', e); } catch (err) { guardedConsole('error', 'The user\'s map/reduce function threw an uncaught error.\n' + 'You can debug this error by doing:\n' + 'myDatabase.on(\'error\', function (err) { debugger; });\n' + 'Please double-check your map/reduce function.'); guardedConsole('error', e); } } /** * Returns an "abstract" mapreduce object of the form: * * { * query: queryFun, * viewCleanup: viewCleanupFun * } * * Arguments are: * * localDoc: string * This is for the local doc that gets saved in order to track the * "dependent" DBs and clean them up for viewCleanup. It should be * unique, so that indexer plugins don't collide with each other. * mapper: function (mapFunDef, emit) * Returns a map function based on the mapFunDef, which in the case of * normal map/reduce is just the de-stringified function, but may be * something else, such as an object in the case of pouchdb-find. * reducer: function (reduceFunDef) * Ditto, but for reducing. Modules don't have to support reducing * (e.g. pouchdb-find). * ddocValidator: function (ddoc, viewName) * Throws an error if the ddoc or viewName is not valid. * This could be a way to communicate to the user that the configuration for the * indexer is invalid. */ function createAbstractMapReduce(localDocName, mapper, reducer, ddocValidator) { function tryMap(db, fun, doc) { // emit an event if there was an error thrown by a map function. // putting try/catches in a single function also avoids deoptimizations. try { fun(doc); } catch (e) { emitError(db, e); } } function tryReduce(db, fun, keys, values, rereduce) { // same as above, but returning the result or an error. there are two separate // functions to avoid extra memory allocations since the tryCode() case is used // for custom map functions (common) vs this function, which is only used for // custom reduce functions (rare) try { return {output : fun(keys, values, rereduce)}; } catch (e) { emitError(db, e); return {error: e}; } } function sortByKeyThenValue(x, y) { var keyCompare = collate(x.key, y.key); return keyCompare !== 0 ? keyCompare : collate(x.value, y.value); } function sliceResults(results, limit, skip) { skip = skip || 0; if (typeof limit === 'number') { return results.slice(skip, limit + skip); } else if (skip > 0) { return results.slice(skip); } return results; } function rowToDocId(row) { var val = row.value; // Users can explicitly specify a joined doc _id, or it // defaults to the doc _id that emitted the key/value. var docId = (val && typeof val === 'object' && val._id) || row.id; return docId; } function readAttachmentsAsBlobOrBuffer(res) { res.rows.forEach(function (row) { var atts = row.doc && row.doc._attachments; if (!atts) { return; } Object.keys(atts).forEach(function (filename) { var att = atts[filename]; atts[filename].data = b64ToBluffer(att.data, att.content_type); }); }); } function postprocessAttachments(opts) { return function (res) { if (opts.include_docs && opts.attachments && opts.binary) { readAttachmentsAsBlobOrBuffer(res); } return res; }; } function addHttpParam(paramName, opts, params, asJson) { // add an http param from opts to params, optionally json-encoded var val = opts[paramName]; if (typeof val !== 'undefined') { if (asJson) { val = encodeURIComponent(JSON.stringify(val)); } params.push(paramName + '=' + val); } } function coerceInteger(integerCandidate) { if (typeof integerCandidate !== 'undefined') { var asNumber = Number(integerCandidate); // prevents e.g. '1foo' or '1.1' being coerced to 1 if (!isNaN(asNumber) && asNumber === parseInt(integerCandidate, 10)) { return asNumber; } else { return integerCandidate; } } } function coerceOptions(opts) { opts.group_level = coerceInteger(opts.group_level); opts.limit = coerceInteger(opts.limit); opts.skip = coerceInteger(opts.skip); return opts; } function checkPositiveInteger(number) { if (number) { if (typeof number !== 'number') { return new QueryParseError('Invalid value for integer: "' + number + '"'); } if (number < 0) { return new QueryParseError('Invalid value for positive integer: ' + '"' + number + '"'); } } } function checkQueryParseError(options, fun) { var startkeyName = options.descending ? 'endkey' : 'startkey'; var endkeyName = options.descending ? 'startkey' : 'endkey'; if (typeof options[startkeyName] !== 'undefined' && typeof options[endkeyName] !== 'undefined' && collate(options[startkeyName], options[endkeyName]) > 0) { throw new QueryParseError('No rows can match your key range, ' + 'reverse your start_key and end_key or set {descending : true}'); } else if (fun.reduce && options.reduce !== false) { if (options.include_docs) { throw new QueryParseError('{include_docs:true} is invalid for reduce'); } else if (options.keys && options.keys.length > 1 && !options.group && !options.group_level) { throw new QueryParseError('Multi-key fetches for reduce views must use ' + '{group: true}'); } } ['group_level', 'limit', 'skip'].forEach(function (optionName) { var error = checkPositiveInteger(options[optionName]); if (error) { throw error; } }); } function httpQuery(db, fun, opts) { // List of parameters to add to the PUT request var params = []; var body; var method = 'GET'; var ok, status; // If opts.reduce exists and is defined, then add it to the list // of parameters. // If reduce=false then the results are that of only the map function // not the final result of map and reduce. addHttpParam('reduce', opts, params); addHttpParam('include_docs', opts, params); addHttpParam('attachments', opts, params); addHttpParam('limit', opts, params); addHttpParam('descending', opts, params); addHttpParam('group', opts, params); addHttpParam('group_level', opts, params); addHttpParam('skip', opts, params); addHttpParam('stale', opts, params); addHttpParam('conflicts', opts, params); addHttpParam('startkey', opts, params, true); addHttpParam('start_key', opts, params, true); addHttpParam('endkey', opts, params, true); addHttpParam('end_key', opts, params, true); addHttpParam('inclusive_end', opts, params); addHttpParam('key', opts, params, true); addHttpParam('update_seq', opts, params); // Format the list of parameters into a valid URI query string params = params.join('&'); params = params === '' ? '' : '?' + params; // If keys are supplied, issue a POST to circumvent GET query string limits // see http://wiki.apache.org/couchdb/HTTP_view_API#Querying_Options if (typeof opts.keys !== 'undefined') { var MAX_URL_LENGTH = 2000; // according to http://stackoverflow.com/a/417184/680742, // the de facto URL length limit is 2000 characters var keysAsString = 'keys=' + encodeURIComponent(JSON.stringify(opts.keys)); if (keysAsString.length + params.length + 1 <= MAX_URL_LENGTH) { // If the keys are short enough, do a GET. we do this to work around // Safari not understanding 304s on POSTs (see pouchdb/pouchdb#1239) params += (params[0] === '?' ? '&' : '?') + keysAsString; } else { method = 'POST'; if (typeof fun === 'string') { body = {keys: opts.keys}; } else { // fun is {map : mapfun}, so append to this fun.keys = opts.keys; } } } // We are referencing a query defined in the design doc if (typeof fun === 'string') { var parts = parseViewName(fun); return db.fetch('_design/' + parts[0] + '/_view/' + parts[1] + params, { headers: new h({'Content-Type': 'application/json'}), method: method, body: JSON.stringify(body) }).then(function (response) { ok = response.ok; status = response.status; return response.json(); }).then(function (result) { if (!ok) { result.status = status; throw generateErrorFromResponse(result); } // fail the entire request if the result contains an error result.rows.forEach(function (row) { /* istanbul ignore if */ if (row.value && row.value.error && row.value.error === "builtin_reduce_error") { throw new Error(row.reason); } }); return result; }).then(postprocessAttachments(opts)); } // We are using a temporary view, terrible for performance, good for testing body = body || {}; Object.keys(fun).forEach(function (key) { if (Array.isArray(fun[key])) { body[key] = fun[key]; } else { body[key] = fun[key].toString(); } }); return db.fetch('_temp_view' + params, { headers: new h({'Content-Type': 'application/json'}), method: 'POST', body: JSON.stringify(body) }).then(function (response) { ok = response.ok; status = response.status; return response.json(); }).then(function (result) { if (!ok) { result.status = status; throw generateErrorFromResponse(result); } return result; }).then(postprocessAttachments(opts)); } // custom adapters can define their own api._query // and override the default behavior /* istanbul ignore next */ function customQuery(db, fun, opts) { return new Promise(function (resolve, reject) { db._query(fun, opts, function (err, res) { if (err) { return reject(err); } resolve(res); }); }); } // custom adapters can define their own api._viewCleanup // and override the default behavior /* istanbul ignore next */ function customViewCleanup(db) { return new Promise(function (resolve, reject) { db._viewCleanup(function (err, res) { if (err) { return reject(err); } resolve(res); }); }); } function defaultsTo(value) { return function (reason) { /* istanbul ignore else */ if (reason.status === 404) { return value; } else { throw reason; } }; } // returns a promise for a list of docs to update, based on the input docId. // the order doesn't matter, because post-3.2.0, bulkDocs // is an atomic operation in all three adapters. function getDocsToPersist(docId, view, docIdsToChangesAndEmits) { var metaDocId = '_local/doc_' + docId; var defaultMetaDoc = {_id: metaDocId, keys: []}; var docData = docIdsToChangesAndEmits.get(docId); var indexableKeysToKeyValues = docData[0]; var changes = docData[1]; function getMetaDoc() { if (isGenOne(changes)) { // generation 1, so we can safely assume initial state // for performance reasons (avoids unnecessary GETs) return Promise.resolve(defaultMetaDoc); } return view.db.get(metaDocId).catch(defaultsTo(defaultMetaDoc)); } function getKeyValueDocs(metaDoc) { if (!metaDoc.keys.length) { // no keys, no need for a lookup return Promise.resolve({rows: []}); } return view.db.allDocs({ keys: metaDoc.keys, include_docs: true }); } function processKeyValueDocs(metaDoc, kvDocsRes) { var kvDocs = []; var oldKeys = new ExportedSet(); for (var i = 0, len = kvDocsRes.rows.length; i < len; i++) { var row = kvDocsRes.rows[i]; var doc = row.doc; if (!doc) { // deleted continue; } kvDocs.push(doc); oldKeys.add(doc._id); doc._deleted = !indexableKeysToKeyValues.has(doc._id); if (!doc._deleted) { var keyValue = indexableKeysToKeyValues.get(doc._id); if ('value' in keyValue) { doc.value = keyValue.value; } } } var newKeys = mapToKeysArray(indexableKeysToKeyValues); newKeys.forEach(function (key) { if (!oldKeys.has(key)) { // new doc var kvDoc = { _id: key }; var keyValue = indexableKeysToKeyValues.get(key); if ('value' in keyValue) { kvDoc.value = keyValue.value; } kvDocs.push(kvDoc); } }); metaDoc.keys = uniq(newKeys.concat(metaDoc.keys)); kvDocs.push(metaDoc); return kvDocs; } return getMetaDoc().then(function (metaDoc) { return getKeyValueDocs(metaDoc).then(function (kvDocsRes) { return processKeyValueDocs(metaDoc, kvDocsRes); }); }); } // updates all emitted key/value docs and metaDocs in the mrview database // for the given batch of documents from the source database function saveKeyValues(view, docIdsToChangesAndEmits, seq) { var seqDocId = '_local/lastSeq'; return view.db.get(seqDocId) .catch(defaultsTo({_id: seqDocId, seq: 0})) .then(function (lastSeqDoc) { var docIds = mapToKeysArray(docIdsToChangesAndEmits); return Promise.all(docIds.map(function (docId) { return getDocsToPersist(docId, view, docIdsToChangesAndEmits); })).then(function (listOfDocsToPersist) { var docsToPersist = flatten(listOfDocsToPersist); lastSeqDoc.seq = seq; docsToPersist.push(lastSeqDoc); // write all docs in a single operation, update the seq once return view.db.bulkDocs({docs : docsToPersist}); }); }); } function getQueue(view) { var viewName = typeof view === 'string' ? view : view.name; var queue = persistentQueues[viewName]; if (!queue) { queue = persistentQueues[viewName] = new TaskQueue$1(); } return queue; } function updateView(view) { return sequentialize(getQueue(view), function () { return updateViewInQueue(view); })(); } function updateViewInQueue(view) { // bind the emit function once var mapResults; var doc; function emit(key, value) { var output = {id: doc._id, key: normalizeKey(key)}; // Don't explicitly store the value unless it's defined and non-null. // This saves on storage space, because often people don't use it. if (typeof value !== 'undefined' && value !== null) { output.value = normalizeKey(value); } mapResults.push(output); } var mapFun = mapper(view.mapFun, emit); var currentSeq = view.seq || 0; function processChange(docIdsToChangesAndEmits, seq) { return function () { return saveKeyValues(view, docIdsToChangesAndEmits, seq); }; } var queue = new TaskQueue$1(); function processNextBatch() { return view.sourceDB.changes({ return_docs: true, conflicts: true, include_docs: true, style: 'all_docs', since: currentSeq, limit: CHANGES_BATCH_SIZE$1 }).then(processBatch); } function processBatch(response) { var results = response.results; if (!results.length) { return; } var docIdsToChangesAndEmits = createDocIdsToChangesAndEmits(results); queue.add(processChange(docIdsToChangesAndEmits, currentSeq)); if (results.length < CHANGES_BATCH_SIZE$1) { return; } return processNextBatch(); } function createDocIdsToChangesAndEmits(results) { var docIdsToChangesAndEmits = new ExportedMap(); for (var i = 0, len = results.length; i < len; i++) { var change = results[i]; if (change.doc._id[0] !== '_') { mapResults = []; doc = change.doc; if (!doc._deleted) { tryMap(view.sourceDB, mapFun, doc); } mapResults.sort(sortByKeyThenValue); var indexableKeysToKeyValues = createIndexableKeysToKeyValues(mapResults); docIdsToChangesAndEmits.set(change.doc._id, [ indexableKeysToKeyValues, change.changes ]); } currentSeq = change.seq; } return docIdsToChangesAndEmits; } function createIndexableKeysToKeyValues(mapResults) { var indexableKeysToKeyValues = new ExportedMap(); var lastKey; for (var i = 0, len = mapResults.length; i < len; i++) { var emittedKeyValue = mapResults[i]; var complexKey = [emittedKeyValue.key, emittedKeyValue.id]; if (i > 0 && collate(emittedKeyValue.key, lastKey) === 0) { complexKey.push(i); // dup key+id, so make it unique } indexableKeysToKeyValues.set(toIndexableString(complexKey), emittedKeyValue); lastKey = emittedKeyValue.key; } return indexableKeysToKeyValues; } return processNextBatch().then(function () { return queue.finish(); }).then(function () { view.seq = currentSeq; }); } function reduceView(view, results, options) { if (options.group_level === 0) { delete options.group_level; } var shouldGroup = options.group || options.group_level; var reduceFun = reducer(view.reduceFun); var groups = []; var lvl = isNaN(options.group_level) ? Number.POSITIVE_INFINITY : options.group_level; results.forEach(function (e) { var last = groups[groups.length - 1]; var groupKey = shouldGroup ? e.key : null; // only set group_level for array keys if (shouldGroup && Array.isArray(groupKey)) { groupKey = groupKey.slice(0, lvl); } if (last && collate(last.groupKey, groupKey) === 0) { last.keys.push([e.key, e.id]); last.values.push(e.value); return; } groups.push({ keys: [[e.key, e.id]], values: [e.value], groupKey: groupKey }); }); results = []; for (var i = 0, len = groups.length; i < len; i++) { var e = groups[i]; var reduceTry = tryReduce(view.sourceDB, reduceFun, e.keys, e.values, false); if (reduceTry.error && reduceTry.error instanceof BuiltInError) { // CouchDB returns an error if a built-in errors out throw reduceTry.error; } results.push({ // CouchDB just sets the value to null if a non-built-in errors out value: reduceTry.error ? null : reduceTry.output, key: e.groupKey }); } // no total_rows/offset when reducing return {rows: sliceResults(results, options.limit, options.skip)}; } function queryView(view, opts) { return sequentialize(getQueue(view), function () { return queryViewInQueue(view, opts); })(); } function queryViewInQueue(view, opts) { var totalRows; var shouldReduce = view.reduceFun && opts.reduce !== false; var skip = opts.skip || 0; if (typeof opts.keys !== 'undefined' && !opts.keys.length) { // equivalent query opts.limit = 0; delete opts.keys; } function fetchFromView(viewOpts) { viewOpts.include_docs = true; return view.db.allDocs(viewOpts).then(function (res) { totalRows = res.total_rows; return res.rows.map(function (result) { // implicit migration - in older versions of PouchDB, // we explicitly stored the doc as {id: ..., key: ..., value: ...} // this is tested in a migration test /* istanbul ignore next */ if ('value' in result.doc && typeof result.doc.value === 'object' && result.doc.value !== null) { var keys = Object.keys(result.doc.value).sort(); // this detection method is not perfect, but it's unlikely the user // emitted a value which was an object with these 3 exact keys var expectedKeys = ['id', 'key', 'value']; if (!(keys < expectedKeys || keys > expectedKeys)) { return result.doc.value; } } var parsedKeyAndDocId = parseIndexableString(result.doc._id); return { key: parsedKeyAndDocId[0], id: parsedKeyAndDocId[1], value: ('value' in result.doc ? result.doc.value : null) }; }); }); } function onMapResultsReady(rows) { var finalResults; if (shouldReduce) { finalResults = reduceView(view, rows, opts); } else { finalResults = { total_rows: totalRows, offset: skip, rows: rows }; } /* istanbul ignore if */ if (opts.update_seq) { finalResults.update_seq = view.seq; } if (opts.include_docs) { var docIds = uniq(rows.map(rowToDocId)); return view.sourceDB.allDocs({ keys: docIds, include_docs: true, conflicts: opts.conflicts, attachments: opts.attachments, binary: opts.binary }).then(function (allDocsRes) { var docIdsToDocs = new ExportedMap(); allDocsRes.rows.forEach(function (row) { docIdsToDocs.set(row.id, row.doc); }); rows.forEach(function (row) { var docId = rowToDocId(row); var doc = docIdsToDocs.get(docId); if (doc) { row.doc = doc; } }); return finalResults; }); } else { return finalResults; } } if (typeof opts.keys !== 'undefined') { var keys = opts.keys; var fetchPromises = keys.map(function (key) { var viewOpts = { startkey : toIndexableString([key]), endkey : toIndexableString([key, {}]) }; /* istanbul ignore if */ if (opts.update_seq) { viewOpts.update_seq = true; } return fetchFromView(viewOpts); }); return Promise.all(fetchPromises).then(flatten).then(onMapResultsReady); } else { // normal query, no 'keys' var viewOpts = { descending : opts.descending }; /* istanbul ignore if */ if (opts.update_seq) { viewOpts.update_seq = true; } var startkey; var endkey; if ('start_key' in opts) { startkey = opts.start_key; } if ('startkey' in opts) { startkey = opts.startkey; } if ('end_key' in opts) { endkey = opts.end_key; } if ('endkey' in opts) { endkey = opts.endkey; } if (typeof startkey !== 'undefined') { viewOpts.startkey = opts.descending ? toIndexableString([startkey, {}]) : toIndexableString([startkey]); } if (typeof endkey !== 'undefined') { var inclusiveEnd = opts.inclusive_end !== false; if (opts.descending) { inclusiveEnd = !inclusiveEnd; } viewOpts.endkey = toIndexableString( inclusiveEnd ? [endkey, {}] : [endkey]); } if (typeof opts.key !== 'undefined') { var keyStart = toIndexableString([opts.key]); var keyEnd = toIndexableString([opts.key, {}]); if (viewOpts.descending) { viewOpts.endkey = keyStart; viewOpts.startkey = keyEnd; } else { viewOpts.startkey = keyStart; viewOpts.endkey = keyEnd; } } if (!shouldReduce) { if (typeof opts.limit === 'number') { viewOpts.limit = opts.limit; } viewOpts.skip = skip; } return fetchFromView(viewOpts).then(onMapResultsReady); } } function httpViewCleanup(db) { return db.fetch('_view_cleanup', { headers: new h({'Content-Type': 'application/json'}), method: 'POST' }).then(function (response) { return response.json(); }); } function localViewCleanup(db) { return db.get('_local/' + localDocName).then(function (metaDoc) { var docsToViews = new ExportedMap(); Object.keys(metaDoc.views).forEach(function (fullViewName) { var parts = parseViewName(fullViewName); var designDocName = '_design/' + parts[0]; var viewName = parts[1]; var views = docsToViews.get(designDocName); if (!views) { views = new ExportedSet(); docsToViews.set(designDocName, views); } views.add(viewName); }); var opts = { keys : mapToKeysArray(docsToViews), include_docs : true }; return db.allDocs(opts).then(function (res) { var viewsToStatus = {}; res.rows.forEach(function (row) { var ddocName = row.key.substring(8); // cuts off '_design/' docsToViews.get(row.key).forEach(function (viewName) { var fullViewName = ddocName + '/' + viewName; /* istanbul ignore if */ if (!metaDoc.views[fullViewName]) { // new format, without slashes, to support PouchDB 2.2.0 // migration test in pouchdb's browser.migration.js verifies this fullViewName = viewName; } var viewDBNames = Object.keys(metaDoc.views[fullViewName]); // design doc deleted, or view function nonexistent var statusIsGood = row.doc && row.doc.views && row.doc.views[viewName]; viewDBNames.forEach(function (viewDBName) { viewsToStatus[viewDBName] = viewsToStatus[viewDBName] || statusIsGood; }); }); }); var dbsToDelete = Object.keys(viewsToStatus).filter( function (viewDBName) { return !viewsToStatus[viewDBName]; }); var destroyPromises = dbsToDelete.map(function (viewDBName) { return sequentialize(getQueue(viewDBName), function () { return new db.constructor(viewDBName, db.__opts).destroy(); })(); }); return Promise.all(destroyPromises).then(function () { return {ok: true}; }); }); }, defaultsTo({ok: true})); } function queryPromised(db, fun, opts) { /* istanbul ignore next */ if (typeof db._query === 'function') { return customQuery(db, fun, opts); } if (isRemote(db)) { return httpQuery(db, fun, opts); } if (typeof fun !== 'string') { // temp_view checkQueryParseError(opts, fun); tempViewQueue.add(function () { var createViewPromise = createView( /* sourceDB */ db, /* viewName */ 'temp_view/temp_view', /* mapFun */ fun.map, /* reduceFun */ fun.reduce, /* temporary */ true, /* localDocName */ localDocName); return createViewPromise.then(function (view) { return fin(updateView(view).then(function () { return queryView(view, opts); }), function () { return view.db.destroy(); }); }); }); return tempViewQueue.finish(); } else { // persistent view var fullViewName = fun; var parts = parseViewName(fullViewName); var designDocName = parts[0]; var viewName = parts[1]; return db.get('_design/' + designDocName).then(function (doc) { var fun = doc.views && doc.views[viewName]; if (!fun) { // basic validator; it's assumed that every subclass would want this throw new NotFoundError('ddoc ' + doc._id + ' has no view named ' + viewName); } ddocValidator(doc, viewName); checkQueryParseError(opts, fun); var createViewPromise = createView( /* sourceDB */ db, /* viewName */ fullViewName, /* mapFun */ fun.map, /* reduceFun */ fun.reduce, /* temporary */ false, /* localDocName */ localDocName); return createViewPromise.then(function (view) { if (opts.stale === 'ok' || opts.stale === 'update_after') { if (opts.stale === 'update_after') { immediate__WEBPACK_IMPORTED_MODULE_1___default()(function () { updateView(view); }); } return queryView(view, opts); } else { // stale not ok return updateView(view).then(function () { return queryView(view, opts); }); } }); }); } } function abstractQuery(fun, opts, callback) { var db = this; if (typeof opts === 'function') { callback = opts; opts = {}; } opts = opts ? coerceOptions(opts) : {}; if (typeof fun === 'function') { fun = {map : fun}; } var promise = Promise.resolve().then(function () { return queryPromised(db, fun, opts); }); promisedCallback(promise, callback); return promise; } var abstractViewCleanup = callbackify(function () { var db = this; /* istanbul ignore next */ if (typeof db._viewCleanup === 'function') { return customViewCleanup(db); } if (isRemote(db)) { return httpViewCleanup(db); } return localViewCleanup(db); }); return { query: abstractQuery, viewCleanup: abstractViewCleanup }; } var builtInReduce = { _sum: function (keys, values) { return sum(values); }, _count: function (keys, values) { return values.length; }, _stats: function (keys, values) { // no need to implement rereduce=true, because Pouch // will never call it function sumsqr(values) { var _sumsqr = 0; for (var i = 0, len = values.length; i < len; i++) { var num = values[i]; _sumsqr += (num * num); } return _sumsqr; } return { sum : sum(values), min : Math.min.apply(null, values), max : Math.max.apply(null, values), count : values.length, sumsqr : sumsqr(values) }; } }; function getBuiltIn(reduceFunString) { if (/^_sum/.test(reduceFunString)) { return builtInReduce._sum; } else if (/^_count/.test(reduceFunString)) { return builtInReduce._count; } else if (/^_stats/.test(reduceFunString)) { return builtInReduce._stats; } else if (/^_/.test(reduceFunString)) { throw new Error(reduceFunString + ' is not a supported reduce function.'); } } function mapper(mapFun, emit) { // for temp_views one can use emit(doc, emit), see #38 if (typeof mapFun === "function" && mapFun.length === 2) { var origMap = mapFun; return function (doc) { return origMap(doc, emit); }; } else { return evalFunctionWithEval(mapFun.toString(), emit); } } function reducer(reduceFun) { var reduceFunString = reduceFun.toString(); var builtIn = getBuiltIn(reduceFunString); if (builtIn) { return builtIn; } else { return evalFunctionWithEval(reduceFunString); } } function ddocValidator(ddoc, viewName) { var fun = ddoc.views && ddoc.views[viewName]; if (typeof fun.map !== 'string') { throw new NotFoundError('ddoc ' + ddoc._id + ' has no string view named ' + viewName + ', instead found object of type: ' + typeof fun.map); } } var localDocName = 'mrviews'; var abstract = createAbstractMapReduce(localDocName, mapper, reducer, ddocValidator); function query(fun, opts, callback) { return abstract.query.call(this, fun, opts, callback); } function viewCleanup(callback) { return abstract.viewCleanup.call(this, callback); } var mapreduce = { query: query, viewCleanup: viewCleanup }; function isGenOne$1(rev) { return /^1-/.test(rev); } function fileHasChanged(localDoc, remoteDoc, filename) { return !localDoc._attachments || !localDoc._attachments[filename] || localDoc._attachments[filename].digest !== remoteDoc._attachments[filename].digest; } function getDocAttachments(db, doc) { var filenames = Object.keys(doc._attachments); return Promise.all(filenames.map(function (filename) { return db.getAttachment(doc._id, filename, {rev: doc._rev}); })); } function getDocAttachmentsFromTargetOrSource(target, src, doc) { var doCheckForLocalAttachments = isRemote(src) && !isRemote(target); var filenames = Object.keys(doc._attachments); if (!doCheckForLocalAttachments) { return getDocAttachments(src, doc); } return target.get(doc._id).then(function (localDoc) { return Promise.all(filenames.map(function (filename) { if (fileHasChanged(localDoc, doc, filename)) { return src.getAttachment(doc._id, filename); } return target.getAttachment(localDoc._id, filename); })); }).catch(function (error) { /* istanbul ignore if */ if (error.status !== 404) { throw error; } return getDocAttachments(src, doc); }); } function createBulkGetOpts(diffs) { var requests = []; Object.keys(diffs).forEach(function (id) { var missingRevs = diffs[id].missing; missingRevs.forEach(function (missingRev) { requests.push({ id: id, rev: missingRev }); }); }); return { docs: requests, revs: true, latest: true }; } // // Fetch all the documents from the src as described in the "diffs", // which is a mapping of docs IDs to revisions. If the state ever // changes to "cancelled", then the returned promise will be rejected. // Else it will be resolved with a list of fetched documents. // function getDocs(src, target, diffs, state) { diffs = clone(diffs); // we do not need to modify this var resultDocs = [], ok = true; function getAllDocs() { var bulkGetOpts = createBulkGetOpts(diffs); if (!bulkGetOpts.docs.length) { // optimization: skip empty requests return; } return src.bulkGet(bulkGetOpts).then(function (bulkGetResponse) { /* istanbul ignore if */ if (state.cancelled) { throw new Error('cancelled'); } return Promise.all(bulkGetResponse.results.map(function (bulkGetInfo) { return Promise.all(bulkGetInfo.docs.map(function (doc) { var remoteDoc = doc.ok; if (doc.error) { // when AUTO_COMPACTION is set, docs can be returned which look // like this: {"missing":"1-7c3ac256b693c462af8442f992b83696"} ok = false; } if (!remoteDoc || !remoteDoc._attachments) { return remoteDoc; } return getDocAttachmentsFromTargetOrSource(target, src, remoteDoc) .then(function (attachments) { var filenames = Object.keys(remoteDoc._attachments); attachments .forEach(function (attachment, i) { var att = remoteDoc._attachments[filenames[i]]; delete att.stub; delete att.length; att.data = attachment; }); return remoteDoc; }); })); })) .then(function (results) { resultDocs = resultDocs.concat(flatten(results).filter(Boolean)); }); }); } function hasAttachments(doc) { return doc._attachments && Object.keys(doc._attachments).length > 0; } function hasConflicts(doc) { return doc._conflicts && doc._conflicts.length > 0; } function fetchRevisionOneDocs(ids) { // Optimization: fetch gen-1 docs and attachments in // a single request using _all_docs return src.allDocs({ keys: ids, include_docs: true, conflicts: true }).then(function (res) { if (state.cancelled) { throw new Error('cancelled'); } res.rows.forEach(function (row) { if (row.deleted || !row.doc || !isGenOne$1(row.value.rev) || hasAttachments(row.doc) || hasConflicts(row.doc)) { // if any of these conditions apply, we need to fetch using get() return; } // strip _conflicts array to appease CSG (#5793) /* istanbul ignore if */ if (row.doc._conflicts) { delete row.doc._conflicts; } // the doc we got back from allDocs() is sufficient resultDocs.push(row.doc); delete diffs[row.id]; }); }); } function getRevisionOneDocs() { // filter out the generation 1 docs and get them // leaving the non-generation one docs to be got otherwise var ids = Object.keys(diffs).filter(function (id) { var missing = diffs[id].missing; return missing.length === 1 && isGenOne$1(missing[0]); }); if (ids.length > 0) { return fetchRevisionOneDocs(ids); } } function returnResult() { return { ok:ok, docs:resultDocs }; } return Promise.resolve() .then(getRevisionOneDocs) .then(getAllDocs) .then(returnResult); } var CHECKPOINT_VERSION = 1; var REPLICATOR = "pouchdb"; // This is an arbitrary number to limit the // amount of replication history we save in the checkpoint. // If we save too much, the checkpoing docs will become very big, // if we save fewer, we'll run a greater risk of having to // read all the changes from 0 when checkpoint PUTs fail // CouchDB 2.0 has a more involved history pruning, // but let's go for the simple version for now. var CHECKPOINT_HISTORY_SIZE = 5; var LOWEST_SEQ = 0; function updateCheckpoint(db, id, checkpoint, session, returnValue) { return db.get(id).catch(function (err) { if (err.status === 404) { if (db.adapter === 'http' || db.adapter === 'https') { explainError( 404, 'PouchDB is just checking if a remote checkpoint exists.' ); } return { session_id: session, _id: id, history: [], replicator: REPLICATOR, version: CHECKPOINT_VERSION }; } throw err; }).then(function (doc) { if (returnValue.cancelled) { return; } // if the checkpoint has not changed, do not update if (doc.last_seq === checkpoint) { return; } // Filter out current entry for this replication doc.history = (doc.history || []).filter(function (item) { return item.session_id !== session; }); // Add the latest checkpoint to history doc.history.unshift({ last_seq: checkpoint, session_id: session }); // Just take the last pieces in history, to // avoid really big checkpoint docs. // see comment on history size above doc.history = doc.history.slice(0, CHECKPOINT_HISTORY_SIZE); doc.version = CHECKPOINT_VERSION; doc.replicator = REPLICATOR; doc.session_id = session; doc.last_seq = checkpoint; return db.put(doc).catch(function (err) { if (err.status === 409) { // retry; someone is trying to write a checkpoint simultaneously return updateCheckpoint(db, id, checkpoint, session, returnValue); } throw err; }); }); } function Checkpointer(src, target, id, returnValue, opts) { this.src = src; this.target = target; this.id = id; this.returnValue = returnValue; this.opts = opts || {}; } Checkpointer.prototype.writeCheckpoint = function (checkpoint, session) { var self = this; return this.updateTarget(checkpoint, session).then(function () { return self.updateSource(checkpoint, session); }); }; Checkpointer.prototype.updateTarget = function (checkpoint, session) { if (this.opts.writeTargetCheckpoint) { return updateCheckpoint(this.target, this.id, checkpoint, session, this.returnValue); } else { return Promise.resolve(true); } }; Checkpointer.prototype.updateSource = function (checkpoint, session) { if (this.opts.writeSourceCheckpoint) { var self = this; return updateCheckpoint(this.src, this.id, checkpoint, session, this.returnValue) .catch(function (err) { if (isForbiddenError(err)) { self.opts.writeSourceCheckpoint = false; return true; } throw err; }); } else { return Promise.resolve(true); } }; var comparisons = { "undefined": function (targetDoc, sourceDoc) { // This is the previous comparison function if (collate(targetDoc.last_seq, sourceDoc.last_seq) === 0) { return sourceDoc.last_seq; } /* istanbul ignore next */ return 0; }, "1": function (targetDoc, sourceDoc) { // This is the comparison function ported from CouchDB return compareReplicationLogs(sourceDoc, targetDoc).last_seq; } }; Checkpointer.prototype.getCheckpoint = function () { var self = this; if (self.opts && self.opts.writeSourceCheckpoint && !self.opts.writeTargetCheckpoint) { return self.src.get(self.id).then(function (sourceDoc) { return sourceDoc.last_seq || LOWEST_SEQ; }).catch(function (err) { /* istanbul ignore if */ if (err.status !== 404) { throw err; } return LOWEST_SEQ; }); } return self.target.get(self.id).then(function (targetDoc) { if (self.opts && self.opts.writeTargetCheckpoint && !self.opts.writeSourceCheckpoint) { return targetDoc.last_seq || LOWEST_SEQ; } return self.src.get(self.id).then(function (sourceDoc) { // Since we can't migrate an old version doc to a new one // (no session id), we just go with the lowest seq in this case /* istanbul ignore if */ if (targetDoc.version !== sourceDoc.version) { return LOWEST_SEQ; } var version; if (targetDoc.version) { version = targetDoc.version.toString(); } else { version = "undefined"; } if (version in comparisons) { return comparisons[version](targetDoc, sourceDoc); } /* istanbul ignore next */ return LOWEST_SEQ; }, function (err) { if (err.status === 404 && targetDoc.last_seq) { return self.src.put({ _id: self.id, last_seq: LOWEST_SEQ }).then(function () { return LOWEST_SEQ; }, function (err) { if (isForbiddenError(err)) { self.opts.writeSourceCheckpoint = false; return targetDoc.last_seq; } /* istanbul ignore next */ return LOWEST_SEQ; }); } throw err; }); }).catch(function (err) { if (err.status !== 404) { throw err; } return LOWEST_SEQ; }); }; // This checkpoint comparison is ported from CouchDBs source // they come from here: // https://github.com/apache/couchdb-couch-replicator/blob/master/src/couch_replicator.erl#L863-L906 function compareReplicationLogs(srcDoc, tgtDoc) { if (srcDoc.session_id === tgtDoc.session_id) { return { last_seq: srcDoc.last_seq, history: srcDoc.history }; } return compareReplicationHistory(srcDoc.history, tgtDoc.history); } function compareReplicationHistory(sourceHistory, targetHistory) { // the erlang loop via function arguments is not so easy to repeat in JS // therefore, doing this as recursion var S = sourceHistory[0]; var sourceRest = sourceHistory.slice(1); var T = targetHistory[0]; var targetRest = targetHistory.slice(1); if (!S || targetHistory.length === 0) { return { last_seq: LOWEST_SEQ, history: [] }; } var sourceId = S.session_id; /* istanbul ignore if */ if (hasSessionId(sourceId, targetHistory)) { return { last_seq: S.last_seq, history: sourceHistory }; } var targetId = T.session_id; if (hasSessionId(targetId, sourceRest)) { return { last_seq: T.last_seq, history: targetRest }; } return compareReplicationHistory(sourceRest, targetRest); } function hasSessionId(sessionId, history) { var props = history[0]; var rest = history.slice(1); if (!sessionId || history.length === 0) { return false; } if (sessionId === props.session_id) { return true; } return hasSessionId(sessionId, rest); } function isForbiddenError(err) { return typeof err.status === 'number' && Math.floor(err.status / 100) === 4; } var STARTING_BACK_OFF = 0; function backOff(opts, returnValue, error, callback) { if (opts.retry === false) { returnValue.emit('error', error); returnValue.removeAllListeners(); return; } /* istanbul ignore if */ if (typeof opts.back_off_function !== 'function') { opts.back_off_function = defaultBackOff; } returnValue.emit('requestError', error); if (returnValue.state === 'active' || returnValue.state === 'pending') { returnValue.emit('paused', error); returnValue.state = 'stopped'; var backOffSet = function backoffTimeSet() { opts.current_back_off = STARTING_BACK_OFF; }; var removeBackOffSetter = function removeBackOffTimeSet() { returnValue.removeListener('active', backOffSet); }; returnValue.once('paused', removeBackOffSetter); returnValue.once('active', backOffSet); } opts.current_back_off = opts.current_back_off || STARTING_BACK_OFF; opts.current_back_off = opts.back_off_function(opts.current_back_off); setTimeout(callback, opts.current_back_off); } function sortObjectPropertiesByKey(queryParams) { return Object.keys(queryParams).sort(collate).reduce(function (result, key) { result[key] = queryParams[key]; return result; }, {}); } // Generate a unique id particular to this replication. // Not guaranteed to align perfectly with CouchDB's rep ids. function generateReplicationId(src, target, opts) { var docIds = opts.doc_ids ? opts.doc_ids.sort(collate) : ''; var filterFun = opts.filter ? opts.filter.toString() : ''; var queryParams = ''; var filterViewName = ''; var selector = ''; // possibility for checkpoints to be lost here as behaviour of // JSON.stringify is not stable (see #6226) /* istanbul ignore if */ if (opts.selector) { selector = JSON.stringify(opts.selector); } if (opts.filter && opts.query_params) { queryParams = JSON.stringify(sortObjectPropertiesByKey(opts.query_params)); } if (opts.filter && opts.filter === '_view') { filterViewName = opts.view.toString(); } return Promise.all([src.id(), target.id()]).then(function (res) { var queryData = res[0] + res[1] + filterFun + filterViewName + queryParams + docIds + selector; return new Promise(function (resolve) { binaryMd5(queryData, resolve); }); }).then(function (md5sum) { // can't use straight-up md5 alphabet, because // the char '/' is interpreted as being for attachments, // and + is also not url-safe md5sum = md5sum.replace(/\//g, '.').replace(/\+/g, '_'); return '_local/' + md5sum; }); } function replicate(src, target, opts, returnValue, result) { var batches = []; // list of batches to be processed var currentBatch; // the batch currently being processed var pendingBatch = { seq: 0, changes: [], docs: [] }; // next batch, not yet ready to be processed var writingCheckpoint = false; // true while checkpoint is being written var changesCompleted = false; // true when all changes received var replicationCompleted = false; // true when replication has completed var last_seq = 0; var continuous = opts.continuous || opts.live || false; var batch_size = opts.batch_size || 100; var batches_limit = opts.batches_limit || 10; var changesPending = false; // true while src.changes is running var doc_ids = opts.doc_ids; var selector = opts.selector; var repId; var checkpointer; var changedDocs = []; // Like couchdb, every replication gets a unique session id var session = uuid(); result = result || { ok: true, start_time: new Date().toISOString(), docs_read: 0, docs_written: 0, doc_write_failures: 0, errors: [] }; var changesOpts = {}; returnValue.ready(src, target); function initCheckpointer() { if (checkpointer) { return Promise.resolve(); } return generateReplicationId(src, target, opts).then(function (res) { repId = res; var checkpointOpts = {}; if (opts.checkpoint === false) { checkpointOpts = { writeSourceCheckpoint: false, writeTargetCheckpoint: false }; } else if (opts.checkpoint === 'source') { checkpointOpts = { writeSourceCheckpoint: true, writeTargetCheckpoint: false }; } else if (opts.checkpoint === 'target') { checkpointOpts = { writeSourceCheckpoint: false, writeTargetCheckpoint: true }; } else { checkpointOpts = { writeSourceCheckpoint: true, writeTargetCheckpoint: true }; } checkpointer = new Checkpointer(src, target, repId, returnValue, checkpointOpts); }); } function writeDocs() { changedDocs = []; if (currentBatch.docs.length === 0) { return; } var docs = currentBatch.docs; var bulkOpts = {timeout: opts.timeout}; return target.bulkDocs({docs: docs, new_edits: false}, bulkOpts).then(function (res) { /* istanbul ignore if */ if (returnValue.cancelled) { completeReplication(); throw new Error('cancelled'); } // `res` doesn't include full documents (which live in `docs`), so we create a map of // (id -> error), and check for errors while iterating over `docs` var errorsById = Object.create(null); res.forEach(function (res) { if (res.error) { errorsById[res.id] = res; } }); var errorsNo = Object.keys(errorsById).length; result.doc_write_failures += errorsNo; result.docs_written += docs.length - errorsNo; docs.forEach(function (doc) { var error = errorsById[doc._id]; if (error) { result.errors.push(error); // Normalize error name. i.e. 'Unauthorized' -> 'unauthorized' (eg Sync Gateway) var errorName = (error.name || '').toLowerCase(); if (errorName === 'unauthorized' || errorName === 'forbidden') { returnValue.emit('denied', clone(error)); } else { throw error; } } else { changedDocs.push(doc); } }); }, function (err) { result.doc_write_failures += docs.length; throw err; }); } function finishBatch() { if (currentBatch.error) { throw new Error('There was a problem getting docs.'); } result.last_seq = last_seq = currentBatch.seq; var outResult = clone(result); if (changedDocs.length) { outResult.docs = changedDocs; // Attach 'pending' property if server supports it (CouchDB 2.0+) /* istanbul ignore if */ if (typeof currentBatch.pending === 'number') { outResult.pending = currentBatch.pending; delete currentBatch.pending; } returnValue.emit('change', outResult); } writingCheckpoint = true; return checkpointer.writeCheckpoint(currentBatch.seq, session).then(function () { writingCheckpoint = false; /* istanbul ignore if */ if (returnValue.cancelled) { completeReplication(); throw new Error('cancelled'); } currentBatch = undefined; getChanges(); }).catch(function (err) { onCheckpointError(err); throw err; }); } function getDiffs() { var diff = {}; currentBatch.changes.forEach(function (change) { // Couchbase Sync Gateway emits these, but we can ignore them /* istanbul ignore if */ if (change.id === "_user/") { return; } diff[change.id] = change.changes.map(function (x) { return x.rev; }); }); return target.revsDiff(diff).then(function (diffs) { /* istanbul ignore if */ if (returnValue.cancelled) { completeReplication(); throw new Error('cancelled'); } // currentBatch.diffs elements are deleted as the documents are written currentBatch.diffs = diffs; }); } function getBatchDocs() { return getDocs(src, target, currentBatch.diffs, returnValue).then(function (got) { currentBatch.error = !got.ok; got.docs.forEach(function (doc) { delete currentBatch.diffs[doc._id]; result.docs_read++; currentBatch.docs.push(doc); }); }); } function startNextBatch() { if (returnValue.cancelled || currentBatch) { return; } if (batches.length === 0) { processPendingBatch(true); return; } currentBatch = batches.shift(); getDiffs() .then(getBatchDocs) .then(writeDocs) .then(finishBatch) .then(startNextBatch) .catch(function (err) { abortReplication('batch processing terminated with error', err); }); } function processPendingBatch(immediate) { if (pendingBatch.changes.length === 0) { if (batches.length === 0 && !currentBatch) { if ((continuous && changesOpts.live) || changesCompleted) { returnValue.state = 'pending'; returnValue.emit('paused'); } if (changesCompleted) { completeReplication(); } } return; } if ( immediate || changesCompleted || pendingBatch.changes.length >= batch_size ) { batches.push(pendingBatch); pendingBatch = { seq: 0, changes: [], docs: [] }; if (returnValue.state === 'pending' || returnValue.state === 'stopped') { returnValue.state = 'active'; returnValue.emit('active'); } startNextBatch(); } } function abortReplication(reason, err) { if (replicationCompleted) { return; } if (!err.message) { err.message = reason; } result.ok = false; result.status = 'aborting'; batches = []; pendingBatch = { seq: 0, changes: [], docs: [] }; completeReplication(err); } function completeReplication(fatalError) { if (replicationCompleted) { return; } /* istanbul ignore if */ if (returnValue.cancelled) { result.status = 'cancelled'; if (writingCheckpoint) { return; } } result.status = result.status || 'complete'; result.end_time = new Date().toISOString(); result.last_seq = last_seq; replicationCompleted = true; if (fatalError) { // need to extend the error because Firefox considers ".result" read-only fatalError = createError(fatalError); fatalError.result = result; // Normalize error name. i.e. 'Unauthorized' -> 'unauthorized' (eg Sync Gateway) var errorName = (fatalError.name || '').toLowerCase(); if (errorName === 'unauthorized' || errorName === 'forbidden') { returnValue.emit('error', fatalError); returnValue.removeAllListeners(); } else { backOff(opts, returnValue, fatalError, function () { replicate(src, target, opts, returnValue); }); } } else { returnValue.emit('complete', result); returnValue.removeAllListeners(); } } function onChange(change, pending, lastSeq) { /* istanbul ignore if */ if (returnValue.cancelled) { return completeReplication(); } // Attach 'pending' property if server supports it (CouchDB 2.0+) /* istanbul ignore if */ if (typeof pending === 'number') { pendingBatch.pending = pending; } var filter = filterChange(opts)(change); if (!filter) { return; } pendingBatch.seq = change.seq || lastSeq; pendingBatch.changes.push(change); immediate__WEBPACK_IMPORTED_MODULE_1___default()(function () { processPendingBatch(batches.length === 0 && changesOpts.live); }); } function onChangesComplete(changes) { changesPending = false; /* istanbul ignore if */ if (returnValue.cancelled) { return completeReplication(); } // if no results were returned then we're done, // else fetch more if (changes.results.length > 0) { changesOpts.since = changes.results[changes.results.length - 1].seq; getChanges(); processPendingBatch(true); } else { var complete = function () { if (continuous) { changesOpts.live = true; getChanges(); } else { changesCompleted = true; } processPendingBatch(true); }; // update the checkpoint so we start from the right seq next time if (!currentBatch && changes.results.length === 0) { writingCheckpoint = true; checkpointer.writeCheckpoint(changes.last_seq, session).then(function () { writingCheckpoint = false; result.last_seq = last_seq = changes.last_seq; complete(); }) .catch(onCheckpointError); } else { complete(); } } } function onChangesError(err) { changesPending = false; /* istanbul ignore if */ if (returnValue.cancelled) { return completeReplication(); } abortReplication('changes rejected', err); } function getChanges() { if (!( !changesPending && !changesCompleted && batches.length < batches_limit )) { return; } changesPending = true; function abortChanges() { changes.cancel(); } function removeListener() { returnValue.removeListener('cancel', abortChanges); } if (returnValue._changes) { // remove old changes() and listeners returnValue.removeListener('cancel', returnValue._abortChanges); returnValue._changes.cancel(); } returnValue.once('cancel', abortChanges); var changes = src.changes(changesOpts) .on('change', onChange); changes.then(removeListener, removeListener); changes.then(onChangesComplete) .catch(onChangesError); if (opts.retry) { // save for later so we can cancel if necessary returnValue._changes = changes; returnValue._abortChanges = abortChanges; } } function startChanges() { initCheckpointer().then(function () { /* istanbul ignore if */ if (returnValue.cancelled) { completeReplication(); return; } return checkpointer.getCheckpoint().then(function (checkpoint) { last_seq = checkpoint; changesOpts = { since: last_seq, limit: batch_size, batch_size: batch_size, style: 'all_docs', doc_ids: doc_ids, selector: selector, return_docs: true // required so we know when we're done }; if (opts.filter) { if (typeof opts.filter !== 'string') { // required for the client-side filter in onChange changesOpts.include_docs = true; } else { // ddoc filter changesOpts.filter = opts.filter; } } if ('heartbeat' in opts) { changesOpts.heartbeat = opts.heartbeat; } if ('timeout' in opts) { changesOpts.timeout = opts.timeout; } if (opts.query_params) { changesOpts.query_params = opts.query_params; } if (opts.view) { changesOpts.view = opts.view; } getChanges(); }); }).catch(function (err) { abortReplication('getCheckpoint rejected with ', err); }); } /* istanbul ignore next */ function onCheckpointError(err) { writingCheckpoint = false; abortReplication('writeCheckpoint completed with error', err); } /* istanbul ignore if */ if (returnValue.cancelled) { // cancelled immediately completeReplication(); return; } if (!returnValue._addedListeners) { returnValue.once('cancel', completeReplication); if (typeof opts.complete === 'function') { returnValue.once('error', opts.complete); returnValue.once('complete', function (result) { opts.complete(null, result); }); } returnValue._addedListeners = true; } if (typeof opts.since === 'undefined') { startChanges(); } else { initCheckpointer().then(function () { writingCheckpoint = true; return checkpointer.writeCheckpoint(opts.since, session); }).then(function () { writingCheckpoint = false; /* istanbul ignore if */ if (returnValue.cancelled) { completeReplication(); return; } last_seq = opts.since; startChanges(); }).catch(onCheckpointError); } } // We create a basic promise so the caller can cancel the replication possibly // before we have actually started listening to changes etc inherits__WEBPACK_IMPORTED_MODULE_3___default()(Replication, events__WEBPACK_IMPORTED_MODULE_2__["EventEmitter"]); function Replication() { events__WEBPACK_IMPORTED_MODULE_2__["EventEmitter"].call(this); this.cancelled = false; this.state = 'pending'; var self = this; var promise = new Promise(function (fulfill, reject) { self.once('complete', fulfill); self.once('error', reject); }); self.then = function (resolve, reject) { return promise.then(resolve, reject); }; self.catch = function (reject) { return promise.catch(reject); }; // As we allow error handling via "error" event as well, // put a stub in here so that rejecting never throws UnhandledError. self.catch(function () {}); } Replication.prototype.cancel = function () { this.cancelled = true; this.state = 'cancelled'; this.emit('cancel'); }; Replication.prototype.ready = function (src, target) { var self = this; if (self._readyCalled) { return; } self._readyCalled = true; function onDestroy() { self.cancel(); } src.once('destroyed', onDestroy); target.once('destroyed', onDestroy); function cleanup() { src.removeListener('destroyed', onDestroy); target.removeListener('destroyed', onDestroy); } self.once('complete', cleanup); }; function toPouch(db, opts) { var PouchConstructor = opts.PouchConstructor; if (typeof db === 'string') { return new PouchConstructor(db, opts); } else { return db; } } function replicateWrapper(src, target, opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } if (typeof opts === 'undefined') { opts = {}; } if (opts.doc_ids && !Array.isArray(opts.doc_ids)) { throw createError(BAD_REQUEST, "`doc_ids` filter parameter is not a list."); } opts.complete = callback; opts = clone(opts); opts.continuous = opts.continuous || opts.live; opts.retry = ('retry' in opts) ? opts.retry : false; /*jshint validthis:true */ opts.PouchConstructor = opts.PouchConstructor || this; var replicateRet = new Replication(opts); var srcPouch = toPouch(src, opts); var targetPouch = toPouch(target, opts); replicate(srcPouch, targetPouch, opts, replicateRet); return replicateRet; } inherits__WEBPACK_IMPORTED_MODULE_3___default()(Sync, events__WEBPACK_IMPORTED_MODULE_2__["EventEmitter"]); function sync(src, target, opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } if (typeof opts === 'undefined') { opts = {}; } opts = clone(opts); /*jshint validthis:true */ opts.PouchConstructor = opts.PouchConstructor || this; src = toPouch(src, opts); target = toPouch(target, opts); return new Sync(src, target, opts, callback); } function Sync(src, target, opts, callback) { var self = this; this.canceled = false; var optsPush = opts.push ? $inject_Object_assign({}, opts, opts.push) : opts; var optsPull = opts.pull ? $inject_Object_assign({}, opts, opts.pull) : opts; this.push = replicateWrapper(src, target, optsPush); this.pull = replicateWrapper(target, src, optsPull); this.pushPaused = true; this.pullPaused = true; function pullChange(change) { self.emit('change', { direction: 'pull', change: change }); } function pushChange(change) { self.emit('change', { direction: 'push', change: change }); } function pushDenied(doc) { self.emit('denied', { direction: 'push', doc: doc }); } function pullDenied(doc) { self.emit('denied', { direction: 'pull', doc: doc }); } function pushPaused() { self.pushPaused = true; /* istanbul ignore if */ if (self.pullPaused) { self.emit('paused'); } } function pullPaused() { self.pullPaused = true; /* istanbul ignore if */ if (self.pushPaused) { self.emit('paused'); } } function pushActive() { self.pushPaused = false; /* istanbul ignore if */ if (self.pullPaused) { self.emit('active', { direction: 'push' }); } } function pullActive() { self.pullPaused = false; /* istanbul ignore if */ if (self.pushPaused) { self.emit('active', { direction: 'pull' }); } } var removed = {}; function removeAll(type) { // type is 'push' or 'pull' return function (event, func) { var isChange = event === 'change' && (func === pullChange || func === pushChange); var isDenied = event === 'denied' && (func === pullDenied || func === pushDenied); var isPaused = event === 'paused' && (func === pullPaused || func === pushPaused); var isActive = event === 'active' && (func === pullActive || func === pushActive); if (isChange || isDenied || isPaused || isActive) { if (!(event in removed)) { removed[event] = {}; } removed[event][type] = true; if (Object.keys(removed[event]).length === 2) { // both push and pull have asked to be removed self.removeAllListeners(event); } } }; } if (opts.live) { this.push.on('complete', self.pull.cancel.bind(self.pull)); this.pull.on('complete', self.push.cancel.bind(self.push)); } function addOneListener(ee, event, listener) { if (ee.listeners(event).indexOf(listener) == -1) { ee.on(event, listener); } } this.on('newListener', function (event) { if (event === 'change') { addOneListener(self.pull, 'change', pullChange); addOneListener(self.push, 'change', pushChange); } else if (event === 'denied') { addOneListener(self.pull, 'denied', pullDenied); addOneListener(self.push, 'denied', pushDenied); } else if (event === 'active') { addOneListener(self.pull, 'active', pullActive); addOneListener(self.push, 'active', pushActive); } else if (event === 'paused') { addOneListener(self.pull, 'paused', pullPaused); addOneListener(self.push, 'paused', pushPaused); } }); this.on('removeListener', function (event) { if (event === 'change') { self.pull.removeListener('change', pullChange); self.push.removeListener('change', pushChange); } else if (event === 'denied') { self.pull.removeListener('denied', pullDenied); self.push.removeListener('denied', pushDenied); } else if (event === 'active') { self.pull.removeListener('active', pullActive); self.push.removeListener('active', pushActive); } else if (event === 'paused') { self.pull.removeListener('paused', pullPaused); self.push.removeListener('paused', pushPaused); } }); this.pull.on('removeListener', removeAll('pull')); this.push.on('removeListener', removeAll('push')); var promise = Promise.all([ this.push, this.pull ]).then(function (resp) { var out = { push: resp[0], pull: resp[1] }; self.emit('complete', out); if (callback) { callback(null, out); } self.removeAllListeners(); return out; }, function (err) { self.cancel(); if (callback) { // if there's a callback, then the callback can receive // the error event callback(err); } else { // if there's no callback, then we're safe to emit an error // event, which would otherwise throw an unhandled error // due to 'error' being a special event in EventEmitters self.emit('error', err); } self.removeAllListeners(); if (callback) { // no sense throwing if we're already emitting an 'error' event throw err; } }); this.then = function (success, err) { return promise.then(success, err); }; this.catch = function (err) { return promise.catch(err); }; } Sync.prototype.cancel = function () { if (!this.canceled) { this.canceled = true; this.push.cancel(); this.pull.cancel(); } }; function replication(PouchDB) { PouchDB.replicate = replicateWrapper; PouchDB.sync = sync; Object.defineProperty(PouchDB.prototype, 'replicate', { get: function () { var self = this; if (typeof this.replicateMethods === 'undefined') { this.replicateMethods = { from: function (other, opts, callback) { return self.constructor.replicate(other, self, opts, callback); }, to: function (other, opts, callback) { return self.constructor.replicate(self, other, opts, callback); } }; } return this.replicateMethods; } }); PouchDB.prototype.sync = function (dbName, opts, callback) { return this.constructor.sync(this, dbName, opts, callback); }; } PouchDB.plugin(IDBPouch) .plugin(HttpPouch$1) .plugin(mapreduce) .plugin(replication); /* harmony default export */ __webpack_exports__["default"] = (PouchDB); /***/ }), /* 694 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = argsArray; function argsArray(fun) { return function () { var len = arguments.length; if (len) { var args = []; var i = -1; while (++i < len) { args[i] = arguments[i]; } return fun.call(this, args); } else { return fun.call(this, []); } }; } /***/ }), /* 695 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Mutation = global.MutationObserver || global.WebKitMutationObserver; var scheduleDrain; if (process.browser) { if (Mutation) { var called = 0; var observer = new Mutation(nextTick); var element = global.document.createTextNode(''); observer.observe(element, { characterData: true }); scheduleDrain = function () { element.data = (called = ++called % 2); }; } else if (!global.setImmediate && typeof global.MessageChannel !== 'undefined') { var channel = new global.MessageChannel(); channel.port1.onmessage = nextTick; scheduleDrain = function () { channel.port2.postMessage(0); }; } else if ('document' in global && 'onreadystatechange' in global.document.createElement('script')) { scheduleDrain = function () { // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called. var scriptEl = global.document.createElement('script'); scriptEl.onreadystatechange = function () { nextTick(); scriptEl.onreadystatechange = null; scriptEl.parentNode.removeChild(scriptEl); scriptEl = null; }; global.document.documentElement.appendChild(scriptEl); }; } else { scheduleDrain = function () { setTimeout(nextTick, 0); }; } } else { scheduleDrain = function () { process.nextTick(nextTick); }; } var draining; var queue = []; //named nextTick for less confusing stack traces function nextTick() { draining = true; var i, oldQueue; var len = queue.length; while (len) { oldQueue = queue; queue = []; i = -1; while (++i < len) { oldQueue[i](); } len = queue.length; } draining = false; } module.exports = immediate; function immediate(task) { if (queue.push(task) === 1 && !draining) { scheduleDrain(); } } /***/ }), /* 696 */ /***/ (function(module, exports, __webpack_require__) { try { var util = __webpack_require__(9); if (typeof util.inherits !== 'function') throw ''; module.exports = util.inherits; } catch (e) { module.exports = __webpack_require__(697); } /***/ }), /* 697 */ /***/ (function(module, exports) { if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { ctor.super_ = superCtor ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }); }; } else { // old school shim for old browsers module.exports = function inherits(ctor, superCtor) { ctor.super_ = superCtor var TempCtor = function () {} TempCtor.prototype = superCtor.prototype ctor.prototype = new TempCtor() ctor.prototype.constructor = ctor } } /***/ }), /* 698 */ /***/ (function(module, exports, __webpack_require__) { (function (factory) { if (true) { // Node/CommonJS module.exports = factory(); } else { var glob; } }(function (undefined) { 'use strict'; /* * Fastest md5 implementation around (JKM md5). * Credits: Joseph Myers * * @see http://www.myersdaily.org/joseph/javascript/md5-text.html * @see http://jsperf.com/md5-shootout/7 */ /* this function is much faster, so if possible we use it. Some IEs are the only ones I know of that need the idiotic second function, generated by an if clause. */ var add32 = function (a, b) { return (a + b) & 0xFFFFFFFF; }, hex_chr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f']; function cmn(q, a, b, x, s, t) { a = add32(add32(a, q), add32(x, t)); return add32((a << s) | (a >>> (32 - s)), b); } function md5cycle(x, k) { var a = x[0], b = x[1], c = x[2], d = x[3]; a += (b & c | ~b & d) + k[0] - 680876936 | 0; a = (a << 7 | a >>> 25) + b | 0; d += (a & b | ~a & c) + k[1] - 389564586 | 0; d = (d << 12 | d >>> 20) + a | 0; c += (d & a | ~d & b) + k[2] + 606105819 | 0; c = (c << 17 | c >>> 15) + d | 0; b += (c & d | ~c & a) + k[3] - 1044525330 | 0; b = (b << 22 | b >>> 10) + c | 0; a += (b & c | ~b & d) + k[4] - 176418897 | 0; a = (a << 7 | a >>> 25) + b | 0; d += (a & b | ~a & c) + k[5] + 1200080426 | 0; d = (d << 12 | d >>> 20) + a | 0; c += (d & a | ~d & b) + k[6] - 1473231341 | 0; c = (c << 17 | c >>> 15) + d | 0; b += (c & d | ~c & a) + k[7] - 45705983 | 0; b = (b << 22 | b >>> 10) + c | 0; a += (b & c | ~b & d) + k[8] + 1770035416 | 0; a = (a << 7 | a >>> 25) + b | 0; d += (a & b | ~a & c) + k[9] - 1958414417 | 0; d = (d << 12 | d >>> 20) + a | 0; c += (d & a | ~d & b) + k[10] - 42063 | 0; c = (c << 17 | c >>> 15) + d | 0; b += (c & d | ~c & a) + k[11] - 1990404162 | 0; b = (b << 22 | b >>> 10) + c | 0; a += (b & c | ~b & d) + k[12] + 1804603682 | 0; a = (a << 7 | a >>> 25) + b | 0; d += (a & b | ~a & c) + k[13] - 40341101 | 0; d = (d << 12 | d >>> 20) + a | 0; c += (d & a | ~d & b) + k[14] - 1502002290 | 0; c = (c << 17 | c >>> 15) + d | 0; b += (c & d | ~c & a) + k[15] + 1236535329 | 0; b = (b << 22 | b >>> 10) + c | 0; a += (b & d | c & ~d) + k[1] - 165796510 | 0; a = (a << 5 | a >>> 27) + b | 0; d += (a & c | b & ~c) + k[6] - 1069501632 | 0; d = (d << 9 | d >>> 23) + a | 0; c += (d & b | a & ~b) + k[11] + 643717713 | 0; c = (c << 14 | c >>> 18) + d | 0; b += (c & a | d & ~a) + k[0] - 373897302 | 0; b = (b << 20 | b >>> 12) + c | 0; a += (b & d | c & ~d) + k[5] - 701558691 | 0; a = (a << 5 | a >>> 27) + b | 0; d += (a & c | b & ~c) + k[10] + 38016083 | 0; d = (d << 9 | d >>> 23) + a | 0; c += (d & b | a & ~b) + k[15] - 660478335 | 0; c = (c << 14 | c >>> 18) + d | 0; b += (c & a | d & ~a) + k[4] - 405537848 | 0; b = (b << 20 | b >>> 12) + c | 0; a += (b & d | c & ~d) + k[9] + 568446438 | 0; a = (a << 5 | a >>> 27) + b | 0; d += (a & c | b & ~c) + k[14] - 1019803690 | 0; d = (d << 9 | d >>> 23) + a | 0; c += (d & b | a & ~b) + k[3] - 187363961 | 0; c = (c << 14 | c >>> 18) + d | 0; b += (c & a | d & ~a) + k[8] + 1163531501 | 0; b = (b << 20 | b >>> 12) + c | 0; a += (b & d | c & ~d) + k[13] - 1444681467 | 0; a = (a << 5 | a >>> 27) + b | 0; d += (a & c | b & ~c) + k[2] - 51403784 | 0; d = (d << 9 | d >>> 23) + a | 0; c += (d & b | a & ~b) + k[7] + 1735328473 | 0; c = (c << 14 | c >>> 18) + d | 0; b += (c & a | d & ~a) + k[12] - 1926607734 | 0; b = (b << 20 | b >>> 12) + c | 0; a += (b ^ c ^ d) + k[5] - 378558 | 0; a = (a << 4 | a >>> 28) + b | 0; d += (a ^ b ^ c) + k[8] - 2022574463 | 0; d = (d << 11 | d >>> 21) + a | 0; c += (d ^ a ^ b) + k[11] + 1839030562 | 0; c = (c << 16 | c >>> 16) + d | 0; b += (c ^ d ^ a) + k[14] - 35309556 | 0; b = (b << 23 | b >>> 9) + c | 0; a += (b ^ c ^ d) + k[1] - 1530992060 | 0; a = (a << 4 | a >>> 28) + b | 0; d += (a ^ b ^ c) + k[4] + 1272893353 | 0; d = (d << 11 | d >>> 21) + a | 0; c += (d ^ a ^ b) + k[7] - 155497632 | 0; c = (c << 16 | c >>> 16) + d | 0; b += (c ^ d ^ a) + k[10] - 1094730640 | 0; b = (b << 23 | b >>> 9) + c | 0; a += (b ^ c ^ d) + k[13] + 681279174 | 0; a = (a << 4 | a >>> 28) + b | 0; d += (a ^ b ^ c) + k[0] - 358537222 | 0; d = (d << 11 | d >>> 21) + a | 0; c += (d ^ a ^ b) + k[3] - 722521979 | 0; c = (c << 16 | c >>> 16) + d | 0; b += (c ^ d ^ a) + k[6] + 76029189 | 0; b = (b << 23 | b >>> 9) + c | 0; a += (b ^ c ^ d) + k[9] - 640364487 | 0; a = (a << 4 | a >>> 28) + b | 0; d += (a ^ b ^ c) + k[12] - 421815835 | 0; d = (d << 11 | d >>> 21) + a | 0; c += (d ^ a ^ b) + k[15] + 530742520 | 0; c = (c << 16 | c >>> 16) + d | 0; b += (c ^ d ^ a) + k[2] - 995338651 | 0; b = (b << 23 | b >>> 9) + c | 0; a += (c ^ (b | ~d)) + k[0] - 198630844 | 0; a = (a << 6 | a >>> 26) + b | 0; d += (b ^ (a | ~c)) + k[7] + 1126891415 | 0; d = (d << 10 | d >>> 22) + a | 0; c += (a ^ (d | ~b)) + k[14] - 1416354905 | 0; c = (c << 15 | c >>> 17) + d | 0; b += (d ^ (c | ~a)) + k[5] - 57434055 | 0; b = (b << 21 |b >>> 11) + c | 0; a += (c ^ (b | ~d)) + k[12] + 1700485571 | 0; a = (a << 6 | a >>> 26) + b | 0; d += (b ^ (a | ~c)) + k[3] - 1894986606 | 0; d = (d << 10 | d >>> 22) + a | 0; c += (a ^ (d | ~b)) + k[10] - 1051523 | 0; c = (c << 15 | c >>> 17) + d | 0; b += (d ^ (c | ~a)) + k[1] - 2054922799 | 0; b = (b << 21 |b >>> 11) + c | 0; a += (c ^ (b | ~d)) + k[8] + 1873313359 | 0; a = (a << 6 | a >>> 26) + b | 0; d += (b ^ (a | ~c)) + k[15] - 30611744 | 0; d = (d << 10 | d >>> 22) + a | 0; c += (a ^ (d | ~b)) + k[6] - 1560198380 | 0; c = (c << 15 | c >>> 17) + d | 0; b += (d ^ (c | ~a)) + k[13] + 1309151649 | 0; b = (b << 21 |b >>> 11) + c | 0; a += (c ^ (b | ~d)) + k[4] - 145523070 | 0; a = (a << 6 | a >>> 26) + b | 0; d += (b ^ (a | ~c)) + k[11] - 1120210379 | 0; d = (d << 10 | d >>> 22) + a | 0; c += (a ^ (d | ~b)) + k[2] + 718787259 | 0; c = (c << 15 | c >>> 17) + d | 0; b += (d ^ (c | ~a)) + k[9] - 343485551 | 0; b = (b << 21 | b >>> 11) + c | 0; x[0] = a + x[0] | 0; x[1] = b + x[1] | 0; x[2] = c + x[2] | 0; x[3] = d + x[3] | 0; } function md5blk(s) { var md5blks = [], i; /* Andy King said do it this way. */ for (i = 0; i < 64; i += 4) { md5blks[i >> 2] = s.charCodeAt(i) + (s.charCodeAt(i + 1) << 8) + (s.charCodeAt(i + 2) << 16) + (s.charCodeAt(i + 3) << 24); } return md5blks; } function md5blk_array(a) { var md5blks = [], i; /* Andy King said do it this way. */ for (i = 0; i < 64; i += 4) { md5blks[i >> 2] = a[i] + (a[i + 1] << 8) + (a[i + 2] << 16) + (a[i + 3] << 24); } return md5blks; } function md51(s) { var n = s.length, state = [1732584193, -271733879, -1732584194, 271733878], i, length, tail, tmp, lo, hi; for (i = 64; i <= n; i += 64) { md5cycle(state, md5blk(s.substring(i - 64, i))); } s = s.substring(i - 64); length = s.length; tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; for (i = 0; i < length; i += 1) { tail[i >> 2] |= s.charCodeAt(i) << ((i % 4) << 3); } tail[i >> 2] |= 0x80 << ((i % 4) << 3); if (i > 55) { md5cycle(state, tail); for (i = 0; i < 16; i += 1) { tail[i] = 0; } } // Beware that the final length might not fit in 32 bits so we take care of that tmp = n * 8; tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/); lo = parseInt(tmp[2], 16); hi = parseInt(tmp[1], 16) || 0; tail[14] = lo; tail[15] = hi; md5cycle(state, tail); return state; } function md51_array(a) { var n = a.length, state = [1732584193, -271733879, -1732584194, 271733878], i, length, tail, tmp, lo, hi; for (i = 64; i <= n; i += 64) { md5cycle(state, md5blk_array(a.subarray(i - 64, i))); } // Not sure if it is a bug, however IE10 will always produce a sub array of length 1 // containing the last element of the parent array if the sub array specified starts // beyond the length of the parent array - weird. // https://connect.microsoft.com/IE/feedback/details/771452/typed-array-subarray-issue a = (i - 64) < n ? a.subarray(i - 64) : new Uint8Array(0); length = a.length; tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; for (i = 0; i < length; i += 1) { tail[i >> 2] |= a[i] << ((i % 4) << 3); } tail[i >> 2] |= 0x80 << ((i % 4) << 3); if (i > 55) { md5cycle(state, tail); for (i = 0; i < 16; i += 1) { tail[i] = 0; } } // Beware that the final length might not fit in 32 bits so we take care of that tmp = n * 8; tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/); lo = parseInt(tmp[2], 16); hi = parseInt(tmp[1], 16) || 0; tail[14] = lo; tail[15] = hi; md5cycle(state, tail); return state; } function rhex(n) { var s = '', j; for (j = 0; j < 4; j += 1) { s += hex_chr[(n >> (j * 8 + 4)) & 0x0F] + hex_chr[(n >> (j * 8)) & 0x0F]; } return s; } function hex(x) { var i; for (i = 0; i < x.length; i += 1) { x[i] = rhex(x[i]); } return x.join(''); } // In some cases the fast add32 function cannot be used.. if (hex(md51('hello')) !== '5d41402abc4b2a76b9719d911017c592') { add32 = function (x, y) { var lsw = (x & 0xFFFF) + (y & 0xFFFF), msw = (x >> 16) + (y >> 16) + (lsw >> 16); return (msw << 16) | (lsw & 0xFFFF); }; } // --------------------------------------------------- /** * ArrayBuffer slice polyfill. * * @see https://github.com/ttaubert/node-arraybuffer-slice */ if (typeof ArrayBuffer !== 'undefined' && !ArrayBuffer.prototype.slice) { (function () { function clamp(val, length) { val = (val | 0) || 0; if (val < 0) { return Math.max(val + length, 0); } return Math.min(val, length); } ArrayBuffer.prototype.slice = function (from, to) { var length = this.byteLength, begin = clamp(from, length), end = length, num, target, targetArray, sourceArray; if (to !== undefined) { end = clamp(to, length); } if (begin > end) { return new ArrayBuffer(0); } num = end - begin; target = new ArrayBuffer(num); targetArray = new Uint8Array(target); sourceArray = new Uint8Array(this, begin, num); targetArray.set(sourceArray); return target; }; })(); } // --------------------------------------------------- /** * Helpers. */ function toUtf8(str) { if (/[\u0080-\uFFFF]/.test(str)) { str = unescape(encodeURIComponent(str)); } return str; } function utf8Str2ArrayBuffer(str, returnUInt8Array) { var length = str.length, buff = new ArrayBuffer(length), arr = new Uint8Array(buff), i; for (i = 0; i < length; i += 1) { arr[i] = str.charCodeAt(i); } return returnUInt8Array ? arr : buff; } function arrayBuffer2Utf8Str(buff) { return String.fromCharCode.apply(null, new Uint8Array(buff)); } function concatenateArrayBuffers(first, second, returnUInt8Array) { var result = new Uint8Array(first.byteLength + second.byteLength); result.set(new Uint8Array(first)); result.set(new Uint8Array(second), first.byteLength); return returnUInt8Array ? result : result.buffer; } function hexToBinaryString(hex) { var bytes = [], length = hex.length, x; for (x = 0; x < length - 1; x += 2) { bytes.push(parseInt(hex.substr(x, 2), 16)); } return String.fromCharCode.apply(String, bytes); } // --------------------------------------------------- /** * SparkMD5 OOP implementation. * * Use this class to perform an incremental md5, otherwise use the * static methods instead. */ function SparkMD5() { // call reset to init the instance this.reset(); } /** * Appends a string. * A conversion will be applied if an utf8 string is detected. * * @param {String} str The string to be appended * * @return {SparkMD5} The instance itself */ SparkMD5.prototype.append = function (str) { // Converts the string to utf8 bytes if necessary // Then append as binary this.appendBinary(toUtf8(str)); return this; }; /** * Appends a binary string. * * @param {String} contents The binary string to be appended * * @return {SparkMD5} The instance itself */ SparkMD5.prototype.appendBinary = function (contents) { this._buff += contents; this._length += contents.length; var length = this._buff.length, i; for (i = 64; i <= length; i += 64) { md5cycle(this._hash, md5blk(this._buff.substring(i - 64, i))); } this._buff = this._buff.substring(i - 64); return this; }; /** * Finishes the incremental computation, reseting the internal state and * returning the result. * * @param {Boolean} raw True to get the raw string, false to get the hex string * * @return {String} The result */ SparkMD5.prototype.end = function (raw) { var buff = this._buff, length = buff.length, i, tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], ret; for (i = 0; i < length; i += 1) { tail[i >> 2] |= buff.charCodeAt(i) << ((i % 4) << 3); } this._finish(tail, length); ret = hex(this._hash); if (raw) { ret = hexToBinaryString(ret); } this.reset(); return ret; }; /** * Resets the internal state of the computation. * * @return {SparkMD5} The instance itself */ SparkMD5.prototype.reset = function () { this._buff = ''; this._length = 0; this._hash = [1732584193, -271733879, -1732584194, 271733878]; return this; }; /** * Gets the internal state of the computation. * * @return {Object} The state */ SparkMD5.prototype.getState = function () { return { buff: this._buff, length: this._length, hash: this._hash }; }; /** * Gets the internal state of the computation. * * @param {Object} state The state * * @return {SparkMD5} The instance itself */ SparkMD5.prototype.setState = function (state) { this._buff = state.buff; this._length = state.length; this._hash = state.hash; return this; }; /** * Releases memory used by the incremental buffer and other additional * resources. If you plan to use the instance again, use reset instead. */ SparkMD5.prototype.destroy = function () { delete this._hash; delete this._buff; delete this._length; }; /** * Finish the final calculation based on the tail. * * @param {Array} tail The tail (will be modified) * @param {Number} length The length of the remaining buffer */ SparkMD5.prototype._finish = function (tail, length) { var i = length, tmp, lo, hi; tail[i >> 2] |= 0x80 << ((i % 4) << 3); if (i > 55) { md5cycle(this._hash, tail); for (i = 0; i < 16; i += 1) { tail[i] = 0; } } // Do the final computation based on the tail and length // Beware that the final length may not fit in 32 bits so we take care of that tmp = this._length * 8; tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/); lo = parseInt(tmp[2], 16); hi = parseInt(tmp[1], 16) || 0; tail[14] = lo; tail[15] = hi; md5cycle(this._hash, tail); }; /** * Performs the md5 hash on a string. * A conversion will be applied if utf8 string is detected. * * @param {String} str The string * @param {Boolean} raw True to get the raw string, false to get the hex string * * @return {String} The result */ SparkMD5.hash = function (str, raw) { // Converts the string to utf8 bytes if necessary // Then compute it using the binary function return SparkMD5.hashBinary(toUtf8(str), raw); }; /** * Performs the md5 hash on a binary string. * * @param {String} content The binary string * @param {Boolean} raw True to get the raw string, false to get the hex string * * @return {String} The result */ SparkMD5.hashBinary = function (content, raw) { var hash = md51(content), ret = hex(hash); return raw ? hexToBinaryString(ret) : ret; }; // --------------------------------------------------- /** * SparkMD5 OOP implementation for array buffers. * * Use this class to perform an incremental md5 ONLY for array buffers. */ SparkMD5.ArrayBuffer = function () { // call reset to init the instance this.reset(); }; /** * Appends an array buffer. * * @param {ArrayBuffer} arr The array to be appended * * @return {SparkMD5.ArrayBuffer} The instance itself */ SparkMD5.ArrayBuffer.prototype.append = function (arr) { var buff = concatenateArrayBuffers(this._buff.buffer, arr, true), length = buff.length, i; this._length += arr.byteLength; for (i = 64; i <= length; i += 64) { md5cycle(this._hash, md5blk_array(buff.subarray(i - 64, i))); } this._buff = (i - 64) < length ? new Uint8Array(buff.buffer.slice(i - 64)) : new Uint8Array(0); return this; }; /** * Finishes the incremental computation, reseting the internal state and * returning the result. * * @param {Boolean} raw True to get the raw string, false to get the hex string * * @return {String} The result */ SparkMD5.ArrayBuffer.prototype.end = function (raw) { var buff = this._buff, length = buff.length, tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], i, ret; for (i = 0; i < length; i += 1) { tail[i >> 2] |= buff[i] << ((i % 4) << 3); } this._finish(tail, length); ret = hex(this._hash); if (raw) { ret = hexToBinaryString(ret); } this.reset(); return ret; }; /** * Resets the internal state of the computation. * * @return {SparkMD5.ArrayBuffer} The instance itself */ SparkMD5.ArrayBuffer.prototype.reset = function () { this._buff = new Uint8Array(0); this._length = 0; this._hash = [1732584193, -271733879, -1732584194, 271733878]; return this; }; /** * Gets the internal state of the computation. * * @return {Object} The state */ SparkMD5.ArrayBuffer.prototype.getState = function () { var state = SparkMD5.prototype.getState.call(this); // Convert buffer to a string state.buff = arrayBuffer2Utf8Str(state.buff); return state; }; /** * Gets the internal state of the computation. * * @param {Object} state The state * * @return {SparkMD5.ArrayBuffer} The instance itself */ SparkMD5.ArrayBuffer.prototype.setState = function (state) { // Convert string to buffer state.buff = utf8Str2ArrayBuffer(state.buff, true); return SparkMD5.prototype.setState.call(this, state); }; SparkMD5.ArrayBuffer.prototype.destroy = SparkMD5.prototype.destroy; SparkMD5.ArrayBuffer.prototype._finish = SparkMD5.prototype._finish; /** * Performs the md5 hash on an array buffer. * * @param {ArrayBuffer} arr The array buffer * @param {Boolean} raw True to get the raw string, false to get the hex one * * @return {String} The result */ SparkMD5.ArrayBuffer.hash = function (arr, raw) { var hash = md51_array(new Uint8Array(arr)), ret = hex(hash); return raw ? hexToBinaryString(ret) : ret; }; return SparkMD5; })); /***/ }), /* 699 */ /***/ (function(module, exports, __webpack_require__) { var v1 = __webpack_require__(700); var v4 = __webpack_require__(703); var uuid = v4; uuid.v1 = v1; uuid.v4 = v4; module.exports = uuid; /***/ }), /* 700 */ /***/ (function(module, exports, __webpack_require__) { var rng = __webpack_require__(701); var bytesToUuid = __webpack_require__(702); // **`v1()` - Generate time-based UUID** // // Inspired by https://github.com/LiosK/UUID.js // and http://docs.python.org/library/uuid.html var _nodeId; var _clockseq; // Previous uuid creation time var _lastMSecs = 0; var _lastNSecs = 0; // See https://github.com/broofa/node-uuid for API details function v1(options, buf, offset) { var i = buf && offset || 0; var b = buf || []; options = options || {}; var node = options.node || _nodeId; var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not // specified. We do this lazily to minimize issues related to insufficient // system entropy. See #189 if (node == null || clockseq == null) { var seedBytes = rng(); if (node == null) { // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) node = _nodeId = [ seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5] ]; } if (clockseq == null) { // Per 4.2.2, randomize (14 bit) clockseq clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; } } // UUID timestamps are 100 nano-second units since the Gregorian epoch, // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime(); // Per 4.2.1.2, use count of uuid's generated during the current clock // cycle to simulate higher resolution clock var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000; // Per 4.2.1.2, Bump clockseq on clock regression if (dt < 0 && options.clockseq === undefined) { clockseq = clockseq + 1 & 0x3fff; } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new // time interval if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { nsecs = 0; } // Per 4.2.1.2 Throw error if too many uuids are requested if (nsecs >= 10000) { throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec'); } _lastMSecs = msecs; _lastNSecs = nsecs; _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch msecs += 12219292800000; // `time_low` var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; b[i++] = tl >>> 24 & 0xff; b[i++] = tl >>> 16 & 0xff; b[i++] = tl >>> 8 & 0xff; b[i++] = tl & 0xff; // `time_mid` var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff; b[i++] = tmh >>> 8 & 0xff; b[i++] = tmh & 0xff; // `time_high_and_version` b[i++] = tmh >>> 24 & 0xf | 0x10; // include version b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` b[i++] = clockseq & 0xff; // `node` for (var n = 0; n < 6; ++n) { b[i + n] = node[n]; } return buf ? buf : bytesToUuid(b); } module.exports = v1; /***/ }), /* 701 */ /***/ (function(module, exports, __webpack_require__) { // Unique ID creation requires a high quality random # generator. In node.js // this is pretty straight-forward - we use the crypto API. var crypto = __webpack_require__(94); module.exports = function nodeRNG() { return crypto.randomBytes(16); }; /***/ }), /* 702 */ /***/ (function(module, exports) { /** * Convert array of 16 byte values to UUID string format of the form: * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */ var byteToHex = []; for (var i = 0; i < 256; ++i) { byteToHex[i] = (i + 0x100).toString(16).substr(1); } function bytesToUuid(buf, offset) { var i = offset || 0; var bth = byteToHex; return bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]]; } module.exports = bytesToUuid; /***/ }), /* 703 */ /***/ (function(module, exports, __webpack_require__) { var rng = __webpack_require__(701); var bytesToUuid = __webpack_require__(702); function v4(options, buf, offset) { var i = buf && offset || 0; if (typeof(options) == 'string') { buf = options === 'binary' ? new Array(16) : null; options = null; } options = options || {}; var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` rnds[6] = (rnds[6] & 0x0f) | 0x40; rnds[8] = (rnds[8] & 0x3f) | 0x80; // Copy bytes to buffer, if provided if (buf) { for (var ii = 0; ii < 16; ++ii) { buf[i + ii] = rnds[ii]; } } return buf || bytesToUuid(rnds); } module.exports = v4; /***/ }), /* 704 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Stringify/parse functions that don't operate * recursively, so they avoid call stack exceeded * errors. */ exports.stringify = function stringify(input) { var queue = []; queue.push({obj: input}); var res = ''; var next, obj, prefix, val, i, arrayPrefix, keys, k, key, value, objPrefix; while ((next = queue.pop())) { obj = next.obj; prefix = next.prefix || ''; val = next.val || ''; res += prefix; if (val) { res += val; } else if (typeof obj !== 'object') { res += typeof obj === 'undefined' ? null : JSON.stringify(obj); } else if (obj === null) { res += 'null'; } else if (Array.isArray(obj)) { queue.push({val: ']'}); for (i = obj.length - 1; i >= 0; i--) { arrayPrefix = i === 0 ? '' : ','; queue.push({obj: obj[i], prefix: arrayPrefix}); } queue.push({val: '['}); } else { // object keys = []; for (k in obj) { if (obj.hasOwnProperty(k)) { keys.push(k); } } queue.push({val: '}'}); for (i = keys.length - 1; i >= 0; i--) { key = keys[i]; value = obj[key]; objPrefix = (i > 0 ? ',' : ''); objPrefix += JSON.stringify(key) + ':'; queue.push({obj: value, prefix: objPrefix}); } queue.push({val: '{'}); } } return res; }; // Convenience function for the parse function. // This pop function is basically copied from // pouchCollate.parseIndexableString function pop(obj, stack, metaStack) { var lastMetaElement = metaStack[metaStack.length - 1]; if (obj === lastMetaElement.element) { // popping a meta-element, e.g. an object whose value is another object metaStack.pop(); lastMetaElement = metaStack[metaStack.length - 1]; } var element = lastMetaElement.element; var lastElementIndex = lastMetaElement.index; if (Array.isArray(element)) { element.push(obj); } else if (lastElementIndex === stack.length - 2) { // obj with key+value var key = stack.pop(); element[key] = obj; } else { stack.push(obj); // obj with key only } } exports.parse = function (str) { var stack = []; var metaStack = []; // stack for arrays and objects var i = 0; var collationIndex,parsedNum,numChar; var parsedString,lastCh,numConsecutiveSlashes,ch; var arrayElement, objElement; while (true) { collationIndex = str[i++]; if (collationIndex === '}' || collationIndex === ']' || typeof collationIndex === 'undefined') { if (stack.length === 1) { return stack.pop(); } else { pop(stack.pop(), stack, metaStack); continue; } } switch (collationIndex) { case ' ': case '\t': case '\n': case ':': case ',': break; case 'n': i += 3; // 'ull' pop(null, stack, metaStack); break; case 't': i += 3; // 'rue' pop(true, stack, metaStack); break; case 'f': i += 4; // 'alse' pop(false, stack, metaStack); break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '-': parsedNum = ''; i--; while (true) { numChar = str[i++]; if (/[\d\.\-e\+]/.test(numChar)) { parsedNum += numChar; } else { i--; break; } } pop(parseFloat(parsedNum), stack, metaStack); break; case '"': parsedString = ''; lastCh = void 0; numConsecutiveSlashes = 0; while (true) { ch = str[i++]; if (ch !== '"' || (lastCh === '\\' && numConsecutiveSlashes % 2 === 1)) { parsedString += ch; lastCh = ch; if (lastCh === '\\') { numConsecutiveSlashes++; } else { numConsecutiveSlashes = 0; } } else { break; } } pop(JSON.parse('"' + parsedString + '"'), stack, metaStack); break; case '[': arrayElement = { element: [], index: stack.length }; stack.push(arrayElement.element); metaStack.push(arrayElement); break; case '{': objElement = { element: {}, index: stack.length }; stack.push(objElement.element); metaStack.push(objElement); break; default: throw new Error( 'unexpectedly reached end of input: ' + collationIndex); } } }; /***/ }), /* 705 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(706); /* harmony import */ var pouchdb_errors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(711); /* harmony import */ var pouchdb_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(715); /* harmony import */ var pouchdb_selector_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(719); /* harmony import */ var pouchdb_abstract_mapreduce__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(721); /* harmony import */ var pouchdb_collate__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(720); /* harmony import */ var pouchdb_md5__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(714); // we restucture the supplied JSON considerably, because the official // Mango API is very particular about a lot of this stuff, but we like // to be liberal with what we accept in order to prevent mental // breakdowns in our users function massageCreateIndexRequest(requestDef) { requestDef = Object(pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__["clone"])(requestDef); if (!requestDef.index) { requestDef.index = {}; } ['type', 'name', 'ddoc'].forEach(function (key) { if (requestDef.index[key]) { requestDef[key] = requestDef.index[key]; delete requestDef.index[key]; } }); if (requestDef.fields) { requestDef.index.fields = requestDef.fields; delete requestDef.fields; } if (!requestDef.type) { requestDef.type = 'json'; } return requestDef; } function dbFetch(db, path, opts, callback) { var status, ok; opts.headers = new pouchdb_fetch__WEBPACK_IMPORTED_MODULE_2__["Headers"]({'Content-type': 'application/json'}); db.fetch(path, opts).then(function (response) { status = response.status; ok = response.ok; return response.json(); }).then(function (json) { if (!ok) { json.status = status; var err = Object(pouchdb_errors__WEBPACK_IMPORTED_MODULE_1__["generateErrorFromResponse"])(json); callback(err); } else { callback(null, json); } }).catch(callback); } function createIndex(db, requestDef, callback) { requestDef = massageCreateIndexRequest(requestDef); dbFetch(db, '_index', { method: 'POST', body: JSON.stringify(requestDef) }, callback); } function find(db, requestDef, callback) { dbFetch(db, '_find', { method: 'POST', body: JSON.stringify(requestDef) }, callback); } function explain(db, requestDef, callback) { dbFetch(db, '_explain', { method: 'POST', body: JSON.stringify(requestDef) }, callback); } function getIndexes(db, callback) { dbFetch(db, '_index', { method: 'GET' }, callback); } function deleteIndex(db, indexDef, callback) { var ddoc = indexDef.ddoc; var type = indexDef.type || 'json'; var name = indexDef.name; if (!ddoc) { return callback(new Error('you must provide an index\'s ddoc')); } if (!name) { return callback(new Error('you must provide an index\'s name')); } var url = '_index/' + [ddoc, type, name].map(encodeURIComponent).join('/'); dbFetch(db, url, {method: 'DELETE'}, callback); } function getArguments(fun) { return function () { var len = arguments.length; var args = new Array(len); var i = -1; while (++i < len) { args[i] = arguments[i]; } return fun.call(this, args); }; } function callbackify(fun) { return getArguments(function (args) { var cb = args.pop(); var promise = fun.apply(this, args); promisedCallback(promise, cb); return promise; }); } function promisedCallback(promise, callback) { promise.then(function (res) { Object(pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__["nextTick"])(function () { callback(null, res); }); }, function (reason) { Object(pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__["nextTick"])(function () { callback(reason); }); }); return promise; } var flatten = getArguments(function (args) { var res = []; for (var i = 0, len = args.length; i < len; i++) { var subArr = args[i]; if (Array.isArray(subArr)) { res = res.concat(flatten.apply(null, subArr)); } else { res.push(subArr); } } return res; }); function mergeObjects(arr) { var res = {}; for (var i = 0, len = arr.length; i < len; i++) { res = Object(pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__["assign"])(res, arr[i]); } return res; } // Selects a list of fields defined in dot notation from one doc // and copies them to a new doc. Like underscore _.pick but supports nesting. function pick(obj, arr) { var res = {}; for (var i = 0, len = arr.length; i < len; i++) { var parsedField = Object(pouchdb_selector_core__WEBPACK_IMPORTED_MODULE_3__["parseField"])(arr[i]); var value = Object(pouchdb_selector_core__WEBPACK_IMPORTED_MODULE_3__["getFieldFromDoc"])(obj, parsedField); if (typeof value !== 'undefined') { Object(pouchdb_selector_core__WEBPACK_IMPORTED_MODULE_3__["setFieldInDoc"])(res, parsedField, value); } } return res; } // e.g. ['a'], ['a', 'b'] is true, but ['b'], ['a', 'b'] is false function oneArrayIsSubArrayOfOther(left, right) { for (var i = 0, len = Math.min(left.length, right.length); i < len; i++) { if (left[i] !== right[i]) { return false; } } return true; } // e.g.['a', 'b', 'c'], ['a', 'b'] is false function oneArrayIsStrictSubArrayOfOther(left, right) { if (left.length > right.length) { return false; } return oneArrayIsSubArrayOfOther(left, right); } // same as above, but treat the left array as an unordered set // e.g. ['b', 'a'], ['a', 'b', 'c'] is true, but ['c'], ['a', 'b', 'c'] is false function oneSetIsSubArrayOfOther(left, right) { left = left.slice(); for (var i = 0, len = right.length; i < len; i++) { var field = right[i]; if (!left.length) { break; } var leftIdx = left.indexOf(field); if (leftIdx === -1) { return false; } else { left.splice(leftIdx, 1); } } return true; } function arrayToObject(arr) { var res = {}; for (var i = 0, len = arr.length; i < len; i++) { res[arr[i]] = true; } return res; } function max(arr, fun) { var max = null; var maxScore = -1; for (var i = 0, len = arr.length; i < len; i++) { var element = arr[i]; var score = fun(element); if (score > maxScore) { maxScore = score; max = element; } } return max; } function arrayEquals(arr1, arr2) { if (arr1.length !== arr2.length) { return false; } for (var i = 0, len = arr1.length; i < len; i++) { if (arr1[i] !== arr2[i]) { return false; } } return true; } function uniq(arr) { var obj = {}; for (var i = 0; i < arr.length; i++) { obj['$' + arr[i]] = true; } return Object.keys(obj).map(function (key) { return key.substring(1); }); } // // One thing about these mappers: // // Per the advice of John-David Dalton (http://youtu.be/NthmeLEhDDM), // what you want to do in this case is optimize for the smallest possible // function, since that's the thing that gets run over and over again. // // This code would be a lot simpler if all the if/elses were inside // the function, but it would also be a lot less performant. // function createDeepMultiMapper(fields, emit) { return function (doc) { var toEmit = []; for (var i = 0, iLen = fields.length; i < iLen; i++) { var parsedField = Object(pouchdb_selector_core__WEBPACK_IMPORTED_MODULE_3__["parseField"])(fields[i]); var value = doc; for (var j = 0, jLen = parsedField.length; j < jLen; j++) { var key = parsedField[j]; value = value[key]; if (typeof value === 'undefined') { return; // don't emit } } toEmit.push(value); } emit(toEmit); }; } function createDeepSingleMapper(field, emit) { var parsedField = Object(pouchdb_selector_core__WEBPACK_IMPORTED_MODULE_3__["parseField"])(field); return function (doc) { var value = doc; for (var i = 0, len = parsedField.length; i < len; i++) { var key = parsedField[i]; value = value[key]; if (typeof value === 'undefined') { return; // do nothing } } emit(value); }; } function createShallowSingleMapper(field, emit) { return function (doc) { emit(doc[field]); }; } function createShallowMultiMapper(fields, emit) { return function (doc) { var toEmit = []; for (var i = 0, len = fields.length; i < len; i++) { toEmit.push(doc[fields[i]]); } emit(toEmit); }; } function checkShallow(fields) { for (var i = 0, len = fields.length; i < len; i++) { var field = fields[i]; if (field.indexOf('.') !== -1) { return false; } } return true; } function createMapper(fields, emit) { var isShallow = checkShallow(fields); var isSingle = fields.length === 1; // notice we try to optimize for the most common case, // i.e. single shallow indexes if (isShallow) { if (isSingle) { return createShallowSingleMapper(fields[0], emit); } else { // multi return createShallowMultiMapper(fields, emit); } } else { // deep if (isSingle) { return createDeepSingleMapper(fields[0], emit); } else { // multi return createDeepMultiMapper(fields, emit); } } } function mapper(mapFunDef, emit) { // mapFunDef is a list of fields var fields = Object.keys(mapFunDef.fields); return createMapper(fields, emit); } /* istanbul ignore next */ function reducer(/*reduceFunDef*/) { throw new Error('reduce not supported'); } function ddocValidator(ddoc, viewName) { var view = ddoc.views[viewName]; // This doesn't actually need to be here apparently, but // I feel safer keeping it. /* istanbul ignore if */ if (!view.map || !view.map.fields) { throw new Error('ddoc ' + ddoc._id +' with view ' + viewName + ' doesn\'t have map.fields defined. ' + 'maybe it wasn\'t created by this plugin?'); } } var abstractMapper = Object(pouchdb_abstract_mapreduce__WEBPACK_IMPORTED_MODULE_4__["default"])( /* localDocName */ 'indexes', mapper, reducer, ddocValidator ); // normalize the "sort" value function massageSort(sort) { if (!Array.isArray(sort)) { throw new Error('invalid sort json - should be an array'); } return sort.map(function (sorting) { if (typeof sorting === 'string') { var obj = {}; obj[sorting] = 'asc'; return obj; } else { return sorting; } }); } function massageUseIndex(useIndex) { var cleanedUseIndex = []; if (typeof useIndex === 'string') { cleanedUseIndex.push(useIndex); } else { cleanedUseIndex = useIndex; } return cleanedUseIndex.map(function (name) { return name.replace('_design/', ''); }); } function massageIndexDef(indexDef) { indexDef.fields = indexDef.fields.map(function (field) { if (typeof field === 'string') { var obj = {}; obj[field] = 'asc'; return obj; } return field; }); return indexDef; } function getKeyFromDoc(doc, index) { var res = []; for (var i = 0; i < index.def.fields.length; i++) { var field = Object(pouchdb_selector_core__WEBPACK_IMPORTED_MODULE_3__["getKey"])(index.def.fields[i]); res.push(doc[field]); } return res; } // have to do this manually because REASONS. I don't know why // CouchDB didn't implement inclusive_start function filterInclusiveStart(rows, targetValue, index) { var indexFields = index.def.fields; for (var i = 0, len = rows.length; i < len; i++) { var row = rows[i]; // shave off any docs at the beginning that are <= the // target value var docKey = getKeyFromDoc(row.doc, index); if (indexFields.length === 1) { docKey = docKey[0]; // only one field, not multi-field } else { // more than one field in index // in the case where e.g. the user is searching {$gt: {a: 1}} // but the index is [a, b], then we need to shorten the doc key while (docKey.length > targetValue.length) { docKey.pop(); } } //ABS as we just looking for values that don't match if (Math.abs(Object(pouchdb_collate__WEBPACK_IMPORTED_MODULE_5__["collate"])(docKey, targetValue)) > 0) { // no need to filter any further; we're past the key break; } } return i > 0 ? rows.slice(i) : rows; } function reverseOptions(opts) { var newOpts = Object(pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__["clone"])(opts); delete newOpts.startkey; delete newOpts.endkey; delete newOpts.inclusive_start; delete newOpts.inclusive_end; if ('endkey' in opts) { newOpts.startkey = opts.endkey; } if ('startkey' in opts) { newOpts.endkey = opts.startkey; } if ('inclusive_start' in opts) { newOpts.inclusive_end = opts.inclusive_start; } if ('inclusive_end' in opts) { newOpts.inclusive_start = opts.inclusive_end; } return newOpts; } function validateIndex(index) { var ascFields = index.fields.filter(function (field) { return Object(pouchdb_selector_core__WEBPACK_IMPORTED_MODULE_3__["getValue"])(field) === 'asc'; }); if (ascFields.length !== 0 && ascFields.length !== index.fields.length) { throw new Error('unsupported mixed sorting'); } } function validateSort(requestDef, index) { if (index.defaultUsed && requestDef.sort) { var noneIdSorts = requestDef.sort.filter(function (sortItem) { return Object.keys(sortItem)[0] !== '_id'; }).map(function (sortItem) { return Object.keys(sortItem)[0]; }); if (noneIdSorts.length > 0) { throw new Error('Cannot sort on field(s) "' + noneIdSorts.join(',') + '" when using the default index'); } } if (index.defaultUsed) { return; } } function validateFindRequest(requestDef) { if (typeof requestDef.selector !== 'object') { throw new Error('you must provide a selector when you find()'); } /*var selectors = requestDef.selector['$and'] || [requestDef.selector]; for (var i = 0; i < selectors.length; i++) { var selector = selectors[i]; var keys = Object.keys(selector); if (keys.length === 0) { throw new Error('invalid empty selector'); } //var selection = selector[keys[0]]; /*if (Object.keys(selection).length !== 1) { throw new Error('invalid selector: ' + JSON.stringify(selection) + ' - it must have exactly one key/value'); } }*/ } // determine the maximum number of fields // we're going to need to query, e.g. if the user // has selection ['a'] and sorting ['a', 'b'], then we // need to use the longer of the two: ['a', 'b'] function getUserFields(selector, sort) { var selectorFields = Object.keys(selector); var sortFields = sort? sort.map(pouchdb_selector_core__WEBPACK_IMPORTED_MODULE_3__["getKey"]) : []; var userFields; if (selectorFields.length >= sortFields.length) { userFields = selectorFields; } else { userFields = sortFields; } if (sortFields.length === 0) { return { fields: userFields }; } // sort according to the user's preferred sorting userFields = userFields.sort(function (left, right) { var leftIdx = sortFields.indexOf(left); if (leftIdx === -1) { leftIdx = Number.MAX_VALUE; } var rightIdx = sortFields.indexOf(right); if (rightIdx === -1) { rightIdx = Number.MAX_VALUE; } return leftIdx < rightIdx ? -1 : leftIdx > rightIdx ? 1 : 0; }); return { fields: userFields, sortOrder: sort.map(pouchdb_selector_core__WEBPACK_IMPORTED_MODULE_3__["getKey"]) }; } function createIndex$1(db, requestDef) { requestDef = massageCreateIndexRequest(requestDef); var originalIndexDef = Object(pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__["clone"])(requestDef.index); requestDef.index = massageIndexDef(requestDef.index); validateIndex(requestDef.index); // calculating md5 is expensive - memoize and only // run if required var md5; function getMd5() { return md5 || (md5 = Object(pouchdb_md5__WEBPACK_IMPORTED_MODULE_6__["stringMd5"])(JSON.stringify(requestDef))); } var viewName = requestDef.name || ('idx-' + getMd5()); var ddocName = requestDef.ddoc || ('idx-' + getMd5()); var ddocId = '_design/' + ddocName; var hasInvalidLanguage = false; var viewExists = false; function updateDdoc(doc) { if (doc._rev && doc.language !== 'query') { hasInvalidLanguage = true; } doc.language = 'query'; doc.views = doc.views || {}; viewExists = !!doc.views[viewName]; if (viewExists) { return false; } doc.views[viewName] = { map: { fields: mergeObjects(requestDef.index.fields) }, reduce: '_count', options: { def: originalIndexDef } }; return doc; } db.constructor.emit('debug', ['find', 'creating index', ddocId]); return Object(pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__["upsert"])(db, ddocId, updateDdoc).then(function () { if (hasInvalidLanguage) { throw new Error('invalid language for ddoc with id "' + ddocId + '" (should be "query")'); } }).then(function () { // kick off a build // TODO: abstract-pouchdb-mapreduce should support auto-updating // TODO: should also use update_after, but pouchdb/pouchdb#3415 blocks me var signature = ddocName + '/' + viewName; return abstractMapper.query.call(db, signature, { limit: 0, reduce: false }).then(function () { return { id: ddocId, name: viewName, result: viewExists ? 'exists' : 'created' }; }); }); } function getIndexes$1(db) { // just search through all the design docs and filter in-memory. // hopefully there aren't that many ddocs. return db.allDocs({ startkey: '_design/', endkey: '_design/\uffff', include_docs: true }).then(function (allDocsRes) { var res = { indexes: [{ ddoc: null, name: '_all_docs', type: 'special', def: { fields: [{_id: 'asc'}] } }] }; res.indexes = flatten(res.indexes, allDocsRes.rows.filter(function (row) { return row.doc.language === 'query'; }).map(function (row) { var viewNames = row.doc.views !== undefined ? Object.keys(row.doc.views) : []; return viewNames.map(function (viewName) { var view = row.doc.views[viewName]; return { ddoc: row.id, name: viewName, type: 'json', def: massageIndexDef(view.options.def) }; }); })); // these are sorted by view name for some reason res.indexes.sort(function (left, right) { return Object(pouchdb_selector_core__WEBPACK_IMPORTED_MODULE_3__["compare"])(left.name, right.name); }); res.total_rows = res.indexes.length; return res; }); } // couchdb lowest collation value var COLLATE_LO = null; // couchdb highest collation value (TODO: well not really, but close enough amirite) var COLLATE_HI = {"\uffff": {}}; // couchdb second-lowest collation value function checkFieldInIndex(index, field) { var indexFields = index.def.fields.map(pouchdb_selector_core__WEBPACK_IMPORTED_MODULE_3__["getKey"]); for (var i = 0, len = indexFields.length; i < len; i++) { var indexField = indexFields[i]; if (field === indexField) { return true; } } return false; } // so when you do e.g. $eq/$eq, we can do it entirely in the database. // but when you do e.g. $gt/$eq, the first part can be done // in the database, but the second part has to be done in-memory, // because $gt has forced us to lose precision. // so that's what this determines function userOperatorLosesPrecision(selector, field) { var matcher = selector[field]; var userOperator = Object(pouchdb_selector_core__WEBPACK_IMPORTED_MODULE_3__["getKey"])(matcher); return userOperator !== '$eq'; } // sort the user fields by their position in the index, // if they're in the index function sortFieldsByIndex(userFields, index) { var indexFields = index.def.fields.map(pouchdb_selector_core__WEBPACK_IMPORTED_MODULE_3__["getKey"]); return userFields.slice().sort(function (a, b) { var aIdx = indexFields.indexOf(a); var bIdx = indexFields.indexOf(b); if (aIdx === -1) { aIdx = Number.MAX_VALUE; } if (bIdx === -1) { bIdx = Number.MAX_VALUE; } return Object(pouchdb_selector_core__WEBPACK_IMPORTED_MODULE_3__["compare"])(aIdx, bIdx); }); } // first pass to try to find fields that will need to be sorted in-memory function getBasicInMemoryFields(index, selector, userFields) { userFields = sortFieldsByIndex(userFields, index); // check if any of the user selectors lose precision var needToFilterInMemory = false; for (var i = 0, len = userFields.length; i < len; i++) { var field = userFields[i]; if (needToFilterInMemory || !checkFieldInIndex(index, field)) { return userFields.slice(i); } if (i < len - 1 && userOperatorLosesPrecision(selector, field)) { needToFilterInMemory = true; } } return []; } function getInMemoryFieldsFromNe(selector) { var fields = []; Object.keys(selector).forEach(function (field) { var matcher = selector[field]; Object.keys(matcher).forEach(function (operator) { if (operator === '$ne') { fields.push(field); } }); }); return fields; } function getInMemoryFields(coreInMemoryFields, index, selector, userFields) { var result = flatten( // in-memory fields reported as necessary by the query planner coreInMemoryFields, // combine with another pass that checks for any we may have missed getBasicInMemoryFields(index, selector, userFields), // combine with another pass that checks for $ne's getInMemoryFieldsFromNe(selector) ); return sortFieldsByIndex(uniq(result), index); } // check that at least one field in the user's query is represented // in the index. order matters in the case of sorts function checkIndexFieldsMatch(indexFields, sortOrder, fields) { if (sortOrder) { // array has to be a strict subarray of index array. furthermore, // the sortOrder fields need to all be represented in the index var sortMatches = oneArrayIsStrictSubArrayOfOther(sortOrder, indexFields); var selectorMatches = oneArrayIsSubArrayOfOther(fields, indexFields); return sortMatches && selectorMatches; } // all of the user's specified fields still need to be // on the left side of the index array, although the order // doesn't matter return oneSetIsSubArrayOfOther(fields, indexFields); } var logicalMatchers = ['$eq', '$gt', '$gte', '$lt', '$lte']; function isNonLogicalMatcher(matcher) { return logicalMatchers.indexOf(matcher) === -1; } // check all the index fields for usages of '$ne' // e.g. if the user queries {foo: {$ne: 'foo'}, bar: {$eq: 'bar'}}, // then we can neither use an index on ['foo'] nor an index on // ['foo', 'bar'], but we can use an index on ['bar'] or ['bar', 'foo'] function checkFieldsLogicallySound(indexFields, selector) { var firstField = indexFields[0]; var matcher = selector[firstField]; if (typeof matcher === 'undefined') { /* istanbul ignore next */ return true; } var hasLogicalOperator = Object.keys(matcher).some(function (matcherKey) { return !(isNonLogicalMatcher(matcherKey)); }); if (!hasLogicalOperator) { return false; } var isInvalidNe = Object.keys(matcher).length === 1 && Object(pouchdb_selector_core__WEBPACK_IMPORTED_MODULE_3__["getKey"])(matcher) === '$ne'; return !isInvalidNe; } function checkIndexMatches(index, sortOrder, fields, selector) { var indexFields = index.def.fields.map(pouchdb_selector_core__WEBPACK_IMPORTED_MODULE_3__["getKey"]); var fieldsMatch = checkIndexFieldsMatch(indexFields, sortOrder, fields); if (!fieldsMatch) { return false; } return checkFieldsLogicallySound(indexFields, selector); } // // the algorithm is very simple: // take all the fields the user supplies, and if those fields // are a strict subset of the fields in some index, // then use that index // // function findMatchingIndexes(selector, userFields, sortOrder, indexes) { return indexes.reduce(function (res, index) { var indexMatches = checkIndexMatches(index, sortOrder, userFields, selector); if (indexMatches) { res.push(index); } return res; }, []); } // find the best index, i.e. the one that matches the most fields // in the user's query function findBestMatchingIndex(selector, userFields, sortOrder, indexes, useIndex) { var matchingIndexes = findMatchingIndexes(selector, userFields, sortOrder, indexes); if (matchingIndexes.length === 0) { if (useIndex) { throw { error: "no_usable_index", message: "There is no index available for this selector." }; } //return `all_docs` as a default index; //I'm assuming that _all_docs is always first var defaultIndex = indexes[0]; defaultIndex.defaultUsed = true; return defaultIndex; } if (matchingIndexes.length === 1 && !useIndex) { return matchingIndexes[0]; } var userFieldsMap = arrayToObject(userFields); function scoreIndex(index) { var indexFields = index.def.fields.map(pouchdb_selector_core__WEBPACK_IMPORTED_MODULE_3__["getKey"]); var score = 0; for (var i = 0, len = indexFields.length; i < len; i++) { var indexField = indexFields[i]; if (userFieldsMap[indexField]) { score++; } } return score; } if (useIndex) { var useIndexDdoc = '_design/' + useIndex[0]; var useIndexName = useIndex.length === 2 ? useIndex[1] : false; var index = matchingIndexes.find(function (index) { if (useIndexName && index.ddoc === useIndexDdoc && useIndexName === index.name) { return true; } if (index.ddoc === useIndexDdoc) { /* istanbul ignore next */ return true; } return false; }); if (!index) { throw { error: "unknown_error", message: "Could not find that index or could not use that index for the query" }; } return index; } return max(matchingIndexes, scoreIndex); } function getSingleFieldQueryOptsFor(userOperator, userValue) { switch (userOperator) { case '$eq': return {key: userValue}; case '$lte': return {endkey: userValue}; case '$gte': return {startkey: userValue}; case '$lt': return { endkey: userValue, inclusive_end: false }; case '$gt': return { startkey: userValue, inclusive_start: false }; } } function getSingleFieldCoreQueryPlan(selector, index) { var field = Object(pouchdb_selector_core__WEBPACK_IMPORTED_MODULE_3__["getKey"])(index.def.fields[0]); //ignoring this because the test to exercise the branch is skipped at the moment /* istanbul ignore next */ var matcher = selector[field] || {}; var inMemoryFields = []; var userOperators = Object.keys(matcher); var combinedOpts; userOperators.forEach(function (userOperator) { if (isNonLogicalMatcher(userOperator)) { inMemoryFields.push(field); return; } var userValue = matcher[userOperator]; var newQueryOpts = getSingleFieldQueryOptsFor(userOperator, userValue); if (combinedOpts) { combinedOpts = mergeObjects([combinedOpts, newQueryOpts]); } else { combinedOpts = newQueryOpts; } }); return { queryOpts: combinedOpts, inMemoryFields: inMemoryFields }; } function getMultiFieldCoreQueryPlan(userOperator, userValue) { switch (userOperator) { case '$eq': return { startkey: userValue, endkey: userValue }; case '$lte': return { endkey: userValue }; case '$gte': return { startkey: userValue }; case '$lt': return { endkey: userValue, inclusive_end: false }; case '$gt': return { startkey: userValue, inclusive_start: false }; } } function getMultiFieldQueryOpts(selector, index) { var indexFields = index.def.fields.map(pouchdb_selector_core__WEBPACK_IMPORTED_MODULE_3__["getKey"]); var inMemoryFields = []; var startkey = []; var endkey = []; var inclusiveStart; var inclusiveEnd; function finish(i) { if (inclusiveStart !== false) { startkey.push(COLLATE_LO); } if (inclusiveEnd !== false) { endkey.push(COLLATE_HI); } // keep track of the fields where we lost specificity, // and therefore need to filter in-memory inMemoryFields = indexFields.slice(i); } for (var i = 0, len = indexFields.length; i < len; i++) { var indexField = indexFields[i]; var matcher = selector[indexField]; if (!matcher || !Object.keys(matcher).length) { // fewer fields in user query than in index finish(i); break; } else if (i > 0) { if (Object.keys(matcher).some(isNonLogicalMatcher)) { // non-logical are ignored finish(i); break; } var usingGtlt = ( '$gt' in matcher || '$gte' in matcher || '$lt' in matcher || '$lte' in matcher); var previousKeys = Object.keys(selector[indexFields[i - 1]]); var previousWasEq = arrayEquals(previousKeys, ['$eq']); var previousWasSame = arrayEquals(previousKeys, Object.keys(matcher)); var gtltLostSpecificity = usingGtlt && !previousWasEq && !previousWasSame; if (gtltLostSpecificity) { finish(i); break; } } var userOperators = Object.keys(matcher); var combinedOpts = null; for (var j = 0; j < userOperators.length; j++) { var userOperator = userOperators[j]; var userValue = matcher[userOperator]; var newOpts = getMultiFieldCoreQueryPlan(userOperator, userValue); if (combinedOpts) { combinedOpts = mergeObjects([combinedOpts, newOpts]); } else { combinedOpts = newOpts; } } startkey.push('startkey' in combinedOpts ? combinedOpts.startkey : COLLATE_LO); endkey.push('endkey' in combinedOpts ? combinedOpts.endkey : COLLATE_HI); if ('inclusive_start' in combinedOpts) { inclusiveStart = combinedOpts.inclusive_start; } if ('inclusive_end' in combinedOpts) { inclusiveEnd = combinedOpts.inclusive_end; } } var res = { startkey: startkey, endkey: endkey }; if (typeof inclusiveStart !== 'undefined') { res.inclusive_start = inclusiveStart; } if (typeof inclusiveEnd !== 'undefined') { res.inclusive_end = inclusiveEnd; } return { queryOpts: res, inMemoryFields: inMemoryFields }; } function getDefaultQueryPlan(selector) { //using default index, so all fields need to be done in memory return { queryOpts: {startkey: null}, inMemoryFields: [Object.keys(selector)] }; } function getCoreQueryPlan(selector, index) { if (index.defaultUsed) { return getDefaultQueryPlan(selector, index); } if (index.def.fields.length === 1) { // one field in index, so the value was indexed as a singleton return getSingleFieldCoreQueryPlan(selector, index); } // else index has multiple fields, so the value was indexed as an array return getMultiFieldQueryOpts(selector, index); } function planQuery(request, indexes) { var selector = request.selector; var sort = request.sort; var userFieldsRes = getUserFields(selector, sort); var userFields = userFieldsRes.fields; var sortOrder = userFieldsRes.sortOrder; var index = findBestMatchingIndex(selector, userFields, sortOrder, indexes, request.use_index); var coreQueryPlan = getCoreQueryPlan(selector, index); var queryOpts = coreQueryPlan.queryOpts; var coreInMemoryFields = coreQueryPlan.inMemoryFields; var inMemoryFields = getInMemoryFields(coreInMemoryFields, index, selector, userFields); var res = { queryOpts: queryOpts, index: index, inMemoryFields: inMemoryFields }; return res; } function indexToSignature(index) { // remove '_design/' return index.ddoc.substring(8) + '/' + index.name; } function doAllDocs(db, originalOpts) { var opts = Object(pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__["clone"])(originalOpts); // CouchDB responds in weird ways when you provide a non-string to _id; // we mimic the behavior for consistency. See issue66 tests for details. if (opts.descending) { if ('endkey' in opts && typeof opts.endkey !== 'string') { opts.endkey = ''; } if ('startkey' in opts && typeof opts.startkey !== 'string') { opts.limit = 0; } } else { if ('startkey' in opts && typeof opts.startkey !== 'string') { opts.startkey = ''; } if ('endkey' in opts && typeof opts.endkey !== 'string') { opts.limit = 0; } } if ('key' in opts && typeof opts.key !== 'string') { opts.limit = 0; } return db.allDocs(opts) .then(function (res) { // filter out any design docs that _all_docs might return res.rows = res.rows.filter(function (row) { return !/^_design\//.test(row.id); }); return res; }); } function find$1(db, requestDef, explain) { if (requestDef.selector) { requestDef.selector = Object(pouchdb_selector_core__WEBPACK_IMPORTED_MODULE_3__["massageSelector"])(requestDef.selector); } if (requestDef.sort) { requestDef.sort = massageSort(requestDef.sort); } if (requestDef.use_index) { requestDef.use_index = massageUseIndex(requestDef.use_index); } validateFindRequest(requestDef); return getIndexes$1(db).then(function (getIndexesRes) { db.constructor.emit('debug', ['find', 'planning query', requestDef]); var queryPlan = planQuery(requestDef, getIndexesRes.indexes); db.constructor.emit('debug', ['find', 'query plan', queryPlan]); var indexToUse = queryPlan.index; validateSort(requestDef, indexToUse); var opts = Object(pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__["assign"])({ include_docs: true, reduce: false }, queryPlan.queryOpts); if ('startkey' in opts && 'endkey' in opts && Object(pouchdb_collate__WEBPACK_IMPORTED_MODULE_5__["collate"])(opts.startkey, opts.endkey) > 0) { // can't possibly return any results, startkey > endkey /* istanbul ignore next */ return {docs: []}; } var isDescending = requestDef.sort && typeof requestDef.sort[0] !== 'string' && Object(pouchdb_selector_core__WEBPACK_IMPORTED_MODULE_3__["getValue"])(requestDef.sort[0]) === 'desc'; if (isDescending) { // either all descending or all ascending opts.descending = true; opts = reverseOptions(opts); } if (!queryPlan.inMemoryFields.length) { // no in-memory filtering necessary, so we can let the // database do the limit/skip for us if ('limit' in requestDef) { opts.limit = requestDef.limit; } if ('skip' in requestDef) { opts.skip = requestDef.skip; } } if (explain) { return Promise.resolve(queryPlan, opts); } return Promise.resolve().then(function () { if (indexToUse.name === '_all_docs') { return doAllDocs(db, opts); } else { var signature = indexToSignature(indexToUse); return abstractMapper.query.call(db, signature, opts); } }).then(function (res) { if (opts.inclusive_start === false) { // may have to manually filter the first one, // since couchdb has no true inclusive_start option res.rows = filterInclusiveStart(res.rows, opts.startkey, indexToUse); } if (queryPlan.inMemoryFields.length) { // need to filter some stuff in-memory res.rows = Object(pouchdb_selector_core__WEBPACK_IMPORTED_MODULE_3__["filterInMemoryFields"])(res.rows, requestDef, queryPlan.inMemoryFields); } var resp = { docs: res.rows.map(function (row) { var doc = row.doc; if (requestDef.fields) { return pick(doc, requestDef.fields); } return doc; }) }; if (indexToUse.defaultUsed) { resp.warning = 'no matching index found, create an index to optimize query time'; } return resp; }); }); } function explain$1(db, requestDef) { return find$1(db, requestDef, true) .then(function (queryPlan) { return { dbname: db.name, index: queryPlan.index, selector: requestDef.selector, range: { start_key: queryPlan.queryOpts.startkey, end_key: queryPlan.queryOpts.endkey, }, opts: { use_index: requestDef.use_index || [], bookmark: "nil", //hardcoded to match CouchDB since its not supported, limit: requestDef.limit, skip: requestDef.skip, sort: requestDef.sort || {}, fields: requestDef.fields, conflicts: false, //hardcoded to match CouchDB since its not supported, r: [49], // hardcoded to match CouchDB since its not support }, limit: requestDef.limit, skip: requestDef.skip || 0, fields: requestDef.fields, }; }); } function deleteIndex$1(db, index) { if (!index.ddoc) { throw new Error('you must supply an index.ddoc when deleting'); } if (!index.name) { throw new Error('you must supply an index.name when deleting'); } var docId = index.ddoc; var viewName = index.name; function deltaFun(doc) { if (Object.keys(doc.views).length === 1 && doc.views[viewName]) { // only one view in this ddoc, delete the whole ddoc return {_id: docId, _deleted: true}; } // more than one view here, just remove the view delete doc.views[viewName]; return doc; } return Object(pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__["upsert"])(db, docId, deltaFun).then(function () { return abstractMapper.viewCleanup.apply(db); }).then(function () { return {ok: true}; }); } var createIndexAsCallback = callbackify(createIndex$1); var findAsCallback = callbackify(find$1); var explainAsCallback = callbackify(explain$1); var getIndexesAsCallback = callbackify(getIndexes$1); var deleteIndexAsCallback = callbackify(deleteIndex$1); var plugin = {}; plugin.createIndex = Object(pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__["toPromise"])(function (requestDef, callback) { if (typeof requestDef !== 'object') { return callback(new Error('you must provide an index to create')); } var createIndex$$1 = Object(pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__["isRemote"])(this) ? createIndex : createIndexAsCallback; createIndex$$1(this, requestDef, callback); }); plugin.find = Object(pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__["toPromise"])(function (requestDef, callback) { if (typeof callback === 'undefined') { callback = requestDef; requestDef = undefined; } if (typeof requestDef !== 'object') { return callback(new Error('you must provide search parameters to find()')); } var find$$1 = Object(pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__["isRemote"])(this) ? find : findAsCallback; find$$1(this, requestDef, callback); }); plugin.explain = Object(pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__["toPromise"])(function (requestDef, callback) { if (typeof callback === 'undefined') { callback = requestDef; requestDef = undefined; } if (typeof requestDef !== 'object') { return callback(new Error('you must provide search parameters to explain()')); } var find$$1 = Object(pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__["isRemote"])(this) ? explain : explainAsCallback; find$$1(this, requestDef, callback); }); plugin.getIndexes = Object(pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__["toPromise"])(function (callback) { var getIndexes$$1 = Object(pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__["isRemote"])(this) ? getIndexes : getIndexesAsCallback; getIndexes$$1(this, callback); }); plugin.deleteIndex = Object(pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__["toPromise"])(function (indexDef, callback) { if (typeof indexDef !== 'object') { return callback(new Error('you must provide an index to delete')); } var deleteIndex$$1 = Object(pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__["isRemote"])(this) ? deleteIndex : deleteIndexAsCallback; deleteIndex$$1(this, indexDef, callback); }); /* harmony default export */ __webpack_exports__["default"] = (plugin); /***/ }), /* 706 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "adapterFun", function() { return adapterFun; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "assign", function() { return assign$1; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bulkGetShim", function() { return bulkGet; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "changesHandler", function() { return Changes; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return clone$1; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultBackOff", function() { return defaultBackOff; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "explainError", function() { return res; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "filterChange", function() { return filterChange; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return flatten; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "functionName", function() { return res$2; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "guardedConsole", function() { return guardedConsole; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasLocalStorage", function() { return hasLocalStorage; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "invalidIdError", function() { return invalidIdError; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isRemote", function() { return isRemote; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "listenerCount", function() { return listenerCount; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "nextTick", function() { return nextTick; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeDdocFunctionName", function() { return normalizeDesignDocFunctionName; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "once", function() { return once; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseDdocFunctionName", function() { return parseDesignDocFunctionName; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseUri", function() { return parseUri; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pick", function() { return pick; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rev", function() { return rev; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scopeEval", function() { return scopeEval; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toPromise", function() { return toPromise; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "upsert", function() { return upsert; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "uuid", function() { return uuid; }); /* harmony import */ var clone_buffer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(707); /* harmony import */ var clone_buffer__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(clone_buffer__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var argsarray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(694); /* harmony import */ var argsarray__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(argsarray__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var pouchdb_collections__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(708); /* harmony import */ var events__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(268); /* harmony import */ var events__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(events__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(709); /* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(inherits__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var pouchdb_errors__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(711); /* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(699); /* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(uuid__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var pouchdb_md5__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(714); /* harmony import */ var pouchdb_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(706); function isBinaryObject(object) { return object instanceof Buffer; } // most of this is borrowed from lodash.isPlainObject: // https://github.com/fis-components/lodash.isplainobject/ // blob/29c358140a74f252aeb08c9eb28bef86f2217d4a/index.js var funcToString = Function.prototype.toString; var objectCtorString = funcToString.call(Object); function isPlainObject(value) { var proto = Object.getPrototypeOf(value); /* istanbul ignore if */ if (proto === null) { // not sure when this happens, but I guess it can return true; } var Ctor = proto.constructor; return (typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString); } function clone$1(object) { var newObject; var i; var len; if (!object || typeof object !== 'object') { return object; } if (Array.isArray(object)) { newObject = []; for (i = 0, len = object.length; i < len; i++) { newObject[i] = clone$1(object[i]); } return newObject; } // special case: to avoid inconsistencies between IndexedDB // and other backends, we automatically stringify Dates if (object instanceof Date) { return object.toISOString(); } if (isBinaryObject(object)) { return clone_buffer__WEBPACK_IMPORTED_MODULE_0___default()(object); } if (!isPlainObject(object)) { return object; // don't clone objects like Workers } newObject = {}; for (i in object) { /* istanbul ignore else */ if (Object.prototype.hasOwnProperty.call(object, i)) { var value = clone$1(object[i]); if (typeof value !== 'undefined') { newObject[i] = value; } } } return newObject; } function once(fun) { var called = false; return argsarray__WEBPACK_IMPORTED_MODULE_1___default()(function (args) { /* istanbul ignore if */ if (called) { // this is a smoke test and should never actually happen throw new Error('once called more than once'); } else { called = true; fun.apply(this, args); } }); } function toPromise(func) { //create the function we will be returning return argsarray__WEBPACK_IMPORTED_MODULE_1___default()(function (args) { // Clone arguments args = clone$1(args); var self = this; // if the last argument is a function, assume its a callback var usedCB = (typeof args[args.length - 1] === 'function') ? args.pop() : false; var promise = new Promise(function (fulfill, reject) { var resp; try { var callback = once(function (err, mesg) { if (err) { reject(err); } else { fulfill(mesg); } }); // create a callback for this invocation // apply the function in the orig context args.push(callback); resp = func.apply(self, args); if (resp && typeof resp.then === 'function') { fulfill(resp); } } catch (e) { reject(e); } }); // if there is a callback, call it back if (usedCB) { promise.then(function (result) { usedCB(null, result); }, usedCB); } return promise; }); } function logApiCall(self, name, args) { /* istanbul ignore if */ if (self.constructor.listeners('debug').length) { var logArgs = ['api', self.name, name]; for (var i = 0; i < args.length - 1; i++) { logArgs.push(args[i]); } self.constructor.emit('debug', logArgs); // override the callback itself to log the response var origCallback = args[args.length - 1]; args[args.length - 1] = function (err, res) { var responseArgs = ['api', self.name, name]; responseArgs = responseArgs.concat( err ? ['error', err] : ['success', res] ); self.constructor.emit('debug', responseArgs); origCallback(err, res); }; } } function adapterFun(name, callback) { return toPromise(argsarray__WEBPACK_IMPORTED_MODULE_1___default()(function (args) { if (this._closed) { return Promise.reject(new Error('database is closed')); } if (this._destroyed) { return Promise.reject(new Error('database is destroyed')); } var self = this; logApiCall(self, name, args); if (!this.taskqueue.isReady) { return new Promise(function (fulfill, reject) { self.taskqueue.addTask(function (failed) { if (failed) { reject(failed); } else { fulfill(self[name].apply(self, args)); } }); }); } return callback.apply(this, args); })); } // like underscore/lodash _.pick() function pick(obj, arr) { var res = {}; for (var i = 0, len = arr.length; i < len; i++) { var prop = arr[i]; if (prop in obj) { res[prop] = obj[prop]; } } return res; } // Most browsers throttle concurrent requests at 6, so it's silly // to shim _bulk_get by trying to launch potentially hundreds of requests // and then letting the majority time out. We can handle this ourselves. var MAX_NUM_CONCURRENT_REQUESTS = 6; function identityFunction(x) { return x; } function formatResultForOpenRevsGet(result) { return [{ ok: result }]; } // shim for P/CouchDB adapters that don't directly implement _bulk_get function bulkGet(db, opts, callback) { var requests = opts.docs; // consolidate into one request per doc if possible var requestsById = new pouchdb_collections__WEBPACK_IMPORTED_MODULE_2__["Map"](); requests.forEach(function (request) { if (requestsById.has(request.id)) { requestsById.get(request.id).push(request); } else { requestsById.set(request.id, [request]); } }); var numDocs = requestsById.size; var numDone = 0; var perDocResults = new Array(numDocs); function collapseResultsAndFinish() { var results = []; perDocResults.forEach(function (res) { res.docs.forEach(function (info) { results.push({ id: res.id, docs: [info] }); }); }); callback(null, {results: results}); } function checkDone() { if (++numDone === numDocs) { collapseResultsAndFinish(); } } function gotResult(docIndex, id, docs) { perDocResults[docIndex] = {id: id, docs: docs}; checkDone(); } var allRequests = []; requestsById.forEach(function (value, key) { allRequests.push(key); }); var i = 0; function nextBatch() { if (i >= allRequests.length) { return; } var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length); var batch = allRequests.slice(i, upTo); processBatch(batch, i); i += batch.length; } function processBatch(batch, offset) { batch.forEach(function (docId, j) { var docIdx = offset + j; var docRequests = requestsById.get(docId); // just use the first request as the "template" // TODO: The _bulk_get API allows for more subtle use cases than this, // but for now it is unlikely that there will be a mix of different // "atts_since" or "attachments" in the same request, since it's just // replicate.js that is using this for the moment. // Also, atts_since is aspirational, since we don't support it yet. var docOpts = pick(docRequests[0], ['atts_since', 'attachments']); docOpts.open_revs = docRequests.map(function (request) { // rev is optional, open_revs disallowed return request.rev; }); // remove falsey / undefined revisions docOpts.open_revs = docOpts.open_revs.filter(identityFunction); var formatResult = identityFunction; if (docOpts.open_revs.length === 0) { delete docOpts.open_revs; // when fetching only the "winning" leaf, // transform the result so it looks like an open_revs // request formatResult = formatResultForOpenRevsGet; } // globally-supplied options ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) { if (param in opts) { docOpts[param] = opts[param]; } }); db.get(docId, docOpts, function (err, res) { var result; /* istanbul ignore if */ if (err) { result = [{error: err}]; } else { result = formatResult(res); } gotResult(docIdx, docId, result); nextBatch(); }); }); } nextBatch(); } // in Node of course this is false function hasLocalStorage() { return false; } function nextTick(fn) { process.nextTick(fn); } inherits__WEBPACK_IMPORTED_MODULE_4___default()(Changes, events__WEBPACK_IMPORTED_MODULE_3__["EventEmitter"]); /* istanbul ignore next */ function attachBrowserEvents(self) { if (hasLocalStorage()) { addEventListener("storage", function (e) { self.emit(e.key); }); } } function Changes() { events__WEBPACK_IMPORTED_MODULE_3__["EventEmitter"].call(this); this._listeners = {}; attachBrowserEvents(this); } Changes.prototype.addListener = function (dbName, id, db, opts) { /* istanbul ignore if */ if (this._listeners[id]) { return; } var self = this; var inprogress = false; function eventFunction() { /* istanbul ignore if */ if (!self._listeners[id]) { return; } if (inprogress) { inprogress = 'waiting'; return; } inprogress = true; var changesOpts = pick(opts, [ 'style', 'include_docs', 'attachments', 'conflicts', 'filter', 'doc_ids', 'view', 'since', 'query_params', 'binary', 'return_docs' ]); /* istanbul ignore next */ function onError() { inprogress = false; } db.changes(changesOpts).on('change', function (c) { if (c.seq > opts.since && !opts.cancelled) { opts.since = c.seq; opts.onChange(c); } }).on('complete', function () { if (inprogress === 'waiting') { nextTick(eventFunction); } inprogress = false; }).on('error', onError); } this._listeners[id] = eventFunction; this.on(dbName, eventFunction); }; Changes.prototype.removeListener = function (dbName, id) { /* istanbul ignore if */ if (!(id in this._listeners)) { return; } events__WEBPACK_IMPORTED_MODULE_3__["EventEmitter"].prototype.removeListener.call(this, dbName, this._listeners[id]); delete this._listeners[id]; }; /* istanbul ignore next */ Changes.prototype.notifyLocalWindows = function (dbName) { //do a useless change on a storage thing //in order to get other windows's listeners to activate if (hasLocalStorage()) { localStorage[dbName] = (localStorage[dbName] === "a") ? "b" : "a"; } }; Changes.prototype.notify = function (dbName) { this.emit(dbName); this.notifyLocalWindows(dbName); }; function guardedConsole(method) { /* istanbul ignore else */ if (typeof console !== 'undefined' && typeof console[method] === 'function') { var args = Array.prototype.slice.call(arguments, 1); console[method].apply(console, args); } } function randomNumber(min, max) { var maxTimeout = 600000; // Hard-coded default of 10 minutes min = parseInt(min, 10) || 0; max = parseInt(max, 10); if (max !== max || max <= min) { max = (min || 1) << 1; //doubling } else { max = max + 1; } // In order to not exceed maxTimeout, pick a random value between half of maxTimeout and maxTimeout if (max > maxTimeout) { min = maxTimeout >> 1; // divide by two max = maxTimeout; } var ratio = Math.random(); var range = max - min; return ~~(range * ratio + min); // ~~ coerces to an int, but fast. } function defaultBackOff(min) { var max = 0; if (!min) { max = 2000; } return randomNumber(min, max); } // We assume Node users don't need to see this warning var res = function () {}; var assign; { if (typeof Object.assign === 'function') { assign = Object.assign; } else { // lite Object.assign polyfill based on // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign assign = function (target) { var to = Object(target); for (var index = 1; index < arguments.length; index++) { var nextSource = arguments[index]; if (nextSource != null) { // Skip over if undefined or null for (var nextKey in nextSource) { // Avoid bugs when hasOwnProperty is shadowed if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) { to[nextKey] = nextSource[nextKey]; } } } } return to; }; } } var assign$1 = assign; function tryFilter(filter, doc, req) { try { return !filter(doc, req); } catch (err) { var msg = 'Filter function threw: ' + err.toString(); return Object(pouchdb_errors__WEBPACK_IMPORTED_MODULE_5__["createError"])(pouchdb_errors__WEBPACK_IMPORTED_MODULE_5__["BAD_REQUEST"], msg); } } function filterChange(opts) { var req = {}; var hasFilter = opts.filter && typeof opts.filter === 'function'; req.query = opts.query_params; return function filter(change) { if (!change.doc) { // CSG sends events on the changes feed that don't have documents, // this hack makes a whole lot of existing code robust. change.doc = {}; } var filterReturn = hasFilter && tryFilter(opts.filter, change.doc, req); if (typeof filterReturn === 'object') { return filterReturn; } if (filterReturn) { return false; } if (!opts.include_docs) { delete change.doc; } else if (!opts.attachments) { for (var att in change.doc._attachments) { /* istanbul ignore else */ if (change.doc._attachments.hasOwnProperty(att)) { change.doc._attachments[att].stub = true; } } } return true; }; } function flatten(arrs) { var res = []; for (var i = 0, len = arrs.length; i < len; i++) { res = res.concat(arrs[i]); } return res; } // shim for Function.prototype.name, // for browsers that don't support it like IE /* istanbul ignore next */ function f() {} var hasName = f.name; var res$1; // We dont run coverage in IE /* istanbul ignore else */ if (hasName) { res$1 = function (fun) { return fun.name; }; } else { res$1 = function (fun) { var match = fun.toString().match(/^\s*function\s*(?:(\S+)\s*)?\(/); if (match && match[1]) { return match[1]; } else { return ''; } }; } var res$2 = res$1; // Determine id an ID is valid // - invalid IDs begin with an underescore that does not begin '_design' or // '_local' // - any other string value is a valid id // Returns the specific error object for each case function invalidIdError(id) { var err; if (!id) { err = Object(pouchdb_errors__WEBPACK_IMPORTED_MODULE_5__["createError"])(pouchdb_errors__WEBPACK_IMPORTED_MODULE_5__["MISSING_ID"]); } else if (typeof id !== 'string') { err = Object(pouchdb_errors__WEBPACK_IMPORTED_MODULE_5__["createError"])(pouchdb_errors__WEBPACK_IMPORTED_MODULE_5__["INVALID_ID"]); } else if (/^_/.test(id) && !(/^_(design|local)/).test(id)) { err = Object(pouchdb_errors__WEBPACK_IMPORTED_MODULE_5__["createError"])(pouchdb_errors__WEBPACK_IMPORTED_MODULE_5__["RESERVED_ID"]); } if (err) { throw err; } } // Checks if a PouchDB object is "remote" or not. This is function isRemote(db) { if (typeof db._remote === 'boolean') { return db._remote; } /* istanbul ignore next */ if (typeof db.type === 'function') { guardedConsole('warn', 'db.type() is deprecated and will be removed in ' + 'a future version of PouchDB'); return db.type() === 'http'; } /* istanbul ignore next */ return false; } function listenerCount(ee, type) { return 'listenerCount' in ee ? ee.listenerCount(type) : events__WEBPACK_IMPORTED_MODULE_3__["EventEmitter"].listenerCount(ee, type); } function parseDesignDocFunctionName(s) { if (!s) { return null; } var parts = s.split('/'); if (parts.length === 2) { return parts; } if (parts.length === 1) { return [s, s]; } return null; } function normalizeDesignDocFunctionName(s) { var normalized = parseDesignDocFunctionName(s); return normalized ? normalized.join('/') : null; } // originally parseUri 1.2.2, now patched by us // (c) Steven Levithan <stevenlevithan.com> // MIT License var keys = ["source", "protocol", "authority", "userInfo", "user", "password", "host", "port", "relative", "path", "directory", "file", "query", "anchor"]; var qName ="queryKey"; var qParser = /(?:^|&)([^&=]*)=?([^&]*)/g; // use the "loose" parser /* eslint maxlen: 0, no-useless-escape: 0 */ var parser = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/; function parseUri(str) { var m = parser.exec(str); var uri = {}; var i = 14; while (i--) { var key = keys[i]; var value = m[i] || ""; var encoded = ['user', 'password'].indexOf(key) !== -1; uri[key] = encoded ? decodeURIComponent(value) : value; } uri[qName] = {}; uri[keys[12]].replace(qParser, function ($0, $1, $2) { if ($1) { uri[qName][$1] = $2; } }); return uri; } // Based on https://github.com/alexdavid/scope-eval v0.0.3 // (source: https://unpkg.com/scope-eval@0.0.3/scope_eval.js) // This is basically just a wrapper around new Function() function scopeEval(source, scope) { var keys = []; var values = []; for (var key in scope) { if (scope.hasOwnProperty(key)) { keys.push(key); values.push(scope[key]); } } keys.push(source); return Function.apply(null, keys).apply(null, values); } // this is essentially the "update sugar" function from daleharvey/pouchdb#1388 // the diffFun tells us what delta to apply to the doc. it either returns // the doc, or false if it doesn't need to do an update after all function upsert(db, docId, diffFun) { return new Promise(function (fulfill, reject) { db.get(docId, function (err, doc) { if (err) { /* istanbul ignore next */ if (err.status !== 404) { return reject(err); } doc = {}; } // the user might change the _rev, so save it for posterity var docRev = doc._rev; var newDoc = diffFun(doc); if (!newDoc) { // if the diffFun returns falsy, we short-circuit as // an optimization return fulfill({updated: false, rev: docRev}); } // users aren't allowed to modify these values, // so reset them here newDoc._id = docId; newDoc._rev = docRev; fulfill(tryAndPut(db, newDoc, diffFun)); }); }); } function tryAndPut(db, doc, diffFun) { return db.put(doc).then(function (res) { return { updated: true, rev: res.rev }; }, function (err) { /* istanbul ignore next */ if (err.status !== 409) { throw err; } return upsert(db, doc._id, diffFun); }); } function rev(doc, deterministic_revs) { var clonedDoc = Object(pouchdb_utils__WEBPACK_IMPORTED_MODULE_8__["clone"])(doc); if (!deterministic_revs) { return uuid__WEBPACK_IMPORTED_MODULE_6___default.a.v4().replace(/-/g, '').toLowerCase(); } delete clonedDoc._rev_tree; return Object(pouchdb_md5__WEBPACK_IMPORTED_MODULE_7__["stringMd5"])(JSON.stringify(clonedDoc)); } var uuid = uuid__WEBPACK_IMPORTED_MODULE_6___default.a.v4; /***/ }), /* 707 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Buffer = __webpack_require__(96).Buffer; function hasFrom() { // Node versions 5.x below 5.10 seem to have a `from` method // However, it doesn't clone Buffers // Luckily, it reports as `false` to hasOwnProperty return (Buffer.hasOwnProperty('from') && typeof Buffer.from === 'function'); } function cloneBuffer(buf) { if (!Buffer.isBuffer(buf)) { throw new Error('Can only clone Buffer.'); } if (hasFrom()) { return Buffer.from(buf); } var copy = new Buffer(buf.length); buf.copy(copy); return copy; } cloneBuffer.hasFrom = hasFrom; module.exports = cloneBuffer; /***/ }), /* 708 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Set", function() { return ExportedSet; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Map", function() { return ExportedMap; }); function mangle(key) { return '$' + key; } function unmangle(key) { return key.substring(1); } function Map$1() { this._store = {}; } Map$1.prototype.get = function (key) { var mangled = mangle(key); return this._store[mangled]; }; Map$1.prototype.set = function (key, value) { var mangled = mangle(key); this._store[mangled] = value; return true; }; Map$1.prototype.has = function (key) { var mangled = mangle(key); return mangled in this._store; }; Map$1.prototype.delete = function (key) { var mangled = mangle(key); var res = mangled in this._store; delete this._store[mangled]; return res; }; Map$1.prototype.forEach = function (cb) { var keys = Object.keys(this._store); for (var i = 0, len = keys.length; i < len; i++) { var key = keys[i]; var value = this._store[key]; key = unmangle(key); cb(value, key); } }; Object.defineProperty(Map$1.prototype, 'size', { get: function () { return Object.keys(this._store).length; } }); function Set$1(array) { this._store = new Map$1(); // init with an array if (array && Array.isArray(array)) { for (var i = 0, len = array.length; i < len; i++) { this.add(array[i]); } } } Set$1.prototype.add = function (key) { return this._store.set(key, true); }; Set$1.prototype.has = function (key) { return this._store.has(key); }; Set$1.prototype.forEach = function (cb) { this._store.forEach(function (value, key) { cb(key); }); }; Object.defineProperty(Set$1.prototype, 'size', { get: function () { return this._store.size; } }); /* global Map,Set,Symbol */ // Based on https://kangax.github.io/compat-table/es6/ we can sniff out // incomplete Map/Set implementations which would otherwise cause our tests to fail. // Notably they fail in IE11 and iOS 8.4, which this prevents. function supportsMapAndSet() { if (typeof Symbol === 'undefined' || typeof Map === 'undefined' || typeof Set === 'undefined') { return false; } var prop = Object.getOwnPropertyDescriptor(Map, Symbol.species); return prop && 'get' in prop && Map[Symbol.species] === Map; } // based on https://github.com/montagejs/collections var ExportedSet; var ExportedMap; { if (supportsMapAndSet()) { // prefer built-in Map/Set ExportedSet = Set; ExportedMap = Map; } else { // fall back to our polyfill ExportedSet = Set$1; ExportedMap = Map$1; } } /***/ }), /* 709 */ /***/ (function(module, exports, __webpack_require__) { try { var util = __webpack_require__(9); if (typeof util.inherits !== 'function') throw ''; module.exports = util.inherits; } catch (e) { module.exports = __webpack_require__(710); } /***/ }), /* 710 */ /***/ (function(module, exports) { if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { ctor.super_ = superCtor ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }); }; } else { // old school shim for old browsers module.exports = function inherits(ctor, superCtor) { ctor.super_ = superCtor var TempCtor = function () {} TempCtor.prototype = superCtor.prototype ctor.prototype = new TempCtor() ctor.prototype.constructor = ctor } } /***/ }), /* 711 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UNAUTHORIZED", function() { return UNAUTHORIZED; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MISSING_BULK_DOCS", function() { return MISSING_BULK_DOCS; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MISSING_DOC", function() { return MISSING_DOC; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "REV_CONFLICT", function() { return REV_CONFLICT; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "INVALID_ID", function() { return INVALID_ID; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MISSING_ID", function() { return MISSING_ID; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RESERVED_ID", function() { return RESERVED_ID; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NOT_OPEN", function() { return NOT_OPEN; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UNKNOWN_ERROR", function() { return UNKNOWN_ERROR; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BAD_ARG", function() { return BAD_ARG; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "INVALID_REQUEST", function() { return INVALID_REQUEST; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QUERY_PARSE_ERROR", function() { return QUERY_PARSE_ERROR; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DOC_VALIDATION", function() { return DOC_VALIDATION; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BAD_REQUEST", function() { return BAD_REQUEST; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NOT_AN_OBJECT", function() { return NOT_AN_OBJECT; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DB_MISSING", function() { return DB_MISSING; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WSQ_ERROR", function() { return WSQ_ERROR; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LDB_ERROR", function() { return LDB_ERROR; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FORBIDDEN", function() { return FORBIDDEN; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "INVALID_REV", function() { return INVALID_REV; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FILE_EXISTS", function() { return FILE_EXISTS; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MISSING_STUB", function() { return MISSING_STUB; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IDB_ERROR", function() { return IDB_ERROR; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "INVALID_URL", function() { return INVALID_URL; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createError", function() { return createError; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "generateErrorFromResponse", function() { return generateErrorFromResponse; }); /* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(712); /* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(inherits__WEBPACK_IMPORTED_MODULE_0__); inherits__WEBPACK_IMPORTED_MODULE_0___default()(PouchError, Error); function PouchError(status, error, reason) { Error.call(this, reason); this.status = status; this.name = error; this.message = reason; this.error = true; } PouchError.prototype.toString = function () { return JSON.stringify({ status: this.status, name: this.name, message: this.message, reason: this.reason }); }; var UNAUTHORIZED = new PouchError(401, 'unauthorized', "Name or password is incorrect."); var MISSING_BULK_DOCS = new PouchError(400, 'bad_request', "Missing JSON list of 'docs'"); var MISSING_DOC = new PouchError(404, 'not_found', 'missing'); var REV_CONFLICT = new PouchError(409, 'conflict', 'Document update conflict'); var INVALID_ID = new PouchError(400, 'bad_request', '_id field must contain a string'); var MISSING_ID = new PouchError(412, 'missing_id', '_id is required for puts'); var RESERVED_ID = new PouchError(400, 'bad_request', 'Only reserved document ids may start with underscore.'); var NOT_OPEN = new PouchError(412, 'precondition_failed', 'Database not open'); var UNKNOWN_ERROR = new PouchError(500, 'unknown_error', 'Database encountered an unknown error'); var BAD_ARG = new PouchError(500, 'badarg', 'Some query argument is invalid'); var INVALID_REQUEST = new PouchError(400, 'invalid_request', 'Request was invalid'); var QUERY_PARSE_ERROR = new PouchError(400, 'query_parse_error', 'Some query parameter is invalid'); var DOC_VALIDATION = new PouchError(500, 'doc_validation', 'Bad special document member'); var BAD_REQUEST = new PouchError(400, 'bad_request', 'Something wrong with the request'); var NOT_AN_OBJECT = new PouchError(400, 'bad_request', 'Document must be a JSON object'); var DB_MISSING = new PouchError(404, 'not_found', 'Database not found'); var IDB_ERROR = new PouchError(500, 'indexed_db_went_bad', 'unknown'); var WSQ_ERROR = new PouchError(500, 'web_sql_went_bad', 'unknown'); var LDB_ERROR = new PouchError(500, 'levelDB_went_went_bad', 'unknown'); var FORBIDDEN = new PouchError(403, 'forbidden', 'Forbidden by design doc validate_doc_update function'); var INVALID_REV = new PouchError(400, 'bad_request', 'Invalid rev format'); var FILE_EXISTS = new PouchError(412, 'file_exists', 'The database could not be created, the file already exists.'); var MISSING_STUB = new PouchError(412, 'missing_stub', 'A pre-existing attachment stub wasn\'t found'); var INVALID_URL = new PouchError(413, 'invalid_url', 'Provided URL is invalid'); function createError(error, reason) { function CustomPouchError(reason) { // inherit error properties from our parent error manually // so as to allow proper JSON parsing. /* jshint ignore:start */ for (var p in error) { if (typeof error[p] !== 'function') { this[p] = error[p]; } } /* jshint ignore:end */ if (reason !== undefined) { this.reason = reason; } } CustomPouchError.prototype = PouchError.prototype; return new CustomPouchError(reason); } function generateErrorFromResponse(err) { if (typeof err !== 'object') { var data = err; err = UNKNOWN_ERROR; err.data = data; } if ('error' in err && err.error === 'conflict') { err.name = 'conflict'; err.status = 409; } if (!('name' in err)) { err.name = err.error || 'unknown'; } if (!('status' in err)) { err.status = 500; } if (!('message' in err)) { err.message = err.message || err.reason; } return err; } /***/ }), /* 712 */ /***/ (function(module, exports, __webpack_require__) { try { var util = __webpack_require__(9); if (typeof util.inherits !== 'function') throw ''; module.exports = util.inherits; } catch (e) { module.exports = __webpack_require__(713); } /***/ }), /* 713 */ /***/ (function(module, exports) { if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { ctor.super_ = superCtor ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }); }; } else { // old school shim for old browsers module.exports = function inherits(ctor, superCtor) { ctor.super_ = superCtor var TempCtor = function () {} TempCtor.prototype = superCtor.prototype ctor.prototype = new TempCtor() ctor.prototype.constructor = ctor } } /***/ }), /* 714 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "binaryMd5", function() { return binaryMd5; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stringMd5", function() { return stringMd5; }); /* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(94); /* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(crypto__WEBPACK_IMPORTED_MODULE_0__); function binaryMd5(data, callback) { var base64 = crypto__WEBPACK_IMPORTED_MODULE_0___default.a.createHash('md5').update(data, 'binary').digest('base64'); callback(base64); } function stringMd5(string) { return crypto__WEBPACK_IMPORTED_MODULE_0___default.a.createHash('md5').update(string, 'binary').digest('hex'); } /***/ }), /* 715 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fetch", function() { return fetch; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Headers", function() { return Headers; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbortController", function() { return AbortController; }); /* harmony import */ var node_fetch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(716); /* harmony import */ var fetch_cookie__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(717); /* harmony import */ var fetch_cookie__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fetch_cookie__WEBPACK_IMPORTED_MODULE_1__); var fetch = fetch_cookie__WEBPACK_IMPORTED_MODULE_1___default()(node_fetch__WEBPACK_IMPORTED_MODULE_0__["default"]); /* We can fake the abort, the http adapter keeps track of ignoring the result */ function AbortController() { return {abort: function () {}}; } var Headers = node_fetch__WEBPACK_IMPORTED_MODULE_0__["default"].Headers; /***/ }), /* 716 */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Headers", function() { return Headers; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Request", function() { return Request; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Response", function() { return Response; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FetchError", function() { return FetchError; }); /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(100); /* harmony import */ var http__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(98); /* harmony import */ var url__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(83); /* harmony import */ var https__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(99); /* harmony import */ var zlib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(101); // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js // fix for "Readable" isn't a named export issue const Readable = stream__WEBPACK_IMPORTED_MODULE_0__.Readable; const BUFFER = Symbol('buffer'); const TYPE = Symbol('type'); class Blob { constructor() { this[TYPE] = ''; const blobParts = arguments[0]; const options = arguments[1]; const buffers = []; let size = 0; if (blobParts) { const a = blobParts; const length = Number(a.length); for (let i = 0; i < length; i++) { const element = a[i]; let buffer; if (element instanceof Buffer) { buffer = element; } else if (ArrayBuffer.isView(element)) { buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength); } else if (element instanceof ArrayBuffer) { buffer = Buffer.from(element); } else if (element instanceof Blob) { buffer = element[BUFFER]; } else { buffer = Buffer.from(typeof element === 'string' ? element : String(element)); } size += buffer.length; buffers.push(buffer); } } this[BUFFER] = Buffer.concat(buffers); let type = options && options.type !== undefined && String(options.type).toLowerCase(); if (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]; const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); return Promise.resolve(ab); } stream() { const readable = new Readable(); readable._read = function () {}; readable.push(this[BUFFER]); readable.push(null); return readable; } toString() { return '[object Blob]'; } slice() { const size = this.size; const start = arguments[0]; const end = arguments[1]; let relativeStart, relativeEnd; if (start === undefined) { relativeStart = 0; } else if (start < 0) { relativeStart = Math.max(size + start, 0); } else { relativeStart = Math.min(start, size); } if (end === undefined) { relativeEnd = size; } else if (end < 0) { relativeEnd = Math.max(size + end, 0); } else { relativeEnd = Math.min(end, size); } const span = Math.max(relativeEnd - relativeStart, 0); const buffer = this[BUFFER]; const slicedBuffer = buffer.slice(relativeStart, relativeStart + span); const blob = new Blob([], { type: arguments[2] }); blob[BUFFER] = slicedBuffer; return blob; } } Object.defineProperties(Blob.prototype, { size: { enumerable: true }, type: { enumerable: true }, slice: { enumerable: true } }); Object.defineProperty(Blob.prototype, Symbol.toStringTag, { value: 'Blob', writable: false, enumerable: false, configurable: true }); /** * fetch-error.js * * FetchError interface for operational errors */ /** * Create FetchError instance * * @param String message Error message for human * @param String type Error type for machine * @param String systemError For Node.js system error * @return FetchError */ function FetchError(message, type, systemError) { Error.call(this, message); this.message = message; this.type = type; // when err.type is `system`, err.code contains system error code if (systemError) { this.code = this.errno = systemError.code; } // hide custom error implementation details from end-users Error.captureStackTrace(this, this.constructor); } FetchError.prototype = Object.create(Error.prototype); FetchError.prototype.constructor = FetchError; FetchError.prototype.name = 'FetchError'; let convert; try { convert = require('encoding').convert; } catch (e) {} const INTERNALS = Symbol('Body internals'); // fix an issue where "PassThrough" isn't a named export for node <10 const PassThrough = stream__WEBPACK_IMPORTED_MODULE_0__.PassThrough; /** * Body mixin * * Ref: https://fetch.spec.whatwg.org/#body * * @param Stream body Readable stream * @param Object opts Response options * @return Void */ function Body(body) { var _this = this; var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref$size = _ref.size; let size = _ref$size === undefined ? 0 : _ref$size; var _ref$timeout = _ref.timeout; let timeout = _ref$timeout === undefined ? 0 : _ref$timeout; if (body == null) { // body is undefined or null body = null; } else if (isURLSearchParams(body)) { // body is a URLSearchParams body = Buffer.from(body.toString()); } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') { // body is ArrayBuffer body = Buffer.from(body); } else if (ArrayBuffer.isView(body)) { // body is ArrayBufferView body = Buffer.from(body.buffer, body.byteOffset, body.byteLength); } else if (body instanceof stream__WEBPACK_IMPORTED_MODULE_0__) ; else { // none of the above // coerce to string then buffer body = Buffer.from(String(body)); } this[INTERNALS] = { body, disturbed: false, error: null }; this.size = size; this.timeout = timeout; if (body instanceof stream__WEBPACK_IMPORTED_MODULE_0__) { body.on('error', function (err) { const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err); _this[INTERNALS].error = error; }); } } Body.prototype = { get body() { return this[INTERNALS].body; }, get bodyUsed() { return this[INTERNALS].disturbed; }, /** * Decode response as ArrayBuffer * * @return Promise */ arrayBuffer() { return consumeBody.call(this).then(function (buf) { return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); }); }, /** * Return raw response as Blob * * @return Promise */ blob() { let ct = this.headers && this.headers.get('content-type') || ''; return consumeBody.call(this).then(function (buf) { return Object.assign( // Prevent copying new Blob([], { type: ct.toLowerCase() }), { [BUFFER]: buf }); }); }, /** * Decode response as json * * @return Promise */ 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')); } }); }, /** * Decode response as text * * @return Promise */ text() { return consumeBody.call(this).then(function (buffer) { return buffer.toString(); }); }, /** * Decode response as buffer (non-spec api) * * @return Promise */ buffer() { return consumeBody.call(this); }, /** * Decode response as text, while automatically detecting the encoding and * trying to decode to UTF-8 (non-spec api) * * @return Promise */ textConverted() { var _this3 = this; return consumeBody.call(this).then(function (buffer) { return convertBody(buffer, _this3.headers); }); } }; // In browsers, all properties are enumerable. Object.defineProperties(Body.prototype, { body: { enumerable: true }, bodyUsed: { enumerable: true }, arrayBuffer: { enumerable: true }, blob: { enumerable: true }, json: { enumerable: true }, text: { enumerable: true } }); Body.mixIn = function (proto) { for (const name of Object.getOwnPropertyNames(Body.prototype)) { // istanbul ignore else: future proof if (!(name in proto)) { const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); Object.defineProperty(proto, name, desc); } } }; /** * Consume and convert an entire Body to a Buffer. * * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body * * @return Promise */ function consumeBody() { var _this4 = this; if (this[INTERNALS].disturbed) { return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); } this[INTERNALS].disturbed = true; if (this[INTERNALS].error) { return Body.Promise.reject(this[INTERNALS].error); } let body = this.body; // body is null if (body === null) { return Body.Promise.resolve(Buffer.alloc(0)); } // body is blob if (isBlob(body)) { body = body.stream(); } // body is buffer if (Buffer.isBuffer(body)) { return Body.Promise.resolve(body); } // istanbul ignore if: should never happen if (!(body instanceof stream__WEBPACK_IMPORTED_MODULE_0__)) { return Body.Promise.resolve(Buffer.alloc(0)); } // body is stream // get ready to actually consume the body let accum = []; let accumBytes = 0; let abort = false; return new Body.Promise(function (resolve, reject) { let resTimeout; // allow timeout on slow response body if (_this4.timeout) { resTimeout = setTimeout(function () { abort = true; reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout')); }, _this4.timeout); } // handle stream errors body.on('error', function (err) { if (err.name === 'AbortError') { // if the request was aborted, reject with this Error abort = true; reject(err); } else { // other errors, such as incorrect content-encoding reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err)); } }); body.on('data', function (chunk) { if (abort || chunk === null) { return; } if (_this4.size && accumBytes + chunk.length > _this4.size) { abort = true; reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size')); return; } accumBytes += chunk.length; accum.push(chunk); }); body.on('end', function () { if (abort) { return; } clearTimeout(resTimeout); try { resolve(Buffer.concat(accum, accumBytes)); } catch (err) { // handle streams that have accumulated too much data (issue #414) reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err)); } }); }); } /** * Detect buffer encoding and convert to target encoding * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding * * @param Buffer buffer Incoming buffer * @param String encoding Target encoding * @return String */ function convertBody(buffer, headers) { if (typeof convert !== 'function') { throw new Error('The package `encoding` must be installed to use the textConverted() function'); } const ct = headers.get('content-type'); let charset = 'utf-8'; let res, str; // header if (ct) { res = /charset=([^;]*)/i.exec(ct); } // no charset in content type, peek at response body for at most 1024 bytes str = buffer.slice(0, 1024).toString(); // html5 if (!res && str) { res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str); } // html4 if (!res && str) { res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str); if (res) { res = /charset=(.*)/i.exec(res.pop()); } } // xml if (!res && str) { res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str); } // found charset if (res) { charset = res.pop(); // prevent decode issues when sites use incorrect encoding // ref: https://hsivonen.fi/encoding-menu/ if (charset === 'gb2312' || charset === 'gbk') { charset = 'gb18030'; } } // turn raw buffers into a single utf-8 buffer return convert(buffer, 'UTF-8', charset).toString(); } /** * Detect a URLSearchParams object * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143 * * @param Object obj Object to detect by type or brand * @return String */ function isURLSearchParams(obj) { // Duck-typing as a necessary condition. if (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') { return false; } // Brand-checking and more duck-typing as optional condition. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function'; } /** * Check if `obj` is a W3C `Blob` object (which `File` inherits from) * @param {*} obj * @return {boolean} */ function isBlob(obj) { return typeof obj === 'object' && typeof obj.arrayBuffer === 'function' && typeof obj.type === 'string' && typeof obj.stream === 'function' && typeof obj.constructor === 'function' && typeof obj.constructor.name === 'string' && /^(Blob|File)$/.test(obj.constructor.name) && /^(Blob|File)$/.test(obj[Symbol.toStringTag]); } /** * Clone body given Res/Req instance * * @param Mixed instance Response or Request instance * @return Mixed */ function clone(instance) { let p1, p2; let body = instance.body; // don't allow cloning a used body if (instance.bodyUsed) { throw new Error('cannot clone body after it is used'); } // check that body is a stream and not form-data object // note: we can't clone the form-data object without having it as a dependency if (body instanceof stream__WEBPACK_IMPORTED_MODULE_0__ && typeof body.getBoundary !== 'function') { // tee instance body p1 = new PassThrough(); p2 = new PassThrough(); body.pipe(p1); body.pipe(p2); // set instance body to teed body and return the other teed body instance[INTERNALS].body = p1; body = p2; } return body; } /** * Performs the operation "extract a `Content-Type` value from |object|" as * specified in the specification: * https://fetch.spec.whatwg.org/#concept-bodyinit-extract * * This function assumes that instance.body is present. * * @param Mixed instance Any options.body input */ function extractContentType(body) { if (body === null) { // body is null return null; } else if (typeof body === 'string') { // body is string return 'text/plain;charset=UTF-8'; } else if (isURLSearchParams(body)) { // body is a URLSearchParams return 'application/x-www-form-urlencoded;charset=UTF-8'; } else if (isBlob(body)) { // body is blob return body.type || null; } else if (Buffer.isBuffer(body)) { // body is buffer return null; } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') { // body is ArrayBuffer return null; } else if (ArrayBuffer.isView(body)) { // body is ArrayBufferView return null; } else if (typeof body.getBoundary === 'function') { // detect form data input from form-data module return `multipart/form-data;boundary=${body.getBoundary()}`; } else if (body instanceof stream__WEBPACK_IMPORTED_MODULE_0__) { // body is stream // can't really do much about this return null; } else { // Body constructor defaults other things to string return 'text/plain;charset=UTF-8'; } } /** * The Fetch Standard treats this as if "total bytes" is a property on the body. * For us, we have to explicitly get it with a function. * * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes * * @param Body instance Instance of Body * @return Number? Number of bytes, or null if not possible */ function getTotalBytes(instance) { const body = instance.body; if (body === null) { // body is null return 0; } else if (isBlob(body)) { return body.size; } else if (Buffer.isBuffer(body)) { // body is buffer return body.length; } else if (body && typeof body.getLengthSync === 'function') { // detect form data input from form-data module if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x body.hasKnownLength && body.hasKnownLength()) { // 2.x return body.getLengthSync(); } return null; } else { // body is stream return null; } } /** * Write a Body to a Node.js WritableStream (e.g. http.Request) object. * * @param Body instance Instance of Body * @return Void */ function writeToStream(dest, instance) { const body = instance.body; if (body === null) { // body is null dest.end(); } else if (isBlob(body)) { body.stream().pipe(dest); } else if (Buffer.isBuffer(body)) { // body is buffer dest.write(body); dest.end(); } else { // body is stream body.pipe(dest); } } // expose Promise Body.Promise = global.Promise; /** * headers.js * * Headers class offers convenient helpers */ const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/; const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/; function validateName(name) { name = `${name}`; if (invalidTokenRegex.test(name) || name === '') { throw new TypeError(`${name} is not a legal HTTP header name`); } } function validateValue(value) { value = `${value}`; if (invalidHeaderCharRegex.test(value)) { throw new TypeError(`${value} is not a legal HTTP header value`); } } /** * Find the key in the map object given a header name. * * Returns undefined if not found. * * @param String name Header name * @return String|Undefined */ function find(map, name) { name = name.toLowerCase(); for (const key in map) { if (key.toLowerCase() === name) { return key; } } return undefined; } const MAP = Symbol('map'); class Headers { /** * Headers class * * @param Object headers Response headers * @return Void */ constructor() { let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined; this[MAP] = Object.create(null); if (init instanceof Headers) { const rawHeaders = init.raw(); const headerNames = Object.keys(rawHeaders); for (const headerName of headerNames) { for (const value of rawHeaders[headerName]) { this.append(headerName, value); } } return; } // We don't worry about converting prop to ByteString here as append() // will handle it. if (init == null) ; else if (typeof init === 'object') { const method = init[Symbol.iterator]; if (method != null) { if (typeof method !== 'function') { throw new TypeError('Header pairs must be iterable'); } // sequence<sequence<ByteString>> // Note: per spec we have to first exhaust the lists then process them const pairs = []; for (const pair of init) { if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') { throw new TypeError('Each header pair must be iterable'); } pairs.push(Array.from(pair)); } for (const pair of pairs) { if (pair.length !== 2) { throw new TypeError('Each header pair must be a name/value tuple'); } this.append(pair[0], pair[1]); } } else { // record<ByteString, ByteString> for (const key of Object.keys(init)) { const value = init[key]; this.append(key, value); } } } else { throw new TypeError('Provided initializer must be an object'); } } /** * Return combined header value given name * * @param String name Header name * @return Mixed */ get(name) { name = `${name}`; validateName(name); const key = find(this[MAP], name); if (key === undefined) { return null; } return this[MAP][key].join(', '); } /** * Iterate over all headers * * @param Function callback Executed for each item with parameters (value, name, thisArg) * @param Boolean thisArg `this` context for callback function * @return Void */ forEach(callback) { let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; let pairs = getHeaders(this); let i = 0; while (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++; } } /** * Overwrite header values given name * * @param String name Header name * @param String value Header value * @return Void */ set(name, value) { name = `${name}`; value = `${value}`; validateName(name); validateValue(value); const key = find(this[MAP], name); this[MAP][key !== undefined ? key : name] = [value]; } /** * Append a value onto existing header * * @param String name Header name * @param String value Header value * @return Void */ append(name, value) { name = `${name}`; value = `${value}`; validateName(name); validateValue(value); const key = find(this[MAP], name); if (key !== undefined) { this[MAP][key].push(value); } else { this[MAP][name] = [value]; } } /** * Check for header name existence * * @param String name Header name * @return Boolean */ has(name) { name = `${name}`; validateName(name); return find(this[MAP], name) !== undefined; } /** * Delete all header values given name * * @param String name Header name * @return Void */ delete(name) { name = `${name}`; validateName(name); const key = find(this[MAP], name); if (key !== undefined) { delete this[MAP][key]; } } /** * Return raw headers (non-spec api) * * @return Object */ raw() { return this[MAP]; } /** * Get an iterator on keys. * * @return Iterator */ keys() { return createHeadersIterator(this, 'key'); } /** * Get an iterator on values. * * @return Iterator */ values() { return createHeadersIterator(this, 'value'); } /** * Get an iterator on entries. * * This is the default iterator of the Headers object. * * @return Iterator */ [Symbol.iterator]() { return createHeadersIterator(this, 'key+value'); } } Headers.prototype.entries = Headers.prototype[Symbol.iterator]; Object.defineProperty(Headers.prototype, Symbol.toStringTag, { value: 'Headers', writable: false, enumerable: false, configurable: true }); Object.defineProperties(Headers.prototype, { get: { enumerable: true }, forEach: { enumerable: true }, set: { enumerable: true }, append: { enumerable: true }, has: { enumerable: true }, delete: { enumerable: true }, keys: { enumerable: true }, values: { enumerable: true }, entries: { enumerable: true } }); function getHeaders(headers) { let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value'; const keys = Object.keys(headers[MAP]).sort(); return keys.map(kind === 'key' ? function (k) { return k.toLowerCase(); } : kind === 'value' ? function (k) { return headers[MAP][k].join(', '); } : function (k) { return [k.toLowerCase(), headers[MAP][k].join(', ')]; }); } const INTERNAL = Symbol('internal'); function createHeadersIterator(target, kind) { const iterator = Object.create(HeadersIteratorPrototype); iterator[INTERNAL] = { target, kind, index: 0 }; return iterator; } const HeadersIteratorPrototype = Object.setPrototypeOf({ next() { // istanbul ignore if 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; const values = getHeaders(target, kind); const len = values.length; if (index >= len) { return { value: undefined, done: true }; } this[INTERNAL].index = index + 1; return { value: values[index], done: false }; } }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { value: 'HeadersIterator', writable: false, enumerable: false, configurable: true }); /** * Export the Headers object in a form that Node.js can consume. * * @param Headers headers * @return Object */ function exportNodeCompatibleHeaders(headers) { const obj = Object.assign({ __proto__: null }, headers[MAP]); // http.request() only supports string as Host header. This hack makes // specifying custom Host header possible. const hostHeaderKey = find(headers[MAP], 'Host'); if (hostHeaderKey !== undefined) { obj[hostHeaderKey] = obj[hostHeaderKey][0]; } return obj; } /** * Create a Headers object from an object of headers, ignoring those that do * not conform to HTTP grammar productions. * * @param Object obj Object of headers * @return Headers */ function createHeadersLenient(obj) { const headers = new Headers(); for (const name of Object.keys(obj)) { if (invalidTokenRegex.test(name)) { continue; } if (Array.isArray(obj[name])) { for (const val of obj[name]) { if (invalidHeaderCharRegex.test(val)) { continue; } if (headers[MAP][name] === undefined) { headers[MAP][name] = [val]; } else { headers[MAP][name].push(val); } } } else if (!invalidHeaderCharRegex.test(obj[name])) { headers[MAP][name] = [obj[name]]; } } return headers; } const INTERNALS$1 = Symbol('Response internals'); // fix an issue where "STATUS_CODES" aren't a named export for node <10 const STATUS_CODES = http__WEBPACK_IMPORTED_MODULE_1__.STATUS_CODES; /** * Response class * * @param Stream body Readable stream * @param Object opts Response options * @return Void */ class Response { constructor() { let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; Body.call(this, body, opts); const status = opts.status || 200; const headers = new Headers(opts.headers); if (body != null && !headers.has('Content-Type')) { const contentType = extractContentType(body); if (contentType) { headers.append('Content-Type', contentType); } } this[INTERNALS$1] = { url: opts.url, status, statusText: opts.statusText || STATUS_CODES[status], headers, counter: opts.counter }; } get url() { return this[INTERNALS$1].url || ''; } get status() { return this[INTERNALS$1].status; } /** * Convenience property representing if the request ended normally */ 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 this response * * @return Response */ 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: true }, status: { enumerable: true }, ok: { enumerable: true }, redirected: { enumerable: true }, statusText: { enumerable: true }, headers: { enumerable: true }, clone: { enumerable: true } }); Object.defineProperty(Response.prototype, Symbol.toStringTag, { value: 'Response', writable: false, enumerable: false, configurable: true }); const INTERNALS$2 = Symbol('Request internals'); // fix an issue where "format", "parse" aren't a named export for node <10 const parse_url = url__WEBPACK_IMPORTED_MODULE_2__.parse; const format_url = url__WEBPACK_IMPORTED_MODULE_2__.format; const streamDestructionSupported = 'destroy' in stream__WEBPACK_IMPORTED_MODULE_0__.Readable.prototype; /** * Check if a value is an instance of Request. * * @param Mixed input * @return Boolean */ function isRequest(input) { return typeof input === 'object' && typeof input[INTERNALS$2] === 'object'; } function isAbortSignal(signal) { const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal); return !!(proto && proto.constructor.name === 'AbortSignal'); } /** * Request class * * @param Mixed input Url or Request instance * @param Object init Custom options * @return Void */ class Request { constructor(input) { let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; let parsedURL; // normalize input if (!isRequest(input)) { if (input && input.href) { // in order to support Node.js' Url objects; though WHATWG's URL objects // will fall into this branch also (since their `toString()` will return // `href` property anyway) parsedURL = parse_url(input.href); } else { // coerce input to a string before attempting to parse parsedURL = parse_url(`${input}`); } input = {}; } else { parsedURL = parse_url(input.url); } let method = init.method || input.method || 'GET'; method = method.toUpperCase(); if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) { throw new TypeError('Request with GET/HEAD method cannot have body'); } let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? 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 (inputBody != null && !headers.has('Content-Type')) { const contentType = extractContentType(inputBody); if (contentType) { headers.append('Content-Type', contentType); } } let signal = isRequest(input) ? input.signal : null; if ('signal' in init) signal = init.signal; if (signal != null && !isAbortSignal(signal)) { throw new TypeError('Expected signal to be an instanceof AbortSignal'); } this[INTERNALS$2] = { method, redirect: init.redirect || input.redirect || 'follow', headers, parsedURL, signal }; // node-fetch-only options this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20; this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true; 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 this request * * @return Request */ clone() { return new Request(this); } } Body.mixIn(Request.prototype); Object.defineProperty(Request.prototype, Symbol.toStringTag, { value: 'Request', writable: false, enumerable: false, configurable: true }); Object.defineProperties(Request.prototype, { method: { enumerable: true }, url: { enumerable: true }, headers: { enumerable: true }, redirect: { enumerable: true }, clone: { enumerable: true }, signal: { enumerable: true } }); /** * Convert a Request to Node.js http request options. * * @param Request A Request instance * @return Object The options object to be passed to http.request */ function getNodeRequestOptions(request) { const parsedURL = request[INTERNALS$2].parsedURL; const headers = new Headers(request[INTERNALS$2].headers); // fetch step 1.3 if (!headers.has('Accept')) { headers.set('Accept', '*/*'); } // Basic fetch if (!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__WEBPACK_IMPORTED_MODULE_0__.Readable && !streamDestructionSupported) { throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8'); } // HTTP-network-or-cache fetch steps 2.4-2.7 let contentLengthValue = null; if (request.body == null && /^(POST|PUT)$/i.test(request.method)) { contentLengthValue = '0'; } if (request.body != null) { const totalBytes = getTotalBytes(request); if (typeof totalBytes === 'number') { contentLengthValue = String(totalBytes); } } if (contentLengthValue) { headers.set('Content-Length', contentLengthValue); } // HTTP-network-or-cache fetch step 2.11 if (!headers.has('User-Agent')) { headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)'); } // HTTP-network-or-cache fetch step 2.15 if (request.compress && !headers.has('Accept-Encoding')) { headers.set('Accept-Encoding', 'gzip,deflate'); } let agent = request.agent; if (typeof agent === 'function') { agent = agent(parsedURL); } if (!headers.has('Connection') && !agent) { headers.set('Connection', 'close'); } // HTTP-network fetch step 4.2 // chunked encoding is handled by Node.js return Object.assign({}, parsedURL, { method: request.method, headers: exportNodeCompatibleHeaders(headers), agent }); } /** * abort-error.js * * AbortError interface for cancelled requests */ /** * Create AbortError instance * * @param String message Error message for human * @return AbortError */ function AbortError(message) { Error.call(this, message); this.type = 'aborted'; this.message = message; // hide custom error implementation details from end-users Error.captureStackTrace(this, this.constructor); } AbortError.prototype = Object.create(Error.prototype); AbortError.prototype.constructor = AbortError; AbortError.prototype.name = 'AbortError'; // fix an issue where "PassThrough", "resolve" aren't a named export for node <10 const PassThrough$1 = stream__WEBPACK_IMPORTED_MODULE_0__.PassThrough; const resolve_url = url__WEBPACK_IMPORTED_MODULE_2__.resolve; /** * Fetch function * * @param Mixed url Absolute url or Request instance * @param Object opts Fetch options * @return Promise */ function fetch(url, opts) { // allow custom promise if (!fetch.Promise) { throw new Error('native promise missing, set fetch.Promise to your favorite alternative'); } Body.Promise = fetch.Promise; // wrap http.request into fetch return new fetch.Promise(function (resolve, reject) { // build request object const request = new Request(url, opts); const options = getNodeRequestOptions(request); const send = (options.protocol === 'https:' ? https__WEBPACK_IMPORTED_MODULE_3__ : http__WEBPACK_IMPORTED_MODULE_1__).request; const signal = request.signal; let response = null; const abort = function abort() { let error = new AbortError('The user aborted a request.'); reject(error); if (request.body && request.body instanceof stream__WEBPACK_IMPORTED_MODULE_0__.Readable) { request.body.destroy(error); } if (!response || !response.body) return; response.body.emit('error', error); }; if (signal && signal.aborted) { abort(); return; } const abortAndFinalize = function abortAndFinalize() { abort(); finalize(); }; // send request const req = send(options); let reqTimeout; if (signal) { signal.addEventListener('abort', abortAndFinalize); } function finalize() { req.abort(); if (signal) signal.removeEventListener('abort', abortAndFinalize); clearTimeout(reqTimeout); } if (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 = createHeadersLenient(res.headers); // HTTP fetch step 5 if (fetch.isRedirect(res.statusCode)) { // HTTP fetch step 5.2 const location = headers.get('Location'); // HTTP fetch step 5.3 const locationURL = location === null ? null : resolve_url(request.url, location); // HTTP fetch step 5.5 switch (request.redirect) { case 'error': reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect')); finalize(); return; case 'manual': // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL. if (locationURL !== null) { // handle corrupted header try { headers.set('Location', locationURL); } catch (err) { // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request reject(err); } } break; case 'follow': // HTTP-redirect fetch step 2 if (locationURL === null) { break; } // HTTP-redirect fetch step 5 if (request.counter >= request.follow) { reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect')); finalize(); return; } // HTTP-redirect fetch step 6 (counter increment) // Create a new Request object. 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 }; // HTTP-redirect fetch step 9 if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) { reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect')); finalize(); return; } // HTTP-redirect fetch step 11 if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') { requestOpts.method = 'GET'; requestOpts.body = undefined; requestOpts.headers.delete('content-length'); } // HTTP-redirect fetch step 15 resolve(fetch(new Request(locationURL, requestOpts))); finalize(); return; } } // prepare response res.once('end', function () { if (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 }; // HTTP-network fetch step 12.1.1.3 const codings = headers.get('Content-Encoding'); // HTTP-network fetch step 12.1.1.4: handle content codings // in following scenarios we ignore compression support // 1. compression support is disabled // 2. HEAD request // 3. no Content-Encoding header // 4. no content response (204) // 5. content not modified response (304) if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) { response = new Response(body, response_options); resolve(response); return; } // For Node v6+ // Be less strict when decoding compressed responses, since sometimes // servers send slightly invalid responses that are still accepted // by common browsers. // Always using Z_SYNC_FLUSH is what cURL does. const zlibOptions = { flush: zlib__WEBPACK_IMPORTED_MODULE_4__.Z_SYNC_FLUSH, finishFlush: zlib__WEBPACK_IMPORTED_MODULE_4__.Z_SYNC_FLUSH }; // for gzip if (codings == 'gzip' || codings == 'x-gzip') { body = body.pipe(zlib__WEBPACK_IMPORTED_MODULE_4__.createGunzip(zlibOptions)); response = new Response(body, response_options); resolve(response); return; } // for deflate if (codings == 'deflate' || codings == 'x-deflate') { // handle the infamous raw deflate response from old servers // a hack for old IIS and Apache servers const raw = res.pipe(new PassThrough$1()); raw.once('data', function (chunk) { // see http://stackoverflow.com/questions/37519828 if ((chunk[0] & 0x0F) === 0x08) { body = body.pipe(zlib__WEBPACK_IMPORTED_MODULE_4__.createInflate()); } else { body = body.pipe(zlib__WEBPACK_IMPORTED_MODULE_4__.createInflateRaw()); } response = new Response(body, response_options); resolve(response); }); return; } // for br if (codings == 'br' && typeof zlib__WEBPACK_IMPORTED_MODULE_4__.createBrotliDecompress === 'function') { body = body.pipe(zlib__WEBPACK_IMPORTED_MODULE_4__.createBrotliDecompress()); response = new Response(body, response_options); resolve(response); return; } // otherwise, use response as-is response = new Response(body, response_options); resolve(response); }); writeToStream(req, request); }); } /** * Redirect code matching * * @param Number code Status code * @return Boolean */ fetch.isRedirect = function (code) { return code === 301 || code === 302 || code === 303 || code === 307 || code === 308; }; // expose Promise fetch.Promise = global.Promise; /* harmony default export */ __webpack_exports__["default"] = (fetch); /***/ }), /* 717 */ /***/ (function(module, exports, __webpack_require__) { var denodeify = __webpack_require__(718)(Promise) var tough = __webpack_require__(270) module.exports = function fetchCookieDecorator (fetch, jar) { fetch = fetch || window.fetch jar = jar || new tough.CookieJar() var getCookieString = denodeify(jar.getCookieString.bind(jar)) var setCookie = denodeify(jar.setCookie.bind(jar)) return function fetchCookie (url, opts) { opts = opts || {} return getCookieString(url) .then(function (cookie) { return fetch(url, Object.assign(opts, { headers: Object.assign(opts.headers || {}, (cookie ? { cookie: cookie } : {})) })) }) .then(function (res) { var cookies if (res.headers.getAll) { // node-fetch v1 cookies = res.headers.getAll('set-cookie') } else { // node-fetch v2 var cookie = res.headers.get('set-cookie') cookies = cookie && cookie.split(',') || [] } if (!cookies.length) { return res } return Promise.all(cookies.map(function (cookie) { return setCookie(cookie, res.url) })).then(function () { return res }) }) } } /***/ }), /* 718 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = function () { var PromiseArg = arguments[0] === undefined ? Promise : arguments[0]; return function (f) { return function () { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return new PromiseArg(function (resolve, reject) { return f.apply(undefined, args.concat([function (err, val) { return err ? reject(err) : resolve(val); }])); }); }; }; }; module.exports = exports["default"]; /***/ }), /* 719 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "massageSelector", function() { return massageSelector; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matchesSelector", function() { return matchesSelector; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "filterInMemoryFields", function() { return filterInMemoryFields; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFieldSorter", function() { return createFieldSorter; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rowFilter", function() { return rowFilter; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isCombinationalField", function() { return isCombinationalField; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getKey", function() { return getKey; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getValue", function() { return getValue; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFieldFromDoc", function() { return getFieldFromDoc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setFieldInDoc", function() { return setFieldInDoc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compare", function() { return compare; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseField", function() { return parseField; }); /* harmony import */ var pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(706); /* harmony import */ var pouchdb_collate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(720); // this would just be "return doc[field]", but fields // can be "deep" due to dot notation function getFieldFromDoc(doc, parsedField) { var value = doc; for (var i = 0, len = parsedField.length; i < len; i++) { var key = parsedField[i]; value = value[key]; if (!value) { break; } } return value; } function setFieldInDoc(doc, parsedField, value) { for (var i = 0, len = parsedField.length; i < len-1; i++) { var elem = parsedField[i]; doc = doc[elem] = {}; } doc[parsedField[len-1]] = value; } function compare(left, right) { return left < right ? -1 : left > right ? 1 : 0; } // Converts a string in dot notation to an array of its components, with backslash escaping function parseField(fieldName) { // fields may be deep (e.g. "foo.bar.baz"), so parse var fields = []; var current = ''; for (var i = 0, len = fieldName.length; i < len; i++) { var ch = fieldName[i]; if (ch === '.') { if (i > 0 && fieldName[i - 1] === '\\') { // escaped delimiter current = current.substring(0, current.length - 1) + '.'; } else { // not escaped, so delimiter fields.push(current); current = ''; } } else { // normal character current += ch; } } fields.push(current); return fields; } var combinationFields = ['$or', '$nor', '$not']; function isCombinationalField(field) { return combinationFields.indexOf(field) > -1; } function getKey(obj) { return Object.keys(obj)[0]; } function getValue(obj) { return obj[getKey(obj)]; } // flatten an array of selectors joined by an $and operator function mergeAndedSelectors(selectors) { // sort to ensure that e.g. if the user specified // $and: [{$gt: 'a'}, {$gt: 'b'}], then it's collapsed into // just {$gt: 'b'} var res = {}; selectors.forEach(function (selector) { Object.keys(selector).forEach(function (field) { var matcher = selector[field]; if (typeof matcher !== 'object') { matcher = {$eq: matcher}; } if (isCombinationalField(field)) { if (matcher instanceof Array) { res[field] = matcher.map(function (m) { return mergeAndedSelectors([m]); }); } else { res[field] = mergeAndedSelectors([matcher]); } } else { var fieldMatchers = res[field] = res[field] || {}; Object.keys(matcher).forEach(function (operator) { var value = matcher[operator]; if (operator === '$gt' || operator === '$gte') { return mergeGtGte(operator, value, fieldMatchers); } else if (operator === '$lt' || operator === '$lte') { return mergeLtLte(operator, value, fieldMatchers); } else if (operator === '$ne') { return mergeNe(value, fieldMatchers); } else if (operator === '$eq') { return mergeEq(value, fieldMatchers); } fieldMatchers[operator] = value; }); } }); }); return res; } // collapse logically equivalent gt/gte values function mergeGtGte(operator, value, fieldMatchers) { if (typeof fieldMatchers.$eq !== 'undefined') { return; // do nothing } if (typeof fieldMatchers.$gte !== 'undefined') { if (operator === '$gte') { if (value > fieldMatchers.$gte) { // more specificity fieldMatchers.$gte = value; } } else { // operator === '$gt' if (value >= fieldMatchers.$gte) { // more specificity delete fieldMatchers.$gte; fieldMatchers.$gt = value; } } } else if (typeof fieldMatchers.$gt !== 'undefined') { if (operator === '$gte') { if (value > fieldMatchers.$gt) { // more specificity delete fieldMatchers.$gt; fieldMatchers.$gte = value; } } else { // operator === '$gt' if (value > fieldMatchers.$gt) { // more specificity fieldMatchers.$gt = value; } } } else { fieldMatchers[operator] = value; } } // collapse logically equivalent lt/lte values function mergeLtLte(operator, value, fieldMatchers) { if (typeof fieldMatchers.$eq !== 'undefined') { return; // do nothing } if (typeof fieldMatchers.$lte !== 'undefined') { if (operator === '$lte') { if (value < fieldMatchers.$lte) { // more specificity fieldMatchers.$lte = value; } } else { // operator === '$gt' if (value <= fieldMatchers.$lte) { // more specificity delete fieldMatchers.$lte; fieldMatchers.$lt = value; } } } else if (typeof fieldMatchers.$lt !== 'undefined') { if (operator === '$lte') { if (value < fieldMatchers.$lt) { // more specificity delete fieldMatchers.$lt; fieldMatchers.$lte = value; } } else { // operator === '$gt' if (value < fieldMatchers.$lt) { // more specificity fieldMatchers.$lt = value; } } } else { fieldMatchers[operator] = value; } } // combine $ne values into one array function mergeNe(value, fieldMatchers) { if ('$ne' in fieldMatchers) { // there are many things this could "not" be fieldMatchers.$ne.push(value); } else { // doesn't exist yet fieldMatchers.$ne = [value]; } } // add $eq into the mix function mergeEq(value, fieldMatchers) { // these all have less specificity than the $eq // TODO: check for user errors here delete fieldMatchers.$gt; delete fieldMatchers.$gte; delete fieldMatchers.$lt; delete fieldMatchers.$lte; delete fieldMatchers.$ne; fieldMatchers.$eq = value; } // // normalize the selector // function massageSelector(input) { var result = Object(pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__["clone"])(input); var wasAnded = false; if ('$and' in result) { result = mergeAndedSelectors(result['$and']); wasAnded = true; } ['$or', '$nor'].forEach(function (orOrNor) { if (orOrNor in result) { // message each individual selector // e.g. {foo: 'bar'} becomes {foo: {$eq: 'bar'}} result[orOrNor].forEach(function (subSelector) { var fields = Object.keys(subSelector); for (var i = 0; i < fields.length; i++) { var field = fields[i]; var matcher = subSelector[field]; if (typeof matcher !== 'object' || matcher === null) { subSelector[field] = {$eq: matcher}; } } }); } }); if ('$not' in result) { //This feels a little like forcing, but it will work for now, //I would like to come back to this and make the merging of selectors a little more generic result['$not'] = mergeAndedSelectors([result['$not']]); } var fields = Object.keys(result); for (var i = 0; i < fields.length; i++) { var field = fields[i]; var matcher = result[field]; if (typeof matcher !== 'object' || matcher === null) { matcher = {$eq: matcher}; } else if ('$ne' in matcher && !wasAnded) { // I put these in an array, since there may be more than one // but in the "mergeAnded" operation, I already take care of that matcher.$ne = [matcher.$ne]; } result[field] = matcher; } return result; } // create a comparator based on the sort object function createFieldSorter(sort) { function getFieldValuesAsArray(doc) { return sort.map(function (sorting) { var fieldName = getKey(sorting); var parsedField = parseField(fieldName); var docFieldValue = getFieldFromDoc(doc, parsedField); return docFieldValue; }); } return function (aRow, bRow) { var aFieldValues = getFieldValuesAsArray(aRow.doc); var bFieldValues = getFieldValuesAsArray(bRow.doc); var collation = Object(pouchdb_collate__WEBPACK_IMPORTED_MODULE_1__["collate"])(aFieldValues, bFieldValues); if (collation !== 0) { return collation; } // this is what mango seems to do return compare(aRow.doc._id, bRow.doc._id); }; } function filterInMemoryFields(rows, requestDef, inMemoryFields) { rows = rows.filter(function (row) { return rowFilter(row.doc, requestDef.selector, inMemoryFields); }); if (requestDef.sort) { // in-memory sort var fieldSorter = createFieldSorter(requestDef.sort); rows = rows.sort(fieldSorter); if (typeof requestDef.sort[0] !== 'string' && getValue(requestDef.sort[0]) === 'desc') { rows = rows.reverse(); } } if ('limit' in requestDef || 'skip' in requestDef) { // have to do the limit in-memory var skip = requestDef.skip || 0; var limit = ('limit' in requestDef ? requestDef.limit : rows.length) + skip; rows = rows.slice(skip, limit); } return rows; } function rowFilter(doc, selector, inMemoryFields) { return inMemoryFields.every(function (field) { var matcher = selector[field]; var parsedField = parseField(field); var docFieldValue = getFieldFromDoc(doc, parsedField); if (isCombinationalField(field)) { return matchCominationalSelector(field, matcher, doc); } return matchSelector(matcher, doc, parsedField, docFieldValue); }); } function matchSelector(matcher, doc, parsedField, docFieldValue) { if (!matcher) { // no filtering necessary; this field is just needed for sorting return true; } return Object.keys(matcher).every(function (userOperator) { var userValue = matcher[userOperator]; return match(userOperator, doc, userValue, parsedField, docFieldValue); }); } function matchCominationalSelector(field, matcher, doc) { if (field === '$or') { return matcher.some(function (orMatchers) { return rowFilter(doc, orMatchers, Object.keys(orMatchers)); }); } if (field === '$not') { return !rowFilter(doc, matcher, Object.keys(matcher)); } //`$nor` return !matcher.find(function (orMatchers) { return rowFilter(doc, orMatchers, Object.keys(orMatchers)); }); } function match(userOperator, doc, userValue, parsedField, docFieldValue) { if (!matchers[userOperator]) { throw new Error('unknown operator "' + userOperator + '" - should be one of $eq, $lte, $lt, $gt, $gte, $exists, $ne, $in, ' + '$nin, $size, $mod, $regex, $elemMatch, $type, $allMatch or $all'); } return matchers[userOperator](doc, userValue, parsedField, docFieldValue); } function fieldExists(docFieldValue) { return typeof docFieldValue !== 'undefined' && docFieldValue !== null; } function fieldIsNotUndefined(docFieldValue) { return typeof docFieldValue !== 'undefined'; } function modField(docFieldValue, userValue) { var divisor = userValue[0]; var mod = userValue[1]; if (divisor === 0) { throw new Error('Bad divisor, cannot divide by zero'); } if (parseInt(divisor, 10) !== divisor ) { throw new Error('Divisor is not an integer'); } if (parseInt(mod, 10) !== mod ) { throw new Error('Modulus is not an integer'); } if (parseInt(docFieldValue, 10) !== docFieldValue) { return false; } return docFieldValue % divisor === mod; } function arrayContainsValue(docFieldValue, userValue) { return userValue.some(function (val) { if (docFieldValue instanceof Array) { return docFieldValue.indexOf(val) > -1; } return docFieldValue === val; }); } function arrayContainsAllValues(docFieldValue, userValue) { return userValue.every(function (val) { return docFieldValue.indexOf(val) > -1; }); } function arraySize(docFieldValue, userValue) { return docFieldValue.length === userValue; } function regexMatch(docFieldValue, userValue) { var re = new RegExp(userValue); return re.test(docFieldValue); } function typeMatch(docFieldValue, userValue) { switch (userValue) { case 'null': return docFieldValue === null; case 'boolean': return typeof (docFieldValue) === 'boolean'; case 'number': return typeof (docFieldValue) === 'number'; case 'string': return typeof (docFieldValue) === 'string'; case 'array': return docFieldValue instanceof Array; case 'object': return ({}).toString.call(docFieldValue) === '[object Object]'; } throw new Error(userValue + ' not supported as a type.' + 'Please use one of object, string, array, number, boolean or null.'); } var matchers = { '$elemMatch': function (doc, userValue, parsedField, docFieldValue) { if (!Array.isArray(docFieldValue)) { return false; } if (docFieldValue.length === 0) { return false; } if (typeof docFieldValue[0] === 'object') { return docFieldValue.some(function (val) { return rowFilter(val, userValue, Object.keys(userValue)); }); } return docFieldValue.some(function (val) { return matchSelector(userValue, doc, parsedField, val); }); }, '$allMatch': function (doc, userValue, parsedField, docFieldValue) { if (!Array.isArray(docFieldValue)) { return false; } /* istanbul ignore next */ if (docFieldValue.length === 0) { return false; } if (typeof docFieldValue[0] === 'object') { return docFieldValue.every(function (val) { return rowFilter(val, userValue, Object.keys(userValue)); }); } return docFieldValue.every(function (val) { return matchSelector(userValue, doc, parsedField, val); }); }, '$eq': function (doc, userValue, parsedField, docFieldValue) { return fieldIsNotUndefined(docFieldValue) && Object(pouchdb_collate__WEBPACK_IMPORTED_MODULE_1__["collate"])(docFieldValue, userValue) === 0; }, '$gte': function (doc, userValue, parsedField, docFieldValue) { return fieldIsNotUndefined(docFieldValue) && Object(pouchdb_collate__WEBPACK_IMPORTED_MODULE_1__["collate"])(docFieldValue, userValue) >= 0; }, '$gt': function (doc, userValue, parsedField, docFieldValue) { return fieldIsNotUndefined(docFieldValue) && Object(pouchdb_collate__WEBPACK_IMPORTED_MODULE_1__["collate"])(docFieldValue, userValue) > 0; }, '$lte': function (doc, userValue, parsedField, docFieldValue) { return fieldIsNotUndefined(docFieldValue) && Object(pouchdb_collate__WEBPACK_IMPORTED_MODULE_1__["collate"])(docFieldValue, userValue) <= 0; }, '$lt': function (doc, userValue, parsedField, docFieldValue) { return fieldIsNotUndefined(docFieldValue) && Object(pouchdb_collate__WEBPACK_IMPORTED_MODULE_1__["collate"])(docFieldValue, userValue) < 0; }, '$exists': function (doc, userValue, parsedField, docFieldValue) { //a field that is null is still considered to exist if (userValue) { return fieldIsNotUndefined(docFieldValue); } return !fieldIsNotUndefined(docFieldValue); }, '$mod': function (doc, userValue, parsedField, docFieldValue) { return fieldExists(docFieldValue) && modField(docFieldValue, userValue); }, '$ne': function (doc, userValue, parsedField, docFieldValue) { return userValue.every(function (neValue) { return Object(pouchdb_collate__WEBPACK_IMPORTED_MODULE_1__["collate"])(docFieldValue, neValue) !== 0; }); }, '$in': function (doc, userValue, parsedField, docFieldValue) { return fieldExists(docFieldValue) && arrayContainsValue(docFieldValue, userValue); }, '$nin': function (doc, userValue, parsedField, docFieldValue) { return fieldExists(docFieldValue) && !arrayContainsValue(docFieldValue, userValue); }, '$size': function (doc, userValue, parsedField, docFieldValue) { return fieldExists(docFieldValue) && arraySize(docFieldValue, userValue); }, '$all': function (doc, userValue, parsedField, docFieldValue) { return Array.isArray(docFieldValue) && arrayContainsAllValues(docFieldValue, userValue); }, '$regex': function (doc, userValue, parsedField, docFieldValue) { return fieldExists(docFieldValue) && regexMatch(docFieldValue, userValue); }, '$type': function (doc, userValue, parsedField, docFieldValue) { return typeMatch(docFieldValue, userValue); } }; // return true if the given doc matches the supplied selector function matchesSelector(doc, selector) { /* istanbul ignore if */ if (typeof selector !== 'object') { // match the CouchDB error message throw new Error('Selector error: expected a JSON object'); } selector = massageSelector(selector); var row = { 'doc': doc }; var rowsMatched = filterInMemoryFields([row], { 'selector': selector }, Object.keys(selector)); return rowsMatched && rowsMatched.length === 1; } /***/ }), /* 720 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "collate", function() { return collate; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeKey", function() { return normalizeKey; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toIndexableString", function() { return toIndexableString; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseIndexableString", function() { return parseIndexableString; }); function pad(str, padWith, upToLength) { var padding = ''; var targetLength = upToLength - str.length; /* istanbul ignore next */ while (padding.length < targetLength) { padding += padWith; } return padding; } function padLeft(str, padWith, upToLength) { var padding = pad(str, padWith, upToLength); return padding + str; } var MIN_MAGNITUDE = -324; // verified by -Number.MIN_VALUE var MAGNITUDE_DIGITS = 3; // ditto var SEP = ''; // set to '_' for easier debugging function collate(a, b) { if (a === b) { return 0; } a = normalizeKey(a); b = normalizeKey(b); var ai = collationIndex(a); var bi = collationIndex(b); if ((ai - bi) !== 0) { return ai - bi; } switch (typeof a) { case 'number': return a - b; case 'boolean': return a < b ? -1 : 1; case 'string': return stringCollate(a, b); } return Array.isArray(a) ? arrayCollate(a, b) : objectCollate(a, b); } // couch considers null/NaN/Infinity/-Infinity === undefined, // for the purposes of mapreduce indexes. also, dates get stringified. function normalizeKey(key) { switch (typeof key) { case 'undefined': return null; case 'number': if (key === Infinity || key === -Infinity || isNaN(key)) { return null; } return key; case 'object': var origKey = key; if (Array.isArray(key)) { var len = key.length; key = new Array(len); for (var i = 0; i < len; i++) { key[i] = normalizeKey(origKey[i]); } /* istanbul ignore next */ } else if (key instanceof Date) { return key.toJSON(); } else if (key !== null) { // generic object key = {}; for (var k in origKey) { if (origKey.hasOwnProperty(k)) { var val = origKey[k]; if (typeof val !== 'undefined') { key[k] = normalizeKey(val); } } } } } return key; } function indexify(key) { if (key !== null) { switch (typeof key) { case 'boolean': return key ? 1 : 0; case 'number': return numToIndexableString(key); case 'string': // We've to be sure that key does not contain \u0000 // Do order-preserving replacements: // 0 -> 1, 1 // 1 -> 1, 2 // 2 -> 2, 2 /* eslint-disable no-control-regex */ return key .replace(/\u0002/g, '\u0002\u0002') .replace(/\u0001/g, '\u0001\u0002') .replace(/\u0000/g, '\u0001\u0001'); /* eslint-enable no-control-regex */ case 'object': var isArray = Array.isArray(key); var arr = isArray ? key : Object.keys(key); var i = -1; var len = arr.length; var result = ''; if (isArray) { while (++i < len) { result += toIndexableString(arr[i]); } } else { while (++i < len) { var objKey = arr[i]; result += toIndexableString(objKey) + toIndexableString(key[objKey]); } } return result; } } return ''; } // convert the given key to a string that would be appropriate // for lexical sorting, e.g. within a database, where the // sorting is the same given by the collate() function. function toIndexableString(key) { var zero = '\u0000'; key = normalizeKey(key); return collationIndex(key) + SEP + indexify(key) + zero; } function parseNumber(str, i) { var originalIdx = i; var num; var zero = str[i] === '1'; if (zero) { num = 0; i++; } else { var neg = str[i] === '0'; i++; var numAsString = ''; var magAsString = str.substring(i, i + MAGNITUDE_DIGITS); var magnitude = parseInt(magAsString, 10) + MIN_MAGNITUDE; /* istanbul ignore next */ if (neg) { magnitude = -magnitude; } i += MAGNITUDE_DIGITS; while (true) { var ch = str[i]; if (ch === '\u0000') { break; } else { numAsString += ch; } i++; } numAsString = numAsString.split('.'); if (numAsString.length === 1) { num = parseInt(numAsString, 10); } else { /* istanbul ignore next */ num = parseFloat(numAsString[0] + '.' + numAsString[1]); } /* istanbul ignore next */ if (neg) { num = num - 10; } /* istanbul ignore next */ if (magnitude !== 0) { // parseFloat is more reliable than pow due to rounding errors // e.g. Number.MAX_VALUE would return Infinity if we did // num * Math.pow(10, magnitude); num = parseFloat(num + 'e' + magnitude); } } return {num: num, length : i - originalIdx}; } // move up the stack while parsing // this function moved outside of parseIndexableString for performance function pop(stack, metaStack) { var obj = stack.pop(); if (metaStack.length) { var lastMetaElement = metaStack[metaStack.length - 1]; if (obj === lastMetaElement.element) { // popping a meta-element, e.g. an object whose value is another object metaStack.pop(); lastMetaElement = metaStack[metaStack.length - 1]; } var element = lastMetaElement.element; var lastElementIndex = lastMetaElement.index; if (Array.isArray(element)) { element.push(obj); } else if (lastElementIndex === stack.length - 2) { // obj with key+value var key = stack.pop(); element[key] = obj; } else { stack.push(obj); // obj with key only } } } function parseIndexableString(str) { var stack = []; var metaStack = []; // stack for arrays and objects var i = 0; /*eslint no-constant-condition: ["error", { "checkLoops": false }]*/ while (true) { var collationIndex = str[i++]; if (collationIndex === '\u0000') { if (stack.length === 1) { return stack.pop(); } else { pop(stack, metaStack); continue; } } switch (collationIndex) { case '1': stack.push(null); break; case '2': stack.push(str[i] === '1'); i++; break; case '3': var parsedNum = parseNumber(str, i); stack.push(parsedNum.num); i += parsedNum.length; break; case '4': var parsedStr = ''; /*eslint no-constant-condition: ["error", { "checkLoops": false }]*/ while (true) { var ch = str[i]; if (ch === '\u0000') { break; } parsedStr += ch; i++; } // perform the reverse of the order-preserving replacement // algorithm (see above) /* eslint-disable no-control-regex */ parsedStr = parsedStr.replace(/\u0001\u0001/g, '\u0000') .replace(/\u0001\u0002/g, '\u0001') .replace(/\u0002\u0002/g, '\u0002'); /* eslint-enable no-control-regex */ stack.push(parsedStr); break; case '5': var arrayElement = { element: [], index: stack.length }; stack.push(arrayElement.element); metaStack.push(arrayElement); break; case '6': var objElement = { element: {}, index: stack.length }; stack.push(objElement.element); metaStack.push(objElement); break; /* istanbul ignore next */ default: throw new Error( 'bad collationIndex or unexpectedly reached end of input: ' + collationIndex); } } } function arrayCollate(a, b) { var len = Math.min(a.length, b.length); for (var i = 0; i < len; i++) { var sort = collate(a[i], b[i]); if (sort !== 0) { return sort; } } return (a.length === b.length) ? 0 : (a.length > b.length) ? 1 : -1; } function stringCollate(a, b) { // See: https://github.com/daleharvey/pouchdb/issues/40 // This is incompatible with the CouchDB implementation, but its the // best we can do for now return (a === b) ? 0 : ((a > b) ? 1 : -1); } function objectCollate(a, b) { var ak = Object.keys(a), bk = Object.keys(b); var len = Math.min(ak.length, bk.length); for (var i = 0; i < len; i++) { // First sort the keys var sort = collate(ak[i], bk[i]); if (sort !== 0) { return sort; } // if the keys are equal sort the values sort = collate(a[ak[i]], b[bk[i]]); if (sort !== 0) { return sort; } } return (ak.length === bk.length) ? 0 : (ak.length > bk.length) ? 1 : -1; } // The collation is defined by erlangs ordered terms // the atoms null, true, false come first, then numbers, strings, // arrays, then objects // null/undefined/NaN/Infinity/-Infinity are all considered null function collationIndex(x) { var id = ['boolean', 'number', 'string', 'object']; var idx = id.indexOf(typeof x); //false if -1 otherwise true, but fast!!!!1 if (~idx) { if (x === null) { return 1; } if (Array.isArray(x)) { return 5; } return idx < 3 ? (idx + 2) : (idx + 3); } /* istanbul ignore next */ if (Array.isArray(x)) { return 5; } } // conversion: // x yyy zz...zz // x = 0 for negative, 1 for 0, 2 for positive // y = exponent (for negative numbers negated) moved so that it's >= 0 // z = mantisse function numToIndexableString(num) { if (num === 0) { return '1'; } // convert number to exponential format for easier and // more succinct string sorting var expFormat = num.toExponential().split(/e\+?/); var magnitude = parseInt(expFormat[1], 10); var neg = num < 0; var result = neg ? '0' : '2'; // first sort by magnitude // it's easier if all magnitudes are positive var magForComparison = ((neg ? -magnitude : magnitude) - MIN_MAGNITUDE); var magString = padLeft((magForComparison).toString(), '0', MAGNITUDE_DIGITS); result += SEP + magString; // then sort by the factor var factor = Math.abs(parseFloat(expFormat[0])); // [1..10) /* istanbul ignore next */ if (neg) { // for negative reverse ordering factor = 10 - factor; } var factorStr = factor.toFixed(20); // strip zeros from the end factorStr = factorStr.replace(/\.?0+$/, ''); result += SEP + factorStr; return result; } /***/ }), /* 721 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(706); /* harmony import */ var pouchdb_md5__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(714); /* harmony import */ var pouchdb_collections__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(708); /* harmony import */ var pouchdb_binary_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(722); /* harmony import */ var pouchdb_collate__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(720); /* harmony import */ var pouchdb_errors__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(711); /* harmony import */ var pouchdb_fetch__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(715); /* harmony import */ var pouchdb_mapreduce_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(724); /* * Simple task queue to sequentialize actions. Assumes * callbacks will eventually fire (once). */ function TaskQueue() { this.promise = new Promise(function (fulfill) {fulfill(); }); } TaskQueue.prototype.add = function (promiseFactory) { this.promise = this.promise.catch(function () { // just recover }).then(function () { return promiseFactory(); }); return this.promise; }; TaskQueue.prototype.finish = function () { return this.promise; }; function stringify(input) { if (!input) { return 'undefined'; // backwards compat for empty reduce } // for backwards compat with mapreduce, functions/strings are stringified // as-is. everything else is JSON-stringified. switch (typeof input) { case 'function': // e.g. a mapreduce map return input.toString(); case 'string': // e.g. a mapreduce built-in _reduce function return input.toString(); default: // e.g. a JSON object in the case of mango queries return JSON.stringify(input); } } /* create a string signature for a view so we can cache it and uniq it */ function createViewSignature(mapFun, reduceFun) { // the "undefined" part is for backwards compatibility return stringify(mapFun) + stringify(reduceFun) + 'undefined'; } function createView(sourceDB, viewName, mapFun, reduceFun, temporary, localDocName) { var viewSignature = createViewSignature(mapFun, reduceFun); var cachedViews; if (!temporary) { // cache this to ensure we don't try to update the same view twice cachedViews = sourceDB._cachedViews = sourceDB._cachedViews || {}; if (cachedViews[viewSignature]) { return cachedViews[viewSignature]; } } var promiseForView = sourceDB.info().then(function (info) { var depDbName = info.db_name + '-mrview-' + (temporary ? 'temp' : Object(pouchdb_md5__WEBPACK_IMPORTED_MODULE_1__["stringMd5"])(viewSignature)); // save the view name in the source db so it can be cleaned up if necessary // (e.g. when the _design doc is deleted, remove all associated view data) function diffFunction(doc) { doc.views = doc.views || {}; var fullViewName = viewName; if (fullViewName.indexOf('/') === -1) { fullViewName = viewName + '/' + viewName; } var depDbs = doc.views[fullViewName] = doc.views[fullViewName] || {}; /* istanbul ignore if */ if (depDbs[depDbName]) { return; // no update necessary } depDbs[depDbName] = true; return doc; } return Object(pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__["upsert"])(sourceDB, '_local/' + localDocName, diffFunction).then(function () { return sourceDB.registerDependentDatabase(depDbName).then(function (res) { var db = res.db; db.auto_compaction = true; var view = { name: depDbName, db: db, sourceDB: sourceDB, adapter: sourceDB.adapter, mapFun: mapFun, reduceFun: reduceFun }; return view.db.get('_local/lastSeq').catch(function (err) { /* istanbul ignore if */ if (err.status !== 404) { throw err; } }).then(function (lastSeqDoc) { view.seq = lastSeqDoc ? lastSeqDoc.seq : 0; if (cachedViews) { view.db.once('destroyed', function () { delete cachedViews[viewSignature]; }); } return view; }); }); }); }); if (cachedViews) { cachedViews[viewSignature] = promiseForView; } return promiseForView; } var persistentQueues = {}; var tempViewQueue = new TaskQueue(); var CHANGES_BATCH_SIZE = 50; function parseViewName(name) { // can be either 'ddocname/viewname' or just 'viewname' // (where the ddoc name is the same) return name.indexOf('/') === -1 ? [name, name] : name.split('/'); } function isGenOne(changes) { // only return true if the current change is 1- // and there are no other leafs return changes.length === 1 && /^1-/.test(changes[0].rev); } function emitError(db, e) { try { db.emit('error', e); } catch (err) { Object(pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__["guardedConsole"])('error', 'The user\'s map/reduce function threw an uncaught error.\n' + 'You can debug this error by doing:\n' + 'myDatabase.on(\'error\', function (err) { debugger; });\n' + 'Please double-check your map/reduce function.'); Object(pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__["guardedConsole"])('error', e); } } /** * Returns an "abstract" mapreduce object of the form: * * { * query: queryFun, * viewCleanup: viewCleanupFun * } * * Arguments are: * * localDoc: string * This is for the local doc that gets saved in order to track the * "dependent" DBs and clean them up for viewCleanup. It should be * unique, so that indexer plugins don't collide with each other. * mapper: function (mapFunDef, emit) * Returns a map function based on the mapFunDef, which in the case of * normal map/reduce is just the de-stringified function, but may be * something else, such as an object in the case of pouchdb-find. * reducer: function (reduceFunDef) * Ditto, but for reducing. Modules don't have to support reducing * (e.g. pouchdb-find). * ddocValidator: function (ddoc, viewName) * Throws an error if the ddoc or viewName is not valid. * This could be a way to communicate to the user that the configuration for the * indexer is invalid. */ function createAbstractMapReduce(localDocName, mapper, reducer, ddocValidator) { function tryMap(db, fun, doc) { // emit an event if there was an error thrown by a map function. // putting try/catches in a single function also avoids deoptimizations. try { fun(doc); } catch (e) { emitError(db, e); } } function tryReduce(db, fun, keys, values, rereduce) { // same as above, but returning the result or an error. there are two separate // functions to avoid extra memory allocations since the tryCode() case is used // for custom map functions (common) vs this function, which is only used for // custom reduce functions (rare) try { return {output : fun(keys, values, rereduce)}; } catch (e) { emitError(db, e); return {error: e}; } } function sortByKeyThenValue(x, y) { var keyCompare = Object(pouchdb_collate__WEBPACK_IMPORTED_MODULE_4__["collate"])(x.key, y.key); return keyCompare !== 0 ? keyCompare : Object(pouchdb_collate__WEBPACK_IMPORTED_MODULE_4__["collate"])(x.value, y.value); } function sliceResults(results, limit, skip) { skip = skip || 0; if (typeof limit === 'number') { return results.slice(skip, limit + skip); } else if (skip > 0) { return results.slice(skip); } return results; } function rowToDocId(row) { var val = row.value; // Users can explicitly specify a joined doc _id, or it // defaults to the doc _id that emitted the key/value. var docId = (val && typeof val === 'object' && val._id) || row.id; return docId; } function readAttachmentsAsBlobOrBuffer(res) { res.rows.forEach(function (row) { var atts = row.doc && row.doc._attachments; if (!atts) { return; } Object.keys(atts).forEach(function (filename) { var att = atts[filename]; atts[filename].data = Object(pouchdb_binary_utils__WEBPACK_IMPORTED_MODULE_3__["base64StringToBlobOrBuffer"])(att.data, att.content_type); }); }); } function postprocessAttachments(opts) { return function (res) { if (opts.include_docs && opts.attachments && opts.binary) { readAttachmentsAsBlobOrBuffer(res); } return res; }; } function addHttpParam(paramName, opts, params, asJson) { // add an http param from opts to params, optionally json-encoded var val = opts[paramName]; if (typeof val !== 'undefined') { if (asJson) { val = encodeURIComponent(JSON.stringify(val)); } params.push(paramName + '=' + val); } } function coerceInteger(integerCandidate) { if (typeof integerCandidate !== 'undefined') { var asNumber = Number(integerCandidate); // prevents e.g. '1foo' or '1.1' being coerced to 1 if (!isNaN(asNumber) && asNumber === parseInt(integerCandidate, 10)) { return asNumber; } else { return integerCandidate; } } } function coerceOptions(opts) { opts.group_level = coerceInteger(opts.group_level); opts.limit = coerceInteger(opts.limit); opts.skip = coerceInteger(opts.skip); return opts; } function checkPositiveInteger(number) { if (number) { if (typeof number !== 'number') { return new pouchdb_mapreduce_utils__WEBPACK_IMPORTED_MODULE_7__["QueryParseError"]('Invalid value for integer: "' + number + '"'); } if (number < 0) { return new pouchdb_mapreduce_utils__WEBPACK_IMPORTED_MODULE_7__["QueryParseError"]('Invalid value for positive integer: ' + '"' + number + '"'); } } } function checkQueryParseError(options, fun) { var startkeyName = options.descending ? 'endkey' : 'startkey'; var endkeyName = options.descending ? 'startkey' : 'endkey'; if (typeof options[startkeyName] !== 'undefined' && typeof options[endkeyName] !== 'undefined' && Object(pouchdb_collate__WEBPACK_IMPORTED_MODULE_4__["collate"])(options[startkeyName], options[endkeyName]) > 0) { throw new pouchdb_mapreduce_utils__WEBPACK_IMPORTED_MODULE_7__["QueryParseError"]('No rows can match your key range, ' + 'reverse your start_key and end_key or set {descending : true}'); } else if (fun.reduce && options.reduce !== false) { if (options.include_docs) { throw new pouchdb_mapreduce_utils__WEBPACK_IMPORTED_MODULE_7__["QueryParseError"]('{include_docs:true} is invalid for reduce'); } else if (options.keys && options.keys.length > 1 && !options.group && !options.group_level) { throw new pouchdb_mapreduce_utils__WEBPACK_IMPORTED_MODULE_7__["QueryParseError"]('Multi-key fetches for reduce views must use ' + '{group: true}'); } } ['group_level', 'limit', 'skip'].forEach(function (optionName) { var error = checkPositiveInteger(options[optionName]); if (error) { throw error; } }); } function httpQuery(db, fun, opts) { // List of parameters to add to the PUT request var params = []; var body; var method = 'GET'; var ok, status; // If opts.reduce exists and is defined, then add it to the list // of parameters. // If reduce=false then the results are that of only the map function // not the final result of map and reduce. addHttpParam('reduce', opts, params); addHttpParam('include_docs', opts, params); addHttpParam('attachments', opts, params); addHttpParam('limit', opts, params); addHttpParam('descending', opts, params); addHttpParam('group', opts, params); addHttpParam('group_level', opts, params); addHttpParam('skip', opts, params); addHttpParam('stale', opts, params); addHttpParam('conflicts', opts, params); addHttpParam('startkey', opts, params, true); addHttpParam('start_key', opts, params, true); addHttpParam('endkey', opts, params, true); addHttpParam('end_key', opts, params, true); addHttpParam('inclusive_end', opts, params); addHttpParam('key', opts, params, true); addHttpParam('update_seq', opts, params); // Format the list of parameters into a valid URI query string params = params.join('&'); params = params === '' ? '' : '?' + params; // If keys are supplied, issue a POST to circumvent GET query string limits // see http://wiki.apache.org/couchdb/HTTP_view_API#Querying_Options if (typeof opts.keys !== 'undefined') { var MAX_URL_LENGTH = 2000; // according to http://stackoverflow.com/a/417184/680742, // the de facto URL length limit is 2000 characters var keysAsString = 'keys=' + encodeURIComponent(JSON.stringify(opts.keys)); if (keysAsString.length + params.length + 1 <= MAX_URL_LENGTH) { // If the keys are short enough, do a GET. we do this to work around // Safari not understanding 304s on POSTs (see pouchdb/pouchdb#1239) params += (params[0] === '?' ? '&' : '?') + keysAsString; } else { method = 'POST'; if (typeof fun === 'string') { body = {keys: opts.keys}; } else { // fun is {map : mapfun}, so append to this fun.keys = opts.keys; } } } // We are referencing a query defined in the design doc if (typeof fun === 'string') { var parts = parseViewName(fun); return db.fetch('_design/' + parts[0] + '/_view/' + parts[1] + params, { headers: new pouchdb_fetch__WEBPACK_IMPORTED_MODULE_6__["Headers"]({'Content-Type': 'application/json'}), method: method, body: JSON.stringify(body) }).then(function (response) { ok = response.ok; status = response.status; return response.json(); }).then(function (result) { if (!ok) { result.status = status; throw Object(pouchdb_errors__WEBPACK_IMPORTED_MODULE_5__["generateErrorFromResponse"])(result); } // fail the entire request if the result contains an error result.rows.forEach(function (row) { /* istanbul ignore if */ if (row.value && row.value.error && row.value.error === "builtin_reduce_error") { throw new Error(row.reason); } }); return result; }).then(postprocessAttachments(opts)); } // We are using a temporary view, terrible for performance, good for testing body = body || {}; Object.keys(fun).forEach(function (key) { if (Array.isArray(fun[key])) { body[key] = fun[key]; } else { body[key] = fun[key].toString(); } }); return db.fetch('_temp_view' + params, { headers: new pouchdb_fetch__WEBPACK_IMPORTED_MODULE_6__["Headers"]({'Content-Type': 'application/json'}), method: 'POST', body: JSON.stringify(body) }).then(function (response) { ok = response.ok; status = response.status; return response.json(); }).then(function (result) { if (!ok) { result.status = status; throw Object(pouchdb_errors__WEBPACK_IMPORTED_MODULE_5__["generateErrorFromResponse"])(result); } return result; }).then(postprocessAttachments(opts)); } // custom adapters can define their own api._query // and override the default behavior /* istanbul ignore next */ function customQuery(db, fun, opts) { return new Promise(function (resolve, reject) { db._query(fun, opts, function (err, res) { if (err) { return reject(err); } resolve(res); }); }); } // custom adapters can define their own api._viewCleanup // and override the default behavior /* istanbul ignore next */ function customViewCleanup(db) { return new Promise(function (resolve, reject) { db._viewCleanup(function (err, res) { if (err) { return reject(err); } resolve(res); }); }); } function defaultsTo(value) { return function (reason) { /* istanbul ignore else */ if (reason.status === 404) { return value; } else { throw reason; } }; } // returns a promise for a list of docs to update, based on the input docId. // the order doesn't matter, because post-3.2.0, bulkDocs // is an atomic operation in all three adapters. function getDocsToPersist(docId, view, docIdsToChangesAndEmits) { var metaDocId = '_local/doc_' + docId; var defaultMetaDoc = {_id: metaDocId, keys: []}; var docData = docIdsToChangesAndEmits.get(docId); var indexableKeysToKeyValues = docData[0]; var changes = docData[1]; function getMetaDoc() { if (isGenOne(changes)) { // generation 1, so we can safely assume initial state // for performance reasons (avoids unnecessary GETs) return Promise.resolve(defaultMetaDoc); } return view.db.get(metaDocId).catch(defaultsTo(defaultMetaDoc)); } function getKeyValueDocs(metaDoc) { if (!metaDoc.keys.length) { // no keys, no need for a lookup return Promise.resolve({rows: []}); } return view.db.allDocs({ keys: metaDoc.keys, include_docs: true }); } function processKeyValueDocs(metaDoc, kvDocsRes) { var kvDocs = []; var oldKeys = new pouchdb_collections__WEBPACK_IMPORTED_MODULE_2__["Set"](); for (var i = 0, len = kvDocsRes.rows.length; i < len; i++) { var row = kvDocsRes.rows[i]; var doc = row.doc; if (!doc) { // deleted continue; } kvDocs.push(doc); oldKeys.add(doc._id); doc._deleted = !indexableKeysToKeyValues.has(doc._id); if (!doc._deleted) { var keyValue = indexableKeysToKeyValues.get(doc._id); if ('value' in keyValue) { doc.value = keyValue.value; } } } var newKeys = Object(pouchdb_mapreduce_utils__WEBPACK_IMPORTED_MODULE_7__["mapToKeysArray"])(indexableKeysToKeyValues); newKeys.forEach(function (key) { if (!oldKeys.has(key)) { // new doc var kvDoc = { _id: key }; var keyValue = indexableKeysToKeyValues.get(key); if ('value' in keyValue) { kvDoc.value = keyValue.value; } kvDocs.push(kvDoc); } }); metaDoc.keys = Object(pouchdb_mapreduce_utils__WEBPACK_IMPORTED_MODULE_7__["uniq"])(newKeys.concat(metaDoc.keys)); kvDocs.push(metaDoc); return kvDocs; } return getMetaDoc().then(function (metaDoc) { return getKeyValueDocs(metaDoc).then(function (kvDocsRes) { return processKeyValueDocs(metaDoc, kvDocsRes); }); }); } // updates all emitted key/value docs and metaDocs in the mrview database // for the given batch of documents from the source database function saveKeyValues(view, docIdsToChangesAndEmits, seq) { var seqDocId = '_local/lastSeq'; return view.db.get(seqDocId) .catch(defaultsTo({_id: seqDocId, seq: 0})) .then(function (lastSeqDoc) { var docIds = Object(pouchdb_mapreduce_utils__WEBPACK_IMPORTED_MODULE_7__["mapToKeysArray"])(docIdsToChangesAndEmits); return Promise.all(docIds.map(function (docId) { return getDocsToPersist(docId, view, docIdsToChangesAndEmits); })).then(function (listOfDocsToPersist) { var docsToPersist = Object(pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__["flatten"])(listOfDocsToPersist); lastSeqDoc.seq = seq; docsToPersist.push(lastSeqDoc); // write all docs in a single operation, update the seq once return view.db.bulkDocs({docs : docsToPersist}); }); }); } function getQueue(view) { var viewName = typeof view === 'string' ? view : view.name; var queue = persistentQueues[viewName]; if (!queue) { queue = persistentQueues[viewName] = new TaskQueue(); } return queue; } function updateView(view) { return Object(pouchdb_mapreduce_utils__WEBPACK_IMPORTED_MODULE_7__["sequentialize"])(getQueue(view), function () { return updateViewInQueue(view); })(); } function updateViewInQueue(view) { // bind the emit function once var mapResults; var doc; function emit(key, value) { var output = {id: doc._id, key: Object(pouchdb_collate__WEBPACK_IMPORTED_MODULE_4__["normalizeKey"])(key)}; // Don't explicitly store the value unless it's defined and non-null. // This saves on storage space, because often people don't use it. if (typeof value !== 'undefined' && value !== null) { output.value = Object(pouchdb_collate__WEBPACK_IMPORTED_MODULE_4__["normalizeKey"])(value); } mapResults.push(output); } var mapFun = mapper(view.mapFun, emit); var currentSeq = view.seq || 0; function processChange(docIdsToChangesAndEmits, seq) { return function () { return saveKeyValues(view, docIdsToChangesAndEmits, seq); }; } var queue = new TaskQueue(); function processNextBatch() { return view.sourceDB.changes({ return_docs: true, conflicts: true, include_docs: true, style: 'all_docs', since: currentSeq, limit: CHANGES_BATCH_SIZE }).then(processBatch); } function processBatch(response) { var results = response.results; if (!results.length) { return; } var docIdsToChangesAndEmits = createDocIdsToChangesAndEmits(results); queue.add(processChange(docIdsToChangesAndEmits, currentSeq)); if (results.length < CHANGES_BATCH_SIZE) { return; } return processNextBatch(); } function createDocIdsToChangesAndEmits(results) { var docIdsToChangesAndEmits = new pouchdb_collections__WEBPACK_IMPORTED_MODULE_2__["Map"](); for (var i = 0, len = results.length; i < len; i++) { var change = results[i]; if (change.doc._id[0] !== '_') { mapResults = []; doc = change.doc; if (!doc._deleted) { tryMap(view.sourceDB, mapFun, doc); } mapResults.sort(sortByKeyThenValue); var indexableKeysToKeyValues = createIndexableKeysToKeyValues(mapResults); docIdsToChangesAndEmits.set(change.doc._id, [ indexableKeysToKeyValues, change.changes ]); } currentSeq = change.seq; } return docIdsToChangesAndEmits; } function createIndexableKeysToKeyValues(mapResults) { var indexableKeysToKeyValues = new pouchdb_collections__WEBPACK_IMPORTED_MODULE_2__["Map"](); var lastKey; for (var i = 0, len = mapResults.length; i < len; i++) { var emittedKeyValue = mapResults[i]; var complexKey = [emittedKeyValue.key, emittedKeyValue.id]; if (i > 0 && Object(pouchdb_collate__WEBPACK_IMPORTED_MODULE_4__["collate"])(emittedKeyValue.key, lastKey) === 0) { complexKey.push(i); // dup key+id, so make it unique } indexableKeysToKeyValues.set(Object(pouchdb_collate__WEBPACK_IMPORTED_MODULE_4__["toIndexableString"])(complexKey), emittedKeyValue); lastKey = emittedKeyValue.key; } return indexableKeysToKeyValues; } return processNextBatch().then(function () { return queue.finish(); }).then(function () { view.seq = currentSeq; }); } function reduceView(view, results, options) { if (options.group_level === 0) { delete options.group_level; } var shouldGroup = options.group || options.group_level; var reduceFun = reducer(view.reduceFun); var groups = []; var lvl = isNaN(options.group_level) ? Number.POSITIVE_INFINITY : options.group_level; results.forEach(function (e) { var last = groups[groups.length - 1]; var groupKey = shouldGroup ? e.key : null; // only set group_level for array keys if (shouldGroup && Array.isArray(groupKey)) { groupKey = groupKey.slice(0, lvl); } if (last && Object(pouchdb_collate__WEBPACK_IMPORTED_MODULE_4__["collate"])(last.groupKey, groupKey) === 0) { last.keys.push([e.key, e.id]); last.values.push(e.value); return; } groups.push({ keys: [[e.key, e.id]], values: [e.value], groupKey: groupKey }); }); results = []; for (var i = 0, len = groups.length; i < len; i++) { var e = groups[i]; var reduceTry = tryReduce(view.sourceDB, reduceFun, e.keys, e.values, false); if (reduceTry.error && reduceTry.error instanceof pouchdb_mapreduce_utils__WEBPACK_IMPORTED_MODULE_7__["BuiltInError"]) { // CouchDB returns an error if a built-in errors out throw reduceTry.error; } results.push({ // CouchDB just sets the value to null if a non-built-in errors out value: reduceTry.error ? null : reduceTry.output, key: e.groupKey }); } // no total_rows/offset when reducing return {rows: sliceResults(results, options.limit, options.skip)}; } function queryView(view, opts) { return Object(pouchdb_mapreduce_utils__WEBPACK_IMPORTED_MODULE_7__["sequentialize"])(getQueue(view), function () { return queryViewInQueue(view, opts); })(); } function queryViewInQueue(view, opts) { var totalRows; var shouldReduce = view.reduceFun && opts.reduce !== false; var skip = opts.skip || 0; if (typeof opts.keys !== 'undefined' && !opts.keys.length) { // equivalent query opts.limit = 0; delete opts.keys; } function fetchFromView(viewOpts) { viewOpts.include_docs = true; return view.db.allDocs(viewOpts).then(function (res) { totalRows = res.total_rows; return res.rows.map(function (result) { // implicit migration - in older versions of PouchDB, // we explicitly stored the doc as {id: ..., key: ..., value: ...} // this is tested in a migration test /* istanbul ignore next */ if ('value' in result.doc && typeof result.doc.value === 'object' && result.doc.value !== null) { var keys = Object.keys(result.doc.value).sort(); // this detection method is not perfect, but it's unlikely the user // emitted a value which was an object with these 3 exact keys var expectedKeys = ['id', 'key', 'value']; if (!(keys < expectedKeys || keys > expectedKeys)) { return result.doc.value; } } var parsedKeyAndDocId = Object(pouchdb_collate__WEBPACK_IMPORTED_MODULE_4__["parseIndexableString"])(result.doc._id); return { key: parsedKeyAndDocId[0], id: parsedKeyAndDocId[1], value: ('value' in result.doc ? result.doc.value : null) }; }); }); } function onMapResultsReady(rows) { var finalResults; if (shouldReduce) { finalResults = reduceView(view, rows, opts); } else { finalResults = { total_rows: totalRows, offset: skip, rows: rows }; } /* istanbul ignore if */ if (opts.update_seq) { finalResults.update_seq = view.seq; } if (opts.include_docs) { var docIds = Object(pouchdb_mapreduce_utils__WEBPACK_IMPORTED_MODULE_7__["uniq"])(rows.map(rowToDocId)); return view.sourceDB.allDocs({ keys: docIds, include_docs: true, conflicts: opts.conflicts, attachments: opts.attachments, binary: opts.binary }).then(function (allDocsRes) { var docIdsToDocs = new pouchdb_collections__WEBPACK_IMPORTED_MODULE_2__["Map"](); allDocsRes.rows.forEach(function (row) { docIdsToDocs.set(row.id, row.doc); }); rows.forEach(function (row) { var docId = rowToDocId(row); var doc = docIdsToDocs.get(docId); if (doc) { row.doc = doc; } }); return finalResults; }); } else { return finalResults; } } if (typeof opts.keys !== 'undefined') { var keys = opts.keys; var fetchPromises = keys.map(function (key) { var viewOpts = { startkey : Object(pouchdb_collate__WEBPACK_IMPORTED_MODULE_4__["toIndexableString"])([key]), endkey : Object(pouchdb_collate__WEBPACK_IMPORTED_MODULE_4__["toIndexableString"])([key, {}]) }; /* istanbul ignore if */ if (opts.update_seq) { viewOpts.update_seq = true; } return fetchFromView(viewOpts); }); return Promise.all(fetchPromises).then(pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__["flatten"]).then(onMapResultsReady); } else { // normal query, no 'keys' var viewOpts = { descending : opts.descending }; /* istanbul ignore if */ if (opts.update_seq) { viewOpts.update_seq = true; } var startkey; var endkey; if ('start_key' in opts) { startkey = opts.start_key; } if ('startkey' in opts) { startkey = opts.startkey; } if ('end_key' in opts) { endkey = opts.end_key; } if ('endkey' in opts) { endkey = opts.endkey; } if (typeof startkey !== 'undefined') { viewOpts.startkey = opts.descending ? Object(pouchdb_collate__WEBPACK_IMPORTED_MODULE_4__["toIndexableString"])([startkey, {}]) : Object(pouchdb_collate__WEBPACK_IMPORTED_MODULE_4__["toIndexableString"])([startkey]); } if (typeof endkey !== 'undefined') { var inclusiveEnd = opts.inclusive_end !== false; if (opts.descending) { inclusiveEnd = !inclusiveEnd; } viewOpts.endkey = Object(pouchdb_collate__WEBPACK_IMPORTED_MODULE_4__["toIndexableString"])( inclusiveEnd ? [endkey, {}] : [endkey]); } if (typeof opts.key !== 'undefined') { var keyStart = Object(pouchdb_collate__WEBPACK_IMPORTED_MODULE_4__["toIndexableString"])([opts.key]); var keyEnd = Object(pouchdb_collate__WEBPACK_IMPORTED_MODULE_4__["toIndexableString"])([opts.key, {}]); if (viewOpts.descending) { viewOpts.endkey = keyStart; viewOpts.startkey = keyEnd; } else { viewOpts.startkey = keyStart; viewOpts.endkey = keyEnd; } } if (!shouldReduce) { if (typeof opts.limit === 'number') { viewOpts.limit = opts.limit; } viewOpts.skip = skip; } return fetchFromView(viewOpts).then(onMapResultsReady); } } function httpViewCleanup(db) { return db.fetch('_view_cleanup', { headers: new pouchdb_fetch__WEBPACK_IMPORTED_MODULE_6__["Headers"]({'Content-Type': 'application/json'}), method: 'POST' }).then(function (response) { return response.json(); }); } function localViewCleanup(db) { return db.get('_local/' + localDocName).then(function (metaDoc) { var docsToViews = new pouchdb_collections__WEBPACK_IMPORTED_MODULE_2__["Map"](); Object.keys(metaDoc.views).forEach(function (fullViewName) { var parts = parseViewName(fullViewName); var designDocName = '_design/' + parts[0]; var viewName = parts[1]; var views = docsToViews.get(designDocName); if (!views) { views = new pouchdb_collections__WEBPACK_IMPORTED_MODULE_2__["Set"](); docsToViews.set(designDocName, views); } views.add(viewName); }); var opts = { keys : Object(pouchdb_mapreduce_utils__WEBPACK_IMPORTED_MODULE_7__["mapToKeysArray"])(docsToViews), include_docs : true }; return db.allDocs(opts).then(function (res) { var viewsToStatus = {}; res.rows.forEach(function (row) { var ddocName = row.key.substring(8); // cuts off '_design/' docsToViews.get(row.key).forEach(function (viewName) { var fullViewName = ddocName + '/' + viewName; /* istanbul ignore if */ if (!metaDoc.views[fullViewName]) { // new format, without slashes, to support PouchDB 2.2.0 // migration test in pouchdb's browser.migration.js verifies this fullViewName = viewName; } var viewDBNames = Object.keys(metaDoc.views[fullViewName]); // design doc deleted, or view function nonexistent var statusIsGood = row.doc && row.doc.views && row.doc.views[viewName]; viewDBNames.forEach(function (viewDBName) { viewsToStatus[viewDBName] = viewsToStatus[viewDBName] || statusIsGood; }); }); }); var dbsToDelete = Object.keys(viewsToStatus).filter( function (viewDBName) { return !viewsToStatus[viewDBName]; }); var destroyPromises = dbsToDelete.map(function (viewDBName) { return Object(pouchdb_mapreduce_utils__WEBPACK_IMPORTED_MODULE_7__["sequentialize"])(getQueue(viewDBName), function () { return new db.constructor(viewDBName, db.__opts).destroy(); })(); }); return Promise.all(destroyPromises).then(function () { return {ok: true}; }); }); }, defaultsTo({ok: true})); } function queryPromised(db, fun, opts) { /* istanbul ignore next */ if (typeof db._query === 'function') { return customQuery(db, fun, opts); } if (Object(pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__["isRemote"])(db)) { return httpQuery(db, fun, opts); } if (typeof fun !== 'string') { // temp_view checkQueryParseError(opts, fun); tempViewQueue.add(function () { var createViewPromise = createView( /* sourceDB */ db, /* viewName */ 'temp_view/temp_view', /* mapFun */ fun.map, /* reduceFun */ fun.reduce, /* temporary */ true, /* localDocName */ localDocName); return createViewPromise.then(function (view) { return Object(pouchdb_mapreduce_utils__WEBPACK_IMPORTED_MODULE_7__["fin"])(updateView(view).then(function () { return queryView(view, opts); }), function () { return view.db.destroy(); }); }); }); return tempViewQueue.finish(); } else { // persistent view var fullViewName = fun; var parts = parseViewName(fullViewName); var designDocName = parts[0]; var viewName = parts[1]; return db.get('_design/' + designDocName).then(function (doc) { var fun = doc.views && doc.views[viewName]; if (!fun) { // basic validator; it's assumed that every subclass would want this throw new pouchdb_mapreduce_utils__WEBPACK_IMPORTED_MODULE_7__["NotFoundError"]('ddoc ' + doc._id + ' has no view named ' + viewName); } ddocValidator(doc, viewName); checkQueryParseError(opts, fun); var createViewPromise = createView( /* sourceDB */ db, /* viewName */ fullViewName, /* mapFun */ fun.map, /* reduceFun */ fun.reduce, /* temporary */ false, /* localDocName */ localDocName); return createViewPromise.then(function (view) { if (opts.stale === 'ok' || opts.stale === 'update_after') { if (opts.stale === 'update_after') { Object(pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__["nextTick"])(function () { updateView(view); }); } return queryView(view, opts); } else { // stale not ok return updateView(view).then(function () { return queryView(view, opts); }); } }); }); } } function abstractQuery(fun, opts, callback) { var db = this; if (typeof opts === 'function') { callback = opts; opts = {}; } opts = opts ? coerceOptions(opts) : {}; if (typeof fun === 'function') { fun = {map : fun}; } var promise = Promise.resolve().then(function () { return queryPromised(db, fun, opts); }); Object(pouchdb_mapreduce_utils__WEBPACK_IMPORTED_MODULE_7__["promisedCallback"])(promise, callback); return promise; } var abstractViewCleanup = Object(pouchdb_mapreduce_utils__WEBPACK_IMPORTED_MODULE_7__["callbackify"])(function () { var db = this; /* istanbul ignore next */ if (typeof db._viewCleanup === 'function') { return customViewCleanup(db); } if (Object(pouchdb_utils__WEBPACK_IMPORTED_MODULE_0__["isRemote"])(db)) { return httpViewCleanup(db); } return localViewCleanup(db); }); return { query: abstractQuery, viewCleanup: abstractViewCleanup }; } /* harmony default export */ __webpack_exports__["default"] = (createAbstractMapReduce); /***/ }), /* 722 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "atob", function() { return thisAtob; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "btoa", function() { return thisBtoa; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "base64StringToBlobOrBuffer", function() { return b64ToBluffer; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "binaryStringToArrayBuffer", function() { return binaryStringToArrayBuffer; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "binaryStringToBlobOrBuffer", function() { return binStringToBluffer; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "blob", function() { return createBlob; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "blobOrBufferToBase64", function() { return blobToBase64; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "blobOrBufferToBinaryString", function() { return blobToBase64$1; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "readAsArrayBuffer", function() { return readAsArrayBuffer; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "readAsBinaryString", function() { return readAsBinaryString; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "typedBuffer", function() { return typedBuffer; }); /* harmony import */ var buffer_from__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(723); /* harmony import */ var buffer_from__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(buffer_from__WEBPACK_IMPORTED_MODULE_0__); function thisAtob(str) { var base64 = new Buffer(str, 'base64'); // Node.js will just skip the characters it can't decode instead of // throwing an exception if (base64.toString('base64') !== str) { throw new Error("attachment is not a valid base64 string"); } return base64.toString('binary'); } function thisBtoa(str) { return buffer_from__WEBPACK_IMPORTED_MODULE_0___default()(str, 'binary').toString('base64'); } function typedBuffer(binString, buffType, type) { // buffType is either 'binary' or 'base64' var buff = buffer_from__WEBPACK_IMPORTED_MODULE_0___default()(binString, buffType); buff.type = type; // non-standard, but used for consistency with the browser return buff; } function b64ToBluffer(b64, type) { return typedBuffer(b64, 'base64', type); } // From http://stackoverflow.com/questions/14967647/ (continues on next line) // encode-decode-image-with-base64-breaks-image (2013-04-21) function binaryStringToArrayBuffer(bin) { var length = bin.length; var buf = new ArrayBuffer(length); var arr = new Uint8Array(buf); for (var i = 0; i < length; i++) { arr[i] = bin.charCodeAt(i); } return buf; } function binStringToBluffer(binString, type) { return typedBuffer(binString, 'binary', type); } // This function is unused in Node /* istanbul ignore next */ function createBlob() { } function blobToBase64(blobOrBuffer, callback) { callback(blobOrBuffer.toString('base64')); } // not used in Node, but here for completeness function blobToBase64$1(blobOrBuffer, callback) { callback(blobOrBuffer.toString('binary')); } // simplified API. universal browser support is assumed function readAsArrayBuffer(blob, callback) { var reader = new FileReader(); reader.onloadend = function (e) { var result = e.target.result || new ArrayBuffer(0); callback(result); }; reader.readAsArrayBuffer(blob); } //Can't find original post, but this is close //http://stackoverflow.com/questions/6965107/ (continues on next line) //converting-between-strings-and-arraybuffers function arrayBufferToBinaryString(buffer) { var binary = ''; var bytes = new Uint8Array(buffer); var length = bytes.byteLength; for (var i = 0; i < length; i++) { binary += String.fromCharCode(bytes[i]); } return binary; } // shim for browsers that don't support it function readAsBinaryString(blob, callback) { var reader = new FileReader(); var hasBinaryString = typeof reader.readAsBinaryString === 'function'; reader.onloadend = function (e) { var result = e.target.result || ''; if (hasBinaryString) { return callback(result); } callback(arrayBufferToBinaryString(result)); }; if (hasBinaryString) { reader.readAsBinaryString(blob); } else { reader.readAsArrayBuffer(blob); } } /***/ }), /* 723 */ /***/ (function(module, exports) { var toString = Object.prototype.toString var isModern = ( typeof Buffer.alloc === 'function' && typeof Buffer.allocUnsafe === 'function' && typeof Buffer.from === 'function' ) function isArrayBuffer (input) { return toString.call(input).slice(8, -1) === 'ArrayBuffer' } function fromArrayBuffer (obj, byteOffset, length) { byteOffset >>>= 0 var maxLength = obj.byteLength - byteOffset if (maxLength < 0) { throw new RangeError("'offset' is out of bounds") } if (length === undefined) { length = maxLength } else { length >>>= 0 if (length > maxLength) { throw new RangeError("'length' is out of bounds") } } return isModern ? Buffer.from(obj.slice(byteOffset, byteOffset + length)) : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length))) } function fromString (string, encoding) { if (typeof encoding !== 'string' || encoding === '') { encoding = 'utf8' } if (!Buffer.isEncoding(encoding)) { throw new TypeError('"encoding" must be a valid string encoding') } return isModern ? Buffer.from(string, encoding) : new Buffer(string, encoding) } function bufferFrom (value, encodingOrOffset, length) { if (typeof value === 'number') { throw new TypeError('"value" argument must not be a number') } if (isArrayBuffer(value)) { return fromArrayBuffer(value, encodingOrOffset, length) } if (typeof value === 'string') { return fromString(value, encodingOrOffset) } return isModern ? Buffer.from(value) : new Buffer(value) } module.exports = bufferFrom /***/ }), /* 724 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "uniq", function() { return uniq; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sequentialize", function() { return sequentialize; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fin", function() { return fin; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "callbackify", function() { return callbackify; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "promisedCallback", function() { return promisedCallback; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapToKeysArray", function() { return mapToKeysArray; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QueryParseError", function() { return QueryParseError; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotFoundError", function() { return NotFoundError; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BuiltInError", function() { return BuiltInError; }); /* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(725); /* harmony import */ var inherits__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(inherits__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var pouchdb_collections__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(708); /* harmony import */ var argsarray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(694); /* harmony import */ var argsarray__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(argsarray__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var pouchdb_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(706); function QueryParseError(message) { this.status = 400; this.name = 'query_parse_error'; this.message = message; this.error = true; try { Error.captureStackTrace(this, QueryParseError); } catch (e) {} } inherits__WEBPACK_IMPORTED_MODULE_0___default()(QueryParseError, Error); function NotFoundError(message) { this.status = 404; this.name = 'not_found'; this.message = message; this.error = true; try { Error.captureStackTrace(this, NotFoundError); } catch (e) {} } inherits__WEBPACK_IMPORTED_MODULE_0___default()(NotFoundError, Error); function BuiltInError(message) { this.status = 500; this.name = 'invalid_value'; this.message = message; this.error = true; try { Error.captureStackTrace(this, BuiltInError); } catch (e) {} } inherits__WEBPACK_IMPORTED_MODULE_0___default()(BuiltInError, Error); function promisedCallback(promise, callback) { if (callback) { promise.then(function (res) { Object(pouchdb_utils__WEBPACK_IMPORTED_MODULE_3__["nextTick"])(function () { callback(null, res); }); }, function (reason) { Object(pouchdb_utils__WEBPACK_IMPORTED_MODULE_3__["nextTick"])(function () { callback(reason); }); }); } return promise; } function callbackify(fun) { return argsarray__WEBPACK_IMPORTED_MODULE_2___default()(function (args) { var cb = args.pop(); var promise = fun.apply(this, args); if (typeof cb === 'function') { promisedCallback(promise, cb); } return promise; }); } // Promise finally util similar to Q.finally function fin(promise, finalPromiseFactory) { return promise.then(function (res) { return finalPromiseFactory().then(function () { return res; }); }, function (reason) { return finalPromiseFactory().then(function () { throw reason; }); }); } function sequentialize(queue, promiseFactory) { return function () { var args = arguments; var that = this; return queue.add(function () { return promiseFactory.apply(that, args); }); }; } // uniq an array of strings, order not guaranteed // similar to underscore/lodash _.uniq function uniq(arr) { var theSet = new pouchdb_collections__WEBPACK_IMPORTED_MODULE_1__["Set"](arr); var result = new Array(theSet.size); var index = -1; theSet.forEach(function (value) { result[++index] = value; }); return result; } function mapToKeysArray(map) { var result = new Array(map.size); var index = -1; map.forEach(function (value, key) { result[++index] = key; }); return result; } /***/ }), /* 725 */ /***/ (function(module, exports, __webpack_require__) { try { var util = __webpack_require__(9); if (typeof util.inherits !== 'function') throw ''; module.exports = util.inherits; } catch (e) { module.exports = __webpack_require__(726); } /***/ }), /* 726 */ /***/ (function(module, exports) { if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { ctor.super_ = superCtor ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }); }; } else { // old school shim for old browsers module.exports = function inherits(ctor, superCtor) { ctor.super_ = superCtor var TempCtor = function () {} TempCtor.prototype = superCtor.prototype ctor.prototype = new TempCtor() ctor.prototype.constructor = ctor } } /***/ }), /* 727 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.manifest = exports.Registry = exports.getQueryFromState = exports.cancelable = exports.dehydrate = exports.HasManyTriggers = exports.HasManyInPlace = exports.HasOneInPlace = exports.HasOne = exports.HasMany = exports.Association = exports.getDoctypeFromOperation = exports.MutationTypes = exports.Mutations = exports.QueryDefinition = exports.compose = exports.StackLink = exports.CozyLink = exports.default = undefined; var _CozyClient = __webpack_require__(728); Object.defineProperty(exports, 'default', { enumerable: true, get: function get() { return _interopRequireDefault(_CozyClient).default; } }); var _CozyLink = __webpack_require__(885); Object.defineProperty(exports, 'CozyLink', { enumerable: true, get: function get() { return _interopRequireDefault(_CozyLink).default; } }); var _StackLink = __webpack_require__(857); Object.defineProperty(exports, 'StackLink', { enumerable: true, get: function get() { return _interopRequireDefault(_StackLink).default; } }); var _flow = __webpack_require__(1051); Object.defineProperty(exports, 'compose', { enumerable: true, get: function get() { return _interopRequireDefault(_flow).default; } }); var _dsl = __webpack_require__(884); Object.defineProperty(exports, 'QueryDefinition', { enumerable: true, get: function get() { return _dsl.QueryDefinition; } }); Object.defineProperty(exports, 'Mutations', { enumerable: true, get: function get() { return _dsl.Mutations; } }); Object.defineProperty(exports, 'MutationTypes', { enumerable: true, get: function get() { return _dsl.MutationTypes; } }); Object.defineProperty(exports, 'getDoctypeFromOperation', { enumerable: true, get: function get() { return _dsl.getDoctypeFromOperation; } }); var _associations = __webpack_require__(888); Object.defineProperty(exports, 'Association', { enumerable: true, get: function get() { return _associations.Association; } }); Object.defineProperty(exports, 'HasMany', { enumerable: true, get: function get() { return _associations.HasMany; } }); Object.defineProperty(exports, 'HasOne', { enumerable: true, get: function get() { return _associations.HasOne; } }); Object.defineProperty(exports, 'HasOneInPlace', { enumerable: true, get: function get() { return _associations.HasOneInPlace; } }); Object.defineProperty(exports, 'HasManyInPlace', { enumerable: true, get: function get() { return _associations.HasManyInPlace; } }); Object.defineProperty(exports, 'HasManyTriggers', { enumerable: true, get: function get() { return _associations.HasManyTriggers; } }); var _helpers = __webpack_require__(965); Object.defineProperty(exports, 'dehydrate', { enumerable: true, get: function get() { return _helpers.dehydrate; } }); var _utils = __webpack_require__(1053); Object.defineProperty(exports, 'cancelable', { enumerable: true, get: function get() { return _utils.cancelable; } }); var _store = __webpack_require__(899); Object.defineProperty(exports, 'getQueryFromState', { enumerable: true, get: function get() { return _store.getQueryFromState; } }); var _registry = __webpack_require__(1054); Object.defineProperty(exports, 'Registry', { enumerable: true, get: function get() { return _interopRequireDefault(_registry).default; } }); var _manifest = __webpack_require__(1058); var manifest = _interopRequireWildcard(_manifest); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.manifest = manifest; /***/ }), /* 728 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _entries = __webpack_require__(729); var _entries2 = _interopRequireDefault(_entries); var _toArray2 = __webpack_require__(765); var _toArray3 = _interopRequireDefault(_toArray2); var _slicedToArray2 = __webpack_require__(788); var _slicedToArray3 = _interopRequireDefault(_slicedToArray2); var _promise = __webpack_require__(799); var _promise2 = _interopRequireDefault(_promise); var _map = __webpack_require__(817); var _map2 = _interopRequireDefault(_map); var _keys = __webpack_require__(835); var _keys2 = _interopRequireDefault(_keys); var _values = __webpack_require__(839); var _values2 = _interopRequireDefault(_values); var _toConsumableArray2 = __webpack_require__(842); var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2); var _extends2 = __webpack_require__(843); var _extends3 = _interopRequireDefault(_extends2); var _regenerator = __webpack_require__(619); var _regenerator2 = _interopRequireDefault(_regenerator); var _asyncToGenerator2 = __webpack_require__(849); var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); var _getIterator2 = __webpack_require__(796); var _getIterator3 = _interopRequireDefault(_getIterator2); var _objectWithoutProperties2 = __webpack_require__(850); var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); var _classCallCheck2 = __webpack_require__(851); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = __webpack_require__(852); var _createClass3 = _interopRequireDefault(_createClass2); var _const = __webpack_require__(856); var _StackLink = __webpack_require__(857); var _StackLink2 = _interopRequireDefault(_StackLink); var _associations = __webpack_require__(888); var _helpers = __webpack_require__(889); var _helpers2 = __webpack_require__(965); var _dsl = __webpack_require__(884); var _cozyStackClient = __webpack_require__(966); var _cozyStackClient2 = _interopRequireDefault(_cozyStackClient); var _mobile = __webpack_require__(1015); var _optimize = __webpack_require__(1036); var _optimize2 = _interopRequireDefault(_optimize); var _store = __webpack_require__(899); var _store2 = _interopRequireDefault(_store); var _policies = __webpack_require__(1039); var _policies2 = _interopRequireDefault(_policies); var _Schema = __webpack_require__(1040); var _Schema2 = _interopRequireDefault(_Schema); var _CozyLink = __webpack_require__(885); var _ObservableQuery = __webpack_require__(1046); var _ObservableQuery2 = _interopRequireDefault(_ObservableQuery); var _mapValues = __webpack_require__(901); var _mapValues2 = _interopRequireDefault(_mapValues); var _fromPairs = __webpack_require__(1047); var _fromPairs2 = _interopRequireDefault(_fromPairs); var _flatten = __webpack_require__(598); var _flatten2 = _interopRequireDefault(_flatten); var _uniqBy = __webpack_require__(612); var _uniqBy2 = _interopRequireDefault(_uniqBy); var _zip = __webpack_require__(1048); var _zip2 = _interopRequireDefault(_zip); var _forEach = __webpack_require__(458); var _forEach2 = _interopRequireDefault(_forEach); var _get = __webpack_require__(571); var _get2 = _interopRequireDefault(_get); var _microee = __webpack_require__(1050); var _microee2 = _interopRequireDefault(_microee); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var ensureArray = function ensureArray(arr) { return Array.isArray(arr) ? arr : [arr]; }; var deprecatedHandler = function deprecatedHandler(msg) { return { get: function get(target, prop) { console.warn(msg); return target[prop]; } }; }; var TRIGGER_CREATION = 'creation'; var TRIGGER_UPDATE = 'update'; /** * Responsible for * * - Creating observable queries * - Hydration * - Creating plan for saving documents * - Associations */ var CozyClient = function () { /** * @param {object} options * @param {Link} options.link - Backward compatibility * @param {Array.Link} options.links - List of links * @param {object} options.schema - Schema description for each doctypes * @param {object} options.appMetadata - Metadata about the application that will be used in ensureCozyMetadata * * Cozy-Client will automatically call `this.login()` if provided with a token and an uri */ function CozyClient(_ref) { var link = _ref.link, links = _ref.links, _ref$schema = _ref.schema, schema = _ref$schema === undefined ? {} : _ref$schema, _ref$appMetadata = _ref.appMetadata, appMetadata = _ref$appMetadata === undefined ? {} : _ref$appMetadata, options = (0, _objectWithoutProperties3.default)(_ref, ['link', 'links', 'schema', 'appMetadata']); (0, _classCallCheck3.default)(this, CozyClient); if (link) { console.warn('`link` is deprecated, use `links`'); } this.appMetadata = appMetadata; this.options = options; this.idCounter = 1; this.isLogged = false; // Bind handlers this.handleRevocationChange = this.handleRevocationChange.bind(this); this.handleTokenRefresh = this.handleTokenRefresh.bind(this); this.createClient(); this.links = ensureArray(link || links || new _StackLink2.default()); this.registerClientOnLinks(); this.chain = (0, _CozyLink.chain)(this.links); this.schema = new _Schema2.default(schema, this.getStackClient()); // Instances of plugins registered with registerPlugin this.plugins = {}; if (options.uri && options.token) { this.login(); } } /** * A plugin is a class whose constructor receives the client as first argument. * The main mean of interaction with the client should be with events * like "login"/"logout". * * The plugin system is meant to encourage separation of concerns, modularity * and testability : instead of registering events at module level, please * create a plugin that subscribes to events. * * Plugin instances are stored internally in the `plugins` attribute of the client * and can be accessed via this mean. A plugin class must have the attribute * `pluginName` that will be use as the key in the `plugins` object. * * Two plugins with the same `pluginName` cannot co-exist. * * @example * ``` * class AlertPlugin { * constructor(client, options) { * this.client = client * this.options = options * this.handleLogin = this.handleLogin.bind(this) * this.handleLogout = this.handleLogout.bind(this) * this.client.on("login", this.handleLogin) * this.client.on("logout", this.handleLogout) * } * * handleLogin() { * alert(this.options.onLoginAlert) * } * * handleLogout() { * alert(this.options.onLogoutAlert) * } * } * * AlertPlugin.pluginName = 'alerts' * * client.registerPlugin(AlertPlugin, { * onLoginAlert: 'client has logged in !', * onLogoutAlert: 'client has logged out !' * }) * * // the instance of the plugin is accessible via * client.plugins.alerts * ``` */ (0, _createClass3.default)(CozyClient, [{ key: 'registerPlugin', value: function registerPlugin(Plugin, options) { if (!Plugin.pluginName) { throw new Error('Cannot register a plugin whose class does not have `pluginName` attribute.'); } if (this.plugins[Plugin.pluginName]) { throw new Error('Cannot register plugin ' + Plugin.pluginName + '. A plugin with the same name has already been registered.'); } var instance = new Plugin(this, options); this.plugins[Plugin.pluginName] = instance; return instance; } /** * To help with the transition from cozy-client-js to cozy-client, it is possible to instantiate * a client with an instance of cozy-client-js. */ }, { key: 'addSchema', value: function addSchema(schemaDefinition) { this.schema.add(schemaDefinition); } }, { key: 'registerClientOnLinks', value: function registerClientOnLinks() { var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = (0, _getIterator3.default)(this.links), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var link = _step.value; if (link.registerClient) { try { link.registerClient(this); } catch (e) { console.warn(e); } } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } } /** * Notify the links that they can start and set isLogged to true. * * On mobile, where url/token are set after instantiation, use this method * to set the token and uri via options. * * Emits * * - "beforeLogin" at the beginning, before links have been set up * - "login" when the client is fully logged in and links have been set up * * @param {options.token} options.token - If passed, the token is set on the client * @param {options.uri} options.uri - If passed, the uri is set on the client * @returns {Promise} - Resolves when all links have been setup and client is fully logged in * */ }, { key: 'login', value: function login(options) { // Keep the promise to be able to return it in future calls. // This allows us to autoLogin in constructor without breaking any compatibility // with codes that uses an explicit login. if (this.isLogged && !this.isRevoked) { console.warn('CozyClient is already logged.'); return this.loginPromise; } return this.loginPromise = this._login(options); } }, { key: '_login', value: function () { var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(options) { var _iteratorNormalCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, link; return _regenerator2.default.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: this.emit('beforeLogin'); this.registerClientOnLinks(); if (options) { if (options.uri) { this.stackClient.setUri(options.uri); } if (options.token) { this.stackClient.setToken(options.token); } } _iteratorNormalCompletion2 = true; _didIteratorError2 = false; _iteratorError2 = undefined; _context.prev = 6; _iterator2 = (0, _getIterator3.default)(this.links); case 8: if (_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done) { _context.next = 16; break; } link = _step2.value; if (!link.onLogin) { _context.next = 13; break; } _context.next = 13; return link.onLogin(); case 13: _iteratorNormalCompletion2 = true; _context.next = 8; break; case 16: _context.next = 22; break; case 18: _context.prev = 18; _context.t0 = _context['catch'](6); _didIteratorError2 = true; _iteratorError2 = _context.t0; case 22: _context.prev = 22; _context.prev = 23; if (!_iteratorNormalCompletion2 && _iterator2.return) { _iterator2.return(); } case 25: _context.prev = 25; if (!_didIteratorError2) { _context.next = 28; break; } throw _iteratorError2; case 28: return _context.finish(25); case 29: return _context.finish(22); case 30: this.isLogged = true; this.isRevoked = false; this.emit('login'); case 33: case 'end': return _context.stop(); } } }, _callee, this, [[6, 18, 22, 30], [23,, 25, 29]]); })); function _login(_x) { return _ref2.apply(this, arguments); } return _login; }() /** * Logs out the client and reset all the links * * Emits * * - "beforeLogout" at the beginning, before links have been reset * - "login" when the client is fully logged out and links have been reset * * @returns {Promise} - Resolves when all links have been reset and client is fully logged out */ }, { key: 'logout', value: function () { var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2() { var _iteratorNormalCompletion3, _didIteratorError3, _iteratorError3, _iterator3, _step3, link; return _regenerator2.default.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: if (this.isLogged) { _context2.next = 3; break; } console.warn('CozyClient isn\'t logged.'); return _context2.abrupt('return'); case 3: this.emit('beforeLogout'); this.isLogged = false; if (!(this.stackClient instanceof _cozyStackClient.OAuthClient)) { _context2.next = 17; break; } _context2.prev = 6; if (!(this.stackClient.unregister && (!this.stackClient.isRegistered || this.stackClient.isRegistered()))) { _context2.next = 10; break; } _context2.next = 10; return this.stackClient.unregister(); case 10: _context2.next = 15; break; case 12: _context2.prev = 12; _context2.t0 = _context2['catch'](6); console.warn('Impossible to unregister client on stack: ' + _context2.t0); case 15: _context2.next = 25; break; case 17: _context2.prev = 17; _context2.next = 20; return this.stackClient.fetch('DELETE', '/auth/login'); case 20: _context2.next = 25; break; case 22: _context2.prev = 22; _context2.t1 = _context2['catch'](17); console.warn('Impossible to log out: ' + _context2.t1); case 25: // clean information on links _iteratorNormalCompletion3 = true; _didIteratorError3 = false; _iteratorError3 = undefined; _context2.prev = 28; _iterator3 = (0, _getIterator3.default)(this.links); case 30: if (_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done) { _context2.next = 44; break; } link = _step3.value; if (!link.reset) { _context2.next = 41; break; } _context2.prev = 33; _context2.next = 36; return link.reset(); case 36: _context2.next = 41; break; case 38: _context2.prev = 38; _context2.t2 = _context2['catch'](33); console.warn(_context2.t2); case 41: _iteratorNormalCompletion3 = true; _context2.next = 30; break; case 44: _context2.next = 50; break; case 46: _context2.prev = 46; _context2.t3 = _context2['catch'](28); _didIteratorError3 = true; _iteratorError3 = _context2.t3; case 50: _context2.prev = 50; _context2.prev = 51; if (!_iteratorNormalCompletion3 && _iterator3.return) { _iterator3.return(); } case 53: _context2.prev = 53; if (!_didIteratorError3) { _context2.next = 56; break; } throw _iteratorError3; case 56: return _context2.finish(53); case 57: return _context2.finish(50); case 58: this.emit('logout'); case 59: case 'end': return _context2.stop(); } } }, _callee2, this, [[6, 12], [17, 22], [28, 46, 50, 58], [33, 38], [51,, 53, 57]]); })); function logout() { return _ref3.apply(this, arguments); } return logout; }() /** * Forwards to a stack client instance and returns * a [DocumentCollection]{@link https://docs.cozy.io/en/cozy-client/api/cozy-stack-client/#DocumentCollection} instance. * * @param {string} doctype The collection doctype. * @returns {DocumentCollection} */ }, { key: 'collection', value: function collection(doctype) { return this.getStackClient().collection(doctype); } }, { key: 'fetch', value: function fetch(method, path, body) { var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; return this.getStackClient().fetch(method, path, body, options); } }, { key: 'all', value: function all(doctype) { return new _dsl.QueryDefinition({ doctype: doctype }); } }, { key: 'find', value: function find(doctype) { var selector = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; return new _dsl.QueryDefinition({ doctype: doctype, selector: selector }); } }, { key: 'get', value: function get(doctype, id) { return new _dsl.QueryDefinition({ doctype: doctype, id: id }); } }, { key: 'create', value: function () { var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(type, _ref4, relationships) { var _type = _ref4._type, attributes = (0, _objectWithoutProperties3.default)(_ref4, ['_type']); var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; var document, ret; return _regenerator2.default.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: document = (0, _extends3.default)({ _type: type }, attributes); _context3.next = 3; return this.schema.validate(document); case 3: ret = _context3.sent; if (!(ret !== true)) { _context3.next = 6; break; } throw new Error('Validation failed'); case 6: return _context3.abrupt('return', this.mutate(this.getDocumentSavePlan(document, relationships), options)); case 7: case 'end': return _context3.stop(); } } }, _callee3, this); })); function create(_x5, _x6, _x7) { return _ref5.apply(this, arguments); } return create; }() }, { key: 'validate', value: function validate(document) { return this.schema.validate(document); } }, { key: 'save', value: function () { var _ref6 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(document) { var mutationOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var ret; return _regenerator2.default.wrap(function _callee4$(_context4) { while (1) { switch (_context4.prev = _context4.next) { case 0: _context4.next = 2; return this.schema.validate(document); case 2: ret = _context4.sent; if (!(ret !== true)) { _context4.next = 5; break; } throw new Error('Validation failed'); case 5: return _context4.abrupt('return', this.mutate(this.getDocumentSavePlan(document), mutationOptions)); case 6: case 'end': return _context4.stop(); } } }, _callee4, this); })); function save(_x9) { return _ref6.apply(this, arguments); } return save; }() }, { key: 'ensureCozyMetadata', value: function ensureCozyMetadata(document) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { event: TRIGGER_CREATION }; var METADATA_VERSION = 1; if (this.appMetadata === undefined) return document; var doctypeVersion = void 0; if (document._type) { var schema = this.schema.getDoctypeSchema(document._type); doctypeVersion = (0, _get2.default)(schema, 'doctypeVersion'); } var _appMetadata = this.appMetadata, slug = _appMetadata.slug, sourceAccount = _appMetadata.sourceAccount, version = _appMetadata.version; var now = new Date().toISOString(); var cozyMetadata = (0, _get2.default)(document, 'cozyMetadata', {}); if (options.event === TRIGGER_CREATION) { cozyMetadata = (0, _extends3.default)({ metadataVersion: METADATA_VERSION, doctypeVersion: doctypeVersion, createdByApp: slug, sourceAccount: sourceAccount, createdAt: now, createdByAppVersion: version, updatedAt: now, updatedByApps: slug ? [{ date: now, slug: slug, version: version }] : [] }, cozyMetadata); } else if (options.event === TRIGGER_UPDATE) { cozyMetadata = (0, _extends3.default)({}, cozyMetadata, { updatedAt: now, updatedByApps: [{ date: now, slug: slug, version: version }].concat((0, _toConsumableArray3.default)((0, _get2.default)(document, 'cozyMetadata.updatedByApps', []).filter(function (info) { return info.slug !== slug; }))) }); } return (0, _extends3.default)({}, document, { cozyMetadata: cozyMetadata }); } /** * Creates a list of mutations to execute to create a document and its relationships. * * ```js * const baseDoc = { _type: 'io.cozy.todo', label: 'Go hiking' } * // relations can be arrays or single objects * const relationships = { * attachments: [{ _id: 12345, _type: 'io.cozy.files' }, { _id: 6789, _type: 'io.cozy.files' }], * bills: { _id: 9999, _type: 'io.cozy.bills' } * } * client.getDocumentSavePlan(baseDoc, relationships) * ``` * * @param {object} document The base document to create * @param {object} relationships The list of relationships to add, as a dictionnary. Keys should be relationship names and values the documents to link. * @returns {Mutation[]} One or more mutation to execute */ }, { key: 'getDocumentSavePlan', value: function getDocumentSavePlan(document, relationships) { var _this = this; var newDocument = !document._rev; var dehydratedDoc = this.ensureCozyMetadata((0, _helpers2.dehydrate)(document), { event: newDocument ? TRIGGER_CREATION : TRIGGER_UPDATE }); var saveMutation = newDocument ? _dsl.Mutations.createDocument(dehydratedDoc) : _dsl.Mutations.updateDocument(dehydratedDoc); var hasRelationships = relationships && (0, _values2.default)(relationships).filter(function (relations) { return Array.isArray(relations) ? relations.length > 0 : relations; }).length > 0; if (!hasRelationships) { return saveMutation; } if (relationships && !newDocument) { throw new Error('Unable to save relationships on a not-new document'); } return [saveMutation, function (response) { var document = _this.hydrateDocument(response.data); return (0, _keys2.default)(relationships).map(function (name) { var val = relationships[name]; return Array.isArray(val) ? document[name].insertDocuments(val) : document[name].setDocument(val); }); }]; } /** * Hooks are an observable system for events on documents. * There are at the moment only 2 hooks available. * * - before:destroy, called just before a document is destroyed via CozyClient::destroy * - after:destroy, called after a document is destroyed via CozyClient::destroy * * @example * ``` * CozyClient.registerHook('io.cozy.bank.accounts', 'before:destroy', () => { * console.log('A io.cozy.bank.accounts is being destroyed') * }) * ``` * * @param {string} doctype * @param {string} name Name of the hook * @param {Function} fn Callback */ }, { key: 'triggerHook', value: function triggerHook(name, document) { if (!CozyClient.hooks) return; var allHooks = CozyClient.hooks[document._type] || {}; var hooks = allHooks[name] || []; var _iteratorNormalCompletion4 = true; var _didIteratorError4 = false; var _iteratorError4 = undefined; try { for (var _iterator4 = (0, _getIterator3.default)(hooks), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { var h = _step4.value; h(this, document); } } catch (err) { _didIteratorError4 = true; _iteratorError4 = err; } finally { try { if (!_iteratorNormalCompletion4 && _iterator4.return) { _iterator4.return(); } } finally { if (_didIteratorError4) { throw _iteratorError4; } } } } /** * Destroys a document. {before,after}:destroy hooks will be fired. * * @param {Document} document * @returns {Document} The document that has been deleted */ }, { key: 'destroy', value: function () { var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(document) { var mutationOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var res; return _regenerator2.default.wrap(function _callee5$(_context5) { while (1) { switch (_context5.prev = _context5.next) { case 0: _context5.next = 2; return this.triggerHook('before:destroy', document); case 2: _context5.next = 4; return this.mutate(_dsl.Mutations.deleteDocument(document), mutationOptions); case 4: res = _context5.sent; _context5.next = 7; return this.triggerHook('after:destroy', document); case 7: return _context5.abrupt('return', res); case 8: case 'end': return _context5.stop(); } } }, _callee5, this); })); function destroy(_x12) { return _ref7.apply(this, arguments); } return destroy; }() }, { key: 'upload', value: function upload(file, dirPath) { var mutationOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; return this.mutate(_dsl.Mutations.uploadFile(file, dirPath), mutationOptions); } }, { key: 'ensureQueryExists', value: function ensureQueryExists(queryId, queryDefinition) { this.ensureStore(); var existingQuery = (0, _store.getQueryFromState)(this.store.getState(), queryId); // Don't trigger the INIT_QUERY for fetchMore() calls if (existingQuery.fetchStatus !== 'loaded' || !queryDefinition.skip) { this.dispatch((0, _store.initQuery)(queryId, queryDefinition)); } } /** * Executes a query and returns its results. * * Results from the query will be saved internally and can be retrieved via * `getQueryFromState` or directly using `<Query />`. `<Query />` automatically * executes its query when mounted if no fetch policy has been indicated. * * @param {QueryDefinition} queryDefinition * @param {string} options.as - Names the query so it can be reused (by multiple components for example) * @returns {QueryResult} */ }, { key: 'query', value: function () { var _ref9 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6(queryDefinition) { var _ref8 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var update = _ref8.update, options = (0, _objectWithoutProperties3.default)(_ref8, ['update']); var queryId, response; return _regenerator2.default.wrap(function _callee6$(_context6) { while (1) { switch (_context6.prev = _context6.next) { case 0: this.ensureStore(); queryId = options.as || this.generateId(); this.ensureQueryExists(queryId, queryDefinition); _context6.prev = 3; _context6.next = 6; return this.requestQuery(queryDefinition); case 6: response = _context6.sent; this.dispatch((0, _store.receiveQueryResult)(queryId, response, { update: update })); return _context6.abrupt('return', response); case 11: _context6.prev = 11; _context6.t0 = _context6['catch'](3); this.dispatch((0, _store.receiveQueryError)(queryId, _context6.t0)); throw _context6.t0; case 15: case 'end': return _context6.stop(); } } }, _callee6, this, [[3, 11]]); })); function query(_x15) { return _ref9.apply(this, arguments); } return query; }() /** * Will fetch all documents for a `queryDefinition`, automatically fetching more * documents if the total of documents is superior to the pagination limit. Can * result in a lot of network requests. * * @param {QueryDefinition} queryDefinition * @param {object} options - Options to the query * @returns {Array} All documents matching the query */ }, { key: 'queryAll', value: function () { var _ref10 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(queryDefinition, options) { var documents, resp; return _regenerator2.default.wrap(function _callee7$(_context7) { while (1) { switch (_context7.prev = _context7.next) { case 0: documents = []; resp = { next: true }; case 2: if (!(resp && resp.next)) { _context7.next = 9; break; } _context7.next = 5; return this.query(queryDefinition.offset(documents.length), options); case 5: resp = _context7.sent; documents.push.apply(documents, (0, _toConsumableArray3.default)(resp.data)); _context7.next = 2; break; case 9: return _context7.abrupt('return', documents); case 10: case 'end': return _context7.stop(); } } }, _callee7, this); })); function queryAll(_x16, _x17) { return _ref10.apply(this, arguments); } return queryAll; }() }, { key: 'watchQuery', value: function watchQuery() { console.warn('client.watchQuery is deprecated, please use client.makeObservableQuery.'); return this.makeObservableQuery.apply(this, arguments); } }, { key: 'makeObservableQuery', value: function makeObservableQuery(queryDefinition) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; this.ensureStore(); var queryId = options.as || this.generateId(); this.ensureQueryExists(queryId, queryDefinition); return new _ObservableQuery2.default(queryId, queryDefinition, this); } }, { key: 'mutate', value: function () { var _ref12 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee8(mutationDefinition) { var _ref11 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var update = _ref11.update, updateQueries = _ref11.updateQueries, options = (0, _objectWithoutProperties3.default)(_ref11, ['update', 'updateQueries']); var mutationId, response; return _regenerator2.default.wrap(function _callee8$(_context8) { while (1) { switch (_context8.prev = _context8.next) { case 0: this.ensureStore(); mutationId = options.as || this.generateId(); this.dispatch((0, _store.initMutation)(mutationId, mutationDefinition)); _context8.prev = 3; _context8.next = 6; return this.requestMutation(mutationDefinition); case 6: response = _context8.sent; this.dispatch((0, _store.receiveMutationResult)(mutationId, response, { update: update, updateQueries: updateQueries }, mutationDefinition)); return _context8.abrupt('return', response); case 11: _context8.prev = 11; _context8.t0 = _context8['catch'](3); this.dispatch((0, _store.receiveMutationError)(mutationId, _context8.t0, mutationDefinition)); throw _context8.t0; case 15: case 'end': return _context8.stop(); } } }, _callee8, this, [[3, 11]]); })); function mutate(_x20) { return _ref12.apply(this, arguments); } return mutate; }() /** * Executes a query through links and fetches relationships * * @private * @param {QueryDefinition} definition * @returns {Response} */ }, { key: 'requestQuery', value: function () { var _ref13 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee9(definition) { var mainResponse, withIncluded; return _regenerator2.default.wrap(function _callee9$(_context9) { while (1) { switch (_context9.prev = _context9.next) { case 0: _context9.next = 2; return this.chain.request(definition); case 2: mainResponse = _context9.sent; if (definition.includes) { _context9.next = 5; break; } return _context9.abrupt('return', mainResponse); case 5: _context9.next = 7; return this.fetchRelationships(mainResponse, this.getIncludesRelationships(definition)); case 7: withIncluded = _context9.sent; return _context9.abrupt('return', withIncluded); case 9: case 'end': return _context9.stop(); } } }, _callee9, this); })); function requestQuery(_x21) { return _ref13.apply(this, arguments); } return requestQuery; }() /** * Fetch relationships for a response (can be several docs). * Fills the `relationships` attribute of each documents. * * Can potentially result in several fetch requests. * Queries are optimized before being sent (multiple single documents queries can be packed into * one multiple document query) for example. */ }, { key: 'fetchRelationships', value: function () { var _ref14 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee10(response, relationshipsByName) { var _this2 = this; var isSingleDoc, responseDocs, queryDefToDocIdAndRel, documents, definitions, optimizedDefinitions, responses, uniqueDocuments, included, relationshipsByDocId, _iteratorNormalCompletion5, _didIteratorError5, _iteratorError5, _iterator5, _step5, _ref15, _ref16, def, resp, docIdAndRel, _docIdAndRel, docId, relName; return _regenerator2.default.wrap(function _callee10$(_context10) { while (1) { switch (_context10.prev = _context10.next) { case 0: isSingleDoc = !Array.isArray(response.data); if (!(!isSingleDoc && response.data.length === 0)) { _context10.next = 3; break; } return _context10.abrupt('return', response); case 3: responseDocs = isSingleDoc ? [response.data] : response.data; queryDefToDocIdAndRel = new _map2.default(); documents = []; definitions = []; responseDocs.forEach(function (doc) { return (0, _forEach2.default)(relationshipsByName, function (relationship, relName) { var queryDef = relationship.type.query(doc, _this2, relationship); var docId = doc._id; // Used to reattach responses into the relationships attribute of // each document queryDefToDocIdAndRel.set(queryDef, [docId, relName]); // Relationships can yield "queries" that are already resolved documents. // These do not need to go through the usual link request mechanism. if (queryDef instanceof _dsl.QueryDefinition) { definitions.push(queryDef); } else { documents.push(queryDef); } }); }); // Definitions can be in optimized/regrouped in case of HasMany relationships. optimizedDefinitions = (0, _optimize2.default)(definitions); _context10.next = 11; return _promise2.default.all(optimizedDefinitions.map(function (req) { return _this2.chain.request(req); })); case 11: responses = _context10.sent; // "Included" documents will be stored in the `documents` store uniqueDocuments = (0, _uniqBy2.default)((0, _flatten2.default)(documents), '_id'); included = (0, _flatten2.default)(responses.map(function (r) { return r.included || r.data; })).concat(uniqueDocuments).filter(Boolean); // Some relationships have the relationship data on the other side of the // relationship (ex: io.cozy.photos.albums do not have photo inclusion information, // it is on the io.cozy.files side). // Here we take the data received from the relationship queries, and group // it so that we can fill the `relationships` attribute of each doc before // storing the document. This makes the data easier to manipulate for the front-end. relationshipsByDocId = {}; _iteratorNormalCompletion5 = true; _didIteratorError5 = false; _iteratorError5 = undefined; _context10.prev = 18; for (_iterator5 = (0, _getIterator3.default)((0, _zip2.default)(optimizedDefinitions, responses)); !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { _ref15 = _step5.value; _ref16 = (0, _slicedToArray3.default)(_ref15, 2); def = _ref16[0]; resp = _ref16[1]; docIdAndRel = queryDefToDocIdAndRel.get(def); if (docIdAndRel) { _docIdAndRel = (0, _slicedToArray3.default)(docIdAndRel, 2), docId = _docIdAndRel[0], relName = _docIdAndRel[1]; relationshipsByDocId[docId] = relationshipsByDocId[docId] || {}; relationshipsByDocId[docId][relName] = (0, _helpers.responseToRelationship)(resp); } } _context10.next = 26; break; case 22: _context10.prev = 22; _context10.t0 = _context10['catch'](18); _didIteratorError5 = true; _iteratorError5 = _context10.t0; case 26: _context10.prev = 26; _context10.prev = 27; if (!_iteratorNormalCompletion5 && _iterator5.return) { _iterator5.return(); } case 29: _context10.prev = 29; if (!_didIteratorError5) { _context10.next = 32; break; } throw _iteratorError5; case 32: return _context10.finish(29); case 33: return _context10.finish(26); case 34: return _context10.abrupt('return', (0, _extends3.default)({}, (0, _helpers.attachRelationships)(response, relationshipsByDocId), { included: included })); case 35: case 'end': return _context10.stop(); } } }, _callee10, this, [[18, 22, 26, 34], [27,, 29, 33]]); })); function fetchRelationships(_x22, _x23) { return _ref14.apply(this, arguments); } return fetchRelationships; }() }, { key: 'requestMutation', value: function () { var _ref17 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee11(definition) { var _this3 = this; var _definition, first, rest, firstResponse; return _regenerator2.default.wrap(function _callee11$(_context11) { while (1) { switch (_context11.prev = _context11.next) { case 0: if (!Array.isArray(definition)) { _context11.next = 8; break; } _definition = (0, _toArray3.default)(definition), first = _definition[0], rest = _definition.slice(1); _context11.next = 4; return this.requestMutation(first); case 4: firstResponse = _context11.sent; _context11.next = 7; return _promise2.default.all(rest.map(function (def) { return typeof def === 'function' ? _this3.requestMutation(def(firstResponse)) : _this3.requestMutation(def); })); case 7: return _context11.abrupt('return', firstResponse); case 8: return _context11.abrupt('return', this.chain.request(definition)); case 9: case 'end': return _context11.stop(); } } }, _callee11, this); })); function requestMutation(_x24) { return _ref17.apply(this, arguments); } return requestMutation; }() }, { key: 'getIncludesRelationships', value: function getIncludesRelationships(queryDefinition) { var _this4 = this; var includes = queryDefinition.includes, doctype = queryDefinition.doctype; if (!includes) return {}; return (0, _fromPairs2.default)(includes.map(function (relName) { return [relName, _this4.schema.getRelationship(doctype, relName)]; })); } /** * Returns documents with their relationships resolved according to their schema. * If related documents are not in the store, they will not be fetched automatically. * Instead, the relationships will have null documents. * * @param {string} doctype * @param {Array<Document>} documents * @returns {Array<HydratedDocument>} */ }, { key: 'hydrateDocuments', value: function hydrateDocuments(doctype, documents) { var _this5 = this; if (this.options.autoHydrate === false) { return documents; } var schema = this.schema.getDoctypeSchema(doctype); var relationships = schema.relationships; if (relationships) { return documents.map(function (doc) { return _this5.hydrateDocument(doc, schema); }); } else { return documents; } } /** * Resolves relationships on a document. * * The original document is kept in the target attribute of * the relationship * * @param {Document} document for which relationships must be resolved * @param {Schema} schema for the document doctype * @returns {HydrateDocument} */ }, { key: 'hydrateDocument', value: function hydrateDocument(document, schema) { if (!document) { return document; } schema = schema || this.schema.getDoctypeSchema(document._type); return (0, _extends3.default)({}, document, this.hydrateRelationships(document, schema.relationships)); } }, { key: 'hydrateRelationships', value: function hydrateRelationships(document, schemaRelationships) { var methods = this.getRelationshipStoreAccessors(); return (0, _mapValues2.default)(schemaRelationships, function (assoc, name) { return (0, _associations.create)(document, assoc, methods); }); } /** * Creates (locally) a new document for the given doctype. * This document is hydrated : its relationships are there * and working. */ }, { key: 'makeNewDocument', value: function makeNewDocument(doctype) { var obj = { _type: doctype }; return this.hydrateDocument(obj); } /** * Creates an association that is linked to the store. */ }, { key: 'getAssociation', value: function getAssociation(document, associationName) { return (0, _associations.create)(document, this.schema.getAssociation(document._type, associationName), this.getRelationshipStoreAccessors()); } /** * Returns the accessors that are given to the relationships for them * to deal with the stores. * * Relationships need to have access to the store to ping it when * a modification (addById/removeById etc...) has been done. This wakes * the store up, which in turn will update the `<Query>`s and re-render the data. */ }, { key: 'getRelationshipStoreAccessors', value: function getRelationshipStoreAccessors() { var _this6 = this; if (!this.storeAccesors) { this.storeAccessors = { get: this.getDocumentFromState.bind(this), save: function save(document, opts) { return _this6.save.call(_this6, document, opts); }, dispatch: this.dispatch.bind(this), query: function query(def, opts) { return _this6.query.call(_this6, def, opts); }, mutate: function mutate(def, opts) { return _this6.mutate.call(_this6, def, opts); } }; } return this.storeAccessors; } /** * Get a collection of documents from the internal store. * * @param {string} type - Doctype of the collection * * @returns {Document[]} Array of documents or null if the collection does not exist. */ }, { key: 'getCollectionFromState', value: function getCollectionFromState(type) { try { return (0, _store.getCollectionFromState)(this.store.getState(), type); } catch (e) { console.warn('Could not getCollectionFromState', type, e.message); return null; } } /** * Get a document from the internal store. * * @param {string} type - Doctype of the document * @param {string} id - Id of the document * * @returns {Document} Document or null if the object does not exist. */ }, { key: 'getDocumentFromState', value: function getDocumentFromState(type, id) { try { return (0, _store.getDocumentFromState)(this.store.getState(), type, id); } catch (e) { console.warn('Could not getDocumentFromState', type, id, e.message); return null; } } /** * Get a query from the internal store. * * @param {string} id - Id of the query (set via Query.props.as) * @param {boolean} options.hydrated - Whether documents should be returned already hydrated (default: false) * * @returns {QueryState} - Query state or null if it does not exist. */ }, { key: 'getQueryFromState', value: function getQueryFromState(id) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var hydrated = options.hydrated || false; try { var queryResults = (0, _store.getQueryFromState)(this.store.getState(), id); var doctype = queryResults.definition && queryResults.definition.doctype; var data = hydrated && doctype ? this.hydrateDocuments(doctype, queryResults.data) : queryResults.data; return (0, _extends3.default)({}, queryResults, { data: data }); } catch (e) { console.warn('Could not getQueryFromState', id, e.message); return null; } } /** * Performs a complete OAuth flow using a Cordova webview for auth. * The `register` method's name has been chosen for compat reasons with the Authentication compo. * * @param {string} cozyURL Receives the URL of the cozy instance. * @returns {object} Contains the fetched token and the client information. */ }, { key: 'register', value: function register(cozyUrl) { var stackClient = this.getStackClient(); stackClient.setUri(cozyUrl); return this.startOAuthFlow(_mobile.authenticateWithCordova); } /** * Performs a complete OAuth flow, including updating the internal token at the end. * * @param {Function} openURLCallback Receives the URL to present to the user as a parameter, and should return a promise that resolves with the URL the user was redirected to after accepting the permissions. * @returns {object} Contains the fetched token and the client information. These should be stored and used to restore the client. */ }, { key: 'startOAuthFlow', value: function () { var _ref18 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee12(openURLCallback) { var stackClient; return _regenerator2.default.wrap(function _callee12$(_context12) { while (1) { switch (_context12.prev = _context12.next) { case 0: stackClient = this.getStackClient(); _context12.next = 3; return stackClient.register(); case 3: return _context12.abrupt('return', this.authorize(openURLCallback)); case 4: case 'end': return _context12.stop(); } } }, _callee12, this); })); function startOAuthFlow(_x26) { return _ref18.apply(this, arguments); } return startOAuthFlow; }() }, { key: 'authorize', value: function () { var _ref19 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee13(openURLCallback) { var stackClient, stateCode, url, redirectedURL, code, token, _stackClient; return _regenerator2.default.wrap(function _callee13$(_context13) { while (1) { switch (_context13.prev = _context13.next) { case 0: _context13.prev = 0; stackClient = this.getStackClient(); stateCode = stackClient.generateStateCode(); url = stackClient.getAuthCodeURL(stateCode); _context13.next = 6; return openURLCallback(url); case 6: redirectedURL = _context13.sent; code = stackClient.getAccessCodeFromURL(redirectedURL, stateCode); _context13.next = 10; return stackClient.fetchAccessToken(code); case 10: token = _context13.sent; stackClient.setToken(token); return _context13.abrupt('return', { token: token, infos: stackClient.oauthOptions, client: stackClient.oauthOptions // for compat with Authentication comp reasons }); case 15: _context13.prev = 15; _context13.t0 = _context13['catch'](0); /* if REGISTRATION_ABORT is emited, we have to unregister the client. */ if (_context13.t0.message === _const.REGISTRATION_ABORT) { _stackClient = this.getStackClient(); _stackClient.unregister(); } throw _context13.t0; case 19: case 'end': return _context13.stop(); } } }, _callee13, this, [[0, 15]]); })); function authorize(_x27) { return _ref19.apply(this, arguments); } return authorize; }() /** * Renews the token if, for instance, new permissions are required or token * has expired. * * @returns {object} Contains the fetched token and the client information. */ }, { key: 'renewAuthorization', value: function renewAuthorization() { return this.authorize(_mobile.authenticateWithCordova); } /** * Sets the internal store of the client. Use this when you want to have cozy-client's * internal store colocated with your existing Redux store. * * Typically, you would need to do this only once in your application, this is why * setStore throws if you do it twice. If you really need to set the store again, * use options.force = true. * * @example * ``` * const client = new CozyClient() * const store = createStore(combineReducers({ * todos: todoReducer, * cozy: client.reducer() * }) * client.setStore(store) * ``` * * @param {ReduxStore} store - A redux store * @param {boolean} options.force - Will deactivate throwing when client's store already exists */ }, { key: 'setStore', value: function setStore(store) { var _ref20 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref20$force = _ref20.force, force = _ref20$force === undefined ? false : _ref20$force; if (store === undefined) { throw new Error('Store is undefined'); } else if (this.store && !force) { throw new Error('Client already has a store, it is forbidden to change store.'); } this.store = store; } }, { key: 'ensureStore', value: function ensureStore() { if (!this.store) { this.setStore((0, _store.createStore)()); } } /** Sets public attribute and emits event related to revocation */ }, { key: 'handleRevocationChange', value: function handleRevocationChange(state) { if (state) { this.isRevoked = true; this.emit('revoked'); } else { this.isRevoked = false; this.emit('unrevoked'); } } /** Emits event when token is refreshed */ }, { key: 'handleTokenRefresh', value: function handleTokenRefresh(token) { this.emit('tokenRefreshed'); if (this.options.onTokenRefresh) { deprecatedHandler('Using onTokenRefresh is deprecated, please use events like this: cozyClient.on(\'tokenUpdated\', token => console.log(\'Token is updated\', token)). https://git.io/fj3M3'); this.options.onTokenRefresh(token); } } /** * If no stack client has been passed in options, creates a default stack * client and attaches handlers for revocation and token refresh. * If a stackClient has been passed in options, ensure it has handlers for * revocation and token refresh. * * If `oauth` options are passed, stackClient is an OAuthStackClient. */ }, { key: 'createClient', value: function createClient() { if (this.options.client) { console.warn('CozyClient: Using options.client is deprecated, please use options.stackClient.'); } var warningForCustomHandlers = this.options.warningForCustomHandlers !== undefined ? this.options.warningForCustomHandlers : true; var stackClient = this.options.client || this.options.stackClient; var handlers = { onRevocationChange: this.handleRevocationChange, onTokenRefresh: this.handleTokenRefresh }; if (stackClient) { this.stackClient = stackClient; if (!stackClient.options) { stackClient.options = {}; } var _iteratorNormalCompletion6 = true; var _didIteratorError6 = false; var _iteratorError6 = undefined; try { for (var _iterator6 = (0, _getIterator3.default)((0, _keys2.default)(handlers)), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) { var handlerName = _step6.value; if (!stackClient.options[handlerName]) { stackClient.options[handlerName] = handlers[handlerName]; } else { if (warningForCustomHandlers) { console.warn('You passed a stackClient with its own ' + handlerName + '. It is not supported, unexpected things might happen.'); } } } } catch (err) { _didIteratorError6 = true; _iteratorError6 = err; } finally { try { if (!_iteratorNormalCompletion6 && _iterator6.return) { _iterator6.return(); } } finally { if (_didIteratorError6) { throw _iteratorError6; } } } } else { var options = (0, _extends3.default)({}, this.options, handlers); this.stackClient = this.options.oauth ? new _cozyStackClient.OAuthClient(options) : new _cozyStackClient2.default(options); } this.client = new Proxy(this.stackClient, deprecatedHandler('Using cozyClient.client is deprecated, please use cozyClient.stackClient.')); } }, { key: 'getClient', value: function getClient() { console.warn('CozyClient: getClient() is deprecated, please use getStackClient().'); return this.getStackClient(); } }, { key: 'getStackClient', value: function getStackClient() { if (!this.stackClient) { this.createClient(); } return this.stackClient; } }, { key: 'reducer', value: function reducer() { return _store2.default; } }, { key: 'dispatch', value: function dispatch(action) { return this.store.dispatch(action); } }, { key: 'generateId', value: function generateId() { var id = this.idCounter; this.idCounter++; return id; } /** * Directly set the data in the store, without using a query * This is useful for cases like Pouch replication, which wants to * set some data in the store. * * @param data {Object} { doctype: [data] } */ }, { key: 'setData', value: function setData(data) { var _this7 = this; this.ensureStore(); (0, _entries2.default)(data).forEach(function (_ref21) { var _ref22 = (0, _slicedToArray3.default)(_ref21, 2), doctype = _ref22[0], data = _ref22[1]; _this7.dispatch((0, _store.receiveQueryResult)(null, { data: data })); }); } }], [{ key: 'fromOldClient', value: function fromOldClient(oldClient, options) { return new CozyClient((0, _extends3.default)({ uri: oldClient._url, token: oldClient._token.token }, options)); } /** In konnector/service context, CozyClient can be instantiated from environment variables */ }, { key: 'fromEnv', value: function fromEnv(env) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; env = env || (typeof process !== 'undefined' ? process.env : {}); var _env = env, COZY_URL = _env.COZY_URL, COZY_CREDENTIALS = _env.COZY_CREDENTIALS, NODE_ENV = _env.NODE_ENV; if (!COZY_URL || !COZY_CREDENTIALS) { throw new Error('Env used to instantiate CozyClient must have COZY_URL and COZY_CREDENTIALS'); } if (NODE_ENV === 'development') { options.oauth = JSON.parse(COZY_CREDENTIALS); } else { options.token = COZY_CREDENTIALS.trim(); } options.uri = COZY_URL.trim(); return new CozyClient((0, _extends3.default)({}, options)); } }, { key: 'registerHook', value: function registerHook(doctype, name, fn) { CozyClient.hooks = CozyClient.hooks || {}; var hooks = CozyClient.hooks[doctype] = CozyClient.hooks[doctype] || {}; hooks[name] = hooks[name] || []; hooks[name].push(fn); } }]); return CozyClient; }(); CozyClient.fetchPolicies = _policies2.default; _microee2.default.mixin(CozyClient); exports.default = CozyClient; /***/ }), /* 729 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__(730), __esModule: true }; /***/ }), /* 730 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(731); module.exports = __webpack_require__(734).Object.entries; /***/ }), /* 731 */ /***/ (function(module, exports, __webpack_require__) { // https://github.com/tc39/proposal-object-values-entries var $export = __webpack_require__(732); var $entries = __webpack_require__(748)(true); $export($export.S, 'Object', { entries: function entries(it) { return $entries(it); } }); /***/ }), /* 732 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(733); var core = __webpack_require__(734); var ctx = __webpack_require__(735); var hide = __webpack_require__(737); var has = __webpack_require__(747); var PROTOTYPE = 'prototype'; var $export = function (type, name, source) { var IS_FORCED = type & $export.F; var IS_GLOBAL = type & $export.G; var IS_STATIC = type & $export.S; var IS_PROTO = type & $export.P; var IS_BIND = type & $export.B; var IS_WRAP = type & $export.W; var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); var expProto = exports[PROTOTYPE]; var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]; var key, own, out; if (IS_GLOBAL) source = name; for (key in source) { // contains in native own = !IS_FORCED && target && target[key] !== undefined; if (own && has(exports, key)) continue; // export native or passed out = own ? target[key] : source[key]; // prevent global pollution for namespaces exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] // bind timers to global for call from export context : IS_BIND && own ? ctx(out, global) // wrap global constructors for prevent change them in library : IS_WRAP && target[key] == out ? (function (C) { var F = function (a, b, c) { if (this instanceof C) { switch (arguments.length) { case 0: return new C(); case 1: return new C(a); case 2: return new C(a, b); } return new C(a, b, c); } return C.apply(this, arguments); }; F[PROTOTYPE] = C[PROTOTYPE]; return F; // make static versions for prototype methods })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% if (IS_PROTO) { (exports.virtual || (exports.virtual = {}))[key] = out; // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out); } } }; // type bitmap $export.F = 1; // forced $export.G = 2; // global $export.S = 4; // static $export.P = 8; // proto $export.B = 16; // bind $export.W = 32; // wrap $export.U = 64; // safe $export.R = 128; // real proto method for `library` module.exports = $export; /***/ }), /* 733 */ /***/ (function(module, exports) { // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 var global = module.exports = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self // eslint-disable-next-line no-new-func : Function('return this')(); if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef /***/ }), /* 734 */ /***/ (function(module, exports) { var core = module.exports = { version: '2.6.10' }; if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef /***/ }), /* 735 */ /***/ (function(module, exports, __webpack_require__) { // optional / simple context binding var aFunction = __webpack_require__(736); module.exports = function (fn, that, length) { aFunction(fn); if (that === undefined) return fn; switch (length) { case 1: return function (a) { return fn.call(that, a); }; case 2: return function (a, b) { return fn.call(that, a, b); }; case 3: return function (a, b, c) { return fn.call(that, a, b, c); }; } return function (/* ...args */) { return fn.apply(that, arguments); }; }; /***/ }), /* 736 */ /***/ (function(module, exports) { module.exports = function (it) { if (typeof it != 'function') throw TypeError(it + ' is not a function!'); return it; }; /***/ }), /* 737 */ /***/ (function(module, exports, __webpack_require__) { var dP = __webpack_require__(738); var createDesc = __webpack_require__(746); module.exports = __webpack_require__(742) ? function (object, key, value) { return dP.f(object, key, createDesc(1, value)); } : function (object, key, value) { object[key] = value; return object; }; /***/ }), /* 738 */ /***/ (function(module, exports, __webpack_require__) { var anObject = __webpack_require__(739); var IE8_DOM_DEFINE = __webpack_require__(741); var toPrimitive = __webpack_require__(745); var dP = Object.defineProperty; exports.f = __webpack_require__(742) ? Object.defineProperty : function defineProperty(O, P, Attributes) { anObject(O); P = toPrimitive(P, true); anObject(Attributes); if (IE8_DOM_DEFINE) try { return dP(O, P, Attributes); } catch (e) { /* empty */ } if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; /***/ }), /* 739 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(740); module.exports = function (it) { if (!isObject(it)) throw TypeError(it + ' is not an object!'); return it; }; /***/ }), /* 740 */ /***/ (function(module, exports) { module.exports = function (it) { return typeof it === 'object' ? it !== null : typeof it === 'function'; }; /***/ }), /* 741 */ /***/ (function(module, exports, __webpack_require__) { module.exports = !__webpack_require__(742) && !__webpack_require__(743)(function () { return Object.defineProperty(__webpack_require__(744)('div'), 'a', { get: function () { return 7; } }).a != 7; }); /***/ }), /* 742 */ /***/ (function(module, exports, __webpack_require__) { // Thank's IE8 for his funny defineProperty module.exports = !__webpack_require__(743)(function () { return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; }); /***/ }), /* 743 */ /***/ (function(module, exports) { module.exports = function (exec) { try { return !!exec(); } catch (e) { return true; } }; /***/ }), /* 744 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(740); var document = __webpack_require__(733).document; // typeof document.createElement is 'object' in old IE var is = isObject(document) && isObject(document.createElement); module.exports = function (it) { return is ? document.createElement(it) : {}; }; /***/ }), /* 745 */ /***/ (function(module, exports, __webpack_require__) { // 7.1.1 ToPrimitive(input [, PreferredType]) var isObject = __webpack_require__(740); // instead of the ES6 spec version, we didn't implement @@toPrimitive case // and the second argument - flag - preferred type is a string module.exports = function (it, S) { if (!isObject(it)) return it; var fn, val; if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; throw TypeError("Can't convert object to primitive value"); }; /***/ }), /* 746 */ /***/ (function(module, exports) { module.exports = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; /***/ }), /* 747 */ /***/ (function(module, exports) { var hasOwnProperty = {}.hasOwnProperty; module.exports = function (it, key) { return hasOwnProperty.call(it, key); }; /***/ }), /* 748 */ /***/ (function(module, exports, __webpack_require__) { var DESCRIPTORS = __webpack_require__(742); var getKeys = __webpack_require__(749); var toIObject = __webpack_require__(751); var isEnum = __webpack_require__(764).f; module.exports = function (isEntries) { return function (it) { var O = toIObject(it); var keys = getKeys(O); var length = keys.length; var i = 0; var result = []; var key; while (length > i) { key = keys[i++]; if (!DESCRIPTORS || isEnum.call(O, key)) { result.push(isEntries ? [key, O[key]] : O[key]); } } return result; }; }; /***/ }), /* 749 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.14 / 15.2.3.14 Object.keys(O) var $keys = __webpack_require__(750); var enumBugKeys = __webpack_require__(763); module.exports = Object.keys || function keys(O) { return $keys(O, enumBugKeys); }; /***/ }), /* 750 */ /***/ (function(module, exports, __webpack_require__) { var has = __webpack_require__(747); var toIObject = __webpack_require__(751); var arrayIndexOf = __webpack_require__(755)(false); var IE_PROTO = __webpack_require__(759)('IE_PROTO'); module.exports = function (object, names) { var O = toIObject(object); var i = 0; var result = []; var key; for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key); // Don't enum bug & hidden keys while (names.length > i) if (has(O, key = names[i++])) { ~arrayIndexOf(result, key) || result.push(key); } return result; }; /***/ }), /* 751 */ /***/ (function(module, exports, __webpack_require__) { // to indexed object, toObject with fallback for non-array-like ES3 strings var IObject = __webpack_require__(752); var defined = __webpack_require__(754); module.exports = function (it) { return IObject(defined(it)); }; /***/ }), /* 752 */ /***/ (function(module, exports, __webpack_require__) { // fallback for non-array-like ES3 and non-enumerable old V8 strings var cof = __webpack_require__(753); // eslint-disable-next-line no-prototype-builtins module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { return cof(it) == 'String' ? it.split('') : Object(it); }; /***/ }), /* 753 */ /***/ (function(module, exports) { var toString = {}.toString; module.exports = function (it) { return toString.call(it).slice(8, -1); }; /***/ }), /* 754 */ /***/ (function(module, exports) { // 7.2.1 RequireObjectCoercible(argument) module.exports = function (it) { if (it == undefined) throw TypeError("Can't call method on " + it); return it; }; /***/ }), /* 755 */ /***/ (function(module, exports, __webpack_require__) { // false -> Array#indexOf // true -> Array#includes var toIObject = __webpack_require__(751); var toLength = __webpack_require__(756); var toAbsoluteIndex = __webpack_require__(758); module.exports = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIObject($this); var length = toLength(O.length); var index = toAbsoluteIndex(fromIndex, length); var value; // Array#includes uses SameValueZero equality algorithm // eslint-disable-next-line no-self-compare if (IS_INCLUDES && el != el) while (length > index) { value = O[index++]; // eslint-disable-next-line no-self-compare if (value != value) return true; // Array#indexOf ignores holes, Array#includes - not } else for (;length > index; index++) if (IS_INCLUDES || index in O) { if (O[index] === el) return IS_INCLUDES || index || 0; } return !IS_INCLUDES && -1; }; }; /***/ }), /* 756 */ /***/ (function(module, exports, __webpack_require__) { // 7.1.15 ToLength var toInteger = __webpack_require__(757); var min = Math.min; module.exports = function (it) { return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 }; /***/ }), /* 757 */ /***/ (function(module, exports) { // 7.1.4 ToInteger var ceil = Math.ceil; var floor = Math.floor; module.exports = function (it) { return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); }; /***/ }), /* 758 */ /***/ (function(module, exports, __webpack_require__) { var toInteger = __webpack_require__(757); var max = Math.max; var min = Math.min; module.exports = function (index, length) { index = toInteger(index); return index < 0 ? max(index + length, 0) : min(index, length); }; /***/ }), /* 759 */ /***/ (function(module, exports, __webpack_require__) { var shared = __webpack_require__(760)('keys'); var uid = __webpack_require__(762); module.exports = function (key) { return shared[key] || (shared[key] = uid(key)); }; /***/ }), /* 760 */ /***/ (function(module, exports, __webpack_require__) { var core = __webpack_require__(734); var global = __webpack_require__(733); var SHARED = '__core-js_shared__'; var store = global[SHARED] || (global[SHARED] = {}); (module.exports = function (key, value) { return store[key] || (store[key] = value !== undefined ? value : {}); })('versions', []).push({ version: core.version, mode: __webpack_require__(761) ? 'pure' : 'global', copyright: '© 2019 Denis Pushkarev (zloirock.ru)' }); /***/ }), /* 761 */ /***/ (function(module, exports) { module.exports = true; /***/ }), /* 762 */ /***/ (function(module, exports) { var id = 0; var px = Math.random(); module.exports = function (key) { return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); }; /***/ }), /* 763 */ /***/ (function(module, exports) { // IE 8- don't enum bug keys module.exports = ( 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' ).split(','); /***/ }), /* 764 */ /***/ (function(module, exports) { exports.f = {}.propertyIsEnumerable; /***/ }), /* 765 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var _from = __webpack_require__(766); var _from2 = _interopRequireDefault(_from); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = function (arr) { return Array.isArray(arr) ? arr : (0, _from2.default)(arr); }; /***/ }), /* 766 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__(767), __esModule: true }; /***/ }), /* 767 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(768); __webpack_require__(781); module.exports = __webpack_require__(734).Array.from; /***/ }), /* 768 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $at = __webpack_require__(769)(true); // 21.1.3.27 String.prototype[@@iterator]() __webpack_require__(770)(String, 'String', function (iterated) { this._t = String(iterated); // target this._i = 0; // next index // 21.1.5.2.1 %StringIteratorPrototype%.next() }, function () { var O = this._t; var index = this._i; var point; if (index >= O.length) return { value: undefined, done: true }; point = $at(O, index); this._i += point.length; return { value: point, done: false }; }); /***/ }), /* 769 */ /***/ (function(module, exports, __webpack_require__) { var toInteger = __webpack_require__(757); var defined = __webpack_require__(754); // true -> String#at // false -> String#codePointAt module.exports = function (TO_STRING) { return function (that, pos) { var s = String(defined(that)); var i = toInteger(pos); var l = s.length; var a, b; if (i < 0 || i >= l) return TO_STRING ? '' : undefined; a = s.charCodeAt(i); return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff ? TO_STRING ? s.charAt(i) : a : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; }; }; /***/ }), /* 770 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var LIBRARY = __webpack_require__(761); var $export = __webpack_require__(732); var redefine = __webpack_require__(771); var hide = __webpack_require__(737); var Iterators = __webpack_require__(772); var $iterCreate = __webpack_require__(773); var setToStringTag = __webpack_require__(777); var getPrototypeOf = __webpack_require__(779); var ITERATOR = __webpack_require__(778)('iterator'); var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` var FF_ITERATOR = '@@iterator'; var KEYS = 'keys'; var VALUES = 'values'; var returnThis = function () { return this; }; module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { $iterCreate(Constructor, NAME, next); var getMethod = function (kind) { if (!BUGGY && kind in proto) return proto[kind]; switch (kind) { case KEYS: return function keys() { return new Constructor(this, kind); }; case VALUES: return function values() { return new Constructor(this, kind); }; } return function entries() { return new Constructor(this, kind); }; }; var TAG = NAME + ' Iterator'; var DEF_VALUES = DEFAULT == VALUES; var VALUES_BUG = false; var proto = Base.prototype; var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; var $default = $native || getMethod(DEFAULT); var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; var methods, key, IteratorPrototype; // Fix native if ($anyNative) { IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { // Set @@toStringTag to native iterators setToStringTag(IteratorPrototype, TAG, true); // fix for some old engines if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis); } } // fix Array#{values, @@iterator}.name in V8 / FF if (DEF_VALUES && $native && $native.name !== VALUES) { VALUES_BUG = true; $default = function values() { return $native.call(this); }; } // Define iterator if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { hide(proto, ITERATOR, $default); } // Plug for library Iterators[NAME] = $default; Iterators[TAG] = returnThis; if (DEFAULT) { methods = { values: DEF_VALUES ? $default : getMethod(VALUES), keys: IS_SET ? $default : getMethod(KEYS), entries: $entries }; if (FORCED) for (key in methods) { if (!(key in proto)) redefine(proto, key, methods[key]); } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); } return methods; }; /***/ }), /* 771 */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(737); /***/ }), /* 772 */ /***/ (function(module, exports) { module.exports = {}; /***/ }), /* 773 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var create = __webpack_require__(774); var descriptor = __webpack_require__(746); var setToStringTag = __webpack_require__(777); var IteratorPrototype = {}; // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() __webpack_require__(737)(IteratorPrototype, __webpack_require__(778)('iterator'), function () { return this; }); module.exports = function (Constructor, NAME, next) { Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); setToStringTag(Constructor, NAME + ' Iterator'); }; /***/ }), /* 774 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) var anObject = __webpack_require__(739); var dPs = __webpack_require__(775); var enumBugKeys = __webpack_require__(763); var IE_PROTO = __webpack_require__(759)('IE_PROTO'); var Empty = function () { /* empty */ }; var PROTOTYPE = 'prototype'; // Create object with fake `null` prototype: use iframe Object with cleared prototype var createDict = function () { // Thrash, waste and sodomy: IE GC bug var iframe = __webpack_require__(744)('iframe'); var i = enumBugKeys.length; var lt = '<'; var gt = '>'; var iframeDocument; iframe.style.display = 'none'; __webpack_require__(776).appendChild(iframe); iframe.src = 'javascript:'; // eslint-disable-line no-script-url // createDict = iframe.contentWindow.Object; // html.removeChild(iframe); iframeDocument = iframe.contentWindow.document; iframeDocument.open(); iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); iframeDocument.close(); createDict = iframeDocument.F; while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]]; return createDict(); }; module.exports = Object.create || function create(O, Properties) { var result; if (O !== null) { Empty[PROTOTYPE] = anObject(O); result = new Empty(); Empty[PROTOTYPE] = null; // add "__proto__" for Object.getPrototypeOf polyfill result[IE_PROTO] = O; } else result = createDict(); return Properties === undefined ? result : dPs(result, Properties); }; /***/ }), /* 775 */ /***/ (function(module, exports, __webpack_require__) { var dP = __webpack_require__(738); var anObject = __webpack_require__(739); var getKeys = __webpack_require__(749); module.exports = __webpack_require__(742) ? Object.defineProperties : function defineProperties(O, Properties) { anObject(O); var keys = getKeys(Properties); var length = keys.length; var i = 0; var P; while (length > i) dP.f(O, P = keys[i++], Properties[P]); return O; }; /***/ }), /* 776 */ /***/ (function(module, exports, __webpack_require__) { var document = __webpack_require__(733).document; module.exports = document && document.documentElement; /***/ }), /* 777 */ /***/ (function(module, exports, __webpack_require__) { var def = __webpack_require__(738).f; var has = __webpack_require__(747); var TAG = __webpack_require__(778)('toStringTag'); module.exports = function (it, tag, stat) { if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); }; /***/ }), /* 778 */ /***/ (function(module, exports, __webpack_require__) { var store = __webpack_require__(760)('wks'); var uid = __webpack_require__(762); var Symbol = __webpack_require__(733).Symbol; var USE_SYMBOL = typeof Symbol == 'function'; var $exports = module.exports = function (name) { return store[name] || (store[name] = USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); }; $exports.store = store; /***/ }), /* 779 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) var has = __webpack_require__(747); var toObject = __webpack_require__(780); var IE_PROTO = __webpack_require__(759)('IE_PROTO'); var ObjectProto = Object.prototype; module.exports = Object.getPrototypeOf || function (O) { O = toObject(O); if (has(O, IE_PROTO)) return O[IE_PROTO]; if (typeof O.constructor == 'function' && O instanceof O.constructor) { return O.constructor.prototype; } return O instanceof Object ? ObjectProto : null; }; /***/ }), /* 780 */ /***/ (function(module, exports, __webpack_require__) { // 7.1.13 ToObject(argument) var defined = __webpack_require__(754); module.exports = function (it) { return Object(defined(it)); }; /***/ }), /* 781 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var ctx = __webpack_require__(735); var $export = __webpack_require__(732); var toObject = __webpack_require__(780); var call = __webpack_require__(782); var isArrayIter = __webpack_require__(783); var toLength = __webpack_require__(756); var createProperty = __webpack_require__(784); var getIterFn = __webpack_require__(785); $export($export.S + $export.F * !__webpack_require__(787)(function (iter) { Array.from(iter); }), 'Array', { // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { var O = toObject(arrayLike); var C = typeof this == 'function' ? this : Array; var aLen = arguments.length; var mapfn = aLen > 1 ? arguments[1] : undefined; var mapping = mapfn !== undefined; var index = 0; var iterFn = getIterFn(O); var length, result, step, iterator; if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); // if object isn't iterable or it's array with default iterator - use simple case if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) { for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value); } } else { length = toLength(O.length); for (result = new C(length); length > index; index++) { createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); } } result.length = index; return result; } }); /***/ }), /* 782 */ /***/ (function(module, exports, __webpack_require__) { // call something on iterator step with safe closing on error var anObject = __webpack_require__(739); module.exports = function (iterator, fn, value, entries) { try { return entries ? fn(anObject(value)[0], value[1]) : fn(value); // 7.4.6 IteratorClose(iterator, completion) } catch (e) { var ret = iterator['return']; if (ret !== undefined) anObject(ret.call(iterator)); throw e; } }; /***/ }), /* 783 */ /***/ (function(module, exports, __webpack_require__) { // check on default Array iterator var Iterators = __webpack_require__(772); var ITERATOR = __webpack_require__(778)('iterator'); var ArrayProto = Array.prototype; module.exports = function (it) { return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); }; /***/ }), /* 784 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $defineProperty = __webpack_require__(738); var createDesc = __webpack_require__(746); module.exports = function (object, index, value) { if (index in object) $defineProperty.f(object, index, createDesc(0, value)); else object[index] = value; }; /***/ }), /* 785 */ /***/ (function(module, exports, __webpack_require__) { var classof = __webpack_require__(786); var ITERATOR = __webpack_require__(778)('iterator'); var Iterators = __webpack_require__(772); module.exports = __webpack_require__(734).getIteratorMethod = function (it) { if (it != undefined) return it[ITERATOR] || it['@@iterator'] || Iterators[classof(it)]; }; /***/ }), /* 786 */ /***/ (function(module, exports, __webpack_require__) { // getting tag from 19.1.3.6 Object.prototype.toString() var cof = __webpack_require__(753); var TAG = __webpack_require__(778)('toStringTag'); // ES3 wrong here var ARG = cof(function () { return arguments; }()) == 'Arguments'; // fallback for IE11 Script Access Denied error var tryGet = function (it, key) { try { return it[key]; } catch (e) { /* empty */ } }; module.exports = function (it) { var O, T, B; return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T // builtinTag case : ARG ? cof(O) // ES3 arguments fallback : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; }; /***/ }), /* 787 */ /***/ (function(module, exports, __webpack_require__) { var ITERATOR = __webpack_require__(778)('iterator'); var SAFE_CLOSING = false; try { var riter = [7][ITERATOR](); riter['return'] = function () { SAFE_CLOSING = true; }; // eslint-disable-next-line no-throw-literal Array.from(riter, function () { throw 2; }); } catch (e) { /* empty */ } module.exports = function (exec, skipClosing) { if (!skipClosing && !SAFE_CLOSING) return false; var safe = false; try { var arr = [7]; var iter = arr[ITERATOR](); iter.next = function () { return { done: safe = true }; }; arr[ITERATOR] = function () { return iter; }; exec(arr); } catch (e) { /* empty */ } return safe; }; /***/ }), /* 788 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var _isIterable2 = __webpack_require__(789); var _isIterable3 = _interopRequireDefault(_isIterable2); var _getIterator2 = __webpack_require__(796); var _getIterator3 = _interopRequireDefault(_getIterator2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = (0, _getIterator3.default)(arr), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if ((0, _isIterable3.default)(Object(arr))) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); /***/ }), /* 789 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__(790), __esModule: true }; /***/ }), /* 790 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(791); __webpack_require__(768); module.exports = __webpack_require__(795); /***/ }), /* 791 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(792); var global = __webpack_require__(733); var hide = __webpack_require__(737); var Iterators = __webpack_require__(772); var TO_STRING_TAG = __webpack_require__(778)('toStringTag'); var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' + 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' + 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' + 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' + 'TextTrackList,TouchList').split(','); for (var i = 0; i < DOMIterables.length; i++) { var NAME = DOMIterables[i]; var Collection = global[NAME]; var proto = Collection && Collection.prototype; if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); Iterators[NAME] = Iterators.Array; } /***/ }), /* 792 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var addToUnscopables = __webpack_require__(793); var step = __webpack_require__(794); var Iterators = __webpack_require__(772); var toIObject = __webpack_require__(751); // 22.1.3.4 Array.prototype.entries() // 22.1.3.13 Array.prototype.keys() // 22.1.3.29 Array.prototype.values() // 22.1.3.30 Array.prototype[@@iterator]() module.exports = __webpack_require__(770)(Array, 'Array', function (iterated, kind) { this._t = toIObject(iterated); // target this._i = 0; // next index this._k = kind; // kind // 22.1.5.2.1 %ArrayIteratorPrototype%.next() }, function () { var O = this._t; var kind = this._k; var index = this._i++; if (!O || index >= O.length) { this._t = undefined; return step(1); } if (kind == 'keys') return step(0, index); if (kind == 'values') return step(0, O[index]); return step(0, [index, O[index]]); }, 'values'); // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) Iterators.Arguments = Iterators.Array; addToUnscopables('keys'); addToUnscopables('values'); addToUnscopables('entries'); /***/ }), /* 793 */ /***/ (function(module, exports) { module.exports = function () { /* empty */ }; /***/ }), /* 794 */ /***/ (function(module, exports) { module.exports = function (done, value) { return { value: value, done: !!done }; }; /***/ }), /* 795 */ /***/ (function(module, exports, __webpack_require__) { var classof = __webpack_require__(786); var ITERATOR = __webpack_require__(778)('iterator'); var Iterators = __webpack_require__(772); module.exports = __webpack_require__(734).isIterable = function (it) { var O = Object(it); return O[ITERATOR] !== undefined || '@@iterator' in O // eslint-disable-next-line no-prototype-builtins || Iterators.hasOwnProperty(classof(O)); }; /***/ }), /* 796 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__(797), __esModule: true }; /***/ }), /* 797 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(791); __webpack_require__(768); module.exports = __webpack_require__(798); /***/ }), /* 798 */ /***/ (function(module, exports, __webpack_require__) { var anObject = __webpack_require__(739); var get = __webpack_require__(785); module.exports = __webpack_require__(734).getIterator = function (it) { var iterFn = get(it); if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!'); return anObject(iterFn.call(it)); }; /***/ }), /* 799 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__(800), __esModule: true }; /***/ }), /* 800 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(801); __webpack_require__(768); __webpack_require__(791); __webpack_require__(802); __webpack_require__(815); __webpack_require__(816); module.exports = __webpack_require__(734).Promise; /***/ }), /* 801 */ /***/ (function(module, exports) { /***/ }), /* 802 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var LIBRARY = __webpack_require__(761); var global = __webpack_require__(733); var ctx = __webpack_require__(735); var classof = __webpack_require__(786); var $export = __webpack_require__(732); var isObject = __webpack_require__(740); var aFunction = __webpack_require__(736); var anInstance = __webpack_require__(803); var forOf = __webpack_require__(804); var speciesConstructor = __webpack_require__(805); var task = __webpack_require__(806).set; var microtask = __webpack_require__(808)(); var newPromiseCapabilityModule = __webpack_require__(809); var perform = __webpack_require__(810); var userAgent = __webpack_require__(811); var promiseResolve = __webpack_require__(812); var PROMISE = 'Promise'; var TypeError = global.TypeError; var process = global.process; var versions = process && process.versions; var v8 = versions && versions.v8 || ''; var $Promise = global[PROMISE]; var isNode = classof(process) == 'process'; var empty = function () { /* empty */ }; var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f; var USE_NATIVE = !!function () { try { // correct subclassing with @@species support var promise = $Promise.resolve(1); var FakePromise = (promise.constructor = {})[__webpack_require__(778)('species')] = function (exec) { exec(empty, empty); }; // unhandled rejections tracking support, NodeJS Promise without it fails @@species test return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 // we can't detect it synchronously, so just check versions && v8.indexOf('6.6') !== 0 && userAgent.indexOf('Chrome/66') === -1; } catch (e) { /* empty */ } }(); // helpers var isThenable = function (it) { var then; return isObject(it) && typeof (then = it.then) == 'function' ? then : false; }; var notify = function (promise, isReject) { if (promise._n) return; promise._n = true; var chain = promise._c; microtask(function () { var value = promise._v; var ok = promise._s == 1; var i = 0; var run = function (reaction) { var handler = ok ? reaction.ok : reaction.fail; var resolve = reaction.resolve; var reject = reaction.reject; var domain = reaction.domain; var result, then, exited; try { if (handler) { if (!ok) { if (promise._h == 2) onHandleUnhandled(promise); promise._h = 1; } if (handler === true) result = value; else { if (domain) domain.enter(); result = handler(value); // may throw if (domain) { domain.exit(); exited = true; } } if (result === reaction.promise) { reject(TypeError('Promise-chain cycle')); } else if (then = isThenable(result)) { then.call(result, resolve, reject); } else resolve(result); } else reject(value); } catch (e) { if (domain && !exited) domain.exit(); reject(e); } }; while (chain.length > i) run(chain[i++]); // variable length - can't use forEach promise._c = []; promise._n = false; if (isReject && !promise._h) onUnhandled(promise); }); }; var onUnhandled = function (promise) { task.call(global, function () { var value = promise._v; var unhandled = isUnhandled(promise); var result, handler, console; if (unhandled) { result = perform(function () { if (isNode) { process.emit('unhandledRejection', value, promise); } else if (handler = global.onunhandledrejection) { handler({ promise: promise, reason: value }); } else if ((console = global.console) && console.error) { console.error('Unhandled promise rejection', value); } }); // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should promise._h = isNode || isUnhandled(promise) ? 2 : 1; } promise._a = undefined; if (unhandled && result.e) throw result.v; }); }; var isUnhandled = function (promise) { return promise._h !== 1 && (promise._a || promise._c).length === 0; }; var onHandleUnhandled = function (promise) { task.call(global, function () { var handler; if (isNode) { process.emit('rejectionHandled', promise); } else if (handler = global.onrejectionhandled) { handler({ promise: promise, reason: promise._v }); } }); }; var $reject = function (value) { var promise = this; if (promise._d) return; promise._d = true; promise = promise._w || promise; // unwrap promise._v = value; promise._s = 2; if (!promise._a) promise._a = promise._c.slice(); notify(promise, true); }; var $resolve = function (value) { var promise = this; var then; if (promise._d) return; promise._d = true; promise = promise._w || promise; // unwrap try { if (promise === value) throw TypeError("Promise can't be resolved itself"); if (then = isThenable(value)) { microtask(function () { var wrapper = { _w: promise, _d: false }; // wrap try { then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); } catch (e) { $reject.call(wrapper, e); } }); } else { promise._v = value; promise._s = 1; notify(promise, false); } } catch (e) { $reject.call({ _w: promise, _d: false }, e); // wrap } }; // constructor polyfill if (!USE_NATIVE) { // 25.4.3.1 Promise(executor) $Promise = function Promise(executor) { anInstance(this, $Promise, PROMISE, '_h'); aFunction(executor); Internal.call(this); try { executor(ctx($resolve, this, 1), ctx($reject, this, 1)); } catch (err) { $reject.call(this, err); } }; // eslint-disable-next-line no-unused-vars Internal = function Promise(executor) { this._c = []; // <- awaiting reactions this._a = undefined; // <- checked in isUnhandled reactions this._s = 0; // <- state this._d = false; // <- done this._v = undefined; // <- value this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled this._n = false; // <- notify }; Internal.prototype = __webpack_require__(813)($Promise.prototype, { // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) then: function then(onFulfilled, onRejected) { var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; reaction.fail = typeof onRejected == 'function' && onRejected; reaction.domain = isNode ? process.domain : undefined; this._c.push(reaction); if (this._a) this._a.push(reaction); if (this._s) notify(this, false); return reaction.promise; }, // 25.4.5.1 Promise.prototype.catch(onRejected) 'catch': function (onRejected) { return this.then(undefined, onRejected); } }); OwnPromiseCapability = function () { var promise = new Internal(); this.promise = promise; this.resolve = ctx($resolve, promise, 1); this.reject = ctx($reject, promise, 1); }; newPromiseCapabilityModule.f = newPromiseCapability = function (C) { return C === $Promise || C === Wrapper ? new OwnPromiseCapability(C) : newGenericPromiseCapability(C); }; } $export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); __webpack_require__(777)($Promise, PROMISE); __webpack_require__(814)(PROMISE); Wrapper = __webpack_require__(734)[PROMISE]; // statics $export($export.S + $export.F * !USE_NATIVE, PROMISE, { // 25.4.4.5 Promise.reject(r) reject: function reject(r) { var capability = newPromiseCapability(this); var $$reject = capability.reject; $$reject(r); return capability.promise; } }); $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { // 25.4.4.6 Promise.resolve(x) resolve: function resolve(x) { return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); } }); $export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(787)(function (iter) { $Promise.all(iter)['catch'](empty); })), PROMISE, { // 25.4.4.1 Promise.all(iterable) all: function all(iterable) { var C = this; var capability = newPromiseCapability(C); var resolve = capability.resolve; var reject = capability.reject; var result = perform(function () { var values = []; var index = 0; var remaining = 1; forOf(iterable, false, function (promise) { var $index = index++; var alreadyCalled = false; values.push(undefined); remaining++; C.resolve(promise).then(function (value) { if (alreadyCalled) return; alreadyCalled = true; values[$index] = value; --remaining || resolve(values); }, reject); }); --remaining || resolve(values); }); if (result.e) reject(result.v); return capability.promise; }, // 25.4.4.4 Promise.race(iterable) race: function race(iterable) { var C = this; var capability = newPromiseCapability(C); var reject = capability.reject; var result = perform(function () { forOf(iterable, false, function (promise) { C.resolve(promise).then(capability.resolve, reject); }); }); if (result.e) reject(result.v); return capability.promise; } }); /***/ }), /* 803 */ /***/ (function(module, exports) { module.exports = function (it, Constructor, name, forbiddenField) { if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) { throw TypeError(name + ': incorrect invocation!'); } return it; }; /***/ }), /* 804 */ /***/ (function(module, exports, __webpack_require__) { var ctx = __webpack_require__(735); var call = __webpack_require__(782); var isArrayIter = __webpack_require__(783); var anObject = __webpack_require__(739); var toLength = __webpack_require__(756); var getIterFn = __webpack_require__(785); var BREAK = {}; var RETURN = {}; var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable); var f = ctx(fn, that, entries ? 2 : 1); var index = 0; var length, step, iterator, result; if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); // fast case for arrays with default iterator if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) { result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); if (result === BREAK || result === RETURN) return result; } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { result = call(iterator, f, step.value, entries); if (result === BREAK || result === RETURN) return result; } }; exports.BREAK = BREAK; exports.RETURN = RETURN; /***/ }), /* 805 */ /***/ (function(module, exports, __webpack_require__) { // 7.3.20 SpeciesConstructor(O, defaultConstructor) var anObject = __webpack_require__(739); var aFunction = __webpack_require__(736); var SPECIES = __webpack_require__(778)('species'); module.exports = function (O, D) { var C = anObject(O).constructor; var S; return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); }; /***/ }), /* 806 */ /***/ (function(module, exports, __webpack_require__) { var ctx = __webpack_require__(735); var invoke = __webpack_require__(807); var html = __webpack_require__(776); var cel = __webpack_require__(744); var global = __webpack_require__(733); var process = global.process; var setTask = global.setImmediate; var clearTask = global.clearImmediate; var MessageChannel = global.MessageChannel; var Dispatch = global.Dispatch; var counter = 0; var queue = {}; var ONREADYSTATECHANGE = 'onreadystatechange'; var defer, channel, port; var run = function () { var id = +this; // eslint-disable-next-line no-prototype-builtins if (queue.hasOwnProperty(id)) { var fn = queue[id]; delete queue[id]; fn(); } }; var listener = function (event) { run.call(event.data); }; // Node.js 0.9+ & IE10+ has setImmediate, otherwise: if (!setTask || !clearTask) { setTask = function setImmediate(fn) { var args = []; var i = 1; while (arguments.length > i) args.push(arguments[i++]); queue[++counter] = function () { // eslint-disable-next-line no-new-func invoke(typeof fn == 'function' ? fn : Function(fn), args); }; defer(counter); return counter; }; clearTask = function clearImmediate(id) { delete queue[id]; }; // Node.js 0.8- if (__webpack_require__(753)(process) == 'process') { defer = function (id) { process.nextTick(ctx(run, id, 1)); }; // Sphere (JS game engine) Dispatch API } else if (Dispatch && Dispatch.now) { defer = function (id) { Dispatch.now(ctx(run, id, 1)); }; // Browsers with MessageChannel, includes WebWorkers } else if (MessageChannel) { channel = new MessageChannel(); port = channel.port2; channel.port1.onmessage = listener; defer = ctx(port.postMessage, port, 1); // Browsers with postMessage, skip WebWorkers // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) { defer = function (id) { global.postMessage(id + '', '*'); }; global.addEventListener('message', listener, false); // IE8- } else if (ONREADYSTATECHANGE in cel('script')) { defer = function (id) { html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () { html.removeChild(this); run.call(id); }; }; // Rest old browsers } else { defer = function (id) { setTimeout(ctx(run, id, 1), 0); }; } } module.exports = { set: setTask, clear: clearTask }; /***/ }), /* 807 */ /***/ (function(module, exports) { // fast apply, http://jsperf.lnkit.com/fast-apply/5 module.exports = function (fn, args, that) { var un = that === undefined; switch (args.length) { case 0: return un ? fn() : fn.call(that); case 1: return un ? fn(args[0]) : fn.call(that, args[0]); case 2: return un ? fn(args[0], args[1]) : fn.call(that, args[0], args[1]); case 3: return un ? fn(args[0], args[1], args[2]) : fn.call(that, args[0], args[1], args[2]); case 4: return un ? fn(args[0], args[1], args[2], args[3]) : fn.call(that, args[0], args[1], args[2], args[3]); } return fn.apply(that, args); }; /***/ }), /* 808 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(733); var macrotask = __webpack_require__(806).set; var Observer = global.MutationObserver || global.WebKitMutationObserver; var process = global.process; var Promise = global.Promise; var isNode = __webpack_require__(753)(process) == 'process'; module.exports = function () { var head, last, notify; var flush = function () { var parent, fn; if (isNode && (parent = process.domain)) parent.exit(); while (head) { fn = head.fn; head = head.next; try { fn(); } catch (e) { if (head) notify(); else last = undefined; throw e; } } last = undefined; if (parent) parent.enter(); }; // Node.js if (isNode) { notify = function () { process.nextTick(flush); }; // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339 } else if (Observer && !(global.navigator && global.navigator.standalone)) { var toggle = true; var node = document.createTextNode(''); new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new notify = function () { node.data = toggle = !toggle; }; // environments with maybe non-completely correct, but existent Promise } else if (Promise && Promise.resolve) { // Promise.resolve without an argument throws an error in LG WebOS 2 var promise = Promise.resolve(undefined); notify = function () { promise.then(flush); }; // for other environments - macrotask based on: // - setImmediate // - MessageChannel // - window.postMessag // - onreadystatechange // - setTimeout } else { notify = function () { // strange IE + webpack dev server bug - use .call(global) macrotask.call(global, flush); }; } return function (fn) { var task = { fn: fn, next: undefined }; if (last) last.next = task; if (!head) { head = task; notify(); } last = task; }; }; /***/ }), /* 809 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // 25.4.1.5 NewPromiseCapability(C) var aFunction = __webpack_require__(736); function PromiseCapability(C) { var resolve, reject; this.promise = new C(function ($$resolve, $$reject) { if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); resolve = $$resolve; reject = $$reject; }); this.resolve = aFunction(resolve); this.reject = aFunction(reject); } module.exports.f = function (C) { return new PromiseCapability(C); }; /***/ }), /* 810 */ /***/ (function(module, exports) { module.exports = function (exec) { try { return { e: false, v: exec() }; } catch (e) { return { e: true, v: e }; } }; /***/ }), /* 811 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(733); var navigator = global.navigator; module.exports = navigator && navigator.userAgent || ''; /***/ }), /* 812 */ /***/ (function(module, exports, __webpack_require__) { var anObject = __webpack_require__(739); var isObject = __webpack_require__(740); var newPromiseCapability = __webpack_require__(809); module.exports = function (C, x) { anObject(C); if (isObject(x) && x.constructor === C) return x; var promiseCapability = newPromiseCapability.f(C); var resolve = promiseCapability.resolve; resolve(x); return promiseCapability.promise; }; /***/ }), /* 813 */ /***/ (function(module, exports, __webpack_require__) { var hide = __webpack_require__(737); module.exports = function (target, src, safe) { for (var key in src) { if (safe && target[key]) target[key] = src[key]; else hide(target, key, src[key]); } return target; }; /***/ }), /* 814 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var global = __webpack_require__(733); var core = __webpack_require__(734); var dP = __webpack_require__(738); var DESCRIPTORS = __webpack_require__(742); var SPECIES = __webpack_require__(778)('species'); module.exports = function (KEY) { var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY]; if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { configurable: true, get: function () { return this; } }); }; /***/ }), /* 815 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // https://github.com/tc39/proposal-promise-finally var $export = __webpack_require__(732); var core = __webpack_require__(734); var global = __webpack_require__(733); var speciesConstructor = __webpack_require__(805); var promiseResolve = __webpack_require__(812); $export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) { var C = speciesConstructor(this, core.Promise || global.Promise); var isFunction = typeof onFinally == 'function'; return this.then( isFunction ? function (x) { return promiseResolve(C, onFinally()).then(function () { return x; }); } : onFinally, isFunction ? function (e) { return promiseResolve(C, onFinally()).then(function () { throw e; }); } : onFinally ); } }); /***/ }), /* 816 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // https://github.com/tc39/proposal-promise-try var $export = __webpack_require__(732); var newPromiseCapability = __webpack_require__(809); var perform = __webpack_require__(810); $export($export.S, 'Promise', { 'try': function (callbackfn) { var promiseCapability = newPromiseCapability.f(this); var result = perform(callbackfn); (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v); return promiseCapability.promise; } }); /***/ }), /* 817 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__(818), __esModule: true }; /***/ }), /* 818 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(801); __webpack_require__(768); __webpack_require__(791); __webpack_require__(819); __webpack_require__(828); __webpack_require__(831); __webpack_require__(833); module.exports = __webpack_require__(734).Map; /***/ }), /* 819 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var strong = __webpack_require__(820); var validate = __webpack_require__(822); var MAP = 'Map'; // 23.1 Map Objects module.exports = __webpack_require__(823)(MAP, function (get) { return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; }, { // 23.1.3.6 Map.prototype.get(key) get: function get(key) { var entry = strong.getEntry(validate(this, MAP), key); return entry && entry.v; }, // 23.1.3.9 Map.prototype.set(key, value) set: function set(key, value) { return strong.def(validate(this, MAP), key === 0 ? 0 : key, value); } }, strong, true); /***/ }), /* 820 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var dP = __webpack_require__(738).f; var create = __webpack_require__(774); var redefineAll = __webpack_require__(813); var ctx = __webpack_require__(735); var anInstance = __webpack_require__(803); var forOf = __webpack_require__(804); var $iterDefine = __webpack_require__(770); var step = __webpack_require__(794); var setSpecies = __webpack_require__(814); var DESCRIPTORS = __webpack_require__(742); var fastKey = __webpack_require__(821).fastKey; var validate = __webpack_require__(822); var SIZE = DESCRIPTORS ? '_s' : 'size'; var getEntry = function (that, key) { // fast case var index = fastKey(key); var entry; if (index !== 'F') return that._i[index]; // frozen object case for (entry = that._f; entry; entry = entry.n) { if (entry.k == key) return entry; } }; module.exports = { getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { var C = wrapper(function (that, iterable) { anInstance(that, C, NAME, '_i'); that._t = NAME; // collection type that._i = create(null); // index that._f = undefined; // first entry that._l = undefined; // last entry that[SIZE] = 0; // size if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); }); redefineAll(C.prototype, { // 23.1.3.1 Map.prototype.clear() // 23.2.3.2 Set.prototype.clear() clear: function clear() { for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) { entry.r = true; if (entry.p) entry.p = entry.p.n = undefined; delete data[entry.i]; } that._f = that._l = undefined; that[SIZE] = 0; }, // 23.1.3.3 Map.prototype.delete(key) // 23.2.3.4 Set.prototype.delete(value) 'delete': function (key) { var that = validate(this, NAME); var entry = getEntry(that, key); if (entry) { var next = entry.n; var prev = entry.p; delete that._i[entry.i]; entry.r = true; if (prev) prev.n = next; if (next) next.p = prev; if (that._f == entry) that._f = next; if (that._l == entry) that._l = prev; that[SIZE]--; } return !!entry; }, // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) forEach: function forEach(callbackfn /* , that = undefined */) { validate(this, NAME); var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); var entry; while (entry = entry ? entry.n : this._f) { f(entry.v, entry.k, this); // revert to the last existing entry while (entry && entry.r) entry = entry.p; } }, // 23.1.3.7 Map.prototype.has(key) // 23.2.3.7 Set.prototype.has(value) has: function has(key) { return !!getEntry(validate(this, NAME), key); } }); if (DESCRIPTORS) dP(C.prototype, 'size', { get: function () { return validate(this, NAME)[SIZE]; } }); return C; }, def: function (that, key, value) { var entry = getEntry(that, key); var prev, index; // change existing entry if (entry) { entry.v = value; // create new entry } else { that._l = entry = { i: index = fastKey(key, true), // <- index k: key, // <- key v: value, // <- value p: prev = that._l, // <- previous entry n: undefined, // <- next entry r: false // <- removed }; if (!that._f) that._f = entry; if (prev) prev.n = entry; that[SIZE]++; // add to index if (index !== 'F') that._i[index] = entry; } return that; }, getEntry: getEntry, setStrong: function (C, NAME, IS_MAP) { // add .keys, .values, .entries, [@@iterator] // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 $iterDefine(C, NAME, function (iterated, kind) { this._t = validate(iterated, NAME); // target this._k = kind; // kind this._l = undefined; // previous }, function () { var that = this; var kind = that._k; var entry = that._l; // revert to the last existing entry while (entry && entry.r) entry = entry.p; // get next entry if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) { // or finish the iteration that._t = undefined; return step(1); } // return step by kind if (kind == 'keys') return step(0, entry.k); if (kind == 'values') return step(0, entry.v); return step(0, [entry.k, entry.v]); }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); // add [@@species], 23.1.2.2, 23.2.2.2 setSpecies(NAME); } }; /***/ }), /* 821 */ /***/ (function(module, exports, __webpack_require__) { var META = __webpack_require__(762)('meta'); var isObject = __webpack_require__(740); var has = __webpack_require__(747); var setDesc = __webpack_require__(738).f; var id = 0; var isExtensible = Object.isExtensible || function () { return true; }; var FREEZE = !__webpack_require__(743)(function () { return isExtensible(Object.preventExtensions({})); }); var setMeta = function (it) { setDesc(it, META, { value: { i: 'O' + ++id, // object ID w: {} // weak collections IDs } }); }; var fastKey = function (it, create) { // return primitive with prefix if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; if (!has(it, META)) { // can't set metadata to uncaught frozen object if (!isExtensible(it)) return 'F'; // not necessary to add metadata if (!create) return 'E'; // add missing metadata setMeta(it); // return object ID } return it[META].i; }; var getWeak = function (it, create) { if (!has(it, META)) { // can't set metadata to uncaught frozen object if (!isExtensible(it)) return true; // not necessary to add metadata if (!create) return false; // add missing metadata setMeta(it); // return hash weak collections IDs } return it[META].w; }; // add metadata on freeze-family methods calling var onFreeze = function (it) { if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it); return it; }; var meta = module.exports = { KEY: META, NEED: false, fastKey: fastKey, getWeak: getWeak, onFreeze: onFreeze }; /***/ }), /* 822 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(740); module.exports = function (it, TYPE) { if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); return it; }; /***/ }), /* 823 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var global = __webpack_require__(733); var $export = __webpack_require__(732); var meta = __webpack_require__(821); var fails = __webpack_require__(743); var hide = __webpack_require__(737); var redefineAll = __webpack_require__(813); var forOf = __webpack_require__(804); var anInstance = __webpack_require__(803); var isObject = __webpack_require__(740); var setToStringTag = __webpack_require__(777); var dP = __webpack_require__(738).f; var each = __webpack_require__(824)(0); var DESCRIPTORS = __webpack_require__(742); module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) { var Base = global[NAME]; var C = Base; var ADDER = IS_MAP ? 'set' : 'add'; var proto = C && C.prototype; var O = {}; if (!DESCRIPTORS || typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () { new C().entries().next(); }))) { // create collection constructor C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); redefineAll(C.prototype, methods); meta.NEED = true; } else { C = wrapper(function (target, iterable) { anInstance(target, C, NAME, '_c'); target._c = new Base(); if (iterable != undefined) forOf(iterable, IS_MAP, target[ADDER], target); }); each('add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON'.split(','), function (KEY) { var IS_ADDER = KEY == 'add' || KEY == 'set'; if (KEY in proto && !(IS_WEAK && KEY == 'clear')) hide(C.prototype, KEY, function (a, b) { anInstance(this, C, KEY); if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false; var result = this._c[KEY](a === 0 ? 0 : a, b); return IS_ADDER ? this : result; }); }); IS_WEAK || dP(C.prototype, 'size', { get: function () { return this._c.size; } }); } setToStringTag(C, NAME); O[NAME] = C; $export($export.G + $export.W + $export.F, O); if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP); return C; }; /***/ }), /* 824 */ /***/ (function(module, exports, __webpack_require__) { // 0 -> Array#forEach // 1 -> Array#map // 2 -> Array#filter // 3 -> Array#some // 4 -> Array#every // 5 -> Array#find // 6 -> Array#findIndex var ctx = __webpack_require__(735); var IObject = __webpack_require__(752); var toObject = __webpack_require__(780); var toLength = __webpack_require__(756); var asc = __webpack_require__(825); module.exports = function (TYPE, $create) { var IS_MAP = TYPE == 1; var IS_FILTER = TYPE == 2; var IS_SOME = TYPE == 3; var IS_EVERY = TYPE == 4; var IS_FIND_INDEX = TYPE == 6; var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; var create = $create || asc; return function ($this, callbackfn, that) { var O = toObject($this); var self = IObject(O); var f = ctx(callbackfn, that, 3); var length = toLength(self.length); var index = 0; var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; var val, res; for (;length > index; index++) if (NO_HOLES || index in self) { val = self[index]; res = f(val, index, O); if (TYPE) { if (IS_MAP) result[index] = res; // map else if (res) switch (TYPE) { case 3: return true; // some case 5: return val; // find case 6: return index; // findIndex case 2: result.push(val); // filter } else if (IS_EVERY) return false; // every } } return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; }; }; /***/ }), /* 825 */ /***/ (function(module, exports, __webpack_require__) { // 9.4.2.3 ArraySpeciesCreate(originalArray, length) var speciesConstructor = __webpack_require__(826); module.exports = function (original, length) { return new (speciesConstructor(original))(length); }; /***/ }), /* 826 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(740); var isArray = __webpack_require__(827); var SPECIES = __webpack_require__(778)('species'); module.exports = function (original) { var C; if (isArray(original)) { C = original.constructor; // cross-realm fallback if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; if (isObject(C)) { C = C[SPECIES]; if (C === null) C = undefined; } } return C === undefined ? Array : C; }; /***/ }), /* 827 */ /***/ (function(module, exports, __webpack_require__) { // 7.2.2 IsArray(argument) var cof = __webpack_require__(753); module.exports = Array.isArray || function isArray(arg) { return cof(arg) == 'Array'; }; /***/ }), /* 828 */ /***/ (function(module, exports, __webpack_require__) { // https://github.com/DavidBruant/Map-Set.prototype.toJSON var $export = __webpack_require__(732); $export($export.P + $export.R, 'Map', { toJSON: __webpack_require__(829)('Map') }); /***/ }), /* 829 */ /***/ (function(module, exports, __webpack_require__) { // https://github.com/DavidBruant/Map-Set.prototype.toJSON var classof = __webpack_require__(786); var from = __webpack_require__(830); module.exports = function (NAME) { return function toJSON() { if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic"); return from(this); }; }; /***/ }), /* 830 */ /***/ (function(module, exports, __webpack_require__) { var forOf = __webpack_require__(804); module.exports = function (iter, ITERATOR) { var result = []; forOf(iter, false, result.push, result, ITERATOR); return result; }; /***/ }), /* 831 */ /***/ (function(module, exports, __webpack_require__) { // https://tc39.github.io/proposal-setmap-offrom/#sec-map.of __webpack_require__(832)('Map'); /***/ }), /* 832 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // https://tc39.github.io/proposal-setmap-offrom/ var $export = __webpack_require__(732); module.exports = function (COLLECTION) { $export($export.S, COLLECTION, { of: function of() { var length = arguments.length; var A = new Array(length); while (length--) A[length] = arguments[length]; return new this(A); } }); }; /***/ }), /* 833 */ /***/ (function(module, exports, __webpack_require__) { // https://tc39.github.io/proposal-setmap-offrom/#sec-map.from __webpack_require__(834)('Map'); /***/ }), /* 834 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // https://tc39.github.io/proposal-setmap-offrom/ var $export = __webpack_require__(732); var aFunction = __webpack_require__(736); var ctx = __webpack_require__(735); var forOf = __webpack_require__(804); module.exports = function (COLLECTION) { $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) { var mapFn = arguments[1]; var mapping, A, n, cb; aFunction(this); mapping = mapFn !== undefined; if (mapping) aFunction(mapFn); if (source == undefined) return new this(); A = []; if (mapping) { n = 0; cb = ctx(mapFn, arguments[2], 2); forOf(source, false, function (nextItem) { A.push(cb(nextItem, n++)); }); } else { forOf(source, false, A.push, A); } return new this(A); } }); }; /***/ }), /* 835 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__(836), __esModule: true }; /***/ }), /* 836 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(837); module.exports = __webpack_require__(734).Object.keys; /***/ }), /* 837 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.14 Object.keys(O) var toObject = __webpack_require__(780); var $keys = __webpack_require__(749); __webpack_require__(838)('keys', function () { return function keys(it) { return $keys(toObject(it)); }; }); /***/ }), /* 838 */ /***/ (function(module, exports, __webpack_require__) { // most Object methods by ES6 should accept primitives var $export = __webpack_require__(732); var core = __webpack_require__(734); var fails = __webpack_require__(743); module.exports = function (KEY, exec) { var fn = (core.Object || {})[KEY] || Object[KEY]; var exp = {}; exp[KEY] = exec(fn); $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp); }; /***/ }), /* 839 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__(840), __esModule: true }; /***/ }), /* 840 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(841); module.exports = __webpack_require__(734).Object.values; /***/ }), /* 841 */ /***/ (function(module, exports, __webpack_require__) { // https://github.com/tc39/proposal-object-values-entries var $export = __webpack_require__(732); var $values = __webpack_require__(748)(false); $export($export.S, 'Object', { values: function values(it) { return $values(it); } }); /***/ }), /* 842 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var _from = __webpack_require__(766); var _from2 = _interopRequireDefault(_from); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = function (arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return (0, _from2.default)(arr); } }; /***/ }), /* 843 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var _assign = __webpack_require__(844); var _assign2 = _interopRequireDefault(_assign); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = _assign2.default || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /***/ }), /* 844 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__(845), __esModule: true }; /***/ }), /* 845 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(846); module.exports = __webpack_require__(734).Object.assign; /***/ }), /* 846 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.3.1 Object.assign(target, source) var $export = __webpack_require__(732); $export($export.S + $export.F, 'Object', { assign: __webpack_require__(847) }); /***/ }), /* 847 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // 19.1.2.1 Object.assign(target, source, ...) var DESCRIPTORS = __webpack_require__(742); var getKeys = __webpack_require__(749); var gOPS = __webpack_require__(848); var pIE = __webpack_require__(764); var toObject = __webpack_require__(780); var IObject = __webpack_require__(752); var $assign = Object.assign; // should work with symbols and should have deterministic property order (V8 bug) module.exports = !$assign || __webpack_require__(743)(function () { var A = {}; var B = {}; // eslint-disable-next-line no-undef var S = Symbol(); var K = 'abcdefghijklmnopqrst'; A[S] = 7; K.split('').forEach(function (k) { B[k] = k; }); return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; }) ? function assign(target, source) { // eslint-disable-line no-unused-vars var T = toObject(target); var aLen = arguments.length; var index = 1; var getSymbols = gOPS.f; var isEnum = pIE.f; while (aLen > index) { var S = IObject(arguments[index++]); var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S); var length = keys.length; var j = 0; var key; while (length > j) { key = keys[j++]; if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key]; } } return T; } : $assign; /***/ }), /* 848 */ /***/ (function(module, exports) { exports.f = Object.getOwnPropertySymbols; /***/ }), /* 849 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var _promise = __webpack_require__(799); var _promise2 = _interopRequireDefault(_promise); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = function (fn) { return function () { var gen = fn.apply(this, arguments); return new _promise2.default(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return _promise2.default.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }; /***/ }), /* 850 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.default = function (obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }; /***/ }), /* 851 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.default = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; /***/ }), /* 852 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var _defineProperty = __webpack_require__(853); var _defineProperty2 = _interopRequireDefault(_defineProperty); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; (0, _defineProperty2.default)(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /***/ }), /* 853 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__(854), __esModule: true }; /***/ }), /* 854 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(855); var $Object = __webpack_require__(734).Object; module.exports = function defineProperty(it, key, desc) { return $Object.defineProperty(it, key, desc); }; /***/ }), /* 855 */ /***/ (function(module, exports, __webpack_require__) { var $export = __webpack_require__(732); // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) $export($export.S + $export.F * !__webpack_require__(742), 'Object', { defineProperty: __webpack_require__(738).f }); /***/ }), /* 856 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var REGISTRATION_ABORT = exports.REGISTRATION_ABORT = 'REGISTRATION_ABORT'; /***/ }), /* 857 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _objectWithoutProperties2 = __webpack_require__(850); var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); var _getPrototypeOf = __webpack_require__(858); var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); var _classCallCheck2 = __webpack_require__(851); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = __webpack_require__(852); var _createClass3 = _interopRequireDefault(_createClass2); var _possibleConstructorReturn2 = __webpack_require__(861); var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); var _inherits2 = __webpack_require__(876); var _inherits3 = _interopRequireDefault(_inherits2); var _dsl = __webpack_require__(884); var _CozyLink2 = __webpack_require__(885); var _CozyLink3 = _interopRequireDefault(_CozyLink2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var StackLink = function (_CozyLink) { (0, _inherits3.default)(StackLink, _CozyLink); function StackLink() { var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, client = _ref.client, stackClient = _ref.stackClient; (0, _classCallCheck3.default)(this, StackLink); var _this = (0, _possibleConstructorReturn3.default)(this, (StackLink.__proto__ || (0, _getPrototypeOf2.default)(StackLink)).call(this)); if (client) { console.info('Using options.client is deprecated, prefer options.stackClient'); } _this.stackClient = stackClient || client; return _this; } (0, _createClass3.default)(StackLink, [{ key: 'registerClient', value: function registerClient(client) { this.stackClient = client.stackClient || client.client; } }, { key: 'reset', value: function reset() { this.stackClient = null; } }, { key: 'request', value: function request(operation, result, forward) { if (operation.mutationType) { return this.executeMutation(operation, result, forward); } return this.executeQuery(operation); } }, { key: 'executeQuery', value: function executeQuery(query) { var doctype = query.doctype, selector = query.selector, id = query.id, ids = query.ids, referenced = query.referenced, options = (0, _objectWithoutProperties3.default)(query, ['doctype', 'selector', 'id', 'ids', 'referenced']); if (!doctype) { console.warn('Bad query', query); throw new Error('No doctype found in a query definition'); } var collection = this.stackClient.collection(doctype); if (id) { return collection.get(id); } if (ids) { return collection.getAll(ids); } if (referenced) { return collection.findReferencedBy(referenced, options); } return !selector && !options.sort ? collection.all(options) : collection.find(selector, options); } }, { key: 'executeMutation', value: function executeMutation(mutation, result, forward) { var mutationType = mutation.mutationType, props = (0, _objectWithoutProperties3.default)(mutation, ['mutationType']); switch (mutationType) { case _dsl.MutationTypes.CREATE_DOCUMENT: return this.stackClient.collection(props.document._type).create(props.document); case _dsl.MutationTypes.UPDATE_DOCUMENT: return this.stackClient.collection(props.document._type).update(props.document); case _dsl.MutationTypes.DELETE_DOCUMENT: return this.stackClient.collection(props.document._type).destroy(props.document); case _dsl.MutationTypes.ADD_REFERENCES_TO: return this.stackClient.collection(props.referencedDocuments[0]._type).addReferencesTo(props.document, props.referencedDocuments); case _dsl.MutationTypes.REMOVE_REFERENCES_TO: return this.stackClient.collection(props.referencedDocuments[0]._type).removeReferencesTo(props.document, props.referencedDocuments); case _dsl.MutationTypes.ADD_REFERENCED_BY: if (props.document._type === 'io.cozy.files') { return this.stackClient.collection('io.cozy.files').addReferencedBy(props.document, props.referencedDocuments); } else { throw new Error('The document type should be io.cozy.files'); } case _dsl.MutationTypes.REMOVE_REFERENCED_BY: if (props.document._type === 'io.cozy.files') { return this.stackClient.collection('io.cozy.files').removeReferencedBy(props.document, props.referencedDocuments); } else { throw new Error('The document type should be io.cozy.files'); } case _dsl.MutationTypes.UPLOAD_FILE: return this.stackClient.collection('io.cozy.files').upload(props.file, props.dirPath); default: return forward(mutation, result); } } }]); return StackLink; }(_CozyLink3.default); exports.default = StackLink; /***/ }), /* 858 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__(859), __esModule: true }; /***/ }), /* 859 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(860); module.exports = __webpack_require__(734).Object.getPrototypeOf; /***/ }), /* 860 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.9 Object.getPrototypeOf(O) var toObject = __webpack_require__(780); var $getPrototypeOf = __webpack_require__(779); __webpack_require__(838)('getPrototypeOf', function () { return function getPrototypeOf(it) { return $getPrototypeOf(toObject(it)); }; }); /***/ }), /* 861 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var _typeof2 = __webpack_require__(862); var _typeof3 = _interopRequireDefault(_typeof2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self; }; /***/ }), /* 862 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var _iterator = __webpack_require__(863); var _iterator2 = _interopRequireDefault(_iterator); var _symbol = __webpack_require__(866); var _symbol2 = _interopRequireDefault(_symbol); var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) { return typeof obj === "undefined" ? "undefined" : _typeof(obj); } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj); }; /***/ }), /* 863 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__(864), __esModule: true }; /***/ }), /* 864 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(768); __webpack_require__(791); module.exports = __webpack_require__(865).f('iterator'); /***/ }), /* 865 */ /***/ (function(module, exports, __webpack_require__) { exports.f = __webpack_require__(778); /***/ }), /* 866 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__(867), __esModule: true }; /***/ }), /* 867 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(868); __webpack_require__(801); __webpack_require__(874); __webpack_require__(875); module.exports = __webpack_require__(734).Symbol; /***/ }), /* 868 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // ECMAScript 6 symbols shim var global = __webpack_require__(733); var has = __webpack_require__(747); var DESCRIPTORS = __webpack_require__(742); var $export = __webpack_require__(732); var redefine = __webpack_require__(771); var META = __webpack_require__(821).KEY; var $fails = __webpack_require__(743); var shared = __webpack_require__(760); var setToStringTag = __webpack_require__(777); var uid = __webpack_require__(762); var wks = __webpack_require__(778); var wksExt = __webpack_require__(865); var wksDefine = __webpack_require__(869); var enumKeys = __webpack_require__(870); var isArray = __webpack_require__(827); var anObject = __webpack_require__(739); var isObject = __webpack_require__(740); var toObject = __webpack_require__(780); var toIObject = __webpack_require__(751); var toPrimitive = __webpack_require__(745); var createDesc = __webpack_require__(746); var _create = __webpack_require__(774); var gOPNExt = __webpack_require__(871); var $GOPD = __webpack_require__(873); var $GOPS = __webpack_require__(848); var $DP = __webpack_require__(738); var $keys = __webpack_require__(749); var gOPD = $GOPD.f; var dP = $DP.f; var gOPN = gOPNExt.f; var $Symbol = global.Symbol; var $JSON = global.JSON; var _stringify = $JSON && $JSON.stringify; var PROTOTYPE = 'prototype'; var HIDDEN = wks('_hidden'); var TO_PRIMITIVE = wks('toPrimitive'); var isEnum = {}.propertyIsEnumerable; var SymbolRegistry = shared('symbol-registry'); var AllSymbols = shared('symbols'); var OPSymbols = shared('op-symbols'); var ObjectProto = Object[PROTOTYPE]; var USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f; var QObject = global.QObject; // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 var setSymbolDesc = DESCRIPTORS && $fails(function () { return _create(dP({}, 'a', { get: function () { return dP(this, 'a', { value: 7 }).a; } })).a != 7; }) ? function (it, key, D) { var protoDesc = gOPD(ObjectProto, key); if (protoDesc) delete ObjectProto[key]; dP(it, key, D); if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc); } : dP; var wrap = function (tag) { var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); sym._k = tag; return sym; }; var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) { return typeof it == 'symbol'; } : function (it) { return it instanceof $Symbol; }; var $defineProperty = function defineProperty(it, key, D) { if (it === ObjectProto) $defineProperty(OPSymbols, key, D); anObject(it); key = toPrimitive(key, true); anObject(D); if (has(AllSymbols, key)) { if (!D.enumerable) { if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {})); it[HIDDEN][key] = true; } else { if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false; D = _create(D, { enumerable: createDesc(0, false) }); } return setSymbolDesc(it, key, D); } return dP(it, key, D); }; var $defineProperties = function defineProperties(it, P) { anObject(it); var keys = enumKeys(P = toIObject(P)); var i = 0; var l = keys.length; var key; while (l > i) $defineProperty(it, key = keys[i++], P[key]); return it; }; var $create = function create(it, P) { return P === undefined ? _create(it) : $defineProperties(_create(it), P); }; var $propertyIsEnumerable = function propertyIsEnumerable(key) { var E = isEnum.call(this, key = toPrimitive(key, true)); if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false; return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; }; var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) { it = toIObject(it); key = toPrimitive(key, true); if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return; var D = gOPD(it, key); if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true; return D; }; var $getOwnPropertyNames = function getOwnPropertyNames(it) { var names = gOPN(toIObject(it)); var result = []; var i = 0; var key; while (names.length > i) { if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key); } return result; }; var $getOwnPropertySymbols = function getOwnPropertySymbols(it) { var IS_OP = it === ObjectProto; var names = gOPN(IS_OP ? OPSymbols : toIObject(it)); var result = []; var i = 0; var key; while (names.length > i) { if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]); } return result; }; // 19.4.1.1 Symbol([description]) if (!USE_NATIVE) { $Symbol = function Symbol() { if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!'); var tag = uid(arguments.length > 0 ? arguments[0] : undefined); var $set = function (value) { if (this === ObjectProto) $set.call(OPSymbols, value); if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; setSymbolDesc(this, tag, createDesc(1, value)); }; if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set }); return wrap(tag); }; redefine($Symbol[PROTOTYPE], 'toString', function toString() { return this._k; }); $GOPD.f = $getOwnPropertyDescriptor; $DP.f = $defineProperty; __webpack_require__(872).f = gOPNExt.f = $getOwnPropertyNames; __webpack_require__(764).f = $propertyIsEnumerable; $GOPS.f = $getOwnPropertySymbols; if (DESCRIPTORS && !__webpack_require__(761)) { redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); } wksExt.f = function (name) { return wrap(wks(name)); }; } $export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol }); for (var es6Symbols = ( // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' ).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]); for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]); $export($export.S + $export.F * !USE_NATIVE, 'Symbol', { // 19.4.2.1 Symbol.for(key) 'for': function (key) { return has(SymbolRegistry, key += '') ? SymbolRegistry[key] : SymbolRegistry[key] = $Symbol(key); }, // 19.4.2.5 Symbol.keyFor(sym) keyFor: function keyFor(sym) { if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!'); for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key; }, useSetter: function () { setter = true; }, useSimple: function () { setter = false; } }); $export($export.S + $export.F * !USE_NATIVE, 'Object', { // 19.1.2.2 Object.create(O [, Properties]) create: $create, // 19.1.2.4 Object.defineProperty(O, P, Attributes) defineProperty: $defineProperty, // 19.1.2.3 Object.defineProperties(O, Properties) defineProperties: $defineProperties, // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) getOwnPropertyDescriptor: $getOwnPropertyDescriptor, // 19.1.2.7 Object.getOwnPropertyNames(O) getOwnPropertyNames: $getOwnPropertyNames, // 19.1.2.8 Object.getOwnPropertySymbols(O) getOwnPropertySymbols: $getOwnPropertySymbols }); // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives // https://bugs.chromium.org/p/v8/issues/detail?id=3443 var FAILS_ON_PRIMITIVES = $fails(function () { $GOPS.f(1); }); $export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', { getOwnPropertySymbols: function getOwnPropertySymbols(it) { return $GOPS.f(toObject(it)); } }); // 24.3.2 JSON.stringify(value [, replacer [, space]]) $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () { var S = $Symbol(); // MS Edge converts symbol values to JSON as {} // WebKit converts symbol values to JSON as null // V8 throws on boxed symbols return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}'; })), 'JSON', { stringify: function stringify(it) { var args = [it]; var i = 1; var replacer, $replacer; while (arguments.length > i) args.push(arguments[i++]); $replacer = replacer = args[1]; if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined if (!isArray(replacer)) replacer = function (key, value) { if (typeof $replacer == 'function') value = $replacer.call(this, key, value); if (!isSymbol(value)) return value; }; args[1] = replacer; return _stringify.apply($JSON, args); } }); // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) $Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(737)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); // 19.4.3.5 Symbol.prototype[@@toStringTag] setToStringTag($Symbol, 'Symbol'); // 20.2.1.9 Math[@@toStringTag] setToStringTag(Math, 'Math', true); // 24.3.3 JSON[@@toStringTag] setToStringTag(global.JSON, 'JSON', true); /***/ }), /* 869 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(733); var core = __webpack_require__(734); var LIBRARY = __webpack_require__(761); var wksExt = __webpack_require__(865); var defineProperty = __webpack_require__(738).f; module.exports = function (name) { var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) }); }; /***/ }), /* 870 */ /***/ (function(module, exports, __webpack_require__) { // all enumerable object keys, includes symbols var getKeys = __webpack_require__(749); var gOPS = __webpack_require__(848); var pIE = __webpack_require__(764); module.exports = function (it) { var result = getKeys(it); var getSymbols = gOPS.f; if (getSymbols) { var symbols = getSymbols(it); var isEnum = pIE.f; var i = 0; var key; while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key); } return result; }; /***/ }), /* 871 */ /***/ (function(module, exports, __webpack_require__) { // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window var toIObject = __webpack_require__(751); var gOPN = __webpack_require__(872).f; var toString = {}.toString; var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : []; var getWindowNames = function (it) { try { return gOPN(it); } catch (e) { return windowNames.slice(); } }; module.exports.f = function getOwnPropertyNames(it) { return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); }; /***/ }), /* 872 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) var $keys = __webpack_require__(750); var hiddenKeys = __webpack_require__(763).concat('length', 'prototype'); exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { return $keys(O, hiddenKeys); }; /***/ }), /* 873 */ /***/ (function(module, exports, __webpack_require__) { var pIE = __webpack_require__(764); var createDesc = __webpack_require__(746); var toIObject = __webpack_require__(751); var toPrimitive = __webpack_require__(745); var has = __webpack_require__(747); var IE8_DOM_DEFINE = __webpack_require__(741); var gOPD = Object.getOwnPropertyDescriptor; exports.f = __webpack_require__(742) ? gOPD : function getOwnPropertyDescriptor(O, P) { O = toIObject(O); P = toPrimitive(P, true); if (IE8_DOM_DEFINE) try { return gOPD(O, P); } catch (e) { /* empty */ } if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]); }; /***/ }), /* 874 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(869)('asyncIterator'); /***/ }), /* 875 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(869)('observable'); /***/ }), /* 876 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var _setPrototypeOf = __webpack_require__(877); var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf); var _create = __webpack_require__(881); var _create2 = _interopRequireDefault(_create); var _typeof2 = __webpack_require__(862); var _typeof3 = _interopRequireDefault(_typeof2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass))); } subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass; }; /***/ }), /* 877 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__(878), __esModule: true }; /***/ }), /* 878 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(879); module.exports = __webpack_require__(734).Object.setPrototypeOf; /***/ }), /* 879 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.3.19 Object.setPrototypeOf(O, proto) var $export = __webpack_require__(732); $export($export.S, 'Object', { setPrototypeOf: __webpack_require__(880).set }); /***/ }), /* 880 */ /***/ (function(module, exports, __webpack_require__) { // Works with __proto__ only. Old v8 can't work with null proto objects. /* eslint-disable no-proto */ var isObject = __webpack_require__(740); var anObject = __webpack_require__(739); var check = function (O, proto) { anObject(O); if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!"); }; module.exports = { set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line function (test, buggy, set) { try { set = __webpack_require__(735)(Function.call, __webpack_require__(873).f(Object.prototype, '__proto__').set, 2); set(test, []); buggy = !(test instanceof Array); } catch (e) { buggy = true; } return function setPrototypeOf(O, proto) { check(O, proto); if (buggy) O.__proto__ = proto; else set(O, proto); return O; }; }({}, false) : undefined), check: check }; /***/ }), /* 881 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__(882), __esModule: true }; /***/ }), /* 882 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(883); var $Object = __webpack_require__(734).Object; module.exports = function create(P, D) { return $Object.create(P, D); }; /***/ }), /* 883 */ /***/ (function(module, exports, __webpack_require__) { var $export = __webpack_require__(732); // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) $export($export.S, 'Object', { create: __webpack_require__(774) }); /***/ }), /* 884 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.QueryDefinition = exports.MutationTypes = exports.Mutations = exports.getDoctypeFromOperation = exports.uploadFile = exports.removeReferencedBy = exports.addReferencedBy = exports.removeReferencesTo = exports.addReferencesTo = exports.deleteDocument = exports.updateDocument = exports.createDocument = exports.Q = undefined; var _extends2 = __webpack_require__(843); var _extends3 = _interopRequireDefault(_extends2); var _classCallCheck2 = __webpack_require__(851); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = __webpack_require__(852); var _createClass3 = _interopRequireDefault(_createClass2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var isString = __webpack_require__(74); /** * Chainable API to create query definitions to retrieve documents * from a Cozy. `QueryDefinition`s are sent to links. */ var QueryDefinition = function () { /** * @class * @param {string} doctype - The doctype of the doc. * @param {string} id - The id of the doc. * @param {Array} ids - The ids of the docs. * @param {object} selector - The selector to query the docs. * @param {Array} fields - The fields to return. * @param {Array} indexedFields - The fields to index. * @param {Array} sort - The sorting params. * @param {string} includes - The docs to include. * @param {string} referenced - The referenced document. * @param {number} limit - The document's limit to return. * @param {number} skip - The number of docs to skip. */ function QueryDefinition() { var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, doctype = _ref.doctype, id = _ref.id, ids = _ref.ids, selector = _ref.selector, fields = _ref.fields, indexedFields = _ref.indexedFields, sort = _ref.sort, includes = _ref.includes, referenced = _ref.referenced, limit = _ref.limit, skip = _ref.skip, cursor = _ref.cursor; (0, _classCallCheck3.default)(this, QueryDefinition); this.doctype = doctype; this.id = id; this.ids = ids; this.selector = selector; this.fields = fields; this.indexedFields = indexedFields; this.sort = sort; this.includes = includes; this.referenced = referenced; this.limit = limit; this.skip = skip; this.cursor = cursor; } /** * Query a single document on its id. * * @param {string} id The document id. * @returns {QueryDefinition} The QueryDefinition object. */ (0, _createClass3.default)(QueryDefinition, [{ key: 'getById', value: function getById(id) { return new QueryDefinition((0, _extends3.default)({}, this.toDefinition(), { id: id })); } /** * Query several documents on their ids. * * @param {Array} ids The documents ids. * @returns {QueryDefinition} The QueryDefinition object. */ }, { key: 'getByIds', value: function getByIds(ids) { return new QueryDefinition((0, _extends3.default)({}, this.toDefinition(), { ids: ids })); } /** * Query documents with a [mango selector](http://docs.couchdb.org/en/latest/api/database/find.html#find-selectors). * Each field passed in the selector will be indexed, except if the indexField option is used. * * @param {object} selector The Mango selector. * @returns {QueryDefinition} The QueryDefinition object. */ }, { key: 'where', value: function where(selector) { return new QueryDefinition((0, _extends3.default)({}, this.toDefinition(), { selector: selector })); } /** * Specify which fields of each object should be returned. If it is omitted, the entire object is returned. * * @param {Array} fields The fields to return. * @returns {QueryDefinition} The QueryDefinition object. */ }, { key: 'select', value: function select(fields) { return new QueryDefinition((0, _extends3.default)({}, this.toDefinition(), { fields: fields })); } /** * Specify which fields should be indexed. This prevent the automatic indexing of the mango fields. * * @param {Array} fields The fields to index. * @returns {QueryDefinition} The QueryDefinition object. */ }, { key: 'indexFields', value: function indexFields(indexedFields) { return new QueryDefinition((0, _extends3.default)({}, this.toDefinition(), { indexedFields: indexedFields })); } /** * Specify how to sort documents, following the [sort syntax](http://docs.couchdb.org/en/latest/api/database/find.html#find-sort) * * @param {Array} sort The list of field name and direction pairs. * @returns {QueryDefinition} The QueryDefinition object. */ }, { key: 'sortBy', value: function sortBy(sort) { if (isString(sort)) { throw new Error('Invalid sort, should be an object (`{ label: "desc"}`), you passed a string.'); } return new QueryDefinition((0, _extends3.default)({}, this.toDefinition(), { sort: sort })); } /** * Includes documents having a relationships with the ones queried. * For example, query albums including the photos. * * @param {Array} includes The documents to include. * @returns {QueryDefinition} The QueryDefinition object. */ }, { key: 'include', value: function include(includes) { if (!Array.isArray(includes)) { throw new Error('include() takes an array of relationship names'); } return new QueryDefinition((0, _extends3.default)({}, this.toDefinition(), { includes: includes })); } /** * Maximum number of documents returned, useful for pagination. Default is 100. * * @param {number} limit The document's limit. * @returns {QueryDefinition} The QueryDefinition object. */ }, { key: 'limitBy', value: function limitBy(limit) { return new QueryDefinition((0, _extends3.default)({}, this.toDefinition(), { limit: limit })); } }, { key: 'UNSAFE_noLimit', value: function UNSAFE_noLimit() { return new QueryDefinition((0, _extends3.default)({}, this.toDefinition(), { limit: null })); } /** * Skip the first ‘n’ documents, where ‘n’ is the value specified. * * Beware, this [performs badly](http://docs.couchdb.org/en/stable/ddocs/views/pagination.html#paging-alternate-method) on view's index. * Prefer cursor-based pagination in such situation. * * @param {number} skip The number of documents to skip. * @returns {QueryDefinition} The QueryDefinition object. */ }, { key: 'offset', value: function offset(skip) { return new QueryDefinition((0, _extends3.default)({}, this.toDefinition(), { skip: skip })); } /** * Use [cursor-based](https://docs.cozy.io/en/cozy-stack/jsonapi/#pagination) pagination. * *Warning*: this is only useful for views. * The cursor is a [startkey, startkey_docid] array, where startkey is the view's key, * e.g. ["io.cozy.photos.albums", "album-id"] and startkey_docid is the id of * the starting document of the query, e.g. "file-id". * Use the last docid of each query as startkey_docid to paginate or leave blank for the first query. * * @param {Array} cursor The cursor for pagination. * @returns {QueryDefinition} The QueryDefinition object. */ }, { key: 'offsetCursor', value: function offsetCursor(cursor) { return new QueryDefinition((0, _extends3.default)({}, this.toDefinition(), { cursor: cursor })); } /** * Use the [file reference system](https://docs.cozy.io/en/cozy-stack/references-docs-in-vfs/) * * @param {object} document The reference document * @returns {QueryDefinition} The QueryDefinition object. */ }, { key: 'referencedBy', value: function referencedBy(document) { return new QueryDefinition((0, _extends3.default)({}, this.toDefinition(), { referenced: document })); } }, { key: 'toDefinition', value: function toDefinition() { return { doctype: this.doctype, id: this.id, ids: this.ids, selector: this.selector, fields: this.fields, indexedFields: this.indexedFields, sort: this.sort, includes: this.includes, referenced: this.referenced, limit: this.limit, skip: this.skip, cursor: this.cursor }; } }]); return QueryDefinition; }(); /** * Helper to create a QueryDefinition. Recommended way to create * query definitions. * * @example * ``` * import { Q } from 'cozy-client' * * const qDef = Q('io.cozy.todos').where({ _id: '1234' }) * ``` */ var Q = exports.Q = function Q(doctype) { return new QueryDefinition({ doctype: doctype }); }; // Mutations var CREATE_DOCUMENT = 'CREATE_DOCUMENT'; var UPDATE_DOCUMENT = 'UPDATE_DOCUMENT'; var DELETE_DOCUMENT = 'DELETE_DOCUMENT'; var ADD_REFERENCES_TO = 'ADD_REFERENCES_TO'; var REMOVE_REFERENCES_TO = 'REMOVE_REFERENCES_TO'; var ADD_REFERENCED_BY = 'ADD_REFERENCED_BY'; var REMOVE_REFERENCED_BY = 'REMOVE_REFERENCED_BY'; var UPLOAD_FILE = 'UPLOAD_FILE'; var createDocument = exports.createDocument = function createDocument(document) { return { mutationType: MutationTypes.CREATE_DOCUMENT, document: document }; }; var updateDocument = exports.updateDocument = function updateDocument(document) { return { mutationType: MutationTypes.UPDATE_DOCUMENT, document: document }; }; var deleteDocument = exports.deleteDocument = function deleteDocument(document) { return { mutationType: MutationTypes.DELETE_DOCUMENT, document: document }; }; var addReferencesTo = exports.addReferencesTo = function addReferencesTo(document, referencedDocuments) { return { mutationType: MutationTypes.ADD_REFERENCES_TO, referencedDocuments: referencedDocuments, document: document }; }; var removeReferencesTo = exports.removeReferencesTo = function removeReferencesTo(document, referencedDocuments) { return { mutationType: MutationTypes.REMOVE_REFERENCES_TO, referencedDocuments: referencedDocuments, document: document }; }; var addReferencedBy = exports.addReferencedBy = function addReferencedBy(document, referencedDocuments) { return { mutationType: MutationTypes.ADD_REFERENCED_BY, referencedDocuments: referencedDocuments, document: document }; }; var removeReferencedBy = exports.removeReferencedBy = function removeReferencedBy(document, referencedDocuments) { return { mutationType: MutationTypes.REMOVE_REFERENCED_BY, referencedDocuments: referencedDocuments, document: document }; }; var uploadFile = exports.uploadFile = function uploadFile(file, dirPath) { return { mutationType: MutationTypes.UPLOAD_FILE, file: file, dirPath: dirPath }; }; var getDoctypeFromOperation = exports.getDoctypeFromOperation = function getDoctypeFromOperation(operation) { if (operation.mutationType) { var type = operation.mutationType; switch (type) { case CREATE_DOCUMENT: return operation.document._type; case UPDATE_DOCUMENT: return operation.document._type; case DELETE_DOCUMENT: return operation.document._type; case ADD_REFERENCES_TO: throw new Error('Not implemented'); case UPLOAD_FILE: throw new Error('Not implemented'); default: throw new Error('Unknown mutationType ' + type); } } else { return operation.doctype; } }; var Mutations = exports.Mutations = { createDocument: createDocument, updateDocument: updateDocument, deleteDocument: deleteDocument, addReferencesTo: addReferencesTo, removeReferencesTo: removeReferencesTo, addReferencedBy: addReferencedBy, removeReferencedBy: removeReferencedBy, uploadFile: uploadFile }; var MutationTypes = exports.MutationTypes = { CREATE_DOCUMENT: CREATE_DOCUMENT, UPDATE_DOCUMENT: UPDATE_DOCUMENT, DELETE_DOCUMENT: DELETE_DOCUMENT, ADD_REFERENCES_TO: ADD_REFERENCES_TO, REMOVE_REFERENCES_TO: REMOVE_REFERENCES_TO, ADD_REFERENCED_BY: ADD_REFERENCED_BY, REMOVE_REFERENCED_BY: REMOVE_REFERENCED_BY, UPLOAD_FILE: UPLOAD_FILE }; exports.QueryDefinition = QueryDefinition; /***/ }), /* 885 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.chain = undefined; var _toConsumableArray2 = __webpack_require__(842); var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2); var _stringify = __webpack_require__(886); var _stringify2 = _interopRequireDefault(_stringify); var _classCallCheck2 = __webpack_require__(851); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = __webpack_require__(852); var _createClass3 = _interopRequireDefault(_createClass2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var CozyLink = function () { function CozyLink(requestHandler) { (0, _classCallCheck3.default)(this, CozyLink); if (typeof requestHandler === 'function') { this.request = requestHandler; } } (0, _createClass3.default)(CozyLink, [{ key: 'request', value: function request(operation, result, forward) { throw new Error('request is not implemented'); } }]); return CozyLink; }(); exports.default = CozyLink; var toLink = function toLink(handler) { return typeof handler === 'function' ? new CozyLink(handler) : handler; }; var defaultLinkHandler = function defaultLinkHandler(operation, result) { if (result) return result;else if (operation.execute) return operation.execute();else throw new Error('No link could handle operation ' + (0, _stringify2.default)(operation)); }; var chain = exports.chain = function chain(links) { return [].concat((0, _toConsumableArray3.default)(links), [defaultLinkHandler]).map(toLink).reduce(concat); }; var concat = function concat(firstLink, nextLink) { return new CozyLink(function (operation, result, forward) { var nextForward = function nextForward(op, res) { return nextLink.request(op, res, forward); }; return firstLink.request(operation, result, nextForward); }); }; /***/ }), /* 886 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__(887), __esModule: true }; /***/ }), /* 887 */ /***/ (function(module, exports, __webpack_require__) { var core = __webpack_require__(734); var $JSON = core.JSON || (core.JSON = { stringify: JSON.stringify }); module.exports = function stringify(it) { // eslint-disable-line no-unused-vars return $JSON.stringify.apply($JSON, arguments); }; /***/ }), /* 888 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.HasManyTriggers = exports.HasManyInPlace = exports.HasOneInPlace = exports.HasOne = exports.HasMany = exports.HasManyFiles = exports.Association = exports.create = exports.resolveClass = undefined; var _helpers = __webpack_require__(889); Object.defineProperty(exports, 'resolveClass', { enumerable: true, get: function get() { return _helpers.resolveClass; } }); Object.defineProperty(exports, 'create', { enumerable: true, get: function get() { return _helpers.create; } }); var _HasManyFiles = __webpack_require__(939); var _HasManyFiles2 = _interopRequireDefault(_HasManyFiles); var _HasMany = __webpack_require__(898); var _HasMany2 = _interopRequireDefault(_HasMany); var _HasOne = __webpack_require__(894); var _HasOne2 = _interopRequireDefault(_HasOne); var _HasOneInPlace = __webpack_require__(897); var _HasOneInPlace2 = _interopRequireDefault(_HasOneInPlace); var _HasManyInPlace = __webpack_require__(938); var _HasManyInPlace2 = _interopRequireDefault(_HasManyInPlace); var _HasManyTriggers = __webpack_require__(964); var _HasManyTriggers2 = _interopRequireDefault(_HasManyTriggers); var _Association = __webpack_require__(893); var _Association2 = _interopRequireDefault(_Association); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.Association = _Association2.default; exports.HasManyFiles = _HasManyFiles2.default; exports.HasMany = _HasMany2.default; exports.HasOne = _HasOne2.default; exports.HasOneInPlace = _HasOneInPlace2.default; exports.HasManyInPlace = _HasManyInPlace2.default; exports.HasManyTriggers = _HasManyTriggers2.default; /***/ }), /* 889 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.create = exports.resolveClass = exports.attachRelationships = exports.responseToRelationship = exports.pickTypeAndId = undefined; var _extends2 = __webpack_require__(843); var _extends3 = _interopRequireDefault(_extends2); var _pick = __webpack_require__(602); var _pick2 = _interopRequireDefault(_pick); var _pickBy = __webpack_require__(890); var _pickBy2 = _interopRequireDefault(_pickBy); var _Association = __webpack_require__(893); var _Association2 = _interopRequireDefault(_Association); var _HasOne = __webpack_require__(894); var _HasOne2 = _interopRequireDefault(_HasOne); var _HasOneInPlace = __webpack_require__(897); var _HasOneInPlace2 = _interopRequireDefault(_HasOneInPlace); var _HasMany = __webpack_require__(898); var _HasMany2 = _interopRequireDefault(_HasMany); var _HasManyInPlace = __webpack_require__(938); var _HasManyInPlace2 = _interopRequireDefault(_HasManyInPlace); var _HasManyFiles = __webpack_require__(939); var _HasManyFiles2 = _interopRequireDefault(_HasManyFiles); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var pickTypeAndId = exports.pickTypeAndId = function pickTypeAndId(x) { return (0, _pick2.default)(x, '_type', '_id'); }; var applyHelper = function applyHelper(fn, objOrArr) { return Array.isArray(objOrArr) ? objOrArr.map(fn) : fn(objOrArr); }; var responseToRelationship = exports.responseToRelationship = function responseToRelationship(response) { return (0, _pickBy2.default)({ data: applyHelper(pickTypeAndId, response.data), meta: response.meta, next: response.next, skip: response.skip }); }; var attachRelationship = function attachRelationship(doc, relationships) { return (0, _extends3.default)({}, doc, { relationships: (0, _extends3.default)({}, doc.relationships, relationships) }); }; var attachRelationships = exports.attachRelationships = function attachRelationships(response, relationshipsByDocId) { if (Array.isArray(response.data)) { return (0, _extends3.default)({}, response, { data: response.data.map(function (doc) { return attachRelationship(doc, relationshipsByDocId[doc._id]); }) }); } else { var doc = response.data; return (0, _extends3.default)({}, response, { data: attachRelationship(doc, relationshipsByDocId[doc._id]) }); } }; var aliases = { 'io.cozy.files:has-many': _HasManyFiles2.default, 'has-many': _HasMany2.default, 'belongs-to-in-place': _HasOneInPlace2.default, 'has-one': _HasOne2.default, 'has-one-in-place': _HasOneInPlace2.default, 'has-many-in-place': _HasManyInPlace2.default /** * Returns the relationship class for a given doctype/type. * * In the schema definition, some classes have string aliases * so you do not have to import directly the association. * * Some doctypes can have built-in overriden relationships. * * @private */ };var resolveClass = exports.resolveClass = function resolveClass(doctype, type) { if (type === undefined) { throw new Error('Undefined type for ' + doctype); } if (typeof type !== 'string') { return type; } else { var qualified = doctype + ':' + type; var cls = aliases[qualified] || aliases[type]; if (!cls) { throw new Error('Unknown association \'' + type + '\''); } else { return cls; } } }; var create = exports.create = function create(target, _ref, accessors) { var name = _ref.name, type = _ref.type, doctype = _ref.doctype; if (target[name] instanceof _Association2.default) { throw new Error('Association ' + name + ' already exists'); } return new type(target, name, doctype, accessors); }; /***/ }), /* 890 */ /***/ (function(module, exports, __webpack_require__) { var arrayMap = __webpack_require__(580), baseIteratee = __webpack_require__(543), basePickBy = __webpack_require__(604), getAllKeysIn = __webpack_require__(891); /** * Creates an object composed of the `object` properties `predicate` returns * truthy for. The predicate is invoked with two arguments: (value, key). * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The source object. * @param {Function} [predicate=_.identity] The function invoked per property. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.pickBy(object, _.isNumber); * // => { 'a': 1, 'c': 3 } */ function pickBy(object, predicate) { if (object == null) { return {}; } var props = arrayMap(getAllKeysIn(object), function(prop) { return [prop]; }); predicate = baseIteratee(predicate); return basePickBy(object, props, function(value, path) { return predicate(value, path[0]); }); } module.exports = pickBy; /***/ }), /* 891 */ /***/ (function(module, exports, __webpack_require__) { var baseGetAllKeys = __webpack_require__(558), getSymbolsIn = __webpack_require__(892), keysIn = __webpack_require__(410); /** * Creates an array of own and inherited enumerable property names and * symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names and symbols. */ function getAllKeysIn(object) { return baseGetAllKeys(object, keysIn, getSymbolsIn); } module.exports = getAllKeysIn; /***/ }), /* 892 */ /***/ (function(module, exports, __webpack_require__) { var arrayPush = __webpack_require__(559), getPrototype = __webpack_require__(536), getSymbols = __webpack_require__(560), stubArray = __webpack_require__(562); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeGetSymbols = Object.getOwnPropertySymbols; /** * Creates an array of the own and inherited enumerable symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { var result = []; while (object) { arrayPush(result, getSymbols(object)); object = getPrototype(object); } return result; }; module.exports = getSymbolsIn; /***/ }), /* 893 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _classCallCheck2 = __webpack_require__(851); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = __webpack_require__(852); var _createClass3 = _interopRequireDefault(_createClass2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Associations are used by components to access related store documents that are * linked in a document. They are also responsible for building the `QueryDefinition` that is * used by the client to automatically fetch relationship data. * * Hydrated documents used by components come with Association instances. * * @description * Example: The schema defines an `author` relationship : * * ```js * const BOOK_SCHEMA = { * relationships: { * author: 'has-one' * } * } * ``` * * Hydrated `books` will have the `author` association instance under the `author` key. * Accessing `hydratedBook.author.data` gives you the author from the store, for example : * * ```json * { * "name": "St-Exupery", * "firstName": "Antoine", * "_id": "antoine" * } * ``` * * It is the responsibility of the relationship to decide how the relationship data is stored. * For example, here since we use the default `has-one` relationship, the relationship data * is stored in the `relationships` attribute of the original document (in our case here, our book * would be * * ```json * { * "title": "Le petit prince", * "relationships": { * "author": { * "data": { * "doctype": "io.cozy.authors", * "_id": "antoine" * } * } * } * } * ``` * * In the case of an "in-place" relationship, the relationship data is stored directly under the attribute named * by the relationship (in our case `author`). Our book would be * * ```json * { * "title": "Le petit prince", * "author": "antoine" * } * ``` * * --- * * Each different type of Association may change: * * - `get raw`: how the relationship data is stored (either as per the JSON API spec or * in a custom way) * - `get data`: how the store documents are then fetched from the store to be added to * the hydrated document (.data method). View components will access * `hydratedDoc[relationshipName].data`. * - `get query`: how to build the query to fetch related documents * */ var Association = function () { /** * @param {object} target - Original object containing raw data * @param {string} name - Attribute under which the association is stored * @param {string} doctype - Doctype of the documents managed by the association * @param {Function} options.dispatch - Store's dispatch, comes from the client * @param {string} options */ function Association(target, name, doctype, options) { (0, _classCallCheck3.default)(this, Association); var dispatch = options.dispatch, get = options.get, query = options.query, mutate = options.mutate, save = options.save; /** * The original document declaring the relationship * * @type {object} */ this.target = target; /** * The name of the relationship. * * @type {string} * @example 'author' */ this.name = name; /** * Doctype of the relationship * * @type {string} * @example 'io.cozy.authors' */ this.doctype = doctype; /** * Returns the document from the store * * @type {Function} */ this.get = get; /** * Performs a query to retrieve relationship documents. * * @param {QueryDefinition} queryDefinition * @function */ this.query = query; /** * Performs a mutation on the relationship. * * @function */ this.mutate = mutate; /** * Saves the relationship in store. * * @type {Function} */ this.save = save; /** * Dispatch an action on the store. * * @type {Function} */ this.dispatch = dispatch; } /** * * Returns the raw relationship data as stored in the original document * * For a document with relationships stored as JSON API spec: * * ```js * const book = { * title: 'Moby Dick', * relationships: { * author: { * data: { * doctype: 'io.cozy.authors', * id: 'herman' * } * } * } * } * ``` * * Raw value will be * * ```json * { * "doctype": "io.cozy.authors", * "id": "herman" * } * ``` * * Derived `Association`s need to implement this method. */ (0, _createClass3.default)(Association, [{ key: 'raw', get: function get() { throw new Error('A relationship must define its raw getter'); } /** * Returns the document(s) from the store * * For document with relationships stored as JSON API spec : * * ```js * const book = { * title: 'Moby Dick', * relationships: { * author: { * data: { * doctype: 'io.cozy.authors', * id: 'herman' * } * } * } * } * ``` * * `data` will be * * ```json * { * "_id": "herman" * "_type": "io.cozy.authors", * "firstName": "herman", * "name": "Melville" * } * ``` * * Derived `Association`s need to implement this method. */ }, { key: 'data', get: function get() { throw new Error('A relationship must define its data getter'); } /** * Derived `Association`s need to implement this method. * * @returns {QueryDefinition} */ }], [{ key: 'query', value: function query() { throw new Error('A custom relationship must define its query() function'); } }]); return Association; }(); exports.default = Association; /***/ }), /* 894 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _defineProperty2 = __webpack_require__(895); var _defineProperty3 = _interopRequireDefault(_defineProperty2); var _extends3 = __webpack_require__(843); var _extends4 = _interopRequireDefault(_extends3); var _getPrototypeOf = __webpack_require__(858); var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); var _classCallCheck2 = __webpack_require__(851); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = __webpack_require__(852); var _createClass3 = _interopRequireDefault(_createClass2); var _possibleConstructorReturn2 = __webpack_require__(861); var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); var _inherits2 = __webpack_require__(876); var _inherits3 = _interopRequireDefault(_inherits2); var _get2 = __webpack_require__(571); var _get3 = _interopRequireDefault(_get2); var _set2 = __webpack_require__(896); var _set3 = _interopRequireDefault(_set2); var _Association2 = __webpack_require__(893); var _Association3 = _interopRequireDefault(_Association2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var HasOne = function (_Association) { (0, _inherits3.default)(HasOne, _Association); function HasOne() { (0, _classCallCheck3.default)(this, HasOne); return (0, _possibleConstructorReturn3.default)(this, (HasOne.__proto__ || (0, _getPrototypeOf2.default)(HasOne)).apply(this, arguments)); } (0, _createClass3.default)(HasOne, [{ key: 'set', value: function set(doc) { if (doc && doc._type !== this.doctype) { throw new Error('Tried to associate a ' + doc._type + ' document to a HasOne relationship on ' + this.doctype + ' document'); } var path = 'relationships[' + this.name + '].data'; if (doc) { (0, _set3.default)(this.target, path, { _id: doc._id, _type: doc._type }); } else { (0, _set3.default)(this.target, path, undefined); } } }, { key: 'unset', value: function unset() { this.set(undefined); } }, { key: 'dehydrate', value: function dehydrate(doc) { return (0, _extends4.default)({}, doc, { relationships: (0, _extends4.default)({}, doc.relationships, (0, _defineProperty3.default)({}, this.name, { data: this.raw })) }); } }, { key: 'raw', get: function get() { return (0, _get3.default)(this.target, 'relationships[' + this.name + '].data', null); } }, { key: 'data', get: function get() { if (!this.raw) { return null; } return this.get(this.doctype, this.raw._id); } }], [{ key: 'query', value: function query(doc, client, assoc) { var relationship = (0, _get3.default)(doc, 'relationships.' + assoc.name + '.data', {}); return client.get(assoc.doctype, relationship._id); } }]); return HasOne; }(_Association3.default); exports.default = HasOne; /***/ }), /* 895 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var _defineProperty = __webpack_require__(853); var _defineProperty2 = _interopRequireDefault(_defineProperty); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = function (obj, key, value) { if (key in obj) { (0, _defineProperty2.default)(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }; /***/ }), /* 896 */ /***/ (function(module, exports, __webpack_require__) { var baseSet = __webpack_require__(605); /** * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, * it's created. Arrays are created for missing index properties while objects * are created for all other missing properties. Use `_.setWith` to customize * `path` creation. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 3.7.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {*} value The value to set. * @returns {Object} Returns `object`. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.set(object, 'a[0].b.c', 4); * console.log(object.a[0].b.c); * // => 4 * * _.set(object, ['x', '0', 'y', 'z'], 5); * console.log(object.x[0].y.z); * // => 5 */ function set(object, path, value) { return object == null ? object : baseSet(object, path, value); } module.exports = set; /***/ }), /* 897 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BelongsToInPlace = undefined; var _defineProperty2 = __webpack_require__(895); var _defineProperty3 = _interopRequireDefault(_defineProperty2); var _extends3 = __webpack_require__(843); var _extends4 = _interopRequireDefault(_extends3); var _getPrototypeOf = __webpack_require__(858); var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); var _classCallCheck2 = __webpack_require__(851); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = __webpack_require__(852); var _createClass3 = _interopRequireDefault(_createClass2); var _possibleConstructorReturn2 = __webpack_require__(861); var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); var _inherits2 = __webpack_require__(876); var _inherits3 = _interopRequireDefault(_inherits2); var _Association2 = __webpack_require__(893); var _Association3 = _interopRequireDefault(_Association2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Here the id of the document is directly set in the attribute * of the document, not in the relationships attribute */ var HasOneInPlace = function (_Association) { (0, _inherits3.default)(HasOneInPlace, _Association); function HasOneInPlace() { (0, _classCallCheck3.default)(this, HasOneInPlace); return (0, _possibleConstructorReturn3.default)(this, (HasOneInPlace.__proto__ || (0, _getPrototypeOf2.default)(HasOneInPlace)).apply(this, arguments)); } (0, _createClass3.default)(HasOneInPlace, [{ key: 'dehydrate', value: function dehydrate(doc) { return (0, _extends4.default)({}, doc, (0, _defineProperty3.default)({}, this.name, this.raw || undefined)); } }, { key: 'raw', get: function get() { return this.target[this.name]; } }, { key: 'data', get: function get() { return this.get(this.doctype, this.raw); } }], [{ key: 'query', value: function query(doc, client, assoc) { var id = doc[assoc.name]; return client.getDocumentFromState(assoc.doctype, id) || client.get(assoc.doctype, id); } }]); return HasOneInPlace; }(_Association3.default); exports.default = HasOneInPlace; var BelongsToInPlace = exports.BelongsToInPlace = HasOneInPlace; /***/ }), /* 898 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _toConsumableArray2 = __webpack_require__(842); var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2); var _defineProperty2 = __webpack_require__(895); var _defineProperty3 = _interopRequireDefault(_defineProperty2); var _extends5 = __webpack_require__(843); var _extends6 = _interopRequireDefault(_extends5); var _getPrototypeOf = __webpack_require__(858); var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); var _classCallCheck2 = __webpack_require__(851); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = __webpack_require__(852); var _createClass3 = _interopRequireDefault(_createClass2); var _possibleConstructorReturn2 = __webpack_require__(861); var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); var _inherits2 = __webpack_require__(876); var _inherits3 = _interopRequireDefault(_inherits2); var _get = __webpack_require__(571); var _get2 = _interopRequireDefault(_get); var _Association2 = __webpack_require__(893); var _Association3 = _interopRequireDefault(_Association2); var _dsl = __webpack_require__(884); var _store = __webpack_require__(899); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var empty = function empty() { return { data: [], next: true, meta: { count: 0 } }; }; /** * Related documents are stored in the relationships attribute of the object, * following the JSON API spec. * * Responsible for * * - Creating relationships * - Removing relationships * * @description * * ``` * const schema = { * todos: { * doctype: 'io.cozy.todos', * relationships: { * tasks: { * doctype: 'io.cozy.tasks', * type: 'has-many' * } * } * } * } * * const todo = { * label: "Protect people's privacy", * relationships: { * tasks: { * data: [ * {_id: 1, _type: 'io.cozy.tasks'}, * {_id: 2, _type: 'io.cozy.tasks'} * ] * } * } * } * ``` */ var HasMany = function (_Association) { (0, _inherits3.default)(HasMany, _Association); function HasMany() { var _ref; var _temp, _this, _ret; (0, _classCallCheck3.default)(this, HasMany); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = HasMany.__proto__ || (0, _getPrototypeOf2.default)(HasMany)).call.apply(_ref, [this].concat(args))), _this), _this.updateRelationshipData = function (getUpdatedRelationshipData) { return function (dispatch, getState) { var previousRelationship = (0, _store.getDocumentFromState)(getState(), _this.target._type, _this.target._id); dispatch((0, _store.receiveQueryResult)(null, { data: (0, _extends6.default)({}, previousRelationship, { relationships: (0, _extends6.default)({}, previousRelationship.relationships, (0, _defineProperty3.default)({}, _this.name, getUpdatedRelationshipData(previousRelationship.relationships[_this.name]))) }) })); }; }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); } (0, _createClass3.default)(HasMany, [{ key: 'fetchMore', value: function fetchMore() { throw 'Not implemented'; } }, { key: 'exists', value: function exists(document) { return this.existsById(document._id); } }, { key: 'existsById', value: function existsById(id) { return this.getRelationship().data.find(function (_ref2) { var _id = _ref2._id; return id === _id; }) !== undefined; } /** * Add a referenced document by id. You need to call save() * in order to synchronize your document with the store. * * @todo We shouldn't create the array of relationship manually since * it'll not be present in the store as well. * We certainly should use something like `updateRelationship` * */ }, { key: 'addById', value: function addById(ids) { var _this2 = this, _target$relationships; if (!this.target.relationships) this.target.relationships = {}; if (!this.target.relationships[this.name]) { this.target.relationships[this.name] = { data: [] }; } ids = Array.isArray(ids) ? ids : [ids]; var newRelations = ids.filter(function (id) { return !_this2.existsById(id); }).map(function (id) { return { _id: id, _type: _this2.doctype }; }); (_target$relationships = this.target.relationships[this.name].data).push.apply(_target$relationships, (0, _toConsumableArray3.default)(newRelations)); this.updateMetaCount(); return this.save(this.target); } }, { key: 'removeById', value: function removeById(ids) { ids = Array.isArray(ids) ? ids : [ids]; this.target.relationships[this.name].data = this.target.relationships[this.name].data.filter(function (_ref3) { var _id = _ref3._id; return !ids.includes(_id); }); this.updateMetaCount(); return this.save(this.target); } }, { key: 'updateMetaCount', value: function updateMetaCount() { if ((0, _get2.default)(this.target.relationships[this.name], 'meta.count') !== undefined) { this.target.relationships[this.name].meta = (0, _extends6.default)({}, this.target.relationships[this.name].meta, { count: this.target.relationships[this.name].data.length }); } } }, { key: 'getRelationship', value: function getRelationship() { var rawData = this.target[this.name]; var relationship = (0, _get2.default)(this.target, 'relationships.' + this.name); if (!relationship) { if (rawData && rawData.length) { console.warn("You're trying to access data on a relationship that appear to not be loaded yet. You may want to use 'include()' on your query"); } return empty(); } return relationship; } }, { key: 'updateTargetRelationship', value: function updateTargetRelationship(store, updateFn) { // TODO See if updateTargetRelationship is still used, removing it would enable us // to remove store.readDocument and store.writeDocument and the StoreProxy var prevTarget = store.readDocument(this.target._type, this.target._id); store.writeDocument(this.updateRelationship(prevTarget, updateFn)); } }, { key: 'updateRelationship', value: function updateRelationship(target, updateFn) { return (0, _extends6.default)({}, target, { relationships: (0, _extends6.default)({}, target.relationships, (0, _defineProperty3.default)({}, this.name, (0, _extends6.default)({}, target.relationships[this.name], updateFn(target.relationships[this.name])))) }); } }, { key: 'dehydrate', value: function dehydrate(doc) { return (0, _extends6.default)({}, doc, { relationships: (0, _extends6.default)({}, doc.relationships, (0, _defineProperty3.default)({}, this.name, { data: this.raw })) }); } }, { key: 'raw', get: function get() { return this.getRelationship().data; } }, { key: 'data', get: function get() { var _this3 = this; return this.getRelationship().data.map(function (_ref4) { var _id = _ref4._id, _type = _ref4._type; return _this3.get(_type, _id); }); } }, { key: 'hasMore', get: function get() { return this.getRelationship().next; } }, { key: 'count', get: function get() { var relationship = this.getRelationship(); return relationship.meta ? relationship.meta.count : relationship.data.length; } }], [{ key: 'query', value: function query(document, client, assoc) { var relationships = (0, _get2.default)(document, 'relationships.' + assoc.name + '.data', []); var ids = relationships.map(function (assoc) { return assoc._id; }); return new _dsl.QueryDefinition({ doctype: assoc.doctype, ids: ids }); } }]); return HasMany; }(_Association3.default); exports.default = HasMany; /***/ }), /* 899 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.receiveMutationError = exports.receiveMutationResult = exports.initMutation = exports.receiveQueryError = exports.receiveQueryResult = exports.initQuery = exports.getRawQueryFromState = exports.getQueryFromState = exports.getQueryFromStore = exports.getDocumentFromState = exports.getCollectionFromState = exports.getStateRoot = exports.createStore = exports.StoreProxy = undefined; var _defineProperty2 = __webpack_require__(895); var _defineProperty3 = _interopRequireDefault(_defineProperty2); var _extends4 = __webpack_require__(843); var _extends5 = _interopRequireDefault(_extends4); var _classCallCheck2 = __webpack_require__(851); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = __webpack_require__(852); var _createClass3 = _interopRequireDefault(_createClass2); var _queries = __webpack_require__(900); Object.defineProperty(exports, 'initQuery', { enumerable: true, get: function get() { return _queries.initQuery; } }); Object.defineProperty(exports, 'receiveQueryResult', { enumerable: true, get: function get() { return _queries.receiveQueryResult; } }); Object.defineProperty(exports, 'receiveQueryError', { enumerable: true, get: function get() { return _queries.receiveQueryError; } }); var _mutations = __webpack_require__(909); Object.defineProperty(exports, 'initMutation', { enumerable: true, get: function get() { return _mutations.initMutation; } }); Object.defineProperty(exports, 'receiveMutationResult', { enumerable: true, get: function get() { return _mutations.receiveMutationResult; } }); Object.defineProperty(exports, 'receiveMutationError', { enumerable: true, get: function get() { return _mutations.receiveMutationError; } }); var _redux = __webpack_require__(917); var _reduxThunk = __webpack_require__(937); var _reduxThunk2 = _interopRequireDefault(_reduxThunk); var _documents = __webpack_require__(908); var _documents2 = _interopRequireDefault(_documents); var _queries2 = _interopRequireDefault(_queries); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var StoreProxy = exports.StoreProxy = function () { function StoreProxy(state) { (0, _classCallCheck3.default)(this, StoreProxy); this.state = state; } (0, _createClass3.default)(StoreProxy, [{ key: 'readDocument', value: function readDocument(doctype, id) { return this.state.documents[doctype][id]; } }, { key: 'writeDocument', value: function writeDocument(document) { this.setState(function (state) { return (0, _extends5.default)({}, state, { documents: (0, _extends5.default)({}, state.documents, (0, _defineProperty3.default)({}, document._type, (0, _extends5.default)({}, state.documents[document._type], (0, _defineProperty3.default)({}, document._id, document)))) }); }); } }, { key: 'setState', value: function setState(updaterFn) { this.state = updaterFn(this.state); } }, { key: 'getState', value: function getState() { return this.state; } }]); return StoreProxy; }(); var combinedReducer = function combinedReducer() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { documents: {}, queries: {} }; var action = arguments[1]; if (!(0, _queries.isQueryAction)(action) && !(0, _mutations.isMutationAction)(action)) { return state; } if (action.update) { var proxy = new StoreProxy(state); action.update(proxy, action.response); return { documents: proxy.getState().documents, queries: (0, _queries2.default)(proxy.getState().queries, action, proxy.getState().documents) }; } var nextDocuments = (0, _documents2.default)(state.documents, action); var haveDocumentsChanged = nextDocuments !== state.documents; return { documents: nextDocuments, queries: (0, _queries2.default)(state.queries, action, nextDocuments, haveDocumentsChanged) }; }; exports.default = combinedReducer; var createStore = exports.createStore = function createStore() { return (0, _redux.createStore)((0, _redux.combineReducers)({ cozy: combinedReducer }), (0, _redux.applyMiddleware)(_reduxThunk2.default)); }; var getStateRoot = exports.getStateRoot = function getStateRoot(state) { return state.cozy || {}; }; var getCollectionFromState = exports.getCollectionFromState = function getCollectionFromState(state, doctype) { return (0, _documents.getCollectionFromSlice)(getStateRoot(state).documents, doctype); }; var getDocumentFromState = exports.getDocumentFromState = function getDocumentFromState(state, doctype, id) { return (0, _documents.getDocumentFromSlice)(getStateRoot(state).documents, doctype, id); }; var getQueryFromStore = exports.getQueryFromStore = function getQueryFromStore(store, queryId) { return getQueryFromState(store.getState(), queryId); }; var getQueryFromState = exports.getQueryFromState = function getQueryFromState(state, queryId) { return (0, _queries.getQueryFromSlice)(getStateRoot(state).queries, queryId, getStateRoot(state).documents); }; var getRawQueryFromState = exports.getRawQueryFromState = function getRawQueryFromState(state, queryId) { return (0, _queries.getQueryFromSlice)(getStateRoot(state).queries, queryId); }; /***/ }), /* 900 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getQueryFromSlice = exports.receiveQueryError = exports.receiveQueryResult = exports.initQuery = exports.convert$gtNullSelectors = exports.isReceivingData = exports.isQueryAction = undefined; var _defineProperty2 = __webpack_require__(895); var _defineProperty3 = _interopRequireDefault(_defineProperty2); var _entries = __webpack_require__(729); var _entries2 = _interopRequireDefault(_entries); var _getIterator2 = __webpack_require__(796); var _getIterator3 = _interopRequireDefault(_getIterator2); var _slicedToArray2 = __webpack_require__(788); var _slicedToArray3 = _interopRequireDefault(_slicedToArray2); var _toConsumableArray2 = __webpack_require__(842); var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2); var _extends3 = __webpack_require__(843); var _extends4 = _interopRequireDefault(_extends3); var _mapValues = __webpack_require__(901); var _mapValues2 = _interopRequireDefault(_mapValues); var _union = __webpack_require__(902); var _union2 = _interopRequireDefault(_union); var _difference = __webpack_require__(903); var _difference2 = _interopRequireDefault(_difference); var _intersection = __webpack_require__(905); var _intersection2 = _interopRequireDefault(_intersection); var _isPlainObject = __webpack_require__(538); var _isPlainObject2 = _interopRequireDefault(_isPlainObject); var _documents = __webpack_require__(908); var _mutations = __webpack_require__(909); var _helpers = __webpack_require__(915); var _sift = __webpack_require__(916); var _sift2 = _interopRequireDefault(_sift); var _get = __webpack_require__(571); var _get2 = _interopRequireDefault(_get); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var INIT_QUERY = 'INIT_QUERY'; var RECEIVE_QUERY_RESULT = 'RECEIVE_QUERY_RESULT'; var RECEIVE_QUERY_ERROR = 'RECEIVE_QUERY_ERROR'; var isQueryAction = exports.isQueryAction = function isQueryAction(action) { return [INIT_QUERY, RECEIVE_QUERY_RESULT, RECEIVE_QUERY_ERROR].indexOf(action.type) !== -1; }; var isReceivingData = exports.isReceivingData = function isReceivingData(action) { return action.type === RECEIVE_QUERY_RESULT; }; // reducers var queryInitialState = { id: null, definition: null, fetchStatus: 'pending', lastFetch: null, lastUpdate: null, lastError: null, hasMore: false, count: 0, data: [] }; var query = function query() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : queryInitialState; var action = arguments[1]; switch (action.type) { case INIT_QUERY: return (0, _extends4.default)({}, state, { id: action.queryId, definition: action.queryDefinition, fetchStatus: 'loading' }); case RECEIVE_QUERY_RESULT: { var response = action.response; var common = { fetchStatus: 'loaded', lastFetch: Date.now(), lastUpdate: Date.now() }; if (!response.data) { return state; } if (!Array.isArray(response.data)) { return (0, _extends4.default)({}, state, common, { hasMore: false, count: 1, data: [(0, _helpers.properId)(response.data)] }); } return (0, _extends4.default)({}, state, common, { hasMore: response.next !== undefined ? response.next : state.hasMore, count: response.meta && response.meta.count ? response.meta.count : response.data.length, data: response.skip === 0 ? response.data.map(_helpers.properId) : [].concat((0, _toConsumableArray3.default)(state.data), (0, _toConsumableArray3.default)(response.data.map(_helpers.properId))) }); } case RECEIVE_QUERY_ERROR: return (0, _extends4.default)({}, state, { id: action.queryId, fetchStatus: 'failed', lastError: action.error }); default: return state; } }; var convert$gtNullSelectors = exports.convert$gtNullSelectors = function convert$gtNullSelectors(selector) { var result = {}; var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = (0, _getIterator3.default)((0, _entries2.default)(selector)), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var _ref = _step.value; var _ref2 = (0, _slicedToArray3.default)(_ref, 2); var key = _ref2[0]; var value = _ref2[1]; var convertedValue = (0, _isPlainObject2.default)(value) ? convert$gtNullSelectors(value) : value; var convertedKey = key === '$gt' && convertedValue === null ? '$gtnull' : key; result[convertedKey] = convertedValue; } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } return result; }; var getSelectorFilterFn = function getSelectorFilterFn(queryDefinition) { if (queryDefinition.selector) { // sift does not work like couchdb when using { $gt: null } as a selector, so we use a custom operator _sift2.default.use({ $gtnull: function $gtnull(selectorValue, actualValue) { return !!actualValue; } }); return (0, _sift2.default)(convert$gtNullSelectors(queryDefinition.selector)); } else if (queryDefinition.id) { return (0, _sift2.default)({ _id: queryDefinition.id }); } else { return null; } }; var getQueryDocumentsChecker = function getQueryDocumentsChecker(query) { var qdoctype = query.definition.doctype; var selectorFilterFn = getSelectorFilterFn(query.definition); return function (datum) { var ddoctype = datum._type; if (ddoctype !== qdoctype) return false; if (selectorFilterFn && !selectorFilterFn(datum)) { return false; } if (datum._deleted) return false; return true; }; }; var updateData = function updateData(query, newData) { var isFulfilled = getQueryDocumentsChecker(query); var matchedIds = newData.filter(function (doc) { return isFulfilled(doc); }).map(_helpers.properId); var unmatchedIds = newData.filter(function (doc) { return !isFulfilled(doc); }).map(_helpers.properId); var originalIds = query.data; var toRemove = (0, _intersection2.default)(originalIds, unmatchedIds); var toAdd = (0, _difference2.default)(matchedIds, originalIds); var toUpdate = (0, _intersection2.default)(originalIds, matchedIds); var changed = toRemove.length || toAdd.length || toUpdate.length; var updatedData = (0, _difference2.default)((0, _union2.default)(originalIds, toAdd), toRemove); return (0, _extends4.default)({}, query, { data: updatedData, count: updatedData.length, lastUpdate: changed ? Date.now() : query.lastUpdate }); }; var autoQueryUpdater = function autoQueryUpdater(action) { return function (query) { var data = (0, _get2.default)(action, 'response.data') || (0, _get2.default)(action, 'definition.document'); if (!data) return query; if (!Array.isArray(data)) { data = [data]; } if (!data.length) { return query; } if (query.definition.doctype !== data[0]._type) { return query; } return updateData(query, data); }; }; var manualQueryUpdater = function manualQueryUpdater(action, documents) { return function (query) { var updateQueries = action.updateQueries; var response = action.response; var updater = updateQueries[query.id]; if (!updater) { return query; } var doctype = query.definition.doctype; var oldData = query.data; var oldDocs = mapIdsToDocuments(documents, doctype, oldData); var newData = updater(oldDocs, response); var newDataIds = newData.map(_helpers.properId); return (0, _extends4.default)({}, query, { data: newDataIds, count: newDataIds.length, lastUpdate: Date.now() }); }; }; var queries = function queries() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var action = arguments[1]; var nextDocuments = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var haveDocumentsChanged = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; if (action.type == INIT_QUERY) { return (0, _extends4.default)({}, state, (0, _defineProperty3.default)({}, action.queryId, query(state[action.queryId], action))); } if (isQueryAction(action)) { var updater = autoQueryUpdater(action); return (0, _mapValues2.default)(state, function (queryState) { if (queryState.id == action.queryId) { return query(queryState, action); } else if (haveDocumentsChanged) { return updater(queryState); } else { return queryState; } }); } if ((0, _mutations.isReceivingMutationResult)(action)) { var _updater = action.updateQueries ? manualQueryUpdater(action, nextDocuments) : autoQueryUpdater(action); return (0, _mapValues2.default)(state, _updater); } return state; }; exports.default = queries; // actions var initQuery = exports.initQuery = function initQuery(queryId, queryDefinition) { if (!queryDefinition.doctype) { throw new Error('Cannot init query with no doctype'); } return { type: INIT_QUERY, queryId: queryId, queryDefinition: queryDefinition }; }; var receiveQueryResult = exports.receiveQueryResult = function receiveQueryResult(queryId, response) { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; return (0, _extends4.default)({ type: RECEIVE_QUERY_RESULT, queryId: queryId, response: response }, options); }; var receiveQueryError = exports.receiveQueryError = function receiveQueryError(queryId, error) { return { type: RECEIVE_QUERY_ERROR, queryId: queryId, error: error }; }; // selectors var mapIdsToDocuments = function mapIdsToDocuments(documents, doctype, ids) { return ids.map(function (id) { return (0, _documents.getDocumentFromSlice)(documents, doctype, id); }); }; var getQueryFromSlice = exports.getQueryFromSlice = function getQueryFromSlice(state, queryId, documents) { if (!state || !state[queryId]) { return (0, _extends4.default)({}, queryInitialState, { data: null }); } var query = state[queryId]; return documents ? (0, _extends4.default)({}, query, { data: mapIdsToDocuments(documents, query.definition.doctype, query.data) }) : query; }; /***/ }), /* 901 */ /***/ (function(module, exports, __webpack_require__) { var baseAssignValue = __webpack_require__(366), baseForOwn = __webpack_require__(460), baseIteratee = __webpack_require__(543); /** * Creates an object with the same keys as `object` and values generated * by running each own enumerable string keyed property of `object` thru * `iteratee`. The iteratee is invoked with three arguments: * (value, key, object). * * @static * @memberOf _ * @since 2.4.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns the new mapped object. * @see _.mapKeys * @example * * var users = { * 'fred': { 'user': 'fred', 'age': 40 }, * 'pebbles': { 'user': 'pebbles', 'age': 1 } * }; * * _.mapValues(users, function(o) { return o.age; }); * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) * * // The `_.property` iteratee shorthand. * _.mapValues(users, 'age'); * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) */ function mapValues(object, iteratee) { var result = {}; iteratee = baseIteratee(iteratee, 3); baseForOwn(object, function(value, key, object) { baseAssignValue(result, key, iteratee(value, key, object)); }); return result; } module.exports = mapValues; /***/ }), /* 902 */ /***/ (function(module, exports, __webpack_require__) { var baseFlatten = __webpack_require__(599), baseRest = __webpack_require__(377), baseUniq = __webpack_require__(613), isArrayLikeObject = __webpack_require__(537); /** * Creates an array of unique values, in order, from all given arrays using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @returns {Array} Returns the new array of combined values. * @example * * _.union([2], [1, 2]); * // => [2, 1] */ var union = baseRest(function(arrays) { return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); }); module.exports = union; /***/ }), /* 903 */ /***/ (function(module, exports, __webpack_require__) { var baseDifference = __webpack_require__(904), baseFlatten = __webpack_require__(599), baseRest = __webpack_require__(377), isArrayLikeObject = __webpack_require__(537); /** * Creates an array of `array` values not included in the other given arrays * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. The order and references of result values are * determined by the first array. * * **Note:** Unlike `_.pullAll`, this method returns a new array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. * @returns {Array} Returns the new array of filtered values. * @see _.without, _.xor * @example * * _.difference([2, 1], [2, 3]); * // => [1] */ var difference = baseRest(function(array, values) { return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) : []; }); module.exports = difference; /***/ }), /* 904 */ /***/ (function(module, exports, __webpack_require__) { var SetCache = __webpack_require__(549), arrayIncludes = __webpack_require__(444), arrayIncludesWith = __webpack_require__(614), arrayMap = __webpack_require__(580), baseUnary = __webpack_require__(399), cacheHas = __webpack_require__(552); /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; /** * The base implementation of methods like `_.difference` without support * for excluding multiple arrays or iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Array} values The values to exclude. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of filtered values. */ function baseDifference(array, values, iteratee, comparator) { var index = -1, includes = arrayIncludes, isCommon = true, length = array.length, result = [], valuesLength = values.length; if (!length) { return result; } if (iteratee) { values = arrayMap(values, baseUnary(iteratee)); } if (comparator) { includes = arrayIncludesWith; isCommon = false; } else if (values.length >= LARGE_ARRAY_SIZE) { includes = cacheHas; isCommon = false; values = new SetCache(values); } outer: while (++index < length) { var value = array[index], computed = iteratee == null ? value : iteratee(value); value = (comparator || value !== 0) ? value : 0; if (isCommon && computed === computed) { var valuesIndex = valuesLength; while (valuesIndex--) { if (values[valuesIndex] === computed) { continue outer; } } result.push(value); } else if (!includes(values, computed, comparator)) { result.push(value); } } return result; } module.exports = baseDifference; /***/ }), /* 905 */ /***/ (function(module, exports, __webpack_require__) { var arrayMap = __webpack_require__(580), baseIntersection = __webpack_require__(906), baseRest = __webpack_require__(377), castArrayLikeObject = __webpack_require__(907); /** * Creates an array of unique values that are included in all given arrays * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. The order and references of result values are * determined by the first array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @returns {Array} Returns the new array of intersecting values. * @example * * _.intersection([2, 1], [2, 3]); * // => [2] */ var intersection = baseRest(function(arrays) { var mapped = arrayMap(arrays, castArrayLikeObject); return (mapped.length && mapped[0] === arrays[0]) ? baseIntersection(mapped) : []; }); module.exports = intersection; /***/ }), /* 906 */ /***/ (function(module, exports, __webpack_require__) { var SetCache = __webpack_require__(549), arrayIncludes = __webpack_require__(444), arrayIncludesWith = __webpack_require__(614), arrayMap = __webpack_require__(580), baseUnary = __webpack_require__(399), cacheHas = __webpack_require__(552); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMin = Math.min; /** * The base implementation of methods like `_.intersection`, without support * for iteratee shorthands, that accepts an array of arrays to inspect. * * @private * @param {Array} arrays The arrays to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of shared values. */ function baseIntersection(arrays, iteratee, comparator) { var includes = comparator ? arrayIncludesWith : arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array(othLength), maxLength = Infinity, result = []; while (othIndex--) { var array = arrays[othIndex]; if (othIndex && iteratee) { array = arrayMap(array, baseUnary(iteratee)); } maxLength = nativeMin(array.length, maxLength); caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) ? new SetCache(othIndex && array) : undefined; } array = arrays[0]; var index = -1, seen = caches[0]; outer: while (++index < length && result.length < maxLength) { var value = array[index], computed = iteratee ? iteratee(value) : value; value = (comparator || value !== 0) ? value : 0; if (!(seen ? cacheHas(seen, computed) : includes(result, computed, comparator) )) { othIndex = othLength; while (--othIndex) { var cache = caches[othIndex]; if (!(cache ? cacheHas(cache, computed) : includes(arrays[othIndex], computed, comparator)) ) { continue outer; } } if (seen) { seen.push(computed); } result.push(value); } } return result; } module.exports = baseIntersection; /***/ }), /* 907 */ /***/ (function(module, exports, __webpack_require__) { var isArrayLikeObject = __webpack_require__(537); /** * Casts `value` to an empty array if it's not an array like object. * * @private * @param {*} value The value to inspect. * @returns {Array|Object} Returns the cast array-like object. */ function castArrayLikeObject(value) { return isArrayLikeObject(value) ? value : []; } module.exports = castArrayLikeObject; /***/ }), /* 908 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.extractAndMergeDocument = exports.getCollectionFromSlice = exports.getDocumentFromSlice = exports.mergeDocumentsWithRelationships = undefined; var _values = __webpack_require__(839); var _values2 = _interopRequireDefault(_values); var _defineProperty2 = __webpack_require__(895); var _defineProperty3 = _interopRequireDefault(_defineProperty2); var _extends4 = __webpack_require__(843); var _extends5 = _interopRequireDefault(_extends4); var _queries = __webpack_require__(900); var _mutations = __webpack_require__(909); var _keyBy = __webpack_require__(910); var _keyBy2 = _interopRequireDefault(_keyBy); var _get = __webpack_require__(571); var _get2 = _interopRequireDefault(_get); var _isEqual = __webpack_require__(914); var _isEqual2 = _interopRequireDefault(_isEqual); var _helpers = __webpack_require__(915); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var storeDocument = function storeDocument(state, document) { var type = document._type; if (!type) { if (true) { console.warn('Document without _type', document); } throw new Error('Document without _type'); } if (!(0, _helpers.properId)(document)) { if (true) { console.warn('Document without id', document); } throw new Error('Document without id'); } var existingDoc = (0, _get2.default)(state, [type, (0, _helpers.properId)(document)]); if ((0, _isEqual2.default)(existingDoc, document)) { return state; } else { return (0, _extends5.default)({}, state, (0, _defineProperty3.default)({}, type, (0, _extends5.default)({}, state[type], (0, _defineProperty3.default)({}, (0, _helpers.properId)(document), mergeDocumentsWithRelationships(existingDoc, document))))); } }; var mergeDocumentsWithRelationships = exports.mergeDocumentsWithRelationships = function mergeDocumentsWithRelationships() { var prevDocument = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var nextDocument = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var merged = (0, _extends5.default)({}, prevDocument, nextDocument); if (prevDocument.relationships || nextDocument.relationships) merged.relationships = (0, _extends5.default)({}, prevDocument.relationships, nextDocument.relationships); return merged; }; // reducer var documents = function documents() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var action = arguments[1]; if (!(0, _queries.isReceivingData)(action) && !(0, _mutations.isReceivingMutationResult)(action)) { return state; } var _action$response = action.response, data = _action$response.data, included = _action$response.included; if (!data || Array.isArray(data) && data.length === 0) return state; var updatedStateWithIncluded = included ? included.reduce(storeDocument, state) : state; if (!Array.isArray(data)) { return storeDocument(updatedStateWithIncluded, data); } return extractAndMergeDocument(data, updatedStateWithIncluded); }; exports.default = documents; // selector var getDocumentFromSlice = exports.getDocumentFromSlice = function getDocumentFromSlice() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var doctype = arguments[1]; var id = arguments[2]; if (!doctype) { throw new Error('getDocumentFromSlice: Cannot retrieve document with undefined doctype'); } if (!id) { throw new Error('getDocumentFromSlice: Cannot retrieve document with undefined id'); } if (!state[doctype]) { if (true) { console.warn('getDocumentFromSlice: ' + doctype + ' is absent from the store\'s documents. State is', state); } return null; } else if (!state[doctype][id]) { if (true) { console.warn('getDocumentFromSlice: ' + doctype + ':' + id + ' is absent from the store documents. State is', state); } return null; } return state[doctype][id]; }; var getCollectionFromSlice = exports.getCollectionFromSlice = function getCollectionFromSlice() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var doctype = arguments[1]; if (!doctype) { throw new Error('getDocumentFromSlice: Cannot retrieve document with undefined doctype'); } if (!state[doctype]) { if (true) { console.warn('getCollectionFromSlice: ' + doctype + ' is absent from the store documents. State is', state); } return null; } return (0, _values2.default)(state[doctype]); }; /* This method has been created in order to get a returned object in `data` with the full set on information coming potentielly from ìncluded` This method should be somewhere else. The `document` shall not be deal with included / data and so on. This method takes data and included and merge both sources together. It should be always up to date. The returned object will be as full of informations as it can be. */ var extractAndMergeDocument = exports.extractAndMergeDocument = function extractAndMergeDocument(data, updatedStateWithIncluded) { var doctype = data[0]._type; if (!doctype) { throw new Error('Document without _type', data[0]); } var sortedData = (0, _keyBy2.default)(data, _helpers.properId); var mergedData = {}; if (updatedStateWithIncluded && updatedStateWithIncluded[doctype]) { (0, _values2.default)(updatedStateWithIncluded[doctype]).map(function (dataState) { if (!mergedData[doctype]) mergedData[doctype] = {}; var id = (0, _helpers.properId)(dataState); if (sortedData[id]) { mergedData[doctype][id] = (0, _extends5.default)({}, dataState, sortedData[id], mergedData[doctype][id]); } else { mergedData[doctype][id] = (0, _extends5.default)({}, dataState, mergedData[doctype][id]); } }); } (0, _values2.default)(sortedData).map(function (data) { if (!mergedData[doctype]) mergedData[doctype] = {}; var id = (0, _helpers.properId)(data); if (mergedData[doctype][id]) { mergedData[doctype][id] = (0, _extends5.default)({}, mergedData[doctype][id], data); } else { mergedData[doctype][id] = data; } }); return (0, _extends5.default)({}, updatedStateWithIncluded, mergedData); }; /***/ }), /* 909 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.receiveMutationError = exports.receiveMutationResult = exports.initMutation = exports.isReceivingMutationResult = exports.isMutationAction = undefined; var _extends2 = __webpack_require__(843); var _extends3 = _interopRequireDefault(_extends2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var INIT_MUTATION = 'INIT_MUTATION'; var RECEIVE_MUTATION_RESULT = 'RECEIVE_MUTATION_RESULT'; var RECEIVE_MUTATION_ERROR = 'RECEIVE_MUTATION_ERROR'; var isMutationAction = exports.isMutationAction = function isMutationAction(action) { return [INIT_MUTATION, RECEIVE_MUTATION_RESULT, RECEIVE_MUTATION_ERROR].indexOf(action.type) !== -1; }; var isReceivingMutationResult = exports.isReceivingMutationResult = function isReceivingMutationResult(action) { return action.type === RECEIVE_MUTATION_RESULT; }; // actions var initMutation = exports.initMutation = function initMutation(mutationId, definition) { return { type: INIT_MUTATION, mutationId: mutationId, definition: definition }; }; var receiveMutationResult = exports.receiveMutationResult = function receiveMutationResult(mutationId, response) { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var definition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; return (0, _extends3.default)({ type: RECEIVE_MUTATION_RESULT, mutationId: mutationId, response: response }, options, { definition: definition }); }; var receiveMutationError = exports.receiveMutationError = function receiveMutationError(mutationId, error) { var definition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; return { type: RECEIVE_MUTATION_ERROR, mutationId: mutationId, error: error, definition: definition }; }; /***/ }), /* 910 */ /***/ (function(module, exports, __webpack_require__) { var baseAssignValue = __webpack_require__(366), createAggregator = __webpack_require__(911); /** * Creates an object composed of keys generated from the results of running * each element of `collection` thru `iteratee`. The corresponding value of * each key is the last element responsible for generating the key. The * iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * * var array = [ * { 'dir': 'left', 'code': 97 }, * { 'dir': 'right', 'code': 100 } * ]; * * _.keyBy(array, function(o) { * return String.fromCharCode(o.code); * }); * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } * * _.keyBy(array, 'dir'); * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } */ var keyBy = createAggregator(function(result, value, key) { baseAssignValue(result, key, value); }); module.exports = keyBy; /***/ }), /* 911 */ /***/ (function(module, exports, __webpack_require__) { var arrayAggregator = __webpack_require__(912), baseAggregator = __webpack_require__(913), baseIteratee = __webpack_require__(543), isArray = __webpack_require__(75); /** * Creates a function like `_.groupBy`. * * @private * @param {Function} setter The function to set accumulator values. * @param {Function} [initializer] The accumulator object initializer. * @returns {Function} Returns the new aggregator function. */ function createAggregator(setter, initializer) { return function(collection, iteratee) { var func = isArray(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {}; return func(collection, setter, baseIteratee(iteratee, 2), accumulator); }; } module.exports = createAggregator; /***/ }), /* 912 */ /***/ (function(module, exports) { /** * A specialized version of `baseAggregator` for arrays. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} setter The function to set `accumulator` values. * @param {Function} iteratee The iteratee to transform keys. * @param {Object} accumulator The initial aggregated object. * @returns {Function} Returns `accumulator`. */ function arrayAggregator(array, setter, iteratee, accumulator) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { var value = array[index]; setter(accumulator, value, iteratee(value), array); } return accumulator; } module.exports = arrayAggregator; /***/ }), /* 913 */ /***/ (function(module, exports, __webpack_require__) { var baseEach = __webpack_require__(459); /** * Aggregates elements of `collection` on `accumulator` with keys transformed * by `iteratee` and values set by `setter`. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} setter The function to set `accumulator` values. * @param {Function} iteratee The iteratee to transform keys. * @param {Object} accumulator The initial aggregated object. * @returns {Function} Returns `accumulator`. */ function baseAggregator(collection, setter, iteratee, accumulator) { baseEach(collection, function(value, key, collection) { setter(accumulator, value, iteratee(value), collection); }); return accumulator; } module.exports = baseAggregator; /***/ }), /* 914 */ /***/ (function(module, exports, __webpack_require__) { var baseIsEqual = __webpack_require__(546); /** * Performs a deep comparison between two values to determine if they are * equivalent. * * **Note:** This method supports comparing arrays, array buffers, booleans, * date objects, error objects, maps, numbers, `Object` objects, regexes, * sets, strings, symbols, and typed arrays. `Object` objects are compared * by their own, not inherited, enumerable properties. Functions and DOM * nodes are compared by strict equality, i.e. `===`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.isEqual(object, other); * // => true * * object === other; * // => false */ function isEqual(value, other) { return baseIsEqual(value, other); } module.exports = isEqual; /***/ }), /* 915 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var properId = exports.properId = function properId(doc) { return doc.id || doc._id; }; /***/ }), /* 916 */ /***/ (function(module, exports, __webpack_require__) { /* * Sift 3.x * * Copryright 2015, Craig Condon * Licensed under MIT * * Filter JavaScript objects with mongodb queries */ (function() { 'use strict'; /** */ function isFunction(value) { return typeof value === 'function'; } /** */ function isArray(value) { return Object.prototype.toString.call(value) === '[object Array]'; } /** */ function comparable(value) { if (value instanceof Date) { return value.getTime(); } else if (isArray(value)) { return value.map(comparable); } else if (value && typeof value.toJSON === 'function') { return value.toJSON(); } else { return value; } } function get(obj, key) { return isFunction(obj.get) ? obj.get(key) : obj[key]; } /** */ function or(validator) { return function(a, b) { if (!isArray(b) || !b.length) { return validator(a, b); } for (var i = 0, n = b.length; i < n; i++) { if (validator(a, get(b,i))) return true; } return false; } } /** */ function and(validator) { return function(a, b) { if (!isArray(b) || !b.length) { return validator(a, b); } for (var i = 0, n = b.length; i < n; i++) { if (!validator(a, get(b, i))) return false; } return true; }; } function validate(validator, b, k, o) { return validator.v(validator.a, b, k, o); } var OPERATORS = { /** */ $eq: or(function(a, b) { return a(b); }), /** */ $ne: and(function(a, b) { return !a(b); }), /** */ $gt: or(function(a, b) { return sift.compare(comparable(b), a) > 0; }), /** */ $gte: or(function(a, b) { return sift.compare(comparable(b), a) >= 0; }), /** */ $lt: or(function(a, b) { return sift.compare(comparable(b), a) < 0; }), /** */ $lte: or(function(a, b) { return sift.compare(comparable(b), a) <= 0; }), /** */ $mod: or(function(a, b) { return b % a[0] == a[1]; }), /** */ $in: function(a, b) { if (b instanceof Array) { for (var i = b.length; i--;) { if (~a.indexOf(comparable(get(b, i)))) { return true; } } } else { var comparableB = comparable(b); if (comparableB === b && typeof b === 'object') { for (var i = a.length; i--;) { if (String(a[i]) === String(b) && String(b) !== '[object Object]') { return true; } } } /* Handles documents that are undefined, whilst also having a 'null' element in the parameters to $in. */ if (typeof comparableB == 'undefined') { for (var i = a.length; i--;) { if (a[i] == null) { return true; } } } /* Handles the case of {'field': {$in: [/regexp1/, /regexp2/, ...]}} */ for (var i = a.length; i--;) { var validator = createRootValidator(get(a, i), undefined); var result = validate(validator, b, i, a); if ((result) && (String(result) !== '[object Object]') && (String(b) !== '[object Object]')) { return true; } } return !!~a.indexOf(comparableB); } return false; }, /** */ $nin: function(a, b, k, o) { return !OPERATORS.$in(a, b, k, o); }, /** */ $not: function(a, b, k, o) { return !validate(a, b, k, o); }, /** */ $type: function(a, b) { return b != void 0 ? b instanceof a || b.constructor == a : false; }, /** */ $all: function(a, b, k, o) { return OPERATORS.$and(a, b, k, o); }, /** */ $size: function(a, b) { return b ? a === b.length : false; }, /** */ $or: function(a, b, k, o) { for (var i = 0, n = a.length; i < n; i++) if (validate(get(a, i), b, k, o)) return true; return false; }, /** */ $nor: function(a, b, k, o) { return !OPERATORS.$or(a, b, k, o); }, /** */ $and: function(a, b, k, o) { for (var i = 0, n = a.length; i < n; i++) { if (!validate(get(a, i), b, k, o)) { return false; } } return true; }, /** */ $regex: or(function(a, b) { return typeof b === 'string' && a.test(b); }), /** */ $where: function(a, b, k, o) { return a.call(b, b, k, o); }, /** */ $elemMatch: function(a, b, k, o) { if (isArray(b)) { return !!~search(b, a); } return validate(a, b, k, o); }, /** */ $exists: function(a, b, k, o) { return o.hasOwnProperty(k) === a; } }; /** */ var prepare = { /** */ $eq: function(a) { if (a instanceof RegExp) { return function(b) { return typeof b === 'string' && a.test(b); }; } else if (a instanceof Function) { return a; } else if (isArray(a) && !a.length) { // Special case of a == [] return function(b) { return (isArray(b) && !b.length); }; } else if (a === null){ return function(b){ //will match both null and undefined return b == null; } } return function(b) { return sift.compare(comparable(b), a) === 0; }; }, /** */ $ne: function(a) { return prepare.$eq(a); }, /** */ $and: function(a) { return a.map(parse); }, /** */ $all: function(a) { return prepare.$and(a); }, /** */ $or: function(a) { return a.map(parse); }, /** */ $nor: function(a) { return a.map(parse); }, /** */ $not: function(a) { return parse(a); }, /** */ $regex: function(a, query) { return new RegExp(a, query.$options); }, /** */ $where: function(a) { return typeof a === 'string' ? new Function('obj', 'return ' + a) : a; }, /** */ $elemMatch: function(a) { return parse(a); }, /** */ $exists: function(a) { return !!a; } }; /** */ function search(array, validator) { for (var i = 0; i < array.length; i++) { var result = get(array, i); if (validate(validator, get(array, i))) { return i; } } return -1; } /** */ function createValidator(a, validate) { return { a: a, v: validate }; } /** */ function nestedValidator(a, b) { var values = []; findValues(b, a.k, 0, b, values); if (values.length === 1) { var first = values[0]; return validate(a.nv, first[0], first[1], first[2]); } // If the query contains $ne, need to test all elements ANDed together var inclusive = a && a.q && typeof a.q.$ne !== 'undefined'; var allValid = inclusive; for (var i = 0; i < values.length; i++) { var result = values[i]; var isValid = validate(a.nv, result[0], result[1], result[2]); if (inclusive) { allValid &= isValid; } else { allValid |= isValid; } } return allValid; } /** */ function findValues(current, keypath, index, object, values) { if (index === keypath.length || current == void 0) { values.push([current, keypath[index - 1], object]); return; } var k = get(keypath, index); // ensure that if current is an array, that the current key // is NOT an array index. This sort of thing needs to work: // sift({'foo.0':42}, [{foo: [42]}]); if (isArray(current) && isNaN(Number(k))) { for (var i = 0, n = current.length; i < n; i++) { findValues(get(current, i), keypath, index, current, values); } } else { findValues(get(current, k), keypath, index + 1, current, values); } } /** */ function createNestedValidator(keypath, a, q) { return { a: { k: keypath, nv: a, q: q }, v: nestedValidator }; } /** * flatten the query */ function isVanillaObject(value) { return value && value.constructor === Object; } function parse(query) { query = comparable(query); if (!query || !isVanillaObject(query)) { // cross browser support query = { $eq: query }; } var validators = []; for (var key in query) { var a = query[key]; if (key === '$options') { continue; } if (OPERATORS[key]) { if (prepare[key]) a = prepare[key](a, query); validators.push(createValidator(comparable(a), OPERATORS[key])); } else { if (key.charCodeAt(0) === 36) { throw new Error('Unknown operation ' + key); } validators.push(createNestedValidator(key.split('.'), parse(a), a)); } } return validators.length === 1 ? validators[0] : createValidator(validators, OPERATORS.$and); } /** */ function createRootValidator(query, getter) { var validator = parse(query); if (getter) { validator = { a: validator, v: function(a, b, k, o) { return validate(a, getter(b), k, o); } }; } return validator; } /** */ function sift(query, array, getter) { if (isFunction(array)) { getter = array; array = void 0; } var validator = createRootValidator(query, getter); function filter(b, k, o) { return validate(validator, b, k, o); } if (array) { return array.filter(filter); } return filter; } /** */ sift.use = function(plugin) { if (isFunction(plugin)) return plugin(sift); for (var key in plugin) { /* istanbul ignore else */ if (key.charCodeAt(0) === 36) { OPERATORS[key] = plugin[key]; } } }; /** */ sift.indexOf = function(query, array, getter) { return search(array, createRootValidator(query, getter)); }; /** */ sift.compare = function(a, b) { if(a===b) return 0; if(typeof a === typeof b) { if (a > b) { return 1; } if (a < b) { return -1; } } }; /* istanbul ignore next */ if ( true && typeof module.exports !== 'undefined') { Object.defineProperty(exports, "__esModule", { value: true }); module.exports = sift; exports['default'] = module.exports.default = sift; } /* istanbul ignore next */ if (typeof window !== 'undefined') { window.sift = sift; } })(); /***/ }), /* 917 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _createStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(918); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createStore", function() { return _createStore__WEBPACK_IMPORTED_MODULE_0__["default"]; }); /* harmony import */ var _combineReducers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(932); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "combineReducers", function() { return _combineReducers__WEBPACK_IMPORTED_MODULE_1__["default"]; }); /* harmony import */ var _bindActionCreators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(934); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bindActionCreators", function() { return _bindActionCreators__WEBPACK_IMPORTED_MODULE_2__["default"]; }); /* harmony import */ var _applyMiddleware__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(935); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "applyMiddleware", function() { return _applyMiddleware__WEBPACK_IMPORTED_MODULE_3__["default"]; }); /* harmony import */ var _compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(936); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return _compose__WEBPACK_IMPORTED_MODULE_4__["default"]; }); /* harmony import */ var _utils_warning__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(933); /* * This is a dummy function to check if the function name has been altered by minification. * If the function has been minified and NODE_ENV !== 'production', warn the user. */ function isCrushed() {} if ( true && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') { Object(_utils_warning__WEBPACK_IMPORTED_MODULE_5__["default"])('You are currently using minified code outside of NODE_ENV === \'production\'. ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) ' + 'to ensure you have the correct code for your production build.'); } /***/ }), /* 918 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ActionTypes", function() { return ActionTypes; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return createStore; }); /* harmony import */ var lodash_es_isPlainObject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(919); /* harmony import */ var symbol_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(929); /** * These are private action types reserved by Redux. * For any unknown actions, you must return the current state. * If the current state is undefined, you must return the initial state. * Do not reference these action types directly in your code. */ var ActionTypes = { INIT: '@@redux/INIT' /** * Creates a Redux store that holds the state tree. * The only way to change the data in the store is to call `dispatch()` on it. * * There should only be a single store in your app. To specify how different * parts of the state tree respond to actions, you may combine several reducers * into a single reducer function by using `combineReducers`. * * @param {Function} reducer A function that returns the next state tree, given * the current state tree and the action to handle. * * @param {any} [preloadedState] The initial state. You may optionally specify it * to hydrate the state from the server in universal apps, or to restore a * previously serialized user session. * If you use `combineReducers` to produce the root reducer function, this must be * an object with the same shape as `combineReducers` keys. * * @param {Function} [enhancer] The store enhancer. You may optionally specify it * to enhance the store with third-party capabilities such as middleware, * time travel, persistence, etc. The only store enhancer that ships with Redux * is `applyMiddleware()`. * * @returns {Store} A Redux store that lets you read the state, dispatch actions * and subscribe to changes. */ };function createStore(reducer, preloadedState, enhancer) { var _ref2; if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') { enhancer = preloadedState; preloadedState = undefined; } if (typeof enhancer !== 'undefined') { if (typeof enhancer !== 'function') { throw new Error('Expected the enhancer to be a function.'); } return enhancer(createStore)(reducer, preloadedState); } if (typeof reducer !== 'function') { throw new Error('Expected the reducer to be a function.'); } var currentReducer = reducer; var currentState = preloadedState; var currentListeners = []; var nextListeners = currentListeners; var isDispatching = false; function ensureCanMutateNextListeners() { if (nextListeners === currentListeners) { nextListeners = currentListeners.slice(); } } /** * Reads the state tree managed by the store. * * @returns {any} The current state tree of your application. */ function getState() { return currentState; } /** * Adds a change listener. It will be called any time an action is dispatched, * and some part of the state tree may potentially have changed. You may then * call `getState()` to read the current state tree inside the callback. * * You may call `dispatch()` from a change listener, with the following * caveats: * * 1. The subscriptions are snapshotted just before every `dispatch()` call. * If you subscribe or unsubscribe while the listeners are being invoked, this * will not have any effect on the `dispatch()` that is currently in progress. * However, the next `dispatch()` call, whether nested or not, will use a more * recent snapshot of the subscription list. * * 2. The listener should not expect to see all state changes, as the state * might have been updated multiple times during a nested `dispatch()` before * the listener is called. It is, however, guaranteed that all subscribers * registered before the `dispatch()` started will be called with the latest * state by the time it exits. * * @param {Function} listener A callback to be invoked on every dispatch. * @returns {Function} A function to remove this change listener. */ function subscribe(listener) { if (typeof listener !== 'function') { throw new Error('Expected listener to be a function.'); } var isSubscribed = true; ensureCanMutateNextListeners(); nextListeners.push(listener); return function unsubscribe() { if (!isSubscribed) { return; } isSubscribed = false; ensureCanMutateNextListeners(); var index = nextListeners.indexOf(listener); nextListeners.splice(index, 1); }; } /** * Dispatches an action. It is the only way to trigger a state change. * * The `reducer` function, used to create the store, will be called with the * current state tree and the given `action`. Its return value will * be considered the **next** state of the tree, and the change listeners * will be notified. * * The base implementation only supports plain object actions. If you want to * dispatch a Promise, an Observable, a thunk, or something else, you need to * wrap your store creating function into the corresponding middleware. For * example, see the documentation for the `redux-thunk` package. Even the * middleware will eventually dispatch plain object actions using this method. * * @param {Object} action A plain object representing “what changed”. It is * a good idea to keep actions serializable so you can record and replay user * sessions, or use the time travelling `redux-devtools`. An action must have * a `type` property which may not be `undefined`. It is a good idea to use * string constants for action types. * * @returns {Object} For convenience, the same action object you dispatched. * * Note that, if you use a custom middleware, it may wrap `dispatch()` to * return something else (for example, a Promise you can await). */ function dispatch(action) { if (!Object(lodash_es_isPlainObject__WEBPACK_IMPORTED_MODULE_0__["default"])(action)) { throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.'); } if (typeof action.type === 'undefined') { throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?'); } if (isDispatching) { throw new Error('Reducers may not dispatch actions.'); } try { isDispatching = true; currentState = currentReducer(currentState, action); } finally { isDispatching = false; } var listeners = currentListeners = nextListeners; for (var i = 0; i < listeners.length; i++) { var listener = listeners[i]; listener(); } return action; } /** * Replaces the reducer currently used by the store to calculate the state. * * You might need this if your app implements code splitting and you want to * load some of the reducers dynamically. You might also need this if you * implement a hot reloading mechanism for Redux. * * @param {Function} nextReducer The reducer for the store to use instead. * @returns {void} */ function replaceReducer(nextReducer) { if (typeof nextReducer !== 'function') { throw new Error('Expected the nextReducer to be a function.'); } currentReducer = nextReducer; dispatch({ type: ActionTypes.INIT }); } /** * Interoperability point for observable/reactive libraries. * @returns {observable} A minimal observable of state changes. * For more information, see the observable proposal: * https://github.com/tc39/proposal-observable */ function observable() { var _ref; var outerSubscribe = subscribe; return _ref = { /** * The minimal observable subscription method. * @param {Object} observer Any object that can be used as an observer. * The observer object should have a `next` method. * @returns {subscription} An object with an `unsubscribe` method that can * be used to unsubscribe the observable from the store, and prevent further * emission of values from the observable. */ subscribe: function subscribe(observer) { if (typeof observer !== 'object') { throw new TypeError('Expected the observer to be an object.'); } function observeState() { if (observer.next) { observer.next(getState()); } } observeState(); var unsubscribe = outerSubscribe(observeState); return { unsubscribe: unsubscribe }; } }, _ref[symbol_observable__WEBPACK_IMPORTED_MODULE_1__["default"]] = function () { return this; }, _ref; } // When a store is created, an "INIT" action is dispatched so that every // reducer returns their initial state. This effectively populates // the initial state tree. dispatch({ type: ActionTypes.INIT }); return _ref2 = { dispatch: dispatch, subscribe: subscribe, getState: getState, replaceReducer: replaceReducer }, _ref2[symbol_observable__WEBPACK_IMPORTED_MODULE_1__["default"]] = observable, _ref2; } /***/ }), /* 919 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(920); /* harmony import */ var _getPrototype_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(926); /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(928); /** `Object#toString` result references. */ var objectTag = '[object Object]'; /** Used for built-in method references. */ var funcProto = Function.prototype, objectProto = Object.prototype; /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** Used to infer the `Object` constructor. */ var objectCtorString = funcToString.call(Object); /** * Checks if `value` is a plain object, that is, an object created by the * `Object` constructor or one with a `[[Prototype]]` of `null`. * * @static * @memberOf _ * @since 0.8.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. * @example * * function Foo() { * this.a = 1; * } * * _.isPlainObject(new Foo); * // => false * * _.isPlainObject([1, 2, 3]); * // => false * * _.isPlainObject({ 'x': 0, 'y': 0 }); * // => true * * _.isPlainObject(Object.create(null)); * // => true */ function isPlainObject(value) { if (!Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value) || Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) != objectTag) { return false; } var proto = Object(_getPrototype_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value); if (proto === null) { return true; } var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; } /* harmony default export */ __webpack_exports__["default"] = (isPlainObject); /***/ }), /* 920 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(921); /* harmony import */ var _getRawTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(924); /* harmony import */ var _objectToString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(925); /** `Object#toString` result references. */ var nullTag = '[object Null]', undefinedTag = '[object Undefined]'; /** Built-in value references. */ var symToStringTag = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].toStringTag : undefined; /** * The base implementation of `getTag` without fallbacks for buggy environments. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ function baseGetTag(value) { if (value == null) { return value === undefined ? undefinedTag : nullTag; } return (symToStringTag && symToStringTag in Object(value)) ? Object(_getRawTag_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) : Object(_objectToString_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value); } /* harmony default export */ __webpack_exports__["default"] = (baseGetTag); /***/ }), /* 921 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(922); /** Built-in value references. */ var Symbol = _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].Symbol; /* harmony default export */ __webpack_exports__["default"] = (Symbol); /***/ }), /* 922 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _freeGlobal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(923); /** Detect free variable `self`. */ var freeSelf = typeof self == 'object' && self && self.Object === Object && self; /** Used as a reference to the global object. */ var root = _freeGlobal_js__WEBPACK_IMPORTED_MODULE_0__["default"] || freeSelf || Function('return this')(); /* harmony default export */ __webpack_exports__["default"] = (root); /***/ }), /* 923 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /** Detect free variable `global` from Node.js. */ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; /* harmony default export */ __webpack_exports__["default"] = (freeGlobal); /***/ }), /* 924 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(921); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString = objectProto.toString; /** Built-in value references. */ var symToStringTag = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].toStringTag : undefined; /** * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. * * @private * @param {*} value The value to query. * @returns {string} Returns the raw `toStringTag`. */ function getRawTag(value) { var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; try { value[symToStringTag] = undefined; var unmasked = true; } catch (e) {} var result = nativeObjectToString.call(value); if (unmasked) { if (isOwn) { value[symToStringTag] = tag; } else { delete value[symToStringTag]; } } return result; } /* harmony default export */ __webpack_exports__["default"] = (getRawTag); /***/ }), /* 925 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /** Used for built-in method references. */ var objectProto = Object.prototype; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString = objectProto.toString; /** * Converts `value` to a string using `Object.prototype.toString`. * * @private * @param {*} value The value to convert. * @returns {string} Returns the converted string. */ function objectToString(value) { return nativeObjectToString.call(value); } /* harmony default export */ __webpack_exports__["default"] = (objectToString); /***/ }), /* 926 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _overArg_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(927); /** Built-in value references. */ var getPrototype = Object(_overArg_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object.getPrototypeOf, Object); /* harmony default export */ __webpack_exports__["default"] = (getPrototype); /***/ }), /* 927 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /** * Creates a unary function that invokes `func` with its argument transformed. * * @private * @param {Function} func The function to wrap. * @param {Function} transform The argument transform. * @returns {Function} Returns the new function. */ function overArg(func, transform) { return function(arg) { return func(transform(arg)); }; } /* harmony default export */ __webpack_exports__["default"] = (overArg); /***/ }), /* 928 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return value != null && typeof value == 'object'; } /* harmony default export */ __webpack_exports__["default"] = (isObjectLike); /***/ }), /* 929 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* WEBPACK VAR INJECTION */(function(module) {/* harmony import */ var _ponyfill_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(931); /* global window */ var root; if (typeof self !== 'undefined') { root = self; } else if (typeof window !== 'undefined') { root = window; } else if (typeof global !== 'undefined') { root = global; } else if (true) { root = module; } else {} var result = Object(_ponyfill_js__WEBPACK_IMPORTED_MODULE_0__["default"])(root); /* harmony default export */ __webpack_exports__["default"] = (result); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(930)(module))) /***/ }), /* 930 */ /***/ (function(module, exports) { module.exports = function(originalModule) { if (!originalModule.webpackPolyfill) { var module = Object.create(originalModule); // module.parent = undefined by default if (!module.children) module.children = []; Object.defineProperty(module, "loaded", { enumerable: true, get: function() { return module.l; } }); Object.defineProperty(module, "id", { enumerable: true, get: function() { return module.i; } }); Object.defineProperty(module, "exports", { enumerable: true }); module.webpackPolyfill = 1; } return module; }; /***/ }), /* 931 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return symbolObservablePonyfill; }); function symbolObservablePonyfill(root) { var result; var Symbol = root.Symbol; if (typeof Symbol === 'function') { if (Symbol.observable) { result = Symbol.observable; } else { result = Symbol('observable'); Symbol.observable = result; } } else { result = '@@observable'; } return result; }; /***/ }), /* 932 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return combineReducers; }); /* harmony import */ var _createStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(918); /* harmony import */ var lodash_es_isPlainObject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(919); /* harmony import */ var _utils_warning__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(933); function getUndefinedStateErrorMessage(key, action) { var actionType = action && action.type; var actionName = actionType && '"' + actionType.toString() + '"' || 'an action'; return 'Given action ' + actionName + ', reducer "' + key + '" returned undefined. ' + 'To ignore an action, you must explicitly return the previous state. ' + 'If you want this reducer to hold no value, you can return null instead of undefined.'; } function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) { var reducerKeys = Object.keys(reducers); var argumentName = action && action.type === _createStore__WEBPACK_IMPORTED_MODULE_0__["ActionTypes"].INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer'; if (reducerKeys.length === 0) { return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.'; } if (!Object(lodash_es_isPlainObject__WEBPACK_IMPORTED_MODULE_1__["default"])(inputState)) { return 'The ' + argumentName + ' has unexpected type of "' + {}.toString.call(inputState).match(/\s([a-z|A-Z]+)/)[1] + '". Expected argument to be an object with the following ' + ('keys: "' + reducerKeys.join('", "') + '"'); } var unexpectedKeys = Object.keys(inputState).filter(function (key) { return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]; }); unexpectedKeys.forEach(function (key) { unexpectedKeyCache[key] = true; }); if (unexpectedKeys.length > 0) { return 'Unexpected ' + (unexpectedKeys.length > 1 ? 'keys' : 'key') + ' ' + ('"' + unexpectedKeys.join('", "') + '" found in ' + argumentName + '. ') + 'Expected to find one of the known reducer keys instead: ' + ('"' + reducerKeys.join('", "') + '". Unexpected keys will be ignored.'); } } function assertReducerShape(reducers) { Object.keys(reducers).forEach(function (key) { var reducer = reducers[key]; var initialState = reducer(undefined, { type: _createStore__WEBPACK_IMPORTED_MODULE_0__["ActionTypes"].INIT }); if (typeof initialState === 'undefined') { throw new Error('Reducer "' + key + '" returned undefined during initialization. ' + 'If the state passed to the reducer is undefined, you must ' + 'explicitly return the initial state. The initial state may ' + 'not be undefined. If you don\'t want to set a value for this reducer, ' + 'you can use null instead of undefined.'); } var type = '@@redux/PROBE_UNKNOWN_ACTION_' + Math.random().toString(36).substring(7).split('').join('.'); if (typeof reducer(undefined, { type: type }) === 'undefined') { throw new Error('Reducer "' + key + '" returned undefined when probed with a random type. ' + ('Don\'t try to handle ' + _createStore__WEBPACK_IMPORTED_MODULE_0__["ActionTypes"].INIT + ' or other actions in "redux/*" ') + 'namespace. They are considered private. Instead, you must return the ' + 'current state for any unknown actions, unless it is undefined, ' + 'in which case you must return the initial state, regardless of the ' + 'action type. The initial state may not be undefined, but can be null.'); } }); } /** * Turns an object whose values are different reducer functions, into a single * reducer function. It will call every child reducer, and gather their results * into a single state object, whose keys correspond to the keys of the passed * reducer functions. * * @param {Object} reducers An object whose values correspond to different * reducer functions that need to be combined into one. One handy way to obtain * it is to use ES6 `import * as reducers` syntax. The reducers may never return * undefined for any action. Instead, they should return their initial state * if the state passed to them was undefined, and the current state for any * unrecognized action. * * @returns {Function} A reducer function that invokes every reducer inside the * passed object, and builds a state object with the same shape. */ function combineReducers(reducers) { var reducerKeys = Object.keys(reducers); var finalReducers = {}; for (var i = 0; i < reducerKeys.length; i++) { var key = reducerKeys[i]; if (true) { if (typeof reducers[key] === 'undefined') { Object(_utils_warning__WEBPACK_IMPORTED_MODULE_2__["default"])('No reducer provided for key "' + key + '"'); } } if (typeof reducers[key] === 'function') { finalReducers[key] = reducers[key]; } } var finalReducerKeys = Object.keys(finalReducers); var unexpectedKeyCache = void 0; if (true) { unexpectedKeyCache = {}; } var shapeAssertionError = void 0; try { assertReducerShape(finalReducers); } catch (e) { shapeAssertionError = e; } return function combination() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var action = arguments[1]; if (shapeAssertionError) { throw shapeAssertionError; } if (true) { var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache); if (warningMessage) { Object(_utils_warning__WEBPACK_IMPORTED_MODULE_2__["default"])(warningMessage); } } var hasChanged = false; var nextState = {}; for (var _i = 0; _i < finalReducerKeys.length; _i++) { var _key = finalReducerKeys[_i]; var reducer = finalReducers[_key]; var previousStateForKey = state[_key]; var nextStateForKey = reducer(previousStateForKey, action); if (typeof nextStateForKey === 'undefined') { var errorMessage = getUndefinedStateErrorMessage(_key, action); throw new Error(errorMessage); } nextState[_key] = nextStateForKey; hasChanged = hasChanged || nextStateForKey !== previousStateForKey; } return hasChanged ? nextState : state; }; } /***/ }), /* 933 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return warning; }); /** * Prints a warning in the console if it exists. * * @param {String} message The warning message. * @returns {void} */ function warning(message) { /* eslint-disable no-console */ if (typeof console !== 'undefined' && typeof console.error === 'function') { console.error(message); } /* eslint-enable no-console */ try { // This error was thrown as a convenience so that if you enable // "break on all exceptions" in your console, // it would pause the execution at this line. throw new Error(message); /* eslint-disable no-empty */ } catch (e) {} /* eslint-enable no-empty */ } /***/ }), /* 934 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return bindActionCreators; }); function bindActionCreator(actionCreator, dispatch) { return function () { return dispatch(actionCreator.apply(undefined, arguments)); }; } /** * Turns an object whose values are action creators, into an object with the * same keys, but with every function wrapped into a `dispatch` call so they * may be invoked directly. This is just a convenience method, as you can call * `store.dispatch(MyActionCreators.doSomething())` yourself just fine. * * For convenience, you can also pass a single function as the first argument, * and get a function in return. * * @param {Function|Object} actionCreators An object whose values are action * creator functions. One handy way to obtain it is to use ES6 `import * as` * syntax. You may also pass a single function. * * @param {Function} dispatch The `dispatch` function available on your Redux * store. * * @returns {Function|Object} The object mimicking the original object, but with * every action creator wrapped into the `dispatch` call. If you passed a * function as `actionCreators`, the return value will also be a single * function. */ function bindActionCreators(actionCreators, dispatch) { if (typeof actionCreators === 'function') { return bindActionCreator(actionCreators, dispatch); } if (typeof actionCreators !== 'object' || actionCreators === null) { throw new Error('bindActionCreators expected an object or a function, instead received ' + (actionCreators === null ? 'null' : typeof actionCreators) + '. ' + 'Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?'); } var keys = Object.keys(actionCreators); var boundActionCreators = {}; for (var i = 0; i < keys.length; i++) { var key = keys[i]; var actionCreator = actionCreators[key]; if (typeof actionCreator === 'function') { boundActionCreators[key] = bindActionCreator(actionCreator, dispatch); } } return boundActionCreators; } /***/ }), /* 935 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return applyMiddleware; }); /* harmony import */ var _compose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(936); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /** * Creates a store enhancer that applies middleware to the dispatch method * of the Redux store. This is handy for a variety of tasks, such as expressing * asynchronous actions in a concise manner, or logging every action payload. * * See `redux-thunk` package as an example of the Redux middleware. * * Because middleware is potentially asynchronous, this should be the first * store enhancer in the composition chain. * * Note that each middleware will be given the `dispatch` and `getState` functions * as named arguments. * * @param {...Function} middlewares The middleware chain to be applied. * @returns {Function} A store enhancer applying the middleware. */ function applyMiddleware() { for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) { middlewares[_key] = arguments[_key]; } return function (createStore) { return function (reducer, preloadedState, enhancer) { var store = createStore(reducer, preloadedState, enhancer); var _dispatch = store.dispatch; var chain = []; var middlewareAPI = { getState: store.getState, dispatch: function dispatch(action) { return _dispatch(action); } }; chain = middlewares.map(function (middleware) { return middleware(middlewareAPI); }); _dispatch = _compose__WEBPACK_IMPORTED_MODULE_0__["default"].apply(undefined, chain)(store.dispatch); return _extends({}, store, { dispatch: _dispatch }); }; }; } /***/ }), /* 936 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return compose; }); /** * Composes single-argument functions from right to left. The rightmost * function can take multiple arguments as it provides the signature for * the resulting composite function. * * @param {...Function} funcs The functions to compose. * @returns {Function} A function obtained by composing the argument functions * from right to left. For example, compose(f, g, h) is identical to doing * (...args) => f(g(h(...args))). */ function compose() { for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) { funcs[_key] = arguments[_key]; } if (funcs.length === 0) { return function (arg) { return arg; }; } if (funcs.length === 1) { return funcs[0]; } return funcs.reduce(function (a, b) { return function () { return a(b.apply(undefined, arguments)); }; }); } /***/ }), /* 937 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); function createThunkMiddleware(extraArgument) { return function (_ref) { var dispatch = _ref.dispatch, getState = _ref.getState; return function (next) { return function (action) { if (typeof action === 'function') { return action(dispatch, getState, extraArgument); } return next(action); }; }; }; } var thunk = createThunkMiddleware(); thunk.withExtraArgument = createThunkMiddleware; /* harmony default export */ __webpack_exports__["default"] = (thunk); /***/ }), /* 938 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _defineProperty2 = __webpack_require__(895); var _defineProperty3 = _interopRequireDefault(_defineProperty2); var _extends3 = __webpack_require__(843); var _extends4 = _interopRequireDefault(_extends3); var _getPrototypeOf = __webpack_require__(858); var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); var _classCallCheck2 = __webpack_require__(851); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = __webpack_require__(852); var _createClass3 = _interopRequireDefault(_createClass2); var _possibleConstructorReturn2 = __webpack_require__(861); var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); var _inherits2 = __webpack_require__(876); var _inherits3 = _interopRequireDefault(_inherits2); var _Association2 = __webpack_require__(893); var _Association3 = _interopRequireDefault(_Association2); var _dsl = __webpack_require__(884); var _dsl2 = _interopRequireDefault(_dsl); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * * Used when related documents are stored directly under the attribute with * only the ids. * * @description * * An example document representing a TODO. See as the related * tasks are represented via ids. * * ```js * const todo = { * label: "Protect people's privacy", * tasks: [1, 2] * } * ``` * * Here is the `Schema` that would represent this kind of document. * Components receiving todos via `Query`s would have an instance of `HasManyInPlace` * as their `tasks` attribute. * * ```js * const schema = { * todos: { * doctype: 'io.cozy.todos', * relationships: { * tasks: { * doctype: 'io.cozy.tasks', * type: 'has-many-in-place' * } * } * } * } * * const todo = { * label: "Get rich", * tasks: [1, 2] * } * ``` * */ var HasManyInPlace = function (_Association) { (0, _inherits3.default)(HasManyInPlace, _Association); function HasManyInPlace() { (0, _classCallCheck3.default)(this, HasManyInPlace); return (0, _possibleConstructorReturn3.default)(this, (HasManyInPlace.__proto__ || (0, _getPrototypeOf2.default)(HasManyInPlace)).apply(this, arguments)); } (0, _createClass3.default)(HasManyInPlace, [{ key: 'addById', value: function addById(id) { var rel = this.getRelationship(); rel.push(id); } }, { key: 'removeById', value: function removeById(id) { var rel = this.getRelationship(); var index = rel.indexOf(id); if (index !== -1) { rel.splice(index, 1); } } }, { key: 'existsById', value: function existsById(id) { var rel = this.getRelationship(); return rel.indexOf(id) !== -1; } }, { key: 'getRelationship', value: function getRelationship() { this.target[this.name] = this.target[this.name] || []; return this.target[this.name]; } }, { key: 'dehydrate', value: function dehydrate(doc) { return (0, _extends4.default)({}, doc, (0, _defineProperty3.default)({}, this.name, this.raw || [])); } }, { key: 'raw', get: function get() { return this.target[this.name]; } }, { key: 'data', get: function get() { var _this2 = this; var doctype = this.doctype; return (this.raw || []).map(function (_id) { return _this2.get(doctype, _id); }); } }], [{ key: 'query', value: function query() { if (this.raw && this.raw.length > 0) { return (0, _dsl2.default)({ doctype: this.doctype, ids: this.raw }); } else { return null; } } }]); return HasManyInPlace; }(_Association3.default); exports.default = HasManyInPlace; /***/ }), /* 939 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _regenerator = __webpack_require__(619); var _regenerator2 = _interopRequireDefault(_regenerator); var _toConsumableArray2 = __webpack_require__(842); var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2); var _extends2 = __webpack_require__(843); var _extends3 = _interopRequireDefault(_extends2); var _asyncToGenerator2 = __webpack_require__(849); var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); var _getPrototypeOf = __webpack_require__(858); var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); var _classCallCheck2 = __webpack_require__(851); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = __webpack_require__(852); var _createClass3 = _interopRequireDefault(_createClass2); var _possibleConstructorReturn2 = __webpack_require__(861); var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); var _get2 = __webpack_require__(940); var _get3 = _interopRequireDefault(_get2); var _inherits2 = __webpack_require__(876); var _inherits3 = _interopRequireDefault(_inherits2); var _omit = __webpack_require__(944); var _omit2 = _interopRequireDefault(_omit); var _HasMany2 = __webpack_require__(898); var _HasMany3 = _interopRequireDefault(_HasMany2); var _dsl = __webpack_require__(884); var _store = __webpack_require__(899); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * This class is only used for photos albums relationships. * Behind the hood, the queries uses a view returning the files sorted * by datetime, with a cursor-based pagination. */ var HasManyFiles = function (_HasMany) { (0, _inherits3.default)(HasManyFiles, _HasMany); function HasManyFiles() { (0, _classCallCheck3.default)(this, HasManyFiles); return (0, _possibleConstructorReturn3.default)(this, (HasManyFiles.__proto__ || (0, _getPrototypeOf2.default)(HasManyFiles)).apply(this, arguments)); } (0, _createClass3.default)(HasManyFiles, [{ key: 'fetchMore', value: function () { var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2() { var _this2 = this; var queryDef, relationships, lastRelationship; return _regenerator2.default.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: queryDef = new _dsl.QueryDefinition({ doctype: 'io.cozy.files' }); relationships = this.getRelationship().data; // Get last datetime for cursor lastRelationship = relationships[relationships.length - 1]; _context2.next = 5; return this.dispatch(function () { var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(dispatch, getState) { var lastRelDoc, lastDatetime, cursorKey, startDocId, cursorView, response; return _regenerator2.default.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: lastRelDoc = (0, _store.getDocumentFromState)(getState(), lastRelationship._type, lastRelationship._id); // Photos always have a datetime field in metadata lastDatetime = lastRelDoc.attributes.metadata.datetime; // cursor-based pagination cursorKey = [_this2.target._type, _this2.target._id, lastDatetime]; startDocId = relationships[relationships.length - 1]._id; cursorView = [cursorKey, startDocId]; _context.next = 7; return _this2.query(queryDef.referencedBy(_this2.target).offsetCursor(cursorView)); case 7: response = _context.sent; // Remove first returned element, used as starting point for the query response.data.shift(); _context.next = 11; return _this2.dispatch(_this2.updateRelationshipData(function (previousRelationshipData) { return (0, _extends3.default)({}, previousRelationshipData, { data: [].concat((0, _toConsumableArray3.default)(previousRelationshipData.data), (0, _toConsumableArray3.default)(response.data)), next: response.next }); })); case 11: case 'end': return _context.stop(); } } }, _callee, _this2); })); return function (_x, _x2) { return _ref2.apply(this, arguments); }; }()); case 5: case 'end': return _context2.stop(); } } }, _callee2, this); })); function fetchMore() { return _ref.apply(this, arguments); } return fetchMore; }() }, { key: 'addById', value: function () { var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(ids) { var _this3 = this; var relations; return _regenerator2.default.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: ids = Array.isArray(ids) ? ids : [ids]; relations = ids.map(function (id) { return { _id: id, _type: _this3.doctype }; }); _context3.next = 4; return this.mutate(this.insertDocuments(relations)); case 4: _context3.next = 6; return (0, _get3.default)(HasManyFiles.prototype.__proto__ || (0, _getPrototypeOf2.default)(HasManyFiles.prototype), 'addById', this).call(this, ids); case 6: case 'end': return _context3.stop(); } } }, _callee3, this); })); function addById(_x3) { return _ref3.apply(this, arguments); } return addById; }() }, { key: 'removeById', value: function () { var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(ids) { var _this4 = this; var relations; return _regenerator2.default.wrap(function _callee4$(_context4) { while (1) { switch (_context4.prev = _context4.next) { case 0: ids = Array.isArray(ids) ? ids : [ids]; relations = ids.map(function (id) { return { _id: id, _type: _this4.doctype }; }); _context4.next = 4; return this.mutate(this.removeDocuments(relations)); case 4: _context4.next = 6; return (0, _get3.default)(HasManyFiles.prototype.__proto__ || (0, _getPrototypeOf2.default)(HasManyFiles.prototype), 'removeById', this).call(this, ids); case 6: case 'end': return _context4.stop(); } } }, _callee4, this); })); function removeById(_x4) { return _ref4.apply(this, arguments); } return removeById; }() }, { key: 'insertDocuments', value: function insertDocuments(referencedDocs) { if (this.target._type === 'io.cozy.files') { return _dsl.Mutations.addReferencedBy(this.target, referencedDocs); } else if (referencedDocs[0]._type === 'io.cozy.files') { return _dsl.Mutations.addReferencesTo(this.target, referencedDocs); } else { throw new Error('Either the document or the references should be io.cozy.files'); } } }, { key: 'removeDocuments', value: function removeDocuments(referencedDocs) { if (this.target._type === 'io.cozy.files') { return _dsl.Mutations.removeReferencedBy(this.target, referencedDocs); } else if (referencedDocs[0]._type === 'io.cozy.files') { return _dsl.Mutations.removeReferencesTo(this.target, referencedDocs); } else { throw new Error('Either the document or the references should be io.cozy.files'); } } }, { key: 'dehydrate', value: function dehydrate(doc) { // HasManyFiles relationships are stored on the file doctype, not the document the files are related to return (0, _omit2.default)(doc, [this.name, 'relationships.' + this.name]); } }], [{ key: 'query', value: function query(document, client, assoc) { var key = [document._type, document._id]; var cursor = [key, '']; var queryAll = client.find(assoc.doctype); return queryAll.referencedBy(document).offsetCursor(cursor); } }]); return HasManyFiles; }(_HasMany3.default); exports.default = HasManyFiles; /***/ }), /* 940 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var _getPrototypeOf = __webpack_require__(858); var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); var _getOwnPropertyDescriptor = __webpack_require__(941); var _getOwnPropertyDescriptor2 = _interopRequireDefault(_getOwnPropertyDescriptor); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = (0, _getOwnPropertyDescriptor2.default)(object, property); if (desc === undefined) { var parent = (0, _getPrototypeOf2.default)(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; /***/ }), /* 941 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__(942), __esModule: true }; /***/ }), /* 942 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(943); var $Object = __webpack_require__(734).Object; module.exports = function getOwnPropertyDescriptor(it, key) { return $Object.getOwnPropertyDescriptor(it, key); }; /***/ }), /* 943 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) var toIObject = __webpack_require__(751); var $getOwnPropertyDescriptor = __webpack_require__(873).f; __webpack_require__(838)('getOwnPropertyDescriptor', function () { return function getOwnPropertyDescriptor(it, key) { return $getOwnPropertyDescriptor(toIObject(it), key); }; }); /***/ }), /* 944 */ /***/ (function(module, exports, __webpack_require__) { var arrayMap = __webpack_require__(580), baseClone = __webpack_require__(945), baseUnset = __webpack_require__(959), castPath = __webpack_require__(573), copyObject = __webpack_require__(375), customOmitClone = __webpack_require__(963), flatRest = __webpack_require__(606), getAllKeysIn = __webpack_require__(891); /** Used to compose bitmasks for cloning. */ var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4; /** * The opposite of `_.pick`; this method creates an object composed of the * own and inherited enumerable property paths of `object` that are not omitted. * * **Note:** This method is considerably slower than `_.pick`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The source object. * @param {...(string|string[])} [paths] The property paths to omit. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.omit(object, ['a', 'c']); * // => { 'b': '2' } */ var omit = flatRest(function(object, paths) { var result = {}; if (object == null) { return result; } var isDeep = false; paths = arrayMap(paths, function(path) { path = castPath(path, object); isDeep || (isDeep = path.length > 1); return path; }); copyObject(object, getAllKeysIn(object), result); if (isDeep) { result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); } var length = paths.length; while (length--) { baseUnset(result, paths[length]); } return result; }); module.exports = omit; /***/ }), /* 945 */ /***/ (function(module, exports, __webpack_require__) { var Stack = __webpack_require__(500), arrayEach = __webpack_require__(443), assignValue = __webpack_require__(365), baseAssign = __webpack_require__(946), baseAssignIn = __webpack_require__(947), cloneBuffer = __webpack_require__(531), copyArray = __webpack_require__(437), copySymbols = __webpack_require__(948), copySymbolsIn = __webpack_require__(949), getAllKeys = __webpack_require__(557), getAllKeysIn = __webpack_require__(891), getTag = __webpack_require__(563), initCloneArray = __webpack_require__(950), initCloneByTag = __webpack_require__(951), initCloneObject = __webpack_require__(535), isArray = __webpack_require__(75), isBuffer = __webpack_require__(395), isMap = __webpack_require__(955), isObject = __webpack_require__(72), isSet = __webpack_require__(957), keys = __webpack_require__(390); /** Used to compose bitmasks for cloning. */ var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4; /** `Object#toString` result references. */ var argsTag = '[object Arguments]', arrayTag = '[object Array]', boolTag = '[object Boolean]', dateTag = '[object Date]', errorTag = '[object Error]', funcTag = '[object Function]', genTag = '[object GeneratorFunction]', mapTag = '[object Map]', numberTag = '[object Number]', objectTag = '[object Object]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', symbolTag = '[object Symbol]', weakMapTag = '[object WeakMap]'; var arrayBufferTag = '[object ArrayBuffer]', dataViewTag = '[object DataView]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', int16Tag = '[object Int16Array]', int32Tag = '[object Int32Array]', uint8Tag = '[object Uint8Array]', uint8ClampedTag = '[object Uint8ClampedArray]', uint16Tag = '[object Uint16Array]', uint32Tag = '[object Uint32Array]'; /** Used to identify `toStringTag` values supported by `_.clone`. */ var cloneableTags = {}; cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false; /** * The base implementation of `_.clone` and `_.cloneDeep` which tracks * traversed objects. * * @private * @param {*} value The value to clone. * @param {boolean} bitmask The bitmask flags. * 1 - Deep clone * 2 - Flatten inherited properties * 4 - Clone symbols * @param {Function} [customizer] The function to customize cloning. * @param {string} [key] The key of `value`. * @param {Object} [object] The parent object of `value`. * @param {Object} [stack] Tracks traversed objects and their clone counterparts. * @returns {*} Returns the cloned value. */ function baseClone(value, bitmask, customizer, key, object, stack) { var result, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG; if (customizer) { result = object ? customizer(value, key, object, stack) : customizer(value); } if (result !== undefined) { return result; } if (!isObject(value)) { return value; } var isArr = isArray(value); if (isArr) { result = initCloneArray(value); if (!isDeep) { return copyArray(value, result); } } else { var tag = getTag(value), isFunc = tag == funcTag || tag == genTag; if (isBuffer(value)) { return cloneBuffer(value, isDeep); } if (tag == objectTag || tag == argsTag || (isFunc && !object)) { result = (isFlat || isFunc) ? {} : initCloneObject(value); if (!isDeep) { return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value)); } } else { if (!cloneableTags[tag]) { return object ? value : {}; } result = initCloneByTag(value, tag, isDeep); } } // Check for circular references and return its corresponding clone. stack || (stack = new Stack); var stacked = stack.get(value); if (stacked) { return stacked; } stack.set(value, result); if (isSet(value)) { value.forEach(function(subValue) { result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); }); } else if (isMap(value)) { value.forEach(function(subValue, key) { result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); }); } var keysFunc = isFull ? (isFlat ? getAllKeysIn : getAllKeys) : (isFlat ? keysIn : keys); var props = isArr ? undefined : keysFunc(value); arrayEach(props || value, function(subValue, key) { if (props) { key = subValue; subValue = value[key]; } // Recursively populate clone (susceptible to call stack limits). assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); }); return result; } module.exports = baseClone; /***/ }), /* 946 */ /***/ (function(module, exports, __webpack_require__) { var copyObject = __webpack_require__(375), keys = __webpack_require__(390); /** * The base implementation of `_.assign` without support for multiple sources * or `customizer` functions. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @returns {Object} Returns `object`. */ function baseAssign(object, source) { return object && copyObject(source, keys(source), object); } module.exports = baseAssign; /***/ }), /* 947 */ /***/ (function(module, exports, __webpack_require__) { var copyObject = __webpack_require__(375), keysIn = __webpack_require__(410); /** * The base implementation of `_.assignIn` without support for multiple sources * or `customizer` functions. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @returns {Object} Returns `object`. */ function baseAssignIn(object, source) { return object && copyObject(source, keysIn(source), object); } module.exports = baseAssignIn; /***/ }), /* 948 */ /***/ (function(module, exports, __webpack_require__) { var copyObject = __webpack_require__(375), getSymbols = __webpack_require__(560); /** * Copies own symbols of `source` to `object`. * * @private * @param {Object} source The object to copy symbols from. * @param {Object} [object={}] The object to copy symbols to. * @returns {Object} Returns `object`. */ function copySymbols(source, object) { return copyObject(source, getSymbols(source), object); } module.exports = copySymbols; /***/ }), /* 949 */ /***/ (function(module, exports, __webpack_require__) { var copyObject = __webpack_require__(375), getSymbolsIn = __webpack_require__(892); /** * Copies own and inherited symbols of `source` to `object`. * * @private * @param {Object} source The object to copy symbols from. * @param {Object} [object={}] The object to copy symbols to. * @returns {Object} Returns `object`. */ function copySymbolsIn(source, object) { return copyObject(source, getSymbolsIn(source), object); } module.exports = copySymbolsIn; /***/ }), /* 950 */ /***/ (function(module, exports) { /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Initializes an array clone. * * @private * @param {Array} array The array to clone. * @returns {Array} Returns the initialized clone. */ function initCloneArray(array) { var length = array.length, result = new array.constructor(length); // Add properties assigned by `RegExp#exec`. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { result.index = array.index; result.input = array.input; } return result; } module.exports = initCloneArray; /***/ }), /* 951 */ /***/ (function(module, exports, __webpack_require__) { var cloneArrayBuffer = __webpack_require__(533), cloneDataView = __webpack_require__(952), cloneRegExp = __webpack_require__(953), cloneSymbol = __webpack_require__(954), cloneTypedArray = __webpack_require__(532); /** `Object#toString` result references. */ var boolTag = '[object Boolean]', dateTag = '[object Date]', mapTag = '[object Map]', numberTag = '[object Number]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', symbolTag = '[object Symbol]'; var arrayBufferTag = '[object ArrayBuffer]', dataViewTag = '[object DataView]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', int16Tag = '[object Int16Array]', int32Tag = '[object Int32Array]', uint8Tag = '[object Uint8Array]', uint8ClampedTag = '[object Uint8ClampedArray]', uint16Tag = '[object Uint16Array]', uint32Tag = '[object Uint32Array]'; /** * Initializes an object clone based on its `toStringTag`. * * **Note:** This function only supports cloning values with tags of * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. * * @private * @param {Object} object The object to clone. * @param {string} tag The `toStringTag` of the object to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the initialized clone. */ function initCloneByTag(object, tag, isDeep) { var Ctor = object.constructor; switch (tag) { case arrayBufferTag: return cloneArrayBuffer(object); case boolTag: case dateTag: return new Ctor(+object); case dataViewTag: return cloneDataView(object, isDeep); case float32Tag: case float64Tag: case int8Tag: case int16Tag: case int32Tag: case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: return cloneTypedArray(object, isDeep); case mapTag: return new Ctor; case numberTag: case stringTag: return new Ctor(object); case regexpTag: return cloneRegExp(object); case setTag: return new Ctor; case symbolTag: return cloneSymbol(object); } } module.exports = initCloneByTag; /***/ }), /* 952 */ /***/ (function(module, exports, __webpack_require__) { var cloneArrayBuffer = __webpack_require__(533); /** * Creates a clone of `dataView`. * * @private * @param {Object} dataView The data view to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned data view. */ function cloneDataView(dataView, isDeep) { var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); } module.exports = cloneDataView; /***/ }), /* 953 */ /***/ (function(module, exports) { /** Used to match `RegExp` flags from their coerced string values. */ var reFlags = /\w*$/; /** * Creates a clone of `regexp`. * * @private * @param {Object} regexp The regexp to clone. * @returns {Object} Returns the cloned regexp. */ function cloneRegExp(regexp) { var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); result.lastIndex = regexp.lastIndex; return result; } module.exports = cloneRegExp; /***/ }), /* 954 */ /***/ (function(module, exports, __webpack_require__) { var Symbol = __webpack_require__(67); /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol ? Symbol.prototype : undefined, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; /** * Creates a clone of the `symbol` object. * * @private * @param {Object} symbol The symbol object to clone. * @returns {Object} Returns the cloned symbol object. */ function cloneSymbol(symbol) { return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; } module.exports = cloneSymbol; /***/ }), /* 955 */ /***/ (function(module, exports, __webpack_require__) { var baseIsMap = __webpack_require__(956), baseUnary = __webpack_require__(399), nodeUtil = __webpack_require__(400); /* Node.js helper references. */ var nodeIsMap = nodeUtil && nodeUtil.isMap; /** * Checks if `value` is classified as a `Map` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a map, else `false`. * @example * * _.isMap(new Map); * // => true * * _.isMap(new WeakMap); * // => false */ var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; module.exports = isMap; /***/ }), /* 956 */ /***/ (function(module, exports, __webpack_require__) { var getTag = __webpack_require__(563), isObjectLike = __webpack_require__(73); /** `Object#toString` result references. */ var mapTag = '[object Map]'; /** * The base implementation of `_.isMap` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a map, else `false`. */ function baseIsMap(value) { return isObjectLike(value) && getTag(value) == mapTag; } module.exports = baseIsMap; /***/ }), /* 957 */ /***/ (function(module, exports, __webpack_require__) { var baseIsSet = __webpack_require__(958), baseUnary = __webpack_require__(399), nodeUtil = __webpack_require__(400); /* Node.js helper references. */ var nodeIsSet = nodeUtil && nodeUtil.isSet; /** * Checks if `value` is classified as a `Set` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a set, else `false`. * @example * * _.isSet(new Set); * // => true * * _.isSet(new WeakSet); * // => false */ var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; module.exports = isSet; /***/ }), /* 958 */ /***/ (function(module, exports, __webpack_require__) { var getTag = __webpack_require__(563), isObjectLike = __webpack_require__(73); /** `Object#toString` result references. */ var setTag = '[object Set]'; /** * The base implementation of `_.isSet` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a set, else `false`. */ function baseIsSet(value) { return isObjectLike(value) && getTag(value) == setTag; } module.exports = baseIsSet; /***/ }), /* 959 */ /***/ (function(module, exports, __webpack_require__) { var castPath = __webpack_require__(573), last = __webpack_require__(960), parent = __webpack_require__(961), toKey = __webpack_require__(581); /** * The base implementation of `_.unset`. * * @private * @param {Object} object The object to modify. * @param {Array|string} path The property path to unset. * @returns {boolean} Returns `true` if the property is deleted, else `false`. */ function baseUnset(object, path) { path = castPath(path, object); object = parent(object, path); return object == null || delete object[toKey(last(path))]; } module.exports = baseUnset; /***/ }), /* 960 */ /***/ (function(module, exports) { /** * Gets the last element of `array`. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to query. * @returns {*} Returns the last element of `array`. * @example * * _.last([1, 2, 3]); * // => 3 */ function last(array) { var length = array == null ? 0 : array.length; return length ? array[length - 1] : undefined; } module.exports = last; /***/ }), /* 961 */ /***/ (function(module, exports, __webpack_require__) { var baseGet = __webpack_require__(572), baseSlice = __webpack_require__(962); /** * Gets the parent value at `path` of `object`. * * @private * @param {Object} object The object to query. * @param {Array} path The path to get the parent value of. * @returns {*} Returns the parent value. */ function parent(object, path) { return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); } module.exports = parent; /***/ }), /* 962 */ /***/ (function(module, exports) { /** * The base implementation of `_.slice` without an iteratee call guard. * * @private * @param {Array} array The array to slice. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the slice of `array`. */ function baseSlice(array, start, end) { var index = -1, length = array.length; if (start < 0) { start = -start > length ? 0 : (length + start); } end = end > length ? length : end; if (end < 0) { end += length; } length = start > end ? 0 : ((end - start) >>> 0); start >>>= 0; var result = Array(length); while (++index < length) { result[index] = array[index + start]; } return result; } module.exports = baseSlice; /***/ }), /* 963 */ /***/ (function(module, exports, __webpack_require__) { var isPlainObject = __webpack_require__(538); /** * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain * objects. * * @private * @param {*} value The value to inspect. * @param {string} key The key of the property to inspect. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. */ function customOmitClone(value) { return isPlainObject(value) ? undefined : value; } module.exports = customOmitClone; /***/ }), /* 964 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _getPrototypeOf = __webpack_require__(858); var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); var _classCallCheck2 = __webpack_require__(851); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = __webpack_require__(852); var _createClass3 = _interopRequireDefault(_createClass2); var _possibleConstructorReturn2 = __webpack_require__(861); var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); var _get2 = __webpack_require__(940); var _get3 = _interopRequireDefault(_get2); var _inherits2 = __webpack_require__(876); var _inherits3 = _interopRequireDefault(_inherits2); var _HasMany2 = __webpack_require__(898); var _HasMany3 = _interopRequireDefault(_HasMany2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var TRIGGERS_DOCTYPE = 'io.cozy.triggers'; /** * Association used for konnectors to retrieve all their related triggers. * * @augments HasMany */ var HasManyTriggers = function (_HasMany) { (0, _inherits3.default)(HasManyTriggers, _HasMany); function HasManyTriggers() { (0, _classCallCheck3.default)(this, HasManyTriggers); return (0, _possibleConstructorReturn3.default)(this, (HasManyTriggers.__proto__ || (0, _getPrototypeOf2.default)(HasManyTriggers)).apply(this, arguments)); } (0, _createClass3.default)(HasManyTriggers, [{ key: 'data', get: function get() { var _this2 = this; return (0, _get3.default)(HasManyTriggers.prototype.__proto__ || (0, _getPrototypeOf2.default)(HasManyTriggers.prototype), 'data', this).filter(function (_ref) { var slug = _ref.slug; return slug === _this2.target.slug; }); } /** * In this association the query is special, we need to fetch all the triggers * having for the 'konnector' worker, and then filter them based on their * `message.konnector` attribute */ }], [{ key: 'query', value: function query(doc, client) { return client.all(TRIGGERS_DOCTYPE).where({ worker: 'konnector' }); } }]); return HasManyTriggers; }(_HasMany3.default); exports.default = HasManyTriggers; /***/ }), /* 965 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.dehydrate = undefined; var _slicedToArray2 = __webpack_require__(788); var _slicedToArray3 = _interopRequireDefault(_slicedToArray2); var _entries = __webpack_require__(729); var _entries2 = _interopRequireDefault(_entries); var _associations = __webpack_require__(888); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var dehydrate = exports.dehydrate = function dehydrate(document) { var dehydrated = (0, _entries2.default)(document).reduce(function (document, _ref) { var _ref2 = (0, _slicedToArray3.default)(_ref, 2), key = _ref2[0], value = _ref2[1]; if (!(value instanceof _associations.Association)) { document[key] = value; } else if (value.dehydrate) { document = value.dehydrate(document); } else { throw new Error('Association on key ' + key + ' should have a dehydrate method'); } return document; }, {}); return dehydrated; }; /***/ }), /* 966 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _CozyStackClient = __webpack_require__(967); Object.defineProperty(exports, 'default', { enumerable: true, get: function get() { return _interopRequireDefault(_CozyStackClient).default; } }); var _OAuthClient = __webpack_require__(1013); Object.defineProperty(exports, 'OAuthClient', { enumerable: true, get: function get() { return _interopRequireDefault(_OAuthClient).default; } }); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /***/ }), /* 967 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.FetchError = undefined; var _getPrototypeOf = __webpack_require__(858); var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); var _possibleConstructorReturn2 = __webpack_require__(861); var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); var _inherits2 = __webpack_require__(876); var _inherits3 = _interopRequireDefault(_inherits2); var _stringify = __webpack_require__(886); var _stringify2 = _interopRequireDefault(_stringify); var _regenerator = __webpack_require__(619); var _regenerator2 = _interopRequireDefault(_regenerator); var _asyncToGenerator2 = __webpack_require__(849); var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); var _extends2 = __webpack_require__(843); var _extends3 = _interopRequireDefault(_extends2); var _classCallCheck2 = __webpack_require__(851); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = __webpack_require__(852); var _createClass3 = _interopRequireDefault(_createClass2); var _AppCollection = __webpack_require__(968); var _AppCollection2 = _interopRequireDefault(_AppCollection); var _AppToken = __webpack_require__(996); var _AppToken2 = _interopRequireDefault(_AppToken); var _DocumentCollection = __webpack_require__(969); var _DocumentCollection2 = _interopRequireDefault(_DocumentCollection); var _FileCollection = __webpack_require__(997); var _FileCollection2 = _interopRequireDefault(_FileCollection); var _JobCollection = __webpack_require__(1003); var _JobCollection2 = _interopRequireDefault(_JobCollection); var _KonnectorCollection = __webpack_require__(1004); var _KonnectorCollection2 = _interopRequireDefault(_KonnectorCollection); var _SharingCollection = __webpack_require__(1006); var _SharingCollection2 = _interopRequireDefault(_SharingCollection); var _PermissionCollection = __webpack_require__(1007); var _PermissionCollection2 = _interopRequireDefault(_PermissionCollection); var _TriggerCollection = __webpack_require__(1005); var _TriggerCollection2 = _interopRequireDefault(_TriggerCollection); var _SettingsCollection = __webpack_require__(1008); var _SettingsCollection2 = _interopRequireDefault(_SettingsCollection); var _getIconURL2 = __webpack_require__(1009); var _getIconURL3 = _interopRequireDefault(_getIconURL2); var _logDeprecate = __webpack_require__(1011); var _logDeprecate2 = _interopRequireDefault(_logDeprecate); var _errors = __webpack_require__(1012); var _errors2 = _interopRequireDefault(_errors); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var normalizeUri = function normalizeUri(uri) { if (uri === null) return null; while (uri[uri.length - 1] === '/') { uri = uri.slice(0, -1); } return uri; }; /** * Main API against the `cozy-stack` server. */ var CozyStackClient = function () { function CozyStackClient(options) { (0, _classCallCheck3.default)(this, CozyStackClient); var opts = (0, _extends3.default)({}, options); var token = opts.token, _opts$uri = opts.uri, uri = _opts$uri === undefined ? '' : _opts$uri; this.options = opts; this.setUri(uri); this.setToken(token); this.konnectors = new _KonnectorCollection2.default(this); this.jobs = new _JobCollection2.default(this); } /** * Creates a {@link DocumentCollection} instance. * * @param {string} doctype The collection doctype. * @returns {DocumentCollection} */ (0, _createClass3.default)(CozyStackClient, [{ key: 'collection', value: function collection(doctype) { if (!doctype) { throw new Error('CozyStackClient.collection() called without a doctype'); } switch (doctype) { case _AppCollection.APPS_DOCTYPE: return new _AppCollection2.default(this); case _KonnectorCollection.KONNECTORS_DOCTYPE: return new _KonnectorCollection2.default(this); case 'io.cozy.files': return new _FileCollection2.default(doctype, this); case 'io.cozy.sharings': return new _SharingCollection2.default(doctype, this); case 'io.cozy.permissions': return new _PermissionCollection2.default(doctype, this); case _TriggerCollection.TRIGGERS_DOCTYPE: return new _TriggerCollection2.default(this); case _JobCollection.JOBS_DOCTYPE: return new _JobCollection2.default(this); case _SettingsCollection.SETTINGS_DOCTYPE: return new _SettingsCollection2.default(this); default: return new _DocumentCollection2.default(doctype, this); } } /** * Fetches an endpoint in an authorized way. * * @param {string} method The HTTP method. * @param {string} path The URI. * @param {object} body The payload. * @param {object} options * @returns {object} * @throws {FetchError} */ }, { key: 'fetch', value: function (_fetch) { function fetch(_x, _x2, _x3) { return _fetch.apply(this, arguments); } fetch.toString = function () { return _fetch.toString(); }; return fetch; }(function () { var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(method, path, body) { var _this = this; var opts = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; var options, headers; return _regenerator2.default.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: options = (0, _extends3.default)({}, opts); options.method = method; headers = options.headers = (0, _extends3.default)({}, opts.headers); if (method !== 'GET' && method !== 'HEAD' && body !== undefined) { if (headers['Content-Type']) { options.body = body; } } if (!headers.Authorization) { headers.Authorization = this.getAuthorizationHeader(); } // the option credentials:include tells fetch to include the cookies in the // request even for cross-origin requests options.credentials = 'include'; return _context.abrupt('return', fetch(this.fullpath(path), options).catch(function (err) { _this.checkForRevocation(err); throw err; })); case 7: case 'end': return _context.stop(); } } }, _callee, this); })); return function (_x5, _x6, _x7) { return _ref.apply(this, arguments); }; }()) }, { key: 'checkForRevocation', value: function checkForRevocation(err) { if (err.message && _errors2.default.CLIENT_NOT_FOUND.test(err.message)) { this.onRevocationChange(true); } } }, { key: 'onRevocationChange', value: function onRevocationChange(state) { if (this.options && this.options.onRevocationChange) { this.options.onRevocationChange(state); } } /** * Retrieves a new app token by refreshing the currently used token. * * @throws {Error} The client should already have an access token to use this function * @throws {Error} The client couldn't fetch a new token * @returns {Promise} A promise that resolves with a new AccessToken object */ }, { key: 'refreshToken', value: function () { var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2() { var options, response, html, parser, doc, appNode, cozyToken, newToken; return _regenerator2.default.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: if (this.token) { _context2.next = 2; break; } throw new Error('Cannot refresh an empty token'); case 2: options = { method: 'GET', credentials: 'include' }; if (global.document) { _context2.next = 5; break; } throw new Error('Not in a web context, cannot refresh token'); case 5: _context2.next = 7; return fetch('/', options); case 7: response = _context2.sent; if (response.ok) { _context2.next = 10; break; } throw new Error("couldn't fetch a new token - response " + response.statusCode); case 10: _context2.next = 12; return response.text(); case 12: html = _context2.sent; parser = new DOMParser(); doc = parser.parseFromString(html, 'text/html'); if (doc) { _context2.next = 17; break; } throw Error("couldn't fetch a new token - doc is not html"); case 17: appNode = doc.querySelector('div[role="application"]'); if (appNode) { _context2.next = 20; break; } throw Error("couldn't fetch a new token - no div[role=application]"); case 20: cozyToken = appNode.dataset.cozyToken; if (cozyToken) { _context2.next = 23; break; } throw Error("couldn't fetch a new token -- missing data-cozy-token attribute"); case 23: newToken = new _AppToken2.default(cozyToken); if (this.onTokenRefresh && typeof this.onTokenRefresh === 'function') { this.onTokenRefresh(newToken); } return _context2.abrupt('return', newToken); case 26: case 'end': return _context2.stop(); } } }, _callee2, this); })); function refreshToken() { return _ref2.apply(this, arguments); } return refreshToken; }() /** * Fetches JSON in an authorized way. * * @param {string} method The HTTP method. * @param {string} path The URI. * @param {object} body The payload. * @param {object} options * @returns {object} * @throws {FetchError} */ }, { key: 'fetchJSON', value: function () { var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(method, path, body) { var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; var token; return _regenerator2.default.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: _context3.prev = 0; _context3.next = 3; return this.fetchJSONWithCurrentToken(method, path, body, options); case 3: return _context3.abrupt('return', _context3.sent); case 6: _context3.prev = 6; _context3.t0 = _context3['catch'](0); if (!_errors2.default.EXPIRED_TOKEN.test(_context3.t0.message)) { _context3.next = 25; break; } token = void 0; _context3.prev = 10; _context3.next = 13; return this.refreshToken(); case 13: token = _context3.sent; _context3.next = 19; break; case 16: _context3.prev = 16; _context3.t1 = _context3['catch'](10); throw _context3.t0; case 19: this.setToken(token); _context3.next = 22; return this.fetchJSONWithCurrentToken(method, path, body, options); case 22: return _context3.abrupt('return', _context3.sent); case 25: throw _context3.t0; case 26: case 'end': return _context3.stop(); } } }, _callee3, this, [[0, 6], [10, 16]]); })); function fetchJSON(_x9, _x10, _x11) { return _ref3.apply(this, arguments); } return fetchJSON; }() }, { key: 'fetchJSONWithCurrentToken', value: function () { var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(method, path, body) { var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; var headers, resp, contentType, isJson, data; return _regenerator2.default.wrap(function _callee4$(_context4) { while (1) { switch (_context4.prev = _context4.next) { case 0: headers = options.headers = options.headers || {}; headers['Accept'] = 'application/json'; if (method !== 'GET' && method !== 'HEAD' && body !== undefined) { if (!headers['Content-Type']) { headers['Content-Type'] = 'application/json'; body = (0, _stringify2.default)(body); } } _context4.next = 5; return this.fetch(method, path, body, options); case 5: resp = _context4.sent; contentType = resp.headers.get('content-type'); isJson = contentType && contentType.indexOf('json') >= 0; _context4.next = 10; return isJson ? resp.json() : resp.text(); case 10: data = _context4.sent; if (!resp.ok) { _context4.next = 13; break; } return _context4.abrupt('return', data); case 13: throw new FetchError(resp, data); case 14: case 'end': return _context4.stop(); } } }, _callee4, this); })); function fetchJSONWithCurrentToken(_x13, _x14, _x15) { return _ref4.apply(this, arguments); } return fetchJSONWithCurrentToken; }() }, { key: 'fullpath', value: function fullpath(path) { if (path.startsWith('http')) { return path; } else { return this.uri + path; } } }, { key: 'getAuthorizationHeader', value: function getAuthorizationHeader() { return this.token ? this.token.toAuthHeader() : null; } }, { key: 'setCredentials', value: function setCredentials(token) { (0, _logDeprecate2.default)('CozyStackClient::setCredentials is deprecated, use CozyStackClient::setToken'); return this.setToken(token); } }, { key: 'getCredentials', value: function getCredentials() { (0, _logDeprecate2.default)('CozyStackClient::getCredentials is deprecated, use CozyStackClient::getAuthorizationHeader'); return this.getAuthorizationHeader(); } }, { key: 'setToken', value: function setToken(token) { this.token = token ? new _AppToken2.default(token) : null; if (token) { this.onRevocationChange(false); } } /** * Get the access token string, being an oauth token or an app token * * @returns {string} token */ }, { key: 'getAccessToken', value: function getAccessToken() { return this.token && this.token.getAccessToken(); } }, { key: 'setUri', value: function setUri(uri) { this.uri = normalizeUri(uri); } }, { key: 'getIconURL', value: function getIconURL(opts) { return (0, _getIconURL3.default)(this, opts); } }]); return CozyStackClient; }(); var FetchError = exports.FetchError = function (_Error) { (0, _inherits3.default)(FetchError, _Error); function FetchError(response, reason) { (0, _classCallCheck3.default)(this, FetchError); var _this2 = (0, _possibleConstructorReturn3.default)(this, (FetchError.__proto__ || (0, _getPrototypeOf2.default)(FetchError)).call(this)); if (Error.captureStackTrace) { Error.captureStackTrace(_this2, _this2.constructor); } // WARN We have to hardcode this because babel doesn't play nice when extending Error _this2.name = 'FetchError'; _this2.response = response; _this2.url = response.url; _this2.status = response.status; _this2.reason = reason; Object.defineProperty(_this2, 'message', { value: reason.message || (typeof reason === 'string' ? reason : (0, _stringify2.default)(reason)) }); return _this2; } return FetchError; }(Error); exports.default = CozyStackClient; /***/ }), /* 968 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeApp = exports.APPS_DOCTYPE = undefined; var _regenerator = __webpack_require__(619); var _regenerator2 = _interopRequireDefault(_regenerator); var _asyncToGenerator2 = __webpack_require__(849); var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); var _getPrototypeOf = __webpack_require__(858); var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); var _classCallCheck2 = __webpack_require__(851); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = __webpack_require__(852); var _createClass3 = _interopRequireDefault(_createClass2); var _possibleConstructorReturn2 = __webpack_require__(861); var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); var _inherits2 = __webpack_require__(876); var _inherits3 = _interopRequireDefault(_inherits2); var _extends2 = __webpack_require__(843); var _extends3 = _interopRequireDefault(_extends2); var _DocumentCollection2 = __webpack_require__(969); var _DocumentCollection3 = _interopRequireDefault(_DocumentCollection2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var APPS_DOCTYPE = exports.APPS_DOCTYPE = 'io.cozy.apps'; var normalizeApp = exports.normalizeApp = function normalizeApp(app, doctype) { return (0, _extends3.default)({}, app, (0, _DocumentCollection2.normalizeDoc)(app, doctype), app.attributes); }; /** * Extends `DocumentCollection` API along with specific methods for `io.cozy.apps`. */ var AppCollection = function (_DocumentCollection) { (0, _inherits3.default)(AppCollection, _DocumentCollection); function AppCollection(stackClient) { (0, _classCallCheck3.default)(this, AppCollection); var _this = (0, _possibleConstructorReturn3.default)(this, (AppCollection.__proto__ || (0, _getPrototypeOf2.default)(AppCollection)).call(this, APPS_DOCTYPE, stackClient)); _this.endpoint = '/apps/'; return _this; } /** * Lists all apps, without filters. * * The returned documents are not paginated by the stack. * * @returns {{data, meta, skip, next}} The JSON API conformant response. * @throws {FetchError} */ (0, _createClass3.default)(AppCollection, [{ key: 'all', value: function () { var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee() { var _this2 = this; var resp; return _regenerator2.default.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _context.next = 2; return this.stackClient.fetchJSON('GET', this.endpoint); case 2: resp = _context.sent; return _context.abrupt('return', { data: resp.data.map(function (app) { return normalizeApp(app, _this2.doctype); }), meta: { count: resp.meta.count }, skip: 0, next: false }); case 4: case 'end': return _context.stop(); } } }, _callee, this); })); function all() { return _ref.apply(this, arguments); } return all; }() }, { key: 'get', value: function () { var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2() { return _regenerator2.default.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: throw new Error('get() method is not yet implemented'); case 1: case 'end': return _context2.stop(); } } }, _callee2, this); })); function get() { return _ref2.apply(this, arguments); } return get; }() }, { key: 'create', value: function () { var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3() { return _regenerator2.default.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: throw new Error('create() method is not available for applications'); case 1: case 'end': return _context3.stop(); } } }, _callee3, this); })); function create() { return _ref3.apply(this, arguments); } return create; }() }, { key: 'update', value: function () { var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4() { return _regenerator2.default.wrap(function _callee4$(_context4) { while (1) { switch (_context4.prev = _context4.next) { case 0: throw new Error('update() method is not available for applications'); case 1: case 'end': return _context4.stop(); } } }, _callee4, this); })); function update() { return _ref4.apply(this, arguments); } return update; }() }, { key: 'destroy', value: function () { var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5() { return _regenerator2.default.wrap(function _callee5$(_context5) { while (1) { switch (_context5.prev = _context5.next) { case 0: throw new Error('destroy() method is not available for applications'); case 1: case 'end': return _context5.stop(); } } }, _callee5, this); })); function destroy() { return _ref5.apply(this, arguments); } return destroy; }() }]); return AppCollection; }(_DocumentCollection3.default); AppCollection.normalizeDoctype = _DocumentCollection3.default.normalizeDoctypeJsonApi; exports.default = AppCollection; /***/ }), /* 969 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeDoctype = undefined; var _typeof2 = __webpack_require__(862); var _typeof3 = _interopRequireDefault(_typeof2); var _set = __webpack_require__(970); var _set2 = _interopRequireDefault(_set); var _from = __webpack_require__(766); var _from2 = _interopRequireDefault(_from); var _toConsumableArray2 = __webpack_require__(842); var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2); var _getIterator2 = __webpack_require__(796); var _getIterator3 = _interopRequireDefault(_getIterator2); var _keys = __webpack_require__(835); var _keys2 = _interopRequireDefault(_keys); var _values = __webpack_require__(839); var _values2 = _interopRequireDefault(_values); var _defineProperty2 = __webpack_require__(895); var _defineProperty3 = _interopRequireDefault(_defineProperty2); var _promise = __webpack_require__(799); var _promise2 = _interopRequireDefault(_promise); var _objectWithoutProperties2 = __webpack_require__(850); var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); var _regenerator = __webpack_require__(619); var _regenerator2 = _interopRequireDefault(_regenerator); var _taggedTemplateLiteral2 = __webpack_require__(976); var _taggedTemplateLiteral3 = _interopRequireDefault(_taggedTemplateLiteral2); var _asyncToGenerator2 = __webpack_require__(849); var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); var _classCallCheck2 = __webpack_require__(851); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = __webpack_require__(852); var _createClass3 = _interopRequireDefault(_createClass2); var _assign = __webpack_require__(844); var _assign2 = _interopRequireDefault(_assign); var _extends2 = __webpack_require__(843); var _extends3 = _interopRequireDefault(_extends2); var _templateObject = (0, _taggedTemplateLiteral3.default)(['/data/', '/', ''], ['/data/', '/', '']), _templateObject2 = (0, _taggedTemplateLiteral3.default)(['/data/', '/_find'], ['/data/', '/_find']), _templateObject3 = (0, _taggedTemplateLiteral3.default)(['/data/', '/_all_docs?include_docs=true'], ['/data/', '/_all_docs?include_docs=true']), _templateObject4 = (0, _taggedTemplateLiteral3.default)(['/data/', '/', '?rev=', ''], ['/data/', '/', '?rev=', '']), _templateObject5 = (0, _taggedTemplateLiteral3.default)(['/data/', '/_index'], ['/data/', '/_index']); exports.normalizeDoc = normalizeDoc; var _utils = __webpack_require__(983); var _uniq = __webpack_require__(984); var _uniq2 = _interopRequireDefault(_uniq); var _transform = __webpack_require__(985); var _transform2 = _interopRequireDefault(_transform); var _head = __webpack_require__(986); var _head2 = _interopRequireDefault(_head); var _omit = __webpack_require__(944); var _omit2 = _interopRequireDefault(_omit); var _startsWith = __webpack_require__(987); var _startsWith2 = _interopRequireDefault(_startsWith); var _qs = __webpack_require__(989); var _qs2 = _interopRequireDefault(_qs); var _Collection = __webpack_require__(994); var _Collection2 = _interopRequireDefault(_Collection); var _querystring = __webpack_require__(995); var querystring = _interopRequireWildcard(_querystring); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var DATABASE_DOES_NOT_EXIST = 'Database does not exist.'; /** * Normalize a document, adding its doctype if needed * * @param {object} doc - Document to normalize * @param {string} doctype * @returns {object} normalized document * @private */ function normalizeDoc() { var doc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var doctype = arguments[1]; var id = doc._id || doc.id; return (0, _extends3.default)({ id: id, _id: id, _type: doctype }, doc); } var flagForDeletion = function flagForDeletion(x) { return (0, _assign2.default)({}, x, { _deleted: true }); }; /** * Abstracts a collection of documents of the same doctype, providing CRUD methods and other helpers. */ var DocumentCollection = function () { function DocumentCollection(doctype, stackClient) { (0, _classCallCheck3.default)(this, DocumentCollection); this.doctype = doctype; this.stackClient = stackClient; this.indexes = {}; } /** * Provides a callback for `Collection.get` * * @private * @param {string} doctype * @returns {Function} (data, response) => normalizedDocument * using `normalizeDoc` */ (0, _createClass3.default)(DocumentCollection, [{ key: 'all', /** * Lists all documents of the collection, without filters. * * The returned documents are paginated by the stack. * * @param {{limit, skip, keys}} options The fetch options: pagination & fetch of specific docs. * @returns {{data, meta, skip, next}} The JSON API conformant response. * @throws {FetchError} */ value: function () { var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee() { var _this = this; var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var limit, _options$skip, skip, keys, isUsingAllDocsRoute, route, url, params, path, resp, data; return _regenerator2.default.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: limit = options.limit, _options$skip = options.skip, skip = _options$skip === undefined ? 0 : _options$skip, keys = options.keys; // If the limit is intentionnally null, we need to use _all_docs, since _normal_docs uses _find and have a hard limit of 100 isUsingAllDocsRoute = !!keys || limit === null; route = isUsingAllDocsRoute ? '_all_docs' : '_normal_docs'; url = (0, _utils.uri)(_templateObject, this.doctype, route); params = { include_docs: true, limit: limit, skip: skip, keys: keys }; path = querystring.buildURL(url, params); // If no document of this doctype exist, this route will return a 404, // so we need to try/catch and return an empty response object in case of a 404 resp = void 0; _context.prev = 7; _context.next = 10; return this.stackClient.fetchJSON('GET', path); case 10: resp = _context.sent; _context.next = 16; break; case 13: _context.prev = 13; _context.t0 = _context['catch'](7); return _context.abrupt('return', (0, _Collection.dontThrowNotFoundError)(_context.t0)); case 16: data = void 0; /* If using `all_docs` we need to filter our design documents and check if the document is not null. If we use `normal_doc` we can't have any design doc */ if (isUsingAllDocsRoute) { data = resp.rows.filter(function (doc) { return doc && doc.doc !== null && !doc.error && !(0, _startsWith2.default)(doc.id, '_design'); }).map(function (row) { return normalizeDoc(row.doc, _this.doctype); }); } else { data = resp.rows.map(function (row) { return normalizeDoc(row, _this.doctype); }); } return _context.abrupt('return', { data: data, meta: { count: isUsingAllDocsRoute ? data.length : resp.total_rows }, skip: skip, next: skip + resp.rows.length < resp.total_rows }); case 19: case 'end': return _context.stop(); } } }, _callee, this, [[7, 13]]); })); function all() { return _ref.apply(this, arguments); } return all; }() /** * Returns a filtered list of documents using a Mango selector. * * The returned documents are paginated by the stack. * * @param {object} selector The Mango selector. * @param {{sort, fields, limit, skip, indexId}} options The query options. * @returns {{data, meta, skip, next}} The JSON API conformant response. * @throws {FetchError} */ }, { key: 'find', value: function () { var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(selector) { var _this2 = this; var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var _options$skip2, skip, resp; return _regenerator2.default.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: _options$skip2 = options.skip, skip = _options$skip2 === undefined ? 0 : _options$skip2; resp = void 0; _context2.prev = 2; _context2.t0 = this.stackClient; _context2.t1 = (0, _utils.uri)(_templateObject2, this.doctype); _context2.next = 7; return this.toMangoOptions(selector, options); case 7: _context2.t2 = _context2.sent; _context2.next = 10; return _context2.t0.fetchJSON.call(_context2.t0, 'POST', _context2.t1, _context2.t2); case 10: resp = _context2.sent; _context2.next = 16; break; case 13: _context2.prev = 13; _context2.t3 = _context2['catch'](2); return _context2.abrupt('return', (0, _Collection.dontThrowNotFoundError)(_context2.t3)); case 16: return _context2.abrupt('return', { data: resp.docs.map(function (doc) { return normalizeDoc(doc, _this2.doctype); }), // Mango queries don't return the total count of rows, so if next = true, // we return a `meta.count` greater than the count of rows we have so that // 'fetchMore' features would work meta: { count: resp.next ? skip + resp.docs.length + 1 : resp.docs.length }, next: resp.next, skip: skip }); case 17: case 'end': return _context2.stop(); } } }, _callee2, this, [[2, 13]]); })); function find(_x4) { return _ref2.apply(this, arguments); } return find; }() /** * Get a document by id */ }, { key: 'get', value: function () { var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(id) { return _regenerator2.default.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: return _context3.abrupt('return', _Collection2.default.get(this.stackClient, (0, _utils.uri)(_templateObject, this.doctype, id), { normalize: this.constructor.normalizeDoctype(this.doctype) })); case 1: case 'end': return _context3.stop(); } } }, _callee3, this); })); function get(_x5) { return _ref3.apply(this, arguments); } return get; }() /** * Get many documents by id */ }, { key: 'getAll', value: function () { var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(ids) { var _this3 = this; var resp, rows; return _regenerator2.default.wrap(function _callee4$(_context4) { while (1) { switch (_context4.prev = _context4.next) { case 0: resp = void 0; _context4.prev = 1; _context4.next = 4; return this.stackClient.fetchJSON('POST', (0, _utils.uri)(_templateObject3, this.doctype), { keys: ids }); case 4: resp = _context4.sent; _context4.next = 10; break; case 7: _context4.prev = 7; _context4.t0 = _context4['catch'](1); return _context4.abrupt('return', (0, _Collection.dontThrowNotFoundError)(_context4.t0)); case 10: rows = resp.rows.filter(function (row) { return row.doc; }); return _context4.abrupt('return', { data: rows.map(function (row) { return normalizeDoc(row.doc, _this3.doctype); }), meta: { count: rows.length } }); case 12: case 'end': return _context4.stop(); } } }, _callee4, this, [[1, 7]]); })); function getAll(_x6) { return _ref4.apply(this, arguments); } return getAll; }() }, { key: 'create', value: function () { var _ref6 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(_ref5) { var _id = _ref5._id, _type = _ref5._type, document = (0, _objectWithoutProperties3.default)(_ref5, ['_id', '_type']); var hasFixedId, method, endpoint, resp; return _regenerator2.default.wrap(function _callee5$(_context5) { while (1) { switch (_context5.prev = _context5.next) { case 0: // In case of a fixed id, let's use the dedicated creation endpoint // https://github.com/cozy/cozy-stack/blob/master/docs/data-system.md#create-a-document-with-a-fixed-id hasFixedId = !!_id; method = hasFixedId ? 'PUT' : 'POST'; endpoint = (0, _utils.uri)(_templateObject, this.doctype, hasFixedId ? _id : ''); _context5.next = 5; return this.stackClient.fetchJSON(method, endpoint, document); case 5: resp = _context5.sent; return _context5.abrupt('return', { data: normalizeDoc(resp.data, this.doctype) }); case 7: case 'end': return _context5.stop(); } } }, _callee5, this); })); function create(_x7) { return _ref6.apply(this, arguments); } return create; }() /** * Updates a document */ }, { key: 'update', value: function () { var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6(document) { var resp; return _regenerator2.default.wrap(function _callee6$(_context6) { while (1) { switch (_context6.prev = _context6.next) { case 0: _context6.next = 2; return this.stackClient.fetchJSON('PUT', (0, _utils.uri)(_templateObject, this.doctype, document._id), document); case 2: resp = _context6.sent; return _context6.abrupt('return', { data: normalizeDoc(resp.data, this.doctype) }); case 4: case 'end': return _context6.stop(); } } }, _callee6, this); })); function update(_x8) { return _ref7.apply(this, arguments); } return update; }() /** * Destroys a document */ }, { key: 'destroy', value: function () { var _ref9 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(_ref8) { var _id = _ref8._id, _rev = _ref8._rev, document = (0, _objectWithoutProperties3.default)(_ref8, ['_id', '_rev']); var resp; return _regenerator2.default.wrap(function _callee7$(_context7) { while (1) { switch (_context7.prev = _context7.next) { case 0: _context7.next = 2; return this.stackClient.fetchJSON('DELETE', (0, _utils.uri)(_templateObject4, this.doctype, _id, _rev)); case 2: resp = _context7.sent; return _context7.abrupt('return', { data: normalizeDoc((0, _extends3.default)({}, document, { _id: _id, _rev: resp.rev, _deleted: true }), this.doctype) }); case 4: case 'end': return _context7.stop(); } } }, _callee7, this); })); function destroy(_x9) { return _ref9.apply(this, arguments); } return destroy; }() /** * Updates several documents in one batch * * @param {Document[]} docs */ }, { key: 'updateAll', value: function () { var _ref10 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee8(docs) { var stackClient, update, firstDoc, resp; return _regenerator2.default.wrap(function _callee8$(_context8) { while (1) { switch (_context8.prev = _context8.next) { case 0: stackClient = this.stackClient; if (!(!docs || !docs.length)) { _context8.next = 3; break; } return _context8.abrupt('return', _promise2.default.resolve([])); case 3: _context8.prev = 3; _context8.next = 6; return stackClient.fetchJSON('POST', '/data/' + this.doctype + '/_bulk_docs', { docs: docs }); case 6: update = _context8.sent; return _context8.abrupt('return', update); case 10: _context8.prev = 10; _context8.t0 = _context8['catch'](3); if (!(_context8.t0.reason && _context8.t0.reason.reason && _context8.t0.reason.reason === DATABASE_DOES_NOT_EXIST)) { _context8.next = 23; break; } _context8.next = 15; return this.create(docs[0]); case 15: firstDoc = _context8.sent; _context8.next = 18; return this.updateAll(docs.slice(1)); case 18: resp = _context8.sent; resp.unshift({ ok: true, id: firstDoc._id, rev: firstDoc._rev }); return _context8.abrupt('return', resp); case 23: throw _context8.t0; case 24: case 'end': return _context8.stop(); } } }, _callee8, this, [[3, 10]]); })); function updateAll(_x10) { return _ref10.apply(this, arguments); } return updateAll; }() /** * Deletes several documents in one batch * * @param {Document[]} docs - Documents to delete */ }, { key: 'destroyAll', value: function destroyAll(docs) { return this.updateAll(docs.map(flagForDeletion)); } }, { key: 'toMangoOptions', value: function () { var _ref11 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee9(selector) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var sort, indexedFields, fields, _options$skip3, skip, limit, indexId, sortOrders, sortOrder, _loop, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, field; return _regenerator2.default.wrap(function _callee9$(_context9) { while (1) { switch (_context9.prev = _context9.next) { case 0: sort = options.sort, indexedFields = options.indexedFields; fields = options.fields, _options$skip3 = options.skip, skip = _options$skip3 === undefined ? 0 : _options$skip3, limit = options.limit; if (sort && !Array.isArray(sort)) { console.warn('Passing an object to the "sort" is deprecated, please use an array instead.'); sort = (0, _transform2.default)(sort, function (acc, order, field) { return acc.push((0, _defineProperty3.default)({}, field, order)); }, []); } indexedFields = indexedFields ? indexedFields : this.getIndexFields({ sort: sort, selector: selector }); _context9.t0 = options.indexId; if (_context9.t0) { _context9.next = 9; break; } _context9.next = 8; return this.getIndexId(indexedFields); case 8: _context9.t0 = _context9.sent; case 9: indexId = _context9.t0; if (!sort) { _context9.next = 35; break; } sortOrders = (0, _uniq2.default)(sort.map(function (sortOption) { return (0, _head2.default)((0, _values2.default)(sortOption)); })); if (!(sortOrders.length > 1)) { _context9.next = 14; break; } throw new Error('Mango sort can only use a single order (asc or desc).'); case 14: sortOrder = sortOrders.length > 0 ? (0, _head2.default)(sortOrders) : 'asc'; _loop = function _loop(field) { if (!sort.find(function (sortOption) { return (0, _head2.default)((0, _keys2.default)(sortOption)) === field; })) sort.push((0, _defineProperty3.default)({}, field, sortOrder)); }; _iteratorNormalCompletion = true; _didIteratorError = false; _iteratorError = undefined; _context9.prev = 19; for (_iterator = (0, _getIterator3.default)(indexedFields); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { field = _step.value; _loop(field); } _context9.next = 27; break; case 23: _context9.prev = 23; _context9.t1 = _context9['catch'](19); _didIteratorError = true; _iteratorError = _context9.t1; case 27: _context9.prev = 27; _context9.prev = 28; if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } case 30: _context9.prev = 30; if (!_didIteratorError) { _context9.next = 33; break; } throw _iteratorError; case 33: return _context9.finish(30); case 34: return _context9.finish(27); case 35: return _context9.abrupt('return', { selector: selector, use_index: indexId, // TODO: type and class should not be necessary, it's just a temp fix for a stack bug fields: fields ? [].concat((0, _toConsumableArray3.default)(fields), ['_id', '_type', 'class']) : undefined, limit: limit, skip: skip, sort: sort }); case 36: case 'end': return _context9.stop(); } } }, _callee9, this, [[19, 23, 27, 35], [28,, 30, 34]]); })); function toMangoOptions(_x12) { return _ref11.apply(this, arguments); } return toMangoOptions; }() }, { key: 'checkUniquenessOf', value: function () { var _ref12 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee10(property, value) { var indexId, existingDocs; return _regenerator2.default.wrap(function _callee10$(_context10) { while (1) { switch (_context10.prev = _context10.next) { case 0: _context10.next = 2; return this.getUniqueIndexId(property); case 2: indexId = _context10.sent; _context10.next = 5; return this.find((0, _defineProperty3.default)({}, property, value), { indexId: indexId, fields: ['_id'] }); case 5: existingDocs = _context10.sent; return _context10.abrupt('return', existingDocs.data.length === 0); case 7: case 'end': return _context10.stop(); } } }, _callee10, this); })); function checkUniquenessOf(_x13, _x14) { return _ref12.apply(this, arguments); } return checkUniquenessOf; }() }, { key: 'getUniqueIndexId', value: function getUniqueIndexId(property) { return this.getIndexId([property], this.doctype + '/' + property); } }, { key: 'getIndexId', value: function () { var _ref13 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee11(fields) { var indexName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getIndexNameFromFields(fields); return _regenerator2.default.wrap(function _callee11$(_context11) { while (1) { switch (_context11.prev = _context11.next) { case 0: if (this.indexes[indexName]) { _context11.next = 4; break; } _context11.next = 3; return this.createIndex(fields); case 3: this.indexes[indexName] = _context11.sent; case 4: return _context11.abrupt('return', this.indexes[indexName].id); case 5: case 'end': return _context11.stop(); } } }, _callee11, this); })); function getIndexId(_x16) { return _ref13.apply(this, arguments); } return getIndexId; }() }, { key: 'createIndex', value: function () { var _ref14 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee12(fields) { var indexDef, resp, indexResp, selector, options; return _regenerator2.default.wrap(function _callee12$(_context12) { while (1) { switch (_context12.prev = _context12.next) { case 0: indexDef = { index: { fields: fields } }; _context12.next = 3; return this.stackClient.fetchJSON('POST', (0, _utils.uri)(_templateObject5, this.doctype), indexDef); case 3: resp = _context12.sent; indexResp = { id: resp.id, fields: fields }; if (!(resp.result === 'exists')) { _context12.next = 7; break; } return _context12.abrupt('return', indexResp); case 7: // indexes might not be usable right after being created; so we delay the resolving until they are selector = (0, _defineProperty3.default)({}, fields[0], { $gt: null }); options = { indexId: indexResp.id }; _context12.next = 11; return (0, _utils.attempt)(this.find(selector, options)); case 11: if (!_context12.sent) { _context12.next = 13; break; } return _context12.abrupt('return', indexResp); case 13: _context12.next = 15; return (0, _utils.sleep)(1000); case 15: _context12.next = 17; return (0, _utils.attempt)(this.find(selector, options)); case 17: if (!_context12.sent) { _context12.next = 19; break; } return _context12.abrupt('return', indexResp); case 19: _context12.next = 21; return (0, _utils.sleep)(500); case 21: return _context12.abrupt('return', indexResp); case 22: case 'end': return _context12.stop(); } } }, _callee12, this); })); function createIndex(_x17) { return _ref14.apply(this, arguments); } return createIndex; }() }, { key: 'getIndexNameFromFields', value: function getIndexNameFromFields(fields) { return 'by_' + fields.join('_and_'); } /** * Compute fields that should be indexed for a mango * query to work * * @private * @param {object} options - Mango query options * @returns {Array} - Fields to index */ }, { key: 'getIndexFields', value: function getIndexFields(_ref15) { var selector = _ref15.selector, _ref15$sort = _ref15.sort, sort = _ref15$sort === undefined ? [] : _ref15$sort; return (0, _from2.default)(new _set2.default([].concat((0, _toConsumableArray3.default)(sort.map(function (sortOption) { return (0, _head2.default)((0, _keys2.default)(sortOption)); })), (0, _toConsumableArray3.default)((0, _keys2.default)(selector))))); } /** * Use Couch _changes API * * @param {object} couchOptions Couch options for changes https://kutt.it/5r7MNQ * @param {object} options { includeDesign: false, includeDeleted: false } */ }, { key: 'fetchChanges', value: function () { var _ref16 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee13() { var couchOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var haveDocsIds, urlParams, method, endpoint, params, result, newLastSeq, docs; return _regenerator2.default.wrap(function _callee13$(_context13) { while (1) { switch (_context13.prev = _context13.next) { case 0: haveDocsIds = couchOptions.doc_ids && couchOptions.doc_ids.length > 0; urlParams = ''; if ((typeof couchOptions === 'undefined' ? 'undefined' : (0, _typeof3.default)(couchOptions)) !== 'object') { urlParams = '?include_docs=true&since=' + couchOptions; console.warn('fetchChanges use couchOptions as Object not a string, since is deprecated, please use fetchChanges({include_docs: true, since: "' + couchOptions + '"}).'); } else if ((0, _keys2.default)(couchOptions).length > 0) { urlParams = '?' + [_qs2.default.stringify((0, _omit2.default)(couchOptions, 'doc_ids')), haveDocsIds && couchOptions.filter === undefined ? 'filter=_doc_ids' : undefined].filter(Boolean).join('&'); } method = haveDocsIds ? 'POST' : 'GET'; endpoint = '/data/' + this.doctype + '/_changes' + urlParams; params = haveDocsIds ? { doc_ids: couchOptions.doc_ids } : undefined; _context13.next = 8; return this.stackClient.fetchJSON(method, endpoint, params); case 8: result = _context13.sent; newLastSeq = result.last_seq; docs = result.results.map(function (x) { return x.doc; }).filter(Boolean); if (!options.includeDesign) { docs = docs.filter(function (doc) { return doc._id.indexOf('_design') !== 0; }); } if (!options.includeDeleted) { docs = docs.filter(function (doc) { return !doc._deleted; }); } return _context13.abrupt('return', { newLastSeq: newLastSeq, documents: docs }); case 14: case 'end': return _context13.stop(); } } }, _callee13, this); })); function fetchChanges() { return _ref16.apply(this, arguments); } return fetchChanges; }() }], [{ key: 'normalizeDoctype', value: function normalizeDoctype(doctype) { return this.normalizeDoctypeRawApi(doctype); } /** * `normalizeDoctype` for api end points returning json api responses * * @private * @param {string} doctype * @returns {Function} (data, response) => normalizedDocument * using `normalizeDoc` */ }, { key: 'normalizeDoctypeJsonApi', value: function normalizeDoctypeJsonApi(doctype) { return function (data, response) { // use the "data" attribute of the response return normalizeDoc(data, doctype); }; } /** * `normalizeDoctype` for api end points returning raw documents * * @private * @param {string} doctype * @returns {Function} (data, response) => normalizedDocument * using `normalizeDoc` */ }, { key: 'normalizeDoctypeRawApi', value: function normalizeDoctypeRawApi(doctype) { return function (data, response) { // use the response directly return normalizeDoc(response, doctype); }; } }]); return DocumentCollection; }(); exports.default = DocumentCollection; var normalizeDoctype = exports.normalizeDoctype = DocumentCollection.normalizeDoctype; /***/ }), /* 970 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__(971), __esModule: true }; /***/ }), /* 971 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(801); __webpack_require__(768); __webpack_require__(791); __webpack_require__(972); __webpack_require__(973); __webpack_require__(974); __webpack_require__(975); module.exports = __webpack_require__(734).Set; /***/ }), /* 972 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var strong = __webpack_require__(820); var validate = __webpack_require__(822); var SET = 'Set'; // 23.2 Set Objects module.exports = __webpack_require__(823)(SET, function (get) { return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; }, { // 23.2.3.1 Set.prototype.add(value) add: function add(value) { return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value); } }, strong); /***/ }), /* 973 */ /***/ (function(module, exports, __webpack_require__) { // https://github.com/DavidBruant/Map-Set.prototype.toJSON var $export = __webpack_require__(732); $export($export.P + $export.R, 'Set', { toJSON: __webpack_require__(829)('Set') }); /***/ }), /* 974 */ /***/ (function(module, exports, __webpack_require__) { // https://tc39.github.io/proposal-setmap-offrom/#sec-set.of __webpack_require__(832)('Set'); /***/ }), /* 975 */ /***/ (function(module, exports, __webpack_require__) { // https://tc39.github.io/proposal-setmap-offrom/#sec-set.from __webpack_require__(834)('Set'); /***/ }), /* 976 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var _defineProperties = __webpack_require__(977); var _defineProperties2 = _interopRequireDefault(_defineProperties); var _freeze = __webpack_require__(980); var _freeze2 = _interopRequireDefault(_freeze); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = function (strings, raw) { return (0, _freeze2.default)((0, _defineProperties2.default)(strings, { raw: { value: (0, _freeze2.default)(raw) } })); }; /***/ }), /* 977 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__(978), __esModule: true }; /***/ }), /* 978 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(979); var $Object = __webpack_require__(734).Object; module.exports = function defineProperties(T, D) { return $Object.defineProperties(T, D); }; /***/ }), /* 979 */ /***/ (function(module, exports, __webpack_require__) { var $export = __webpack_require__(732); // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) $export($export.S + $export.F * !__webpack_require__(742), 'Object', { defineProperties: __webpack_require__(775) }); /***/ }), /* 980 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__(981), __esModule: true }; /***/ }), /* 981 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(982); module.exports = __webpack_require__(734).Object.freeze; /***/ }), /* 982 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.5 Object.freeze(O) var isObject = __webpack_require__(740); var meta = __webpack_require__(821).onFreeze; __webpack_require__(838)('freeze', function ($freeze) { return function freeze(it) { return $freeze && isObject(it) ? $freeze(meta(it)) : it; }; }); /***/ }), /* 983 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.formatBytes = exports.forceFileDownload = exports.slugify = exports.sleep = exports.attempt = exports.uri = undefined; var _promise = __webpack_require__(799); var _promise2 = _interopRequireDefault(_promise); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * @function * @description Template tag function for URIs encoding * * Will automatically apply `encodeURIComponent` to template literal placeholders * * @example * ``` * const safe = uri`/data/${doctype}/_all_docs?limit=${limit}` * ``` * * @private */ var uri = exports.uri = function uri(strings) { for (var _len = arguments.length, values = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { values[_key - 1] = arguments[_key]; } var parts = [strings[0]]; for (var i = 0; i < values.length; i++) { parts.push(encodeURIComponent(values[i]) + strings[i + 1]); } return parts.join(''); }; /** * @function * @description Helps to avoid nested try/catch when using async/await * * Inspired by a Go pattern: http://blog.grossman.io/how-to-write-async-await-without-try-catch-blocks-in-javascript/ * * @example * ``` * if (await attempt(collection.all()) return * await sleep(1000) * if (await attempt(collection.all()) return * await sleep(1000) * return * ``` * * @private */ var attempt = exports.attempt = function attempt(promise) { return promise.then(function () { return true; }).catch(function () { return false; }); }; /** * @function * @description Helps to avoid nested try/catch when using async/await — see documentation for attempt * @private */ var sleep = exports.sleep = function sleep(time, args) { return new _promise2.default(function (resolve) { setTimeout(resolve, time, args); }); }; var slugify = exports.slugify = function slugify(text) { return text.toString().toLowerCase().replace(/\s+/g, '-') // Replace spaces with - .replace(/[^\w-]+/g, '') // Remove all non-word chars .replace(/--+/g, '-') // Replace multiple - with single - .replace(/^-+/, '') // Trim - from start of text .replace(/-+$/, ''); }; // Trim - from end of text var forceFileDownload = exports.forceFileDownload = function forceFileDownload(href, filename) { var element = document.createElement('a'); element.setAttribute('href', href); element.setAttribute('download', filename); element.style.display = 'none'; document.body.appendChild(element); element.click(); document.body.removeChild(element); }; var formatBytes = exports.formatBytes = function formatBytes(bytes) { var decimals = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2; if (bytes === 0) return '0 Bytes'; var k = 1024; var dm = decimals < 0 ? 0 : decimals; var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; var i = Math.floor(Math.log(bytes) / Math.log(k)); return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i]; }; /***/ }), /* 984 */ /***/ (function(module, exports, __webpack_require__) { var baseUniq = __webpack_require__(613); /** * Creates a duplicate-free version of an array, using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons, in which only the first occurrence of each element * is kept. The order of result values is determined by the order they occur * in the array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @returns {Array} Returns the new duplicate free array. * @example * * _.uniq([2, 1, 2]); * // => [2, 1] */ function uniq(array) { return (array && array.length) ? baseUniq(array) : []; } module.exports = uniq; /***/ }), /* 985 */ /***/ (function(module, exports, __webpack_require__) { var arrayEach = __webpack_require__(443), baseCreate = __webpack_require__(420), baseForOwn = __webpack_require__(460), baseIteratee = __webpack_require__(543), getPrototype = __webpack_require__(536), isArray = __webpack_require__(75), isBuffer = __webpack_require__(395), isFunction = __webpack_require__(65), isObject = __webpack_require__(72), isTypedArray = __webpack_require__(397); /** * An alternative to `_.reduce`; this method transforms `object` to a new * `accumulator` object which is the result of running each of its own * enumerable string keyed properties thru `iteratee`, with each invocation * potentially mutating the `accumulator` object. If `accumulator` is not * provided, a new object with the same `[[Prototype]]` will be used. The * iteratee is invoked with four arguments: (accumulator, value, key, object). * Iteratee functions may exit iteration early by explicitly returning `false`. * * @static * @memberOf _ * @since 1.3.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {*} [accumulator] The custom accumulator value. * @returns {*} Returns the accumulated value. * @example * * _.transform([2, 3, 4], function(result, n) { * result.push(n *= n); * return n % 2 == 0; * }, []); * // => [4, 9] * * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { * (result[value] || (result[value] = [])).push(key); * }, {}); * // => { '1': ['a', 'c'], '2': ['b'] } */ function transform(object, iteratee, accumulator) { var isArr = isArray(object), isArrLike = isArr || isBuffer(object) || isTypedArray(object); iteratee = baseIteratee(iteratee, 4); if (accumulator == null) { var Ctor = object && object.constructor; if (isArrLike) { accumulator = isArr ? new Ctor : []; } else if (isObject(object)) { accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; } else { accumulator = {}; } } (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { return iteratee(accumulator, value, index, object); }); return accumulator; } module.exports = transform; /***/ }), /* 986 */ /***/ (function(module, exports) { /** * Gets the first element of `array`. * * @static * @memberOf _ * @since 0.1.0 * @alias first * @category Array * @param {Array} array The array to query. * @returns {*} Returns the first element of `array`. * @example * * _.head([1, 2, 3]); * // => 1 * * _.head([]); * // => undefined */ function head(array) { return (array && array.length) ? array[0] : undefined; } module.exports = head; /***/ }), /* 987 */ /***/ (function(module, exports, __webpack_require__) { var baseClamp = __webpack_require__(988), baseToString = __webpack_require__(579), toInteger = __webpack_require__(454), toString = __webpack_require__(578); /** * Checks if `string` starts with the given target string. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to inspect. * @param {string} [target] The string to search for. * @param {number} [position=0] The position to search from. * @returns {boolean} Returns `true` if `string` starts with `target`, * else `false`. * @example * * _.startsWith('abc', 'a'); * // => true * * _.startsWith('abc', 'b'); * // => false * * _.startsWith('abc', 'b', 1); * // => true */ function startsWith(string, target, position) { string = toString(string); position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length); target = baseToString(target); return string.slice(position, position + target.length) == target; } module.exports = startsWith; /***/ }), /* 988 */ /***/ (function(module, exports) { /** * The base implementation of `_.clamp` which doesn't coerce arguments. * * @private * @param {number} number The number to clamp. * @param {number} [lower] The lower bound. * @param {number} upper The upper bound. * @returns {number} Returns the clamped number. */ function baseClamp(number, lower, upper) { if (number === number) { if (upper !== undefined) { number = number <= upper ? number : upper; } if (lower !== undefined) { number = number >= lower ? number : lower; } } return number; } module.exports = baseClamp; /***/ }), /* 989 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var stringify = __webpack_require__(990); var parse = __webpack_require__(993); var formats = __webpack_require__(992); module.exports = { formats: formats, parse: parse, stringify: stringify }; /***/ }), /* 990 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var utils = __webpack_require__(991); var formats = __webpack_require__(992); var has = Object.prototype.hasOwnProperty; var arrayPrefixGenerators = { brackets: function brackets(prefix) { return prefix + '[]'; }, comma: 'comma', indices: function indices(prefix, key) { return prefix + '[' + key + ']'; }, repeat: function repeat(prefix) { return prefix; } }; var isArray = Array.isArray; var push = Array.prototype.push; var pushToArray = function (arr, valueOrArray) { push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]); }; var toISO = Date.prototype.toISOString; var defaultFormat = formats['default']; var defaults = { addQueryPrefix: false, allowDots: false, charset: 'utf-8', charsetSentinel: false, delimiter: '&', encode: true, encoder: utils.encode, encodeValuesOnly: false, format: defaultFormat, formatter: formats.formatters[defaultFormat], // deprecated indices: false, serializeDate: function serializeDate(date) { return toISO.call(date); }, skipNulls: false, strictNullHandling: false }; var isNonNullishPrimitive = function isNonNullishPrimitive(v) { return typeof v === 'string' || typeof v === 'number' || typeof v === 'boolean' || typeof v === 'symbol' || typeof v === 'bigint'; }; var stringify = function stringify( object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly, charset ) { var obj = object; if (typeof filter === 'function') { obj = filter(prefix, obj); } else if (obj instanceof Date) { obj = serializeDate(obj); } else if (generateArrayPrefix === 'comma' && isArray(obj)) { obj = obj.join(','); } if (obj === null) { if (strictNullHandling) { return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key') : prefix; } obj = ''; } if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) { if (encoder) { var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key'); return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value'))]; } return [formatter(prefix) + '=' + formatter(String(obj))]; } var values = []; if (typeof obj === 'undefined') { return values; } var objKeys; if (isArray(filter)) { objKeys = filter; } else { var keys = Object.keys(obj); objKeys = sort ? keys.sort(sort) : keys; } for (var i = 0; i < objKeys.length; ++i) { var key = objKeys[i]; if (skipNulls && obj[key] === null) { continue; } if (isArray(obj)) { pushToArray(values, stringify( obj[key], typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly, charset )); } else { pushToArray(values, stringify( obj[key], prefix + (allowDots ? '.' + key : '[' + key + ']'), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly, charset )); } } return values; }; var normalizeStringifyOptions = function normalizeStringifyOptions(opts) { if (!opts) { return defaults; } if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') { throw new TypeError('Encoder has to be a function.'); } var charset = opts.charset || defaults.charset; if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); } var format = formats['default']; if (typeof opts.format !== 'undefined') { if (!has.call(formats.formatters, opts.format)) { throw new TypeError('Unknown format option provided.'); } format = opts.format; } var formatter = formats.formatters[format]; var filter = defaults.filter; if (typeof opts.filter === 'function' || isArray(opts.filter)) { filter = opts.filter; } return { addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots, charset: charset, charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter, encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode, encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder, encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly, filter: filter, formatter: formatter, serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate, skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls, sort: typeof opts.sort === 'function' ? opts.sort : null, strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling }; }; module.exports = function (object, opts) { var obj = object; var options = normalizeStringifyOptions(opts); var objKeys; var filter; if (typeof options.filter === 'function') { filter = options.filter; obj = filter('', obj); } else if (isArray(options.filter)) { filter = options.filter; objKeys = filter; } var keys = []; if (typeof obj !== 'object' || obj === null) { return ''; } var arrayFormat; if (opts && opts.arrayFormat in arrayPrefixGenerators) { arrayFormat = opts.arrayFormat; } else if (opts && 'indices' in opts) { arrayFormat = opts.indices ? 'indices' : 'repeat'; } else { arrayFormat = 'indices'; } var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; if (!objKeys) { objKeys = Object.keys(obj); } if (options.sort) { objKeys.sort(options.sort); } for (var i = 0; i < objKeys.length; ++i) { var key = objKeys[i]; if (options.skipNulls && obj[key] === null) { continue; } pushToArray(keys, stringify( obj[key], key, generateArrayPrefix, options.strictNullHandling, options.skipNulls, options.encode ? options.encoder : null, options.filter, options.sort, options.allowDots, options.serializeDate, options.formatter, options.encodeValuesOnly, options.charset )); } var joined = keys.join(options.delimiter); var prefix = options.addQueryPrefix === true ? '?' : ''; if (options.charsetSentinel) { if (options.charset === 'iso-8859-1') { // encodeURIComponent('✓'), the "numeric entity" representation of a checkmark prefix += 'utf8=%26%2310003%3B&'; } else { // encodeURIComponent('✓') prefix += 'utf8=%E2%9C%93&'; } } return joined.length > 0 ? prefix + joined : ''; }; /***/ }), /* 991 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var has = Object.prototype.hasOwnProperty; var isArray = Array.isArray; var hexTable = (function () { var array = []; for (var i = 0; i < 256; ++i) { array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); } return array; }()); var compactQueue = function compactQueue(queue) { while (queue.length > 1) { var item = queue.pop(); var obj = item.obj[item.prop]; if (isArray(obj)) { var compacted = []; for (var j = 0; j < obj.length; ++j) { if (typeof obj[j] !== 'undefined') { compacted.push(obj[j]); } } item.obj[item.prop] = compacted; } } }; var arrayToObject = function arrayToObject(source, options) { var obj = options && options.plainObjects ? Object.create(null) : {}; for (var i = 0; i < source.length; ++i) { if (typeof source[i] !== 'undefined') { obj[i] = source[i]; } } return obj; }; var merge = function merge(target, source, options) { if (!source) { return target; } if (typeof source !== 'object') { if (isArray(target)) { target.push(source); } else if (target && typeof target === 'object') { if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) { target[source] = true; } } else { return [target, source]; } return target; } if (!target || typeof target !== 'object') { return [target].concat(source); } var mergeTarget = target; if (isArray(target) && !isArray(source)) { mergeTarget = arrayToObject(target, options); } if (isArray(target) && isArray(source)) { source.forEach(function (item, i) { if (has.call(target, i)) { var targetItem = target[i]; if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') { target[i] = merge(targetItem, item, options); } else { target.push(item); } } else { target[i] = item; } }); return target; } return Object.keys(source).reduce(function (acc, key) { var value = source[key]; if (has.call(acc, key)) { acc[key] = merge(acc[key], value, options); } else { acc[key] = value; } return acc; }, mergeTarget); }; var assign = function assignSingleSource(target, source) { return Object.keys(source).reduce(function (acc, key) { acc[key] = source[key]; return acc; }, target); }; var decode = function (str, decoder, charset) { var strWithoutPlus = str.replace(/\+/g, ' '); if (charset === 'iso-8859-1') { // unescape never throws, no try...catch needed: return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); } // utf-8 try { return decodeURIComponent(strWithoutPlus); } catch (e) { return strWithoutPlus; } }; var encode = function encode(str, defaultEncoder, charset) { // This code was originally written by Brian White (mscdex) for the io.js core querystring library. // It has been adapted here for stricter adherence to RFC 3986 if (str.length === 0) { return str; } var string = str; if (typeof str === 'symbol') { string = Symbol.prototype.toString.call(str); } else if (typeof str !== 'string') { string = String(str); } if (charset === 'iso-8859-1') { return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) { return '%26%23' + parseInt($0.slice(2), 16) + '%3B'; }); } var out = ''; for (var i = 0; i < string.length; ++i) { var c = string.charCodeAt(i); if ( c === 0x2D // - || c === 0x2E // . || c === 0x5F // _ || c === 0x7E // ~ || (c >= 0x30 && c <= 0x39) // 0-9 || (c >= 0x41 && c <= 0x5A) // a-z || (c >= 0x61 && c <= 0x7A) // A-Z ) { out += string.charAt(i); continue; } if (c < 0x80) { out = out + hexTable[c]; continue; } if (c < 0x800) { out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]); continue; } if (c < 0xD800 || c >= 0xE000) { out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); continue; } i += 1; c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); out += hexTable[0xF0 | (c >> 18)] + hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]; } return out; }; var compact = function compact(value) { var queue = [{ obj: { o: value }, prop: 'o' }]; var refs = []; for (var i = 0; i < queue.length; ++i) { var item = queue[i]; var obj = item.obj[item.prop]; var keys = Object.keys(obj); for (var j = 0; j < keys.length; ++j) { var key = keys[j]; var val = obj[key]; if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { queue.push({ obj: obj, prop: key }); refs.push(val); } } } compactQueue(queue); return value; }; var isRegExp = function isRegExp(obj) { return Object.prototype.toString.call(obj) === '[object RegExp]'; }; var isBuffer = function isBuffer(obj) { if (!obj || typeof obj !== 'object') { return false; } return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); }; var combine = function combine(a, b) { return [].concat(a, b); }; module.exports = { arrayToObject: arrayToObject, assign: assign, combine: combine, compact: compact, decode: decode, encode: encode, isBuffer: isBuffer, isRegExp: isRegExp, merge: merge }; /***/ }), /* 992 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var replace = String.prototype.replace; var percentTwenties = /%20/g; var util = __webpack_require__(991); var Format = { RFC1738: 'RFC1738', RFC3986: 'RFC3986' }; module.exports = util.assign( { 'default': Format.RFC3986, formatters: { RFC1738: function (value) { return replace.call(value, percentTwenties, '+'); }, RFC3986: function (value) { return String(value); } } }, Format ); /***/ }), /* 993 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var utils = __webpack_require__(991); var has = Object.prototype.hasOwnProperty; var defaults = { allowDots: false, allowPrototypes: false, arrayLimit: 20, charset: 'utf-8', charsetSentinel: false, comma: false, decoder: utils.decode, delimiter: '&', depth: 5, ignoreQueryPrefix: false, interpretNumericEntities: false, parameterLimit: 1000, parseArrays: true, plainObjects: false, strictNullHandling: false }; var interpretNumericEntities = function (str) { return str.replace(/&#(\d+);/g, function ($0, numberStr) { return String.fromCharCode(parseInt(numberStr, 10)); }); }; // This is what browsers will submit when the ✓ character occurs in an // application/x-www-form-urlencoded body and the encoding of the page containing // the form is iso-8859-1, or when the submitted form has an accept-charset // attribute of iso-8859-1. Presumably also with other charsets that do not contain // the ✓ character, such as us-ascii. var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓') // These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded. var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓') var parseValues = function parseQueryStringValues(str, options) { var obj = {}; var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; var parts = cleanStr.split(options.delimiter, limit); var skipIndex = -1; // Keep track of where the utf8 sentinel was found var i; var charset = options.charset; if (options.charsetSentinel) { for (i = 0; i < parts.length; ++i) { if (parts[i].indexOf('utf8=') === 0) { if (parts[i] === charsetSentinel) { charset = 'utf-8'; } else if (parts[i] === isoSentinel) { charset = 'iso-8859-1'; } skipIndex = i; i = parts.length; // The eslint settings do not allow break; } } } for (i = 0; i < parts.length; ++i) { if (i === skipIndex) { continue; } var part = parts[i]; var bracketEqualsPos = part.indexOf(']='); var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1; var key, val; if (pos === -1) { key = options.decoder(part, defaults.decoder, charset, 'key'); val = options.strictNullHandling ? null : ''; } else { key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key'); val = options.decoder(part.slice(pos + 1), defaults.decoder, charset, 'value'); } if (val && options.interpretNumericEntities && charset === 'iso-8859-1') { val = interpretNumericEntities(val); } if (val && options.comma && val.indexOf(',') > -1) { val = val.split(','); } if (has.call(obj, key)) { obj[key] = utils.combine(obj[key], val); } else { obj[key] = val; } } return obj; }; var parseObject = function (chain, val, options) { var leaf = val; for (var i = chain.length - 1; i >= 0; --i) { var obj; var root = chain[i]; if (root === '[]' && options.parseArrays) { obj = [].concat(leaf); } else { obj = options.plainObjects ? Object.create(null) : {}; var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; var index = parseInt(cleanRoot, 10); if (!options.parseArrays && cleanRoot === '') { obj = { 0: leaf }; } else if ( !isNaN(index) && root !== cleanRoot && String(index) === cleanRoot && index >= 0 && (options.parseArrays && index <= options.arrayLimit) ) { obj = []; obj[index] = leaf; } else { obj[cleanRoot] = leaf; } } leaf = obj; } return leaf; }; var parseKeys = function parseQueryStringKeys(givenKey, val, options) { if (!givenKey) { return; } // Transform dot notation to bracket notation var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey; // The regex chunks var brackets = /(\[[^[\]]*])/; var child = /(\[[^[\]]*])/g; // Get the parent var segment = options.depth > 0 && brackets.exec(key); var parent = segment ? key.slice(0, segment.index) : key; // Stash the parent if it exists var keys = []; if (parent) { // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties if (!options.plainObjects && has.call(Object.prototype, parent)) { if (!options.allowPrototypes) { return; } } keys.push(parent); } // Loop through children appending to the array until we hit depth var i = 0; while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) { i += 1; if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { if (!options.allowPrototypes) { return; } } keys.push(segment[1]); } // If there's a remainder, just add whatever is left if (segment) { keys.push('[' + key.slice(segment.index) + ']'); } return parseObject(keys, val, options); }; var normalizeParseOptions = function normalizeParseOptions(opts) { if (!opts) { return defaults; } if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') { throw new TypeError('Decoder has to be a function.'); } if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { throw new Error('The charset option must be either utf-8, iso-8859-1, or undefined'); } var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset; return { allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots, allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes, arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit, charset: charset, charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma, decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder, delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter, // eslint-disable-next-line no-implicit-coercion, no-extra-parens depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth, ignoreQueryPrefix: opts.ignoreQueryPrefix === true, interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities, parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit, parseArrays: opts.parseArrays !== false, plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects, strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling }; }; module.exports = function (str, opts) { var options = normalizeParseOptions(opts); if (str === '' || str === null || typeof str === 'undefined') { return options.plainObjects ? Object.create(null) : {}; } var tempObj = typeof str === 'string' ? parseValues(str, options) : str; var obj = options.plainObjects ? Object.create(null) : {}; // Iterate over the keys and setup the new object var keys = Object.keys(tempObj); for (var i = 0; i < keys.length; ++i) { var key = keys[i]; var newObj = parseKeys(key, tempObj[key], options); obj = utils.merge(obj, newObj, options); } return utils.compact(obj); }; /***/ }), /* 994 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Collection = exports.dontThrowNotFoundError = undefined; var _regenerator = __webpack_require__(619); var _regenerator2 = _interopRequireDefault(_regenerator); var _asyncToGenerator2 = __webpack_require__(849); var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); var _classCallCheck2 = __webpack_require__(851); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = __webpack_require__(852); var _createClass3 = _interopRequireDefault(_createClass2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Handler for error response which return a empty value for "not found" error * * @param {Error} error * @param {Array|object} data Data to return in case of "not found" error * @returns {object} JsonAPI response with empty data in case of "not * found" error. */ var dontThrowNotFoundError = exports.dontThrowNotFoundError = function dontThrowNotFoundError(error) { var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; if (error.message.match(/not_found/)) { var expectsCollection = Array.isArray(data); // Return expected JsonAPI attributes : collections are expecting // meta, skip and next attribute return expectsCollection ? { data: data, meta: { count: 0 }, skip: 0, next: false } : { data: data }; } throw error; }; /** * Utility class to abstract an regroup identical methods and logics for * specific collections. */ var Collection = exports.Collection = function () { function Collection() { (0, _classCallCheck3.default)(this, Collection); } (0, _createClass3.default)(Collection, null, [{ key: 'get', /** * Utility method aimed to return only one document. * * @param {object} stackClient * @param {string} endpoint Stack endpoint * @param {object} options * @param {Func} options.normalize Callback to normalize response data * (default `data => data`) * @param {string} options.method HTTP method (default `GET`) * @returns {object} JsonAPI response containing normalized * document as data attribute */ value: function () { var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(stackClient, endpoint, _ref) { var _ref$normalize = _ref.normalize, normalize = _ref$normalize === undefined ? function (data, response) { return data; } : _ref$normalize, _ref$method = _ref.method, method = _ref$method === undefined ? 'GET' : _ref$method; var resp; return _regenerator2.default.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _context.prev = 0; _context.next = 3; return stackClient.fetchJSON(method, endpoint); case 3: resp = _context.sent; return _context.abrupt('return', { data: normalize(resp.data, resp) }); case 7: _context.prev = 7; _context.t0 = _context['catch'](0); return _context.abrupt('return', dontThrowNotFoundError(_context.t0, null)); case 10: case 'end': return _context.stop(); } } }, _callee, this, [[0, 7]]); })); function get(_x2, _x3, _x4) { return _ref2.apply(this, arguments); } return get; }() }]); return Collection; }(); exports.default = Collection; /***/ }), /* 995 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.buildURL = exports.encode = undefined; var _slicedToArray2 = __webpack_require__(788); var _slicedToArray3 = _interopRequireDefault(_slicedToArray2); var _entries = __webpack_require__(729); var _entries2 = _interopRequireDefault(_entries); var _pickBy = __webpack_require__(890); var _pickBy2 = _interopRequireDefault(_pickBy); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var encodeValues = function encodeValues(values) { var fromArray = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (Array.isArray(values)) { return '[' + values.map(function (v) { return encodeValues(v, true); }).join(',') + ']'; } return fromArray ? encodeURIComponent('"' + values + '"') : encodeURIComponent(values); }; /** * Encode an object as querystring, values are encoded as * URI components, keys are not. * * @function * @private */ var encode = exports.encode = function encode(data) { return (0, _entries2.default)(data).map(function (_ref) { var _ref2 = (0, _slicedToArray3.default)(_ref, 2), k = _ref2[0], v = _ref2[1]; var encodedValue = encodeValues(v); return k + '=' + encodedValue; }).join('&'); }; /** * Returns a URL from base url and a query parameter object. * Any undefined parameter is removed. * * @function * @private */ var buildURL = exports.buildURL = function buildURL(url, params) { var qs = encode((0, _pickBy2.default)(params)); if (qs) { return url + '?' + qs; } else { return url; } }; /***/ }), /* 996 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _classCallCheck2 = __webpack_require__(851); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = __webpack_require__(852); var _createClass3 = _interopRequireDefault(_createClass2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var AppToken = function () { function AppToken(token) { (0, _classCallCheck3.default)(this, AppToken); this.token = token || ''; } (0, _createClass3.default)(AppToken, [{ key: 'toAuthHeader', value: function toAuthHeader() { return 'Bearer ' + this.token; } }, { key: 'toBasicAuth', value: function toBasicAuth() { return 'user:' + this.token + '@'; } /** * Get the app token string * * @see CozyStackClient.getAccessToken * @returns {string} token */ }, { key: 'getAccessToken', value: function getAccessToken() { return this.token; } }]); return AppToken; }(); exports.default = AppToken; /***/ }), /* 997 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isDirectory = exports.isFile = undefined; var _typeof2 = __webpack_require__(862); var _typeof3 = _interopRequireDefault(_typeof2); var _objectWithoutProperties2 = __webpack_require__(850); var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); var _getIterator2 = __webpack_require__(796); var _getIterator3 = _interopRequireDefault(_getIterator2); var _taggedTemplateLiteral2 = __webpack_require__(976); var _taggedTemplateLiteral3 = _interopRequireDefault(_taggedTemplateLiteral2); var _regenerator = __webpack_require__(619); var _regenerator2 = _interopRequireDefault(_regenerator); var _asyncToGenerator2 = __webpack_require__(849); var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); var _getPrototypeOf = __webpack_require__(858); var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); var _classCallCheck2 = __webpack_require__(851); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = __webpack_require__(852); var _createClass3 = _interopRequireDefault(_createClass2); var _possibleConstructorReturn2 = __webpack_require__(861); var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); var _inherits2 = __webpack_require__(876); var _inherits3 = _interopRequireDefault(_inherits2); var _promise = __webpack_require__(799); var _promise2 = _interopRequireDefault(_promise); var _extends2 = __webpack_require__(843); var _extends3 = _interopRequireDefault(_extends2); var _templateObject = (0, _taggedTemplateLiteral3.default)(['/data/', '/', '/relationships/references'], ['/data/', '/', '/relationships/references']), _templateObject2 = (0, _taggedTemplateLiteral3.default)(['/files/', '/relationships/referenced_by'], ['/files/', '/relationships/referenced_by']), _templateObject3 = (0, _taggedTemplateLiteral3.default)(['/files/', ''], ['/files/', '']), _templateObject4 = (0, _taggedTemplateLiteral3.default)(['/files/trash/', ''], ['/files/trash/', '']), _templateObject5 = (0, _taggedTemplateLiteral3.default)(['/files/', '?Name=', '&Type=file&Executable=', '&MetadataID=', ''], ['/files/', '?Name=', '&Type=file&Executable=', '&MetadataID=', '']), _templateObject6 = (0, _taggedTemplateLiteral3.default)(['/files/', '?Name=', '&Type=file&Executable=', ''], ['/files/', '?Name=', '&Type=file&Executable=', '']), _templateObject7 = (0, _taggedTemplateLiteral3.default)(['/files/downloads?Id=', '&Filename=', ''], ['/files/downloads?Id=', '&Filename=', '']), _templateObject8 = (0, _taggedTemplateLiteral3.default)(['/files/downloads?VersionId=', '&Filename=', ''], ['/files/downloads?VersionId=', '&Filename=', '']), _templateObject9 = (0, _taggedTemplateLiteral3.default)(['/files/downloads?Path=', ''], ['/files/downloads?Path=', '']), _templateObject10 = (0, _taggedTemplateLiteral3.default)(['/files/metadata?Path=', ''], ['/files/metadata?Path=', '']), _templateObject11 = (0, _taggedTemplateLiteral3.default)(['/files/', '?Name=', '&Type=directory'], ['/files/', '?Name=', '&Type=directory']), _templateObject12 = (0, _taggedTemplateLiteral3.default)(['/files/upload/metadata'], ['/files/upload/metadata']), _templateObject13 = (0, _taggedTemplateLiteral3.default)(['/files/', '/versions'], ['/files/', '/versions']); var _lite = __webpack_require__(998); var _lite2 = _interopRequireDefault(_lite); var _has = __webpack_require__(1001); var _has2 = _interopRequireDefault(_has); var _DocumentCollection2 = __webpack_require__(969); var _DocumentCollection3 = _interopRequireDefault(_DocumentCollection2); var _utils = __webpack_require__(983); var _querystring = __webpack_require__(995); var querystring = _interopRequireWildcard(_querystring); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var ROOT_DIR_ID = 'io.cozy.files.root-dir'; var CONTENT_TYPE_OCTET_STREAM = 'application/octet-stream'; var normalizeFile = function normalizeFile(file) { return (0, _extends3.default)({}, (0, _DocumentCollection2.normalizeDoc)(file, 'io.cozy.files'), file.attributes); }; var sanitizeFileName = function sanitizeFileName(name) { return name && name.trim(); }; var getFileTypeFromName = function getFileTypeFromName(name) { return _lite2.default.getType(name) || CONTENT_TYPE_OCTET_STREAM; }; var isFile = exports.isFile = function isFile(_ref) { var _type = _ref._type, type = _ref.type; return _type === 'io.cozy.files' || type === 'directory' || type === 'file'; }; var isDirectory = exports.isDirectory = function isDirectory(_ref2) { var type = _ref2.type; return type === 'directory'; }; var raceWithCondition = function raceWithCondition(promises, predicate) { return new _promise2.default(function (resolve) { promises.forEach(function (p) { return p.then(function (res) { if (predicate(res)) { resolve(true); } }); }); _promise2.default.all(promises).then(function () { return resolve(false); }); }); }; var dirName = function dirName(path) { var lastIndex = path.lastIndexOf('/'); return path.substring(0, lastIndex); }; /** * Implements `DocumentCollection` API along with specific methods for * `io.cozy.files`. * * Files are a special type of documents and are handled differently by the stack: * special routes are to be used, and there is a notion of referenced files, aka * files associated to a specific document */ var FileCollection = function (_DocumentCollection) { (0, _inherits3.default)(FileCollection, _DocumentCollection); function FileCollection(doctype, stackClient) { (0, _classCallCheck3.default)(this, FileCollection); var _this = (0, _possibleConstructorReturn3.default)(this, (FileCollection.__proto__ || (0, _getPrototypeOf2.default)(FileCollection)).call(this, doctype, stackClient)); _this.extractResponseLinkRelated = function (res) { var href = res.links && res.links.related; if (!href) throw new Error('No related link in server response'); return _this.stackClient.fullpath(href); }; _this.specialDirectories = {}; return _this; } (0, _createClass3.default)(FileCollection, [{ key: 'get', value: function get(id) { return this.statById(id); } /** * Returns a filtered list of documents using a Mango selector. * * The returned documents are paginated by the stack. * * @param {object} selector The Mango selector. * @param {{sort, fields, limit, skip, indexId}} options The query options. * @returns {{data, meta, skip, next}} The JSON API conformant response. * @throws {FetchError} */ }, { key: 'find', value: function () { var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(selector) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var _options$skip, skip, resp; return _regenerator2.default.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _options$skip = options.skip, skip = _options$skip === undefined ? 0 : _options$skip; _context.t0 = this.stackClient; _context.next = 4; return this.toMangoOptions(selector, options); case 4: _context.t1 = _context.sent; _context.next = 7; return _context.t0.fetchJSON.call(_context.t0, 'POST', '/files/_find', _context.t1); case 7: resp = _context.sent; return _context.abrupt('return', { data: resp.data.map(function (f) { return normalizeFile(f); }), meta: resp.meta, next: resp.meta.count > skip + resp.data.length, skip: skip }); case 9: case 'end': return _context.stop(); } } }, _callee, this); })); function find(_x2) { return _ref3.apply(this, arguments); } return find; }() /** * async findReferencedBy - Returns the list of files referenced by a document — see https://docs.cozy.io/en/cozy-stack/references-docs-in-vfs/ * * @param {object} document A JSON representing a document, with at least a `_type` and `_id` field. * @param {object} options Additional options * @param {number} options.skip For skip-based pagination, the number of referenced files to skip. * @param {number} options.limit For pagination, the number of results to return. * @param {object} options.cursor For cursor-based pagination, the index cursor. * @returns {object} The JSON API conformant response. */ }, { key: 'findReferencedBy', value: function () { var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(document) { var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref5$skip = _ref5.skip, skip = _ref5$skip === undefined ? 0 : _ref5$skip, limit = _ref5.limit, cursor = _ref5.cursor; var params, url, path, resp; return _regenerator2.default.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: params = { include: 'files', 'page[limit]': limit, 'page[cursor]': cursor, sort: 'datetime' }; url = (0, _utils.uri)(_templateObject, document._type, document._id); path = querystring.buildURL(url, params); _context2.next = 5; return this.stackClient.fetchJSON('GET', path); case 5: resp = _context2.sent; return _context2.abrupt('return', { data: resp.data.map(function (f) { return normalizeFile(f); }), included: resp.included ? resp.included.map(function (f) { return normalizeFile(f); }) : [], next: (0, _has2.default)(resp, 'links.next'), meta: resp.meta, skip: skip }); case 7: case 'end': return _context2.stop(); } } }, _callee2, this); })); function findReferencedBy(_x4) { return _ref4.apply(this, arguments); } return findReferencedBy; }() /** * Add referenced_by documents to a file — see https://docs.cozy.io/en/cozy-stack/references-docs-in-vfs/#post-filesfile-idrelationshipsreferenced_by * * For example, to have an album referenced by a file: * ``` * addReferencedBy({_id: 123, _type: "io.cozy.files", name: "cozy.jpg"}, [{_id: 456, _type: "io.cozy.photos.albums", name: "Happy Cloud"}]) * ``` * * @param {object} document A JSON representing the file * @param {Array} documents An array of JSON documents having a `_type` and `_id` field. * @returns {object} The JSON API conformant response. */ }, { key: 'addReferencedBy', value: function addReferencedBy(document, documents) { var refs = documents.map(function (d) { return { id: d._id, type: d._type }; }); return this.stackClient.fetchJSON('POST', (0, _utils.uri)(_templateObject2, document._id), { data: refs }); } /** * Remove referenced_by documents from a file — see https://docs.cozy.io/en/cozy-stack/references-docs-in-vfs/#delete-filesfile-idrelationshipsreferenced_by * * For example, to remove an album reference from a file: * ``` * removeReferencedBy({_id: 123, _type: "io.cozy.files", name: "cozy.jpg"}, [{_id: 456, _type: "io.cozy.photos.albums", name: "Happy Cloud"}]) * ``` * * @param {object} document A JSON representing the file * @param {Array} documents An array of JSON documents having a `_type` and `_id` field. * @returns {object} The JSON API conformant response. */ }, { key: 'removeReferencedBy', value: function removeReferencedBy(document, documents) { var refs = documents.map(function (d) { return { id: d._id, type: d._type }; }); return this.stackClient.fetchJSON('DELETE', (0, _utils.uri)(_templateObject2, document._id), { data: refs }); } /** * Add files references to a document — see https://docs.cozy.io/en/cozy-stack/references-docs-in-vfs/#post-datatypedoc-idrelationshipsreferences * * For example, to add a photo to an album: * ``` * addReferencesTo({_id: 456, _type: "io.cozy.photos.albums", name: "Happy Cloud"}, [{_id: 123, _type: "io.cozy.files", name: "cozy.jpg"}]) * ``` * * @param {object} document A JSON representing a document, with at least a `_type` and `_id` field. * @param {Array} documents An array of JSON files having an `_id` field. * @returns {object} The JSON API conformant response. */ }, { key: 'addReferencesTo', value: function addReferencesTo(document, documents) { var refs = documents.map(function (d) { return { id: d._id, type: 'io.cozy.files' }; }); return this.stackClient.fetchJSON('POST', (0, _utils.uri)(_templateObject, document._type, document._id), { data: refs }); } /** * Remove files references to a document — see https://docs.cozy.io/en/cozy-stack/references-docs-in-vfs/#delete-datatypedoc-idrelationshipsreferences * * For example, to remove a photo from an album: * ``` * removeReferencesTo({_id: 456, _type: "io.cozy.photos.albums", name: "Happy Cloud"}, [{_id: 123, _type: "io.cozy.files", name: "cozy.jpg"}]) * ``` * * @param {object} document A JSON representing a document, with at least a `_type` and `_id` field. * @param {Array} documents An array of JSON files having an `_id` field. * @returns {object} The JSON API conformant response. */ }, { key: 'removeReferencesTo', value: function removeReferencesTo(document, documents) { var refs = documents.map(function (d) { return { id: d._id, type: 'io.cozy.files' }; }); return this.stackClient.fetchJSON('DELETE', (0, _utils.uri)(_templateObject, document._type, document._id), { data: refs }); } }, { key: 'destroy', value: function () { var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(_ref6) { var _id = _ref6._id, relationships = _ref6.relationships; var _ref8 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref8$ifMatch = _ref8.ifMatch, ifMatch = _ref8$ifMatch === undefined ? '' : _ref8$ifMatch; var _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, ref, resp; return _regenerator2.default.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: if (!(relationships && relationships.referenced_by && Array.isArray(relationships.referenced_by.data))) { _context3.next = 27; break; } _iteratorNormalCompletion = true; _didIteratorError = false; _iteratorError = undefined; _context3.prev = 4; _iterator = (0, _getIterator3.default)(relationships.referenced_by.data); case 6: if (_iteratorNormalCompletion = (_step = _iterator.next()).done) { _context3.next = 13; break; } ref = _step.value; _context3.next = 10; return this.removeReferencesTo({ _id: ref.id, _type: ref.type }, [{ _id: _id }]); case 10: _iteratorNormalCompletion = true; _context3.next = 6; break; case 13: _context3.next = 19; break; case 15: _context3.prev = 15; _context3.t0 = _context3['catch'](4); _didIteratorError = true; _iteratorError = _context3.t0; case 19: _context3.prev = 19; _context3.prev = 20; if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } case 22: _context3.prev = 22; if (!_didIteratorError) { _context3.next = 25; break; } throw _iteratorError; case 25: return _context3.finish(22); case 26: return _context3.finish(19); case 27: _context3.next = 29; return this.stackClient.fetchJSON('DELETE', (0, _utils.uri)(_templateObject3, _id), undefined, { headers: { 'If-Match': ifMatch } }); case 29: resp = _context3.sent; return _context3.abrupt('return', { data: normalizeFile(resp.data) }); case 31: case 'end': return _context3.stop(); } } }, _callee3, this, [[4, 15, 19, 27], [20,, 22, 26]]); })); function destroy(_x6) { return _ref7.apply(this, arguments); } return destroy; }() /** * Restores a trashed file. * * @param {string} id - The file's id * @returns {Promise} - A promise that returns the restored file if resolved. * @throws {FetchError} * */ }, { key: 'restore', value: function restore(id) { return this.stackClient.fetchJSON('POST', (0, _utils.uri)(_templateObject4, id)); } /** * async deleteFilePermanently - Definitely delete a file * * @param {string} id - The id of the file to delete * @returns {object} The deleted file object */ }, { key: 'deleteFilePermanently', value: function () { var _ref9 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(id) { var resp; return _regenerator2.default.wrap(function _callee4$(_context4) { while (1) { switch (_context4.prev = _context4.next) { case 0: _context4.next = 2; return this.stackClient.fetchJSON('PATCH', (0, _utils.uri)(_templateObject3, id), { data: { type: 'io.cozy.files', id: id, attributes: { permanent_delete: true } } }); case 2: resp = _context4.sent; return _context4.abrupt('return', resp.data); case 4: case 'end': return _context4.stop(); } } }, _callee4, this); })); function deleteFilePermanently(_x7) { return _ref9.apply(this, arguments); } return deleteFilePermanently; }() /** * * @param {File|Blob|Stream|string|ArrayBuffer} data file to be uploaded * @param {string} dirPath Path to upload the file to. ie : /Administative/XXX/ * @returns {object} Created io.cozy.files */ }, { key: 'upload', value: function () { var _ref10 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(data, dirPath) { var dirId; return _regenerator2.default.wrap(function _callee5$(_context5) { while (1) { switch (_context5.prev = _context5.next) { case 0: _context5.next = 2; return this.ensureDirectoryExists(dirPath); case 2: dirId = _context5.sent; return _context5.abrupt('return', this.createFile(data, { dirId: dirId })); case 4: case 'end': return _context5.stop(); } } }, _callee5, this); })); function upload(_x8, _x9) { return _ref10.apply(this, arguments); } return upload; }() /** * * @param {File|Blob|Stream|string|ArrayBuffer} data file to be uploaded * @param {object} params Additionnal parameters * @param {string} params.name Name of the file * @param {string} params.dirId Id of the directory you want to upload the file to * @param {boolean} params.executable If the file is an executable or not * @param {object} params.metadata io.cozy.files.metadata to attach to the file * @param {object} params.options Options to pass to doUpload method (additional headers) */ }, { key: 'createFile', value: function () { var _ref12 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6(data) { var _ref11 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var name = _ref11.name, _ref11$dirId = _ref11.dirId, dirId = _ref11$dirId === undefined ? '' : _ref11$dirId, executable = _ref11.executable, metadata = _ref11.metadata, options = (0, _objectWithoutProperties3.default)(_ref11, ['name', 'dirId', 'executable', 'metadata']); var metadataId, meta, path; return _regenerator2.default.wrap(function _callee6$(_context6) { while (1) { switch (_context6.prev = _context6.next) { case 0: // handle case where data is a file and contains the name if (!name && typeof data.name === 'string') { name = data.name; } name = sanitizeFileName(name); if (!(typeof name !== 'string' || name === '')) { _context6.next = 4; break; } throw new Error('missing name argument'); case 4: if (executable === undefined) { executable = false; } metadataId = ''; if (!metadata) { _context6.next = 11; break; } _context6.next = 9; return this.createFileMetadata(metadata); case 9: meta = _context6.sent; metadataId = meta.data.id; case 11: path = (0, _utils.uri)(_templateObject5, dirId, name, executable, metadataId); return _context6.abrupt('return', this.doUpload(data, path, options)); case 13: case 'end': return _context6.stop(); } } }, _callee6, this); })); function createFile(_x11) { return _ref12.apply(this, arguments); } return createFile; }() /** * updateFile - Updates a file's data * * @param {object} data Javascript File object * @param {object} params Additional parameters * @param {string} params.fileId The id of the file to update (required) * @param {boolean} params.executable Whether the file is executable or not * @param {object} params.metadata Metadata to be attached to the File io.cozy.file * @param {object} params.options Options to pass to doUpload method (additional headers) * @returns {object} Updated document */ }, { key: 'updateFile', value: function () { var _ref14 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(data) { var _ref13 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var _ref13$executable = _ref13.executable, executable = _ref13$executable === undefined ? false : _ref13$executable, fileId = _ref13.fileId, metadata = _ref13.metadata, options = (0, _objectWithoutProperties3.default)(_ref13, ['executable', 'fileId', 'metadata']); var name, metadataId, path, meta; return _regenerator2.default.wrap(function _callee7$(_context7) { while (1) { switch (_context7.prev = _context7.next) { case 0: if (!(!fileId || typeof fileId !== 'string')) { _context7.next = 2; break; } throw new Error('missing fileId argument'); case 2: if (!(typeof data.name !== 'string')) { _context7.next = 4; break; } throw new Error('missing name in data argument'); case 4: name = sanitizeFileName(data.name); if (!(typeof name !== 'string' || name === '')) { _context7.next = 7; break; } throw new Error('missing name argument'); case 7: /** * We already use the body to send the content of the file. So we have 2 choices : * Use an object in a query string to send the metadata * create a new header http * In both case, we have a size limitation depending of the browser. * * So we had this current workaround where we create the metadata before * (no size limit since we can use the body for that) and after we use the ID. */ metadataId = void 0; path = (0, _utils.uri)(_templateObject6, fileId, name, executable); if (!metadata) { _context7.next = 15; break; } _context7.next = 12; return this.createFileMetadata(metadata); case 12: meta = _context7.sent; metadataId = meta.data.id; path = path + ('&MetadataID=' + metadataId); case 15: return _context7.abrupt('return', this.doUpload(data, path, options, 'PUT')); case 16: case 'end': return _context7.stop(); } } }, _callee7, this); })); function updateFile(_x13) { return _ref14.apply(this, arguments); } return updateFile; }() }, { key: 'getDownloadLinkById', value: function getDownloadLinkById(id, filename) { return this.stackClient.fetchJSON('POST', (0, _utils.uri)(_templateObject7, id, filename)).then(this.extractResponseLinkRelated); } }, { key: 'getDownloadLinkByRevision', value: function getDownloadLinkByRevision(versionId, filename) { return this.stackClient.fetchJSON('POST', (0, _utils.uri)(_templateObject8, versionId, filename)).then(this.extractResponseLinkRelated); } }, { key: 'getDownloadLinkByPath', value: function getDownloadLinkByPath(path) { return this.stackClient.fetchJSON('POST', (0, _utils.uri)(_templateObject9, path)).then(this.extractResponseLinkRelated); } }, { key: 'download', /** * Download a file or a specific version of the file * * @param {object} file io.cozy.files object * @param {string} versionId Id of the io.cozy.files.version * @param {string} filename The name you want for the downloaded file * (by default the same as the file) */ value: function () { var _ref15 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee8(file) { var versionId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; var filename = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; var href, filenameToUse; return _regenerator2.default.wrap(function _callee8$(_context8) { while (1) { switch (_context8.prev = _context8.next) { case 0: href = void 0; filenameToUse = filename ? filename : file.name; /** * Passing a filename to forceFileDownload is not enough * for a few browsers since the stack's response header will * not contain that name. Passing the filename to * getDownloadLinkBy{Id,Revision} will ask the stack to * return this filename in its content-disposition * header response */ if (versionId) { _context8.next = 8; break; } _context8.next = 5; return this.getDownloadLinkById(file._id, filenameToUse); case 5: href = _context8.sent; _context8.next = 11; break; case 8: _context8.next = 10; return this.getDownloadLinkByRevision(versionId, filenameToUse); case 10: href = _context8.sent; case 11: (0, _utils.forceFileDownload)(href + '?Dl=1', filenameToUse); case 12: case 'end': return _context8.stop(); } } }, _callee8, this); })); function download(_x16) { return _ref15.apply(this, arguments); } return download; }() /** * Fetch the binary of a file or a specific version of a file * Useful for instance when you can't download the file directly * (via a content-disposition attachement header) and need to store * it before doing an operation. * * @param {string} id Id of the io.cozy.files or io.cozy.files.version * */ }, { key: 'fetchFileContent', value: function () { var _ref16 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee9(id) { return _regenerator2.default.wrap(function _callee9$(_context9) { while (1) { switch (_context9.prev = _context9.next) { case 0: return _context9.abrupt('return', this.stackClient.fetch('GET', '/files/download/' + id)); case 1: case 'end': return _context9.stop(); } } }, _callee9, this); })); function fetchFileContent(_x17) { return _ref16.apply(this, arguments); } return fetchFileContent; }() /** * Get a beautified size for a given file * 1024B => 1KB * 102404500404B => 95.37 GB * * @param {object} file io.cozy.files object * @param {int} decimal number of decimal */ }, { key: 'getBeautifulSize', value: function getBeautifulSize(file, decimal) { return (0, _utils.formatBytes)(parseInt(file.size), decimal); } }, { key: 'downloadArchive', value: function () { var _ref17 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee10(fileIds) { var notSecureFilename = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'files'; var filename, href, fullpath; return _regenerator2.default.wrap(function _callee10$(_context10) { while (1) { switch (_context10.prev = _context10.next) { case 0: filename = (0, _utils.slugify)(notSecureFilename); _context10.next = 3; return this.getArchiveLinkByIds(fileIds, filename); case 3: href = _context10.sent; fullpath = this.stackClient.fullpath(href); (0, _utils.forceFileDownload)(fullpath, filename + '.zip'); case 6: case 'end': return _context10.stop(); } } }, _callee10, this); })); function downloadArchive(_x19) { return _ref17.apply(this, arguments); } return downloadArchive; }() }, { key: 'getArchiveLinkByIds', value: function () { var _ref18 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee11(ids) { var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'files'; var resp; return _regenerator2.default.wrap(function _callee11$(_context11) { while (1) { switch (_context11.prev = _context11.next) { case 0: _context11.next = 2; return this.stackClient.fetchJSON('POST', '/files/archive', { data: { type: 'io.cozy.archives', attributes: { name: name, ids: ids } } }); case 2: resp = _context11.sent; return _context11.abrupt('return', resp.links.related); case 4: case 'end': return _context11.stop(); } } }, _callee11, this); })); function getArchiveLinkByIds(_x21) { return _ref18.apply(this, arguments); } return getArchiveLinkByIds; }() /** * Checks if the file belongs to the parent's hierarchy. * * @param {string|object} child The file which can either be an id or an object * @param {string|object} parent The parent target which can either be an id or an object * @returns {boolean} Whether the file is a parent's child */ }, { key: 'isChildOf', value: function () { var _ref19 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee12(child, parent) { var _this2 = this; var _ref20, childID, childDirID, childPath, _ref21, parentID, childDoc, currPath, targetsPath, newPath; return _regenerator2.default.wrap(function _callee12$(_context12) { while (1) { switch (_context12.prev = _context12.next) { case 0: _ref20 = (typeof child === 'undefined' ? 'undefined' : (0, _typeof3.default)(child)) === 'object' ? child : { _id: child }, childID = _ref20._id, childDirID = _ref20.dirID, childPath = _ref20.path; _ref21 = (typeof parent === 'undefined' ? 'undefined' : (0, _typeof3.default)(parent)) === 'object' ? parent : { _id: parent }, parentID = _ref21._id; if (!(childID === parentID || childDirID === parentID)) { _context12.next = 4; break; } return _context12.abrupt('return', true); case 4: if (childPath) { _context12.next = 10; break; } _context12.next = 7; return this.statById(childID); case 7: childDoc = _context12.sent; childPath = childDoc.path; childDirID = childDoc.dirID; case 10: // Build hierarchy paths currPath = childPath; targetsPath = [childPath]; while (currPath != '') { newPath = dirName(currPath); if (newPath != '') { targetsPath.push(newPath); } currPath = newPath; } targetsPath.reverse(); // Look for all hierarchy in parallel and return true as soon as a dir is the searched parent return _context12.abrupt('return', raceWithCondition(targetsPath.map(function (path) { return _this2.statByPath(path); }), function (stat) { return stat.data._id == parentID; })); case 15: case 'end': return _context12.stop(); } } }, _callee12, this); })); function isChildOf(_x22, _x23) { return _ref19.apply(this, arguments); } return isChildOf; }() }, { key: 'statById', value: function () { var _ref22 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee13(id) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var limit, _options$skip2, skip, params, url, path, resp; return _regenerator2.default.wrap(function _callee13$(_context13) { while (1) { switch (_context13.prev = _context13.next) { case 0: limit = options.limit, _options$skip2 = options.skip, skip = _options$skip2 === undefined ? 0 : _options$skip2; params = { limit: limit, skip: skip }; url = (0, _utils.uri)(_templateObject3, id); path = querystring.buildURL(url, params); _context13.next = 6; return this.stackClient.fetchJSON('GET', path); case 6: resp = _context13.sent; return _context13.abrupt('return', { data: normalizeFile(resp.data), included: resp.included && resp.included.map(function (f) { return normalizeFile(f); }) }); case 8: case 'end': return _context13.stop(); } } }, _callee13, this); })); function statById(_x25) { return _ref22.apply(this, arguments); } return statById; }() }, { key: 'statByPath', value: function () { var _ref23 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee14(path) { var resp; return _regenerator2.default.wrap(function _callee14$(_context14) { while (1) { switch (_context14.prev = _context14.next) { case 0: _context14.next = 2; return this.stackClient.fetchJSON('GET', (0, _utils.uri)(_templateObject10, path)); case 2: resp = _context14.sent; return _context14.abrupt('return', { data: normalizeFile(resp.data), included: resp.included && resp.included.map(function (f) { return normalizeFile(f); }) }); case 4: case 'end': return _context14.stop(); } } }, _callee14, this); })); function statByPath(_x26) { return _ref23.apply(this, arguments); } return statByPath; }() }, { key: 'createDirectory', value: function () { var _ref24 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee15() { var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var name, dirId, lastModifiedDate, safeName, lastModified, resp; return _regenerator2.default.wrap(function _callee15$(_context15) { while (1) { switch (_context15.prev = _context15.next) { case 0: name = attributes.name, dirId = attributes.dirId, lastModifiedDate = attributes.lastModifiedDate; safeName = sanitizeFileName(name); if (!(typeof name !== 'string' || safeName === '')) { _context15.next = 4; break; } throw new Error('missing name argument'); case 4: lastModified = lastModifiedDate && (typeof lastModifiedDate === 'string' ? new Date(lastModifiedDate) : lastModifiedDate); _context15.next = 7; return this.stackClient.fetchJSON('POST', (0, _utils.uri)(_templateObject11, dirId, safeName), undefined, { headers: { Date: lastModified ? lastModified.toGMTString() : '' } }); case 7: resp = _context15.sent; return _context15.abrupt('return', { data: normalizeFile(resp.data) }); case 9: case 'end': return _context15.stop(); } } }, _callee15, this); })); function createDirectory() { return _ref24.apply(this, arguments); } return createDirectory; }() }, { key: 'ensureDirectoryExists', value: function () { var _ref25 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee16(path) { var resp; return _regenerator2.default.wrap(function _callee16$(_context16) { while (1) { switch (_context16.prev = _context16.next) { case 0: if (this.specialDirectories[path]) { _context16.next = 5; break; } _context16.next = 3; return this.createDirectoryByPath(path); case 3: resp = _context16.sent; this.specialDirectories[path] = resp.data._id; case 5: return _context16.abrupt('return', this.specialDirectories[path]); case 6: case 'end': return _context16.stop(); } } }, _callee16, this); })); function ensureDirectoryExists(_x28) { return _ref25.apply(this, arguments); } return ensureDirectoryExists; }() }, { key: 'getDirectoryOrCreate', value: function () { var _ref26 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee17(name, parentDirectory) { var safeName, path, stat, parsedError, errors; return _regenerator2.default.wrap(function _callee17$(_context17) { while (1) { switch (_context17.prev = _context17.next) { case 0: if (!(parentDirectory && !parentDirectory.attributes)) { _context17.next = 2; break; } throw new Error('Malformed parent directory'); case 2: safeName = sanitizeFileName(name); path = (parentDirectory._id === ROOT_DIR_ID ? '' : parentDirectory.attributes.path) + '/' + safeName; _context17.prev = 4; _context17.next = 7; return this.statByPath(path || '/'); case 7: stat = _context17.sent; return _context17.abrupt('return', stat); case 11: _context17.prev = 11; _context17.t0 = _context17['catch'](4); parsedError = JSON.parse(_context17.t0.message); errors = parsedError.errors; if (!(errors && errors.length && errors[0].status === '404')) { _context17.next = 17; break; } return _context17.abrupt('return', this.createDirectory({ name: safeName, dirId: parentDirectory && parentDirectory._id })); case 17: throw errors; case 18: case 'end': return _context17.stop(); } } }, _callee17, this, [[4, 11]]); })); function getDirectoryOrCreate(_x29, _x30) { return _ref26.apply(this, arguments); } return getDirectoryOrCreate; }() /** * async createDirectoryByPath - Creates one or more folders until the given path exists * * @param {string} path * @returns {object} The document corresponding to the last segment of the path */ }, { key: 'createDirectoryByPath', value: function () { var _ref27 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee18(path) { var parts, root, parentDir, _iteratorNormalCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, part; return _regenerator2.default.wrap(function _callee18$(_context18) { while (1) { switch (_context18.prev = _context18.next) { case 0: parts = path.split('/').filter(function (part) { return part !== ''; }); _context18.next = 3; return this.statById(ROOT_DIR_ID); case 3: root = _context18.sent; if (parts.length) { _context18.next = 6; break; } return _context18.abrupt('return', root); case 6: parentDir = root; _iteratorNormalCompletion2 = true; _didIteratorError2 = false; _iteratorError2 = undefined; _context18.prev = 10; _iterator2 = (0, _getIterator3.default)(parts); case 12: if (_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done) { _context18.next = 20; break; } part = _step2.value; _context18.next = 16; return this.getDirectoryOrCreate(part, parentDir.data); case 16: parentDir = _context18.sent; case 17: _iteratorNormalCompletion2 = true; _context18.next = 12; break; case 20: _context18.next = 26; break; case 22: _context18.prev = 22; _context18.t0 = _context18['catch'](10); _didIteratorError2 = true; _iteratorError2 = _context18.t0; case 26: _context18.prev = 26; _context18.prev = 27; if (!_iteratorNormalCompletion2 && _iterator2.return) { _iterator2.return(); } case 29: _context18.prev = 29; if (!_didIteratorError2) { _context18.next = 32; break; } throw _iteratorError2; case 32: return _context18.finish(29); case 33: return _context18.finish(26); case 34: return _context18.abrupt('return', parentDir); case 35: case 'end': return _context18.stop(); } } }, _callee18, this, [[10, 22, 26, 34], [27,, 29, 33]]); })); function createDirectoryByPath(_x31) { return _ref27.apply(this, arguments); } return createDirectoryByPath; }() /** * async updateAttributes - Updates a file / folder's attributes except * the metadata attribute. If you want to update its metadata attribute, * then use `updateFileMetadataAttribute` since `metadata` is a specific * doctype. * * For instance, if you want to update the name of a file, you can pass * attributes = { name: 'newName'} * * You can see the attributes for both Folder and File (as they share the * same doctype they have a few in common) here : * https://docs.cozy.io/en/cozy-doctypes/docs/io.cozy.files/#iocozyfiles * * @param {string} id File id * @param {object} attributes New file attributes * @returns {object} Updated document */ }, { key: 'updateAttributes', value: function () { var _ref28 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee19(id, attributes) { var resp; return _regenerator2.default.wrap(function _callee19$(_context19) { while (1) { switch (_context19.prev = _context19.next) { case 0: _context19.next = 2; return this.stackClient.fetchJSON('PATCH', (0, _utils.uri)(_templateObject3, id), { data: { type: 'io.cozy.files', id: id, attributes: attributes } }); case 2: resp = _context19.sent; return _context19.abrupt('return', { data: normalizeFile(resp.data) }); case 4: case 'end': return _context19.stop(); } } }, _callee19, this); })); function updateAttributes(_x32, _x33) { return _ref28.apply(this, arguments); } return updateAttributes; }() }, { key: 'updateFileMetadata', value: function () { var _ref29 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee20(id, attributes) { return _regenerator2.default.wrap(function _callee20$(_context20) { while (1) { switch (_context20.prev = _context20.next) { case 0: console.warn('CozyClient FileCollection updateFileMetadata method is deprecated. Use updateAttributes instead'); return _context20.abrupt('return', this.updateAttributes(id, attributes)); case 2: case 'end': return _context20.stop(); } } }, _callee20, this); })); function updateFileMetadata(_x34, _x35) { return _ref29.apply(this, arguments); } return updateFileMetadata; }() /** * Send a metadata object that can be associated to a file uploaded after that, * via the MetadataID query parameter. * See https://github.com/cozy/cozy-stack/blob/master/docs/files.md#post-filesuploadmetadata * * @param {object} attributes The file's metadata * @returns {object} The Metadata object */ }, { key: 'createFileMetadata', value: function () { var _ref30 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee21(attributes) { var resp; return _regenerator2.default.wrap(function _callee21$(_context21) { while (1) { switch (_context21.prev = _context21.next) { case 0: _context21.next = 2; return this.stackClient.fetchJSON('POST', (0, _utils.uri)(_templateObject12), { data: { type: 'io.cozy.files.metadata', attributes: attributes } }); case 2: resp = _context21.sent; return _context21.abrupt('return', { data: resp.data }); case 4: case 'end': return _context21.stop(); } } }, _callee21, this); })); function createFileMetadata(_x36) { return _ref30.apply(this, arguments); } return createFileMetadata; }() /** * * Updates the metadata attribute of a io.cozy.files * Creates a new version of the file without having * to upload again the file's content * * To see available content of the metadata attribute * see : https://docs.cozy.io/en/cozy-doctypes/docs/io.cozy.files_metadata/ * * @param {string} id File id * @param {object} metadata io.cozy.files.metadata attributes * @returns {object} io.cozy.files updated */ }, { key: 'updateMetadataAttribute', value: function () { var _ref31 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee22(id, metadata) { var resp; return _regenerator2.default.wrap(function _callee22$(_context22) { while (1) { switch (_context22.prev = _context22.next) { case 0: _context22.next = 2; return this.stackClient.fetchJSON('POST', (0, _utils.uri)(_templateObject13, id), { data: { type: 'io.cozy.files.metadata', attributes: metadata } }); case 2: resp = _context22.sent; return _context22.abrupt('return', { data: resp.data }); case 4: case 'end': return _context22.stop(); } } }, _callee22, this); })); function updateMetadataAttribute(_x37, _x38) { return _ref31.apply(this, arguments); } return updateMetadataAttribute; }() /** * * This method should not be called directly to upload a file. * You should use `createFile` * * @param {File|Blob|Stream|string|ArrayBuffer} data file to be uploaded * @param {string} path Uri to call the stack from. Something like * `/files/${dirId}?Name=${name}&Type=file&Executable=${executable}&MetadataID=${metadataId}` * @param {object} options Additional headers * @param {string} method POST / PUT / PATCH */ }, { key: 'doUpload', value: function () { var _ref32 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee23(data, path, options) { var method = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'POST'; var isBuffer, isFile, isBlob, isStream, isString, _ref33, contentType, contentLength, checksum, lastModifiedDate, ifMatch, headers, resp; return _regenerator2.default.wrap(function _callee23$(_context23) { while (1) { switch (_context23.prev = _context23.next) { case 0: if (data) { _context23.next = 2; break; } throw new Error('missing data argument'); case 2: // transform any ArrayBufferView to ArrayBuffer if (data.buffer && data.buffer instanceof ArrayBuffer) { data = data.buffer; } isBuffer = typeof ArrayBuffer !== 'undefined' && data instanceof ArrayBuffer; isFile = typeof File !== 'undefined' && data instanceof File; isBlob = typeof Blob !== 'undefined' && data instanceof Blob; isStream = data.readable === true && typeof data.pipe === 'function'; isString = typeof data === 'string'; if (!(!isBuffer && !isFile && !isBlob && !isStream && !isString)) { _context23.next = 10; break; } throw new Error('invalid data type'); case 10: _ref33 = options || {}, contentType = _ref33.contentType, contentLength = _ref33.contentLength, checksum = _ref33.checksum, lastModifiedDate = _ref33.lastModifiedDate, ifMatch = _ref33.ifMatch; if (!contentType) { if (isBuffer) { contentType = CONTENT_TYPE_OCTET_STREAM; } else if (isFile) { contentType = data.type || getFileTypeFromName(data.name.toLowerCase()) || CONTENT_TYPE_OCTET_STREAM; if (!lastModifiedDate) { lastModifiedDate = data.lastModifiedDate; } } else if (isBlob) { contentType = data.type || CONTENT_TYPE_OCTET_STREAM; } else if (isStream) { contentType = CONTENT_TYPE_OCTET_STREAM; } else if (typeof data === 'string') { contentType = 'text/plain'; } } if (lastModifiedDate && typeof lastModifiedDate === 'string') { lastModifiedDate = new Date(lastModifiedDate); } headers = { 'Content-Type': contentType }; if (contentLength) headers['Content-Length'] = String(contentLength); if (checksum) headers['Content-MD5'] = checksum; if (lastModifiedDate) headers['Date'] = lastModifiedDate.toGMTString(); if (ifMatch) headers['If-Match'] = ifMatch; _context23.next = 20; return this.stackClient.fetchJSON(method, path, data, { headers: headers }); case 20: resp = _context23.sent; return _context23.abrupt('return', { data: normalizeFile(resp.data) }); case 22: case 'end': return _context23.stop(); } } }, _callee23, this); })); function doUpload(_x40, _x41, _x42) { return _ref32.apply(this, arguments); } return doUpload; }() }]); return FileCollection; }(_DocumentCollection3.default); exports.default = FileCollection; /***/ }), /* 998 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Mime = __webpack_require__(999); module.exports = new Mime(__webpack_require__(1000)); /***/ }), /* 999 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @param typeMap [Object] Map of MIME type -> Array[extensions] * @param ... */ function Mime() { this._types = Object.create(null); this._extensions = Object.create(null); for (var i = 0; i < arguments.length; i++) { this.define(arguments[i]); } this.define = this.define.bind(this); this.getType = this.getType.bind(this); this.getExtension = this.getExtension.bind(this); } /** * Define mimetype -> extension mappings. Each key is a mime-type that maps * to an array of extensions associated with the type. The first extension is * used as the default extension for the type. * * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']}); * * If a type declares an extension that has already been defined, an error will * be thrown. To suppress this error and force the extension to be associated * with the new type, pass `force`=true. Alternatively, you may prefix the * extension with "*" to map the type to extension, without mapping the * extension to the type. * * e.g. mime.define({'audio/wav', ['wav']}, {'audio/x-wav', ['*wav']}); * * * @param map (Object) type definitions * @param force (Boolean) if true, force overriding of existing definitions */ Mime.prototype.define = function(typeMap, force) { for (var type in typeMap) { var extensions = typeMap[type].map(function(t) {return t.toLowerCase()}); type = type.toLowerCase(); for (var i = 0; i < extensions.length; i++) { var ext = extensions[i]; // '*' prefix = not the preferred type for this extension. So fixup the // extension, and skip it. if (ext[0] == '*') { continue; } if (!force && (ext in this._types)) { throw new Error( 'Attempt to change mapping for "' + ext + '" extension from "' + this._types[ext] + '" to "' + type + '". Pass `force=true` to allow this, otherwise remove "' + ext + '" from the list of extensions for "' + type + '".' ); } this._types[ext] = type; } // Use first extension as default if (force || !this._extensions[type]) { var ext = extensions[0]; this._extensions[type] = (ext[0] != '*') ? ext : ext.substr(1) } } }; /** * Lookup a mime type based on extension */ Mime.prototype.getType = function(path) { path = String(path); var last = path.replace(/^.*[/\\]/, '').toLowerCase(); var ext = last.replace(/^.*\./, '').toLowerCase(); var hasPath = last.length < path.length; var hasDot = ext.length < last.length - 1; return (hasDot || !hasPath) && this._types[ext] || null; }; /** * Return file extension associated with a mime type */ Mime.prototype.getExtension = function(type) { type = /^\s*([^;\s]*)/.test(type) && RegExp.$1; return type && this._extensions[type.toLowerCase()] || null; }; module.exports = Mime; /***/ }), /* 1000 */ /***/ (function(module, exports) { module.exports = {"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomsvc+xml":["atomsvc"],"application/bdoc":["bdoc"],"application/ccxml+xml":["ccxml"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma","es"],"application/emma+xml":["emma"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-diff+xml":["xdf"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/ktx":["ktx"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]}; /***/ }), /* 1001 */ /***/ (function(module, exports, __webpack_require__) { var baseHas = __webpack_require__(1002), hasPath = __webpack_require__(584); /** * Checks if `path` is a direct property of `object`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * * var object = { 'a': { 'b': 2 } }; * var other = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.has(object, 'a'); * // => true * * _.has(object, 'a.b'); * // => true * * _.has(object, ['a', 'b']); * // => true * * _.has(other, 'a'); * // => false */ function has(object, path) { return object != null && hasPath(object, path, baseHas); } module.exports = has; /***/ }), /* 1002 */ /***/ (function(module, exports) { /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * The base implementation of `_.has` without support for deep paths. * * @private * @param {Object} [object] The object to query. * @param {Array|string} key The key to check. * @returns {boolean} Returns `true` if `key` exists, else `false`. */ function baseHas(object, key) { return object != null && hasOwnProperty.call(object, key); } module.exports = baseHas; /***/ }), /* 1003 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.hasJobFinished = exports.normalizeJob = exports.JOBS_DOCTYPE = undefined; var _regenerator = __webpack_require__(619); var _regenerator2 = _interopRequireDefault(_regenerator); var _taggedTemplateLiteral2 = __webpack_require__(976); var _taggedTemplateLiteral3 = _interopRequireDefault(_taggedTemplateLiteral2); var _asyncToGenerator2 = __webpack_require__(849); var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); var _classCallCheck2 = __webpack_require__(851); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = __webpack_require__(852); var _createClass3 = _interopRequireDefault(_createClass2); var _extends2 = __webpack_require__(843); var _extends3 = _interopRequireDefault(_extends2); var _promise = __webpack_require__(799); var _promise2 = _interopRequireDefault(_promise); var _templateObject = (0, _taggedTemplateLiteral3.default)(['/jobs/', ''], ['/jobs/', '']); var _Collection = __webpack_require__(994); var _Collection2 = _interopRequireDefault(_Collection); var _DocumentCollection = __webpack_require__(969); var _utils = __webpack_require__(983); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var JOBS_DOCTYPE = exports.JOBS_DOCTYPE = 'io.cozy.jobs'; var sleep = function sleep(delay) { return new _promise2.default(function (resolve) { return setTimeout(resolve, delay); }); }; var normalizeJob = exports.normalizeJob = function normalizeJob(job) { return (0, _extends3.default)({}, job, (0, _DocumentCollection.normalizeDoc)(job, JOBS_DOCTYPE), job.attributes); }; var hasJobFinished = exports.hasJobFinished = function hasJobFinished(job) { return job.state === 'done' || job.state === 'errored'; }; var JobCollection = function () { function JobCollection(stackClient) { (0, _classCallCheck3.default)(this, JobCollection); this.stackClient = stackClient; } (0, _createClass3.default)(JobCollection, [{ key: 'queued', value: function queued(workerType) { return this.stackClient.fetchJSON('GET', '/jobs/queue/' + workerType); } /** * Creates a job * * @param {string} workerType - Ex: "konnector" * @param {object} args - Ex: {"slug": "my-konnector", "trigger": "trigger-id"} * @param {object} options * @returns {object} createdJob */ }, { key: 'create', value: function create(workerType, args, options) { return this.stackClient.fetchJSON('POST', '/jobs/queue/' + workerType, { data: { type: JOBS_DOCTYPE, attributes: { arguments: args || {}, options: options || {} } } }); } /** * Return a normalized job, given its id */ }, { key: 'get', value: function () { var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(id) { return _regenerator2.default.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: return _context.abrupt('return', _Collection2.default.get(this.stackClient, (0, _utils.uri)(_templateObject, id), { normalize: normalizeJob })); case 1: case 'end': return _context.stop(); } } }, _callee, this); })); function get(_x) { return _ref.apply(this, arguments); } return get; }() /** * Polls a job state until it is finished * * `options.until` can be used to tweak when to stop waiting. It will be * given the current job state. If true is returned, the awaiting is * stopped. */ }, { key: 'waitFor', value: function () { var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(id) { var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref3$onUpdate = _ref3.onUpdate, onUpdate = _ref3$onUpdate === undefined ? null : _ref3$onUpdate, _ref3$until = _ref3.until, until = _ref3$until === undefined ? hasJobFinished : _ref3$until, _ref3$delay = _ref3.delay, delay = _ref3$delay === undefined ? 5 * 1000 : _ref3$delay, _ref3$timeout = _ref3.timeout, timeout = _ref3$timeout === undefined ? 60 * 5 * 1000 : _ref3$timeout; var start, jobData, now; return _regenerator2.default.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: start = Date.now(); _context2.next = 3; return this.get(id); case 3: jobData = _context2.sent.data.attributes; case 4: if (!(!jobData || !until(jobData))) { _context2.next = 16; break; } _context2.next = 7; return sleep(delay); case 7: _context2.next = 9; return this.get(id); case 9: jobData = _context2.sent.data.attributes; if (onUpdate) { onUpdate(jobData); } now = Date.now(); if (!(start - now > timeout)) { _context2.next = 14; break; } throw new Error('Timeout for JobCollection::waitFor'); case 14: _context2.next = 4; break; case 16: return _context2.abrupt('return', jobData); case 17: case 'end': return _context2.stop(); } } }, _callee2, this); })); function waitFor(_x3) { return _ref2.apply(this, arguments); } return waitFor; }() }]); return JobCollection; }(); exports.default = JobCollection; /***/ }), /* 1004 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.KONNECTORS_DOCTYPE = undefined; var _stringify = __webpack_require__(886); var _stringify2 = _interopRequireDefault(_stringify); var _regenerator = __webpack_require__(619); var _regenerator2 = _interopRequireDefault(_regenerator); var _asyncToGenerator2 = __webpack_require__(849); var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); var _getPrototypeOf = __webpack_require__(858); var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); var _classCallCheck2 = __webpack_require__(851); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = __webpack_require__(852); var _createClass3 = _interopRequireDefault(_createClass2); var _possibleConstructorReturn2 = __webpack_require__(861); var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); var _inherits2 = __webpack_require__(876); var _inherits3 = _interopRequireDefault(_inherits2); var _AppCollection2 = __webpack_require__(968); var _AppCollection3 = _interopRequireDefault(_AppCollection2); var _TriggerCollection = __webpack_require__(1005); var _TriggerCollection2 = _interopRequireDefault(_TriggerCollection); var _DocumentCollection = __webpack_require__(969); var _pick = __webpack_require__(602); var _pick2 = _interopRequireDefault(_pick); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var KONNECTORS_DOCTYPE = exports.KONNECTORS_DOCTYPE = 'io.cozy.konnectors'; var KonnectorCollection = function (_AppCollection) { (0, _inherits3.default)(KonnectorCollection, _AppCollection); function KonnectorCollection(stackClient) { (0, _classCallCheck3.default)(this, KonnectorCollection); var _this = (0, _possibleConstructorReturn3.default)(this, (KonnectorCollection.__proto__ || (0, _getPrototypeOf2.default)(KonnectorCollection)).call(this, stackClient)); _this.doctype = KONNECTORS_DOCTYPE; _this.endpoint = '/konnectors/'; return _this; } (0, _createClass3.default)(KonnectorCollection, [{ key: 'create', value: function () { var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee() { return _regenerator2.default.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: throw new Error('create() method is not available for konnectors'); case 1: case 'end': return _context.stop(); } } }, _callee, this); })); function create() { return _ref.apply(this, arguments); } return create; }() }, { key: 'destroy', value: function () { var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2() { return _regenerator2.default.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: throw new Error('destroy() method is not available for konnectors'); case 1: case 'end': return _context2.stop(); } } }, _callee2, this); })); function destroy() { return _ref2.apply(this, arguments); } return destroy; }() /** * Find triggers for a particular konnector * * @param {string} slug of the konnector */ }, { key: 'findTriggersBySlug', value: function () { var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(slug) { var triggerCol, _ref4, rawTriggers; return _regenerator2.default.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: triggerCol = new _TriggerCollection2.default(this.stackClient); _context3.next = 3; return triggerCol.all({ limit: null }); case 3: _ref4 = _context3.sent; rawTriggers = _ref4.data; return _context3.abrupt('return', rawTriggers.map(function (x) { return x.attributes; }).filter(function (triggerAttrs) { return (0, _TriggerCollection.isForKonnector)(triggerAttrs, slug); })); case 6: case 'end': return _context3.stop(); } } }, _callee3, this); })); function findTriggersBySlug(_x) { return _ref3.apply(this, arguments); } return findTriggersBySlug; }() /** * Launch a trigger for a given konnector. * * @param {string} slug * @param {object} options * @param {object} options.accountId - Pinpoint the account that should be used, useful if the user * has more than 1 account for 1 konnector */ }, { key: 'launch', value: function () { var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(slug) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var triggerCol, konnTriggers, filteredTriggers, filterAttrs; return _regenerator2.default.wrap(function _callee4$(_context4) { while (1) { switch (_context4.prev = _context4.next) { case 0: triggerCol = new _TriggerCollection2.default(this.stackClient); _context4.next = 3; return this.findTriggersBySlug(slug); case 3: konnTriggers = _context4.sent; filteredTriggers = options.accountId ? konnTriggers.filter(function (triggerAttrs) { return (0, _TriggerCollection.isForAccount)(triggerAttrs, options.accountId); }) : konnTriggers; if (!(filteredTriggers.length === 1)) { _context4.next = 9; break; } return _context4.abrupt('return', triggerCol.launch(konnTriggers[0])); case 9: filterAttrs = (0, _stringify2.default)((0, _pick2.default)({ slug: slug, accountId: options.accountId })); if (!(filteredTriggers.length === 0)) { _context4.next = 14; break; } throw new Error('No trigger found for ' + filterAttrs); case 14: if (!(filteredTriggers.length > 1)) { _context4.next = 16; break; } throw new Error('More than 1 trigger found for ' + filterAttrs); case 16: case 'end': return _context4.stop(); } } }, _callee4, this); })); function launch(_x3) { return _ref5.apply(this, arguments); } return launch; }() /** * Updates a konnector * * @param {string} slug * @param {object} options * @param {object} options.source - Specify the source (ex: registry://slug/stable) * @param {boolean} options.sync - Wait for konnector to be updated, otherwise the job * is just scheduled */ }, { key: 'update', value: function () { var _ref6 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(slug) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var source, sync, reqOptions, rawKonnector; return _regenerator2.default.wrap(function _callee5$(_context5) { while (1) { switch (_context5.prev = _context5.next) { case 0: if (slug) { _context5.next = 2; break; } throw new Error('Cannot call update with no slug'); case 2: source = options.source || null; sync = options.sync || false; reqOptions = sync ? { headers: { Accept: 'text/event-stream' } } : {}; _context5.next = 7; return this.stackClient.fetchJSON('PUT', '/konnectors/' + slug + (source ? '?Source=' + source : ''), reqOptions); case 7: rawKonnector = _context5.sent; return _context5.abrupt('return', (0, _DocumentCollection.normalizeDoc)(rawKonnector)); case 9: case 'end': return _context5.stop(); } } }, _callee5, this); })); function update(_x5) { return _ref6.apply(this, arguments); } return update; }() }]); return KonnectorCollection; }(_AppCollection3.default); exports.default = KonnectorCollection; /***/ }), /* 1005 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isForAccount = exports.isForKonnector = exports.normalizeTrigger = exports.TRIGGERS_DOCTYPE = exports.JOBS_DOCTYPE = undefined; var _keys = __webpack_require__(835); var _keys2 = _interopRequireDefault(_keys); var _taggedTemplateLiteral2 = __webpack_require__(976); var _taggedTemplateLiteral3 = _interopRequireDefault(_taggedTemplateLiteral2); var _regenerator = __webpack_require__(619); var _regenerator2 = _interopRequireDefault(_regenerator); var _asyncToGenerator2 = __webpack_require__(849); var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); var _getPrototypeOf = __webpack_require__(858); var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); var _classCallCheck2 = __webpack_require__(851); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = __webpack_require__(852); var _createClass3 = _interopRequireDefault(_createClass2); var _possibleConstructorReturn2 = __webpack_require__(861); var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); var _get2 = __webpack_require__(940); var _get3 = _interopRequireDefault(_get2); var _inherits2 = __webpack_require__(876); var _inherits3 = _interopRequireDefault(_inherits2); var _extends2 = __webpack_require__(843); var _extends3 = _interopRequireDefault(_extends2); var _templateObject = (0, _taggedTemplateLiteral3.default)(['/jobs/triggers'], ['/jobs/triggers']), _templateObject2 = (0, _taggedTemplateLiteral3.default)(['/jobs/triggers/', ''], ['/jobs/triggers/', '']), _templateObject3 = (0, _taggedTemplateLiteral3.default)(['/jobs/triggers/', '/launch'], ['/jobs/triggers/', '/launch']); var _Collection = __webpack_require__(994); var _Collection2 = _interopRequireDefault(_Collection); var _DocumentCollection2 = __webpack_require__(969); var _DocumentCollection3 = _interopRequireDefault(_DocumentCollection2); var _JobCollection = __webpack_require__(1003); var _utils = __webpack_require__(983); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var JOBS_DOCTYPE = exports.JOBS_DOCTYPE = 'io.cozy.jobs'; var TRIGGERS_DOCTYPE = exports.TRIGGERS_DOCTYPE = 'io.cozy.triggers'; var normalizeTrigger = exports.normalizeTrigger = function normalizeTrigger(trigger) { return (0, _extends3.default)({}, trigger, (0, _DocumentCollection2.normalizeDoc)(trigger, TRIGGERS_DOCTYPE), trigger.attributes); }; var isForKonnector = exports.isForKonnector = function isForKonnector(triggerAttrs, slug) { return triggerAttrs.worker === 'konnector' && triggerAttrs.message.konnector == slug; }; var isForAccount = exports.isForAccount = function isForAccount(triggerAttrs, accountId) { return triggerAttrs.message.account == accountId; }; /** * Implements `DocumentCollection` API along with specific methods for `io.cozy.triggers`. */ var TriggerCollection = function (_DocumentCollection) { (0, _inherits3.default)(TriggerCollection, _DocumentCollection); function TriggerCollection(stackClient) { (0, _classCallCheck3.default)(this, TriggerCollection); return (0, _possibleConstructorReturn3.default)(this, (TriggerCollection.__proto__ || (0, _getPrototypeOf2.default)(TriggerCollection)).call(this, TRIGGERS_DOCTYPE, stackClient)); } /** * Get the list of triggers. * * @see https://docs.cozy.io/en/cozy-stack/jobs/#get-jobstriggers * @param {{Worker}} options The fetch options: Worker allow to filter only triggers associated with a specific worker. * @returns {{data}} The JSON API conformant response. * @throws {FetchError} */ (0, _createClass3.default)(TriggerCollection, [{ key: 'all', value: function () { var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var resp; return _regenerator2.default.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _context.prev = 0; _context.next = 3; return this.stackClient.fetchJSON('GET', '/jobs/triggers'); case 3: resp = _context.sent; return _context.abrupt('return', { data: resp.data.map(function (row) { return normalizeTrigger(row, TRIGGERS_DOCTYPE); }), meta: { count: resp.data.length }, next: false, skip: 0 }); case 7: _context.prev = 7; _context.t0 = _context['catch'](0); return _context.abrupt('return', (0, _Collection.dontThrowNotFoundError)(_context.t0)); case 10: case 'end': return _context.stop(); } } }, _callee, this, [[0, 7]]); })); function all() { return _ref.apply(this, arguments); } return all; }() /** * Creates a Trigger document * * @see https://docs.cozy.io/en/cozy-stack/jobs/#post-jobstriggers * @param {object} attributes Trigger's attributes * @returns {object} Stack response, containing trigger document under `data` attribute. */ }, { key: 'create', value: function () { var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(attributes) { var path, resp; return _regenerator2.default.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: path = (0, _utils.uri)(_templateObject); _context2.next = 3; return this.stackClient.fetchJSON('POST', path, { data: { attributes: attributes } }); case 3: resp = _context2.sent; return _context2.abrupt('return', { data: normalizeTrigger(resp.data) }); case 5: case 'end': return _context2.stop(); } } }, _callee2, this); })); function create(_x2) { return _ref2.apply(this, arguments); } return create; }() /** * Deletes a trigger * * @see https://docs.cozy.io/en/cozy-stack/jobs/#delete-jobstriggerstrigger-id * @param {object} document The trigger to delete — must have an _id field * @returns {object} The deleted document */ }, { key: 'destroy', value: function () { var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(document) { var _id; return _regenerator2.default.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: _id = document._id; if (_id) { _context3.next = 3; break; } throw new Error('TriggerCollection.destroy needs a document with an _id'); case 3: _context3.next = 5; return this.stackClient.fetchJSON('DELETE', (0, _utils.uri)(_templateObject2, _id)); case 5: return _context3.abrupt('return', { data: normalizeTrigger((0, _extends3.default)({}, document, { _deleted: true })) }); case 6: case 'end': return _context3.stop(); } } }, _callee3, this); })); function destroy(_x3) { return _ref3.apply(this, arguments); } return destroy; }() /** * * Be warned, ATM /jobs/triggers does not return the same informations * than /data/io.cozy.triggers (used by the super.find method). * * See https://github.com/cozy/cozy-stack/pull/2010 * * @param {object} selector * @param {object} options * @returns {{data, meta, skip, next}} The JSON API conformant response. * @throws {FetchError} */ }, { key: 'find', value: function () { var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4() { var selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var url, resp; return _regenerator2.default.wrap(function _callee4$(_context4) { while (1) { switch (_context4.prev = _context4.next) { case 0: if (!((0, _keys2.default)(selector).length === 1 && selector.worker)) { _context4.next = 14; break; } // @see https://github.com/cozy/cozy-stack/blob/master/docs/jobs.md#get-jobstriggers url = '/jobs/triggers?Worker=' + selector.worker; _context4.prev = 2; _context4.next = 5; return this.stackClient.fetchJSON('GET', url); case 5: resp = _context4.sent; return _context4.abrupt('return', { data: resp.data.map(function (row) { return normalizeTrigger(row, TRIGGERS_DOCTYPE); }), meta: { count: resp.data.length }, next: false, skip: 0 }); case 9: _context4.prev = 9; _context4.t0 = _context4['catch'](2); return _context4.abrupt('return', (0, _Collection.dontThrowNotFoundError)(_context4.t0)); case 12: _context4.next = 15; break; case 14: return _context4.abrupt('return', (0, _get3.default)(TriggerCollection.prototype.__proto__ || (0, _getPrototypeOf2.default)(TriggerCollection.prototype), 'find', this).call(this, selector, options)); case 15: case 'end': return _context4.stop(); } } }, _callee4, this, [[2, 9]]); })); function find() { return _ref4.apply(this, arguments); } return find; }() }, { key: 'get', value: function () { var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(id) { return _regenerator2.default.wrap(function _callee5$(_context5) { while (1) { switch (_context5.prev = _context5.next) { case 0: return _context5.abrupt('return', _Collection2.default.get(this.stackClient, (0, _utils.uri)(_templateObject2, id), { normalize: normalizeTrigger })); case 1: case 'end': return _context5.stop(); } } }, _callee5, this); })); function get(_x6) { return _ref5.apply(this, arguments); } return get; }() /** * Force given trigger execution. * * @see https://docs.cozy.io/en/cozy-stack/jobs/#post-jobstriggerstrigger-idlaunch * @param {object} Trigger to launch * @returns {object} Stack response, containing job launched by trigger, under `data` attribute. */ }, { key: 'launch', value: function () { var _ref6 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6(trigger) { var path, resp; return _regenerator2.default.wrap(function _callee6$(_context6) { while (1) { switch (_context6.prev = _context6.next) { case 0: path = (0, _utils.uri)(_templateObject3, trigger._id); _context6.next = 3; return this.stackClient.fetchJSON('POST', path); case 3: resp = _context6.sent; return _context6.abrupt('return', { data: (0, _JobCollection.normalizeJob)(resp.data) }); case 5: case 'end': return _context6.stop(); } } }, _callee6, this); })); function launch(_x7) { return _ref6.apply(this, arguments); } return launch; }() }, { key: 'update', value: function () { var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7() { return _regenerator2.default.wrap(function _callee7$(_context7) { while (1) { switch (_context7.prev = _context7.next) { case 0: throw new Error('update() method is not available for triggers'); case 1: case 'end': return _context7.stop(); } } }, _callee7, this); })); function update() { return _ref7.apply(this, arguments); } return update; }() }]); return TriggerCollection; }(_DocumentCollection3.default); TriggerCollection.normalizeDoctype = _DocumentCollection3.default.normalizeDoctypeJsonApi; exports.default = TriggerCollection; /***/ }), /* 1006 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _regenerator = __webpack_require__(619); var _regenerator2 = _interopRequireDefault(_regenerator); var _extends2 = __webpack_require__(843); var _extends3 = _interopRequireDefault(_extends2); var _taggedTemplateLiteral2 = __webpack_require__(976); var _taggedTemplateLiteral3 = _interopRequireDefault(_taggedTemplateLiteral2); var _asyncToGenerator2 = __webpack_require__(849); var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); var _getPrototypeOf = __webpack_require__(858); var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); var _classCallCheck2 = __webpack_require__(851); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = __webpack_require__(852); var _createClass3 = _interopRequireDefault(_createClass2); var _possibleConstructorReturn2 = __webpack_require__(861); var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); var _inherits2 = __webpack_require__(876); var _inherits3 = _interopRequireDefault(_inherits2); var _templateObject = (0, _taggedTemplateLiteral3.default)(['/sharings/doctype/', ''], ['/sharings/doctype/', '']), _templateObject2 = (0, _taggedTemplateLiteral3.default)(['/sharings/', '/recipients'], ['/sharings/', '/recipients']), _templateObject3 = (0, _taggedTemplateLiteral3.default)(['/sharings/', '/recipients/', ''], ['/sharings/', '/recipients/', '']), _templateObject4 = (0, _taggedTemplateLiteral3.default)(['/sharings/', '/recipients/self'], ['/sharings/', '/recipients/self']); var _DocumentCollection2 = __webpack_require__(969); var _DocumentCollection3 = _interopRequireDefault(_DocumentCollection2); var _FileCollection = __webpack_require__(997); var _utils = __webpack_require__(983); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var normalizeSharing = function normalizeSharing(sharing) { return (0, _DocumentCollection2.normalizeDoc)(sharing, 'io.cozy.sharings'); }; /** * Implements the `DocumentCollection` API along with specific methods for * `io.cozy.sharings`. */ var SharingCollection = function (_DocumentCollection) { (0, _inherits3.default)(SharingCollection, _DocumentCollection); function SharingCollection() { (0, _classCallCheck3.default)(this, SharingCollection); return (0, _possibleConstructorReturn3.default)(this, (SharingCollection.__proto__ || (0, _getPrototypeOf2.default)(SharingCollection)).apply(this, arguments)); } (0, _createClass3.default)(SharingCollection, [{ key: 'findByDoctype', value: function () { var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(doctype) { var resp; return _regenerator2.default.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _context.next = 2; return this.stackClient.fetchJSON('GET', (0, _utils.uri)(_templateObject, doctype)); case 2: resp = _context.sent; return _context.abrupt('return', (0, _extends3.default)({}, resp, { data: resp.data.map(normalizeSharing) })); case 4: case 'end': return _context.stop(); } } }, _callee, this); })); function findByDoctype(_x) { return _ref.apply(this, arguments); } return findByDoctype; }() /** * share - Creates a new sharing. See https://docs.cozy.io/en/cozy-stack/sharing/#post-sharings * * @param {object} document The document to share. Should have and _id and a name. * @param {Array} recipients A list of io.cozy.contacts * @param {string} sharingType * @param {string} description * @param {string=} previewPath Relative URL of the sharings preview page */ }, { key: 'share', value: function () { var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(document, recipients, sharingType, description) { var previewPath = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null; var resp; return _regenerator2.default.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: _context2.next = 2; return this.stackClient.fetchJSON('POST', '/sharings/', { data: { type: 'io.cozy.sharings', attributes: { description: description, preview_path: previewPath, open_sharing: sharingType === 'two-way', rules: getSharingRules(document, sharingType) }, relationships: { recipients: { data: recipients.map(function (_ref3) { var _id = _ref3._id, _type = _ref3._type; return { id: _id, type: _type }; }) } } } }); case 2: resp = _context2.sent; return _context2.abrupt('return', { data: normalizeSharing(resp.data) }); case 4: case 'end': return _context2.stop(); } } }, _callee2, this); })); function share(_x3, _x4, _x5, _x6) { return _ref2.apply(this, arguments); } return share; }() /** * getDiscoveryLink - Returns the URL of the page that can be used to accept a sharing. See https://docs.cozy.io/en/cozy-stack/sharing/#get-sharingssharing-iddiscovery * * @param {string} sharingId * @param {string} sharecode * @returns {string} */ }, { key: 'getDiscoveryLink', value: function getDiscoveryLink(sharingId, sharecode) { return this.stackClient.fullpath('/sharings/' + sharingId + '/discovery?sharecode=' + sharecode); } }, { key: 'addRecipients', value: function () { var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(sharing, recipients, sharingType) { var recipientsPayload, resp; return _regenerator2.default.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: recipientsPayload = { data: recipients.map(function (_ref5) { var _id = _ref5._id, _type = _ref5._type; return { id: _id, type: _type }; }) }; _context3.next = 3; return this.stackClient.fetchJSON('POST', (0, _utils.uri)(_templateObject2, sharing._id), { data: { type: 'io.cozy.sharings', id: sharing._id, relationships: sharingType === 'two-way' ? { recipients: recipientsPayload } : { read_only_recipients: recipientsPayload } } }); case 3: resp = _context3.sent; return _context3.abrupt('return', { data: normalizeSharing(resp.data) }); case 5: case 'end': return _context3.stop(); } } }, _callee3, this); })); function addRecipients(_x7, _x8, _x9) { return _ref4.apply(this, arguments); } return addRecipients; }() }, { key: 'revokeRecipient', value: function revokeRecipient(sharing, recipientIndex) { return this.stackClient.fetchJSON('DELETE', (0, _utils.uri)(_templateObject3, sharing._id, recipientIndex)); } }, { key: 'revokeSelf', value: function revokeSelf(sharing) { return this.stackClient.fetchJSON('DELETE', (0, _utils.uri)(_templateObject4, sharing._id)); } }]); return SharingCollection; }(_DocumentCollection3.default); SharingCollection.normalizeDoctype = _DocumentCollection3.default.normalizeDoctypeJsonApi; // Rules determine the behavior of the sharing when changes are made to the shared document // See https://github.com/cozy/cozy-stack/blob/master/docs/sharing-design.md#description-of-a-sharing var getSharingRules = function getSharingRules(document, sharingType) { var _id = document._id, _type = document._type; return (0, _FileCollection.isFile)(document) ? [(0, _extends3.default)({ title: document.name, doctype: 'io.cozy.files', values: [_id] }, getSharingPolicy(document, sharingType))] : [(0, _extends3.default)({ title: 'collection', doctype: _type, values: [_id] }, getSharingPolicy(document, sharingType)), (0, _extends3.default)({ title: 'items', doctype: 'io.cozy.files', values: [_type + '/' + _id], selector: 'referenced_by' }, sharingType === 'two-way' ? { add: 'sync', update: 'sync', remove: 'sync' } : { add: 'push', update: 'none', remove: 'push' })]; }; var getSharingPolicy = function getSharingPolicy(document, sharingType) { if ((0, _FileCollection.isFile)(document) && (0, _FileCollection.isDirectory)(document)) { return sharingType === 'two-way' ? { add: 'sync', update: 'sync', remove: 'sync' } : { add: 'push', update: 'push', remove: 'push' }; } return sharingType === 'two-way' ? { update: 'sync', remove: 'revoke' } : { update: 'push', remove: 'revoke' }; }; exports.default = SharingCollection; /***/ }), /* 1007 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _getIterator2 = __webpack_require__(796); var _getIterator3 = _interopRequireDefault(_getIterator2); var _extends2 = __webpack_require__(843); var _extends3 = _interopRequireDefault(_extends2); var _objectWithoutProperties2 = __webpack_require__(850); var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); var _regenerator = __webpack_require__(619); var _regenerator2 = _interopRequireDefault(_regenerator); var _taggedTemplateLiteral2 = __webpack_require__(976); var _taggedTemplateLiteral3 = _interopRequireDefault(_taggedTemplateLiteral2); var _asyncToGenerator2 = __webpack_require__(849); var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); var _getPrototypeOf = __webpack_require__(858); var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); var _classCallCheck2 = __webpack_require__(851); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = __webpack_require__(852); var _createClass3 = _interopRequireDefault(_createClass2); var _possibleConstructorReturn2 = __webpack_require__(861); var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); var _inherits2 = __webpack_require__(876); var _inherits3 = _interopRequireDefault(_inherits2); var _templateObject = (0, _taggedTemplateLiteral3.default)(['/permissions/', ''], ['/permissions/', '']), _templateObject2 = (0, _taggedTemplateLiteral3.default)(['/permissions'], ['/permissions']), _templateObject3 = (0, _taggedTemplateLiteral3.default)(['/permissions/doctype/', '/shared-by-link'], ['/permissions/doctype/', '/shared-by-link']); var _DocumentCollection2 = __webpack_require__(969); var _DocumentCollection3 = _interopRequireDefault(_DocumentCollection2); var _FileCollection = __webpack_require__(997); var _utils = __webpack_require__(983); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var normalizePermission = function normalizePermission(perm) { return (0, _DocumentCollection2.normalizeDoc)(perm, 'io.cozy.permissions'); }; /** * Implements `DocumentCollection` API along with specific methods for `io.cozy.permissions`. */ var PermissionCollection = function (_DocumentCollection) { (0, _inherits3.default)(PermissionCollection, _DocumentCollection); function PermissionCollection() { (0, _classCallCheck3.default)(this, PermissionCollection); return (0, _possibleConstructorReturn3.default)(this, (PermissionCollection.__proto__ || (0, _getPrototypeOf2.default)(PermissionCollection)).apply(this, arguments)); } (0, _createClass3.default)(PermissionCollection, [{ key: 'get', value: function () { var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(id) { var resp; return _regenerator2.default.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _context.next = 2; return this.stackClient.fetchJSON('GET', (0, _utils.uri)(_templateObject, id)); case 2: resp = _context.sent; return _context.abrupt('return', { data: normalizePermission(resp.data) }); case 4: case 'end': return _context.stop(); } } }, _callee, this); })); function get(_x) { return _ref.apply(this, arguments); } return get; }() }, { key: 'create', value: function () { var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(_ref2) { var _id = _ref2._id, _type = _ref2._type, attributes = (0, _objectWithoutProperties3.default)(_ref2, ['_id', '_type']); var resp; return _regenerator2.default.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: _context2.next = 2; return this.stackClient.fetchJSON('POST', (0, _utils.uri)(_templateObject2), { data: { type: 'io.cozy.permissions', attributes: attributes } }); case 2: resp = _context2.sent; return _context2.abrupt('return', { data: normalizePermission(resp.data) }); case 4: case 'end': return _context2.stop(); } } }, _callee2, this); })); function create(_x2) { return _ref3.apply(this, arguments); } return create; }() /** * Adds a permission to the given document. Document type must be * `io.cozy.apps`, `io.cozy.konnectors` or `io.cozy.permissions` * * @param {object} document * @param {object} permission * @returns {Promise} * * @example * ``` * const permissions = await client * .collection('io.cozy.permissions') * .add(konnector, { * folder: { * type: 'io.cozy.files', * verbs: ['GET', 'PUT'], * values: [`io.cozy.files.bc57b60eb2954537b0dcdc6ebd8e9d23`] * } * }) * ``` */ }, { key: 'add', value: function () { var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(document, permission) { var endpoint, resp; return _regenerator2.default.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: endpoint = void 0; _context3.t0 = document._type; _context3.next = _context3.t0 === 'io.cozy.apps' ? 4 : _context3.t0 === 'io.cozy.konnectors' ? 6 : _context3.t0 === 'io.cozy.permissions' ? 8 : 10; break; case 4: endpoint = '/permissions/apps/' + document.slug; return _context3.abrupt('break', 11); case 6: endpoint = '/permissions/konnectors/' + document.slug; return _context3.abrupt('break', 11); case 8: endpoint = '/permissions/' + document._id; return _context3.abrupt('break', 11); case 10: throw new Error('Permissions can only be added on existing permissions, apps and konnectors.'); case 11: _context3.next = 13; return this.stackClient.fetchJSON('PATCH', endpoint, { data: { type: 'io.cozy.permissions', attributes: { permissions: permission } } }); case 13: resp = _context3.sent; return _context3.abrupt('return', resp.data); case 15: case 'end': return _context3.stop(); } } }, _callee3, this); })); function add(_x3, _x4) { return _ref4.apply(this, arguments); } return add; }() }, { key: 'destroy', value: function destroy(permission) { return this.stackClient.fetchJSON('DELETE', (0, _utils.uri)(_templateObject, permission.id)); } }, { key: 'findLinksByDoctype', value: function () { var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(doctype) { var resp; return _regenerator2.default.wrap(function _callee4$(_context4) { while (1) { switch (_context4.prev = _context4.next) { case 0: _context4.next = 2; return this.stackClient.fetchJSON('GET', (0, _utils.uri)(_templateObject3, doctype)); case 2: resp = _context4.sent; return _context4.abrupt('return', (0, _extends3.default)({}, resp, { data: resp.data.map(normalizePermission) })); case 4: case 'end': return _context4.stop(); } } }, _callee4, this); })); function findLinksByDoctype(_x5) { return _ref5.apply(this, arguments); } return findLinksByDoctype; }() }, { key: 'findApps', value: function () { var _ref6 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5() { var resp; return _regenerator2.default.wrap(function _callee5$(_context5) { while (1) { switch (_context5.prev = _context5.next) { case 0: _context5.next = 2; return this.stackClient.fetchJSON('GET', '/apps/'); case 2: resp = _context5.sent; return _context5.abrupt('return', (0, _extends3.default)({}, resp, { data: resp.data.map(function (a) { return (0, _extends3.default)({ _id: a.id }, a); }) })); case 4: case 'end': return _context5.stop(); } } }, _callee5, this); })); function findApps() { return _ref6.apply(this, arguments); } return findApps; }() }, { key: 'createSharingLink', value: function () { var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6(document) { var resp; return _regenerator2.default.wrap(function _callee6$(_context6) { while (1) { switch (_context6.prev = _context6.next) { case 0: _context6.next = 2; return this.stackClient.fetchJSON('POST', '/permissions?codes=email', { data: { type: 'io.cozy.permissions', attributes: { permissions: getPermissionsFor(document, true) } } }); case 2: resp = _context6.sent; return _context6.abrupt('return', { data: normalizePermission(resp.data) }); case 4: case 'end': return _context6.stop(); } } }, _callee6, this); })); function createSharingLink(_x6) { return _ref7.apply(this, arguments); } return createSharingLink; }() }, { key: 'revokeSharingLink', value: function () { var _ref8 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(document) { var allLinks, links, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, perm; return _regenerator2.default.wrap(function _callee7$(_context7) { while (1) { switch (_context7.prev = _context7.next) { case 0: _context7.next = 2; return this.findLinksByDoctype(document._type); case 2: allLinks = _context7.sent; links = allLinks.data.filter(function (perm) { return isPermissionRelatedTo(perm, document); }); _iteratorNormalCompletion = true; _didIteratorError = false; _iteratorError = undefined; _context7.prev = 7; _iterator = (0, _getIterator3.default)(links); case 9: if (_iteratorNormalCompletion = (_step = _iterator.next()).done) { _context7.next = 16; break; } perm = _step.value; _context7.next = 13; return this.destroy(perm); case 13: _iteratorNormalCompletion = true; _context7.next = 9; break; case 16: _context7.next = 22; break; case 18: _context7.prev = 18; _context7.t0 = _context7['catch'](7); _didIteratorError = true; _iteratorError = _context7.t0; case 22: _context7.prev = 22; _context7.prev = 23; if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } case 25: _context7.prev = 25; if (!_didIteratorError) { _context7.next = 28; break; } throw _iteratorError; case 28: return _context7.finish(25); case 29: return _context7.finish(22); case 30: case 'end': return _context7.stop(); } } }, _callee7, this, [[7, 18, 22, 30], [23,, 25, 29]]); })); function revokeSharingLink(_x7) { return _ref8.apply(this, arguments); } return revokeSharingLink; }() /** * async getOwnPermissions - Gets the permission for the current token * * @returns {object} */ }, { key: 'getOwnPermissions', value: function () { var _ref9 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee8() { var resp; return _regenerator2.default.wrap(function _callee8$(_context8) { while (1) { switch (_context8.prev = _context8.next) { case 0: _context8.next = 2; return this.stackClient.fetchJSON('GET', '/permissions/self'); case 2: resp = _context8.sent; return _context8.abrupt('return', { data: normalizePermission(resp.data) }); case 4: case 'end': return _context8.stop(); } } }, _callee8, this); })); function getOwnPermissions() { return _ref9.apply(this, arguments); } return getOwnPermissions; }() }]); return PermissionCollection; }(_DocumentCollection3.default); var getPermissionsFor = function getPermissionsFor(document) { var publicLink = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var _id = document._id, _type = document._type; var verbs = publicLink ? ['GET'] : ['ALL']; // TODO: this works for albums, but it needs to be generalized and integrated // with cozy-client ; some sort of doctype "schema" will be needed here return (0, _FileCollection.isFile)(document) ? { files: { type: 'io.cozy.files', verbs: verbs, values: [_id] } } : { collection: { type: _type, verbs: verbs, values: [_id] }, files: { type: 'io.cozy.files', verbs: verbs, values: [_type + '/' + _id], selector: 'referenced_by' } }; }; PermissionCollection.normalizeDoctype = _DocumentCollection3.default.normalizeDoctypeJsonApi; var isPermissionRelatedTo = function isPermissionRelatedTo(perm, document) { var _id = document._id; return (0, _FileCollection.isFile)(document) ? perm.attributes.permissions.files.values.indexOf(_id) !== -1 : perm.attributes.permissions.collection.values.indexOf(_id) !== -1; }; exports.default = PermissionCollection; /***/ }), /* 1008 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SETTINGS_DOCTYPE = undefined; var _regenerator = __webpack_require__(619); var _regenerator2 = _interopRequireDefault(_regenerator); var _asyncToGenerator2 = __webpack_require__(849); var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); var _getPrototypeOf = __webpack_require__(858); var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); var _classCallCheck2 = __webpack_require__(851); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = __webpack_require__(852); var _createClass3 = _interopRequireDefault(_createClass2); var _possibleConstructorReturn2 = __webpack_require__(861); var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); var _inherits2 = __webpack_require__(876); var _inherits3 = _interopRequireDefault(_inherits2); var _DocumentCollection2 = __webpack_require__(969); var _DocumentCollection3 = _interopRequireDefault(_DocumentCollection2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var SETTINGS_DOCTYPE = exports.SETTINGS_DOCTYPE = 'io.cozy.settings'; /** * Implements `DocumentCollection` API to interact with the /settings endpoint of the stack */ var SettingsCollection = function (_DocumentCollection) { (0, _inherits3.default)(SettingsCollection, _DocumentCollection); function SettingsCollection(stackClient) { (0, _classCallCheck3.default)(this, SettingsCollection); return (0, _possibleConstructorReturn3.default)(this, (SettingsCollection.__proto__ || (0, _getPrototypeOf2.default)(SettingsCollection)).call(this, SETTINGS_DOCTYPE, stackClient)); } /** * async get - Calls a route on the /settings API * * @param {string} path The setting route to call, eg `instance` or `context` * @returns {object} The response from the route */ (0, _createClass3.default)(SettingsCollection, [{ key: 'get', value: function () { var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(path) { var resp; return _regenerator2.default.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _context.next = 2; return this.stackClient.fetchJSON('GET', '/settings/' + path); case 2: resp = _context.sent; return _context.abrupt('return', _DocumentCollection3.default.normalizeDoctypeJsonApi(SETTINGS_DOCTYPE)(resp.data, resp)); case 4: case 'end': return _context.stop(); } } }, _callee, this); })); function get(_x) { return _ref.apply(this, arguments); } return get; }() }]); return SettingsCollection; }(_DocumentCollection3.default); SettingsCollection.normalizeDoctype = _DocumentCollection3.default.normalizeDoctypeJsonApi; exports.default = SettingsCollection; /***/ }), /* 1009 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getIconURL = undefined; var _regenerator = __webpack_require__(619); var _regenerator2 = _interopRequireDefault(_regenerator); var _getIterator2 = __webpack_require__(796); var _getIterator3 = _interopRequireDefault(_getIterator2); var _asyncToGenerator2 = __webpack_require__(849); var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); var _memoize = __webpack_require__(1010); var _memoize2 = _interopRequireDefault(_memoize); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var mimeTypes = { gif: 'image/gif', ico: 'image/vnd.microsoft.icon', jpeg: 'image/jpeg', jpg: 'image/jpeg', png: 'image/png', svg: 'image/svg+xml' }; var getIconExtensionFromApp = function getIconExtensionFromApp(app) { if (!app.icon) { throw new Error(app.name + ': Cannot detect icon mime type since app has no icon'); } var extension = app.icon.split('.').pop(); if (!extension) { throw new Error(app.name + ': Unable to detect icon mime type from extension (' + app.icon + ')'); } return extension; }; var fallbacks = function () { var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(tries, check) { var err, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _try, res; return _regenerator2.default.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: err = void 0; _iteratorNormalCompletion = true; _didIteratorError = false; _iteratorError = undefined; _context.prev = 4; _iterator = (0, _getIterator3.default)(tries); case 6: if (_iteratorNormalCompletion = (_step = _iterator.next()).done) { _context.next = 22; break; } _try = _step.value; _context.prev = 8; _context.next = 11; return _try(); case 11: res = _context.sent; check && check(res); return _context.abrupt('return', res); case 16: _context.prev = 16; _context.t0 = _context['catch'](8); err = _context.t0; case 19: _iteratorNormalCompletion = true; _context.next = 6; break; case 22: _context.next = 28; break; case 24: _context.prev = 24; _context.t1 = _context['catch'](4); _didIteratorError = true; _iteratorError = _context.t1; case 28: _context.prev = 28; _context.prev = 29; if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } case 31: _context.prev = 31; if (!_didIteratorError) { _context.next = 34; break; } throw _iteratorError; case 34: return _context.finish(31); case 35: return _context.finish(28); case 36: throw err; case 37: case 'end': return _context.stop(); } } }, _callee, undefined, [[4, 24, 28, 36], [8, 16], [29,, 31, 35]]); })); return function fallbacks(_x, _x2) { return _ref.apply(this, arguments); }; }(); /** * Fetch application/konnector that is installed * * @private */ var fetchAppOrKonnector = function fetchAppOrKonnector(stackClient, type, slug) { return stackClient.fetchJSON('GET', '/' + type + 's/' + slug).then(function (x) { return x.data.attributes; }); }; /** * Fetch application/konnector from the registry * * @private */ var fetchAppOrKonnectorViaRegistry = function fetchAppOrKonnectorViaRegistry(stackClient, type, slug) { return stackClient.fetchJSON('GET', '/registry/' + slug).then(function (x) { return x.latest_version.manifest; }); }; var _getIconURL = function () { var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(stackClient, opts) { var type, slug, appData, _opts$priority, priority, iconDataFetchers, resp, icon, app, appDataFetchers, ext; return _regenerator2.default.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: type = opts.type, slug = opts.slug, appData = opts.appData, _opts$priority = opts.priority, priority = _opts$priority === undefined ? 'stack' : _opts$priority; iconDataFetchers = [function () { return stackClient.fetch('GET', '/' + type + 's/' + slug + '/icon'); }, function () { return stackClient.fetch('GET', '/registry/' + slug + '/icon'); }]; if (priority === 'registry') { iconDataFetchers.reverse(); } _context2.next = 5; return fallbacks(iconDataFetchers, function (resp) { if (!resp.ok) { throw new Error('Error while fetching icon ' + resp.statusText); } }); case 5: resp = _context2.sent; _context2.next = 8; return resp.blob(); case 8: icon = _context2.sent; app = void 0; if (icon.type) { _context2.next = 26; break; } // iOS10 does not set correctly mime type for images, so we assume // that an empty mime type could mean that the app is running on iOS10. // For regular images like jpeg, png or gif it still works well in the // Safari browser but not for SVG. // So let's set a mime type manually. We cannot always set it to // image/svg+xml and must guess the mime type based on the icon attribute // from app/manifest // See https://stackoverflow.com/questions/38318411/uiwebview-on-ios-10-beta-not-loading-any-svg-images appDataFetchers = [function () { return fetchAppOrKonnector(stackClient, type, slug); }, function () { return fetchAppOrKonnectorViaRegistry(stackClient, type, slug); }]; if (priority === 'registry') { appDataFetchers.reverse(); } _context2.t1 = appData; if (_context2.t1) { _context2.next = 18; break; } _context2.next = 17; return fallbacks(appDataFetchers); case 17: _context2.t1 = _context2.sent; case 18: _context2.t0 = _context2.t1; if (_context2.t0) { _context2.next = 21; break; } _context2.t0 = {}; case 21: app = _context2.t0; ext = getIconExtensionFromApp(app); if (mimeTypes[ext]) { _context2.next = 25; break; } throw new Error('Unknown image extension "' + ext + '" for app ' + app.name); case 25: icon = new Blob([icon], { type: mimeTypes[ext] }); case 26: return _context2.abrupt('return', URL.createObjectURL(icon)); case 27: case 'end': return _context2.stop(); } } }, _callee2, undefined); })); return function _getIconURL(_x3, _x4) { return _ref2.apply(this, arguments); }; }(); var getIconURL = function getIconURL() { return _getIconURL.apply(this, arguments).catch(function (e) { console.warn(e); return ''; }); }; exports.default = (0, _memoize2.default)(getIconURL, { maxDuration: 300 * 1000, key: function key(stackClient, opts) { var type = opts.type, slug = opts.slug, priority = opts.priority; return stackClient.uri + +':' + type + ':' + slug + ':' + priority; } }); exports.getIconURL = getIconURL; /***/ }), /* 1010 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _keys = __webpack_require__(835); var _keys2 = _interopRequireDefault(_keys); var _getIterator2 = __webpack_require__(796); var _getIterator3 = _interopRequireDefault(_getIterator2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Delete outdated results from cache */ var garbageCollect = function garbageCollect(cache, maxDuration) { var now = Date.now(); var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = (0, _getIterator3.default)((0, _keys2.default)(cache)), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var key = _step.value; var delta = now - cache[key].date; if (delta > maxDuration) { delete cache[key]; } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } }; /** * Memoize with maxDuration and custom key */ var memoize = function memoize(fn, options) { var cache = {}; return function () { var key = options.key.apply(null, arguments); garbageCollect(cache, options.maxDuration); var existing = cache[key]; if (existing) { return existing.result; } else { var result = fn.apply(this, arguments); cache[key] = { result: result, date: Date.now() }; return result; } }; }; exports.default = memoize; /***/ }), /* 1011 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var logDeprecate = function logDeprecate() { var _console; if (false) {} (_console = console).warn.apply(_console, arguments); }; exports.default = logDeprecate; /***/ }), /* 1012 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var EXPIRED_TOKEN = /Expired token/; var CLIENT_NOT_FOUND = /Client not found/; exports.default = { EXPIRED_TOKEN: EXPIRED_TOKEN, CLIENT_NOT_FOUND: CLIENT_NOT_FOUND }; /***/ }), /* 1013 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _regenerator = __webpack_require__(619); var _regenerator2 = _interopRequireDefault(_regenerator); var _asyncToGenerator2 = __webpack_require__(849); var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); var _keys = __webpack_require__(835); var _keys2 = _interopRequireDefault(_keys); var _extends2 = __webpack_require__(843); var _extends3 = _interopRequireDefault(_extends2); var _getPrototypeOf = __webpack_require__(858); var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); var _objectWithoutProperties2 = __webpack_require__(850); var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); var _classCallCheck2 = __webpack_require__(851); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = __webpack_require__(852); var _createClass3 = _interopRequireDefault(_createClass2); var _possibleConstructorReturn2 = __webpack_require__(861); var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); var _get2 = __webpack_require__(940); var _get3 = _interopRequireDefault(_get2); var _inherits2 = __webpack_require__(876); var _inherits3 = _interopRequireDefault(_inherits2); var _CozyStackClient2 = __webpack_require__(967); var _CozyStackClient3 = _interopRequireDefault(_CozyStackClient2); var _AccessToken = __webpack_require__(1014); var _AccessToken2 = _interopRequireDefault(_AccessToken); var _logDeprecate = __webpack_require__(1011); var _logDeprecate2 = _interopRequireDefault(_logDeprecate); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var defaultoauthOptions = { clientID: '', clientName: '', clientKind: '', clientSecret: '', clientURI: '', registrationAccessToken: '', redirectURI: '', softwareID: '', softwareVersion: '', logoURI: '', policyURI: '', notificationPlatform: '', notificationDeviceToken: '' /** * Specialized `CozyStackClient` for mobile, implementing stack registration * through OAuth. */ }; var OAuthClient = function (_CozyStackClient) { (0, _inherits3.default)(OAuthClient, _CozyStackClient); function OAuthClient(_ref) { var oauth = _ref.oauth, _ref$scope = _ref.scope, scope = _ref$scope === undefined ? [] : _ref$scope, onTokenRefresh = _ref.onTokenRefresh, options = (0, _objectWithoutProperties3.default)(_ref, ['oauth', 'scope', 'onTokenRefresh']); (0, _classCallCheck3.default)(this, OAuthClient); var _this = (0, _possibleConstructorReturn3.default)(this, (OAuthClient.__proto__ || (0, _getPrototypeOf2.default)(OAuthClient)).call(this, options)); _this.setOAuthOptions((0, _extends3.default)({}, defaultoauthOptions, oauth)); if (oauth.token) { _this.setToken(oauth.token); } _this.scope = scope; _this.onTokenRefresh = onTokenRefresh; return _this; } /** * Checks if the client has his registration information from the server * * @returns {boolean} * @private */ (0, _createClass3.default)(OAuthClient, [{ key: 'isRegistered', value: function isRegistered() { return this.oauthOptions.clientID !== ''; } /** * Converts a camel-cased data set to snake case, suitable for sending to the OAuth server * * @param {object} data Initial data * @returns {object} Formatted data * @private */ }, { key: 'snakeCaseOAuthData', value: function snakeCaseOAuthData(data) { var mappedFields = { softwareID: 'software_id', softwareVersion: 'software_version', clientID: 'client_id', clientName: 'client_name', clientKind: 'client_kind', clientURI: 'client_uri', logoURI: 'logo_uri', policyURI: 'policy_uri', notificationPlatform: 'notification_platform', notificationDeviceToken: 'notification_device_token', redirectURI: 'redirect_uris' }; var result = {}; (0, _keys2.default)(data).forEach(function (fieldName) { var key = mappedFields[fieldName] || fieldName; var value = data[fieldName]; result[key] = value; }); // special case: turn redirect_uris into an array if (result['redirect_uris'] && result['redirect_uris'] instanceof Array === false) result['redirect_uris'] = [result['redirect_uris']]; return result; } /** * Converts a snake-cased data set to camel case, suitable for internal use * * @param {object} data Initial data * @returns {object} Formatted data * @private */ }, { key: 'camelCaseOAuthData', value: function camelCaseOAuthData(data) { var mappedFields = { client_id: 'clientID', client_name: 'clientName', client_secret: 'clientSecret', registration_access_token: 'registrationAccessToken', software_id: 'softwareID', redirect_uris: 'redirectURI' }; var result = {}; (0, _keys2.default)(data).forEach(function (fieldName) { var key = mappedFields[fieldName] || fieldName; var value = data[fieldName]; result[key] = value; }); return result; } /** * Registers the currenly configured client with the OAuth server. * * @throws {Error} When the client is already registered * @returns {promise} A promise that resolves with a complete list of client information, including client ID and client secret. */ }, { key: 'register', value: function () { var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee() { var mandatoryFields, fields, missingMandatoryFields, data; return _regenerator2.default.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: if (!this.isRegistered()) { _context.next = 2; break; } throw new Error('Client already registered'); case 2: mandatoryFields = ['redirectURI']; fields = (0, _keys2.default)(this.oauthOptions); missingMandatoryFields = mandatoryFields.filter(function (fieldName) { return fields[fieldName]; }); if (!(missingMandatoryFields.length > 0)) { _context.next = 7; break; } throw new Error('Can\'t register client : missing ' + missingMandatoryFields + ' fields'); case 7: _context.next = 9; return this.fetchJSON('POST', '/auth/register', this.snakeCaseOAuthData({ redirectURI: this.oauthOptions.redirectURI, clientName: this.oauthOptions.clientName, softwareID: this.oauthOptions.softwareID, clientKind: this.oauthOptions.clientKind, clientURI: this.oauthOptions.clientURI, logoURI: this.oauthOptions.logoURI, policyURI: this.oauthOptions.policyURI, softwareVersion: this.oauthOptions.softwareVersion, notificationPlatform: this.oauthOptions.notificationPlatform, notificationDeviceToken: this.oauthOptions.notificationDeviceToken })); case 9: data = _context.sent; this.setOAuthOptions((0, _extends3.default)({}, this.oauthOptions, { client_id: data.client_id, client_name: data.client_name, client_secret: data.client_secret, registration_access_token: data.registration_access_token, software_id: data.software_id })); return _context.abrupt('return', this.oauthOptions); case 12: case 'end': return _context.stop(); } } }, _callee, this); })); function register() { return _ref2.apply(this, arguments); } return register; }() /** * Unregisters the currenly configured client with the OAuth server. * * @throws {NotRegisteredException} When the client doesn't have it's registration information * @returns {promise} */ }, { key: 'unregister', value: function () { var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2() { var clientID; return _regenerator2.default.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: if (this.isRegistered()) { _context2.next = 2; break; } throw new NotRegisteredException(); case 2: clientID = this.oauthOptions.clientID; this.oauthOptions.clientID = ''; return _context2.abrupt('return', this.fetchJSON('DELETE', '/auth/register/' + clientID, null, { headers: { Authorization: this.registrationAccessTokenToAuthHeader() } })); case 5: case 'end': return _context2.stop(); } } }, _callee2, this); })); function unregister() { return _ref3.apply(this, arguments); } return unregister; }() /** * Fetches the complete set of client information from the server after it has been registered. * * @throws {NotRegisteredException} When the client doesn't have it's registration information * @returns {promise} */ }, { key: 'fetchInformation', value: function () { var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3() { return _regenerator2.default.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: if (this.isRegistered()) { _context3.next = 2; break; } throw new NotRegisteredException(); case 2: return _context3.abrupt('return', this.fetchJSON('GET', '/auth/register/' + this.oauthOptions.clientID, null, { headers: { Authorization: this.registrationAccessTokenToAuthHeader() } })); case 3: case 'end': return _context3.stop(); } } }, _callee3, this); })); function fetchInformation() { return _ref4.apply(this, arguments); } return fetchInformation; }() /** * Overwrites the client own information. This method will update both the local information and the remote information on the OAuth server. * * @throws {NotRegisteredException} When the client doesn't have it's registration information * @param {object} information Set of information to update. Note that some fields such as `clientID` can't be updated. * @param {boolean} resetSecret = false Optionnal, whether to reset the client secret or not * @returns {promise} A promise that resolves to a complete, updated list of client information */ }, { key: 'updateInformation', value: function () { var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(information) { var resetSecret = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var mandatoryFields, data, result; return _regenerator2.default.wrap(function _callee4$(_context4) { while (1) { switch (_context4.prev = _context4.next) { case 0: if (this.isRegistered()) { _context4.next = 2; break; } throw new NotRegisteredException(); case 2: mandatoryFields = { clientID: this.oauthOptions.clientID, clientName: this.oauthOptions.clientName, redirectURI: this.oauthOptions.redirectURI, softwareID: this.oauthOptions.softwareID }; data = this.snakeCaseOAuthData((0, _extends3.default)({}, mandatoryFields, information)); if (resetSecret) data['client_secret'] = this.oauthOptions.clientSecret; _context4.next = 7; return this.fetchJSON('PUT', '/auth/register/' + this.oauthOptions.clientID, data, { headers: { Authorization: this.registrationAccessTokenToAuthHeader() } }); case 7: result = _context4.sent; this.setOAuthOptions((0, _extends3.default)({}, data, result)); return _context4.abrupt('return', this.oauthOptions); case 10: case 'end': return _context4.stop(); } } }, _callee4, this); })); function updateInformation(_x2) { return _ref5.apply(this, arguments); } return updateInformation; }() /** * Generates a random state code to be used during the OAuth process * * @returns {string} */ }, { key: 'generateStateCode', value: function generateStateCode() { var STATE_SIZE = 16; var hasCrypto = typeof window !== 'undefined' && typeof window.crypto !== 'undefined' && typeof window.crypto.getRandomValues === 'function'; var buffer = void 0; if (hasCrypto) { buffer = new Uint8Array(STATE_SIZE); window.crypto.getRandomValues(buffer); } else { buffer = new Array(STATE_SIZE); for (var i = 0; i < buffer.length; i++) { buffer[i] = Math.floor(Math.random() * 255); } } return btoa(String.fromCharCode.apply(null, buffer)).replace(/=+$/, '').replace(/\//g, '_').replace(/\+/g, '-'); } /** * Generates the URL that the user should be sent to in order to accept the app's permissions. * * @throws {NotRegisteredException} When the client doesn't have it's registration information * @param {string} stateCode A random code to be included in the URl for security. Can be generated with `client.generateStateCode()` * @param {Array} scopes = [] An array of permission scopes for the token. * @returns {string} The URL */ }, { key: 'getAuthCodeURL', value: function getAuthCodeURL(stateCode) { var scopes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.scope; if (!this.isRegistered()) throw new NotRegisteredException(); var query = { client_id: this.oauthOptions.clientID, redirect_uri: this.oauthOptions.redirectURI, state: stateCode, response_type: 'code', scope: scopes.join(' ') }; return this.uri + '/auth/authorize?' + this.dataToQueryString(query); } }, { key: 'dataToQueryString', value: function dataToQueryString(data) { return (0, _keys2.default)(data).map(function (param) { return param + '=' + encodeURIComponent(data[param]); }).join('&'); } /** * Retrieves the access code contained in the URL to which the user is redirected after accepting the app's permissions (the `redirectURI`). * * @throws {Error} The URL should contain the same state code as the one generated with `client.getAuthCodeURL()`. If not, it will throw an error * @param {string} pageURL The redirected page URL, containing the state code and the access code * @param {string} stateCode The state code that was contained in the original URL the user was sent to (see `client.getAuthCodeURL()`) * @returns {string} The access code */ }, { key: 'getAccessCodeFromURL', value: function getAccessCodeFromURL(pageURL, stateCode) { if (!stateCode) throw new Error('Missing state code'); var params = new URL(pageURL).searchParams; var urlStateCode = params.get('state'); var urlAccessCode = params.get('access_code'); if (stateCode !== urlStateCode) throw new Error('Given state does not match url query state'); return urlAccessCode; } /** * Exchanges an access code for an access token. This function does **not** update the client's token. * * @throws {NotRegisteredException} When the client doesn't have it's registration information * @param {string} accessCode - The access code contained in the redirection URL — see `client.getAccessCodeFromURL()` * @param {object} oauthOptions — To use when OAuthClient is not yet registered (during login process) * @param {string} uri — To use when OAuthClient is not yet registered (during login process) * @returns {Promise} A promise that resolves with an AccessToken object. */ }, { key: 'fetchAccessToken', value: function () { var _ref6 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(accessCode, oauthOptions, uri) { var data, result; return _regenerator2.default.wrap(function _callee5$(_context5) { while (1) { switch (_context5.prev = _context5.next) { case 0: if (!(!this.isRegistered() && !oauthOptions)) { _context5.next = 2; break; } throw new NotRegisteredException(); case 2: oauthOptions = oauthOptions || this.oauthOptions; data = { grant_type: 'authorization_code', code: accessCode, client_id: oauthOptions.clientID, client_secret: oauthOptions.clientSecret }; _context5.next = 6; return this.fetchJSON('POST', (uri || '') + '/auth/access_token', this.dataToQueryString(data), { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }); case 6: result = _context5.sent; return _context5.abrupt('return', new _AccessToken2.default(result)); case 8: case 'end': return _context5.stop(); } } }, _callee5, this); })); function fetchAccessToken(_x4, _x5, _x6) { return _ref6.apply(this, arguments); } return fetchAccessToken; }() /** * Retrieves a new access token by refreshing the currently used token. * * @throws {NotRegisteredException} When the client doesn't have it's registration information * @throws {Error} The client should already have an access token to use this function * @returns {Promise} A promise that resolves with a new AccessToken object */ }, { key: 'refreshToken', value: function () { var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6() { var data, result, newToken; return _regenerator2.default.wrap(function _callee6$(_context6) { while (1) { switch (_context6.prev = _context6.next) { case 0: if (this.isRegistered()) { _context6.next = 2; break; } throw new NotRegisteredException(); case 2: if (this.token) { _context6.next = 4; break; } throw new Error('No token to refresh'); case 4: data = { grant_type: 'refresh_token', refresh_token: this.token.refreshToken, client_id: this.oauthOptions.clientID, client_secret: this.oauthOptions.clientSecret }; _context6.next = 7; return (0, _get3.default)(OAuthClient.prototype.__proto__ || (0, _getPrototypeOf2.default)(OAuthClient.prototype), 'fetchJSON', this).call(this, 'POST', '/auth/access_token', this.dataToQueryString(data), { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }); case 7: result = _context6.sent; newToken = new _AccessToken2.default((0, _extends3.default)({ refresh_token: this.token.refreshToken }, result)); if (this.onTokenRefresh && typeof this.onTokenRefresh === 'function') { this.onTokenRefresh(newToken); } return _context6.abrupt('return', newToken); case 11: case 'end': return _context6.stop(); } } }, _callee6, this); })); function refreshToken() { return _ref7.apply(this, arguments); } return refreshToken; }() }, { key: 'exchangeOAuthSecret', value: function exchangeOAuthSecret(uri, secret) { return this.fetchJSON('POST', uri + '/auth/secret_exchange', { secret: secret }); } /** * Updates the client's stored token * * @param {string} token = null The new token to use — can be a string, a json object or an AccessToken instance. */ }, { key: 'setToken', value: function setToken(token) { if (token) { this.token = token instanceof _AccessToken2.default ? token : new _AccessToken2.default(token); } else { this.token = null; } } }, { key: 'setCredentials', value: function setCredentials(token) { (0, _logDeprecate2.default)('setCredentials is deprecated, please replace by setToken'); return this.setToken(token); } /** * Updates the OAuth informations * * @param {object} options Map of OAuth options */ }, { key: 'setOAuthOptions', value: function setOAuthOptions(options) { this.oauthOptions = this.camelCaseOAuthData(options); } }, { key: 'resetClientId', value: function resetClientId() { this.oauthOptions.clientID = ''; } /** * Reset the current OAuth client */ }, { key: 'resetClient', value: function resetClient() { this.resetClientId(); this.setUri(null); this.setToken(null); } /** * Turns the client's registration access token into a header suitable for HTTP requests. Used in some queries to manipulate the client on the server side. * * @returns {string} * @private */ }, { key: 'registrationAccessTokenToAuthHeader', value: function registrationAccessTokenToAuthHeader() { if (!this.oauthOptions.registrationAccessToken) { throw new Error('No registration access token'); } return 'Bearer ' + this.oauthOptions.registrationAccessToken; } }]); return OAuthClient; }(_CozyStackClient3.default); var NotRegisteredException = function (_Error) { (0, _inherits3.default)(NotRegisteredException, _Error); function NotRegisteredException() { var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Client not registered or missing OAuth information'; (0, _classCallCheck3.default)(this, NotRegisteredException); var _this2 = (0, _possibleConstructorReturn3.default)(this, (NotRegisteredException.__proto__ || (0, _getPrototypeOf2.default)(NotRegisteredException)).call(this, message)); _this2.message = message; _this2.name = 'NotRegisteredException'; return _this2; } return NotRegisteredException; }(Error); exports.default = OAuthClient; /***/ }), /* 1014 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _stringify = __webpack_require__(886); var _stringify2 = _interopRequireDefault(_stringify); var _classCallCheck2 = __webpack_require__(851); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = __webpack_require__(852); var _createClass3 = _interopRequireDefault(_createClass2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var AccessToken = function () { function AccessToken(data) { (0, _classCallCheck3.default)(this, AccessToken); if (typeof data === 'string') data = JSON.parse(data); this.tokenType = data.token_type || data.tokenType; this.accessToken = data.access_token || data.accessToken; this.refreshToken = data.refresh_token || data.refreshToken; this.scope = data.scope; } (0, _createClass3.default)(AccessToken, [{ key: 'toAuthHeader', value: function toAuthHeader() { return 'Bearer ' + this.accessToken; } }, { key: 'toBasicAuth', value: function toBasicAuth() { return 'user:' + this.accessToken + '@'; } }, { key: 'toJSON', value: function toJSON() { return { tokenType: this.tokenType, accessToken: this.accessToken, refreshToken: this.refreshToken, scope: this.scope }; } }, { key: 'toString', value: function toString() { return (0, _stringify2.default)(this.toJSON()); } /** * Get the access token string * * @see CozyStackClient.getAccessToken * @returns {string} token */ }, { key: 'getAccessToken', value: function getAccessToken() { return this.accessToken; } }]); return AccessToken; }(); exports.default = AccessToken; /***/ }), /* 1015 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.authenticateWithCordova = undefined; var _regenerator = __webpack_require__(619); var _regenerator2 = _interopRequireDefault(_regenerator); var _asyncToGenerator2 = __webpack_require__(849); var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); var _promise = __webpack_require__(799); var _promise2 = _interopRequireDefault(_promise); var _const = __webpack_require__(856); var _cozyDeviceHelper = __webpack_require__(1016); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* global prompt */ var authenticateWithSafari = function authenticateWithSafari(url) { return new _promise2.default(function (resolve, reject) { window.SafariViewController.show({ url: url, transition: 'curl' // (this only works in iOS 9.1/9.2 and lower) unless animated is false you can choose from: curl, flip, fade, slide (default) // enterReaderModeIfAvailable: readerMode, // default false // tintColor: "#00ffff", // default is ios blue // barColor: "#0000ff", // on iOS 10+ you can change the background color as well // controlTintColor: "#ffffff" // on iOS 10+ you can override the default tintColor }, // this success handler will be invoked for the lifecycle events 'opened', 'loaded' and 'closed' function (result) { if (result.event === 'closed') { reject(new Error(_const.REGISTRATION_ABORT)); } }, function (error) { console.log('KO: ' + error); reject(new Error(_const.REGISTRATION_ABORT)); }); var handle = window.handleOpenURL; window.handleOpenURL = function (url) { window.SafariViewController.hide(); resolve(url); if (handle) { window.handleOpenURL = handle; } }; }); }; var authenticateWithInAppBrowser = function authenticateWithInAppBrowser(url) { return new _promise2.default(function (resolve, reject) { var target = '_blank'; var options = 'clearcache=yes,zoom=no'; var inAppBrowser = window.cordova.InAppBrowser.open(url, target, options); var removeListener = function removeListener() { inAppBrowser.removeEventListener('loadstart', onLoadStart); inAppBrowser.removeEventListener('exit', onExit); }; var onLoadStart = function onLoadStart(_ref) { var url = _ref.url; var accessCode = /\?access_code=(.+)$/.test(url); var state = /\?state=(.+)$/.test(url); if (accessCode || state) { resolve(url); removeListener(); inAppBrowser.close(); } }; var onExit = function onExit() { reject(new Error(_const.REGISTRATION_ABORT)); removeListener(); inAppBrowser.close(); }; inAppBrowser.addEventListener('loadstart', onLoadStart); inAppBrowser.addEventListener('exit', onExit); }); }; var authenticateWithCordova = exports.authenticateWithCordova = function () { var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(url) { return _regenerator2.default.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _context.t0 = (0, _cozyDeviceHelper.isIOSApp)(); if (!_context.t0) { _context.next = 5; break; } _context.next = 4; return (0, _cozyDeviceHelper.hasSafariPlugin)(); case 4: _context.t0 = _context.sent; case 5: if (!_context.t0) { _context.next = 9; break; } return _context.abrupt('return', authenticateWithSafari(url)); case 9: if (!(0, _cozyDeviceHelper.hasInAppBrowserPlugin)()) { _context.next = 13; break; } return _context.abrupt('return', authenticateWithInAppBrowser(url)); case 13: /** * for dev purpose: * In oauth workflow, the server displays an authorization page * User must accept to give permission then the server gives an url * with query parameters used by cozy-client-js to initialize itself. * * This hack let developers open the authorization page in a new tab * then get the "access_code" url and paste it in the prompt to let the * application initialize and redirect to other pages. */ console.log(url); return _context.abrupt('return', new _promise2.default(function (resolve) { setTimeout(function () { var token = prompt('Paste the url here:'); resolve(token); }, 5000); })); case 15: case 'end': return _context.stop(); } } }, _callee, undefined); })); return function authenticateWithCordova(_x) { return _ref2.apply(this, arguments); }; }(); /***/ }), /* 1016 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "getPlatform", { enumerable: true, get: function get() { return _platform.getPlatform; } }); Object.defineProperty(exports, "isIOSApp", { enumerable: true, get: function get() { return _platform.isIOSApp; } }); Object.defineProperty(exports, "isAndroidApp", { enumerable: true, get: function get() { return _platform.isAndroidApp; } }); Object.defineProperty(exports, "isWebApp", { enumerable: true, get: function get() { return _platform.isWebApp; } }); Object.defineProperty(exports, "isMobileApp", { enumerable: true, get: function get() { return _platform.isMobileApp; } }); Object.defineProperty(exports, "isAndroid", { enumerable: true, get: function get() { return _platform.isAndroid; } }); Object.defineProperty(exports, "isIOS", { enumerable: true, get: function get() { return _platform.isIOS; } }); Object.defineProperty(exports, "isMobile", { enumerable: true, get: function get() { return _platform.isMobile; } }); Object.defineProperty(exports, "getDeviceName", { enumerable: true, get: function get() { return _device.getDeviceName; } }); Object.defineProperty(exports, "checkApp", { enumerable: true, get: function get() { return _apps.checkApp; } }); Object.defineProperty(exports, "startApp", { enumerable: true, get: function get() { return _apps.startApp; } }); Object.defineProperty(exports, "hasDevicePlugin", { enumerable: true, get: function get() { return _plugins.hasDevicePlugin; } }); Object.defineProperty(exports, "hasInAppBrowserPlugin", { enumerable: true, get: function get() { return _plugins.hasInAppBrowserPlugin; } }); Object.defineProperty(exports, "hasSafariPlugin", { enumerable: true, get: function get() { return _plugins.hasSafariPlugin; } }); Object.defineProperty(exports, "nativeLinkOpen", { enumerable: true, get: function get() { return _link.nativeLinkOpen; } }); Object.defineProperty(exports, "openDeeplinkOrRedirect", { enumerable: true, get: function get() { return _deeplink.openDeeplinkOrRedirect; } }); var _platform = __webpack_require__(1017); var _device = __webpack_require__(1019); var _apps = __webpack_require__(1030); var _plugins = __webpack_require__(1029); var _link = __webpack_require__(1034); var _deeplink = __webpack_require__(1035); /***/ }), /* 1017 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isMobile = exports.isIOS = exports.isAndroid = exports.isMobileApp = exports.isWebApp = exports.isAndroidApp = exports.isIOSApp = exports.getPlatform = void 0; var _cordova = __webpack_require__(1018); var WEB_PLATFORM = 'web'; var IOS_PLATFORM = 'ios'; var ANDROID_PLATFORM = 'android'; var getPlatform = function getPlatform() { return (0, _cordova.isCordova)() ? window.cordova.platformId : WEB_PLATFORM; }; exports.getPlatform = getPlatform; var isPlatform = function isPlatform(platform) { return getPlatform() === platform; }; var isIOSApp = function isIOSApp() { return isPlatform(IOS_PLATFORM); }; exports.isIOSApp = isIOSApp; var isAndroidApp = function isAndroidApp() { return isPlatform(ANDROID_PLATFORM); }; exports.isAndroidApp = isAndroidApp; var isWebApp = function isWebApp() { return isPlatform(WEB_PLATFORM); }; exports.isWebApp = isWebApp; var isMobileApp = function isMobileApp() { return (0, _cordova.isCordova)(); }; //return if is on an Android Device (native or browser) exports.isMobileApp = isMobileApp; var isAndroid = function isAndroid() { return window.navigator.userAgent && window.navigator.userAgent.indexOf('Android') >= 0; }; //return if is on an iOS Device (native or browser) exports.isAndroid = isAndroid; var isIOS = function isIOS() { return window.navigator.userAgent && /iPad|iPhone|iPod/.test(window.navigator.userAgent); }; //isMobile checks if the user is on a smartphone : native app or browser exports.isIOS = isIOS; var isMobile = function isMobile() { return isAndroid() || isIOS(); }; exports.isMobile = isMobile; /***/ }), /* 1018 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isCordova = void 0; // cordova var isCordova = function isCordova() { return typeof window !== 'undefined' && window.cordova !== undefined; }; exports.isCordova = isCordova; /***/ }), /* 1019 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireDefault = __webpack_require__(1020); Object.defineProperty(exports, "__esModule", { value: true }); exports.getDeviceName = void 0; var _capitalize = _interopRequireDefault(__webpack_require__(1021)); var _cordova = __webpack_require__(1018); var _plugins = __webpack_require__(1029); var _platform = __webpack_require__(1017); var DEFAULT_DEVICE = 'Device'; // device var getAppleModel = function getAppleModel(identifier) { var devices = ['iPhone', 'iPad', 'Watch', 'AppleTV']; for (var _i = 0; _i < devices.length; _i++) { var device = devices[_i]; if (identifier.match(new RegExp(device))) { return device; } } return DEFAULT_DEVICE; }; var getDeviceName = function getDeviceName() { if (!(0, _plugins.hasDevicePlugin)()) { if ((0, _cordova.isCordova)()) { console.warn('You should install `cordova-plugin-device`.'); // eslint-disable-line no-console } return DEFAULT_DEVICE; } var _window$device = window.device, manufacturer = _window$device.manufacturer, originalModel = _window$device.model; var model = (0, _platform.isIOSApp)() ? getAppleModel(originalModel) : originalModel; return "".concat((0, _capitalize.default)(manufacturer), " ").concat(model); }; exports.getDeviceName = getDeviceName; /***/ }), /* 1020 */ /***/ (function(module, exports) { function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } module.exports = _interopRequireDefault; /***/ }), /* 1021 */ /***/ (function(module, exports, __webpack_require__) { var toString = __webpack_require__(578), upperFirst = __webpack_require__(1022); /** * Converts the first character of `string` to upper case and the remaining * to lower case. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to capitalize. * @returns {string} Returns the capitalized string. * @example * * _.capitalize('FRED'); * // => 'Fred' */ function capitalize(string) { return upperFirst(toString(string).toLowerCase()); } module.exports = capitalize; /***/ }), /* 1022 */ /***/ (function(module, exports, __webpack_require__) { var createCaseFirst = __webpack_require__(1023); /** * Converts the first character of `string` to upper case. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the converted string. * @example * * _.upperFirst('fred'); * // => 'Fred' * * _.upperFirst('FRED'); * // => 'FRED' */ var upperFirst = createCaseFirst('toUpperCase'); module.exports = upperFirst; /***/ }), /* 1023 */ /***/ (function(module, exports, __webpack_require__) { var castSlice = __webpack_require__(1024), hasUnicode = __webpack_require__(1025), stringToArray = __webpack_require__(1026), toString = __webpack_require__(578); /** * Creates a function like `_.lowerFirst`. * * @private * @param {string} methodName The name of the `String` case method to use. * @returns {Function} Returns the new case function. */ function createCaseFirst(methodName) { return function(string) { string = toString(string); var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined; var chr = strSymbols ? strSymbols[0] : string.charAt(0); var trailing = strSymbols ? castSlice(strSymbols, 1).join('') : string.slice(1); return chr[methodName]() + trailing; }; } module.exports = createCaseFirst; /***/ }), /* 1024 */ /***/ (function(module, exports, __webpack_require__) { var baseSlice = __webpack_require__(962); /** * Casts `array` to a slice if it's needed. * * @private * @param {Array} array The array to inspect. * @param {number} start The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the cast slice. */ function castSlice(array, start, end) { var length = array.length; end = end === undefined ? length : end; return (!start && end >= length) ? array : baseSlice(array, start, end); } module.exports = castSlice; /***/ }), /* 1025 */ /***/ (function(module, exports) { /** Used to compose unicode character classes. */ var rsAstralRange = '\\ud800-\\udfff', rsComboMarksRange = '\\u0300-\\u036f', reComboHalfMarksRange = '\\ufe20-\\ufe2f', rsComboSymbolsRange = '\\u20d0-\\u20ff', rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsVarRange = '\\ufe0e\\ufe0f'; /** Used to compose unicode capture groups. */ var rsZWJ = '\\u200d'; /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); /** * Checks if `string` contains Unicode symbols. * * @private * @param {string} string The string to inspect. * @returns {boolean} Returns `true` if a symbol is found, else `false`. */ function hasUnicode(string) { return reHasUnicode.test(string); } module.exports = hasUnicode; /***/ }), /* 1026 */ /***/ (function(module, exports, __webpack_require__) { var asciiToArray = __webpack_require__(1027), hasUnicode = __webpack_require__(1025), unicodeToArray = __webpack_require__(1028); /** * Converts `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function stringToArray(string) { return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string); } module.exports = stringToArray; /***/ }), /* 1027 */ /***/ (function(module, exports) { /** * Converts an ASCII `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function asciiToArray(string) { return string.split(''); } module.exports = asciiToArray; /***/ }), /* 1028 */ /***/ (function(module, exports) { /** Used to compose unicode character classes. */ var rsAstralRange = '\\ud800-\\udfff', rsComboMarksRange = '\\u0300-\\u036f', reComboHalfMarksRange = '\\ufe20-\\ufe2f', rsComboSymbolsRange = '\\u20d0-\\u20ff', rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsVarRange = '\\ufe0e\\ufe0f'; /** Used to compose unicode capture groups. */ var rsAstral = '[' + rsAstralRange + ']', rsCombo = '[' + rsComboRange + ']', rsFitz = '\\ud83c[\\udffb-\\udfff]', rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', rsNonAstral = '[^' + rsAstralRange + ']', rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', rsZWJ = '\\u200d'; /** Used to compose unicode regexes. */ var reOptMod = rsModifier + '?', rsOptVar = '[' + rsVarRange + ']?', rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', rsSeq = rsOptVar + reOptMod + rsOptJoin, rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); /** * Converts a Unicode `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function unicodeToArray(string) { return string.match(reUnicode) || []; } module.exports = unicodeToArray; /***/ }), /* 1029 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.hasSafariPlugin = exports.hasInAppBrowserPlugin = exports.hasDevicePlugin = void 0; var _cordova = __webpack_require__(1018); var hasDevicePlugin = function hasDevicePlugin() { return (0, _cordova.isCordova)() && window.device !== undefined; }; exports.hasDevicePlugin = hasDevicePlugin; var hasInAppBrowserPlugin = function hasInAppBrowserPlugin() { return (0, _cordova.isCordova)() && window.cordova.InAppBrowser !== undefined; }; exports.hasInAppBrowserPlugin = hasInAppBrowserPlugin; var hasSafariPlugin = function hasSafariPlugin() { return new Promise(function (resolve) { if (!(0, _cordova.isCordova)() || window.SafariViewController === undefined) { resolve(false); return; } window.SafariViewController.isAvailable(function (available) { return resolve(available); }); }); }; exports.hasSafariPlugin = hasSafariPlugin; /***/ }), /* 1030 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireDefault = __webpack_require__(1020); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.startApp = exports.checkApp = void 0; var _regenerator = _interopRequireDefault(__webpack_require__(1031)); var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1033)); var _platform = __webpack_require__(1017); var cordovaPluginIsInstalled = function cordovaPluginIsInstalled() { return window.startApp; }; /** * Normalize startApp params for Android and iOS */ var getParams = function getParams(_ref) { var appId = _ref.appId, uri = _ref.uri; if ((0, _platform.isAndroidApp)()) { return { package: appId }; } else { return uri; } }; var exported = {}; /** * Start an application if it is installed on the phone * @returns Promise - False if the application was not able to be started */ var startApp = exported.startApp = /*#__PURE__*/ function () { var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/ _regenerator.default.mark(function _callee(appInfo) { var startAppPlugin, isAppInstalled, params; return _regenerator.default.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: startAppPlugin = window.startApp; _context.next = 3; return exported.checkApp(appInfo); case 3: isAppInstalled = _context.sent; if (!isAppInstalled) { _context.next = 9; break; } params = getParams(appInfo); return _context.abrupt("return", new Promise(function (resolve, reject) { if (!cordovaPluginIsInstalled()) { reject(new Error("Cordova plugin 'com.lampa.startapp' is not installed. This plugin is needed to start a native app. Required by cozy-bar")); return; } startAppPlugin.set(params).start(resolve, reject); })); case 9: return _context.abrupt("return", false); case 10: case "end": return _context.stop(); } } }, _callee); })); return function (_x) { return _ref2.apply(this, arguments); }; }(); /** * Check that an application is installed on the phone * @returns Promise - Promise containing information on the application * * @example * > checkApp({ appId: 'io.cozy.drive.mobile', uri: 'cozydrive://' }) * Promise.resolve({ * versionName: "0.9.2", * packageName: "io.cozy.drive.mobile", * versionCode: 902, * applicationInfo: "ApplicationInfo{70aa0ef io.cozy.drive.mobile}" * }) */ exports.startApp = startApp; var checkApp = exported.checkApp = /*#__PURE__*/ function () { var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/ _regenerator.default.mark(function _callee2(appInfo) { var startAppPlugin, params; return _regenerator.default.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: startAppPlugin = window.startApp; params = getParams(appInfo); return _context2.abrupt("return", new Promise(function (resolve, reject) { if (!cordovaPluginIsInstalled()) { reject(new Error("Cordova plugin 'com.lampa.startapp' is not installed.")); return; } startAppPlugin.set(params).check(function (infos) { resolve(infos === 'OK' ? true : infos); }, function (error) { if (error === false || error.indexOf('NameNotFoundException') === 0) { // Plugin returns an error 'NameNotFoundException' on Android and // false on iOS when an application is not found. // We prefer to always return false resolve(false); } else { reject(error); } }); })); case 3: case "end": return _context2.stop(); } } }, _callee2); })); return function (_x2) { return _ref3.apply(this, arguments); }; }(); exports.checkApp = checkApp; var _default = exported; exports.default = _default; /***/ }), /* 1031 */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(1032); /***/ }), /* 1032 */ /***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2014-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var runtime = (function (exports) { "use strict"; var Op = Object.prototype; var hasOwn = Op.hasOwnProperty; var undefined; // More compressible than void 0. var $Symbol = typeof Symbol === "function" ? Symbol : {}; var iteratorSymbol = $Symbol.iterator || "@@iterator"; var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function wrap(innerFn, outerFn, self, tryLocsList) { // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; var generator = Object.create(protoGenerator.prototype); var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next, // .throw, and .return methods. generator._invoke = makeInvokeMethod(innerFn, self, context); return generator; } exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion // record like context.tryEntries[i].completion. This interface could // have been (and was previously) designed to take a closure to be // invoked without arguments, but in all the cases we care about we // already have an existing method we want to call, so there's no need // to create a new function object. We can even get away with assuming // the method takes exactly one argument, since that happens to be true // in every case, so we don't have to touch the arguments object. The // only additional allocation required is the completion record, which // has a stable shape and so hopefully should be cheap to allocate. function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } var GenStateSuspendedStart = "suspendedStart"; var GenStateSuspendedYield = "suspendedYield"; var GenStateExecuting = "executing"; var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as // breaking out of the dispatch switch statement. var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and // .constructor.prototype properties for functions that return Generator // objects. For full spec compliance, you may wish to configure your // minifier not to mangle the names of these two functions. function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that // don't natively support it. var IteratorPrototype = {}; IteratorPrototype[iteratorSymbol] = function () { return this; }; var getProto = Object.getPrototypeOf; var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { // This environment has a native %IteratorPrototype%; use it instead // of the polyfill. IteratorPrototype = NativeIteratorPrototype; } var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; GeneratorFunctionPrototype.constructor = GeneratorFunction; GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = "GeneratorFunction"; // Helper for defining the .next, .throw, and .return methods of the // Iterator interface in terms of a single ._invoke method. function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function(method) { prototype[method] = function(arg) { return this._invoke(method, arg); }; }); } exports.isGeneratorFunction = function(genFun) { var ctor = typeof genFun === "function" && genFun.constructor; return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can // do is to check its .name property. (ctor.displayName || ctor.name) === "GeneratorFunction" : false; }; exports.mark = function(genFun) { if (Object.setPrototypeOf) { Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); } else { genFun.__proto__ = GeneratorFunctionPrototype; if (!(toStringTagSymbol in genFun)) { genFun[toStringTagSymbol] = "GeneratorFunction"; } } genFun.prototype = Object.create(Gp); return genFun; }; // Within the body of any async function, `await x` is transformed to // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test // `hasOwn.call(value, "__await")` to determine if the yielded value is // meant to be awaited. exports.awrap = function(arg) { return { __await: arg }; }; function AsyncIterator(generator) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (record.type === "throw") { reject(record.arg); } else { var result = record.arg; var value = result.value; if (value && typeof value === "object" && hasOwn.call(value, "__await")) { return Promise.resolve(value.__await).then(function(value) { invoke("next", value, resolve, reject); }, function(err) { invoke("throw", err, resolve, reject); }); } return Promise.resolve(value).then(function(unwrapped) { // When a yielded Promise is resolved, its final value becomes // the .value of the Promise<{value,done}> result for the // current iteration. result.value = unwrapped; resolve(result); }, function(error) { // If a rejected Promise was yielded, throw the rejection back // into the async generator function so it can be handled there. return invoke("throw", error, resolve, reject); }); } } var previousPromise; function enqueue(method, arg) { function callInvokeWithMethodAndArg() { return new Promise(function(resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = // If enqueue has been called before, then we want to wait until // all previous Promises have been resolved before calling invoke, // so that results are always delivered in the correct order. If // enqueue has not been called before, then it is important to // call invoke immediately, without waiting on a callback to fire, // so that the async generator function has the opportunity to do // any necessary setup in a predictable way. This predictability // is why the Promise constructor synchronously invokes its // executor callback, and why async functions synchronously // execute code before the first await. Since we implement simple // async functions in terms of async generators, it is especially // important to get this right, even though it requires care. previousPromise ? previousPromise.then( callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later // invocations of the iterator. callInvokeWithMethodAndArg ) : callInvokeWithMethodAndArg(); } // Define the unified helper method that is used to implement .next, // .throw, and .return (see defineIteratorMethods). this._invoke = enqueue; } defineIteratorMethods(AsyncIterator.prototype); AsyncIterator.prototype[asyncIteratorSymbol] = function () { return this; }; exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of // AsyncIterator objects; they just return a Promise for the value of // the final result produced by the iterator. exports.async = function(innerFn, outerFn, self, tryLocsList) { var iter = new AsyncIterator( wrap(innerFn, outerFn, self, tryLocsList) ); return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator. : iter.next().then(function(result) { return result.done ? result.value : iter.next(); }); }; function makeInvokeMethod(innerFn, self, context) { var state = GenStateSuspendedStart; return function invoke(method, arg) { if (state === GenStateExecuting) { throw new Error("Generator is already running"); } if (state === GenStateCompleted) { if (method === "throw") { throw arg; } // Be forgiving, per 25.3.3.3.3 of the spec: // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume return doneResult(); } context.method = method; context.arg = arg; while (true) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (context.method === "next") { // Setting context._sent for legacy support of Babel's // function.sent implementation. context.sent = context._sent = context.arg; } else if (context.method === "throw") { if (state === GenStateSuspendedStart) { state = GenStateCompleted; throw context.arg; } context.dispatchException(context.arg); } else if (context.method === "return") { context.abrupt("return", context.arg); } state = GenStateExecuting; var record = tryCatch(innerFn, self, context); if (record.type === "normal") { // If an exception is thrown from innerFn, we leave state === // GenStateExecuting and loop back for another invocation. state = context.done ? GenStateCompleted : GenStateSuspendedYield; if (record.arg === ContinueSentinel) { continue; } return { value: record.arg, done: context.done }; } else if (record.type === "throw") { state = GenStateCompleted; // Dispatch the exception by looping back around to the // context.dispatchException(context.arg) call above. context.method = "throw"; context.arg = record.arg; } } }; } // Call delegate.iterator[context.method](context.arg) and handle the // result, either by returning a { value, done } result from the // delegate iterator, or by modifying context.method and context.arg, // setting context.delegate to null, and returning the ContinueSentinel. function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (method === undefined) { // A .throw or .return when the delegate iterator has no .throw // method always terminates the yield* loop. context.delegate = null; if (context.method === "throw") { // Note: ["return"] must be used for ES3 parsing compatibility. if (delegate.iterator["return"]) { // If the delegate iterator has a return method, give it a // chance to clean up. context.method = "return"; context.arg = undefined; maybeInvokeDelegate(delegate, context); if (context.method === "throw") { // If maybeInvokeDelegate(context) changed context.method from // "return" to "throw", let that override the TypeError below. return ContinueSentinel; } } context.method = "throw"; context.arg = new TypeError( "The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if (record.type === "throw") { context.method = "throw"; context.arg = record.arg; context.delegate = null; return ContinueSentinel; } var info = record.arg; if (! info) { context.method = "throw"; context.arg = new TypeError("iterator result is not an object"); context.delegate = null; return ContinueSentinel; } if (info.done) { // Assign the result of the finished delegate to the temporary // variable specified by delegate.resultName (see delegateYield). context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield). context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the // exception, let the outer generator proceed normally. If // context.method was "next", forget context.arg since it has been // "consumed" by the delegate iterator. If context.method was // "return", allow the original .return call to continue in the // outer generator. if (context.method !== "return") { context.method = "next"; context.arg = undefined; } } else { // Re-yield the result returned by the delegate method. return info; } // The delegate iterator is finished, so forget it and continue with // the outer generator. context.delegate = null; return ContinueSentinel; } // Define Generator.prototype.{next,throw,return} in terms of the // unified ._invoke helper method. defineIteratorMethods(Gp); Gp[toStringTagSymbol] = "Generator"; // A Generator should always return itself as the iterator object when the // @@iterator function is called on it. Some browsers' implementations of the // iterator prototype chain incorrectly implement this, causing the Generator // object to not be returned from this call. This ensures that doesn't happen. // See https://github.com/facebook/regenerator/issues/274 for more details. Gp[iteratorSymbol] = function() { return this; }; Gp.toString = function() { return "[object Generator]"; }; function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; if (1 in locs) { entry.catchLoc = locs[1]; } if (2 in locs) { entry.finallyLoc = locs[2]; entry.afterLoc = locs[3]; } this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal"; delete record.arg; entry.completion = record; } function Context(tryLocsList) { // The root entry object (effectively a try statement without a catch // or a finally block) gives us a place to store values thrown from // locations where there is no enclosing try statement. this.tryEntries = [{ tryLoc: "root" }]; tryLocsList.forEach(pushTryEntry, this); this.reset(true); } exports.keys = function(object) { var keys = []; for (var key in object) { keys.push(key); } keys.reverse(); // Rather than returning an object with a next method, we keep // things simple and return the next function itself. return function next() { while (keys.length) { var key = keys.pop(); if (key in object) { next.value = key; next.done = false; return next; } } // To avoid creating an additional object, we just hang the .value // and .done properties off the next function object itself. This // also ensures that the minifier will not anonymize the function. next.done = true; return next; }; }; function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) { return iteratorMethod.call(iterable); } if (typeof iterable.next === "function") { return iterable; } if (!isNaN(iterable.length)) { var i = -1, next = function next() { while (++i < iterable.length) { if (hasOwn.call(iterable, i)) { next.value = iterable[i]; next.done = false; return next; } } next.value = undefined; next.done = true; return next; }; return next.next = next; } } // Return an iterator with no values. return { next: doneResult }; } exports.values = values; function doneResult() { return { value: undefined, done: true }; } Context.prototype = { constructor: Context, reset: function(skipTempReset) { this.prev = 0; this.next = 0; // Resetting context._sent for legacy support of Babel's // function.sent implementation. this.sent = this._sent = undefined; this.done = false; this.delegate = null; this.method = "next"; this.arg = undefined; this.tryEntries.forEach(resetTryEntry); if (!skipTempReset) { for (var name in this) { // Not sure about the optimal order of these conditions: if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) { this[name] = undefined; } } } }, stop: function() { this.done = true; var rootEntry = this.tryEntries[0]; var rootRecord = rootEntry.completion; if (rootRecord.type === "throw") { throw rootRecord.arg; } return this.rval; }, dispatchException: function(exception) { if (this.done) { throw exception; } var context = this; function handle(loc, caught) { record.type = "throw"; record.arg = exception; context.next = loc; if (caught) { // If the dispatched exception was caught by a catch block, // then let that catch block handle the exception normally. context.method = "next"; context.arg = undefined; } return !! caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; var record = entry.completion; if (entry.tryLoc === "root") { // Exception thrown outside of any try block that could handle // it, so set the completion value of the entire function to // throw the exception. return handle("end"); } if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"); var hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) { return handle(entry.catchLoc, true); } else if (this.prev < entry.finallyLoc) { return handle(entry.finallyLoc); } } else if (hasCatch) { if (this.prev < entry.catchLoc) { return handle(entry.catchLoc, true); } } else if (hasFinally) { if (this.prev < entry.finallyLoc) { return handle(entry.finallyLoc); } } else { throw new Error("try statement without catch or finally"); } } } }, abrupt: function(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) { // Ignore the finally entry if control is not jumping to a // location outside the try/catch block. finallyEntry = null; } var record = finallyEntry ? finallyEntry.completion : {}; record.type = type; record.arg = arg; if (finallyEntry) { this.method = "next"; this.next = finallyEntry.finallyLoc; return ContinueSentinel; } return this.complete(record); }, complete: function(record, afterLoc) { if (record.type === "throw") { throw record.arg; } if (record.type === "break" || record.type === "continue") { this.next = record.arg; } else if (record.type === "return") { this.rval = this.arg = record.arg; this.method = "return"; this.next = "end"; } else if (record.type === "normal" && afterLoc) { this.next = afterLoc; } return ContinueSentinel; }, finish: function(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) { this.complete(entry.completion, entry.afterLoc); resetTryEntry(entry); return ContinueSentinel; } } }, "catch": function(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (record.type === "throw") { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } // The context.catch method must only be called with a location // argument that corresponds to a known catch block. throw new Error("illegal catch attempt"); }, delegateYield: function(iterable, resultName, nextLoc) { this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }; if (this.method === "next") { // Deliberately forget the last sent value so that we don't // accidentally pass it on to the delegate. this.arg = undefined; } return ContinueSentinel; } }; // Regardless of whether this script is executing as a CommonJS module // or not, return the runtime object so that we can declare the variable // regeneratorRuntime in the outer scope, which allows this module to be // injected easily by `bin/regenerator --include-runtime script.js`. return exports; }( // If this script is executing as a CommonJS module, use module.exports // as the regeneratorRuntime namespace. Otherwise create a new empty // object. Either way, the resulting object will be used to initialize // the regeneratorRuntime variable at the top of this file. true ? module.exports : undefined )); try { regeneratorRuntime = runtime; } catch (accidentalStrictMode) { // This module should not be running in strict mode, so the above // assignment should always work unless something is misconfigured. Just // in case runtime.js accidentally runs in strict mode, we can escape // strict mode using a global Function call. This could conceivably fail // if a Content Security Policy forbids using Function, but in that case // the proper solution is to fix the accidental strict mode problem. If // you've misconfigured your bundler to force strict mode and applied a // CSP to forbid Function, and you're not willing to fix either of those // problems, please detail your unique predicament in a GitHub issue. Function("r", "regeneratorRuntime = r")(runtime); } /***/ }), /* 1033 */ /***/ (function(module, exports) { function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } module.exports = _asyncToGenerator; /***/ }), /* 1034 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireDefault = __webpack_require__(1020); Object.defineProperty(exports, "__esModule", { value: true }); exports.nativeLinkOpen = void 0; var _regenerator = _interopRequireDefault(__webpack_require__(1031)); var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1033)); var _plugins = __webpack_require__(1029); var nativeLinkOpen = /*#__PURE__*/ function () { var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/ _regenerator.default.mark(function _callee(_ref) { var url, target, options; return _regenerator.default.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: url = _ref.url; _context.next = 3; return (0, _plugins.hasSafariPlugin)(); case 3: _context.t0 = _context.sent; if (!_context.t0) { _context.next = 6; break; } _context.t0 = window.SafariViewController; case 6: if (!_context.t0) { _context.next = 10; break; } window.SafariViewController.show({ url: url, transition: 'curl' }, function (result) { if (result.event === 'closed') { window.SafariViewController.hide(); } }, function () { window.SafariViewController.hide(); }); _context.next = 11; break; case 10: if ((0, _plugins.hasInAppBrowserPlugin)()) { target = '_blank'; options = 'clearcache=yes,zoom=no'; window.cordova.InAppBrowser.open(url, target, options); } else { window.location = url; } case 11: case "end": return _context.stop(); } } }, _callee); })); return function nativeLinkOpen(_x) { return _ref2.apply(this, arguments); }; }(); exports.nativeLinkOpen = nativeLinkOpen; /***/ }), /* 1035 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.openDeeplinkOrRedirect = void 0; /** * This file is used to open the native app from a webapp * if this native app is installed * * From a webapp, we don't have any clue if a native app is installed. * The only way to know that, is to try to open the custom link * (aka cozydrive://) and if nothing happens (no blur) we redirect to * the callback * * Firefox tries to open custom link, so we need to create an iframe * to detect if this is supported or not */ var _createHiddenIframe = function _createHiddenIframe(target, uri, randomId) { var iframe = document.createElement('iframe'); iframe.src = uri; iframe.id = "hiddenIframe_".concat(randomId); iframe.style.display = 'none'; target.appendChild(iframe); return iframe; }; var openUriWithHiddenFrame = function openUriWithHiddenFrame(uri, failCb) { var randomId = Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5); window.addEventListener('blur', onBlur); var iframe = _createHiddenIframe(document.body, 'about:blank', randomId); var timeout = setTimeout(function () { failCb(); window.removeEventListener('blur', onBlur); iframe.parentElement.removeChild(iframe); }, 500); function onBlur() { clearTimeout(timeout); window.removeEventListener('blur', onBlur); iframe.parentElement.removeChild(iframe); } iframe.contentWindow.location.href = uri; }; var openUriWithTimeoutHack = function openUriWithTimeoutHack(uri, failCb) { var timeout = setTimeout(function () { failCb(); target.removeEventListener('blur', onBlur); }, 500); //handle page running in an iframe (blur must be registered with top level window) var target = window; while (target != target.parent) { target = target.parent; } target.addEventListener('blur', onBlur); function onBlur() { clearTimeout(timeout); target.removeEventListener('blur', onBlur); } window.location = uri; }; var openUriWithMsLaunchUri = function openUriWithMsLaunchUri(uri, failCb) { navigator.msLaunchUri(uri, undefined, failCb); }; var checkBrowser = function checkBrowser() { var isOpera = !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0; var ua = navigator.userAgent.toLowerCase(); var isSafari = ua.includes('safari') && !ua.includes('chrome') || Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0; var isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; var isIOS122 = isIOS && (ua.includes('os 12_2') || ua.includes('os 12_3')); return { isOpera: isOpera, isFirefox: typeof InstallTrigger !== 'undefined', isSafari: isSafari, isChrome: !!window.chrome && !isOpera, isIOS122: isIOS122, isIOS: isIOS }; }; /** * * @param {String} deeplink (cozydrive://) * @param {String} failCb (http://drive.cozy.ios) */ var openDeeplinkOrRedirect = function openDeeplinkOrRedirect(deeplink, failCb) { if (navigator.msLaunchUri) { //for IE and Edge in Win 8 and Win 10 openUriWithMsLaunchUri(deeplink, failCb); } else { var browser = checkBrowser(); if (browser.isChrome || browser.isIOS && !browser.isIOS122) { openUriWithTimeoutHack(deeplink, failCb); } else if (browser.isSafari && !browser.isIOS122 || browser.isFirefox) { openUriWithHiddenFrame(deeplink, failCb); } else { failCb(); } } }; exports.openDeeplinkOrRedirect = openDeeplinkOrRedirect; /***/ }), /* 1036 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _values = __webpack_require__(839); var _values2 = _interopRequireDefault(_values); var _mapValues = __webpack_require__(901); var _mapValues2 = _interopRequireDefault(_mapValues); var _groupBy2 = __webpack_require__(1037); var _groupBy3 = _interopRequireDefault(_groupBy2); var _flatten = __webpack_require__(598); var _flatten2 = _interopRequireDefault(_flatten); var _isEqual = __webpack_require__(914); var _isEqual2 = _interopRequireDefault(_isEqual); var _uniq = __webpack_require__(984); var _uniq2 = _interopRequireDefault(_uniq); var _uniqWith = __webpack_require__(1038); var _uniqWith2 = _interopRequireDefault(_uniqWith); var _dsl = __webpack_require__(884); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var isIdQuery = function isIdQuery(query) { return query.id || query.ids; }; /** * Optimize queries on a single doctype * * @param {QueryDefinition[]} queries - Queries of a same doctype * @returns {QueryDefinition[]} Optimized queries * @private */ var optimizeDoctypeQueries = function optimizeDoctypeQueries(queries) { var _groupBy = (0, _groupBy3.default)(queries, function (q) { return isIdQuery(q) ? 'idQueries' : 'others'; }), _groupBy$idQueries = _groupBy.idQueries, idQueries = _groupBy$idQueries === undefined ? [] : _groupBy$idQueries, _groupBy$others = _groupBy.others, others = _groupBy$others === undefined ? [] : _groupBy$others; var groupedIdQueries = idQueries.length > 0 ? new _dsl.QueryDefinition({ doctype: queries[0].doctype, ids: (0, _uniq2.default)((0, _flatten2.default)(idQueries.map(function (q) { return q.id || q.ids; }))) }) : []; // Deduplicate before concataining return (0, _uniqWith2.default)(others, _isEqual2.default).concat(groupedIdQueries); }; /** * Reduce the number of queries used to fetch documents. * * - Deduplication of queries * - Groups id queries * * @param {QueryDefinition[]} queries - Queries to optimized * @returns {QueryDefinition[]} Optimized queries * @private */ var optimizeQueries = function optimizeQueries(queries) { var byDoctype = (0, _groupBy3.default)(queries, function (q) { return q.doctype; }); return (0, _flatten2.default)((0, _values2.default)((0, _mapValues2.default)(byDoctype, optimizeDoctypeQueries))); }; exports.default = optimizeQueries; /***/ }), /* 1037 */ /***/ (function(module, exports, __webpack_require__) { var baseAssignValue = __webpack_require__(366), createAggregator = __webpack_require__(911); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Creates an object composed of keys generated from the results of running * each element of `collection` thru `iteratee`. The order of grouped values * is determined by the order they occur in `collection`. The corresponding * value of each key is an array of elements responsible for generating the * key. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * * _.groupBy([6.1, 4.2, 6.3], Math.floor); * // => { '4': [4.2], '6': [6.1, 6.3] } * * // The `_.property` iteratee shorthand. * _.groupBy(['one', 'two', 'three'], 'length'); * // => { '3': ['one', 'two'], '5': ['three'] } */ var groupBy = createAggregator(function(result, value, key) { if (hasOwnProperty.call(result, key)) { result[key].push(value); } else { baseAssignValue(result, key, [value]); } }); module.exports = groupBy; /***/ }), /* 1038 */ /***/ (function(module, exports, __webpack_require__) { var baseUniq = __webpack_require__(613); /** * This method is like `_.uniq` except that it accepts `comparator` which * is invoked to compare elements of `array`. The order of result values is * determined by the order they occur in the array.The comparator is invoked * with two arguments: (arrVal, othVal). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new duplicate free array. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; * * _.uniqWith(objects, _.isEqual); * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] */ function uniqWith(array, comparator) { comparator = typeof comparator == 'function' ? comparator : undefined; return (array && array.length) ? baseUniq(array, undefined, comparator) : []; } module.exports = uniqWith; /***/ }), /* 1039 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Use those fetch policies with `<Query />` to limit the number of re-fetch. * * @example * ``` * import { fetchPolicies } from 'cozy-client' * const olderThan30s = fetchPolicies.olderThan(30 * 1000) * <Query fetchPolicy={olderThan30s} /> * ``` */ var fetchPolicies = { /** * Returns a fetchPolicy that will only re-fetch queries that are older * than `<delay>` ms. * * @param {number} delay - Milliseconds since the query has been fetched * @returns {Function} Fetch policy to be used with `<Query />` */ olderThan: function olderThan(delay) { return function (queryState) { if (!queryState || !queryState.lastUpdate) { return true; } else { var elapsed = Date.now() - queryState.lastUpdate; return elapsed > delay; } }; }, /** * Fetch policy that deactivates any fetching. */ noFetch: function noFetch() { return false; } }; exports.default = fetchPolicies; /***/ }), /* 1040 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _regenerator = __webpack_require__(619); var _regenerator2 = _interopRequireDefault(_regenerator); var _keys = __webpack_require__(835); var _keys2 = _interopRequireDefault(_keys); var _asyncToGenerator2 = __webpack_require__(849); var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); var _values = __webpack_require__(839); var _values2 = _interopRequireDefault(_values); var _classCallCheck2 = __webpack_require__(851); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = __webpack_require__(852); var _createClass3 = _interopRequireDefault(_createClass2); var _extends2 = __webpack_require__(843); var _extends3 = _interopRequireDefault(_extends2); var _keyBy = __webpack_require__(910); var _keyBy2 = _interopRequireDefault(_keyBy); var _mapValues = __webpack_require__(901); var _mapValues2 = _interopRequireDefault(_mapValues); var _merge = __webpack_require__(498); var _merge2 = _interopRequireDefault(_merge); var _size = __webpack_require__(1041); var _size2 = _interopRequireDefault(_size); var _intersectionBy = __webpack_require__(1045); var _intersectionBy2 = _interopRequireDefault(_intersectionBy); var _associations = __webpack_require__(888); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Returns a normalized schema object from the schema definition. * * - Relationships are resolved to classes if needed * - The name of the relationship (its key in the schema definition) * is included in the relationship * - Empty relationships are nulled * * @private */ var normalizeDoctypeSchema = function normalizeDoctypeSchema(doctypeSchema) { var relationships = (0, _mapValues2.default)(doctypeSchema.relationships || {}, function (v, k) { return (0, _extends3.default)({}, v, { name: k, type: (0, _associations.resolveClass)(v.doctype, v.type) }); }); return (0, _extends3.default)({}, doctypeSchema, { relationships: (0, _size2.default)(relationships) > 0 ? (0, _keyBy2.default)(relationships, 'name') : null }); }; var assert = function assert(predicate, errorMessage) { if (!predicate) throw new Error(errorMessage); }; var ensureCanBeAdded = function ensureCanBeAdded(newSchemas, existingSchemas) { var sameNames = (0, _intersectionBy2.default)(newSchemas, existingSchemas, function (x) { return x.name; }); assert(sameNames.length === 0, 'Duplicated names in schemas being added: ' + sameNames.map(function (x) { return x.name; }).join(', ')); var sameDoctypes = (0, _intersectionBy2.default)(newSchemas, existingSchemas, function (x) { return x.doctype; }); assert(sameDoctypes.length === 0, 'Duplicated doctypes in schemas being added: ' + sameDoctypes.map(function (x) { return x.name; }).join(', ')); }; /** * Stores information on a particular doctype. * * - Attribute validation * - Relationship access * * ```js * const schema = new Schema({ * todos: { * attributes: { * label: { * unique: true * } * }, * relationships: { * author: 'has-one-in-place' * } * } * }, cozyStackClient) * ``` */ var Schema = function () { function Schema() { var schemaDefinition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var client = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; (0, _classCallCheck3.default)(this, Schema); this.byDoctype = {}; this.add(schemaDefinition); this.client = client; } (0, _createClass3.default)(Schema, [{ key: 'add', value: function add() { var schemaDefinition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var normalizedSchemaDefinition = (0, _mapValues2.default)(schemaDefinition, function (obj, name) { return (0, _extends3.default)({ name: name }, normalizeDoctypeSchema(obj)); }); ensureCanBeAdded((0, _values2.default)(normalizedSchemaDefinition), (0, _values2.default)(this.byDoctype)); (0, _merge2.default)(this.byDoctype, (0, _keyBy2.default)(normalizedSchemaDefinition, function (x) { return x.doctype; })); } /** * Returns the schema for a doctype * * Creates an empty schema implicitly if it does not exist */ }, { key: 'getDoctypeSchema', value: function getDoctypeSchema(doctype) { var schema = this.byDoctype[doctype]; if (!schema) { schema = normalizeDoctypeSchema({ name: doctype, doctype: doctype }); this.byDoctype[doctype] = schema; } return schema; } /** * Returns the relationship for a given doctype/name */ }, { key: 'getRelationship', value: function getRelationship(doctype, relationshipName) { var schema = this.getDoctypeSchema(doctype); return schema.relationships[relationshipName]; } /** * Validates a document considering the descriptions in schema.attributes. */ }, { key: 'validate', value: function () { var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(document) { var errors, schema, n, ret; return _regenerator2.default.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: errors = {}; schema = this.byDoctype[document._type]; if (schema) { _context.next = 4; break; } return _context.abrupt('return', true); case 4: if (schema.attributes) { _context.next = 6; break; } return _context.abrupt('return', true); case 6: _context.t0 = _regenerator2.default.keys(schema.attributes); case 7: if ((_context.t1 = _context.t0()).done) { _context.next = 15; break; } n = _context.t1.value; _context.next = 11; return this.validateAttribute(document, n, schema.attributes[n]); case 11: ret = _context.sent; if (ret !== true) errors[n] = ret; _context.next = 7; break; case 15: if (!((0, _keys2.default)(errors).length === 0)) { _context.next = 17; break; } return _context.abrupt('return', true); case 17: return _context.abrupt('return', errors); case 18: case 'end': return _context.stop(); } } }, _callee, this); })); function validate(_x4) { return _ref.apply(this, arguments); } return validate; }() }, { key: 'validateAttribute', value: function () { var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(document, attrName, attrProps) { var ret; return _regenerator2.default.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: if (!(attrProps.unique && this.client)) { _context2.next = 6; break; } _context2.next = 3; return this.client.collection(document._type).checkUniquenessOf(attrName, document[attrName]); case 3: ret = _context2.sent; if (!(ret !== true)) { _context2.next = 6; break; } return _context2.abrupt('return', 'must be unique'); case 6: return _context2.abrupt('return', true); case 7: case 'end': return _context2.stop(); } } }, _callee2, this); })); function validateAttribute(_x5, _x6, _x7) { return _ref2.apply(this, arguments); } return validateAttribute; }() }]); return Schema; }(); exports.default = Schema; /***/ }), /* 1041 */ /***/ (function(module, exports, __webpack_require__) { var baseKeys = __webpack_require__(401), getTag = __webpack_require__(563), isArrayLike = __webpack_require__(386), isString = __webpack_require__(74), stringSize = __webpack_require__(1042); /** `Object#toString` result references. */ var mapTag = '[object Map]', setTag = '[object Set]'; /** * Gets the size of `collection` by returning its length for array-like * values or the number of own enumerable string keyed properties for objects. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object|string} collection The collection to inspect. * @returns {number} Returns the collection size. * @example * * _.size([1, 2, 3]); * // => 3 * * _.size({ 'a': 1, 'b': 2 }); * // => 2 * * _.size('pebbles'); * // => 7 */ function size(collection) { if (collection == null) { return 0; } if (isArrayLike(collection)) { return isString(collection) ? stringSize(collection) : collection.length; } var tag = getTag(collection); if (tag == mapTag || tag == setTag) { return collection.size; } return baseKeys(collection).length; } module.exports = size; /***/ }), /* 1042 */ /***/ (function(module, exports, __webpack_require__) { var asciiSize = __webpack_require__(1043), hasUnicode = __webpack_require__(1025), unicodeSize = __webpack_require__(1044); /** * Gets the number of symbols in `string`. * * @private * @param {string} string The string to inspect. * @returns {number} Returns the string size. */ function stringSize(string) { return hasUnicode(string) ? unicodeSize(string) : asciiSize(string); } module.exports = stringSize; /***/ }), /* 1043 */ /***/ (function(module, exports, __webpack_require__) { var baseProperty = __webpack_require__(586); /** * Gets the size of an ASCII `string`. * * @private * @param {string} string The string inspect. * @returns {number} Returns the string size. */ var asciiSize = baseProperty('length'); module.exports = asciiSize; /***/ }), /* 1044 */ /***/ (function(module, exports) { /** Used to compose unicode character classes. */ var rsAstralRange = '\\ud800-\\udfff', rsComboMarksRange = '\\u0300-\\u036f', reComboHalfMarksRange = '\\ufe20-\\ufe2f', rsComboSymbolsRange = '\\u20d0-\\u20ff', rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsVarRange = '\\ufe0e\\ufe0f'; /** Used to compose unicode capture groups. */ var rsAstral = '[' + rsAstralRange + ']', rsCombo = '[' + rsComboRange + ']', rsFitz = '\\ud83c[\\udffb-\\udfff]', rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', rsNonAstral = '[^' + rsAstralRange + ']', rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', rsZWJ = '\\u200d'; /** Used to compose unicode regexes. */ var reOptMod = rsModifier + '?', rsOptVar = '[' + rsVarRange + ']?', rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', rsSeq = rsOptVar + reOptMod + rsOptJoin, rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); /** * Gets the size of a Unicode `string`. * * @private * @param {string} string The string inspect. * @returns {number} Returns the string size. */ function unicodeSize(string) { var result = reUnicode.lastIndex = 0; while (reUnicode.test(string)) { ++result; } return result; } module.exports = unicodeSize; /***/ }), /* 1045 */ /***/ (function(module, exports, __webpack_require__) { var arrayMap = __webpack_require__(580), baseIntersection = __webpack_require__(906), baseIteratee = __webpack_require__(543), baseRest = __webpack_require__(377), castArrayLikeObject = __webpack_require__(907), last = __webpack_require__(960); /** * This method is like `_.intersection` except that it accepts `iteratee` * which is invoked for each element of each `arrays` to generate the criterion * by which they're compared. The order and references of result values are * determined by the first array. The iteratee is invoked with one argument: * (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of intersecting values. * @example * * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); * // => [2.1] * * // The `_.property` iteratee shorthand. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }] */ var intersectionBy = baseRest(function(arrays) { var iteratee = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject); if (iteratee === last(mapped)) { iteratee = undefined; } else { mapped.pop(); } return (mapped.length && mapped[0] === arrays[0]) ? baseIntersection(mapped, baseIteratee(iteratee, 2)) : []; }); module.exports = intersectionBy; /***/ }), /* 1046 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _typeof2 = __webpack_require__(862); var _typeof3 = _interopRequireDefault(_typeof2); var _keys = __webpack_require__(835); var _keys2 = _interopRequireDefault(_keys); var _extends2 = __webpack_require__(843); var _extends3 = _interopRequireDefault(_extends2); var _classCallCheck2 = __webpack_require__(851); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = __webpack_require__(852); var _createClass3 = _interopRequireDefault(_createClass2); var _store = __webpack_require__(899); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var hasOwn = Object.prototype.hasOwnProperty; /** * ObservableQueries are the glue between the store and observers * of the store. They have the responsibility to hydrate the documents * before passing them to the React component. */ var ObservableQuery = function () { function ObservableQuery(queryId, definition, client) { var _this = this; (0, _classCallCheck3.default)(this, ObservableQuery); this.handleStoreChange = function () { var nextResult = _this.currentRawResult(); if (!shallowEqual(nextResult, _this.lastResult)) { _this.lastResult = nextResult; _this.notifyObservers(); } }; if (!queryId || !definition || !client) { throw new Error('ObservableQuery takes 3 arguments: queryId, definition and client'); } this.queryId = queryId; this.definition = definition; this.client = client; this.observers = {}; this.idCounter = 1; this.lastResult = this.currentRawResult(); } (0, _createClass3.default)(ObservableQuery, [{ key: 'currentResult', /** * Returns the query from the store with hydrated documents. * * @returns {HydratedQueryState} */ value: function currentResult() { var result = this.client.getQueryFromState(this.queryId, { hydrated: true }); if (!result.lastFetch) { return result; } return (0, _extends3.default)({}, result, { // Weird to have this.definition.id here, maybe it could be getQueryFromState // that should do that data: this.definition.id ? result.data[0] : result.data }); } }, { key: 'fetch', value: function fetch() { return this.client.query(this.definition, { as: this.queryId }); } /** * Generates and executes a query that is offsetted by the number of documents * we have in the store. */ }, { key: 'fetchMore', value: function fetchMore() { return this.client.query(this.definition.offset(this.currentRawResult().data.length), { as: this.queryId }); } }, { key: 'currentRawResult', value: function currentRawResult() { return (0, _store.getRawQueryFromState)(this.getStore().getState(), this.queryId); } }, { key: 'notifyObservers', value: function notifyObservers() { var _this2 = this; (0, _keys2.default)(this.observers).forEach(function (id) { return _this2.observers[id](); }); } }, { key: 'subscribeToStore', value: function subscribeToStore() { if (this._unsubscribeStore) { throw new Error('ObservableQuery instance is already subscribed to store.'); } this._unsubscribeStore = this.getStore().subscribe(this.handleStoreChange); } }, { key: 'unsubscribeFromStore', value: function unsubscribeFromStore() { if (!this._unsubscribeStore) { throw new Error('ObservableQuery instance is not subscribed to store'); } this._unsubscribeStore(); } }, { key: 'subscribe', value: function subscribe(callback) { var _this3 = this; var callbackId = this.idCounter; this.idCounter++; this.observers[callbackId] = callback; if ((0, _keys2.default)(this.observers).length === 1) { this.subscribeToStore(); } return function () { return _this3.unsubscribe(callbackId); }; } }, { key: 'unsubscribe', value: function unsubscribe(callbackId) { if (!this.observers[callbackId]) { throw new Error('Cannot unsubscribe unknown callbackId ' + callbackId); } delete this.observers[callbackId]; if ((0, _keys2.default)(this.observers).length === 0) { this.unsubscribeFromStore(); this._unsubscribeStore = null; } } }, { key: 'getStore', value: function getStore() { return this.client.store; } }]); return ObservableQuery; }(); exports.default = ObservableQuery; function is(x, y) { if (x === y) { return x !== 0 || y !== 0 || 1 / x === 1 / y; } else { return x !== x && y !== y; } } function shallowEqual(objA, objB) { if (is(objA, objB)) return true; if ((typeof objA === 'undefined' ? 'undefined' : (0, _typeof3.default)(objA)) !== 'object' || objA === null || (typeof objB === 'undefined' ? 'undefined' : (0, _typeof3.default)(objB)) !== 'object' || objB === null) { return false; } var keysA = (0, _keys2.default)(objA); var keysB = (0, _keys2.default)(objB); if (keysA.length !== keysB.length) return false; for (var i = 0; i < keysA.length; i++) { if (!hasOwn.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) { return false; } } return true; } /***/ }), /* 1047 */ /***/ (function(module, exports) { /** * The inverse of `_.toPairs`; this method returns an object composed * from key-value `pairs`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} pairs The key-value pairs. * @returns {Object} Returns the new object. * @example * * _.fromPairs([['a', 1], ['b', 2]]); * // => { 'a': 1, 'b': 2 } */ function fromPairs(pairs) { var index = -1, length = pairs == null ? 0 : pairs.length, result = {}; while (++index < length) { var pair = pairs[index]; result[pair[0]] = pair[1]; } return result; } module.exports = fromPairs; /***/ }), /* 1048 */ /***/ (function(module, exports, __webpack_require__) { var baseRest = __webpack_require__(377), unzip = __webpack_require__(1049); /** * Creates an array of grouped elements, the first of which contains the * first elements of the given arrays, the second of which contains the * second elements of the given arrays, and so on. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to process. * @returns {Array} Returns the new array of grouped elements. * @example * * _.zip(['a', 'b'], [1, 2], [true, false]); * // => [['a', 1, true], ['b', 2, false]] */ var zip = baseRest(unzip); module.exports = zip; /***/ }), /* 1049 */ /***/ (function(module, exports, __webpack_require__) { var arrayFilter = __webpack_require__(561), arrayMap = __webpack_require__(580), baseProperty = __webpack_require__(586), baseTimes = __webpack_require__(392), isArrayLikeObject = __webpack_require__(537); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max; /** * This method is like `_.zip` except that it accepts an array of grouped * elements and creates an array regrouping the elements to their pre-zip * configuration. * * @static * @memberOf _ * @since 1.2.0 * @category Array * @param {Array} array The array of grouped elements to process. * @returns {Array} Returns the new array of regrouped elements. * @example * * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); * // => [['a', 1, true], ['b', 2, false]] * * _.unzip(zipped); * // => [['a', 'b'], [1, 2], [true, false]] */ function unzip(array) { if (!(array && array.length)) { return []; } var length = 0; array = arrayFilter(array, function(group) { if (isArrayLikeObject(group)) { length = nativeMax(group.length, length); return true; } }); return baseTimes(length, function(index) { return arrayMap(array, baseProperty(index)); }); } module.exports = unzip; /***/ }), /* 1050 */ /***/ (function(module, exports) { function M() { this._events = {}; } M.prototype = { on: function(ev, cb) { this._events || (this._events = {}); var e = this._events; (e[ev] || (e[ev] = [])).push(cb); return this; }, removeListener: function(ev, cb) { var e = this._events[ev] || [], i; for(i = e.length-1; i >= 0 && e[i]; i--){ if(e[i] === cb || e[i].cb === cb) { e.splice(i, 1); } } }, removeAllListeners: function(ev) { if(!ev) { this._events = {}; } else { this._events[ev] && (this._events[ev] = []); } }, listeners: function(ev) { return (this._events ? this._events[ev] || [] : []); }, emit: function(ev) { this._events || (this._events = {}); var args = Array.prototype.slice.call(arguments, 1), i, e = this._events[ev] || []; for(i = e.length-1; i >= 0 && e[i]; i--){ e[i].apply(this, args); } return this; }, when: function(ev, cb) { return this.once(ev, cb, true); }, once: function(ev, cb, when) { if(!cb) return this; function c() { if(!when) this.removeListener(ev, c); if(cb.apply(this, arguments) && when) this.removeListener(ev, c); } c.cb = cb; this.on(ev, c); return this; } }; M.mixin = function(dest) { var o = M.prototype, k; for (k in o) { o.hasOwnProperty(k) && (dest.prototype[k] = o[k]); } }; module.exports = M; /***/ }), /* 1051 */ /***/ (function(module, exports, __webpack_require__) { var createFlow = __webpack_require__(1052); /** * Creates a function that returns the result of invoking the given functions * with the `this` binding of the created function, where each successive * invocation is supplied the return value of the previous. * * @static * @memberOf _ * @since 3.0.0 * @category Util * @param {...(Function|Function[])} [funcs] The functions to invoke. * @returns {Function} Returns the new composite function. * @see _.flowRight * @example * * function square(n) { * return n * n; * } * * var addSquare = _.flow([_.add, square]); * addSquare(1, 2); * // => 9 */ var flow = createFlow(); module.exports = flow; /***/ }), /* 1052 */ /***/ (function(module, exports, __webpack_require__) { var LodashWrapper = __webpack_require__(435), flatRest = __webpack_require__(606), getData = __webpack_require__(430), getFuncName = __webpack_require__(432), isArray = __webpack_require__(75), isLaziable = __webpack_require__(427); /** Error message constants. */ var FUNC_ERROR_TEXT = 'Expected a function'; /** Used to compose bitmasks for function metadata. */ var WRAP_CURRY_FLAG = 8, WRAP_PARTIAL_FLAG = 32, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256; /** * Creates a `_.flow` or `_.flowRight` function. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new flow function. */ function createFlow(fromRight) { return flatRest(function(funcs) { var length = funcs.length, index = length, prereq = LodashWrapper.prototype.thru; if (fromRight) { funcs.reverse(); } while (index--) { var func = funcs[index]; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } if (prereq && !wrapper && getFuncName(func) == 'wrapper') { var wrapper = new LodashWrapper([], true); } } index = wrapper ? index : length; while (++index < length) { func = funcs[index]; var funcName = getFuncName(func), data = funcName == 'wrapper' ? getData(func) : undefined; if (data && isLaziable(data[0]) && data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data[4].length && data[9] == 1 ) { wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); } else { wrapper = (func.length == 1 && isLaziable(func)) ? wrapper[funcName]() : wrapper.thru(func); } } return function() { var args = arguments, value = args[0]; if (wrapper && args.length == 1 && isArray(value)) { return wrapper.plant(value).value(); } var index = 0, result = length ? funcs[index].apply(this, args) : value; while (++index < length) { result = funcs[index].call(this, result); } return result; }; }); } module.exports = createFlow; /***/ }), /* 1053 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.cancelable = undefined; var _promise = __webpack_require__(799); var _promise2 = _interopRequireDefault(_promise); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Wraps a promise so that it can be canceled * * Rejects with canceled: true as soon as cancel is called * * @param {Promise} promise * @returns {AugmentedPromise} - Promise with .cancel method */ var cancelable = function cancelable(promise) { var _reject = void 0; var wrapped = new _promise2.default(function (resolve, reject) { _reject = reject; promise.then(resolve); promise.catch(reject); }); wrapped.cancel = function () { _reject({ canceled: true }); }; return wrapped; }; exports.cancelable = cancelable; /***/ }), /* 1054 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _regenerator = __webpack_require__(619); var _regenerator2 = _interopRequireDefault(_regenerator); var _asyncToGenerator2 = __webpack_require__(849); var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); var _classCallCheck2 = __webpack_require__(851); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = __webpack_require__(852); var _createClass3 = _interopRequireDefault(_createClass2); __webpack_require__(1055); var _terms = __webpack_require__(1056); var _terms2 = _interopRequireDefault(_terms); var _constants = __webpack_require__(1057); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var queryPartFromOptions = function queryPartFromOptions(options) { var query = new URLSearchParams(options).toString(); return query ? '?' + query : ''; }; var getBaseRoute = function getBaseRoute(app) { var type = app.type; // TODO node is an historic type, it should be `konnector`, check with the back var route = type === _constants.APP_TYPE.KONNECTOR || type === 'node' ? 'konnectors' : 'apps'; return '/' + route; }; var Registry = function () { function Registry(options) { (0, _classCallCheck3.default)(this, Registry); if (!options.client) { throw new Error('Need to pass a client to instantiate a Registry API.'); } this.client = options.client; } /** * Installs or updates an app from a source. * * Accepts the terms if the app has them. * @param {RegistryApp} app - App to be installed * @param {string} source - String (ex: registry://drive/stable) * @returns {Promise} */ (0, _createClass3.default)(Registry, [{ key: 'installApp', value: function () { var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(app, source) { var slug, terms, searchParams, isUpdate, querypart, verb, baseRoute; return _regenerator2.default.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: slug = app.slug, terms = app.terms; searchParams = {}; isUpdate = app.installed; if (isUpdate) searchParams.PermissionsAcked = isUpdate; if (source) searchParams.Source = source; querypart = queryPartFromOptions(searchParams); if (!terms) { _context.next = 9; break; } _context.next = 9; return _terms2.default.save(this.client, terms); case 9: verb = app.installed ? 'PUT' : 'POST'; baseRoute = getBaseRoute(app); return _context.abrupt('return', this.client.stackClient.fetchJSON(verb, baseRoute + '/' + slug + querypart)); case 12: case 'end': return _context.stop(); } } }, _callee, this); })); function installApp(_x, _x2) { return _ref.apply(this, arguments); } return installApp; }() /** * Uninstalls an app. */ }, { key: 'uninstallApp', value: function () { var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(app) { var slug, baseRoute; return _regenerator2.default.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: slug = app.slug; baseRoute = getBaseRoute(app); return _context2.abrupt('return', this.client.stackClient.fetchJSON('DELETE', baseRoute + '/' + slug)); case 3: case 'end': return _context2.stop(); } } }, _callee2, this); })); function uninstallApp(_x3) { return _ref2.apply(this, arguments); } return uninstallApp; }() /** * Fetch at most 200 apps from the channel * * @param {string} options.type - "webapp" or "konnector" * @param {string} options.channel - "dev"/"beta"/"stable" * * @returns {Array<RegistryApp>} */ }, { key: 'fetchApps', value: function () { var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(options) { var channel, type, params, querypart, _ref4, apps; return _regenerator2.default.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: channel = options.channel, type = options.type; params = { limit: 200, versionsChannel: channel, latestChannelVersion: channel }; querypart = new URLSearchParams(params).toString(); if (type) { // Unfortunately, URLSearchParams encodes brackets so we have to do // the querypart handling manually querypart = querypart + ('&filter[type]=' + type); } _context3.next = 6; return this.client.stackClient.fetchJSON('GET', '/registry?' + querypart); case 6: _ref4 = _context3.sent; apps = _ref4.data; return _context3.abrupt('return', apps); case 9: case 'end': return _context3.stop(); } } }, _callee3, this); })); function fetchApps(_x4) { return _ref3.apply(this, arguments); } return fetchApps; }() /** * Fetch the list of apps that are in maintenance mode * * @returns {Array<RegistryApp>} */ }, { key: 'fetchAppsInMaintenance', value: function fetchAppsInMaintenance() { return this.client.stackClient.fetchJSON('GET', '/registry/maintenance'); } /** * Fetch the status of a single app on the registry * * @param {string} slug - The slug of the app to fetch * * @returns {RegistryApp} */ }, { key: 'fetchApp', value: function fetchApp(slug) { return this.client.stackClient.fetchJSON('GET', '/registry/' + slug); } }]); return Registry; }(); exports.default = Registry; /***/ }), /* 1055 */ /***/ (function(module, exports) { /** * * * @author Jerry Bendy <jerry@icewingcc.com> * @licence MIT * */ (function(self) { 'use strict'; var nativeURLSearchParams = (self.URLSearchParams && self.URLSearchParams.prototype.get) ? self.URLSearchParams : null, isSupportObjectConstructor = nativeURLSearchParams && (new nativeURLSearchParams({a: 1})).toString() === 'a=1', // There is a bug in safari 10.1 (and earlier) that incorrectly decodes `%2B` as an empty space and not a plus. decodesPlusesCorrectly = nativeURLSearchParams && (new nativeURLSearchParams('s=%2B').get('s') === '+'), __URLSearchParams__ = "__URLSearchParams__", // Fix bug in Edge which cannot encode ' &' correctly encodesAmpersandsCorrectly = nativeURLSearchParams ? (function() { var ampersandTest = new nativeURLSearchParams(); ampersandTest.append('s', ' &'); return ampersandTest.toString() === 's=+%26'; })() : true, prototype = URLSearchParamsPolyfill.prototype, iterable = !!(self.Symbol && self.Symbol.iterator); if (nativeURLSearchParams && isSupportObjectConstructor && decodesPlusesCorrectly && encodesAmpersandsCorrectly) { return; } /** * Make a URLSearchParams instance * * @param {object|string|URLSearchParams} search * @constructor */ function URLSearchParamsPolyfill(search) { search = search || ""; // support construct object with another URLSearchParams instance if (search instanceof URLSearchParams || search instanceof URLSearchParamsPolyfill) { search = search.toString(); } this [__URLSearchParams__] = parseToDict(search); } /** * Appends a specified key/value pair as a new search parameter. * * @param {string} name * @param {string} value */ prototype.append = function(name, value) { appendTo(this [__URLSearchParams__], name, value); }; /** * Deletes the given search parameter, and its associated value, * from the list of all search parameters. * * @param {string} name */ prototype['delete'] = function(name) { delete this [__URLSearchParams__] [name]; }; /** * Returns the first value associated to the given search parameter. * * @param {string} name * @returns {string|null} */ prototype.get = function(name) { var dict = this [__URLSearchParams__]; return name in dict ? dict[name][0] : null; }; /** * Returns all the values association with a given search parameter. * * @param {string} name * @returns {Array} */ prototype.getAll = function(name) { var dict = this [__URLSearchParams__]; return name in dict ? dict [name].slice(0) : []; }; /** * Returns a Boolean indicating if such a search parameter exists. * * @param {string} name * @returns {boolean} */ prototype.has = function(name) { return name in this [__URLSearchParams__]; }; /** * Sets the value associated to a given search parameter to * the given value. If there were several values, delete the * others. * * @param {string} name * @param {string} value */ prototype.set = function set(name, value) { this [__URLSearchParams__][name] = ['' + value]; }; /** * Returns a string containg a query string suitable for use in a URL. * * @returns {string} */ prototype.toString = function() { var dict = this[__URLSearchParams__], query = [], i, key, name, value; for (key in dict) { name = encode(key); for (i = 0, value = dict[key]; i < value.length; i++) { query.push(name + '=' + encode(value[i])); } } return query.join('&'); }; // There is a bug in Safari 10.1 and `Proxy`ing it is not enough. var forSureUsePolyfill = !decodesPlusesCorrectly; var useProxy = (!forSureUsePolyfill && nativeURLSearchParams && !isSupportObjectConstructor && self.Proxy) /* * Apply polifill to global object and append other prototype into it */ Object.defineProperty(self, 'URLSearchParams', { value: (useProxy ? // Safari 10.0 doesn't support Proxy, so it won't extend URLSearchParams on safari 10.0 new Proxy(nativeURLSearchParams, { construct: function(target, args) { return new target((new URLSearchParamsPolyfill(args[0]).toString())); } }) : URLSearchParamsPolyfill) }); var USPProto = self.URLSearchParams.prototype; USPProto.polyfill = true; /** * * @param {function} callback * @param {object} thisArg */ USPProto.forEach = USPProto.forEach || function(callback, thisArg) { var dict = parseToDict(this.toString()); Object.getOwnPropertyNames(dict).forEach(function(name) { dict[name].forEach(function(value) { callback.call(thisArg, value, name, this); }, this); }, this); }; /** * Sort all name-value pairs */ USPProto.sort = USPProto.sort || function() { var dict = parseToDict(this.toString()), keys = [], k, i, j; for (k in dict) { keys.push(k); } keys.sort(); for (i = 0; i < keys.length; i++) { this['delete'](keys[i]); } for (i = 0; i < keys.length; i++) { var key = keys[i], values = dict[key]; for (j = 0; j < values.length; j++) { this.append(key, values[j]); } } }; /** * Returns an iterator allowing to go through all keys of * the key/value pairs contained in this object. * * @returns {function} */ USPProto.keys = USPProto.keys || function() { var items = []; this.forEach(function(item, name) { items.push(name); }); return makeIterator(items); }; /** * Returns an iterator allowing to go through all values of * the key/value pairs contained in this object. * * @returns {function} */ USPProto.values = USPProto.values || function() { var items = []; this.forEach(function(item) { items.push(item); }); return makeIterator(items); }; /** * Returns an iterator allowing to go through all key/value * pairs contained in this object. * * @returns {function} */ USPProto.entries = USPProto.entries || function() { var items = []; this.forEach(function(item, name) { items.push([name, item]); }); return makeIterator(items); }; if (iterable) { USPProto[self.Symbol.iterator] = USPProto[self.Symbol.iterator] || USPProto.entries; } function encode(str) { var replace = { '!': '%21', "'": '%27', '(': '%28', ')': '%29', '~': '%7E', '%20': '+', '%00': '\x00' }; return encodeURIComponent(str).replace(/[!'\(\)~]|%20|%00/g, function(match) { return replace[match]; }); } function decode(str) { return str .replace(/[ +]/g, '%20') .replace(/(%[a-f0-9]{2})+/ig, function(match) { return decodeURIComponent(match); }); } function makeIterator(arr) { var iterator = { next: function() { var value = arr.shift(); return {done: value === undefined, value: value}; } }; if (iterable) { iterator[self.Symbol.iterator] = function() { return iterator; }; } return iterator; } function parseToDict(search) { var dict = {}; if (typeof search === "object") { // if `search` is an array, treat it as a sequence if (isArray(search)) { for (var i = 0; i < search.length; i++) { var item = search[i]; if (isArray(item) && item.length === 2) { appendTo(dict, item[0], item[1]); } else { throw new TypeError("Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements"); } } } else { for (var key in search) { if (search.hasOwnProperty(key)) { appendTo(dict, key, search[key]); } } } } else { // remove first '?' if (search.indexOf("?") === 0) { search = search.slice(1); } var pairs = search.split("&"); for (var j = 0; j < pairs.length; j++) { var value = pairs [j], index = value.indexOf('='); if (-1 < index) { appendTo(dict, decode(value.slice(0, index)), decode(value.slice(index + 1))); } else { if (value) { appendTo(dict, decode(value), ''); } } } } return dict; } function appendTo(dict, name, value) { var val = typeof value === 'string' ? value : ( value !== null && value !== undefined && typeof value.toString === 'function' ? value.toString() : JSON.stringify(value) ) if (name in dict) { dict[name].push(val); } else { dict[name] = [val]; } } function isArray(val) { return !!val && '[object Array]' === Object.prototype.toString.call(val); } })(typeof global !== 'undefined' ? global : (typeof window !== 'undefined' ? window : this)); /***/ }), /* 1056 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _regenerator = __webpack_require__(619); var _regenerator2 = _interopRequireDefault(_regenerator); var _extends2 = __webpack_require__(843); var _extends3 = _interopRequireDefault(_extends2); var _objectWithoutProperties2 = __webpack_require__(850); var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); var _asyncToGenerator2 = __webpack_require__(849); var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); /* TODO Use collection terms */ var save = function () { var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(client, terms) { var id, termsAttributes, _ref2, savedTermsDocs, savedTerms, termsToSave, _termsToSave; return _regenerator2.default.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: id = terms.id, termsAttributes = (0, _objectWithoutProperties3.default)(terms, ['id']); _context.next = 3; return client.query({ doctype: TERMS_DOCTYPE, selector: { termsId: id, version: termsAttributes.version }, limit: 1 }); case 3: _ref2 = _context.sent; savedTermsDocs = _ref2.data; if (!(savedTermsDocs && savedTermsDocs.length)) { _context.next = 13; break; } // we just update the url if this is the same id and same version // but the url changed savedTerms = savedTermsDocs[0]; if (!(savedTerms.termsId == id && savedTerms.version == termsAttributes.version && savedTerms.url != termsAttributes.url)) { _context.next = 11; break; } termsToSave = (0, _extends3.default)({ _type: TERMS_DOCTYPE }, savedTerms, { url: termsAttributes.url }); _context.next = 11; return client.save(termsToSave); case 11: _context.next = 16; break; case 13: _termsToSave = (0, _extends3.default)({ _type: TERMS_DOCTYPE }, termsAttributes, { termsId: id, accepted: true, acceptedAt: new Date() }); _context.next = 16; return client.save(_termsToSave); case 16: case 'end': return _context.stop(); } } }, _callee, this); })); return function save(_x, _x2) { return _ref.apply(this, arguments); }; }(); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var TERMS_DOCTYPE = 'io.cozy.terms';exports.default = { save: save }; /***/ }), /* 1057 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var APP_TYPE = exports.APP_TYPE = { KONNECTOR: 'konnector', WEBAPP: 'webapp' }; /***/ }), /* 1058 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _typeof2 = __webpack_require__(862); var _typeof3 = _interopRequireDefault(_typeof2); var _extends2 = __webpack_require__(843); var _extends3 = _interopRequireDefault(_extends2); exports.sanitizeCategories = sanitizeCategories; exports.areTermsValid = areTermsValid; exports.isPartnershipValid = isPartnershipValid; exports.sanitize = sanitize; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var APP_CATEGORIES = ['banking', 'cozy', 'energy', 'health', 'host_provider', 'insurance', 'isp', 'mes_infos', 'online_services', 'others', 'partners', 'press', 'productivity', 'ptnb', 'public_service', 'shopping', 'social', 'telecom', 'transport']; /** Filters unauthorized categories. Defaults to ['others'] if no suitable category. */ function sanitizeCategories(categories) { if (!categories) return ['others']; var filteredList = categories.filter(function (c) { return APP_CATEGORIES.includes(c); }); if (!filteredList.length) return ['others']; return filteredList; } function areTermsValid(terms) { return Boolean(terms && terms.id && terms.url && terms.version); } function isPartnershipValid(partnership) { return Boolean(partnership && partnership.description); } /** * Normalize app manifest, retrocompatibility for old manifests * * @param {Manifest} manifest * @returns {Manifest} */ function sanitize(manifest) { var sanitized = (0, _extends3.default)({}, manifest); // Make categories an array and delete category attribute if it exists if (!manifest.categories && manifest.category && typeof manifest.category === 'string') { sanitized.categories = [manifest.category]; delete sanitized.category; } sanitized.categories = sanitizeCategories(sanitized.categories); // manifest name is not an object if ((0, _typeof3.default)(manifest.name) === 'object') sanitized.name = manifest.name.en; // Fix camelCase from cozy-stack if (manifest.available_version) { sanitized.availableVersion = manifest.available_version; delete sanitized.available_version; } // Fix camelCase from cozy-stack if (manifest.latest_version) { sanitized.latestVersion = manifest.latestVersion; delete sanitized.latest_version; } // Remove invalid terms if (sanitized.terms && !areTermsValid(sanitized.terms)) { delete sanitized.terms; } // Remove invalid partnership if (sanitized.partnership && !isPartnershipValid(sanitized.partnership)) { delete sanitized.partnership; } return sanitized; } /***/ }), /* 1059 */ /***/ (function(module, exports, __webpack_require__) { /* global __WEBPACK_PROVIDED_MANIFEST__ */ /** * Manifest is provided differently in developement that in production. * * - In production, the manifest has been "merged" via Webpack via the * DefinePlugin * * - In development/test, we simply read the manifest from the fs */ const fs = __webpack_require__(167); const path = __webpack_require__(160); let manifest = typeof {"version":"1.0.1","name":"Enedis","type":"konnector","language":"node","icon":"icon.png","slug":"enedisgrandlyon","source":"https://forge.grandlyon.com/web-et-numerique/llle_project/enedis-konnector.git","editor":"Métropole de Lyon","vendor_link":"https://www.enedis.fr/","categories":["energy"],"frequency":"daily","fields":{"access_token":{"type":"hidden"},"refresh_token":{"type":"hidden"}},"oauth":{},"data_types":[],"screenshots":[],"permissions":{"accounts":{"type":"io.cozy.accounts"},"enedis data":{"type":"com.grandlyon.enedis.*"}},"developer":{"name":"Métropole de Lyon","url":"https://www.grandlyon.com/"},"langs":["fr"],"locales":{"fr":{"short_description":"Récupère vos donnéees de courbe de charge depuis l'API Enedis","long_description":"Ce connecteur récupère la courbe de charge électrique enregistrée par le compteur Linky","permissions":{"enedis data":{"description":"Requises pour accéder et stocker les données collectées par le compteur Linky et exposées par les API Enedis (consommations d’électricité à la demi-heure, au jour, mois et année). "},"accounts":{"description":"Utilisé pour accéder à vos données de consommation."}}},"en":{"short_description":"Fetches your electricity consumption data from Enedis API","long_description":"This konnector fetches the energy curve of your electricity consumption gathered by your Linky device.","permissions":{"enedis data":{"description":"Required to access and store the data collected by the Linky meter and exposed by Enedis APIs (half-an-hour, daily, monthly and yearly consumption)."},"accounts":{"description":"Used to access your consumption data."}}}},"manifest_version":"2"} === 'undefined' ? {} : {"version":"1.0.1","name":"Enedis","type":"konnector","language":"node","icon":"icon.png","slug":"enedisgrandlyon","source":"https://forge.grandlyon.com/web-et-numerique/llle_project/enedis-konnector.git","editor":"Métropole de Lyon","vendor_link":"https://www.enedis.fr/","categories":["energy"],"frequency":"daily","fields":{"access_token":{"type":"hidden"},"refresh_token":{"type":"hidden"}},"oauth":{},"data_types":[],"screenshots":[],"permissions":{"accounts":{"type":"io.cozy.accounts"},"enedis data":{"type":"com.grandlyon.enedis.*"}},"developer":{"name":"Métropole de Lyon","url":"https://www.grandlyon.com/"},"langs":["fr"],"locales":{"fr":{"short_description":"Récupère vos donnéees de courbe de charge depuis l'API Enedis","long_description":"Ce connecteur récupère la courbe de charge électrique enregistrée par le compteur Linky","permissions":{"enedis data":{"description":"Requises pour accéder et stocker les données collectées par le compteur Linky et exposées par les API Enedis (consommations d’électricité à la demi-heure, au jour, mois et année). "},"accounts":{"description":"Utilisé pour accéder à vos données de consommation."}}},"en":{"short_description":"Fetches your electricity consumption data from Enedis API","long_description":"This konnector fetches the energy curve of your electricity consumption gathered by your Linky device.","permissions":{"enedis data":{"description":"Required to access and store the data collected by the Linky meter and exposed by Enedis APIs (half-an-hour, daily, monthly and yearly consumption)."},"accounts":{"description":"Used to access your consumption data."}}}},"manifest_version":"2"}; if (false) {} function getManifestFromFile() { return JSON.parse(fs.readFileSync(path.join(process.cwd(), 'manifest.konnector'))); } function setManifest(data) { manifest = data; } function getCozyMetadata(data = {}) { const now = new Date(Date.now()); const defaultData = { doctypeVersion: 1, metadataVersion: 1, createdAt: now, createdByApp: manifest.slug, createdByAppVersion: manifest.version, updatedAt: now, updatedByApps: [{ slug: manifest.slug, date: now, version: manifest.version }] }; if (data.updatedByApps) { const index = data.updatedByApps.findIndex(app => app.slug === manifest.slug); if (index !== -1) { data.updatedByApps[index] = defaultData.updatedByApps.pop(); } } return { ...defaultData, ...data }; } module.exports = { data: manifest, getCozyMetadata, setManifest }; /***/ }), /* 1060 */ /***/ (function(module, exports, __webpack_require__) { const fs = __webpack_require__(167); const path = __webpack_require__(160); const log = __webpack_require__(2).namespace('cozy-client-js-stub'); const mimetypes = __webpack_require__(1061); const low = __webpack_require__(1064); const lodashId = __webpack_require__(1067); const FileSync = __webpack_require__(1068); const rawBody = __webpack_require__(1076); const stripJsonComments = __webpack_require__(1088); const rootPath = JSON.parse(process.env.COZY_FIELDS || '{"folder_to_save": "."}').folder_to_save; let db = setUpDb(); function setDefaults(doctype) { const defaults = { 'io.cozy.files': [] }; if (doctype) defaults[doctype] = []; db.defaults(defaults).write(); } module.exports = { _setDb(newDb) { db = newDb; }, fetchJSON() { return Promise.resolve({ rows: [] }); }, data: { create(doctype, item) { setDefaults(doctype); const doc = db.get(doctype).insert(item).write(); return Promise.resolve(doc); }, update(doctype, doc, changes) { setDefaults(doctype); db.get(doctype).updateById(doc._id, changes).write(); return Promise.resolve(doc); }, updateAttributes(doctype, id, attrs) { setDefaults(doctype); const doc = db.get(doctype).updateById(id, attrs).write(); return Promise.resolve(doc); }, defineIndex(doctype) { return Promise.resolve({ doctype }); }, query(index, options) { // this stub only supposes that there are keys defined in options.selectors // this is only needed by the hydrateAndFilter function // supporting all mango selectors is not planned here const { doctype } = index; setDefaults(doctype); const { selector } = options; const keys = Object.keys(selector); let result = db.get(doctype).filter(doc => keys.every(key => doc[key] && doc[key] === selector[key])).value(); if (options.wholeResponse) { result = { docs: result }; } return Promise.resolve(result); }, findAll(doctype) { setDefaults(doctype); return Promise.resolve(db.get(doctype).value()); }, delete(doctype, doc) { setDefaults(doctype); const result = db.get(doctype).removeById(doc._id).write(); return Promise.resolve(result); }, find(doctype, id) { setDefaults(doctype); let result = db.get(doctype).getById(id).value(); const accountExists = Boolean(result); if (doctype === 'io.cozy.accounts') { const configPath = path.resolve('konnector-dev-config.json'); const config = JSON.parse(stripJsonComments(fs.readFileSync(configPath))); result = { _id: id, ...result, auth: config.fields }; if (!accountExists) { this.create(doctype, result); } else { this.update(doctype, result, result); } } return Promise.resolve(result); }, listReferencedFiles() { return Promise.resolve([]); }, addReferencedFiles() { return Promise.resolve({}); } }, files: { statByPath(pathToCheck) { setDefaults(); // check this path in . return new Promise((resolve, reject) => { log('debug', `Checking if ${pathToCheck} exists`); if (pathToCheck === '/') return resolve({ _id: '.' }); const realpath = path.join(rootPath, pathToCheck); log('debug', `Real path : ${realpath}`); if (fs.existsSync(realpath)) { const extension = path.extname(pathToCheck).substr(1); const doc = db.get('io.cozy.files').getById(pathToCheck.split('/').pop()).value(); if (!doc) { resolve({ _id: removeFirstSlash(pathToCheck), attributes: { mime: mimetypes.lookup(extension), name: pathToCheck, size: fs.statSync(realpath).size } }); } else { resolve(doc); } } else { const err = new Error(`${pathToCheck} does not exist`); err.status = 404; reject(err); } }); }, statById() { setDefaults(); // just return the / path for dev purpose return Promise.resolve({ attributes: { path: '/' } }); }, async updateById(id, file, options) { setDefaults(); await removeFile(id); return createFile(file, options); }, create(file, options) { setDefaults(); return createFile(file, options); }, createDirectory(options) { setDefaults(); return new Promise(resolve => { log('info', `Creating new directory ${options.name}`); const finalPath = path.join(rootPath, options.dirID, options.name); const returnPath = path.join(options.dirID, options.name); log('info', `Real path : ${finalPath}`); fs.mkdirSync(finalPath); resolve({ _id: returnPath, path: returnPath }); }); }, downloadByPath(filePath) { setDefaults(); return this.downloadById(filePath); }, downloadById(fileId) { setDefaults(); const realpath = path.join(rootPath, fileId); const stream = fs.createReadStream(realpath); return { body: stream, buffer: () => rawBody(stream) }; }, trashById(fileId) { setDefaults(); return removeFile(fileId); }, destroyById() { setDefaults(); // there is no trash with the stub return Promise.resolve(); } } }; async function removeFile(fileId) { db.get('io.cozy.files').removeById(fileId).write(); const realpath = path.join(rootPath, fileId); fs.unlinkSync(realpath); } function setUpDb() { let DUMP_PATH = 'importedData.json'; const KONNECTOR_DEV_CONFIG_PATH = path.resolve('konnector-dev-config.json'); if (fs.existsSync(KONNECTOR_DEV_CONFIG_PATH)) { const KONNECTOR_DEV_CONFIG = JSON.parse(fs.readFileSync(KONNECTOR_DEV_CONFIG_PATH, 'utf-8')); DUMP_PATH = path.join(KONNECTOR_DEV_CONFIG.fields.folderPath || rootPath, DUMP_PATH); } const db = low(new FileSync(DUMP_PATH)); db._.mixin(lodashId); db._.id = '_id'; return db; } function removeFirstSlash(pathToCheck) { if (pathToCheck[0] === '/') { return pathToCheck.substr(1); } return pathToCheck; } function createFile(file, options = {}) { return new Promise((resolve, reject) => { log('debug', `Creating new file ${options.name}`); const finalPath = path.join(rootPath, options.dirID, options.name); log('debug', `Real path : ${finalPath}`); const extension = path.extname(options.name).substr(1); const mime = mimetypes.lookup(extension); const fileDoc = { _id: options.name, attributes: { mime, name: options.name, metadata: options.metadata }, cozyMetadata: { sourceAccount: options.sourceAccount, sourceAccountIdentifier: options.sourceAccountIdentifier } }; if (file.pipe) { let writeStream = fs.createWriteStream(finalPath); file.pipe(writeStream); file.on('end', () => { log('info', `File ${finalPath} created`); addFileSizeAndWrite(fileDoc, finalPath); resolve(fileDoc); }); writeStream.on('error', err => { log('warn', `Error : ${err} while trying to write file`); reject(new Error(err)); }); } else { // file is a string fs.writeFileSync(finalPath, file); addFileSizeAndWrite(fileDoc, finalPath); resolve(fileDoc); } function addFileSizeAndWrite(doc, filePath) { doc.attributes.size = fs.statSync(filePath).size; db.get('io.cozy.files').insert(doc).write(); } }); } /***/ }), /* 1061 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * mime-types * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var db = __webpack_require__(1062) var extname = __webpack_require__(160).extname /** * Module variables. * @private */ var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/ var TEXT_TYPE_REGEXP = /^text\//i /** * Module exports. * @public */ exports.charset = charset exports.charsets = { lookup: charset } exports.contentType = contentType exports.extension = extension exports.extensions = Object.create(null) exports.lookup = lookup exports.types = Object.create(null) // Populate the extensions/types maps populateMaps(exports.extensions, exports.types) /** * Get the default charset for a MIME type. * * @param {string} type * @return {boolean|string} */ function charset (type) { if (!type || typeof type !== 'string') { return false } // TODO: use media-typer var match = EXTRACT_TYPE_REGEXP.exec(type) var mime = match && db[match[1].toLowerCase()] if (mime && mime.charset) { return mime.charset } // default text/* to utf-8 if (match && TEXT_TYPE_REGEXP.test(match[1])) { return 'UTF-8' } return false } /** * Create a full Content-Type header given a MIME type or extension. * * @param {string} str * @return {boolean|string} */ function contentType (str) { // TODO: should this even be in this module? if (!str || typeof str !== 'string') { return false } var mime = str.indexOf('/') === -1 ? exports.lookup(str) : str if (!mime) { return false } // TODO: use content-type or other module if (mime.indexOf('charset') === -1) { var charset = exports.charset(mime) if (charset) mime += '; charset=' + charset.toLowerCase() } return mime } /** * Get the default extension for a MIME type. * * @param {string} type * @return {boolean|string} */ function extension (type) { if (!type || typeof type !== 'string') { return false } // TODO: use media-typer var match = EXTRACT_TYPE_REGEXP.exec(type) // get extensions var exts = match && exports.extensions[match[1].toLowerCase()] if (!exts || !exts.length) { return false } return exts[0] } /** * Lookup the MIME type for a file path/extension. * * @param {string} path * @return {boolean|string} */ function lookup (path) { if (!path || typeof path !== 'string') { return false } // get the extension ("ext" or ".ext" or full path) var extension = extname('x.' + path) .toLowerCase() .substr(1) if (!extension) { return false } return exports.types[extension] || false } /** * Populate the extensions and types maps. * @private */ function populateMaps (extensions, types) { // source preference (least -> most) var preference = ['nginx', 'apache', undefined, 'iana'] Object.keys(db).forEach(function forEachMimeType (type) { var mime = db[type] var exts = mime.extensions if (!exts || !exts.length) { return } // mime -> extensions extensions[type] = exts // extension -> mime for (var i = 0; i < exts.length; i++) { var extension = exts[i] if (types[extension]) { var from = preference.indexOf(db[types[extension]].source) var to = preference.indexOf(mime.source) if (types[extension] !== 'application/octet-stream' && (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) { // skip the remapping continue } } // set the extension -> mime types[extension] = type } }) } /***/ }), /* 1062 */ /***/ (function(module, exports, __webpack_require__) { /*! * mime-db * Copyright(c) 2014 Jonathan Ong * MIT Licensed */ /** * Module exports. */ module.exports = __webpack_require__(1063) /***/ }), /* 1063 */ /***/ (function(module) { module.exports = JSON.parse("{\"application/1d-interleaved-parityfec\":{\"source\":\"iana\"},\"application/3gpdash-qoe-report+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/3gpp-ims+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/a2l\":{\"source\":\"iana\"},\"application/activemessage\":{\"source\":\"iana\"},\"application/activity+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-costmap+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-costmapfilter+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-directory+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-endpointcost+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-endpointcostparams+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-endpointprop+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-endpointpropparams+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-error+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-networkmap+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-networkmapfilter+json\":{\"source\":\"iana\",\"compressible\":true},\"application/aml\":{\"source\":\"iana\"},\"application/andrew-inset\":{\"source\":\"iana\",\"extensions\":[\"ez\"]},\"application/applefile\":{\"source\":\"iana\"},\"application/applixware\":{\"source\":\"apache\",\"extensions\":[\"aw\"]},\"application/atf\":{\"source\":\"iana\"},\"application/atfx\":{\"source\":\"iana\"},\"application/atom+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"atom\"]},\"application/atomcat+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"atomcat\"]},\"application/atomdeleted+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/atomicmail\":{\"source\":\"iana\"},\"application/atomsvc+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"atomsvc\"]},\"application/atsc-dwd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/atsc-held+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/atsc-rsat+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/atxml\":{\"source\":\"iana\"},\"application/auth-policy+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/bacnet-xdd+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/batch-smtp\":{\"source\":\"iana\"},\"application/bdoc\":{\"compressible\":false,\"extensions\":[\"bdoc\"]},\"application/beep+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/calendar+json\":{\"source\":\"iana\",\"compressible\":true},\"application/calendar+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/call-completion\":{\"source\":\"iana\"},\"application/cals-1840\":{\"source\":\"iana\"},\"application/cbor\":{\"source\":\"iana\"},\"application/cccex\":{\"source\":\"iana\"},\"application/ccmp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/ccxml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ccxml\"]},\"application/cdfx+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cdmi-capability\":{\"source\":\"iana\",\"extensions\":[\"cdmia\"]},\"application/cdmi-container\":{\"source\":\"iana\",\"extensions\":[\"cdmic\"]},\"application/cdmi-domain\":{\"source\":\"iana\",\"extensions\":[\"cdmid\"]},\"application/cdmi-object\":{\"source\":\"iana\",\"extensions\":[\"cdmio\"]},\"application/cdmi-queue\":{\"source\":\"iana\",\"extensions\":[\"cdmiq\"]},\"application/cdni\":{\"source\":\"iana\"},\"application/cea\":{\"source\":\"iana\"},\"application/cea-2018+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cellml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cfw\":{\"source\":\"iana\"},\"application/clue_info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cms\":{\"source\":\"iana\"},\"application/cnrp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/coap-group+json\":{\"source\":\"iana\",\"compressible\":true},\"application/coap-payload\":{\"source\":\"iana\"},\"application/commonground\":{\"source\":\"iana\"},\"application/conference-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cose\":{\"source\":\"iana\"},\"application/cose-key\":{\"source\":\"iana\"},\"application/cose-key-set\":{\"source\":\"iana\"},\"application/cpl+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/csrattrs\":{\"source\":\"iana\"},\"application/csta+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cstadata+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/csvm+json\":{\"source\":\"iana\",\"compressible\":true},\"application/cu-seeme\":{\"source\":\"apache\",\"extensions\":[\"cu\"]},\"application/cwt\":{\"source\":\"iana\"},\"application/cybercash\":{\"source\":\"iana\"},\"application/dart\":{\"compressible\":true},\"application/dash+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mpd\"]},\"application/dashdelta\":{\"source\":\"iana\"},\"application/davmount+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"davmount\"]},\"application/dca-rft\":{\"source\":\"iana\"},\"application/dcd\":{\"source\":\"iana\"},\"application/dec-dx\":{\"source\":\"iana\"},\"application/dialog-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/dicom\":{\"source\":\"iana\"},\"application/dicom+json\":{\"source\":\"iana\",\"compressible\":true},\"application/dicom+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/dii\":{\"source\":\"iana\"},\"application/dit\":{\"source\":\"iana\"},\"application/dns\":{\"source\":\"iana\"},\"application/dns+json\":{\"source\":\"iana\",\"compressible\":true},\"application/dns-message\":{\"source\":\"iana\"},\"application/docbook+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"dbk\"]},\"application/dskpp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/dssc+der\":{\"source\":\"iana\",\"extensions\":[\"dssc\"]},\"application/dssc+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xdssc\"]},\"application/dvcs\":{\"source\":\"iana\"},\"application/ecmascript\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ecma\",\"es\"]},\"application/edi-consent\":{\"source\":\"iana\"},\"application/edi-x12\":{\"source\":\"iana\",\"compressible\":false},\"application/edifact\":{\"source\":\"iana\",\"compressible\":false},\"application/efi\":{\"source\":\"iana\"},\"application/emergencycalldata.comment+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.control+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.deviceinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.ecall.msd\":{\"source\":\"iana\"},\"application/emergencycalldata.providerinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.serviceinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.subscriberinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.veds+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emma+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"emma\"]},\"application/emotionml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/encaprtp\":{\"source\":\"iana\"},\"application/epp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/epub+zip\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"epub\"]},\"application/eshop\":{\"source\":\"iana\"},\"application/exi\":{\"source\":\"iana\",\"extensions\":[\"exi\"]},\"application/expect-ct-report+json\":{\"source\":\"iana\",\"compressible\":true},\"application/fastinfoset\":{\"source\":\"iana\"},\"application/fastsoap\":{\"source\":\"iana\"},\"application/fdt+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/fhir+json\":{\"source\":\"iana\",\"compressible\":true},\"application/fhir+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/fido.trusted-apps+json\":{\"compressible\":true},\"application/fits\":{\"source\":\"iana\"},\"application/flexfec\":{\"source\":\"iana\"},\"application/font-sfnt\":{\"source\":\"iana\"},\"application/font-tdpfr\":{\"source\":\"iana\",\"extensions\":[\"pfr\"]},\"application/font-woff\":{\"source\":\"iana\",\"compressible\":false},\"application/framework-attributes+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/geo+json\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"geojson\"]},\"application/geo+json-seq\":{\"source\":\"iana\"},\"application/geopackage+sqlite3\":{\"source\":\"iana\"},\"application/geoxacml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/gltf-buffer\":{\"source\":\"iana\"},\"application/gml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"gml\"]},\"application/gpx+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"gpx\"]},\"application/gxf\":{\"source\":\"apache\",\"extensions\":[\"gxf\"]},\"application/gzip\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"gz\"]},\"application/h224\":{\"source\":\"iana\"},\"application/held+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/hjson\":{\"extensions\":[\"hjson\"]},\"application/http\":{\"source\":\"iana\"},\"application/hyperstudio\":{\"source\":\"iana\",\"extensions\":[\"stk\"]},\"application/ibe-key-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/ibe-pkg-reply+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/ibe-pp-data\":{\"source\":\"iana\"},\"application/iges\":{\"source\":\"iana\"},\"application/im-iscomposing+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/index\":{\"source\":\"iana\"},\"application/index.cmd\":{\"source\":\"iana\"},\"application/index.obj\":{\"source\":\"iana\"},\"application/index.response\":{\"source\":\"iana\"},\"application/index.vnd\":{\"source\":\"iana\"},\"application/inkml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ink\",\"inkml\"]},\"application/iotp\":{\"source\":\"iana\"},\"application/ipfix\":{\"source\":\"iana\",\"extensions\":[\"ipfix\"]},\"application/ipp\":{\"source\":\"iana\"},\"application/isup\":{\"source\":\"iana\"},\"application/its+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/java-archive\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"jar\",\"war\",\"ear\"]},\"application/java-serialized-object\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"ser\"]},\"application/java-vm\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"class\"]},\"application/javascript\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"js\",\"mjs\"]},\"application/jf2feed+json\":{\"source\":\"iana\",\"compressible\":true},\"application/jose\":{\"source\":\"iana\"},\"application/jose+json\":{\"source\":\"iana\",\"compressible\":true},\"application/jrd+json\":{\"source\":\"iana\",\"compressible\":true},\"application/json\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"json\",\"map\"]},\"application/json-patch+json\":{\"source\":\"iana\",\"compressible\":true},\"application/json-seq\":{\"source\":\"iana\"},\"application/json5\":{\"extensions\":[\"json5\"]},\"application/jsonml+json\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"jsonml\"]},\"application/jwk+json\":{\"source\":\"iana\",\"compressible\":true},\"application/jwk-set+json\":{\"source\":\"iana\",\"compressible\":true},\"application/jwt\":{\"source\":\"iana\"},\"application/kpml-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/kpml-response+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/ld+json\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"jsonld\"]},\"application/lgr+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/link-format\":{\"source\":\"iana\"},\"application/load-control+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/lost+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"lostxml\"]},\"application/lostsync+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/lxf\":{\"source\":\"iana\"},\"application/mac-binhex40\":{\"source\":\"iana\",\"extensions\":[\"hqx\"]},\"application/mac-compactpro\":{\"source\":\"apache\",\"extensions\":[\"cpt\"]},\"application/macwriteii\":{\"source\":\"iana\"},\"application/mads+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mads\"]},\"application/manifest+json\":{\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"webmanifest\"]},\"application/marc\":{\"source\":\"iana\",\"extensions\":[\"mrc\"]},\"application/marcxml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mrcx\"]},\"application/mathematica\":{\"source\":\"iana\",\"extensions\":[\"ma\",\"nb\",\"mb\"]},\"application/mathml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mathml\"]},\"application/mathml-content+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mathml-presentation+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-associated-procedure-description+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-deregister+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-envelope+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-msk+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-msk-response+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-protection-description+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-reception-report+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-register+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-register-response+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-schedule+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-user-service-description+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbox\":{\"source\":\"iana\",\"extensions\":[\"mbox\"]},\"application/media-policy-dataset+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/media_control+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mediaservercontrol+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mscml\"]},\"application/merge-patch+json\":{\"source\":\"iana\",\"compressible\":true},\"application/metalink+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"metalink\"]},\"application/metalink4+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"meta4\"]},\"application/mets+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mets\"]},\"application/mf4\":{\"source\":\"iana\"},\"application/mikey\":{\"source\":\"iana\"},\"application/mipc\":{\"source\":\"iana\"},\"application/mmt-aei+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mmt-usd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mods+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mods\"]},\"application/moss-keys\":{\"source\":\"iana\"},\"application/moss-signature\":{\"source\":\"iana\"},\"application/mosskey-data\":{\"source\":\"iana\"},\"application/mosskey-request\":{\"source\":\"iana\"},\"application/mp21\":{\"source\":\"iana\",\"extensions\":[\"m21\",\"mp21\"]},\"application/mp4\":{\"source\":\"iana\",\"extensions\":[\"mp4s\",\"m4p\"]},\"application/mpeg4-generic\":{\"source\":\"iana\"},\"application/mpeg4-iod\":{\"source\":\"iana\"},\"application/mpeg4-iod-xmt\":{\"source\":\"iana\"},\"application/mrb-consumer+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mrb-publish+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/msc-ivr+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/msc-mixer+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/msword\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"doc\",\"dot\"]},\"application/mud+json\":{\"source\":\"iana\",\"compressible\":true},\"application/mxf\":{\"source\":\"iana\",\"extensions\":[\"mxf\"]},\"application/n-quads\":{\"source\":\"iana\",\"extensions\":[\"nq\"]},\"application/n-triples\":{\"source\":\"iana\",\"extensions\":[\"nt\"]},\"application/nasdata\":{\"source\":\"iana\"},\"application/news-checkgroups\":{\"source\":\"iana\"},\"application/news-groupinfo\":{\"source\":\"iana\"},\"application/news-transmission\":{\"source\":\"iana\"},\"application/nlsml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/node\":{\"source\":\"iana\"},\"application/nss\":{\"source\":\"iana\"},\"application/ocsp-request\":{\"source\":\"iana\"},\"application/ocsp-response\":{\"source\":\"iana\"},\"application/octet-stream\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"bin\",\"dms\",\"lrf\",\"mar\",\"so\",\"dist\",\"distz\",\"pkg\",\"bpk\",\"dump\",\"elc\",\"deploy\",\"exe\",\"dll\",\"deb\",\"dmg\",\"iso\",\"img\",\"msi\",\"msp\",\"msm\",\"buffer\"]},\"application/oda\":{\"source\":\"iana\",\"extensions\":[\"oda\"]},\"application/odm+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/odx\":{\"source\":\"iana\"},\"application/oebps-package+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"opf\"]},\"application/ogg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"ogx\"]},\"application/omdoc+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"omdoc\"]},\"application/onenote\":{\"source\":\"apache\",\"extensions\":[\"onetoc\",\"onetoc2\",\"onetmp\",\"onepkg\"]},\"application/oscore\":{\"source\":\"iana\"},\"application/oxps\":{\"source\":\"iana\",\"extensions\":[\"oxps\"]},\"application/p2p-overlay+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/parityfec\":{\"source\":\"iana\"},\"application/passport\":{\"source\":\"iana\"},\"application/patch-ops-error+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xer\"]},\"application/pdf\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"pdf\"]},\"application/pdx\":{\"source\":\"iana\"},\"application/pem-certificate-chain\":{\"source\":\"iana\"},\"application/pgp-encrypted\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"pgp\"]},\"application/pgp-keys\":{\"source\":\"iana\"},\"application/pgp-signature\":{\"source\":\"iana\",\"extensions\":[\"asc\",\"sig\"]},\"application/pics-rules\":{\"source\":\"apache\",\"extensions\":[\"prf\"]},\"application/pidf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/pidf-diff+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/pkcs10\":{\"source\":\"iana\",\"extensions\":[\"p10\"]},\"application/pkcs12\":{\"source\":\"iana\"},\"application/pkcs7-mime\":{\"source\":\"iana\",\"extensions\":[\"p7m\",\"p7c\"]},\"application/pkcs7-signature\":{\"source\":\"iana\",\"extensions\":[\"p7s\"]},\"application/pkcs8\":{\"source\":\"iana\",\"extensions\":[\"p8\"]},\"application/pkcs8-encrypted\":{\"source\":\"iana\"},\"application/pkix-attr-cert\":{\"source\":\"iana\",\"extensions\":[\"ac\"]},\"application/pkix-cert\":{\"source\":\"iana\",\"extensions\":[\"cer\"]},\"application/pkix-crl\":{\"source\":\"iana\",\"extensions\":[\"crl\"]},\"application/pkix-pkipath\":{\"source\":\"iana\",\"extensions\":[\"pkipath\"]},\"application/pkixcmp\":{\"source\":\"iana\",\"extensions\":[\"pki\"]},\"application/pls+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"pls\"]},\"application/poc-settings+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/postscript\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ai\",\"eps\",\"ps\"]},\"application/ppsp-tracker+json\":{\"source\":\"iana\",\"compressible\":true},\"application/problem+json\":{\"source\":\"iana\",\"compressible\":true},\"application/problem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/provenance+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/prs.alvestrand.titrax-sheet\":{\"source\":\"iana\"},\"application/prs.cww\":{\"source\":\"iana\",\"extensions\":[\"cww\"]},\"application/prs.hpub+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/prs.nprend\":{\"source\":\"iana\"},\"application/prs.plucker\":{\"source\":\"iana\"},\"application/prs.rdf-xml-crypt\":{\"source\":\"iana\"},\"application/prs.xsf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/pskc+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"pskcxml\"]},\"application/qsig\":{\"source\":\"iana\"},\"application/raml+yaml\":{\"compressible\":true,\"extensions\":[\"raml\"]},\"application/raptorfec\":{\"source\":\"iana\"},\"application/rdap+json\":{\"source\":\"iana\",\"compressible\":true},\"application/rdf+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rdf\",\"owl\"]},\"application/reginfo+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rif\"]},\"application/relax-ng-compact-syntax\":{\"source\":\"iana\",\"extensions\":[\"rnc\"]},\"application/remote-printing\":{\"source\":\"iana\"},\"application/reputon+json\":{\"source\":\"iana\",\"compressible\":true},\"application/resource-lists+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rl\"]},\"application/resource-lists-diff+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rld\"]},\"application/rfc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/riscos\":{\"source\":\"iana\"},\"application/rlmi+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/rls-services+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rs\"]},\"application/route-apd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/route-s-tsid+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/route-usd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/rpki-ghostbusters\":{\"source\":\"iana\",\"extensions\":[\"gbr\"]},\"application/rpki-manifest\":{\"source\":\"iana\",\"extensions\":[\"mft\"]},\"application/rpki-publication\":{\"source\":\"iana\"},\"application/rpki-roa\":{\"source\":\"iana\",\"extensions\":[\"roa\"]},\"application/rpki-updown\":{\"source\":\"iana\"},\"application/rsd+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"rsd\"]},\"application/rss+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"rss\"]},\"application/rtf\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rtf\"]},\"application/rtploopback\":{\"source\":\"iana\"},\"application/rtx\":{\"source\":\"iana\"},\"application/samlassertion+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/samlmetadata+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/sbml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"sbml\"]},\"application/scaip+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/scim+json\":{\"source\":\"iana\",\"compressible\":true},\"application/scvp-cv-request\":{\"source\":\"iana\",\"extensions\":[\"scq\"]},\"application/scvp-cv-response\":{\"source\":\"iana\",\"extensions\":[\"scs\"]},\"application/scvp-vp-request\":{\"source\":\"iana\",\"extensions\":[\"spq\"]},\"application/scvp-vp-response\":{\"source\":\"iana\",\"extensions\":[\"spp\"]},\"application/sdp\":{\"source\":\"iana\",\"extensions\":[\"sdp\"]},\"application/secevent+jwt\":{\"source\":\"iana\"},\"application/senml+cbor\":{\"source\":\"iana\"},\"application/senml+json\":{\"source\":\"iana\",\"compressible\":true},\"application/senml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/senml-exi\":{\"source\":\"iana\"},\"application/sensml+cbor\":{\"source\":\"iana\"},\"application/sensml+json\":{\"source\":\"iana\",\"compressible\":true},\"application/sensml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/sensml-exi\":{\"source\":\"iana\"},\"application/sep+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/sep-exi\":{\"source\":\"iana\"},\"application/session-info\":{\"source\":\"iana\"},\"application/set-payment\":{\"source\":\"iana\"},\"application/set-payment-initiation\":{\"source\":\"iana\",\"extensions\":[\"setpay\"]},\"application/set-registration\":{\"source\":\"iana\"},\"application/set-registration-initiation\":{\"source\":\"iana\",\"extensions\":[\"setreg\"]},\"application/sgml\":{\"source\":\"iana\"},\"application/sgml-open-catalog\":{\"source\":\"iana\"},\"application/shf+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"shf\"]},\"application/sieve\":{\"source\":\"iana\",\"extensions\":[\"siv\",\"sieve\"]},\"application/simple-filter+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/simple-message-summary\":{\"source\":\"iana\"},\"application/simplesymbolcontainer\":{\"source\":\"iana\"},\"application/sipc\":{\"source\":\"iana\"},\"application/slate\":{\"source\":\"iana\"},\"application/smil\":{\"source\":\"iana\"},\"application/smil+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"smi\",\"smil\"]},\"application/smpte336m\":{\"source\":\"iana\"},\"application/soap+fastinfoset\":{\"source\":\"iana\"},\"application/soap+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/sparql-query\":{\"source\":\"iana\",\"extensions\":[\"rq\"]},\"application/sparql-results+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"srx\"]},\"application/spirits-event+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/sql\":{\"source\":\"iana\"},\"application/srgs\":{\"source\":\"iana\",\"extensions\":[\"gram\"]},\"application/srgs+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"grxml\"]},\"application/sru+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"sru\"]},\"application/ssdl+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"ssdl\"]},\"application/ssml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ssml\"]},\"application/stix+json\":{\"source\":\"iana\",\"compressible\":true},\"application/swid+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/tamp-apex-update\":{\"source\":\"iana\"},\"application/tamp-apex-update-confirm\":{\"source\":\"iana\"},\"application/tamp-community-update\":{\"source\":\"iana\"},\"application/tamp-community-update-confirm\":{\"source\":\"iana\"},\"application/tamp-error\":{\"source\":\"iana\"},\"application/tamp-sequence-adjust\":{\"source\":\"iana\"},\"application/tamp-sequence-adjust-confirm\":{\"source\":\"iana\"},\"application/tamp-status-query\":{\"source\":\"iana\"},\"application/tamp-status-response\":{\"source\":\"iana\"},\"application/tamp-update\":{\"source\":\"iana\"},\"application/tamp-update-confirm\":{\"source\":\"iana\"},\"application/tar\":{\"compressible\":true},\"application/taxii+json\":{\"source\":\"iana\",\"compressible\":true},\"application/tei+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"tei\",\"teicorpus\"]},\"application/tetra_isi\":{\"source\":\"iana\"},\"application/thraud+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"tfi\"]},\"application/timestamp-query\":{\"source\":\"iana\"},\"application/timestamp-reply\":{\"source\":\"iana\"},\"application/timestamped-data\":{\"source\":\"iana\",\"extensions\":[\"tsd\"]},\"application/tlsrpt+gzip\":{\"source\":\"iana\"},\"application/tlsrpt+json\":{\"source\":\"iana\",\"compressible\":true},\"application/tnauthlist\":{\"source\":\"iana\"},\"application/toml\":{\"compressible\":true,\"extensions\":[\"toml\"]},\"application/trickle-ice-sdpfrag\":{\"source\":\"iana\"},\"application/trig\":{\"source\":\"iana\"},\"application/ttml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/tve-trigger\":{\"source\":\"iana\"},\"application/tzif\":{\"source\":\"iana\"},\"application/tzif-leap\":{\"source\":\"iana\"},\"application/ulpfec\":{\"source\":\"iana\"},\"application/urc-grpsheet+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/urc-ressheet+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/urc-targetdesc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/urc-uisocketdesc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vcard+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vcard+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vemmi\":{\"source\":\"iana\"},\"application/vividence.scriptfile\":{\"source\":\"apache\"},\"application/vnd.1000minds.decision-model+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp-prose+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp-prose-pc3ch+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp-v2x-local-service-information\":{\"source\":\"iana\"},\"application/vnd.3gpp.access-transfer-events+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.bsf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.gmop+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mc-signalling-ear\":{\"source\":\"iana\"},\"application/vnd.3gpp.mcdata-affiliation-command+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcdata-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcdata-payload\":{\"source\":\"iana\"},\"application/vnd.3gpp.mcdata-service-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcdata-signalling\":{\"source\":\"iana\"},\"application/vnd.3gpp.mcdata-ue-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcdata-user-profile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-affiliation-command+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-floor-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-location-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-mbms-usage-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-service-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-signed+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-ue-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-ue-init-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-user-profile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-affiliation-command+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-affiliation-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-location-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-mbms-usage-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-service-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-transmission-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-ue-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-user-profile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mid-call+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.pic-bw-large\":{\"source\":\"iana\",\"extensions\":[\"plb\"]},\"application/vnd.3gpp.pic-bw-small\":{\"source\":\"iana\",\"extensions\":[\"psb\"]},\"application/vnd.3gpp.pic-bw-var\":{\"source\":\"iana\",\"extensions\":[\"pvb\"]},\"application/vnd.3gpp.sms\":{\"source\":\"iana\"},\"application/vnd.3gpp.sms+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.srvcc-ext+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.srvcc-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.state-and-event-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.ussd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp2.bcmcsinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp2.sms\":{\"source\":\"iana\"},\"application/vnd.3gpp2.tcap\":{\"source\":\"iana\",\"extensions\":[\"tcap\"]},\"application/vnd.3lightssoftware.imagescal\":{\"source\":\"iana\"},\"application/vnd.3m.post-it-notes\":{\"source\":\"iana\",\"extensions\":[\"pwn\"]},\"application/vnd.accpac.simply.aso\":{\"source\":\"iana\",\"extensions\":[\"aso\"]},\"application/vnd.accpac.simply.imp\":{\"source\":\"iana\",\"extensions\":[\"imp\"]},\"application/vnd.acucobol\":{\"source\":\"iana\",\"extensions\":[\"acu\"]},\"application/vnd.acucorp\":{\"source\":\"iana\",\"extensions\":[\"atc\",\"acutc\"]},\"application/vnd.adobe.air-application-installer-package+zip\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"air\"]},\"application/vnd.adobe.flash.movie\":{\"source\":\"iana\"},\"application/vnd.adobe.formscentral.fcdt\":{\"source\":\"iana\",\"extensions\":[\"fcdt\"]},\"application/vnd.adobe.fxp\":{\"source\":\"iana\",\"extensions\":[\"fxp\",\"fxpl\"]},\"application/vnd.adobe.partial-upload\":{\"source\":\"iana\"},\"application/vnd.adobe.xdp+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xdp\"]},\"application/vnd.adobe.xfdf\":{\"source\":\"iana\",\"extensions\":[\"xfdf\"]},\"application/vnd.aether.imp\":{\"source\":\"iana\"},\"application/vnd.afpc.afplinedata\":{\"source\":\"iana\"},\"application/vnd.afpc.modca\":{\"source\":\"iana\"},\"application/vnd.ah-barcode\":{\"source\":\"iana\"},\"application/vnd.ahead.space\":{\"source\":\"iana\",\"extensions\":[\"ahead\"]},\"application/vnd.airzip.filesecure.azf\":{\"source\":\"iana\",\"extensions\":[\"azf\"]},\"application/vnd.airzip.filesecure.azs\":{\"source\":\"iana\",\"extensions\":[\"azs\"]},\"application/vnd.amadeus+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.amazon.ebook\":{\"source\":\"apache\",\"extensions\":[\"azw\"]},\"application/vnd.amazon.mobi8-ebook\":{\"source\":\"iana\"},\"application/vnd.americandynamics.acc\":{\"source\":\"iana\",\"extensions\":[\"acc\"]},\"application/vnd.amiga.ami\":{\"source\":\"iana\",\"extensions\":[\"ami\"]},\"application/vnd.amundsen.maze+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.android.ota\":{\"source\":\"iana\"},\"application/vnd.android.package-archive\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"apk\"]},\"application/vnd.anki\":{\"source\":\"iana\"},\"application/vnd.anser-web-certificate-issue-initiation\":{\"source\":\"iana\",\"extensions\":[\"cii\"]},\"application/vnd.anser-web-funds-transfer-initiation\":{\"source\":\"apache\",\"extensions\":[\"fti\"]},\"application/vnd.antix.game-component\":{\"source\":\"iana\",\"extensions\":[\"atx\"]},\"application/vnd.apache.thrift.binary\":{\"source\":\"iana\"},\"application/vnd.apache.thrift.compact\":{\"source\":\"iana\"},\"application/vnd.apache.thrift.json\":{\"source\":\"iana\"},\"application/vnd.api+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.apothekende.reservation+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.apple.installer+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mpkg\"]},\"application/vnd.apple.keynote\":{\"source\":\"iana\",\"extensions\":[\"keynote\"]},\"application/vnd.apple.mpegurl\":{\"source\":\"iana\",\"extensions\":[\"m3u8\"]},\"application/vnd.apple.numbers\":{\"source\":\"iana\",\"extensions\":[\"numbers\"]},\"application/vnd.apple.pages\":{\"source\":\"iana\",\"extensions\":[\"pages\"]},\"application/vnd.apple.pkpass\":{\"compressible\":false,\"extensions\":[\"pkpass\"]},\"application/vnd.arastra.swi\":{\"source\":\"iana\"},\"application/vnd.aristanetworks.swi\":{\"source\":\"iana\",\"extensions\":[\"swi\"]},\"application/vnd.artisan+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.artsquare\":{\"source\":\"iana\"},\"application/vnd.astraea-software.iota\":{\"source\":\"iana\",\"extensions\":[\"iota\"]},\"application/vnd.audiograph\":{\"source\":\"iana\",\"extensions\":[\"aep\"]},\"application/vnd.autopackage\":{\"source\":\"iana\"},\"application/vnd.avalon+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.avistar+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.balsamiq.bmml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.balsamiq.bmpr\":{\"source\":\"iana\"},\"application/vnd.banana-accounting\":{\"source\":\"iana\"},\"application/vnd.bbf.usp.error\":{\"source\":\"iana\"},\"application/vnd.bbf.usp.msg\":{\"source\":\"iana\"},\"application/vnd.bbf.usp.msg+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.bekitzur-stech+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.bint.med-content\":{\"source\":\"iana\"},\"application/vnd.biopax.rdf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.blink-idb-value-wrapper\":{\"source\":\"iana\"},\"application/vnd.blueice.multipass\":{\"source\":\"iana\",\"extensions\":[\"mpm\"]},\"application/vnd.bluetooth.ep.oob\":{\"source\":\"iana\"},\"application/vnd.bluetooth.le.oob\":{\"source\":\"iana\"},\"application/vnd.bmi\":{\"source\":\"iana\",\"extensions\":[\"bmi\"]},\"application/vnd.bpf\":{\"source\":\"iana\"},\"application/vnd.bpf3\":{\"source\":\"iana\"},\"application/vnd.businessobjects\":{\"source\":\"iana\",\"extensions\":[\"rep\"]},\"application/vnd.byu.uapi+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.cab-jscript\":{\"source\":\"iana\"},\"application/vnd.canon-cpdl\":{\"source\":\"iana\"},\"application/vnd.canon-lips\":{\"source\":\"iana\"},\"application/vnd.capasystems-pg+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.cendio.thinlinc.clientconf\":{\"source\":\"iana\"},\"application/vnd.century-systems.tcp_stream\":{\"source\":\"iana\"},\"application/vnd.chemdraw+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"cdxml\"]},\"application/vnd.chess-pgn\":{\"source\":\"iana\"},\"application/vnd.chipnuts.karaoke-mmd\":{\"source\":\"iana\",\"extensions\":[\"mmd\"]},\"application/vnd.ciedi\":{\"source\":\"iana\"},\"application/vnd.cinderella\":{\"source\":\"iana\",\"extensions\":[\"cdy\"]},\"application/vnd.cirpack.isdn-ext\":{\"source\":\"iana\"},\"application/vnd.citationstyles.style+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"csl\"]},\"application/vnd.claymore\":{\"source\":\"iana\",\"extensions\":[\"cla\"]},\"application/vnd.cloanto.rp9\":{\"source\":\"iana\",\"extensions\":[\"rp9\"]},\"application/vnd.clonk.c4group\":{\"source\":\"iana\",\"extensions\":[\"c4g\",\"c4d\",\"c4f\",\"c4p\",\"c4u\"]},\"application/vnd.cluetrust.cartomobile-config\":{\"source\":\"iana\",\"extensions\":[\"c11amc\"]},\"application/vnd.cluetrust.cartomobile-config-pkg\":{\"source\":\"iana\",\"extensions\":[\"c11amz\"]},\"application/vnd.coffeescript\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.document\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.document-template\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.presentation\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.presentation-template\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.spreadsheet\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.spreadsheet-template\":{\"source\":\"iana\"},\"application/vnd.collection+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.collection.doc+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.collection.next+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.comicbook+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.comicbook-rar\":{\"source\":\"iana\"},\"application/vnd.commerce-battelle\":{\"source\":\"iana\"},\"application/vnd.commonspace\":{\"source\":\"iana\",\"extensions\":[\"csp\"]},\"application/vnd.contact.cmsg\":{\"source\":\"iana\",\"extensions\":[\"cdbcmsg\"]},\"application/vnd.coreos.ignition+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.cosmocaller\":{\"source\":\"iana\",\"extensions\":[\"cmc\"]},\"application/vnd.crick.clicker\":{\"source\":\"iana\",\"extensions\":[\"clkx\"]},\"application/vnd.crick.clicker.keyboard\":{\"source\":\"iana\",\"extensions\":[\"clkk\"]},\"application/vnd.crick.clicker.palette\":{\"source\":\"iana\",\"extensions\":[\"clkp\"]},\"application/vnd.crick.clicker.template\":{\"source\":\"iana\",\"extensions\":[\"clkt\"]},\"application/vnd.crick.clicker.wordbank\":{\"source\":\"iana\",\"extensions\":[\"clkw\"]},\"application/vnd.criticaltools.wbs+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"wbs\"]},\"application/vnd.cryptii.pipe+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.crypto-shade-file\":{\"source\":\"iana\"},\"application/vnd.ctc-posml\":{\"source\":\"iana\",\"extensions\":[\"pml\"]},\"application/vnd.ctct.ws+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.cups-pdf\":{\"source\":\"iana\"},\"application/vnd.cups-postscript\":{\"source\":\"iana\"},\"application/vnd.cups-ppd\":{\"source\":\"iana\",\"extensions\":[\"ppd\"]},\"application/vnd.cups-raster\":{\"source\":\"iana\"},\"application/vnd.cups-raw\":{\"source\":\"iana\"},\"application/vnd.curl\":{\"source\":\"iana\"},\"application/vnd.curl.car\":{\"source\":\"apache\",\"extensions\":[\"car\"]},\"application/vnd.curl.pcurl\":{\"source\":\"apache\",\"extensions\":[\"pcurl\"]},\"application/vnd.cyan.dean.root+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.cybank\":{\"source\":\"iana\"},\"application/vnd.d2l.coursepackage1p0+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.dart\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"dart\"]},\"application/vnd.data-vision.rdz\":{\"source\":\"iana\",\"extensions\":[\"rdz\"]},\"application/vnd.datapackage+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dataresource+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.debian.binary-package\":{\"source\":\"iana\"},\"application/vnd.dece.data\":{\"source\":\"iana\",\"extensions\":[\"uvf\",\"uvvf\",\"uvd\",\"uvvd\"]},\"application/vnd.dece.ttml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"uvt\",\"uvvt\"]},\"application/vnd.dece.unspecified\":{\"source\":\"iana\",\"extensions\":[\"uvx\",\"uvvx\"]},\"application/vnd.dece.zip\":{\"source\":\"iana\",\"extensions\":[\"uvz\",\"uvvz\"]},\"application/vnd.denovo.fcselayout-link\":{\"source\":\"iana\",\"extensions\":[\"fe_launch\"]},\"application/vnd.desmume.movie\":{\"source\":\"iana\"},\"application/vnd.dir-bi.plate-dl-nosuffix\":{\"source\":\"iana\"},\"application/vnd.dm.delegation+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dna\":{\"source\":\"iana\",\"extensions\":[\"dna\"]},\"application/vnd.document+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dolby.mlp\":{\"source\":\"apache\",\"extensions\":[\"mlp\"]},\"application/vnd.dolby.mobile.1\":{\"source\":\"iana\"},\"application/vnd.dolby.mobile.2\":{\"source\":\"iana\"},\"application/vnd.doremir.scorecloud-binary-document\":{\"source\":\"iana\"},\"application/vnd.dpgraph\":{\"source\":\"iana\",\"extensions\":[\"dpg\"]},\"application/vnd.dreamfactory\":{\"source\":\"iana\",\"extensions\":[\"dfac\"]},\"application/vnd.drive+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ds-keypoint\":{\"source\":\"apache\",\"extensions\":[\"kpxx\"]},\"application/vnd.dtg.local\":{\"source\":\"iana\"},\"application/vnd.dtg.local.flash\":{\"source\":\"iana\"},\"application/vnd.dtg.local.html\":{\"source\":\"iana\"},\"application/vnd.dvb.ait\":{\"source\":\"iana\",\"extensions\":[\"ait\"]},\"application/vnd.dvb.dvbj\":{\"source\":\"iana\"},\"application/vnd.dvb.esgcontainer\":{\"source\":\"iana\"},\"application/vnd.dvb.ipdcdftnotifaccess\":{\"source\":\"iana\"},\"application/vnd.dvb.ipdcesgaccess\":{\"source\":\"iana\"},\"application/vnd.dvb.ipdcesgaccess2\":{\"source\":\"iana\"},\"application/vnd.dvb.ipdcesgpdd\":{\"source\":\"iana\"},\"application/vnd.dvb.ipdcroaming\":{\"source\":\"iana\"},\"application/vnd.dvb.iptv.alfec-base\":{\"source\":\"iana\"},\"application/vnd.dvb.iptv.alfec-enhancement\":{\"source\":\"iana\"},\"application/vnd.dvb.notif-aggregate-root+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-container+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-generic+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-ia-msglist+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-ia-registration-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-ia-registration-response+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-init+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.pfr\":{\"source\":\"iana\"},\"application/vnd.dvb.service\":{\"source\":\"iana\",\"extensions\":[\"svc\"]},\"application/vnd.dxr\":{\"source\":\"iana\"},\"application/vnd.dynageo\":{\"source\":\"iana\",\"extensions\":[\"geo\"]},\"application/vnd.dzr\":{\"source\":\"iana\"},\"application/vnd.easykaraoke.cdgdownload\":{\"source\":\"iana\"},\"application/vnd.ecdis-update\":{\"source\":\"iana\"},\"application/vnd.ecip.rlp\":{\"source\":\"iana\"},\"application/vnd.ecowin.chart\":{\"source\":\"iana\",\"extensions\":[\"mag\"]},\"application/vnd.ecowin.filerequest\":{\"source\":\"iana\"},\"application/vnd.ecowin.fileupdate\":{\"source\":\"iana\"},\"application/vnd.ecowin.series\":{\"source\":\"iana\"},\"application/vnd.ecowin.seriesrequest\":{\"source\":\"iana\"},\"application/vnd.ecowin.seriesupdate\":{\"source\":\"iana\"},\"application/vnd.efi.img\":{\"source\":\"iana\"},\"application/vnd.efi.iso\":{\"source\":\"iana\"},\"application/vnd.emclient.accessrequest+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.enliven\":{\"source\":\"iana\",\"extensions\":[\"nml\"]},\"application/vnd.enphase.envoy\":{\"source\":\"iana\"},\"application/vnd.eprints.data+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.epson.esf\":{\"source\":\"iana\",\"extensions\":[\"esf\"]},\"application/vnd.epson.msf\":{\"source\":\"iana\",\"extensions\":[\"msf\"]},\"application/vnd.epson.quickanime\":{\"source\":\"iana\",\"extensions\":[\"qam\"]},\"application/vnd.epson.salt\":{\"source\":\"iana\",\"extensions\":[\"slt\"]},\"application/vnd.epson.ssf\":{\"source\":\"iana\",\"extensions\":[\"ssf\"]},\"application/vnd.ericsson.quickcall\":{\"source\":\"iana\"},\"application/vnd.espass-espass+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.eszigno3+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"es3\",\"et3\"]},\"application/vnd.etsi.aoc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.asic-e+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.etsi.asic-s+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.etsi.cug+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvcommand+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvdiscovery+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvprofile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvsad-bc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvsad-cod+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvsad-npvr+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvservice+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvsync+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvueprofile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.mcid+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.mheg5\":{\"source\":\"iana\"},\"application/vnd.etsi.overload-control-policy-dataset+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.pstn+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.sci+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.simservs+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.timestamp-token\":{\"source\":\"iana\"},\"application/vnd.etsi.tsl+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.tsl.der\":{\"source\":\"iana\"},\"application/vnd.eudora.data\":{\"source\":\"iana\"},\"application/vnd.evolv.ecig.profile\":{\"source\":\"iana\"},\"application/vnd.evolv.ecig.settings\":{\"source\":\"iana\"},\"application/vnd.evolv.ecig.theme\":{\"source\":\"iana\"},\"application/vnd.exstream-empower+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.exstream-package\":{\"source\":\"iana\"},\"application/vnd.ezpix-album\":{\"source\":\"iana\",\"extensions\":[\"ez2\"]},\"application/vnd.ezpix-package\":{\"source\":\"iana\",\"extensions\":[\"ez3\"]},\"application/vnd.f-secure.mobile\":{\"source\":\"iana\"},\"application/vnd.fastcopy-disk-image\":{\"source\":\"iana\"},\"application/vnd.fdf\":{\"source\":\"iana\",\"extensions\":[\"fdf\"]},\"application/vnd.fdsn.mseed\":{\"source\":\"iana\",\"extensions\":[\"mseed\"]},\"application/vnd.fdsn.seed\":{\"source\":\"iana\",\"extensions\":[\"seed\",\"dataless\"]},\"application/vnd.ffsns\":{\"source\":\"iana\"},\"application/vnd.ficlab.flb+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.filmit.zfc\":{\"source\":\"iana\"},\"application/vnd.fints\":{\"source\":\"iana\"},\"application/vnd.firemonkeys.cloudcell\":{\"source\":\"iana\"},\"application/vnd.flographit\":{\"source\":\"iana\",\"extensions\":[\"gph\"]},\"application/vnd.fluxtime.clip\":{\"source\":\"iana\",\"extensions\":[\"ftc\"]},\"application/vnd.font-fontforge-sfd\":{\"source\":\"iana\"},\"application/vnd.framemaker\":{\"source\":\"iana\",\"extensions\":[\"fm\",\"frame\",\"maker\",\"book\"]},\"application/vnd.frogans.fnc\":{\"source\":\"iana\",\"extensions\":[\"fnc\"]},\"application/vnd.frogans.ltf\":{\"source\":\"iana\",\"extensions\":[\"ltf\"]},\"application/vnd.fsc.weblaunch\":{\"source\":\"iana\",\"extensions\":[\"fsc\"]},\"application/vnd.fujitsu.oasys\":{\"source\":\"iana\",\"extensions\":[\"oas\"]},\"application/vnd.fujitsu.oasys2\":{\"source\":\"iana\",\"extensions\":[\"oa2\"]},\"application/vnd.fujitsu.oasys3\":{\"source\":\"iana\",\"extensions\":[\"oa3\"]},\"application/vnd.fujitsu.oasysgp\":{\"source\":\"iana\",\"extensions\":[\"fg5\"]},\"application/vnd.fujitsu.oasysprs\":{\"source\":\"iana\",\"extensions\":[\"bh2\"]},\"application/vnd.fujixerox.art-ex\":{\"source\":\"iana\"},\"application/vnd.fujixerox.art4\":{\"source\":\"iana\"},\"application/vnd.fujixerox.ddd\":{\"source\":\"iana\",\"extensions\":[\"ddd\"]},\"application/vnd.fujixerox.docuworks\":{\"source\":\"iana\",\"extensions\":[\"xdw\"]},\"application/vnd.fujixerox.docuworks.binder\":{\"source\":\"iana\",\"extensions\":[\"xbd\"]},\"application/vnd.fujixerox.docuworks.container\":{\"source\":\"iana\"},\"application/vnd.fujixerox.hbpl\":{\"source\":\"iana\"},\"application/vnd.fut-misnet\":{\"source\":\"iana\"},\"application/vnd.futoin+cbor\":{\"source\":\"iana\"},\"application/vnd.futoin+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.fuzzysheet\":{\"source\":\"iana\",\"extensions\":[\"fzs\"]},\"application/vnd.genomatix.tuxedo\":{\"source\":\"iana\",\"extensions\":[\"txd\"]},\"application/vnd.geo+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.geocube+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.geogebra.file\":{\"source\":\"iana\",\"extensions\":[\"ggb\"]},\"application/vnd.geogebra.tool\":{\"source\":\"iana\",\"extensions\":[\"ggt\"]},\"application/vnd.geometry-explorer\":{\"source\":\"iana\",\"extensions\":[\"gex\",\"gre\"]},\"application/vnd.geonext\":{\"source\":\"iana\",\"extensions\":[\"gxt\"]},\"application/vnd.geoplan\":{\"source\":\"iana\",\"extensions\":[\"g2w\"]},\"application/vnd.geospace\":{\"source\":\"iana\",\"extensions\":[\"g3w\"]},\"application/vnd.gerber\":{\"source\":\"iana\"},\"application/vnd.globalplatform.card-content-mgt\":{\"source\":\"iana\"},\"application/vnd.globalplatform.card-content-mgt-response\":{\"source\":\"iana\"},\"application/vnd.gmx\":{\"source\":\"iana\",\"extensions\":[\"gmx\"]},\"application/vnd.google-apps.document\":{\"compressible\":false,\"extensions\":[\"gdoc\"]},\"application/vnd.google-apps.presentation\":{\"compressible\":false,\"extensions\":[\"gslides\"]},\"application/vnd.google-apps.spreadsheet\":{\"compressible\":false,\"extensions\":[\"gsheet\"]},\"application/vnd.google-earth.kml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"kml\"]},\"application/vnd.google-earth.kmz\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"kmz\"]},\"application/vnd.gov.sk.e-form+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.gov.sk.e-form+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.gov.sk.xmldatacontainer+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.grafeq\":{\"source\":\"iana\",\"extensions\":[\"gqf\",\"gqs\"]},\"application/vnd.gridmp\":{\"source\":\"iana\"},\"application/vnd.groove-account\":{\"source\":\"iana\",\"extensions\":[\"gac\"]},\"application/vnd.groove-help\":{\"source\":\"iana\",\"extensions\":[\"ghf\"]},\"application/vnd.groove-identity-message\":{\"source\":\"iana\",\"extensions\":[\"gim\"]},\"application/vnd.groove-injector\":{\"source\":\"iana\",\"extensions\":[\"grv\"]},\"application/vnd.groove-tool-message\":{\"source\":\"iana\",\"extensions\":[\"gtm\"]},\"application/vnd.groove-tool-template\":{\"source\":\"iana\",\"extensions\":[\"tpl\"]},\"application/vnd.groove-vcard\":{\"source\":\"iana\",\"extensions\":[\"vcg\"]},\"application/vnd.hal+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hal+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"hal\"]},\"application/vnd.handheld-entertainment+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"zmm\"]},\"application/vnd.hbci\":{\"source\":\"iana\",\"extensions\":[\"hbci\"]},\"application/vnd.hc+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hcl-bireports\":{\"source\":\"iana\"},\"application/vnd.hdt\":{\"source\":\"iana\"},\"application/vnd.heroku+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hhe.lesson-player\":{\"source\":\"iana\",\"extensions\":[\"les\"]},\"application/vnd.hp-hpgl\":{\"source\":\"iana\",\"extensions\":[\"hpgl\"]},\"application/vnd.hp-hpid\":{\"source\":\"iana\",\"extensions\":[\"hpid\"]},\"application/vnd.hp-hps\":{\"source\":\"iana\",\"extensions\":[\"hps\"]},\"application/vnd.hp-jlyt\":{\"source\":\"iana\",\"extensions\":[\"jlt\"]},\"application/vnd.hp-pcl\":{\"source\":\"iana\",\"extensions\":[\"pcl\"]},\"application/vnd.hp-pclxl\":{\"source\":\"iana\",\"extensions\":[\"pclxl\"]},\"application/vnd.httphone\":{\"source\":\"iana\"},\"application/vnd.hydrostatix.sof-data\":{\"source\":\"iana\",\"extensions\":[\"sfd-hdstx\"]},\"application/vnd.hyper+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hyper-item+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hyperdrive+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hzn-3d-crossword\":{\"source\":\"iana\"},\"application/vnd.ibm.afplinedata\":{\"source\":\"iana\"},\"application/vnd.ibm.electronic-media\":{\"source\":\"iana\"},\"application/vnd.ibm.minipay\":{\"source\":\"iana\",\"extensions\":[\"mpy\"]},\"application/vnd.ibm.modcap\":{\"source\":\"iana\",\"extensions\":[\"afp\",\"listafp\",\"list3820\"]},\"application/vnd.ibm.rights-management\":{\"source\":\"iana\",\"extensions\":[\"irm\"]},\"application/vnd.ibm.secure-container\":{\"source\":\"iana\",\"extensions\":[\"sc\"]},\"application/vnd.iccprofile\":{\"source\":\"iana\",\"extensions\":[\"icc\",\"icm\"]},\"application/vnd.ieee.1905\":{\"source\":\"iana\"},\"application/vnd.igloader\":{\"source\":\"iana\",\"extensions\":[\"igl\"]},\"application/vnd.imagemeter.folder+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.imagemeter.image+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.immervision-ivp\":{\"source\":\"iana\",\"extensions\":[\"ivp\"]},\"application/vnd.immervision-ivu\":{\"source\":\"iana\",\"extensions\":[\"ivu\"]},\"application/vnd.ims.imsccv1p1\":{\"source\":\"iana\"},\"application/vnd.ims.imsccv1p2\":{\"source\":\"iana\"},\"application/vnd.ims.imsccv1p3\":{\"source\":\"iana\"},\"application/vnd.ims.lis.v2.result+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ims.lti.v2.toolconsumerprofile+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ims.lti.v2.toolproxy+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ims.lti.v2.toolproxy.id+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ims.lti.v2.toolsettings+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ims.lti.v2.toolsettings.simple+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.informedcontrol.rms+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.informix-visionary\":{\"source\":\"iana\"},\"application/vnd.infotech.project\":{\"source\":\"iana\"},\"application/vnd.infotech.project+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.innopath.wamp.notification\":{\"source\":\"iana\"},\"application/vnd.insors.igm\":{\"source\":\"iana\",\"extensions\":[\"igm\"]},\"application/vnd.intercon.formnet\":{\"source\":\"iana\",\"extensions\":[\"xpw\",\"xpx\"]},\"application/vnd.intergeo\":{\"source\":\"iana\",\"extensions\":[\"i2g\"]},\"application/vnd.intertrust.digibox\":{\"source\":\"iana\"},\"application/vnd.intertrust.nncp\":{\"source\":\"iana\"},\"application/vnd.intu.qbo\":{\"source\":\"iana\",\"extensions\":[\"qbo\"]},\"application/vnd.intu.qfx\":{\"source\":\"iana\",\"extensions\":[\"qfx\"]},\"application/vnd.iptc.g2.catalogitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.conceptitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.knowledgeitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.newsitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.newsmessage+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.packageitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.planningitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ipunplugged.rcprofile\":{\"source\":\"iana\",\"extensions\":[\"rcprofile\"]},\"application/vnd.irepository.package+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"irp\"]},\"application/vnd.is-xpr\":{\"source\":\"iana\",\"extensions\":[\"xpr\"]},\"application/vnd.isac.fcs\":{\"source\":\"iana\",\"extensions\":[\"fcs\"]},\"application/vnd.iso11783-10+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.jam\":{\"source\":\"iana\",\"extensions\":[\"jam\"]},\"application/vnd.japannet-directory-service\":{\"source\":\"iana\"},\"application/vnd.japannet-jpnstore-wakeup\":{\"source\":\"iana\"},\"application/vnd.japannet-payment-wakeup\":{\"source\":\"iana\"},\"application/vnd.japannet-registration\":{\"source\":\"iana\"},\"application/vnd.japannet-registration-wakeup\":{\"source\":\"iana\"},\"application/vnd.japannet-setstore-wakeup\":{\"source\":\"iana\"},\"application/vnd.japannet-verification\":{\"source\":\"iana\"},\"application/vnd.japannet-verification-wakeup\":{\"source\":\"iana\"},\"application/vnd.jcp.javame.midlet-rms\":{\"source\":\"iana\",\"extensions\":[\"rms\"]},\"application/vnd.jisp\":{\"source\":\"iana\",\"extensions\":[\"jisp\"]},\"application/vnd.joost.joda-archive\":{\"source\":\"iana\",\"extensions\":[\"joda\"]},\"application/vnd.jsk.isdn-ngn\":{\"source\":\"iana\"},\"application/vnd.kahootz\":{\"source\":\"iana\",\"extensions\":[\"ktz\",\"ktr\"]},\"application/vnd.kde.karbon\":{\"source\":\"iana\",\"extensions\":[\"karbon\"]},\"application/vnd.kde.kchart\":{\"source\":\"iana\",\"extensions\":[\"chrt\"]},\"application/vnd.kde.kformula\":{\"source\":\"iana\",\"extensions\":[\"kfo\"]},\"application/vnd.kde.kivio\":{\"source\":\"iana\",\"extensions\":[\"flw\"]},\"application/vnd.kde.kontour\":{\"source\":\"iana\",\"extensions\":[\"kon\"]},\"application/vnd.kde.kpresenter\":{\"source\":\"iana\",\"extensions\":[\"kpr\",\"kpt\"]},\"application/vnd.kde.kspread\":{\"source\":\"iana\",\"extensions\":[\"ksp\"]},\"application/vnd.kde.kword\":{\"source\":\"iana\",\"extensions\":[\"kwd\",\"kwt\"]},\"application/vnd.kenameaapp\":{\"source\":\"iana\",\"extensions\":[\"htke\"]},\"application/vnd.kidspiration\":{\"source\":\"iana\",\"extensions\":[\"kia\"]},\"application/vnd.kinar\":{\"source\":\"iana\",\"extensions\":[\"kne\",\"knp\"]},\"application/vnd.koan\":{\"source\":\"iana\",\"extensions\":[\"skp\",\"skd\",\"skt\",\"skm\"]},\"application/vnd.kodak-descriptor\":{\"source\":\"iana\",\"extensions\":[\"sse\"]},\"application/vnd.las\":{\"source\":\"iana\"},\"application/vnd.las.las+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.las.las+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"lasxml\"]},\"application/vnd.laszip\":{\"source\":\"iana\"},\"application/vnd.leap+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.liberty-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.llamagraphics.life-balance.desktop\":{\"source\":\"iana\",\"extensions\":[\"lbd\"]},\"application/vnd.llamagraphics.life-balance.exchange+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"lbe\"]},\"application/vnd.logipipe.circuit+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.loom\":{\"source\":\"iana\"},\"application/vnd.lotus-1-2-3\":{\"source\":\"iana\",\"extensions\":[\"123\"]},\"application/vnd.lotus-approach\":{\"source\":\"iana\",\"extensions\":[\"apr\"]},\"application/vnd.lotus-freelance\":{\"source\":\"iana\",\"extensions\":[\"pre\"]},\"application/vnd.lotus-notes\":{\"source\":\"iana\",\"extensions\":[\"nsf\"]},\"application/vnd.lotus-organizer\":{\"source\":\"iana\",\"extensions\":[\"org\"]},\"application/vnd.lotus-screencam\":{\"source\":\"iana\",\"extensions\":[\"scm\"]},\"application/vnd.lotus-wordpro\":{\"source\":\"iana\",\"extensions\":[\"lwp\"]},\"application/vnd.macports.portpkg\":{\"source\":\"iana\",\"extensions\":[\"portpkg\"]},\"application/vnd.mapbox-vector-tile\":{\"source\":\"iana\"},\"application/vnd.marlin.drm.actiontoken+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.marlin.drm.conftoken+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.marlin.drm.license+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.marlin.drm.mdcf\":{\"source\":\"iana\"},\"application/vnd.mason+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.maxmind.maxmind-db\":{\"source\":\"iana\"},\"application/vnd.mcd\":{\"source\":\"iana\",\"extensions\":[\"mcd\"]},\"application/vnd.medcalcdata\":{\"source\":\"iana\",\"extensions\":[\"mc1\"]},\"application/vnd.mediastation.cdkey\":{\"source\":\"iana\",\"extensions\":[\"cdkey\"]},\"application/vnd.meridian-slingshot\":{\"source\":\"iana\"},\"application/vnd.mfer\":{\"source\":\"iana\",\"extensions\":[\"mwf\"]},\"application/vnd.mfmp\":{\"source\":\"iana\",\"extensions\":[\"mfm\"]},\"application/vnd.micro+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.micrografx.flo\":{\"source\":\"iana\",\"extensions\":[\"flo\"]},\"application/vnd.micrografx.igx\":{\"source\":\"iana\",\"extensions\":[\"igx\"]},\"application/vnd.microsoft.portable-executable\":{\"source\":\"iana\"},\"application/vnd.microsoft.windows.thumbnail-cache\":{\"source\":\"iana\"},\"application/vnd.miele+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.mif\":{\"source\":\"iana\",\"extensions\":[\"mif\"]},\"application/vnd.minisoft-hp3000-save\":{\"source\":\"iana\"},\"application/vnd.mitsubishi.misty-guard.trustweb\":{\"source\":\"iana\"},\"application/vnd.mobius.daf\":{\"source\":\"iana\",\"extensions\":[\"daf\"]},\"application/vnd.mobius.dis\":{\"source\":\"iana\",\"extensions\":[\"dis\"]},\"application/vnd.mobius.mbk\":{\"source\":\"iana\",\"extensions\":[\"mbk\"]},\"application/vnd.mobius.mqy\":{\"source\":\"iana\",\"extensions\":[\"mqy\"]},\"application/vnd.mobius.msl\":{\"source\":\"iana\",\"extensions\":[\"msl\"]},\"application/vnd.mobius.plc\":{\"source\":\"iana\",\"extensions\":[\"plc\"]},\"application/vnd.mobius.txf\":{\"source\":\"iana\",\"extensions\":[\"txf\"]},\"application/vnd.mophun.application\":{\"source\":\"iana\",\"extensions\":[\"mpn\"]},\"application/vnd.mophun.certificate\":{\"source\":\"iana\",\"extensions\":[\"mpc\"]},\"application/vnd.motorola.flexsuite\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.adsi\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.fis\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.gotap\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.kmr\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.ttc\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.wem\":{\"source\":\"iana\"},\"application/vnd.motorola.iprm\":{\"source\":\"iana\"},\"application/vnd.mozilla.xul+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xul\"]},\"application/vnd.ms-3mfdocument\":{\"source\":\"iana\"},\"application/vnd.ms-artgalry\":{\"source\":\"iana\",\"extensions\":[\"cil\"]},\"application/vnd.ms-asf\":{\"source\":\"iana\"},\"application/vnd.ms-cab-compressed\":{\"source\":\"iana\",\"extensions\":[\"cab\"]},\"application/vnd.ms-color.iccprofile\":{\"source\":\"apache\"},\"application/vnd.ms-excel\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"xls\",\"xlm\",\"xla\",\"xlc\",\"xlt\",\"xlw\"]},\"application/vnd.ms-excel.addin.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"xlam\"]},\"application/vnd.ms-excel.sheet.binary.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"xlsb\"]},\"application/vnd.ms-excel.sheet.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"xlsm\"]},\"application/vnd.ms-excel.template.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"xltm\"]},\"application/vnd.ms-fontobject\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"eot\"]},\"application/vnd.ms-htmlhelp\":{\"source\":\"iana\",\"extensions\":[\"chm\"]},\"application/vnd.ms-ims\":{\"source\":\"iana\",\"extensions\":[\"ims\"]},\"application/vnd.ms-lrm\":{\"source\":\"iana\",\"extensions\":[\"lrm\"]},\"application/vnd.ms-office.activex+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ms-officetheme\":{\"source\":\"iana\",\"extensions\":[\"thmx\"]},\"application/vnd.ms-opentype\":{\"source\":\"apache\",\"compressible\":true},\"application/vnd.ms-outlook\":{\"compressible\":false,\"extensions\":[\"msg\"]},\"application/vnd.ms-package.obfuscated-opentype\":{\"source\":\"apache\"},\"application/vnd.ms-pki.seccat\":{\"source\":\"apache\",\"extensions\":[\"cat\"]},\"application/vnd.ms-pki.stl\":{\"source\":\"apache\",\"extensions\":[\"stl\"]},\"application/vnd.ms-playready.initiator+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ms-powerpoint\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"ppt\",\"pps\",\"pot\"]},\"application/vnd.ms-powerpoint.addin.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"ppam\"]},\"application/vnd.ms-powerpoint.presentation.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"pptm\"]},\"application/vnd.ms-powerpoint.slide.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"sldm\"]},\"application/vnd.ms-powerpoint.slideshow.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"ppsm\"]},\"application/vnd.ms-powerpoint.template.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"potm\"]},\"application/vnd.ms-printdevicecapabilities+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ms-printing.printticket+xml\":{\"source\":\"apache\",\"compressible\":true},\"application/vnd.ms-printschematicket+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ms-project\":{\"source\":\"iana\",\"extensions\":[\"mpp\",\"mpt\"]},\"application/vnd.ms-tnef\":{\"source\":\"iana\"},\"application/vnd.ms-windows.devicepairing\":{\"source\":\"iana\"},\"application/vnd.ms-windows.nwprinting.oob\":{\"source\":\"iana\"},\"application/vnd.ms-windows.printerpairing\":{\"source\":\"iana\"},\"application/vnd.ms-windows.wsd.oob\":{\"source\":\"iana\"},\"application/vnd.ms-wmdrm.lic-chlg-req\":{\"source\":\"iana\"},\"application/vnd.ms-wmdrm.lic-resp\":{\"source\":\"iana\"},\"application/vnd.ms-wmdrm.meter-chlg-req\":{\"source\":\"iana\"},\"application/vnd.ms-wmdrm.meter-resp\":{\"source\":\"iana\"},\"application/vnd.ms-word.document.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"docm\"]},\"application/vnd.ms-word.template.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"dotm\"]},\"application/vnd.ms-works\":{\"source\":\"iana\",\"extensions\":[\"wps\",\"wks\",\"wcm\",\"wdb\"]},\"application/vnd.ms-wpl\":{\"source\":\"iana\",\"extensions\":[\"wpl\"]},\"application/vnd.ms-xpsdocument\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"xps\"]},\"application/vnd.msa-disk-image\":{\"source\":\"iana\"},\"application/vnd.mseq\":{\"source\":\"iana\",\"extensions\":[\"mseq\"]},\"application/vnd.msign\":{\"source\":\"iana\"},\"application/vnd.multiad.creator\":{\"source\":\"iana\"},\"application/vnd.multiad.creator.cif\":{\"source\":\"iana\"},\"application/vnd.music-niff\":{\"source\":\"iana\"},\"application/vnd.musician\":{\"source\":\"iana\",\"extensions\":[\"mus\"]},\"application/vnd.muvee.style\":{\"source\":\"iana\",\"extensions\":[\"msty\"]},\"application/vnd.mynfc\":{\"source\":\"iana\",\"extensions\":[\"taglet\"]},\"application/vnd.ncd.control\":{\"source\":\"iana\"},\"application/vnd.ncd.reference\":{\"source\":\"iana\"},\"application/vnd.nearst.inv+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nervana\":{\"source\":\"iana\"},\"application/vnd.netfpx\":{\"source\":\"iana\"},\"application/vnd.neurolanguage.nlu\":{\"source\":\"iana\",\"extensions\":[\"nlu\"]},\"application/vnd.nimn\":{\"source\":\"iana\"},\"application/vnd.nintendo.nitro.rom\":{\"source\":\"iana\"},\"application/vnd.nintendo.snes.rom\":{\"source\":\"iana\"},\"application/vnd.nitf\":{\"source\":\"iana\",\"extensions\":[\"ntf\",\"nitf\"]},\"application/vnd.noblenet-directory\":{\"source\":\"iana\",\"extensions\":[\"nnd\"]},\"application/vnd.noblenet-sealer\":{\"source\":\"iana\",\"extensions\":[\"nns\"]},\"application/vnd.noblenet-web\":{\"source\":\"iana\",\"extensions\":[\"nnw\"]},\"application/vnd.nokia.catalogs\":{\"source\":\"iana\"},\"application/vnd.nokia.conml+wbxml\":{\"source\":\"iana\"},\"application/vnd.nokia.conml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.iptv.config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.isds-radio-presets\":{\"source\":\"iana\"},\"application/vnd.nokia.landmark+wbxml\":{\"source\":\"iana\"},\"application/vnd.nokia.landmark+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.landmarkcollection+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.n-gage.ac+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.n-gage.data\":{\"source\":\"iana\",\"extensions\":[\"ngdat\"]},\"application/vnd.nokia.n-gage.symbian.install\":{\"source\":\"iana\",\"extensions\":[\"n-gage\"]},\"application/vnd.nokia.ncd\":{\"source\":\"iana\"},\"application/vnd.nokia.pcd+wbxml\":{\"source\":\"iana\"},\"application/vnd.nokia.pcd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.radio-preset\":{\"source\":\"iana\",\"extensions\":[\"rpst\"]},\"application/vnd.nokia.radio-presets\":{\"source\":\"iana\",\"extensions\":[\"rpss\"]},\"application/vnd.novadigm.edm\":{\"source\":\"iana\",\"extensions\":[\"edm\"]},\"application/vnd.novadigm.edx\":{\"source\":\"iana\",\"extensions\":[\"edx\"]},\"application/vnd.novadigm.ext\":{\"source\":\"iana\",\"extensions\":[\"ext\"]},\"application/vnd.ntt-local.content-share\":{\"source\":\"iana\"},\"application/vnd.ntt-local.file-transfer\":{\"source\":\"iana\"},\"application/vnd.ntt-local.ogw_remote-access\":{\"source\":\"iana\"},\"application/vnd.ntt-local.sip-ta_remote\":{\"source\":\"iana\"},\"application/vnd.ntt-local.sip-ta_tcp_stream\":{\"source\":\"iana\"},\"application/vnd.oasis.opendocument.chart\":{\"source\":\"iana\",\"extensions\":[\"odc\"]},\"application/vnd.oasis.opendocument.chart-template\":{\"source\":\"iana\",\"extensions\":[\"otc\"]},\"application/vnd.oasis.opendocument.database\":{\"source\":\"iana\",\"extensions\":[\"odb\"]},\"application/vnd.oasis.opendocument.formula\":{\"source\":\"iana\",\"extensions\":[\"odf\"]},\"application/vnd.oasis.opendocument.formula-template\":{\"source\":\"iana\",\"extensions\":[\"odft\"]},\"application/vnd.oasis.opendocument.graphics\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"odg\"]},\"application/vnd.oasis.opendocument.graphics-template\":{\"source\":\"iana\",\"extensions\":[\"otg\"]},\"application/vnd.oasis.opendocument.image\":{\"source\":\"iana\",\"extensions\":[\"odi\"]},\"application/vnd.oasis.opendocument.image-template\":{\"source\":\"iana\",\"extensions\":[\"oti\"]},\"application/vnd.oasis.opendocument.presentation\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"odp\"]},\"application/vnd.oasis.opendocument.presentation-template\":{\"source\":\"iana\",\"extensions\":[\"otp\"]},\"application/vnd.oasis.opendocument.spreadsheet\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"ods\"]},\"application/vnd.oasis.opendocument.spreadsheet-template\":{\"source\":\"iana\",\"extensions\":[\"ots\"]},\"application/vnd.oasis.opendocument.text\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"odt\"]},\"application/vnd.oasis.opendocument.text-master\":{\"source\":\"iana\",\"extensions\":[\"odm\"]},\"application/vnd.oasis.opendocument.text-template\":{\"source\":\"iana\",\"extensions\":[\"ott\"]},\"application/vnd.oasis.opendocument.text-web\":{\"source\":\"iana\",\"extensions\":[\"oth\"]},\"application/vnd.obn\":{\"source\":\"iana\"},\"application/vnd.ocf+cbor\":{\"source\":\"iana\"},\"application/vnd.oftn.l10n+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.contentaccessdownload+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.contentaccessstreaming+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.cspg-hexbinary\":{\"source\":\"iana\"},\"application/vnd.oipf.dae.svg+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.dae.xhtml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.mippvcontrolmessage+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.pae.gem\":{\"source\":\"iana\"},\"application/vnd.oipf.spdiscovery+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.spdlist+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.ueprofile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.userprofile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.olpc-sugar\":{\"source\":\"iana\",\"extensions\":[\"xo\"]},\"application/vnd.oma-scws-config\":{\"source\":\"iana\"},\"application/vnd.oma-scws-http-request\":{\"source\":\"iana\"},\"application/vnd.oma-scws-http-response\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.associated-procedure-parameter+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.drm-trigger+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.imd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.ltkm\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.notification+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.provisioningtrigger\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.sgboot\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.sgdd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.sgdu\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.simple-symbol-container\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.smartcard-trigger+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.sprov+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.stkm\":{\"source\":\"iana\"},\"application/vnd.oma.cab-address-book+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.cab-feature-handler+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.cab-pcc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.cab-subs-invite+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.cab-user-prefs+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.dcd\":{\"source\":\"iana\"},\"application/vnd.oma.dcdc\":{\"source\":\"iana\"},\"application/vnd.oma.dd2+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"dd2\"]},\"application/vnd.oma.drm.risd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.group-usage-list+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.lwm2m+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.lwm2m+tlv\":{\"source\":\"iana\"},\"application/vnd.oma.pal+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.poc.detailed-progress-report+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.poc.final-report+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.poc.groups+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.poc.invocation-descriptor+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.poc.optimized-progress-report+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.push\":{\"source\":\"iana\"},\"application/vnd.oma.scidm.messages+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.xcap-directory+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.omads-email+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.omads-file+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.omads-folder+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.omaloc-supl-init\":{\"source\":\"iana\"},\"application/vnd.onepager\":{\"source\":\"iana\"},\"application/vnd.onepagertamp\":{\"source\":\"iana\"},\"application/vnd.onepagertamx\":{\"source\":\"iana\"},\"application/vnd.onepagertat\":{\"source\":\"iana\"},\"application/vnd.onepagertatp\":{\"source\":\"iana\"},\"application/vnd.onepagertatx\":{\"source\":\"iana\"},\"application/vnd.openblox.game+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openblox.game-binary\":{\"source\":\"iana\"},\"application/vnd.openeye.oeb\":{\"source\":\"iana\"},\"application/vnd.openofficeorg.extension\":{\"source\":\"apache\",\"extensions\":[\"oxt\"]},\"application/vnd.openstreetmap.data+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.custom-properties+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.customxmlproperties+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawing+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.chart+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.extended-properties+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.comments+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.presentation\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"pptx\"]},\"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.slide\":{\"source\":\"iana\",\"extensions\":[\"sldx\"]},\"application/vnd.openxmlformats-officedocument.presentationml.slide+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.slideshow\":{\"source\":\"iana\",\"extensions\":[\"ppsx\"]},\"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.tags+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.template\":{\"source\":\"iana\",\"extensions\":[\"potx\"]},\"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"xlsx\"]},\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.template\":{\"source\":\"iana\",\"extensions\":[\"xltx\"]},\"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.theme+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.themeoverride+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.vmldrawing\":{\"source\":\"iana\"},\"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"docx\"]},\"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.template\":{\"source\":\"iana\",\"extensions\":[\"dotx\"]},\"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-package.core-properties+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-package.relationships+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oracle.resource+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.orange.indata\":{\"source\":\"iana\"},\"application/vnd.osa.netdeploy\":{\"source\":\"iana\"},\"application/vnd.osgeo.mapguide.package\":{\"source\":\"iana\",\"extensions\":[\"mgp\"]},\"application/vnd.osgi.bundle\":{\"source\":\"iana\"},\"application/vnd.osgi.dp\":{\"source\":\"iana\",\"extensions\":[\"dp\"]},\"application/vnd.osgi.subsystem\":{\"source\":\"iana\",\"extensions\":[\"esa\"]},\"application/vnd.otps.ct-kip+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oxli.countgraph\":{\"source\":\"iana\"},\"application/vnd.pagerduty+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.palm\":{\"source\":\"iana\",\"extensions\":[\"pdb\",\"pqa\",\"oprc\"]},\"application/vnd.panoply\":{\"source\":\"iana\"},\"application/vnd.paos.xml\":{\"source\":\"iana\"},\"application/vnd.patentdive\":{\"source\":\"iana\"},\"application/vnd.patientecommsdoc\":{\"source\":\"iana\"},\"application/vnd.pawaafile\":{\"source\":\"iana\",\"extensions\":[\"paw\"]},\"application/vnd.pcos\":{\"source\":\"iana\"},\"application/vnd.pg.format\":{\"source\":\"iana\",\"extensions\":[\"str\"]},\"application/vnd.pg.osasli\":{\"source\":\"iana\",\"extensions\":[\"ei6\"]},\"application/vnd.piaccess.application-licence\":{\"source\":\"iana\"},\"application/vnd.picsel\":{\"source\":\"iana\",\"extensions\":[\"efif\"]},\"application/vnd.pmi.widget\":{\"source\":\"iana\",\"extensions\":[\"wg\"]},\"application/vnd.poc.group-advertisement+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.pocketlearn\":{\"source\":\"iana\",\"extensions\":[\"plf\"]},\"application/vnd.powerbuilder6\":{\"source\":\"iana\",\"extensions\":[\"pbd\"]},\"application/vnd.powerbuilder6-s\":{\"source\":\"iana\"},\"application/vnd.powerbuilder7\":{\"source\":\"iana\"},\"application/vnd.powerbuilder7-s\":{\"source\":\"iana\"},\"application/vnd.powerbuilder75\":{\"source\":\"iana\"},\"application/vnd.powerbuilder75-s\":{\"source\":\"iana\"},\"application/vnd.preminet\":{\"source\":\"iana\"},\"application/vnd.previewsystems.box\":{\"source\":\"iana\",\"extensions\":[\"box\"]},\"application/vnd.proteus.magazine\":{\"source\":\"iana\",\"extensions\":[\"mgz\"]},\"application/vnd.psfs\":{\"source\":\"iana\"},\"application/vnd.publishare-delta-tree\":{\"source\":\"iana\",\"extensions\":[\"qps\"]},\"application/vnd.pvi.ptid1\":{\"source\":\"iana\",\"extensions\":[\"ptid\"]},\"application/vnd.pwg-multiplexed\":{\"source\":\"iana\"},\"application/vnd.pwg-xhtml-print+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.qualcomm.brew-app-res\":{\"source\":\"iana\"},\"application/vnd.quarantainenet\":{\"source\":\"iana\"},\"application/vnd.quark.quarkxpress\":{\"source\":\"iana\",\"extensions\":[\"qxd\",\"qxt\",\"qwd\",\"qwt\",\"qxl\",\"qxb\"]},\"application/vnd.quobject-quoxdocument\":{\"source\":\"iana\"},\"application/vnd.radisys.moml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-audit+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-audit-conf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-audit-conn+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-audit-dialog+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-audit-stream+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-conf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-base+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-fax-detect+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-fax-sendrecv+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-group+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-speech+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-transform+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.rainstor.data\":{\"source\":\"iana\"},\"application/vnd.rapid\":{\"source\":\"iana\"},\"application/vnd.rar\":{\"source\":\"iana\"},\"application/vnd.realvnc.bed\":{\"source\":\"iana\",\"extensions\":[\"bed\"]},\"application/vnd.recordare.musicxml\":{\"source\":\"iana\",\"extensions\":[\"mxl\"]},\"application/vnd.recordare.musicxml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"musicxml\"]},\"application/vnd.renlearn.rlprint\":{\"source\":\"iana\"},\"application/vnd.restful+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.rig.cryptonote\":{\"source\":\"iana\",\"extensions\":[\"cryptonote\"]},\"application/vnd.rim.cod\":{\"source\":\"apache\",\"extensions\":[\"cod\"]},\"application/vnd.rn-realmedia\":{\"source\":\"apache\",\"extensions\":[\"rm\"]},\"application/vnd.rn-realmedia-vbr\":{\"source\":\"apache\",\"extensions\":[\"rmvb\"]},\"application/vnd.route66.link66+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"link66\"]},\"application/vnd.rs-274x\":{\"source\":\"iana\"},\"application/vnd.ruckus.download\":{\"source\":\"iana\"},\"application/vnd.s3sms\":{\"source\":\"iana\"},\"application/vnd.sailingtracker.track\":{\"source\":\"iana\",\"extensions\":[\"st\"]},\"application/vnd.sbm.cid\":{\"source\":\"iana\"},\"application/vnd.sbm.mid2\":{\"source\":\"iana\"},\"application/vnd.scribus\":{\"source\":\"iana\"},\"application/vnd.sealed.3df\":{\"source\":\"iana\"},\"application/vnd.sealed.csf\":{\"source\":\"iana\"},\"application/vnd.sealed.doc\":{\"source\":\"iana\"},\"application/vnd.sealed.eml\":{\"source\":\"iana\"},\"application/vnd.sealed.mht\":{\"source\":\"iana\"},\"application/vnd.sealed.net\":{\"source\":\"iana\"},\"application/vnd.sealed.ppt\":{\"source\":\"iana\"},\"application/vnd.sealed.tiff\":{\"source\":\"iana\"},\"application/vnd.sealed.xls\":{\"source\":\"iana\"},\"application/vnd.sealedmedia.softseal.html\":{\"source\":\"iana\"},\"application/vnd.sealedmedia.softseal.pdf\":{\"source\":\"iana\"},\"application/vnd.seemail\":{\"source\":\"iana\",\"extensions\":[\"see\"]},\"application/vnd.sema\":{\"source\":\"iana\",\"extensions\":[\"sema\"]},\"application/vnd.semd\":{\"source\":\"iana\",\"extensions\":[\"semd\"]},\"application/vnd.semf\":{\"source\":\"iana\",\"extensions\":[\"semf\"]},\"application/vnd.shade-save-file\":{\"source\":\"iana\"},\"application/vnd.shana.informed.formdata\":{\"source\":\"iana\",\"extensions\":[\"ifm\"]},\"application/vnd.shana.informed.formtemplate\":{\"source\":\"iana\",\"extensions\":[\"itp\"]},\"application/vnd.shana.informed.interchange\":{\"source\":\"iana\",\"extensions\":[\"iif\"]},\"application/vnd.shana.informed.package\":{\"source\":\"iana\",\"extensions\":[\"ipk\"]},\"application/vnd.shootproof+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.shopkick+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.sigrok.session\":{\"source\":\"iana\"},\"application/vnd.simtech-mindmapper\":{\"source\":\"iana\",\"extensions\":[\"twd\",\"twds\"]},\"application/vnd.siren+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.smaf\":{\"source\":\"iana\",\"extensions\":[\"mmf\"]},\"application/vnd.smart.notebook\":{\"source\":\"iana\"},\"application/vnd.smart.teacher\":{\"source\":\"iana\",\"extensions\":[\"teacher\"]},\"application/vnd.software602.filler.form+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.software602.filler.form-xml-zip\":{\"source\":\"iana\"},\"application/vnd.solent.sdkm+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"sdkm\",\"sdkd\"]},\"application/vnd.spotfire.dxp\":{\"source\":\"iana\",\"extensions\":[\"dxp\"]},\"application/vnd.spotfire.sfs\":{\"source\":\"iana\",\"extensions\":[\"sfs\"]},\"application/vnd.sqlite3\":{\"source\":\"iana\"},\"application/vnd.sss-cod\":{\"source\":\"iana\"},\"application/vnd.sss-dtf\":{\"source\":\"iana\"},\"application/vnd.sss-ntf\":{\"source\":\"iana\"},\"application/vnd.stardivision.calc\":{\"source\":\"apache\",\"extensions\":[\"sdc\"]},\"application/vnd.stardivision.draw\":{\"source\":\"apache\",\"extensions\":[\"sda\"]},\"application/vnd.stardivision.impress\":{\"source\":\"apache\",\"extensions\":[\"sdd\"]},\"application/vnd.stardivision.math\":{\"source\":\"apache\",\"extensions\":[\"smf\"]},\"application/vnd.stardivision.writer\":{\"source\":\"apache\",\"extensions\":[\"sdw\",\"vor\"]},\"application/vnd.stardivision.writer-global\":{\"source\":\"apache\",\"extensions\":[\"sgl\"]},\"application/vnd.stepmania.package\":{\"source\":\"iana\",\"extensions\":[\"smzip\"]},\"application/vnd.stepmania.stepchart\":{\"source\":\"iana\",\"extensions\":[\"sm\"]},\"application/vnd.street-stream\":{\"source\":\"iana\"},\"application/vnd.sun.wadl+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"wadl\"]},\"application/vnd.sun.xml.calc\":{\"source\":\"apache\",\"extensions\":[\"sxc\"]},\"application/vnd.sun.xml.calc.template\":{\"source\":\"apache\",\"extensions\":[\"stc\"]},\"application/vnd.sun.xml.draw\":{\"source\":\"apache\",\"extensions\":[\"sxd\"]},\"application/vnd.sun.xml.draw.template\":{\"source\":\"apache\",\"extensions\":[\"std\"]},\"application/vnd.sun.xml.impress\":{\"source\":\"apache\",\"extensions\":[\"sxi\"]},\"application/vnd.sun.xml.impress.template\":{\"source\":\"apache\",\"extensions\":[\"sti\"]},\"application/vnd.sun.xml.math\":{\"source\":\"apache\",\"extensions\":[\"sxm\"]},\"application/vnd.sun.xml.writer\":{\"source\":\"apache\",\"extensions\":[\"sxw\"]},\"application/vnd.sun.xml.writer.global\":{\"source\":\"apache\",\"extensions\":[\"sxg\"]},\"application/vnd.sun.xml.writer.template\":{\"source\":\"apache\",\"extensions\":[\"stw\"]},\"application/vnd.sus-calendar\":{\"source\":\"iana\",\"extensions\":[\"sus\",\"susp\"]},\"application/vnd.svd\":{\"source\":\"iana\",\"extensions\":[\"svd\"]},\"application/vnd.swiftview-ics\":{\"source\":\"iana\"},\"application/vnd.symbian.install\":{\"source\":\"apache\",\"extensions\":[\"sis\",\"sisx\"]},\"application/vnd.syncml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xsm\"]},\"application/vnd.syncml.dm+wbxml\":{\"source\":\"iana\",\"extensions\":[\"bdm\"]},\"application/vnd.syncml.dm+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xdm\"]},\"application/vnd.syncml.dm.notification\":{\"source\":\"iana\"},\"application/vnd.syncml.dmddf+wbxml\":{\"source\":\"iana\"},\"application/vnd.syncml.dmddf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.syncml.dmtnds+wbxml\":{\"source\":\"iana\"},\"application/vnd.syncml.dmtnds+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.syncml.ds.notification\":{\"source\":\"iana\"},\"application/vnd.tableschema+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.tao.intent-module-archive\":{\"source\":\"iana\",\"extensions\":[\"tao\"]},\"application/vnd.tcpdump.pcap\":{\"source\":\"iana\",\"extensions\":[\"pcap\",\"cap\",\"dmp\"]},\"application/vnd.think-cell.ppttc+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.tmd.mediaflex.api+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.tml\":{\"source\":\"iana\"},\"application/vnd.tmobile-livetv\":{\"source\":\"iana\",\"extensions\":[\"tmo\"]},\"application/vnd.tri.onesource\":{\"source\":\"iana\"},\"application/vnd.trid.tpt\":{\"source\":\"iana\",\"extensions\":[\"tpt\"]},\"application/vnd.triscape.mxs\":{\"source\":\"iana\",\"extensions\":[\"mxs\"]},\"application/vnd.trueapp\":{\"source\":\"iana\",\"extensions\":[\"tra\"]},\"application/vnd.truedoc\":{\"source\":\"iana\"},\"application/vnd.ubisoft.webplayer\":{\"source\":\"iana\"},\"application/vnd.ufdl\":{\"source\":\"iana\",\"extensions\":[\"ufd\",\"ufdl\"]},\"application/vnd.uiq.theme\":{\"source\":\"iana\",\"extensions\":[\"utz\"]},\"application/vnd.umajin\":{\"source\":\"iana\",\"extensions\":[\"umj\"]},\"application/vnd.unity\":{\"source\":\"iana\",\"extensions\":[\"unityweb\"]},\"application/vnd.uoml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"uoml\"]},\"application/vnd.uplanet.alert\":{\"source\":\"iana\"},\"application/vnd.uplanet.alert-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.bearer-choice\":{\"source\":\"iana\"},\"application/vnd.uplanet.bearer-choice-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.cacheop\":{\"source\":\"iana\"},\"application/vnd.uplanet.cacheop-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.channel\":{\"source\":\"iana\"},\"application/vnd.uplanet.channel-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.list\":{\"source\":\"iana\"},\"application/vnd.uplanet.list-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.listcmd\":{\"source\":\"iana\"},\"application/vnd.uplanet.listcmd-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.signal\":{\"source\":\"iana\"},\"application/vnd.uri-map\":{\"source\":\"iana\"},\"application/vnd.valve.source.material\":{\"source\":\"iana\"},\"application/vnd.vcx\":{\"source\":\"iana\",\"extensions\":[\"vcx\"]},\"application/vnd.vd-study\":{\"source\":\"iana\"},\"application/vnd.vectorworks\":{\"source\":\"iana\"},\"application/vnd.vel+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.verimatrix.vcas\":{\"source\":\"iana\"},\"application/vnd.veryant.thin\":{\"source\":\"iana\"},\"application/vnd.ves.encrypted\":{\"source\":\"iana\"},\"application/vnd.vidsoft.vidconference\":{\"source\":\"iana\"},\"application/vnd.visio\":{\"source\":\"iana\",\"extensions\":[\"vsd\",\"vst\",\"vss\",\"vsw\"]},\"application/vnd.visionary\":{\"source\":\"iana\",\"extensions\":[\"vis\"]},\"application/vnd.vividence.scriptfile\":{\"source\":\"iana\"},\"application/vnd.vsf\":{\"source\":\"iana\",\"extensions\":[\"vsf\"]},\"application/vnd.wap.sic\":{\"source\":\"iana\"},\"application/vnd.wap.slc\":{\"source\":\"iana\"},\"application/vnd.wap.wbxml\":{\"source\":\"iana\",\"extensions\":[\"wbxml\"]},\"application/vnd.wap.wmlc\":{\"source\":\"iana\",\"extensions\":[\"wmlc\"]},\"application/vnd.wap.wmlscriptc\":{\"source\":\"iana\",\"extensions\":[\"wmlsc\"]},\"application/vnd.webturbo\":{\"source\":\"iana\",\"extensions\":[\"wtb\"]},\"application/vnd.wfa.p2p\":{\"source\":\"iana\"},\"application/vnd.wfa.wsc\":{\"source\":\"iana\"},\"application/vnd.windows.devicepairing\":{\"source\":\"iana\"},\"application/vnd.wmc\":{\"source\":\"iana\"},\"application/vnd.wmf.bootstrap\":{\"source\":\"iana\"},\"application/vnd.wolfram.mathematica\":{\"source\":\"iana\"},\"application/vnd.wolfram.mathematica.package\":{\"source\":\"iana\"},\"application/vnd.wolfram.player\":{\"source\":\"iana\",\"extensions\":[\"nbp\"]},\"application/vnd.wordperfect\":{\"source\":\"iana\",\"extensions\":[\"wpd\"]},\"application/vnd.wqd\":{\"source\":\"iana\",\"extensions\":[\"wqd\"]},\"application/vnd.wrq-hp3000-labelled\":{\"source\":\"iana\"},\"application/vnd.wt.stf\":{\"source\":\"iana\",\"extensions\":[\"stf\"]},\"application/vnd.wv.csp+wbxml\":{\"source\":\"iana\"},\"application/vnd.wv.csp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.wv.ssp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.xacml+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.xara\":{\"source\":\"iana\",\"extensions\":[\"xar\"]},\"application/vnd.xfdl\":{\"source\":\"iana\",\"extensions\":[\"xfdl\"]},\"application/vnd.xfdl.webform\":{\"source\":\"iana\"},\"application/vnd.xmi+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.xmpie.cpkg\":{\"source\":\"iana\"},\"application/vnd.xmpie.dpkg\":{\"source\":\"iana\"},\"application/vnd.xmpie.plan\":{\"source\":\"iana\"},\"application/vnd.xmpie.ppkg\":{\"source\":\"iana\"},\"application/vnd.xmpie.xlim\":{\"source\":\"iana\"},\"application/vnd.yamaha.hv-dic\":{\"source\":\"iana\",\"extensions\":[\"hvd\"]},\"application/vnd.yamaha.hv-script\":{\"source\":\"iana\",\"extensions\":[\"hvs\"]},\"application/vnd.yamaha.hv-voice\":{\"source\":\"iana\",\"extensions\":[\"hvp\"]},\"application/vnd.yamaha.openscoreformat\":{\"source\":\"iana\",\"extensions\":[\"osf\"]},\"application/vnd.yamaha.openscoreformat.osfpvg+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"osfpvg\"]},\"application/vnd.yamaha.remote-setup\":{\"source\":\"iana\"},\"application/vnd.yamaha.smaf-audio\":{\"source\":\"iana\",\"extensions\":[\"saf\"]},\"application/vnd.yamaha.smaf-phrase\":{\"source\":\"iana\",\"extensions\":[\"spf\"]},\"application/vnd.yamaha.through-ngn\":{\"source\":\"iana\"},\"application/vnd.yamaha.tunnel-udpencap\":{\"source\":\"iana\"},\"application/vnd.yaoweme\":{\"source\":\"iana\"},\"application/vnd.yellowriver-custom-menu\":{\"source\":\"iana\",\"extensions\":[\"cmp\"]},\"application/vnd.youtube.yt\":{\"source\":\"iana\"},\"application/vnd.zul\":{\"source\":\"iana\",\"extensions\":[\"zir\",\"zirz\"]},\"application/vnd.zzazz.deck+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"zaz\"]},\"application/voicexml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"vxml\"]},\"application/voucher-cms+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vq-rtcpxr\":{\"source\":\"iana\"},\"application/wasm\":{\"compressible\":true,\"extensions\":[\"wasm\"]},\"application/watcherinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/webpush-options+json\":{\"source\":\"iana\",\"compressible\":true},\"application/whoispp-query\":{\"source\":\"iana\"},\"application/whoispp-response\":{\"source\":\"iana\"},\"application/widget\":{\"source\":\"iana\",\"extensions\":[\"wgt\"]},\"application/winhlp\":{\"source\":\"apache\",\"extensions\":[\"hlp\"]},\"application/wita\":{\"source\":\"iana\"},\"application/wordperfect5.1\":{\"source\":\"iana\"},\"application/wsdl+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"wsdl\"]},\"application/wspolicy+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"wspolicy\"]},\"application/x-7z-compressed\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"7z\"]},\"application/x-abiword\":{\"source\":\"apache\",\"extensions\":[\"abw\"]},\"application/x-ace-compressed\":{\"source\":\"apache\",\"extensions\":[\"ace\"]},\"application/x-amf\":{\"source\":\"apache\"},\"application/x-apple-diskimage\":{\"source\":\"apache\",\"extensions\":[\"dmg\"]},\"application/x-arj\":{\"compressible\":false,\"extensions\":[\"arj\"]},\"application/x-authorware-bin\":{\"source\":\"apache\",\"extensions\":[\"aab\",\"x32\",\"u32\",\"vox\"]},\"application/x-authorware-map\":{\"source\":\"apache\",\"extensions\":[\"aam\"]},\"application/x-authorware-seg\":{\"source\":\"apache\",\"extensions\":[\"aas\"]},\"application/x-bcpio\":{\"source\":\"apache\",\"extensions\":[\"bcpio\"]},\"application/x-bdoc\":{\"compressible\":false,\"extensions\":[\"bdoc\"]},\"application/x-bittorrent\":{\"source\":\"apache\",\"extensions\":[\"torrent\"]},\"application/x-blorb\":{\"source\":\"apache\",\"extensions\":[\"blb\",\"blorb\"]},\"application/x-bzip\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"bz\"]},\"application/x-bzip2\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"bz2\",\"boz\"]},\"application/x-cbr\":{\"source\":\"apache\",\"extensions\":[\"cbr\",\"cba\",\"cbt\",\"cbz\",\"cb7\"]},\"application/x-cdlink\":{\"source\":\"apache\",\"extensions\":[\"vcd\"]},\"application/x-cfs-compressed\":{\"source\":\"apache\",\"extensions\":[\"cfs\"]},\"application/x-chat\":{\"source\":\"apache\",\"extensions\":[\"chat\"]},\"application/x-chess-pgn\":{\"source\":\"apache\",\"extensions\":[\"pgn\"]},\"application/x-chrome-extension\":{\"extensions\":[\"crx\"]},\"application/x-cocoa\":{\"source\":\"nginx\",\"extensions\":[\"cco\"]},\"application/x-compress\":{\"source\":\"apache\"},\"application/x-conference\":{\"source\":\"apache\",\"extensions\":[\"nsc\"]},\"application/x-cpio\":{\"source\":\"apache\",\"extensions\":[\"cpio\"]},\"application/x-csh\":{\"source\":\"apache\",\"extensions\":[\"csh\"]},\"application/x-deb\":{\"compressible\":false},\"application/x-debian-package\":{\"source\":\"apache\",\"extensions\":[\"deb\",\"udeb\"]},\"application/x-dgc-compressed\":{\"source\":\"apache\",\"extensions\":[\"dgc\"]},\"application/x-director\":{\"source\":\"apache\",\"extensions\":[\"dir\",\"dcr\",\"dxr\",\"cst\",\"cct\",\"cxt\",\"w3d\",\"fgd\",\"swa\"]},\"application/x-doom\":{\"source\":\"apache\",\"extensions\":[\"wad\"]},\"application/x-dtbncx+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"ncx\"]},\"application/x-dtbook+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"dtb\"]},\"application/x-dtbresource+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"res\"]},\"application/x-dvi\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"dvi\"]},\"application/x-envoy\":{\"source\":\"apache\",\"extensions\":[\"evy\"]},\"application/x-eva\":{\"source\":\"apache\",\"extensions\":[\"eva\"]},\"application/x-font-bdf\":{\"source\":\"apache\",\"extensions\":[\"bdf\"]},\"application/x-font-dos\":{\"source\":\"apache\"},\"application/x-font-framemaker\":{\"source\":\"apache\"},\"application/x-font-ghostscript\":{\"source\":\"apache\",\"extensions\":[\"gsf\"]},\"application/x-font-libgrx\":{\"source\":\"apache\"},\"application/x-font-linux-psf\":{\"source\":\"apache\",\"extensions\":[\"psf\"]},\"application/x-font-pcf\":{\"source\":\"apache\",\"extensions\":[\"pcf\"]},\"application/x-font-snf\":{\"source\":\"apache\",\"extensions\":[\"snf\"]},\"application/x-font-speedo\":{\"source\":\"apache\"},\"application/x-font-sunos-news\":{\"source\":\"apache\"},\"application/x-font-type1\":{\"source\":\"apache\",\"extensions\":[\"pfa\",\"pfb\",\"pfm\",\"afm\"]},\"application/x-font-vfont\":{\"source\":\"apache\"},\"application/x-freearc\":{\"source\":\"apache\",\"extensions\":[\"arc\"]},\"application/x-futuresplash\":{\"source\":\"apache\",\"extensions\":[\"spl\"]},\"application/x-gca-compressed\":{\"source\":\"apache\",\"extensions\":[\"gca\"]},\"application/x-glulx\":{\"source\":\"apache\",\"extensions\":[\"ulx\"]},\"application/x-gnumeric\":{\"source\":\"apache\",\"extensions\":[\"gnumeric\"]},\"application/x-gramps-xml\":{\"source\":\"apache\",\"extensions\":[\"gramps\"]},\"application/x-gtar\":{\"source\":\"apache\",\"extensions\":[\"gtar\"]},\"application/x-gzip\":{\"source\":\"apache\"},\"application/x-hdf\":{\"source\":\"apache\",\"extensions\":[\"hdf\"]},\"application/x-httpd-php\":{\"compressible\":true,\"extensions\":[\"php\"]},\"application/x-install-instructions\":{\"source\":\"apache\",\"extensions\":[\"install\"]},\"application/x-iso9660-image\":{\"source\":\"apache\",\"extensions\":[\"iso\"]},\"application/x-java-archive-diff\":{\"source\":\"nginx\",\"extensions\":[\"jardiff\"]},\"application/x-java-jnlp-file\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"jnlp\"]},\"application/x-javascript\":{\"compressible\":true},\"application/x-latex\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"latex\"]},\"application/x-lua-bytecode\":{\"extensions\":[\"luac\"]},\"application/x-lzh-compressed\":{\"source\":\"apache\",\"extensions\":[\"lzh\",\"lha\"]},\"application/x-makeself\":{\"source\":\"nginx\",\"extensions\":[\"run\"]},\"application/x-mie\":{\"source\":\"apache\",\"extensions\":[\"mie\"]},\"application/x-mobipocket-ebook\":{\"source\":\"apache\",\"extensions\":[\"prc\",\"mobi\"]},\"application/x-mpegurl\":{\"compressible\":false},\"application/x-ms-application\":{\"source\":\"apache\",\"extensions\":[\"application\"]},\"application/x-ms-shortcut\":{\"source\":\"apache\",\"extensions\":[\"lnk\"]},\"application/x-ms-wmd\":{\"source\":\"apache\",\"extensions\":[\"wmd\"]},\"application/x-ms-wmz\":{\"source\":\"apache\",\"extensions\":[\"wmz\"]},\"application/x-ms-xbap\":{\"source\":\"apache\",\"extensions\":[\"xbap\"]},\"application/x-msaccess\":{\"source\":\"apache\",\"extensions\":[\"mdb\"]},\"application/x-msbinder\":{\"source\":\"apache\",\"extensions\":[\"obd\"]},\"application/x-mscardfile\":{\"source\":\"apache\",\"extensions\":[\"crd\"]},\"application/x-msclip\":{\"source\":\"apache\",\"extensions\":[\"clp\"]},\"application/x-msdos-program\":{\"extensions\":[\"exe\"]},\"application/x-msdownload\":{\"source\":\"apache\",\"extensions\":[\"exe\",\"dll\",\"com\",\"bat\",\"msi\"]},\"application/x-msmediaview\":{\"source\":\"apache\",\"extensions\":[\"mvb\",\"m13\",\"m14\"]},\"application/x-msmetafile\":{\"source\":\"apache\",\"extensions\":[\"wmf\",\"wmz\",\"emf\",\"emz\"]},\"application/x-msmoney\":{\"source\":\"apache\",\"extensions\":[\"mny\"]},\"application/x-mspublisher\":{\"source\":\"apache\",\"extensions\":[\"pub\"]},\"application/x-msschedule\":{\"source\":\"apache\",\"extensions\":[\"scd\"]},\"application/x-msterminal\":{\"source\":\"apache\",\"extensions\":[\"trm\"]},\"application/x-mswrite\":{\"source\":\"apache\",\"extensions\":[\"wri\"]},\"application/x-netcdf\":{\"source\":\"apache\",\"extensions\":[\"nc\",\"cdf\"]},\"application/x-ns-proxy-autoconfig\":{\"compressible\":true,\"extensions\":[\"pac\"]},\"application/x-nzb\":{\"source\":\"apache\",\"extensions\":[\"nzb\"]},\"application/x-perl\":{\"source\":\"nginx\",\"extensions\":[\"pl\",\"pm\"]},\"application/x-pilot\":{\"source\":\"nginx\",\"extensions\":[\"prc\",\"pdb\"]},\"application/x-pkcs12\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"p12\",\"pfx\"]},\"application/x-pkcs7-certificates\":{\"source\":\"apache\",\"extensions\":[\"p7b\",\"spc\"]},\"application/x-pkcs7-certreqresp\":{\"source\":\"apache\",\"extensions\":[\"p7r\"]},\"application/x-rar-compressed\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"rar\"]},\"application/x-redhat-package-manager\":{\"source\":\"nginx\",\"extensions\":[\"rpm\"]},\"application/x-research-info-systems\":{\"source\":\"apache\",\"extensions\":[\"ris\"]},\"application/x-sea\":{\"source\":\"nginx\",\"extensions\":[\"sea\"]},\"application/x-sh\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"sh\"]},\"application/x-shar\":{\"source\":\"apache\",\"extensions\":[\"shar\"]},\"application/x-shockwave-flash\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"swf\"]},\"application/x-silverlight-app\":{\"source\":\"apache\",\"extensions\":[\"xap\"]},\"application/x-sql\":{\"source\":\"apache\",\"extensions\":[\"sql\"]},\"application/x-stuffit\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"sit\"]},\"application/x-stuffitx\":{\"source\":\"apache\",\"extensions\":[\"sitx\"]},\"application/x-subrip\":{\"source\":\"apache\",\"extensions\":[\"srt\"]},\"application/x-sv4cpio\":{\"source\":\"apache\",\"extensions\":[\"sv4cpio\"]},\"application/x-sv4crc\":{\"source\":\"apache\",\"extensions\":[\"sv4crc\"]},\"application/x-t3vm-image\":{\"source\":\"apache\",\"extensions\":[\"t3\"]},\"application/x-tads\":{\"source\":\"apache\",\"extensions\":[\"gam\"]},\"application/x-tar\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"tar\"]},\"application/x-tcl\":{\"source\":\"apache\",\"extensions\":[\"tcl\",\"tk\"]},\"application/x-tex\":{\"source\":\"apache\",\"extensions\":[\"tex\"]},\"application/x-tex-tfm\":{\"source\":\"apache\",\"extensions\":[\"tfm\"]},\"application/x-texinfo\":{\"source\":\"apache\",\"extensions\":[\"texinfo\",\"texi\"]},\"application/x-tgif\":{\"source\":\"apache\",\"extensions\":[\"obj\"]},\"application/x-ustar\":{\"source\":\"apache\",\"extensions\":[\"ustar\"]},\"application/x-virtualbox-hdd\":{\"compressible\":true,\"extensions\":[\"hdd\"]},\"application/x-virtualbox-ova\":{\"compressible\":true,\"extensions\":[\"ova\"]},\"application/x-virtualbox-ovf\":{\"compressible\":true,\"extensions\":[\"ovf\"]},\"application/x-virtualbox-vbox\":{\"compressible\":true,\"extensions\":[\"vbox\"]},\"application/x-virtualbox-vbox-extpack\":{\"compressible\":false,\"extensions\":[\"vbox-extpack\"]},\"application/x-virtualbox-vdi\":{\"compressible\":true,\"extensions\":[\"vdi\"]},\"application/x-virtualbox-vhd\":{\"compressible\":true,\"extensions\":[\"vhd\"]},\"application/x-virtualbox-vmdk\":{\"compressible\":true,\"extensions\":[\"vmdk\"]},\"application/x-wais-source\":{\"source\":\"apache\",\"extensions\":[\"src\"]},\"application/x-web-app-manifest+json\":{\"compressible\":true,\"extensions\":[\"webapp\"]},\"application/x-www-form-urlencoded\":{\"source\":\"iana\",\"compressible\":true},\"application/x-x509-ca-cert\":{\"source\":\"apache\",\"extensions\":[\"der\",\"crt\",\"pem\"]},\"application/x-xfig\":{\"source\":\"apache\",\"extensions\":[\"fig\"]},\"application/x-xliff+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"xlf\"]},\"application/x-xpinstall\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"xpi\"]},\"application/x-xz\":{\"source\":\"apache\",\"extensions\":[\"xz\"]},\"application/x-zmachine\":{\"source\":\"apache\",\"extensions\":[\"z1\",\"z2\",\"z3\",\"z4\",\"z5\",\"z6\",\"z7\",\"z8\"]},\"application/x400-bp\":{\"source\":\"iana\"},\"application/xacml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xaml+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"xaml\"]},\"application/xcap-att+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xcap-caps+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xcap-diff+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xdf\"]},\"application/xcap-el+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xcap-error+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xcap-ns+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xcon-conference-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xcon-conference-info-diff+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xenc+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xenc\"]},\"application/xhtml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xhtml\",\"xht\"]},\"application/xhtml-voice+xml\":{\"source\":\"apache\",\"compressible\":true},\"application/xliff+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xml\",\"xsl\",\"xsd\",\"rng\"]},\"application/xml-dtd\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"dtd\"]},\"application/xml-external-parsed-entity\":{\"source\":\"iana\"},\"application/xml-patch+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xmpp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xop+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xop\"]},\"application/xproc+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"xpl\"]},\"application/xslt+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xslt\"]},\"application/xspf+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"xspf\"]},\"application/xv+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mxml\",\"xhvml\",\"xvml\",\"xvm\"]},\"application/yang\":{\"source\":\"iana\",\"extensions\":[\"yang\"]},\"application/yang-data+json\":{\"source\":\"iana\",\"compressible\":true},\"application/yang-data+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/yang-patch+json\":{\"source\":\"iana\",\"compressible\":true},\"application/yang-patch+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/yin+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"yin\"]},\"application/zip\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"zip\"]},\"application/zlib\":{\"source\":\"iana\"},\"application/zstd\":{\"source\":\"iana\"},\"audio/1d-interleaved-parityfec\":{\"source\":\"iana\"},\"audio/32kadpcm\":{\"source\":\"iana\"},\"audio/3gpp\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"3gpp\"]},\"audio/3gpp2\":{\"source\":\"iana\"},\"audio/aac\":{\"source\":\"iana\"},\"audio/ac3\":{\"source\":\"iana\"},\"audio/adpcm\":{\"source\":\"apache\",\"extensions\":[\"adp\"]},\"audio/amr\":{\"source\":\"iana\"},\"audio/amr-wb\":{\"source\":\"iana\"},\"audio/amr-wb+\":{\"source\":\"iana\"},\"audio/aptx\":{\"source\":\"iana\"},\"audio/asc\":{\"source\":\"iana\"},\"audio/atrac-advanced-lossless\":{\"source\":\"iana\"},\"audio/atrac-x\":{\"source\":\"iana\"},\"audio/atrac3\":{\"source\":\"iana\"},\"audio/basic\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"au\",\"snd\"]},\"audio/bv16\":{\"source\":\"iana\"},\"audio/bv32\":{\"source\":\"iana\"},\"audio/clearmode\":{\"source\":\"iana\"},\"audio/cn\":{\"source\":\"iana\"},\"audio/dat12\":{\"source\":\"iana\"},\"audio/dls\":{\"source\":\"iana\"},\"audio/dsr-es201108\":{\"source\":\"iana\"},\"audio/dsr-es202050\":{\"source\":\"iana\"},\"audio/dsr-es202211\":{\"source\":\"iana\"},\"audio/dsr-es202212\":{\"source\":\"iana\"},\"audio/dv\":{\"source\":\"iana\"},\"audio/dvi4\":{\"source\":\"iana\"},\"audio/eac3\":{\"source\":\"iana\"},\"audio/encaprtp\":{\"source\":\"iana\"},\"audio/evrc\":{\"source\":\"iana\"},\"audio/evrc-qcp\":{\"source\":\"iana\"},\"audio/evrc0\":{\"source\":\"iana\"},\"audio/evrc1\":{\"source\":\"iana\"},\"audio/evrcb\":{\"source\":\"iana\"},\"audio/evrcb0\":{\"source\":\"iana\"},\"audio/evrcb1\":{\"source\":\"iana\"},\"audio/evrcnw\":{\"source\":\"iana\"},\"audio/evrcnw0\":{\"source\":\"iana\"},\"audio/evrcnw1\":{\"source\":\"iana\"},\"audio/evrcwb\":{\"source\":\"iana\"},\"audio/evrcwb0\":{\"source\":\"iana\"},\"audio/evrcwb1\":{\"source\":\"iana\"},\"audio/evs\":{\"source\":\"iana\"},\"audio/flexfec\":{\"source\":\"iana\"},\"audio/fwdred\":{\"source\":\"iana\"},\"audio/g711-0\":{\"source\":\"iana\"},\"audio/g719\":{\"source\":\"iana\"},\"audio/g722\":{\"source\":\"iana\"},\"audio/g7221\":{\"source\":\"iana\"},\"audio/g723\":{\"source\":\"iana\"},\"audio/g726-16\":{\"source\":\"iana\"},\"audio/g726-24\":{\"source\":\"iana\"},\"audio/g726-32\":{\"source\":\"iana\"},\"audio/g726-40\":{\"source\":\"iana\"},\"audio/g728\":{\"source\":\"iana\"},\"audio/g729\":{\"source\":\"iana\"},\"audio/g7291\":{\"source\":\"iana\"},\"audio/g729d\":{\"source\":\"iana\"},\"audio/g729e\":{\"source\":\"iana\"},\"audio/gsm\":{\"source\":\"iana\"},\"audio/gsm-efr\":{\"source\":\"iana\"},\"audio/gsm-hr-08\":{\"source\":\"iana\"},\"audio/ilbc\":{\"source\":\"iana\"},\"audio/ip-mr_v2.5\":{\"source\":\"iana\"},\"audio/isac\":{\"source\":\"apache\"},\"audio/l16\":{\"source\":\"iana\"},\"audio/l20\":{\"source\":\"iana\"},\"audio/l24\":{\"source\":\"iana\",\"compressible\":false},\"audio/l8\":{\"source\":\"iana\"},\"audio/lpc\":{\"source\":\"iana\"},\"audio/melp\":{\"source\":\"iana\"},\"audio/melp1200\":{\"source\":\"iana\"},\"audio/melp2400\":{\"source\":\"iana\"},\"audio/melp600\":{\"source\":\"iana\"},\"audio/midi\":{\"source\":\"apache\",\"extensions\":[\"mid\",\"midi\",\"kar\",\"rmi\"]},\"audio/mobile-xmf\":{\"source\":\"iana\"},\"audio/mp3\":{\"compressible\":false,\"extensions\":[\"mp3\"]},\"audio/mp4\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"m4a\",\"mp4a\"]},\"audio/mp4a-latm\":{\"source\":\"iana\"},\"audio/mpa\":{\"source\":\"iana\"},\"audio/mpa-robust\":{\"source\":\"iana\"},\"audio/mpeg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"mpga\",\"mp2\",\"mp2a\",\"mp3\",\"m2a\",\"m3a\"]},\"audio/mpeg4-generic\":{\"source\":\"iana\"},\"audio/musepack\":{\"source\":\"apache\"},\"audio/ogg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"oga\",\"ogg\",\"spx\"]},\"audio/opus\":{\"source\":\"iana\"},\"audio/parityfec\":{\"source\":\"iana\"},\"audio/pcma\":{\"source\":\"iana\"},\"audio/pcma-wb\":{\"source\":\"iana\"},\"audio/pcmu\":{\"source\":\"iana\"},\"audio/pcmu-wb\":{\"source\":\"iana\"},\"audio/prs.sid\":{\"source\":\"iana\"},\"audio/qcelp\":{\"source\":\"iana\"},\"audio/raptorfec\":{\"source\":\"iana\"},\"audio/red\":{\"source\":\"iana\"},\"audio/rtp-enc-aescm128\":{\"source\":\"iana\"},\"audio/rtp-midi\":{\"source\":\"iana\"},\"audio/rtploopback\":{\"source\":\"iana\"},\"audio/rtx\":{\"source\":\"iana\"},\"audio/s3m\":{\"source\":\"apache\",\"extensions\":[\"s3m\"]},\"audio/silk\":{\"source\":\"apache\",\"extensions\":[\"sil\"]},\"audio/smv\":{\"source\":\"iana\"},\"audio/smv-qcp\":{\"source\":\"iana\"},\"audio/smv0\":{\"source\":\"iana\"},\"audio/sp-midi\":{\"source\":\"iana\"},\"audio/speex\":{\"source\":\"iana\"},\"audio/t140c\":{\"source\":\"iana\"},\"audio/t38\":{\"source\":\"iana\"},\"audio/telephone-event\":{\"source\":\"iana\"},\"audio/tetra_acelp\":{\"source\":\"iana\"},\"audio/tone\":{\"source\":\"iana\"},\"audio/uemclip\":{\"source\":\"iana\"},\"audio/ulpfec\":{\"source\":\"iana\"},\"audio/usac\":{\"source\":\"iana\"},\"audio/vdvi\":{\"source\":\"iana\"},\"audio/vmr-wb\":{\"source\":\"iana\"},\"audio/vnd.3gpp.iufp\":{\"source\":\"iana\"},\"audio/vnd.4sb\":{\"source\":\"iana\"},\"audio/vnd.audiokoz\":{\"source\":\"iana\"},\"audio/vnd.celp\":{\"source\":\"iana\"},\"audio/vnd.cisco.nse\":{\"source\":\"iana\"},\"audio/vnd.cmles.radio-events\":{\"source\":\"iana\"},\"audio/vnd.cns.anp1\":{\"source\":\"iana\"},\"audio/vnd.cns.inf1\":{\"source\":\"iana\"},\"audio/vnd.dece.audio\":{\"source\":\"iana\",\"extensions\":[\"uva\",\"uvva\"]},\"audio/vnd.digital-winds\":{\"source\":\"iana\",\"extensions\":[\"eol\"]},\"audio/vnd.dlna.adts\":{\"source\":\"iana\"},\"audio/vnd.dolby.heaac.1\":{\"source\":\"iana\"},\"audio/vnd.dolby.heaac.2\":{\"source\":\"iana\"},\"audio/vnd.dolby.mlp\":{\"source\":\"iana\"},\"audio/vnd.dolby.mps\":{\"source\":\"iana\"},\"audio/vnd.dolby.pl2\":{\"source\":\"iana\"},\"audio/vnd.dolby.pl2x\":{\"source\":\"iana\"},\"audio/vnd.dolby.pl2z\":{\"source\":\"iana\"},\"audio/vnd.dolby.pulse.1\":{\"source\":\"iana\"},\"audio/vnd.dra\":{\"source\":\"iana\",\"extensions\":[\"dra\"]},\"audio/vnd.dts\":{\"source\":\"iana\",\"extensions\":[\"dts\"]},\"audio/vnd.dts.hd\":{\"source\":\"iana\",\"extensions\":[\"dtshd\"]},\"audio/vnd.dts.uhd\":{\"source\":\"iana\"},\"audio/vnd.dvb.file\":{\"source\":\"iana\"},\"audio/vnd.everad.plj\":{\"source\":\"iana\"},\"audio/vnd.hns.audio\":{\"source\":\"iana\"},\"audio/vnd.lucent.voice\":{\"source\":\"iana\",\"extensions\":[\"lvp\"]},\"audio/vnd.ms-playready.media.pya\":{\"source\":\"iana\",\"extensions\":[\"pya\"]},\"audio/vnd.nokia.mobile-xmf\":{\"source\":\"iana\"},\"audio/vnd.nortel.vbk\":{\"source\":\"iana\"},\"audio/vnd.nuera.ecelp4800\":{\"source\":\"iana\",\"extensions\":[\"ecelp4800\"]},\"audio/vnd.nuera.ecelp7470\":{\"source\":\"iana\",\"extensions\":[\"ecelp7470\"]},\"audio/vnd.nuera.ecelp9600\":{\"source\":\"iana\",\"extensions\":[\"ecelp9600\"]},\"audio/vnd.octel.sbc\":{\"source\":\"iana\"},\"audio/vnd.presonus.multitrack\":{\"source\":\"iana\"},\"audio/vnd.qcelp\":{\"source\":\"iana\"},\"audio/vnd.rhetorex.32kadpcm\":{\"source\":\"iana\"},\"audio/vnd.rip\":{\"source\":\"iana\",\"extensions\":[\"rip\"]},\"audio/vnd.rn-realaudio\":{\"compressible\":false},\"audio/vnd.sealedmedia.softseal.mpeg\":{\"source\":\"iana\"},\"audio/vnd.vmx.cvsd\":{\"source\":\"iana\"},\"audio/vnd.wave\":{\"compressible\":false},\"audio/vorbis\":{\"source\":\"iana\",\"compressible\":false},\"audio/vorbis-config\":{\"source\":\"iana\"},\"audio/wav\":{\"compressible\":false,\"extensions\":[\"wav\"]},\"audio/wave\":{\"compressible\":false,\"extensions\":[\"wav\"]},\"audio/webm\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"weba\"]},\"audio/x-aac\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"aac\"]},\"audio/x-aiff\":{\"source\":\"apache\",\"extensions\":[\"aif\",\"aiff\",\"aifc\"]},\"audio/x-caf\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"caf\"]},\"audio/x-flac\":{\"source\":\"apache\",\"extensions\":[\"flac\"]},\"audio/x-m4a\":{\"source\":\"nginx\",\"extensions\":[\"m4a\"]},\"audio/x-matroska\":{\"source\":\"apache\",\"extensions\":[\"mka\"]},\"audio/x-mpegurl\":{\"source\":\"apache\",\"extensions\":[\"m3u\"]},\"audio/x-ms-wax\":{\"source\":\"apache\",\"extensions\":[\"wax\"]},\"audio/x-ms-wma\":{\"source\":\"apache\",\"extensions\":[\"wma\"]},\"audio/x-pn-realaudio\":{\"source\":\"apache\",\"extensions\":[\"ram\",\"ra\"]},\"audio/x-pn-realaudio-plugin\":{\"source\":\"apache\",\"extensions\":[\"rmp\"]},\"audio/x-realaudio\":{\"source\":\"nginx\",\"extensions\":[\"ra\"]},\"audio/x-tta\":{\"source\":\"apache\"},\"audio/x-wav\":{\"source\":\"apache\",\"extensions\":[\"wav\"]},\"audio/xm\":{\"source\":\"apache\",\"extensions\":[\"xm\"]},\"chemical/x-cdx\":{\"source\":\"apache\",\"extensions\":[\"cdx\"]},\"chemical/x-cif\":{\"source\":\"apache\",\"extensions\":[\"cif\"]},\"chemical/x-cmdf\":{\"source\":\"apache\",\"extensions\":[\"cmdf\"]},\"chemical/x-cml\":{\"source\":\"apache\",\"extensions\":[\"cml\"]},\"chemical/x-csml\":{\"source\":\"apache\",\"extensions\":[\"csml\"]},\"chemical/x-pdb\":{\"source\":\"apache\"},\"chemical/x-xyz\":{\"source\":\"apache\",\"extensions\":[\"xyz\"]},\"font/collection\":{\"source\":\"iana\",\"extensions\":[\"ttc\"]},\"font/otf\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"otf\"]},\"font/sfnt\":{\"source\":\"iana\"},\"font/ttf\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ttf\"]},\"font/woff\":{\"source\":\"iana\",\"extensions\":[\"woff\"]},\"font/woff2\":{\"source\":\"iana\",\"extensions\":[\"woff2\"]},\"image/aces\":{\"source\":\"iana\",\"extensions\":[\"exr\"]},\"image/apng\":{\"compressible\":false,\"extensions\":[\"apng\"]},\"image/avci\":{\"source\":\"iana\"},\"image/avcs\":{\"source\":\"iana\"},\"image/bmp\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"bmp\"]},\"image/cgm\":{\"source\":\"iana\",\"extensions\":[\"cgm\"]},\"image/dicom-rle\":{\"source\":\"iana\",\"extensions\":[\"drle\"]},\"image/emf\":{\"source\":\"iana\",\"extensions\":[\"emf\"]},\"image/fits\":{\"source\":\"iana\",\"extensions\":[\"fits\"]},\"image/g3fax\":{\"source\":\"iana\",\"extensions\":[\"g3\"]},\"image/gif\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"gif\"]},\"image/heic\":{\"source\":\"iana\",\"extensions\":[\"heic\"]},\"image/heic-sequence\":{\"source\":\"iana\",\"extensions\":[\"heics\"]},\"image/heif\":{\"source\":\"iana\",\"extensions\":[\"heif\"]},\"image/heif-sequence\":{\"source\":\"iana\",\"extensions\":[\"heifs\"]},\"image/hej2k\":{\"source\":\"iana\",\"extensions\":[\"hej2\"]},\"image/hsj2\":{\"source\":\"iana\",\"extensions\":[\"hsj2\"]},\"image/ief\":{\"source\":\"iana\",\"extensions\":[\"ief\"]},\"image/jls\":{\"source\":\"iana\",\"extensions\":[\"jls\"]},\"image/jp2\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"jp2\",\"jpg2\"]},\"image/jpeg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"jpeg\",\"jpg\",\"jpe\"]},\"image/jph\":{\"source\":\"iana\",\"extensions\":[\"jph\"]},\"image/jphc\":{\"source\":\"iana\",\"extensions\":[\"jhc\"]},\"image/jpm\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"jpm\"]},\"image/jpx\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"jpx\",\"jpf\"]},\"image/jxr\":{\"source\":\"iana\",\"extensions\":[\"jxr\"]},\"image/jxra\":{\"source\":\"iana\",\"extensions\":[\"jxra\"]},\"image/jxrs\":{\"source\":\"iana\",\"extensions\":[\"jxrs\"]},\"image/jxs\":{\"source\":\"iana\",\"extensions\":[\"jxs\"]},\"image/jxsc\":{\"source\":\"iana\",\"extensions\":[\"jxsc\"]},\"image/jxsi\":{\"source\":\"iana\",\"extensions\":[\"jxsi\"]},\"image/jxss\":{\"source\":\"iana\",\"extensions\":[\"jxss\"]},\"image/ktx\":{\"source\":\"iana\",\"extensions\":[\"ktx\"]},\"image/naplps\":{\"source\":\"iana\"},\"image/pjpeg\":{\"compressible\":false},\"image/png\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"png\"]},\"image/prs.btif\":{\"source\":\"iana\",\"extensions\":[\"btif\"]},\"image/prs.pti\":{\"source\":\"iana\",\"extensions\":[\"pti\"]},\"image/pwg-raster\":{\"source\":\"iana\"},\"image/sgi\":{\"source\":\"apache\",\"extensions\":[\"sgi\"]},\"image/svg+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"svg\",\"svgz\"]},\"image/t38\":{\"source\":\"iana\",\"extensions\":[\"t38\"]},\"image/tiff\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"tif\",\"tiff\"]},\"image/tiff-fx\":{\"source\":\"iana\",\"extensions\":[\"tfx\"]},\"image/vnd.adobe.photoshop\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"psd\"]},\"image/vnd.airzip.accelerator.azv\":{\"source\":\"iana\",\"extensions\":[\"azv\"]},\"image/vnd.cns.inf2\":{\"source\":\"iana\"},\"image/vnd.dece.graphic\":{\"source\":\"iana\",\"extensions\":[\"uvi\",\"uvvi\",\"uvg\",\"uvvg\"]},\"image/vnd.djvu\":{\"source\":\"iana\",\"extensions\":[\"djvu\",\"djv\"]},\"image/vnd.dvb.subtitle\":{\"source\":\"iana\",\"extensions\":[\"sub\"]},\"image/vnd.dwg\":{\"source\":\"iana\",\"extensions\":[\"dwg\"]},\"image/vnd.dxf\":{\"source\":\"iana\",\"extensions\":[\"dxf\"]},\"image/vnd.fastbidsheet\":{\"source\":\"iana\",\"extensions\":[\"fbs\"]},\"image/vnd.fpx\":{\"source\":\"iana\",\"extensions\":[\"fpx\"]},\"image/vnd.fst\":{\"source\":\"iana\",\"extensions\":[\"fst\"]},\"image/vnd.fujixerox.edmics-mmr\":{\"source\":\"iana\",\"extensions\":[\"mmr\"]},\"image/vnd.fujixerox.edmics-rlc\":{\"source\":\"iana\",\"extensions\":[\"rlc\"]},\"image/vnd.globalgraphics.pgb\":{\"source\":\"iana\"},\"image/vnd.microsoft.icon\":{\"source\":\"iana\",\"extensions\":[\"ico\"]},\"image/vnd.mix\":{\"source\":\"iana\"},\"image/vnd.mozilla.apng\":{\"source\":\"iana\"},\"image/vnd.ms-dds\":{\"extensions\":[\"dds\"]},\"image/vnd.ms-modi\":{\"source\":\"iana\",\"extensions\":[\"mdi\"]},\"image/vnd.ms-photo\":{\"source\":\"apache\",\"extensions\":[\"wdp\"]},\"image/vnd.net-fpx\":{\"source\":\"iana\",\"extensions\":[\"npx\"]},\"image/vnd.radiance\":{\"source\":\"iana\"},\"image/vnd.sealed.png\":{\"source\":\"iana\"},\"image/vnd.sealedmedia.softseal.gif\":{\"source\":\"iana\"},\"image/vnd.sealedmedia.softseal.jpg\":{\"source\":\"iana\"},\"image/vnd.svf\":{\"source\":\"iana\"},\"image/vnd.tencent.tap\":{\"source\":\"iana\",\"extensions\":[\"tap\"]},\"image/vnd.valve.source.texture\":{\"source\":\"iana\",\"extensions\":[\"vtf\"]},\"image/vnd.wap.wbmp\":{\"source\":\"iana\",\"extensions\":[\"wbmp\"]},\"image/vnd.xiff\":{\"source\":\"iana\",\"extensions\":[\"xif\"]},\"image/vnd.zbrush.pcx\":{\"source\":\"iana\",\"extensions\":[\"pcx\"]},\"image/webp\":{\"source\":\"apache\",\"extensions\":[\"webp\"]},\"image/wmf\":{\"source\":\"iana\",\"extensions\":[\"wmf\"]},\"image/x-3ds\":{\"source\":\"apache\",\"extensions\":[\"3ds\"]},\"image/x-cmu-raster\":{\"source\":\"apache\",\"extensions\":[\"ras\"]},\"image/x-cmx\":{\"source\":\"apache\",\"extensions\":[\"cmx\"]},\"image/x-freehand\":{\"source\":\"apache\",\"extensions\":[\"fh\",\"fhc\",\"fh4\",\"fh5\",\"fh7\"]},\"image/x-icon\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"ico\"]},\"image/x-jng\":{\"source\":\"nginx\",\"extensions\":[\"jng\"]},\"image/x-mrsid-image\":{\"source\":\"apache\",\"extensions\":[\"sid\"]},\"image/x-ms-bmp\":{\"source\":\"nginx\",\"compressible\":true,\"extensions\":[\"bmp\"]},\"image/x-pcx\":{\"source\":\"apache\",\"extensions\":[\"pcx\"]},\"image/x-pict\":{\"source\":\"apache\",\"extensions\":[\"pic\",\"pct\"]},\"image/x-portable-anymap\":{\"source\":\"apache\",\"extensions\":[\"pnm\"]},\"image/x-portable-bitmap\":{\"source\":\"apache\",\"extensions\":[\"pbm\"]},\"image/x-portable-graymap\":{\"source\":\"apache\",\"extensions\":[\"pgm\"]},\"image/x-portable-pixmap\":{\"source\":\"apache\",\"extensions\":[\"ppm\"]},\"image/x-rgb\":{\"source\":\"apache\",\"extensions\":[\"rgb\"]},\"image/x-tga\":{\"source\":\"apache\",\"extensions\":[\"tga\"]},\"image/x-xbitmap\":{\"source\":\"apache\",\"extensions\":[\"xbm\"]},\"image/x-xcf\":{\"compressible\":false},\"image/x-xpixmap\":{\"source\":\"apache\",\"extensions\":[\"xpm\"]},\"image/x-xwindowdump\":{\"source\":\"apache\",\"extensions\":[\"xwd\"]},\"message/cpim\":{\"source\":\"iana\"},\"message/delivery-status\":{\"source\":\"iana\"},\"message/disposition-notification\":{\"source\":\"iana\",\"extensions\":[\"disposition-notification\"]},\"message/external-body\":{\"source\":\"iana\"},\"message/feedback-report\":{\"source\":\"iana\"},\"message/global\":{\"source\":\"iana\",\"extensions\":[\"u8msg\"]},\"message/global-delivery-status\":{\"source\":\"iana\",\"extensions\":[\"u8dsn\"]},\"message/global-disposition-notification\":{\"source\":\"iana\",\"extensions\":[\"u8mdn\"]},\"message/global-headers\":{\"source\":\"iana\",\"extensions\":[\"u8hdr\"]},\"message/http\":{\"source\":\"iana\",\"compressible\":false},\"message/imdn+xml\":{\"source\":\"iana\",\"compressible\":true},\"message/news\":{\"source\":\"iana\"},\"message/partial\":{\"source\":\"iana\",\"compressible\":false},\"message/rfc822\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"eml\",\"mime\"]},\"message/s-http\":{\"source\":\"iana\"},\"message/sip\":{\"source\":\"iana\"},\"message/sipfrag\":{\"source\":\"iana\"},\"message/tracking-status\":{\"source\":\"iana\"},\"message/vnd.si.simp\":{\"source\":\"iana\"},\"message/vnd.wfa.wsc\":{\"source\":\"iana\",\"extensions\":[\"wsc\"]},\"model/3mf\":{\"source\":\"iana\",\"extensions\":[\"3mf\"]},\"model/gltf+json\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"gltf\"]},\"model/gltf-binary\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"glb\"]},\"model/iges\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"igs\",\"iges\"]},\"model/mesh\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"msh\",\"mesh\",\"silo\"]},\"model/stl\":{\"source\":\"iana\",\"extensions\":[\"stl\"]},\"model/vnd.collada+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"dae\"]},\"model/vnd.dwf\":{\"source\":\"iana\",\"extensions\":[\"dwf\"]},\"model/vnd.flatland.3dml\":{\"source\":\"iana\"},\"model/vnd.gdl\":{\"source\":\"iana\",\"extensions\":[\"gdl\"]},\"model/vnd.gs-gdl\":{\"source\":\"apache\"},\"model/vnd.gs.gdl\":{\"source\":\"iana\"},\"model/vnd.gtw\":{\"source\":\"iana\",\"extensions\":[\"gtw\"]},\"model/vnd.moml+xml\":{\"source\":\"iana\",\"compressible\":true},\"model/vnd.mts\":{\"source\":\"iana\",\"extensions\":[\"mts\"]},\"model/vnd.opengex\":{\"source\":\"iana\",\"extensions\":[\"ogex\"]},\"model/vnd.parasolid.transmit.binary\":{\"source\":\"iana\",\"extensions\":[\"x_b\"]},\"model/vnd.parasolid.transmit.text\":{\"source\":\"iana\",\"extensions\":[\"x_t\"]},\"model/vnd.rosette.annotated-data-model\":{\"source\":\"iana\"},\"model/vnd.usdz+zip\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"usdz\"]},\"model/vnd.valve.source.compiled-map\":{\"source\":\"iana\",\"extensions\":[\"bsp\"]},\"model/vnd.vtu\":{\"source\":\"iana\",\"extensions\":[\"vtu\"]},\"model/vrml\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"wrl\",\"vrml\"]},\"model/x3d+binary\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"x3db\",\"x3dbz\"]},\"model/x3d+fastinfoset\":{\"source\":\"iana\",\"extensions\":[\"x3db\"]},\"model/x3d+vrml\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"x3dv\",\"x3dvz\"]},\"model/x3d+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"x3d\",\"x3dz\"]},\"model/x3d-vrml\":{\"source\":\"iana\",\"extensions\":[\"x3dv\"]},\"multipart/alternative\":{\"source\":\"iana\",\"compressible\":false},\"multipart/appledouble\":{\"source\":\"iana\"},\"multipart/byteranges\":{\"source\":\"iana\"},\"multipart/digest\":{\"source\":\"iana\"},\"multipart/encrypted\":{\"source\":\"iana\",\"compressible\":false},\"multipart/form-data\":{\"source\":\"iana\",\"compressible\":false},\"multipart/header-set\":{\"source\":\"iana\"},\"multipart/mixed\":{\"source\":\"iana\"},\"multipart/multilingual\":{\"source\":\"iana\"},\"multipart/parallel\":{\"source\":\"iana\"},\"multipart/related\":{\"source\":\"iana\",\"compressible\":false},\"multipart/report\":{\"source\":\"iana\"},\"multipart/signed\":{\"source\":\"iana\",\"compressible\":false},\"multipart/vnd.bint.med-plus\":{\"source\":\"iana\"},\"multipart/voice-message\":{\"source\":\"iana\"},\"multipart/x-mixed-replace\":{\"source\":\"iana\"},\"text/1d-interleaved-parityfec\":{\"source\":\"iana\"},\"text/cache-manifest\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"appcache\",\"manifest\"]},\"text/calendar\":{\"source\":\"iana\",\"extensions\":[\"ics\",\"ifb\"]},\"text/calender\":{\"compressible\":true},\"text/cmd\":{\"compressible\":true},\"text/coffeescript\":{\"extensions\":[\"coffee\",\"litcoffee\"]},\"text/css\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"css\"]},\"text/csv\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"csv\"]},\"text/csv-schema\":{\"source\":\"iana\"},\"text/directory\":{\"source\":\"iana\"},\"text/dns\":{\"source\":\"iana\"},\"text/ecmascript\":{\"source\":\"iana\"},\"text/encaprtp\":{\"source\":\"iana\"},\"text/enriched\":{\"source\":\"iana\"},\"text/flexfec\":{\"source\":\"iana\"},\"text/fwdred\":{\"source\":\"iana\"},\"text/grammar-ref-list\":{\"source\":\"iana\"},\"text/html\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"html\",\"htm\",\"shtml\"]},\"text/jade\":{\"extensions\":[\"jade\"]},\"text/javascript\":{\"source\":\"iana\",\"compressible\":true},\"text/jcr-cnd\":{\"source\":\"iana\"},\"text/jsx\":{\"compressible\":true,\"extensions\":[\"jsx\"]},\"text/less\":{\"compressible\":true,\"extensions\":[\"less\"]},\"text/markdown\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"markdown\",\"md\"]},\"text/mathml\":{\"source\":\"nginx\",\"extensions\":[\"mml\"]},\"text/mdx\":{\"compressible\":true,\"extensions\":[\"mdx\"]},\"text/mizar\":{\"source\":\"iana\"},\"text/n3\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"n3\"]},\"text/parameters\":{\"source\":\"iana\"},\"text/parityfec\":{\"source\":\"iana\"},\"text/plain\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"txt\",\"text\",\"conf\",\"def\",\"list\",\"log\",\"in\",\"ini\"]},\"text/provenance-notation\":{\"source\":\"iana\"},\"text/prs.fallenstein.rst\":{\"source\":\"iana\"},\"text/prs.lines.tag\":{\"source\":\"iana\",\"extensions\":[\"dsc\"]},\"text/prs.prop.logic\":{\"source\":\"iana\"},\"text/raptorfec\":{\"source\":\"iana\"},\"text/red\":{\"source\":\"iana\"},\"text/rfc822-headers\":{\"source\":\"iana\"},\"text/richtext\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rtx\"]},\"text/rtf\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rtf\"]},\"text/rtp-enc-aescm128\":{\"source\":\"iana\"},\"text/rtploopback\":{\"source\":\"iana\"},\"text/rtx\":{\"source\":\"iana\"},\"text/sgml\":{\"source\":\"iana\",\"extensions\":[\"sgml\",\"sgm\"]},\"text/shex\":{\"extensions\":[\"shex\"]},\"text/slim\":{\"extensions\":[\"slim\",\"slm\"]},\"text/strings\":{\"source\":\"iana\"},\"text/stylus\":{\"extensions\":[\"stylus\",\"styl\"]},\"text/t140\":{\"source\":\"iana\"},\"text/tab-separated-values\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"tsv\"]},\"text/troff\":{\"source\":\"iana\",\"extensions\":[\"t\",\"tr\",\"roff\",\"man\",\"me\",\"ms\"]},\"text/turtle\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"extensions\":[\"ttl\"]},\"text/ulpfec\":{\"source\":\"iana\"},\"text/uri-list\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"uri\",\"uris\",\"urls\"]},\"text/vcard\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"vcard\"]},\"text/vnd.a\":{\"source\":\"iana\"},\"text/vnd.abc\":{\"source\":\"iana\"},\"text/vnd.ascii-art\":{\"source\":\"iana\"},\"text/vnd.curl\":{\"source\":\"iana\",\"extensions\":[\"curl\"]},\"text/vnd.curl.dcurl\":{\"source\":\"apache\",\"extensions\":[\"dcurl\"]},\"text/vnd.curl.mcurl\":{\"source\":\"apache\",\"extensions\":[\"mcurl\"]},\"text/vnd.curl.scurl\":{\"source\":\"apache\",\"extensions\":[\"scurl\"]},\"text/vnd.debian.copyright\":{\"source\":\"iana\"},\"text/vnd.dmclientscript\":{\"source\":\"iana\"},\"text/vnd.dvb.subtitle\":{\"source\":\"iana\",\"extensions\":[\"sub\"]},\"text/vnd.esmertec.theme-descriptor\":{\"source\":\"iana\"},\"text/vnd.ficlab.flt\":{\"source\":\"iana\"},\"text/vnd.fly\":{\"source\":\"iana\",\"extensions\":[\"fly\"]},\"text/vnd.fmi.flexstor\":{\"source\":\"iana\",\"extensions\":[\"flx\"]},\"text/vnd.gml\":{\"source\":\"iana\"},\"text/vnd.graphviz\":{\"source\":\"iana\",\"extensions\":[\"gv\"]},\"text/vnd.hgl\":{\"source\":\"iana\"},\"text/vnd.in3d.3dml\":{\"source\":\"iana\",\"extensions\":[\"3dml\"]},\"text/vnd.in3d.spot\":{\"source\":\"iana\",\"extensions\":[\"spot\"]},\"text/vnd.iptc.newsml\":{\"source\":\"iana\"},\"text/vnd.iptc.nitf\":{\"source\":\"iana\"},\"text/vnd.latex-z\":{\"source\":\"iana\"},\"text/vnd.motorola.reflex\":{\"source\":\"iana\"},\"text/vnd.ms-mediapackage\":{\"source\":\"iana\"},\"text/vnd.net2phone.commcenter.command\":{\"source\":\"iana\"},\"text/vnd.radisys.msml-basic-layout\":{\"source\":\"iana\"},\"text/vnd.senx.warpscript\":{\"source\":\"iana\"},\"text/vnd.si.uricatalogue\":{\"source\":\"iana\"},\"text/vnd.sosi\":{\"source\":\"iana\"},\"text/vnd.sun.j2me.app-descriptor\":{\"source\":\"iana\",\"extensions\":[\"jad\"]},\"text/vnd.trolltech.linguist\":{\"source\":\"iana\"},\"text/vnd.wap.si\":{\"source\":\"iana\"},\"text/vnd.wap.sl\":{\"source\":\"iana\"},\"text/vnd.wap.wml\":{\"source\":\"iana\",\"extensions\":[\"wml\"]},\"text/vnd.wap.wmlscript\":{\"source\":\"iana\",\"extensions\":[\"wmls\"]},\"text/vtt\":{\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"vtt\"]},\"text/x-asm\":{\"source\":\"apache\",\"extensions\":[\"s\",\"asm\"]},\"text/x-c\":{\"source\":\"apache\",\"extensions\":[\"c\",\"cc\",\"cxx\",\"cpp\",\"h\",\"hh\",\"dic\"]},\"text/x-component\":{\"source\":\"nginx\",\"extensions\":[\"htc\"]},\"text/x-fortran\":{\"source\":\"apache\",\"extensions\":[\"f\",\"for\",\"f77\",\"f90\"]},\"text/x-gwt-rpc\":{\"compressible\":true},\"text/x-handlebars-template\":{\"extensions\":[\"hbs\"]},\"text/x-java-source\":{\"source\":\"apache\",\"extensions\":[\"java\"]},\"text/x-jquery-tmpl\":{\"compressible\":true},\"text/x-lua\":{\"extensions\":[\"lua\"]},\"text/x-markdown\":{\"compressible\":true,\"extensions\":[\"mkd\"]},\"text/x-nfo\":{\"source\":\"apache\",\"extensions\":[\"nfo\"]},\"text/x-opml\":{\"source\":\"apache\",\"extensions\":[\"opml\"]},\"text/x-org\":{\"compressible\":true,\"extensions\":[\"org\"]},\"text/x-pascal\":{\"source\":\"apache\",\"extensions\":[\"p\",\"pas\"]},\"text/x-processing\":{\"compressible\":true,\"extensions\":[\"pde\"]},\"text/x-sass\":{\"extensions\":[\"sass\"]},\"text/x-scss\":{\"extensions\":[\"scss\"]},\"text/x-setext\":{\"source\":\"apache\",\"extensions\":[\"etx\"]},\"text/x-sfv\":{\"source\":\"apache\",\"extensions\":[\"sfv\"]},\"text/x-suse-ymp\":{\"compressible\":true,\"extensions\":[\"ymp\"]},\"text/x-uuencode\":{\"source\":\"apache\",\"extensions\":[\"uu\"]},\"text/x-vcalendar\":{\"source\":\"apache\",\"extensions\":[\"vcs\"]},\"text/x-vcard\":{\"source\":\"apache\",\"extensions\":[\"vcf\"]},\"text/xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xml\"]},\"text/xml-external-parsed-entity\":{\"source\":\"iana\"},\"text/yaml\":{\"extensions\":[\"yaml\",\"yml\"]},\"video/1d-interleaved-parityfec\":{\"source\":\"iana\"},\"video/3gpp\":{\"source\":\"iana\",\"extensions\":[\"3gp\",\"3gpp\"]},\"video/3gpp-tt\":{\"source\":\"iana\"},\"video/3gpp2\":{\"source\":\"iana\",\"extensions\":[\"3g2\"]},\"video/bmpeg\":{\"source\":\"iana\"},\"video/bt656\":{\"source\":\"iana\"},\"video/celb\":{\"source\":\"iana\"},\"video/dv\":{\"source\":\"iana\"},\"video/encaprtp\":{\"source\":\"iana\"},\"video/flexfec\":{\"source\":\"iana\"},\"video/h261\":{\"source\":\"iana\",\"extensions\":[\"h261\"]},\"video/h263\":{\"source\":\"iana\",\"extensions\":[\"h263\"]},\"video/h263-1998\":{\"source\":\"iana\"},\"video/h263-2000\":{\"source\":\"iana\"},\"video/h264\":{\"source\":\"iana\",\"extensions\":[\"h264\"]},\"video/h264-rcdo\":{\"source\":\"iana\"},\"video/h264-svc\":{\"source\":\"iana\"},\"video/h265\":{\"source\":\"iana\"},\"video/iso.segment\":{\"source\":\"iana\"},\"video/jpeg\":{\"source\":\"iana\",\"extensions\":[\"jpgv\"]},\"video/jpeg2000\":{\"source\":\"iana\"},\"video/jpm\":{\"source\":\"apache\",\"extensions\":[\"jpm\",\"jpgm\"]},\"video/mj2\":{\"source\":\"iana\",\"extensions\":[\"mj2\",\"mjp2\"]},\"video/mp1s\":{\"source\":\"iana\"},\"video/mp2p\":{\"source\":\"iana\"},\"video/mp2t\":{\"source\":\"iana\",\"extensions\":[\"ts\"]},\"video/mp4\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"mp4\",\"mp4v\",\"mpg4\"]},\"video/mp4v-es\":{\"source\":\"iana\"},\"video/mpeg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"mpeg\",\"mpg\",\"mpe\",\"m1v\",\"m2v\"]},\"video/mpeg4-generic\":{\"source\":\"iana\"},\"video/mpv\":{\"source\":\"iana\"},\"video/nv\":{\"source\":\"iana\"},\"video/ogg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"ogv\"]},\"video/parityfec\":{\"source\":\"iana\"},\"video/pointer\":{\"source\":\"iana\"},\"video/quicktime\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"qt\",\"mov\"]},\"video/raptorfec\":{\"source\":\"iana\"},\"video/raw\":{\"source\":\"iana\"},\"video/rtp-enc-aescm128\":{\"source\":\"iana\"},\"video/rtploopback\":{\"source\":\"iana\"},\"video/rtx\":{\"source\":\"iana\"},\"video/smpte291\":{\"source\":\"iana\"},\"video/smpte292m\":{\"source\":\"iana\"},\"video/ulpfec\":{\"source\":\"iana\"},\"video/vc1\":{\"source\":\"iana\"},\"video/vc2\":{\"source\":\"iana\"},\"video/vnd.cctv\":{\"source\":\"iana\"},\"video/vnd.dece.hd\":{\"source\":\"iana\",\"extensions\":[\"uvh\",\"uvvh\"]},\"video/vnd.dece.mobile\":{\"source\":\"iana\",\"extensions\":[\"uvm\",\"uvvm\"]},\"video/vnd.dece.mp4\":{\"source\":\"iana\"},\"video/vnd.dece.pd\":{\"source\":\"iana\",\"extensions\":[\"uvp\",\"uvvp\"]},\"video/vnd.dece.sd\":{\"source\":\"iana\",\"extensions\":[\"uvs\",\"uvvs\"]},\"video/vnd.dece.video\":{\"source\":\"iana\",\"extensions\":[\"uvv\",\"uvvv\"]},\"video/vnd.directv.mpeg\":{\"source\":\"iana\"},\"video/vnd.directv.mpeg-tts\":{\"source\":\"iana\"},\"video/vnd.dlna.mpeg-tts\":{\"source\":\"iana\"},\"video/vnd.dvb.file\":{\"source\":\"iana\",\"extensions\":[\"dvb\"]},\"video/vnd.fvt\":{\"source\":\"iana\",\"extensions\":[\"fvt\"]},\"video/vnd.hns.video\":{\"source\":\"iana\"},\"video/vnd.iptvforum.1dparityfec-1010\":{\"source\":\"iana\"},\"video/vnd.iptvforum.1dparityfec-2005\":{\"source\":\"iana\"},\"video/vnd.iptvforum.2dparityfec-1010\":{\"source\":\"iana\"},\"video/vnd.iptvforum.2dparityfec-2005\":{\"source\":\"iana\"},\"video/vnd.iptvforum.ttsavc\":{\"source\":\"iana\"},\"video/vnd.iptvforum.ttsmpeg2\":{\"source\":\"iana\"},\"video/vnd.motorola.video\":{\"source\":\"iana\"},\"video/vnd.motorola.videop\":{\"source\":\"iana\"},\"video/vnd.mpegurl\":{\"source\":\"iana\",\"extensions\":[\"mxu\",\"m4u\"]},\"video/vnd.ms-playready.media.pyv\":{\"source\":\"iana\",\"extensions\":[\"pyv\"]},\"video/vnd.nokia.interleaved-multimedia\":{\"source\":\"iana\"},\"video/vnd.nokia.mp4vr\":{\"source\":\"iana\"},\"video/vnd.nokia.videovoip\":{\"source\":\"iana\"},\"video/vnd.objectvideo\":{\"source\":\"iana\"},\"video/vnd.radgamettools.bink\":{\"source\":\"iana\"},\"video/vnd.radgamettools.smacker\":{\"source\":\"iana\"},\"video/vnd.sealed.mpeg1\":{\"source\":\"iana\"},\"video/vnd.sealed.mpeg4\":{\"source\":\"iana\"},\"video/vnd.sealed.swf\":{\"source\":\"iana\"},\"video/vnd.sealedmedia.softseal.mov\":{\"source\":\"iana\"},\"video/vnd.uvvu.mp4\":{\"source\":\"iana\",\"extensions\":[\"uvu\",\"uvvu\"]},\"video/vnd.vivo\":{\"source\":\"iana\",\"extensions\":[\"viv\"]},\"video/vnd.youtube.yt\":{\"source\":\"iana\"},\"video/vp8\":{\"source\":\"iana\"},\"video/webm\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"webm\"]},\"video/x-f4v\":{\"source\":\"apache\",\"extensions\":[\"f4v\"]},\"video/x-fli\":{\"source\":\"apache\",\"extensions\":[\"fli\"]},\"video/x-flv\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"flv\"]},\"video/x-m4v\":{\"source\":\"apache\",\"extensions\":[\"m4v\"]},\"video/x-matroska\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"mkv\",\"mk3d\",\"mks\"]},\"video/x-mng\":{\"source\":\"apache\",\"extensions\":[\"mng\"]},\"video/x-ms-asf\":{\"source\":\"apache\",\"extensions\":[\"asf\",\"asx\"]},\"video/x-ms-vob\":{\"source\":\"apache\",\"extensions\":[\"vob\"]},\"video/x-ms-wm\":{\"source\":\"apache\",\"extensions\":[\"wm\"]},\"video/x-ms-wmv\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"wmv\"]},\"video/x-ms-wmx\":{\"source\":\"apache\",\"extensions\":[\"wmx\"]},\"video/x-ms-wvx\":{\"source\":\"apache\",\"extensions\":[\"wvx\"]},\"video/x-msvideo\":{\"source\":\"apache\",\"extensions\":[\"avi\"]},\"video/x-sgi-movie\":{\"source\":\"apache\",\"extensions\":[\"movie\"]},\"video/x-smv\":{\"source\":\"apache\",\"extensions\":[\"smv\"]},\"x-conference/x-cooltalk\":{\"source\":\"apache\",\"extensions\":[\"ice\"]},\"x-shader/x-fragment\":{\"compressible\":true},\"x-shader/x-vertex\":{\"compressible\":true}}"); /***/ }), /* 1064 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var lodash = __webpack_require__(1065); var isPromise = __webpack_require__(1066); module.exports = function (adapter) { if (typeof adapter !== 'object') { throw new Error('An adapter must be provided, see https://github.com/typicode/lowdb/#usage'); } // Create a fresh copy of lodash var _ = lodash.runInContext(); var db = _.chain({}); // Add write function to lodash // Calls save before returning result _.prototype.write = _.wrap(_.prototype.value, function (func) { var funcRes = func.apply(this); return db.write(funcRes); }); function plant(state) { db.__wrapped__ = state; return db; } // Lowdb API // Expose _ for mixins db._ = _; db.read = function () { var r = adapter.read(); return isPromise(r) ? r.then(plant) : plant(r); }; db.write = function (returnValue) { var w = adapter.write(db.getState()); return isPromise(w) ? w.then(function () { return returnValue; }) : returnValue; }; db.getState = function () { return db.__wrapped__; }; db.setState = function (state) { return plant(state); }; return db.read(); }; /***/ }), /* 1065 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_RESULT__;/** * @license * Lodash <https://lodash.com/> * Copyright OpenJS Foundation and other contributors <https://openjsf.org/> * Released under MIT license <https://lodash.com/license> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ ;(function() { /** Used as a safe reference for `undefined` in pre-ES5 environments. */ var undefined; /** Used as the semantic version number. */ var VERSION = '4.17.15'; /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; /** Error message constants. */ var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', FUNC_ERROR_TEXT = 'Expected a function'; /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; /** Used as the maximum memoize cache size. */ var MAX_MEMOIZE_SIZE = 500; /** Used as the internal argument placeholder. */ var PLACEHOLDER = '__lodash_placeholder__'; /** Used to compose bitmasks for cloning. */ var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4; /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512; /** Used as default options for `_.truncate`. */ var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = '...'; /** Used to detect hot functions by number of calls within a span of milliseconds. */ var HOT_COUNT = 800, HOT_SPAN = 16; /** Used to indicate the type of lazy iteratees. */ var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3; /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 1.7976931348623157e+308, NAN = 0 / 0; /** Used as references for the maximum length and index of an array. */ var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; /** Used to associate wrap methods with their bit flags. */ var wrapFlags = [ ['ary', WRAP_ARY_FLAG], ['bind', WRAP_BIND_FLAG], ['bindKey', WRAP_BIND_KEY_FLAG], ['curry', WRAP_CURRY_FLAG], ['curryRight', WRAP_CURRY_RIGHT_FLAG], ['flip', WRAP_FLIP_FLAG], ['partial', WRAP_PARTIAL_FLAG], ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], ['rearg', WRAP_REARG_FLAG] ]; /** `Object#toString` result references. */ var argsTag = '[object Arguments]', arrayTag = '[object Array]', asyncTag = '[object AsyncFunction]', boolTag = '[object Boolean]', dateTag = '[object Date]', domExcTag = '[object DOMException]', errorTag = '[object Error]', funcTag = '[object Function]', genTag = '[object GeneratorFunction]', mapTag = '[object Map]', numberTag = '[object Number]', nullTag = '[object Null]', objectTag = '[object Object]', promiseTag = '[object Promise]', proxyTag = '[object Proxy]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', symbolTag = '[object Symbol]', undefinedTag = '[object Undefined]', weakMapTag = '[object WeakMap]', weakSetTag = '[object WeakSet]'; var arrayBufferTag = '[object ArrayBuffer]', dataViewTag = '[object DataView]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', int16Tag = '[object Int16Array]', int32Tag = '[object Int32Array]', uint8Tag = '[object Uint8Array]', uint8ClampedTag = '[object Uint8ClampedArray]', uint16Tag = '[object Uint16Array]', uint32Tag = '[object Uint32Array]'; /** Used to match empty string literals in compiled template source. */ var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; /** Used to match HTML entities and HTML characters. */ var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source); /** Used to match template delimiters. */ var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g; /** Used to match property names within property paths. */ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; /** * Used to match `RegExp` * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source); /** Used to match leading and trailing whitespace. */ var reTrim = /^\s+|\s+$/g, reTrimStart = /^\s+/, reTrimEnd = /\s+$/; /** Used to match wrap detail comments. */ var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /; /** Used to match words composed of alphanumeric characters. */ var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; /** Used to match backslashes in property paths. */ var reEscapeChar = /\\(\\)?/g; /** * Used to match * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). */ var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; /** Used to match `RegExp` flags from their coerced string values. */ var reFlags = /\w*$/; /** Used to detect bad signed hexadecimal string values. */ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; /** Used to detect binary string values. */ var reIsBinary = /^0b[01]+$/i; /** Used to detect host constructors (Safari). */ var reIsHostCtor = /^\[object .+?Constructor\]$/; /** Used to detect octal string values. */ var reIsOctal = /^0o[0-7]+$/i; /** Used to detect unsigned integer values. */ var reIsUint = /^(?:0|[1-9]\d*)$/; /** Used to match Latin Unicode letters (excluding mathematical operators). */ var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; /** Used to ensure capturing order of template delimiters. */ var reNoMatch = /($^)/; /** Used to match unescaped characters in compiled string literals. */ var reUnescapedString = /['\n\r\u2028\u2029\\]/g; /** Used to compose unicode character classes. */ var rsAstralRange = '\\ud800-\\udfff', rsComboMarksRange = '\\u0300-\\u036f', reComboHalfMarksRange = '\\ufe20-\\ufe2f', rsComboSymbolsRange = '\\u20d0-\\u20ff', rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = '\\u2700-\\u27bf', rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', rsPunctuationRange = '\\u2000-\\u206f', rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', rsVarRange = '\\ufe0e\\ufe0f', rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; /** Used to compose unicode capture groups. */ var rsApos = "['\u2019]", rsAstral = '[' + rsAstralRange + ']', rsBreak = '[' + rsBreakRange + ']', rsCombo = '[' + rsComboRange + ']', rsDigits = '\\d+', rsDingbat = '[' + rsDingbatRange + ']', rsLower = '[' + rsLowerRange + ']', rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', rsFitz = '\\ud83c[\\udffb-\\udfff]', rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', rsNonAstral = '[^' + rsAstralRange + ']', rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', rsUpper = '[' + rsUpperRange + ']', rsZWJ = '\\u200d'; /** Used to compose unicode regexes. */ var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', reOptMod = rsModifier + '?', rsOptVar = '[' + rsVarRange + ']?', rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; /** Used to match apostrophes. */ var reApos = RegExp(rsApos, 'g'); /** * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). */ var reComboMark = RegExp(rsCombo, 'g'); /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); /** Used to match complex or compound words. */ var reUnicodeWord = RegExp([ rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, rsUpper + '+' + rsOptContrUpper, rsOrdUpper, rsOrdLower, rsDigits, rsEmoji ].join('|'), 'g'); /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); /** Used to detect strings that need a more robust regexp to match words. */ var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; /** Used to assign default `context` object properties. */ var contextProps = [ 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' ]; /** Used to make template sourceURLs easier to identify. */ var templateCounter = -1; /** Used to identify `toStringTag` values of typed arrays. */ var typedArrayTags = {}; typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; /** Used to identify `toStringTag` values supported by `_.clone`. */ var cloneableTags = {}; cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false; /** Used to map Latin Unicode letters to basic Latin letters. */ var deburredLetters = { // Latin-1 Supplement block. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', '\xc7': 'C', '\xe7': 'c', '\xd0': 'D', '\xf0': 'd', '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', '\xd1': 'N', '\xf1': 'n', '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', '\xc6': 'Ae', '\xe6': 'ae', '\xde': 'Th', '\xfe': 'th', '\xdf': 'ss', // Latin Extended-A block. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', '\u0134': 'J', '\u0135': 'j', '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', '\u0163': 't', '\u0165': 't', '\u0167': 't', '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', '\u0174': 'W', '\u0175': 'w', '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', '\u0132': 'IJ', '\u0133': 'ij', '\u0152': 'Oe', '\u0153': 'oe', '\u0149': "'n", '\u017f': 's' }; /** Used to map characters to HTML entities. */ var htmlEscapes = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }; /** Used to map HTML entities to characters. */ var htmlUnescapes = { '&': '&', '<': '<', '>': '>', '"': '"', ''': "'" }; /** Used to escape characters for inclusion in compiled string literals. */ var stringEscapes = { '\\': '\\', "'": "'", '\n': 'n', '\r': 'r', '\u2028': 'u2028', '\u2029': 'u2029' }; /** Built-in method references without a dependency on `root`. */ var freeParseFloat = parseFloat, freeParseInt = parseInt; /** Detect free variable `global` from Node.js. */ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; /** Detect free variable `self`. */ var freeSelf = typeof self == 'object' && self && self.Object === Object && self; /** Used as a reference to the global object. */ var root = freeGlobal || freeSelf || Function('return this')(); /** Detect free variable `exports`. */ var freeExports = true && exports && !exports.nodeType && exports; /** Detect free variable `module`. */ var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; /** Detect free variable `process` from Node.js. */ var freeProcess = moduleExports && freeGlobal.process; /** Used to access faster Node.js helpers. */ var nodeUtil = (function() { try { // Use `util.types` for Node.js 10+. var types = freeModule && freeModule.require && freeModule.require('util').types; if (types) { return types; } // Legacy `process.binding('util')` for Node.js < 10. return freeProcess && freeProcess.binding && freeProcess.binding('util'); } catch (e) {} }()); /* Node.js helper references. */ var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, nodeIsDate = nodeUtil && nodeUtil.isDate, nodeIsMap = nodeUtil && nodeUtil.isMap, nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, nodeIsSet = nodeUtil && nodeUtil.isSet, nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; /*--------------------------------------------------------------------------*/ /** * A faster alternative to `Function#apply`, this function invokes `func` * with the `this` binding of `thisArg` and the arguments of `args`. * * @private * @param {Function} func The function to invoke. * @param {*} thisArg The `this` binding of `func`. * @param {Array} args The arguments to invoke `func` with. * @returns {*} Returns the result of `func`. */ function apply(func, thisArg, args) { switch (args.length) { case 0: return func.call(thisArg); case 1: return func.call(thisArg, args[0]); case 2: return func.call(thisArg, args[0], args[1]); case 3: return func.call(thisArg, args[0], args[1], args[2]); } return func.apply(thisArg, args); } /** * A specialized version of `baseAggregator` for arrays. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} setter The function to set `accumulator` values. * @param {Function} iteratee The iteratee to transform keys. * @param {Object} accumulator The initial aggregated object. * @returns {Function} Returns `accumulator`. */ function arrayAggregator(array, setter, iteratee, accumulator) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { var value = array[index]; setter(accumulator, value, iteratee(value), array); } return accumulator; } /** * A specialized version of `_.forEach` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ function arrayEach(array, iteratee) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (iteratee(array[index], index, array) === false) { break; } } return array; } /** * A specialized version of `_.forEachRight` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ function arrayEachRight(array, iteratee) { var length = array == null ? 0 : array.length; while (length--) { if (iteratee(array[length], length, array) === false) { break; } } return array; } /** * A specialized version of `_.every` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if all elements pass the predicate check, * else `false`. */ function arrayEvery(array, predicate) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (!predicate(array[index], index, array)) { return false; } } return true; } /** * A specialized version of `_.filter` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns the new filtered array. */ function arrayFilter(array, predicate) { var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (predicate(value, index, array)) { result[resIndex++] = value; } } return result; } /** * A specialized version of `_.includes` for arrays without support for * specifying an index to search from. * * @private * @param {Array} [array] The array to inspect. * @param {*} target The value to search for. * @returns {boolean} Returns `true` if `target` is found, else `false`. */ function arrayIncludes(array, value) { var length = array == null ? 0 : array.length; return !!length && baseIndexOf(array, value, 0) > -1; } /** * This function is like `arrayIncludes` except that it accepts a comparator. * * @private * @param {Array} [array] The array to inspect. * @param {*} target The value to search for. * @param {Function} comparator The comparator invoked per element. * @returns {boolean} Returns `true` if `target` is found, else `false`. */ function arrayIncludesWith(array, value, comparator) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (comparator(value, array[index])) { return true; } } return false; } /** * A specialized version of `_.map` for arrays without support for iteratee * shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function arrayMap(array, iteratee) { var index = -1, length = array == null ? 0 : array.length, result = Array(length); while (++index < length) { result[index] = iteratee(array[index], index, array); } return result; } /** * Appends the elements of `values` to `array`. * * @private * @param {Array} array The array to modify. * @param {Array} values The values to append. * @returns {Array} Returns `array`. */ function arrayPush(array, values) { var index = -1, length = values.length, offset = array.length; while (++index < length) { array[offset + index] = values[index]; } return array; } /** * A specialized version of `_.reduce` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {boolean} [initAccum] Specify using the first element of `array` as * the initial value. * @returns {*} Returns the accumulated value. */ function arrayReduce(array, iteratee, accumulator, initAccum) { var index = -1, length = array == null ? 0 : array.length; if (initAccum && length) { accumulator = array[++index]; } while (++index < length) { accumulator = iteratee(accumulator, array[index], index, array); } return accumulator; } /** * A specialized version of `_.reduceRight` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {boolean} [initAccum] Specify using the last element of `array` as * the initial value. * @returns {*} Returns the accumulated value. */ function arrayReduceRight(array, iteratee, accumulator, initAccum) { var length = array == null ? 0 : array.length; if (initAccum && length) { accumulator = array[--length]; } while (length--) { accumulator = iteratee(accumulator, array[length], length, array); } return accumulator; } /** * A specialized version of `_.some` for arrays without support for iteratee * shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. */ function arraySome(array, predicate) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (predicate(array[index], index, array)) { return true; } } return false; } /** * Gets the size of an ASCII `string`. * * @private * @param {string} string The string inspect. * @returns {number} Returns the string size. */ var asciiSize = baseProperty('length'); /** * Converts an ASCII `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function asciiToArray(string) { return string.split(''); } /** * Splits an ASCII `string` into an array of its words. * * @private * @param {string} The string to inspect. * @returns {Array} Returns the words of `string`. */ function asciiWords(string) { return string.match(reAsciiWord) || []; } /** * The base implementation of methods like `_.findKey` and `_.findLastKey`, * without support for iteratee shorthands, which iterates over `collection` * using `eachFunc`. * * @private * @param {Array|Object} collection The collection to inspect. * @param {Function} predicate The function invoked per iteration. * @param {Function} eachFunc The function to iterate over `collection`. * @returns {*} Returns the found element or its key, else `undefined`. */ function baseFindKey(collection, predicate, eachFunc) { var result; eachFunc(collection, function(value, key, collection) { if (predicate(value, key, collection)) { result = key; return false; } }); return result; } /** * The base implementation of `_.findIndex` and `_.findLastIndex` without * support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Function} predicate The function invoked per iteration. * @param {number} fromIndex The index to search from. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseFindIndex(array, predicate, fromIndex, fromRight) { var length = array.length, index = fromIndex + (fromRight ? 1 : -1); while ((fromRight ? index-- : ++index < length)) { if (predicate(array[index], index, array)) { return index; } } return -1; } /** * The base implementation of `_.indexOf` without `fromIndex` bounds checks. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseIndexOf(array, value, fromIndex) { return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex); } /** * This function is like `baseIndexOf` except that it accepts a comparator. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @param {Function} comparator The comparator invoked per element. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseIndexOfWith(array, value, fromIndex, comparator) { var index = fromIndex - 1, length = array.length; while (++index < length) { if (comparator(array[index], value)) { return index; } } return -1; } /** * The base implementation of `_.isNaN` without support for number objects. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. */ function baseIsNaN(value) { return value !== value; } /** * The base implementation of `_.mean` and `_.meanBy` without support for * iteratee shorthands. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {number} Returns the mean. */ function baseMean(array, iteratee) { var length = array == null ? 0 : array.length; return length ? (baseSum(array, iteratee) / length) : NAN; } /** * The base implementation of `_.property` without support for deep paths. * * @private * @param {string} key The key of the property to get. * @returns {Function} Returns the new accessor function. */ function baseProperty(key) { return function(object) { return object == null ? undefined : object[key]; }; } /** * The base implementation of `_.propertyOf` without support for deep paths. * * @private * @param {Object} object The object to query. * @returns {Function} Returns the new accessor function. */ function basePropertyOf(object) { return function(key) { return object == null ? undefined : object[key]; }; } /** * The base implementation of `_.reduce` and `_.reduceRight`, without support * for iteratee shorthands, which iterates over `collection` using `eachFunc`. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} accumulator The initial value. * @param {boolean} initAccum Specify using the first or last element of * `collection` as the initial value. * @param {Function} eachFunc The function to iterate over `collection`. * @returns {*} Returns the accumulated value. */ function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { eachFunc(collection, function(value, index, collection) { accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection); }); return accumulator; } /** * The base implementation of `_.sortBy` which uses `comparer` to define the * sort order of `array` and replaces criteria objects with their corresponding * values. * * @private * @param {Array} array The array to sort. * @param {Function} comparer The function to define sort order. * @returns {Array} Returns `array`. */ function baseSortBy(array, comparer) { var length = array.length; array.sort(comparer); while (length--) { array[length] = array[length].value; } return array; } /** * The base implementation of `_.sum` and `_.sumBy` without support for * iteratee shorthands. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {number} Returns the sum. */ function baseSum(array, iteratee) { var result, index = -1, length = array.length; while (++index < length) { var current = iteratee(array[index]); if (current !== undefined) { result = result === undefined ? current : (result + current); } } return result; } /** * The base implementation of `_.times` without support for iteratee shorthands * or max array length checks. * * @private * @param {number} n The number of times to invoke `iteratee`. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the array of results. */ function baseTimes(n, iteratee) { var index = -1, result = Array(n); while (++index < n) { result[index] = iteratee(index); } return result; } /** * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array * of key-value pairs for `object` corresponding to the property names of `props`. * * @private * @param {Object} object The object to query. * @param {Array} props The property names to get values for. * @returns {Object} Returns the key-value pairs. */ function baseToPairs(object, props) { return arrayMap(props, function(key) { return [key, object[key]]; }); } /** * The base implementation of `_.unary` without support for storing metadata. * * @private * @param {Function} func The function to cap arguments for. * @returns {Function} Returns the new capped function. */ function baseUnary(func) { return function(value) { return func(value); }; } /** * The base implementation of `_.values` and `_.valuesIn` which creates an * array of `object` property values corresponding to the property names * of `props`. * * @private * @param {Object} object The object to query. * @param {Array} props The property names to get values for. * @returns {Object} Returns the array of property values. */ function baseValues(object, props) { return arrayMap(props, function(key) { return object[key]; }); } /** * Checks if a `cache` value for `key` exists. * * @private * @param {Object} cache The cache to query. * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function cacheHas(cache, key) { return cache.has(key); } /** * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol * that is not found in the character symbols. * * @private * @param {Array} strSymbols The string symbols to inspect. * @param {Array} chrSymbols The character symbols to find. * @returns {number} Returns the index of the first unmatched string symbol. */ function charsStartIndex(strSymbols, chrSymbols) { var index = -1, length = strSymbols.length; while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} return index; } /** * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol * that is not found in the character symbols. * * @private * @param {Array} strSymbols The string symbols to inspect. * @param {Array} chrSymbols The character symbols to find. * @returns {number} Returns the index of the last unmatched string symbol. */ function charsEndIndex(strSymbols, chrSymbols) { var index = strSymbols.length; while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} return index; } /** * Gets the number of `placeholder` occurrences in `array`. * * @private * @param {Array} array The array to inspect. * @param {*} placeholder The placeholder to search for. * @returns {number} Returns the placeholder count. */ function countHolders(array, placeholder) { var length = array.length, result = 0; while (length--) { if (array[length] === placeholder) { ++result; } } return result; } /** * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A * letters to basic Latin letters. * * @private * @param {string} letter The matched letter to deburr. * @returns {string} Returns the deburred letter. */ var deburrLetter = basePropertyOf(deburredLetters); /** * Used by `_.escape` to convert characters to HTML entities. * * @private * @param {string} chr The matched character to escape. * @returns {string} Returns the escaped character. */ var escapeHtmlChar = basePropertyOf(htmlEscapes); /** * Used by `_.template` to escape characters for inclusion in compiled string literals. * * @private * @param {string} chr The matched character to escape. * @returns {string} Returns the escaped character. */ function escapeStringChar(chr) { return '\\' + stringEscapes[chr]; } /** * Gets the value at `key` of `object`. * * @private * @param {Object} [object] The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function getValue(object, key) { return object == null ? undefined : object[key]; } /** * Checks if `string` contains Unicode symbols. * * @private * @param {string} string The string to inspect. * @returns {boolean} Returns `true` if a symbol is found, else `false`. */ function hasUnicode(string) { return reHasUnicode.test(string); } /** * Checks if `string` contains a word composed of Unicode symbols. * * @private * @param {string} string The string to inspect. * @returns {boolean} Returns `true` if a word is found, else `false`. */ function hasUnicodeWord(string) { return reHasUnicodeWord.test(string); } /** * Converts `iterator` to an array. * * @private * @param {Object} iterator The iterator to convert. * @returns {Array} Returns the converted array. */ function iteratorToArray(iterator) { var data, result = []; while (!(data = iterator.next()).done) { result.push(data.value); } return result; } /** * Converts `map` to its key-value pairs. * * @private * @param {Object} map The map to convert. * @returns {Array} Returns the key-value pairs. */ function mapToArray(map) { var index = -1, result = Array(map.size); map.forEach(function(value, key) { result[++index] = [key, value]; }); return result; } /** * Creates a unary function that invokes `func` with its argument transformed. * * @private * @param {Function} func The function to wrap. * @param {Function} transform The argument transform. * @returns {Function} Returns the new function. */ function overArg(func, transform) { return function(arg) { return func(transform(arg)); }; } /** * Replaces all `placeholder` elements in `array` with an internal placeholder * and returns an array of their indexes. * * @private * @param {Array} array The array to modify. * @param {*} placeholder The placeholder to replace. * @returns {Array} Returns the new array of placeholder indexes. */ function replaceHolders(array, placeholder) { var index = -1, length = array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (value === placeholder || value === PLACEHOLDER) { array[index] = PLACEHOLDER; result[resIndex++] = index; } } return result; } /** * Converts `set` to an array of its values. * * @private * @param {Object} set The set to convert. * @returns {Array} Returns the values. */ function setToArray(set) { var index = -1, result = Array(set.size); set.forEach(function(value) { result[++index] = value; }); return result; } /** * Converts `set` to its value-value pairs. * * @private * @param {Object} set The set to convert. * @returns {Array} Returns the value-value pairs. */ function setToPairs(set) { var index = -1, result = Array(set.size); set.forEach(function(value) { result[++index] = [value, value]; }); return result; } /** * A specialized version of `_.indexOf` which performs strict equality * comparisons of values, i.e. `===`. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function strictIndexOf(array, value, fromIndex) { var index = fromIndex - 1, length = array.length; while (++index < length) { if (array[index] === value) { return index; } } return -1; } /** * A specialized version of `_.lastIndexOf` which performs strict equality * comparisons of values, i.e. `===`. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function strictLastIndexOf(array, value, fromIndex) { var index = fromIndex + 1; while (index--) { if (array[index] === value) { return index; } } return index; } /** * Gets the number of symbols in `string`. * * @private * @param {string} string The string to inspect. * @returns {number} Returns the string size. */ function stringSize(string) { return hasUnicode(string) ? unicodeSize(string) : asciiSize(string); } /** * Converts `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function stringToArray(string) { return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string); } /** * Used by `_.unescape` to convert HTML entities to characters. * * @private * @param {string} chr The matched character to unescape. * @returns {string} Returns the unescaped character. */ var unescapeHtmlChar = basePropertyOf(htmlUnescapes); /** * Gets the size of a Unicode `string`. * * @private * @param {string} string The string inspect. * @returns {number} Returns the string size. */ function unicodeSize(string) { var result = reUnicode.lastIndex = 0; while (reUnicode.test(string)) { ++result; } return result; } /** * Converts a Unicode `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function unicodeToArray(string) { return string.match(reUnicode) || []; } /** * Splits a Unicode `string` into an array of its words. * * @private * @param {string} The string to inspect. * @returns {Array} Returns the words of `string`. */ function unicodeWords(string) { return string.match(reUnicodeWord) || []; } /*--------------------------------------------------------------------------*/ /** * Create a new pristine `lodash` function using the `context` object. * * @static * @memberOf _ * @since 1.1.0 * @category Util * @param {Object} [context=root] The context object. * @returns {Function} Returns a new `lodash` function. * @example * * _.mixin({ 'foo': _.constant('foo') }); * * var lodash = _.runInContext(); * lodash.mixin({ 'bar': lodash.constant('bar') }); * * _.isFunction(_.foo); * // => true * _.isFunction(_.bar); * // => false * * lodash.isFunction(lodash.foo); * // => false * lodash.isFunction(lodash.bar); * // => true * * // Create a suped-up `defer` in Node.js. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; */ var runInContext = (function runInContext(context) { context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); /** Built-in constructor references. */ var Array = context.Array, Date = context.Date, Error = context.Error, Function = context.Function, Math = context.Math, Object = context.Object, RegExp = context.RegExp, String = context.String, TypeError = context.TypeError; /** Used for built-in method references. */ var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype; /** Used to detect overreaching core-js shims. */ var coreJsData = context['__core-js_shared__']; /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** Used to generate unique IDs. */ var idCounter = 0; /** Used to detect methods masquerading as native. */ var maskSrcKey = (function() { var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); return uid ? ('Symbol(src)_1.' + uid) : ''; }()); /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString = objectProto.toString; /** Used to infer the `Object` constructor. */ var objectCtorString = funcToString.call(Object); /** Used to restore the original `_` reference in `_.noConflict`. */ var oldDash = root._; /** Used to detect if a method is native. */ var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' ); /** Built-in value references. */ var Buffer = moduleExports ? context.Buffer : undefined, Symbol = context.Symbol, Uint8Array = context.Uint8Array, allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, getPrototype = overArg(Object.getPrototypeOf, Object), objectCreate = Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, symIterator = Symbol ? Symbol.iterator : undefined, symToStringTag = Symbol ? Symbol.toStringTag : undefined; var defineProperty = (function() { try { var func = getNative(Object, 'defineProperty'); func({}, '', {}); return func; } catch (e) {} }()); /** Mocked built-ins. */ var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date && Date.now !== root.Date.now && Date.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeCeil = Math.ceil, nativeFloor = Math.floor, nativeGetSymbols = Object.getOwnPropertySymbols, nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object.keys, Object), nativeMax = Math.max, nativeMin = Math.min, nativeNow = Date.now, nativeParseInt = context.parseInt, nativeRandom = Math.random, nativeReverse = arrayProto.reverse; /* Built-in method references that are verified to be native. */ var DataView = getNative(context, 'DataView'), Map = getNative(context, 'Map'), Promise = getNative(context, 'Promise'), Set = getNative(context, 'Set'), WeakMap = getNative(context, 'WeakMap'), nativeCreate = getNative(Object, 'create'); /** Used to store function metadata. */ var metaMap = WeakMap && new WeakMap; /** Used to lookup unminified function names. */ var realNames = {}; /** Used to detect maps, sets, and weakmaps. */ var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap); /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol ? Symbol.prototype : undefined, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, symbolToString = symbolProto ? symbolProto.toString : undefined; /*------------------------------------------------------------------------*/ /** * Creates a `lodash` object which wraps `value` to enable implicit method * chain sequences. Methods that operate on and return arrays, collections, * and functions can be chained together. Methods that retrieve a single value * or may return a primitive value will automatically end the chain sequence * and return the unwrapped value. Otherwise, the value must be unwrapped * with `_#value`. * * Explicit chain sequences, which must be unwrapped with `_#value`, may be * enabled using `_.chain`. * * The execution of chained methods is lazy, that is, it's deferred until * `_#value` is implicitly or explicitly called. * * Lazy evaluation allows several methods to support shortcut fusion. * Shortcut fusion is an optimization to merge iteratee calls; this avoids * the creation of intermediate arrays and can greatly reduce the number of * iteratee executions. Sections of a chain sequence qualify for shortcut * fusion if the section is applied to an array and iteratees accept only * one argument. The heuristic for whether a section qualifies for shortcut * fusion is subject to change. * * Chaining is supported in custom builds as long as the `_#value` method is * directly or indirectly included in the build. * * In addition to lodash methods, wrappers have `Array` and `String` methods. * * The wrapper `Array` methods are: * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` * * The wrapper `String` methods are: * `replace` and `split` * * The wrapper methods that support shortcut fusion are: * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` * * The chainable wrapper methods are: * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, * `zipObject`, `zipObjectDeep`, and `zipWith` * * The wrapper methods that are **not** chainable by default are: * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, * `upperFirst`, `value`, and `words` * * @name _ * @constructor * @category Seq * @param {*} value The value to wrap in a `lodash` instance. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * function square(n) { * return n * n; * } * * var wrapped = _([1, 2, 3]); * * // Returns an unwrapped value. * wrapped.reduce(_.add); * // => 6 * * // Returns a wrapped value. * var squares = wrapped.map(square); * * _.isArray(squares); * // => false * * _.isArray(squares.value()); * // => true */ function lodash(value) { if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { if (value instanceof LodashWrapper) { return value; } if (hasOwnProperty.call(value, '__wrapped__')) { return wrapperClone(value); } } return new LodashWrapper(value); } /** * The base implementation of `_.create` without support for assigning * properties to the created object. * * @private * @param {Object} proto The object to inherit from. * @returns {Object} Returns the new object. */ var baseCreate = (function() { function object() {} return function(proto) { if (!isObject(proto)) { return {}; } if (objectCreate) { return objectCreate(proto); } object.prototype = proto; var result = new object; object.prototype = undefined; return result; }; }()); /** * The function whose prototype chain sequence wrappers inherit from. * * @private */ function baseLodash() { // No operation performed. } /** * The base constructor for creating `lodash` wrapper objects. * * @private * @param {*} value The value to wrap. * @param {boolean} [chainAll] Enable explicit method chain sequences. */ function LodashWrapper(value, chainAll) { this.__wrapped__ = value; this.__actions__ = []; this.__chain__ = !!chainAll; this.__index__ = 0; this.__values__ = undefined; } /** * By default, the template delimiters used by lodash are like those in * embedded Ruby (ERB) as well as ES2015 template strings. Change the * following template settings to use alternative delimiters. * * @static * @memberOf _ * @type {Object} */ lodash.templateSettings = { /** * Used to detect `data` property values to be HTML-escaped. * * @memberOf _.templateSettings * @type {RegExp} */ 'escape': reEscape, /** * Used to detect code to be evaluated. * * @memberOf _.templateSettings * @type {RegExp} */ 'evaluate': reEvaluate, /** * Used to detect `data` property values to inject. * * @memberOf _.templateSettings * @type {RegExp} */ 'interpolate': reInterpolate, /** * Used to reference the data object in the template text. * * @memberOf _.templateSettings * @type {string} */ 'variable': '', /** * Used to import variables into the compiled template. * * @memberOf _.templateSettings * @type {Object} */ 'imports': { /** * A reference to the `lodash` function. * * @memberOf _.templateSettings.imports * @type {Function} */ '_': lodash } }; // Ensure wrappers are instances of `baseLodash`. lodash.prototype = baseLodash.prototype; lodash.prototype.constructor = lodash; LodashWrapper.prototype = baseCreate(baseLodash.prototype); LodashWrapper.prototype.constructor = LodashWrapper; /*------------------------------------------------------------------------*/ /** * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. * * @private * @constructor * @param {*} value The value to wrap. */ function LazyWrapper(value) { this.__wrapped__ = value; this.__actions__ = []; this.__dir__ = 1; this.__filtered__ = false; this.__iteratees__ = []; this.__takeCount__ = MAX_ARRAY_LENGTH; this.__views__ = []; } /** * Creates a clone of the lazy wrapper object. * * @private * @name clone * @memberOf LazyWrapper * @returns {Object} Returns the cloned `LazyWrapper` object. */ function lazyClone() { var result = new LazyWrapper(this.__wrapped__); result.__actions__ = copyArray(this.__actions__); result.__dir__ = this.__dir__; result.__filtered__ = this.__filtered__; result.__iteratees__ = copyArray(this.__iteratees__); result.__takeCount__ = this.__takeCount__; result.__views__ = copyArray(this.__views__); return result; } /** * Reverses the direction of lazy iteration. * * @private * @name reverse * @memberOf LazyWrapper * @returns {Object} Returns the new reversed `LazyWrapper` object. */ function lazyReverse() { if (this.__filtered__) { var result = new LazyWrapper(this); result.__dir__ = -1; result.__filtered__ = true; } else { result = this.clone(); result.__dir__ *= -1; } return result; } /** * Extracts the unwrapped value from its lazy wrapper. * * @private * @name value * @memberOf LazyWrapper * @returns {*} Returns the unwrapped value. */ function lazyValue() { var array = this.__wrapped__.value(), dir = this.__dir__, isArr = isArray(array), isRight = dir < 0, arrLength = isArr ? array.length : 0, view = getView(0, arrLength, this.__views__), start = view.start, end = view.end, length = end - start, index = isRight ? end : (start - 1), iteratees = this.__iteratees__, iterLength = iteratees.length, resIndex = 0, takeCount = nativeMin(length, this.__takeCount__); if (!isArr || (!isRight && arrLength == length && takeCount == length)) { return baseWrapperValue(array, this.__actions__); } var result = []; outer: while (length-- && resIndex < takeCount) { index += dir; var iterIndex = -1, value = array[index]; while (++iterIndex < iterLength) { var data = iteratees[iterIndex], iteratee = data.iteratee, type = data.type, computed = iteratee(value); if (type == LAZY_MAP_FLAG) { value = computed; } else if (!computed) { if (type == LAZY_FILTER_FLAG) { continue outer; } else { break outer; } } } result[resIndex++] = value; } return result; } // Ensure `LazyWrapper` is an instance of `baseLodash`. LazyWrapper.prototype = baseCreate(baseLodash.prototype); LazyWrapper.prototype.constructor = LazyWrapper; /*------------------------------------------------------------------------*/ /** * Creates a hash object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Hash(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the hash. * * @private * @name clear * @memberOf Hash */ function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; this.size = 0; } /** * Removes `key` and its value from the hash. * * @private * @name delete * @memberOf Hash * @param {Object} hash The hash to modify. * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function hashDelete(key) { var result = this.has(key) && delete this.__data__[key]; this.size -= result ? 1 : 0; return result; } /** * Gets the hash value for `key`. * * @private * @name get * @memberOf Hash * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function hashGet(key) { var data = this.__data__; if (nativeCreate) { var result = data[key]; return result === HASH_UNDEFINED ? undefined : result; } return hasOwnProperty.call(data, key) ? data[key] : undefined; } /** * Checks if a hash value for `key` exists. * * @private * @name has * @memberOf Hash * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function hashHas(key) { var data = this.__data__; return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); } /** * Sets the hash `key` to `value`. * * @private * @name set * @memberOf Hash * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the hash instance. */ function hashSet(key, value) { var data = this.__data__; this.size += this.has(key) ? 0 : 1; data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; return this; } // Add methods to `Hash`. Hash.prototype.clear = hashClear; Hash.prototype['delete'] = hashDelete; Hash.prototype.get = hashGet; Hash.prototype.has = hashHas; Hash.prototype.set = hashSet; /*------------------------------------------------------------------------*/ /** * Creates an list cache object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function ListCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the list cache. * * @private * @name clear * @memberOf ListCache */ function listCacheClear() { this.__data__ = []; this.size = 0; } /** * Removes `key` and its value from the list cache. * * @private * @name delete * @memberOf ListCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function listCacheDelete(key) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { return false; } var lastIndex = data.length - 1; if (index == lastIndex) { data.pop(); } else { splice.call(data, index, 1); } --this.size; return true; } /** * Gets the list cache value for `key`. * * @private * @name get * @memberOf ListCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function listCacheGet(key) { var data = this.__data__, index = assocIndexOf(data, key); return index < 0 ? undefined : data[index][1]; } /** * Checks if a list cache value for `key` exists. * * @private * @name has * @memberOf ListCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function listCacheHas(key) { return assocIndexOf(this.__data__, key) > -1; } /** * Sets the list cache `key` to `value`. * * @private * @name set * @memberOf ListCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the list cache instance. */ function listCacheSet(key, value) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { ++this.size; data.push([key, value]); } else { data[index][1] = value; } return this; } // Add methods to `ListCache`. ListCache.prototype.clear = listCacheClear; ListCache.prototype['delete'] = listCacheDelete; ListCache.prototype.get = listCacheGet; ListCache.prototype.has = listCacheHas; ListCache.prototype.set = listCacheSet; /*------------------------------------------------------------------------*/ /** * Creates a map cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function MapCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the map. * * @private * @name clear * @memberOf MapCache */ function mapCacheClear() { this.size = 0; this.__data__ = { 'hash': new Hash, 'map': new (Map || ListCache), 'string': new Hash }; } /** * Removes `key` and its value from the map. * * @private * @name delete * @memberOf MapCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function mapCacheDelete(key) { var result = getMapData(this, key)['delete'](key); this.size -= result ? 1 : 0; return result; } /** * Gets the map value for `key`. * * @private * @name get * @memberOf MapCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function mapCacheGet(key) { return getMapData(this, key).get(key); } /** * Checks if a map value for `key` exists. * * @private * @name has * @memberOf MapCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function mapCacheHas(key) { return getMapData(this, key).has(key); } /** * Sets the map `key` to `value`. * * @private * @name set * @memberOf MapCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the map cache instance. */ function mapCacheSet(key, value) { var data = getMapData(this, key), size = data.size; data.set(key, value); this.size += data.size == size ? 0 : 1; return this; } // Add methods to `MapCache`. MapCache.prototype.clear = mapCacheClear; MapCache.prototype['delete'] = mapCacheDelete; MapCache.prototype.get = mapCacheGet; MapCache.prototype.has = mapCacheHas; MapCache.prototype.set = mapCacheSet; /*------------------------------------------------------------------------*/ /** * * Creates an array cache object to store unique values. * * @private * @constructor * @param {Array} [values] The values to cache. */ function SetCache(values) { var index = -1, length = values == null ? 0 : values.length; this.__data__ = new MapCache; while (++index < length) { this.add(values[index]); } } /** * Adds `value` to the array cache. * * @private * @name add * @memberOf SetCache * @alias push * @param {*} value The value to cache. * @returns {Object} Returns the cache instance. */ function setCacheAdd(value) { this.__data__.set(value, HASH_UNDEFINED); return this; } /** * Checks if `value` is in the array cache. * * @private * @name has * @memberOf SetCache * @param {*} value The value to search for. * @returns {number} Returns `true` if `value` is found, else `false`. */ function setCacheHas(value) { return this.__data__.has(value); } // Add methods to `SetCache`. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; SetCache.prototype.has = setCacheHas; /*------------------------------------------------------------------------*/ /** * Creates a stack cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Stack(entries) { var data = this.__data__ = new ListCache(entries); this.size = data.size; } /** * Removes all key-value entries from the stack. * * @private * @name clear * @memberOf Stack */ function stackClear() { this.__data__ = new ListCache; this.size = 0; } /** * Removes `key` and its value from the stack. * * @private * @name delete * @memberOf Stack * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function stackDelete(key) { var data = this.__data__, result = data['delete'](key); this.size = data.size; return result; } /** * Gets the stack value for `key`. * * @private * @name get * @memberOf Stack * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function stackGet(key) { return this.__data__.get(key); } /** * Checks if a stack value for `key` exists. * * @private * @name has * @memberOf Stack * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function stackHas(key) { return this.__data__.has(key); } /** * Sets the stack `key` to `value`. * * @private * @name set * @memberOf Stack * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the stack cache instance. */ function stackSet(key, value) { var data = this.__data__; if (data instanceof ListCache) { var pairs = data.__data__; if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { pairs.push([key, value]); this.size = ++data.size; return this; } data = this.__data__ = new MapCache(pairs); } data.set(key, value); this.size = data.size; return this; } // Add methods to `Stack`. Stack.prototype.clear = stackClear; Stack.prototype['delete'] = stackDelete; Stack.prototype.get = stackGet; Stack.prototype.has = stackHas; Stack.prototype.set = stackSet; /*------------------------------------------------------------------------*/ /** * Creates an array of the enumerable property names of the array-like `value`. * * @private * @param {*} value The value to query. * @param {boolean} inherited Specify returning inherited property names. * @returns {Array} Returns the array of property names. */ function arrayLikeKeys(value, inherited) { var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length; for (var key in value) { if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && ( // Safari 9 has enumerable `arguments.length` in strict mode. key == 'length' || // Node.js 0.10 has enumerable non-index properties on buffers. (isBuff && (key == 'offset' || key == 'parent')) || // PhantomJS 2 has enumerable non-index properties on typed arrays. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || // Skip index properties. isIndex(key, length) ))) { result.push(key); } } return result; } /** * A specialized version of `_.sample` for arrays. * * @private * @param {Array} array The array to sample. * @returns {*} Returns the random element. */ function arraySample(array) { var length = array.length; return length ? array[baseRandom(0, length - 1)] : undefined; } /** * A specialized version of `_.sampleSize` for arrays. * * @private * @param {Array} array The array to sample. * @param {number} n The number of elements to sample. * @returns {Array} Returns the random elements. */ function arraySampleSize(array, n) { return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); } /** * A specialized version of `_.shuffle` for arrays. * * @private * @param {Array} array The array to shuffle. * @returns {Array} Returns the new shuffled array. */ function arrayShuffle(array) { return shuffleSelf(copyArray(array)); } /** * This function is like `assignValue` except that it doesn't assign * `undefined` values. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignMergeValue(object, key, value) { if ((value !== undefined && !eq(object[key], value)) || (value === undefined && !(key in object))) { baseAssignValue(object, key, value); } } /** * Assigns `value` to `key` of `object` if the existing value is not equivalent * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignValue(object, key, value) { var objValue = object[key]; if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || (value === undefined && !(key in object))) { baseAssignValue(object, key, value); } } /** * Gets the index at which the `key` is found in `array` of key-value pairs. * * @private * @param {Array} array The array to inspect. * @param {*} key The key to search for. * @returns {number} Returns the index of the matched value, else `-1`. */ function assocIndexOf(array, key) { var length = array.length; while (length--) { if (eq(array[length][0], key)) { return length; } } return -1; } /** * Aggregates elements of `collection` on `accumulator` with keys transformed * by `iteratee` and values set by `setter`. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} setter The function to set `accumulator` values. * @param {Function} iteratee The iteratee to transform keys. * @param {Object} accumulator The initial aggregated object. * @returns {Function} Returns `accumulator`. */ function baseAggregator(collection, setter, iteratee, accumulator) { baseEach(collection, function(value, key, collection) { setter(accumulator, value, iteratee(value), collection); }); return accumulator; } /** * The base implementation of `_.assign` without support for multiple sources * or `customizer` functions. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @returns {Object} Returns `object`. */ function baseAssign(object, source) { return object && copyObject(source, keys(source), object); } /** * The base implementation of `_.assignIn` without support for multiple sources * or `customizer` functions. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @returns {Object} Returns `object`. */ function baseAssignIn(object, source) { return object && copyObject(source, keysIn(source), object); } /** * The base implementation of `assignValue` and `assignMergeValue` without * value checks. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function baseAssignValue(object, key, value) { if (key == '__proto__' && defineProperty) { defineProperty(object, key, { 'configurable': true, 'enumerable': true, 'value': value, 'writable': true }); } else { object[key] = value; } } /** * The base implementation of `_.at` without support for individual paths. * * @private * @param {Object} object The object to iterate over. * @param {string[]} paths The property paths to pick. * @returns {Array} Returns the picked elements. */ function baseAt(object, paths) { var index = -1, length = paths.length, result = Array(length), skip = object == null; while (++index < length) { result[index] = skip ? undefined : get(object, paths[index]); } return result; } /** * The base implementation of `_.clamp` which doesn't coerce arguments. * * @private * @param {number} number The number to clamp. * @param {number} [lower] The lower bound. * @param {number} upper The upper bound. * @returns {number} Returns the clamped number. */ function baseClamp(number, lower, upper) { if (number === number) { if (upper !== undefined) { number = number <= upper ? number : upper; } if (lower !== undefined) { number = number >= lower ? number : lower; } } return number; } /** * The base implementation of `_.clone` and `_.cloneDeep` which tracks * traversed objects. * * @private * @param {*} value The value to clone. * @param {boolean} bitmask The bitmask flags. * 1 - Deep clone * 2 - Flatten inherited properties * 4 - Clone symbols * @param {Function} [customizer] The function to customize cloning. * @param {string} [key] The key of `value`. * @param {Object} [object] The parent object of `value`. * @param {Object} [stack] Tracks traversed objects and their clone counterparts. * @returns {*} Returns the cloned value. */ function baseClone(value, bitmask, customizer, key, object, stack) { var result, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG; if (customizer) { result = object ? customizer(value, key, object, stack) : customizer(value); } if (result !== undefined) { return result; } if (!isObject(value)) { return value; } var isArr = isArray(value); if (isArr) { result = initCloneArray(value); if (!isDeep) { return copyArray(value, result); } } else { var tag = getTag(value), isFunc = tag == funcTag || tag == genTag; if (isBuffer(value)) { return cloneBuffer(value, isDeep); } if (tag == objectTag || tag == argsTag || (isFunc && !object)) { result = (isFlat || isFunc) ? {} : initCloneObject(value); if (!isDeep) { return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value)); } } else { if (!cloneableTags[tag]) { return object ? value : {}; } result = initCloneByTag(value, tag, isDeep); } } // Check for circular references and return its corresponding clone. stack || (stack = new Stack); var stacked = stack.get(value); if (stacked) { return stacked; } stack.set(value, result); if (isSet(value)) { value.forEach(function(subValue) { result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); }); } else if (isMap(value)) { value.forEach(function(subValue, key) { result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); }); } var keysFunc = isFull ? (isFlat ? getAllKeysIn : getAllKeys) : (isFlat ? keysIn : keys); var props = isArr ? undefined : keysFunc(value); arrayEach(props || value, function(subValue, key) { if (props) { key = subValue; subValue = value[key]; } // Recursively populate clone (susceptible to call stack limits). assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); }); return result; } /** * The base implementation of `_.conforms` which doesn't clone `source`. * * @private * @param {Object} source The object of property predicates to conform to. * @returns {Function} Returns the new spec function. */ function baseConforms(source) { var props = keys(source); return function(object) { return baseConformsTo(object, source, props); }; } /** * The base implementation of `_.conformsTo` which accepts `props` to check. * * @private * @param {Object} object The object to inspect. * @param {Object} source The object of property predicates to conform to. * @returns {boolean} Returns `true` if `object` conforms, else `false`. */ function baseConformsTo(object, source, props) { var length = props.length; if (object == null) { return !length; } object = Object(object); while (length--) { var key = props[length], predicate = source[key], value = object[key]; if ((value === undefined && !(key in object)) || !predicate(value)) { return false; } } return true; } /** * The base implementation of `_.delay` and `_.defer` which accepts `args` * to provide to `func`. * * @private * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. * @param {Array} args The arguments to provide to `func`. * @returns {number|Object} Returns the timer id or timeout object. */ function baseDelay(func, wait, args) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } return setTimeout(function() { func.apply(undefined, args); }, wait); } /** * The base implementation of methods like `_.difference` without support * for excluding multiple arrays or iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Array} values The values to exclude. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of filtered values. */ function baseDifference(array, values, iteratee, comparator) { var index = -1, includes = arrayIncludes, isCommon = true, length = array.length, result = [], valuesLength = values.length; if (!length) { return result; } if (iteratee) { values = arrayMap(values, baseUnary(iteratee)); } if (comparator) { includes = arrayIncludesWith; isCommon = false; } else if (values.length >= LARGE_ARRAY_SIZE) { includes = cacheHas; isCommon = false; values = new SetCache(values); } outer: while (++index < length) { var value = array[index], computed = iteratee == null ? value : iteratee(value); value = (comparator || value !== 0) ? value : 0; if (isCommon && computed === computed) { var valuesIndex = valuesLength; while (valuesIndex--) { if (values[valuesIndex] === computed) { continue outer; } } result.push(value); } else if (!includes(values, computed, comparator)) { result.push(value); } } return result; } /** * The base implementation of `_.forEach` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array|Object} Returns `collection`. */ var baseEach = createBaseEach(baseForOwn); /** * The base implementation of `_.forEachRight` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array|Object} Returns `collection`. */ var baseEachRight = createBaseEach(baseForOwnRight, true); /** * The base implementation of `_.every` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if all elements pass the predicate check, * else `false` */ function baseEvery(collection, predicate) { var result = true; baseEach(collection, function(value, index, collection) { result = !!predicate(value, index, collection); return result; }); return result; } /** * The base implementation of methods like `_.max` and `_.min` which accepts a * `comparator` to determine the extremum value. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The iteratee invoked per iteration. * @param {Function} comparator The comparator used to compare values. * @returns {*} Returns the extremum value. */ function baseExtremum(array, iteratee, comparator) { var index = -1, length = array.length; while (++index < length) { var value = array[index], current = iteratee(value); if (current != null && (computed === undefined ? (current === current && !isSymbol(current)) : comparator(current, computed) )) { var computed = current, result = value; } } return result; } /** * The base implementation of `_.fill` without an iteratee call guard. * * @private * @param {Array} array The array to fill. * @param {*} value The value to fill `array` with. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns `array`. */ function baseFill(array, value, start, end) { var length = array.length; start = toInteger(start); if (start < 0) { start = -start > length ? 0 : (length + start); } end = (end === undefined || end > length) ? length : toInteger(end); if (end < 0) { end += length; } end = start > end ? 0 : toLength(end); while (start < end) { array[start++] = value; } return array; } /** * The base implementation of `_.filter` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns the new filtered array. */ function baseFilter(collection, predicate) { var result = []; baseEach(collection, function(value, index, collection) { if (predicate(value, index, collection)) { result.push(value); } }); return result; } /** * The base implementation of `_.flatten` with support for restricting flattening. * * @private * @param {Array} array The array to flatten. * @param {number} depth The maximum recursion depth. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. * @param {Array} [result=[]] The initial result value. * @returns {Array} Returns the new flattened array. */ function baseFlatten(array, depth, predicate, isStrict, result) { var index = -1, length = array.length; predicate || (predicate = isFlattenable); result || (result = []); while (++index < length) { var value = array[index]; if (depth > 0 && predicate(value)) { if (depth > 1) { // Recursively flatten arrays (susceptible to call stack limits). baseFlatten(value, depth - 1, predicate, isStrict, result); } else { arrayPush(result, value); } } else if (!isStrict) { result[result.length] = value; } } return result; } /** * The base implementation of `baseForOwn` which iterates over `object` * properties returned by `keysFunc` and invokes `iteratee` for each property. * Iteratee functions may exit iteration early by explicitly returning `false`. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ var baseFor = createBaseFor(); /** * This function is like `baseFor` except that it iterates over properties * in the opposite order. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ var baseForRight = createBaseFor(true); /** * The base implementation of `_.forOwn` without support for iteratee shorthands. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. */ function baseForOwn(object, iteratee) { return object && baseFor(object, iteratee, keys); } /** * The base implementation of `_.forOwnRight` without support for iteratee shorthands. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. */ function baseForOwnRight(object, iteratee) { return object && baseForRight(object, iteratee, keys); } /** * The base implementation of `_.functions` which creates an array of * `object` function property names filtered from `props`. * * @private * @param {Object} object The object to inspect. * @param {Array} props The property names to filter. * @returns {Array} Returns the function names. */ function baseFunctions(object, props) { return arrayFilter(props, function(key) { return isFunction(object[key]); }); } /** * The base implementation of `_.get` without support for default values. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @returns {*} Returns the resolved value. */ function baseGet(object, path) { path = castPath(path, object); var index = 0, length = path.length; while (object != null && index < length) { object = object[toKey(path[index++])]; } return (index && index == length) ? object : undefined; } /** * The base implementation of `getAllKeys` and `getAllKeysIn` which uses * `keysFunc` and `symbolsFunc` to get the enumerable property names and * symbols of `object`. * * @private * @param {Object} object The object to query. * @param {Function} keysFunc The function to get the keys of `object`. * @param {Function} symbolsFunc The function to get the symbols of `object`. * @returns {Array} Returns the array of property names and symbols. */ function baseGetAllKeys(object, keysFunc, symbolsFunc) { var result = keysFunc(object); return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); } /** * The base implementation of `getTag` without fallbacks for buggy environments. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ function baseGetTag(value) { if (value == null) { return value === undefined ? undefinedTag : nullTag; } return (symToStringTag && symToStringTag in Object(value)) ? getRawTag(value) : objectToString(value); } /** * The base implementation of `_.gt` which doesn't coerce arguments. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is greater than `other`, * else `false`. */ function baseGt(value, other) { return value > other; } /** * The base implementation of `_.has` without support for deep paths. * * @private * @param {Object} [object] The object to query. * @param {Array|string} key The key to check. * @returns {boolean} Returns `true` if `key` exists, else `false`. */ function baseHas(object, key) { return object != null && hasOwnProperty.call(object, key); } /** * The base implementation of `_.hasIn` without support for deep paths. * * @private * @param {Object} [object] The object to query. * @param {Array|string} key The key to check. * @returns {boolean} Returns `true` if `key` exists, else `false`. */ function baseHasIn(object, key) { return object != null && key in Object(object); } /** * The base implementation of `_.inRange` which doesn't coerce arguments. * * @private * @param {number} number The number to check. * @param {number} start The start of the range. * @param {number} end The end of the range. * @returns {boolean} Returns `true` if `number` is in the range, else `false`. */ function baseInRange(number, start, end) { return number >= nativeMin(start, end) && number < nativeMax(start, end); } /** * The base implementation of methods like `_.intersection`, without support * for iteratee shorthands, that accepts an array of arrays to inspect. * * @private * @param {Array} arrays The arrays to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of shared values. */ function baseIntersection(arrays, iteratee, comparator) { var includes = comparator ? arrayIncludesWith : arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array(othLength), maxLength = Infinity, result = []; while (othIndex--) { var array = arrays[othIndex]; if (othIndex && iteratee) { array = arrayMap(array, baseUnary(iteratee)); } maxLength = nativeMin(array.length, maxLength); caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) ? new SetCache(othIndex && array) : undefined; } array = arrays[0]; var index = -1, seen = caches[0]; outer: while (++index < length && result.length < maxLength) { var value = array[index], computed = iteratee ? iteratee(value) : value; value = (comparator || value !== 0) ? value : 0; if (!(seen ? cacheHas(seen, computed) : includes(result, computed, comparator) )) { othIndex = othLength; while (--othIndex) { var cache = caches[othIndex]; if (!(cache ? cacheHas(cache, computed) : includes(arrays[othIndex], computed, comparator)) ) { continue outer; } } if (seen) { seen.push(computed); } result.push(value); } } return result; } /** * The base implementation of `_.invert` and `_.invertBy` which inverts * `object` with values transformed by `iteratee` and set by `setter`. * * @private * @param {Object} object The object to iterate over. * @param {Function} setter The function to set `accumulator` values. * @param {Function} iteratee The iteratee to transform values. * @param {Object} accumulator The initial inverted object. * @returns {Function} Returns `accumulator`. */ function baseInverter(object, setter, iteratee, accumulator) { baseForOwn(object, function(value, key, object) { setter(accumulator, iteratee(value), key, object); }); return accumulator; } /** * The base implementation of `_.invoke` without support for individual * method arguments. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path of the method to invoke. * @param {Array} args The arguments to invoke the method with. * @returns {*} Returns the result of the invoked method. */ function baseInvoke(object, path, args) { path = castPath(path, object); object = parent(object, path); var func = object == null ? object : object[toKey(last(path))]; return func == null ? undefined : apply(func, object, args); } /** * The base implementation of `_.isArguments`. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, */ function baseIsArguments(value) { return isObjectLike(value) && baseGetTag(value) == argsTag; } /** * The base implementation of `_.isArrayBuffer` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. */ function baseIsArrayBuffer(value) { return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; } /** * The base implementation of `_.isDate` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a date object, else `false`. */ function baseIsDate(value) { return isObjectLike(value) && baseGetTag(value) == dateTag; } /** * The base implementation of `_.isEqual` which supports partial comparisons * and tracks traversed objects. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @param {boolean} bitmask The bitmask flags. * 1 - Unordered comparison * 2 - Partial comparison * @param {Function} [customizer] The function to customize comparisons. * @param {Object} [stack] Tracks traversed `value` and `other` objects. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. */ function baseIsEqual(value, other, bitmask, customizer, stack) { if (value === other) { return true; } if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { return value !== value && other !== other; } return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); } /** * A specialized version of `baseIsEqual` for arrays and objects which performs * deep comparisons and tracks traversed objects enabling objects with circular * references to be compared. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} [stack] Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other); objTag = objTag == argsTag ? objectTag : objTag; othTag = othTag == argsTag ? objectTag : othTag; var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag; if (isSameTag && isBuffer(object)) { if (!isBuffer(other)) { return false; } objIsArr = true; objIsObj = false; } if (isSameTag && !objIsObj) { stack || (stack = new Stack); return (objIsArr || isTypedArray(object)) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); } if (!(bitmask & COMPARE_PARTIAL_FLAG)) { var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); if (objIsWrapped || othIsWrapped) { var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other; stack || (stack = new Stack); return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); } } if (!isSameTag) { return false; } stack || (stack = new Stack); return equalObjects(object, other, bitmask, customizer, equalFunc, stack); } /** * The base implementation of `_.isMap` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a map, else `false`. */ function baseIsMap(value) { return isObjectLike(value) && getTag(value) == mapTag; } /** * The base implementation of `_.isMatch` without support for iteratee shorthands. * * @private * @param {Object} object The object to inspect. * @param {Object} source The object of property values to match. * @param {Array} matchData The property names, values, and compare flags to match. * @param {Function} [customizer] The function to customize comparisons. * @returns {boolean} Returns `true` if `object` is a match, else `false`. */ function baseIsMatch(object, source, matchData, customizer) { var index = matchData.length, length = index, noCustomizer = !customizer; if (object == null) { return !length; } object = Object(object); while (index--) { var data = matchData[index]; if ((noCustomizer && data[2]) ? data[1] !== object[data[0]] : !(data[0] in object) ) { return false; } } while (++index < length) { data = matchData[index]; var key = data[0], objValue = object[key], srcValue = data[1]; if (noCustomizer && data[2]) { if (objValue === undefined && !(key in object)) { return false; } } else { var stack = new Stack; if (customizer) { var result = customizer(objValue, srcValue, key, object, source, stack); } if (!(result === undefined ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result )) { return false; } } } return true; } /** * The base implementation of `_.isNative` without bad shim checks. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, * else `false`. */ function baseIsNative(value) { if (!isObject(value) || isMasked(value)) { return false; } var pattern = isFunction(value) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } /** * The base implementation of `_.isRegExp` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. */ function baseIsRegExp(value) { return isObjectLike(value) && baseGetTag(value) == regexpTag; } /** * The base implementation of `_.isSet` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a set, else `false`. */ function baseIsSet(value) { return isObjectLike(value) && getTag(value) == setTag; } /** * The base implementation of `_.isTypedArray` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. */ function baseIsTypedArray(value) { return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; } /** * The base implementation of `_.iteratee`. * * @private * @param {*} [value=_.identity] The value to convert to an iteratee. * @returns {Function} Returns the iteratee. */ function baseIteratee(value) { // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. if (typeof value == 'function') { return value; } if (value == null) { return identity; } if (typeof value == 'object') { return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); } return property(value); } /** * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function baseKeys(object) { if (!isPrototype(object)) { return nativeKeys(object); } var result = []; for (var key in Object(object)) { if (hasOwnProperty.call(object, key) && key != 'constructor') { result.push(key); } } return result; } /** * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function baseKeysIn(object) { if (!isObject(object)) { return nativeKeysIn(object); } var isProto = isPrototype(object), result = []; for (var key in object) { if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { result.push(key); } } return result; } /** * The base implementation of `_.lt` which doesn't coerce arguments. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is less than `other`, * else `false`. */ function baseLt(value, other) { return value < other; } /** * The base implementation of `_.map` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function baseMap(collection, iteratee) { var index = -1, result = isArrayLike(collection) ? Array(collection.length) : []; baseEach(collection, function(value, key, collection) { result[++index] = iteratee(value, key, collection); }); return result; } /** * The base implementation of `_.matches` which doesn't clone `source`. * * @private * @param {Object} source The object of property values to match. * @returns {Function} Returns the new spec function. */ function baseMatches(source) { var matchData = getMatchData(source); if (matchData.length == 1 && matchData[0][2]) { return matchesStrictComparable(matchData[0][0], matchData[0][1]); } return function(object) { return object === source || baseIsMatch(object, source, matchData); }; } /** * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. * * @private * @param {string} path The path of the property to get. * @param {*} srcValue The value to match. * @returns {Function} Returns the new spec function. */ function baseMatchesProperty(path, srcValue) { if (isKey(path) && isStrictComparable(srcValue)) { return matchesStrictComparable(toKey(path), srcValue); } return function(object) { var objValue = get(object, path); return (objValue === undefined && objValue === srcValue) ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); }; } /** * The base implementation of `_.merge` without support for multiple sources. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @param {number} srcIndex The index of `source`. * @param {Function} [customizer] The function to customize merged values. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. */ function baseMerge(object, source, srcIndex, customizer, stack) { if (object === source) { return; } baseFor(source, function(srcValue, key) { stack || (stack = new Stack); if (isObject(srcValue)) { baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); } else { var newValue = customizer ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) : undefined; if (newValue === undefined) { newValue = srcValue; } assignMergeValue(object, key, newValue); } }, keysIn); } /** * A specialized version of `baseMerge` for arrays and objects which performs * deep merges and tracks traversed objects enabling objects with circular * references to be merged. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @param {string} key The key of the value to merge. * @param {number} srcIndex The index of `source`. * @param {Function} mergeFunc The function to merge values. * @param {Function} [customizer] The function to customize assigned values. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. */ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue); if (stacked) { assignMergeValue(object, key, stacked); return; } var newValue = customizer ? customizer(objValue, srcValue, (key + ''), object, source, stack) : undefined; var isCommon = newValue === undefined; if (isCommon) { var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue); newValue = srcValue; if (isArr || isBuff || isTyped) { if (isArray(objValue)) { newValue = objValue; } else if (isArrayLikeObject(objValue)) { newValue = copyArray(objValue); } else if (isBuff) { isCommon = false; newValue = cloneBuffer(srcValue, true); } else if (isTyped) { isCommon = false; newValue = cloneTypedArray(srcValue, true); } else { newValue = []; } } else if (isPlainObject(srcValue) || isArguments(srcValue)) { newValue = objValue; if (isArguments(objValue)) { newValue = toPlainObject(objValue); } else if (!isObject(objValue) || isFunction(objValue)) { newValue = initCloneObject(srcValue); } } else { isCommon = false; } } if (isCommon) { // Recursively merge objects and arrays (susceptible to call stack limits). stack.set(srcValue, newValue); mergeFunc(newValue, srcValue, srcIndex, customizer, stack); stack['delete'](srcValue); } assignMergeValue(object, key, newValue); } /** * The base implementation of `_.nth` which doesn't coerce arguments. * * @private * @param {Array} array The array to query. * @param {number} n The index of the element to return. * @returns {*} Returns the nth element of `array`. */ function baseNth(array, n) { var length = array.length; if (!length) { return; } n += n < 0 ? length : 0; return isIndex(n, length) ? array[n] : undefined; } /** * The base implementation of `_.orderBy` without param guards. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. * @param {string[]} orders The sort orders of `iteratees`. * @returns {Array} Returns the new sorted array. */ function baseOrderBy(collection, iteratees, orders) { var index = -1; iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee())); var result = baseMap(collection, function(value, key, collection) { var criteria = arrayMap(iteratees, function(iteratee) { return iteratee(value); }); return { 'criteria': criteria, 'index': ++index, 'value': value }; }); return baseSortBy(result, function(object, other) { return compareMultiple(object, other, orders); }); } /** * The base implementation of `_.pick` without support for individual * property identifiers. * * @private * @param {Object} object The source object. * @param {string[]} paths The property paths to pick. * @returns {Object} Returns the new object. */ function basePick(object, paths) { return basePickBy(object, paths, function(value, path) { return hasIn(object, path); }); } /** * The base implementation of `_.pickBy` without support for iteratee shorthands. * * @private * @param {Object} object The source object. * @param {string[]} paths The property paths to pick. * @param {Function} predicate The function invoked per property. * @returns {Object} Returns the new object. */ function basePickBy(object, paths, predicate) { var index = -1, length = paths.length, result = {}; while (++index < length) { var path = paths[index], value = baseGet(object, path); if (predicate(value, path)) { baseSet(result, castPath(path, object), value); } } return result; } /** * A specialized version of `baseProperty` which supports deep paths. * * @private * @param {Array|string} path The path of the property to get. * @returns {Function} Returns the new accessor function. */ function basePropertyDeep(path) { return function(object) { return baseGet(object, path); }; } /** * The base implementation of `_.pullAllBy` without support for iteratee * shorthands. * * @private * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns `array`. */ function basePullAll(array, values, iteratee, comparator) { var indexOf = comparator ? baseIndexOfWith : baseIndexOf, index = -1, length = values.length, seen = array; if (array === values) { values = copyArray(values); } if (iteratee) { seen = arrayMap(array, baseUnary(iteratee)); } while (++index < length) { var fromIndex = 0, value = values[index], computed = iteratee ? iteratee(value) : value; while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { if (seen !== array) { splice.call(seen, fromIndex, 1); } splice.call(array, fromIndex, 1); } } return array; } /** * The base implementation of `_.pullAt` without support for individual * indexes or capturing the removed elements. * * @private * @param {Array} array The array to modify. * @param {number[]} indexes The indexes of elements to remove. * @returns {Array} Returns `array`. */ function basePullAt(array, indexes) { var length = array ? indexes.length : 0, lastIndex = length - 1; while (length--) { var index = indexes[length]; if (length == lastIndex || index !== previous) { var previous = index; if (isIndex(index)) { splice.call(array, index, 1); } else { baseUnset(array, index); } } } return array; } /** * The base implementation of `_.random` without support for returning * floating-point numbers. * * @private * @param {number} lower The lower bound. * @param {number} upper The upper bound. * @returns {number} Returns the random number. */ function baseRandom(lower, upper) { return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); } /** * The base implementation of `_.range` and `_.rangeRight` which doesn't * coerce arguments. * * @private * @param {number} start The start of the range. * @param {number} end The end of the range. * @param {number} step The value to increment or decrement by. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Array} Returns the range of numbers. */ function baseRange(start, end, step, fromRight) { var index = -1, length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), result = Array(length); while (length--) { result[fromRight ? length : ++index] = start; start += step; } return result; } /** * The base implementation of `_.repeat` which doesn't coerce arguments. * * @private * @param {string} string The string to repeat. * @param {number} n The number of times to repeat the string. * @returns {string} Returns the repeated string. */ function baseRepeat(string, n) { var result = ''; if (!string || n < 1 || n > MAX_SAFE_INTEGER) { return result; } // Leverage the exponentiation by squaring algorithm for a faster repeat. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. do { if (n % 2) { result += string; } n = nativeFloor(n / 2); if (n) { string += string; } } while (n); return result; } /** * The base implementation of `_.rest` which doesn't validate or coerce arguments. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @returns {Function} Returns the new function. */ function baseRest(func, start) { return setToString(overRest(func, start, identity), func + ''); } /** * The base implementation of `_.sample`. * * @private * @param {Array|Object} collection The collection to sample. * @returns {*} Returns the random element. */ function baseSample(collection) { return arraySample(values(collection)); } /** * The base implementation of `_.sampleSize` without param guards. * * @private * @param {Array|Object} collection The collection to sample. * @param {number} n The number of elements to sample. * @returns {Array} Returns the random elements. */ function baseSampleSize(collection, n) { var array = values(collection); return shuffleSelf(array, baseClamp(n, 0, array.length)); } /** * The base implementation of `_.set`. * * @private * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {*} value The value to set. * @param {Function} [customizer] The function to customize path creation. * @returns {Object} Returns `object`. */ function baseSet(object, path, value, customizer) { if (!isObject(object)) { return object; } path = castPath(path, object); var index = -1, length = path.length, lastIndex = length - 1, nested = object; while (nested != null && ++index < length) { var key = toKey(path[index]), newValue = value; if (index != lastIndex) { var objValue = nested[key]; newValue = customizer ? customizer(objValue, key, nested) : undefined; if (newValue === undefined) { newValue = isObject(objValue) ? objValue : (isIndex(path[index + 1]) ? [] : {}); } } assignValue(nested, key, newValue); nested = nested[key]; } return object; } /** * The base implementation of `setData` without support for hot loop shorting. * * @private * @param {Function} func The function to associate metadata with. * @param {*} data The metadata. * @returns {Function} Returns `func`. */ var baseSetData = !metaMap ? identity : function(func, data) { metaMap.set(func, data); return func; }; /** * The base implementation of `setToString` without support for hot loop shorting. * * @private * @param {Function} func The function to modify. * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ var baseSetToString = !defineProperty ? identity : function(func, string) { return defineProperty(func, 'toString', { 'configurable': true, 'enumerable': false, 'value': constant(string), 'writable': true }); }; /** * The base implementation of `_.shuffle`. * * @private * @param {Array|Object} collection The collection to shuffle. * @returns {Array} Returns the new shuffled array. */ function baseShuffle(collection) { return shuffleSelf(values(collection)); } /** * The base implementation of `_.slice` without an iteratee call guard. * * @private * @param {Array} array The array to slice. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the slice of `array`. */ function baseSlice(array, start, end) { var index = -1, length = array.length; if (start < 0) { start = -start > length ? 0 : (length + start); } end = end > length ? length : end; if (end < 0) { end += length; } length = start > end ? 0 : ((end - start) >>> 0); start >>>= 0; var result = Array(length); while (++index < length) { result[index] = array[index + start]; } return result; } /** * The base implementation of `_.some` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. */ function baseSome(collection, predicate) { var result; baseEach(collection, function(value, index, collection) { result = predicate(value, index, collection); return !result; }); return !!result; } /** * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which * performs a binary search of `array` to determine the index at which `value` * should be inserted into `array` in order to maintain its sort order. * * @private * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @param {boolean} [retHighest] Specify returning the highest qualified index. * @returns {number} Returns the index at which `value` should be inserted * into `array`. */ function baseSortedIndex(array, value, retHighest) { var low = 0, high = array == null ? low : array.length; if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { while (low < high) { var mid = (low + high) >>> 1, computed = array[mid]; if (computed !== null && !isSymbol(computed) && (retHighest ? (computed <= value) : (computed < value))) { low = mid + 1; } else { high = mid; } } return high; } return baseSortedIndexBy(array, value, identity, retHighest); } /** * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` * which invokes `iteratee` for `value` and each element of `array` to compute * their sort ranking. The iteratee is invoked with one argument; (value). * * @private * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @param {Function} iteratee The iteratee invoked per element. * @param {boolean} [retHighest] Specify returning the highest qualified index. * @returns {number} Returns the index at which `value` should be inserted * into `array`. */ function baseSortedIndexBy(array, value, iteratee, retHighest) { value = iteratee(value); var low = 0, high = array == null ? 0 : array.length, valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol(value), valIsUndefined = value === undefined; while (low < high) { var mid = nativeFloor((low + high) / 2), computed = iteratee(array[mid]), othIsDefined = computed !== undefined, othIsNull = computed === null, othIsReflexive = computed === computed, othIsSymbol = isSymbol(computed); if (valIsNaN) { var setLow = retHighest || othIsReflexive; } else if (valIsUndefined) { setLow = othIsReflexive && (retHighest || othIsDefined); } else if (valIsNull) { setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); } else if (valIsSymbol) { setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); } else if (othIsNull || othIsSymbol) { setLow = false; } else { setLow = retHighest ? (computed <= value) : (computed < value); } if (setLow) { low = mid + 1; } else { high = mid; } } return nativeMin(high, MAX_ARRAY_INDEX); } /** * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without * support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @returns {Array} Returns the new duplicate free array. */ function baseSortedUniq(array, iteratee) { var index = -1, length = array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index], computed = iteratee ? iteratee(value) : value; if (!index || !eq(computed, seen)) { var seen = computed; result[resIndex++] = value === 0 ? 0 : value; } } return result; } /** * The base implementation of `_.toNumber` which doesn't ensure correct * conversions of binary, hexadecimal, or octal string values. * * @private * @param {*} value The value to process. * @returns {number} Returns the number. */ function baseToNumber(value) { if (typeof value == 'number') { return value; } if (isSymbol(value)) { return NAN; } return +value; } /** * The base implementation of `_.toString` which doesn't convert nullish * values to empty strings. * * @private * @param {*} value The value to process. * @returns {string} Returns the string. */ function baseToString(value) { // Exit early for strings to avoid a performance hit in some environments. if (typeof value == 'string') { return value; } if (isArray(value)) { // Recursively convert values (susceptible to call stack limits). return arrayMap(value, baseToString) + ''; } if (isSymbol(value)) { return symbolToString ? symbolToString.call(value) : ''; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } /** * The base implementation of `_.uniqBy` without support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new duplicate free array. */ function baseUniq(array, iteratee, comparator) { var index = -1, includes = arrayIncludes, length = array.length, isCommon = true, result = [], seen = result; if (comparator) { isCommon = false; includes = arrayIncludesWith; } else if (length >= LARGE_ARRAY_SIZE) { var set = iteratee ? null : createSet(array); if (set) { return setToArray(set); } isCommon = false; includes = cacheHas; seen = new SetCache; } else { seen = iteratee ? [] : result; } outer: while (++index < length) { var value = array[index], computed = iteratee ? iteratee(value) : value; value = (comparator || value !== 0) ? value : 0; if (isCommon && computed === computed) { var seenIndex = seen.length; while (seenIndex--) { if (seen[seenIndex] === computed) { continue outer; } } if (iteratee) { seen.push(computed); } result.push(value); } else if (!includes(seen, computed, comparator)) { if (seen !== result) { seen.push(computed); } result.push(value); } } return result; } /** * The base implementation of `_.unset`. * * @private * @param {Object} object The object to modify. * @param {Array|string} path The property path to unset. * @returns {boolean} Returns `true` if the property is deleted, else `false`. */ function baseUnset(object, path) { path = castPath(path, object); object = parent(object, path); return object == null || delete object[toKey(last(path))]; } /** * The base implementation of `_.update`. * * @private * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to update. * @param {Function} updater The function to produce the updated value. * @param {Function} [customizer] The function to customize path creation. * @returns {Object} Returns `object`. */ function baseUpdate(object, path, updater, customizer) { return baseSet(object, path, updater(baseGet(object, path)), customizer); } /** * The base implementation of methods like `_.dropWhile` and `_.takeWhile` * without support for iteratee shorthands. * * @private * @param {Array} array The array to query. * @param {Function} predicate The function invoked per iteration. * @param {boolean} [isDrop] Specify dropping elements instead of taking them. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Array} Returns the slice of `array`. */ function baseWhile(array, predicate, isDrop, fromRight) { var length = array.length, index = fromRight ? length : -1; while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {} return isDrop ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); } /** * The base implementation of `wrapperValue` which returns the result of * performing a sequence of actions on the unwrapped `value`, where each * successive action is supplied the return value of the previous. * * @private * @param {*} value The unwrapped value. * @param {Array} actions Actions to perform to resolve the unwrapped value. * @returns {*} Returns the resolved value. */ function baseWrapperValue(value, actions) { var result = value; if (result instanceof LazyWrapper) { result = result.value(); } return arrayReduce(actions, function(result, action) { return action.func.apply(action.thisArg, arrayPush([result], action.args)); }, result); } /** * The base implementation of methods like `_.xor`, without support for * iteratee shorthands, that accepts an array of arrays to inspect. * * @private * @param {Array} arrays The arrays to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of values. */ function baseXor(arrays, iteratee, comparator) { var length = arrays.length; if (length < 2) { return length ? baseUniq(arrays[0]) : []; } var index = -1, result = Array(length); while (++index < length) { var array = arrays[index], othIndex = -1; while (++othIndex < length) { if (othIndex != index) { result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); } } } return baseUniq(baseFlatten(result, 1), iteratee, comparator); } /** * This base implementation of `_.zipObject` which assigns values using `assignFunc`. * * @private * @param {Array} props The property identifiers. * @param {Array} values The property values. * @param {Function} assignFunc The function to assign values. * @returns {Object} Returns the new object. */ function baseZipObject(props, values, assignFunc) { var index = -1, length = props.length, valsLength = values.length, result = {}; while (++index < length) { var value = index < valsLength ? values[index] : undefined; assignFunc(result, props[index], value); } return result; } /** * Casts `value` to an empty array if it's not an array like object. * * @private * @param {*} value The value to inspect. * @returns {Array|Object} Returns the cast array-like object. */ function castArrayLikeObject(value) { return isArrayLikeObject(value) ? value : []; } /** * Casts `value` to `identity` if it's not a function. * * @private * @param {*} value The value to inspect. * @returns {Function} Returns cast function. */ function castFunction(value) { return typeof value == 'function' ? value : identity; } /** * Casts `value` to a path array if it's not one. * * @private * @param {*} value The value to inspect. * @param {Object} [object] The object to query keys on. * @returns {Array} Returns the cast property path array. */ function castPath(value, object) { if (isArray(value)) { return value; } return isKey(value, object) ? [value] : stringToPath(toString(value)); } /** * A `baseRest` alias which can be replaced with `identity` by module * replacement plugins. * * @private * @type {Function} * @param {Function} func The function to apply a rest parameter to. * @returns {Function} Returns the new function. */ var castRest = baseRest; /** * Casts `array` to a slice if it's needed. * * @private * @param {Array} array The array to inspect. * @param {number} start The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the cast slice. */ function castSlice(array, start, end) { var length = array.length; end = end === undefined ? length : end; return (!start && end >= length) ? array : baseSlice(array, start, end); } /** * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). * * @private * @param {number|Object} id The timer id or timeout object of the timer to clear. */ var clearTimeout = ctxClearTimeout || function(id) { return root.clearTimeout(id); }; /** * Creates a clone of `buffer`. * * @private * @param {Buffer} buffer The buffer to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Buffer} Returns the cloned buffer. */ function cloneBuffer(buffer, isDeep) { if (isDeep) { return buffer.slice(); } var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); buffer.copy(result); return result; } /** * Creates a clone of `arrayBuffer`. * * @private * @param {ArrayBuffer} arrayBuffer The array buffer to clone. * @returns {ArrayBuffer} Returns the cloned array buffer. */ function cloneArrayBuffer(arrayBuffer) { var result = new arrayBuffer.constructor(arrayBuffer.byteLength); new Uint8Array(result).set(new Uint8Array(arrayBuffer)); return result; } /** * Creates a clone of `dataView`. * * @private * @param {Object} dataView The data view to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned data view. */ function cloneDataView(dataView, isDeep) { var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); } /** * Creates a clone of `regexp`. * * @private * @param {Object} regexp The regexp to clone. * @returns {Object} Returns the cloned regexp. */ function cloneRegExp(regexp) { var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); result.lastIndex = regexp.lastIndex; return result; } /** * Creates a clone of the `symbol` object. * * @private * @param {Object} symbol The symbol object to clone. * @returns {Object} Returns the cloned symbol object. */ function cloneSymbol(symbol) { return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; } /** * Creates a clone of `typedArray`. * * @private * @param {Object} typedArray The typed array to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned typed array. */ function cloneTypedArray(typedArray, isDeep) { var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); } /** * Compares values to sort them in ascending order. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {number} Returns the sort order indicator for `value`. */ function compareAscending(value, other) { if (value !== other) { var valIsDefined = value !== undefined, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value); var othIsDefined = other !== undefined, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other); if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || (valIsNull && othIsDefined && othIsReflexive) || (!valIsDefined && othIsReflexive) || !valIsReflexive) { return 1; } if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || (othIsNull && valIsDefined && valIsReflexive) || (!othIsDefined && valIsReflexive) || !othIsReflexive) { return -1; } } return 0; } /** * Used by `_.orderBy` to compare multiple properties of a value to another * and stable sort them. * * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, * specify an order of "desc" for descending or "asc" for ascending sort order * of corresponding values. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {boolean[]|string[]} orders The order to sort by for each property. * @returns {number} Returns the sort order indicator for `object`. */ function compareMultiple(object, other, orders) { var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length; while (++index < length) { var result = compareAscending(objCriteria[index], othCriteria[index]); if (result) { if (index >= ordersLength) { return result; } var order = orders[index]; return result * (order == 'desc' ? -1 : 1); } } // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications // that causes it, under certain circumstances, to provide the same value for // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 // for more details. // // This also ensures a stable sort in V8 and other engines. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. return object.index - other.index; } /** * Creates an array that is the composition of partially applied arguments, * placeholders, and provided arguments into a single array of arguments. * * @private * @param {Array} args The provided arguments. * @param {Array} partials The arguments to prepend to those provided. * @param {Array} holders The `partials` placeholder indexes. * @params {boolean} [isCurried] Specify composing for a curried function. * @returns {Array} Returns the new array of composed arguments. */ function composeArgs(args, partials, holders, isCurried) { var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result = Array(leftLength + rangeLength), isUncurried = !isCurried; while (++leftIndex < leftLength) { result[leftIndex] = partials[leftIndex]; } while (++argsIndex < holdersLength) { if (isUncurried || argsIndex < argsLength) { result[holders[argsIndex]] = args[argsIndex]; } } while (rangeLength--) { result[leftIndex++] = args[argsIndex++]; } return result; } /** * This function is like `composeArgs` except that the arguments composition * is tailored for `_.partialRight`. * * @private * @param {Array} args The provided arguments. * @param {Array} partials The arguments to append to those provided. * @param {Array} holders The `partials` placeholder indexes. * @params {boolean} [isCurried] Specify composing for a curried function. * @returns {Array} Returns the new array of composed arguments. */ function composeArgsRight(args, partials, holders, isCurried) { var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result = Array(rangeLength + rightLength), isUncurried = !isCurried; while (++argsIndex < rangeLength) { result[argsIndex] = args[argsIndex]; } var offset = argsIndex; while (++rightIndex < rightLength) { result[offset + rightIndex] = partials[rightIndex]; } while (++holdersIndex < holdersLength) { if (isUncurried || argsIndex < argsLength) { result[offset + holders[holdersIndex]] = args[argsIndex++]; } } return result; } /** * Copies the values of `source` to `array`. * * @private * @param {Array} source The array to copy values from. * @param {Array} [array=[]] The array to copy values to. * @returns {Array} Returns `array`. */ function copyArray(source, array) { var index = -1, length = source.length; array || (array = Array(length)); while (++index < length) { array[index] = source[index]; } return array; } /** * Copies properties of `source` to `object`. * * @private * @param {Object} source The object to copy properties from. * @param {Array} props The property identifiers to copy. * @param {Object} [object={}] The object to copy properties to. * @param {Function} [customizer] The function to customize copied values. * @returns {Object} Returns `object`. */ function copyObject(source, props, object, customizer) { var isNew = !object; object || (object = {}); var index = -1, length = props.length; while (++index < length) { var key = props[index]; var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined; if (newValue === undefined) { newValue = source[key]; } if (isNew) { baseAssignValue(object, key, newValue); } else { assignValue(object, key, newValue); } } return object; } /** * Copies own symbols of `source` to `object`. * * @private * @param {Object} source The object to copy symbols from. * @param {Object} [object={}] The object to copy symbols to. * @returns {Object} Returns `object`. */ function copySymbols(source, object) { return copyObject(source, getSymbols(source), object); } /** * Copies own and inherited symbols of `source` to `object`. * * @private * @param {Object} source The object to copy symbols from. * @param {Object} [object={}] The object to copy symbols to. * @returns {Object} Returns `object`. */ function copySymbolsIn(source, object) { return copyObject(source, getSymbolsIn(source), object); } /** * Creates a function like `_.groupBy`. * * @private * @param {Function} setter The function to set accumulator values. * @param {Function} [initializer] The accumulator object initializer. * @returns {Function} Returns the new aggregator function. */ function createAggregator(setter, initializer) { return function(collection, iteratee) { var func = isArray(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {}; return func(collection, setter, getIteratee(iteratee, 2), accumulator); }; } /** * Creates a function like `_.assign`. * * @private * @param {Function} assigner The function to assign values. * @returns {Function} Returns the new assigner function. */ function createAssigner(assigner) { return baseRest(function(object, sources) { var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined, guard = length > 2 ? sources[2] : undefined; customizer = (assigner.length > 3 && typeof customizer == 'function') ? (length--, customizer) : undefined; if (guard && isIterateeCall(sources[0], sources[1], guard)) { customizer = length < 3 ? undefined : customizer; length = 1; } object = Object(object); while (++index < length) { var source = sources[index]; if (source) { assigner(object, source, index, customizer); } } return object; }); } /** * Creates a `baseEach` or `baseEachRight` function. * * @private * @param {Function} eachFunc The function to iterate over a collection. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function. */ function createBaseEach(eachFunc, fromRight) { return function(collection, iteratee) { if (collection == null) { return collection; } if (!isArrayLike(collection)) { return eachFunc(collection, iteratee); } var length = collection.length, index = fromRight ? length : -1, iterable = Object(collection); while ((fromRight ? index-- : ++index < length)) { if (iteratee(iterable[index], index, iterable) === false) { break; } } return collection; }; } /** * Creates a base function for methods like `_.forIn` and `_.forOwn`. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function. */ function createBaseFor(fromRight) { return function(object, iteratee, keysFunc) { var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length; while (length--) { var key = props[fromRight ? length : ++index]; if (iteratee(iterable[key], key, iterable) === false) { break; } } return object; }; } /** * Creates a function that wraps `func` to invoke it with the optional `this` * binding of `thisArg`. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} [thisArg] The `this` binding of `func`. * @returns {Function} Returns the new wrapped function. */ function createBind(func, bitmask, thisArg) { var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func); function wrapper() { var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; return fn.apply(isBind ? thisArg : this, arguments); } return wrapper; } /** * Creates a function like `_.lowerFirst`. * * @private * @param {string} methodName The name of the `String` case method to use. * @returns {Function} Returns the new case function. */ function createCaseFirst(methodName) { return function(string) { string = toString(string); var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined; var chr = strSymbols ? strSymbols[0] : string.charAt(0); var trailing = strSymbols ? castSlice(strSymbols, 1).join('') : string.slice(1); return chr[methodName]() + trailing; }; } /** * Creates a function like `_.camelCase`. * * @private * @param {Function} callback The function to combine each word. * @returns {Function} Returns the new compounder function. */ function createCompounder(callback) { return function(string) { return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); }; } /** * Creates a function that produces an instance of `Ctor` regardless of * whether it was invoked as part of a `new` expression or by `call` or `apply`. * * @private * @param {Function} Ctor The constructor to wrap. * @returns {Function} Returns the new wrapped function. */ function createCtor(Ctor) { return function() { // Use a `switch` statement to work with class constructors. See // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist // for more details. var args = arguments; switch (args.length) { case 0: return new Ctor; case 1: return new Ctor(args[0]); case 2: return new Ctor(args[0], args[1]); case 3: return new Ctor(args[0], args[1], args[2]); case 4: return new Ctor(args[0], args[1], args[2], args[3]); case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); } var thisBinding = baseCreate(Ctor.prototype), result = Ctor.apply(thisBinding, args); // Mimic the constructor's `return` behavior. // See https://es5.github.io/#x13.2.2 for more details. return isObject(result) ? result : thisBinding; }; } /** * Creates a function that wraps `func` to enable currying. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {number} arity The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createCurry(func, bitmask, arity) { var Ctor = createCtor(func); function wrapper() { var length = arguments.length, args = Array(length), index = length, placeholder = getHolder(wrapper); while (index--) { args[index] = arguments[index]; } var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) ? [] : replaceHolders(args, placeholder); length -= holders.length; if (length < arity) { return createRecurry( func, bitmask, createHybrid, wrapper.placeholder, undefined, args, holders, undefined, undefined, arity - length); } var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; return apply(fn, this, args); } return wrapper; } /** * Creates a `_.find` or `_.findLast` function. * * @private * @param {Function} findIndexFunc The function to find the collection index. * @returns {Function} Returns the new find function. */ function createFind(findIndexFunc) { return function(collection, predicate, fromIndex) { var iterable = Object(collection); if (!isArrayLike(collection)) { var iteratee = getIteratee(predicate, 3); collection = keys(collection); predicate = function(key) { return iteratee(iterable[key], key, iterable); }; } var index = findIndexFunc(collection, predicate, fromIndex); return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; }; } /** * Creates a `_.flow` or `_.flowRight` function. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new flow function. */ function createFlow(fromRight) { return flatRest(function(funcs) { var length = funcs.length, index = length, prereq = LodashWrapper.prototype.thru; if (fromRight) { funcs.reverse(); } while (index--) { var func = funcs[index]; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } if (prereq && !wrapper && getFuncName(func) == 'wrapper') { var wrapper = new LodashWrapper([], true); } } index = wrapper ? index : length; while (++index < length) { func = funcs[index]; var funcName = getFuncName(func), data = funcName == 'wrapper' ? getData(func) : undefined; if (data && isLaziable(data[0]) && data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data[4].length && data[9] == 1 ) { wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); } else { wrapper = (func.length == 1 && isLaziable(func)) ? wrapper[funcName]() : wrapper.thru(func); } } return function() { var args = arguments, value = args[0]; if (wrapper && args.length == 1 && isArray(value)) { return wrapper.plant(value).value(); } var index = 0, result = length ? funcs[index].apply(this, args) : value; while (++index < length) { result = funcs[index].call(this, result); } return result; }; }); } /** * Creates a function that wraps `func` to invoke it with optional `this` * binding of `thisArg`, partial application, and currying. * * @private * @param {Function|string} func The function or method name to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to prepend to those provided to * the new function. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [partialsRight] The arguments to append to those provided * to the new function. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { var isAry = bitmask & WRAP_ARY_FLAG, isBind = bitmask & WRAP_BIND_FLAG, isBindKey = bitmask & WRAP_BIND_KEY_FLAG, isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), isFlip = bitmask & WRAP_FLIP_FLAG, Ctor = isBindKey ? undefined : createCtor(func); function wrapper() { var length = arguments.length, args = Array(length), index = length; while (index--) { args[index] = arguments[index]; } if (isCurried) { var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder); } if (partials) { args = composeArgs(args, partials, holders, isCurried); } if (partialsRight) { args = composeArgsRight(args, partialsRight, holdersRight, isCurried); } length -= holdersCount; if (isCurried && length < arity) { var newHolders = replaceHolders(args, placeholder); return createRecurry( func, bitmask, createHybrid, wrapper.placeholder, thisArg, args, newHolders, argPos, ary, arity - length ); } var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func; length = args.length; if (argPos) { args = reorder(args, argPos); } else if (isFlip && length > 1) { args.reverse(); } if (isAry && ary < length) { args.length = ary; } if (this && this !== root && this instanceof wrapper) { fn = Ctor || createCtor(fn); } return fn.apply(thisBinding, args); } return wrapper; } /** * Creates a function like `_.invertBy`. * * @private * @param {Function} setter The function to set accumulator values. * @param {Function} toIteratee The function to resolve iteratees. * @returns {Function} Returns the new inverter function. */ function createInverter(setter, toIteratee) { return function(object, iteratee) { return baseInverter(object, setter, toIteratee(iteratee), {}); }; } /** * Creates a function that performs a mathematical operation on two values. * * @private * @param {Function} operator The function to perform the operation. * @param {number} [defaultValue] The value used for `undefined` arguments. * @returns {Function} Returns the new mathematical operation function. */ function createMathOperation(operator, defaultValue) { return function(value, other) { var result; if (value === undefined && other === undefined) { return defaultValue; } if (value !== undefined) { result = value; } if (other !== undefined) { if (result === undefined) { return other; } if (typeof value == 'string' || typeof other == 'string') { value = baseToString(value); other = baseToString(other); } else { value = baseToNumber(value); other = baseToNumber(other); } result = operator(value, other); } return result; }; } /** * Creates a function like `_.over`. * * @private * @param {Function} arrayFunc The function to iterate over iteratees. * @returns {Function} Returns the new over function. */ function createOver(arrayFunc) { return flatRest(function(iteratees) { iteratees = arrayMap(iteratees, baseUnary(getIteratee())); return baseRest(function(args) { var thisArg = this; return arrayFunc(iteratees, function(iteratee) { return apply(iteratee, thisArg, args); }); }); }); } /** * Creates the padding for `string` based on `length`. The `chars` string * is truncated if the number of characters exceeds `length`. * * @private * @param {number} length The padding length. * @param {string} [chars=' '] The string used as padding. * @returns {string} Returns the padding for `string`. */ function createPadding(length, chars) { chars = chars === undefined ? ' ' : baseToString(chars); var charsLength = chars.length; if (charsLength < 2) { return charsLength ? baseRepeat(chars, length) : chars; } var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); return hasUnicode(chars) ? castSlice(stringToArray(result), 0, length).join('') : result.slice(0, length); } /** * Creates a function that wraps `func` to invoke it with the `this` binding * of `thisArg` and `partials` prepended to the arguments it receives. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} thisArg The `this` binding of `func`. * @param {Array} partials The arguments to prepend to those provided to * the new function. * @returns {Function} Returns the new wrapped function. */ function createPartial(func, bitmask, thisArg, partials) { var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func); function wrapper() { var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array(leftLength + argsLength), fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; while (++leftIndex < leftLength) { args[leftIndex] = partials[leftIndex]; } while (argsLength--) { args[leftIndex++] = arguments[++argsIndex]; } return apply(fn, isBind ? thisArg : this, args); } return wrapper; } /** * Creates a `_.range` or `_.rangeRight` function. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new range function. */ function createRange(fromRight) { return function(start, end, step) { if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { end = step = undefined; } // Ensure the sign of `-0` is preserved. start = toFinite(start); if (end === undefined) { end = start; start = 0; } else { end = toFinite(end); } step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); return baseRange(start, end, step, fromRight); }; } /** * Creates a function that performs a relational operation on two values. * * @private * @param {Function} operator The function to perform the operation. * @returns {Function} Returns the new relational operation function. */ function createRelationalOperation(operator) { return function(value, other) { if (!(typeof value == 'string' && typeof other == 'string')) { value = toNumber(value); other = toNumber(other); } return operator(value, other); }; } /** * Creates a function that wraps `func` to continue currying. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {Function} wrapFunc The function to create the `func` wrapper. * @param {*} placeholder The placeholder value. * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to prepend to those provided to * the new function. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { var isCurry = bitmask & WRAP_CURRY_FLAG, newHolders = isCurry ? holders : undefined, newHoldersRight = isCurry ? undefined : holders, newPartials = isCurry ? partials : undefined, newPartialsRight = isCurry ? undefined : partials; bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); } var newData = [ func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, newHoldersRight, argPos, ary, arity ]; var result = wrapFunc.apply(undefined, newData); if (isLaziable(func)) { setData(result, newData); } result.placeholder = placeholder; return setWrapToString(result, func, bitmask); } /** * Creates a function like `_.round`. * * @private * @param {string} methodName The name of the `Math` method to use when rounding. * @returns {Function} Returns the new round function. */ function createRound(methodName) { var func = Math[methodName]; return function(number, precision) { number = toNumber(number); precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); if (precision && nativeIsFinite(number)) { // Shift with exponential notation to avoid floating-point issues. // See [MDN](https://mdn.io/round#Examples) for more details. var pair = (toString(number) + 'e').split('e'), value = func(pair[0] + 'e' + (+pair[1] + precision)); pair = (toString(value) + 'e').split('e'); return +(pair[0] + 'e' + (+pair[1] - precision)); } return func(number); }; } /** * Creates a set object of `values`. * * @private * @param {Array} values The values to add to the set. * @returns {Object} Returns the new set. */ var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { return new Set(values); }; /** * Creates a `_.toPairs` or `_.toPairsIn` function. * * @private * @param {Function} keysFunc The function to get the keys of a given object. * @returns {Function} Returns the new pairs function. */ function createToPairs(keysFunc) { return function(object) { var tag = getTag(object); if (tag == mapTag) { return mapToArray(object); } if (tag == setTag) { return setToPairs(object); } return baseToPairs(object, keysFunc(object)); }; } /** * Creates a function that either curries or invokes `func` with optional * `this` binding and partially applied arguments. * * @private * @param {Function|string} func The function or method name to wrap. * @param {number} bitmask The bitmask flags. * 1 - `_.bind` * 2 - `_.bindKey` * 4 - `_.curry` or `_.curryRight` of a bound function * 8 - `_.curry` * 16 - `_.curryRight` * 32 - `_.partial` * 64 - `_.partialRight` * 128 - `_.rearg` * 256 - `_.ary` * 512 - `_.flip` * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to be partially applied. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; if (!isBindKey && typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } var length = partials ? partials.length : 0; if (!length) { bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); partials = holders = undefined; } ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); arity = arity === undefined ? arity : toInteger(arity); length -= holders ? holders.length : 0; if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { var partialsRight = partials, holdersRight = holders; partials = holders = undefined; } var data = isBindKey ? undefined : getData(func); var newData = [ func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity ]; if (data) { mergeData(newData, data); } func = newData[0]; bitmask = newData[1]; thisArg = newData[2]; partials = newData[3]; holders = newData[4]; arity = newData[9] = newData[9] === undefined ? (isBindKey ? 0 : func.length) : nativeMax(newData[9] - length, 0); if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); } if (!bitmask || bitmask == WRAP_BIND_FLAG) { var result = createBind(func, bitmask, thisArg); } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { result = createCurry(func, bitmask, arity); } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { result = createPartial(func, bitmask, thisArg, partials); } else { result = createHybrid.apply(undefined, newData); } var setter = data ? baseSetData : setData; return setWrapToString(setter(result, newData), func, bitmask); } /** * Used by `_.defaults` to customize its `_.assignIn` use to assign properties * of source objects to the destination object for all destination properties * that resolve to `undefined`. * * @private * @param {*} objValue The destination value. * @param {*} srcValue The source value. * @param {string} key The key of the property to assign. * @param {Object} object The parent object of `objValue`. * @returns {*} Returns the value to assign. */ function customDefaultsAssignIn(objValue, srcValue, key, object) { if (objValue === undefined || (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { return srcValue; } return objValue; } /** * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source * objects into destination objects that are passed thru. * * @private * @param {*} objValue The destination value. * @param {*} srcValue The source value. * @param {string} key The key of the property to merge. * @param {Object} object The parent object of `objValue`. * @param {Object} source The parent object of `srcValue`. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. * @returns {*} Returns the value to assign. */ function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { if (isObject(objValue) && isObject(srcValue)) { // Recursively merge objects and arrays (susceptible to call stack limits). stack.set(srcValue, objValue); baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); stack['delete'](srcValue); } return objValue; } /** * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain * objects. * * @private * @param {*} value The value to inspect. * @param {string} key The key of the property to inspect. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. */ function customOmitClone(value) { return isPlainObject(value) ? undefined : value; } /** * A specialized version of `baseIsEqualDeep` for arrays with support for * partial deep comparisons. * * @private * @param {Array} array The array to compare. * @param {Array} other The other array to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `array` and `other` objects. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. */ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length; if (arrLength != othLength && !(isPartial && othLength > arrLength)) { return false; } // Assume cyclic values are equal. var stacked = stack.get(array); if (stacked && stack.get(other)) { return stacked == other; } var index = -1, result = true, seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; stack.set(array, other); stack.set(other, array); // Ignore non-index properties. while (++index < arrLength) { var arrValue = array[index], othValue = other[index]; if (customizer) { var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack); } if (compared !== undefined) { if (compared) { continue; } result = false; break; } // Recursively compare arrays (susceptible to call stack limits). if (seen) { if (!arraySome(other, function(othValue, othIndex) { if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { return seen.push(othIndex); } })) { result = false; break; } } else if (!( arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack) )) { result = false; break; } } stack['delete'](array); stack['delete'](other); return result; } /** * A specialized version of `baseIsEqualDeep` for comparing objects of * the same `toStringTag`. * * **Note:** This function only supports comparing values with tags of * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {string} tag The `toStringTag` of the objects to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { switch (tag) { case dataViewTag: if ((object.byteLength != other.byteLength) || (object.byteOffset != other.byteOffset)) { return false; } object = object.buffer; other = other.buffer; case arrayBufferTag: if ((object.byteLength != other.byteLength) || !equalFunc(new Uint8Array(object), new Uint8Array(other))) { return false; } return true; case boolTag: case dateTag: case numberTag: // Coerce booleans to `1` or `0` and dates to milliseconds. // Invalid dates are coerced to `NaN`. return eq(+object, +other); case errorTag: return object.name == other.name && object.message == other.message; case regexpTag: case stringTag: // Coerce regexes to strings and treat strings, primitives and objects, // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring // for more details. return object == (other + ''); case mapTag: var convert = mapToArray; case setTag: var isPartial = bitmask & COMPARE_PARTIAL_FLAG; convert || (convert = setToArray); if (object.size != other.size && !isPartial) { return false; } // Assume cyclic values are equal. var stacked = stack.get(object); if (stacked) { return stacked == other; } bitmask |= COMPARE_UNORDERED_FLAG; // Recursively compare objects (susceptible to call stack limits). stack.set(object, other); var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); stack['delete'](object); return result; case symbolTag: if (symbolValueOf) { return symbolValueOf.call(object) == symbolValueOf.call(other); } } return false; } /** * A specialized version of `baseIsEqualDeep` for objects with support for * partial deep comparisons. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length; if (objLength != othLength && !isPartial) { return false; } var index = objLength; while (index--) { var key = objProps[index]; if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { return false; } } // Assume cyclic values are equal. var stacked = stack.get(object); if (stacked && stack.get(other)) { return stacked == other; } var result = true; stack.set(object, other); stack.set(other, object); var skipCtor = isPartial; while (++index < objLength) { key = objProps[index]; var objValue = object[key], othValue = other[key]; if (customizer) { var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack); } // Recursively compare objects (susceptible to call stack limits). if (!(compared === undefined ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) : compared )) { result = false; break; } skipCtor || (skipCtor = key == 'constructor'); } if (result && !skipCtor) { var objCtor = object.constructor, othCtor = other.constructor; // Non `Object` object instances with different constructors are not equal. if (objCtor != othCtor && ('constructor' in object && 'constructor' in other) && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) { result = false; } } stack['delete'](object); stack['delete'](other); return result; } /** * A specialized version of `baseRest` which flattens the rest array. * * @private * @param {Function} func The function to apply a rest parameter to. * @returns {Function} Returns the new function. */ function flatRest(func) { return setToString(overRest(func, undefined, flatten), func + ''); } /** * Creates an array of own enumerable property names and symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names and symbols. */ function getAllKeys(object) { return baseGetAllKeys(object, keys, getSymbols); } /** * Creates an array of own and inherited enumerable property names and * symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names and symbols. */ function getAllKeysIn(object) { return baseGetAllKeys(object, keysIn, getSymbolsIn); } /** * Gets metadata for `func`. * * @private * @param {Function} func The function to query. * @returns {*} Returns the metadata for `func`. */ var getData = !metaMap ? noop : function(func) { return metaMap.get(func); }; /** * Gets the name of `func`. * * @private * @param {Function} func The function to query. * @returns {string} Returns the function name. */ function getFuncName(func) { var result = (func.name + ''), array = realNames[result], length = hasOwnProperty.call(realNames, result) ? array.length : 0; while (length--) { var data = array[length], otherFunc = data.func; if (otherFunc == null || otherFunc == func) { return data.name; } } return result; } /** * Gets the argument placeholder value for `func`. * * @private * @param {Function} func The function to inspect. * @returns {*} Returns the placeholder value. */ function getHolder(func) { var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; return object.placeholder; } /** * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, * this function returns the custom method, otherwise it returns `baseIteratee`. * If arguments are provided, the chosen function is invoked with them and * its result is returned. * * @private * @param {*} [value] The value to convert to an iteratee. * @param {number} [arity] The arity of the created iteratee. * @returns {Function} Returns the chosen function or its result. */ function getIteratee() { var result = lodash.iteratee || iteratee; result = result === iteratee ? baseIteratee : result; return arguments.length ? result(arguments[0], arguments[1]) : result; } /** * Gets the data for `map`. * * @private * @param {Object} map The map to query. * @param {string} key The reference key. * @returns {*} Returns the map data. */ function getMapData(map, key) { var data = map.__data__; return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map; } /** * Gets the property names, values, and compare flags of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the match data of `object`. */ function getMatchData(object) { var result = keys(object), length = result.length; while (length--) { var key = result[length], value = object[key]; result[length] = [key, value, isStrictComparable(value)]; } return result; } /** * Gets the native function at `key` of `object`. * * @private * @param {Object} object The object to query. * @param {string} key The key of the method to get. * @returns {*} Returns the function if it's native, else `undefined`. */ function getNative(object, key) { var value = getValue(object, key); return baseIsNative(value) ? value : undefined; } /** * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. * * @private * @param {*} value The value to query. * @returns {string} Returns the raw `toStringTag`. */ function getRawTag(value) { var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; try { value[symToStringTag] = undefined; var unmasked = true; } catch (e) {} var result = nativeObjectToString.call(value); if (unmasked) { if (isOwn) { value[symToStringTag] = tag; } else { delete value[symToStringTag]; } } return result; } /** * Creates an array of the own enumerable symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ var getSymbols = !nativeGetSymbols ? stubArray : function(object) { if (object == null) { return []; } object = Object(object); return arrayFilter(nativeGetSymbols(object), function(symbol) { return propertyIsEnumerable.call(object, symbol); }); }; /** * Creates an array of the own and inherited enumerable symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { var result = []; while (object) { arrayPush(result, getSymbols(object)); object = getPrototype(object); } return result; }; /** * Gets the `toStringTag` of `value`. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ var getTag = baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || (Map && getTag(new Map) != mapTag) || (Promise && getTag(Promise.resolve()) != promiseTag) || (Set && getTag(new Set) != setTag) || (WeakMap && getTag(new WeakMap) != weakMapTag)) { getTag = function(value) { var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : undefined, ctorString = Ctor ? toSource(Ctor) : ''; if (ctorString) { switch (ctorString) { case dataViewCtorString: return dataViewTag; case mapCtorString: return mapTag; case promiseCtorString: return promiseTag; case setCtorString: return setTag; case weakMapCtorString: return weakMapTag; } } return result; }; } /** * Gets the view, applying any `transforms` to the `start` and `end` positions. * * @private * @param {number} start The start of the view. * @param {number} end The end of the view. * @param {Array} transforms The transformations to apply to the view. * @returns {Object} Returns an object containing the `start` and `end` * positions of the view. */ function getView(start, end, transforms) { var index = -1, length = transforms.length; while (++index < length) { var data = transforms[index], size = data.size; switch (data.type) { case 'drop': start += size; break; case 'dropRight': end -= size; break; case 'take': end = nativeMin(end, start + size); break; case 'takeRight': start = nativeMax(start, end - size); break; } } return { 'start': start, 'end': end }; } /** * Extracts wrapper details from the `source` body comment. * * @private * @param {string} source The source to inspect. * @returns {Array} Returns the wrapper details. */ function getWrapDetails(source) { var match = source.match(reWrapDetails); return match ? match[1].split(reSplitDetails) : []; } /** * Checks if `path` exists on `object`. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @param {Function} hasFunc The function to check properties. * @returns {boolean} Returns `true` if `path` exists, else `false`. */ function hasPath(object, path, hasFunc) { path = castPath(path, object); var index = -1, length = path.length, result = false; while (++index < length) { var key = toKey(path[index]); if (!(result = object != null && hasFunc(object, key))) { break; } object = object[key]; } if (result || ++index != length) { return result; } length = object == null ? 0 : object.length; return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object)); } /** * Initializes an array clone. * * @private * @param {Array} array The array to clone. * @returns {Array} Returns the initialized clone. */ function initCloneArray(array) { var length = array.length, result = new array.constructor(length); // Add properties assigned by `RegExp#exec`. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { result.index = array.index; result.input = array.input; } return result; } /** * Initializes an object clone. * * @private * @param {Object} object The object to clone. * @returns {Object} Returns the initialized clone. */ function initCloneObject(object) { return (typeof object.constructor == 'function' && !isPrototype(object)) ? baseCreate(getPrototype(object)) : {}; } /** * Initializes an object clone based on its `toStringTag`. * * **Note:** This function only supports cloning values with tags of * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. * * @private * @param {Object} object The object to clone. * @param {string} tag The `toStringTag` of the object to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the initialized clone. */ function initCloneByTag(object, tag, isDeep) { var Ctor = object.constructor; switch (tag) { case arrayBufferTag: return cloneArrayBuffer(object); case boolTag: case dateTag: return new Ctor(+object); case dataViewTag: return cloneDataView(object, isDeep); case float32Tag: case float64Tag: case int8Tag: case int16Tag: case int32Tag: case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: return cloneTypedArray(object, isDeep); case mapTag: return new Ctor; case numberTag: case stringTag: return new Ctor(object); case regexpTag: return cloneRegExp(object); case setTag: return new Ctor; case symbolTag: return cloneSymbol(object); } } /** * Inserts wrapper `details` in a comment at the top of the `source` body. * * @private * @param {string} source The source to modify. * @returns {Array} details The details to insert. * @returns {string} Returns the modified source. */ function insertWrapDetails(source, details) { var length = details.length; if (!length) { return source; } var lastIndex = length - 1; details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; details = details.join(length > 2 ? ', ' : ' '); return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); } /** * Checks if `value` is a flattenable `arguments` object or array. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. */ function isFlattenable(value) { return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]); } /** * Checks if `value` is a valid array-like index. * * @private * @param {*} value The value to check. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ function isIndex(value, length) { var type = typeof value; length = length == null ? MAX_SAFE_INTEGER : length; return !!length && (type == 'number' || (type != 'symbol' && reIsUint.test(value))) && (value > -1 && value % 1 == 0 && value < length); } /** * Checks if the given arguments are from an iteratee call. * * @private * @param {*} value The potential iteratee value argument. * @param {*} index The potential iteratee index or key argument. * @param {*} object The potential iteratee object argument. * @returns {boolean} Returns `true` if the arguments are from an iteratee call, * else `false`. */ function isIterateeCall(value, index, object) { if (!isObject(object)) { return false; } var type = typeof index; if (type == 'number' ? (isArrayLike(object) && isIndex(index, object.length)) : (type == 'string' && index in object) ) { return eq(object[index], value); } return false; } /** * Checks if `value` is a property name and not a property path. * * @private * @param {*} value The value to check. * @param {Object} [object] The object to query keys on. * @returns {boolean} Returns `true` if `value` is a property name, else `false`. */ function isKey(value, object) { if (isArray(value)) { return false; } var type = typeof value; if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) { return true; } return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || (object != null && value in Object(object)); } /** * Checks if `value` is suitable for use as unique object key. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is suitable, else `false`. */ function isKeyable(value) { var type = typeof value; return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') ? (value !== '__proto__') : (value === null); } /** * Checks if `func` has a lazy counterpart. * * @private * @param {Function} func The function to check. * @returns {boolean} Returns `true` if `func` has a lazy counterpart, * else `false`. */ function isLaziable(func) { var funcName = getFuncName(func), other = lodash[funcName]; if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { return false; } if (func === other) { return true; } var data = getData(other); return !!data && func === data[0]; } /** * Checks if `func` has its source masked. * * @private * @param {Function} func The function to check. * @returns {boolean} Returns `true` if `func` is masked, else `false`. */ function isMasked(func) { return !!maskSrcKey && (maskSrcKey in func); } /** * Checks if `func` is capable of being masked. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `func` is maskable, else `false`. */ var isMaskable = coreJsData ? isFunction : stubFalse; /** * Checks if `value` is likely a prototype object. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. */ function isPrototype(value) { var Ctor = value && value.constructor, proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; return value === proto; } /** * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` if suitable for strict * equality comparisons, else `false`. */ function isStrictComparable(value) { return value === value && !isObject(value); } /** * A specialized version of `matchesProperty` for source values suitable * for strict equality comparisons, i.e. `===`. * * @private * @param {string} key The key of the property to get. * @param {*} srcValue The value to match. * @returns {Function} Returns the new spec function. */ function matchesStrictComparable(key, srcValue) { return function(object) { if (object == null) { return false; } return object[key] === srcValue && (srcValue !== undefined || (key in Object(object))); }; } /** * A specialized version of `_.memoize` which clears the memoized function's * cache when it exceeds `MAX_MEMOIZE_SIZE`. * * @private * @param {Function} func The function to have its output memoized. * @returns {Function} Returns the new memoized function. */ function memoizeCapped(func) { var result = memoize(func, function(key) { if (cache.size === MAX_MEMOIZE_SIZE) { cache.clear(); } return key; }); var cache = result.cache; return result; } /** * Merges the function metadata of `source` into `data`. * * Merging metadata reduces the number of wrappers used to invoke a function. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` * may be applied regardless of execution order. Methods like `_.ary` and * `_.rearg` modify function arguments, making the order in which they are * executed important, preventing the merging of metadata. However, we make * an exception for a safe combined case where curried functions have `_.ary` * and or `_.rearg` applied. * * @private * @param {Array} data The destination metadata. * @param {Array} source The source metadata. * @returns {Array} Returns `data`. */ function mergeData(data, source) { var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); var isCombo = ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); // Exit early if metadata can't be merged. if (!(isCommon || isCombo)) { return data; } // Use source `thisArg` if available. if (srcBitmask & WRAP_BIND_FLAG) { data[2] = source[2]; // Set when currying a bound function. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; } // Compose partial arguments. var value = source[3]; if (value) { var partials = data[3]; data[3] = partials ? composeArgs(partials, value, source[4]) : value; data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; } // Compose partial right arguments. value = source[5]; if (value) { partials = data[5]; data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; } // Use source `argPos` if available. value = source[7]; if (value) { data[7] = value; } // Use source `ary` if it's smaller. if (srcBitmask & WRAP_ARY_FLAG) { data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); } // Use source `arity` if one is not provided. if (data[9] == null) { data[9] = source[9]; } // Use source `func` and merge bitmasks. data[0] = source[0]; data[1] = newBitmask; return data; } /** * This function is like * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * except that it includes inherited enumerable properties. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function nativeKeysIn(object) { var result = []; if (object != null) { for (var key in Object(object)) { result.push(key); } } return result; } /** * Converts `value` to a string using `Object.prototype.toString`. * * @private * @param {*} value The value to convert. * @returns {string} Returns the converted string. */ function objectToString(value) { return nativeObjectToString.call(value); } /** * A specialized version of `baseRest` which transforms the rest array. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @param {Function} transform The rest array transform. * @returns {Function} Returns the new function. */ function overRest(func, start, transform) { start = nativeMax(start === undefined ? (func.length - 1) : start, 0); return function() { var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length); while (++index < length) { array[index] = args[start + index]; } index = -1; var otherArgs = Array(start + 1); while (++index < start) { otherArgs[index] = args[index]; } otherArgs[start] = transform(array); return apply(func, this, otherArgs); }; } /** * Gets the parent value at `path` of `object`. * * @private * @param {Object} object The object to query. * @param {Array} path The path to get the parent value of. * @returns {*} Returns the parent value. */ function parent(object, path) { return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); } /** * Reorder `array` according to the specified indexes where the element at * the first index is assigned as the first element, the element at * the second index is assigned as the second element, and so on. * * @private * @param {Array} array The array to reorder. * @param {Array} indexes The arranged array indexes. * @returns {Array} Returns `array`. */ function reorder(array, indexes) { var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array); while (length--) { var index = indexes[length]; array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; } return array; } /** * Gets the value at `key`, unless `key` is "__proto__" or "constructor". * * @private * @param {Object} object The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function safeGet(object, key) { if (key === 'constructor' && typeof object[key] === 'function') { return; } if (key == '__proto__') { return; } return object[key]; } /** * Sets metadata for `func`. * * **Note:** If this function becomes hot, i.e. is invoked a lot in a short * period of time, it will trip its breaker and transition to an identity * function to avoid garbage collection pauses in V8. See * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) * for more details. * * @private * @param {Function} func The function to associate metadata with. * @param {*} data The metadata. * @returns {Function} Returns `func`. */ var setData = shortOut(baseSetData); /** * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). * * @private * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. * @returns {number|Object} Returns the timer id or timeout object. */ var setTimeout = ctxSetTimeout || function(func, wait) { return root.setTimeout(func, wait); }; /** * Sets the `toString` method of `func` to return `string`. * * @private * @param {Function} func The function to modify. * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ var setToString = shortOut(baseSetToString); /** * Sets the `toString` method of `wrapper` to mimic the source of `reference` * with wrapper details in a comment at the top of the source body. * * @private * @param {Function} wrapper The function to modify. * @param {Function} reference The reference function. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @returns {Function} Returns `wrapper`. */ function setWrapToString(wrapper, reference, bitmask) { var source = (reference + ''); return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); } /** * Creates a function that'll short out and invoke `identity` instead * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` * milliseconds. * * @private * @param {Function} func The function to restrict. * @returns {Function} Returns the new shortable function. */ function shortOut(func) { var count = 0, lastCalled = 0; return function() { var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); lastCalled = stamp; if (remaining > 0) { if (++count >= HOT_COUNT) { return arguments[0]; } } else { count = 0; } return func.apply(undefined, arguments); }; } /** * A specialized version of `_.shuffle` which mutates and sets the size of `array`. * * @private * @param {Array} array The array to shuffle. * @param {number} [size=array.length] The size of `array`. * @returns {Array} Returns `array`. */ function shuffleSelf(array, size) { var index = -1, length = array.length, lastIndex = length - 1; size = size === undefined ? length : size; while (++index < size) { var rand = baseRandom(index, lastIndex), value = array[rand]; array[rand] = array[index]; array[index] = value; } array.length = size; return array; } /** * Converts `string` to a property path array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the property path array. */ var stringToPath = memoizeCapped(function(string) { var result = []; if (string.charCodeAt(0) === 46 /* . */) { result.push(''); } string.replace(rePropName, function(match, number, quote, subString) { result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); }); return result; }); /** * Converts `value` to a string key if it's not a string or symbol. * * @private * @param {*} value The value to inspect. * @returns {string|symbol} Returns the key. */ function toKey(value) { if (typeof value == 'string' || isSymbol(value)) { return value; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } /** * Converts `func` to its source code. * * @private * @param {Function} func The function to convert. * @returns {string} Returns the source code. */ function toSource(func) { if (func != null) { try { return funcToString.call(func); } catch (e) {} try { return (func + ''); } catch (e) {} } return ''; } /** * Updates wrapper `details` based on `bitmask` flags. * * @private * @returns {Array} details The details to modify. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @returns {Array} Returns `details`. */ function updateWrapDetails(details, bitmask) { arrayEach(wrapFlags, function(pair) { var value = '_.' + pair[0]; if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { details.push(value); } }); return details.sort(); } /** * Creates a clone of `wrapper`. * * @private * @param {Object} wrapper The wrapper to clone. * @returns {Object} Returns the cloned wrapper. */ function wrapperClone(wrapper) { if (wrapper instanceof LazyWrapper) { return wrapper.clone(); } var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); result.__actions__ = copyArray(wrapper.__actions__); result.__index__ = wrapper.__index__; result.__values__ = wrapper.__values__; return result; } /*------------------------------------------------------------------------*/ /** * Creates an array of elements split into groups the length of `size`. * If `array` can't be split evenly, the final chunk will be the remaining * elements. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to process. * @param {number} [size=1] The length of each chunk * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the new array of chunks. * @example * * _.chunk(['a', 'b', 'c', 'd'], 2); * // => [['a', 'b'], ['c', 'd']] * * _.chunk(['a', 'b', 'c', 'd'], 3); * // => [['a', 'b', 'c'], ['d']] */ function chunk(array, size, guard) { if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { size = 1; } else { size = nativeMax(toInteger(size), 0); } var length = array == null ? 0 : array.length; if (!length || size < 1) { return []; } var index = 0, resIndex = 0, result = Array(nativeCeil(length / size)); while (index < length) { result[resIndex++] = baseSlice(array, index, (index += size)); } return result; } /** * Creates an array with all falsey values removed. The values `false`, `null`, * `0`, `""`, `undefined`, and `NaN` are falsey. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to compact. * @returns {Array} Returns the new array of filtered values. * @example * * _.compact([0, 1, false, 2, '', 3]); * // => [1, 2, 3] */ function compact(array) { var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (value) { result[resIndex++] = value; } } return result; } /** * Creates a new array concatenating `array` with any additional arrays * and/or values. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to concatenate. * @param {...*} [values] The values to concatenate. * @returns {Array} Returns the new concatenated array. * @example * * var array = [1]; * var other = _.concat(array, 2, [3], [[4]]); * * console.log(other); * // => [1, 2, 3, [4]] * * console.log(array); * // => [1] */ function concat() { var length = arguments.length; if (!length) { return []; } var args = Array(length - 1), array = arguments[0], index = length; while (index--) { args[index - 1] = arguments[index]; } return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); } /** * Creates an array of `array` values not included in the other given arrays * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. The order and references of result values are * determined by the first array. * * **Note:** Unlike `_.pullAll`, this method returns a new array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. * @returns {Array} Returns the new array of filtered values. * @see _.without, _.xor * @example * * _.difference([2, 1], [2, 3]); * // => [1] */ var difference = baseRest(function(array, values) { return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) : []; }); /** * This method is like `_.difference` except that it accepts `iteratee` which * is invoked for each element of `array` and `values` to generate the criterion * by which they're compared. The order and references of result values are * determined by the first array. The iteratee is invoked with one argument: * (value). * * **Note:** Unlike `_.pullAllBy`, this method returns a new array. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); * // => [1.2] * * // The `_.property` iteratee shorthand. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); * // => [{ 'x': 2 }] */ var differenceBy = baseRest(function(array, values) { var iteratee = last(values); if (isArrayLikeObject(iteratee)) { iteratee = undefined; } return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) : []; }); /** * This method is like `_.difference` except that it accepts `comparator` * which is invoked to compare elements of `array` to `values`. The order and * references of result values are determined by the first array. The comparator * is invoked with two arguments: (arrVal, othVal). * * **Note:** Unlike `_.pullAllWith`, this method returns a new array. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; * * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); * // => [{ 'x': 2, 'y': 1 }] */ var differenceWith = baseRest(function(array, values) { var comparator = last(values); if (isArrayLikeObject(comparator)) { comparator = undefined; } return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) : []; }); /** * Creates a slice of `array` with `n` elements dropped from the beginning. * * @static * @memberOf _ * @since 0.5.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to drop. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * * _.drop([1, 2, 3]); * // => [2, 3] * * _.drop([1, 2, 3], 2); * // => [3] * * _.drop([1, 2, 3], 5); * // => [] * * _.drop([1, 2, 3], 0); * // => [1, 2, 3] */ function drop(array, n, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } n = (guard || n === undefined) ? 1 : toInteger(n); return baseSlice(array, n < 0 ? 0 : n, length); } /** * Creates a slice of `array` with `n` elements dropped from the end. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to drop. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * * _.dropRight([1, 2, 3]); * // => [1, 2] * * _.dropRight([1, 2, 3], 2); * // => [1] * * _.dropRight([1, 2, 3], 5); * // => [] * * _.dropRight([1, 2, 3], 0); * // => [1, 2, 3] */ function dropRight(array, n, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } n = (guard || n === undefined) ? 1 : toInteger(n); n = length - n; return baseSlice(array, 0, n < 0 ? 0 : n); } /** * Creates a slice of `array` excluding elements dropped from the end. * Elements are dropped until `predicate` returns falsey. The predicate is * invoked with three arguments: (value, index, array). * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * * var users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': false } * ]; * * _.dropRightWhile(users, function(o) { return !o.active; }); * // => objects for ['barney'] * * // The `_.matches` iteratee shorthand. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); * // => objects for ['barney', 'fred'] * * // The `_.matchesProperty` iteratee shorthand. * _.dropRightWhile(users, ['active', false]); * // => objects for ['barney'] * * // The `_.property` iteratee shorthand. * _.dropRightWhile(users, 'active'); * // => objects for ['barney', 'fred', 'pebbles'] */ function dropRightWhile(array, predicate) { return (array && array.length) ? baseWhile(array, getIteratee(predicate, 3), true, true) : []; } /** * Creates a slice of `array` excluding elements dropped from the beginning. * Elements are dropped until `predicate` returns falsey. The predicate is * invoked with three arguments: (value, index, array). * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * * var users = [ * { 'user': 'barney', 'active': false }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': true } * ]; * * _.dropWhile(users, function(o) { return !o.active; }); * // => objects for ['pebbles'] * * // The `_.matches` iteratee shorthand. * _.dropWhile(users, { 'user': 'barney', 'active': false }); * // => objects for ['fred', 'pebbles'] * * // The `_.matchesProperty` iteratee shorthand. * _.dropWhile(users, ['active', false]); * // => objects for ['pebbles'] * * // The `_.property` iteratee shorthand. * _.dropWhile(users, 'active'); * // => objects for ['barney', 'fred', 'pebbles'] */ function dropWhile(array, predicate) { return (array && array.length) ? baseWhile(array, getIteratee(predicate, 3), true) : []; } /** * Fills elements of `array` with `value` from `start` up to, but not * including, `end`. * * **Note:** This method mutates `array`. * * @static * @memberOf _ * @since 3.2.0 * @category Array * @param {Array} array The array to fill. * @param {*} value The value to fill `array` with. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns `array`. * @example * * var array = [1, 2, 3]; * * _.fill(array, 'a'); * console.log(array); * // => ['a', 'a', 'a'] * * _.fill(Array(3), 2); * // => [2, 2, 2] * * _.fill([4, 6, 8, 10], '*', 1, 3); * // => [4, '*', '*', 10] */ function fill(array, value, start, end) { var length = array == null ? 0 : array.length; if (!length) { return []; } if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { start = 0; end = length; } return baseFill(array, value, start, end); } /** * This method is like `_.find` except that it returns the index of the first * element `predicate` returns truthy for instead of the element itself. * * @static * @memberOf _ * @since 1.1.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=0] The index to search from. * @returns {number} Returns the index of the found element, else `-1`. * @example * * var users = [ * { 'user': 'barney', 'active': false }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': true } * ]; * * _.findIndex(users, function(o) { return o.user == 'barney'; }); * // => 0 * * // The `_.matches` iteratee shorthand. * _.findIndex(users, { 'user': 'fred', 'active': false }); * // => 1 * * // The `_.matchesProperty` iteratee shorthand. * _.findIndex(users, ['active', false]); * // => 0 * * // The `_.property` iteratee shorthand. * _.findIndex(users, 'active'); * // => 2 */ function findIndex(array, predicate, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = fromIndex == null ? 0 : toInteger(fromIndex); if (index < 0) { index = nativeMax(length + index, 0); } return baseFindIndex(array, getIteratee(predicate, 3), index); } /** * This method is like `_.findIndex` except that it iterates over elements * of `collection` from right to left. * * @static * @memberOf _ * @since 2.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=array.length-1] The index to search from. * @returns {number} Returns the index of the found element, else `-1`. * @example * * var users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': false } * ]; * * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); * // => 2 * * // The `_.matches` iteratee shorthand. * _.findLastIndex(users, { 'user': 'barney', 'active': true }); * // => 0 * * // The `_.matchesProperty` iteratee shorthand. * _.findLastIndex(users, ['active', false]); * // => 2 * * // The `_.property` iteratee shorthand. * _.findLastIndex(users, 'active'); * // => 0 */ function findLastIndex(array, predicate, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = length - 1; if (fromIndex !== undefined) { index = toInteger(fromIndex); index = fromIndex < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); } return baseFindIndex(array, getIteratee(predicate, 3), index, true); } /** * Flattens `array` a single level deep. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to flatten. * @returns {Array} Returns the new flattened array. * @example * * _.flatten([1, [2, [3, [4]], 5]]); * // => [1, 2, [3, [4]], 5] */ function flatten(array) { var length = array == null ? 0 : array.length; return length ? baseFlatten(array, 1) : []; } /** * Recursively flattens `array`. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to flatten. * @returns {Array} Returns the new flattened array. * @example * * _.flattenDeep([1, [2, [3, [4]], 5]]); * // => [1, 2, 3, 4, 5] */ function flattenDeep(array) { var length = array == null ? 0 : array.length; return length ? baseFlatten(array, INFINITY) : []; } /** * Recursively flatten `array` up to `depth` times. * * @static * @memberOf _ * @since 4.4.0 * @category Array * @param {Array} array The array to flatten. * @param {number} [depth=1] The maximum recursion depth. * @returns {Array} Returns the new flattened array. * @example * * var array = [1, [2, [3, [4]], 5]]; * * _.flattenDepth(array, 1); * // => [1, 2, [3, [4]], 5] * * _.flattenDepth(array, 2); * // => [1, 2, 3, [4], 5] */ function flattenDepth(array, depth) { var length = array == null ? 0 : array.length; if (!length) { return []; } depth = depth === undefined ? 1 : toInteger(depth); return baseFlatten(array, depth); } /** * The inverse of `_.toPairs`; this method returns an object composed * from key-value `pairs`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} pairs The key-value pairs. * @returns {Object} Returns the new object. * @example * * _.fromPairs([['a', 1], ['b', 2]]); * // => { 'a': 1, 'b': 2 } */ function fromPairs(pairs) { var index = -1, length = pairs == null ? 0 : pairs.length, result = {}; while (++index < length) { var pair = pairs[index]; result[pair[0]] = pair[1]; } return result; } /** * Gets the first element of `array`. * * @static * @memberOf _ * @since 0.1.0 * @alias first * @category Array * @param {Array} array The array to query. * @returns {*} Returns the first element of `array`. * @example * * _.head([1, 2, 3]); * // => 1 * * _.head([]); * // => undefined */ function head(array) { return (array && array.length) ? array[0] : undefined; } /** * Gets the index at which the first occurrence of `value` is found in `array` * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. If `fromIndex` is negative, it's used as the * offset from the end of `array`. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=0] The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. * @example * * _.indexOf([1, 2, 1, 2], 2); * // => 1 * * // Search from the `fromIndex`. * _.indexOf([1, 2, 1, 2], 2, 2); * // => 3 */ function indexOf(array, value, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = fromIndex == null ? 0 : toInteger(fromIndex); if (index < 0) { index = nativeMax(length + index, 0); } return baseIndexOf(array, value, index); } /** * Gets all but the last element of `array`. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to query. * @returns {Array} Returns the slice of `array`. * @example * * _.initial([1, 2, 3]); * // => [1, 2] */ function initial(array) { var length = array == null ? 0 : array.length; return length ? baseSlice(array, 0, -1) : []; } /** * Creates an array of unique values that are included in all given arrays * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. The order and references of result values are * determined by the first array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @returns {Array} Returns the new array of intersecting values. * @example * * _.intersection([2, 1], [2, 3]); * // => [2] */ var intersection = baseRest(function(arrays) { var mapped = arrayMap(arrays, castArrayLikeObject); return (mapped.length && mapped[0] === arrays[0]) ? baseIntersection(mapped) : []; }); /** * This method is like `_.intersection` except that it accepts `iteratee` * which is invoked for each element of each `arrays` to generate the criterion * by which they're compared. The order and references of result values are * determined by the first array. The iteratee is invoked with one argument: * (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of intersecting values. * @example * * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); * // => [2.1] * * // The `_.property` iteratee shorthand. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }] */ var intersectionBy = baseRest(function(arrays) { var iteratee = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject); if (iteratee === last(mapped)) { iteratee = undefined; } else { mapped.pop(); } return (mapped.length && mapped[0] === arrays[0]) ? baseIntersection(mapped, getIteratee(iteratee, 2)) : []; }); /** * This method is like `_.intersection` except that it accepts `comparator` * which is invoked to compare elements of `arrays`. The order and references * of result values are determined by the first array. The comparator is * invoked with two arguments: (arrVal, othVal). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of intersecting values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; * * _.intersectionWith(objects, others, _.isEqual); * // => [{ 'x': 1, 'y': 2 }] */ var intersectionWith = baseRest(function(arrays) { var comparator = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject); comparator = typeof comparator == 'function' ? comparator : undefined; if (comparator) { mapped.pop(); } return (mapped.length && mapped[0] === arrays[0]) ? baseIntersection(mapped, undefined, comparator) : []; }); /** * Converts all elements in `array` into a string separated by `separator`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to convert. * @param {string} [separator=','] The element separator. * @returns {string} Returns the joined string. * @example * * _.join(['a', 'b', 'c'], '~'); * // => 'a~b~c' */ function join(array, separator) { return array == null ? '' : nativeJoin.call(array, separator); } /** * Gets the last element of `array`. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to query. * @returns {*} Returns the last element of `array`. * @example * * _.last([1, 2, 3]); * // => 3 */ function last(array) { var length = array == null ? 0 : array.length; return length ? array[length - 1] : undefined; } /** * This method is like `_.indexOf` except that it iterates over elements of * `array` from right to left. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=array.length-1] The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. * @example * * _.lastIndexOf([1, 2, 1, 2], 2); * // => 3 * * // Search from the `fromIndex`. * _.lastIndexOf([1, 2, 1, 2], 2, 2); * // => 1 */ function lastIndexOf(array, value, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = length; if (fromIndex !== undefined) { index = toInteger(fromIndex); index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); } return value === value ? strictLastIndexOf(array, value, index) : baseFindIndex(array, baseIsNaN, index, true); } /** * Gets the element at index `n` of `array`. If `n` is negative, the nth * element from the end is returned. * * @static * @memberOf _ * @since 4.11.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=0] The index of the element to return. * @returns {*} Returns the nth element of `array`. * @example * * var array = ['a', 'b', 'c', 'd']; * * _.nth(array, 1); * // => 'b' * * _.nth(array, -2); * // => 'c'; */ function nth(array, n) { return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; } /** * Removes all given values from `array` using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` * to remove elements from an array by predicate. * * @static * @memberOf _ * @since 2.0.0 * @category Array * @param {Array} array The array to modify. * @param {...*} [values] The values to remove. * @returns {Array} Returns `array`. * @example * * var array = ['a', 'b', 'c', 'a', 'b', 'c']; * * _.pull(array, 'a', 'c'); * console.log(array); * // => ['b', 'b'] */ var pull = baseRest(pullAll); /** * This method is like `_.pull` except that it accepts an array of values to remove. * * **Note:** Unlike `_.difference`, this method mutates `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @returns {Array} Returns `array`. * @example * * var array = ['a', 'b', 'c', 'a', 'b', 'c']; * * _.pullAll(array, ['a', 'c']); * console.log(array); * // => ['b', 'b'] */ function pullAll(array, values) { return (array && array.length && values && values.length) ? basePullAll(array, values) : array; } /** * This method is like `_.pullAll` except that it accepts `iteratee` which is * invoked for each element of `array` and `values` to generate the criterion * by which they're compared. The iteratee is invoked with one argument: (value). * * **Note:** Unlike `_.differenceBy`, this method mutates `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns `array`. * @example * * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; * * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); * console.log(array); * // => [{ 'x': 2 }] */ function pullAllBy(array, values, iteratee) { return (array && array.length && values && values.length) ? basePullAll(array, values, getIteratee(iteratee, 2)) : array; } /** * This method is like `_.pullAll` except that it accepts `comparator` which * is invoked to compare elements of `array` to `values`. The comparator is * invoked with two arguments: (arrVal, othVal). * * **Note:** Unlike `_.differenceWith`, this method mutates `array`. * * @static * @memberOf _ * @since 4.6.0 * @category Array * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns `array`. * @example * * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; * * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); * console.log(array); * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] */ function pullAllWith(array, values, comparator) { return (array && array.length && values && values.length) ? basePullAll(array, values, undefined, comparator) : array; } /** * Removes elements from `array` corresponding to `indexes` and returns an * array of removed elements. * * **Note:** Unlike `_.at`, this method mutates `array`. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to modify. * @param {...(number|number[])} [indexes] The indexes of elements to remove. * @returns {Array} Returns the new array of removed elements. * @example * * var array = ['a', 'b', 'c', 'd']; * var pulled = _.pullAt(array, [1, 3]); * * console.log(array); * // => ['a', 'c'] * * console.log(pulled); * // => ['b', 'd'] */ var pullAt = flatRest(function(array, indexes) { var length = array == null ? 0 : array.length, result = baseAt(array, indexes); basePullAt(array, arrayMap(indexes, function(index) { return isIndex(index, length) ? +index : index; }).sort(compareAscending)); return result; }); /** * Removes all elements from `array` that `predicate` returns truthy for * and returns an array of the removed elements. The predicate is invoked * with three arguments: (value, index, array). * * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` * to pull elements from an array by value. * * @static * @memberOf _ * @since 2.0.0 * @category Array * @param {Array} array The array to modify. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the new array of removed elements. * @example * * var array = [1, 2, 3, 4]; * var evens = _.remove(array, function(n) { * return n % 2 == 0; * }); * * console.log(array); * // => [1, 3] * * console.log(evens); * // => [2, 4] */ function remove(array, predicate) { var result = []; if (!(array && array.length)) { return result; } var index = -1, indexes = [], length = array.length; predicate = getIteratee(predicate, 3); while (++index < length) { var value = array[index]; if (predicate(value, index, array)) { result.push(value); indexes.push(index); } } basePullAt(array, indexes); return result; } /** * Reverses `array` so that the first element becomes the last, the second * element becomes the second to last, and so on. * * **Note:** This method mutates `array` and is based on * [`Array#reverse`](https://mdn.io/Array/reverse). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to modify. * @returns {Array} Returns `array`. * @example * * var array = [1, 2, 3]; * * _.reverse(array); * // => [3, 2, 1] * * console.log(array); * // => [3, 2, 1] */ function reverse(array) { return array == null ? array : nativeReverse.call(array); } /** * Creates a slice of `array` from `start` up to, but not including, `end`. * * **Note:** This method is used instead of * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are * returned. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to slice. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the slice of `array`. */ function slice(array, start, end) { var length = array == null ? 0 : array.length; if (!length) { return []; } if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { start = 0; end = length; } else { start = start == null ? 0 : toInteger(start); end = end === undefined ? length : toInteger(end); } return baseSlice(array, start, end); } /** * Uses a binary search to determine the lowest index at which `value` * should be inserted into `array` in order to maintain its sort order. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @returns {number} Returns the index at which `value` should be inserted * into `array`. * @example * * _.sortedIndex([30, 50], 40); * // => 1 */ function sortedIndex(array, value) { return baseSortedIndex(array, value); } /** * This method is like `_.sortedIndex` except that it accepts `iteratee` * which is invoked for `value` and each element of `array` to compute their * sort ranking. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {number} Returns the index at which `value` should be inserted * into `array`. * @example * * var objects = [{ 'x': 4 }, { 'x': 5 }]; * * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); * // => 0 * * // The `_.property` iteratee shorthand. * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); * // => 0 */ function sortedIndexBy(array, value, iteratee) { return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); } /** * This method is like `_.indexOf` except that it performs a binary * search on a sorted `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @returns {number} Returns the index of the matched value, else `-1`. * @example * * _.sortedIndexOf([4, 5, 5, 5, 6], 5); * // => 1 */ function sortedIndexOf(array, value) { var length = array == null ? 0 : array.length; if (length) { var index = baseSortedIndex(array, value); if (index < length && eq(array[index], value)) { return index; } } return -1; } /** * This method is like `_.sortedIndex` except that it returns the highest * index at which `value` should be inserted into `array` in order to * maintain its sort order. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @returns {number} Returns the index at which `value` should be inserted * into `array`. * @example * * _.sortedLastIndex([4, 5, 5, 5, 6], 5); * // => 4 */ function sortedLastIndex(array, value) { return baseSortedIndex(array, value, true); } /** * This method is like `_.sortedLastIndex` except that it accepts `iteratee` * which is invoked for `value` and each element of `array` to compute their * sort ranking. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {number} Returns the index at which `value` should be inserted * into `array`. * @example * * var objects = [{ 'x': 4 }, { 'x': 5 }]; * * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); * // => 1 * * // The `_.property` iteratee shorthand. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); * // => 1 */ function sortedLastIndexBy(array, value, iteratee) { return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); } /** * This method is like `_.lastIndexOf` except that it performs a binary * search on a sorted `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @returns {number} Returns the index of the matched value, else `-1`. * @example * * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); * // => 3 */ function sortedLastIndexOf(array, value) { var length = array == null ? 0 : array.length; if (length) { var index = baseSortedIndex(array, value, true) - 1; if (eq(array[index], value)) { return index; } } return -1; } /** * This method is like `_.uniq` except that it's designed and optimized * for sorted arrays. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @returns {Array} Returns the new duplicate free array. * @example * * _.sortedUniq([1, 1, 2]); * // => [1, 2] */ function sortedUniq(array) { return (array && array.length) ? baseSortedUniq(array) : []; } /** * This method is like `_.uniqBy` except that it's designed and optimized * for sorted arrays. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @returns {Array} Returns the new duplicate free array. * @example * * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); * // => [1.1, 2.3] */ function sortedUniqBy(array, iteratee) { return (array && array.length) ? baseSortedUniq(array, getIteratee(iteratee, 2)) : []; } /** * Gets all but the first element of `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to query. * @returns {Array} Returns the slice of `array`. * @example * * _.tail([1, 2, 3]); * // => [2, 3] */ function tail(array) { var length = array == null ? 0 : array.length; return length ? baseSlice(array, 1, length) : []; } /** * Creates a slice of `array` with `n` elements taken from the beginning. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to take. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * * _.take([1, 2, 3]); * // => [1] * * _.take([1, 2, 3], 2); * // => [1, 2] * * _.take([1, 2, 3], 5); * // => [1, 2, 3] * * _.take([1, 2, 3], 0); * // => [] */ function take(array, n, guard) { if (!(array && array.length)) { return []; } n = (guard || n === undefined) ? 1 : toInteger(n); return baseSlice(array, 0, n < 0 ? 0 : n); } /** * Creates a slice of `array` with `n` elements taken from the end. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to take. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * * _.takeRight([1, 2, 3]); * // => [3] * * _.takeRight([1, 2, 3], 2); * // => [2, 3] * * _.takeRight([1, 2, 3], 5); * // => [1, 2, 3] * * _.takeRight([1, 2, 3], 0); * // => [] */ function takeRight(array, n, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } n = (guard || n === undefined) ? 1 : toInteger(n); n = length - n; return baseSlice(array, n < 0 ? 0 : n, length); } /** * Creates a slice of `array` with elements taken from the end. Elements are * taken until `predicate` returns falsey. The predicate is invoked with * three arguments: (value, index, array). * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * * var users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': false } * ]; * * _.takeRightWhile(users, function(o) { return !o.active; }); * // => objects for ['fred', 'pebbles'] * * // The `_.matches` iteratee shorthand. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); * // => objects for ['pebbles'] * * // The `_.matchesProperty` iteratee shorthand. * _.takeRightWhile(users, ['active', false]); * // => objects for ['fred', 'pebbles'] * * // The `_.property` iteratee shorthand. * _.takeRightWhile(users, 'active'); * // => [] */ function takeRightWhile(array, predicate) { return (array && array.length) ? baseWhile(array, getIteratee(predicate, 3), false, true) : []; } /** * Creates a slice of `array` with elements taken from the beginning. Elements * are taken until `predicate` returns falsey. The predicate is invoked with * three arguments: (value, index, array). * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * * var users = [ * { 'user': 'barney', 'active': false }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': true } * ]; * * _.takeWhile(users, function(o) { return !o.active; }); * // => objects for ['barney', 'fred'] * * // The `_.matches` iteratee shorthand. * _.takeWhile(users, { 'user': 'barney', 'active': false }); * // => objects for ['barney'] * * // The `_.matchesProperty` iteratee shorthand. * _.takeWhile(users, ['active', false]); * // => objects for ['barney', 'fred'] * * // The `_.property` iteratee shorthand. * _.takeWhile(users, 'active'); * // => [] */ function takeWhile(array, predicate) { return (array && array.length) ? baseWhile(array, getIteratee(predicate, 3)) : []; } /** * Creates an array of unique values, in order, from all given arrays using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @returns {Array} Returns the new array of combined values. * @example * * _.union([2], [1, 2]); * // => [2, 1] */ var union = baseRest(function(arrays) { return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); }); /** * This method is like `_.union` except that it accepts `iteratee` which is * invoked for each element of each `arrays` to generate the criterion by * which uniqueness is computed. Result values are chosen from the first * array in which the value occurs. The iteratee is invoked with one argument: * (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of combined values. * @example * * _.unionBy([2.1], [1.2, 2.3], Math.floor); * // => [2.1, 1.2] * * // The `_.property` iteratee shorthand. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }, { 'x': 2 }] */ var unionBy = baseRest(function(arrays) { var iteratee = last(arrays); if (isArrayLikeObject(iteratee)) { iteratee = undefined; } return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); }); /** * This method is like `_.union` except that it accepts `comparator` which * is invoked to compare elements of `arrays`. Result values are chosen from * the first array in which the value occurs. The comparator is invoked * with two arguments: (arrVal, othVal). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of combined values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; * * _.unionWith(objects, others, _.isEqual); * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] */ var unionWith = baseRest(function(arrays) { var comparator = last(arrays); comparator = typeof comparator == 'function' ? comparator : undefined; return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); }); /** * Creates a duplicate-free version of an array, using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons, in which only the first occurrence of each element * is kept. The order of result values is determined by the order they occur * in the array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @returns {Array} Returns the new duplicate free array. * @example * * _.uniq([2, 1, 2]); * // => [2, 1] */ function uniq(array) { return (array && array.length) ? baseUniq(array) : []; } /** * This method is like `_.uniq` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the criterion by which * uniqueness is computed. The order of result values is determined by the * order they occur in the array. The iteratee is invoked with one argument: * (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new duplicate free array. * @example * * _.uniqBy([2.1, 1.2, 2.3], Math.floor); * // => [2.1, 1.2] * * // The `_.property` iteratee shorthand. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }, { 'x': 2 }] */ function uniqBy(array, iteratee) { return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; } /** * This method is like `_.uniq` except that it accepts `comparator` which * is invoked to compare elements of `array`. The order of result values is * determined by the order they occur in the array.The comparator is invoked * with two arguments: (arrVal, othVal). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new duplicate free array. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; * * _.uniqWith(objects, _.isEqual); * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] */ function uniqWith(array, comparator) { comparator = typeof comparator == 'function' ? comparator : undefined; return (array && array.length) ? baseUniq(array, undefined, comparator) : []; } /** * This method is like `_.zip` except that it accepts an array of grouped * elements and creates an array regrouping the elements to their pre-zip * configuration. * * @static * @memberOf _ * @since 1.2.0 * @category Array * @param {Array} array The array of grouped elements to process. * @returns {Array} Returns the new array of regrouped elements. * @example * * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); * // => [['a', 1, true], ['b', 2, false]] * * _.unzip(zipped); * // => [['a', 'b'], [1, 2], [true, false]] */ function unzip(array) { if (!(array && array.length)) { return []; } var length = 0; array = arrayFilter(array, function(group) { if (isArrayLikeObject(group)) { length = nativeMax(group.length, length); return true; } }); return baseTimes(length, function(index) { return arrayMap(array, baseProperty(index)); }); } /** * This method is like `_.unzip` except that it accepts `iteratee` to specify * how regrouped values should be combined. The iteratee is invoked with the * elements of each group: (...group). * * @static * @memberOf _ * @since 3.8.0 * @category Array * @param {Array} array The array of grouped elements to process. * @param {Function} [iteratee=_.identity] The function to combine * regrouped values. * @returns {Array} Returns the new array of regrouped elements. * @example * * var zipped = _.zip([1, 2], [10, 20], [100, 200]); * // => [[1, 10, 100], [2, 20, 200]] * * _.unzipWith(zipped, _.add); * // => [3, 30, 300] */ function unzipWith(array, iteratee) { if (!(array && array.length)) { return []; } var result = unzip(array); if (iteratee == null) { return result; } return arrayMap(result, function(group) { return apply(iteratee, undefined, group); }); } /** * Creates an array excluding all given values using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * **Note:** Unlike `_.pull`, this method returns a new array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {...*} [values] The values to exclude. * @returns {Array} Returns the new array of filtered values. * @see _.difference, _.xor * @example * * _.without([2, 1, 2, 3], 1, 2); * // => [3] */ var without = baseRest(function(array, values) { return isArrayLikeObject(array) ? baseDifference(array, values) : []; }); /** * Creates an array of unique values that is the * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) * of the given arrays. The order of result values is determined by the order * they occur in the arrays. * * @static * @memberOf _ * @since 2.4.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @returns {Array} Returns the new array of filtered values. * @see _.difference, _.without * @example * * _.xor([2, 1], [2, 3]); * // => [1, 3] */ var xor = baseRest(function(arrays) { return baseXor(arrayFilter(arrays, isArrayLikeObject)); }); /** * This method is like `_.xor` except that it accepts `iteratee` which is * invoked for each element of each `arrays` to generate the criterion by * which by which they're compared. The order of result values is determined * by the order they occur in the arrays. The iteratee is invoked with one * argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); * // => [1.2, 3.4] * * // The `_.property` iteratee shorthand. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 2 }] */ var xorBy = baseRest(function(arrays) { var iteratee = last(arrays); if (isArrayLikeObject(iteratee)) { iteratee = undefined; } return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); }); /** * This method is like `_.xor` except that it accepts `comparator` which is * invoked to compare elements of `arrays`. The order of result values is * determined by the order they occur in the arrays. The comparator is invoked * with two arguments: (arrVal, othVal). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; * * _.xorWith(objects, others, _.isEqual); * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] */ var xorWith = baseRest(function(arrays) { var comparator = last(arrays); comparator = typeof comparator == 'function' ? comparator : undefined; return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); }); /** * Creates an array of grouped elements, the first of which contains the * first elements of the given arrays, the second of which contains the * second elements of the given arrays, and so on. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to process. * @returns {Array} Returns the new array of grouped elements. * @example * * _.zip(['a', 'b'], [1, 2], [true, false]); * // => [['a', 1, true], ['b', 2, false]] */ var zip = baseRest(unzip); /** * This method is like `_.fromPairs` except that it accepts two arrays, * one of property identifiers and one of corresponding values. * * @static * @memberOf _ * @since 0.4.0 * @category Array * @param {Array} [props=[]] The property identifiers. * @param {Array} [values=[]] The property values. * @returns {Object} Returns the new object. * @example * * _.zipObject(['a', 'b'], [1, 2]); * // => { 'a': 1, 'b': 2 } */ function zipObject(props, values) { return baseZipObject(props || [], values || [], assignValue); } /** * This method is like `_.zipObject` except that it supports property paths. * * @static * @memberOf _ * @since 4.1.0 * @category Array * @param {Array} [props=[]] The property identifiers. * @param {Array} [values=[]] The property values. * @returns {Object} Returns the new object. * @example * * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } */ function zipObjectDeep(props, values) { return baseZipObject(props || [], values || [], baseSet); } /** * This method is like `_.zip` except that it accepts `iteratee` to specify * how grouped values should be combined. The iteratee is invoked with the * elements of each group: (...group). * * @static * @memberOf _ * @since 3.8.0 * @category Array * @param {...Array} [arrays] The arrays to process. * @param {Function} [iteratee=_.identity] The function to combine * grouped values. * @returns {Array} Returns the new array of grouped elements. * @example * * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { * return a + b + c; * }); * // => [111, 222] */ var zipWith = baseRest(function(arrays) { var length = arrays.length, iteratee = length > 1 ? arrays[length - 1] : undefined; iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; return unzipWith(arrays, iteratee); }); /*------------------------------------------------------------------------*/ /** * Creates a `lodash` wrapper instance that wraps `value` with explicit method * chain sequences enabled. The result of such sequences must be unwrapped * with `_#value`. * * @static * @memberOf _ * @since 1.3.0 * @category Seq * @param {*} value The value to wrap. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var users = [ * { 'user': 'barney', 'age': 36 }, * { 'user': 'fred', 'age': 40 }, * { 'user': 'pebbles', 'age': 1 } * ]; * * var youngest = _ * .chain(users) * .sortBy('age') * .map(function(o) { * return o.user + ' is ' + o.age; * }) * .head() * .value(); * // => 'pebbles is 1' */ function chain(value) { var result = lodash(value); result.__chain__ = true; return result; } /** * This method invokes `interceptor` and returns `value`. The interceptor * is invoked with one argument; (value). The purpose of this method is to * "tap into" a method chain sequence in order to modify intermediate results. * * @static * @memberOf _ * @since 0.1.0 * @category Seq * @param {*} value The value to provide to `interceptor`. * @param {Function} interceptor The function to invoke. * @returns {*} Returns `value`. * @example * * _([1, 2, 3]) * .tap(function(array) { * // Mutate input array. * array.pop(); * }) * .reverse() * .value(); * // => [2, 1] */ function tap(value, interceptor) { interceptor(value); return value; } /** * This method is like `_.tap` except that it returns the result of `interceptor`. * The purpose of this method is to "pass thru" values replacing intermediate * results in a method chain sequence. * * @static * @memberOf _ * @since 3.0.0 * @category Seq * @param {*} value The value to provide to `interceptor`. * @param {Function} interceptor The function to invoke. * @returns {*} Returns the result of `interceptor`. * @example * * _(' abc ') * .chain() * .trim() * .thru(function(value) { * return [value]; * }) * .value(); * // => ['abc'] */ function thru(value, interceptor) { return interceptor(value); } /** * This method is the wrapper version of `_.at`. * * @name at * @memberOf _ * @since 1.0.0 * @category Seq * @param {...(string|string[])} [paths] The property paths to pick. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; * * _(object).at(['a[0].b.c', 'a[1]']).value(); * // => [3, 4] */ var wrapperAt = flatRest(function(paths) { var length = paths.length, start = length ? paths[0] : 0, value = this.__wrapped__, interceptor = function(object) { return baseAt(object, paths); }; if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) { return this.thru(interceptor); } value = value.slice(start, +start + (length ? 1 : 0)); value.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined }); return new LodashWrapper(value, this.__chain__).thru(function(array) { if (length && !array.length) { array.push(undefined); } return array; }); }); /** * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. * * @name chain * @memberOf _ * @since 0.1.0 * @category Seq * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var users = [ * { 'user': 'barney', 'age': 36 }, * { 'user': 'fred', 'age': 40 } * ]; * * // A sequence without explicit chaining. * _(users).head(); * // => { 'user': 'barney', 'age': 36 } * * // A sequence with explicit chaining. * _(users) * .chain() * .head() * .pick('user') * .value(); * // => { 'user': 'barney' } */ function wrapperChain() { return chain(this); } /** * Executes the chain sequence and returns the wrapped result. * * @name commit * @memberOf _ * @since 3.2.0 * @category Seq * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var array = [1, 2]; * var wrapped = _(array).push(3); * * console.log(array); * // => [1, 2] * * wrapped = wrapped.commit(); * console.log(array); * // => [1, 2, 3] * * wrapped.last(); * // => 3 * * console.log(array); * // => [1, 2, 3] */ function wrapperCommit() { return new LodashWrapper(this.value(), this.__chain__); } /** * Gets the next value on a wrapped object following the * [iterator protocol](https://mdn.io/iteration_protocols#iterator). * * @name next * @memberOf _ * @since 4.0.0 * @category Seq * @returns {Object} Returns the next iterator value. * @example * * var wrapped = _([1, 2]); * * wrapped.next(); * // => { 'done': false, 'value': 1 } * * wrapped.next(); * // => { 'done': false, 'value': 2 } * * wrapped.next(); * // => { 'done': true, 'value': undefined } */ function wrapperNext() { if (this.__values__ === undefined) { this.__values__ = toArray(this.value()); } var done = this.__index__ >= this.__values__.length, value = done ? undefined : this.__values__[this.__index__++]; return { 'done': done, 'value': value }; } /** * Enables the wrapper to be iterable. * * @name Symbol.iterator * @memberOf _ * @since 4.0.0 * @category Seq * @returns {Object} Returns the wrapper object. * @example * * var wrapped = _([1, 2]); * * wrapped[Symbol.iterator]() === wrapped; * // => true * * Array.from(wrapped); * // => [1, 2] */ function wrapperToIterator() { return this; } /** * Creates a clone of the chain sequence planting `value` as the wrapped value. * * @name plant * @memberOf _ * @since 3.2.0 * @category Seq * @param {*} value The value to plant. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * function square(n) { * return n * n; * } * * var wrapped = _([1, 2]).map(square); * var other = wrapped.plant([3, 4]); * * other.value(); * // => [9, 16] * * wrapped.value(); * // => [1, 4] */ function wrapperPlant(value) { var result, parent = this; while (parent instanceof baseLodash) { var clone = wrapperClone(parent); clone.__index__ = 0; clone.__values__ = undefined; if (result) { previous.__wrapped__ = clone; } else { result = clone; } var previous = clone; parent = parent.__wrapped__; } previous.__wrapped__ = value; return result; } /** * This method is the wrapper version of `_.reverse`. * * **Note:** This method mutates the wrapped array. * * @name reverse * @memberOf _ * @since 0.1.0 * @category Seq * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var array = [1, 2, 3]; * * _(array).reverse().value() * // => [3, 2, 1] * * console.log(array); * // => [3, 2, 1] */ function wrapperReverse() { var value = this.__wrapped__; if (value instanceof LazyWrapper) { var wrapped = value; if (this.__actions__.length) { wrapped = new LazyWrapper(this); } wrapped = wrapped.reverse(); wrapped.__actions__.push({ 'func': thru, 'args': [reverse], 'thisArg': undefined }); return new LodashWrapper(wrapped, this.__chain__); } return this.thru(reverse); } /** * Executes the chain sequence to resolve the unwrapped value. * * @name value * @memberOf _ * @since 0.1.0 * @alias toJSON, valueOf * @category Seq * @returns {*} Returns the resolved unwrapped value. * @example * * _([1, 2, 3]).value(); * // => [1, 2, 3] */ function wrapperValue() { return baseWrapperValue(this.__wrapped__, this.__actions__); } /*------------------------------------------------------------------------*/ /** * Creates an object composed of keys generated from the results of running * each element of `collection` thru `iteratee`. The corresponding value of * each key is the number of times the key was returned by `iteratee`. The * iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 0.5.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * * _.countBy([6.1, 4.2, 6.3], Math.floor); * // => { '4': 1, '6': 2 } * * // The `_.property` iteratee shorthand. * _.countBy(['one', 'two', 'three'], 'length'); * // => { '3': 2, '5': 1 } */ var countBy = createAggregator(function(result, value, key) { if (hasOwnProperty.call(result, key)) { ++result[key]; } else { baseAssignValue(result, key, 1); } }); /** * Checks if `predicate` returns truthy for **all** elements of `collection`. * Iteration is stopped once `predicate` returns falsey. The predicate is * invoked with three arguments: (value, index|key, collection). * * **Note:** This method returns `true` for * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of * elements of empty collections. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {boolean} Returns `true` if all elements pass the predicate check, * else `false`. * @example * * _.every([true, 1, null, 'yes'], Boolean); * // => false * * var users = [ * { 'user': 'barney', 'age': 36, 'active': false }, * { 'user': 'fred', 'age': 40, 'active': false } * ]; * * // The `_.matches` iteratee shorthand. * _.every(users, { 'user': 'barney', 'active': false }); * // => false * * // The `_.matchesProperty` iteratee shorthand. * _.every(users, ['active', false]); * // => true * * // The `_.property` iteratee shorthand. * _.every(users, 'active'); * // => false */ function every(collection, predicate, guard) { var func = isArray(collection) ? arrayEvery : baseEvery; if (guard && isIterateeCall(collection, predicate, guard)) { predicate = undefined; } return func(collection, getIteratee(predicate, 3)); } /** * Iterates over elements of `collection`, returning an array of all elements * `predicate` returns truthy for. The predicate is invoked with three * arguments: (value, index|key, collection). * * **Note:** Unlike `_.remove`, this method returns a new array. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the new filtered array. * @see _.reject * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': true }, * { 'user': 'fred', 'age': 40, 'active': false } * ]; * * _.filter(users, function(o) { return !o.active; }); * // => objects for ['fred'] * * // The `_.matches` iteratee shorthand. * _.filter(users, { 'age': 36, 'active': true }); * // => objects for ['barney'] * * // The `_.matchesProperty` iteratee shorthand. * _.filter(users, ['active', false]); * // => objects for ['fred'] * * // The `_.property` iteratee shorthand. * _.filter(users, 'active'); * // => objects for ['barney'] */ function filter(collection, predicate) { var func = isArray(collection) ? arrayFilter : baseFilter; return func(collection, getIteratee(predicate, 3)); } /** * Iterates over elements of `collection`, returning the first element * `predicate` returns truthy for. The predicate is invoked with three * arguments: (value, index|key, collection). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=0] The index to search from. * @returns {*} Returns the matched element, else `undefined`. * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': true }, * { 'user': 'fred', 'age': 40, 'active': false }, * { 'user': 'pebbles', 'age': 1, 'active': true } * ]; * * _.find(users, function(o) { return o.age < 40; }); * // => object for 'barney' * * // The `_.matches` iteratee shorthand. * _.find(users, { 'age': 1, 'active': true }); * // => object for 'pebbles' * * // The `_.matchesProperty` iteratee shorthand. * _.find(users, ['active', false]); * // => object for 'fred' * * // The `_.property` iteratee shorthand. * _.find(users, 'active'); * // => object for 'barney' */ var find = createFind(findIndex); /** * This method is like `_.find` except that it iterates over elements of * `collection` from right to left. * * @static * @memberOf _ * @since 2.0.0 * @category Collection * @param {Array|Object} collection The collection to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=collection.length-1] The index to search from. * @returns {*} Returns the matched element, else `undefined`. * @example * * _.findLast([1, 2, 3, 4], function(n) { * return n % 2 == 1; * }); * // => 3 */ var findLast = createFind(findLastIndex); /** * Creates a flattened array of values by running each element in `collection` * thru `iteratee` and flattening the mapped results. The iteratee is invoked * with three arguments: (value, index|key, collection). * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the new flattened array. * @example * * function duplicate(n) { * return [n, n]; * } * * _.flatMap([1, 2], duplicate); * // => [1, 1, 2, 2] */ function flatMap(collection, iteratee) { return baseFlatten(map(collection, iteratee), 1); } /** * This method is like `_.flatMap` except that it recursively flattens the * mapped results. * * @static * @memberOf _ * @since 4.7.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the new flattened array. * @example * * function duplicate(n) { * return [[[n, n]]]; * } * * _.flatMapDeep([1, 2], duplicate); * // => [1, 1, 2, 2] */ function flatMapDeep(collection, iteratee) { return baseFlatten(map(collection, iteratee), INFINITY); } /** * This method is like `_.flatMap` except that it recursively flattens the * mapped results up to `depth` times. * * @static * @memberOf _ * @since 4.7.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {number} [depth=1] The maximum recursion depth. * @returns {Array} Returns the new flattened array. * @example * * function duplicate(n) { * return [[[n, n]]]; * } * * _.flatMapDepth([1, 2], duplicate, 2); * // => [[1, 1], [2, 2]] */ function flatMapDepth(collection, iteratee, depth) { depth = depth === undefined ? 1 : toInteger(depth); return baseFlatten(map(collection, iteratee), depth); } /** * Iterates over elements of `collection` and invokes `iteratee` for each element. * The iteratee is invoked with three arguments: (value, index|key, collection). * Iteratee functions may exit iteration early by explicitly returning `false`. * * **Note:** As with other "Collections" methods, objects with a "length" * property are iterated like arrays. To avoid this behavior use `_.forIn` * or `_.forOwn` for object iteration. * * @static * @memberOf _ * @since 0.1.0 * @alias each * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array|Object} Returns `collection`. * @see _.forEachRight * @example * * _.forEach([1, 2], function(value) { * console.log(value); * }); * // => Logs `1` then `2`. * * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { * console.log(key); * }); * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ function forEach(collection, iteratee) { var func = isArray(collection) ? arrayEach : baseEach; return func(collection, getIteratee(iteratee, 3)); } /** * This method is like `_.forEach` except that it iterates over elements of * `collection` from right to left. * * @static * @memberOf _ * @since 2.0.0 * @alias eachRight * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array|Object} Returns `collection`. * @see _.forEach * @example * * _.forEachRight([1, 2], function(value) { * console.log(value); * }); * // => Logs `2` then `1`. */ function forEachRight(collection, iteratee) { var func = isArray(collection) ? arrayEachRight : baseEachRight; return func(collection, getIteratee(iteratee, 3)); } /** * Creates an object composed of keys generated from the results of running * each element of `collection` thru `iteratee`. The order of grouped values * is determined by the order they occur in `collection`. The corresponding * value of each key is an array of elements responsible for generating the * key. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * * _.groupBy([6.1, 4.2, 6.3], Math.floor); * // => { '4': [4.2], '6': [6.1, 6.3] } * * // The `_.property` iteratee shorthand. * _.groupBy(['one', 'two', 'three'], 'length'); * // => { '3': ['one', 'two'], '5': ['three'] } */ var groupBy = createAggregator(function(result, value, key) { if (hasOwnProperty.call(result, key)) { result[key].push(value); } else { baseAssignValue(result, key, [value]); } }); /** * Checks if `value` is in `collection`. If `collection` is a string, it's * checked for a substring of `value`, otherwise * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * is used for equality comparisons. If `fromIndex` is negative, it's used as * the offset from the end of `collection`. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object|string} collection The collection to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=0] The index to search from. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. * @returns {boolean} Returns `true` if `value` is found, else `false`. * @example * * _.includes([1, 2, 3], 1); * // => true * * _.includes([1, 2, 3], 1, 2); * // => false * * _.includes({ 'a': 1, 'b': 2 }, 1); * // => true * * _.includes('abcd', 'bc'); * // => true */ function includes(collection, value, fromIndex, guard) { collection = isArrayLike(collection) ? collection : values(collection); fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; var length = collection.length; if (fromIndex < 0) { fromIndex = nativeMax(length + fromIndex, 0); } return isString(collection) ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) : (!!length && baseIndexOf(collection, value, fromIndex) > -1); } /** * Invokes the method at `path` of each element in `collection`, returning * an array of the results of each invoked method. Any additional arguments * are provided to each invoked method. If `path` is a function, it's invoked * for, and `this` bound to, each element in `collection`. * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Array|Function|string} path The path of the method to invoke or * the function invoked per iteration. * @param {...*} [args] The arguments to invoke each method with. * @returns {Array} Returns the array of results. * @example * * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); * // => [[1, 5, 7], [1, 2, 3]] * * _.invokeMap([123, 456], String.prototype.split, ''); * // => [['1', '2', '3'], ['4', '5', '6']] */ var invokeMap = baseRest(function(collection, path, args) { var index = -1, isFunc = typeof path == 'function', result = isArrayLike(collection) ? Array(collection.length) : []; baseEach(collection, function(value) { result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); }); return result; }); /** * Creates an object composed of keys generated from the results of running * each element of `collection` thru `iteratee`. The corresponding value of * each key is the last element responsible for generating the key. The * iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * * var array = [ * { 'dir': 'left', 'code': 97 }, * { 'dir': 'right', 'code': 100 } * ]; * * _.keyBy(array, function(o) { * return String.fromCharCode(o.code); * }); * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } * * _.keyBy(array, 'dir'); * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } */ var keyBy = createAggregator(function(result, value, key) { baseAssignValue(result, key, value); }); /** * Creates an array of values by running each element in `collection` thru * `iteratee`. The iteratee is invoked with three arguments: * (value, index|key, collection). * * Many lodash methods are guarded to work as iteratees for methods like * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. * * The guarded methods are: * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, * `template`, `trim`, `trimEnd`, `trimStart`, and `words` * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the new mapped array. * @example * * function square(n) { * return n * n; * } * * _.map([4, 8], square); * // => [16, 64] * * _.map({ 'a': 4, 'b': 8 }, square); * // => [16, 64] (iteration order is not guaranteed) * * var users = [ * { 'user': 'barney' }, * { 'user': 'fred' } * ]; * * // The `_.property` iteratee shorthand. * _.map(users, 'user'); * // => ['barney', 'fred'] */ function map(collection, iteratee) { var func = isArray(collection) ? arrayMap : baseMap; return func(collection, getIteratee(iteratee, 3)); } /** * This method is like `_.sortBy` except that it allows specifying the sort * orders of the iteratees to sort by. If `orders` is unspecified, all values * are sorted in ascending order. Otherwise, specify an order of "desc" for * descending or "asc" for ascending sort order of corresponding values. * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] * The iteratees to sort by. * @param {string[]} [orders] The sort orders of `iteratees`. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. * @returns {Array} Returns the new sorted array. * @example * * var users = [ * { 'user': 'fred', 'age': 48 }, * { 'user': 'barney', 'age': 34 }, * { 'user': 'fred', 'age': 40 }, * { 'user': 'barney', 'age': 36 } * ]; * * // Sort by `user` in ascending order and by `age` in descending order. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] */ function orderBy(collection, iteratees, orders, guard) { if (collection == null) { return []; } if (!isArray(iteratees)) { iteratees = iteratees == null ? [] : [iteratees]; } orders = guard ? undefined : orders; if (!isArray(orders)) { orders = orders == null ? [] : [orders]; } return baseOrderBy(collection, iteratees, orders); } /** * Creates an array of elements split into two groups, the first of which * contains elements `predicate` returns truthy for, the second of which * contains elements `predicate` returns falsey for. The predicate is * invoked with one argument: (value). * * @static * @memberOf _ * @since 3.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the array of grouped elements. * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': false }, * { 'user': 'fred', 'age': 40, 'active': true }, * { 'user': 'pebbles', 'age': 1, 'active': false } * ]; * * _.partition(users, function(o) { return o.active; }); * // => objects for [['fred'], ['barney', 'pebbles']] * * // The `_.matches` iteratee shorthand. * _.partition(users, { 'age': 1, 'active': false }); * // => objects for [['pebbles'], ['barney', 'fred']] * * // The `_.matchesProperty` iteratee shorthand. * _.partition(users, ['active', false]); * // => objects for [['barney', 'pebbles'], ['fred']] * * // The `_.property` iteratee shorthand. * _.partition(users, 'active'); * // => objects for [['fred'], ['barney', 'pebbles']] */ var partition = createAggregator(function(result, value, key) { result[key ? 0 : 1].push(value); }, function() { return [[], []]; }); /** * Reduces `collection` to a value which is the accumulated result of running * each element in `collection` thru `iteratee`, where each successive * invocation is supplied the return value of the previous. If `accumulator` * is not given, the first element of `collection` is used as the initial * value. The iteratee is invoked with four arguments: * (accumulator, value, index|key, collection). * * Many lodash methods are guarded to work as iteratees for methods like * `_.reduce`, `_.reduceRight`, and `_.transform`. * * The guarded methods are: * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, * and `sortBy` * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {*} [accumulator] The initial value. * @returns {*} Returns the accumulated value. * @see _.reduceRight * @example * * _.reduce([1, 2], function(sum, n) { * return sum + n; * }, 0); * // => 3 * * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { * (result[value] || (result[value] = [])).push(key); * return result; * }, {}); * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) */ function reduce(collection, iteratee, accumulator) { var func = isArray(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3; return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); } /** * This method is like `_.reduce` except that it iterates over elements of * `collection` from right to left. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {*} [accumulator] The initial value. * @returns {*} Returns the accumulated value. * @see _.reduce * @example * * var array = [[0, 1], [2, 3], [4, 5]]; * * _.reduceRight(array, function(flattened, other) { * return flattened.concat(other); * }, []); * // => [4, 5, 2, 3, 0, 1] */ function reduceRight(collection, iteratee, accumulator) { var func = isArray(collection) ? arrayReduceRight : baseReduce, initAccum = arguments.length < 3; return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); } /** * The opposite of `_.filter`; this method returns the elements of `collection` * that `predicate` does **not** return truthy for. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the new filtered array. * @see _.filter * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': false }, * { 'user': 'fred', 'age': 40, 'active': true } * ]; * * _.reject(users, function(o) { return !o.active; }); * // => objects for ['fred'] * * // The `_.matches` iteratee shorthand. * _.reject(users, { 'age': 40, 'active': true }); * // => objects for ['barney'] * * // The `_.matchesProperty` iteratee shorthand. * _.reject(users, ['active', false]); * // => objects for ['fred'] * * // The `_.property` iteratee shorthand. * _.reject(users, 'active'); * // => objects for ['barney'] */ function reject(collection, predicate) { var func = isArray(collection) ? arrayFilter : baseFilter; return func(collection, negate(getIteratee(predicate, 3))); } /** * Gets a random element from `collection`. * * @static * @memberOf _ * @since 2.0.0 * @category Collection * @param {Array|Object} collection The collection to sample. * @returns {*} Returns the random element. * @example * * _.sample([1, 2, 3, 4]); * // => 2 */ function sample(collection) { var func = isArray(collection) ? arraySample : baseSample; return func(collection); } /** * Gets `n` random elements at unique keys from `collection` up to the * size of `collection`. * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to sample. * @param {number} [n=1] The number of elements to sample. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the random elements. * @example * * _.sampleSize([1, 2, 3], 2); * // => [3, 1] * * _.sampleSize([1, 2, 3], 4); * // => [2, 3, 1] */ function sampleSize(collection, n, guard) { if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { n = 1; } else { n = toInteger(n); } var func = isArray(collection) ? arraySampleSize : baseSampleSize; return func(collection, n); } /** * Creates an array of shuffled values, using a version of the * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to shuffle. * @returns {Array} Returns the new shuffled array. * @example * * _.shuffle([1, 2, 3, 4]); * // => [4, 1, 3, 2] */ function shuffle(collection) { var func = isArray(collection) ? arrayShuffle : baseShuffle; return func(collection); } /** * Gets the size of `collection` by returning its length for array-like * values or the number of own enumerable string keyed properties for objects. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object|string} collection The collection to inspect. * @returns {number} Returns the collection size. * @example * * _.size([1, 2, 3]); * // => 3 * * _.size({ 'a': 1, 'b': 2 }); * // => 2 * * _.size('pebbles'); * // => 7 */ function size(collection) { if (collection == null) { return 0; } if (isArrayLike(collection)) { return isString(collection) ? stringSize(collection) : collection.length; } var tag = getTag(collection); if (tag == mapTag || tag == setTag) { return collection.size; } return baseKeys(collection).length; } /** * Checks if `predicate` returns truthy for **any** element of `collection`. * Iteration is stopped once `predicate` returns truthy. The predicate is * invoked with three arguments: (value, index|key, collection). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. * @example * * _.some([null, 0, 'yes', false], Boolean); * // => true * * var users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false } * ]; * * // The `_.matches` iteratee shorthand. * _.some(users, { 'user': 'barney', 'active': false }); * // => false * * // The `_.matchesProperty` iteratee shorthand. * _.some(users, ['active', false]); * // => true * * // The `_.property` iteratee shorthand. * _.some(users, 'active'); * // => true */ function some(collection, predicate, guard) { var func = isArray(collection) ? arraySome : baseSome; if (guard && isIterateeCall(collection, predicate, guard)) { predicate = undefined; } return func(collection, getIteratee(predicate, 3)); } /** * Creates an array of elements, sorted in ascending order by the results of * running each element in a collection thru each iteratee. This method * performs a stable sort, that is, it preserves the original sort order of * equal elements. The iteratees are invoked with one argument: (value). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {...(Function|Function[])} [iteratees=[_.identity]] * The iteratees to sort by. * @returns {Array} Returns the new sorted array. * @example * * var users = [ * { 'user': 'fred', 'age': 48 }, * { 'user': 'barney', 'age': 36 }, * { 'user': 'fred', 'age': 40 }, * { 'user': 'barney', 'age': 34 } * ]; * * _.sortBy(users, [function(o) { return o.user; }]); * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] * * _.sortBy(users, ['user', 'age']); * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] */ var sortBy = baseRest(function(collection, iteratees) { if (collection == null) { return []; } var length = iteratees.length; if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { iteratees = []; } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { iteratees = [iteratees[0]]; } return baseOrderBy(collection, baseFlatten(iteratees, 1), []); }); /*------------------------------------------------------------------------*/ /** * Gets the timestamp of the number of milliseconds that have elapsed since * the Unix epoch (1 January 1970 00:00:00 UTC). * * @static * @memberOf _ * @since 2.4.0 * @category Date * @returns {number} Returns the timestamp. * @example * * _.defer(function(stamp) { * console.log(_.now() - stamp); * }, _.now()); * // => Logs the number of milliseconds it took for the deferred invocation. */ var now = ctxNow || function() { return root.Date.now(); }; /*------------------------------------------------------------------------*/ /** * The opposite of `_.before`; this method creates a function that invokes * `func` once it's called `n` or more times. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {number} n The number of calls before `func` is invoked. * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. * @example * * var saves = ['profile', 'settings']; * * var done = _.after(saves.length, function() { * console.log('done saving!'); * }); * * _.forEach(saves, function(type) { * asyncSave({ 'type': type, 'complete': done }); * }); * // => Logs 'done saving!' after the two async saves have completed. */ function after(n, func) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } n = toInteger(n); return function() { if (--n < 1) { return func.apply(this, arguments); } }; } /** * Creates a function that invokes `func`, with up to `n` arguments, * ignoring any additional arguments. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {Function} func The function to cap arguments for. * @param {number} [n=func.length] The arity cap. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the new capped function. * @example * * _.map(['6', '8', '10'], _.ary(parseInt, 1)); * // => [6, 8, 10] */ function ary(func, n, guard) { n = guard ? undefined : n; n = (func && n == null) ? func.length : n; return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); } /** * Creates a function that invokes `func`, with the `this` binding and arguments * of the created function, while it's called less than `n` times. Subsequent * calls to the created function return the result of the last `func` invocation. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {number} n The number of calls at which `func` is no longer invoked. * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. * @example * * jQuery(element).on('click', _.before(5, addContactToList)); * // => Allows adding up to 4 contacts to the list. */ function before(n, func) { var result; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } n = toInteger(n); return function() { if (--n > 0) { result = func.apply(this, arguments); } if (n <= 1) { func = undefined; } return result; }; } /** * Creates a function that invokes `func` with the `this` binding of `thisArg` * and `partials` prepended to the arguments it receives. * * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, * may be used as a placeholder for partially applied arguments. * * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" * property of bound functions. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to bind. * @param {*} thisArg The `this` binding of `func`. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new bound function. * @example * * function greet(greeting, punctuation) { * return greeting + ' ' + this.user + punctuation; * } * * var object = { 'user': 'fred' }; * * var bound = _.bind(greet, object, 'hi'); * bound('!'); * // => 'hi fred!' * * // Bound with placeholders. * var bound = _.bind(greet, object, _, '!'); * bound('hi'); * // => 'hi fred!' */ var bind = baseRest(function(func, thisArg, partials) { var bitmask = WRAP_BIND_FLAG; if (partials.length) { var holders = replaceHolders(partials, getHolder(bind)); bitmask |= WRAP_PARTIAL_FLAG; } return createWrap(func, bitmask, thisArg, partials, holders); }); /** * Creates a function that invokes the method at `object[key]` with `partials` * prepended to the arguments it receives. * * This method differs from `_.bind` by allowing bound functions to reference * methods that may be redefined or don't yet exist. See * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) * for more details. * * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for partially applied arguments. * * @static * @memberOf _ * @since 0.10.0 * @category Function * @param {Object} object The object to invoke the method on. * @param {string} key The key of the method. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new bound function. * @example * * var object = { * 'user': 'fred', * 'greet': function(greeting, punctuation) { * return greeting + ' ' + this.user + punctuation; * } * }; * * var bound = _.bindKey(object, 'greet', 'hi'); * bound('!'); * // => 'hi fred!' * * object.greet = function(greeting, punctuation) { * return greeting + 'ya ' + this.user + punctuation; * }; * * bound('!'); * // => 'hiya fred!' * * // Bound with placeholders. * var bound = _.bindKey(object, 'greet', _, '!'); * bound('hi'); * // => 'hiya fred!' */ var bindKey = baseRest(function(object, key, partials) { var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; if (partials.length) { var holders = replaceHolders(partials, getHolder(bindKey)); bitmask |= WRAP_PARTIAL_FLAG; } return createWrap(key, bitmask, object, partials, holders); }); /** * Creates a function that accepts arguments of `func` and either invokes * `func` returning its result, if at least `arity` number of arguments have * been provided, or returns a function that accepts the remaining `func` * arguments, and so on. The arity of `func` may be specified if `func.length` * is not sufficient. * * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, * may be used as a placeholder for provided arguments. * * **Note:** This method doesn't set the "length" property of curried functions. * * @static * @memberOf _ * @since 2.0.0 * @category Function * @param {Function} func The function to curry. * @param {number} [arity=func.length] The arity of `func`. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the new curried function. * @example * * var abc = function(a, b, c) { * return [a, b, c]; * }; * * var curried = _.curry(abc); * * curried(1)(2)(3); * // => [1, 2, 3] * * curried(1, 2)(3); * // => [1, 2, 3] * * curried(1, 2, 3); * // => [1, 2, 3] * * // Curried with placeholders. * curried(1)(_, 3)(2); * // => [1, 2, 3] */ function curry(func, arity, guard) { arity = guard ? undefined : arity; var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); result.placeholder = curry.placeholder; return result; } /** * This method is like `_.curry` except that arguments are applied to `func` * in the manner of `_.partialRight` instead of `_.partial`. * * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for provided arguments. * * **Note:** This method doesn't set the "length" property of curried functions. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {Function} func The function to curry. * @param {number} [arity=func.length] The arity of `func`. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the new curried function. * @example * * var abc = function(a, b, c) { * return [a, b, c]; * }; * * var curried = _.curryRight(abc); * * curried(3)(2)(1); * // => [1, 2, 3] * * curried(2, 3)(1); * // => [1, 2, 3] * * curried(1, 2, 3); * // => [1, 2, 3] * * // Curried with placeholders. * curried(3)(1, _)(2); * // => [1, 2, 3] */ function curryRight(func, arity, guard) { arity = guard ? undefined : arity; var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); result.placeholder = curryRight.placeholder; return result; } /** * Creates a debounced function that delays invoking `func` until after `wait` * milliseconds have elapsed since the last time the debounced function was * invoked. The debounced function comes with a `cancel` method to cancel * delayed `func` invocations and a `flush` method to immediately invoke them. * Provide `options` to indicate whether `func` should be invoked on the * leading and/or trailing edge of the `wait` timeout. The `func` is invoked * with the last arguments provided to the debounced function. Subsequent * calls to the debounced function return the result of the last `func` * invocation. * * **Note:** If `leading` and `trailing` options are `true`, `func` is * invoked on the trailing edge of the timeout only if the debounced function * is invoked more than once during the `wait` timeout. * * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred * until to the next tick, similar to `setTimeout` with a timeout of `0`. * * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) * for details over the differences between `_.debounce` and `_.throttle`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to debounce. * @param {number} [wait=0] The number of milliseconds to delay. * @param {Object} [options={}] The options object. * @param {boolean} [options.leading=false] * Specify invoking on the leading edge of the timeout. * @param {number} [options.maxWait] * The maximum time `func` is allowed to be delayed before it's invoked. * @param {boolean} [options.trailing=true] * Specify invoking on the trailing edge of the timeout. * @returns {Function} Returns the new debounced function. * @example * * // Avoid costly calculations while the window size is in flux. * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); * * // Invoke `sendMail` when clicked, debouncing subsequent calls. * jQuery(element).on('click', _.debounce(sendMail, 300, { * 'leading': true, * 'trailing': false * })); * * // Ensure `batchLog` is invoked once after 1 second of debounced calls. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); * var source = new EventSource('/stream'); * jQuery(source).on('message', debounced); * * // Cancel the trailing debounced invocation. * jQuery(window).on('popstate', debounced.cancel); */ function debounce(func, wait, options) { var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } wait = toNumber(wait) || 0; if (isObject(options)) { leading = !!options.leading; maxing = 'maxWait' in options; maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; trailing = 'trailing' in options ? !!options.trailing : trailing; } function invokeFunc(time) { var args = lastArgs, thisArg = lastThis; lastArgs = lastThis = undefined; lastInvokeTime = time; result = func.apply(thisArg, args); return result; } function leadingEdge(time) { // Reset any `maxWait` timer. lastInvokeTime = time; // Start the timer for the trailing edge. timerId = setTimeout(timerExpired, wait); // Invoke the leading edge. return leading ? invokeFunc(time) : result; } function remainingWait(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall; return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting; } function shouldInvoke(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime; // Either this is the first call, activity has stopped and we're at the // trailing edge, the system time has gone backwards and we're treating // it as the trailing edge, or we've hit the `maxWait` limit. return (lastCallTime === undefined || (timeSinceLastCall >= wait) || (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); } function timerExpired() { var time = now(); if (shouldInvoke(time)) { return trailingEdge(time); } // Restart the timer. timerId = setTimeout(timerExpired, remainingWait(time)); } function trailingEdge(time) { timerId = undefined; // Only invoke if we have `lastArgs` which means `func` has been // debounced at least once. if (trailing && lastArgs) { return invokeFunc(time); } lastArgs = lastThis = undefined; return result; } function cancel() { if (timerId !== undefined) { clearTimeout(timerId); } lastInvokeTime = 0; lastArgs = lastCallTime = lastThis = timerId = undefined; } function flush() { return timerId === undefined ? result : trailingEdge(now()); } function debounced() { var time = now(), isInvoking = shouldInvoke(time); lastArgs = arguments; lastThis = this; lastCallTime = time; if (isInvoking) { if (timerId === undefined) { return leadingEdge(lastCallTime); } if (maxing) { // Handle invocations in a tight loop. clearTimeout(timerId); timerId = setTimeout(timerExpired, wait); return invokeFunc(lastCallTime); } } if (timerId === undefined) { timerId = setTimeout(timerExpired, wait); } return result; } debounced.cancel = cancel; debounced.flush = flush; return debounced; } /** * Defers invoking the `func` until the current call stack has cleared. Any * additional arguments are provided to `func` when it's invoked. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to defer. * @param {...*} [args] The arguments to invoke `func` with. * @returns {number} Returns the timer id. * @example * * _.defer(function(text) { * console.log(text); * }, 'deferred'); * // => Logs 'deferred' after one millisecond. */ var defer = baseRest(function(func, args) { return baseDelay(func, 1, args); }); /** * Invokes `func` after `wait` milliseconds. Any additional arguments are * provided to `func` when it's invoked. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. * @param {...*} [args] The arguments to invoke `func` with. * @returns {number} Returns the timer id. * @example * * _.delay(function(text) { * console.log(text); * }, 1000, 'later'); * // => Logs 'later' after one second. */ var delay = baseRest(function(func, wait, args) { return baseDelay(func, toNumber(wait) || 0, args); }); /** * Creates a function that invokes `func` with arguments reversed. * * @static * @memberOf _ * @since 4.0.0 * @category Function * @param {Function} func The function to flip arguments for. * @returns {Function} Returns the new flipped function. * @example * * var flipped = _.flip(function() { * return _.toArray(arguments); * }); * * flipped('a', 'b', 'c', 'd'); * // => ['d', 'c', 'b', 'a'] */ function flip(func) { return createWrap(func, WRAP_FLIP_FLAG); } /** * Creates a function that memoizes the result of `func`. If `resolver` is * provided, it determines the cache key for storing the result based on the * arguments provided to the memoized function. By default, the first argument * provided to the memoized function is used as the map cache key. The `func` * is invoked with the `this` binding of the memoized function. * * **Note:** The cache is exposed as the `cache` property on the memoized * function. Its creation may be customized by replacing the `_.memoize.Cache` * constructor with one whose instances implement the * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) * method interface of `clear`, `delete`, `get`, `has`, and `set`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to have its output memoized. * @param {Function} [resolver] The function to resolve the cache key. * @returns {Function} Returns the new memoized function. * @example * * var object = { 'a': 1, 'b': 2 }; * var other = { 'c': 3, 'd': 4 }; * * var values = _.memoize(_.values); * values(object); * // => [1, 2] * * values(other); * // => [3, 4] * * object.a = 2; * values(object); * // => [1, 2] * * // Modify the result cache. * values.cache.set(object, ['a', 'b']); * values(object); * // => ['a', 'b'] * * // Replace `_.memoize.Cache`. * _.memoize.Cache = WeakMap; */ function memoize(func, resolver) { if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { throw new TypeError(FUNC_ERROR_TEXT); } var memoized = function() { var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; if (cache.has(key)) { return cache.get(key); } var result = func.apply(this, args); memoized.cache = cache.set(key, result) || cache; return result; }; memoized.cache = new (memoize.Cache || MapCache); return memoized; } // Expose `MapCache`. memoize.Cache = MapCache; /** * Creates a function that negates the result of the predicate `func`. The * `func` predicate is invoked with the `this` binding and arguments of the * created function. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {Function} predicate The predicate to negate. * @returns {Function} Returns the new negated function. * @example * * function isEven(n) { * return n % 2 == 0; * } * * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); * // => [1, 3, 5] */ function negate(predicate) { if (typeof predicate != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } return function() { var args = arguments; switch (args.length) { case 0: return !predicate.call(this); case 1: return !predicate.call(this, args[0]); case 2: return !predicate.call(this, args[0], args[1]); case 3: return !predicate.call(this, args[0], args[1], args[2]); } return !predicate.apply(this, args); }; } /** * Creates a function that is restricted to invoking `func` once. Repeat calls * to the function return the value of the first invocation. The `func` is * invoked with the `this` binding and arguments of the created function. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. * @example * * var initialize = _.once(createApplication); * initialize(); * initialize(); * // => `createApplication` is invoked once */ function once(func) { return before(2, func); } /** * Creates a function that invokes `func` with its arguments transformed. * * @static * @since 4.0.0 * @memberOf _ * @category Function * @param {Function} func The function to wrap. * @param {...(Function|Function[])} [transforms=[_.identity]] * The argument transforms. * @returns {Function} Returns the new function. * @example * * function doubled(n) { * return n * 2; * } * * function square(n) { * return n * n; * } * * var func = _.overArgs(function(x, y) { * return [x, y]; * }, [square, doubled]); * * func(9, 3); * // => [81, 6] * * func(10, 5); * // => [100, 10] */ var overArgs = castRest(function(func, transforms) { transforms = (transforms.length == 1 && isArray(transforms[0])) ? arrayMap(transforms[0], baseUnary(getIteratee())) : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); var funcsLength = transforms.length; return baseRest(function(args) { var index = -1, length = nativeMin(args.length, funcsLength); while (++index < length) { args[index] = transforms[index].call(this, args[index]); } return apply(func, this, args); }); }); /** * Creates a function that invokes `func` with `partials` prepended to the * arguments it receives. This method is like `_.bind` except it does **not** * alter the `this` binding. * * The `_.partial.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for partially applied arguments. * * **Note:** This method doesn't set the "length" property of partially * applied functions. * * @static * @memberOf _ * @since 0.2.0 * @category Function * @param {Function} func The function to partially apply arguments to. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new partially applied function. * @example * * function greet(greeting, name) { * return greeting + ' ' + name; * } * * var sayHelloTo = _.partial(greet, 'hello'); * sayHelloTo('fred'); * // => 'hello fred' * * // Partially applied with placeholders. * var greetFred = _.partial(greet, _, 'fred'); * greetFred('hi'); * // => 'hi fred' */ var partial = baseRest(function(func, partials) { var holders = replaceHolders(partials, getHolder(partial)); return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); }); /** * This method is like `_.partial` except that partially applied arguments * are appended to the arguments it receives. * * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for partially applied arguments. * * **Note:** This method doesn't set the "length" property of partially * applied functions. * * @static * @memberOf _ * @since 1.0.0 * @category Function * @param {Function} func The function to partially apply arguments to. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new partially applied function. * @example * * function greet(greeting, name) { * return greeting + ' ' + name; * } * * var greetFred = _.partialRight(greet, 'fred'); * greetFred('hi'); * // => 'hi fred' * * // Partially applied with placeholders. * var sayHelloTo = _.partialRight(greet, 'hello', _); * sayHelloTo('fred'); * // => 'hello fred' */ var partialRight = baseRest(function(func, partials) { var holders = replaceHolders(partials, getHolder(partialRight)); return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); }); /** * Creates a function that invokes `func` with arguments arranged according * to the specified `indexes` where the argument value at the first index is * provided as the first argument, the argument value at the second index is * provided as the second argument, and so on. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {Function} func The function to rearrange arguments for. * @param {...(number|number[])} indexes The arranged argument indexes. * @returns {Function} Returns the new function. * @example * * var rearged = _.rearg(function(a, b, c) { * return [a, b, c]; * }, [2, 0, 1]); * * rearged('b', 'c', 'a') * // => ['a', 'b', 'c'] */ var rearg = flatRest(function(func, indexes) { return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); }); /** * Creates a function that invokes `func` with the `this` binding of the * created function and arguments from `start` and beyond provided as * an array. * * **Note:** This method is based on the * [rest parameter](https://mdn.io/rest_parameters). * * @static * @memberOf _ * @since 4.0.0 * @category Function * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @returns {Function} Returns the new function. * @example * * var say = _.rest(function(what, names) { * return what + ' ' + _.initial(names).join(', ') + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); * }); * * say('hello', 'fred', 'barney', 'pebbles'); * // => 'hello fred, barney, & pebbles' */ function rest(func, start) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } start = start === undefined ? start : toInteger(start); return baseRest(func, start); } /** * Creates a function that invokes `func` with the `this` binding of the * create function and an array of arguments much like * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). * * **Note:** This method is based on the * [spread operator](https://mdn.io/spread_operator). * * @static * @memberOf _ * @since 3.2.0 * @category Function * @param {Function} func The function to spread arguments over. * @param {number} [start=0] The start position of the spread. * @returns {Function} Returns the new function. * @example * * var say = _.spread(function(who, what) { * return who + ' says ' + what; * }); * * say(['fred', 'hello']); * // => 'fred says hello' * * var numbers = Promise.all([ * Promise.resolve(40), * Promise.resolve(36) * ]); * * numbers.then(_.spread(function(x, y) { * return x + y; * })); * // => a Promise of 76 */ function spread(func, start) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } start = start == null ? 0 : nativeMax(toInteger(start), 0); return baseRest(function(args) { var array = args[start], otherArgs = castSlice(args, 0, start); if (array) { arrayPush(otherArgs, array); } return apply(func, this, otherArgs); }); } /** * Creates a throttled function that only invokes `func` at most once per * every `wait` milliseconds. The throttled function comes with a `cancel` * method to cancel delayed `func` invocations and a `flush` method to * immediately invoke them. Provide `options` to indicate whether `func` * should be invoked on the leading and/or trailing edge of the `wait` * timeout. The `func` is invoked with the last arguments provided to the * throttled function. Subsequent calls to the throttled function return the * result of the last `func` invocation. * * **Note:** If `leading` and `trailing` options are `true`, `func` is * invoked on the trailing edge of the timeout only if the throttled function * is invoked more than once during the `wait` timeout. * * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred * until to the next tick, similar to `setTimeout` with a timeout of `0`. * * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) * for details over the differences between `_.throttle` and `_.debounce`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to throttle. * @param {number} [wait=0] The number of milliseconds to throttle invocations to. * @param {Object} [options={}] The options object. * @param {boolean} [options.leading=true] * Specify invoking on the leading edge of the timeout. * @param {boolean} [options.trailing=true] * Specify invoking on the trailing edge of the timeout. * @returns {Function} Returns the new throttled function. * @example * * // Avoid excessively updating the position while scrolling. * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); * * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); * jQuery(element).on('click', throttled); * * // Cancel the trailing throttled invocation. * jQuery(window).on('popstate', throttled.cancel); */ function throttle(func, wait, options) { var leading = true, trailing = true; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } if (isObject(options)) { leading = 'leading' in options ? !!options.leading : leading; trailing = 'trailing' in options ? !!options.trailing : trailing; } return debounce(func, wait, { 'leading': leading, 'maxWait': wait, 'trailing': trailing }); } /** * Creates a function that accepts up to one argument, ignoring any * additional arguments. * * @static * @memberOf _ * @since 4.0.0 * @category Function * @param {Function} func The function to cap arguments for. * @returns {Function} Returns the new capped function. * @example * * _.map(['6', '8', '10'], _.unary(parseInt)); * // => [6, 8, 10] */ function unary(func) { return ary(func, 1); } /** * Creates a function that provides `value` to `wrapper` as its first * argument. Any additional arguments provided to the function are appended * to those provided to the `wrapper`. The wrapper is invoked with the `this` * binding of the created function. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {*} value The value to wrap. * @param {Function} [wrapper=identity] The wrapper function. * @returns {Function} Returns the new function. * @example * * var p = _.wrap(_.escape, function(func, text) { * return '<p>' + func(text) + '</p>'; * }); * * p('fred, barney, & pebbles'); * // => '<p>fred, barney, & pebbles</p>' */ function wrap(value, wrapper) { return partial(castFunction(wrapper), value); } /*------------------------------------------------------------------------*/ /** * Casts `value` as an array if it's not one. * * @static * @memberOf _ * @since 4.4.0 * @category Lang * @param {*} value The value to inspect. * @returns {Array} Returns the cast array. * @example * * _.castArray(1); * // => [1] * * _.castArray({ 'a': 1 }); * // => [{ 'a': 1 }] * * _.castArray('abc'); * // => ['abc'] * * _.castArray(null); * // => [null] * * _.castArray(undefined); * // => [undefined] * * _.castArray(); * // => [] * * var array = [1, 2, 3]; * console.log(_.castArray(array) === array); * // => true */ function castArray() { if (!arguments.length) { return []; } var value = arguments[0]; return isArray(value) ? value : [value]; } /** * Creates a shallow clone of `value`. * * **Note:** This method is loosely based on the * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) * and supports cloning arrays, array buffers, booleans, date objects, maps, * numbers, `Object` objects, regexes, sets, strings, symbols, and typed * arrays. The own enumerable properties of `arguments` objects are cloned * as plain objects. An empty object is returned for uncloneable values such * as error objects, functions, DOM nodes, and WeakMaps. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to clone. * @returns {*} Returns the cloned value. * @see _.cloneDeep * @example * * var objects = [{ 'a': 1 }, { 'b': 2 }]; * * var shallow = _.clone(objects); * console.log(shallow[0] === objects[0]); * // => true */ function clone(value) { return baseClone(value, CLONE_SYMBOLS_FLAG); } /** * This method is like `_.clone` except that it accepts `customizer` which * is invoked to produce the cloned value. If `customizer` returns `undefined`, * cloning is handled by the method instead. The `customizer` is invoked with * up to four arguments; (value [, index|key, object, stack]). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to clone. * @param {Function} [customizer] The function to customize cloning. * @returns {*} Returns the cloned value. * @see _.cloneDeepWith * @example * * function customizer(value) { * if (_.isElement(value)) { * return value.cloneNode(false); * } * } * * var el = _.cloneWith(document.body, customizer); * * console.log(el === document.body); * // => false * console.log(el.nodeName); * // => 'BODY' * console.log(el.childNodes.length); * // => 0 */ function cloneWith(value, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); } /** * This method is like `_.clone` except that it recursively clones `value`. * * @static * @memberOf _ * @since 1.0.0 * @category Lang * @param {*} value The value to recursively clone. * @returns {*} Returns the deep cloned value. * @see _.clone * @example * * var objects = [{ 'a': 1 }, { 'b': 2 }]; * * var deep = _.cloneDeep(objects); * console.log(deep[0] === objects[0]); * // => false */ function cloneDeep(value) { return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); } /** * This method is like `_.cloneWith` except that it recursively clones `value`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to recursively clone. * @param {Function} [customizer] The function to customize cloning. * @returns {*} Returns the deep cloned value. * @see _.cloneWith * @example * * function customizer(value) { * if (_.isElement(value)) { * return value.cloneNode(true); * } * } * * var el = _.cloneDeepWith(document.body, customizer); * * console.log(el === document.body); * // => false * console.log(el.nodeName); * // => 'BODY' * console.log(el.childNodes.length); * // => 20 */ function cloneDeepWith(value, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); } /** * Checks if `object` conforms to `source` by invoking the predicate * properties of `source` with the corresponding property values of `object`. * * **Note:** This method is equivalent to `_.conforms` when `source` is * partially applied. * * @static * @memberOf _ * @since 4.14.0 * @category Lang * @param {Object} object The object to inspect. * @param {Object} source The object of property predicates to conform to. * @returns {boolean} Returns `true` if `object` conforms, else `false`. * @example * * var object = { 'a': 1, 'b': 2 }; * * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); * // => true * * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); * // => false */ function conformsTo(object, source) { return source == null || baseConformsTo(object, source, keys(source)); } /** * Performs a * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.eq(object, object); * // => true * * _.eq(object, other); * // => false * * _.eq('a', 'a'); * // => true * * _.eq('a', Object('a')); * // => false * * _.eq(NaN, NaN); * // => true */ function eq(value, other) { return value === other || (value !== value && other !== other); } /** * Checks if `value` is greater than `other`. * * @static * @memberOf _ * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is greater than `other`, * else `false`. * @see _.lt * @example * * _.gt(3, 1); * // => true * * _.gt(3, 3); * // => false * * _.gt(1, 3); * // => false */ var gt = createRelationalOperation(baseGt); /** * Checks if `value` is greater than or equal to `other`. * * @static * @memberOf _ * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is greater than or equal to * `other`, else `false`. * @see _.lte * @example * * _.gte(3, 1); * // => true * * _.gte(3, 3); * // => true * * _.gte(1, 3); * // => false */ var gte = createRelationalOperation(function(value, other) { return value >= other; }); /** * Checks if `value` is likely an `arguments` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, * else `false`. * @example * * _.isArguments(function() { return arguments; }()); * // => true * * _.isArguments([1, 2, 3]); * // => false */ var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee'); }; /** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(document.body.children); * // => false * * _.isArray('abc'); * // => false * * _.isArray(_.noop); * // => false */ var isArray = Array.isArray; /** * Checks if `value` is classified as an `ArrayBuffer` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. * @example * * _.isArrayBuffer(new ArrayBuffer(2)); * // => true * * _.isArrayBuffer(new Array(2)); * // => false */ var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; /** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @example * * _.isArrayLike([1, 2, 3]); * // => true * * _.isArrayLike(document.body.children); * // => true * * _.isArrayLike('abc'); * // => true * * _.isArrayLike(_.noop); * // => false */ function isArrayLike(value) { return value != null && isLength(value.length) && !isFunction(value); } /** * This method is like `_.isArrayLike` except that it also checks if `value` * is an object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array-like object, * else `false`. * @example * * _.isArrayLikeObject([1, 2, 3]); * // => true * * _.isArrayLikeObject(document.body.children); * // => true * * _.isArrayLikeObject('abc'); * // => false * * _.isArrayLikeObject(_.noop); * // => false */ function isArrayLikeObject(value) { return isObjectLike(value) && isArrayLike(value); } /** * Checks if `value` is classified as a boolean primitive or object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. * @example * * _.isBoolean(false); * // => true * * _.isBoolean(null); * // => false */ function isBoolean(value) { return value === true || value === false || (isObjectLike(value) && baseGetTag(value) == boolTag); } /** * Checks if `value` is a buffer. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. * @example * * _.isBuffer(new Buffer(2)); * // => true * * _.isBuffer(new Uint8Array(2)); * // => false */ var isBuffer = nativeIsBuffer || stubFalse; /** * Checks if `value` is classified as a `Date` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a date object, else `false`. * @example * * _.isDate(new Date); * // => true * * _.isDate('Mon April 23 2012'); * // => false */ var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; /** * Checks if `value` is likely a DOM element. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. * @example * * _.isElement(document.body); * // => true * * _.isElement('<body>'); * // => false */ function isElement(value) { return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); } /** * Checks if `value` is an empty object, collection, map, or set. * * Objects are considered empty if they have no own enumerable string keyed * properties. * * Array-like values such as `arguments` objects, arrays, buffers, strings, or * jQuery-like collections are considered empty if they have a `length` of `0`. * Similarly, maps and sets are considered empty if they have a `size` of `0`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is empty, else `false`. * @example * * _.isEmpty(null); * // => true * * _.isEmpty(true); * // => true * * _.isEmpty(1); * // => true * * _.isEmpty([1, 2, 3]); * // => false * * _.isEmpty({ 'a': 1 }); * // => false */ function isEmpty(value) { if (value == null) { return true; } if (isArrayLike(value) && (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || isBuffer(value) || isTypedArray(value) || isArguments(value))) { return !value.length; } var tag = getTag(value); if (tag == mapTag || tag == setTag) { return !value.size; } if (isPrototype(value)) { return !baseKeys(value).length; } for (var key in value) { if (hasOwnProperty.call(value, key)) { return false; } } return true; } /** * Performs a deep comparison between two values to determine if they are * equivalent. * * **Note:** This method supports comparing arrays, array buffers, booleans, * date objects, error objects, maps, numbers, `Object` objects, regexes, * sets, strings, symbols, and typed arrays. `Object` objects are compared * by their own, not inherited, enumerable properties. Functions and DOM * nodes are compared by strict equality, i.e. `===`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.isEqual(object, other); * // => true * * object === other; * // => false */ function isEqual(value, other) { return baseIsEqual(value, other); } /** * This method is like `_.isEqual` except that it accepts `customizer` which * is invoked to compare values. If `customizer` returns `undefined`, comparisons * are handled by the method instead. The `customizer` is invoked with up to * six arguments: (objValue, othValue [, index|key, object, other, stack]). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @param {Function} [customizer] The function to customize comparisons. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * function isGreeting(value) { * return /^h(?:i|ello)$/.test(value); * } * * function customizer(objValue, othValue) { * if (isGreeting(objValue) && isGreeting(othValue)) { * return true; * } * } * * var array = ['hello', 'goodbye']; * var other = ['hi', 'goodbye']; * * _.isEqualWith(array, other, customizer); * // => true */ function isEqualWith(value, other, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; var result = customizer ? customizer(value, other) : undefined; return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; } /** * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, * `SyntaxError`, `TypeError`, or `URIError` object. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an error object, else `false`. * @example * * _.isError(new Error); * // => true * * _.isError(Error); * // => false */ function isError(value) { if (!isObjectLike(value)) { return false; } var tag = baseGetTag(value); return tag == errorTag || tag == domExcTag || (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); } /** * Checks if `value` is a finite primitive number. * * **Note:** This method is based on * [`Number.isFinite`](https://mdn.io/Number/isFinite). * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. * @example * * _.isFinite(3); * // => true * * _.isFinite(Number.MIN_VALUE); * // => true * * _.isFinite(Infinity); * // => false * * _.isFinite('3'); * // => false */ function isFinite(value) { return typeof value == 'number' && nativeIsFinite(value); } /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */ function isFunction(value) { if (!isObject(value)) { return false; } // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 9 which returns 'object' for typed arrays and other constructors. var tag = baseGetTag(value); return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } /** * Checks if `value` is an integer. * * **Note:** This method is based on * [`Number.isInteger`](https://mdn.io/Number/isInteger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an integer, else `false`. * @example * * _.isInteger(3); * // => true * * _.isInteger(Number.MIN_VALUE); * // => false * * _.isInteger(Infinity); * // => false * * _.isInteger('3'); * // => false */ function isInteger(value) { return typeof value == 'number' && value == toInteger(value); } /** * Checks if `value` is a valid array-like length. * * **Note:** This method is loosely based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); * // => true * * _.isLength(Number.MIN_VALUE); * // => false * * _.isLength(Infinity); * // => false * * _.isLength('3'); * // => false */ function isLength(value) { return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function isObject(value) { var type = typeof value; return value != null && (type == 'object' || type == 'function'); } /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return value != null && typeof value == 'object'; } /** * Checks if `value` is classified as a `Map` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a map, else `false`. * @example * * _.isMap(new Map); * // => true * * _.isMap(new WeakMap); * // => false */ var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; /** * Performs a partial deep comparison between `object` and `source` to * determine if `object` contains equivalent property values. * * **Note:** This method is equivalent to `_.matches` when `source` is * partially applied. * * Partial comparisons will match empty array and empty object `source` * values against any array or object value, respectively. See `_.isEqual` * for a list of supported value comparisons. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {Object} object The object to inspect. * @param {Object} source The object of property values to match. * @returns {boolean} Returns `true` if `object` is a match, else `false`. * @example * * var object = { 'a': 1, 'b': 2 }; * * _.isMatch(object, { 'b': 2 }); * // => true * * _.isMatch(object, { 'b': 1 }); * // => false */ function isMatch(object, source) { return object === source || baseIsMatch(object, source, getMatchData(source)); } /** * This method is like `_.isMatch` except that it accepts `customizer` which * is invoked to compare values. If `customizer` returns `undefined`, comparisons * are handled by the method instead. The `customizer` is invoked with five * arguments: (objValue, srcValue, index|key, object, source). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {Object} object The object to inspect. * @param {Object} source The object of property values to match. * @param {Function} [customizer] The function to customize comparisons. * @returns {boolean} Returns `true` if `object` is a match, else `false`. * @example * * function isGreeting(value) { * return /^h(?:i|ello)$/.test(value); * } * * function customizer(objValue, srcValue) { * if (isGreeting(objValue) && isGreeting(srcValue)) { * return true; * } * } * * var object = { 'greeting': 'hello' }; * var source = { 'greeting': 'hi' }; * * _.isMatchWith(object, source, customizer); * // => true */ function isMatchWith(object, source, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return baseIsMatch(object, source, getMatchData(source), customizer); } /** * Checks if `value` is `NaN`. * * **Note:** This method is based on * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for * `undefined` and other non-number values. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. * @example * * _.isNaN(NaN); * // => true * * _.isNaN(new Number(NaN)); * // => true * * isNaN(undefined); * // => true * * _.isNaN(undefined); * // => false */ function isNaN(value) { // An `NaN` primitive is the only value that is not equal to itself. // Perform the `toStringTag` check first to avoid errors with some // ActiveX objects in IE. return isNumber(value) && value != +value; } /** * Checks if `value` is a pristine native function. * * **Note:** This method can't reliably detect native functions in the presence * of the core-js package because core-js circumvents this kind of detection. * Despite multiple requests, the core-js maintainer has made it clear: any * attempt to fix the detection will be obstructed. As a result, we're left * with little choice but to throw an error. Unfortunately, this also affects * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), * which rely on core-js. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, * else `false`. * @example * * _.isNative(Array.prototype.push); * // => true * * _.isNative(_); * // => false */ function isNative(value) { if (isMaskable(value)) { throw new Error(CORE_ERROR_TEXT); } return baseIsNative(value); } /** * Checks if `value` is `null`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `null`, else `false`. * @example * * _.isNull(null); * // => true * * _.isNull(void 0); * // => false */ function isNull(value) { return value === null; } /** * Checks if `value` is `null` or `undefined`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is nullish, else `false`. * @example * * _.isNil(null); * // => true * * _.isNil(void 0); * // => true * * _.isNil(NaN); * // => false */ function isNil(value) { return value == null; } /** * Checks if `value` is classified as a `Number` primitive or object. * * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are * classified as numbers, use the `_.isFinite` method. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a number, else `false`. * @example * * _.isNumber(3); * // => true * * _.isNumber(Number.MIN_VALUE); * // => true * * _.isNumber(Infinity); * // => true * * _.isNumber('3'); * // => false */ function isNumber(value) { return typeof value == 'number' || (isObjectLike(value) && baseGetTag(value) == numberTag); } /** * Checks if `value` is a plain object, that is, an object created by the * `Object` constructor or one with a `[[Prototype]]` of `null`. * * @static * @memberOf _ * @since 0.8.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. * @example * * function Foo() { * this.a = 1; * } * * _.isPlainObject(new Foo); * // => false * * _.isPlainObject([1, 2, 3]); * // => false * * _.isPlainObject({ 'x': 0, 'y': 0 }); * // => true * * _.isPlainObject(Object.create(null)); * // => true */ function isPlainObject(value) { if (!isObjectLike(value) || baseGetTag(value) != objectTag) { return false; } var proto = getPrototype(value); if (proto === null) { return true; } var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; } /** * Checks if `value` is classified as a `RegExp` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. * @example * * _.isRegExp(/abc/); * // => true * * _.isRegExp('/abc/'); * // => false */ var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; /** * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 * double precision number which isn't the result of a rounded unsafe integer. * * **Note:** This method is based on * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. * @example * * _.isSafeInteger(3); * // => true * * _.isSafeInteger(Number.MIN_VALUE); * // => false * * _.isSafeInteger(Infinity); * // => false * * _.isSafeInteger('3'); * // => false */ function isSafeInteger(value) { return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; } /** * Checks if `value` is classified as a `Set` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a set, else `false`. * @example * * _.isSet(new Set); * // => true * * _.isSet(new WeakSet); * // => false */ var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; /** * Checks if `value` is classified as a `String` primitive or object. * * @static * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a string, else `false`. * @example * * _.isString('abc'); * // => true * * _.isString(1); * // => false */ function isString(value) { return typeof value == 'string' || (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); } /** * Checks if `value` is classified as a `Symbol` primitive or object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * _.isSymbol(Symbol.iterator); * // => true * * _.isSymbol('abc'); * // => false */ function isSymbol(value) { return typeof value == 'symbol' || (isObjectLike(value) && baseGetTag(value) == symbolTag); } /** * Checks if `value` is classified as a typed array. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. * @example * * _.isTypedArray(new Uint8Array); * // => true * * _.isTypedArray([]); * // => false */ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; /** * Checks if `value` is `undefined`. * * @static * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. * @example * * _.isUndefined(void 0); * // => true * * _.isUndefined(null); * // => false */ function isUndefined(value) { return value === undefined; } /** * Checks if `value` is classified as a `WeakMap` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. * @example * * _.isWeakMap(new WeakMap); * // => true * * _.isWeakMap(new Map); * // => false */ function isWeakMap(value) { return isObjectLike(value) && getTag(value) == weakMapTag; } /** * Checks if `value` is classified as a `WeakSet` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. * @example * * _.isWeakSet(new WeakSet); * // => true * * _.isWeakSet(new Set); * // => false */ function isWeakSet(value) { return isObjectLike(value) && baseGetTag(value) == weakSetTag; } /** * Checks if `value` is less than `other`. * * @static * @memberOf _ * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is less than `other`, * else `false`. * @see _.gt * @example * * _.lt(1, 3); * // => true * * _.lt(3, 3); * // => false * * _.lt(3, 1); * // => false */ var lt = createRelationalOperation(baseLt); /** * Checks if `value` is less than or equal to `other`. * * @static * @memberOf _ * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is less than or equal to * `other`, else `false`. * @see _.gte * @example * * _.lte(1, 3); * // => true * * _.lte(3, 3); * // => true * * _.lte(3, 1); * // => false */ var lte = createRelationalOperation(function(value, other) { return value <= other; }); /** * Converts `value` to an array. * * @static * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to convert. * @returns {Array} Returns the converted array. * @example * * _.toArray({ 'a': 1, 'b': 2 }); * // => [1, 2] * * _.toArray('abc'); * // => ['a', 'b', 'c'] * * _.toArray(1); * // => [] * * _.toArray(null); * // => [] */ function toArray(value) { if (!value) { return []; } if (isArrayLike(value)) { return isString(value) ? stringToArray(value) : copyArray(value); } if (symIterator && value[symIterator]) { return iteratorToArray(value[symIterator]()); } var tag = getTag(value), func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); return func(value); } /** * Converts `value` to a finite number. * * @static * @memberOf _ * @since 4.12.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted number. * @example * * _.toFinite(3.2); * // => 3.2 * * _.toFinite(Number.MIN_VALUE); * // => 5e-324 * * _.toFinite(Infinity); * // => 1.7976931348623157e+308 * * _.toFinite('3.2'); * // => 3.2 */ function toFinite(value) { if (!value) { return value === 0 ? value : 0; } value = toNumber(value); if (value === INFINITY || value === -INFINITY) { var sign = (value < 0 ? -1 : 1); return sign * MAX_INTEGER; } return value === value ? value : 0; } /** * Converts `value` to an integer. * * **Note:** This method is loosely based on * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. * @example * * _.toInteger(3.2); * // => 3 * * _.toInteger(Number.MIN_VALUE); * // => 0 * * _.toInteger(Infinity); * // => 1.7976931348623157e+308 * * _.toInteger('3.2'); * // => 3 */ function toInteger(value) { var result = toFinite(value), remainder = result % 1; return result === result ? (remainder ? result - remainder : result) : 0; } /** * Converts `value` to an integer suitable for use as the length of an * array-like object. * * **Note:** This method is based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. * @example * * _.toLength(3.2); * // => 3 * * _.toLength(Number.MIN_VALUE); * // => 0 * * _.toLength(Infinity); * // => 4294967295 * * _.toLength('3.2'); * // => 3 */ function toLength(value) { return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; } /** * Converts `value` to a number. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to process. * @returns {number} Returns the number. * @example * * _.toNumber(3.2); * // => 3.2 * * _.toNumber(Number.MIN_VALUE); * // => 5e-324 * * _.toNumber(Infinity); * // => Infinity * * _.toNumber('3.2'); * // => 3.2 */ function toNumber(value) { if (typeof value == 'number') { return value; } if (isSymbol(value)) { return NAN; } if (isObject(value)) { var other = typeof value.valueOf == 'function' ? value.valueOf() : value; value = isObject(other) ? (other + '') : other; } if (typeof value != 'string') { return value === 0 ? value : +value; } value = value.replace(reTrim, ''); var isBinary = reIsBinary.test(value); return (isBinary || reIsOctal.test(value)) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : (reIsBadHex.test(value) ? NAN : +value); } /** * Converts `value` to a plain object flattening inherited enumerable string * keyed properties of `value` to own properties of the plain object. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to convert. * @returns {Object} Returns the converted plain object. * @example * * function Foo() { * this.b = 2; * } * * Foo.prototype.c = 3; * * _.assign({ 'a': 1 }, new Foo); * // => { 'a': 1, 'b': 2 } * * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); * // => { 'a': 1, 'b': 2, 'c': 3 } */ function toPlainObject(value) { return copyObject(value, keysIn(value)); } /** * Converts `value` to a safe integer. A safe integer can be compared and * represented correctly. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. * @example * * _.toSafeInteger(3.2); * // => 3 * * _.toSafeInteger(Number.MIN_VALUE); * // => 0 * * _.toSafeInteger(Infinity); * // => 9007199254740991 * * _.toSafeInteger('3.2'); * // => 3 */ function toSafeInteger(value) { return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : (value === 0 ? value : 0); } /** * Converts `value` to a string. An empty string is returned for `null` * and `undefined` values. The sign of `-0` is preserved. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {string} Returns the converted string. * @example * * _.toString(null); * // => '' * * _.toString(-0); * // => '-0' * * _.toString([1, 2, 3]); * // => '1,2,3' */ function toString(value) { return value == null ? '' : baseToString(value); } /*------------------------------------------------------------------------*/ /** * Assigns own enumerable string keyed properties of source objects to the * destination object. Source objects are applied from left to right. * Subsequent sources overwrite property assignments of previous sources. * * **Note:** This method mutates `object` and is loosely based on * [`Object.assign`](https://mdn.io/Object/assign). * * @static * @memberOf _ * @since 0.10.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.assignIn * @example * * function Foo() { * this.a = 1; * } * * function Bar() { * this.c = 3; * } * * Foo.prototype.b = 2; * Bar.prototype.d = 4; * * _.assign({ 'a': 0 }, new Foo, new Bar); * // => { 'a': 1, 'c': 3 } */ var assign = createAssigner(function(object, source) { if (isPrototype(source) || isArrayLike(source)) { copyObject(source, keys(source), object); return; } for (var key in source) { if (hasOwnProperty.call(source, key)) { assignValue(object, key, source[key]); } } }); /** * This method is like `_.assign` except that it iterates over own and * inherited source properties. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @alias extend * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.assign * @example * * function Foo() { * this.a = 1; * } * * function Bar() { * this.c = 3; * } * * Foo.prototype.b = 2; * Bar.prototype.d = 4; * * _.assignIn({ 'a': 0 }, new Foo, new Bar); * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } */ var assignIn = createAssigner(function(object, source) { copyObject(source, keysIn(source), object); }); /** * This method is like `_.assignIn` except that it accepts `customizer` * which is invoked to produce the assigned values. If `customizer` returns * `undefined`, assignment is handled by the method instead. The `customizer` * is invoked with five arguments: (objValue, srcValue, key, object, source). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @alias extendWith * @category Object * @param {Object} object The destination object. * @param {...Object} sources The source objects. * @param {Function} [customizer] The function to customize assigned values. * @returns {Object} Returns `object`. * @see _.assignWith * @example * * function customizer(objValue, srcValue) { * return _.isUndefined(objValue) ? srcValue : objValue; * } * * var defaults = _.partialRight(_.assignInWith, customizer); * * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { copyObject(source, keysIn(source), object, customizer); }); /** * This method is like `_.assign` except that it accepts `customizer` * which is invoked to produce the assigned values. If `customizer` returns * `undefined`, assignment is handled by the method instead. The `customizer` * is invoked with five arguments: (objValue, srcValue, key, object, source). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The destination object. * @param {...Object} sources The source objects. * @param {Function} [customizer] The function to customize assigned values. * @returns {Object} Returns `object`. * @see _.assignInWith * @example * * function customizer(objValue, srcValue) { * return _.isUndefined(objValue) ? srcValue : objValue; * } * * var defaults = _.partialRight(_.assignWith, customizer); * * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ var assignWith = createAssigner(function(object, source, srcIndex, customizer) { copyObject(source, keys(source), object, customizer); }); /** * Creates an array of values corresponding to `paths` of `object`. * * @static * @memberOf _ * @since 1.0.0 * @category Object * @param {Object} object The object to iterate over. * @param {...(string|string[])} [paths] The property paths to pick. * @returns {Array} Returns the picked values. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; * * _.at(object, ['a[0].b.c', 'a[1]']); * // => [3, 4] */ var at = flatRest(baseAt); /** * Creates an object that inherits from the `prototype` object. If a * `properties` object is given, its own enumerable string keyed properties * are assigned to the created object. * * @static * @memberOf _ * @since 2.3.0 * @category Object * @param {Object} prototype The object to inherit from. * @param {Object} [properties] The properties to assign to the object. * @returns {Object} Returns the new object. * @example * * function Shape() { * this.x = 0; * this.y = 0; * } * * function Circle() { * Shape.call(this); * } * * Circle.prototype = _.create(Shape.prototype, { * 'constructor': Circle * }); * * var circle = new Circle; * circle instanceof Circle; * // => true * * circle instanceof Shape; * // => true */ function create(prototype, properties) { var result = baseCreate(prototype); return properties == null ? result : baseAssign(result, properties); } /** * Assigns own and inherited enumerable string keyed properties of source * objects to the destination object for all destination properties that * resolve to `undefined`. Source objects are applied from left to right. * Once a property is set, additional values of the same property are ignored. * * **Note:** This method mutates `object`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.defaultsDeep * @example * * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ var defaults = baseRest(function(object, sources) { object = Object(object); var index = -1; var length = sources.length; var guard = length > 2 ? sources[2] : undefined; if (guard && isIterateeCall(sources[0], sources[1], guard)) { length = 1; } while (++index < length) { var source = sources[index]; var props = keysIn(source); var propsIndex = -1; var propsLength = props.length; while (++propsIndex < propsLength) { var key = props[propsIndex]; var value = object[key]; if (value === undefined || (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { object[key] = source[key]; } } } return object; }); /** * This method is like `_.defaults` except that it recursively assigns * default properties. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 3.10.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.defaults * @example * * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); * // => { 'a': { 'b': 2, 'c': 3 } } */ var defaultsDeep = baseRest(function(args) { args.push(undefined, customDefaultsMerge); return apply(mergeWith, undefined, args); }); /** * This method is like `_.find` except that it returns the key of the first * element `predicate` returns truthy for instead of the element itself. * * @static * @memberOf _ * @since 1.1.0 * @category Object * @param {Object} object The object to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {string|undefined} Returns the key of the matched element, * else `undefined`. * @example * * var users = { * 'barney': { 'age': 36, 'active': true }, * 'fred': { 'age': 40, 'active': false }, * 'pebbles': { 'age': 1, 'active': true } * }; * * _.findKey(users, function(o) { return o.age < 40; }); * // => 'barney' (iteration order is not guaranteed) * * // The `_.matches` iteratee shorthand. * _.findKey(users, { 'age': 1, 'active': true }); * // => 'pebbles' * * // The `_.matchesProperty` iteratee shorthand. * _.findKey(users, ['active', false]); * // => 'fred' * * // The `_.property` iteratee shorthand. * _.findKey(users, 'active'); * // => 'barney' */ function findKey(object, predicate) { return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); } /** * This method is like `_.findKey` except that it iterates over elements of * a collection in the opposite order. * * @static * @memberOf _ * @since 2.0.0 * @category Object * @param {Object} object The object to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {string|undefined} Returns the key of the matched element, * else `undefined`. * @example * * var users = { * 'barney': { 'age': 36, 'active': true }, * 'fred': { 'age': 40, 'active': false }, * 'pebbles': { 'age': 1, 'active': true } * }; * * _.findLastKey(users, function(o) { return o.age < 40; }); * // => returns 'pebbles' assuming `_.findKey` returns 'barney' * * // The `_.matches` iteratee shorthand. * _.findLastKey(users, { 'age': 36, 'active': true }); * // => 'barney' * * // The `_.matchesProperty` iteratee shorthand. * _.findLastKey(users, ['active', false]); * // => 'fred' * * // The `_.property` iteratee shorthand. * _.findLastKey(users, 'active'); * // => 'pebbles' */ function findLastKey(object, predicate) { return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); } /** * Iterates over own and inherited enumerable string keyed properties of an * object and invokes `iteratee` for each property. The iteratee is invoked * with three arguments: (value, key, object). Iteratee functions may exit * iteration early by explicitly returning `false`. * * @static * @memberOf _ * @since 0.3.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. * @see _.forInRight * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.forIn(new Foo, function(value, key) { * console.log(key); * }); * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). */ function forIn(object, iteratee) { return object == null ? object : baseFor(object, getIteratee(iteratee, 3), keysIn); } /** * This method is like `_.forIn` except that it iterates over properties of * `object` in the opposite order. * * @static * @memberOf _ * @since 2.0.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. * @see _.forIn * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.forInRight(new Foo, function(value, key) { * console.log(key); * }); * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. */ function forInRight(object, iteratee) { return object == null ? object : baseForRight(object, getIteratee(iteratee, 3), keysIn); } /** * Iterates over own enumerable string keyed properties of an object and * invokes `iteratee` for each property. The iteratee is invoked with three * arguments: (value, key, object). Iteratee functions may exit iteration * early by explicitly returning `false`. * * @static * @memberOf _ * @since 0.3.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. * @see _.forOwnRight * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.forOwn(new Foo, function(value, key) { * console.log(key); * }); * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ function forOwn(object, iteratee) { return object && baseForOwn(object, getIteratee(iteratee, 3)); } /** * This method is like `_.forOwn` except that it iterates over properties of * `object` in the opposite order. * * @static * @memberOf _ * @since 2.0.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. * @see _.forOwn * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.forOwnRight(new Foo, function(value, key) { * console.log(key); * }); * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. */ function forOwnRight(object, iteratee) { return object && baseForOwnRight(object, getIteratee(iteratee, 3)); } /** * Creates an array of function property names from own enumerable properties * of `object`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to inspect. * @returns {Array} Returns the function names. * @see _.functionsIn * @example * * function Foo() { * this.a = _.constant('a'); * this.b = _.constant('b'); * } * * Foo.prototype.c = _.constant('c'); * * _.functions(new Foo); * // => ['a', 'b'] */ function functions(object) { return object == null ? [] : baseFunctions(object, keys(object)); } /** * Creates an array of function property names from own and inherited * enumerable properties of `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to inspect. * @returns {Array} Returns the function names. * @see _.functions * @example * * function Foo() { * this.a = _.constant('a'); * this.b = _.constant('b'); * } * * Foo.prototype.c = _.constant('c'); * * _.functionsIn(new Foo); * // => ['a', 'b', 'c'] */ function functionsIn(object) { return object == null ? [] : baseFunctions(object, keysIn(object)); } /** * Gets the value at `path` of `object`. If the resolved value is * `undefined`, the `defaultValue` is returned in its place. * * @static * @memberOf _ * @since 3.7.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @param {*} [defaultValue] The value returned for `undefined` resolved values. * @returns {*} Returns the resolved value. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.get(object, 'a[0].b.c'); * // => 3 * * _.get(object, ['a', '0', 'b', 'c']); * // => 3 * * _.get(object, 'a.b.c', 'default'); * // => 'default' */ function get(object, path, defaultValue) { var result = object == null ? undefined : baseGet(object, path); return result === undefined ? defaultValue : result; } /** * Checks if `path` is a direct property of `object`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * * var object = { 'a': { 'b': 2 } }; * var other = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.has(object, 'a'); * // => true * * _.has(object, 'a.b'); * // => true * * _.has(object, ['a', 'b']); * // => true * * _.has(other, 'a'); * // => false */ function has(object, path) { return object != null && hasPath(object, path, baseHas); } /** * Checks if `path` is a direct or inherited property of `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * * var object = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.hasIn(object, 'a'); * // => true * * _.hasIn(object, 'a.b'); * // => true * * _.hasIn(object, ['a', 'b']); * // => true * * _.hasIn(object, 'b'); * // => false */ function hasIn(object, path) { return object != null && hasPath(object, path, baseHasIn); } /** * Creates an object composed of the inverted keys and values of `object`. * If `object` contains duplicate values, subsequent values overwrite * property assignments of previous values. * * @static * @memberOf _ * @since 0.7.0 * @category Object * @param {Object} object The object to invert. * @returns {Object} Returns the new inverted object. * @example * * var object = { 'a': 1, 'b': 2, 'c': 1 }; * * _.invert(object); * // => { '1': 'c', '2': 'b' } */ var invert = createInverter(function(result, value, key) { if (value != null && typeof value.toString != 'function') { value = nativeObjectToString.call(value); } result[value] = key; }, constant(identity)); /** * This method is like `_.invert` except that the inverted object is generated * from the results of running each element of `object` thru `iteratee`. The * corresponding inverted value of each inverted key is an array of keys * responsible for generating the inverted value. The iteratee is invoked * with one argument: (value). * * @static * @memberOf _ * @since 4.1.0 * @category Object * @param {Object} object The object to invert. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Object} Returns the new inverted object. * @example * * var object = { 'a': 1, 'b': 2, 'c': 1 }; * * _.invertBy(object); * // => { '1': ['a', 'c'], '2': ['b'] } * * _.invertBy(object, function(value) { * return 'group' + value; * }); * // => { 'group1': ['a', 'c'], 'group2': ['b'] } */ var invertBy = createInverter(function(result, value, key) { if (value != null && typeof value.toString != 'function') { value = nativeObjectToString.call(value); } if (hasOwnProperty.call(result, value)) { result[value].push(key); } else { result[value] = [key]; } }, getIteratee); /** * Invokes the method at `path` of `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the method to invoke. * @param {...*} [args] The arguments to invoke the method with. * @returns {*} Returns the result of the invoked method. * @example * * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; * * _.invoke(object, 'a[0].b.c.slice', 1, 3); * // => [2, 3] */ var invoke = baseRest(baseInvoke); /** * Creates an array of the own enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. See the * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * for more details. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keys(new Foo); * // => ['a', 'b'] (iteration order is not guaranteed) * * _.keys('hi'); * // => ['0', '1'] */ function keys(object) { return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); } /** * Creates an array of the own and inherited enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @memberOf _ * @since 3.0.0 * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keysIn(new Foo); * // => ['a', 'b', 'c'] (iteration order is not guaranteed) */ function keysIn(object) { return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); } /** * The opposite of `_.mapValues`; this method creates an object with the * same values as `object` and keys generated by running each own enumerable * string keyed property of `object` thru `iteratee`. The iteratee is invoked * with three arguments: (value, key, object). * * @static * @memberOf _ * @since 3.8.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns the new mapped object. * @see _.mapValues * @example * * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { * return key + value; * }); * // => { 'a1': 1, 'b2': 2 } */ function mapKeys(object, iteratee) { var result = {}; iteratee = getIteratee(iteratee, 3); baseForOwn(object, function(value, key, object) { baseAssignValue(result, iteratee(value, key, object), value); }); return result; } /** * Creates an object with the same keys as `object` and values generated * by running each own enumerable string keyed property of `object` thru * `iteratee`. The iteratee is invoked with three arguments: * (value, key, object). * * @static * @memberOf _ * @since 2.4.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns the new mapped object. * @see _.mapKeys * @example * * var users = { * 'fred': { 'user': 'fred', 'age': 40 }, * 'pebbles': { 'user': 'pebbles', 'age': 1 } * }; * * _.mapValues(users, function(o) { return o.age; }); * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) * * // The `_.property` iteratee shorthand. * _.mapValues(users, 'age'); * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) */ function mapValues(object, iteratee) { var result = {}; iteratee = getIteratee(iteratee, 3); baseForOwn(object, function(value, key, object) { baseAssignValue(result, key, iteratee(value, key, object)); }); return result; } /** * This method is like `_.assign` except that it recursively merges own and * inherited enumerable string keyed properties of source objects into the * destination object. Source properties that resolve to `undefined` are * skipped if a destination value exists. Array and plain object properties * are merged recursively. Other objects and value types are overridden by * assignment. Source objects are applied from left to right. Subsequent * sources overwrite property assignments of previous sources. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 0.5.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @example * * var object = { * 'a': [{ 'b': 2 }, { 'd': 4 }] * }; * * var other = { * 'a': [{ 'c': 3 }, { 'e': 5 }] * }; * * _.merge(object, other); * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } */ var merge = createAssigner(function(object, source, srcIndex) { baseMerge(object, source, srcIndex); }); /** * This method is like `_.merge` except that it accepts `customizer` which * is invoked to produce the merged values of the destination and source * properties. If `customizer` returns `undefined`, merging is handled by the * method instead. The `customizer` is invoked with six arguments: * (objValue, srcValue, key, object, source, stack). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The destination object. * @param {...Object} sources The source objects. * @param {Function} customizer The function to customize assigned values. * @returns {Object} Returns `object`. * @example * * function customizer(objValue, srcValue) { * if (_.isArray(objValue)) { * return objValue.concat(srcValue); * } * } * * var object = { 'a': [1], 'b': [2] }; * var other = { 'a': [3], 'b': [4] }; * * _.mergeWith(object, other, customizer); * // => { 'a': [1, 3], 'b': [2, 4] } */ var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { baseMerge(object, source, srcIndex, customizer); }); /** * The opposite of `_.pick`; this method creates an object composed of the * own and inherited enumerable property paths of `object` that are not omitted. * * **Note:** This method is considerably slower than `_.pick`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The source object. * @param {...(string|string[])} [paths] The property paths to omit. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.omit(object, ['a', 'c']); * // => { 'b': '2' } */ var omit = flatRest(function(object, paths) { var result = {}; if (object == null) { return result; } var isDeep = false; paths = arrayMap(paths, function(path) { path = castPath(path, object); isDeep || (isDeep = path.length > 1); return path; }); copyObject(object, getAllKeysIn(object), result); if (isDeep) { result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); } var length = paths.length; while (length--) { baseUnset(result, paths[length]); } return result; }); /** * The opposite of `_.pickBy`; this method creates an object composed of * the own and inherited enumerable string keyed properties of `object` that * `predicate` doesn't return truthy for. The predicate is invoked with two * arguments: (value, key). * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The source object. * @param {Function} [predicate=_.identity] The function invoked per property. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.omitBy(object, _.isNumber); * // => { 'b': '2' } */ function omitBy(object, predicate) { return pickBy(object, negate(getIteratee(predicate))); } /** * Creates an object composed of the picked `object` properties. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The source object. * @param {...(string|string[])} [paths] The property paths to pick. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.pick(object, ['a', 'c']); * // => { 'a': 1, 'c': 3 } */ var pick = flatRest(function(object, paths) { return object == null ? {} : basePick(object, paths); }); /** * Creates an object composed of the `object` properties `predicate` returns * truthy for. The predicate is invoked with two arguments: (value, key). * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The source object. * @param {Function} [predicate=_.identity] The function invoked per property. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.pickBy(object, _.isNumber); * // => { 'a': 1, 'c': 3 } */ function pickBy(object, predicate) { if (object == null) { return {}; } var props = arrayMap(getAllKeysIn(object), function(prop) { return [prop]; }); predicate = getIteratee(predicate); return basePickBy(object, props, function(value, path) { return predicate(value, path[0]); }); } /** * This method is like `_.get` except that if the resolved value is a * function it's invoked with the `this` binding of its parent object and * its result is returned. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to resolve. * @param {*} [defaultValue] The value returned for `undefined` resolved values. * @returns {*} Returns the resolved value. * @example * * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; * * _.result(object, 'a[0].b.c1'); * // => 3 * * _.result(object, 'a[0].b.c2'); * // => 4 * * _.result(object, 'a[0].b.c3', 'default'); * // => 'default' * * _.result(object, 'a[0].b.c3', _.constant('default')); * // => 'default' */ function result(object, path, defaultValue) { path = castPath(path, object); var index = -1, length = path.length; // Ensure the loop is entered when path is empty. if (!length) { length = 1; object = undefined; } while (++index < length) { var value = object == null ? undefined : object[toKey(path[index])]; if (value === undefined) { index = length; value = defaultValue; } object = isFunction(value) ? value.call(object) : value; } return object; } /** * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, * it's created. Arrays are created for missing index properties while objects * are created for all other missing properties. Use `_.setWith` to customize * `path` creation. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 3.7.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {*} value The value to set. * @returns {Object} Returns `object`. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.set(object, 'a[0].b.c', 4); * console.log(object.a[0].b.c); * // => 4 * * _.set(object, ['x', '0', 'y', 'z'], 5); * console.log(object.x[0].y.z); * // => 5 */ function set(object, path, value) { return object == null ? object : baseSet(object, path, value); } /** * This method is like `_.set` except that it accepts `customizer` which is * invoked to produce the objects of `path`. If `customizer` returns `undefined` * path creation is handled by the method instead. The `customizer` is invoked * with three arguments: (nsValue, key, nsObject). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {*} value The value to set. * @param {Function} [customizer] The function to customize assigned values. * @returns {Object} Returns `object`. * @example * * var object = {}; * * _.setWith(object, '[0][1]', 'a', Object); * // => { '0': { '1': 'a' } } */ function setWith(object, path, value, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return object == null ? object : baseSet(object, path, value, customizer); } /** * Creates an array of own enumerable string keyed-value pairs for `object` * which can be consumed by `_.fromPairs`. If `object` is a map or set, its * entries are returned. * * @static * @memberOf _ * @since 4.0.0 * @alias entries * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the key-value pairs. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.toPairs(new Foo); * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) */ var toPairs = createToPairs(keys); /** * Creates an array of own and inherited enumerable string keyed-value pairs * for `object` which can be consumed by `_.fromPairs`. If `object` is a map * or set, its entries are returned. * * @static * @memberOf _ * @since 4.0.0 * @alias entriesIn * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the key-value pairs. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.toPairsIn(new Foo); * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) */ var toPairsIn = createToPairs(keysIn); /** * An alternative to `_.reduce`; this method transforms `object` to a new * `accumulator` object which is the result of running each of its own * enumerable string keyed properties thru `iteratee`, with each invocation * potentially mutating the `accumulator` object. If `accumulator` is not * provided, a new object with the same `[[Prototype]]` will be used. The * iteratee is invoked with four arguments: (accumulator, value, key, object). * Iteratee functions may exit iteration early by explicitly returning `false`. * * @static * @memberOf _ * @since 1.3.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {*} [accumulator] The custom accumulator value. * @returns {*} Returns the accumulated value. * @example * * _.transform([2, 3, 4], function(result, n) { * result.push(n *= n); * return n % 2 == 0; * }, []); * // => [4, 9] * * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { * (result[value] || (result[value] = [])).push(key); * }, {}); * // => { '1': ['a', 'c'], '2': ['b'] } */ function transform(object, iteratee, accumulator) { var isArr = isArray(object), isArrLike = isArr || isBuffer(object) || isTypedArray(object); iteratee = getIteratee(iteratee, 4); if (accumulator == null) { var Ctor = object && object.constructor; if (isArrLike) { accumulator = isArr ? new Ctor : []; } else if (isObject(object)) { accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; } else { accumulator = {}; } } (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { return iteratee(accumulator, value, index, object); }); return accumulator; } /** * Removes the property at `path` of `object`. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to unset. * @returns {boolean} Returns `true` if the property is deleted, else `false`. * @example * * var object = { 'a': [{ 'b': { 'c': 7 } }] }; * _.unset(object, 'a[0].b.c'); * // => true * * console.log(object); * // => { 'a': [{ 'b': {} }] }; * * _.unset(object, ['a', '0', 'b', 'c']); * // => true * * console.log(object); * // => { 'a': [{ 'b': {} }] }; */ function unset(object, path) { return object == null ? true : baseUnset(object, path); } /** * This method is like `_.set` except that accepts `updater` to produce the * value to set. Use `_.updateWith` to customize `path` creation. The `updater` * is invoked with one argument: (value). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.6.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {Function} updater The function to produce the updated value. * @returns {Object} Returns `object`. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.update(object, 'a[0].b.c', function(n) { return n * n; }); * console.log(object.a[0].b.c); * // => 9 * * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); * console.log(object.x[0].y.z); * // => 0 */ function update(object, path, updater) { return object == null ? object : baseUpdate(object, path, castFunction(updater)); } /** * This method is like `_.update` except that it accepts `customizer` which is * invoked to produce the objects of `path`. If `customizer` returns `undefined` * path creation is handled by the method instead. The `customizer` is invoked * with three arguments: (nsValue, key, nsObject). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.6.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {Function} updater The function to produce the updated value. * @param {Function} [customizer] The function to customize assigned values. * @returns {Object} Returns `object`. * @example * * var object = {}; * * _.updateWith(object, '[0][1]', _.constant('a'), Object); * // => { '0': { '1': 'a' } } */ function updateWith(object, path, updater, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); } /** * Creates an array of the own enumerable string keyed property values of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property values. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.values(new Foo); * // => [1, 2] (iteration order is not guaranteed) * * _.values('hi'); * // => ['h', 'i'] */ function values(object) { return object == null ? [] : baseValues(object, keys(object)); } /** * Creates an array of the own and inherited enumerable string keyed property * values of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @memberOf _ * @since 3.0.0 * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property values. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.valuesIn(new Foo); * // => [1, 2, 3] (iteration order is not guaranteed) */ function valuesIn(object) { return object == null ? [] : baseValues(object, keysIn(object)); } /*------------------------------------------------------------------------*/ /** * Clamps `number` within the inclusive `lower` and `upper` bounds. * * @static * @memberOf _ * @since 4.0.0 * @category Number * @param {number} number The number to clamp. * @param {number} [lower] The lower bound. * @param {number} upper The upper bound. * @returns {number} Returns the clamped number. * @example * * _.clamp(-10, -5, 5); * // => -5 * * _.clamp(10, -5, 5); * // => 5 */ function clamp(number, lower, upper) { if (upper === undefined) { upper = lower; lower = undefined; } if (upper !== undefined) { upper = toNumber(upper); upper = upper === upper ? upper : 0; } if (lower !== undefined) { lower = toNumber(lower); lower = lower === lower ? lower : 0; } return baseClamp(toNumber(number), lower, upper); } /** * Checks if `n` is between `start` and up to, but not including, `end`. If * `end` is not specified, it's set to `start` with `start` then set to `0`. * If `start` is greater than `end` the params are swapped to support * negative ranges. * * @static * @memberOf _ * @since 3.3.0 * @category Number * @param {number} number The number to check. * @param {number} [start=0] The start of the range. * @param {number} end The end of the range. * @returns {boolean} Returns `true` if `number` is in the range, else `false`. * @see _.range, _.rangeRight * @example * * _.inRange(3, 2, 4); * // => true * * _.inRange(4, 8); * // => true * * _.inRange(4, 2); * // => false * * _.inRange(2, 2); * // => false * * _.inRange(1.2, 2); * // => true * * _.inRange(5.2, 4); * // => false * * _.inRange(-3, -2, -6); * // => true */ function inRange(number, start, end) { start = toFinite(start); if (end === undefined) { end = start; start = 0; } else { end = toFinite(end); } number = toNumber(number); return baseInRange(number, start, end); } /** * Produces a random number between the inclusive `lower` and `upper` bounds. * If only one argument is provided a number between `0` and the given number * is returned. If `floating` is `true`, or either `lower` or `upper` are * floats, a floating-point number is returned instead of an integer. * * **Note:** JavaScript follows the IEEE-754 standard for resolving * floating-point values which can produce unexpected results. * * @static * @memberOf _ * @since 0.7.0 * @category Number * @param {number} [lower=0] The lower bound. * @param {number} [upper=1] The upper bound. * @param {boolean} [floating] Specify returning a floating-point number. * @returns {number} Returns the random number. * @example * * _.random(0, 5); * // => an integer between 0 and 5 * * _.random(5); * // => also an integer between 0 and 5 * * _.random(5, true); * // => a floating-point number between 0 and 5 * * _.random(1.2, 5.2); * // => a floating-point number between 1.2 and 5.2 */ function random(lower, upper, floating) { if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { upper = floating = undefined; } if (floating === undefined) { if (typeof upper == 'boolean') { floating = upper; upper = undefined; } else if (typeof lower == 'boolean') { floating = lower; lower = undefined; } } if (lower === undefined && upper === undefined) { lower = 0; upper = 1; } else { lower = toFinite(lower); if (upper === undefined) { upper = lower; lower = 0; } else { upper = toFinite(upper); } } if (lower > upper) { var temp = lower; lower = upper; upper = temp; } if (floating || lower % 1 || upper % 1) { var rand = nativeRandom(); return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); } return baseRandom(lower, upper); } /*------------------------------------------------------------------------*/ /** * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the camel cased string. * @example * * _.camelCase('Foo Bar'); * // => 'fooBar' * * _.camelCase('--foo-bar--'); * // => 'fooBar' * * _.camelCase('__FOO_BAR__'); * // => 'fooBar' */ var camelCase = createCompounder(function(result, word, index) { word = word.toLowerCase(); return result + (index ? capitalize(word) : word); }); /** * Converts the first character of `string` to upper case and the remaining * to lower case. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to capitalize. * @returns {string} Returns the capitalized string. * @example * * _.capitalize('FRED'); * // => 'Fred' */ function capitalize(string) { return upperFirst(toString(string).toLowerCase()); } /** * Deburrs `string` by converting * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) * letters to basic Latin letters and removing * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to deburr. * @returns {string} Returns the deburred string. * @example * * _.deburr('déjà vu'); * // => 'deja vu' */ function deburr(string) { string = toString(string); return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); } /** * Checks if `string` ends with the given target string. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to inspect. * @param {string} [target] The string to search for. * @param {number} [position=string.length] The position to search up to. * @returns {boolean} Returns `true` if `string` ends with `target`, * else `false`. * @example * * _.endsWith('abc', 'c'); * // => true * * _.endsWith('abc', 'b'); * // => false * * _.endsWith('abc', 'b', 2); * // => true */ function endsWith(string, target, position) { string = toString(string); target = baseToString(target); var length = string.length; position = position === undefined ? length : baseClamp(toInteger(position), 0, length); var end = position; position -= target.length; return position >= 0 && string.slice(position, end) == target; } /** * Converts the characters "&", "<", ">", '"', and "'" in `string` to their * corresponding HTML entities. * * **Note:** No other characters are escaped. To escape additional * characters use a third-party library like [_he_](https://mths.be/he). * * Though the ">" character is escaped for symmetry, characters like * ">" and "/" don't need escaping in HTML and have no special meaning * unless they're part of a tag or unquoted attribute value. See * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) * (under "semi-related fun fact") for more details. * * When working with HTML you should always * [quote attribute values](http://wonko.com/post/html-escaping) to reduce * XSS vectors. * * @static * @since 0.1.0 * @memberOf _ * @category String * @param {string} [string=''] The string to escape. * @returns {string} Returns the escaped string. * @example * * _.escape('fred, barney, & pebbles'); * // => 'fred, barney, & pebbles' */ function escape(string) { string = toString(string); return (string && reHasUnescapedHtml.test(string)) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string; } /** * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to escape. * @returns {string} Returns the escaped string. * @example * * _.escapeRegExp('[lodash](https://lodash.com/)'); * // => '\[lodash\]\(https://lodash\.com/\)' */ function escapeRegExp(string) { string = toString(string); return (string && reHasRegExpChar.test(string)) ? string.replace(reRegExpChar, '\\$&') : string; } /** * Converts `string` to * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the kebab cased string. * @example * * _.kebabCase('Foo Bar'); * // => 'foo-bar' * * _.kebabCase('fooBar'); * // => 'foo-bar' * * _.kebabCase('__FOO_BAR__'); * // => 'foo-bar' */ var kebabCase = createCompounder(function(result, word, index) { return result + (index ? '-' : '') + word.toLowerCase(); }); /** * Converts `string`, as space separated words, to lower case. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the lower cased string. * @example * * _.lowerCase('--Foo-Bar--'); * // => 'foo bar' * * _.lowerCase('fooBar'); * // => 'foo bar' * * _.lowerCase('__FOO_BAR__'); * // => 'foo bar' */ var lowerCase = createCompounder(function(result, word, index) { return result + (index ? ' ' : '') + word.toLowerCase(); }); /** * Converts the first character of `string` to lower case. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the converted string. * @example * * _.lowerFirst('Fred'); * // => 'fred' * * _.lowerFirst('FRED'); * // => 'fRED' */ var lowerFirst = createCaseFirst('toLowerCase'); /** * Pads `string` on the left and right sides if it's shorter than `length`. * Padding characters are truncated if they can't be evenly divided by `length`. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to pad. * @param {number} [length=0] The padding length. * @param {string} [chars=' '] The string used as padding. * @returns {string} Returns the padded string. * @example * * _.pad('abc', 8); * // => ' abc ' * * _.pad('abc', 8, '_-'); * // => '_-abc_-_' * * _.pad('abc', 3); * // => 'abc' */ function pad(string, length, chars) { string = toString(string); length = toInteger(length); var strLength = length ? stringSize(string) : 0; if (!length || strLength >= length) { return string; } var mid = (length - strLength) / 2; return ( createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars) ); } /** * Pads `string` on the right side if it's shorter than `length`. Padding * characters are truncated if they exceed `length`. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to pad. * @param {number} [length=0] The padding length. * @param {string} [chars=' '] The string used as padding. * @returns {string} Returns the padded string. * @example * * _.padEnd('abc', 6); * // => 'abc ' * * _.padEnd('abc', 6, '_-'); * // => 'abc_-_' * * _.padEnd('abc', 3); * // => 'abc' */ function padEnd(string, length, chars) { string = toString(string); length = toInteger(length); var strLength = length ? stringSize(string) : 0; return (length && strLength < length) ? (string + createPadding(length - strLength, chars)) : string; } /** * Pads `string` on the left side if it's shorter than `length`. Padding * characters are truncated if they exceed `length`. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to pad. * @param {number} [length=0] The padding length. * @param {string} [chars=' '] The string used as padding. * @returns {string} Returns the padded string. * @example * * _.padStart('abc', 6); * // => ' abc' * * _.padStart('abc', 6, '_-'); * // => '_-_abc' * * _.padStart('abc', 3); * // => 'abc' */ function padStart(string, length, chars) { string = toString(string); length = toInteger(length); var strLength = length ? stringSize(string) : 0; return (length && strLength < length) ? (createPadding(length - strLength, chars) + string) : string; } /** * Converts `string` to an integer of the specified radix. If `radix` is * `undefined` or `0`, a `radix` of `10` is used unless `value` is a * hexadecimal, in which case a `radix` of `16` is used. * * **Note:** This method aligns with the * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. * * @static * @memberOf _ * @since 1.1.0 * @category String * @param {string} string The string to convert. * @param {number} [radix=10] The radix to interpret `value` by. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {number} Returns the converted integer. * @example * * _.parseInt('08'); * // => 8 * * _.map(['6', '08', '10'], _.parseInt); * // => [6, 8, 10] */ function parseInt(string, radix, guard) { if (guard || radix == null) { radix = 0; } else if (radix) { radix = +radix; } return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); } /** * Repeats the given string `n` times. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to repeat. * @param {number} [n=1] The number of times to repeat the string. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {string} Returns the repeated string. * @example * * _.repeat('*', 3); * // => '***' * * _.repeat('abc', 2); * // => 'abcabc' * * _.repeat('abc', 0); * // => '' */ function repeat(string, n, guard) { if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { n = 1; } else { n = toInteger(n); } return baseRepeat(toString(string), n); } /** * Replaces matches for `pattern` in `string` with `replacement`. * * **Note:** This method is based on * [`String#replace`](https://mdn.io/String/replace). * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to modify. * @param {RegExp|string} pattern The pattern to replace. * @param {Function|string} replacement The match replacement. * @returns {string} Returns the modified string. * @example * * _.replace('Hi Fred', 'Fred', 'Barney'); * // => 'Hi Barney' */ function replace() { var args = arguments, string = toString(args[0]); return args.length < 3 ? string : string.replace(args[1], args[2]); } /** * Converts `string` to * [snake case](https://en.wikipedia.org/wiki/Snake_case). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the snake cased string. * @example * * _.snakeCase('Foo Bar'); * // => 'foo_bar' * * _.snakeCase('fooBar'); * // => 'foo_bar' * * _.snakeCase('--FOO-BAR--'); * // => 'foo_bar' */ var snakeCase = createCompounder(function(result, word, index) { return result + (index ? '_' : '') + word.toLowerCase(); }); /** * Splits `string` by `separator`. * * **Note:** This method is based on * [`String#split`](https://mdn.io/String/split). * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to split. * @param {RegExp|string} separator The separator pattern to split by. * @param {number} [limit] The length to truncate results to. * @returns {Array} Returns the string segments. * @example * * _.split('a-b-c', '-', 2); * // => ['a', 'b'] */ function split(string, separator, limit) { if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { separator = limit = undefined; } limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; if (!limit) { return []; } string = toString(string); if (string && ( typeof separator == 'string' || (separator != null && !isRegExp(separator)) )) { separator = baseToString(separator); if (!separator && hasUnicode(string)) { return castSlice(stringToArray(string), 0, limit); } } return string.split(separator, limit); } /** * Converts `string` to * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). * * @static * @memberOf _ * @since 3.1.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the start cased string. * @example * * _.startCase('--foo-bar--'); * // => 'Foo Bar' * * _.startCase('fooBar'); * // => 'Foo Bar' * * _.startCase('__FOO_BAR__'); * // => 'FOO BAR' */ var startCase = createCompounder(function(result, word, index) { return result + (index ? ' ' : '') + upperFirst(word); }); /** * Checks if `string` starts with the given target string. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to inspect. * @param {string} [target] The string to search for. * @param {number} [position=0] The position to search from. * @returns {boolean} Returns `true` if `string` starts with `target`, * else `false`. * @example * * _.startsWith('abc', 'a'); * // => true * * _.startsWith('abc', 'b'); * // => false * * _.startsWith('abc', 'b', 1); * // => true */ function startsWith(string, target, position) { string = toString(string); position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length); target = baseToString(target); return string.slice(position, position + target.length) == target; } /** * Creates a compiled template function that can interpolate data properties * in "interpolate" delimiters, HTML-escape interpolated data properties in * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data * properties may be accessed as free variables in the template. If a setting * object is given, it takes precedence over `_.templateSettings` values. * * **Note:** In the development build `_.template` utilizes * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) * for easier debugging. * * For more information on precompiling templates see * [lodash's custom builds documentation](https://lodash.com/custom-builds). * * For more information on Chrome extension sandboxes see * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). * * @static * @since 0.1.0 * @memberOf _ * @category String * @param {string} [string=''] The template string. * @param {Object} [options={}] The options object. * @param {RegExp} [options.escape=_.templateSettings.escape] * The HTML "escape" delimiter. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] * The "evaluate" delimiter. * @param {Object} [options.imports=_.templateSettings.imports] * An object to import into the template as free variables. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] * The "interpolate" delimiter. * @param {string} [options.sourceURL='lodash.templateSources[n]'] * The sourceURL of the compiled template. * @param {string} [options.variable='obj'] * The data object variable name. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the compiled template function. * @example * * // Use the "interpolate" delimiter to create a compiled template. * var compiled = _.template('hello <%= user %>!'); * compiled({ 'user': 'fred' }); * // => 'hello fred!' * * // Use the HTML "escape" delimiter to escape data property values. * var compiled = _.template('<b><%- value %></b>'); * compiled({ 'value': '<script>' }); * // => '<b><script></b>' * * // Use the "evaluate" delimiter to execute JavaScript and generate HTML. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>'); * compiled({ 'users': ['fred', 'barney'] }); * // => '<li>fred</li><li>barney</li>' * * // Use the internal `print` function in "evaluate" delimiters. * var compiled = _.template('<% print("hello " + user); %>!'); * compiled({ 'user': 'barney' }); * // => 'hello barney!' * * // Use the ES template literal delimiter as an "interpolate" delimiter. * // Disable support by replacing the "interpolate" delimiter. * var compiled = _.template('hello ${ user }!'); * compiled({ 'user': 'pebbles' }); * // => 'hello pebbles!' * * // Use backslashes to treat delimiters as plain text. * var compiled = _.template('<%= "\\<%- value %\\>" %>'); * compiled({ 'value': 'ignored' }); * // => '<%- value %>' * * // Use the `imports` option to import `jQuery` as `jq`. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>'; * var compiled = _.template(text, { 'imports': { 'jq': jQuery } }); * compiled({ 'users': ['fred', 'barney'] }); * // => '<li>fred</li><li>barney</li>' * * // Use the `sourceURL` option to specify a custom sourceURL for the template. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' }); * compiled(data); * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector. * * // Use the `variable` option to ensure a with-statement isn't used in the compiled template. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' }); * compiled.source; * // => function(data) { * // var __t, __p = ''; * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!'; * // return __p; * // } * * // Use custom template delimiters. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g; * var compiled = _.template('hello {{ user }}!'); * compiled({ 'user': 'mustache' }); * // => 'hello mustache!' * * // Use the `source` property to inline compiled templates for meaningful * // line numbers in error messages and stack traces. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\ * var JST = {\ * "main": ' + _.template(mainText).source + '\ * };\ * '); */ function template(string, options, guard) { // Based on John Resig's `tmpl` implementation // (http://ejohn.org/blog/javascript-micro-templating/) // and Laura Doktorova's doT.js (https://github.com/olado/doT). var settings = lodash.templateSettings; if (guard && isIterateeCall(string, options, guard)) { options = undefined; } string = toString(string); options = assignInWith({}, options, settings, customDefaultsAssignIn); var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn), importsKeys = keys(imports), importsValues = baseValues(imports, importsKeys); var isEscaping, isEvaluating, index = 0, interpolate = options.interpolate || reNoMatch, source = "__p += '"; // Compile the regexp to match each delimiter. var reDelimiters = RegExp( (options.escape || reNoMatch).source + '|' + interpolate.source + '|' + (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' + (options.evaluate || reNoMatch).source + '|$' , 'g'); // Use a sourceURL for easier debugging. // The sourceURL gets injected into the source that's eval-ed, so be careful // with lookup (in case of e.g. prototype pollution), and strip newlines if any. // A newline wouldn't be a valid sourceURL anyway, and it'd enable code injection. var sourceURL = '//# sourceURL=' + (hasOwnProperty.call(options, 'sourceURL') ? (options.sourceURL + '').replace(/[\r\n]/g, ' ') : ('lodash.templateSources[' + (++templateCounter) + ']') ) + '\n'; string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) { interpolateValue || (interpolateValue = esTemplateValue); // Escape characters that can't be included in string literals. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar); // Replace delimiters with snippets. if (escapeValue) { isEscaping = true; source += "' +\n__e(" + escapeValue + ") +\n'"; } if (evaluateValue) { isEvaluating = true; source += "';\n" + evaluateValue + ";\n__p += '"; } if (interpolateValue) { source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'"; } index = offset + match.length; // The JS engine embedded in Adobe products needs `match` returned in // order to produce the correct `offset` value. return match; }); source += "';\n"; // If `variable` is not specified wrap a with-statement around the generated // code to add the data object to the top of the scope chain. // Like with sourceURL, we take care to not check the option's prototype, // as this configuration is a code injection vector. var variable = hasOwnProperty.call(options, 'variable') && options.variable; if (!variable) { source = 'with (obj) {\n' + source + '\n}\n'; } // Cleanup code by stripping empty strings. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source) .replace(reEmptyStringMiddle, '$1') .replace(reEmptyStringTrailing, '$1;'); // Frame code as the function body. source = 'function(' + (variable || 'obj') + ') {\n' + (variable ? '' : 'obj || (obj = {});\n' ) + "var __t, __p = ''" + (isEscaping ? ', __e = _.escape' : '' ) + (isEvaluating ? ', __j = Array.prototype.join;\n' + "function print() { __p += __j.call(arguments, '') }\n" : ';\n' ) + source + 'return __p\n}'; var result = attempt(function() { return Function(importsKeys, sourceURL + 'return ' + source) .apply(undefined, importsValues); }); // Provide the compiled function's source by its `toString` method or // the `source` property as a convenience for inlining compiled templates. result.source = source; if (isError(result)) { throw result; } return result; } /** * Converts `string`, as a whole, to lower case just like * [String#toLowerCase](https://mdn.io/toLowerCase). * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the lower cased string. * @example * * _.toLower('--Foo-Bar--'); * // => '--foo-bar--' * * _.toLower('fooBar'); * // => 'foobar' * * _.toLower('__FOO_BAR__'); * // => '__foo_bar__' */ function toLower(value) { return toString(value).toLowerCase(); } /** * Converts `string`, as a whole, to upper case just like * [String#toUpperCase](https://mdn.io/toUpperCase). * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the upper cased string. * @example * * _.toUpper('--foo-bar--'); * // => '--FOO-BAR--' * * _.toUpper('fooBar'); * // => 'FOOBAR' * * _.toUpper('__foo_bar__'); * // => '__FOO_BAR__' */ function toUpper(value) { return toString(value).toUpperCase(); } /** * Removes leading and trailing whitespace or specified characters from `string`. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to trim. * @param {string} [chars=whitespace] The characters to trim. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {string} Returns the trimmed string. * @example * * _.trim(' abc '); * // => 'abc' * * _.trim('-_-abc-_-', '_-'); * // => 'abc' * * _.map([' foo ', ' bar '], _.trim); * // => ['foo', 'bar'] */ function trim(string, chars, guard) { string = toString(string); if (string && (guard || chars === undefined)) { return string.replace(reTrim, ''); } if (!string || !(chars = baseToString(chars))) { return string; } var strSymbols = stringToArray(string), chrSymbols = stringToArray(chars), start = charsStartIndex(strSymbols, chrSymbols), end = charsEndIndex(strSymbols, chrSymbols) + 1; return castSlice(strSymbols, start, end).join(''); } /** * Removes trailing whitespace or specified characters from `string`. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to trim. * @param {string} [chars=whitespace] The characters to trim. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {string} Returns the trimmed string. * @example * * _.trimEnd(' abc '); * // => ' abc' * * _.trimEnd('-_-abc-_-', '_-'); * // => '-_-abc' */ function trimEnd(string, chars, guard) { string = toString(string); if (string && (guard || chars === undefined)) { return string.replace(reTrimEnd, ''); } if (!string || !(chars = baseToString(chars))) { return string; } var strSymbols = stringToArray(string), end = charsEndIndex(strSymbols, stringToArray(chars)) + 1; return castSlice(strSymbols, 0, end).join(''); } /** * Removes leading whitespace or specified characters from `string`. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to trim. * @param {string} [chars=whitespace] The characters to trim. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {string} Returns the trimmed string. * @example * * _.trimStart(' abc '); * // => 'abc ' * * _.trimStart('-_-abc-_-', '_-'); * // => 'abc-_-' */ function trimStart(string, chars, guard) { string = toString(string); if (string && (guard || chars === undefined)) { return string.replace(reTrimStart, ''); } if (!string || !(chars = baseToString(chars))) { return string; } var strSymbols = stringToArray(string), start = charsStartIndex(strSymbols, stringToArray(chars)); return castSlice(strSymbols, start).join(''); } /** * Truncates `string` if it's longer than the given maximum string length. * The last characters of the truncated string are replaced with the omission * string which defaults to "...". * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to truncate. * @param {Object} [options={}] The options object. * @param {number} [options.length=30] The maximum string length. * @param {string} [options.omission='...'] The string to indicate text is omitted. * @param {RegExp|string} [options.separator] The separator pattern to truncate to. * @returns {string} Returns the truncated string. * @example * * _.truncate('hi-diddly-ho there, neighborino'); * // => 'hi-diddly-ho there, neighbo...' * * _.truncate('hi-diddly-ho there, neighborino', { * 'length': 24, * 'separator': ' ' * }); * // => 'hi-diddly-ho there,...' * * _.truncate('hi-diddly-ho there, neighborino', { * 'length': 24, * 'separator': /,? +/ * }); * // => 'hi-diddly-ho there...' * * _.truncate('hi-diddly-ho there, neighborino', { * 'omission': ' [...]' * }); * // => 'hi-diddly-ho there, neig [...]' */ function truncate(string, options) { var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION; if (isObject(options)) { var separator = 'separator' in options ? options.separator : separator; length = 'length' in options ? toInteger(options.length) : length; omission = 'omission' in options ? baseToString(options.omission) : omission; } string = toString(string); var strLength = string.length; if (hasUnicode(string)) { var strSymbols = stringToArray(string); strLength = strSymbols.length; } if (length >= strLength) { return string; } var end = length - stringSize(omission); if (end < 1) { return omission; } var result = strSymbols ? castSlice(strSymbols, 0, end).join('') : string.slice(0, end); if (separator === undefined) { return result + omission; } if (strSymbols) { end += (result.length - end); } if (isRegExp(separator)) { if (string.slice(end).search(separator)) { var match, substring = result; if (!separator.global) { separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g'); } separator.lastIndex = 0; while ((match = separator.exec(substring))) { var newEnd = match.index; } result = result.slice(0, newEnd === undefined ? end : newEnd); } } else if (string.indexOf(baseToString(separator), end) != end) { var index = result.lastIndexOf(separator); if (index > -1) { result = result.slice(0, index); } } return result + omission; } /** * The inverse of `_.escape`; this method converts the HTML entities * `&`, `<`, `>`, `"`, and `'` in `string` to * their corresponding characters. * * **Note:** No other HTML entities are unescaped. To unescape additional * HTML entities use a third-party library like [_he_](https://mths.be/he). * * @static * @memberOf _ * @since 0.6.0 * @category String * @param {string} [string=''] The string to unescape. * @returns {string} Returns the unescaped string. * @example * * _.unescape('fred, barney, & pebbles'); * // => 'fred, barney, & pebbles' */ function unescape(string) { string = toString(string); return (string && reHasEscapedHtml.test(string)) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string; } /** * Converts `string`, as space separated words, to upper case. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the upper cased string. * @example * * _.upperCase('--foo-bar'); * // => 'FOO BAR' * * _.upperCase('fooBar'); * // => 'FOO BAR' * * _.upperCase('__foo_bar__'); * // => 'FOO BAR' */ var upperCase = createCompounder(function(result, word, index) { return result + (index ? ' ' : '') + word.toUpperCase(); }); /** * Converts the first character of `string` to upper case. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the converted string. * @example * * _.upperFirst('fred'); * // => 'Fred' * * _.upperFirst('FRED'); * // => 'FRED' */ var upperFirst = createCaseFirst('toUpperCase'); /** * Splits `string` into an array of its words. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to inspect. * @param {RegExp|string} [pattern] The pattern to match words. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the words of `string`. * @example * * _.words('fred, barney, & pebbles'); * // => ['fred', 'barney', 'pebbles'] * * _.words('fred, barney, & pebbles', /[^, ]+/g); * // => ['fred', 'barney', '&', 'pebbles'] */ function words(string, pattern, guard) { string = toString(string); pattern = guard ? undefined : pattern; if (pattern === undefined) { return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); } return string.match(pattern) || []; } /*------------------------------------------------------------------------*/ /** * Attempts to invoke `func`, returning either the result or the caught error * object. Any additional arguments are provided to `func` when it's invoked. * * @static * @memberOf _ * @since 3.0.0 * @category Util * @param {Function} func The function to attempt. * @param {...*} [args] The arguments to invoke `func` with. * @returns {*} Returns the `func` result or error object. * @example * * // Avoid throwing errors for invalid selectors. * var elements = _.attempt(function(selector) { * return document.querySelectorAll(selector); * }, '>_>'); * * if (_.isError(elements)) { * elements = []; * } */ var attempt = baseRest(function(func, args) { try { return apply(func, undefined, args); } catch (e) { return isError(e) ? e : new Error(e); } }); /** * Binds methods of an object to the object itself, overwriting the existing * method. * * **Note:** This method doesn't set the "length" property of bound functions. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {Object} object The object to bind and assign the bound methods to. * @param {...(string|string[])} methodNames The object method names to bind. * @returns {Object} Returns `object`. * @example * * var view = { * 'label': 'docs', * 'click': function() { * console.log('clicked ' + this.label); * } * }; * * _.bindAll(view, ['click']); * jQuery(element).on('click', view.click); * // => Logs 'clicked docs' when clicked. */ var bindAll = flatRest(function(object, methodNames) { arrayEach(methodNames, function(key) { key = toKey(key); baseAssignValue(object, key, bind(object[key], object)); }); return object; }); /** * Creates a function that iterates over `pairs` and invokes the corresponding * function of the first predicate to return truthy. The predicate-function * pairs are invoked with the `this` binding and arguments of the created * function. * * @static * @memberOf _ * @since 4.0.0 * @category Util * @param {Array} pairs The predicate-function pairs. * @returns {Function} Returns the new composite function. * @example * * var func = _.cond([ * [_.matches({ 'a': 1 }), _.constant('matches A')], * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], * [_.stubTrue, _.constant('no match')] * ]); * * func({ 'a': 1, 'b': 2 }); * // => 'matches A' * * func({ 'a': 0, 'b': 1 }); * // => 'matches B' * * func({ 'a': '1', 'b': '2' }); * // => 'no match' */ function cond(pairs) { var length = pairs == null ? 0 : pairs.length, toIteratee = getIteratee(); pairs = !length ? [] : arrayMap(pairs, function(pair) { if (typeof pair[1] != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } return [toIteratee(pair[0]), pair[1]]; }); return baseRest(function(args) { var index = -1; while (++index < length) { var pair = pairs[index]; if (apply(pair[0], this, args)) { return apply(pair[1], this, args); } } }); } /** * Creates a function that invokes the predicate properties of `source` with * the corresponding property values of a given object, returning `true` if * all predicates return truthy, else `false`. * * **Note:** The created function is equivalent to `_.conformsTo` with * `source` partially applied. * * @static * @memberOf _ * @since 4.0.0 * @category Util * @param {Object} source The object of property predicates to conform to. * @returns {Function} Returns the new spec function. * @example * * var objects = [ * { 'a': 2, 'b': 1 }, * { 'a': 1, 'b': 2 } * ]; * * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } })); * // => [{ 'a': 1, 'b': 2 }] */ function conforms(source) { return baseConforms(baseClone(source, CLONE_DEEP_FLAG)); } /** * Creates a function that returns `value`. * * @static * @memberOf _ * @since 2.4.0 * @category Util * @param {*} value The value to return from the new function. * @returns {Function} Returns the new constant function. * @example * * var objects = _.times(2, _.constant({ 'a': 1 })); * * console.log(objects); * // => [{ 'a': 1 }, { 'a': 1 }] * * console.log(objects[0] === objects[1]); * // => true */ function constant(value) { return function() { return value; }; } /** * Checks `value` to determine whether a default value should be returned in * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, * or `undefined`. * * @static * @memberOf _ * @since 4.14.0 * @category Util * @param {*} value The value to check. * @param {*} defaultValue The default value. * @returns {*} Returns the resolved value. * @example * * _.defaultTo(1, 10); * // => 1 * * _.defaultTo(undefined, 10); * // => 10 */ function defaultTo(value, defaultValue) { return (value == null || value !== value) ? defaultValue : value; } /** * Creates a function that returns the result of invoking the given functions * with the `this` binding of the created function, where each successive * invocation is supplied the return value of the previous. * * @static * @memberOf _ * @since 3.0.0 * @category Util * @param {...(Function|Function[])} [funcs] The functions to invoke. * @returns {Function} Returns the new composite function. * @see _.flowRight * @example * * function square(n) { * return n * n; * } * * var addSquare = _.flow([_.add, square]); * addSquare(1, 2); * // => 9 */ var flow = createFlow(); /** * This method is like `_.flow` except that it creates a function that * invokes the given functions from right to left. * * @static * @since 3.0.0 * @memberOf _ * @category Util * @param {...(Function|Function[])} [funcs] The functions to invoke. * @returns {Function} Returns the new composite function. * @see _.flow * @example * * function square(n) { * return n * n; * } * * var addSquare = _.flowRight([square, _.add]); * addSquare(1, 2); * // => 9 */ var flowRight = createFlow(true); /** * This method returns the first argument it receives. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {*} value Any value. * @returns {*} Returns `value`. * @example * * var object = { 'a': 1 }; * * console.log(_.identity(object) === object); * // => true */ function identity(value) { return value; } /** * Creates a function that invokes `func` with the arguments of the created * function. If `func` is a property name, the created function returns the * property value for a given element. If `func` is an array or object, the * created function returns `true` for elements that contain the equivalent * source properties, otherwise it returns `false`. * * @static * @since 4.0.0 * @memberOf _ * @category Util * @param {*} [func=_.identity] The value to convert to a callback. * @returns {Function} Returns the callback. * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': true }, * { 'user': 'fred', 'age': 40, 'active': false } * ]; * * // The `_.matches` iteratee shorthand. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); * // => [{ 'user': 'barney', 'age': 36, 'active': true }] * * // The `_.matchesProperty` iteratee shorthand. * _.filter(users, _.iteratee(['user', 'fred'])); * // => [{ 'user': 'fred', 'age': 40 }] * * // The `_.property` iteratee shorthand. * _.map(users, _.iteratee('user')); * // => ['barney', 'fred'] * * // Create custom iteratee shorthands. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { * return !_.isRegExp(func) ? iteratee(func) : function(string) { * return func.test(string); * }; * }); * * _.filter(['abc', 'def'], /ef/); * // => ['def'] */ function iteratee(func) { return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG)); } /** * Creates a function that performs a partial deep comparison between a given * object and `source`, returning `true` if the given object has equivalent * property values, else `false`. * * **Note:** The created function is equivalent to `_.isMatch` with `source` * partially applied. * * Partial comparisons will match empty array and empty object `source` * values against any array or object value, respectively. See `_.isEqual` * for a list of supported value comparisons. * * @static * @memberOf _ * @since 3.0.0 * @category Util * @param {Object} source The object of property values to match. * @returns {Function} Returns the new spec function. * @example * * var objects = [ * { 'a': 1, 'b': 2, 'c': 3 }, * { 'a': 4, 'b': 5, 'c': 6 } * ]; * * _.filter(objects, _.matches({ 'a': 4, 'c': 6 })); * // => [{ 'a': 4, 'b': 5, 'c': 6 }] */ function matches(source) { return baseMatches(baseClone(source, CLONE_DEEP_FLAG)); } /** * Creates a function that performs a partial deep comparison between the * value at `path` of a given object to `srcValue`, returning `true` if the * object value is equivalent, else `false`. * * **Note:** Partial comparisons will match empty array and empty object * `srcValue` values against any array or object value, respectively. See * `_.isEqual` for a list of supported value comparisons. * * @static * @memberOf _ * @since 3.2.0 * @category Util * @param {Array|string} path The path of the property to get. * @param {*} srcValue The value to match. * @returns {Function} Returns the new spec function. * @example * * var objects = [ * { 'a': 1, 'b': 2, 'c': 3 }, * { 'a': 4, 'b': 5, 'c': 6 } * ]; * * _.find(objects, _.matchesProperty('a', 4)); * // => { 'a': 4, 'b': 5, 'c': 6 } */ function matchesProperty(path, srcValue) { return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG)); } /** * Creates a function that invokes the method at `path` of a given object. * Any additional arguments are provided to the invoked method. * * @static * @memberOf _ * @since 3.7.0 * @category Util * @param {Array|string} path The path of the method to invoke. * @param {...*} [args] The arguments to invoke the method with. * @returns {Function} Returns the new invoker function. * @example * * var objects = [ * { 'a': { 'b': _.constant(2) } }, * { 'a': { 'b': _.constant(1) } } * ]; * * _.map(objects, _.method('a.b')); * // => [2, 1] * * _.map(objects, _.method(['a', 'b'])); * // => [2, 1] */ var method = baseRest(function(path, args) { return function(object) { return baseInvoke(object, path, args); }; }); /** * The opposite of `_.method`; this method creates a function that invokes * the method at a given path of `object`. Any additional arguments are * provided to the invoked method. * * @static * @memberOf _ * @since 3.7.0 * @category Util * @param {Object} object The object to query. * @param {...*} [args] The arguments to invoke the method with. * @returns {Function} Returns the new invoker function. * @example * * var array = _.times(3, _.constant), * object = { 'a': array, 'b': array, 'c': array }; * * _.map(['a[2]', 'c[0]'], _.methodOf(object)); * // => [2, 0] * * _.map([['a', '2'], ['c', '0']], _.methodOf(object)); * // => [2, 0] */ var methodOf = baseRest(function(object, args) { return function(path) { return baseInvoke(object, path, args); }; }); /** * Adds all own enumerable string keyed function properties of a source * object to the destination object. If `object` is a function, then methods * are added to its prototype as well. * * **Note:** Use `_.runInContext` to create a pristine `lodash` function to * avoid conflicts caused by modifying the original. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {Function|Object} [object=lodash] The destination object. * @param {Object} source The object of functions to add. * @param {Object} [options={}] The options object. * @param {boolean} [options.chain=true] Specify whether mixins are chainable. * @returns {Function|Object} Returns `object`. * @example * * function vowels(string) { * return _.filter(string, function(v) { * return /[aeiou]/i.test(v); * }); * } * * _.mixin({ 'vowels': vowels }); * _.vowels('fred'); * // => ['e'] * * _('fred').vowels().value(); * // => ['e'] * * _.mixin({ 'vowels': vowels }, { 'chain': false }); * _('fred').vowels(); * // => ['e'] */ function mixin(object, source, options) { var props = keys(source), methodNames = baseFunctions(source, props); if (options == null && !(isObject(source) && (methodNames.length || !props.length))) { options = source; source = object; object = this; methodNames = baseFunctions(source, keys(source)); } var chain = !(isObject(options) && 'chain' in options) || !!options.chain, isFunc = isFunction(object); arrayEach(methodNames, function(methodName) { var func = source[methodName]; object[methodName] = func; if (isFunc) { object.prototype[methodName] = function() { var chainAll = this.__chain__; if (chain || chainAll) { var result = object(this.__wrapped__), actions = result.__actions__ = copyArray(this.__actions__); actions.push({ 'func': func, 'args': arguments, 'thisArg': object }); result.__chain__ = chainAll; return result; } return func.apply(object, arrayPush([this.value()], arguments)); }; } }); return object; } /** * Reverts the `_` variable to its previous value and returns a reference to * the `lodash` function. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @returns {Function} Returns the `lodash` function. * @example * * var lodash = _.noConflict(); */ function noConflict() { if (root._ === this) { root._ = oldDash; } return this; } /** * This method returns `undefined`. * * @static * @memberOf _ * @since 2.3.0 * @category Util * @example * * _.times(2, _.noop); * // => [undefined, undefined] */ function noop() { // No operation performed. } /** * Creates a function that gets the argument at index `n`. If `n` is negative, * the nth argument from the end is returned. * * @static * @memberOf _ * @since 4.0.0 * @category Util * @param {number} [n=0] The index of the argument to return. * @returns {Function} Returns the new pass-thru function. * @example * * var func = _.nthArg(1); * func('a', 'b', 'c', 'd'); * // => 'b' * * var func = _.nthArg(-2); * func('a', 'b', 'c', 'd'); * // => 'c' */ function nthArg(n) { n = toInteger(n); return baseRest(function(args) { return baseNth(args, n); }); } /** * Creates a function that invokes `iteratees` with the arguments it receives * and returns their results. * * @static * @memberOf _ * @since 4.0.0 * @category Util * @param {...(Function|Function[])} [iteratees=[_.identity]] * The iteratees to invoke. * @returns {Function} Returns the new function. * @example * * var func = _.over([Math.max, Math.min]); * * func(1, 2, 3, 4); * // => [4, 1] */ var over = createOver(arrayMap); /** * Creates a function that checks if **all** of the `predicates` return * truthy when invoked with the arguments it receives. * * @static * @memberOf _ * @since 4.0.0 * @category Util * @param {...(Function|Function[])} [predicates=[_.identity]] * The predicates to check. * @returns {Function} Returns the new function. * @example * * var func = _.overEvery([Boolean, isFinite]); * * func('1'); * // => true * * func(null); * // => false * * func(NaN); * // => false */ var overEvery = createOver(arrayEvery); /** * Creates a function that checks if **any** of the `predicates` return * truthy when invoked with the arguments it receives. * * @static * @memberOf _ * @since 4.0.0 * @category Util * @param {...(Function|Function[])} [predicates=[_.identity]] * The predicates to check. * @returns {Function} Returns the new function. * @example * * var func = _.overSome([Boolean, isFinite]); * * func('1'); * // => true * * func(null); * // => true * * func(NaN); * // => false */ var overSome = createOver(arraySome); /** * Creates a function that returns the value at `path` of a given object. * * @static * @memberOf _ * @since 2.4.0 * @category Util * @param {Array|string} path The path of the property to get. * @returns {Function} Returns the new accessor function. * @example * * var objects = [ * { 'a': { 'b': 2 } }, * { 'a': { 'b': 1 } } * ]; * * _.map(objects, _.property('a.b')); * // => [2, 1] * * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); * // => [1, 2] */ function property(path) { return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); } /** * The opposite of `_.property`; this method creates a function that returns * the value at a given path of `object`. * * @static * @memberOf _ * @since 3.0.0 * @category Util * @param {Object} object The object to query. * @returns {Function} Returns the new accessor function. * @example * * var array = [0, 1, 2], * object = { 'a': array, 'b': array, 'c': array }; * * _.map(['a[2]', 'c[0]'], _.propertyOf(object)); * // => [2, 0] * * _.map([['a', '2'], ['c', '0']], _.propertyOf(object)); * // => [2, 0] */ function propertyOf(object) { return function(path) { return object == null ? undefined : baseGet(object, path); }; } /** * Creates an array of numbers (positive and/or negative) progressing from * `start` up to, but not including, `end`. A step of `-1` is used if a negative * `start` is specified without an `end` or `step`. If `end` is not specified, * it's set to `start` with `start` then set to `0`. * * **Note:** JavaScript follows the IEEE-754 standard for resolving * floating-point values which can produce unexpected results. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {number} [start=0] The start of the range. * @param {number} end The end of the range. * @param {number} [step=1] The value to increment or decrement by. * @returns {Array} Returns the range of numbers. * @see _.inRange, _.rangeRight * @example * * _.range(4); * // => [0, 1, 2, 3] * * _.range(-4); * // => [0, -1, -2, -3] * * _.range(1, 5); * // => [1, 2, 3, 4] * * _.range(0, 20, 5); * // => [0, 5, 10, 15] * * _.range(0, -4, -1); * // => [0, -1, -2, -3] * * _.range(1, 4, 0); * // => [1, 1, 1] * * _.range(0); * // => [] */ var range = createRange(); /** * This method is like `_.range` except that it populates values in * descending order. * * @static * @memberOf _ * @since 4.0.0 * @category Util * @param {number} [start=0] The start of the range. * @param {number} end The end of the range. * @param {number} [step=1] The value to increment or decrement by. * @returns {Array} Returns the range of numbers. * @see _.inRange, _.range * @example * * _.rangeRight(4); * // => [3, 2, 1, 0] * * _.rangeRight(-4); * // => [-3, -2, -1, 0] * * _.rangeRight(1, 5); * // => [4, 3, 2, 1] * * _.rangeRight(0, 20, 5); * // => [15, 10, 5, 0] * * _.rangeRight(0, -4, -1); * // => [-3, -2, -1, 0] * * _.rangeRight(1, 4, 0); * // => [1, 1, 1] * * _.rangeRight(0); * // => [] */ var rangeRight = createRange(true); /** * This method returns a new empty array. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {Array} Returns the new empty array. * @example * * var arrays = _.times(2, _.stubArray); * * console.log(arrays); * // => [[], []] * * console.log(arrays[0] === arrays[1]); * // => false */ function stubArray() { return []; } /** * This method returns `false`. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {boolean} Returns `false`. * @example * * _.times(2, _.stubFalse); * // => [false, false] */ function stubFalse() { return false; } /** * This method returns a new empty object. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {Object} Returns the new empty object. * @example * * var objects = _.times(2, _.stubObject); * * console.log(objects); * // => [{}, {}] * * console.log(objects[0] === objects[1]); * // => false */ function stubObject() { return {}; } /** * This method returns an empty string. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {string} Returns the empty string. * @example * * _.times(2, _.stubString); * // => ['', ''] */ function stubString() { return ''; } /** * This method returns `true`. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {boolean} Returns `true`. * @example * * _.times(2, _.stubTrue); * // => [true, true] */ function stubTrue() { return true; } /** * Invokes the iteratee `n` times, returning an array of the results of * each invocation. The iteratee is invoked with one argument; (index). * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {number} n The number of times to invoke `iteratee`. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the array of results. * @example * * _.times(3, String); * // => ['0', '1', '2'] * * _.times(4, _.constant(0)); * // => [0, 0, 0, 0] */ function times(n, iteratee) { n = toInteger(n); if (n < 1 || n > MAX_SAFE_INTEGER) { return []; } var index = MAX_ARRAY_LENGTH, length = nativeMin(n, MAX_ARRAY_LENGTH); iteratee = getIteratee(iteratee); n -= MAX_ARRAY_LENGTH; var result = baseTimes(length, iteratee); while (++index < n) { iteratee(index); } return result; } /** * Converts `value` to a property path array. * * @static * @memberOf _ * @since 4.0.0 * @category Util * @param {*} value The value to convert. * @returns {Array} Returns the new property path array. * @example * * _.toPath('a.b.c'); * // => ['a', 'b', 'c'] * * _.toPath('a[0].b.c'); * // => ['a', '0', 'b', 'c'] */ function toPath(value) { if (isArray(value)) { return arrayMap(value, toKey); } return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value))); } /** * Generates a unique ID. If `prefix` is given, the ID is appended to it. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {string} [prefix=''] The value to prefix the ID with. * @returns {string} Returns the unique ID. * @example * * _.uniqueId('contact_'); * // => 'contact_104' * * _.uniqueId(); * // => '105' */ function uniqueId(prefix) { var id = ++idCounter; return toString(prefix) + id; } /*------------------------------------------------------------------------*/ /** * Adds two numbers. * * @static * @memberOf _ * @since 3.4.0 * @category Math * @param {number} augend The first number in an addition. * @param {number} addend The second number in an addition. * @returns {number} Returns the total. * @example * * _.add(6, 4); * // => 10 */ var add = createMathOperation(function(augend, addend) { return augend + addend; }, 0); /** * Computes `number` rounded up to `precision`. * * @static * @memberOf _ * @since 3.10.0 * @category Math * @param {number} number The number to round up. * @param {number} [precision=0] The precision to round up to. * @returns {number} Returns the rounded up number. * @example * * _.ceil(4.006); * // => 5 * * _.ceil(6.004, 2); * // => 6.01 * * _.ceil(6040, -2); * // => 6100 */ var ceil = createRound('ceil'); /** * Divide two numbers. * * @static * @memberOf _ * @since 4.7.0 * @category Math * @param {number} dividend The first number in a division. * @param {number} divisor The second number in a division. * @returns {number} Returns the quotient. * @example * * _.divide(6, 4); * // => 1.5 */ var divide = createMathOperation(function(dividend, divisor) { return dividend / divisor; }, 1); /** * Computes `number` rounded down to `precision`. * * @static * @memberOf _ * @since 3.10.0 * @category Math * @param {number} number The number to round down. * @param {number} [precision=0] The precision to round down to. * @returns {number} Returns the rounded down number. * @example * * _.floor(4.006); * // => 4 * * _.floor(0.046, 2); * // => 0.04 * * _.floor(4060, -2); * // => 4000 */ var floor = createRound('floor'); /** * Computes the maximum value of `array`. If `array` is empty or falsey, * `undefined` is returned. * * @static * @since 0.1.0 * @memberOf _ * @category Math * @param {Array} array The array to iterate over. * @returns {*} Returns the maximum value. * @example * * _.max([4, 2, 8, 6]); * // => 8 * * _.max([]); * // => undefined */ function max(array) { return (array && array.length) ? baseExtremum(array, identity, baseGt) : undefined; } /** * This method is like `_.max` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the criterion by which * the value is ranked. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Math * @param {Array} array The array to iterate over. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {*} Returns the maximum value. * @example * * var objects = [{ 'n': 1 }, { 'n': 2 }]; * * _.maxBy(objects, function(o) { return o.n; }); * // => { 'n': 2 } * * // The `_.property` iteratee shorthand. * _.maxBy(objects, 'n'); * // => { 'n': 2 } */ function maxBy(array, iteratee) { return (array && array.length) ? baseExtremum(array, getIteratee(iteratee, 2), baseGt) : undefined; } /** * Computes the mean of the values in `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Math * @param {Array} array The array to iterate over. * @returns {number} Returns the mean. * @example * * _.mean([4, 2, 8, 6]); * // => 5 */ function mean(array) { return baseMean(array, identity); } /** * This method is like `_.mean` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the value to be averaged. * The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.7.0 * @category Math * @param {Array} array The array to iterate over. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {number} Returns the mean. * @example * * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; * * _.meanBy(objects, function(o) { return o.n; }); * // => 5 * * // The `_.property` iteratee shorthand. * _.meanBy(objects, 'n'); * // => 5 */ function meanBy(array, iteratee) { return baseMean(array, getIteratee(iteratee, 2)); } /** * Computes the minimum value of `array`. If `array` is empty or falsey, * `undefined` is returned. * * @static * @since 0.1.0 * @memberOf _ * @category Math * @param {Array} array The array to iterate over. * @returns {*} Returns the minimum value. * @example * * _.min([4, 2, 8, 6]); * // => 2 * * _.min([]); * // => undefined */ function min(array) { return (array && array.length) ? baseExtremum(array, identity, baseLt) : undefined; } /** * This method is like `_.min` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the criterion by which * the value is ranked. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Math * @param {Array} array The array to iterate over. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {*} Returns the minimum value. * @example * * var objects = [{ 'n': 1 }, { 'n': 2 }]; * * _.minBy(objects, function(o) { return o.n; }); * // => { 'n': 1 } * * // The `_.property` iteratee shorthand. * _.minBy(objects, 'n'); * // => { 'n': 1 } */ function minBy(array, iteratee) { return (array && array.length) ? baseExtremum(array, getIteratee(iteratee, 2), baseLt) : undefined; } /** * Multiply two numbers. * * @static * @memberOf _ * @since 4.7.0 * @category Math * @param {number} multiplier The first number in a multiplication. * @param {number} multiplicand The second number in a multiplication. * @returns {number} Returns the product. * @example * * _.multiply(6, 4); * // => 24 */ var multiply = createMathOperation(function(multiplier, multiplicand) { return multiplier * multiplicand; }, 1); /** * Computes `number` rounded to `precision`. * * @static * @memberOf _ * @since 3.10.0 * @category Math * @param {number} number The number to round. * @param {number} [precision=0] The precision to round to. * @returns {number} Returns the rounded number. * @example * * _.round(4.006); * // => 4 * * _.round(4.006, 2); * // => 4.01 * * _.round(4060, -2); * // => 4100 */ var round = createRound('round'); /** * Subtract two numbers. * * @static * @memberOf _ * @since 4.0.0 * @category Math * @param {number} minuend The first number in a subtraction. * @param {number} subtrahend The second number in a subtraction. * @returns {number} Returns the difference. * @example * * _.subtract(6, 4); * // => 2 */ var subtract = createMathOperation(function(minuend, subtrahend) { return minuend - subtrahend; }, 0); /** * Computes the sum of the values in `array`. * * @static * @memberOf _ * @since 3.4.0 * @category Math * @param {Array} array The array to iterate over. * @returns {number} Returns the sum. * @example * * _.sum([4, 2, 8, 6]); * // => 20 */ function sum(array) { return (array && array.length) ? baseSum(array, identity) : 0; } /** * This method is like `_.sum` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the value to be summed. * The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Math * @param {Array} array The array to iterate over. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {number} Returns the sum. * @example * * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; * * _.sumBy(objects, function(o) { return o.n; }); * // => 20 * * // The `_.property` iteratee shorthand. * _.sumBy(objects, 'n'); * // => 20 */ function sumBy(array, iteratee) { return (array && array.length) ? baseSum(array, getIteratee(iteratee, 2)) : 0; } /*------------------------------------------------------------------------*/ // Add methods that return wrapped values in chain sequences. lodash.after = after; lodash.ary = ary; lodash.assign = assign; lodash.assignIn = assignIn; lodash.assignInWith = assignInWith; lodash.assignWith = assignWith; lodash.at = at; lodash.before = before; lodash.bind = bind; lodash.bindAll = bindAll; lodash.bindKey = bindKey; lodash.castArray = castArray; lodash.chain = chain; lodash.chunk = chunk; lodash.compact = compact; lodash.concat = concat; lodash.cond = cond; lodash.conforms = conforms; lodash.constant = constant; lodash.countBy = countBy; lodash.create = create; lodash.curry = curry; lodash.curryRight = curryRight; lodash.debounce = debounce; lodash.defaults = defaults; lodash.defaultsDeep = defaultsDeep; lodash.defer = defer; lodash.delay = delay; lodash.difference = difference; lodash.differenceBy = differenceBy; lodash.differenceWith = differenceWith; lodash.drop = drop; lodash.dropRight = dropRight; lodash.dropRightWhile = dropRightWhile; lodash.dropWhile = dropWhile; lodash.fill = fill; lodash.filter = filter; lodash.flatMap = flatMap; lodash.flatMapDeep = flatMapDeep; lodash.flatMapDepth = flatMapDepth; lodash.flatten = flatten; lodash.flattenDeep = flattenDeep; lodash.flattenDepth = flattenDepth; lodash.flip = flip; lodash.flow = flow; lodash.flowRight = flowRight; lodash.fromPairs = fromPairs; lodash.functions = functions; lodash.functionsIn = functionsIn; lodash.groupBy = groupBy; lodash.initial = initial; lodash.intersection = intersection; lodash.intersectionBy = intersectionBy; lodash.intersectionWith = intersectionWith; lodash.invert = invert; lodash.invertBy = invertBy; lodash.invokeMap = invokeMap; lodash.iteratee = iteratee; lodash.keyBy = keyBy; lodash.keys = keys; lodash.keysIn = keysIn; lodash.map = map; lodash.mapKeys = mapKeys; lodash.mapValues = mapValues; lodash.matches = matches; lodash.matchesProperty = matchesProperty; lodash.memoize = memoize; lodash.merge = merge; lodash.mergeWith = mergeWith; lodash.method = method; lodash.methodOf = methodOf; lodash.mixin = mixin; lodash.negate = negate; lodash.nthArg = nthArg; lodash.omit = omit; lodash.omitBy = omitBy; lodash.once = once; lodash.orderBy = orderBy; lodash.over = over; lodash.overArgs = overArgs; lodash.overEvery = overEvery; lodash.overSome = overSome; lodash.partial = partial; lodash.partialRight = partialRight; lodash.partition = partition; lodash.pick = pick; lodash.pickBy = pickBy; lodash.property = property; lodash.propertyOf = propertyOf; lodash.pull = pull; lodash.pullAll = pullAll; lodash.pullAllBy = pullAllBy; lodash.pullAllWith = pullAllWith; lodash.pullAt = pullAt; lodash.range = range; lodash.rangeRight = rangeRight; lodash.rearg = rearg; lodash.reject = reject; lodash.remove = remove; lodash.rest = rest; lodash.reverse = reverse; lodash.sampleSize = sampleSize; lodash.set = set; lodash.setWith = setWith; lodash.shuffle = shuffle; lodash.slice = slice; lodash.sortBy = sortBy; lodash.sortedUniq = sortedUniq; lodash.sortedUniqBy = sortedUniqBy; lodash.split = split; lodash.spread = spread; lodash.tail = tail; lodash.take = take; lodash.takeRight = takeRight; lodash.takeRightWhile = takeRightWhile; lodash.takeWhile = takeWhile; lodash.tap = tap; lodash.throttle = throttle; lodash.thru = thru; lodash.toArray = toArray; lodash.toPairs = toPairs; lodash.toPairsIn = toPairsIn; lodash.toPath = toPath; lodash.toPlainObject = toPlainObject; lodash.transform = transform; lodash.unary = unary; lodash.union = union; lodash.unionBy = unionBy; lodash.unionWith = unionWith; lodash.uniq = uniq; lodash.uniqBy = uniqBy; lodash.uniqWith = uniqWith; lodash.unset = unset; lodash.unzip = unzip; lodash.unzipWith = unzipWith; lodash.update = update; lodash.updateWith = updateWith; lodash.values = values; lodash.valuesIn = valuesIn; lodash.without = without; lodash.words = words; lodash.wrap = wrap; lodash.xor = xor; lodash.xorBy = xorBy; lodash.xorWith = xorWith; lodash.zip = zip; lodash.zipObject = zipObject; lodash.zipObjectDeep = zipObjectDeep; lodash.zipWith = zipWith; // Add aliases. lodash.entries = toPairs; lodash.entriesIn = toPairsIn; lodash.extend = assignIn; lodash.extendWith = assignInWith; // Add methods to `lodash.prototype`. mixin(lodash, lodash); /*------------------------------------------------------------------------*/ // Add methods that return unwrapped values in chain sequences. lodash.add = add; lodash.attempt = attempt; lodash.camelCase = camelCase; lodash.capitalize = capitalize; lodash.ceil = ceil; lodash.clamp = clamp; lodash.clone = clone; lodash.cloneDeep = cloneDeep; lodash.cloneDeepWith = cloneDeepWith; lodash.cloneWith = cloneWith; lodash.conformsTo = conformsTo; lodash.deburr = deburr; lodash.defaultTo = defaultTo; lodash.divide = divide; lodash.endsWith = endsWith; lodash.eq = eq; lodash.escape = escape; lodash.escapeRegExp = escapeRegExp; lodash.every = every; lodash.find = find; lodash.findIndex = findIndex; lodash.findKey = findKey; lodash.findLast = findLast; lodash.findLastIndex = findLastIndex; lodash.findLastKey = findLastKey; lodash.floor = floor; lodash.forEach = forEach; lodash.forEachRight = forEachRight; lodash.forIn = forIn; lodash.forInRight = forInRight; lodash.forOwn = forOwn; lodash.forOwnRight = forOwnRight; lodash.get = get; lodash.gt = gt; lodash.gte = gte; lodash.has = has; lodash.hasIn = hasIn; lodash.head = head; lodash.identity = identity; lodash.includes = includes; lodash.indexOf = indexOf; lodash.inRange = inRange; lodash.invoke = invoke; lodash.isArguments = isArguments; lodash.isArray = isArray; lodash.isArrayBuffer = isArrayBuffer; lodash.isArrayLike = isArrayLike; lodash.isArrayLikeObject = isArrayLikeObject; lodash.isBoolean = isBoolean; lodash.isBuffer = isBuffer; lodash.isDate = isDate; lodash.isElement = isElement; lodash.isEmpty = isEmpty; lodash.isEqual = isEqual; lodash.isEqualWith = isEqualWith; lodash.isError = isError; lodash.isFinite = isFinite; lodash.isFunction = isFunction; lodash.isInteger = isInteger; lodash.isLength = isLength; lodash.isMap = isMap; lodash.isMatch = isMatch; lodash.isMatchWith = isMatchWith; lodash.isNaN = isNaN; lodash.isNative = isNative; lodash.isNil = isNil; lodash.isNull = isNull; lodash.isNumber = isNumber; lodash.isObject = isObject; lodash.isObjectLike = isObjectLike; lodash.isPlainObject = isPlainObject; lodash.isRegExp = isRegExp; lodash.isSafeInteger = isSafeInteger; lodash.isSet = isSet; lodash.isString = isString; lodash.isSymbol = isSymbol; lodash.isTypedArray = isTypedArray; lodash.isUndefined = isUndefined; lodash.isWeakMap = isWeakMap; lodash.isWeakSet = isWeakSet; lodash.join = join; lodash.kebabCase = kebabCase; lodash.last = last; lodash.lastIndexOf = lastIndexOf; lodash.lowerCase = lowerCase; lodash.lowerFirst = lowerFirst; lodash.lt = lt; lodash.lte = lte; lodash.max = max; lodash.maxBy = maxBy; lodash.mean = mean; lodash.meanBy = meanBy; lodash.min = min; lodash.minBy = minBy; lodash.stubArray = stubArray; lodash.stubFalse = stubFalse; lodash.stubObject = stubObject; lodash.stubString = stubString; lodash.stubTrue = stubTrue; lodash.multiply = multiply; lodash.nth = nth; lodash.noConflict = noConflict; lodash.noop = noop; lodash.now = now; lodash.pad = pad; lodash.padEnd = padEnd; lodash.padStart = padStart; lodash.parseInt = parseInt; lodash.random = random; lodash.reduce = reduce; lodash.reduceRight = reduceRight; lodash.repeat = repeat; lodash.replace = replace; lodash.result = result; lodash.round = round; lodash.runInContext = runInContext; lodash.sample = sample; lodash.size = size; lodash.snakeCase = snakeCase; lodash.some = some; lodash.sortedIndex = sortedIndex; lodash.sortedIndexBy = sortedIndexBy; lodash.sortedIndexOf = sortedIndexOf; lodash.sortedLastIndex = sortedLastIndex; lodash.sortedLastIndexBy = sortedLastIndexBy; lodash.sortedLastIndexOf = sortedLastIndexOf; lodash.startCase = startCase; lodash.startsWith = startsWith; lodash.subtract = subtract; lodash.sum = sum; lodash.sumBy = sumBy; lodash.template = template; lodash.times = times; lodash.toFinite = toFinite; lodash.toInteger = toInteger; lodash.toLength = toLength; lodash.toLower = toLower; lodash.toNumber = toNumber; lodash.toSafeInteger = toSafeInteger; lodash.toString = toString; lodash.toUpper = toUpper; lodash.trim = trim; lodash.trimEnd = trimEnd; lodash.trimStart = trimStart; lodash.truncate = truncate; lodash.unescape = unescape; lodash.uniqueId = uniqueId; lodash.upperCase = upperCase; lodash.upperFirst = upperFirst; // Add aliases. lodash.each = forEach; lodash.eachRight = forEachRight; lodash.first = head; mixin(lodash, (function() { var source = {}; baseForOwn(lodash, function(func, methodName) { if (!hasOwnProperty.call(lodash.prototype, methodName)) { source[methodName] = func; } }); return source; }()), { 'chain': false }); /*------------------------------------------------------------------------*/ /** * The semantic version number. * * @static * @memberOf _ * @type {string} */ lodash.VERSION = VERSION; // Assign default placeholders. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) { lodash[methodName].placeholder = lodash; }); // Add `LazyWrapper` methods for `_.drop` and `_.take` variants. arrayEach(['drop', 'take'], function(methodName, index) { LazyWrapper.prototype[methodName] = function(n) { n = n === undefined ? 1 : nativeMax(toInteger(n), 0); var result = (this.__filtered__ && !index) ? new LazyWrapper(this) : this.clone(); if (result.__filtered__) { result.__takeCount__ = nativeMin(n, result.__takeCount__); } else { result.__views__.push({ 'size': nativeMin(n, MAX_ARRAY_LENGTH), 'type': methodName + (result.__dir__ < 0 ? 'Right' : '') }); } return result; }; LazyWrapper.prototype[methodName + 'Right'] = function(n) { return this.reverse()[methodName](n).reverse(); }; }); // Add `LazyWrapper` methods that accept an `iteratee` value. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) { var type = index + 1, isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG; LazyWrapper.prototype[methodName] = function(iteratee) { var result = this.clone(); result.__iteratees__.push({ 'iteratee': getIteratee(iteratee, 3), 'type': type }); result.__filtered__ = result.__filtered__ || isFilter; return result; }; }); // Add `LazyWrapper` methods for `_.head` and `_.last`. arrayEach(['head', 'last'], function(methodName, index) { var takeName = 'take' + (index ? 'Right' : ''); LazyWrapper.prototype[methodName] = function() { return this[takeName](1).value()[0]; }; }); // Add `LazyWrapper` methods for `_.initial` and `_.tail`. arrayEach(['initial', 'tail'], function(methodName, index) { var dropName = 'drop' + (index ? '' : 'Right'); LazyWrapper.prototype[methodName] = function() { return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1); }; }); LazyWrapper.prototype.compact = function() { return this.filter(identity); }; LazyWrapper.prototype.find = function(predicate) { return this.filter(predicate).head(); }; LazyWrapper.prototype.findLast = function(predicate) { return this.reverse().find(predicate); }; LazyWrapper.prototype.invokeMap = baseRest(function(path, args) { if (typeof path == 'function') { return new LazyWrapper(this); } return this.map(function(value) { return baseInvoke(value, path, args); }); }); LazyWrapper.prototype.reject = function(predicate) { return this.filter(negate(getIteratee(predicate))); }; LazyWrapper.prototype.slice = function(start, end) { start = toInteger(start); var result = this; if (result.__filtered__ && (start > 0 || end < 0)) { return new LazyWrapper(result); } if (start < 0) { result = result.takeRight(-start); } else if (start) { result = result.drop(start); } if (end !== undefined) { end = toInteger(end); result = end < 0 ? result.dropRight(-end) : result.take(end - start); } return result; }; LazyWrapper.prototype.takeRightWhile = function(predicate) { return this.reverse().takeWhile(predicate).reverse(); }; LazyWrapper.prototype.toArray = function() { return this.take(MAX_ARRAY_LENGTH); }; // Add `LazyWrapper` methods to `lodash.prototype`. baseForOwn(LazyWrapper.prototype, function(func, methodName) { var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), isTaker = /^(?:head|last)$/.test(methodName), lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName], retUnwrapped = isTaker || /^find/.test(methodName); if (!lodashFunc) { return; } lodash.prototype[methodName] = function() { var value = this.__wrapped__, args = isTaker ? [1] : arguments, isLazy = value instanceof LazyWrapper, iteratee = args[0], useLazy = isLazy || isArray(value); var interceptor = function(value) { var result = lodashFunc.apply(lodash, arrayPush([value], args)); return (isTaker && chainAll) ? result[0] : result; }; if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) { // Avoid lazy use if the iteratee has a "length" value other than `1`. isLazy = useLazy = false; } var chainAll = this.__chain__, isHybrid = !!this.__actions__.length, isUnwrapped = retUnwrapped && !chainAll, onlyLazy = isLazy && !isHybrid; if (!retUnwrapped && useLazy) { value = onlyLazy ? value : new LazyWrapper(this); var result = func.apply(value, args); result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined }); return new LodashWrapper(result, chainAll); } if (isUnwrapped && onlyLazy) { return func.apply(this, args); } result = this.thru(interceptor); return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result; }; }); // Add `Array` methods to `lodash.prototype`. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) { var func = arrayProto[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru', retUnwrapped = /^(?:pop|shift)$/.test(methodName); lodash.prototype[methodName] = function() { var args = arguments; if (retUnwrapped && !this.__chain__) { var value = this.value(); return func.apply(isArray(value) ? value : [], args); } return this[chainName](function(value) { return func.apply(isArray(value) ? value : [], args); }); }; }); // Map minified method names to their real names. baseForOwn(LazyWrapper.prototype, function(func, methodName) { var lodashFunc = lodash[methodName]; if (lodashFunc) { var key = lodashFunc.name + ''; if (!hasOwnProperty.call(realNames, key)) { realNames[key] = []; } realNames[key].push({ 'name': methodName, 'func': lodashFunc }); } }); realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{ 'name': 'wrapper', 'func': undefined }]; // Add methods to `LazyWrapper`. LazyWrapper.prototype.clone = lazyClone; LazyWrapper.prototype.reverse = lazyReverse; LazyWrapper.prototype.value = lazyValue; // Add chain sequence methods to the `lodash` wrapper. lodash.prototype.at = wrapperAt; lodash.prototype.chain = wrapperChain; lodash.prototype.commit = wrapperCommit; lodash.prototype.next = wrapperNext; lodash.prototype.plant = wrapperPlant; lodash.prototype.reverse = wrapperReverse; lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; // Add lazy aliases. lodash.prototype.first = lodash.prototype.head; if (symIterator) { lodash.prototype[symIterator] = wrapperToIterator; } return lodash; }); /*--------------------------------------------------------------------------*/ // Export lodash. var _ = runInContext(); // Some AMD build optimizers, like r.js, check for condition patterns like: if (true) { // Expose Lodash on the global object to prevent errors when Lodash is // loaded by a script tag in the presence of an AMD loader. // See http://requirejs.org/docs/errors.html#mismatch for more details. // Use `_.noConflict` to remove Lodash from the global object. root._ = _; // Define as an anonymous module so, through path mapping, it can be // referenced as the "underscore" module. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return _; }).call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } // Check for `exports` after `define` in case a build optimizer adds it. else {} }.call(this)); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(13)(module))) /***/ }), /* 1066 */ /***/ (function(module, exports) { module.exports = isPromise; function isPromise(obj) { return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function'; } /***/ }), /* 1067 */ /***/ (function(module, exports) { // UUID // https://gist.github.com/LeverOne/1308368 /* jshint ignore:start */ function uuid (a, b) { for (b = a = ''; a++ < 36; b += a * 51 & 52 ? (a ^ 15 ? 8 ^ Math.random() * (a ^ 20 ? 16 : 4) : 4).toString(16) : '-');return b } /* jshint ignore:end */ module.exports = { // Empties properties __empty: function (doc) { this.forEach(doc, function (value, key) { delete doc[key] }) }, // Copies properties from an object to another __update: function (dest, src) { this.forEach(src, function (value, key) { dest[key] = value }) }, // Removes an item from an array __remove: function (array, item) { var index = this.indexOf(array, item) if (index !== -1) array.splice(index, 1) }, __id: function () { var id = this.id || 'id' return id }, getById: function (collection, id) { var self = this return this.find(collection, function (doc) { if (self.has(doc, self.__id())) { return doc[self.__id()].toString() === id.toString() } }) }, createId: function (collection, doc) { return uuid() }, insert: function (collection, doc) { doc[this.__id()] = doc[this.__id()] || this.createId(collection, doc) var d = this.getById(collection, doc[this.__id()]) if (d) throw new Error('Insert failed, duplicate id') collection.push(doc) return doc }, upsert: function (collection, doc) { if (doc[this.__id()]) { // id is set var d = this.getById(collection, doc[this.__id()]) if (d) { // replace properties of existing object this.__empty(d) this.assign(d, doc) } else { // push new object collection.push(doc) } } else { // create id and push new object doc[this.__id()] = this.createId(collection, doc) collection.push(doc) } return doc }, updateById: function (collection, id, attrs) { var doc = this.getById(collection, id) if (doc) { this.assign(doc, attrs, {id: doc.id}) } return doc }, updateWhere: function (collection, predicate, attrs) { var self = this var docs = this.filter(collection, predicate) docs.forEach(function (doc) { self.assign(doc, attrs, {id: doc.id}) }) return docs }, replaceById: function (collection, id, attrs) { var doc = this.getById(collection, id) if (doc) { var docId = doc.id this.__empty(doc) this.assign(doc, attrs, {id: docId}) } return doc }, removeById: function (collection, id) { var doc = this.getById(collection, id) this.__remove(collection, doc) return doc }, removeWhere: function (collection, predicate) { var self = this var docs = this.filter(collection, predicate) docs.forEach(function (doc) { self.__remove(collection, doc) }) return docs } } /***/ }), /* 1068 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var fs = __webpack_require__(1069); var Base = __webpack_require__(1074); var readFile = fs.readFileSync; var writeFile = fs.writeFileSync; // Same code as in FileAsync, minus `await` var FileSync = function (_Base) { _inherits(FileSync, _Base); function FileSync() { _classCallCheck(this, FileSync); return _possibleConstructorReturn(this, (FileSync.__proto__ || Object.getPrototypeOf(FileSync)).apply(this, arguments)); } _createClass(FileSync, [{ key: 'read', value: function read() { // fs.exists is deprecated but not fs.existsSync if (fs.existsSync(this.source)) { // Read database try { var data = readFile(this.source, 'utf-8').trim(); // Handle blank file return data ? this.deserialize(data) : this.defaultValue; } catch (e) { if (e instanceof SyntaxError) { e.message = `Malformed JSON in file: ${this.source}\n${e.message}`; } throw e; } } else { // Initialize writeFile(this.source, this.serialize(this.defaultValue)); return this.defaultValue; } } }, { key: 'write', value: function write(data) { return writeFile(this.source, this.serialize(data)); } }]); return FileSync; }(Base); module.exports = FileSync; /***/ }), /* 1069 */ /***/ (function(module, exports, __webpack_require__) { var fs = __webpack_require__(167) var polyfills = __webpack_require__(1070) var legacy = __webpack_require__(1072) var clone = __webpack_require__(1073) var util = __webpack_require__(9) /* istanbul ignore next - node 0.x polyfill */ var gracefulQueue var previousSymbol /* istanbul ignore else - node 0.x polyfill */ if (typeof Symbol === 'function' && typeof Symbol.for === 'function') { gracefulQueue = Symbol.for('graceful-fs.queue') // This is used in testing by future versions previousSymbol = Symbol.for('graceful-fs.previous') } else { gracefulQueue = '___graceful-fs.queue' previousSymbol = '___graceful-fs.previous' } function noop () {} var debug = noop if (util.debuglog) debug = util.debuglog('gfs4') else if (/\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) } // Once time initialization if (!global[gracefulQueue]) { // This queue can be shared by multiple loaded instances var queue = [] Object.defineProperty(global, gracefulQueue, { get: function() { return queue } }) // Patch fs.close/closeSync to shared queue version, because we need // to retry() whenever a close happens *anywhere* in the program. // This is essential when multiple graceful-fs instances are // in play at the same time. fs.close = (function (fs$close) { function close (fd, cb) { return fs$close.call(fs, fd, function (err) { // This function uses the graceful-fs shared queue if (!err) { retry() } if (typeof cb === 'function') cb.apply(this, arguments) }) } Object.defineProperty(close, previousSymbol, { value: fs$close }) return close })(fs.close) fs.closeSync = (function (fs$closeSync) { function closeSync (fd) { // This function uses the graceful-fs shared queue fs$closeSync.apply(fs, arguments) retry() } Object.defineProperty(closeSync, previousSymbol, { value: fs$closeSync }) return closeSync })(fs.closeSync) if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { process.on('exit', function() { debug(global[gracefulQueue]) __webpack_require__(109).equal(global[gracefulQueue].length, 0) }) } } module.exports = patch(clone(fs)) if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) { module.exports = patch(fs) fs.__patched = true; } function patch (fs) { // Everything that references the open() function needs to be in here polyfills(fs) fs.gracefulify = patch fs.createReadStream = createReadStream fs.createWriteStream = createWriteStream var fs$readFile = fs.readFile fs.readFile = readFile function readFile (path, options, cb) { if (typeof options === 'function') cb = options, options = null return go$readFile(path, options, cb) function go$readFile (path, options, cb) { return fs$readFile(path, options, function (err) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$readFile, [path, options, cb]]) else { if (typeof cb === 'function') cb.apply(this, arguments) retry() } }) } } var fs$writeFile = fs.writeFile fs.writeFile = writeFile function writeFile (path, data, options, cb) { if (typeof options === 'function') cb = options, options = null return go$writeFile(path, data, options, cb) function go$writeFile (path, data, options, cb) { return fs$writeFile(path, data, options, function (err) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$writeFile, [path, data, options, cb]]) else { if (typeof cb === 'function') cb.apply(this, arguments) retry() } }) } } var fs$appendFile = fs.appendFile if (fs$appendFile) fs.appendFile = appendFile function appendFile (path, data, options, cb) { if (typeof options === 'function') cb = options, options = null return go$appendFile(path, data, options, cb) function go$appendFile (path, data, options, cb) { return fs$appendFile(path, data, options, function (err) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$appendFile, [path, data, options, cb]]) else { if (typeof cb === 'function') cb.apply(this, arguments) retry() } }) } } var fs$readdir = fs.readdir fs.readdir = readdir function readdir (path, options, cb) { var args = [path] if (typeof options !== 'function') { args.push(options) } else { cb = options } args.push(go$readdir$cb) return go$readdir(args) function go$readdir$cb (err, files) { if (files && files.sort) files.sort() if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$readdir, [args]]) else { if (typeof cb === 'function') cb.apply(this, arguments) retry() } } } function go$readdir (args) { return fs$readdir.apply(fs, args) } if (process.version.substr(0, 4) === 'v0.8') { var legStreams = legacy(fs) ReadStream = legStreams.ReadStream WriteStream = legStreams.WriteStream } var fs$ReadStream = fs.ReadStream if (fs$ReadStream) { ReadStream.prototype = Object.create(fs$ReadStream.prototype) ReadStream.prototype.open = ReadStream$open } var fs$WriteStream = fs.WriteStream if (fs$WriteStream) { WriteStream.prototype = Object.create(fs$WriteStream.prototype) WriteStream.prototype.open = WriteStream$open } Object.defineProperty(fs, 'ReadStream', { get: function () { return ReadStream }, set: function (val) { ReadStream = val }, enumerable: true, configurable: true }) Object.defineProperty(fs, 'WriteStream', { get: function () { return WriteStream }, set: function (val) { WriteStream = val }, enumerable: true, configurable: true }) // legacy names Object.defineProperty(fs, 'FileReadStream', { get: function () { return ReadStream }, set: function (val) { ReadStream = val }, enumerable: true, configurable: true }) Object.defineProperty(fs, 'FileWriteStream', { get: function () { return WriteStream }, set: function (val) { WriteStream = val }, enumerable: true, configurable: true }) function ReadStream (path, options) { if (this instanceof ReadStream) return fs$ReadStream.apply(this, arguments), this else return ReadStream.apply(Object.create(ReadStream.prototype), arguments) } function ReadStream$open () { var that = this open(that.path, that.flags, that.mode, function (err, fd) { if (err) { if (that.autoClose) that.destroy() that.emit('error', err) } else { that.fd = fd that.emit('open', fd) that.read() } }) } function WriteStream (path, options) { if (this instanceof WriteStream) return fs$WriteStream.apply(this, arguments), this else return WriteStream.apply(Object.create(WriteStream.prototype), arguments) } function WriteStream$open () { var that = this open(that.path, that.flags, that.mode, function (err, fd) { if (err) { that.destroy() that.emit('error', err) } else { that.fd = fd that.emit('open', fd) } }) } function createReadStream (path, options) { return new fs.ReadStream(path, options) } function createWriteStream (path, options) { return new fs.WriteStream(path, options) } var fs$open = fs.open fs.open = open function open (path, flags, mode, cb) { if (typeof mode === 'function') cb = mode, mode = null return go$open(path, flags, mode, cb) function go$open (path, flags, mode, cb) { return fs$open(path, flags, mode, function (err, fd) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$open, [path, flags, mode, cb]]) else { if (typeof cb === 'function') cb.apply(this, arguments) retry() } }) } } return fs } function enqueue (elem) { debug('ENQUEUE', elem[0].name, elem[1]) global[gracefulQueue].push(elem) } function retry () { var elem = global[gracefulQueue].shift() if (elem) { debug('RETRY', elem[0].name, elem[1]) elem[0].apply(null, elem[1]) } } /***/ }), /* 1070 */ /***/ (function(module, exports, __webpack_require__) { var constants = __webpack_require__(1071) var origCwd = process.cwd var cwd = null var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform process.cwd = function() { if (!cwd) cwd = origCwd.call(process) return cwd } try { process.cwd() } catch (er) {} var chdir = process.chdir process.chdir = function(d) { cwd = null chdir.call(process, d) } module.exports = patch function patch (fs) { // (re-)implement some things that are known busted or missing. // lchmod, broken prior to 0.6.2 // back-port the fix here. if (constants.hasOwnProperty('O_SYMLINK') && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { patchLchmod(fs) } // lutimes implementation, or no-op if (!fs.lutimes) { patchLutimes(fs) } // https://github.com/isaacs/node-graceful-fs/issues/4 // Chown should not fail on einval or eperm if non-root. // It should not fail on enosys ever, as this just indicates // that a fs doesn't support the intended operation. fs.chown = chownFix(fs.chown) fs.fchown = chownFix(fs.fchown) fs.lchown = chownFix(fs.lchown) fs.chmod = chmodFix(fs.chmod) fs.fchmod = chmodFix(fs.fchmod) fs.lchmod = chmodFix(fs.lchmod) fs.chownSync = chownFixSync(fs.chownSync) fs.fchownSync = chownFixSync(fs.fchownSync) fs.lchownSync = chownFixSync(fs.lchownSync) fs.chmodSync = chmodFixSync(fs.chmodSync) fs.fchmodSync = chmodFixSync(fs.fchmodSync) fs.lchmodSync = chmodFixSync(fs.lchmodSync) fs.stat = statFix(fs.stat) fs.fstat = statFix(fs.fstat) fs.lstat = statFix(fs.lstat) fs.statSync = statFixSync(fs.statSync) fs.fstatSync = statFixSync(fs.fstatSync) fs.lstatSync = statFixSync(fs.lstatSync) // if lchmod/lchown do not exist, then make them no-ops if (!fs.lchmod) { fs.lchmod = function (path, mode, cb) { if (cb) process.nextTick(cb) } fs.lchmodSync = function () {} } if (!fs.lchown) { fs.lchown = function (path, uid, gid, cb) { if (cb) process.nextTick(cb) } fs.lchownSync = function () {} } // on Windows, A/V software can lock the directory, causing this // to fail with an EACCES or EPERM if the directory contains newly // created files. Try again on failure, for up to 60 seconds. // Set the timeout this long because some Windows Anti-Virus, such as Parity // bit9, may lock files for up to a minute, causing npm package install // failures. Also, take care to yield the scheduler. Windows scheduling gives // CPU to a busy looping process, which can cause the program causing the lock // contention to be starved of CPU by node, so the contention doesn't resolve. if (platform === "win32") { fs.rename = (function (fs$rename) { return function (from, to, cb) { var start = Date.now() var backoff = 0; fs$rename(from, to, function CB (er) { if (er && (er.code === "EACCES" || er.code === "EPERM") && Date.now() - start < 60000) { setTimeout(function() { fs.stat(to, function (stater, st) { if (stater && stater.code === "ENOENT") fs$rename(from, to, CB); else cb(er) }) }, backoff) if (backoff < 100) backoff += 10; return; } if (cb) cb(er) }) }})(fs.rename) } // if read() returns EAGAIN, then just try it again. fs.read = (function (fs$read) { function read (fd, buffer, offset, length, position, callback_) { var callback if (callback_ && typeof callback_ === 'function') { var eagCounter = 0 callback = function (er, _, __) { if (er && er.code === 'EAGAIN' && eagCounter < 10) { eagCounter ++ return fs$read.call(fs, fd, buffer, offset, length, position, callback) } callback_.apply(this, arguments) } } return fs$read.call(fs, fd, buffer, offset, length, position, callback) } // This ensures `util.promisify` works as it does for native `fs.read`. read.__proto__ = fs$read return read })(fs.read) fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) { var eagCounter = 0 while (true) { try { return fs$readSync.call(fs, fd, buffer, offset, length, position) } catch (er) { if (er.code === 'EAGAIN' && eagCounter < 10) { eagCounter ++ continue } throw er } } }})(fs.readSync) function patchLchmod (fs) { fs.lchmod = function (path, mode, callback) { fs.open( path , constants.O_WRONLY | constants.O_SYMLINK , mode , function (err, fd) { if (err) { if (callback) callback(err) return } // prefer to return the chmod error, if one occurs, // but still try to close, and report closing errors if they occur. fs.fchmod(fd, mode, function (err) { fs.close(fd, function(err2) { if (callback) callback(err || err2) }) }) }) } fs.lchmodSync = function (path, mode) { var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) // prefer to return the chmod error, if one occurs, // but still try to close, and report closing errors if they occur. var threw = true var ret try { ret = fs.fchmodSync(fd, mode) threw = false } finally { if (threw) { try { fs.closeSync(fd) } catch (er) {} } else { fs.closeSync(fd) } } return ret } } function patchLutimes (fs) { if (constants.hasOwnProperty("O_SYMLINK")) { fs.lutimes = function (path, at, mt, cb) { fs.open(path, constants.O_SYMLINK, function (er, fd) { if (er) { if (cb) cb(er) return } fs.futimes(fd, at, mt, function (er) { fs.close(fd, function (er2) { if (cb) cb(er || er2) }) }) }) } fs.lutimesSync = function (path, at, mt) { var fd = fs.openSync(path, constants.O_SYMLINK) var ret var threw = true try { ret = fs.futimesSync(fd, at, mt) threw = false } finally { if (threw) { try { fs.closeSync(fd) } catch (er) {} } else { fs.closeSync(fd) } } return ret } } else { fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } fs.lutimesSync = function () {} } } function chmodFix (orig) { if (!orig) return orig return function (target, mode, cb) { return orig.call(fs, target, mode, function (er) { if (chownErOk(er)) er = null if (cb) cb.apply(this, arguments) }) } } function chmodFixSync (orig) { if (!orig) return orig return function (target, mode) { try { return orig.call(fs, target, mode) } catch (er) { if (!chownErOk(er)) throw er } } } function chownFix (orig) { if (!orig) return orig return function (target, uid, gid, cb) { return orig.call(fs, target, uid, gid, function (er) { if (chownErOk(er)) er = null if (cb) cb.apply(this, arguments) }) } } function chownFixSync (orig) { if (!orig) return orig return function (target, uid, gid) { try { return orig.call(fs, target, uid, gid) } catch (er) { if (!chownErOk(er)) throw er } } } function statFix (orig) { if (!orig) return orig // Older versions of Node erroneously returned signed integers for // uid + gid. return function (target, options, cb) { if (typeof options === 'function') { cb = options options = null } function callback (er, stats) { if (stats) { if (stats.uid < 0) stats.uid += 0x100000000 if (stats.gid < 0) stats.gid += 0x100000000 } if (cb) cb.apply(this, arguments) } return options ? orig.call(fs, target, options, callback) : orig.call(fs, target, callback) } } function statFixSync (orig) { if (!orig) return orig // Older versions of Node erroneously returned signed integers for // uid + gid. return function (target, options) { var stats = options ? orig.call(fs, target, options) : orig.call(fs, target) if (stats.uid < 0) stats.uid += 0x100000000 if (stats.gid < 0) stats.gid += 0x100000000 return stats; } } // ENOSYS means that the fs doesn't support the op. Just ignore // that, because it doesn't matter. // // if there's no getuid, or if getuid() is something other // than 0, and the error is EINVAL or EPERM, then just ignore // it. // // This specific case is a silent failure in cp, install, tar, // and most other unix tools that manage permissions. // // When running as root, or if other types of errors are // encountered, then it's strict. function chownErOk (er) { if (!er) return true if (er.code === "ENOSYS") return true var nonroot = !process.getuid || process.getuid() !== 0 if (nonroot) { if (er.code === "EINVAL" || er.code === "EPERM") return true } return false } } /***/ }), /* 1071 */ /***/ (function(module, exports) { module.exports = require("constants"); /***/ }), /* 1072 */ /***/ (function(module, exports, __webpack_require__) { var Stream = __webpack_require__(100).Stream module.exports = legacy function legacy (fs) { return { ReadStream: ReadStream, WriteStream: WriteStream } function ReadStream (path, options) { if (!(this instanceof ReadStream)) return new ReadStream(path, options); Stream.call(this); var self = this; this.path = path; this.fd = null; this.readable = true; this.paused = false; this.flags = 'r'; this.mode = 438; /*=0666*/ this.bufferSize = 64 * 1024; options = options || {}; // Mixin options into this var keys = Object.keys(options); for (var index = 0, length = keys.length; index < length; index++) { var key = keys[index]; this[key] = options[key]; } if (this.encoding) this.setEncoding(this.encoding); if (this.start !== undefined) { if ('number' !== typeof this.start) { throw TypeError('start must be a Number'); } if (this.end === undefined) { this.end = Infinity; } else if ('number' !== typeof this.end) { throw TypeError('end must be a Number'); } if (this.start > this.end) { throw new Error('start must be <= end'); } this.pos = this.start; } if (this.fd !== null) { process.nextTick(function() { self._read(); }); return; } fs.open(this.path, this.flags, this.mode, function (err, fd) { if (err) { self.emit('error', err); self.readable = false; return; } self.fd = fd; self.emit('open', fd); self._read(); }) } function WriteStream (path, options) { if (!(this instanceof WriteStream)) return new WriteStream(path, options); Stream.call(this); this.path = path; this.fd = null; this.writable = true; this.flags = 'w'; this.encoding = 'binary'; this.mode = 438; /*=0666*/ this.bytesWritten = 0; options = options || {}; // Mixin options into this var keys = Object.keys(options); for (var index = 0, length = keys.length; index < length; index++) { var key = keys[index]; this[key] = options[key]; } if (this.start !== undefined) { if ('number' !== typeof this.start) { throw TypeError('start must be a Number'); } if (this.start < 0) { throw new Error('start must be >= zero'); } this.pos = this.start; } this.busy = false; this._queue = []; if (this.fd === null) { this._open = fs.open; this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); this.flush(); } } } /***/ }), /* 1073 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = clone function clone (obj) { if (obj === null || typeof obj !== 'object') return obj if (obj instanceof Object) var copy = { __proto__: obj.__proto__ } else var copy = Object.create(null) Object.getOwnPropertyNames(obj).forEach(function (key) { Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) }) return copy } /***/ }), /* 1074 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var stringify = __webpack_require__(1075); var Base = function Base(source) { var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref$defaultValue = _ref.defaultValue, defaultValue = _ref$defaultValue === undefined ? {} : _ref$defaultValue, _ref$serialize = _ref.serialize, serialize = _ref$serialize === undefined ? stringify : _ref$serialize, _ref$deserialize = _ref.deserialize, deserialize = _ref$deserialize === undefined ? JSON.parse : _ref$deserialize; _classCallCheck(this, Base); this.source = source; this.defaultValue = defaultValue; this.serialize = serialize; this.deserialize = deserialize; }; module.exports = Base; /***/ }), /* 1075 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Pretty stringify module.exports = function stringify(obj) { return JSON.stringify(obj, null, 2); }; /***/ }), /* 1076 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * raw-body * Copyright(c) 2013-2014 Jonathan Ong * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var bytes = __webpack_require__(1077) var createError = __webpack_require__(1078) var iconv = __webpack_require__(626) var unpipe = __webpack_require__(1087) /** * Module exports. * @public */ module.exports = getRawBody /** * Module variables. * @private */ var ICONV_ENCODING_MESSAGE_REGEXP = /^Encoding not recognized: / /** * Get the decoder for a given encoding. * * @param {string} encoding * @private */ function getDecoder (encoding) { if (!encoding) return null try { return iconv.getDecoder(encoding) } catch (e) { // error getting decoder if (!ICONV_ENCODING_MESSAGE_REGEXP.test(e.message)) throw e // the encoding was not found throw createError(415, 'specified encoding unsupported', { encoding: encoding, type: 'encoding.unsupported' }) } } /** * Get the raw body of a stream (typically HTTP). * * @param {object} stream * @param {object|string|function} [options] * @param {function} [callback] * @public */ function getRawBody (stream, options, callback) { var done = callback var opts = options || {} if (options === true || typeof options === 'string') { // short cut for encoding opts = { encoding: options } } if (typeof options === 'function') { done = options opts = {} } // validate callback is a function, if provided if (done !== undefined && typeof done !== 'function') { throw new TypeError('argument callback must be a function') } // require the callback without promises if (!done && !global.Promise) { throw new TypeError('argument callback is required') } // get encoding var encoding = opts.encoding !== true ? opts.encoding : 'utf-8' // convert the limit to an integer var limit = bytes.parse(opts.limit) // convert the expected length to an integer var length = opts.length != null && !isNaN(opts.length) ? parseInt(opts.length, 10) : null if (done) { // classic callback style return readStream(stream, encoding, length, limit, done) } return new Promise(function executor (resolve, reject) { readStream(stream, encoding, length, limit, function onRead (err, buf) { if (err) return reject(err) resolve(buf) }) }) } /** * Halt a stream. * * @param {Object} stream * @private */ function halt (stream) { // unpipe everything from the stream unpipe(stream) // pause stream if (typeof stream.pause === 'function') { stream.pause() } } /** * Read the data from the stream. * * @param {object} stream * @param {string} encoding * @param {number} length * @param {number} limit * @param {function} callback * @public */ function readStream (stream, encoding, length, limit, callback) { var complete = false var sync = true // check the length and limit options. // note: we intentionally leave the stream paused, // so users should handle the stream themselves. if (limit !== null && length !== null && length > limit) { return done(createError(413, 'request entity too large', { expected: length, length: length, limit: limit, type: 'entity.too.large' })) } // streams1: assert request encoding is buffer. // streams2+: assert the stream encoding is buffer. // stream._decoder: streams1 // state.encoding: streams2 // state.decoder: streams2, specifically < 0.10.6 var state = stream._readableState if (stream._decoder || (state && (state.encoding || state.decoder))) { // developer error return done(createError(500, 'stream encoding should not be set', { type: 'stream.encoding.set' })) } var received = 0 var decoder try { decoder = getDecoder(encoding) } catch (err) { return done(err) } var buffer = decoder ? '' : [] // attach listeners stream.on('aborted', onAborted) stream.on('close', cleanup) stream.on('data', onData) stream.on('end', onEnd) stream.on('error', onEnd) // mark sync section complete sync = false function done () { var args = new Array(arguments.length) // copy arguments for (var i = 0; i < args.length; i++) { args[i] = arguments[i] } // mark complete complete = true if (sync) { process.nextTick(invokeCallback) } else { invokeCallback() } function invokeCallback () { cleanup() if (args[0]) { // halt the stream on error halt(stream) } callback.apply(null, args) } } function onAborted () { if (complete) return done(createError(400, 'request aborted', { code: 'ECONNABORTED', expected: length, length: length, received: received, type: 'request.aborted' })) } function onData (chunk) { if (complete) return received += chunk.length if (limit !== null && received > limit) { done(createError(413, 'request entity too large', { limit: limit, received: received, type: 'entity.too.large' })) } else if (decoder) { buffer += decoder.write(chunk) } else { buffer.push(chunk) } } function onEnd (err) { if (complete) return if (err) return done(err) if (length !== null && received !== length) { done(createError(400, 'request size did not match content length', { expected: length, length: length, received: received, type: 'request.size.invalid' })) } else { var string = decoder ? buffer + (decoder.end() || '') : Buffer.concat(buffer) done(null, string) } } function cleanup () { buffer = null stream.removeListener('aborted', onAborted) stream.removeListener('data', onData) stream.removeListener('end', onEnd) stream.removeListener('error', onEnd) stream.removeListener('close', cleanup) } } /***/ }), /* 1077 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * bytes * Copyright(c) 2012-2014 TJ Holowaychuk * Copyright(c) 2015 Jed Watson * MIT Licensed */ /** * Module exports. * @public */ module.exports = bytes; module.exports.format = format; module.exports.parse = parse; /** * Module variables. * @private */ var formatThousandsRegExp = /\B(?=(\d{3})+(?!\d))/g; var formatDecimalsRegExp = /(?:\.0*|(\.[^0]+)0+)$/; var map = { b: 1, kb: 1 << 10, mb: 1 << 20, gb: 1 << 30, tb: Math.pow(1024, 4), pb: Math.pow(1024, 5), }; var parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i; /** * Convert the given value in bytes into a string or parse to string to an integer in bytes. * * @param {string|number} value * @param {{ * case: [string], * decimalPlaces: [number] * fixedDecimals: [boolean] * thousandsSeparator: [string] * unitSeparator: [string] * }} [options] bytes options. * * @returns {string|number|null} */ function bytes(value, options) { if (typeof value === 'string') { return parse(value); } if (typeof value === 'number') { return format(value, options); } return null; } /** * Format the given value in bytes into a string. * * If the value is negative, it is kept as such. If it is a float, * it is rounded. * * @param {number} value * @param {object} [options] * @param {number} [options.decimalPlaces=2] * @param {number} [options.fixedDecimals=false] * @param {string} [options.thousandsSeparator=] * @param {string} [options.unit=] * @param {string} [options.unitSeparator=] * * @returns {string|null} * @public */ function format(value, options) { if (!Number.isFinite(value)) { return null; } var mag = Math.abs(value); var thousandsSeparator = (options && options.thousandsSeparator) || ''; var unitSeparator = (options && options.unitSeparator) || ''; var decimalPlaces = (options && options.decimalPlaces !== undefined) ? options.decimalPlaces : 2; var fixedDecimals = Boolean(options && options.fixedDecimals); var unit = (options && options.unit) || ''; if (!unit || !map[unit.toLowerCase()]) { if (mag >= map.pb) { unit = 'PB'; } else if (mag >= map.tb) { unit = 'TB'; } else if (mag >= map.gb) { unit = 'GB'; } else if (mag >= map.mb) { unit = 'MB'; } else if (mag >= map.kb) { unit = 'KB'; } else { unit = 'B'; } } var val = value / map[unit.toLowerCase()]; var str = val.toFixed(decimalPlaces); if (!fixedDecimals) { str = str.replace(formatDecimalsRegExp, '$1'); } if (thousandsSeparator) { str = str.replace(formatThousandsRegExp, thousandsSeparator); } return str + unitSeparator + unit; } /** * Parse the string value into an integer in bytes. * * If no unit is given, it is assumed the value is in bytes. * * @param {number|string} val * * @returns {number|null} * @public */ function parse(val) { if (typeof val === 'number' && !isNaN(val)) { return val; } if (typeof val !== 'string') { return null; } // Test if the string passed is valid var results = parseRegExp.exec(val); var floatValue; var unit = 'b'; if (!results) { // Nothing could be extracted from the given string floatValue = parseInt(val, 10); unit = 'b' } else { // Retrieve the value and the unit floatValue = parseFloat(results[1]); unit = results[4].toLowerCase(); } return Math.floor(map[unit] * floatValue); } /***/ }), /* 1078 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * http-errors * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2016 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var deprecate = __webpack_require__(1079)('http-errors') var setPrototypeOf = __webpack_require__(1083) var statuses = __webpack_require__(1084) var inherits = __webpack_require__(290) var toIdentifier = __webpack_require__(1086) /** * Module exports. * @public */ module.exports = createError module.exports.HttpError = createHttpErrorConstructor() // Populate exports for all constructors populateConstructorExports(module.exports, statuses.codes, module.exports.HttpError) /** * Get the code class of a status code. * @private */ function codeClass (status) { return Number(String(status).charAt(0) + '00') } /** * Create a new HTTP Error. * * @returns {Error} * @public */ function createError () { // so much arity going on ~_~ var err var msg var status = 500 var props = {} for (var i = 0; i < arguments.length; i++) { var arg = arguments[i] if (arg instanceof Error) { err = arg status = err.status || err.statusCode || status continue } switch (typeof arg) { case 'string': msg = arg break case 'number': status = arg if (i !== 0) { deprecate('non-first-argument status code; replace with createError(' + arg + ', ...)') } break case 'object': props = arg break } } if (typeof status === 'number' && (status < 400 || status >= 600)) { deprecate('non-error status code; use only 4xx or 5xx status codes') } if (typeof status !== 'number' || (!statuses[status] && (status < 400 || status >= 600))) { status = 500 } // constructor var HttpError = createError[status] || createError[codeClass(status)] if (!err) { // create error err = HttpError ? new HttpError(msg) : new Error(msg || statuses[status]) Error.captureStackTrace(err, createError) } if (!HttpError || !(err instanceof HttpError) || err.status !== status) { // add properties to generic error err.expose = status < 500 err.status = err.statusCode = status } for (var key in props) { if (key !== 'status' && key !== 'statusCode') { err[key] = props[key] } } return err } /** * Create HTTP error abstract base class. * @private */ function createHttpErrorConstructor () { function HttpError () { throw new TypeError('cannot construct abstract class') } inherits(HttpError, Error) return HttpError } /** * Create a constructor for a client error. * @private */ function createClientErrorConstructor (HttpError, name, code) { var className = name.match(/Error$/) ? name : name + 'Error' function ClientError (message) { // create the error object var msg = message != null ? message : statuses[code] var err = new Error(msg) // capture a stack trace to the construction point Error.captureStackTrace(err, ClientError) // adjust the [[Prototype]] setPrototypeOf(err, ClientError.prototype) // redefine the error message Object.defineProperty(err, 'message', { enumerable: true, configurable: true, value: msg, writable: true }) // redefine the error name Object.defineProperty(err, 'name', { enumerable: false, configurable: true, value: className, writable: true }) return err } inherits(ClientError, HttpError) nameFunc(ClientError, className) ClientError.prototype.status = code ClientError.prototype.statusCode = code ClientError.prototype.expose = true return ClientError } /** * Create a constructor for a server error. * @private */ function createServerErrorConstructor (HttpError, name, code) { var className = name.match(/Error$/) ? name : name + 'Error' function ServerError (message) { // create the error object var msg = message != null ? message : statuses[code] var err = new Error(msg) // capture a stack trace to the construction point Error.captureStackTrace(err, ServerError) // adjust the [[Prototype]] setPrototypeOf(err, ServerError.prototype) // redefine the error message Object.defineProperty(err, 'message', { enumerable: true, configurable: true, value: msg, writable: true }) // redefine the error name Object.defineProperty(err, 'name', { enumerable: false, configurable: true, value: className, writable: true }) return err } inherits(ServerError, HttpError) nameFunc(ServerError, className) ServerError.prototype.status = code ServerError.prototype.statusCode = code ServerError.prototype.expose = false return ServerError } /** * Set the name of a function, if possible. * @private */ function nameFunc (func, name) { var desc = Object.getOwnPropertyDescriptor(func, 'name') if (desc && desc.configurable) { desc.value = name Object.defineProperty(func, 'name', desc) } } /** * Populate the exports object with constructors for every error class. * @private */ function populateConstructorExports (exports, codes, HttpError) { codes.forEach(function forEachCode (code) { var CodeError var name = toIdentifier(statuses[code]) switch (codeClass(code)) { case 400: CodeError = createClientErrorConstructor(HttpError, name, code) break case 500: CodeError = createServerErrorConstructor(HttpError, name, code) break } if (CodeError) { // export the constructor exports[code] = CodeError exports[name] = CodeError } }) // backwards-compatibility exports["I'mateapot"] = deprecate.function(exports.ImATeapot, '"I\'mateapot"; use "ImATeapot" instead') } /***/ }), /* 1079 */ /***/ (function(module, exports, __webpack_require__) { /*! * depd * Copyright(c) 2014-2017 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. */ var callSiteToString = __webpack_require__(1080).callSiteToString var eventListenerCount = __webpack_require__(1080).eventListenerCount var relative = __webpack_require__(160).relative /** * Module exports. */ module.exports = depd /** * Get the path to base files on. */ var basePath = process.cwd() /** * Determine if namespace is contained in the string. */ function containsNamespace (str, namespace) { var vals = str.split(/[ ,]+/) var ns = String(namespace).toLowerCase() for (var i = 0; i < vals.length; i++) { var val = vals[i] // namespace contained if (val && (val === '*' || val.toLowerCase() === ns)) { return true } } return false } /** * Convert a data descriptor to accessor descriptor. */ function convertDataDescriptorToAccessor (obj, prop, message) { var descriptor = Object.getOwnPropertyDescriptor(obj, prop) var value = descriptor.value descriptor.get = function getter () { return value } if (descriptor.writable) { descriptor.set = function setter (val) { return (value = val) } } delete descriptor.value delete descriptor.writable Object.defineProperty(obj, prop, descriptor) return descriptor } /** * Create arguments string to keep arity. */ function createArgumentsString (arity) { var str = '' for (var i = 0; i < arity; i++) { str += ', arg' + i } return str.substr(2) } /** * Create stack string from stack. */ function createStackString (stack) { var str = this.name + ': ' + this.namespace if (this.message) { str += ' deprecated ' + this.message } for (var i = 0; i < stack.length; i++) { str += '\n at ' + callSiteToString(stack[i]) } return str } /** * Create deprecate for namespace in caller. */ function depd (namespace) { if (!namespace) { throw new TypeError('argument namespace is required') } var stack = getStack() var site = callSiteLocation(stack[1]) var file = site[0] function deprecate (message) { // call to self as log log.call(deprecate, message) } 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 return deprecate } /** * Determine if namespace is ignored. */ function isignored (namespace) { /* istanbul ignore next: tested in a child processs */ if (process.noDeprecation) { // --no-deprecation support return true } var str = process.env.NO_DEPRECATION || '' // namespace ignored return containsNamespace(str, namespace) } /** * Determine if namespace is traced. */ function istraced (namespace) { /* istanbul ignore next: tested in a child processs */ if (process.traceDeprecation) { // --trace-deprecation support return true } var str = process.env.TRACE_DEPRECATION || '' // namespace traced return containsNamespace(str, namespace) } /** * Display deprecation message. */ function log (message, site) { var haslisteners = eventListenerCount(process, 'deprecation') !== 0 // abort early if no destination if (!haslisteners && this._ignored) { return } var caller var callFile var callSite var depSite var i = 0 var seen = false var stack = getStack() var file = this._file if (site) { // provided site depSite = site callSite = callSiteLocation(stack[1]) callSite.name = depSite.name file = callSite[0] } else { // get call site i = 2 depSite = callSiteLocation(stack[i]) callSite = depSite } // get caller of deprecated thing in relation to file for (; i < stack.length; i++) { caller = callSiteLocation(stack[i]) callFile = caller[0] if (callFile === file) { seen = true } else if (callFile === this._file) { file = this._file } else if (seen) { break } } var key = caller ? depSite.join(':') + '__' + caller.join(':') : undefined if (key !== undefined && key in this._warned) { // already warned return } this._warned[key] = true // generate automatic message from call site var msg = message if (!msg) { msg = callSite === depSite || !callSite.name ? defaultMessage(depSite) : defaultMessage(callSite) } // emit deprecation if listeners exist if (haslisteners) { var err = DeprecationError(this._namespace, msg, stack.slice(i)) process.emit('deprecation', err) return } // format and write message var format = process.stderr.isTTY ? formatColor : formatPlain var output = format.call(this, msg, caller, stack.slice(i)) process.stderr.write(output + '\n', 'utf8') } /** * Get call site location as array. */ function callSiteLocation (callSite) { var file = callSite.getFileName() || '<anonymous>' var line = callSite.getLineNumber() var colm = callSite.getColumnNumber() if (callSite.isEval()) { file = callSite.getEvalOrigin() + ', ' + file } var site = [file, line, colm] site.callSite = callSite site.name = callSite.getFunctionName() return site } /** * Generate a default message from the site. */ function defaultMessage (site) { var callSite = site.callSite var funcName = site.name // make useful anonymous name if (!funcName) { funcName = '<anonymous@' + formatLocation(site) + '>' } var context = callSite.getThis() var typeName = context && callSite.getTypeName() // ignore useless type name if (typeName === 'Object') { typeName = undefined } // make useful type name if (typeName === 'Function') { typeName = context.name || typeName } return typeName && callSite.getMethodName() ? typeName + '.' + funcName : funcName } /** * Format deprecation message without color. */ function formatPlain (msg, caller, stack) { var timestamp = new Date().toUTCString() var formatted = timestamp + ' ' + this._namespace + ' deprecated ' + msg // add stack trace if (this._traced) { for (var i = 0; i < stack.length; i++) { formatted += '\n at ' + callSiteToString(stack[i]) } return formatted } if (caller) { formatted += ' at ' + formatLocation(caller) } return formatted } /** * Format deprecation message with color. */ function formatColor (msg, caller, stack) { var formatted = '\x1b[36;1m' + this._namespace + '\x1b[22;39m' + // bold cyan ' \x1b[33;1mdeprecated\x1b[22;39m' + // bold yellow ' \x1b[0m' + msg + '\x1b[39m' // reset // add stack trace if (this._traced) { for (var i = 0; i < stack.length; i++) { formatted += '\n \x1b[36mat ' + callSiteToString(stack[i]) + '\x1b[39m' // cyan } return formatted } if (caller) { formatted += ' \x1b[36m' + formatLocation(caller) + '\x1b[39m' // cyan } return formatted } /** * Format call site location. */ function formatLocation (callSite) { return relative(basePath, callSite[0]) + ':' + callSite[1] + ':' + callSite[2] } /** * Get the stack as array of call sites. */ function getStack () { var limit = Error.stackTraceLimit var obj = {} var prep = Error.prepareStackTrace Error.prepareStackTrace = prepareObjectStackTrace Error.stackTraceLimit = Math.max(10, limit) // capture the stack Error.captureStackTrace(obj) // slice this function off the top var stack = obj.stack.slice(1) Error.prepareStackTrace = prep Error.stackTraceLimit = limit return stack } /** * Capture call site stack from v8. */ function prepareObjectStackTrace (obj, stack) { return stack } /** * Return a wrapped function in a deprecation message. */ function wrapfunction (fn, message) { if (typeof fn !== 'function') { throw new TypeError('argument fn must be a function') } var args = createArgumentsString(fn.length) var deprecate = this // eslint-disable-line no-unused-vars var stack = getStack() var site = callSiteLocation(stack[1]) site.name = fn.name // eslint-disable-next-line no-eval var deprecatedfn = eval('(function (' + args + ') {\n' + '"use strict"\n' + 'log.call(deprecate, message, site)\n' + 'return fn.apply(this, arguments)\n' + '})') return deprecatedfn } /** * Wrap property in a deprecation message. */ function wrapproperty (obj, prop, message) { if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { 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 var stack = getStack() var site = callSiteLocation(stack[1]) // set site name site.name = prop // convert data descriptor if ('value' in descriptor) { descriptor = convertDataDescriptorToAccessor(obj, prop, message) } var get = descriptor.get var set = descriptor.set // wrap getter if (typeof get === 'function') { descriptor.get = function getter () { log.call(deprecate, message, site) return get.apply(this, arguments) } } // wrap setter if (typeof set === 'function') { descriptor.set = function setter () { log.call(deprecate, message, site) return set.apply(this, arguments) } } Object.defineProperty(obj, prop, descriptor) } /** * Create DeprecationError for deprecation */ function DeprecationError (namespace, message, stack) { var error = new Error() var stackString Object.defineProperty(error, 'constructor', { value: DeprecationError }) Object.defineProperty(error, 'message', { configurable: true, enumerable: false, value: message, writable: true }) Object.defineProperty(error, 'name', { enumerable: false, configurable: true, value: 'DeprecationError', writable: true }) Object.defineProperty(error, 'namespace', { configurable: true, enumerable: false, value: namespace, writable: true }) Object.defineProperty(error, 'stack', { configurable: true, enumerable: false, get: function () { if (stackString !== undefined) { return stackString } // prepare stack trace return (stackString = createStackString.call(this, stack)) }, set: function setter (val) { stackString = val } }) return error } /***/ }), /* 1080 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * depd * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var EventEmitter = __webpack_require__(268).EventEmitter /** * Module exports. * @public */ lazyProperty(module.exports, 'callSiteToString', function callSiteToString () { var limit = Error.stackTraceLimit var obj = {} var prep = Error.prepareStackTrace function prepareObjectStackTrace (obj, stack) { return stack } Error.prepareStackTrace = prepareObjectStackTrace Error.stackTraceLimit = 2 // capture the stack Error.captureStackTrace(obj) // slice the stack var stack = obj.stack.slice() Error.prepareStackTrace = prep Error.stackTraceLimit = limit return stack[0].toString ? toString : __webpack_require__(1081) }) lazyProperty(module.exports, 'eventListenerCount', function eventListenerCount () { return EventEmitter.listenerCount || __webpack_require__(1082) }) /** * Define a lazy property. */ function lazyProperty (obj, prop, getter) { function get () { var val = getter() Object.defineProperty(obj, prop, { configurable: true, enumerable: true, value: val }) return val } Object.defineProperty(obj, prop, { configurable: true, enumerable: true, get: get }) } /** * Call toString() on the obj */ function toString (obj) { return obj.toString() } /***/ }), /* 1081 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * depd * Copyright(c) 2014 Douglas Christopher Wilson * MIT Licensed */ /** * Module exports. */ module.exports = callSiteToString /** * Format a CallSite file location to a string. */ function callSiteFileLocation (callSite) { var fileName var fileLocation = '' if (callSite.isNative()) { fileLocation = 'native' } else if (callSite.isEval()) { fileName = callSite.getScriptNameOrSourceURL() if (!fileName) { fileLocation = callSite.getEvalOrigin() } } else { fileName = callSite.getFileName() } if (fileName) { fileLocation += fileName var lineNumber = callSite.getLineNumber() if (lineNumber != null) { fileLocation += ':' + lineNumber var columnNumber = callSite.getColumnNumber() if (columnNumber) { fileLocation += ':' + columnNumber } } } return fileLocation || 'unknown source' } /** * Format a CallSite to a string. */ function callSiteToString (callSite) { var addSuffix = true var fileLocation = callSiteFileLocation(callSite) var functionName = callSite.getFunctionName() var isConstructor = callSite.isConstructor() var isMethodCall = !(callSite.isToplevel() || isConstructor) var line = '' if (isMethodCall) { var methodName = callSite.getMethodName() var typeName = getConstructorName(callSite) if (functionName) { if (typeName && functionName.indexOf(typeName) !== 0) { line += typeName + '.' } line += functionName if (methodName && functionName.lastIndexOf('.' + methodName) !== functionName.length - methodName.length - 1) { line += ' [as ' + methodName + ']' } } else { line += typeName + '.' + (methodName || '<anonymous>') } } else if (isConstructor) { line += 'new ' + (functionName || '<anonymous>') } else if (functionName) { line += functionName } else { addSuffix = false line += fileLocation } if (addSuffix) { line += ' (' + fileLocation + ')' } return line } /** * Get constructor name of reviver. */ function getConstructorName (obj) { var receiver = obj.receiver return (receiver.constructor && receiver.constructor.name) || null } /***/ }), /* 1082 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * depd * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module exports. * @public */ module.exports = eventListenerCount /** * Get the count of listeners on an event emitter of a specific type. */ function eventListenerCount (emitter, type) { return emitter.listeners(type).length } /***/ }), /* 1083 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* eslint no-proto: 0 */ module.exports = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties) function setProtoOf (obj, proto) { obj.__proto__ = proto return obj } function mixinProperties (obj, proto) { for (var prop in proto) { if (!obj.hasOwnProperty(prop)) { obj[prop] = proto[prop] } } return obj } /***/ }), /* 1084 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * statuses * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2016 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var codes = __webpack_require__(1085) /** * Module exports. * @public */ module.exports = status // status code to message map status.STATUS_CODES = codes // array of status codes status.codes = populateStatusesMap(status, codes) // status codes for redirects status.redirect = { 300: true, 301: true, 302: true, 303: true, 305: true, 307: true, 308: true } // status codes for empty bodies status.empty = { 204: true, 205: true, 304: true } // status codes for when you should retry the request status.retry = { 502: true, 503: true, 504: true } /** * Populate the statuses map for given codes. * @private */ function populateStatusesMap (statuses, codes) { var arr = [] Object.keys(codes).forEach(function forEachCode (code) { var message = codes[code] var status = Number(code) // Populate properties statuses[status] = message statuses[message] = status statuses[message.toLowerCase()] = status // Add to array arr.push(status) }) return arr } /** * Get the status code. * * Given a number, this will throw if it is not a known status * code, otherwise the code will be returned. Given a string, * the string will be parsed for a number and return the code * if valid, otherwise will lookup the code assuming this is * the status message. * * @param {string|number} code * @returns {number} * @public */ function status (code) { if (typeof code === 'number') { if (!status[code]) throw new Error('invalid status code: ' + code) return code } if (typeof code !== 'string') { throw new TypeError('code must be a number or string') } // '403' var n = parseInt(code, 10) if (!isNaN(n)) { if (!status[n]) throw new Error('invalid status code: ' + n) return n } n = status[code.toLowerCase()] if (!n) throw new Error('invalid status message: "' + code + '"') return n } /***/ }), /* 1085 */ /***/ (function(module) { module.exports = JSON.parse("{\"100\":\"Continue\",\"101\":\"Switching Protocols\",\"102\":\"Processing\",\"103\":\"Early Hints\",\"200\":\"OK\",\"201\":\"Created\",\"202\":\"Accepted\",\"203\":\"Non-Authoritative Information\",\"204\":\"No Content\",\"205\":\"Reset Content\",\"206\":\"Partial Content\",\"207\":\"Multi-Status\",\"208\":\"Already Reported\",\"226\":\"IM Used\",\"300\":\"Multiple Choices\",\"301\":\"Moved Permanently\",\"302\":\"Found\",\"303\":\"See Other\",\"304\":\"Not Modified\",\"305\":\"Use Proxy\",\"306\":\"(Unused)\",\"307\":\"Temporary Redirect\",\"308\":\"Permanent Redirect\",\"400\":\"Bad Request\",\"401\":\"Unauthorized\",\"402\":\"Payment Required\",\"403\":\"Forbidden\",\"404\":\"Not Found\",\"405\":\"Method Not Allowed\",\"406\":\"Not Acceptable\",\"407\":\"Proxy Authentication Required\",\"408\":\"Request Timeout\",\"409\":\"Conflict\",\"410\":\"Gone\",\"411\":\"Length Required\",\"412\":\"Precondition Failed\",\"413\":\"Payload Too Large\",\"414\":\"URI Too Long\",\"415\":\"Unsupported Media Type\",\"416\":\"Range Not Satisfiable\",\"417\":\"Expectation Failed\",\"418\":\"I'm a teapot\",\"421\":\"Misdirected Request\",\"422\":\"Unprocessable Entity\",\"423\":\"Locked\",\"424\":\"Failed Dependency\",\"425\":\"Unordered Collection\",\"426\":\"Upgrade Required\",\"428\":\"Precondition Required\",\"429\":\"Too Many Requests\",\"431\":\"Request Header Fields Too Large\",\"451\":\"Unavailable For Legal Reasons\",\"500\":\"Internal Server Error\",\"501\":\"Not Implemented\",\"502\":\"Bad Gateway\",\"503\":\"Service Unavailable\",\"504\":\"Gateway Timeout\",\"505\":\"HTTP Version Not Supported\",\"506\":\"Variant Also Negotiates\",\"507\":\"Insufficient Storage\",\"508\":\"Loop Detected\",\"509\":\"Bandwidth Limit Exceeded\",\"510\":\"Not Extended\",\"511\":\"Network Authentication Required\"}"); /***/ }), /* 1086 */ /***/ (function(module, exports) { /*! * toidentifier * Copyright(c) 2016 Douglas Christopher Wilson * MIT Licensed */ /** * Module exports. * @public */ module.exports = toIdentifier /** * Trasform the given string into a JavaScript identifier * * @param {string} str * @returns {string} * @public */ function toIdentifier (str) { return str .split(' ') .map(function (token) { return token.slice(0, 1).toUpperCase() + token.slice(1) }) .join('') .replace(/[^ _0-9a-z]/gi, '') } /***/ }), /* 1087 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * unpipe * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module exports. * @public */ module.exports = unpipe /** * Determine if there are Node.js pipe-like data listeners. * @private */ function hasPipeDataListeners(stream) { var listeners = stream.listeners('data') for (var i = 0; i < listeners.length; i++) { if (listeners[i].name === 'ondata') { return true } } return false } /** * Unpipe a stream from all destinations. * * @param {object} stream * @public */ function unpipe(stream) { if (!stream) { throw new TypeError('argument stream is required') } if (typeof stream.unpipe === 'function') { // new-style stream.unpipe() return } // Node.js 0.8 hack if (!hasPipeDataListeners(stream)) { return } var listener var listeners = stream.listeners('close') for (var i = 0; i < listeners.length; i++) { listener = listeners[i] if (listener.name !== 'cleanup' && listener.name !== 'onclose') { continue } // invoke the listener listener.call(stream) } } /***/ }), /* 1088 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const singleComment = Symbol('singleComment'); const multiComment = Symbol('multiComment'); const stripWithoutWhitespace = () => ''; const stripWithWhitespace = (string, start, end) => string.slice(start, end).replace(/\S/g, ' '); const isEscaped = (jsonString, quotePosition) => { let index = quotePosition - 1; let backslashCount = 0; while (jsonString[index] === '\\') { index -= 1; backslashCount += 1; } return Boolean(backslashCount % 2); }; module.exports = (jsonString, options = {}) => { const strip = options.whitespace === false ? stripWithoutWhitespace : stripWithWhitespace; let insideString = false; let insideComment = false; let offset = 0; let result = ''; for (let i = 0; i < jsonString.length; i++) { const currentCharacter = jsonString[i]; const nextCharacter = jsonString[i + 1]; if (!insideComment && currentCharacter === '"') { const escaped = isEscaped(jsonString, i); if (!escaped) { insideString = !insideString; } } if (insideString) { continue; } if (!insideComment && currentCharacter + nextCharacter === '//') { result += jsonString.slice(offset, i); offset = i; insideComment = singleComment; i++; } else if (insideComment === singleComment && currentCharacter + nextCharacter === '\r\n') { i++; insideComment = false; result += strip(jsonString, offset, i); offset = i; continue; } else if (insideComment === singleComment && currentCharacter === '\n') { insideComment = false; result += strip(jsonString, offset, i); offset = i; } else if (!insideComment && currentCharacter + nextCharacter === '/*') { result += jsonString.slice(offset, i); offset = i; insideComment = multiComment; i++; continue; } else if (insideComment === multiComment && currentCharacter + nextCharacter === '*/') { i++; insideComment = false; result += strip(jsonString, offset, i + 1); offset = i + 1; continue; } } return result + (insideComment ? strip(jsonString.slice(offset)) : jsonString.slice(offset)); }; /***/ }), /* 1089 */ /***/ (function(module, exports, __webpack_require__) { var baseFlatten = __webpack_require__(599), baseOrderBy = __webpack_require__(1090), baseRest = __webpack_require__(377), isIterateeCall = __webpack_require__(385); /** * Creates an array of elements, sorted in ascending order by the results of * running each element in a collection thru each iteratee. This method * performs a stable sort, that is, it preserves the original sort order of * equal elements. The iteratees are invoked with one argument: (value). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {...(Function|Function[])} [iteratees=[_.identity]] * The iteratees to sort by. * @returns {Array} Returns the new sorted array. * @example * * var users = [ * { 'user': 'fred', 'age': 48 }, * { 'user': 'barney', 'age': 36 }, * { 'user': 'fred', 'age': 40 }, * { 'user': 'barney', 'age': 34 } * ]; * * _.sortBy(users, [function(o) { return o.user; }]); * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] * * _.sortBy(users, ['user', 'age']); * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] */ var sortBy = baseRest(function(collection, iteratees) { if (collection == null) { return []; } var length = iteratees.length; if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { iteratees = []; } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { iteratees = [iteratees[0]]; } return baseOrderBy(collection, baseFlatten(iteratees, 1), []); }); module.exports = sortBy; /***/ }), /* 1090 */ /***/ (function(module, exports, __webpack_require__) { var arrayMap = __webpack_require__(580), baseIteratee = __webpack_require__(543), baseMap = __webpack_require__(609), baseSortBy = __webpack_require__(1091), baseUnary = __webpack_require__(399), compareMultiple = __webpack_require__(1092), identity = __webpack_require__(378); /** * The base implementation of `_.orderBy` without param guards. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. * @param {string[]} orders The sort orders of `iteratees`. * @returns {Array} Returns the new sorted array. */ function baseOrderBy(collection, iteratees, orders) { var index = -1; iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee)); var result = baseMap(collection, function(value, key, collection) { var criteria = arrayMap(iteratees, function(iteratee) { return iteratee(value); }); return { 'criteria': criteria, 'index': ++index, 'value': value }; }); return baseSortBy(result, function(object, other) { return compareMultiple(object, other, orders); }); } module.exports = baseOrderBy; /***/ }), /* 1091 */ /***/ (function(module, exports) { /** * The base implementation of `_.sortBy` which uses `comparer` to define the * sort order of `array` and replaces criteria objects with their corresponding * values. * * @private * @param {Array} array The array to sort. * @param {Function} comparer The function to define sort order. * @returns {Array} Returns `array`. */ function baseSortBy(array, comparer) { var length = array.length; array.sort(comparer); while (length--) { array[length] = array[length].value; } return array; } module.exports = baseSortBy; /***/ }), /* 1092 */ /***/ (function(module, exports, __webpack_require__) { var compareAscending = __webpack_require__(1093); /** * Used by `_.orderBy` to compare multiple properties of a value to another * and stable sort them. * * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, * specify an order of "desc" for descending or "asc" for ascending sort order * of corresponding values. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {boolean[]|string[]} orders The order to sort by for each property. * @returns {number} Returns the sort order indicator for `object`. */ function compareMultiple(object, other, orders) { var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length; while (++index < length) { var result = compareAscending(objCriteria[index], othCriteria[index]); if (result) { if (index >= ordersLength) { return result; } var order = orders[index]; return result * (order == 'desc' ? -1 : 1); } } // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications // that causes it, under certain circumstances, to provide the same value for // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 // for more details. // // This also ensures a stable sort in V8 and other engines. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. return object.index - other.index; } module.exports = compareMultiple; /***/ }), /* 1093 */ /***/ (function(module, exports, __webpack_require__) { var isSymbol = __webpack_require__(457); /** * Compares values to sort them in ascending order. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {number} Returns the sort order indicator for `value`. */ function compareAscending(value, other) { if (value !== other) { var valIsDefined = value !== undefined, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value); var othIsDefined = other !== undefined, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other); if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || (valIsNull && othIsDefined && othIsReflexive) || (!valIsDefined && othIsReflexive) || !valIsReflexive) { return 1; } if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || (othIsNull && valIsDefined && valIsReflexive) || (!othIsDefined && valIsReflexive) || !othIsReflexive) { return -1; } } return 0; } module.exports = compareAscending; /***/ }), /* 1094 */ /***/ (function(module, exports, __webpack_require__) { var createRange = __webpack_require__(1095); /** * Creates an array of numbers (positive and/or negative) progressing from * `start` up to, but not including, `end`. A step of `-1` is used if a negative * `start` is specified without an `end` or `step`. If `end` is not specified, * it's set to `start` with `start` then set to `0`. * * **Note:** JavaScript follows the IEEE-754 standard for resolving * floating-point values which can produce unexpected results. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {number} [start=0] The start of the range. * @param {number} end The end of the range. * @param {number} [step=1] The value to increment or decrement by. * @returns {Array} Returns the range of numbers. * @see _.inRange, _.rangeRight * @example * * _.range(4); * // => [0, 1, 2, 3] * * _.range(-4); * // => [0, -1, -2, -3] * * _.range(1, 5); * // => [1, 2, 3, 4] * * _.range(0, 20, 5); * // => [0, 5, 10, 15] * * _.range(0, -4, -1); * // => [0, -1, -2, -3] * * _.range(1, 4, 0); * // => [1, 1, 1] * * _.range(0); * // => [] */ var range = createRange(); module.exports = range; /***/ }), /* 1095 */ /***/ (function(module, exports, __webpack_require__) { var baseRange = __webpack_require__(1096), isIterateeCall = __webpack_require__(385), toFinite = __webpack_require__(455); /** * Creates a `_.range` or `_.rangeRight` function. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new range function. */ function createRange(fromRight) { return function(start, end, step) { if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { end = step = undefined; } // Ensure the sign of `-0` is preserved. start = toFinite(start); if (end === undefined) { end = start; start = 0; } else { end = toFinite(end); } step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); return baseRange(start, end, step, fromRight); }; } module.exports = createRange; /***/ }), /* 1096 */ /***/ (function(module, exports) { /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeCeil = Math.ceil, nativeMax = Math.max; /** * The base implementation of `_.range` and `_.rangeRight` which doesn't * coerce arguments. * * @private * @param {number} start The start of the range. * @param {number} end The end of the range. * @param {number} step The value to increment or decrement by. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Array} Returns the range of numbers. */ function baseRange(start, end, step, fromRight) { var index = -1, length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), result = Array(length); while (length--) { result[fromRight ? length : ++index] = start; start += step; } return result; } module.exports = baseRange; /***/ }), /* 1097 */ /***/ (function(module, exports, __webpack_require__) { var getDayOfYear = __webpack_require__(1098) var getISOWeek = __webpack_require__(1105) var getISOYear = __webpack_require__(1109) var parse = __webpack_require__(1099) var isValid = __webpack_require__(1110) var enLocale = __webpack_require__(1111) /** * @category Common Helpers * @summary Format the date. * * @description * Return the formatted date string in the given format. * * Accepted tokens: * | Unit | Token | Result examples | * |-------------------------|-------|----------------------------------| * | Month | M | 1, 2, ..., 12 | * | | Mo | 1st, 2nd, ..., 12th | * | | MM | 01, 02, ..., 12 | * | | MMM | Jan, Feb, ..., Dec | * | | MMMM | January, February, ..., December | * | Quarter | Q | 1, 2, 3, 4 | * | | Qo | 1st, 2nd, 3rd, 4th | * | Day of month | D | 1, 2, ..., 31 | * | | Do | 1st, 2nd, ..., 31st | * | | DD | 01, 02, ..., 31 | * | Day of year | DDD | 1, 2, ..., 366 | * | | DDDo | 1st, 2nd, ..., 366th | * | | DDDD | 001, 002, ..., 366 | * | Day of week | d | 0, 1, ..., 6 | * | | do | 0th, 1st, ..., 6th | * | | dd | Su, Mo, ..., Sa | * | | ddd | Sun, Mon, ..., Sat | * | | dddd | Sunday, Monday, ..., Saturday | * | Day of ISO week | E | 1, 2, ..., 7 | * | ISO week | W | 1, 2, ..., 53 | * | | Wo | 1st, 2nd, ..., 53rd | * | | WW | 01, 02, ..., 53 | * | Year | YY | 00, 01, ..., 99 | * | | YYYY | 1900, 1901, ..., 2099 | * | ISO week-numbering year | GG | 00, 01, ..., 99 | * | | GGGG | 1900, 1901, ..., 2099 | * | AM/PM | A | AM, PM | * | | a | am, pm | * | | aa | a.m., p.m. | * | Hour | H | 0, 1, ... 23 | * | | HH | 00, 01, ... 23 | * | | h | 1, 2, ..., 12 | * | | hh | 01, 02, ..., 12 | * | Minute | m | 0, 1, ..., 59 | * | | mm | 00, 01, ..., 59 | * | Second | s | 0, 1, ..., 59 | * | | ss | 00, 01, ..., 59 | * | 1/10 of second | S | 0, 1, ..., 9 | * | 1/100 of second | SS | 00, 01, ..., 99 | * | Millisecond | SSS | 000, 001, ..., 999 | * | Timezone | Z | -01:00, +00:00, ... +12:00 | * | | ZZ | -0100, +0000, ..., +1200 | * | Seconds timestamp | X | 512969520 | * | Milliseconds timestamp | x | 512969520900 | * * The characters wrapped in square brackets are escaped. * * The result may vary by locale. * * @param {Date|String|Number} date - the original date * @param {String} [format='YYYY-MM-DDTHH:mm:ss.SSSZ'] - the string of tokens * @param {Object} [options] - the object with options * @param {Object} [options.locale=enLocale] - the locale object * @returns {String} the formatted date string * * @example * // Represent 11 February 2014 in middle-endian format: * var result = format( * new Date(2014, 1, 11), * 'MM/DD/YYYY' * ) * //=> '02/11/2014' * * @example * // Represent 2 July 2014 in Esperanto: * var eoLocale = require('date-fns/locale/eo') * var result = format( * new Date(2014, 6, 2), * 'Do [de] MMMM YYYY', * {locale: eoLocale} * ) * //=> '2-a de julio 2014' */ function format (dirtyDate, dirtyFormatStr, dirtyOptions) { var formatStr = dirtyFormatStr ? String(dirtyFormatStr) : 'YYYY-MM-DDTHH:mm:ss.SSSZ' var options = dirtyOptions || {} var locale = options.locale var localeFormatters = enLocale.format.formatters var formattingTokensRegExp = enLocale.format.formattingTokensRegExp if (locale && locale.format && locale.format.formatters) { localeFormatters = locale.format.formatters if (locale.format.formattingTokensRegExp) { formattingTokensRegExp = locale.format.formattingTokensRegExp } } var date = parse(dirtyDate) if (!isValid(date)) { return 'Invalid Date' } var formatFn = buildFormatFn(formatStr, localeFormatters, formattingTokensRegExp) return formatFn(date) } var formatters = { // Month: 1, 2, ..., 12 'M': function (date) { return date.getMonth() + 1 }, // Month: 01, 02, ..., 12 'MM': function (date) { return addLeadingZeros(date.getMonth() + 1, 2) }, // Quarter: 1, 2, 3, 4 'Q': function (date) { return Math.ceil((date.getMonth() + 1) / 3) }, // Day of month: 1, 2, ..., 31 'D': function (date) { return date.getDate() }, // Day of month: 01, 02, ..., 31 'DD': function (date) { return addLeadingZeros(date.getDate(), 2) }, // Day of year: 1, 2, ..., 366 'DDD': function (date) { return getDayOfYear(date) }, // Day of year: 001, 002, ..., 366 'DDDD': function (date) { return addLeadingZeros(getDayOfYear(date), 3) }, // Day of week: 0, 1, ..., 6 'd': function (date) { return date.getDay() }, // Day of ISO week: 1, 2, ..., 7 'E': function (date) { return date.getDay() || 7 }, // ISO week: 1, 2, ..., 53 'W': function (date) { return getISOWeek(date) }, // ISO week: 01, 02, ..., 53 'WW': function (date) { return addLeadingZeros(getISOWeek(date), 2) }, // Year: 00, 01, ..., 99 'YY': function (date) { return addLeadingZeros(date.getFullYear(), 4).substr(2) }, // Year: 1900, 1901, ..., 2099 'YYYY': function (date) { return addLeadingZeros(date.getFullYear(), 4) }, // ISO week-numbering year: 00, 01, ..., 99 'GG': function (date) { return String(getISOYear(date)).substr(2) }, // ISO week-numbering year: 1900, 1901, ..., 2099 'GGGG': function (date) { return getISOYear(date) }, // Hour: 0, 1, ... 23 'H': function (date) { return date.getHours() }, // Hour: 00, 01, ..., 23 'HH': function (date) { return addLeadingZeros(date.getHours(), 2) }, // Hour: 1, 2, ..., 12 'h': function (date) { var hours = date.getHours() if (hours === 0) { return 12 } else if (hours > 12) { return hours % 12 } else { return hours } }, // Hour: 01, 02, ..., 12 'hh': function (date) { return addLeadingZeros(formatters['h'](date), 2) }, // Minute: 0, 1, ..., 59 'm': function (date) { return date.getMinutes() }, // Minute: 00, 01, ..., 59 'mm': function (date) { return addLeadingZeros(date.getMinutes(), 2) }, // Second: 0, 1, ..., 59 's': function (date) { return date.getSeconds() }, // Second: 00, 01, ..., 59 'ss': function (date) { return addLeadingZeros(date.getSeconds(), 2) }, // 1/10 of second: 0, 1, ..., 9 'S': function (date) { return Math.floor(date.getMilliseconds() / 100) }, // 1/100 of second: 00, 01, ..., 99 'SS': function (date) { return addLeadingZeros(Math.floor(date.getMilliseconds() / 10), 2) }, // Millisecond: 000, 001, ..., 999 'SSS': function (date) { return addLeadingZeros(date.getMilliseconds(), 3) }, // Timezone: -01:00, +00:00, ... +12:00 'Z': function (date) { return formatTimezone(date.getTimezoneOffset(), ':') }, // Timezone: -0100, +0000, ... +1200 'ZZ': function (date) { return formatTimezone(date.getTimezoneOffset()) }, // Seconds timestamp: 512969520 'X': function (date) { return Math.floor(date.getTime() / 1000) }, // Milliseconds timestamp: 512969520900 'x': function (date) { return date.getTime() } } function buildFormatFn (formatStr, localeFormatters, formattingTokensRegExp) { var array = formatStr.match(formattingTokensRegExp) var length = array.length var i var formatter for (i = 0; i < length; i++) { formatter = localeFormatters[array[i]] || formatters[array[i]] if (formatter) { array[i] = formatter } else { array[i] = removeFormattingTokens(array[i]) } } return function (date) { var output = '' for (var i = 0; i < length; i++) { if (array[i] instanceof Function) { output += array[i](date, formatters) } else { output += array[i] } } return output } } function removeFormattingTokens (input) { if (input.match(/\[[\s\S]/)) { return input.replace(/^\[|]$/g, '') } return input.replace(/\\/g, '') } function formatTimezone (offset, delimeter) { delimeter = delimeter || '' var sign = offset > 0 ? '-' : '+' var absOffset = Math.abs(offset) var hours = Math.floor(absOffset / 60) var minutes = absOffset % 60 return sign + addLeadingZeros(hours, 2) + delimeter + addLeadingZeros(minutes, 2) } function addLeadingZeros (number, targetLength) { var output = Math.abs(number).toString() while (output.length < targetLength) { output = '0' + output } return output } module.exports = format /***/ }), /* 1098 */ /***/ (function(module, exports, __webpack_require__) { var parse = __webpack_require__(1099) var startOfYear = __webpack_require__(1102) var differenceInCalendarDays = __webpack_require__(1103) /** * @category Day Helpers * @summary Get the day of the year of the given date. * * @description * Get the day of the year of the given date. * * @param {Date|String|Number} date - the given date * @returns {Number} the day of year * * @example * // Which day of the year is 2 July 2014? * var result = getDayOfYear(new Date(2014, 6, 2)) * //=> 183 */ function getDayOfYear (dirtyDate) { var date = parse(dirtyDate) var diff = differenceInCalendarDays(date, startOfYear(date)) var dayOfYear = diff + 1 return dayOfYear } module.exports = getDayOfYear /***/ }), /* 1099 */ /***/ (function(module, exports, __webpack_require__) { var getTimezoneOffsetInMilliseconds = __webpack_require__(1100) var isDate = __webpack_require__(1101) var MILLISECONDS_IN_HOUR = 3600000 var MILLISECONDS_IN_MINUTE = 60000 var DEFAULT_ADDITIONAL_DIGITS = 2 var parseTokenDateTimeDelimeter = /[T ]/ var parseTokenPlainTime = /:/ // year tokens var parseTokenYY = /^(\d{2})$/ var parseTokensYYY = [ /^([+-]\d{2})$/, // 0 additional digits /^([+-]\d{3})$/, // 1 additional digit /^([+-]\d{4})$/ // 2 additional digits ] var parseTokenYYYY = /^(\d{4})/ var parseTokensYYYYY = [ /^([+-]\d{4})/, // 0 additional digits /^([+-]\d{5})/, // 1 additional digit /^([+-]\d{6})/ // 2 additional digits ] // date tokens var parseTokenMM = /^-(\d{2})$/ var parseTokenDDD = /^-?(\d{3})$/ var parseTokenMMDD = /^-?(\d{2})-?(\d{2})$/ var parseTokenWww = /^-?W(\d{2})$/ var parseTokenWwwD = /^-?W(\d{2})-?(\d{1})$/ // time tokens var parseTokenHH = /^(\d{2}([.,]\d*)?)$/ var parseTokenHHMM = /^(\d{2}):?(\d{2}([.,]\d*)?)$/ var parseTokenHHMMSS = /^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/ // timezone tokens var parseTokenTimezone = /([Z+-].*)$/ var parseTokenTimezoneZ = /^(Z)$/ var parseTokenTimezoneHH = /^([+-])(\d{2})$/ var parseTokenTimezoneHHMM = /^([+-])(\d{2}):?(\d{2})$/ /** * @category Common Helpers * @summary Convert the given argument to an instance of Date. * * @description * Convert the given argument to an instance of Date. * * If the argument is an instance of Date, the function returns its clone. * * If the argument is a number, it is treated as a timestamp. * * If an argument is a string, the function tries to parse it. * Function accepts complete ISO 8601 formats as well as partial implementations. * ISO 8601: http://en.wikipedia.org/wiki/ISO_8601 * * If all above fails, the function passes the given argument to Date constructor. * * @param {Date|String|Number} argument - the value to convert * @param {Object} [options] - the object with options * @param {0 | 1 | 2} [options.additionalDigits=2] - the additional number of digits in the extended year format * @returns {Date} the parsed date in the local time zone * * @example * // Convert string '2014-02-11T11:30:30' to date: * var result = parse('2014-02-11T11:30:30') * //=> Tue Feb 11 2014 11:30:30 * * @example * // Parse string '+02014101', * // if the additional number of digits in the extended year format is 1: * var result = parse('+02014101', {additionalDigits: 1}) * //=> Fri Apr 11 2014 00:00:00 */ function parse (argument, dirtyOptions) { if (isDate(argument)) { // Prevent the date to lose the milliseconds when passed to new Date() in IE10 return new Date(argument.getTime()) } else if (typeof argument !== 'string') { return new Date(argument) } var options = dirtyOptions || {} var additionalDigits = options.additionalDigits if (additionalDigits == null) { additionalDigits = DEFAULT_ADDITIONAL_DIGITS } else { additionalDigits = Number(additionalDigits) } var dateStrings = splitDateString(argument) var parseYearResult = parseYear(dateStrings.date, additionalDigits) var year = parseYearResult.year var restDateString = parseYearResult.restDateString var date = parseDate(restDateString, year) if (date) { var timestamp = date.getTime() var time = 0 var offset if (dateStrings.time) { time = parseTime(dateStrings.time) } if (dateStrings.timezone) { offset = parseTimezone(dateStrings.timezone) * MILLISECONDS_IN_MINUTE } else { var fullTime = timestamp + time var fullTimeDate = new Date(fullTime) offset = getTimezoneOffsetInMilliseconds(fullTimeDate) // Adjust time when it's coming from DST var fullTimeDateNextDay = new Date(fullTime) fullTimeDateNextDay.setDate(fullTimeDate.getDate() + 1) var offsetDiff = getTimezoneOffsetInMilliseconds(fullTimeDateNextDay) - getTimezoneOffsetInMilliseconds(fullTimeDate) if (offsetDiff > 0) { offset += offsetDiff } } return new Date(timestamp + time + offset) } else { return new Date(argument) } } function splitDateString (dateString) { var dateStrings = {} var array = dateString.split(parseTokenDateTimeDelimeter) var timeString if (parseTokenPlainTime.test(array[0])) { dateStrings.date = null timeString = array[0] } else { dateStrings.date = array[0] timeString = array[1] } if (timeString) { var token = parseTokenTimezone.exec(timeString) if (token) { dateStrings.time = timeString.replace(token[1], '') dateStrings.timezone = token[1] } else { dateStrings.time = timeString } } return dateStrings } function parseYear (dateString, additionalDigits) { var parseTokenYYY = parseTokensYYY[additionalDigits] var parseTokenYYYYY = parseTokensYYYYY[additionalDigits] var token // YYYY or ±YYYYY token = parseTokenYYYY.exec(dateString) || parseTokenYYYYY.exec(dateString) if (token) { var yearString = token[1] return { year: parseInt(yearString, 10), restDateString: dateString.slice(yearString.length) } } // YY or ±YYY token = parseTokenYY.exec(dateString) || parseTokenYYY.exec(dateString) if (token) { var centuryString = token[1] return { year: parseInt(centuryString, 10) * 100, restDateString: dateString.slice(centuryString.length) } } // Invalid ISO-formatted year return { year: null } } function parseDate (dateString, year) { // Invalid ISO-formatted year if (year === null) { return null } var token var date var month var week // YYYY if (dateString.length === 0) { date = new Date(0) date.setUTCFullYear(year) return date } // YYYY-MM token = parseTokenMM.exec(dateString) if (token) { date = new Date(0) month = parseInt(token[1], 10) - 1 date.setUTCFullYear(year, month) return date } // YYYY-DDD or YYYYDDD token = parseTokenDDD.exec(dateString) if (token) { date = new Date(0) var dayOfYear = parseInt(token[1], 10) date.setUTCFullYear(year, 0, dayOfYear) return date } // YYYY-MM-DD or YYYYMMDD token = parseTokenMMDD.exec(dateString) if (token) { date = new Date(0) month = parseInt(token[1], 10) - 1 var day = parseInt(token[2], 10) date.setUTCFullYear(year, month, day) return date } // YYYY-Www or YYYYWww token = parseTokenWww.exec(dateString) if (token) { week = parseInt(token[1], 10) - 1 return dayOfISOYear(year, week) } // YYYY-Www-D or YYYYWwwD token = parseTokenWwwD.exec(dateString) if (token) { week = parseInt(token[1], 10) - 1 var dayOfWeek = parseInt(token[2], 10) - 1 return dayOfISOYear(year, week, dayOfWeek) } // Invalid ISO-formatted date return null } function parseTime (timeString) { var token var hours var minutes // hh token = parseTokenHH.exec(timeString) if (token) { hours = parseFloat(token[1].replace(',', '.')) return (hours % 24) * MILLISECONDS_IN_HOUR } // hh:mm or hhmm token = parseTokenHHMM.exec(timeString) if (token) { hours = parseInt(token[1], 10) minutes = parseFloat(token[2].replace(',', '.')) return (hours % 24) * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE } // hh:mm:ss or hhmmss token = parseTokenHHMMSS.exec(timeString) if (token) { hours = parseInt(token[1], 10) minutes = parseInt(token[2], 10) var seconds = parseFloat(token[3].replace(',', '.')) return (hours % 24) * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE + seconds * 1000 } // Invalid ISO-formatted time return null } function parseTimezone (timezoneString) { var token var absoluteOffset // Z token = parseTokenTimezoneZ.exec(timezoneString) if (token) { return 0 } // ±hh token = parseTokenTimezoneHH.exec(timezoneString) if (token) { absoluteOffset = parseInt(token[2], 10) * 60 return (token[1] === '+') ? -absoluteOffset : absoluteOffset } // ±hh:mm or ±hhmm token = parseTokenTimezoneHHMM.exec(timezoneString) if (token) { absoluteOffset = parseInt(token[2], 10) * 60 + parseInt(token[3], 10) return (token[1] === '+') ? -absoluteOffset : absoluteOffset } return 0 } function dayOfISOYear (isoYear, week, day) { week = week || 0 day = day || 0 var date = new Date(0) date.setUTCFullYear(isoYear, 0, 4) var fourthOfJanuaryDay = date.getUTCDay() || 7 var diff = week * 7 + day + 1 - fourthOfJanuaryDay date.setUTCDate(date.getUTCDate() + diff) return date } module.exports = parse /***/ }), /* 1100 */ /***/ (function(module, exports) { var MILLISECONDS_IN_MINUTE = 60000 /** * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds. * They usually appear for dates that denote time before the timezones were introduced * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891 * and GMT+01:00:00 after that date) * * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above, * which would lead to incorrect calculations. * * This function returns the timezone offset in milliseconds that takes seconds in account. */ module.exports = function getTimezoneOffsetInMilliseconds (dirtyDate) { var date = new Date(dirtyDate.getTime()) var baseTimezoneOffset = date.getTimezoneOffset() date.setSeconds(0, 0) var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset } /***/ }), /* 1101 */ /***/ (function(module, exports) { /** * @category Common Helpers * @summary Is the given argument an instance of Date? * * @description * Is the given argument an instance of Date? * * @param {*} argument - the argument to check * @returns {Boolean} the given argument is an instance of Date * * @example * // Is 'mayonnaise' a Date? * var result = isDate('mayonnaise') * //=> false */ function isDate (argument) { return argument instanceof Date } module.exports = isDate /***/ }), /* 1102 */ /***/ (function(module, exports, __webpack_require__) { var parse = __webpack_require__(1099) /** * @category Year Helpers * @summary Return the start of a year for the given date. * * @description * Return the start of a year for the given date. * The result will be in the local timezone. * * @param {Date|String|Number} date - the original date * @returns {Date} the start of a year * * @example * // The start of a year for 2 September 2014 11:55:00: * var result = startOfYear(new Date(2014, 8, 2, 11, 55, 00)) * //=> Wed Jan 01 2014 00:00:00 */ function startOfYear (dirtyDate) { var cleanDate = parse(dirtyDate) var date = new Date(0) date.setFullYear(cleanDate.getFullYear(), 0, 1) date.setHours(0, 0, 0, 0) return date } module.exports = startOfYear /***/ }), /* 1103 */ /***/ (function(module, exports, __webpack_require__) { var startOfDay = __webpack_require__(1104) var MILLISECONDS_IN_MINUTE = 60000 var MILLISECONDS_IN_DAY = 86400000 /** * @category Day Helpers * @summary Get the number of calendar days between the given dates. * * @description * Get the number of calendar days between the given dates. * * @param {Date|String|Number} dateLeft - the later date * @param {Date|String|Number} dateRight - the earlier date * @returns {Number} the number of calendar days * * @example * // How many calendar days are between * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00? * var result = differenceInCalendarDays( * new Date(2012, 6, 2, 0, 0), * new Date(2011, 6, 2, 23, 0) * ) * //=> 366 */ function differenceInCalendarDays (dirtyDateLeft, dirtyDateRight) { var startOfDayLeft = startOfDay(dirtyDateLeft) var startOfDayRight = startOfDay(dirtyDateRight) var timestampLeft = startOfDayLeft.getTime() - startOfDayLeft.getTimezoneOffset() * MILLISECONDS_IN_MINUTE var timestampRight = startOfDayRight.getTime() - startOfDayRight.getTimezoneOffset() * MILLISECONDS_IN_MINUTE // Round the number of days to the nearest integer // because the number of milliseconds in a day is not constant // (e.g. it's different in the day of the daylight saving time clock shift) return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_DAY) } module.exports = differenceInCalendarDays /***/ }), /* 1104 */ /***/ (function(module, exports, __webpack_require__) { var parse = __webpack_require__(1099) /** * @category Day Helpers * @summary Return the start of a day for the given date. * * @description * Return the start of a day for the given date. * The result will be in the local timezone. * * @param {Date|String|Number} date - the original date * @returns {Date} the start of a day * * @example * // The start of a day for 2 September 2014 11:55:00: * var result = startOfDay(new Date(2014, 8, 2, 11, 55, 0)) * //=> Tue Sep 02 2014 00:00:00 */ function startOfDay (dirtyDate) { var date = parse(dirtyDate) date.setHours(0, 0, 0, 0) return date } module.exports = startOfDay /***/ }), /* 1105 */ /***/ (function(module, exports, __webpack_require__) { var parse = __webpack_require__(1099) var startOfISOWeek = __webpack_require__(1106) var startOfISOYear = __webpack_require__(1108) var MILLISECONDS_IN_WEEK = 604800000 /** * @category ISO Week Helpers * @summary Get the ISO week of the given date. * * @description * Get the ISO week of the given date. * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * @param {Date|String|Number} date - the given date * @returns {Number} the ISO week * * @example * // Which week of the ISO-week numbering year is 2 January 2005? * var result = getISOWeek(new Date(2005, 0, 2)) * //=> 53 */ function getISOWeek (dirtyDate) { var date = parse(dirtyDate) var diff = startOfISOWeek(date).getTime() - startOfISOYear(date).getTime() // Round the number of days to the nearest integer // because the number of milliseconds in a week is not constant // (e.g. it's different in the week of the daylight saving time clock shift) return Math.round(diff / MILLISECONDS_IN_WEEK) + 1 } module.exports = getISOWeek /***/ }), /* 1106 */ /***/ (function(module, exports, __webpack_require__) { var startOfWeek = __webpack_require__(1107) /** * @category ISO Week Helpers * @summary Return the start of an ISO week for the given date. * * @description * Return the start of an ISO week for the given date. * The result will be in the local timezone. * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * @param {Date|String|Number} date - the original date * @returns {Date} the start of an ISO week * * @example * // The start of an ISO week for 2 September 2014 11:55:00: * var result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0)) * //=> Mon Sep 01 2014 00:00:00 */ function startOfISOWeek (dirtyDate) { return startOfWeek(dirtyDate, {weekStartsOn: 1}) } module.exports = startOfISOWeek /***/ }), /* 1107 */ /***/ (function(module, exports, __webpack_require__) { var parse = __webpack_require__(1099) /** * @category Week Helpers * @summary Return the start of a week for the given date. * * @description * Return the start of a week for the given date. * The result will be in the local timezone. * * @param {Date|String|Number} date - the original date * @param {Object} [options] - the object with options * @param {Number} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) * @returns {Date} the start of a week * * @example * // The start of a week for 2 September 2014 11:55:00: * var result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0)) * //=> Sun Aug 31 2014 00:00:00 * * @example * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00: * var result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), {weekStartsOn: 1}) * //=> Mon Sep 01 2014 00:00:00 */ function startOfWeek (dirtyDate, dirtyOptions) { var weekStartsOn = dirtyOptions ? (Number(dirtyOptions.weekStartsOn) || 0) : 0 var date = parse(dirtyDate) var day = date.getDay() var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn date.setDate(date.getDate() - diff) date.setHours(0, 0, 0, 0) return date } module.exports = startOfWeek /***/ }), /* 1108 */ /***/ (function(module, exports, __webpack_require__) { var getISOYear = __webpack_require__(1109) var startOfISOWeek = __webpack_require__(1106) /** * @category ISO Week-Numbering Year Helpers * @summary Return the start of an ISO week-numbering year for the given date. * * @description * Return the start of an ISO week-numbering year, * which always starts 3 days before the year's first Thursday. * The result will be in the local timezone. * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * @param {Date|String|Number} date - the original date * @returns {Date} the start of an ISO year * * @example * // The start of an ISO week-numbering year for 2 July 2005: * var result = startOfISOYear(new Date(2005, 6, 2)) * //=> Mon Jan 03 2005 00:00:00 */ function startOfISOYear (dirtyDate) { var year = getISOYear(dirtyDate) var fourthOfJanuary = new Date(0) fourthOfJanuary.setFullYear(year, 0, 4) fourthOfJanuary.setHours(0, 0, 0, 0) var date = startOfISOWeek(fourthOfJanuary) return date } module.exports = startOfISOYear /***/ }), /* 1109 */ /***/ (function(module, exports, __webpack_require__) { var parse = __webpack_require__(1099) var startOfISOWeek = __webpack_require__(1106) /** * @category ISO Week-Numbering Year Helpers * @summary Get the ISO week-numbering year of the given date. * * @description * Get the ISO week-numbering year of the given date, * which always starts 3 days before the year's first Thursday. * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * @param {Date|String|Number} date - the given date * @returns {Number} the ISO week-numbering year * * @example * // Which ISO-week numbering year is 2 January 2005? * var result = getISOYear(new Date(2005, 0, 2)) * //=> 2004 */ function getISOYear (dirtyDate) { var date = parse(dirtyDate) var year = date.getFullYear() var fourthOfJanuaryOfNextYear = new Date(0) fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4) fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0) var startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear) var fourthOfJanuaryOfThisYear = new Date(0) fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4) fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0) var startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear) if (date.getTime() >= startOfNextYear.getTime()) { return year + 1 } else if (date.getTime() >= startOfThisYear.getTime()) { return year } else { return year - 1 } } module.exports = getISOYear /***/ }), /* 1110 */ /***/ (function(module, exports, __webpack_require__) { var isDate = __webpack_require__(1101) /** * @category Common Helpers * @summary Is the given date valid? * * @description * Returns false if argument is Invalid Date and true otherwise. * Invalid Date is a Date, whose time value is NaN. * * Time value of Date: http://es5.github.io/#x15.9.1.1 * * @param {Date} date - the date to check * @returns {Boolean} the date is valid * @throws {TypeError} argument must be an instance of Date * * @example * // For the valid date: * var result = isValid(new Date(2014, 1, 31)) * //=> true * * @example * // For the invalid date: * var result = isValid(new Date('')) * //=> false */ function isValid (dirtyDate) { if (isDate(dirtyDate)) { return !isNaN(dirtyDate) } else { throw new TypeError(toString.call(dirtyDate) + ' is not an instance of Date') } } module.exports = isValid /***/ }), /* 1111 */ /***/ (function(module, exports, __webpack_require__) { var buildDistanceInWordsLocale = __webpack_require__(1112) var buildFormatLocale = __webpack_require__(1113) /** * @category Locales * @summary English locale. */ module.exports = { distanceInWords: buildDistanceInWordsLocale(), format: buildFormatLocale() } /***/ }), /* 1112 */ /***/ (function(module, exports) { function buildDistanceInWordsLocale () { var distanceInWordsLocale = { lessThanXSeconds: { one: 'less than a second', other: 'less than {{count}} seconds' }, xSeconds: { one: '1 second', other: '{{count}} seconds' }, halfAMinute: 'half a minute', lessThanXMinutes: { one: 'less than a minute', other: 'less than {{count}} minutes' }, xMinutes: { one: '1 minute', other: '{{count}} minutes' }, aboutXHours: { one: 'about 1 hour', other: 'about {{count}} hours' }, xHours: { one: '1 hour', other: '{{count}} hours' }, xDays: { one: '1 day', other: '{{count}} days' }, aboutXMonths: { one: 'about 1 month', other: 'about {{count}} months' }, xMonths: { one: '1 month', other: '{{count}} months' }, aboutXYears: { one: 'about 1 year', other: 'about {{count}} years' }, xYears: { one: '1 year', other: '{{count}} years' }, overXYears: { one: 'over 1 year', other: 'over {{count}} years' }, almostXYears: { one: 'almost 1 year', other: 'almost {{count}} years' } } function localize (token, count, options) { options = options || {} var result if (typeof distanceInWordsLocale[token] === 'string') { result = distanceInWordsLocale[token] } else if (count === 1) { result = distanceInWordsLocale[token].one } else { result = distanceInWordsLocale[token].other.replace('{{count}}', count) } if (options.addSuffix) { if (options.comparison > 0) { return 'in ' + result } else { return result + ' ago' } } return result } return { localize: localize } } module.exports = buildDistanceInWordsLocale /***/ }), /* 1113 */ /***/ (function(module, exports, __webpack_require__) { var buildFormattingTokensRegExp = __webpack_require__(1114) function buildFormatLocale () { // Note: in English, the names of days of the week and months are capitalized. // If you are making a new locale based on this one, check if the same is true for the language you're working on. // Generally, formatted dates should look like they are in the middle of a sentence, // e.g. in Spanish language the weekdays and months should be in the lowercase. var months3char = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] var monthsFull = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] var weekdays2char = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'] var weekdays3char = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] var weekdaysFull = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] var meridiemUppercase = ['AM', 'PM'] var meridiemLowercase = ['am', 'pm'] var meridiemFull = ['a.m.', 'p.m.'] var formatters = { // Month: Jan, Feb, ..., Dec 'MMM': function (date) { return months3char[date.getMonth()] }, // Month: January, February, ..., December 'MMMM': function (date) { return monthsFull[date.getMonth()] }, // Day of week: Su, Mo, ..., Sa 'dd': function (date) { return weekdays2char[date.getDay()] }, // Day of week: Sun, Mon, ..., Sat 'ddd': function (date) { return weekdays3char[date.getDay()] }, // Day of week: Sunday, Monday, ..., Saturday 'dddd': function (date) { return weekdaysFull[date.getDay()] }, // AM, PM 'A': function (date) { return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] }, // am, pm 'a': function (date) { return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] }, // a.m., p.m. 'aa': function (date) { return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] } } // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] ordinalFormatters.forEach(function (formatterToken) { formatters[formatterToken + 'o'] = function (date, formatters) { return ordinal(formatters[formatterToken](date)) } }) return { formatters: formatters, formattingTokensRegExp: buildFormattingTokensRegExp(formatters) } } function ordinal (number) { var rem100 = number % 100 if (rem100 > 20 || rem100 < 10) { switch (rem100 % 10) { case 1: return number + 'st' case 2: return number + 'nd' case 3: return number + 'rd' } } return number + 'th' } module.exports = buildFormatLocale /***/ }), /* 1114 */ /***/ (function(module, exports) { var commonFormatterKeys = [ 'M', 'MM', 'Q', 'D', 'DD', 'DDD', 'DDDD', 'd', 'E', 'W', 'WW', 'YY', 'YYYY', 'GG', 'GGGG', 'H', 'HH', 'h', 'hh', 'm', 'mm', 's', 'ss', 'S', 'SS', 'SSS', 'Z', 'ZZ', 'X', 'x' ] function buildFormattingTokensRegExp (formatters) { var formatterKeys = [] for (var key in formatters) { if (formatters.hasOwnProperty(key)) { formatterKeys.push(key) } } var formattingTokens = commonFormatterKeys .concat(formatterKeys) .sort() .reverse() var formattingTokensRegExp = new RegExp( '(\\[[^\\[]*\\])|(\\\\)?' + '(' + formattingTokens.join('|') + '|.)', 'g' ) return formattingTokensRegExp } module.exports = buildFormattingTokensRegExp /***/ }), /* 1115 */ /***/ (function(module, exports, __webpack_require__) { /** * Bank transactions categorization * * @module categorization */ const { tokenizer } = __webpack_require__(1116); const { createModel: createGlobalModel } = __webpack_require__(1117); const { createModel: createLocalModel } = __webpack_require__(1126); const logger = __webpack_require__(2); const log = logger.namespace('categorization'); /** * Initialize global and local models and return an object exposing a * `categorize` function that applies both models on an array of transactions * * The global model is a model specific to hosted Cozy instances. It is not available for self-hosted instances. It will just do nothing in that case. * * The local model is based on the user manual categorizations. * * Each model adds two properties to the transactions: * * The global model adds `cozyCategoryId` and `cozyCategoryProba` * * The local model adds `localCategoryId` and `localCategoryProba` * * In the end, each transaction can have up to four different categories. An application can use these categories to show the most significant for the user. See https://github.com/cozy/cozy-doctypes/blob/master/docs/io.cozy.bank.md#categories for more informations. * * @returns {object} an object with a `categorize` method * * @example * const { BaseKonnector, createCategorizer } = require('cozy-konnector-libs') * * class BankingKonnector extends BaseKonnector { * async saveTransactions() { * const transactions = await this.fetchTransactions() * const categorizer = await createCategorizer * const categorizedTransactions = await categorizer.categorize(transactions) * * // Save categorizedTransactions * } * } */ async function createCategorizer() { const classifierOptions = { tokenizer }; // We can't initialize the model in parallel using `Promise.all` because with // it is not possible to manage errors separately let globalModel, localModel; try { globalModel = await createGlobalModel(classifierOptions); } catch (e) { log('info', 'Failed to create global model:'); log('info', e.message); } try { localModel = await createLocalModel(classifierOptions); } catch (e) { log('info', 'Failed to create local model:'); log('info', e.message); } const modelsToApply = [globalModel, localModel].filter(Boolean); const categorize = transactions => { modelsToApply.forEach(model => model.categorize(transactions)); return transactions; }; return { categorize }; } /** * Initialize global and local models and categorize the given array of transactions * * @see {@link createCategorizer} for more informations about models initialization * * @returns {object[]} the categorized transactions * * @example * const { BaseKonnector, categorize } = require('cozy-konnector-libs') * * class BankingKonnector extends BaseKonnector { * async saveTransactions() { * const transactions = await this.fetchTransactions() * const categorizedTransactions = await categorize(transactions) * * // Save categorizedTransactions * } * } */ async function categorize(transactions) { const categorizer = await createCategorizer(); return categorizer.categorize(transactions); } module.exports = { createCategorizer, categorize }; /***/ }), /* 1116 */ /***/ (function(module, exports) { const DATE_TAG = ' tag_date '; const DATE_REGEX = /\d{1,2}\/\d{1,2}\/\d{2,4}|\d{1,2}\/\d{1,2}/g; const UNNECESSARY_CHARS_REGEX = /[^a-zA-Z_ ]/g; const MAX_WORD = 3; const DEFAULT_CATEGORY = '0'; const PROBA_LIMIT = 10 / 100; const DESIRED_TAGS = ['sign', 'amount', 'label']; const format = label => { const stripAccents = label => { return label.normalize('NFKD').replace(/[\u0300-\u036f]/g, ''); }; const replaceDate = label => { return label.replace(DATE_REGEX, DATE_TAG); }; const removeUnnecessaryChars = label => { return label.replace(UNNECESSARY_CHARS_REGEX, ''); }; return removeUnnecessaryChars(replaceDate(stripAccents(label.toLowerCase()))); }; const tokenizer = text => { const sanitized = format(text); const words = sanitized.split(/\s+/).filter(token => { return token.length >= 2; }); let tokens = []; let countWord = MAX_WORD; while (countWord !== 0) { if (words.length >= countWord) { for (let start = 0; start + countWord < words.length + 1; start++) { const token = words.slice(start, start + countWord).join(' '); tokens.push(token); } } countWord--; } return tokens; }; const predictProbaMax = (classifier, label) => { const predicted = classifier.categorize(label, true); return predicted.likelihoods[0].proba; }; const categorize = (classifier, label) => { const predicted = classifier.categorize(label, true); const categoryId = predicted.likelihoods[0].proba > PROBA_LIMIT ? predicted.predictedCategory : DEFAULT_CATEGORY; return categoryId; }; const getTransactionLabel = transaction => transaction.label.toLowerCase(); const getAmountSignTag = amount => amount < 0 ? 'tag_neg' : 'tag_pos'; const getAmountTag = amount => { if (amount < -550) { return 'tag_v_b_expense'; } else if (amount < -100) { return 'tag_b_expense'; } else if (amount < -20) { return 'tag_expense'; } else if (amount < 0) { return 'tag_noise_neg'; } else if (amount < 50) { return 'tag_noise_pos'; } else if (amount < 200) { return 'tag_income'; } else if (amount < 1200) { return 'tag_b_income'; } else { return 'tag_activity_income'; } }; const getDayOfMonthTag = dateStr => { const dayOfMonthStr = Number(dateStr.slice(9, 10)); if (dayOfMonthStr < 4 || dayOfMonthStr >= 28) { return 'tag_A'; } else if (dayOfMonthStr < 12 && dayOfMonthStr >= 4) { return 'tag_B'; } else if (dayOfMonthStr < 20 && dayOfMonthStr >= 12) { return 'tag_C'; } else if (dayOfMonthStr < 28 && dayOfMonthStr >= 20) { return 'tag_D'; } }; const getDigitsTag = amount => { const amountString = String(amount); return amountString.includes('.') ? 'tag_float' : 'tag_integer'; }; const getLabelWithTags = transaction => { let label = ''; for (const keyword of DESIRED_TAGS) { if (keyword.includes('amount')) { const tag = getAmountTag(transaction.amount); label = `${label} ${tag}`; } else if (keyword.includes('sign')) { const tag = getAmountSignTag(transaction.amount); label = `${label} ${tag}`; } else if (keyword.includes('day')) { const tag = getDayOfMonthTag(transaction.date); label = `${label} ${tag}`; } else if (keyword.includes('label')) { const tag = transaction.label.toLowerCase(); label = `${label} ${tag}`; } else if (keyword.includes('digits')) { const tag = getDigitsTag(transaction.amount); label = `${label} ${tag}`; } else if (keyword.includes('original')) { const tag = getTransactionLabel(transaction).toLowerCase(); label = `${label} ${tag}`; } } return label; }; module.exports = { tokenizer, predictProbaMax, categorize, getLabelWithTags }; /***/ }), /* 1117 */ /***/ (function(module, exports, __webpack_require__) { const { createModel } = __webpack_require__(1118); module.exports = { createModel }; /***/ }), /* 1118 */ /***/ (function(module, exports, __webpack_require__) { const { fetchParameters } = __webpack_require__(1119); const { createClassifier } = __webpack_require__(1120); const { getLabelWithTags } = __webpack_require__(1116); const maxBy = __webpack_require__(1123); const logger = __webpack_require__(2); const log = logger.namespace('categorization/globalModel'); async function createModel(options) { log('info', 'Fetching parameters from the stack'); const parameters = await fetchParameters(); log('info', 'Successfully fetched parameters from the stack'); log('info', 'Instanciating a new classifier'); const classifier = createClassifier(parameters, options); const categorize = transactions => { for (const transaction of transactions) { const label = getLabelWithTags(transaction); log('info', `Applying model to ${label}`); const { category, proba } = maxBy(classifier.categorize(label).likelihoods, 'proba'); transaction.cozyCategoryId = category; transaction.cozyCategoryProba = proba; log('info', `Results for ${label} :`); log('info', `cozyCategory: ${category}`); log('info', `cozyProba: ${proba}`); } return transactions; }; return { categorize }; } module.exports = { createModel }; /***/ }), /* 1119 */ /***/ (function(module, exports, __webpack_require__) { const cozyClient = __webpack_require__(617); async function fetchParameters() { const parameters = await cozyClient.fetchJSON('GET', '/remote/assets/bank_classifier_nb_and_voc'); return parameters; } module.exports = { fetchParameters }; /***/ }), /* 1120 */ /***/ (function(module, exports, __webpack_require__) { const bayes = __webpack_require__(1121); function createClassifier(parameters, options) { parameters.options = { ...parameters.options, ...options }; const classifier = bayes.fromJson(parameters); return classifier; } module.exports = { createClassifier }; /***/ }), /* 1121 */ /***/ (function(module, exports, __webpack_require__) { const Decimal = __webpack_require__(1122).default; // handles arbitrary-precision arithmetics. /* Expose our naive-bayes generator function */ module.exports = function(options) { return new Naivebayes(options); }; // keys we use to serialize a classifier's state const STATE_KEYS = (module.exports.STATE_KEYS = [ 'categories', 'docCount', 'totalDocuments', 'vocabulary', 'vocabularySize', 'wordCount', 'wordFrequencyCount', 'options', ]); const DEFAULT_ALPHA = 1; const DEFAULT_FIT_PRIOR = true; /** * Initializes a NaiveBayes instance from a JSON state representation. * Use this with classifier.toJson(). * * @param {String|Object} jsonStrOrObject state representation obtained by classifier.toJson() * @return {NaiveBayes} Classifier */ module.exports.fromJson = (jsonStrOrObject) => { let parameters; try { switch (typeof jsonStrOrObject) { case 'string': parameters = JSON.parse(jsonStrOrObject); break; case 'object': parameters = jsonStrOrObject; break; default: throw new Error(''); } } catch (e) { console.error(e); throw new Error('Naivebays.fromJson expects a valid JSON string or an object.'); } // init a new classifier const classifier = new Naivebayes(parameters.options); // override the classifier's state STATE_KEYS.forEach((k) => { if (!parameters[k]) { throw new Error( `Naivebayes.fromJson: JSON string is missing an expected property: [${k}].` ); } classifier[k] = parameters[k]; }); return classifier; }; /** * Given an input string, tokenize it into an array of word tokens. * This is the default tokenization function used if user does not provide one in `options`. * * @param {String} text * @return {Array} */ const defaultTokenizer = (text) => { // remove punctuation from text - remove anything that isn't a word char or a space const rgxPunctuation = /[^(a-zA-ZA-Яa-я0-9_)+\s]/g; const sanitized = text.replace(rgxPunctuation, ' '); // tokens = tokens.filter(function(token) { // return token.length >= _that.config.minimumLength; // }); return sanitized.split(/\s+/); }; /** * Naive-Bayes Classifier * * This is a naive-bayes classifier that uses Laplace Smoothing. * * Takes an (optional) options object containing: * - `tokenizer` => custom tokenization function * */ function Naivebayes(options) { // set options object this.options = {}; if (typeof options !== 'undefined') { if (!options || typeof options !== 'object' || Array.isArray(options)) { throw TypeError( `NaiveBayes got invalid 'options': ${options}'. Pass in an object.` ); } this.options = options; } this.tokenizer = this.options.tokenizer || defaultTokenizer; this.alpha = this.options.alpha || DEFAULT_ALPHA; this.fitPrior = this.options.fitPrior === undefined ? DEFAULT_FIT_PRIOR : this.options.fitPrior; // initialize our vocabulary and its size this.vocabulary = {}; this.vocabularySize = 0; // number of documents we have learned from this.totalDocuments = 0; // document frequency table for each of our categories //= > for each category, how often were documents mapped to it this.docCount = {}; // for each category, how many words total were mapped to it this.wordCount = {}; // word frequency table for each category //= > for each category, how frequent was a given word mapped to it this.wordFrequencyCount = {}; // hashmap of our category names this.categories = {}; } /** * Initialize each of our data structure entries for this new category * * @param {String} categoryName */ Naivebayes.prototype.initializeCategory = function(categoryName) { if (!this.categories[categoryName]) { this.docCount[categoryName] = 0; this.wordCount[categoryName] = 0; this.wordFrequencyCount[categoryName] = {}; this.categories[categoryName] = true; } return this; }; /** * Properly remove a category, unlearning all words that were associated to it. * * @param {String} categoryName */ Naivebayes.prototype.removeCategory = function(categoryName) { if (!this.categories[categoryName]) { return this; } // update the total number of documents we have learned from this.totalDocuments -= this.docCount[categoryName]; Object.keys(this.wordFrequencyCount[categoryName]).forEach((token) => { this.vocabulary[token]--; if (this.vocabulary[token] === 0) this.vocabularySize--; }); delete this.docCount[categoryName]; delete this.wordCount[categoryName]; delete this.wordFrequencyCount[categoryName]; delete this.categories[categoryName]; return this; }; /** * train our naive-bayes classifier by telling it what `category` * the `text` corresponds to. * * @param {String} text * @param {String} category Category to learn as being text */ Naivebayes.prototype.learn = function(text, category) { // initialize category data structures if we've never seen this category this.initializeCategory(category); // update our count of how many documents mapped to this category this.docCount[category]++; // update the total number of documents we have learned from this.totalDocuments++; // normalize the text into a word array const tokens = this.tokenizer(text); // get a frequency count for each token in the text const frequencyTable = this.frequencyTable(tokens); Object.keys(frequencyTable).forEach((token) => { const frequencyInText = frequencyTable[token]; // add this word to our vocabulary if not already existing if (!this.vocabulary[token] || this.vocabulary[token] === 0) { this.vocabularySize++; this.vocabulary[token] = 1; // this.vocabulary[token] = frequencyInText; } else if (this.vocabulary[token] > 0) { this.vocabulary[token]++; // this.vocabulary[token] += frequencyInText; } // update the frequency information for this word in this category if (!this.wordFrequencyCount[category][token]) { this.wordFrequencyCount[category][token] = frequencyInText; } else this.wordFrequencyCount[category][token] += frequencyInText; // update the count of all words we have seen mapped to this category this.wordCount[category] += frequencyInText; }); return this; }; /** * untrain our naive-bayes classifier by telling it what `category` * the `text` to remove corresponds to. * * @param {String} text * @param {String} category Category to unlearn as being text */ Naivebayes.prototype.unlearn = function(text, category) { // update our count of how many documents mapped to this category this.docCount[category]--; if (this.docCount[category] === 0) { delete this.docCount[category]; } // update the total number of documents we have learned from this.totalDocuments--; // normalize the text into a word array const tokens = this.tokenizer(text); // get a frequency count for each token in the text const frequencyTable = this.frequencyTable(tokens); /* Update our vocabulary and our word frequency count for this category */ Object.keys(frequencyTable).forEach((token) => { const frequencyInText = frequencyTable[token]; // add this word to our vocabulary if not already existing if (this.vocabulary[token] && this.vocabulary[token] > 0) { this.vocabulary[token] -= frequencyInText; if (this.vocabulary[token] === 0) this.vocabularySize--; } this.wordFrequencyCount[category][token] -= frequencyInText; if (this.wordFrequencyCount[category][token] === 0) { delete this.wordFrequencyCount[category][token]; } // update the count of all words we have seen mapped to this category this.wordCount[category] -= frequencyInText; if (this.wordCount[category] === 0) { delete this.wordCount[category]; delete this.wordFrequencyCount[category]; } }); return this; }; /** * Determine what category `text` belongs to. * * @param {String} text * * @return {Object} The predicted category, and the likelihoods stats. */ Naivebayes.prototype.categorize = function(text) { const tokens = this.tokenizer(text); const frequencyTable = this.frequencyTable(tokens); const categories = Object.keys(this.categories); const likelihoods = []; // iterate through our categories to find the one with max probability for this text categories.forEach((category) => { // start by calculating the overall probability of this category //= > out of all documents we've ever looked at, how many were // mapped to this category let categoryLikelihood; if (this.fitPrior) { categoryLikelihood = this.docCount[category] / this.totalDocuments; } else { categoryLikelihood = 1; } // take the log to avoid underflow // let logLikelihood = Math.log(categoryLikelihood); let logLikelihood = Decimal(categoryLikelihood); logLikelihood = logLikelihood.naturalLogarithm(); // now determine P( w | c ) for each word `w` in the text Object.keys(frequencyTable).forEach((token) => { if (this.vocabulary[token] && this.vocabulary[token] > 0) { const termFrequencyInText = frequencyTable[token]; const tokenProbability = this.tokenProbability(token, category); // determine the log of the P( w | c ) for this word // logLikelihood += termFrequencyInText * Math.log(tokenProbability); let logTokenProbability = Decimal(tokenProbability); logTokenProbability = logTokenProbability.naturalLogarithm(); logLikelihood = logLikelihood.plus(termFrequencyInText * logTokenProbability); } }); if (logLikelihood == Number.NEGATIVE_INFINITY) { console.warn(`[Classificator] category ${category} had -Infinity odds`); } likelihoods.push({ category, logLikelihood }); }); const logsumexp = (likelihoods) => { let sum = new Decimal(0); likelihoods.forEach((likelihood) => { const x = Decimal(likelihood.logLikelihood); const a = Decimal.exp(x); sum = sum.plus(a); }); return sum.naturalLogarithm(); }; const logProbX = logsumexp(likelihoods); likelihoods.forEach((likelihood) => { likelihood.logProba = Decimal(likelihood.logLikelihood).minus(logProbX); likelihood.proba = likelihood.logProba.naturalExponential(); likelihood.logProba = likelihood.logProba.toNumber(); likelihood.proba = likelihood.proba.toNumber(); likelihood.logLikelihood = likelihood.logLikelihood.toNumber(); }); // sort to have first element with biggest probability likelihoods.sort((a, b) => b.proba - a.proba); return { likelihoods, predictedCategory: likelihoods[0].category }; }; /** * Calculate probability that a `token` belongs to a `category` * * @param {String} token * @param {String} category * @return {Number} probability */ Naivebayes.prototype.tokenProbability = function(token, category) { // how many times this word has occurred in documents mapped to this category const wordFrequencyCount = this.wordFrequencyCount[category][token] || 0; // what is the count of all words that have ever been mapped to this category const wordCount = this.wordCount[category]; // use laplace Add-1 Smoothing equation return (wordFrequencyCount + this.alpha) / (wordCount + this.alpha * this.vocabularySize); }; /** * Build a frequency hashmap where * - the keys are the entries in `tokens` * - the values are the frequency of each entry in `tokens` * * @param {Array} tokens Normalized word array * @return {Object} */ Naivebayes.prototype.frequencyTable = function(tokens) { const frequencyTable = Object.create(null); tokens.forEach((token) => { if (!frequencyTable[token]) frequencyTable[token] = 1; else frequencyTable[token]++; }); return frequencyTable; }; /** * Dump the classifier's state as a JSON string. * @return {String} Representation of the classifier. */ Naivebayes.prototype.toJson = function() { const state = {}; STATE_KEYS.forEach(k => (state[k] = this[k])); return JSON.stringify(state); }; /***/ }), /* 1122 */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Decimal", function() { return Decimal; }); /* * decimal.js v10.2.0 * An arbitrary-precision Decimal type for JavaScript. * https://github.com/MikeMcl/decimal.js * Copyright (c) 2019 Michael Mclaughlin <M8ch88l@gmail.com> * MIT Licence */ // ----------------------------------- EDITABLE DEFAULTS ------------------------------------ // // The maximum exponent magnitude. // The limit on the value of `toExpNeg`, `toExpPos`, `minE` and `maxE`. var EXP_LIMIT = 9e15, // 0 to 9e15 // The limit on the value of `precision`, and on the value of the first argument to // `toDecimalPlaces`, `toExponential`, `toFixed`, `toPrecision` and `toSignificantDigits`. MAX_DIGITS = 1e9, // 0 to 1e9 // Base conversion alphabet. NUMERALS = '0123456789abcdef', // The natural logarithm of 10 (1025 digits). LN10 = '2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058', // Pi (1025 digits). PI = '3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789', // The initial configuration properties of the Decimal constructor. DEFAULTS = { // These values must be integers within the stated ranges (inclusive). // Most of these values can be changed at run-time using the `Decimal.config` method. // The maximum number of significant digits of the result of a calculation or base conversion. // E.g. `Decimal.config({ precision: 20 });` precision: 20, // 1 to MAX_DIGITS // The rounding mode used when rounding to `precision`. // // ROUND_UP 0 Away from zero. // ROUND_DOWN 1 Towards zero. // ROUND_CEIL 2 Towards +Infinity. // ROUND_FLOOR 3 Towards -Infinity. // ROUND_HALF_UP 4 Towards nearest neighbour. If equidistant, up. // ROUND_HALF_DOWN 5 Towards nearest neighbour. If equidistant, down. // ROUND_HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour. // ROUND_HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity. // ROUND_HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity. // // E.g. // `Decimal.rounding = 4;` // `Decimal.rounding = Decimal.ROUND_HALF_UP;` rounding: 4, // 0 to 8 // The modulo mode used when calculating the modulus: a mod n. // The quotient (q = a / n) is calculated according to the corresponding rounding mode. // The remainder (r) is calculated as: r = a - n * q. // // UP 0 The remainder is positive if the dividend is negative, else is negative. // DOWN 1 The remainder has the same sign as the dividend (JavaScript %). // FLOOR 3 The remainder has the same sign as the divisor (Python %). // HALF_EVEN 6 The IEEE 754 remainder function. // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). Always positive. // // Truncated division (1), floored division (3), the IEEE 754 remainder (6), and Euclidian // division (9) are commonly used for the modulus operation. The other rounding modes can also // be used, but they may not give useful results. modulo: 1, // 0 to 9 // The exponent value at and beneath which `toString` returns exponential notation. // JavaScript numbers: -7 toExpNeg: -7, // 0 to -EXP_LIMIT // The exponent value at and above which `toString` returns exponential notation. // JavaScript numbers: 21 toExpPos: 21, // 0 to EXP_LIMIT // The minimum exponent value, beneath which underflow to zero occurs. // JavaScript numbers: -324 (5e-324) minE: -EXP_LIMIT, // -1 to -EXP_LIMIT // The maximum exponent value, above which overflow to Infinity occurs. // JavaScript numbers: 308 (1.7976931348623157e+308) maxE: EXP_LIMIT, // 1 to EXP_LIMIT // Whether to use cryptographically-secure random number generation, if available. crypto: false // true/false }, // ----------------------------------- END OF EDITABLE DEFAULTS ------------------------------- // inexact, quadrant, external = true, decimalError = '[DecimalError] ', invalidArgument = decimalError + 'Invalid argument: ', precisionLimitExceeded = decimalError + 'Precision limit exceeded', cryptoUnavailable = decimalError + 'crypto unavailable', mathfloor = Math.floor, mathpow = Math.pow, isBinary = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i, isHex = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i, isOctal = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i, isDecimal = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, BASE = 1e7, LOG_BASE = 7, MAX_SAFE_INTEGER = 9007199254740991, LN10_PRECISION = LN10.length - 1, PI_PRECISION = PI.length - 1, // Decimal.prototype object P = { name: '[object Decimal]' }; // Decimal prototype methods /* * absoluteValue abs * ceil * comparedTo cmp * cosine cos * cubeRoot cbrt * decimalPlaces dp * dividedBy div * dividedToIntegerBy divToInt * equals eq * floor * greaterThan gt * greaterThanOrEqualTo gte * hyperbolicCosine cosh * hyperbolicSine sinh * hyperbolicTangent tanh * inverseCosine acos * inverseHyperbolicCosine acosh * inverseHyperbolicSine asinh * inverseHyperbolicTangent atanh * inverseSine asin * inverseTangent atan * isFinite * isInteger isInt * isNaN * isNegative isNeg * isPositive isPos * isZero * lessThan lt * lessThanOrEqualTo lte * logarithm log * [maximum] [max] * [minimum] [min] * minus sub * modulo mod * naturalExponential exp * naturalLogarithm ln * negated neg * plus add * precision sd * round * sine sin * squareRoot sqrt * tangent tan * times mul * toBinary * toDecimalPlaces toDP * toExponential * toFixed * toFraction * toHexadecimal toHex * toNearest * toNumber * toOctal * toPower pow * toPrecision * toSignificantDigits toSD * toString * truncated trunc * valueOf toJSON */ /* * Return a new Decimal whose value is the absolute value of this Decimal. * */ P.absoluteValue = P.abs = function () { var x = new this.constructor(this); if (x.s < 0) x.s = 1; return finalise(x); }; /* * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the * direction of positive Infinity. * */ P.ceil = function () { return finalise(new this.constructor(this), this.e + 1, 2); }; /* * Return * 1 if the value of this Decimal is greater than the value of `y`, * -1 if the value of this Decimal is less than the value of `y`, * 0 if they have the same value, * NaN if the value of either Decimal is NaN. * */ P.comparedTo = P.cmp = function (y) { var i, j, xdL, ydL, x = this, xd = x.d, yd = (y = new x.constructor(y)).d, xs = x.s, ys = y.s; // Either NaN or ±Infinity? if (!xd || !yd) { return !xs || !ys ? NaN : xs !== ys ? xs : xd === yd ? 0 : !xd ^ xs < 0 ? 1 : -1; } // Either zero? if (!xd[0] || !yd[0]) return xd[0] ? xs : yd[0] ? -ys : 0; // Signs differ? if (xs !== ys) return xs; // Compare exponents. if (x.e !== y.e) return x.e > y.e ^ xs < 0 ? 1 : -1; xdL = xd.length; ydL = yd.length; // Compare digit by digit. for (i = 0, j = xdL < ydL ? xdL : ydL; i < j; ++i) { if (xd[i] !== yd[i]) return xd[i] > yd[i] ^ xs < 0 ? 1 : -1; } // Compare lengths. return xdL === ydL ? 0 : xdL > ydL ^ xs < 0 ? 1 : -1; }; /* * Return a new Decimal whose value is the cosine of the value in radians of this Decimal. * * Domain: [-Infinity, Infinity] * Range: [-1, 1] * * cos(0) = 1 * cos(-0) = 1 * cos(Infinity) = NaN * cos(-Infinity) = NaN * cos(NaN) = NaN * */ P.cosine = P.cos = function () { var pr, rm, x = this, Ctor = x.constructor; if (!x.d) return new Ctor(NaN); // cos(0) = cos(-0) = 1 if (!x.d[0]) return new Ctor(1); pr = Ctor.precision; rm = Ctor.rounding; Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE; Ctor.rounding = 1; x = cosine(Ctor, toLessThanHalfPi(Ctor, x)); Ctor.precision = pr; Ctor.rounding = rm; return finalise(quadrant == 2 || quadrant == 3 ? x.neg() : x, pr, rm, true); }; /* * * Return a new Decimal whose value is the cube root of the value of this Decimal, rounded to * `precision` significant digits using rounding mode `rounding`. * * cbrt(0) = 0 * cbrt(-0) = -0 * cbrt(1) = 1 * cbrt(-1) = -1 * cbrt(N) = N * cbrt(-I) = -I * cbrt(I) = I * * Math.cbrt(x) = (x < 0 ? -Math.pow(-x, 1/3) : Math.pow(x, 1/3)) * */ P.cubeRoot = P.cbrt = function () { var e, m, n, r, rep, s, sd, t, t3, t3plusx, x = this, Ctor = x.constructor; if (!x.isFinite() || x.isZero()) return new Ctor(x); external = false; // Initial estimate. s = x.s * mathpow(x.s * x, 1 / 3); // Math.cbrt underflow/overflow? // Pass x to Math.pow as integer, then adjust the exponent of the result. if (!s || Math.abs(s) == 1 / 0) { n = digitsToString(x.d); e = x.e; // Adjust n exponent so it is a multiple of 3 away from x exponent. if (s = (e - n.length + 1) % 3) n += (s == 1 || s == -2 ? '0' : '00'); s = mathpow(n, 1 / 3); // Rarely, e may be one less than the result exponent value. e = mathfloor((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2)); if (s == 1 / 0) { n = '5e' + e; } else { n = s.toExponential(); n = n.slice(0, n.indexOf('e') + 1) + e; } r = new Ctor(n); r.s = x.s; } else { r = new Ctor(s.toString()); } sd = (e = Ctor.precision) + 3; // Halley's method. // TODO? Compare Newton's method. for (;;) { t = r; t3 = t.times(t).times(t); t3plusx = t3.plus(x); r = divide(t3plusx.plus(x).times(t), t3plusx.plus(t3), sd + 2, 1); // TODO? Replace with for-loop and checkRoundingDigits. if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) { n = n.slice(sd - 3, sd + 1); // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or 4999 // , i.e. approaching a rounding boundary, continue the iteration. if (n == '9999' || !rep && n == '4999') { // On the first iteration only, check to see if rounding up gives the exact result as the // nines may infinitely repeat. if (!rep) { finalise(t, e + 1, 0); if (t.times(t).times(t).eq(x)) { r = t; break; } } sd += 4; rep = 1; } else { // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result. // If not, then there are further digits and m will be truthy. if (!+n || !+n.slice(1) && n.charAt(0) == '5') { // Truncate to the first rounding digit. finalise(r, e + 1, 1); m = !r.times(r).times(r).eq(x); } break; } } } external = true; return finalise(r, e, Ctor.rounding, m); }; /* * Return the number of decimal places of the value of this Decimal. * */ P.decimalPlaces = P.dp = function () { var w, d = this.d, n = NaN; if (d) { w = d.length - 1; n = (w - mathfloor(this.e / LOG_BASE)) * LOG_BASE; // Subtract the number of trailing zeros of the last word. w = d[w]; if (w) for (; w % 10 == 0; w /= 10) n--; if (n < 0) n = 0; } return n; }; /* * n / 0 = I * n / N = N * n / I = 0 * 0 / n = 0 * 0 / 0 = N * 0 / N = N * 0 / I = 0 * N / n = N * N / 0 = N * N / N = N * N / I = N * I / n = I * I / 0 = I * I / N = N * I / I = N * * Return a new Decimal whose value is the value of this Decimal divided by `y`, rounded to * `precision` significant digits using rounding mode `rounding`. * */ P.dividedBy = P.div = function (y) { return divide(this, new this.constructor(y)); }; /* * Return a new Decimal whose value is the integer part of dividing the value of this Decimal * by the value of `y`, rounded to `precision` significant digits using rounding mode `rounding`. * */ P.dividedToIntegerBy = P.divToInt = function (y) { var x = this, Ctor = x.constructor; return finalise(divide(x, new Ctor(y), 0, 1, 1), Ctor.precision, Ctor.rounding); }; /* * Return true if the value of this Decimal is equal to the value of `y`, otherwise return false. * */ P.equals = P.eq = function (y) { return this.cmp(y) === 0; }; /* * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the * direction of negative Infinity. * */ P.floor = function () { return finalise(new this.constructor(this), this.e + 1, 3); }; /* * Return true if the value of this Decimal is greater than the value of `y`, otherwise return * false. * */ P.greaterThan = P.gt = function (y) { return this.cmp(y) > 0; }; /* * Return true if the value of this Decimal is greater than or equal to the value of `y`, * otherwise return false. * */ P.greaterThanOrEqualTo = P.gte = function (y) { var k = this.cmp(y); return k == 1 || k === 0; }; /* * Return a new Decimal whose value is the hyperbolic cosine of the value in radians of this * Decimal. * * Domain: [-Infinity, Infinity] * Range: [1, Infinity] * * cosh(x) = 1 + x^2/2! + x^4/4! + x^6/6! + ... * * cosh(0) = 1 * cosh(-0) = 1 * cosh(Infinity) = Infinity * cosh(-Infinity) = Infinity * cosh(NaN) = NaN * * x time taken (ms) result * 1000 9 9.8503555700852349694e+433 * 10000 25 4.4034091128314607936e+4342 * 100000 171 1.4033316802130615897e+43429 * 1000000 3817 1.5166076984010437725e+434294 * 10000000 abandoned after 2 minute wait * * TODO? Compare performance of cosh(x) = 0.5 * (exp(x) + exp(-x)) * */ P.hyperbolicCosine = P.cosh = function () { var k, n, pr, rm, len, x = this, Ctor = x.constructor, one = new Ctor(1); if (!x.isFinite()) return new Ctor(x.s ? 1 / 0 : NaN); if (x.isZero()) return one; pr = Ctor.precision; rm = Ctor.rounding; Ctor.precision = pr + Math.max(x.e, x.sd()) + 4; Ctor.rounding = 1; len = x.d.length; // Argument reduction: cos(4x) = 1 - 8cos^2(x) + 8cos^4(x) + 1 // i.e. cos(x) = 1 - cos^2(x/4)(8 - 8cos^2(x/4)) // Estimate the optimum number of times to use the argument reduction. // TODO? Estimation reused from cosine() and may not be optimal here. if (len < 32) { k = Math.ceil(len / 3); n = (1 / tinyPow(4, k)).toString(); } else { k = 16; n = '2.3283064365386962890625e-10'; } x = taylorSeries(Ctor, 1, x.times(n), new Ctor(1), true); // Reverse argument reduction var cosh2_x, i = k, d8 = new Ctor(8); for (; i--;) { cosh2_x = x.times(x); x = one.minus(cosh2_x.times(d8.minus(cosh2_x.times(d8)))); } return finalise(x, Ctor.precision = pr, Ctor.rounding = rm, true); }; /* * Return a new Decimal whose value is the hyperbolic sine of the value in radians of this * Decimal. * * Domain: [-Infinity, Infinity] * Range: [-Infinity, Infinity] * * sinh(x) = x + x^3/3! + x^5/5! + x^7/7! + ... * * sinh(0) = 0 * sinh(-0) = -0 * sinh(Infinity) = Infinity * sinh(-Infinity) = -Infinity * sinh(NaN) = NaN * * x time taken (ms) * 10 2 ms * 100 5 ms * 1000 14 ms * 10000 82 ms * 100000 886 ms 1.4033316802130615897e+43429 * 200000 2613 ms * 300000 5407 ms * 400000 8824 ms * 500000 13026 ms 8.7080643612718084129e+217146 * 1000000 48543 ms * * TODO? Compare performance of sinh(x) = 0.5 * (exp(x) - exp(-x)) * */ P.hyperbolicSine = P.sinh = function () { var k, pr, rm, len, x = this, Ctor = x.constructor; if (!x.isFinite() || x.isZero()) return new Ctor(x); pr = Ctor.precision; rm = Ctor.rounding; Ctor.precision = pr + Math.max(x.e, x.sd()) + 4; Ctor.rounding = 1; len = x.d.length; if (len < 3) { x = taylorSeries(Ctor, 2, x, x, true); } else { // Alternative argument reduction: sinh(3x) = sinh(x)(3 + 4sinh^2(x)) // i.e. sinh(x) = sinh(x/3)(3 + 4sinh^2(x/3)) // 3 multiplications and 1 addition // Argument reduction: sinh(5x) = sinh(x)(5 + sinh^2(x)(20 + 16sinh^2(x))) // i.e. sinh(x) = sinh(x/5)(5 + sinh^2(x/5)(20 + 16sinh^2(x/5))) // 4 multiplications and 2 additions // Estimate the optimum number of times to use the argument reduction. k = 1.4 * Math.sqrt(len); k = k > 16 ? 16 : k | 0; x = x.times(1 / tinyPow(5, k)); x = taylorSeries(Ctor, 2, x, x, true); // Reverse argument reduction var sinh2_x, d5 = new Ctor(5), d16 = new Ctor(16), d20 = new Ctor(20); for (; k--;) { sinh2_x = x.times(x); x = x.times(d5.plus(sinh2_x.times(d16.times(sinh2_x).plus(d20)))); } } Ctor.precision = pr; Ctor.rounding = rm; return finalise(x, pr, rm, true); }; /* * Return a new Decimal whose value is the hyperbolic tangent of the value in radians of this * Decimal. * * Domain: [-Infinity, Infinity] * Range: [-1, 1] * * tanh(x) = sinh(x) / cosh(x) * * tanh(0) = 0 * tanh(-0) = -0 * tanh(Infinity) = 1 * tanh(-Infinity) = -1 * tanh(NaN) = NaN * */ P.hyperbolicTangent = P.tanh = function () { var pr, rm, x = this, Ctor = x.constructor; if (!x.isFinite()) return new Ctor(x.s); if (x.isZero()) return new Ctor(x); pr = Ctor.precision; rm = Ctor.rounding; Ctor.precision = pr + 7; Ctor.rounding = 1; return divide(x.sinh(), x.cosh(), Ctor.precision = pr, Ctor.rounding = rm); }; /* * Return a new Decimal whose value is the arccosine (inverse cosine) in radians of the value of * this Decimal. * * Domain: [-1, 1] * Range: [0, pi] * * acos(x) = pi/2 - asin(x) * * acos(0) = pi/2 * acos(-0) = pi/2 * acos(1) = 0 * acos(-1) = pi * acos(1/2) = pi/3 * acos(-1/2) = 2*pi/3 * acos(|x| > 1) = NaN * acos(NaN) = NaN * */ P.inverseCosine = P.acos = function () { var halfPi, x = this, Ctor = x.constructor, k = x.abs().cmp(1), pr = Ctor.precision, rm = Ctor.rounding; if (k !== -1) { return k === 0 // |x| is 1 ? x.isNeg() ? getPi(Ctor, pr, rm) : new Ctor(0) // |x| > 1 or x is NaN : new Ctor(NaN); } if (x.isZero()) return getPi(Ctor, pr + 4, rm).times(0.5); // TODO? Special case acos(0.5) = pi/3 and acos(-0.5) = 2*pi/3 Ctor.precision = pr + 6; Ctor.rounding = 1; x = x.asin(); halfPi = getPi(Ctor, pr + 4, rm).times(0.5); Ctor.precision = pr; Ctor.rounding = rm; return halfPi.minus(x); }; /* * Return a new Decimal whose value is the inverse of the hyperbolic cosine in radians of the * value of this Decimal. * * Domain: [1, Infinity] * Range: [0, Infinity] * * acosh(x) = ln(x + sqrt(x^2 - 1)) * * acosh(x < 1) = NaN * acosh(NaN) = NaN * acosh(Infinity) = Infinity * acosh(-Infinity) = NaN * acosh(0) = NaN * acosh(-0) = NaN * acosh(1) = 0 * acosh(-1) = NaN * */ P.inverseHyperbolicCosine = P.acosh = function () { var pr, rm, x = this, Ctor = x.constructor; if (x.lte(1)) return new Ctor(x.eq(1) ? 0 : NaN); if (!x.isFinite()) return new Ctor(x); pr = Ctor.precision; rm = Ctor.rounding; Ctor.precision = pr + Math.max(Math.abs(x.e), x.sd()) + 4; Ctor.rounding = 1; external = false; x = x.times(x).minus(1).sqrt().plus(x); external = true; Ctor.precision = pr; Ctor.rounding = rm; return x.ln(); }; /* * Return a new Decimal whose value is the inverse of the hyperbolic sine in radians of the value * of this Decimal. * * Domain: [-Infinity, Infinity] * Range: [-Infinity, Infinity] * * asinh(x) = ln(x + sqrt(x^2 + 1)) * * asinh(NaN) = NaN * asinh(Infinity) = Infinity * asinh(-Infinity) = -Infinity * asinh(0) = 0 * asinh(-0) = -0 * */ P.inverseHyperbolicSine = P.asinh = function () { var pr, rm, x = this, Ctor = x.constructor; if (!x.isFinite() || x.isZero()) return new Ctor(x); pr = Ctor.precision; rm = Ctor.rounding; Ctor.precision = pr + 2 * Math.max(Math.abs(x.e), x.sd()) + 6; Ctor.rounding = 1; external = false; x = x.times(x).plus(1).sqrt().plus(x); external = true; Ctor.precision = pr; Ctor.rounding = rm; return x.ln(); }; /* * Return a new Decimal whose value is the inverse of the hyperbolic tangent in radians of the * value of this Decimal. * * Domain: [-1, 1] * Range: [-Infinity, Infinity] * * atanh(x) = 0.5 * ln((1 + x) / (1 - x)) * * atanh(|x| > 1) = NaN * atanh(NaN) = NaN * atanh(Infinity) = NaN * atanh(-Infinity) = NaN * atanh(0) = 0 * atanh(-0) = -0 * atanh(1) = Infinity * atanh(-1) = -Infinity * */ P.inverseHyperbolicTangent = P.atanh = function () { var pr, rm, wpr, xsd, x = this, Ctor = x.constructor; if (!x.isFinite()) return new Ctor(NaN); if (x.e >= 0) return new Ctor(x.abs().eq(1) ? x.s / 0 : x.isZero() ? x : NaN); pr = Ctor.precision; rm = Ctor.rounding; xsd = x.sd(); if (Math.max(xsd, pr) < 2 * -x.e - 1) return finalise(new Ctor(x), pr, rm, true); Ctor.precision = wpr = xsd - x.e; x = divide(x.plus(1), new Ctor(1).minus(x), wpr + pr, 1); Ctor.precision = pr + 4; Ctor.rounding = 1; x = x.ln(); Ctor.precision = pr; Ctor.rounding = rm; return x.times(0.5); }; /* * Return a new Decimal whose value is the arcsine (inverse sine) in radians of the value of this * Decimal. * * Domain: [-Infinity, Infinity] * Range: [-pi/2, pi/2] * * asin(x) = 2*atan(x/(1 + sqrt(1 - x^2))) * * asin(0) = 0 * asin(-0) = -0 * asin(1/2) = pi/6 * asin(-1/2) = -pi/6 * asin(1) = pi/2 * asin(-1) = -pi/2 * asin(|x| > 1) = NaN * asin(NaN) = NaN * * TODO? Compare performance of Taylor series. * */ P.inverseSine = P.asin = function () { var halfPi, k, pr, rm, x = this, Ctor = x.constructor; if (x.isZero()) return new Ctor(x); k = x.abs().cmp(1); pr = Ctor.precision; rm = Ctor.rounding; if (k !== -1) { // |x| is 1 if (k === 0) { halfPi = getPi(Ctor, pr + 4, rm).times(0.5); halfPi.s = x.s; return halfPi; } // |x| > 1 or x is NaN return new Ctor(NaN); } // TODO? Special case asin(1/2) = pi/6 and asin(-1/2) = -pi/6 Ctor.precision = pr + 6; Ctor.rounding = 1; x = x.div(new Ctor(1).minus(x.times(x)).sqrt().plus(1)).atan(); Ctor.precision = pr; Ctor.rounding = rm; return x.times(2); }; /* * Return a new Decimal whose value is the arctangent (inverse tangent) in radians of the value * of this Decimal. * * Domain: [-Infinity, Infinity] * Range: [-pi/2, pi/2] * * atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ... * * atan(0) = 0 * atan(-0) = -0 * atan(1) = pi/4 * atan(-1) = -pi/4 * atan(Infinity) = pi/2 * atan(-Infinity) = -pi/2 * atan(NaN) = NaN * */ P.inverseTangent = P.atan = function () { var i, j, k, n, px, t, r, wpr, x2, x = this, Ctor = x.constructor, pr = Ctor.precision, rm = Ctor.rounding; if (!x.isFinite()) { if (!x.s) return new Ctor(NaN); if (pr + 4 <= PI_PRECISION) { r = getPi(Ctor, pr + 4, rm).times(0.5); r.s = x.s; return r; } } else if (x.isZero()) { return new Ctor(x); } else if (x.abs().eq(1) && pr + 4 <= PI_PRECISION) { r = getPi(Ctor, pr + 4, rm).times(0.25); r.s = x.s; return r; } Ctor.precision = wpr = pr + 10; Ctor.rounding = 1; // TODO? if (x >= 1 && pr <= PI_PRECISION) atan(x) = halfPi * x.s - atan(1 / x); // Argument reduction // Ensure |x| < 0.42 // atan(x) = 2 * atan(x / (1 + sqrt(1 + x^2))) k = Math.min(28, wpr / LOG_BASE + 2 | 0); for (i = k; i; --i) x = x.div(x.times(x).plus(1).sqrt().plus(1)); external = false; j = Math.ceil(wpr / LOG_BASE); n = 1; x2 = x.times(x); r = new Ctor(x); px = x; // atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ... for (; i !== -1;) { px = px.times(x2); t = r.minus(px.div(n += 2)); px = px.times(x2); r = t.plus(px.div(n += 2)); if (r.d[j] !== void 0) for (i = j; r.d[i] === t.d[i] && i--;); } if (k) r = r.times(2 << (k - 1)); external = true; return finalise(r, Ctor.precision = pr, Ctor.rounding = rm, true); }; /* * Return true if the value of this Decimal is a finite number, otherwise return false. * */ P.isFinite = function () { return !!this.d; }; /* * Return true if the value of this Decimal is an integer, otherwise return false. * */ P.isInteger = P.isInt = function () { return !!this.d && mathfloor(this.e / LOG_BASE) > this.d.length - 2; }; /* * Return true if the value of this Decimal is NaN, otherwise return false. * */ P.isNaN = function () { return !this.s; }; /* * Return true if the value of this Decimal is negative, otherwise return false. * */ P.isNegative = P.isNeg = function () { return this.s < 0; }; /* * Return true if the value of this Decimal is positive, otherwise return false. * */ P.isPositive = P.isPos = function () { return this.s > 0; }; /* * Return true if the value of this Decimal is 0 or -0, otherwise return false. * */ P.isZero = function () { return !!this.d && this.d[0] === 0; }; /* * Return true if the value of this Decimal is less than `y`, otherwise return false. * */ P.lessThan = P.lt = function (y) { return this.cmp(y) < 0; }; /* * Return true if the value of this Decimal is less than or equal to `y`, otherwise return false. * */ P.lessThanOrEqualTo = P.lte = function (y) { return this.cmp(y) < 1; }; /* * Return the logarithm of the value of this Decimal to the specified base, rounded to `precision` * significant digits using rounding mode `rounding`. * * If no base is specified, return log[10](arg). * * log[base](arg) = ln(arg) / ln(base) * * The result will always be correctly rounded if the base of the log is 10, and 'almost always' * otherwise: * * Depending on the rounding mode, the result may be incorrectly rounded if the first fifteen * rounding digits are [49]99999999999999 or [50]00000000000000. In that case, the maximum error * between the result and the correctly rounded result will be one ulp (unit in the last place). * * log[-b](a) = NaN * log[0](a) = NaN * log[1](a) = NaN * log[NaN](a) = NaN * log[Infinity](a) = NaN * log[b](0) = -Infinity * log[b](-0) = -Infinity * log[b](-a) = NaN * log[b](1) = 0 * log[b](Infinity) = Infinity * log[b](NaN) = NaN * * [base] {number|string|Decimal} The base of the logarithm. * */ P.logarithm = P.log = function (base) { var isBase10, d, denominator, k, inf, num, sd, r, arg = this, Ctor = arg.constructor, pr = Ctor.precision, rm = Ctor.rounding, guard = 5; // Default base is 10. if (base == null) { base = new Ctor(10); isBase10 = true; } else { base = new Ctor(base); d = base.d; // Return NaN if base is negative, or non-finite, or is 0 or 1. if (base.s < 0 || !d || !d[0] || base.eq(1)) return new Ctor(NaN); isBase10 = base.eq(10); } d = arg.d; // Is arg negative, non-finite, 0 or 1? if (arg.s < 0 || !d || !d[0] || arg.eq(1)) { return new Ctor(d && !d[0] ? -1 / 0 : arg.s != 1 ? NaN : d ? 0 : 1 / 0); } // The result will have a non-terminating decimal expansion if base is 10 and arg is not an // integer power of 10. if (isBase10) { if (d.length > 1) { inf = true; } else { for (k = d[0]; k % 10 === 0;) k /= 10; inf = k !== 1; } } external = false; sd = pr + guard; num = naturalLogarithm(arg, sd); denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd); // The result will have 5 rounding digits. r = divide(num, denominator, sd, 1); // If at a rounding boundary, i.e. the result's rounding digits are [49]9999 or [50]0000, // calculate 10 further digits. // // If the result is known to have an infinite decimal expansion, repeat this until it is clear // that the result is above or below the boundary. Otherwise, if after calculating the 10 // further digits, the last 14 are nines, round up and assume the result is exact. // Also assume the result is exact if the last 14 are zero. // // Example of a result that will be incorrectly rounded: // log[1048576](4503599627370502) = 2.60000000000000009610279511444746... // The above result correctly rounded using ROUND_CEIL to 1 decimal place should be 2.7, but it // will be given as 2.6 as there are 15 zeros immediately after the requested decimal place, so // the exact result would be assumed to be 2.6, which rounded using ROUND_CEIL to 1 decimal // place is still 2.6. if (checkRoundingDigits(r.d, k = pr, rm)) { do { sd += 10; num = naturalLogarithm(arg, sd); denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd); r = divide(num, denominator, sd, 1); if (!inf) { // Check for 14 nines from the 2nd rounding digit, as the first may be 4. if (+digitsToString(r.d).slice(k + 1, k + 15) + 1 == 1e14) { r = finalise(r, pr + 1, 0); } break; } } while (checkRoundingDigits(r.d, k += 10, rm)); } external = true; return finalise(r, pr, rm); }; /* * Return a new Decimal whose value is the maximum of the arguments and the value of this Decimal. * * arguments {number|string|Decimal} * P.max = function () { Array.prototype.push.call(arguments, this); return maxOrMin(this.constructor, arguments, 'lt'); }; */ /* * Return a new Decimal whose value is the minimum of the arguments and the value of this Decimal. * * arguments {number|string|Decimal} * P.min = function () { Array.prototype.push.call(arguments, this); return maxOrMin(this.constructor, arguments, 'gt'); }; */ /* * n - 0 = n * n - N = N * n - I = -I * 0 - n = -n * 0 - 0 = 0 * 0 - N = N * 0 - I = -I * N - n = N * N - 0 = N * N - N = N * N - I = N * I - n = I * I - 0 = I * I - N = N * I - I = N * * Return a new Decimal whose value is the value of this Decimal minus `y`, rounded to `precision` * significant digits using rounding mode `rounding`. * */ P.minus = P.sub = function (y) { var d, e, i, j, k, len, pr, rm, xd, xe, xLTy, yd, x = this, Ctor = x.constructor; y = new Ctor(y); // If either is not finite... if (!x.d || !y.d) { // Return NaN if either is NaN. if (!x.s || !y.s) y = new Ctor(NaN); // Return y negated if x is finite and y is ±Infinity. else if (x.d) y.s = -y.s; // Return x if y is finite and x is ±Infinity. // Return x if both are ±Infinity with different signs. // Return NaN if both are ±Infinity with the same sign. else y = new Ctor(y.d || x.s !== y.s ? x : NaN); return y; } // If signs differ... if (x.s != y.s) { y.s = -y.s; return x.plus(y); } xd = x.d; yd = y.d; pr = Ctor.precision; rm = Ctor.rounding; // If either is zero... if (!xd[0] || !yd[0]) { // Return y negated if x is zero and y is non-zero. if (yd[0]) y.s = -y.s; // Return x if y is zero and x is non-zero. else if (xd[0]) y = new Ctor(x); // Return zero if both are zero. // From IEEE 754 (2008) 6.3: 0 - 0 = -0 - -0 = -0 when rounding to -Infinity. else return new Ctor(rm === 3 ? -0 : 0); return external ? finalise(y, pr, rm) : y; } // x and y are finite, non-zero numbers with the same sign. // Calculate base 1e7 exponents. e = mathfloor(y.e / LOG_BASE); xe = mathfloor(x.e / LOG_BASE); xd = xd.slice(); k = xe - e; // If base 1e7 exponents differ... if (k) { xLTy = k < 0; if (xLTy) { d = xd; k = -k; len = yd.length; } else { d = yd; e = xe; len = xd.length; } // Numbers with massively different exponents would result in a very high number of // zeros needing to be prepended, but this can be avoided while still ensuring correct // rounding by limiting the number of zeros to `Math.ceil(pr / LOG_BASE) + 2`. i = Math.max(Math.ceil(pr / LOG_BASE), len) + 2; if (k > i) { k = i; d.length = 1; } // Prepend zeros to equalise exponents. d.reverse(); for (i = k; i--;) d.push(0); d.reverse(); // Base 1e7 exponents equal. } else { // Check digits to determine which is the bigger number. i = xd.length; len = yd.length; xLTy = i < len; if (xLTy) len = i; for (i = 0; i < len; i++) { if (xd[i] != yd[i]) { xLTy = xd[i] < yd[i]; break; } } k = 0; } if (xLTy) { d = xd; xd = yd; yd = d; y.s = -y.s; } len = xd.length; // Append zeros to `xd` if shorter. // Don't add zeros to `yd` if shorter as subtraction only needs to start at `yd` length. for (i = yd.length - len; i > 0; --i) xd[len++] = 0; // Subtract yd from xd. for (i = yd.length; i > k;) { if (xd[--i] < yd[i]) { for (j = i; j && xd[--j] === 0;) xd[j] = BASE - 1; --xd[j]; xd[i] += BASE; } xd[i] -= yd[i]; } // Remove trailing zeros. for (; xd[--len] === 0;) xd.pop(); // Remove leading zeros and adjust exponent accordingly. for (; xd[0] === 0; xd.shift()) --e; // Zero? if (!xd[0]) return new Ctor(rm === 3 ? -0 : 0); y.d = xd; y.e = getBase10Exponent(xd, e); return external ? finalise(y, pr, rm) : y; }; /* * n % 0 = N * n % N = N * n % I = n * 0 % n = 0 * -0 % n = -0 * 0 % 0 = N * 0 % N = N * 0 % I = 0 * N % n = N * N % 0 = N * N % N = N * N % I = N * I % n = N * I % 0 = N * I % N = N * I % I = N * * Return a new Decimal whose value is the value of this Decimal modulo `y`, rounded to * `precision` significant digits using rounding mode `rounding`. * * The result depends on the modulo mode. * */ P.modulo = P.mod = function (y) { var q, x = this, Ctor = x.constructor; y = new Ctor(y); // Return NaN if x is ±Infinity or NaN, or y is NaN or ±0. if (!x.d || !y.s || y.d && !y.d[0]) return new Ctor(NaN); // Return x if y is ±Infinity or x is ±0. if (!y.d || x.d && !x.d[0]) { return finalise(new Ctor(x), Ctor.precision, Ctor.rounding); } // Prevent rounding of intermediate calculations. external = false; if (Ctor.modulo == 9) { // Euclidian division: q = sign(y) * floor(x / abs(y)) // result = x - q * y where 0 <= result < abs(y) q = divide(x, y.abs(), 0, 3, 1); q.s *= y.s; } else { q = divide(x, y, 0, Ctor.modulo, 1); } q = q.times(y); external = true; return x.minus(q); }; /* * Return a new Decimal whose value is the natural exponential of the value of this Decimal, * i.e. the base e raised to the power the value of this Decimal, rounded to `precision` * significant digits using rounding mode `rounding`. * */ P.naturalExponential = P.exp = function () { return naturalExponential(this); }; /* * Return a new Decimal whose value is the natural logarithm of the value of this Decimal, * rounded to `precision` significant digits using rounding mode `rounding`. * */ P.naturalLogarithm = P.ln = function () { return naturalLogarithm(this); }; /* * Return a new Decimal whose value is the value of this Decimal negated, i.e. as if multiplied by * -1. * */ P.negated = P.neg = function () { var x = new this.constructor(this); x.s = -x.s; return finalise(x); }; /* * n + 0 = n * n + N = N * n + I = I * 0 + n = n * 0 + 0 = 0 * 0 + N = N * 0 + I = I * N + n = N * N + 0 = N * N + N = N * N + I = N * I + n = I * I + 0 = I * I + N = N * I + I = I * * Return a new Decimal whose value is the value of this Decimal plus `y`, rounded to `precision` * significant digits using rounding mode `rounding`. * */ P.plus = P.add = function (y) { var carry, d, e, i, k, len, pr, rm, xd, yd, x = this, Ctor = x.constructor; y = new Ctor(y); // If either is not finite... if (!x.d || !y.d) { // Return NaN if either is NaN. if (!x.s || !y.s) y = new Ctor(NaN); // Return x if y is finite and x is ±Infinity. // Return x if both are ±Infinity with the same sign. // Return NaN if both are ±Infinity with different signs. // Return y if x is finite and y is ±Infinity. else if (!x.d) y = new Ctor(y.d || x.s === y.s ? x : NaN); return y; } // If signs differ... if (x.s != y.s) { y.s = -y.s; return x.minus(y); } xd = x.d; yd = y.d; pr = Ctor.precision; rm = Ctor.rounding; // If either is zero... if (!xd[0] || !yd[0]) { // Return x if y is zero. // Return y if y is non-zero. if (!yd[0]) y = new Ctor(x); return external ? finalise(y, pr, rm) : y; } // x and y are finite, non-zero numbers with the same sign. // Calculate base 1e7 exponents. k = mathfloor(x.e / LOG_BASE); e = mathfloor(y.e / LOG_BASE); xd = xd.slice(); i = k - e; // If base 1e7 exponents differ... if (i) { if (i < 0) { d = xd; i = -i; len = yd.length; } else { d = yd; e = k; len = xd.length; } // Limit number of zeros prepended to max(ceil(pr / LOG_BASE), len) + 1. k = Math.ceil(pr / LOG_BASE); len = k > len ? k + 1 : len + 1; if (i > len) { i = len; d.length = 1; } // Prepend zeros to equalise exponents. Note: Faster to use reverse then do unshifts. d.reverse(); for (; i--;) d.push(0); d.reverse(); } len = xd.length; i = yd.length; // If yd is longer than xd, swap xd and yd so xd points to the longer array. if (len - i < 0) { i = len; d = yd; yd = xd; xd = d; } // Only start adding at yd.length - 1 as the further digits of xd can be left as they are. for (carry = 0; i;) { carry = (xd[--i] = xd[i] + yd[i] + carry) / BASE | 0; xd[i] %= BASE; } if (carry) { xd.unshift(carry); ++e; } // Remove trailing zeros. // No need to check for zero, as +x + +y != 0 && -x + -y != 0 for (len = xd.length; xd[--len] == 0;) xd.pop(); y.d = xd; y.e = getBase10Exponent(xd, e); return external ? finalise(y, pr, rm) : y; }; /* * Return the number of significant digits of the value of this Decimal. * * [z] {boolean|number} Whether to count integer-part trailing zeros: true, false, 1 or 0. * */ P.precision = P.sd = function (z) { var k, x = this; if (z !== void 0 && z !== !!z && z !== 1 && z !== 0) throw Error(invalidArgument + z); if (x.d) { k = getPrecision(x.d); if (z && x.e + 1 > k) k = x.e + 1; } else { k = NaN; } return k; }; /* * Return a new Decimal whose value is the value of this Decimal rounded to a whole number using * rounding mode `rounding`. * */ P.round = function () { var x = this, Ctor = x.constructor; return finalise(new Ctor(x), x.e + 1, Ctor.rounding); }; /* * Return a new Decimal whose value is the sine of the value in radians of this Decimal. * * Domain: [-Infinity, Infinity] * Range: [-1, 1] * * sin(x) = x - x^3/3! + x^5/5! - ... * * sin(0) = 0 * sin(-0) = -0 * sin(Infinity) = NaN * sin(-Infinity) = NaN * sin(NaN) = NaN * */ P.sine = P.sin = function () { var pr, rm, x = this, Ctor = x.constructor; if (!x.isFinite()) return new Ctor(NaN); if (x.isZero()) return new Ctor(x); pr = Ctor.precision; rm = Ctor.rounding; Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE; Ctor.rounding = 1; x = sine(Ctor, toLessThanHalfPi(Ctor, x)); Ctor.precision = pr; Ctor.rounding = rm; return finalise(quadrant > 2 ? x.neg() : x, pr, rm, true); }; /* * Return a new Decimal whose value is the square root of this Decimal, rounded to `precision` * significant digits using rounding mode `rounding`. * * sqrt(-n) = N * sqrt(N) = N * sqrt(-I) = N * sqrt(I) = I * sqrt(0) = 0 * sqrt(-0) = -0 * */ P.squareRoot = P.sqrt = function () { var m, n, sd, r, rep, t, x = this, d = x.d, e = x.e, s = x.s, Ctor = x.constructor; // Negative/NaN/Infinity/zero? if (s !== 1 || !d || !d[0]) { return new Ctor(!s || s < 0 && (!d || d[0]) ? NaN : d ? x : 1 / 0); } external = false; // Initial estimate. s = Math.sqrt(+x); // Math.sqrt underflow/overflow? // Pass x to Math.sqrt as integer, then adjust the exponent of the result. if (s == 0 || s == 1 / 0) { n = digitsToString(d); if ((n.length + e) % 2 == 0) n += '0'; s = Math.sqrt(n); e = mathfloor((e + 1) / 2) - (e < 0 || e % 2); if (s == 1 / 0) { n = '1e' + e; } else { n = s.toExponential(); n = n.slice(0, n.indexOf('e') + 1) + e; } r = new Ctor(n); } else { r = new Ctor(s.toString()); } sd = (e = Ctor.precision) + 3; // Newton-Raphson iteration. for (;;) { t = r; r = t.plus(divide(x, t, sd + 2, 1)).times(0.5); // TODO? Replace with for-loop and checkRoundingDigits. if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) { n = n.slice(sd - 3, sd + 1); // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or // 4999, i.e. approaching a rounding boundary, continue the iteration. if (n == '9999' || !rep && n == '4999') { // On the first iteration only, check to see if rounding up gives the exact result as the // nines may infinitely repeat. if (!rep) { finalise(t, e + 1, 0); if (t.times(t).eq(x)) { r = t; break; } } sd += 4; rep = 1; } else { // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result. // If not, then there are further digits and m will be truthy. if (!+n || !+n.slice(1) && n.charAt(0) == '5') { // Truncate to the first rounding digit. finalise(r, e + 1, 1); m = !r.times(r).eq(x); } break; } } } external = true; return finalise(r, e, Ctor.rounding, m); }; /* * Return a new Decimal whose value is the tangent of the value in radians of this Decimal. * * Domain: [-Infinity, Infinity] * Range: [-Infinity, Infinity] * * tan(0) = 0 * tan(-0) = -0 * tan(Infinity) = NaN * tan(-Infinity) = NaN * tan(NaN) = NaN * */ P.tangent = P.tan = function () { var pr, rm, x = this, Ctor = x.constructor; if (!x.isFinite()) return new Ctor(NaN); if (x.isZero()) return new Ctor(x); pr = Ctor.precision; rm = Ctor.rounding; Ctor.precision = pr + 10; Ctor.rounding = 1; x = x.sin(); x.s = 1; x = divide(x, new Ctor(1).minus(x.times(x)).sqrt(), pr + 10, 0); Ctor.precision = pr; Ctor.rounding = rm; return finalise(quadrant == 2 || quadrant == 4 ? x.neg() : x, pr, rm, true); }; /* * n * 0 = 0 * n * N = N * n * I = I * 0 * n = 0 * 0 * 0 = 0 * 0 * N = N * 0 * I = N * N * n = N * N * 0 = N * N * N = N * N * I = N * I * n = I * I * 0 = N * I * N = N * I * I = I * * Return a new Decimal whose value is this Decimal times `y`, rounded to `precision` significant * digits using rounding mode `rounding`. * */ P.times = P.mul = function (y) { var carry, e, i, k, r, rL, t, xdL, ydL, x = this, Ctor = x.constructor, xd = x.d, yd = (y = new Ctor(y)).d; y.s *= x.s; // If either is NaN, ±Infinity or ±0... if (!xd || !xd[0] || !yd || !yd[0]) { return new Ctor(!y.s || xd && !xd[0] && !yd || yd && !yd[0] && !xd // Return NaN if either is NaN. // Return NaN if x is ±0 and y is ±Infinity, or y is ±0 and x is ±Infinity. ? NaN // Return ±Infinity if either is ±Infinity. // Return ±0 if either is ±0. : !xd || !yd ? y.s / 0 : y.s * 0); } e = mathfloor(x.e / LOG_BASE) + mathfloor(y.e / LOG_BASE); xdL = xd.length; ydL = yd.length; // Ensure xd points to the longer array. if (xdL < ydL) { r = xd; xd = yd; yd = r; rL = xdL; xdL = ydL; ydL = rL; } // Initialise the result array with zeros. r = []; rL = xdL + ydL; for (i = rL; i--;) r.push(0); // Multiply! for (i = ydL; --i >= 0;) { carry = 0; for (k = xdL + i; k > i;) { t = r[k] + yd[i] * xd[k - i - 1] + carry; r[k--] = t % BASE | 0; carry = t / BASE | 0; } r[k] = (r[k] + carry) % BASE | 0; } // Remove trailing zeros. for (; !r[--rL];) r.pop(); if (carry) ++e; else r.shift(); y.d = r; y.e = getBase10Exponent(r, e); return external ? finalise(y, Ctor.precision, Ctor.rounding) : y; }; /* * Return a string representing the value of this Decimal in base 2, round to `sd` significant * digits using rounding mode `rm`. * * If the optional `sd` argument is present then return binary exponential notation. * * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. * */ P.toBinary = function (sd, rm) { return toStringBinary(this, 2, sd, rm); }; /* * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `dp` * decimal places using rounding mode `rm` or `rounding` if `rm` is omitted. * * If `dp` is omitted, return a new Decimal whose value is the value of this Decimal. * * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. * */ P.toDecimalPlaces = P.toDP = function (dp, rm) { var x = this, Ctor = x.constructor; x = new Ctor(x); if (dp === void 0) return x; checkInt32(dp, 0, MAX_DIGITS); if (rm === void 0) rm = Ctor.rounding; else checkInt32(rm, 0, 8); return finalise(x, dp + x.e + 1, rm); }; /* * Return a string representing the value of this Decimal in exponential notation rounded to * `dp` fixed decimal places using rounding mode `rounding`. * * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. * */ P.toExponential = function (dp, rm) { var str, x = this, Ctor = x.constructor; if (dp === void 0) { str = finiteToString(x, true); } else { checkInt32(dp, 0, MAX_DIGITS); if (rm === void 0) rm = Ctor.rounding; else checkInt32(rm, 0, 8); x = finalise(new Ctor(x), dp + 1, rm); str = finiteToString(x, true, dp + 1); } return x.isNeg() && !x.isZero() ? '-' + str : str; }; /* * Return a string representing the value of this Decimal in normal (fixed-point) notation to * `dp` fixed decimal places and rounded using rounding mode `rm` or `rounding` if `rm` is * omitted. * * As with JavaScript numbers, (-0).toFixed(0) is '0', but e.g. (-0.00001).toFixed(0) is '-0'. * * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. * * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'. * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'. * (-0).toFixed(3) is '0.000'. * (-0.5).toFixed(0) is '-0'. * */ P.toFixed = function (dp, rm) { var str, y, x = this, Ctor = x.constructor; if (dp === void 0) { str = finiteToString(x); } else { checkInt32(dp, 0, MAX_DIGITS); if (rm === void 0) rm = Ctor.rounding; else checkInt32(rm, 0, 8); y = finalise(new Ctor(x), dp + x.e + 1, rm); str = finiteToString(y, false, dp + y.e + 1); } // To determine whether to add the minus sign look at the value before it was rounded, // i.e. look at `x` rather than `y`. return x.isNeg() && !x.isZero() ? '-' + str : str; }; /* * Return an array representing the value of this Decimal as a simple fraction with an integer * numerator and an integer denominator. * * The denominator will be a positive non-zero value less than or equal to the specified maximum * denominator. If a maximum denominator is not specified, the denominator will be the lowest * value necessary to represent the number exactly. * * [maxD] {number|string|Decimal} Maximum denominator. Integer >= 1 and < Infinity. * */ P.toFraction = function (maxD) { var d, d0, d1, d2, e, k, n, n0, n1, pr, q, r, x = this, xd = x.d, Ctor = x.constructor; if (!xd) return new Ctor(x); n1 = d0 = new Ctor(1); d1 = n0 = new Ctor(0); d = new Ctor(d1); e = d.e = getPrecision(xd) - x.e - 1; k = e % LOG_BASE; d.d[0] = mathpow(10, k < 0 ? LOG_BASE + k : k); if (maxD == null) { // d is 10**e, the minimum max-denominator needed. maxD = e > 0 ? d : n1; } else { n = new Ctor(maxD); if (!n.isInt() || n.lt(n1)) throw Error(invalidArgument + n); maxD = n.gt(d) ? (e > 0 ? d : n1) : n; } external = false; n = new Ctor(digitsToString(xd)); pr = Ctor.precision; Ctor.precision = e = xd.length * LOG_BASE * 2; for (;;) { q = divide(n, d, 0, 1, 1); d2 = d0.plus(q.times(d1)); if (d2.cmp(maxD) == 1) break; d0 = d1; d1 = d2; d2 = n1; n1 = n0.plus(q.times(d2)); n0 = d2; d2 = d; d = n.minus(q.times(d2)); n = d2; } d2 = divide(maxD.minus(d0), d1, 0, 1, 1); n0 = n0.plus(d2.times(n1)); d0 = d0.plus(d2.times(d1)); n0.s = n1.s = x.s; // Determine which fraction is closer to x, n0/d0 or n1/d1? r = divide(n1, d1, e, 1).minus(x).abs().cmp(divide(n0, d0, e, 1).minus(x).abs()) < 1 ? [n1, d1] : [n0, d0]; Ctor.precision = pr; external = true; return r; }; /* * Return a string representing the value of this Decimal in base 16, round to `sd` significant * digits using rounding mode `rm`. * * If the optional `sd` argument is present then return binary exponential notation. * * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. * */ P.toHexadecimal = P.toHex = function (sd, rm) { return toStringBinary(this, 16, sd, rm); }; /* * Returns a new Decimal whose value is the nearest multiple of `y` in the direction of rounding * mode `rm`, or `Decimal.rounding` if `rm` is omitted, to the value of this Decimal. * * The return value will always have the same sign as this Decimal, unless either this Decimal * or `y` is NaN, in which case the return value will be also be NaN. * * The return value is not affected by the value of `precision`. * * y {number|string|Decimal} The magnitude to round to a multiple of. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. * * 'toNearest() rounding mode not an integer: {rm}' * 'toNearest() rounding mode out of range: {rm}' * */ P.toNearest = function (y, rm) { var x = this, Ctor = x.constructor; x = new Ctor(x); if (y == null) { // If x is not finite, return x. if (!x.d) return x; y = new Ctor(1); rm = Ctor.rounding; } else { y = new Ctor(y); if (rm === void 0) { rm = Ctor.rounding; } else { checkInt32(rm, 0, 8); } // If x is not finite, return x if y is not NaN, else NaN. if (!x.d) return y.s ? x : y; // If y is not finite, return Infinity with the sign of x if y is Infinity, else NaN. if (!y.d) { if (y.s) y.s = x.s; return y; } } // If y is not zero, calculate the nearest multiple of y to x. if (y.d[0]) { external = false; x = divide(x, y, 0, rm, 1).times(y); external = true; finalise(x); // If y is zero, return zero with the sign of x. } else { y.s = x.s; x = y; } return x; }; /* * Return the value of this Decimal converted to a number primitive. * Zero keeps its sign. * */ P.toNumber = function () { return +this; }; /* * Return a string representing the value of this Decimal in base 8, round to `sd` significant * digits using rounding mode `rm`. * * If the optional `sd` argument is present then return binary exponential notation. * * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. * */ P.toOctal = function (sd, rm) { return toStringBinary(this, 8, sd, rm); }; /* * Return a new Decimal whose value is the value of this Decimal raised to the power `y`, rounded * to `precision` significant digits using rounding mode `rounding`. * * ECMAScript compliant. * * pow(x, NaN) = NaN * pow(x, ±0) = 1 * pow(NaN, non-zero) = NaN * pow(abs(x) > 1, +Infinity) = +Infinity * pow(abs(x) > 1, -Infinity) = +0 * pow(abs(x) == 1, ±Infinity) = NaN * pow(abs(x) < 1, +Infinity) = +0 * pow(abs(x) < 1, -Infinity) = +Infinity * pow(+Infinity, y > 0) = +Infinity * pow(+Infinity, y < 0) = +0 * pow(-Infinity, odd integer > 0) = -Infinity * pow(-Infinity, even integer > 0) = +Infinity * pow(-Infinity, odd integer < 0) = -0 * pow(-Infinity, even integer < 0) = +0 * pow(+0, y > 0) = +0 * pow(+0, y < 0) = +Infinity * pow(-0, odd integer > 0) = -0 * pow(-0, even integer > 0) = +0 * pow(-0, odd integer < 0) = -Infinity * pow(-0, even integer < 0) = +Infinity * pow(finite x < 0, finite non-integer) = NaN * * For non-integer or very large exponents pow(x, y) is calculated using * * x^y = exp(y*ln(x)) * * Assuming the first 15 rounding digits are each equally likely to be any digit 0-9, the * probability of an incorrectly rounded result * P([49]9{14} | [50]0{14}) = 2 * 0.2 * 10^-14 = 4e-15 = 1/2.5e+14 * i.e. 1 in 250,000,000,000,000 * * If a result is incorrectly rounded the maximum error will be 1 ulp (unit in last place). * * y {number|string|Decimal} The power to which to raise this Decimal. * */ P.toPower = P.pow = function (y) { var e, k, pr, r, rm, s, x = this, Ctor = x.constructor, yn = +(y = new Ctor(y)); // Either ±Infinity, NaN or ±0? if (!x.d || !y.d || !x.d[0] || !y.d[0]) return new Ctor(mathpow(+x, yn)); x = new Ctor(x); if (x.eq(1)) return x; pr = Ctor.precision; rm = Ctor.rounding; if (y.eq(1)) return finalise(x, pr, rm); // y exponent e = mathfloor(y.e / LOG_BASE); // If y is a small integer use the 'exponentiation by squaring' algorithm. if (e >= y.d.length - 1 && (k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) { r = intPow(Ctor, x, k, pr); return y.s < 0 ? new Ctor(1).div(r) : finalise(r, pr, rm); } s = x.s; // if x is negative if (s < 0) { // if y is not an integer if (e < y.d.length - 1) return new Ctor(NaN); // Result is positive if x is negative and the last digit of integer y is even. if ((y.d[e] & 1) == 0) s = 1; // if x.eq(-1) if (x.e == 0 && x.d[0] == 1 && x.d.length == 1) { x.s = s; return x; } } // Estimate result exponent. // x^y = 10^e, where e = y * log10(x) // log10(x) = log10(x_significand) + x_exponent // log10(x_significand) = ln(x_significand) / ln(10) k = mathpow(+x, yn); e = k == 0 || !isFinite(k) ? mathfloor(yn * (Math.log('0.' + digitsToString(x.d)) / Math.LN10 + x.e + 1)) : new Ctor(k + '').e; // Exponent estimate may be incorrect e.g. x: 0.999999999999999999, y: 2.29, e: 0, r.e: -1. // Overflow/underflow? if (e > Ctor.maxE + 1 || e < Ctor.minE - 1) return new Ctor(e > 0 ? s / 0 : 0); external = false; Ctor.rounding = x.s = 1; // Estimate the extra guard digits needed to ensure five correct rounding digits from // naturalLogarithm(x). Example of failure without these extra digits (precision: 10): // new Decimal(2.32456).pow('2087987436534566.46411') // should be 1.162377823e+764914905173815, but is 1.162355823e+764914905173815 k = Math.min(12, (e + '').length); // r = x^y = exp(y*ln(x)) r = naturalExponential(y.times(naturalLogarithm(x, pr + k)), pr); // r may be Infinity, e.g. (0.9999999999999999).pow(-1e+40) if (r.d) { // Truncate to the required precision plus five rounding digits. r = finalise(r, pr + 5, 1); // If the rounding digits are [49]9999 or [50]0000 increase the precision by 10 and recalculate // the result. if (checkRoundingDigits(r.d, pr, rm)) { e = pr + 10; // Truncate to the increased precision plus five rounding digits. r = finalise(naturalExponential(y.times(naturalLogarithm(x, e + k)), e), e + 5, 1); // Check for 14 nines from the 2nd rounding digit (the first rounding digit may be 4 or 9). if (+digitsToString(r.d).slice(pr + 1, pr + 15) + 1 == 1e14) { r = finalise(r, pr + 1, 0); } } } r.s = s; external = true; Ctor.rounding = rm; return finalise(r, pr, rm); }; /* * Return a string representing the value of this Decimal rounded to `sd` significant digits * using rounding mode `rounding`. * * Return exponential notation if `sd` is less than the number of digits necessary to represent * the integer part of the value in normal notation. * * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. * */ P.toPrecision = function (sd, rm) { var str, x = this, Ctor = x.constructor; if (sd === void 0) { str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos); } else { checkInt32(sd, 1, MAX_DIGITS); if (rm === void 0) rm = Ctor.rounding; else checkInt32(rm, 0, 8); x = finalise(new Ctor(x), sd, rm); str = finiteToString(x, sd <= x.e || x.e <= Ctor.toExpNeg, sd); } return x.isNeg() && !x.isZero() ? '-' + str : str; }; /* * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `sd` * significant digits using rounding mode `rm`, or to `precision` and `rounding` respectively if * omitted. * * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. * * 'toSD() digits out of range: {sd}' * 'toSD() digits not an integer: {sd}' * 'toSD() rounding mode not an integer: {rm}' * 'toSD() rounding mode out of range: {rm}' * */ P.toSignificantDigits = P.toSD = function (sd, rm) { var x = this, Ctor = x.constructor; if (sd === void 0) { sd = Ctor.precision; rm = Ctor.rounding; } else { checkInt32(sd, 1, MAX_DIGITS); if (rm === void 0) rm = Ctor.rounding; else checkInt32(rm, 0, 8); } return finalise(new Ctor(x), sd, rm); }; /* * Return a string representing the value of this Decimal. * * Return exponential notation if this Decimal has a positive exponent equal to or greater than * `toExpPos`, or a negative exponent equal to or less than `toExpNeg`. * */ P.toString = function () { var x = this, Ctor = x.constructor, str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos); return x.isNeg() && !x.isZero() ? '-' + str : str; }; /* * Return a new Decimal whose value is the value of this Decimal truncated to a whole number. * */ P.truncated = P.trunc = function () { return finalise(new this.constructor(this), this.e + 1, 1); }; /* * Return a string representing the value of this Decimal. * Unlike `toString`, negative zero will include the minus sign. * */ P.valueOf = P.toJSON = function () { var x = this, Ctor = x.constructor, str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos); return x.isNeg() ? '-' + str : str; }; /* // Add aliases to match BigDecimal method names. // P.add = P.plus; P.subtract = P.minus; P.multiply = P.times; P.divide = P.div; P.remainder = P.mod; P.compareTo = P.cmp; P.negate = P.neg; */ // Helper functions for Decimal.prototype (P) and/or Decimal methods, and their callers. /* * digitsToString P.cubeRoot, P.logarithm, P.squareRoot, P.toFraction, P.toPower, * finiteToString, naturalExponential, naturalLogarithm * checkInt32 P.toDecimalPlaces, P.toExponential, P.toFixed, P.toNearest, * P.toPrecision, P.toSignificantDigits, toStringBinary, random * checkRoundingDigits P.logarithm, P.toPower, naturalExponential, naturalLogarithm * convertBase toStringBinary, parseOther * cos P.cos * divide P.atanh, P.cubeRoot, P.dividedBy, P.dividedToIntegerBy, * P.logarithm, P.modulo, P.squareRoot, P.tan, P.tanh, P.toFraction, * P.toNearest, toStringBinary, naturalExponential, naturalLogarithm, * taylorSeries, atan2, parseOther * finalise P.absoluteValue, P.atan, P.atanh, P.ceil, P.cos, P.cosh, * P.cubeRoot, P.dividedToIntegerBy, P.floor, P.logarithm, P.minus, * P.modulo, P.negated, P.plus, P.round, P.sin, P.sinh, P.squareRoot, * P.tan, P.times, P.toDecimalPlaces, P.toExponential, P.toFixed, * P.toNearest, P.toPower, P.toPrecision, P.toSignificantDigits, * P.truncated, divide, getLn10, getPi, naturalExponential, * naturalLogarithm, ceil, floor, round, trunc * finiteToString P.toExponential, P.toFixed, P.toPrecision, P.toString, P.valueOf, * toStringBinary * getBase10Exponent P.minus, P.plus, P.times, parseOther * getLn10 P.logarithm, naturalLogarithm * getPi P.acos, P.asin, P.atan, toLessThanHalfPi, atan2 * getPrecision P.precision, P.toFraction * getZeroString digitsToString, finiteToString * intPow P.toPower, parseOther * isOdd toLessThanHalfPi * maxOrMin max, min * naturalExponential P.naturalExponential, P.toPower * naturalLogarithm P.acosh, P.asinh, P.atanh, P.logarithm, P.naturalLogarithm, * P.toPower, naturalExponential * nonFiniteToString finiteToString, toStringBinary * parseDecimal Decimal * parseOther Decimal * sin P.sin * taylorSeries P.cosh, P.sinh, cos, sin * toLessThanHalfPi P.cos, P.sin * toStringBinary P.toBinary, P.toHexadecimal, P.toOctal * truncate intPow * * Throws: P.logarithm, P.precision, P.toFraction, checkInt32, getLn10, getPi, * naturalLogarithm, config, parseOther, random, Decimal */ function digitsToString(d) { var i, k, ws, indexOfLastWord = d.length - 1, str = '', w = d[0]; if (indexOfLastWord > 0) { str += w; for (i = 1; i < indexOfLastWord; i++) { ws = d[i] + ''; k = LOG_BASE - ws.length; if (k) str += getZeroString(k); str += ws; } w = d[i]; ws = w + ''; k = LOG_BASE - ws.length; if (k) str += getZeroString(k); } else if (w === 0) { return '0'; } // Remove trailing zeros of last w. for (; w % 10 === 0;) w /= 10; return str + w; } function checkInt32(i, min, max) { if (i !== ~~i || i < min || i > max) { throw Error(invalidArgument + i); } } /* * Check 5 rounding digits if `repeating` is null, 4 otherwise. * `repeating == null` if caller is `log` or `pow`, * `repeating != null` if caller is `naturalLogarithm` or `naturalExponential`. */ function checkRoundingDigits(d, i, rm, repeating) { var di, k, r, rd; // Get the length of the first word of the array d. for (k = d[0]; k >= 10; k /= 10) --i; // Is the rounding digit in the first word of d? if (--i < 0) { i += LOG_BASE; di = 0; } else { di = Math.ceil((i + 1) / LOG_BASE); i %= LOG_BASE; } // i is the index (0 - 6) of the rounding digit. // E.g. if within the word 3487563 the first rounding digit is 5, // then i = 4, k = 1000, rd = 3487563 % 1000 = 563 k = mathpow(10, LOG_BASE - i); rd = d[di] % k | 0; if (repeating == null) { if (i < 3) { if (i == 0) rd = rd / 100 | 0; else if (i == 1) rd = rd / 10 | 0; r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 50000 || rd == 0; } else { r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) && (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 || (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0; } } else { if (i < 4) { if (i == 0) rd = rd / 1000 | 0; else if (i == 1) rd = rd / 100 | 0; else if (i == 2) rd = rd / 10 | 0; r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999; } else { r = ((repeating || rm < 4) && rd + 1 == k || (!repeating && rm > 3) && rd + 1 == k / 2) && (d[di + 1] / k / 1000 | 0) == mathpow(10, i - 3) - 1; } } return r; } // Convert string of `baseIn` to an array of numbers of `baseOut`. // Eg. convertBase('255', 10, 16) returns [15, 15]. // Eg. convertBase('ff', 16, 10) returns [2, 5, 5]. function convertBase(str, baseIn, baseOut) { var j, arr = [0], arrL, i = 0, strL = str.length; for (; i < strL;) { for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn; arr[0] += NUMERALS.indexOf(str.charAt(i++)); for (j = 0; j < arr.length; j++) { if (arr[j] > baseOut - 1) { if (arr[j + 1] === void 0) arr[j + 1] = 0; arr[j + 1] += arr[j] / baseOut | 0; arr[j] %= baseOut; } } } return arr.reverse(); } /* * cos(x) = 1 - x^2/2! + x^4/4! - ... * |x| < pi/2 * */ function cosine(Ctor, x) { var k, y, len = x.d.length; // Argument reduction: cos(4x) = 8*(cos^4(x) - cos^2(x)) + 1 // i.e. cos(x) = 8*(cos^4(x/4) - cos^2(x/4)) + 1 // Estimate the optimum number of times to use the argument reduction. if (len < 32) { k = Math.ceil(len / 3); y = (1 / tinyPow(4, k)).toString(); } else { k = 16; y = '2.3283064365386962890625e-10'; } Ctor.precision += k; x = taylorSeries(Ctor, 1, x.times(y), new Ctor(1)); // Reverse argument reduction for (var i = k; i--;) { var cos2x = x.times(x); x = cos2x.times(cos2x).minus(cos2x).times(8).plus(1); } Ctor.precision -= k; return x; } /* * Perform division in the specified base. */ var divide = (function () { // Assumes non-zero x and k, and hence non-zero result. function multiplyInteger(x, k, base) { var temp, carry = 0, i = x.length; for (x = x.slice(); i--;) { temp = x[i] * k + carry; x[i] = temp % base | 0; carry = temp / base | 0; } if (carry) x.unshift(carry); return x; } function compare(a, b, aL, bL) { var i, r; if (aL != bL) { r = aL > bL ? 1 : -1; } else { for (i = r = 0; i < aL; i++) { if (a[i] != b[i]) { r = a[i] > b[i] ? 1 : -1; break; } } } return r; } function subtract(a, b, aL, base) { var i = 0; // Subtract b from a. for (; aL--;) { a[aL] -= i; i = a[aL] < b[aL] ? 1 : 0; a[aL] = i * base + a[aL] - b[aL]; } // Remove leading zeros. for (; !a[0] && a.length > 1;) a.shift(); } return function (x, y, pr, rm, dp, base) { var cmp, e, i, k, logBase, more, prod, prodL, q, qd, rem, remL, rem0, sd, t, xi, xL, yd0, yL, yz, Ctor = x.constructor, sign = x.s == y.s ? 1 : -1, xd = x.d, yd = y.d; // Either NaN, Infinity or 0? if (!xd || !xd[0] || !yd || !yd[0]) { return new Ctor(// Return NaN if either NaN, or both Infinity or 0. !x.s || !y.s || (xd ? yd && xd[0] == yd[0] : !yd) ? NaN : // Return ±0 if x is 0 or y is ±Infinity, or return ±Infinity as y is 0. xd && xd[0] == 0 || !yd ? sign * 0 : sign / 0); } if (base) { logBase = 1; e = x.e - y.e; } else { base = BASE; logBase = LOG_BASE; e = mathfloor(x.e / logBase) - mathfloor(y.e / logBase); } yL = yd.length; xL = xd.length; q = new Ctor(sign); qd = q.d = []; // Result exponent may be one less than e. // The digit array of a Decimal from toStringBinary may have trailing zeros. for (i = 0; yd[i] == (xd[i] || 0); i++); if (yd[i] > (xd[i] || 0)) e--; if (pr == null) { sd = pr = Ctor.precision; rm = Ctor.rounding; } else if (dp) { sd = pr + (x.e - y.e) + 1; } else { sd = pr; } if (sd < 0) { qd.push(1); more = true; } else { // Convert precision in number of base 10 digits to base 1e7 digits. sd = sd / logBase + 2 | 0; i = 0; // divisor < 1e7 if (yL == 1) { k = 0; yd = yd[0]; sd++; // k is the carry. for (; (i < xL || k) && sd--; i++) { t = k * base + (xd[i] || 0); qd[i] = t / yd | 0; k = t % yd | 0; } more = k || i < xL; // divisor >= 1e7 } else { // Normalise xd and yd so highest order digit of yd is >= base/2 k = base / (yd[0] + 1) | 0; if (k > 1) { yd = multiplyInteger(yd, k, base); xd = multiplyInteger(xd, k, base); yL = yd.length; xL = xd.length; } xi = yL; rem = xd.slice(0, yL); remL = rem.length; // Add zeros to make remainder as long as divisor. for (; remL < yL;) rem[remL++] = 0; yz = yd.slice(); yz.unshift(0); yd0 = yd[0]; if (yd[1] >= base / 2) ++yd0; do { k = 0; // Compare divisor and remainder. cmp = compare(yd, rem, yL, remL); // If divisor < remainder. if (cmp < 0) { // Calculate trial digit, k. rem0 = rem[0]; if (yL != remL) rem0 = rem0 * base + (rem[1] || 0); // k will be how many times the divisor goes into the current remainder. k = rem0 / yd0 | 0; // Algorithm: // 1. product = divisor * trial digit (k) // 2. if product > remainder: product -= divisor, k-- // 3. remainder -= product // 4. if product was < remainder at 2: // 5. compare new remainder and divisor // 6. If remainder > divisor: remainder -= divisor, k++ if (k > 1) { if (k >= base) k = base - 1; // product = divisor * trial digit. prod = multiplyInteger(yd, k, base); prodL = prod.length; remL = rem.length; // Compare product and remainder. cmp = compare(prod, rem, prodL, remL); // product > remainder. if (cmp == 1) { k--; // Subtract divisor from product. subtract(prod, yL < prodL ? yz : yd, prodL, base); } } else { // cmp is -1. // If k is 0, there is no need to compare yd and rem again below, so change cmp to 1 // to avoid it. If k is 1 there is a need to compare yd and rem again below. if (k == 0) cmp = k = 1; prod = yd.slice(); } prodL = prod.length; if (prodL < remL) prod.unshift(0); // Subtract product from remainder. subtract(rem, prod, remL, base); // If product was < previous remainder. if (cmp == -1) { remL = rem.length; // Compare divisor and new remainder. cmp = compare(yd, rem, yL, remL); // If divisor < new remainder, subtract divisor from remainder. if (cmp < 1) { k++; // Subtract divisor from remainder. subtract(rem, yL < remL ? yz : yd, remL, base); } } remL = rem.length; } else if (cmp === 0) { k++; rem = [0]; } // if cmp === 1, k will be 0 // Add the next digit, k, to the result array. qd[i++] = k; // Update the remainder. if (cmp && rem[0]) { rem[remL++] = xd[xi] || 0; } else { rem = [xd[xi]]; remL = 1; } } while ((xi++ < xL || rem[0] !== void 0) && sd--); more = rem[0] !== void 0; } // Leading zero? if (!qd[0]) qd.shift(); } // logBase is 1 when divide is being used for base conversion. if (logBase == 1) { q.e = e; inexact = more; } else { // To calculate q.e, first get the number of digits of qd[0]. for (i = 1, k = qd[0]; k >= 10; k /= 10) i++; q.e = i + e * logBase - 1; finalise(q, dp ? pr + q.e + 1 : pr, rm, more); } return q; }; })(); /* * Round `x` to `sd` significant digits using rounding mode `rm`. * Check for over/under-flow. */ function finalise(x, sd, rm, isTruncated) { var digits, i, j, k, rd, roundUp, w, xd, xdi, Ctor = x.constructor; // Don't round if sd is null or undefined. out: if (sd != null) { xd = x.d; // Infinity/NaN. if (!xd) return x; // rd: the rounding digit, i.e. the digit after the digit that may be rounded up. // w: the word of xd containing rd, a base 1e7 number. // xdi: the index of w within xd. // digits: the number of digits of w. // i: what would be the index of rd within w if all the numbers were 7 digits long (i.e. if // they had leading zeros) // j: if > 0, the actual index of rd within w (if < 0, rd is a leading zero). // Get the length of the first word of the digits array xd. for (digits = 1, k = xd[0]; k >= 10; k /= 10) digits++; i = sd - digits; // Is the rounding digit in the first word of xd? if (i < 0) { i += LOG_BASE; j = sd; w = xd[xdi = 0]; // Get the rounding digit at index j of w. rd = w / mathpow(10, digits - j - 1) % 10 | 0; } else { xdi = Math.ceil((i + 1) / LOG_BASE); k = xd.length; if (xdi >= k) { if (isTruncated) { // Needed by `naturalExponential`, `naturalLogarithm` and `squareRoot`. for (; k++ <= xdi;) xd.push(0); w = rd = 0; digits = 1; i %= LOG_BASE; j = i - LOG_BASE + 1; } else { break out; } } else { w = k = xd[xdi]; // Get the number of digits of w. for (digits = 1; k >= 10; k /= 10) digits++; // Get the index of rd within w. i %= LOG_BASE; // Get the index of rd within w, adjusted for leading zeros. // The number of leading zeros of w is given by LOG_BASE - digits. j = i - LOG_BASE + digits; // Get the rounding digit at index j of w. rd = j < 0 ? 0 : w / mathpow(10, digits - j - 1) % 10 | 0; } } // Are there any non-zero digits after the rounding digit? isTruncated = isTruncated || sd < 0 || xd[xdi + 1] !== void 0 || (j < 0 ? w : w % mathpow(10, digits - j - 1)); // The expression `w % mathpow(10, digits - j - 1)` returns all the digits of w to the right // of the digit at (left-to-right) index j, e.g. if w is 908714 and j is 2, the expression // will give 714. roundUp = rm < 4 ? (rd || isTruncated) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : rd > 5 || rd == 5 && (rm == 4 || isTruncated || rm == 6 && // Check whether the digit to the left of the rounding digit is odd. ((i > 0 ? j > 0 ? w / mathpow(10, digits - j) : 0 : xd[xdi - 1]) % 10) & 1 || rm == (x.s < 0 ? 8 : 7)); if (sd < 1 || !xd[0]) { xd.length = 0; if (roundUp) { // Convert sd to decimal places. sd -= x.e + 1; // 1, 0.1, 0.01, 0.001, 0.0001 etc. xd[0] = mathpow(10, (LOG_BASE - sd % LOG_BASE) % LOG_BASE); x.e = -sd || 0; } else { // Zero. xd[0] = x.e = 0; } return x; } // Remove excess digits. if (i == 0) { xd.length = xdi; k = 1; xdi--; } else { xd.length = xdi + 1; k = mathpow(10, LOG_BASE - i); // E.g. 56700 becomes 56000 if 7 is the rounding digit. // j > 0 means i > number of leading zeros of w. xd[xdi] = j > 0 ? (w / mathpow(10, digits - j) % mathpow(10, j) | 0) * k : 0; } if (roundUp) { for (;;) { // Is the digit to be rounded up in the first word of xd? if (xdi == 0) { // i will be the length of xd[0] before k is added. for (i = 1, j = xd[0]; j >= 10; j /= 10) i++; j = xd[0] += k; for (k = 1; j >= 10; j /= 10) k++; // if i != k the length has increased. if (i != k) { x.e++; if (xd[0] == BASE) xd[0] = 1; } break; } else { xd[xdi] += k; if (xd[xdi] != BASE) break; xd[xdi--] = 0; k = 1; } } } // Remove trailing zeros. for (i = xd.length; xd[--i] === 0;) xd.pop(); } if (external) { // Overflow? if (x.e > Ctor.maxE) { // Infinity. x.d = null; x.e = NaN; // Underflow? } else if (x.e < Ctor.minE) { // Zero. x.e = 0; x.d = [0]; // Ctor.underflow = true; } // else Ctor.underflow = false; } return x; } function finiteToString(x, isExp, sd) { if (!x.isFinite()) return nonFiniteToString(x); var k, e = x.e, str = digitsToString(x.d), len = str.length; if (isExp) { if (sd && (k = sd - len) > 0) { str = str.charAt(0) + '.' + str.slice(1) + getZeroString(k); } else if (len > 1) { str = str.charAt(0) + '.' + str.slice(1); } str = str + (x.e < 0 ? 'e' : 'e+') + x.e; } else if (e < 0) { str = '0.' + getZeroString(-e - 1) + str; if (sd && (k = sd - len) > 0) str += getZeroString(k); } else if (e >= len) { str += getZeroString(e + 1 - len); if (sd && (k = sd - e - 1) > 0) str = str + '.' + getZeroString(k); } else { if ((k = e + 1) < len) str = str.slice(0, k) + '.' + str.slice(k); if (sd && (k = sd - len) > 0) { if (e + 1 === len) str += '.'; str += getZeroString(k); } } return str; } // Calculate the base 10 exponent from the base 1e7 exponent. function getBase10Exponent(digits, e) { var w = digits[0]; // Add the number of digits of the first word of the digits array. for ( e *= LOG_BASE; w >= 10; w /= 10) e++; return e; } function getLn10(Ctor, sd, pr) { if (sd > LN10_PRECISION) { // Reset global state in case the exception is caught. external = true; if (pr) Ctor.precision = pr; throw Error(precisionLimitExceeded); } return finalise(new Ctor(LN10), sd, 1, true); } function getPi(Ctor, sd, rm) { if (sd > PI_PRECISION) throw Error(precisionLimitExceeded); return finalise(new Ctor(PI), sd, rm, true); } function getPrecision(digits) { var w = digits.length - 1, len = w * LOG_BASE + 1; w = digits[w]; // If non-zero... if (w) { // Subtract the number of trailing zeros of the last word. for (; w % 10 == 0; w /= 10) len--; // Add the number of digits of the first word. for (w = digits[0]; w >= 10; w /= 10) len++; } return len; } function getZeroString(k) { var zs = ''; for (; k--;) zs += '0'; return zs; } /* * Return a new Decimal whose value is the value of Decimal `x` to the power `n`, where `n` is an * integer of type number. * * Implements 'exponentiation by squaring'. Called by `pow` and `parseOther`. * */ function intPow(Ctor, x, n, pr) { var isTruncated, r = new Ctor(1), // Max n of 9007199254740991 takes 53 loop iterations. // Maximum digits array length; leaves [28, 34] guard digits. k = Math.ceil(pr / LOG_BASE + 4); external = false; for (;;) { if (n % 2) { r = r.times(x); if (truncate(r.d, k)) isTruncated = true; } n = mathfloor(n / 2); if (n === 0) { // To ensure correct rounding when r.d is truncated, increment the last word if it is zero. n = r.d.length - 1; if (isTruncated && r.d[n] === 0) ++r.d[n]; break; } x = x.times(x); truncate(x.d, k); } external = true; return r; } function isOdd(n) { return n.d[n.d.length - 1] & 1; } /* * Handle `max` and `min`. `ltgt` is 'lt' or 'gt'. */ function maxOrMin(Ctor, args, ltgt) { var y, x = new Ctor(args[0]), i = 0; for (; ++i < args.length;) { y = new Ctor(args[i]); if (!y.s) { x = y; break; } else if (x[ltgt](y)) { x = y; } } return x; } /* * Return a new Decimal whose value is the natural exponential of `x` rounded to `sd` significant * digits. * * Taylor/Maclaurin series. * * exp(x) = x^0/0! + x^1/1! + x^2/2! + x^3/3! + ... * * Argument reduction: * Repeat x = x / 32, k += 5, until |x| < 0.1 * exp(x) = exp(x / 2^k)^(2^k) * * Previously, the argument was initially reduced by * exp(x) = exp(r) * 10^k where r = x - k * ln10, k = floor(x / ln10) * to first put r in the range [0, ln10], before dividing by 32 until |x| < 0.1, but this was * found to be slower than just dividing repeatedly by 32 as above. * * Max integer argument: exp('20723265836946413') = 6.3e+9000000000000000 * Min integer argument: exp('-20723265836946411') = 1.2e-9000000000000000 * (Math object integer min/max: Math.exp(709) = 8.2e+307, Math.exp(-745) = 5e-324) * * exp(Infinity) = Infinity * exp(-Infinity) = 0 * exp(NaN) = NaN * exp(±0) = 1 * * exp(x) is non-terminating for any finite, non-zero x. * * The result will always be correctly rounded. * */ function naturalExponential(x, sd) { var denominator, guard, j, pow, sum, t, wpr, rep = 0, i = 0, k = 0, Ctor = x.constructor, rm = Ctor.rounding, pr = Ctor.precision; // 0/NaN/Infinity? if (!x.d || !x.d[0] || x.e > 17) { return new Ctor(x.d ? !x.d[0] ? 1 : x.s < 0 ? 0 : 1 / 0 : x.s ? x.s < 0 ? 0 : x : 0 / 0); } if (sd == null) { external = false; wpr = pr; } else { wpr = sd; } t = new Ctor(0.03125); // while abs(x) >= 0.1 while (x.e > -2) { // x = x / 2^5 x = x.times(t); k += 5; } // Use 2 * log10(2^k) + 5 (empirically derived) to estimate the increase in precision // necessary to ensure the first 4 rounding digits are correct. guard = Math.log(mathpow(2, k)) / Math.LN10 * 2 + 5 | 0; wpr += guard; denominator = pow = sum = new Ctor(1); Ctor.precision = wpr; for (;;) { pow = finalise(pow.times(x), wpr, 1); denominator = denominator.times(++i); t = sum.plus(divide(pow, denominator, wpr, 1)); if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) { j = k; while (j--) sum = finalise(sum.times(sum), wpr, 1); // Check to see if the first 4 rounding digits are [49]999. // If so, repeat the summation with a higher precision, otherwise // e.g. with precision: 18, rounding: 1 // exp(18.404272462595034083567793919843761) = 98372560.1229999999 (should be 98372560.123) // `wpr - guard` is the index of first rounding digit. if (sd == null) { if (rep < 3 && checkRoundingDigits(sum.d, wpr - guard, rm, rep)) { Ctor.precision = wpr += 10; denominator = pow = t = new Ctor(1); i = 0; rep++; } else { return finalise(sum, Ctor.precision = pr, rm, external = true); } } else { Ctor.precision = pr; return sum; } } sum = t; } } /* * Return a new Decimal whose value is the natural logarithm of `x` rounded to `sd` significant * digits. * * ln(-n) = NaN * ln(0) = -Infinity * ln(-0) = -Infinity * ln(1) = 0 * ln(Infinity) = Infinity * ln(-Infinity) = NaN * ln(NaN) = NaN * * ln(n) (n != 1) is non-terminating. * */ function naturalLogarithm(y, sd) { var c, c0, denominator, e, numerator, rep, sum, t, wpr, x1, x2, n = 1, guard = 10, x = y, xd = x.d, Ctor = x.constructor, rm = Ctor.rounding, pr = Ctor.precision; // Is x negative or Infinity, NaN, 0 or 1? if (x.s < 0 || !xd || !xd[0] || !x.e && xd[0] == 1 && xd.length == 1) { return new Ctor(xd && !xd[0] ? -1 / 0 : x.s != 1 ? NaN : xd ? 0 : x); } if (sd == null) { external = false; wpr = pr; } else { wpr = sd; } Ctor.precision = wpr += guard; c = digitsToString(xd); c0 = c.charAt(0); if (Math.abs(e = x.e) < 1.5e15) { // Argument reduction. // The series converges faster the closer the argument is to 1, so using // ln(a^b) = b * ln(a), ln(a) = ln(a^b) / b // multiply the argument by itself until the leading digits of the significand are 7, 8, 9, // 10, 11, 12 or 13, recording the number of multiplications so the sum of the series can // later be divided by this number, then separate out the power of 10 using // ln(a*10^b) = ln(a) + b*ln(10). // max n is 21 (gives 0.9, 1.0 or 1.1) (9e15 / 21 = 4.2e14). //while (c0 < 9 && c0 != 1 || c0 == 1 && c.charAt(1) > 1) { // max n is 6 (gives 0.7 - 1.3) while (c0 < 7 && c0 != 1 || c0 == 1 && c.charAt(1) > 3) { x = x.times(y); c = digitsToString(x.d); c0 = c.charAt(0); n++; } e = x.e; if (c0 > 1) { x = new Ctor('0.' + c); e++; } else { x = new Ctor(c0 + '.' + c.slice(1)); } } else { // The argument reduction method above may result in overflow if the argument y is a massive // number with exponent >= 1500000000000000 (9e15 / 6 = 1.5e15), so instead recall this // function using ln(x*10^e) = ln(x) + e*ln(10). t = getLn10(Ctor, wpr + 2, pr).times(e + ''); x = naturalLogarithm(new Ctor(c0 + '.' + c.slice(1)), wpr - guard).plus(t); Ctor.precision = pr; return sd == null ? finalise(x, pr, rm, external = true) : x; } // x1 is x reduced to a value near 1. x1 = x; // Taylor series. // ln(y) = ln((1 + x)/(1 - x)) = 2(x + x^3/3 + x^5/5 + x^7/7 + ...) // where x = (y - 1)/(y + 1) (|x| < 1) sum = numerator = x = divide(x.minus(1), x.plus(1), wpr, 1); x2 = finalise(x.times(x), wpr, 1); denominator = 3; for (;;) { numerator = finalise(numerator.times(x2), wpr, 1); t = sum.plus(divide(numerator, new Ctor(denominator), wpr, 1)); if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) { sum = sum.times(2); // Reverse the argument reduction. Check that e is not 0 because, besides preventing an // unnecessary calculation, -0 + 0 = +0 and to ensure correct rounding -0 needs to stay -0. if (e !== 0) sum = sum.plus(getLn10(Ctor, wpr + 2, pr).times(e + '')); sum = divide(sum, new Ctor(n), wpr, 1); // Is rm > 3 and the first 4 rounding digits 4999, or rm < 4 (or the summation has // been repeated previously) and the first 4 rounding digits 9999? // If so, restart the summation with a higher precision, otherwise // e.g. with precision: 12, rounding: 1 // ln(135520028.6126091714265381533) = 18.7246299999 when it should be 18.72463. // `wpr - guard` is the index of first rounding digit. if (sd == null) { if (checkRoundingDigits(sum.d, wpr - guard, rm, rep)) { Ctor.precision = wpr += guard; t = numerator = x = divide(x1.minus(1), x1.plus(1), wpr, 1); x2 = finalise(x.times(x), wpr, 1); denominator = rep = 1; } else { return finalise(sum, Ctor.precision = pr, rm, external = true); } } else { Ctor.precision = pr; return sum; } } sum = t; denominator += 2; } } // ±Infinity, NaN. function nonFiniteToString(x) { // Unsigned. return String(x.s * x.s / 0); } /* * Parse the value of a new Decimal `x` from string `str`. */ function parseDecimal(x, str) { var e, i, len; // Decimal point? if ((e = str.indexOf('.')) > -1) str = str.replace('.', ''); // Exponential form? if ((i = str.search(/e/i)) > 0) { // Determine exponent. if (e < 0) e = i; e += +str.slice(i + 1); str = str.substring(0, i); } else if (e < 0) { // Integer. e = str.length; } // Determine leading zeros. for (i = 0; str.charCodeAt(i) === 48; i++); // Determine trailing zeros. for (len = str.length; str.charCodeAt(len - 1) === 48; --len); str = str.slice(i, len); if (str) { len -= i; x.e = e = e - i - 1; x.d = []; // Transform base // e is the base 10 exponent. // i is where to slice str to get the first word of the digits array. i = (e + 1) % LOG_BASE; if (e < 0) i += LOG_BASE; if (i < len) { if (i) x.d.push(+str.slice(0, i)); for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE)); str = str.slice(i); i = LOG_BASE - str.length; } else { i -= len; } for (; i--;) str += '0'; x.d.push(+str); if (external) { // Overflow? if (x.e > x.constructor.maxE) { // Infinity. x.d = null; x.e = NaN; // Underflow? } else if (x.e < x.constructor.minE) { // Zero. x.e = 0; x.d = [0]; // x.constructor.underflow = true; } // else x.constructor.underflow = false; } } else { // Zero. x.e = 0; x.d = [0]; } return x; } /* * Parse the value of a new Decimal `x` from a string `str`, which is not a decimal value. */ function parseOther(x, str) { var base, Ctor, divisor, i, isFloat, len, p, xd, xe; if (str === 'Infinity' || str === 'NaN') { if (!+str) x.s = NaN; x.e = NaN; x.d = null; return x; } if (isHex.test(str)) { base = 16; str = str.toLowerCase(); } else if (isBinary.test(str)) { base = 2; } else if (isOctal.test(str)) { base = 8; } else { throw Error(invalidArgument + str); } // Is there a binary exponent part? i = str.search(/p/i); if (i > 0) { p = +str.slice(i + 1); str = str.substring(2, i); } else { str = str.slice(2); } // Convert `str` as an integer then divide the result by `base` raised to a power such that the // fraction part will be restored. i = str.indexOf('.'); isFloat = i >= 0; Ctor = x.constructor; if (isFloat) { str = str.replace('.', ''); len = str.length; i = len - i; // log[10](16) = 1.2041... , log[10](88) = 1.9444.... divisor = intPow(Ctor, new Ctor(base), i, i * 2); } xd = convertBase(str, base, BASE); xe = xd.length - 1; // Remove trailing zeros. for (i = xe; xd[i] === 0; --i) xd.pop(); if (i < 0) return new Ctor(x.s * 0); x.e = getBase10Exponent(xd, xe); x.d = xd; external = false; // At what precision to perform the division to ensure exact conversion? // maxDecimalIntegerPartDigitCount = ceil(log[10](b) * otherBaseIntegerPartDigitCount) // log[10](2) = 0.30103, log[10](8) = 0.90309, log[10](16) = 1.20412 // E.g. ceil(1.2 * 3) = 4, so up to 4 decimal digits are needed to represent 3 hex int digits. // maxDecimalFractionPartDigitCount = {Hex:4|Oct:3|Bin:1} * otherBaseFractionPartDigitCount // Therefore using 4 * the number of digits of str will always be enough. if (isFloat) x = divide(x, divisor, len * 4); // Multiply by the binary exponent part if present. if (p) x = x.times(Math.abs(p) < 54 ? mathpow(2, p) : Decimal.pow(2, p)); external = true; return x; } /* * sin(x) = x - x^3/3! + x^5/5! - ... * |x| < pi/2 * */ function sine(Ctor, x) { var k, len = x.d.length; if (len < 3) return taylorSeries(Ctor, 2, x, x); // Argument reduction: sin(5x) = 16*sin^5(x) - 20*sin^3(x) + 5*sin(x) // i.e. sin(x) = 16*sin^5(x/5) - 20*sin^3(x/5) + 5*sin(x/5) // and sin(x) = sin(x/5)(5 + sin^2(x/5)(16sin^2(x/5) - 20)) // Estimate the optimum number of times to use the argument reduction. k = 1.4 * Math.sqrt(len); k = k > 16 ? 16 : k | 0; x = x.times(1 / tinyPow(5, k)); x = taylorSeries(Ctor, 2, x, x); // Reverse argument reduction var sin2_x, d5 = new Ctor(5), d16 = new Ctor(16), d20 = new Ctor(20); for (; k--;) { sin2_x = x.times(x); x = x.times(d5.plus(sin2_x.times(d16.times(sin2_x).minus(d20)))); } return x; } // Calculate Taylor series for `cos`, `cosh`, `sin` and `sinh`. function taylorSeries(Ctor, n, x, y, isHyperbolic) { var j, t, u, x2, i = 1, pr = Ctor.precision, k = Math.ceil(pr / LOG_BASE); external = false; x2 = x.times(x); u = new Ctor(y); for (;;) { t = divide(u.times(x2), new Ctor(n++ * n++), pr, 1); u = isHyperbolic ? y.plus(t) : y.minus(t); y = divide(t.times(x2), new Ctor(n++ * n++), pr, 1); t = u.plus(y); if (t.d[k] !== void 0) { for (j = k; t.d[j] === u.d[j] && j--;); if (j == -1) break; } j = u; u = y; y = t; t = j; i++; } external = true; t.d.length = k + 1; return t; } // Exponent e must be positive and non-zero. function tinyPow(b, e) { var n = b; while (--e) n *= b; return n; } // Return the absolute value of `x` reduced to less than or equal to half pi. function toLessThanHalfPi(Ctor, x) { var t, isNeg = x.s < 0, pi = getPi(Ctor, Ctor.precision, 1), halfPi = pi.times(0.5); x = x.abs(); if (x.lte(halfPi)) { quadrant = isNeg ? 4 : 1; return x; } t = x.divToInt(pi); if (t.isZero()) { quadrant = isNeg ? 3 : 2; } else { x = x.minus(t.times(pi)); // 0 <= x < pi if (x.lte(halfPi)) { quadrant = isOdd(t) ? (isNeg ? 2 : 3) : (isNeg ? 4 : 1); return x; } quadrant = isOdd(t) ? (isNeg ? 1 : 4) : (isNeg ? 3 : 2); } return x.minus(pi).abs(); } /* * Return the value of Decimal `x` as a string in base `baseOut`. * * If the optional `sd` argument is present include a binary exponent suffix. */ function toStringBinary(x, baseOut, sd, rm) { var base, e, i, k, len, roundUp, str, xd, y, Ctor = x.constructor, isExp = sd !== void 0; if (isExp) { checkInt32(sd, 1, MAX_DIGITS); if (rm === void 0) rm = Ctor.rounding; else checkInt32(rm, 0, 8); } else { sd = Ctor.precision; rm = Ctor.rounding; } if (!x.isFinite()) { str = nonFiniteToString(x); } else { str = finiteToString(x); i = str.indexOf('.'); // Use exponential notation according to `toExpPos` and `toExpNeg`? No, but if required: // maxBinaryExponent = floor((decimalExponent + 1) * log[2](10)) // minBinaryExponent = floor(decimalExponent * log[2](10)) // log[2](10) = 3.321928094887362347870319429489390175864 if (isExp) { base = 2; if (baseOut == 16) { sd = sd * 4 - 3; } else if (baseOut == 8) { sd = sd * 3 - 2; } } else { base = baseOut; } // Convert the number as an integer then divide the result by its base raised to a power such // that the fraction part will be restored. // Non-integer. if (i >= 0) { str = str.replace('.', ''); y = new Ctor(1); y.e = str.length - i; y.d = convertBase(finiteToString(y), 10, base); y.e = y.d.length; } xd = convertBase(str, 10, base); e = len = xd.length; // Remove trailing zeros. for (; xd[--len] == 0;) xd.pop(); if (!xd[0]) { str = isExp ? '0p+0' : '0'; } else { if (i < 0) { e--; } else { x = new Ctor(x); x.d = xd; x.e = e; x = divide(x, y, sd, rm, 0, base); xd = x.d; e = x.e; roundUp = inexact; } // The rounding digit, i.e. the digit after the digit that may be rounded up. i = xd[sd]; k = base / 2; roundUp = roundUp || xd[sd + 1] !== void 0; roundUp = rm < 4 ? (i !== void 0 || roundUp) && (rm === 0 || rm === (x.s < 0 ? 3 : 2)) : i > k || i === k && (rm === 4 || roundUp || rm === 6 && xd[sd - 1] & 1 || rm === (x.s < 0 ? 8 : 7)); xd.length = sd; if (roundUp) { // Rounding up may mean the previous digit has to be rounded up and so on. for (; ++xd[--sd] > base - 1;) { xd[sd] = 0; if (!sd) { ++e; xd.unshift(1); } } } // Determine trailing zeros. for (len = xd.length; !xd[len - 1]; --len); // E.g. [4, 11, 15] becomes 4bf. for (i = 0, str = ''; i < len; i++) str += NUMERALS.charAt(xd[i]); // Add binary exponent suffix? if (isExp) { if (len > 1) { if (baseOut == 16 || baseOut == 8) { i = baseOut == 16 ? 4 : 3; for (--len; len % i; len++) str += '0'; xd = convertBase(str, base, baseOut); for (len = xd.length; !xd[len - 1]; --len); // xd[0] will always be be 1 for (i = 1, str = '1.'; i < len; i++) str += NUMERALS.charAt(xd[i]); } else { str = str.charAt(0) + '.' + str.slice(1); } } str = str + (e < 0 ? 'p' : 'p+') + e; } else if (e < 0) { for (; ++e;) str = '0' + str; str = '0.' + str; } else { if (++e > len) for (e -= len; e-- ;) str += '0'; else if (e < len) str = str.slice(0, e) + '.' + str.slice(e); } } str = (baseOut == 16 ? '0x' : baseOut == 2 ? '0b' : baseOut == 8 ? '0o' : '') + str; } return x.s < 0 ? '-' + str : str; } // Does not strip trailing zeros. function truncate(arr, len) { if (arr.length > len) { arr.length = len; return true; } } // Decimal methods /* * abs * acos * acosh * add * asin * asinh * atan * atanh * atan2 * cbrt * ceil * clone * config * cos * cosh * div * exp * floor * hypot * ln * log * log2 * log10 * max * min * mod * mul * pow * random * round * set * sign * sin * sinh * sqrt * sub * tan * tanh * trunc */ /* * Return a new Decimal whose value is the absolute value of `x`. * * x {number|string|Decimal} * */ function abs(x) { return new this(x).abs(); } /* * Return a new Decimal whose value is the arccosine in radians of `x`. * * x {number|string|Decimal} * */ function acos(x) { return new this(x).acos(); } /* * Return a new Decimal whose value is the inverse of the hyperbolic cosine of `x`, rounded to * `precision` significant digits using rounding mode `rounding`. * * x {number|string|Decimal} A value in radians. * */ function acosh(x) { return new this(x).acosh(); } /* * Return a new Decimal whose value is the sum of `x` and `y`, rounded to `precision` significant * digits using rounding mode `rounding`. * * x {number|string|Decimal} * y {number|string|Decimal} * */ function add(x, y) { return new this(x).plus(y); } /* * Return a new Decimal whose value is the arcsine in radians of `x`, rounded to `precision` * significant digits using rounding mode `rounding`. * * x {number|string|Decimal} * */ function asin(x) { return new this(x).asin(); } /* * Return a new Decimal whose value is the inverse of the hyperbolic sine of `x`, rounded to * `precision` significant digits using rounding mode `rounding`. * * x {number|string|Decimal} A value in radians. * */ function asinh(x) { return new this(x).asinh(); } /* * Return a new Decimal whose value is the arctangent in radians of `x`, rounded to `precision` * significant digits using rounding mode `rounding`. * * x {number|string|Decimal} * */ function atan(x) { return new this(x).atan(); } /* * Return a new Decimal whose value is the inverse of the hyperbolic tangent of `x`, rounded to * `precision` significant digits using rounding mode `rounding`. * * x {number|string|Decimal} A value in radians. * */ function atanh(x) { return new this(x).atanh(); } /* * Return a new Decimal whose value is the arctangent in radians of `y/x` in the range -pi to pi * (inclusive), rounded to `precision` significant digits using rounding mode `rounding`. * * Domain: [-Infinity, Infinity] * Range: [-pi, pi] * * y {number|string|Decimal} The y-coordinate. * x {number|string|Decimal} The x-coordinate. * * atan2(±0, -0) = ±pi * atan2(±0, +0) = ±0 * atan2(±0, -x) = ±pi for x > 0 * atan2(±0, x) = ±0 for x > 0 * atan2(-y, ±0) = -pi/2 for y > 0 * atan2(y, ±0) = pi/2 for y > 0 * atan2(±y, -Infinity) = ±pi for finite y > 0 * atan2(±y, +Infinity) = ±0 for finite y > 0 * atan2(±Infinity, x) = ±pi/2 for finite x * atan2(±Infinity, -Infinity) = ±3*pi/4 * atan2(±Infinity, +Infinity) = ±pi/4 * atan2(NaN, x) = NaN * atan2(y, NaN) = NaN * */ function atan2(y, x) { y = new this(y); x = new this(x); var r, pr = this.precision, rm = this.rounding, wpr = pr + 4; // Either NaN if (!y.s || !x.s) { r = new this(NaN); // Both ±Infinity } else if (!y.d && !x.d) { r = getPi(this, wpr, 1).times(x.s > 0 ? 0.25 : 0.75); r.s = y.s; // x is ±Infinity or y is ±0 } else if (!x.d || y.isZero()) { r = x.s < 0 ? getPi(this, pr, rm) : new this(0); r.s = y.s; // y is ±Infinity or x is ±0 } else if (!y.d || x.isZero()) { r = getPi(this, wpr, 1).times(0.5); r.s = y.s; // Both non-zero and finite } else if (x.s < 0) { this.precision = wpr; this.rounding = 1; r = this.atan(divide(y, x, wpr, 1)); x = getPi(this, wpr, 1); this.precision = pr; this.rounding = rm; r = y.s < 0 ? r.minus(x) : r.plus(x); } else { r = this.atan(divide(y, x, wpr, 1)); } return r; } /* * Return a new Decimal whose value is the cube root of `x`, rounded to `precision` significant * digits using rounding mode `rounding`. * * x {number|string|Decimal} * */ function cbrt(x) { return new this(x).cbrt(); } /* * Return a new Decimal whose value is `x` rounded to an integer using `ROUND_CEIL`. * * x {number|string|Decimal} * */ function ceil(x) { return finalise(x = new this(x), x.e + 1, 2); } /* * Configure global settings for a Decimal constructor. * * `obj` is an object with one or more of the following properties, * * precision {number} * rounding {number} * toExpNeg {number} * toExpPos {number} * maxE {number} * minE {number} * modulo {number} * crypto {boolean|number} * defaults {true} * * E.g. Decimal.config({ precision: 20, rounding: 4 }) * */ function config(obj) { if (!obj || typeof obj !== 'object') throw Error(decimalError + 'Object expected'); var i, p, v, useDefaults = obj.defaults === true, ps = [ 'precision', 1, MAX_DIGITS, 'rounding', 0, 8, 'toExpNeg', -EXP_LIMIT, 0, 'toExpPos', 0, EXP_LIMIT, 'maxE', 0, EXP_LIMIT, 'minE', -EXP_LIMIT, 0, 'modulo', 0, 9 ]; for (i = 0; i < ps.length; i += 3) { if (p = ps[i], useDefaults) this[p] = DEFAULTS[p]; if ((v = obj[p]) !== void 0) { if (mathfloor(v) === v && v >= ps[i + 1] && v <= ps[i + 2]) this[p] = v; else throw Error(invalidArgument + p + ': ' + v); } } if (p = 'crypto', useDefaults) this[p] = DEFAULTS[p]; if ((v = obj[p]) !== void 0) { if (v === true || v === false || v === 0 || v === 1) { if (v) { if (typeof crypto != 'undefined' && crypto && (crypto.getRandomValues || crypto.randomBytes)) { this[p] = true; } else { throw Error(cryptoUnavailable); } } else { this[p] = false; } } else { throw Error(invalidArgument + p + ': ' + v); } } return this; } /* * Return a new Decimal whose value is the cosine of `x`, rounded to `precision` significant * digits using rounding mode `rounding`. * * x {number|string|Decimal} A value in radians. * */ function cos(x) { return new this(x).cos(); } /* * Return a new Decimal whose value is the hyperbolic cosine of `x`, rounded to precision * significant digits using rounding mode `rounding`. * * x {number|string|Decimal} A value in radians. * */ function cosh(x) { return new this(x).cosh(); } /* * Create and return a Decimal constructor with the same configuration properties as this Decimal * constructor. * */ function clone(obj) { var i, p, ps; /* * The Decimal constructor and exported function. * Return a new Decimal instance. * * v {number|string|Decimal} A numeric value. * */ function Decimal(v) { var e, i, t, x = this; // Decimal called without new. if (!(x instanceof Decimal)) return new Decimal(v); // Retain a reference to this Decimal constructor, and shadow Decimal.prototype.constructor // which points to Object. x.constructor = Decimal; // Duplicate. if (v instanceof Decimal) { x.s = v.s; if (external) { if (!v.d || v.e > Decimal.maxE) { // Infinity. x.e = NaN; x.d = null; } else if (v.e < Decimal.minE) { // Zero. x.e = 0; x.d = [0]; } else { x.e = v.e; x.d = v.d.slice(); } } else { x.e = v.e; x.d = v.d ? v.d.slice() : v.d; } return; } t = typeof v; if (t === 'number') { if (v === 0) { x.s = 1 / v < 0 ? -1 : 1; x.e = 0; x.d = [0]; return; } if (v < 0) { v = -v; x.s = -1; } else { x.s = 1; } // Fast path for small integers. if (v === ~~v && v < 1e7) { for (e = 0, i = v; i >= 10; i /= 10) e++; if (external) { if (e > Decimal.maxE) { x.e = NaN; x.d = null; } else if (e < Decimal.minE) { x.e = 0; x.d = [0]; } else { x.e = e; x.d = [v]; } } else { x.e = e; x.d = [v]; } return; // Infinity, NaN. } else if (v * 0 !== 0) { if (!v) x.s = NaN; x.e = NaN; x.d = null; return; } return parseDecimal(x, v.toString()); } else if (t !== 'string') { throw Error(invalidArgument + v); } // Minus sign? if ((i = v.charCodeAt(0)) === 45) { v = v.slice(1); x.s = -1; } else { // Plus sign? if (i === 43) v = v.slice(1); x.s = 1; } return isDecimal.test(v) ? parseDecimal(x, v) : parseOther(x, v); } Decimal.prototype = P; Decimal.ROUND_UP = 0; Decimal.ROUND_DOWN = 1; Decimal.ROUND_CEIL = 2; Decimal.ROUND_FLOOR = 3; Decimal.ROUND_HALF_UP = 4; Decimal.ROUND_HALF_DOWN = 5; Decimal.ROUND_HALF_EVEN = 6; Decimal.ROUND_HALF_CEIL = 7; Decimal.ROUND_HALF_FLOOR = 8; Decimal.EUCLID = 9; Decimal.config = Decimal.set = config; Decimal.clone = clone; Decimal.isDecimal = isDecimalInstance; Decimal.abs = abs; Decimal.acos = acos; Decimal.acosh = acosh; // ES6 Decimal.add = add; Decimal.asin = asin; Decimal.asinh = asinh; // ES6 Decimal.atan = atan; Decimal.atanh = atanh; // ES6 Decimal.atan2 = atan2; Decimal.cbrt = cbrt; // ES6 Decimal.ceil = ceil; Decimal.cos = cos; Decimal.cosh = cosh; // ES6 Decimal.div = div; Decimal.exp = exp; Decimal.floor = floor; Decimal.hypot = hypot; // ES6 Decimal.ln = ln; Decimal.log = log; Decimal.log10 = log10; // ES6 Decimal.log2 = log2; // ES6 Decimal.max = max; Decimal.min = min; Decimal.mod = mod; Decimal.mul = mul; Decimal.pow = pow; Decimal.random = random; Decimal.round = round; Decimal.sign = sign; // ES6 Decimal.sin = sin; Decimal.sinh = sinh; // ES6 Decimal.sqrt = sqrt; Decimal.sub = sub; Decimal.tan = tan; Decimal.tanh = tanh; // ES6 Decimal.trunc = trunc; // ES6 if (obj === void 0) obj = {}; if (obj) { if (obj.defaults !== true) { ps = ['precision', 'rounding', 'toExpNeg', 'toExpPos', 'maxE', 'minE', 'modulo', 'crypto']; for (i = 0; i < ps.length;) if (!obj.hasOwnProperty(p = ps[i++])) obj[p] = this[p]; } } Decimal.config(obj); return Decimal; } /* * Return a new Decimal whose value is `x` divided by `y`, rounded to `precision` significant * digits using rounding mode `rounding`. * * x {number|string|Decimal} * y {number|string|Decimal} * */ function div(x, y) { return new this(x).div(y); } /* * Return a new Decimal whose value is the natural exponential of `x`, rounded to `precision` * significant digits using rounding mode `rounding`. * * x {number|string|Decimal} The power to which to raise the base of the natural log. * */ function exp(x) { return new this(x).exp(); } /* * Return a new Decimal whose value is `x` round to an integer using `ROUND_FLOOR`. * * x {number|string|Decimal} * */ function floor(x) { return finalise(x = new this(x), x.e + 1, 3); } /* * Return a new Decimal whose value is the square root of the sum of the squares of the arguments, * rounded to `precision` significant digits using rounding mode `rounding`. * * hypot(a, b, ...) = sqrt(a^2 + b^2 + ...) * * arguments {number|string|Decimal} * */ function hypot() { var i, n, t = new this(0); external = false; for (i = 0; i < arguments.length;) { n = new this(arguments[i++]); if (!n.d) { if (n.s) { external = true; return new this(1 / 0); } t = n; } else if (t.d) { t = t.plus(n.times(n)); } } external = true; return t.sqrt(); } /* * Return true if object is a Decimal instance (where Decimal is any Decimal constructor), * otherwise return false. * */ function isDecimalInstance(obj) { return obj instanceof Decimal || obj && obj.name === '[object Decimal]' || false; } /* * Return a new Decimal whose value is the natural logarithm of `x`, rounded to `precision` * significant digits using rounding mode `rounding`. * * x {number|string|Decimal} * */ function ln(x) { return new this(x).ln(); } /* * Return a new Decimal whose value is the log of `x` to the base `y`, or to base 10 if no base * is specified, rounded to `precision` significant digits using rounding mode `rounding`. * * log[y](x) * * x {number|string|Decimal} The argument of the logarithm. * y {number|string|Decimal} The base of the logarithm. * */ function log(x, y) { return new this(x).log(y); } /* * Return a new Decimal whose value is the base 2 logarithm of `x`, rounded to `precision` * significant digits using rounding mode `rounding`. * * x {number|string|Decimal} * */ function log2(x) { return new this(x).log(2); } /* * Return a new Decimal whose value is the base 10 logarithm of `x`, rounded to `precision` * significant digits using rounding mode `rounding`. * * x {number|string|Decimal} * */ function log10(x) { return new this(x).log(10); } /* * Return a new Decimal whose value is the maximum of the arguments. * * arguments {number|string|Decimal} * */ function max() { return maxOrMin(this, arguments, 'lt'); } /* * Return a new Decimal whose value is the minimum of the arguments. * * arguments {number|string|Decimal} * */ function min() { return maxOrMin(this, arguments, 'gt'); } /* * Return a new Decimal whose value is `x` modulo `y`, rounded to `precision` significant digits * using rounding mode `rounding`. * * x {number|string|Decimal} * y {number|string|Decimal} * */ function mod(x, y) { return new this(x).mod(y); } /* * Return a new Decimal whose value is `x` multiplied by `y`, rounded to `precision` significant * digits using rounding mode `rounding`. * * x {number|string|Decimal} * y {number|string|Decimal} * */ function mul(x, y) { return new this(x).mul(y); } /* * Return a new Decimal whose value is `x` raised to the power `y`, rounded to precision * significant digits using rounding mode `rounding`. * * x {number|string|Decimal} The base. * y {number|string|Decimal} The exponent. * */ function pow(x, y) { return new this(x).pow(y); } /* * Returns a new Decimal with a random value equal to or greater than 0 and less than 1, and with * `sd`, or `Decimal.precision` if `sd` is omitted, significant digits (or less if trailing zeros * are produced). * * [sd] {number} Significant digits. Integer, 0 to MAX_DIGITS inclusive. * */ function random(sd) { var d, e, k, n, i = 0, r = new this(1), rd = []; if (sd === void 0) sd = this.precision; else checkInt32(sd, 1, MAX_DIGITS); k = Math.ceil(sd / LOG_BASE); if (!this.crypto) { for (; i < k;) rd[i++] = Math.random() * 1e7 | 0; // Browsers supporting crypto.getRandomValues. } else if (crypto.getRandomValues) { d = crypto.getRandomValues(new Uint32Array(k)); for (; i < k;) { n = d[i]; // 0 <= n < 4294967296 // Probability n >= 4.29e9, is 4967296 / 4294967296 = 0.00116 (1 in 865). if (n >= 4.29e9) { d[i] = crypto.getRandomValues(new Uint32Array(1))[0]; } else { // 0 <= n <= 4289999999 // 0 <= (n % 1e7) <= 9999999 rd[i++] = n % 1e7; } } // Node.js supporting crypto.randomBytes. } else if (crypto.randomBytes) { // buffer d = crypto.randomBytes(k *= 4); for (; i < k;) { // 0 <= n < 2147483648 n = d[i] + (d[i + 1] << 8) + (d[i + 2] << 16) + ((d[i + 3] & 0x7f) << 24); // Probability n >= 2.14e9, is 7483648 / 2147483648 = 0.0035 (1 in 286). if (n >= 2.14e9) { crypto.randomBytes(4).copy(d, i); } else { // 0 <= n <= 2139999999 // 0 <= (n % 1e7) <= 9999999 rd.push(n % 1e7); i += 4; } } i = k / 4; } else { throw Error(cryptoUnavailable); } k = rd[--i]; sd %= LOG_BASE; // Convert trailing digits to zeros according to sd. if (k && sd) { n = mathpow(10, LOG_BASE - sd); rd[i] = (k / n | 0) * n; } // Remove trailing words which are zero. for (; rd[i] === 0; i--) rd.pop(); // Zero? if (i < 0) { e = 0; rd = [0]; } else { e = -1; // Remove leading words which are zero and adjust exponent accordingly. for (; rd[0] === 0; e -= LOG_BASE) rd.shift(); // Count the digits of the first word of rd to determine leading zeros. for (k = 1, n = rd[0]; n >= 10; n /= 10) k++; // Adjust the exponent for leading zeros of the first word of rd. if (k < LOG_BASE) e -= LOG_BASE - k; } r.e = e; r.d = rd; return r; } /* * Return a new Decimal whose value is `x` rounded to an integer using rounding mode `rounding`. * * To emulate `Math.round`, set rounding to 7 (ROUND_HALF_CEIL). * * x {number|string|Decimal} * */ function round(x) { return finalise(x = new this(x), x.e + 1, this.rounding); } /* * Return * 1 if x > 0, * -1 if x < 0, * 0 if x is 0, * -0 if x is -0, * NaN otherwise * * x {number|string|Decimal} * */ function sign(x) { x = new this(x); return x.d ? (x.d[0] ? x.s : 0 * x.s) : x.s || NaN; } /* * Return a new Decimal whose value is the sine of `x`, rounded to `precision` significant digits * using rounding mode `rounding`. * * x {number|string|Decimal} A value in radians. * */ function sin(x) { return new this(x).sin(); } /* * Return a new Decimal whose value is the hyperbolic sine of `x`, rounded to `precision` * significant digits using rounding mode `rounding`. * * x {number|string|Decimal} A value in radians. * */ function sinh(x) { return new this(x).sinh(); } /* * Return a new Decimal whose value is the square root of `x`, rounded to `precision` significant * digits using rounding mode `rounding`. * * x {number|string|Decimal} * */ function sqrt(x) { return new this(x).sqrt(); } /* * Return a new Decimal whose value is `x` minus `y`, rounded to `precision` significant digits * using rounding mode `rounding`. * * x {number|string|Decimal} * y {number|string|Decimal} * */ function sub(x, y) { return new this(x).sub(y); } /* * Return a new Decimal whose value is the tangent of `x`, rounded to `precision` significant * digits using rounding mode `rounding`. * * x {number|string|Decimal} A value in radians. * */ function tan(x) { return new this(x).tan(); } /* * Return a new Decimal whose value is the hyperbolic tangent of `x`, rounded to `precision` * significant digits using rounding mode `rounding`. * * x {number|string|Decimal} A value in radians. * */ function tanh(x) { return new this(x).tanh(); } /* * Return a new Decimal whose value is `x` truncated to an integer. * * x {number|string|Decimal} * */ function trunc(x) { return finalise(x = new this(x), x.e + 1, 1); } P[Symbol.for('nodejs.util.inspect.custom')] = P.toString; P[Symbol.toStringTag] = 'Decimal'; // Create and configure initial Decimal constructor. var Decimal = clone(DEFAULTS); // Create the internal constants from their string values. LN10 = new Decimal(LN10); PI = new Decimal(PI); /* harmony default export */ __webpack_exports__["default"] = (Decimal); /***/ }), /* 1123 */ /***/ (function(module, exports, __webpack_require__) { var baseExtremum = __webpack_require__(1124), baseGt = __webpack_require__(1125), baseIteratee = __webpack_require__(543); /** * This method is like `_.max` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the criterion by which * the value is ranked. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Math * @param {Array} array The array to iterate over. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {*} Returns the maximum value. * @example * * var objects = [{ 'n': 1 }, { 'n': 2 }]; * * _.maxBy(objects, function(o) { return o.n; }); * // => { 'n': 2 } * * // The `_.property` iteratee shorthand. * _.maxBy(objects, 'n'); * // => { 'n': 2 } */ function maxBy(array, iteratee) { return (array && array.length) ? baseExtremum(array, baseIteratee(iteratee, 2), baseGt) : undefined; } module.exports = maxBy; /***/ }), /* 1124 */ /***/ (function(module, exports, __webpack_require__) { var isSymbol = __webpack_require__(457); /** * The base implementation of methods like `_.max` and `_.min` which accepts a * `comparator` to determine the extremum value. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The iteratee invoked per iteration. * @param {Function} comparator The comparator used to compare values. * @returns {*} Returns the extremum value. */ function baseExtremum(array, iteratee, comparator) { var index = -1, length = array.length; while (++index < length) { var value = array[index], current = iteratee(value); if (current != null && (computed === undefined ? (current === current && !isSymbol(current)) : comparator(current, computed) )) { var computed = current, result = value; } } return result; } module.exports = baseExtremum; /***/ }), /* 1125 */ /***/ (function(module, exports) { /** * The base implementation of `_.gt` which doesn't coerce arguments. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is greater than `other`, * else `false`. */ function baseGt(value, other) { return value > other; } module.exports = baseGt; /***/ }), /* 1126 */ /***/ (function(module, exports, __webpack_require__) { const { createModel } = __webpack_require__(1127); module.exports = { createModel }; /***/ }), /* 1127 */ /***/ (function(module, exports, __webpack_require__) { const { createClassifier } = __webpack_require__(1128); const { getLabelWithTags, tokenizer } = __webpack_require__(1116); const { pctOfTokensInVoc } = __webpack_require__(1168); const maxBy = __webpack_require__(1123); const logger = __webpack_require__(2); const { LOCAL_MODEL_CATEG_FALLBACK, LOCAL_MODEL_PROBA_FALLBACK, LOCAL_MODEL_PCT_TOKENS_IN_VOC_THRESHOLD } = __webpack_require__(1169); const log = logger.namespace('categorization/localModel/model'); async function createModel(options) { log('info', 'Create a new classifier'); const classifier = await createClassifier(options); const vocabulary = Object.keys(classifier.vocabulary); const categorize = transactions => { for (const transaction of transactions) { const label = getLabelWithTags(transaction); const tokens = tokenizer(transaction.label); const pctOfThisTokensInVoc = pctOfTokensInVoc(tokens, vocabulary); let category; let proba; // First : check if tokens from the transaction's label are in the model if (pctOfThisTokensInVoc > LOCAL_MODEL_PCT_TOKENS_IN_VOC_THRESHOLD) { // If OK : continue log('info', `Applying model to ${label}`); ({ category, proba } = maxBy(classifier.categorize(label).likelihoods, 'proba')); transaction.localCategoryId = category; transaction.localCategoryProba = proba; } else { // If KO : abort with category '0' and proba 1/nbUniqueCat log('info', `Giving up for ${label}`); category = LOCAL_MODEL_CATEG_FALLBACK; proba = LOCAL_MODEL_PROBA_FALLBACK; transaction.localCategoryId = category; transaction.localCategoryProba = proba; } log('info', `Results for ${label} :`); log('info', `localCategory: ${category}`); log('info', `localProba: ${proba}`); } }; return { categorize }; } module.exports = { createModel }; /***/ }), /* 1128 */ /***/ (function(module, exports, __webpack_require__) { const { fetchTransactionsWithManualCat } = __webpack_require__(1129); const { getUniqueCategories, getAlphaParameter } = __webpack_require__(1168); const bayes = __webpack_require__(1121); const { getLabelWithTags } = __webpack_require__(1116); const logger = __webpack_require__(2); const log = logger.namespace('categorization/localModel/classifier'); const ALPHA_MIN = 2; const ALPHA_MAX = 4; const ALPHA_MAX_SMOOTHING = 12; const FAKE_TRANSACTION = { label: 'thisisafaketransaction', manualCategoryId: '0' }; const TOKENS_TO_REWEIGHT = ['tag_neg', 'tag_v_b_expense', 'tag_neg tag_v_b_expense', 'tag_b_expense', 'tag_neg tag_b_expense', 'tag_expense', 'tag_neg tag_expense', 'tag_noise_neg', 'tag_neg tag_noise_neg', 'tag_pos', 'tag_noise_pos', 'tag_pos tag_noise_pos', 'tag_income', 'tag_pos tag_income', 'tag_b_income', 'tag_pos tag_b_income', 'tag_activity_income', 'tag_pos tag_activity_income']; const getClassifierOptions = transactionsWithManualCat => { const uniqueCategories = getUniqueCategories(transactionsWithManualCat); const nbUniqueCategories = uniqueCategories.length; log('debug', 'Number of unique categories in transactions with manual categories: ' + nbUniqueCategories); const alpha = getAlphaParameter(nbUniqueCategories, ALPHA_MIN, ALPHA_MAX, ALPHA_MAX_SMOOTHING); log('debug', 'Alpha parameter value is ' + alpha); let addFakeTransaction = false; if (nbUniqueCategories === 1) { log('info', 'Not enough different categories, adding a fake transaction to balance the weight of the categories'); addFakeTransaction = true; } return { initialization: { alpha, fitPrior: false }, configuration: { addFakeTransaction } }; }; /** * Create a ready to use classifier for the local categorization model * * @param {Array} transactionsToLearn - Transactions to learn from * @param {object} intializationOptions - Options to pass to the classifier initialization * @param {object} configurationOptions - Options used to configure the classifier */ const createLocalClassifier = (transactionsToLearn, initializationOptions, configurationOptions) => { if (transactionsToLearn.length === 0) { throw new Error('Impossible to instanciate a classifier since there is no manually categorized transactions to learn from'); } const classifier = bayes(initializationOptions); log('info', 'Learning from manually categorized transactions'); for (const transaction of transactionsToLearn) { classifier.learn(getLabelWithTags(transaction), transaction.manualCategoryId); } if (configurationOptions.addFakeTransaction) { classifier.learn(FAKE_TRANSACTION.label, FAKE_TRANSACTION.manualCategoryId); } return classifier; }; /** * Reweights a word in the Naive Bayes parameter in order to mimic the * behavior of a sublinear TF-IDF vectorizer applied to this word. * The transformation applied is inspired by the scikit-learn object * `sklearn.feature_extraction.text.TfidfVectorizer` with `sublinear_tf`. * The `log(frequencyCount)` smooths the probabilities of a word across the * possible categories to avoid the probability of the most targeted category * to explode. * * @param {*} classifier - classifier to reweight * @param {*} category - category in which to reweight a word * @param {*} word - word to reweight * @param {*} frequencyCount - observed frequency count of this word in the given category */ const reweightWord = (classifier, category, word, frequencyCount) => { const newFrequencyCount = 1 + Math.log(frequencyCount); const deltaFrequencyCount = frequencyCount - newFrequencyCount; // update the right entries of the classifier's parameters classifier.vocabulary[word] -= deltaFrequencyCount; classifier.wordCount[category] -= deltaFrequencyCount; classifier.wordFrequencyCount[category][word] = newFrequencyCount; }; const reweightModel = classifier => { // loop over categories in the wordFrequencyCat attribute const wordFrequencyCount = classifier.wordFrequencyCount; // for each category for (const category of Object.keys(wordFrequencyCount)) { // extract its word-frequency count `wfc` const categoryWordsFrequencyCounts = wordFrequencyCount[category]; // and search for tokens to reweight in it TOKENS_TO_REWEIGHT.map(wordToReweight => { if (categoryWordsFrequencyCounts.hasOwnProperty(wordToReweight)) { // for every tokens to reweight : re-compute frequency count `fc` const frequencyCount = categoryWordsFrequencyCounts[wordToReweight]; if (frequencyCount !== 1) { reweightWord(classifier, category, wordToReweight, frequencyCount); } } }); } }; const createClassifier = async options => { log('info', 'Fetching manually categorized transactions'); const transactionsWithManualCat = await fetchTransactionsWithManualCat(); log('info', `Fetched ${transactionsWithManualCat.length} manually categorized transactions`); log('info', 'Instanciating a new classifier'); const classifierOptions = getClassifierOptions(transactionsWithManualCat); const classifier = createLocalClassifier(transactionsWithManualCat, { ...options, ...classifierOptions.initialization }, classifierOptions.configuration); log('info', 'Reweighting model to lower the impact of amount in the prediction'); reweightModel(classifier); log('info', 'Reweighting model to lower the impact of amount in the prediction'); reweightModel(classifier); return classifier; }; module.exports = { createClassifier }; /***/ }), /* 1129 */ /***/ (function(module, exports, __webpack_require__) { const cozyClient = __webpack_require__(617); const { BankTransaction } = __webpack_require__(1130); if (!BankTransaction.cozyClient) { BankTransaction.registerClient(cozyClient); } async function fetchTransactionsWithManualCat() { const transactionsWithManualCat = await BankTransaction.queryAll({ manualCategoryId: { $exists: true } }); return transactionsWithManualCat; } module.exports = { fetchTransactionsWithManualCat }; /***/ }), /* 1130 */ /***/ (function(module, exports, __webpack_require__) { const Account = __webpack_require__(1131) const AdministrativeProcedure = __webpack_require__(1137) const Application = __webpack_require__(1147) const Document = __webpack_require__(1132) const BalanceHistory = __webpack_require__(1148) const BankAccount = __webpack_require__(1149) const BankingReconciliator = __webpack_require__(1154) const BankTransaction = __webpack_require__(1155) const BankAccountStats = __webpack_require__(1159) const Contact = __webpack_require__(1138) const CozyFile = __webpack_require__(1162) const CozyFolder = __webpack_require__(1165) const Group = __webpack_require__(1166) const Permission = __webpack_require__(1167) module.exports = { Account, AdministrativeProcedure, Application, Document, BalanceHistory, BankAccount, BankingReconciliator, BankTransaction, BankAccountStats, Contact, CozyFile, CozyFolder, Group, registerClient: Document.registerClient, Permission } /***/ }), /* 1131 */ /***/ (function(module, exports, __webpack_require__) { const Document = __webpack_require__(1132) const ACCOUNTS_DOCTYPE = 'io.cozy.accounts' // Order matters const probableLoginFieldNames = [ 'login', 'identifier', 'new_identifier', 'email' ] class Account extends Document { static getAccountName(account) { if (!account) return null if (account.auth) { return ( account.auth.accountName || this.getAccountLogin(account) || account._id ) } else { return account._id } } static getAccountLogin(account) { if (account && account.auth) { for (const fieldName of probableLoginFieldNames) { if (account.auth[fieldName]) return account.auth[fieldName] } } } } Account.schema = { doctype: ACCOUNTS_DOCTYPE, attributes: {}, relationships: { master: { type: 'has-one', doctype: ACCOUNTS_DOCTYPE } } } Account.probableLoginFieldNames = probableLoginFieldNames module.exports = Account /***/ }), /* 1132 */ /***/ (function(module, exports, __webpack_require__) { const omit = __webpack_require__(944) const pick = __webpack_require__(602) const size = __webpack_require__(1041) const omitBy = __webpack_require__(1133) const isUndefined = __webpack_require__(76) const fromPairs = __webpack_require__(1047) const pickBy = __webpack_require__(890) const flatMap = __webpack_require__(1134) const groupBy = __webpack_require__(1037) const sortBy = __webpack_require__(1089) const get = __webpack_require__(571) const { parallelMap } = __webpack_require__(1135) const CozyClient = __webpack_require__(728).default const log = __webpack_require__(2).namespace('Document') const querystring = __webpack_require__(104) const DATABASE_DOES_NOT_EXIST = 'Database does not exist.' /** * Tell of two object attributes have any difference */ function isDifferent(o1, o2) { // This is not supposed to happen if (Object.keys(o1).length === 0) return true for (let key in o1) { if (o1[key] !== o2[key]) { return true } } return false } const indexes = {} // Attributes that will not be updated since the // user can change them const userAttributes = ['shortLabel'] function sanitizeKey(key) { if (key.startsWith('\\')) { return key.slice(1) } return key } function updateCreatedByApp(cozyMetadata, appSlug) { if (!cozyMetadata.updatedByApps) { cozyMetadata.updatedByApps = [] } const now = new Date() for (const appInfo of cozyMetadata.updatedByApps) { if (appInfo.slug === appSlug) { appInfo.date = now return } } cozyMetadata.updatedByApps.push({ slug: appSlug, date: now }) } const withoutUndefined = x => omitBy(x, isUndefined) const flagForDeletion = x => Object.assign({}, x, { _deleted: true }) const getDocumentUpdateDate = doc => { const d = doc.cozyMetadata && doc.cozyMetadata.updatedAt return d ? new Date(d) : null } const newestDocumentComparisonFunc = doc => { const d = getDocumentUpdateDate(doc) return d ? -d : 0 } class Document { /** * Registers a client * * @param {Client} client - Cozy client from either cozy-client or cozy-client-js */ static registerClient(client) { if (!this.cozyClient) { this.cozyClient = client } else { // eslint-disable-next-line no-console console.warn( 'Document already has been registered, this is not possible to re-register as the client is shared globally between all classes. This is to prevent concurrency bugs.' ) throw new Error('Document cannot be re-registered to a client.') } } /** * @static copyWithClient - Returns a new class bound to a client * * @param {type} client Client instance * @returns {type} A new class, with the client registered */ static copyWithClient(client) { const BaseClass = this class ExtendedClass extends BaseClass {} ExtendedClass.cozyClient = null ExtendedClass.registerClient(client) return ExtendedClass } /** * Returns true if Document uses a CozyClient (from cozy-client package) * * @returns {boolean} true if Document uses a CozyClient **/ static usesCozyClient() { return this.cozyClient instanceof CozyClient } static getIndex(doctype, fields) { if (this.usesCozyClient()) { throw new Error('This method is not implemented yet with CozyClient') } return this.getIndexViaOldClient(doctype, fields) } static getIndexViaOldClient(doctype, fields) { const key = `${doctype}:${fields.slice().join(',')}` const index = indexes[key] if (!index) { indexes[key] = this.cozyClient.data .defineIndex(doctype, fields) .then(index => { indexes[key] = index return index }) } return Promise.resolve(indexes[key]) } static addCozyMetadata(attributes) { if (!attributes.cozyMetadata) { attributes.cozyMetadata = {} } attributes.cozyMetadata.updatedAt = new Date() if (!attributes.cozyMetadata.createdByApp && this.createdByApp) { attributes.cozyMetadata.createdByApp = this.createdByApp } if (this.createdByApp) { updateCreatedByApp(attributes.cozyMetadata, this.createdByApp) } return attributes } /** * Returns the item that has this id * * @param {string} id - The id of an item in the collection * @returns {object} - The collection's item that has this id * */ static async get(id) { if (!this.usesCozyClient()) { throw new Error('This method is not implemented with cozy-client-js') } if (!this.doctype) { throw new Error('doctype is not defined') } const resp = await this.cozyClient.collection(this.doctype).get(id) return resp.data } /** * Creates or updates a document. * * Before creating/updating, we try to find an existing document by * building a selector with the idAttributes. * * - If not document is found, document is created * - If a document is found, it is updated * - If duplicates are found, it depends on options.handleDuplicates * * @param {String|Function} options.handleDuplicates - How duplicates are handled, see Document.duplicateHandlingStrategies */ static async createOrUpdate(attributes, options = {}) { if (this.usesCozyClient()) { return this.createOrUpdateViaNewClient(attributes, options) } return this.createOrUpdateViaOldClient(attributes, options) } /** * Update a document with `update` attributes. If the * `update` does not concern "important" attributes, the original * document is returned. Otherwise, the update document is * returned with metadata updated. * * @private */ static applyUpdateIfDifferent(doc, update) { // only update if some fields are different if ( !this.checkAttributes || isDifferent( pick(doc, this.checkAttributes), pick(update, this.checkAttributes) ) ) { // do not emit a mail for those attribute updates delete update.dateImport const updatedDoc = this.addCozyMetadata({ ...doc, ...update }) return updatedDoc } else { log( 'debug', `[updateIfDifferent] No need to update ${update._id} because its \`checkedAttributes\` (${this.checkAttributes}) didn't change.` ) return doc } } static getHandleDuplicateStrategy(name) { if (Document.duplicateHandlingStrategies[name]) { return Document.duplicateHandlingStrategies[name] } else { throw new Error( `${name} is not a know duplication handling strategy. Known strategies are ${Object.keys( Document.duplicateHandlingStrategies )}` ) } } static async handleDuplicates(strategyNameOrFn, duplicates, selector) { strategyNameOrFn = strategyNameOrFn || this.defaultDuplicateHandling const strategyFn = typeof strategyNameOrFn === 'string' ? this.getHandleDuplicateStrategy(strategyNameOrFn) : strategyNameOrFn return await strategyFn.call(this, duplicates, selector) } static async createOrUpdateViaNewClient(attributes, options) { const selector = fromPairs( this.idAttributes.map(idAttribute => [ idAttribute, get(attributes, sanitizeKey(idAttribute)) ]) ) let results = [] const compactedSelector = withoutUndefined(selector) if (size(compactedSelector) === this.idAttributes.length) { results = await this.queryAll(selector) } if (results.length === 0) { return this.create(this.addCozyMetadata(attributes)) } else { results = sortBy(results, newestDocumentComparisonFunc) if (results.length > 1) { await this.handleDuplicates(options.handleDuplicates, results, selector) } const doc = results[0] const update = omit(attributes, userAttributes) const updatedDoc = this.applyUpdateIfDifferent(doc, update) if (updatedDoc !== doc) { return this.cozyClient.save(updatedDoc) } else { return updatedDoc } } } static async createOrUpdateViaOldClient(attributes, options) { const selector = fromPairs( this.idAttributes.map(idAttribute => [ idAttribute, get(attributes, sanitizeKey(idAttribute)) ]) ) let results = [] const compactedSelector = withoutUndefined(selector) if (size(compactedSelector) === this.idAttributes.length) { const index = await this.getIndex(this.doctype, this.idAttributes) results = await this.cozyClient.data.query(index, { selector }) } if (results.length === 0) { return this.cozyClient.data.create( this.doctype, this.addCozyMetadata(attributes) ) } else { results = sortBy(results, newestDocumentComparisonFunc) if (results.length > 1) { await this.handleDuplicates(options.handleDuplicates, results, selector) } const doc = results[0] const update = omit(attributes, userAttributes) const updatedDoc = this.applyUpdateIfDifferent(doc, update) if (updatedDoc !== doc) { return this.cozyClient.data.updateAttributes( this.doctype, updatedDoc._id, updatedDoc ) } else { return doc } } } static create(attributes) { if (this.usesCozyClient()) { return this.createViaNewClient(attributes) } return this.createViaOldClient(attributes) } static createViaNewClient(attributes) { return this.cozyClient.create(this.doctype, attributes) } static createViaOldClient(attributes) { return this.cozyClient.data.create(this.doctype, attributes) } /** * Save many documents concurrently */ static bulkSave(documents, optionsOrConcurrency, logProgressOrNothing) { if (logProgressOrNothing || typeof optionsOrConcurrency !== 'object') { log( 'warn', 'Second argument of bulkSave is now an object, please use bulkSave(documents, { logProgress, concurrency })' ) } const options = {} if (typeof optionsOrConcurrency === 'number') { options.concurrency = optionsOrConcurrency } if (typeof logProgressOrNothing === 'function') { options.logProgress = logProgressOrNothing } if (typeof optionsOrConcurrency === 'object') { Object.assign(options, optionsOrConcurrency) } return this._bulkSave(documents, options) } /** * @private * * Meat of the method bulkSave */ static _bulkSave(documents, options = {}) { const { concurrency = 30, logProgress, ...createOrUpdateOptions } = options return parallelMap( documents, doc => { if (logProgress) { logProgress(doc) } return this.createOrUpdate(doc, createOrUpdateOptions) }, concurrency ) } static query(index, options) { if (this.usesCozyClient()) { throw new Error('This method is not implemented yet with CozyClient') } return this.queryViaOldClient(index, options) } static queryViaOldClient(index, options) { return this.cozyClient.data.query(index, options) } static async fetchAll() { const stackClient = this.usesCozyClient() ? this.cozyClient.stackClient : this.cozyClient try { const result = await stackClient.fetchJSON( 'GET', `/data/${this.doctype}/_all_docs?include_docs=true` ) return result.rows .filter(x => x.id.indexOf('_design') !== 0 && x.doc) .map(x => x.doc) } catch (e) { if (e && e.response && e.response.status && e.response.status === 404) { return [] } else { return [] } } } static async updateAll(docs) { const stackClient = this.usesCozyClient() ? this.cozyClient.stackClient : this.cozyClient if (!docs || !docs.length) { return Promise.resolve([]) } try { const update = await stackClient.fetchJSON( 'POST', `/data/${this.doctype}/_bulk_docs`, { docs } ) return update } catch (e) { if ( e.reason && e.reason.reason && e.reason.reason == DATABASE_DOES_NOT_EXIST ) { const firstDoc = await this.create(docs[0]) const resp = await this.updateAll(docs.slice(1)) resp.unshift({ ok: true, id: firstDoc._id, rev: firstDoc._rev }) return resp } else { throw e } } } static async deleteAll(docs) { return this.updateAll(docs.map(flagForDeletion)) } /** * Find duplicates in a list of documents according to the * idAttributes of the class. Priority is given to the document * prior in the list. * * To introduce the notion of priority, you can sort your input docs * according to this priorirty. * * @param {Array[object]} docs * @return {Array[object]} Duplicates */ static findDuplicates(docs) { const fieldSeparator = '#$$$$#' const idAttributes = this.idAttributes const key = doc => { return idAttributes .map(idAttrPath => get(doc, idAttrPath)) .join(fieldSeparator) } const groups = pickBy(groupBy(docs, key), group => group.length > 1) const duplicates = flatMap(groups, group => group.slice(1)) return duplicates } /** * Delete duplicates on the server. Find duplicates according to the * idAttributes. * * @param {Function} Priority (optional). Among duplicates, which one should be prioritized) * @return {Promise} * @example * ``` * deleteDuplicates(doc => -doc.dateImport) // will duplicate documents so that the oldest document is conserved * ``` */ static async deleteDuplicates(priorityFn) { let allDocs = await this.fetchAll() if (priorityFn) { allDocs = sortBy(allDocs, priorityFn) } const duplicates = this.findDuplicates(allDocs) return this.deleteAll(duplicates) } /** * Use Couch _changes API * * @param {string} since Starting sequence for changes * @param {[type]} options { includeDesign: false, includeDeleted: false } */ static async fetchChanges(since, options = {}) { const stackClient = this.usesCozyClient() ? this.cozyClient.stackClient : this.cozyClient const queryParams = { since, include_docs: 'true' } if (options.params) { Object.assign(queryParams, options.params) } const result = await stackClient.fetchJSON( 'GET', `/data/${this.doctype}/_changes?${querystring.stringify(queryParams)}` ) const newLastSeq = result.last_seq let docs = result.results.map(x => x.doc).filter(Boolean) if (!options.includeDesign) { docs = docs.filter(doc => doc._id.indexOf('_design') !== 0) } if (!options.includeDeleted) { docs = docs.filter(doc => !doc._deleted) } return { newLastSeq, documents: docs } } /** * Fetches all documents for a given doctype exceeding the 100 limit. * It is slower that fetchAll because it fetches the data 100 by 100 but allows to filter the data * with a selector and an index * * Parameters: * * * `selector` (object): the mango query selector * * `index` (object): (optional) the query selector index. If not defined, the function will * create it's own index with the keys specified in the selector * * * ```javascript * const documents = await Bills.queryAll({vendor: 'Direct Energie'}) * ``` * */ static async queryAll(selector, index) { if (this.usesCozyClient()) { return this.queryAllViaNewClient(selector) } return this.queryAllViaOldClient(selector, index) } static async queryAllViaNewClient(selector) { if (!selector) { return this.fetchAll() } const result = [] const query = this.cozyClient.find(this.doctype).where(selector) let resp = { next: true } while (resp && resp.next) { resp = await this.cozyClient.query(query.offset(result.length)) result.push(...resp.data) } return result } static async queryAllViaOldClient(selector, index) { if (!selector) { // fetchAll is faster in this case return await this.fetchAll() } if (!index) { index = await this.cozyClient.data.defineIndex( this.doctype, Object.keys(selector) ) } const result = [] let resp = { next: true } while (resp && resp.next) { resp = await this.cozyClient.data.query(index, { selector, wholeResponse: true, skip: result.length }) result.push(...resp.docs) } return result } /** * Fetch in one request a batch of documents by id. * @param {String[]} ids - Ids of documents to fetch * @return {Promise} - Promise resolving to an array of documents, unfound document are filtered */ static async getAll(ids) { const stackClient = this.usesCozyClient() ? this.cozyClient.stackClient : this.cozyClient let resp try { resp = await stackClient.fetchJSON( 'POST', `/data/${this.doctype}/_all_docs?include_docs=true`, { keys: ids } ) } catch (error) { if (error.message.match(/not_found/)) { return [] } throw error } const rows = resp.rows.filter(row => row.doc) return rows.map(row => row.doc) } } Document.defaultDuplicateHandling = 'throw' Document.duplicateHandlingStrategies = { throw: function(duplicates, selector) { throw new Error( 'Create or update with selectors that returns more than 1 result\n' + JSON.stringify(selector) + '\n' + JSON.stringify(duplicates) ) }, remove: async function(duplicates) { const docsToRemove = duplicates.slice(1) if (docsToRemove.length > 0) { log( 'warn', `Cleaning duplicates for doctype ${this.doctype} (kept: ${ duplicates[0]._id }, removed: ${docsToRemove.map(x => x._id)})` ) await this.deleteAll(docsToRemove) } } } module.exports = Document /***/ }), /* 1133 */ /***/ (function(module, exports, __webpack_require__) { var baseIteratee = __webpack_require__(543), negate = __webpack_require__(592), pickBy = __webpack_require__(890); /** * The opposite of `_.pickBy`; this method creates an object composed of * the own and inherited enumerable string keyed properties of `object` that * `predicate` doesn't return truthy for. The predicate is invoked with two * arguments: (value, key). * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The source object. * @param {Function} [predicate=_.identity] The function invoked per property. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.omitBy(object, _.isNumber); * // => { 'b': '2' } */ function omitBy(object, predicate) { return pickBy(object, negate(baseIteratee(predicate))); } module.exports = omitBy; /***/ }), /* 1134 */ /***/ (function(module, exports, __webpack_require__) { var baseFlatten = __webpack_require__(599), map = __webpack_require__(608); /** * Creates a flattened array of values by running each element in `collection` * thru `iteratee` and flattening the mapped results. The iteratee is invoked * with three arguments: (value, index|key, collection). * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the new flattened array. * @example * * function duplicate(n) { * return [n, n]; * } * * _.flatMap([1, 2], duplicate); * // => [1, 1, 2, 2] */ function flatMap(collection, iteratee) { return baseFlatten(map(collection, iteratee), 1); } module.exports = flatMap; /***/ }), /* 1135 */ /***/ (function(module, exports, __webpack_require__) { const PromisePool = __webpack_require__(1136) /** * Like a map, executed in parallel via a promise pool * * @param {Array} arr Items to process * @param {Function} fn Promise creator (will be passed each item) * @param {Number} concurrency How many promise can be in flight at the same time * @return {Promise} Resolved with the results of the promise, not necessary in order */ const parallelMap = (iterable, fn, concurrency) => { concurrency = concurrency || 30 const res = [] const pool = new PromisePool(function*() { for (let item of iterable) { yield fn(item).then(x => res.push(x)) } }, concurrency) return pool.start().then(() => res) } module.exports = { parallelMap } /***/ }), /* 1136 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root, factory) { /* istanbul ignore next */ if (true) { !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) } else {} })(this, function () { 'use strict' var EventTarget = function () { this._listeners = {} } EventTarget.prototype.addEventListener = function (type, listener) { this._listeners[type] = this._listeners[type] || [] if (this._listeners[type].indexOf(listener) < 0) { this._listeners[type].push(listener) } } EventTarget.prototype.removeEventListener = function (type, listener) { if (this._listeners[type]) { var p = this._listeners[type].indexOf(listener) if (p >= 0) { this._listeners[type].splice(p, 1) } } } EventTarget.prototype.dispatchEvent = function (evt) { if (this._listeners[evt.type] && this._listeners[evt.type].length) { var listeners = this._listeners[evt.type].slice() for (var i = 0, l = listeners.length; i < l; ++i) { listeners[i].call(this, evt) } } } var isGenerator = function (func) { return (typeof func.constructor === 'function' && func.constructor.name === 'GeneratorFunction') } var functionToIterator = function (func) { return { next: function () { var promise = func() return promise ? {value: promise} : {done: true} } } } var promiseToIterator = function (promise) { var called = false return { next: function () { if (called) { return {done: true} } called = true return {value: promise} } } } var toIterator = function (obj, Promise) { var type = typeof obj if (type === 'object') { if (typeof obj.next === 'function') { return obj } /* istanbul ignore else */ if (typeof obj.then === 'function') { return promiseToIterator(obj) } } if (type === 'function') { return isGenerator(obj) ? obj() : functionToIterator(obj) } return promiseToIterator(Promise.resolve(obj)) } var PromisePoolEvent = function (target, type, data) { this.target = target this.type = type this.data = data } var PromisePool = function (source, concurrency, options) { EventTarget.call(this) if (typeof concurrency !== 'number' || Math.floor(concurrency) !== concurrency || concurrency < 1) { throw new Error('Invalid concurrency') } this._concurrency = concurrency this._options = options || {} this._options.promise = this._options.promise || Promise this._iterator = toIterator(source, this._options.promise) this._done = false this._size = 0 this._promise = null this._callbacks = null } PromisePool.prototype = new EventTarget() PromisePool.prototype.constructor = PromisePool PromisePool.prototype.concurrency = function (value) { if (typeof value !== 'undefined') { this._concurrency = value if (this.active()) { this._proceed() } } return this._concurrency } PromisePool.prototype.size = function () { return this._size } PromisePool.prototype.active = function () { return !!this._promise } PromisePool.prototype.promise = function () { return this._promise } PromisePool.prototype.start = function () { var that = this var Promise = this._options.promise this._promise = new Promise(function (resolve, reject) { that._callbacks = { reject: reject, resolve: resolve } that._proceed() }) return this._promise } PromisePool.prototype._fireEvent = function (type, data) { this.dispatchEvent(new PromisePoolEvent(this, type, data)) } PromisePool.prototype._settle = function (error) { if (error) { this._callbacks.reject(error) } else { this._callbacks.resolve() } this._promise = null this._callbacks = null } PromisePool.prototype._onPooledPromiseFulfilled = function (promise, result) { this._size-- if (this.active()) { this._fireEvent('fulfilled', { promise: promise, result: result }) this._proceed() } } PromisePool.prototype._onPooledPromiseRejected = function (promise, error) { this._size-- if (this.active()) { this._fireEvent('rejected', { promise: promise, error: error }) this._settle(error || new Error('Unknown error')) } } PromisePool.prototype._trackPromise = function (promise) { var that = this promise .then(function (result) { that._onPooledPromiseFulfilled(promise, result) }, function (error) { that._onPooledPromiseRejected(promise, error) })['catch'](function (err) { that._settle(new Error('Promise processing failed: ' + err)) }) } PromisePool.prototype._proceed = function () { if (!this._done) { var result = { done: false } while (this._size < this._concurrency && !(result = this._iterator.next()).done) { this._size++ this._trackPromise(result.value) } this._done = (result === null || !!result.done) } if (this._done && this._size === 0) { this._settle() } } PromisePool.PromisePoolEvent = PromisePoolEvent // Legacy API PromisePool.PromisePool = PromisePool return PromisePool }) /***/ }), /* 1137 */ /***/ (function(module, exports, __webpack_require__) { const get = __webpack_require__(571) const flatten = __webpack_require__(598) const Contact = __webpack_require__(1138) const Document = __webpack_require__(1132) class AdministrativeProcedure extends Document { /** * Returns personal data for the contact * * @param {Contact} contact - A contact * @param {Array} fields - The list of fields to retrieve * @return {Object} - the personal data **/ static getPersonalData(contact, fields) { const mapping = { firstname: { path: 'name.givenName' }, lastname: { path: 'name.familyName' }, address: { getter: Contact.getPrimaryAddress }, email: { getter: Contact.getPrimaryEmail }, phone: { getter: Contact.getPrimaryPhone } } let personalData = {} fields.forEach(field => { const contactField = get(mapping, field, field) let value if (contactField.getter) { value = contactField.getter(contact) } else { const path = get(contactField, 'path', field) value = get(contact, path) } if (value !== undefined) { personalData[field] = value } }) return personalData } /** * Method to generate a query based on a few rules given by the template * @param {Object} docRules * @param {Object} docRules.rules * @param {int} docRules.count */ static async getFilesByRules(docRules) { const { rules, count } = docRules const cozyRules = { trashed: false, type: 'file', ...rules } //Create an index in order to query and sort await this.cozyClient .collection('io.cozy.files') .createIndex(['metadata.datetime', 'metadata.classification']) //Use the index const files = await this.cozyClient .collection('io.cozy.files') .find(cozyRules, { indexedFields: ['metadata.datetime', 'metadata.classification'], sort: [ { 'metadata.datetime': 'desc' }, { 'metadata.classification': 'desc' } ], limit: count ? count : 1 }) return files } /** * Returns a io.cozy.procedures.administratives object * * @param {object} data - The data we need for this type of procedure * @param {ProcedureTemplate} template - The procedure's template * @return {AdministrativeProcedure} the administrative procedure */ static create(data, template) { const { documentsData, personalData, procedureData } = data const files = Object.keys(documentsData).map(identifier => { return documentsData[identifier].files.map(file => { //TODO Remove this check. it has to be done before if (file) return { _id: file.id, _type: 'io.cozy.files', templateDocumentId: identifier } }) }) return { personalData, procedureData, submissionDate: new Date(), templateId: template.type, templateVersion: template.version, relationships: { files: { data: flatten(files) } } } } /** * Returns json that represents the administative procedure * * @param {AdministrativeProcedure} * @return {string} - the json that represents this procedure * */ static createJson(administrativeProcedure) { return JSON.stringify(administrativeProcedure) } } AdministrativeProcedure.doctype = 'io.cozy.procedures.administratives' module.exports = AdministrativeProcedure /***/ }), /* 1138 */ /***/ (function(module, exports, __webpack_require__) { const PropTypes = __webpack_require__(1139) const get = __webpack_require__(571) const log = __webpack_require__(1146) const Document = __webpack_require__(1132) const getPrimaryOrFirst = property => obj => { if (!obj[property] || obj[property].length === 0) return '' return obj[property].find(property => property.primary) || obj[property][0] } /** * Class representing the contact model. * @extends Document */ class Contact extends Document { /** * Returns true if candidate is a contact * * @param {Object} candidate * @return {boolean} - whether the candidate is a contact */ static isContact(candidate) { return candidate._type === Contact.doctype } /** * Returns the initials of the contact. * * @param {Contact|string} contact - A contact or a string * @return {string} - the contact's initials */ static getInitials(contact) { if (typeof contact === 'string') { log( 'warn', 'Passing a string to Contact.getInitials will be deprecated soon.' ) return contact[0].toUpperCase() } if (contact.name) { return ['givenName', 'familyName'] .map(part => get(contact, ['name', part, 0], '')) .join('') .toUpperCase() } const email = Contact.getPrimaryEmail(contact) if (email) { return email[0].toUpperCase() } log('warn', 'Contact has no name and no email.') return '' } /** * Returns the contact's main email * * @param {Contact} contact - A contact * @return {string} - The contact's main email */ // TODO: sadly we have different versions of contacts' doctype to handle... // A migration tool on the stack side is needed here static getPrimaryEmail(contact) { return Array.isArray(contact.email) ? getPrimaryOrFirst('email')(contact).address : contact.email } /** * Returns the contact's main cozy * * @param {Contact} contact - A contact * @return {string} - The contact's main cozy */ static getPrimaryCozy(contact) { return Array.isArray(contact.cozy) ? getPrimaryOrFirst('cozy')(contact).url : contact.url } /** * Returns the contact's main phone number * * @param {Contact} contact - A contact * @return {string} - The contact's main phone number */ static getPrimaryPhone(contact) { return getPrimaryOrFirst('phone')(contact).number } /** * Returns the contact's main address * * @param {Contact} contact - A contact * @return {string} - The contact's main address */ static getPrimaryAddress(contact) { return getPrimaryOrFirst('address')(contact).formattedAddress } /** * Returns the contact's fullname * * @param {Contact} contact - A contact * @return {string} - The contact's fullname */ static getFullname(contact) { if (contact.fullname) { return contact.fullname } else if (contact.name) { return [ 'namePrefix', 'givenName', 'additionalName', 'familyName', 'nameSuffix' ] .map(part => contact.name[part]) .filter(part => part !== undefined) .join(' ') .trim() } return undefined } /** * Returns a display name for the contact * * @param {Contact} contact - A contact * @return {string} - the contact's display name **/ static getDisplayName(contact) { return Contact.getFullname(contact) || Contact.getPrimaryEmail(contact) } } const ContactShape = PropTypes.shape({ _id: PropTypes.string.isRequired, _type: PropTypes.string.isRequired, fullname: PropTypes.string, name: PropTypes.shape({ givenName: PropTypes.string, familyName: PropTypes.string, additionalName: PropTypes.string, namePrefix: PropTypes.string, nameSuffix: PropTypes.string }), birthday: PropTypes.string, note: PropTypes.string, email: PropTypes.arrayOf( PropTypes.shape({ address: PropTypes.string.isRequired, label: PropTypes.string, type: PropTypes.string, primary: PropTypes.bool }) ), address: PropTypes.arrayOf( PropTypes.shape({ street: PropTypes.string, pobox: PropTypes.string, city: PropTypes.string, region: PropTypes.string, postcode: PropTypes.string, country: PropTypes.string, type: PropTypes.string, primary: PropTypes.bool, label: PropTypes.string, formattedAddress: PropTypes.string }) ), phone: PropTypes.arrayOf( PropTypes.shape({ number: PropTypes.string.isRequired, type: PropTypes.string, label: PropTypes.string, primary: PropTypes.bool }) ), cozy: PropTypes.arrayOf( PropTypes.shape({ url: PropTypes.string.isRequired, label: PropTypes.string, primary: PropTypes.bool }) ), company: PropTypes.string, jobTitle: PropTypes.string, trashed: PropTypes.bool, me: PropTypes.bool, relationships: PropTypes.shape({ accounts: PropTypes.shape({ data: PropTypes.arrayOf( PropTypes.shape({ _id: PropTypes.string.isRequired, _type: PropTypes.string.isRequired }) ) }), groups: PropTypes.shape({ data: PropTypes.arrayOf( PropTypes.shape({ _id: PropTypes.string.isRequired, _type: PropTypes.string.isRequired }) ) }) }) }) Contact.doctype = 'io.cozy.contacts' Contact.propType = ContactShape module.exports = Contact /***/ }), /* 1139 */ /***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ if (true) { var ReactIs = __webpack_require__(1140); // By explicitly using `prop-types` you are opting into new development behavior. // http://fb.me/prop-types-in-prod var throwOnDirectAccess = true; module.exports = __webpack_require__(1142)(ReactIs.isElement, throwOnDirectAccess); } else {} /***/ }), /* 1140 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; if (false) {} else { module.exports = __webpack_require__(1141); } /***/ }), /* 1141 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** @license React v16.10.2 * react-is.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ if (true) { (function() { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); // The Symbol used to tag the ReactElement-like types. If there is no native Symbol // nor polyfill, then a plain number is used for performance. var hasSymbol = typeof Symbol === 'function' && Symbol.for; var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary // (unstable) APIs that have been removed. Can we remove the symbols? var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf; var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8; var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5; var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6; var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7; function isValidElementType(type) { return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE); } /** * Forked from fbjs/warning: * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js * * Only change is we use console.warn instead of console.error, * and do nothing when 'console' is not supported. * This really simplifies the code. * --- * Similar to invariant but only logs a warning if the condition is not met. * This can be used to log issues in development environments in critical * paths. Removing the logging code for production environments will keep the * same logic and follow the same code paths. */ var lowPriorityWarningWithoutStack = function () {}; { var printWarning = function (format) { for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } var argIndex = 0; var message = 'Warning: ' + format.replace(/%s/g, function () { return args[argIndex++]; }); if (typeof console !== 'undefined') { console.warn(message); } try { // --- Welcome to debugging React --- // This error was thrown as a convenience so that you can use this stack // to find the callsite that caused this warning to fire. throw new Error(message); } catch (x) {} }; lowPriorityWarningWithoutStack = function (condition, format) { if (format === undefined) { throw new Error('`lowPriorityWarningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument'); } if (!condition) { for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { args[_key2 - 2] = arguments[_key2]; } printWarning.apply(void 0, [format].concat(args)); } }; } var lowPriorityWarningWithoutStack$1 = lowPriorityWarningWithoutStack; function typeOf(object) { if (typeof object === 'object' && object !== null) { var $$typeof = object.$$typeof; switch ($$typeof) { case REACT_ELEMENT_TYPE: var type = object.type; switch (type) { case REACT_ASYNC_MODE_TYPE: case REACT_CONCURRENT_MODE_TYPE: case REACT_FRAGMENT_TYPE: case REACT_PROFILER_TYPE: case REACT_STRICT_MODE_TYPE: case REACT_SUSPENSE_TYPE: return type; default: var $$typeofType = type && type.$$typeof; switch ($$typeofType) { case REACT_CONTEXT_TYPE: case REACT_FORWARD_REF_TYPE: case REACT_PROVIDER_TYPE: return $$typeofType; default: return $$typeof; } } case REACT_LAZY_TYPE: case REACT_MEMO_TYPE: case REACT_PORTAL_TYPE: return $$typeof; } } return undefined; } // AsyncMode is deprecated along with isAsyncMode var AsyncMode = REACT_ASYNC_MODE_TYPE; var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; var ContextConsumer = REACT_CONTEXT_TYPE; var ContextProvider = REACT_PROVIDER_TYPE; var Element = REACT_ELEMENT_TYPE; var ForwardRef = REACT_FORWARD_REF_TYPE; var Fragment = REACT_FRAGMENT_TYPE; var Lazy = REACT_LAZY_TYPE; var Memo = REACT_MEMO_TYPE; var Portal = REACT_PORTAL_TYPE; var Profiler = REACT_PROFILER_TYPE; var StrictMode = REACT_STRICT_MODE_TYPE; var Suspense = REACT_SUSPENSE_TYPE; var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated function isAsyncMode(object) { { if (!hasWarnedAboutDeprecatedIsAsyncMode) { hasWarnedAboutDeprecatedIsAsyncMode = true; lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.'); } } return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; } function isConcurrentMode(object) { return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; } function isContextConsumer(object) { return typeOf(object) === REACT_CONTEXT_TYPE; } function isContextProvider(object) { return typeOf(object) === REACT_PROVIDER_TYPE; } function isElement(object) { return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; } function isForwardRef(object) { return typeOf(object) === REACT_FORWARD_REF_TYPE; } function isFragment(object) { return typeOf(object) === REACT_FRAGMENT_TYPE; } function isLazy(object) { return typeOf(object) === REACT_LAZY_TYPE; } function isMemo(object) { return typeOf(object) === REACT_MEMO_TYPE; } function isPortal(object) { return typeOf(object) === REACT_PORTAL_TYPE; } function isProfiler(object) { return typeOf(object) === REACT_PROFILER_TYPE; } function isStrictMode(object) { return typeOf(object) === REACT_STRICT_MODE_TYPE; } function isSuspense(object) { return typeOf(object) === REACT_SUSPENSE_TYPE; } exports.typeOf = typeOf; exports.AsyncMode = AsyncMode; exports.ConcurrentMode = ConcurrentMode; exports.ContextConsumer = ContextConsumer; exports.ContextProvider = ContextProvider; exports.Element = Element; exports.ForwardRef = ForwardRef; exports.Fragment = Fragment; exports.Lazy = Lazy; exports.Memo = Memo; exports.Portal = Portal; exports.Profiler = Profiler; exports.StrictMode = StrictMode; exports.Suspense = Suspense; exports.isValidElementType = isValidElementType; exports.isAsyncMode = isAsyncMode; exports.isConcurrentMode = isConcurrentMode; exports.isContextConsumer = isContextConsumer; exports.isContextProvider = isContextProvider; exports.isElement = isElement; exports.isForwardRef = isForwardRef; exports.isFragment = isFragment; exports.isLazy = isLazy; exports.isMemo = isMemo; exports.isPortal = isPortal; exports.isProfiler = isProfiler; exports.isStrictMode = isStrictMode; exports.isSuspense = isSuspense; })(); } /***/ }), /* 1142 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var ReactIs = __webpack_require__(1140); var assign = __webpack_require__(1143); var ReactPropTypesSecret = __webpack_require__(1144); var checkPropTypes = __webpack_require__(1145); var has = Function.call.bind(Object.prototype.hasOwnProperty); var printWarning = function() {}; if (true) { printWarning = function(text) { var message = 'Warning: ' + text; if (typeof console !== 'undefined') { console.error(message); } try { // --- Welcome to debugging React --- // This error was thrown as a convenience so that you can use this stack // to find the callsite that caused this warning to fire. throw new Error(message); } catch (x) {} }; } function emptyFunctionThatReturnsNull() { return null; } module.exports = function(isValidElement, throwOnDirectAccess) { /* global Symbol */ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. /** * Returns the iterator method function contained on the iterable object. * * Be sure to invoke the function with the iterable as context: * * var iteratorFn = getIteratorFn(myIterable); * if (iteratorFn) { * var iterator = iteratorFn.call(myIterable); * ... * } * * @param {?object} maybeIterable * @return {?function} */ function getIteratorFn(maybeIterable) { var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); if (typeof iteratorFn === 'function') { return iteratorFn; } } /** * Collection of methods that allow declaration and validation of props that are * supplied to React components. Example usage: * * var Props = require('ReactPropTypes'); * var MyArticle = React.createClass({ * propTypes: { * // An optional string prop named "description". * description: Props.string, * * // A required enum prop named "category". * category: Props.oneOf(['News','Photos']).isRequired, * * // A prop named "dialog" that requires an instance of Dialog. * dialog: Props.instanceOf(Dialog).isRequired * }, * render: function() { ... } * }); * * A more formal specification of how these methods are used: * * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) * decl := ReactPropTypes.{type}(.isRequired)? * * Each and every declaration produces a function with the same signature. This * allows the creation of custom validation functions. For example: * * var MyLink = React.createClass({ * propTypes: { * // An optional string or URI prop named "href". * href: function(props, propName, componentName) { * var propValue = props[propName]; * if (propValue != null && typeof propValue !== 'string' && * !(propValue instanceof URI)) { * return new Error( * 'Expected a string or an URI for ' + propName + ' in ' + * componentName * ); * } * } * }, * render: function() {...} * }); * * @internal */ var ANONYMOUS = '<<anonymous>>'; // Important! // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. var ReactPropTypes = { array: createPrimitiveTypeChecker('array'), bool: createPrimitiveTypeChecker('boolean'), func: createPrimitiveTypeChecker('function'), number: createPrimitiveTypeChecker('number'), object: createPrimitiveTypeChecker('object'), string: createPrimitiveTypeChecker('string'), symbol: createPrimitiveTypeChecker('symbol'), any: createAnyTypeChecker(), arrayOf: createArrayOfTypeChecker, element: createElementTypeChecker(), elementType: createElementTypeTypeChecker(), instanceOf: createInstanceTypeChecker, node: createNodeChecker(), objectOf: createObjectOfTypeChecker, oneOf: createEnumTypeChecker, oneOfType: createUnionTypeChecker, shape: createShapeTypeChecker, exact: createStrictShapeTypeChecker, }; /** * inlined Object.is polyfill to avoid requiring consumers ship their own * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is */ /*eslint-disable no-self-compare*/ function is(x, y) { // SameValue algorithm if (x === y) { // Steps 1-5, 7-10 // Steps 6.b-6.e: +0 != -0 return x !== 0 || 1 / x === 1 / y; } else { // Step 6.a: NaN == NaN return x !== x && y !== y; } } /*eslint-enable no-self-compare*/ /** * We use an Error-like object for backward compatibility as people may call * PropTypes directly and inspect their output. However, we don't use real * Errors anymore. We don't inspect their stack anyway, and creating them * is prohibitively expensive if they are created too often, such as what * happens in oneOfType() for any type before the one that matched. */ function PropTypeError(message) { this.message = message; this.stack = ''; } // Make `instanceof Error` still work for returned errors. PropTypeError.prototype = Error.prototype; function createChainableTypeChecker(validate) { if (true) { var manualPropTypeCallCache = {}; var manualPropTypeWarningCount = 0; } function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { componentName = componentName || ANONYMOUS; propFullName = propFullName || propName; if (secret !== ReactPropTypesSecret) { if (throwOnDirectAccess) { // New behavior only for users of `prop-types` package var err = new Error( 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types' ); err.name = 'Invariant Violation'; throw err; } else if ( true && typeof console !== 'undefined') { // Old behavior for people using React.PropTypes var cacheKey = componentName + ':' + propName; if ( !manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors manualPropTypeWarningCount < 3 ) { printWarning( 'You are manually calling a React.PropTypes validation ' + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.' ); manualPropTypeCallCache[cacheKey] = true; manualPropTypeWarningCount++; } } } if (props[propName] == null) { if (isRequired) { if (props[propName] === null) { return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); } return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); } return null; } else { return validate(props, propName, componentName, location, propFullName); } } var chainedCheckType = checkType.bind(null, false); chainedCheckType.isRequired = checkType.bind(null, true); return chainedCheckType; } function createPrimitiveTypeChecker(expectedType) { function validate(props, propName, componentName, location, propFullName, secret) { var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== expectedType) { // `propValue` being instance of, say, date/regexp, pass the 'object' // check, but we can offer a more precise error message here rather than // 'of type `object`'. var preciseType = getPreciseType(propValue); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); } return null; } return createChainableTypeChecker(validate); } function createAnyTypeChecker() { return createChainableTypeChecker(emptyFunctionThatReturnsNull); } function createArrayOfTypeChecker(typeChecker) { function validate(props, propName, componentName, location, propFullName) { if (typeof typeChecker !== 'function') { return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); } var propValue = props[propName]; if (!Array.isArray(propValue)) { var propType = getPropType(propValue); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); } for (var i = 0; i < propValue.length; i++) { var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); if (error instanceof Error) { return error; } } return null; } return createChainableTypeChecker(validate); } function createElementTypeChecker() { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; if (!isValidElement(propValue)) { var propType = getPropType(propValue); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); } return null; } return createChainableTypeChecker(validate); } function createElementTypeTypeChecker() { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; if (!ReactIs.isValidElementType(propValue)) { var propType = getPropType(propValue); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.')); } return null; } return createChainableTypeChecker(validate); } function createInstanceTypeChecker(expectedClass) { function validate(props, propName, componentName, location, propFullName) { if (!(props[propName] instanceof expectedClass)) { var expectedClassName = expectedClass.name || ANONYMOUS; var actualClassName = getClassName(props[propName]); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); } return null; } return createChainableTypeChecker(validate); } function createEnumTypeChecker(expectedValues) { if (!Array.isArray(expectedValues)) { if (true) { if (arguments.length > 1) { printWarning( 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).' ); } else { printWarning('Invalid argument supplied to oneOf, expected an array.'); } } return emptyFunctionThatReturnsNull; } function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; for (var i = 0; i < expectedValues.length; i++) { if (is(propValue, expectedValues[i])) { return null; } } var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { var type = getPreciseType(value); if (type === 'symbol') { return String(value); } return value; }); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); } return createChainableTypeChecker(validate); } function createObjectOfTypeChecker(typeChecker) { function validate(props, propName, componentName, location, propFullName) { if (typeof typeChecker !== 'function') { return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); } var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== 'object') { return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); } for (var key in propValue) { if (has(propValue, key)) { var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); if (error instanceof Error) { return error; } } } return null; } return createChainableTypeChecker(validate); } function createUnionTypeChecker(arrayOfTypeCheckers) { if (!Array.isArray(arrayOfTypeCheckers)) { true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : undefined; return emptyFunctionThatReturnsNull; } for (var i = 0; i < arrayOfTypeCheckers.length; i++) { var checker = arrayOfTypeCheckers[i]; if (typeof checker !== 'function') { printWarning( 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.' ); return emptyFunctionThatReturnsNull; } } function validate(props, propName, componentName, location, propFullName) { for (var i = 0; i < arrayOfTypeCheckers.length; i++) { var checker = arrayOfTypeCheckers[i]; if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { return null; } } return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); } return createChainableTypeChecker(validate); } function createNodeChecker() { function validate(props, propName, componentName, location, propFullName) { if (!isNode(props[propName])) { return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); } return null; } return createChainableTypeChecker(validate); } function createShapeTypeChecker(shapeTypes) { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== 'object') { return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); } for (var key in shapeTypes) { var checker = shapeTypes[key]; if (!checker) { continue; } var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); if (error) { return error; } } return null; } return createChainableTypeChecker(validate); } function createStrictShapeTypeChecker(shapeTypes) { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== 'object') { return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); } // We need to check all keys in case some are required but missing from // props. var allKeys = assign({}, props[propName], shapeTypes); for (var key in allKeys) { var checker = shapeTypes[key]; if (!checker) { return new PropTypeError( 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') ); } var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); if (error) { return error; } } return null; } return createChainableTypeChecker(validate); } function isNode(propValue) { switch (typeof propValue) { case 'number': case 'string': case 'undefined': return true; case 'boolean': return !propValue; case 'object': if (Array.isArray(propValue)) { return propValue.every(isNode); } if (propValue === null || isValidElement(propValue)) { return true; } var iteratorFn = getIteratorFn(propValue); if (iteratorFn) { var iterator = iteratorFn.call(propValue); var step; if (iteratorFn !== propValue.entries) { while (!(step = iterator.next()).done) { if (!isNode(step.value)) { return false; } } } else { // Iterator will provide entry [k,v] tuples rather than values. while (!(step = iterator.next()).done) { var entry = step.value; if (entry) { if (!isNode(entry[1])) { return false; } } } } } else { return false; } return true; default: return false; } } function isSymbol(propType, propValue) { // Native Symbol. if (propType === 'symbol') { return true; } // falsy value can't be a Symbol if (!propValue) { return false; } // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' if (propValue['@@toStringTag'] === 'Symbol') { return true; } // Fallback for non-spec compliant Symbols which are polyfilled. if (typeof Symbol === 'function' && propValue instanceof Symbol) { return true; } return false; } // Equivalent of `typeof` but with special handling for array and regexp. function getPropType(propValue) { var propType = typeof propValue; if (Array.isArray(propValue)) { return 'array'; } if (propValue instanceof RegExp) { // Old webkits (at least until Android 4.0) return 'function' rather than // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ // passes PropTypes.object. return 'object'; } if (isSymbol(propType, propValue)) { return 'symbol'; } return propType; } // This handles more types than `getPropType`. Only used for error messages. // See `createPrimitiveTypeChecker`. function getPreciseType(propValue) { if (typeof propValue === 'undefined' || propValue === null) { return '' + propValue; } var propType = getPropType(propValue); if (propType === 'object') { if (propValue instanceof Date) { return 'date'; } else if (propValue instanceof RegExp) { return 'regexp'; } } return propType; } // Returns a string that is postfixed to a warning about an invalid type. // For example, "undefined" or "of type array" function getPostfixForTypeWarning(value) { var type = getPreciseType(value); switch (type) { case 'array': case 'object': return 'an ' + type; case 'boolean': case 'date': case 'regexp': return 'a ' + type; default: return type; } } // Returns class name of the object, if any. function getClassName(propValue) { if (!propValue.constructor || !propValue.constructor.name) { return ANONYMOUS; } return propValue.constructor.name; } ReactPropTypes.checkPropTypes = checkPropTypes; ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; ReactPropTypes.PropTypes = ReactPropTypes; return ReactPropTypes; }; /***/ }), /* 1143 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* object-assign (c) Sindre Sorhus @license MIT */ /* eslint-disable no-unused-vars */ var getOwnPropertySymbols = Object.getOwnPropertySymbols; var hasOwnProperty = Object.prototype.hasOwnProperty; var propIsEnumerable = Object.prototype.propertyIsEnumerable; function toObject(val) { if (val === null || val === undefined) { throw new TypeError('Object.assign cannot be called with null or undefined'); } return Object(val); } function shouldUseNative() { try { if (!Object.assign) { return false; } // Detect buggy property enumeration order in older V8 versions. // https://bugs.chromium.org/p/v8/issues/detail?id=4118 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers test1[5] = 'de'; if (Object.getOwnPropertyNames(test1)[0] === '5') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test2 = {}; for (var i = 0; i < 10; i++) { test2['_' + String.fromCharCode(i)] = i; } var order2 = Object.getOwnPropertyNames(test2).map(function (n) { return test2[n]; }); if (order2.join('') !== '0123456789') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test3 = {}; 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { test3[letter] = letter; }); if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') { return false; } return true; } catch (err) { // We don't expect any of the above to throw, but better to be safe. return false; } } module.exports = shouldUseNative() ? Object.assign : function (target, source) { var from; var to = toObject(target); var symbols; for (var s = 1; s < arguments.length; s++) { from = Object(arguments[s]); for (var key in from) { if (hasOwnProperty.call(from, key)) { to[key] = from[key]; } } if (getOwnPropertySymbols) { symbols = getOwnPropertySymbols(from); for (var i = 0; i < symbols.length; i++) { if (propIsEnumerable.call(from, symbols[i])) { to[symbols[i]] = from[symbols[i]]; } } } } return to; }; /***/ }), /* 1144 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; module.exports = ReactPropTypesSecret; /***/ }), /* 1145 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var printWarning = function() {}; if (true) { var ReactPropTypesSecret = __webpack_require__(1144); var loggedTypeFailures = {}; var has = Function.call.bind(Object.prototype.hasOwnProperty); printWarning = function(text) { var message = 'Warning: ' + text; if (typeof console !== 'undefined') { console.error(message); } try { // --- Welcome to debugging React --- // This error was thrown as a convenience so that you can use this stack // to find the callsite that caused this warning to fire. throw new Error(message); } catch (x) {} }; } /** * Assert that the values match with the type specs. * Error messages are memorized and will only be shown once. * * @param {object} typeSpecs Map of name to a ReactPropType * @param {object} values Runtime values that need to be type-checked * @param {string} location e.g. "prop", "context", "child context" * @param {string} componentName Name of the component for error messages. * @param {?Function} getStack Returns the component stack. * @private */ function checkPropTypes(typeSpecs, values, location, componentName, getStack) { if (true) { for (var typeSpecName in typeSpecs) { if (has(typeSpecs, typeSpecName)) { var error; // Prop type validation may throw. In case they do, we don't want to // fail the render phase where it didn't fail before. So we log it. // After these have been cleaned up, we'll let them throw. try { // This is intentionally an invariant that gets caught. It's the same // behavior as without this statement except with a better message. if (typeof typeSpecs[typeSpecName] !== 'function') { var err = Error( (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' ); err.name = 'Invariant Violation'; throw err; } error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); } catch (ex) { error = ex; } if (error && !(error instanceof Error)) { printWarning( (componentName || 'React class') + ': type specification of ' + location + ' `' + typeSpecName + '` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).' ); } if (error instanceof Error && !(error.message in loggedTypeFailures)) { // Only monitor this failure once because there tends to be a lot of the // same error. loggedTypeFailures[error.message] = true; var stack = getStack ? getStack() : ''; printWarning( 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '') ); } } } } } /** * Resets warning cache when testing. * * @private */ checkPropTypes.resetWarningCache = function() { if (true) { loggedTypeFailures = {}; } } module.exports = checkPropTypes; /***/ }), /* 1146 */ /***/ (function(module, exports, __webpack_require__) { const log = __webpack_require__(2).namespace('doctypes') module.exports = log /***/ }), /* 1147 */ /***/ (function(module, exports, __webpack_require__) { const Document = __webpack_require__(1132) const APP_DOCTYPE = 'io.cozy.apps' const STORE_SLUG = 'store' class Application extends Document { /** * Return Store URL where an app/konnector can be installed / updated * @param {Array} [appData=[]] Apps data, as returned by endpoint /apps/ or * /konnectors/ * @param {Object} [app={}] AppObject * @return {String} URL as string */ static getStoreInstallationURL(appData = [], app = {}) { if (!app.slug) { throw new Error('Expected app / konnector with the defined slug') } const storeApp = this.isInstalled(appData, { slug: STORE_SLUG }) if (!storeApp) return null const storeUrl = storeApp.links && storeApp.links.related if (!storeUrl) return null return `${storeUrl}#/discover/${app.slug}/install` } /** * * @param {Array} apps Array of apps returned by /apps /konnectors * @param {Object} wantedApp io.cozy.app with at least a slug * @return {Object} The io.cozy.app is installed or undefined if not */ static isInstalled(apps = [], wantedApp = {}) { return apps.find( app => app.attributes && app.attributes.slug === wantedApp.slug ) } /** * * @param {Object} app io.cozy.app object * @return {String} url to the app */ static getUrl(app) { return app.links && app.links.related } } Application.schema = { doctype: APP_DOCTYPE, attributes: {} } Application.doctype = APP_DOCTYPE module.exports = Application /***/ }), /* 1148 */ /***/ (function(module, exports, __webpack_require__) { const Document = __webpack_require__(1132) const BankAccount = __webpack_require__(1149) class BalanceHistory extends Document { static async getByYearAndAccount(year, accountId) { const index = await Document.getIndex(this.doctype, this.idAttributes) const options = { selector: { year, 'relationships.account.data._id': accountId }, limit: 1 } const [balance] = await Document.query(index, options) if (balance) { return balance } return this.getEmptyDocument(year, accountId) } static getEmptyDocument(year, accountId) { return { year, balances: {}, metadata: { version: this.version }, relationships: { account: { data: { _id: accountId, _type: BankAccount.doctype } } } } } } BalanceHistory.doctype = 'io.cozy.bank.balancehistories' BalanceHistory.idAttributes = ['year', 'relationships.account.data._id'] BalanceHistory.version = 1 BalanceHistory.checkedAttributes = ['balances'] module.exports = BalanceHistory /***/ }), /* 1149 */ /***/ (function(module, exports, __webpack_require__) { const groupBy = __webpack_require__(1037) const get = __webpack_require__(571) const Document = __webpack_require__(1132) const matching = __webpack_require__(1150) const { getSlugFromInstitutionLabel } = __webpack_require__(1152) class BankAccount extends Document { /** * Adds _id of existing accounts to fetched accounts */ static reconciliate(fetchedAccounts, localAccounts) { const matchings = matching.matchAccounts(fetchedAccounts, localAccounts) return matchings.map(matching => { return { ...matching.account, _id: matching.match ? matching.match._id : undefined } }) } static findDuplicateAccountsWithNoOperations(accounts, operations) { const opsByAccountId = groupBy(operations, op => op.account) const duplicateAccountGroups = Object.entries( groupBy(accounts, x => x.institutionLabel + ' > ' + x.label) ) .map(([, duplicateGroup]) => duplicateGroup) .filter(duplicateGroup => duplicateGroup.length > 1) const res = [] for (const duplicateAccounts of duplicateAccountGroups) { for (const account of duplicateAccounts) { const accountOperations = opsByAccountId[account._id] || [] if (accountOperations.length === 0) { res.push(account) } } } return res } static hasIncoherentCreatedByApp(account) { const predictedSlug = getSlugFromInstitutionLabel(account.institutionLabel) const createdByApp = account.cozyMetadata && account.cozyMetadata.createdByApp return Boolean( predictedSlug && createdByApp && predictedSlug !== createdByApp ) } static getUpdatedAt(account) { const vendorUpdatedAt = get(account, 'metadata.updatedAt') if (vendorUpdatedAt) { return vendorUpdatedAt } const cozyUpdatedAt = get(account, 'cozyMetadata.updatedAt') if (cozyUpdatedAt) { return cozyUpdatedAt } return null } } BankAccount.normalizeAccountNumber = matching.normalizeAccountNumber BankAccount.doctype = 'io.cozy.bank.accounts' BankAccount.idAttributes = ['_id'] BankAccount.version = 1 BankAccount.checkedAttributes = null BankAccount.vendorIdAttr = 'vendorId' module.exports = BankAccount /***/ }), /* 1150 */ /***/ (function(module, exports, __webpack_require__) { const sortBy = __webpack_require__(1089) const { eitherIncludes } = __webpack_require__(1151) const { getSlugFromInstitutionLabel } = __webpack_require__(1152) const findExactMatch = (attr, account, existingAccounts) => { const sameAttr = existingAccounts.filter( existingAccount => existingAccount[attr] === account[attr] ) if (sameAttr.length === 1) { return { match: sameAttr[0], method: attr + '-exact' } } else if (sameAttr.length > 1) { return { matches: sameAttr, method: attr + '-exact' } } else { return null } } const untrimmedAccountNumber = /^(?:[A-Za-z]+)?-?([0-9]+)-?(?:[A-Za-z]+)?$/ const redactedCreditCard = /xxxx xxxx xxxx (\d{4})/ const normalizeAccountNumber = (number, iban) => { iban = iban && iban.replace(/\s/g, '') number = number && !number.match(redactedCreditCard) ? number.replace(/\s/g, '') : number let match if (iban && iban.length == 27) { return iban.substr(14, 11) } if (!number) { return number } if (number.length == 23) { // Must be an IBAN without the COUNTRY code // See support demand #9102 with BI // We extract the account number from the IBAN // COUNTRY (4) BANK (5) COUNTER (5) NUMBER (11) KEY (2) // FRXX 16275 10501 00300060030 00 return number.substr(10, 11) } else if (number.length == 16) { // Linxo sends Bank account number that contains // the counter number return number.substr(5, 11) } else if ( number.length > 11 && (match = number.match(untrimmedAccountNumber)) ) { // Some account numbers from BI are in the form // CC-00300060030 (CC for Compte Courant) or // LEO-00300060030 return match[1] } else { return number } } /** * If either of the account numbers has length 11 and one is contained * in the other, it's a match */ const approxNumberMatch = (account, existingAccount) => { return ( existingAccount.number && account.number && (existingAccount.number.length === 11 || account.number.length === 11) && eitherIncludes(existingAccount.number, account.number) ) } const creditCardMatch = (account, existingAccount) => { let ccAccount, lastDigits for (let acc of [account, existingAccount]) { const match = acc.number && acc.number.match(redactedCreditCard) if (match) { ccAccount = acc lastDigits = match[1] } } const other = ccAccount === account ? existingAccount : account if (other.number.slice(-4) === lastDigits) { return true } } const slugMatch = (account, existingAccount) => { const possibleSlug = getSlugFromInstitutionLabel(account.institutionLabel) const possibleSlugExisting = getSlugFromInstitutionLabel( existingAccount.institutionLabel ) return ( !possibleSlug || !possibleSlugExisting || possibleSlug === possibleSlugExisting ) } const score = (account, existingAccount) => { const methods = [] const res = { account: existingAccount, methods } let points = 0 /* To avoid accounts from different banks to be considered */ if (!slugMatch(account, existingAccount)) { points -= 1000 } if (approxNumberMatch(account, existingAccount)) { points += 50 methods.push('approx-number') } else { points -= 50 } if (account.type === existingAccount.type) { points += 50 methods.push('same-type') } if ( (account.type === 'CreditCard' || existingAccount.type === 'CreditCard') && creditCardMatch(account, existingAccount) ) { points += 150 methods.push('credit-card-number') } if (account.currency) { const sameCurrency = (existingAccount.rawNumber && existingAccount.rawNumber.includes(account.currency)) || (existingAccount.label && existingAccount.label.includes(account.currency)) || (existingAccount.originalBankLabel && existingAccount.originalBankLabel.includes(account.currency)) if (sameCurrency) { points += 50 methods.push('currency') } } res.points = points return res } const normalizeAccount = account => { const normalizedAccountNumber = normalizeAccountNumber( account.number, account.iban ) return { ...account, rawNumber: account.number, number: normalizedAccountNumber } } const exactMatchAttributes = ['iban', 'number'] const eqNotUndefined = (attr1, attr2) => { return attr1 && attr1 === attr2 } const findMatch = (account, existingAccounts) => { // Start with exact attribute matches for (const exactAttribute of exactMatchAttributes) { if (account[exactAttribute]) { const result = findExactMatch(exactAttribute, account, existingAccounts) if (result && result.match) { return result } } } const matchOriginalNumber = existingAccounts.find( otherAccount => eqNotUndefined(account.originalNumber, otherAccount.number) || eqNotUndefined(account.number, otherAccount.originalNumber) ) if (matchOriginalNumber) { return { match: matchOriginalNumber, method: 'originalNumber-exact' } } const matchRawNumberCurrencyType = existingAccounts.find( otherAccount => (eqNotUndefined(account.rawNumber, otherAccount.number) || eqNotUndefined(account.number, otherAccount.rawNumber)) && otherAccount.type == account.type && otherAccount.currency == account.currency ) if (matchRawNumberCurrencyType) { return { match: matchRawNumberCurrencyType, method: 'rawNumber-exact-currency-type' } } // Now we get more fuzzy and score accounts const scored = sortBy( existingAccounts.map(existingAccount => score(account, existingAccount)), x => -x.points ) const candidates = scored.filter(x => x.points > 0) if (candidates.length > 0) { return { match: candidates[0].account, method: candidates[0].methods.join('-') } } } const matchAccounts = (fetchedAccounts, existingAccounts) => { fetchedAccounts = fetchedAccounts.map(normalizeAccount) const toMatch = [...existingAccounts].map(normalizeAccount) const results = [] for (let fetchedAccount of fetchedAccounts) { const matchResult = findMatch(fetchedAccount, toMatch) if (matchResult) { const i = toMatch.indexOf(matchResult.match) toMatch.splice(i, 1) results.push({ account: fetchedAccount, ...matchResult }) } else { results.push({ account: fetchedAccount }) } } return results } module.exports = { matchAccounts, normalizeAccountNumber, score } /***/ }), /* 1151 */ /***/ (function(module, exports) { const eitherIncludes = (str1, str2) => { return Boolean(str1 && str2 && (str1.includes(str2) || str2.includes(str1))) } module.exports = { eitherIncludes } /***/ }), /* 1152 */ /***/ (function(module, exports, __webpack_require__) { const labelSlugs = __webpack_require__(1153) const institutionLabelsCompiled = Object.entries(labelSlugs).map( ([ilabelRx, slug]) => { if (ilabelRx[0] === '/' && ilabelRx[ilabelRx.length - 1] === '/') { return [new RegExp(ilabelRx.substr(1, ilabelRx.length - 2), 'i'), slug] } else { return [ilabelRx, slug] } } ) const getSlugFromInstitutionLabel = institutionLabel => { if (!institutionLabel) { return } for (const [rx, slug] of institutionLabelsCompiled) { if (rx instanceof RegExp) { const match = institutionLabel.match(rx) if (match) { return slug } } else if (rx.toLowerCase() === institutionLabel.toLowerCase()) { return slug } } } module.exports = { getSlugFromInstitutionLabel } /***/ }), /* 1153 */ /***/ (function(module, exports) { module.exports = { 'AXA Banque': 'axabanque102', '/Banque Populaire.*/': 'banquepopulaire', BforBank: 'bforbank97', 'BNP Paribas': 'bnpparibas82', BNPP: 'bnpparibas82', '/Boursorama.*/': 'boursorama83', casden: 'casden173', '/Hello bank!.*/': 'hellobank145', Bred: 'bred', CA: 'caatlantica3', 'Carrefour Banque': 'carrefour159', "/Caisse d'Épargne.*/": 'caissedepargne1', 'Compte Nickel': 'comptenickel168', '/^CIC.*/': 'cic63', 'Crédit Agricole': 'caatlantica3', 'Crédit Coopératif': 'creditcooperatif148', '/Crédit du Nord.*/': 'cdngroup88', '/Crédit Maritime.*/': 'creditmaritime', '/Crédit Mutuel.*/': 'cic45', Fortuneo: 'fortuneo84', 'Hello bank!': 'hellobank145', 'HSBC France': 'hsbc119', HSBC: 'hsbc119', '/^ING.*/': 'ingdirect95', '/La Banque Postale.*/': 'labanquepostale44', '/LCL.*/': 'lcl-linxo', Milleis: 'barclays136', Monabanq: 'monabanq96', 'Société Générale': 'societegenerale', 'Société marseillaise de crédit': 'cdngroup109' } /***/ }), /* 1154 */ /***/ (function(module, exports, __webpack_require__) { const fromPairs = __webpack_require__(1047) const log = __webpack_require__(2).namespace('BankingReconciliator') class BankingReconciliator { constructor(options) { this.options = options } async saveAccounts(fetchedAccounts, options) { const { BankAccount } = this.options const stackAccounts = await BankAccount.fetchAll() // Reconciliate const reconciliatedAccounts = BankAccount.reconciliate( fetchedAccounts, stackAccounts ) log('info', 'Saving accounts...') const savedAccounts = await BankAccount.bulkSave(reconciliatedAccounts, { handleDuplicates: 'remove' }) if (options.onAccountsSaved) { options.onAccountsSaved(savedAccounts) } return { savedAccounts, reconciliatedAccounts } } async save(fetchedAccounts, fetchedTransactions, options = {}) { const { BankAccount, BankTransaction } = this.options const { reconciliatedAccounts, savedAccounts } = await this.saveAccounts( fetchedAccounts, options ) // Bank accounts saved in Cozy, we can now link transactions to accounts // via their cozy id const vendorIdToCozyId = fromPairs( savedAccounts.map(acc => [acc[BankAccount.vendorIdAttr], acc._id]) ) log('info', 'Linking transactions to accounts...') log('info', JSON.stringify(vendorIdToCozyId)) fetchedTransactions.forEach(tr => { tr.account = vendorIdToCozyId[tr[BankTransaction.vendorAccountIdAttr]] if (tr.account === undefined) { log( 'warn', `Transaction without account, vendorAccountIdAttr: ${BankTransaction.vendorAccountIdAttr}` ) log('warn', 'transaction: ' + JSON.stringify(tr)) throw new Error('Transaction without account.') } }) const reconciliatedAccountIds = new Set( reconciliatedAccounts.filter(acc => acc._id).map(acc => acc._id) ) // Pass to transaction reconciliation only transactions that belong // to one of the reconciliated accounts const stackTransactions = (await BankTransaction.fetchAll()).filter( transaction => reconciliatedAccountIds.has(transaction.account) ) const transactions = BankTransaction.reconciliate( fetchedTransactions, stackTransactions, options ) log('info', 'Saving transactions...') let i = 1 const logProgress = doc => { log('debug', `[bulkSave] ${i++} Saving ${doc.date} ${doc.label}`) } const savedTransactions = await BankTransaction.bulkSave(transactions, { concurrency: 30, logProgress, handleDuplicates: 'remove' }) return { accounts: savedAccounts, transactions: savedTransactions } } } module.exports = BankingReconciliator /***/ }), /* 1155 */ /***/ (function(module, exports, __webpack_require__) { const keyBy = __webpack_require__(910) const groupBy = __webpack_require__(1037) const maxBy = __webpack_require__(1123) const addDays = __webpack_require__(1156) const isAfter = __webpack_require__(1157) const Document = __webpack_require__(1132) const log = __webpack_require__(1146) const BankAccount = __webpack_require__(1149) const { matchTransactions } = __webpack_require__(1158) const maxValue = (iterable, fn) => { const res = maxBy(iterable, fn) return res ? fn(res) : null } const getDate = transaction => { const date = transaction.realisationDate || transaction.date return date.slice(0, 10) } /** * Get the date of the latest transaction in an array. * Transactions in the future are ignored. * * @param {array} stackTransactions * @returns {string} The date of the latest transaction (YYYY-MM-DD) */ const getSplitDate = stackTransactions => { const now = new Date() const notFutureTransactions = stackTransactions.filter(transaction => { const date = getDate(transaction) return !isAfter(date, now) }) return maxValue(notFutureTransactions, getDate) } const ensureISOString = date => { if (date instanceof Date) { return date.toISOString() } else { return date } } class Transaction extends Document { static getDate(transaction) { return transaction } isAfter(minDate) { if (!minDate) { return true } else { const day = ensureISOString(this.date).slice(0, 10) if (day !== 'NaN') { return day > minDate } else { log( 'warn', 'transaction date could not be parsed. transaction: ' + JSON.stringify(this) ) return false } } } isBeforeOrSame(maxDate) { if (!maxDate) { return true } else { const day = ensureISOString(this.date).slice(0, 10) if (day !== 'NaN') { return day <= maxDate } else { log( 'warn', 'transaction date could not be parsed. transaction: ' + JSON.stringify(this) ) return false } } } /** * Get the descriptive (and almost uniq) identifier of a transaction * @param {object} transaction - The transaction (containing at least amount, originalBankLabel and date) * @returns {object} */ getIdentifier() { return `${this.amount}-${this.originalBankLabel}-${this.date}` } /** * Get transactions that should be present in the stack but are not. * Transactions that are older that 1 week before the oldest existing * transaction are ignored. * * @param {array} newTransactions * @param {array} stackTransactions * @returns {array} */ static getMissedTransactions( newTransactions, stackTransactions, options = {} ) { const oldestDate = maxValue(stackTransactions, getDate) const frontierDate = addDays(oldestDate, -7) const recentNewTransactions = newTransactions.filter(tr => isAfter(getDate(tr), frontierDate) ) const matchingResults = Array.from( matchTransactions(recentNewTransactions, stackTransactions) ) const missedTransactions = matchingResults .filter(result => !result.match) .map(result => result.transaction) const trackEvent = options.trackEvent if (typeof trackEvent === 'function') { try { const nbMissed = missedTransactions.length const nbExisting = stackTransactions.length trackEvent({ e_a: 'ReconciliateMissing', e_n: 'MissedTransactionPct', e_v: parseFloat((nbMissed / nbExisting).toFixed(2), 10) }) trackEvent({ e_a: 'ReconciliateMissing', e_n: 'MissedTransactionAbs', e_v: nbMissed }) } catch (e) { log('warn', `Could not send MissedTransaction event: ${e.message}`) } } return missedTransactions } static reconciliate(remoteTransactions, localTransactions, options = {}) { const findByVendorId = transaction => localTransactions.find(t => t.vendorId === transaction.vendorId) const groups = groupBy(remoteTransactions, transaction => findByVendorId(transaction) ? 'updatedTransactions' : 'newTransactions' ) let newTransactions = groups.newTransactions || [] const updatedTransactions = groups.updatedTransactions || [] const splitDate = getSplitDate(localTransactions) if (splitDate) { if (typeof options.trackEvent === 'function') { options.trackEvent({ e_a: 'ReconciliateSplitDate' }) } const isAfterSplit = x => Transaction.prototype.isAfter.call(x, splitDate) const isBeforeSplit = x => Transaction.prototype.isBeforeOrSame.call(x, splitDate) const transactionsAfterSplit = newTransactions.filter(isAfterSplit) if (transactionsAfterSplit.length > 0) { log( 'info', `Found ${transactionsAfterSplit.length} transactions after ${splitDate}` ) } else { log('info', `No transaction after ${splitDate}`) } const transactionsBeforeSplit = newTransactions.filter(isBeforeSplit) log( 'info', `Found ${transactionsBeforeSplit.length} transactions before ${splitDate}` ) const missedTransactions = Transaction.getMissedTransactions( transactionsBeforeSplit, localTransactions, options ) if (missedTransactions.length > 0) { log( 'info', `Found ${missedTransactions.length} missed transactions before ${splitDate}` ) } else { log('info', `No missed transactions before ${splitDate}`) } newTransactions = [...transactionsAfterSplit, ...missedTransactions] } else { log('info', "Can't find a split date, saving all new transactions") } log( 'info', `Transaction reconciliation: new ${newTransactions.length}, updated ${updatedTransactions.length}, split date ${splitDate} ` ) return [].concat(newTransactions).concat(updatedTransactions) } static async getMostRecentForAccounts(accountIds) { try { log('debug', 'Transaction.getLast') const index = await Document.getIndex(this.doctype, ['date', 'account']) const options = { selector: { date: { $gte: null }, account: { $in: accountIds } }, sort: [{ date: 'desc' }] } const transactions = await Document.query(index, options) log('info', 'last transactions length: ' + transactions.length) return transactions } catch (e) { log('error', e) return [] } } static async deleteOrphans() { log('info', 'Deleting up orphan operations') const accounts = keyBy(await BankAccount.fetchAll(), '_id') const operations = await this.fetchAll() const orphanOperations = operations.filter(x => !accounts[x.account]) log('info', `Total number of operations: ${operations.length}`) log('info', `Total number of orphan operations: ${orphanOperations.length}`) log('info', `Deleting ${orphanOperations.length} orphan operations...`) if (orphanOperations.length > 0) { return this.deleteAll(orphanOperations) } } getVendorAccountId() { return this[this.constructor.vendorAccountIdAttr] } static getCategoryId(transaction, options) { const opts = { localModelOverride: false, localModelUsageThreshold: this.LOCAL_MODEL_USAGE_THRESHOLD, globalModelUsageThreshold: this.GLOBAL_MODEL_USAGE_THRESHOLD, ...options } if (transaction.manualCategoryId) { return transaction.manualCategoryId } if ( opts.localModelOverride && transaction.localCategoryId && transaction.localCategoryProba && transaction.localCategoryProba > opts.localModelUsageThreshold ) { return transaction.localCategoryId } if ( transaction.cozyCategoryId && transaction.cozyCategoryProba && transaction.cozyCategoryProba > opts.globalModelUsageThreshold ) { return transaction.cozyCategoryId } // If the cozy categorization models have not been applied, we return null // so the transaction is considered as « categorization in progress ». // Otherwize we just use the automatic categorization from the vendor if (!transaction.localCategoryId && !transaction.cozyCategoryId) { return null } return transaction.automaticCategoryId } } Transaction.doctype = 'io.cozy.bank.operations' Transaction.version = 1 Transaction.vendorAccountIdAttr = 'vendorAccountId' Transaction.vendorIdAttr = 'vendorId' Transaction.idAttributes = ['vendorId'] Transaction.checkedAttributes = [ 'label', 'originalBankLabel', 'automaticCategoryId', 'account' ] Transaction.LOCAL_MODEL_USAGE_THRESHOLD = 0.8 Transaction.GLOBAL_MODEL_USAGE_THRESHOLD = 0.15 Transaction.getSplitDate = getSplitDate module.exports = Transaction /***/ }), /* 1156 */ /***/ (function(module, exports, __webpack_require__) { var parse = __webpack_require__(1099) /** * @category Day Helpers * @summary Add the specified number of days to the given date. * * @description * Add the specified number of days to the given date. * * @param {Date|String|Number} date - the date to be changed * @param {Number} amount - the amount of days to be added * @returns {Date} the new date with the days added * * @example * // Add 10 days to 1 September 2014: * var result = addDays(new Date(2014, 8, 1), 10) * //=> Thu Sep 11 2014 00:00:00 */ function addDays (dirtyDate, dirtyAmount) { var date = parse(dirtyDate) var amount = Number(dirtyAmount) date.setDate(date.getDate() + amount) return date } module.exports = addDays /***/ }), /* 1157 */ /***/ (function(module, exports, __webpack_require__) { var parse = __webpack_require__(1099) /** * @category Common Helpers * @summary Is the first date after the second one? * * @description * Is the first date after the second one? * * @param {Date|String|Number} date - the date that should be after the other one to return true * @param {Date|String|Number} dateToCompare - the date to compare with * @returns {Boolean} the first date is after the second date * * @example * // Is 10 July 1989 after 11 February 1987? * var result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11)) * //=> true */ function isAfter (dirtyDate, dirtyDateToCompare) { var date = parse(dirtyDate) var dateToCompare = parse(dirtyDateToCompare) return date.getTime() > dateToCompare.getTime() } module.exports = isAfter /***/ }), /* 1158 */ /***/ (function(module, exports, __webpack_require__) { const groupBy = __webpack_require__(1037) const sortBy = __webpack_require__(1089) const { eitherIncludes } = __webpack_require__(1151) const getDateTransaction = op => op.date.substr(0, 10) /** * Groups `iterables` via `grouper` and returns an iterator * that yields [groupKey, groups] */ const zipGroup = function*(iterables, grouper) { const grouped = iterables.map(items => groupBy(items, grouper)) for (const key of Object.keys(grouped[0]).sort()) { const groups = grouped.map(keyedGroups => keyedGroups[key] || []) yield [key, groups] } } const squash = (str, char) => { const rx = new RegExp(String.raw`${char}{2,}`, 'gi') return str && str.replace(rx, char) } const redactedNumber = /\b[0-9X]+\b/gi const dateRx = /\b\d{2}\/\d{2}\/\d{4}\b/g const cleanLabel = label => label && label.replace(redactedNumber, '') const withoutDate = str => str && str.replace(dateRx, '') const compacted = str => str && str.replace(/\s/g, '').replace(/-/g, '') const scoreLabel = (newTr, existingTr) => { if ( squash(existingTr.originalBankLabel, ' ') === squash(newTr.originalBankLabel, ' ') ) { return [200, 'originalBankLabel'] } else if ( compacted(existingTr.originalBankLabel) === compacted(newTr.originalBankLabel) ) { return [120, 'originalBankLabelCompacted'] } else if ( withoutDate(existingTr.originalBankLabel) === withoutDate(newTr.originalBankLabel) ) { // For some transfers, the date in the originalBankLabel is different between // BudgetInsight and Linxo return [150, 'originalBankLabelWithoutDate'] } else if (existingTr.label === newTr.label) { return [100, 'label'] } else if ( eitherIncludes(existingTr.label.toLowerCase(), newTr.label.toLowerCase()) ) { return [70, 'eitherIncludes'] } else if ( eitherIncludes( cleanLabel(existingTr.label.toLowerCase()), cleanLabel(newTr.label.toLowerCase()) ) ) { return [50, 'fuzzy-eitherIncludes'] } else { // Nothing matches, we penalize so that the score is below 0 return [-1000, 'label-penalty'] } } const DAY = 1000 * 60 * 60 * 24 const getDeltaDate = (newTr, existingTr) => { const nDate1 = new Date(newTr.date.substr(0, 10)) const eDate1 = new Date(existingTr.date.substr(0, 10)) const delta = Math.abs(eDate1 - nDate1) if (newTr.realisationDate) { const nDate2 = new Date(newTr.realisationDate.substr(0, 10)) const delta2 = Math.abs(eDate1 - nDate2) return Math.min(delta, delta2) } else { return delta } } const scoreMatching = (newTr, existingTr, options = {}) => { const methods = [] const res = { op: existingTr, methods } if (options.maxDateDelta) { const delta = getDeltaDate(newTr, existingTr) if (delta > options.maxDateDelta) { // Early exit, transactions are two far off time-wise res.points = -1000 return res } else { methods.push('approx-date') } } const [labelPoints, labelMethod] = scoreLabel(newTr, existingTr) methods.push(labelMethod) const amountDiff = Math.abs(existingTr.amount - newTr.amount) const amountPoints = amountDiff === 0 ? methods.push('amount') && 100 : -1000 const points = amountPoints + labelPoints res.points = points return res } const matchTransaction = (newTr, existingTrs, options = {}) => { const exactVendorId = existingTrs.find( existingTr => existingTr.vendorId && newTr.vendorId && existingTr.vendorId === newTr.vendorId ) if (exactVendorId) { return { match: exactVendorId, method: 'vendorId' } } // Now we try to do it based on originalBankLabel, label and amount. // We score candidates according to their degree of matching // with the current transaction. // Candidates with score below 0 will be discarded. const withPoints = existingTrs.map(existingTr => scoreMatching(newTr, existingTr, options) ) const candidates = sortBy(withPoints, x => -x.points).filter( x => x.points > 0 ) return candidates.length > 0 ? { match: candidates[0].op, method: candidates[0].methods.join('-') } : { candidates } } /** * Logic to match a transaction and removing it from the transactions to * match. `matchingFn` is the function used for matching. */ const matchTransactionToGroup = function*(newTrs, existingTrs, options = {}) { const toMatch = Array.isArray(existingTrs) ? [...existingTrs] : [] for (let newTr of newTrs) { const res = { transaction: newTr } const result = toMatch.length > 0 ? matchTransaction(newTr, toMatch, options) : null if (result) { Object.assign(res, result) const matchIdx = toMatch.indexOf(result.match) if (matchIdx > -1) { toMatch.splice(matchIdx, 1) } } yield res } } /** * Several logics to match transactions. * * First group transactions per day and match transactions in * intra-day mode. * Then relax the date constraint 1 day per 1 day to reach * a maximum of 5 days of differences */ const matchTransactions = function*(newTrs, existingTrs) { const unmatchedNew = new Set(newTrs) const unmatchedExisting = new Set(existingTrs) // eslint-disable-next-line no-unused-vars for (let [date, [newGroup, existingGroup]] of zipGroup( [newTrs, existingTrs], getDateTransaction )) { for (let result of matchTransactionToGroup(newGroup, existingGroup)) { if (result.match) { unmatchedExisting.delete(result.match) unmatchedNew.delete(result.transaction) yield result } } } const deltas = [3, 4, 5] for (let delta of deltas) { for (let result of matchTransactionToGroup( Array.from(unmatchedNew), Array.from(unmatchedExisting), { maxDateDelta: delta * DAY } )) { if (result.method) { result.method += `-delta${delta}` } if (result.match) { unmatchedExisting.delete(result.match) unmatchedNew.delete(result.transaction) } if (result.match || delta === deltas[deltas.length - 1]) { yield result } } } } module.exports = { matchTransactions, scoreMatching } /***/ }), /* 1159 */ /***/ (function(module, exports, __webpack_require__) { const Document = __webpack_require__(1132) const sumBy = __webpack_require__(1160) class BankAccountStats extends Document { static checkCurrencies(accountsStats) { const currency = accountsStats[0].currency for (const accountStats of accountsStats) { if (accountStats.currency !== currency) { return false } } return true } static sum(accountsStats) { if (accountsStats.length === 0) { throw new Error('You must give at least one stats object') } if (!this.checkCurrencies(accountsStats)) { throw new Error('Currency of all stats object must be the same.') } const properties = [ 'income', 'additionalIncome', 'mortgage', 'loans', 'fixedCharges' ] const summedStats = properties.reduce((sums, property) => { sums[property] = sumBy( accountsStats, accountStats => accountStats[property] || 0 ) return sums }, {}) summedStats.currency = accountsStats[0].currency return summedStats } } BankAccountStats.doctype = 'io.cozy.bank.accounts.stats' BankAccountStats.idAttributes = ['_id'] BankAccountStats.version = 1 BankAccountStats.checkedAttributes = null module.exports = BankAccountStats /***/ }), /* 1160 */ /***/ (function(module, exports, __webpack_require__) { var baseIteratee = __webpack_require__(543), baseSum = __webpack_require__(1161); /** * This method is like `_.sum` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the value to be summed. * The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Math * @param {Array} array The array to iterate over. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {number} Returns the sum. * @example * * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; * * _.sumBy(objects, function(o) { return o.n; }); * // => 20 * * // The `_.property` iteratee shorthand. * _.sumBy(objects, 'n'); * // => 20 */ function sumBy(array, iteratee) { return (array && array.length) ? baseSum(array, baseIteratee(iteratee, 2)) : 0; } module.exports = sumBy; /***/ }), /* 1161 */ /***/ (function(module, exports) { /** * The base implementation of `_.sum` and `_.sumBy` without support for * iteratee shorthands. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {number} Returns the sum. */ function baseSum(array, iteratee) { var result, index = -1, length = array.length; while (++index < length) { var current = iteratee(array[index]); if (current !== undefined) { result = result === undefined ? current : (result + current); } } return result; } module.exports = baseSum; /***/ }), /* 1162 */ /***/ (function(module, exports, __webpack_require__) { const trimEnd = __webpack_require__(1163) const Document = __webpack_require__(1132) const FILENAME_WITH_EXTENSION_REGEX = /(.+)(\..*)$/ /** * Class representing the file model. * @extends Document */ class CozyFile extends Document { /** * async getFullpath - Gets a file's path * * @param {string} dirID The id of the parent directory * @param {string} name The file's name * @return {string} The full path of the file in the cozy **/ static async getFullpath(dirId, name) { if (!dirId) { throw new Error('You must provide a dirId') } const parentDir = await this.get(dirId) const parentDirectoryPath = trimEnd(parentDir.path, '/') return `${parentDirectoryPath}/${name}` } /** * Move file to destination. * * @param {string} fileId - The file's id (required) * @param {object} destination * @param {string} destination.folderId - The destination folder's id (required) * @param {string} destination.path - The file's path after the move (optional, used to optimize performance in case of conflict) * @param {string} force - Whether we should overwrite the destination in case of conflict (defaults to false) * @returns {Promise} - A promise that returns the move action response and the deleted file id (if any) if resolved or an Error if rejected * */ static async move(fileId, destination, force = false) { const { folderId, path } = destination const filesCollection = this.cozyClient.collection('io.cozy.files') try { const resp = await filesCollection.updateFileMetadata(fileId, { dir_id: folderId }) return { moved: resp.data, deleted: null } } catch (e) { if (e.status === 409 && force) { let destinationPath if (path) { destinationPath = path } else { const movedFile = await this.get(fileId) const filename = movedFile.name destinationPath = await this.getFullpath(folderId, filename) } const conflictResp = await filesCollection.statByPath(destinationPath) await filesCollection.destroy(conflictResp.data) const resp = await filesCollection.updateFileMetadata(fileId, { dir_id: folderId }) return { moved: resp.data, deleted: conflictResp.data.id } } else { throw e } } } /** * Method to split both the filename and the extension * * @param {Object} file An io.cozy.files * @return {Object} return an object with {filename: , extension: } */ static splitFilename(file) { if (!file.name) throw new Error('file should have a name property ') if (file.type === 'file') { const match = file.name.match(FILENAME_WITH_EXTENSION_REGEX) if (match) { return { filename: match[1], extension: match[2] } } } return { filename: file.name, extension: '' } } /** * * Method to upload a file even if a file with the same name already exists. * * @param {String} path Fullpath for the file ex: path/to/ * @param {Object} file HTML Object file * @param {Object} metadata An object containing the wanted metadata to attach */ static async overrideFileForPath(path, file, metadata) { if (!path.endsWith('/')) path = path + '/' const filesCollection = this.cozyClient.collection('io.cozy.files') try { const existingFile = await filesCollection.statByPath(path + file.name) const { id: fileId, dir_id: dirId } = existingFile.data const resp = await filesCollection.updateFile(file, { dirId, fileId, metadata }) return resp } catch (error) { if (/Not Found/.test(error)) { const dirId = await filesCollection.ensureDirectoryExists(path) const createdFile = await filesCollection.createFile(file, { dirId, metadata }) return createdFile } throw error } } /** * Method to generate a new filename if there is a conflict * * @param {String} filenameWithoutExtension A filename without the extension * @return {String} A filename with the right suffix */ static generateNewFileNameOnConflict(filenameWithoutExtension) { //Check if the string ends by _1 const regex = new RegExp('(_)([0-9]+)$') const matches = filenameWithoutExtension.match(regex) if (matches) { let versionNumber = parseInt(matches[2]) //increment versionNumber versionNumber++ const newFilenameWithoutExtension = filenameWithoutExtension.replace( new RegExp('(_)([0-9]+)$'), `_${versionNumber}` ) return newFilenameWithoutExtension } else { return `${filenameWithoutExtension}_1` } } static generateFileNameForRevision(file, revision, f) { const { filename, extension } = CozyFile.splitFilename({ name: file.name, type: 'file' }) return `${filename}_${f( revision.updated_at, 'DD MMMM - HH[h]mm' )}${extension}` } /** * The goal of this method is to upload a file based on a conflict strategy. * Be careful: We need to check if the file exists by doing a statByPath query * before trying to upload the file since if we post and the stack return a * 409 conflict, we will get a SPDY_ERROR_PROTOCOL on Chrome. This is the only * viable workaround * If there is no conflict, then we upload the file. * If there is a conflict, then we apply the conflict strategy : `erase` or `rename` * @param {String} name File Name * @param {ArrayBuffer} file data * @param {String} dirId dir id where to upload * @param {String} conflictStrategy Actually only 2 hardcoded strategies 'erase' or 'rename' */ static async uploadFileWithConflictStrategy( name, file, dirId, conflictStrategy ) { const filesCollection = this.cozyClient.collection('io.cozy.files') try { const path = await CozyFile.getFullpath(dirId, name) const existingFile = await filesCollection.statByPath(path) const { id: fileId } = existingFile.data if (conflictStrategy === 'erase') { //!TODO Bug Fix. Seems we have to pass a name attribute ?! const resp = await filesCollection.updateFile(file, { dirId, fileId, name }) return resp } else { const { filename, extension } = CozyFile.splitFilename({ name, type: 'file' }) const newFileName = CozyFile.generateNewFileNameOnConflict(filename) + extension //recall itself with the newFilename. return CozyFile.uploadFileWithConflictStrategy( newFileName, file, dirId, conflictStrategy ) } } catch (error) { if (/Not Found/.test(error.message)) { return await CozyFile.upload(name, file, dirId) } throw error } } static async upload(name, file, dirId) { return this.cozyClient .collection('io.cozy.files') .createFile(file, { name, dirId, contentType: 'image/jpeg' }) } } CozyFile.doctype = 'io.cozy.files' module.exports = CozyFile /***/ }), /* 1163 */ /***/ (function(module, exports, __webpack_require__) { var baseToString = __webpack_require__(579), castSlice = __webpack_require__(1024), charsEndIndex = __webpack_require__(1164), stringToArray = __webpack_require__(1026), toString = __webpack_require__(578); /** Used to match leading and trailing whitespace. */ var reTrimEnd = /\s+$/; /** * Removes trailing whitespace or specified characters from `string`. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to trim. * @param {string} [chars=whitespace] The characters to trim. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {string} Returns the trimmed string. * @example * * _.trimEnd(' abc '); * // => ' abc' * * _.trimEnd('-_-abc-_-', '_-'); * // => '-_-abc' */ function trimEnd(string, chars, guard) { string = toString(string); if (string && (guard || chars === undefined)) { return string.replace(reTrimEnd, ''); } if (!string || !(chars = baseToString(chars))) { return string; } var strSymbols = stringToArray(string), end = charsEndIndex(strSymbols, stringToArray(chars)) + 1; return castSlice(strSymbols, 0, end).join(''); } module.exports = trimEnd; /***/ }), /* 1164 */ /***/ (function(module, exports, __webpack_require__) { var baseIndexOf = __webpack_require__(445); /** * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol * that is not found in the character symbols. * * @private * @param {Array} strSymbols The string symbols to inspect. * @param {Array} chrSymbols The character symbols to find. * @returns {number} Returns the index of the last unmatched string symbol. */ function charsEndIndex(strSymbols, chrSymbols) { var index = strSymbols.length; while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} return index; } module.exports = charsEndIndex; /***/ }), /* 1165 */ /***/ (function(module, exports, __webpack_require__) { const Application = __webpack_require__(1147) const CozyFile = __webpack_require__(1162) /** * Class representing the folder model. * @extends CozyFile */ class CozyFolder extends CozyFile { /** * Create a folder with a reference to the given document * @param {String} path Folder path * @param {Object} document Document to make reference to. Any doctype. * @return {Object} Folder document */ static async createFolderWithReference(path, document) { const collection = this.cozyClient.collection(CozyFile.doctype) const dirId = await collection.ensureDirectoryExists(path) await collection.addReferencesTo(document, [ { _id: dirId } ]) const { data: dirInfos } = await collection.get(dirId) return dirInfos } /** * Returns a "Magic Folder", given its id * @param {String} id Magic Folder id. `CozyFolder.magicFolders` contains the * ids of folders that can be magic folders. * @param {String} path Default path to use if magic folder does not exist * @return {Object} Folder document */ static async ensureMagicFolder(id, path) { const magicFolderDocument = { _type: Application.doctype, _id: id } const folders = await this.getReferencedFolders(magicFolderDocument) const existingMagicFolder = folders.length ? folders[0] : null if (existingMagicFolder) return existingMagicFolder const magicFoldersValues = Object.values(this.magicFolders) if (!magicFoldersValues.includes(id)) { throw new Error( `Cannot create Magic folder with id ${id}. Allowed values are ${magicFoldersValues.join( ', ' )}.` ) } if (!path) { throw new Error('Magic folder default path must be defined') } return this.createFolderWithReference(path, magicFolderDocument) } /** * Returns an array of folder referenced by the given document * @param {Object} document Document to get references from * @return {Array} Array of folders referenced with the given * document */ static async getReferencedFolders(document) { const { included } = await this.cozyClient .collection(CozyFile.doctype) .findReferencedBy(document) return included.filter(folder => !this.isTrashed(folder)) } /** * Returns an unique folder referenced with the given reference. Creates it * if it does not exist. * @param {String} path Path used to create folder if the referenced * folder does not exist. * @param {Object} document Document to create references from * @return {Objet} Folder referenced with the give reference */ static async ensureFolderWithReference(path, document) { const existingFolders = await this.getReferencedFolders(document) if (existingFolders.length) return existingFolders[0] const collection = this.cozyClient.collection(CozyFile.doctype) const dirId = await collection.ensureDirectoryExists(path) await collection.addReferencesTo(document, [ { _id: dirId } ]) const { data: dirInfos } = await collection.get(dirId) return dirInfos } /** * Indicates if a folder is in trash * @param {Object} folder `io.cozy.files` document * @return {Boolean} `true` if the folder is in trash, `false` * otherwise. */ static isTrashed(folder) { return /^\/\.cozy_trash/.test(folder.attributes.path) } } /** * References used by the Cozy platform and apps for specific folders. */ CozyFolder.magicFolders = { ADMINISTRATIVE: `${Application.doctype}/administrative`, PHOTOS: `${Application.doctype}/photos`, PHOTOS_BACKUP: `${Application.doctype}/photos/mobile`, PHOTOS_UPLOAD: `${Application.doctype}/photos/upload` } module.exports = CozyFolder /***/ }), /* 1166 */ /***/ (function(module, exports, __webpack_require__) { const PropTypes = __webpack_require__(1139) const Document = __webpack_require__(1132) class Group extends Document {} const GroupShape = PropTypes.shape({ _id: PropTypes.string.isRequired, _type: PropTypes.string.isRequired, name: PropTypes.string.isRequired, trashed: PropTypes.bool }) Group.doctype = 'io.cozy.contacts.groups' Group.propType = GroupShape module.exports = Group /***/ }), /* 1167 */ /***/ (function(module, exports, __webpack_require__) { const Document = __webpack_require__(1132) class Permission extends Document {} Permission.schema = { doctype: 'io.cozy.permissions', attributes: {} } module.exports = Permission /***/ }), /* 1168 */ /***/ (function(module, exports, __webpack_require__) { const uniq = __webpack_require__(984); const getUniqueCategories = transactions => { return uniq(transactions.map(t => t.manualCategoryId)); }; const pctOfTokensInVoc = (tokens, vocabularyArray) => { const n_tokens = tokens.length; const intersection = tokens.filter(t => -1 !== vocabularyArray.indexOf(t)); return intersection.length / n_tokens; }; const getAlphaParameter = (nbUniqueCategories, min, max, maxSmoothing) => { if (nbUniqueCategories === 1) { return 1; } else { const alpha = maxSmoothing / (nbUniqueCategories + 1); return Math.max(min, Math.min(max, alpha)); } }; module.exports = { getUniqueCategories, pctOfTokensInVoc, getAlphaParameter }; /***/ }), /* 1169 */ /***/ (function(module, exports) { const LOCAL_MODEL_CATEG_FALLBACK = '0'; const LOCAL_MODEL_PROBA_FALLBACK = 0.1; const LOCAL_MODEL_PCT_TOKENS_IN_VOC_THRESHOLD = 0.1; module.exports = { LOCAL_MODEL_CATEG_FALLBACK, LOCAL_MODEL_PROBA_FALLBACK, LOCAL_MODEL_PCT_TOKENS_IN_VOC_THRESHOLD }; /***/ }), /* 1170 */ /***/ (function(module, exports, __webpack_require__) { const cozy = __webpack_require__(617); const log = __webpack_require__(2).namespace('BaseKonnector'); const { Secret } = __webpack_require__(2); const manifest = __webpack_require__(1059); const saveBills = __webpack_require__(1171); const saveFiles = __webpack_require__(1172); const signin = __webpack_require__(1199); const get = __webpack_require__(571); const updateOrCreate = __webpack_require__(1202); const saveIdentity = __webpack_require__(1203); const { wrapIfSentrySetUp, captureExceptionAndDie } = __webpack_require__(1204); const sleep = __webpack_require__(9).promisify(global.setTimeout); const LOG_ERROR_MSG_LIMIT = 32 * 1024 - 1; // to avoid to cut the json long and make it unreadable by the stack const once = __webpack_require__(1234); const errors = __webpack_require__(1236); const findFolderPath = async (cozyFields, account) => { // folderId will be stored in cozyFields.folder_to_save on first run if (!cozyFields.folder_to_save) { log('warn', `No folder_to_save available in the trigger`); } const folderId = cozyFields.folder_to_save || account.folderId; if (folderId) { try { const folder = await cozy.files.statById(folderId, false); return folder.attributes.path; } catch (err) { log('error', err.message); log('error', JSON.stringify(err.stack)); log('error', `error while getting the folder path of ${folderId}`); throw new Error('NOT_EXISTING_DIRECTORY'); } } else { log('debug', 'No folder needed'); } }; const checkTOS = err => { if (err && err.reason && err.reason.length && err.reason[0] && err.reason[0].title === 'TOS Updated') { throw new Error('TOS_NOT_ACCEPTED'); } }; /** * @class * The class from which all the connectors must inherit. * It takes a fetch function in parameter that must return a `Promise`. * You need at least the `GET` permission on `io.cozy.accounts` in your manifest to allow it to * fetch account information for your connector. * * @example * ```javascript * const { BaseKonnector } = require('cozy-konnector-libs') * * module.exports = new BaseKonnector(function fetch () { * // use this to access the instance of the konnector to * // store any information that needs to be passed to * // different stages of the konnector * return request('http://ameli.fr') * .then(computeReimbursements) * .then(saveBills) * }) * ``` * * @description * Its role is twofold : * * - Make the link between account data and konnector * - Handle errors * * ⚠️ A promise should be returned from the `fetch` function otherwise * the konnector cannot know that asynchronous code has been called. * * ``` * this.terminate('LOGIN_FAILED') * ``` */ class BaseKonnector { /** * Constructor * * @param {Function} fetch - Function to be run automatically after account data is fetched. * This function will be binded to the current connector. * * If not fetch function is given. The connector will have to handle itself it's own exection and * error handling */ constructor(fetch) { if (typeof fetch === 'function') { this.fetch = fetch.bind(this); return this.run(); } this.deactivateAutoSuccessfulLogin = once(this.deactivateAutoSuccessfulLogin); errors.attachProcessEventHandlers(); } /** * Entrypoint of the konnector * * - Initializes connector attributes * - Awaits this.main * - Ensures errors are handled via this.fail * - Calls this.end when the main function succeeded */ async run() { try { log('info', 'Preparing konnector...'); await this.initAttributes(); log('info', 'Running konnector main...'); await this.main(this.fields, this.parameters); await this.end(); } catch (err) { log('warn', 'Error from konnector'); await this.fail(err); } } /** * Main runs after konnector has been initialized. * Errors thrown will be automatically handled. * * @returns {Promise} - The konnector is considered successful when it resolves */ main() { return this.fetch(this.fields, this.parameters); } /** * Hook called when the connector has ended successfully */ end() { log('info', 'The connector has been run'); } /** * Hook called when the connector fails */ fail(err) { log('info', 'Error caught by BaseKonnector'); const error = err.message || err; this.terminate(error); } async getAccount(accountId) { try { return await cozy.data.find('io.cozy.accounts', accountId); } catch (err) { checkTOS(err); log('error', err.message); log('error', `Account ${accountId} does not exist`); throw new Error('CANNOT_FIND_ACCOUNT'); } } /** * Initializes konnector attributes that will be used during its lifetime * * - this._account * - this.fields */ async initAttributes() { // Parse environment variables const cozyFields = JSON.parse(process.env.COZY_FIELDS || '{}'); const cozyParameters = JSON.parse(process.env.COZY_PARAMETERS || '{}'); this.parameters = cozyParameters; // Set account const account = await this.getAccount(cozyFields.account); if (!account || !account._id) { log('warn', 'No account was retrieved from getAccount'); } this.accountId = account._id; this._account = account; // Set folder const folderPath = await findFolderPath(cozyFields, account); cozyFields.folder_to_save = folderPath; this.fields = Object.assign({}, account.auth, account.oauth, folderPath ? { folderPath } : {}); } /** * Saves data to the account that is passed to the konnector. * Use it to persist data that needs to be passed to each * konnector run. * * By default, the data is merged to the remote data, use * `options.merge = false` to overwrite the data. * * The data is saved under the `.data` attribute of the cozy * account. * * Don't forget to modify the manifest.konnector file to give the right to write on the * `io.cozy.accounts` doctype. The syntax can be : `"permissions": {"accounts": {"type": "io.cozy.accounts"}}` (here we juste removed the verb `GET`) * * @param {object} data - Attributes to be merged * @param {object} options - { merge: true|false } * @returns {Promise}: resolved with the modified account */ saveAccountData(data, options) { options = options || {}; options.merge = options.merge === undefined ? true : options.merge; const start = options.merge ? Object.assign({}, this.getAccountData()) : {}; const newData = Object.assign({}, start, data); return this.updateAccountAttributes({ data: newData }).then(account => account.data); } /** * Get the data saved by saveAccountData * * @returns {object} */ getAccountData() { return new Secret(this._account.data || {}); } /** * Update account attributes and cache the account */ updateAccountAttributes(attributes) { return cozy.data.updateAttributes('io.cozy.accounts', this.accountId, attributes).then(account => { this._account = account; return account; }); } /** * Sets the 2FA state, according to the type passed. * Doing so resets the twoFACode field * * Typically you should not use that directly, prefer to use waitForTwoFaCode since * the wait for user input will be handled for you. It is useful though for the "app" * type where no user input (inside Cozy) is needed. * * @param {string} options.type - Used by the front to show the right message (email/sms/app) * @param {boolean} options.retry */ async setTwoFAState({ type, retry = false } = {}) { let state = retry ? 'TWOFA_NEEDED_RETRY' : 'TWOFA_NEEDED'; if (type === 'email') { state += '.EMAIL'; } else if (type === 'sms') { state += '.SMS'; } else if (type === 'app') { state += '.APP'; } log('info', `Setting ${state} state into the current account`); await this.updateAccountAttributes({ state, twoFACode: null }); } /** * Resets 2FA state when not needed anymore */ async resetTwoFAState() { await this.updateAccountAttributes({ state: null, twoFACode: null }); } /** * Notices that 2FA code is needed and wait for the user to submit it. * It uses the account to do the communication with the user. * * @param {string} options.type (default: "email") - Type of the expected 2FA code. The message displayed * to the user will depend on it. Possible values: email, sms * @param {number} options.timeout (default 3 minutes after now) - After this date, the stop will stop waiting and * and an error will be shown to the user (deprecated and alias of endTime) * @param {number} options.endTime (default 3 minutes after now) - After this timestamp, the home will stop waiting and * and an error will be shown to the user * @param {number} options.heartBeat (default: 5000) - How many milliseconds between each code check * @param {boolean} options.retry (default: false) - Is it a retry. If true, an error message will be * displayed to the user * @throws Will throw `USER_ACTION_NEEDED.TWOFA_EXPIRED` if the konnector job is not run manually (we assume that * not run manually means that we do not have a graphic interface to fill the required information) * @throws Will throw `USER_ACTION_NEEDED.TWOFA_EXPIRED` if 2FA is not filled by the user soon enough * * @returns {Promise} Contains twoFa code entered by user * * @example * * ```javascript * const { BaseKonnector } = require('cozy-konnector-libs') * * module.exports = new BaseKonnector(start) * async function start() { * // we detect the need of a 2FA code * const code = this.waitForTwoFaCode({ * type: 'email' * }) * // send the code to the targeted site * } * ``` */ async waitForTwoFaCode(options = {}) { if (process.env.COZY_JOB_MANUAL_EXECUTION !== 'true') { log('warn', `waitForTwoFaCode: this in not a manual execution. It is not possible to handle 2FA here.`); throw new Error('USER_ACTION_NEEDED.TWOFA_EXPIRED'); } const startTime = Date.now(); const defaultParams = { type: 'email', endTime: startTime + 3 * 60 * 1000, heartBeat: 5000, retry: false }; options = { ...defaultParams, ...options }; if (options.timeout) { log('warn', `The timeout option for waitForTwoFaCode is deprecated. Please use the endTime option now`); options.endTime = options.timeout; } let account = {}; await this.setTwoFAState({ type: options.type, retry: options.retry }); while (Date.now() < options.endTime && !account.twoFACode) { await sleep(options.heartBeat); account = await cozy.data.find('io.cozy.accounts', this.accountId); log('info', `current accountState : ${account.state}`); log('info', `current twoFACode : ${account.twoFACode}`); } if (account.twoFACode) { await this.resetTwoFAState(); return account.twoFACode; } throw new Error('USER_ACTION_NEEDED.TWOFA_EXPIRED'); } /** * Tells Cozy-Home that we have successfully logged in. * Useful when auto-success has been deactivated. * See `deactivateAutoSuccess` */ async notifySuccessfulLogin() { log('info', 'Notify Cozy-Home of successful login'); await this.updateAccountAttributes({ state: 'LOGIN_SUCCESS' }); } /** * By default, cozy-home considers that the konnector has successfully logged in * when the konnector has run for more than 8s. This is problematic for 2FA since * the konnector can sit idle, just waiting for the 2FA to come back. * * When this method is called, cozy-home is notified and will not consider the * absence of error after 8s to be a success. Afterwards, to notify cozy-home when * the user has logged in successfully, for example, after the user has entered 2FA * codes, it is necessary to call `notifySuccessfulLogin`. * * Does nothing if called more than once. */ async deactivateAutoSuccessfulLogin() { log('info', 'Deactivating auto success for Cozy-Home'); await this.updateAccountAttributes({ state: 'HANDLE_LOGIN_SUCCESS' }); } /** * This is saveBills function from cozy-konnector-libs which automatically adds sourceAccount in * metadata of each entry * * @returns {Promise} */ saveBills(entries, fields, options) { return saveBills(entries, fields, { sourceAccount: this.accountId, sourceAccountIdentifier: fields.login, ...options }); } /** * This is saveFiles function from cozy-konnector-libs which automatically adds sourceAccount and * sourceAccountIdentifier cozyMetadatas to files * * @returns {Promise} */ saveFiles(entries, fields, options) { return saveFiles(entries, fields, { sourceAccount: this.accountId, sourceAccountIdentifier: fields.login, ...options }); } /** * This is updateOrCreate function from cozy-konnector-libs which automatically adds sourceAccount in * metadata of each entry * * @returns {Promise} */ updateOrCreate(entries, doctype, matchingAttributes, options) { return updateOrCreate(entries, doctype, matchingAttributes, { sourceAccount: this.accountId, sourceAccountIdentifier: get(options, 'fields.login'), ...options }); } /** * This is saveIdentity function from cozy-konnector-libs which automatically adds sourceAccount in * metadata of each entry * * @returns {Promise} */ saveIdentity(contact, accountIdentifier, options = {}) { return saveIdentity(contact, accountIdentifier, { sourceAccount: this.accountId, sourceAccountIdentifier: accountIdentifier, ...options }); } /** * This is signin function from cozy-konnector-libs which automatically adds deactivateAutoSuccessfulLogin * and notifySuccessfulLogin calls * * @returns {Promise} */ async signin(options = {}) { await this.deactivateAutoSuccessfulLogin(); const result = await signin(options); await this.notifySuccessfulLogin(); return result; } /** * Send a special error code which is interpreted by the cozy stack to terminate the execution of the * connector now * * @param {string} message - The error code to be saved as connector result see [docs/ERROR_CODES.md] */ terminate(err) { log('critical', String(err).substr(0, LOG_ERROR_MSG_LIMIT)); captureExceptionAndDie(err); } /** * Get cozyMetaData from the context of the connector * * @param {object} data - this data will be merged with cozyMetaData */ getCozyMetadata(data) { Object.assign(data, { sourceAccount: this.accountId }); return manifest.getCozyMetadata(data); } } wrapIfSentrySetUp(BaseKonnector.prototype, 'run'); BaseKonnector.findFolderPath = findFolderPath; BaseKonnector.checkTOS = checkTOS; module.exports = BaseKonnector; /***/ }), /* 1171 */ /***/ (function(module, exports, __webpack_require__) { /** * Encapsulates the saving of Bills : saves the files, saves the new data, and associate the files * to an existing bank operation * * @module saveBills */ const utils = __webpack_require__(616); const saveFiles = __webpack_require__(1172); const hydrateAndFilter = __webpack_require__(611); const addData = __webpack_require__(1180); const log = __webpack_require__(2).namespace('saveBills'); const linkBankOperations = __webpack_require__(1181); const DOCTYPE = 'io.cozy.bills'; const _ = __webpack_require__(1065); const manifest = __webpack_require__(1059); const requiredAttributes = { date: 'isDate', amount: 'isNumber', vendor: 'isString' }; /** * Combines the features of `saveFiles`, `hydrateAndFilter`, `addData` and `linkBankOperations` for a * common case: bills. * Will create `io.cozy.bills` objects. The default deduplication keys are `['date', 'amount', 'vendor']`. * You need the full permission on `io.cozy.bills`, full permission on `io.cozy.files` and also * full permission on `io.cozy.bank.operations` in your manifest, to be able to use this function. * * Parameters: * * - `documents` is an array of objects with any attributes with some mandatory attributes : * + `amount` (Number): the amount of the bill used to match bank operations * + `date` (Date): the date of the bill also used to match bank operations * + `vendor` (String): the name of the vendor associated to the bill. Ex: 'trainline' * + `currency` (String) default: EUR: The ISO currency value (not mandatory since there is a * default value. * + `contractId` (String): Contract unique identicator used to deduplicate bills * + `contractLabel`: (String) User label if define, must be used with contractId * + `matchingCriterias` (Object): criterias that can be used by an external service to match bills * with bank operations. If not specified but the 'banksTransactionRegExp' attribute is specified in the * manifest of the connector, this value is automatically added to the bill * * You can also pass attributes expected by `saveFiles` : fileurl, filename, requestOptions * and more * * Please take a look at [io.cozy.bills doctype documentation](https://github.com/cozy/cozy-doctypes/blob/master/docs/io.cozy.bills.md) * - `fields` (object) this is the first parameter given to BaseKonnector's constructor * - `options` is passed directly to `saveFiles`, `hydrateAndFilter`, `addData` and `linkBankOperations`. * * @example * * ```javascript * const { BaseKonnector, saveBills } = require('cozy-konnector-libs') * * module.exports = new BaseKonnector(function fetch (fields) { * const documents = [] * // some code which fills documents * return saveBills(documents, fields, { * identifiers: ['vendor'] * }) * }) * ``` * * @alias module:saveBills */ const saveBills = async (inputEntries, fields, inputOptions = {}) => { // Cloning input arguments since both entries and options are expected // to be modified by functions called inside saveBills. const entries = _.cloneDeep(inputEntries); const options = _.cloneDeep(inputOptions); if (!_.isArray(entries) || entries.length === 0) { log('warn', 'saveBills: no bills to save'); return Promise.resolve(); } if (!options.sourceAccount) { log('warn', 'There is no sourceAccount given to saveBills'); } if (!options.sourceAccountIdentifier) { log('warn', 'There is no sourceAccountIdentifier given to saveBills'); } if (typeof fields === 'string') { fields = { folderPath: fields }; } // Deduplicate on this keys options.keys = options.keys || Object.keys(requiredAttributes); const originalEntries = entries; const defaultShouldUpdate = (entry, dbEntry) => entry.invoice !== dbEntry.invoice || !dbEntry.cozyMetadata || !dbEntry.matchingCriterias; if (!options.shouldUpdate) { options.shouldUpdate = defaultShouldUpdate; } else { const fn = options.shouldUpdate; options.shouldUpdate = (entry, dbEntry) => { return defaultShouldUpdate(entry, dbEntry) || fn(entry, dbEntry); }; } let tempEntries; tempEntries = manageContractsData(entries, options); tempEntries = await saveFiles(tempEntries, fields, options); if (options.processPdf) { for (let entry of tempEntries) { if (entry.fileDocument) { let pdfContent; try { pdfContent = await utils.getPdfText(entry.fileDocument._id); await options.processPdf(entry, pdfContent.text, pdfContent); } catch (err) { log('warn', `processPdf: Failed to read pdf content in ${_.get(entry, 'fileDocument.attributes.name')}`); log('warn', err.message); entry.__ignore = true; } } } } // try to get transaction regexp from the manifest let defaultTransactionRegexp = null; if (Object.keys(manifest.data).length && manifest.data.banksTransactionRegExp) { defaultTransactionRegexp = manifest.data.banksTransactionRegExp; } tempEntries = tempEntries.filter(entry => !entry.__ignore) // we do not save bills without associated file anymore .filter(entry => entry.fileDocument).map(entry => { entry.currency = convertCurrency(entry.currency); entry.invoice = `io.cozy.files:${entry.fileDocument._id}`; const matchingCriterias = entry.matchingCriterias || {}; if (defaultTransactionRegexp && !matchingCriterias.labelRegex) { matchingCriterias.labelRegex = defaultTransactionRegexp; entry.matchingCriterias = matchingCriterias; } delete entry.fileDocument; delete entry.fileAttributes; return entry; }); checkRequiredAttributes(tempEntries); tempEntries = await hydrateAndFilter(tempEntries, DOCTYPE, options); tempEntries = await addData(tempEntries, DOCTYPE, options); if (options.linkBankOperations !== false) { tempEntries = await linkBankOperations(originalEntries, DOCTYPE, fields, options); log('info', 'after linkbankoperation'); } return tempEntries; }; function convertCurrency(currency) { if (currency) { if (currency.includes('€')) { return 'EUR'; } else if (currency.includes('$')) { return 'USD'; } else if (currency.includes('£')) { return 'GBP'; } else { return currency; } } else { return 'EUR'; } } function checkRequiredAttributes(entries) { for (let entry of entries) { for (let attr in requiredAttributes) { if (entry[attr] == null) { throw new Error(`saveBills: an entry is missing the required ${attr} attribute`); } const checkFunction = requiredAttributes[attr]; const isExpectedType = _(entry[attr])[checkFunction](); if (isExpectedType === false) { throw new Error(`saveBills: an entry has a ${attr} which does not respect ${checkFunction}`); } } } } function manageContractsData(tempEntries, options) { if (options.contractLabel && options.contractId === undefined) { log('warn', 'contractLabel used without contractId, ignoring it.'); return tempEntries; } let newEntries = tempEntries; // if contractId passed by option if (options.contractId) { // Define contractlabel from contractId if not set in options if (!options.contractLabel) { options.contractLabel = options.contractId; } // Set saving path from contractLabel options.subPath = options.contractLabel; // Add contractId to deduplication keys addContractIdToDeduplication(options); // Add contract data to bills newEntries = newEntries.map(entry => addContractsDataToBill(entry, options)); // if contractId passed by bill attribute } else if (billsHaveContractId(newEntries)) { // Add contractId to deduplication keys addContractIdToDeduplication(options); newEntries = newEntries.map(entry => mergeContractsDataInBill(entry)); //manageContractsDataPassedByAttribute(newEntries, options } return newEntries; } function addContractsDataToBill(entry, options) { entry.contractLabel = options.contractLabel; entry.contractId = options.contractId; return entry; } function mergeContractsDataInBill(entry) { // Only treat bill with data if (entry.contractId) { // Surcharge label in needed if (!entry.contractLabel) { entry.contractLabel = entry.contractId; } // Edit subpath of each bill according to contractLabel entry.subPath = entry.contractLabel; } return entry; } /* This function return true if at least one bill of entries has a contractId */ function billsHaveContractId(entries) { for (const entry of entries) { if (entry.contractId) { return true; } } return false; } /* Add contractId to deduplication keys */ function addContractIdToDeduplication(options) { if (options.keys) { options.keys.push('contractId'); } } module.exports = saveBills; module.exports.manageContractsData = manageContractsData; /***/ }), /* 1172 */ /***/ (function(module, exports, __webpack_require__) { /** * Saves the given files in the given folder via the Cozy API. * * @module saveFiles */ const bluebird = __webpack_require__(25); const retry = __webpack_require__(1173); const mimetypes = __webpack_require__(1061); const path = __webpack_require__(160); const requestFactory = __webpack_require__(22); const omit = __webpack_require__(944); const get = __webpack_require__(571); const log = __webpack_require__(2).namespace('saveFiles'); const manifest = __webpack_require__(1059); const cozy = __webpack_require__(617); const { queryAll } = __webpack_require__(616); const mkdirp = __webpack_require__(1175); const errors = __webpack_require__(1176); const stream = __webpack_require__(100); const fileType = __webpack_require__(1177); const DEFAULT_TIMEOUT = Date.now() + 4 * 60 * 1000; // 4 minutes by default since the stack allows 5 minutes const DEFAULT_CONCURRENCY = 1; const DEFAULT_RETRY = 1; // do not retry by default /** * Saves the files given in the fileurl attribute of each entries * * You need the full permission on `io.cozy.files` in your manifest to use this function. * * - `files` is an array of objects with the following possible attributes : * * + fileurl: The url of the file (can be a function returning the value). Ignored if `filestream` * is given * + filestream: the stream which will be directly passed to cozyClient.files.create (can also be * function returning the stream) * + requestOptions (object) : The options passed to request to fetch fileurl (can be a function returning the value) * + filename : The file name of the item written on disk. This attribute is optional and as default value, the * file name will be "smartly" guessed by the function. Use this attribute if the guess is not smart * enough for you, or if you use `filestream` (can be a function returning the value). * + `shouldReplaceName` (string) used to migrate filename. If saveFiles find a file linked to this entry and this * file name matches `shouldReplaceName`, the file is renames to `filename` (can be a function returning the value) * + `shouldReplaceFile` (function) use this function to state if the current entry should be forced * to be redownloaded and replaced. Usefull if we know the file content can change and we always * want the last version. * + `fileAttributes` (object) ex: `{created_at: new Date()}` sets some additionnal file * attributes passed to cozyClient.file.create * + `subPath` (string) : A subpath to save all files, will be created if needed. * * - `fields` (string) is the argument given to the main function of your connector by the BaseKonnector. * It especially contains a `folderPath` which is the string path configured by the user in * collect/home * * - `options` (object) is optional. Possible options : * * + `timeout` (timestamp) can be used if your connector needs to fetch a lot of files and if the * stack does not give enough time to your connector to fetch it all. It could happen that the * connector is stopped right in the middle of the download of the file and the file will be * broken. With the `timeout` option, the `saveFiles` function will check if the timeout has * passed right after downloading each file and then will be sure to be stopped cleanly if the * timeout is not too long. And since it is really fast to check that a file has already been * downloaded, on the next run of the connector, it will be able to download some more * files, and so on. If you want the timeout to be in 10s, do `Date.now() + 10*1000`. * You can try it in the previous code. * + `contentType` (string or boolean) ex: 'application/pdf' used to force the contentType of documents when * they are badly recognized by cozy. If "true" the content type will be recognized from the file * name and forced the same way. * + `concurrency` (number) default: `1` sets the maximum number of concurrent downloads * + `validateFile` (function) default: do not validate if file is empty or has bad mime type * + `validateFileContent` (boolean or function) default false. Also check the content of the file to * recognize the mime type * + `fileIdAttributes` (array of strings). Describes which attributes of files will be taken as primary key for * files to check if they already exist, even if they are moved. If not given, the file path will * used for deduplication as before. * + `subPath` (string) : A subpath to save this file, will be created if needed. * * @example * ```javascript * await saveFiles([{fileurl: 'https://...', filename: 'bill1.pdf'}], fields, { * fileIdAttributes: ['fileurl'] * }) * ``` * * @alias module:saveFiles */ const saveFiles = async (entries, fields, options = {}) => { if (!entries || entries.length === 0) { log('warn', 'No file to download'); } if (!options.sourceAccount) { log('warn', 'There is no sourceAccount given to saveFiles'); } if (!options.sourceAccountIdentifier) { log('warn', 'There is no sourceAccountIdentifier given to saveFIles'); } if (typeof fields !== 'object') { log('debug', 'Deprecation warning, saveFiles 2nd argument should not be a string'); fields = { folderPath: fields }; } const saveOptions = { folderPath: fields.folderPath, fileIdAttributes: options.fileIdAttributes, timeout: options.timeout || DEFAULT_TIMEOUT, concurrency: options.concurrency || DEFAULT_CONCURRENCY, retry: options.retry || DEFAULT_RETRY, postProcess: options.postProcess, postProcessFile: options.postProcessFile, contentType: options.contentType, requestInstance: options.requestInstance, shouldReplaceFile: options.shouldReplaceFile, validateFile: options.validateFile || defaultValidateFile, subPath: options.subPath, sourceAccountOptions: { sourceAccount: options.sourceAccount, sourceAccountIdentifier: options.sourceAccountIdentifier } }; if (options.validateFileContent) { if (options.validateFileContent === true) { saveOptions.validateFileContent = defaultValidateFileContent; } else if (typeof options.validateFileContent === 'function') { saveOptions.validateFileContent = options.validateFileContent; } } noMetadataDeduplicationWarning(saveOptions); const canBeSaved = entry => entry.fileurl || entry.requestOptions || entry.filestream; let filesArray = undefined; let savedFiles = 0; const savedEntries = []; try { await bluebird.map(entries, async entry => { ; ['fileurl', 'filename', 'shouldReplaceName', 'requestOptions' // 'filestream' ].forEach(key => { if (entry[key]) entry[key] = getValOrFnResult(entry[key], entry, options); }); if (entry.filestream && !entry.filename) { log('warn', 'Missing filename property for for filestream entry, entry is ignored'); return; } if (entry.shouldReplaceName) { // At first encounter of a rename, we set the filenamesList if (filesArray === undefined) { log('debug', 'initialize files list for renamming'); filesArray = await getFiles(fields.folderPath); } const fileFound = filesArray.find(f => f.name === entry.shouldReplaceName); if (fileFound) { await renameFile(fileFound, entry); return; } else { delete entry.shouldReplaceName; // And continue as normal } } if (canBeSaved(entry)) { const folderPath = await getOrCreateDestinationPath(entry, saveOptions); entry = await saveEntry(entry, { ...saveOptions, folderPath }); if (entry && entry._cozy_file_to_create) { savedFiles++; delete entry._cozy_file_to_create; } } savedEntries.push(entry); }, { concurrency: saveOptions.concurrency }); } catch (err) { if (err.message !== 'TIMEOUT') { throw err; } else { log('warn', `saveFile timeout: still ${entries.length - savedEntries.length} / ${entries.length} to download`); } } log('info', `saveFiles created ${savedFiles} files for ${savedEntries ? savedEntries.length : 'n'} entries`); return savedEntries; }; const saveEntry = async function (entry, options) { if (options.timeout && Date.now() > options.timeout) { const remainingTime = Math.floor((options.timeout - Date.now()) / 1000); log('info', `${remainingTime}s timeout finished for ${options.folderPath}`); throw new Error('TIMEOUT'); } let file = await getFileIfExists(entry, options); let shouldReplace = false; if (file) { try { shouldReplace = await shouldReplaceFile(file, entry, options); } catch (err) { log('info', `Error in shouldReplace : ${err.message}`); shouldReplace = true; } } let method = 'create'; if (shouldReplace && file) { method = 'updateById'; log('info', `Will replace ${getFilePath({ options, file })}...`); } try { if (!file || method === 'updateById') { log('debug', omit(entry, 'filestream')); logFileStream(entry.filestream); log('debug', `File ${getFilePath({ options, entry })} does not exist yet or is not valid`); entry._cozy_file_to_create = true; file = await retry(createFile, { interval: 1000, throw_original: true, max_tries: options.retry, args: [entry, options, method, file ? file._id : undefined] }).catch(err => { if (err.message === 'BAD_DOWNLOADED_FILE') { log('warn', `Could not download file after ${options.retry} tries removing the file`); } else { log('warn', 'unknown file download error: ' + err.message); } }); } attachFileToEntry(entry, file); sanitizeEntry(entry); if (options.postProcess) { await options.postProcess(entry); } } catch (err) { if (getErrorStatus(err) === 413) { // the cozy quota is full throw new Error(errors.DISK_QUOTA_EXCEEDED); } log('warn', errors.SAVE_FILE_FAILED); log('warn', err.message, `Error caught while trying to save the file ${entry.fileurl ? entry.fileurl : entry.filename}`); } return entry; }; function noMetadataDeduplicationWarning(options) { const fileIdAttributes = options.fileIdAttributes; if (!fileIdAttributes) { log('warn', `saveFiles: no deduplication key is defined, file deduplication will be based on file path`); } const slug = manifest.data.slug; if (!slug) { log('warn', `saveFiles: no slug is defined for the current connector, file deduplication will be based on file path`); } const sourceAccountIdentifier = get(options, 'sourceAccountOptions.sourceAccountIdentifier'); if (!sourceAccountIdentifier) { log('warn', `saveFiles: no sourceAccountIdentifier is defined in options, file deduplication will be based on file path`); } } async function getFileIfExists(entry, options) { const fileIdAttributes = options.fileIdAttributes; const slug = manifest.data.slug; const sourceAccountIdentifier = get(options, 'sourceAccountOptions.sourceAccountIdentifier'); const isReadyForFileMetadata = fileIdAttributes && slug && sourceAccountIdentifier; if (isReadyForFileMetadata) { const file = await getFileFromMetaData(entry, fileIdAttributes, sourceAccountIdentifier, slug); if (!file) { // no file with correct metadata, maybe the corresponding file already exist in the default // path from a previous version of the connector return await getFileFromPath(entry, options); } else return file; } else { return await getFileFromPath(entry, options); } } async function getFileFromMetaData(entry, fileIdAttributes, sourceAccountIdentifier, slug) { const index = await cozy.data.defineIndex('io.cozy.files', ['metadata.fileIdAttributes', 'trashed', 'cozyMetadata.sourceAccountIdentifier', 'cozyMetadata.createdByApp']); log('debug', `Checking existence of ${calculateFileKey(entry, fileIdAttributes)}`); const files = await queryAll('io.cozy.files', { metadata: { fileIdAttributes: calculateFileKey(entry, fileIdAttributes) }, trashed: false, cozyMetadata: { sourceAccountIdentifier, createdByApp: slug } }, index); if (files && files[0]) { if (files.length > 1) { log('warn', `Found ${files.length} files corresponding to ${calculateFileKey(entry, fileIdAttributes)}`); } return files[0]; } else { log('debug', 'not found'); return false; } } async function getFileFromPath(entry, options) { try { log('debug', `Checking existence of ${getFilePath({ entry, options })}`); const result = await cozy.files.statByPath(getFilePath({ entry, options })); return result; } catch (err) { log('debug', err.message); return false; } } async function createFile(entry, options, method, fileId) { const folder = await cozy.files.statByPath(options.folderPath); let createFileOptions = { name: getFileName(entry), dirID: folder._id }; if (options.contentType) { if (options.contentType === true && entry.filename) { createFileOptions.contentType = mimetypes.contentType(entry.filename); } else { createFileOptions.contentType = options.contentType; } } createFileOptions = { ...createFileOptions, ...entry.fileAttributes, ...options.sourceAccountOptions }; if (options.fileIdAttributes) { createFileOptions = { ...createFileOptions, ...{ metadata: { ...createFileOptions.metadata, fileIdAttributes: calculateFileKey(entry, options.fileIdAttributes) } } }; } const toCreate = entry.filestream || downloadEntry(entry, { ...options, simple: false }); let fileDocument; if (method === 'create') { fileDocument = await cozy.files.create(toCreate, createFileOptions); } else if (method === 'updateById') { log('info', `replacing file for ${entry.filename}`); fileDocument = await cozy.files.updateById(fileId, toCreate, createFileOptions); } if (options.validateFile) { if ((await options.validateFile(fileDocument)) === false) { await removeFile(fileDocument); throw new Error('BAD_DOWNLOADED_FILE'); } if (options.validateFileContent && !(await options.validateFileContent(fileDocument))) { await removeFile(fileDocument); throw new Error('BAD_DOWNLOADED_FILE'); } } return fileDocument; } function downloadEntry(entry, options) { let filePromise = getRequestInstance(entry, options)(getRequestOptions(entry, options)); if (options.contentType) { // the developper wants to foce the contentType of the document // we pipe the stream to remove headers with bad contentType from the request return filePromise.pipe(new stream.PassThrough()); } // we have to do this since the result of filePromise is not a stream and cannot be taken by // cozy.files.create if (options.postProcessFile) { log('warn', 'Be carefull postProcessFile option is deprecated. You should use the filestream attribute in each entry instead'); return filePromise.then(data => options.postProcessFile(data)); } filePromise.catch(err => { log('warn', `File download error ${err.message}`); }); return filePromise; } const shouldReplaceFile = async function (file, entry, options) { const isValid = !options.validateFile || (await options.validateFile(file)); if (!isValid) { log('warn', `${getFileName({ file, options })} is invalid`); throw new Error('BAD_DOWNLOADED_FILE'); } const defaultShouldReplaceFile = (file, entry) => { // replace all files with meta if there is file metadata to add const fileHasNoMetadata = !getAttribute(file, 'metadata'); const fileHasNoId = !getAttribute(file, 'metadata.fileIdAttributes'); const entryHasMetadata = !!get(entry, 'fileAttributes.metadata'); const hasSourceAccountIdentifierOption = !!get(options, 'sourceAccountOptions.sourceAccountIdentifier'); const fileHasSourceAccountIdentifier = !!getAttribute(file, 'cozyMetadata.sourceAccountIdentifier'); const result = fileHasNoMetadata && entryHasMetadata || fileHasNoId && !!options.fileIdAttributes || hasSourceAccountIdentifierOption && !fileHasSourceAccountIdentifier; return result; }; const shouldReplaceFileFn = entry.shouldReplaceFile || options.shouldReplaceFile || defaultShouldReplaceFile; return shouldReplaceFileFn(file, entry); }; const removeFile = async function (file) { await cozy.files.trashById(file._id); await cozy.files.destroyById(file._id); }; module.exports = saveFiles; module.exports.getFileIfExists = getFileIfExists; function getFileName(entry) { let filename; if (entry.filename) { filename = entry.filename; } else if (entry.fileurl) { // try to get the file name from the url const parsed = __webpack_require__(83).parse(entry.fileurl); filename = path.basename(parsed.pathname); } else { log('error', 'Could not get a file name for the entry'); return false; } return sanitizeFileName(filename); } function sanitizeFileName(filename) { return filename.replace(/^\.+$/, '').replace(/[/?<>\\:*|":]/g, ''); } function checkFileSize(fileobject) { const size = getAttribute(fileobject, 'size'); const name = getAttribute(fileobject, 'name'); if (size === 0 || size === '0') { log('warn', `${name} is empty`); log('warn', 'BAD_FILE_SIZE'); return false; } return true; } function checkMimeWithPath(fileDocument) { const mime = getAttribute(fileDocument, 'mime'); const name = getAttribute(fileDocument, 'name'); const extension = path.extname(name).substr(1); if (extension && mime && mimetypes.lookup(extension) !== mime) { log('warn', `${name} and ${mime} do not correspond`); log('warn', 'BAD_MIME_TYPE'); return false; } return true; } function logFileStream(fileStream) { if (!fileStream) return; if (fileStream && fileStream.constructor && fileStream.constructor.name) { log('info', `The fileStream attribute is an instance of ${fileStream.constructor.name}`); } else { log('info', `The fileStream attribute is a ${typeof fileStream}`); } } async function getFiles(folderPath) { const dir = await cozy.files.statByPath(folderPath); const files = await queryAll('io.cozy.files', { dir_id: dir._id }); return files; } async function renameFile(file, entry) { if (!entry.filename) { throw new Error('shouldReplaceName needs a filename'); } log('debug', `Renaming ${file.name} to ${entry.filename}`); try { await cozy.files.updateAttributesById(file._id, { name: entry.filename }); } catch (err) { if (JSON.parse(err.message).errors.shift().status === '409') { log('warn', `${entry.filename} already exists. Removing ${file.name}`); await cozy.files.trashById(file._id); } } } function getErrorStatus(err) { try { return Number(JSON.parse(err.message).errors[0].status); } catch (e) { return null; } } function getValOrFnResult(val, ...args) { if (typeof val === 'function') { return val.apply(val, args); } else return val; } function calculateFileKey(entry, fileIdAttributes) { return fileIdAttributes.sort().map(key => get(entry, key)).join('####'); } function defaultValidateFile(fileDocument) { return checkFileSize(fileDocument) && checkMimeWithPath(fileDocument); } async function defaultValidateFileContent(fileDocument) { const response = await cozy.files.downloadById(fileDocument._id); const mime = getAttribute(fileDocument, 'mime'); const fileTypeFromContent = fileType((await response.buffer())); if (!fileTypeFromContent) { log('warn', `Could not find mime type from file content`); return false; } if (!defaultValidateFile(fileDocument) || mime !== fileTypeFromContent.mime) { log('warn', `Wrong file type from content ${JSON.stringify(fileTypeFromContent)}`); return false; } return true; } function sanitizeEntry(entry) { delete entry.requestOptions; delete entry.filestream; delete entry.shouldReplaceFile; return entry; } function getRequestInstance(entry, options) { return options.requestInstance ? options.requestInstance : requestFactory({ json: false, cheerio: false, userAgent: true, jar: true }); } function getRequestOptions(entry, options) { const defaultRequestOptions = { uri: entry.fileurl, method: 'GET' }; if (!options.requestInstance) { // if requestInstance is already set, we suppose that the connecteur want to handle the cookie // jar itself defaultRequestOptions.jar = true; } return { ...defaultRequestOptions, ...entry.requestOptions }; } function attachFileToEntry(entry, fileDocument) { entry.fileDocument = fileDocument; return entry; } function getFilePath({ file, entry, options }) { const folderPath = options.folderPath; if (file) { return path.join(folderPath, getAttribute(file, 'name')); } else if (entry) { return path.join(folderPath, getFileName(entry)); } } function getAttribute(obj, attribute) { return get(obj, `attributes.${attribute}`, get(obj, attribute)); } async function getOrCreateDestinationPath(entry, saveOptions) { const subPath = entry.subPath || saveOptions.subPath; let finalPath = saveOptions.folderPath; if (subPath) { finalPath += '/' + subPath; await mkdirp(finalPath); } return finalPath; } /***/ }), /* 1173 */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(1174); /***/ }), /* 1174 */ /***/ (function(module, exports, __webpack_require__) { var Promise = __webpack_require__(25); // Subclass of Error that can be thrown to indicate that retry should stop. // // If called with an instance of Error subclass, then the retry promise will be // rejected with the given error. // // Otherwise the cancel error object itself is propagated to the caller. // function StopError(err) { this.name = 'StopError'; if (err instanceof Error) { this.err = err } else { this.message = err || 'cancelled' } } StopError.prototype = Object.create(Error.prototype); retry.StopError = StopError; // Retry `func` until it succeeds. // // For each attempt, invokes `func` with `options.args` as arguments and // `options.context` as `this`. // // Waits `options.interval` milliseconds (default 1000) between attempts. // // Increases wait by a factor of `options.backoff` each interval, up to // a limit of `options.max_interval`. // // Keeps trying until `options.timeout` milliseconds have elapsed, // or `options.max_tries` have been attempted, whichever comes first. // // If neither is specified, then the default is to make 5 attempts. // function retry(func, options) { options = options || {}; var interval = typeof options.interval === 'number' ? options.interval : 1000; var max_tries, giveup_time; if (typeof(options.max_tries) !== 'undefined') { max_tries = options.max_tries; } if (options.timeout) { giveup_time = new Date().getTime() + options.timeout; } if (!max_tries && !giveup_time) { max_tries = 5; } var tries = 0; var start = new Date().getTime(); // If the user didn't supply a predicate function then add one that // always succeeds. // // This is used in bluebird's filtered catch to flag the error types // that should retry. var predicate = options.predicate || function(err) { return true; } var stopped = false; function try_once() { var tryStart = new Date().getTime(); return Promise.attempt(function() { return func.apply(options.context, options.args); }) .caught(StopError, function(err) { stopped = true; if (err.err instanceof Error) { return Promise.reject(err.err); } else { return Promise.reject(err); } }) .caught(predicate, function(err) { if (stopped) { return Promise.reject(err); } ++tries; if (tries > 1) { interval = backoff(interval, options); } var now = new Date().getTime(); if ((max_tries && (tries === max_tries) || (giveup_time && (now + interval >= giveup_time)))) { if (! (err instanceof Error)) { var failure = err; if (failure) { if (typeof failure !== 'string') { failure = JSON.stringify(failure); } } err = new Error('rejected with non-error: ' + failure); err.failure = failure; } else if (options.throw_original) { return Promise.reject(err); } var timeout = new Error('operation timed out after ' + (now - start) + ' ms, ' + tries + ' tries with error: ' + err.message); timeout.failure = err; timeout.code = 'ETIMEDOUT'; return Promise.reject(timeout); } else { var delay = interval - (now - tryStart); if (delay <= 0) { return try_once(); } else { return Promise.delay(delay).then(try_once); } } }); } return try_once(); } // Return the updated interval after applying the various backoff options function backoff(interval, options) { if (options.backoff) { interval = interval * options.backoff; } if (options.max_interval) { interval = Math.min(interval, options.max_interval); } return interval; } module.exports = retry; /***/ }), /* 1175 */ /***/ (function(module, exports, __webpack_require__) { /** * @module mkdirp */ const { basename, dirname, join } = __webpack_require__(160).posix; const cozyClient = __webpack_require__(617); /** * Creates a directory and its missing ancestors as needed. * * Options : * * - `...pathComponents`: one or many path components to be joined * * ```javascript * await mkdirp('/foo') // Creates /foo * await mkdirp('/foo') // Does nothing as /foo already exists * await mkdirp('/bar/baz') // Creates /bar, then /bar/baz * await mkdirp('/foo/bar/baz') // Creates /foo/bar, then /foo/bar/baz, not /foo * await mkdirp('/') // Does nothing * await mkdirp('/qux', 'qux2/qux3', 'qux4') // Creates /qux, then /qux/qux2, * // then /qux/qux2/qux3 and * // finally /qux/qux2/qux3/qux4 * ``` * * The function will automatically add a leading slash when missing: * * ```javascript * await mkdirp('foo', 'bar') // Creates /foo, then /foo/bar * ``` * * @alias module:mkdirp */ const mkdirp = fromCozy(cozyClient); module.exports = mkdirp; // `fromCozy()` builds an mkdirp() function for the given Cozy client. // Useful for testing. mkdirp.fromCozy = fromCozy; function fromCozy(cozy) { return async function mkdirp(...pathComponents) { const path = join('/', ...pathComponents); let doc = null; try { doc = await cozy.files.statByPath(path); return doc; } catch (err) { if (![404, 409].includes(err.status)) throw err; const name = basename(path); const parentPath = dirname(path); const parentDoc = await mkdirp(parentPath); try { doc = await cozy.files.createDirectory({ name, dirID: parentDoc._id }); return doc; } catch (createErr) { if (![404, 409].includes(createErr.status)) throw createErr; return doc; } } }; } /***/ }), /* 1176 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * The konnector could not login * * @type {string} */ const LOGIN_FAILED = 'LOGIN_FAILED'; /** * The folder specified as folder_to_save does not exist (checked by BaseKonnector) * * @type {string} */ const NOT_EXISTING_DIRECTORY = 'NOT_EXISTING_DIRECTORY'; /** * The vendor's website is down * * @type {string} */ const VENDOR_DOWN = 'VENDOR_DOWN'; /** * There was an unexpected error, please take a look at the logs to know what happened * * @type {string} */ const USER_ACTION_NEEDED = 'USER_ACTION_NEEDED'; /** * There was a problem while downloading a file * * @type {string} */ const FILE_DOWNLOAD_FAILED = 'FILE_DOWNLOAD_FAILED'; /** * There was a problem while saving a file * * @type {string} */ const SAVE_FILE_FAILED = 'SAVE_FILE_FAILED'; /** * Could not save a file to the cozy because of disk quota exceeded * * @type {string} */ const DISK_QUOTA_EXCEEDED = 'DISK_QUOTA_EXCEEDED'; /** * It seems that the website requires a second authentification factor that we don’t support yet. * * @type {string} */ const CHALLENGE_ASKED = 'CHALLENGE_ASKED'; /** * Temporarily blocked * * @type {string} */ const LOGIN_FAILED_TOO_MANY_ATTEMPTS = 'LOGIN_FAILED.TOO_MANY_ATTEMPTS'; /** * Access refresh required * * @type {string} */ const USER_ACTION_NEEDED_OAUTH_OUTDATED = 'USER_ACTION_NEEDED.OAUTH_OUTDATED'; /** * Unavailable account * * @type {string} */ const USER_ACTION_NEEDED_ACCOUNT_REMOVED = 'USER_ACTION_NEEDED.ACCOUNT_REMOVED'; /** * Unavailable account * * @type {string} */ const USER_ACTION_NEEDED_CHANGE_PASSWORD = 'USER_ACTION_NEEDED.CHANGE_PASSWORD'; /** * Password update required * * @type {string} */ const USER_ACTION_NEEDED_PERMISSIONS_CHANGED = 'USER_ACTION_NEEDED.PERMISSIONS_CHANGED'; /** * The user needs to accept a CGU form before accessing the rest of the website * * @type {string} */ const USER_ACTION_NEEDED_CGU_FORM = 'USER_ACTION_NEEDED.CGU_FORM'; /** * solveCaptcha failed to solve the captcha * * @type {string} */ const CAPTCHA_RESOLUTION_FAILED = 'CAPTCHA_RESOLUTION_FAILED'; module.exports = { LOGIN_FAILED, NOT_EXISTING_DIRECTORY, VENDOR_DOWN, USER_ACTION_NEEDED, FILE_DOWNLOAD_FAILED, SAVE_FILE_FAILED, DISK_QUOTA_EXCEEDED, CHALLENGE_ASKED, LOGIN_FAILED_TOO_MANY_ATTEMPTS, USER_ACTION_NEEDED_OAUTH_OUTDATED, USER_ACTION_NEEDED_ACCOUNT_REMOVED, USER_ACTION_NEEDED_CHANGE_PASSWORD, USER_ACTION_NEEDED_PERMISSIONS_CHANGED, USER_ACTION_NEEDED_CGU_FORM, CAPTCHA_RESOLUTION_FAILED }; /***/ }), /* 1177 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const { multiByteIndexOf, stringToBytes, readUInt64LE, tarHeaderChecksumMatches, uint8ArrayUtf8ByteString } = __webpack_require__(1178); const supported = __webpack_require__(1179); const xpiZipFilename = stringToBytes('META-INF/mozilla.rsa'); const oxmlContentTypes = stringToBytes('[Content_Types].xml'); const oxmlRels = stringToBytes('_rels/.rels'); const fileType = input => { if (!(input instanceof Uint8Array || input instanceof ArrayBuffer || Buffer.isBuffer(input))) { throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`Buffer\` or \`ArrayBuffer\`, got \`${typeof input}\``); } const buffer = input instanceof Uint8Array ? input : new Uint8Array(input); if (!(buffer && buffer.length > 1)) { return; } const check = (header, options) => { options = { offset: 0, ...options }; for (let i = 0; i < header.length; i++) { // If a bitmask is set if (options.mask) { // If header doesn't equal `buf` with bits masked off if (header[i] !== (options.mask[i] & buffer[i + options.offset])) { return false; } } else if (header[i] !== buffer[i + options.offset]) { return false; } } return true; }; const checkString = (header, options) => check(stringToBytes(header), options); if (check([0xFF, 0xD8, 0xFF])) { return { ext: 'jpg', mime: 'image/jpeg' }; } if (check([0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A])) { // APNG format (https://wiki.mozilla.org/APNG_Specification) // 1. Find the first IDAT (image data) chunk (49 44 41 54) // 2. Check if there is an "acTL" chunk before the IDAT one (61 63 54 4C) // Offset calculated as follows: // - 8 bytes: PNG signature // - 4 (length) + 4 (chunk type) + 13 (chunk data) + 4 (CRC): IHDR chunk const startIndex = 33; const firstImageDataChunkIndex = buffer.findIndex((el, i) => i >= startIndex && buffer[i] === 0x49 && buffer[i + 1] === 0x44 && buffer[i + 2] === 0x41 && buffer[i + 3] === 0x54); const sliced = buffer.subarray(startIndex, firstImageDataChunkIndex); if (sliced.findIndex((el, i) => sliced[i] === 0x61 && sliced[i + 1] === 0x63 && sliced[i + 2] === 0x54 && sliced[i + 3] === 0x4C) >= 0) { return { ext: 'apng', mime: 'image/apng' }; } return { ext: 'png', mime: 'image/png' }; } if (check([0x47, 0x49, 0x46])) { return { ext: 'gif', mime: 'image/gif' }; } if (check([0x57, 0x45, 0x42, 0x50], {offset: 8})) { return { ext: 'webp', mime: 'image/webp' }; } if (check([0x46, 0x4C, 0x49, 0x46])) { return { ext: 'flif', mime: 'image/flif' }; } // `cr2`, `orf`, and `arw` need to be before `tif` check if ( (check([0x49, 0x49, 0x2A, 0x0]) || check([0x4D, 0x4D, 0x0, 0x2A])) && check([0x43, 0x52], {offset: 8}) ) { return { ext: 'cr2', mime: 'image/x-canon-cr2' }; } if (check([0x49, 0x49, 0x52, 0x4F, 0x08, 0x00, 0x00, 0x00, 0x18])) { return { ext: 'orf', mime: 'image/x-olympus-orf' }; } if ( check([0x49, 0x49, 0x2A, 0x00]) && (check([0x10, 0xFB, 0x86, 0x01], {offset: 4}) || check([0x08, 0x00, 0x00, 0x00], {offset: 4})) && // This pattern differentiates ARW from other TIFF-ish file types: check([0x00, 0xFE, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x01], {offset: 9}) ) { return { ext: 'arw', mime: 'image/x-sony-arw' }; } if ( check([0x49, 0x49, 0x2A, 0x00, 0x08, 0x00, 0x00, 0x00]) && (check([0x2D, 0x00, 0xFE, 0x00], {offset: 8}) || check([0x27, 0x00, 0xFE, 0x00], {offset: 8})) ) { return { ext: 'dng', mime: 'image/x-adobe-dng' }; } if ( check([0x49, 0x49, 0x2A, 0x00]) && check([0x1C, 0x00, 0xFE, 0x00], {offset: 8}) ) { return { ext: 'nef', mime: 'image/x-nikon-nef' }; } if (check([0x49, 0x49, 0x55, 0x00, 0x18, 0x00, 0x00, 0x00, 0x88, 0xE7, 0x74, 0xD8])) { return { ext: 'rw2', mime: 'image/x-panasonic-rw2' }; } // `raf` is here just to keep all the raw image detectors together. if (checkString('FUJIFILMCCD-RAW')) { return { ext: 'raf', mime: 'image/x-fujifilm-raf' }; } if ( check([0x49, 0x49, 0x2A, 0x0]) || check([0x4D, 0x4D, 0x0, 0x2A]) ) { return { ext: 'tif', mime: 'image/tiff' }; } if (check([0x42, 0x4D])) { return { ext: 'bmp', mime: 'image/bmp' }; } if (check([0x49, 0x49, 0xBC])) { return { ext: 'jxr', mime: 'image/vnd.ms-photo' }; } if (check([0x38, 0x42, 0x50, 0x53])) { return { ext: 'psd', mime: 'image/vnd.adobe.photoshop' }; } // Zip-based file formats // Need to be before the `zip` check const zipHeader = [0x50, 0x4B, 0x3, 0x4]; if (check(zipHeader)) { if ( check([0x6D, 0x69, 0x6D, 0x65, 0x74, 0x79, 0x70, 0x65, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x2F, 0x65, 0x70, 0x75, 0x62, 0x2B, 0x7A, 0x69, 0x70], {offset: 30}) ) { return { ext: 'epub', mime: 'application/epub+zip' }; } // Assumes signed `.xpi` from addons.mozilla.org if (check(xpiZipFilename, {offset: 30})) { return { ext: 'xpi', mime: 'application/x-xpinstall' }; } if (checkString('mimetypeapplication/vnd.oasis.opendocument.text', {offset: 30})) { return { ext: 'odt', mime: 'application/vnd.oasis.opendocument.text' }; } if (checkString('mimetypeapplication/vnd.oasis.opendocument.spreadsheet', {offset: 30})) { return { ext: 'ods', mime: 'application/vnd.oasis.opendocument.spreadsheet' }; } if (checkString('mimetypeapplication/vnd.oasis.opendocument.presentation', {offset: 30})) { return { ext: 'odp', mime: 'application/vnd.oasis.opendocument.presentation' }; } // The docx, xlsx and pptx file types extend the Office Open XML file format: // https://en.wikipedia.org/wiki/Office_Open_XML_file_formats // We look for: // - one entry named '[Content_Types].xml' or '_rels/.rels', // - one entry indicating specific type of file. // MS Office, OpenOffice and LibreOffice may put the parts in different order, so the check should not rely on it. let zipHeaderIndex = 0; // The first zip header was already found at index 0 let oxmlFound = false; let type; do { const offset = zipHeaderIndex + 30; if (!oxmlFound) { oxmlFound = (check(oxmlContentTypes, {offset}) || check(oxmlRels, {offset})); } if (!type) { if (checkString('word/', {offset})) { type = { ext: 'docx', mime: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' }; } else if (checkString('ppt/', {offset})) { type = { ext: 'pptx', mime: 'application/vnd.openxmlformats-officedocument.presentationml.presentation' }; } else if (checkString('xl/', {offset})) { type = { ext: 'xlsx', mime: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }; } } if (oxmlFound && type) { return type; } zipHeaderIndex = multiByteIndexOf(buffer, zipHeader, offset); } while (zipHeaderIndex >= 0); // No more zip parts available in the buffer, but maybe we are almost certain about the type? if (type) { return type; } } if ( check([0x50, 0x4B]) && (buffer[2] === 0x3 || buffer[2] === 0x5 || buffer[2] === 0x7) && (buffer[3] === 0x4 || buffer[3] === 0x6 || buffer[3] === 0x8) ) { return { ext: 'zip', mime: 'application/zip' }; } if ( check([0x30, 0x30, 0x30, 0x30, 0x30, 0x30], {offset: 148, mask: [0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8]}) && // Valid tar checksum tarHeaderChecksumMatches(buffer) ) { return { ext: 'tar', mime: 'application/x-tar' }; } if ( check([0x52, 0x61, 0x72, 0x21, 0x1A, 0x7]) && (buffer[6] === 0x0 || buffer[6] === 0x1) ) { return { ext: 'rar', mime: 'application/x-rar-compressed' }; } if (check([0x1F, 0x8B, 0x8])) { return { ext: 'gz', mime: 'application/gzip' }; } if (check([0x42, 0x5A, 0x68])) { return { ext: 'bz2', mime: 'application/x-bzip2' }; } if (check([0x37, 0x7A, 0xBC, 0xAF, 0x27, 0x1C])) { return { ext: '7z', mime: 'application/x-7z-compressed' }; } if (check([0x78, 0x01])) { return { ext: 'dmg', mime: 'application/x-apple-diskimage' }; } // `mov` format variants if ( check([0x66, 0x72, 0x65, 0x65], {offset: 4}) || // `free` check([0x6D, 0x64, 0x61, 0x74], {offset: 4}) || // `mdat` MJPEG check([0x6D, 0x6F, 0x6F, 0x76], {offset: 4}) || // `moov` check([0x77, 0x69, 0x64, 0x65], {offset: 4}) // `wide` ) { return { ext: 'mov', mime: 'video/quicktime' }; } // File Type Box (https://en.wikipedia.org/wiki/ISO_base_media_file_format) // It's not required to be first, but it's recommended to be. Almost all ISO base media files start with `ftyp` box. // `ftyp` box must contain a brand major identifier, which must consist of ISO 8859-1 printable characters. // Here we check for 8859-1 printable characters (for simplicity, it's a mask which also catches one non-printable character). if ( check([0x66, 0x74, 0x79, 0x70], {offset: 4}) && // `ftyp` (buffer[8] & 0x60) !== 0x00 && (buffer[9] & 0x60) !== 0x00 && (buffer[10] & 0x60) !== 0x00 && (buffer[11] & 0x60) !== 0x00 // Brand major ) { // They all can have MIME `video/mp4` except `application/mp4` special-case which is hard to detect. // For some cases, we're specific, everything else falls to `video/mp4` with `mp4` extension. const brandMajor = uint8ArrayUtf8ByteString(buffer, 8, 12); switch (brandMajor) { case 'mif1': return {ext: 'heic', mime: 'image/heif'}; case 'msf1': return {ext: 'heic', mime: 'image/heif-sequence'}; case 'heic': case 'heix': return {ext: 'heic', mime: 'image/heic'}; case 'hevc': case 'hevx': return {ext: 'heic', mime: 'image/heic-sequence'}; case 'qt ': return {ext: 'mov', mime: 'video/quicktime'}; case 'M4V ': case 'M4VH': case 'M4VP': return {ext: 'm4v', mime: 'video/x-m4v'}; case 'M4P ': return {ext: 'm4p', mime: 'video/mp4'}; case 'M4B ': return {ext: 'm4b', mime: 'audio/mp4'}; case 'M4A ': return {ext: 'm4a', mime: 'audio/x-m4a'}; case 'F4V ': return {ext: 'f4v', mime: 'video/mp4'}; case 'F4P ': return {ext: 'f4p', mime: 'video/mp4'}; case 'F4A ': return {ext: 'f4a', mime: 'audio/mp4'}; case 'F4B ': return {ext: 'f4b', mime: 'audio/mp4'}; default: if (brandMajor.startsWith('3g')) { if (brandMajor.startsWith('3g2')) { return {ext: '3g2', mime: 'video/3gpp2'}; } return {ext: '3gp', mime: 'video/3gpp'}; } return {ext: 'mp4', mime: 'video/mp4'}; } } if (check([0x4D, 0x54, 0x68, 0x64])) { return { ext: 'mid', mime: 'audio/midi' }; } // https://github.com/threatstack/libmagic/blob/master/magic/Magdir/matroska if (check([0x1A, 0x45, 0xDF, 0xA3])) { const sliced = buffer.subarray(4, 4 + 4096); const idPos = sliced.findIndex((el, i, arr) => arr[i] === 0x42 && arr[i + 1] === 0x82); if (idPos !== -1) { const docTypePos = idPos + 3; const findDocType = type => [...type].every((c, i) => sliced[docTypePos + i] === c.charCodeAt(0)); if (findDocType('matroska')) { return { ext: 'mkv', mime: 'video/x-matroska' }; } if (findDocType('webm')) { return { ext: 'webm', mime: 'video/webm' }; } } } // RIFF file format which might be AVI, WAV, QCP, etc if (check([0x52, 0x49, 0x46, 0x46])) { if (check([0x41, 0x56, 0x49], {offset: 8})) { return { ext: 'avi', mime: 'video/vnd.avi' }; } if (check([0x57, 0x41, 0x56, 0x45], {offset: 8})) { return { ext: 'wav', mime: 'audio/vnd.wave' }; } // QLCM, QCP file if (check([0x51, 0x4C, 0x43, 0x4D], {offset: 8})) { return { ext: 'qcp', mime: 'audio/qcelp' }; } } // ASF_Header_Object first 80 bytes if (check([0x30, 0x26, 0xB2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xA6, 0xD9])) { // Search for header should be in first 1KB of file. let offset = 30; do { const objectSize = readUInt64LE(buffer, offset + 16); if (check([0x91, 0x07, 0xDC, 0xB7, 0xB7, 0xA9, 0xCF, 0x11, 0x8E, 0xE6, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65], {offset})) { // Sync on Stream-Properties-Object (B7DC0791-A9B7-11CF-8EE6-00C00C205365) if (check([0x40, 0x9E, 0x69, 0xF8, 0x4D, 0x5B, 0xCF, 0x11, 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B], {offset: offset + 24})) { // Found audio: return { ext: 'wma', mime: 'audio/x-ms-wma' }; } if (check([0xC0, 0xEF, 0x19, 0xBC, 0x4D, 0x5B, 0xCF, 0x11, 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B], {offset: offset + 24})) { // Found video: return { ext: 'wmv', mime: 'video/x-ms-asf' }; } break; } offset += objectSize; } while (offset + 24 <= buffer.length); // Default to ASF generic extension return { ext: 'asf', mime: 'application/vnd.ms-asf' }; } if ( check([0x0, 0x0, 0x1, 0xBA]) || check([0x0, 0x0, 0x1, 0xB3]) ) { return { ext: 'mpg', mime: 'video/mpeg' }; } // Check for MPEG header at different starting offsets for (let start = 0; start < 2 && start < (buffer.length - 16); start++) { if ( check([0x49, 0x44, 0x33], {offset: start}) || // ID3 header check([0xFF, 0xE2], {offset: start, mask: [0xFF, 0xE6]}) // MPEG 1 or 2 Layer 3 header ) { return { ext: 'mp3', mime: 'audio/mpeg' }; } if ( check([0xFF, 0xE4], {offset: start, mask: [0xFF, 0xE6]}) // MPEG 1 or 2 Layer 2 header ) { return { ext: 'mp2', mime: 'audio/mpeg' }; } if ( check([0xFF, 0xF8], {offset: start, mask: [0xFF, 0xFC]}) // MPEG 2 layer 0 using ADTS ) { return { ext: 'mp2', mime: 'audio/mpeg' }; } if ( check([0xFF, 0xF0], {offset: start, mask: [0xFF, 0xFC]}) // MPEG 4 layer 0 using ADTS ) { return { ext: 'mp4', mime: 'audio/mpeg' }; } } // Needs to be before `ogg` check if (check([0x4F, 0x70, 0x75, 0x73, 0x48, 0x65, 0x61, 0x64], {offset: 28})) { return { ext: 'opus', mime: 'audio/opus' }; } // If 'OggS' in first bytes, then OGG container if (check([0x4F, 0x67, 0x67, 0x53])) { // This is a OGG container // If ' theora' in header. if (check([0x80, 0x74, 0x68, 0x65, 0x6F, 0x72, 0x61], {offset: 28})) { return { ext: 'ogv', mime: 'video/ogg' }; } // If '\x01video' in header. if (check([0x01, 0x76, 0x69, 0x64, 0x65, 0x6F, 0x00], {offset: 28})) { return { ext: 'ogm', mime: 'video/ogg' }; } // If ' FLAC' in header https://xiph.org/flac/faq.html if (check([0x7F, 0x46, 0x4C, 0x41, 0x43], {offset: 28})) { return { ext: 'oga', mime: 'audio/ogg' }; } // 'Speex ' in header https://en.wikipedia.org/wiki/Speex if (check([0x53, 0x70, 0x65, 0x65, 0x78, 0x20, 0x20], {offset: 28})) { return { ext: 'spx', mime: 'audio/ogg' }; } // If '\x01vorbis' in header if (check([0x01, 0x76, 0x6F, 0x72, 0x62, 0x69, 0x73], {offset: 28})) { return { ext: 'ogg', mime: 'audio/ogg' }; } // Default OGG container https://www.iana.org/assignments/media-types/application/ogg return { ext: 'ogx', mime: 'application/ogg' }; } if (check([0x66, 0x4C, 0x61, 0x43])) { return { ext: 'flac', mime: 'audio/x-flac' }; } if (check([0x4D, 0x41, 0x43, 0x20])) { // 'MAC ' return { ext: 'ape', mime: 'audio/ape' }; } if (check([0x77, 0x76, 0x70, 0x6B])) { // 'wvpk' return { ext: 'wv', mime: 'audio/wavpack' }; } if (check([0x23, 0x21, 0x41, 0x4D, 0x52, 0x0A])) { return { ext: 'amr', mime: 'audio/amr' }; } if (check([0x25, 0x50, 0x44, 0x46])) { return { ext: 'pdf', mime: 'application/pdf' }; } if (check([0x4D, 0x5A])) { return { ext: 'exe', mime: 'application/x-msdownload' }; } if ( (buffer[0] === 0x43 || buffer[0] === 0x46) && check([0x57, 0x53], {offset: 1}) ) { return { ext: 'swf', mime: 'application/x-shockwave-flash' }; } if (check([0x7B, 0x5C, 0x72, 0x74, 0x66])) { return { ext: 'rtf', mime: 'application/rtf' }; } if (check([0x00, 0x61, 0x73, 0x6D])) { return { ext: 'wasm', mime: 'application/wasm' }; } if ( check([0x77, 0x4F, 0x46, 0x46]) && ( check([0x00, 0x01, 0x00, 0x00], {offset: 4}) || check([0x4F, 0x54, 0x54, 0x4F], {offset: 4}) ) ) { return { ext: 'woff', mime: 'font/woff' }; } if ( check([0x77, 0x4F, 0x46, 0x32]) && ( check([0x00, 0x01, 0x00, 0x00], {offset: 4}) || check([0x4F, 0x54, 0x54, 0x4F], {offset: 4}) ) ) { return { ext: 'woff2', mime: 'font/woff2' }; } if ( check([0x4C, 0x50], {offset: 34}) && ( check([0x00, 0x00, 0x01], {offset: 8}) || check([0x01, 0x00, 0x02], {offset: 8}) || check([0x02, 0x00, 0x02], {offset: 8}) ) ) { return { ext: 'eot', mime: 'application/vnd.ms-fontobject' }; } if (check([0x00, 0x01, 0x00, 0x00, 0x00])) { return { ext: 'ttf', mime: 'font/ttf' }; } if (check([0x4F, 0x54, 0x54, 0x4F, 0x00])) { return { ext: 'otf', mime: 'font/otf' }; } if (check([0x00, 0x00, 0x01, 0x00])) { return { ext: 'ico', mime: 'image/x-icon' }; } if (check([0x00, 0x00, 0x02, 0x00])) { return { ext: 'cur', mime: 'image/x-icon' }; } if (check([0x46, 0x4C, 0x56, 0x01])) { return { ext: 'flv', mime: 'video/x-flv' }; } if (check([0x25, 0x21])) { return { ext: 'ps', mime: 'application/postscript' }; } if (check([0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00])) { return { ext: 'xz', mime: 'application/x-xz' }; } if (check([0x53, 0x51, 0x4C, 0x69])) { return { ext: 'sqlite', mime: 'application/x-sqlite3' }; } if (check([0x4E, 0x45, 0x53, 0x1A])) { return { ext: 'nes', mime: 'application/x-nintendo-nes-rom' }; } if (check([0x43, 0x72, 0x32, 0x34])) { return { ext: 'crx', mime: 'application/x-google-chrome-extension' }; } if ( check([0x4D, 0x53, 0x43, 0x46]) || check([0x49, 0x53, 0x63, 0x28]) ) { return { ext: 'cab', mime: 'application/vnd.ms-cab-compressed' }; } // Needs to be before `ar` check if (check([0x21, 0x3C, 0x61, 0x72, 0x63, 0x68, 0x3E, 0x0A, 0x64, 0x65, 0x62, 0x69, 0x61, 0x6E, 0x2D, 0x62, 0x69, 0x6E, 0x61, 0x72, 0x79])) { return { ext: 'deb', mime: 'application/x-deb' }; } if (check([0x21, 0x3C, 0x61, 0x72, 0x63, 0x68, 0x3E])) { return { ext: 'ar', mime: 'application/x-unix-archive' }; } if (check([0xED, 0xAB, 0xEE, 0xDB])) { return { ext: 'rpm', mime: 'application/x-rpm' }; } if ( check([0x1F, 0xA0]) || check([0x1F, 0x9D]) ) { return { ext: 'Z', mime: 'application/x-compress' }; } if (check([0x4C, 0x5A, 0x49, 0x50])) { return { ext: 'lz', mime: 'application/x-lzip' }; } if (check([0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E])) { return { ext: 'msi', mime: 'application/x-msi' }; } if (check([0x06, 0x0E, 0x2B, 0x34, 0x02, 0x05, 0x01, 0x01, 0x0D, 0x01, 0x02, 0x01, 0x01, 0x02])) { return { ext: 'mxf', mime: 'application/mxf' }; } if (check([0x47], {offset: 4}) && (check([0x47], {offset: 192}) || check([0x47], {offset: 196}))) { return { ext: 'mts', mime: 'video/mp2t' }; } if (check([0x42, 0x4C, 0x45, 0x4E, 0x44, 0x45, 0x52])) { return { ext: 'blend', mime: 'application/x-blender' }; } if (check([0x42, 0x50, 0x47, 0xFB])) { return { ext: 'bpg', mime: 'image/bpg' }; } if (check([0x00, 0x00, 0x00, 0x0C, 0x6A, 0x50, 0x20, 0x20, 0x0D, 0x0A, 0x87, 0x0A])) { // JPEG-2000 family if (check([0x6A, 0x70, 0x32, 0x20], {offset: 20})) { return { ext: 'jp2', mime: 'image/jp2' }; } if (check([0x6A, 0x70, 0x78, 0x20], {offset: 20})) { return { ext: 'jpx', mime: 'image/jpx' }; } if (check([0x6A, 0x70, 0x6D, 0x20], {offset: 20})) { return { ext: 'jpm', mime: 'image/jpm' }; } if (check([0x6D, 0x6A, 0x70, 0x32], {offset: 20})) { return { ext: 'mj2', mime: 'image/mj2' }; } } if (check([0x46, 0x4F, 0x52, 0x4D])) { return { ext: 'aif', mime: 'audio/aiff' }; } if (checkString('<?xml ')) { return { ext: 'xml', mime: 'application/xml' }; } if (check([0x42, 0x4F, 0x4F, 0x4B, 0x4D, 0x4F, 0x42, 0x49], {offset: 60})) { return { ext: 'mobi', mime: 'application/x-mobipocket-ebook' }; } if (check([0xAB, 0x4B, 0x54, 0x58, 0x20, 0x31, 0x31, 0xBB, 0x0D, 0x0A, 0x1A, 0x0A])) { return { ext: 'ktx', mime: 'image/ktx' }; } if (check([0x44, 0x49, 0x43, 0x4D], {offset: 128})) { return { ext: 'dcm', mime: 'application/dicom' }; } // Musepack, SV7 if (check([0x4D, 0x50, 0x2B])) { return { ext: 'mpc', mime: 'audio/x-musepack' }; } // Musepack, SV8 if (check([0x4D, 0x50, 0x43, 0x4B])) { return { ext: 'mpc', mime: 'audio/x-musepack' }; } if (check([0x42, 0x45, 0x47, 0x49, 0x4E, 0x3A])) { return { ext: 'ics', mime: 'text/calendar' }; } if (check([0x67, 0x6C, 0x54, 0x46, 0x02, 0x00, 0x00, 0x00])) { return { ext: 'glb', mime: 'model/gltf-binary' }; } if (check([0xD4, 0xC3, 0xB2, 0xA1]) || check([0xA1, 0xB2, 0xC3, 0xD4])) { return { ext: 'pcap', mime: 'application/vnd.tcpdump.pcap' }; } // Sony DSD Stream File (DSF) if (check([0x44, 0x53, 0x44, 0x20])) { return { ext: 'dsf', mime: 'audio/x-dsf' // Non-standard }; } if (check([0x4C, 0x00, 0x00, 0x00, 0x01, 0x14, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46])) { return { ext: 'lnk', mime: 'application/x.ms.shortcut' // Invented by us }; } if (check([0x62, 0x6F, 0x6F, 0x6B, 0x00, 0x00, 0x00, 0x00, 0x6D, 0x61, 0x72, 0x6B, 0x00, 0x00, 0x00, 0x00])) { return { ext: 'alias', mime: 'application/x.apple.alias' // Invented by us }; } if (checkString('Creative Voice File')) { return { ext: 'voc', mime: 'audio/x-voc' }; } if (check([0x0B, 0x77])) { return { ext: 'ac3', mime: 'audio/vnd.dolby.dd-raw' }; } if ((check([0x7E, 0x10, 0x04]) || check([0x7E, 0x18, 0x04])) && check([0x30, 0x4D, 0x49, 0x45], {offset: 4})) { return { ext: 'mie', mime: 'application/x-mie' }; } if (check([0x41, 0x52, 0x52, 0x4F, 0x57, 0x31, 0x00, 0x00])) { return { ext: 'arrow', mime: 'application/x-apache-arrow' }; } if (check([0x27, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], {offset: 2})) { return { ext: 'shp', mime: 'application/x-esri-shape' }; } }; module.exports = fileType; Object.defineProperty(fileType, 'minimumBytes', {value: 4100}); fileType.stream = readableStream => new Promise((resolve, reject) => { // Using `eval` to work around issues when bundling with Webpack const stream = eval('require')('stream'); // eslint-disable-line no-eval readableStream.on('error', reject); readableStream.once('readable', () => { const pass = new stream.PassThrough(); const chunk = readableStream.read(module.exports.minimumBytes) || readableStream.read(); try { pass.fileType = fileType(chunk); } catch (error) { reject(error); } readableStream.unshift(chunk); if (stream.pipeline) { resolve(stream.pipeline(readableStream, pass, () => {})); } else { resolve(readableStream.pipe(pass)); } }); }); Object.defineProperty(fileType, 'extensions', { get() { return new Set(supported.extensions); } }); Object.defineProperty(fileType, 'mimeTypes', { get() { return new Set(supported.mimeTypes); } }); /***/ }), /* 1178 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.stringToBytes = string => [...string].map(character => character.charCodeAt(0)); const uint8ArrayUtf8ByteString = (array, start, end) => { return String.fromCharCode(...array.slice(start, end)); }; exports.readUInt64LE = (buffer, offset = 0) => { let n = buffer[offset]; let mul = 1; let i = 0; while (++i < 8) { mul *= 0x100; n += buffer[offset + i] * mul; } return n; }; exports.tarHeaderChecksumMatches = buffer => { // Does not check if checksum field characters are valid if (buffer.length < 512) { // `tar` header size, cannot compute checksum without it return false; } const MASK_8TH_BIT = 0x80; let sum = 256; // Intitalize sum, with 256 as sum of 8 spaces in checksum field let signedBitSum = 0; // Initialize signed bit sum for (let i = 0; i < 148; i++) { const byte = buffer[i]; sum += byte; signedBitSum += byte & MASK_8TH_BIT; // Add signed bit to signed bit sum } // Skip checksum field for (let i = 156; i < 512; i++) { const byte = buffer[i]; sum += byte; signedBitSum += byte & MASK_8TH_BIT; // Add signed bit to signed bit sum } const readSum = parseInt(uint8ArrayUtf8ByteString(buffer, 148, 154), 8); // Read sum in header // Some implementations compute checksum incorrectly using signed bytes return ( // Checksum in header equals the sum we calculated readSum === sum || // Checksum in header equals sum we calculated plus signed-to-unsigned delta readSum === (sum - (signedBitSum << 1)) ); }; exports.multiByteIndexOf = (buffer, bytesToSearch, startAt = 0) => { // `Buffer#indexOf()` can search for multiple bytes if (Buffer && Buffer.isBuffer(buffer)) { return buffer.indexOf(Buffer.from(bytesToSearch), startAt); } const nextBytesMatch = (buffer, bytes, startIndex) => { for (let i = 1; i < bytes.length; i++) { if (bytes[i] !== buffer[startIndex + i]) { return false; } } return true; }; // `Uint8Array#indexOf()` can search for only a single byte let index = buffer.indexOf(bytesToSearch[0], startAt); while (index >= 0) { if (nextBytesMatch(buffer, bytesToSearch, index)) { return index; } index = buffer.indexOf(bytesToSearch[0], index + 1); } return -1; }; exports.uint8ArrayUtf8ByteString = uint8ArrayUtf8ByteString; /***/ }), /* 1179 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = { extensions: [ 'jpg', 'png', 'apng', 'gif', 'webp', 'flif', 'cr2', 'orf', 'arw', 'dng', 'nef', 'rw2', 'raf', 'tif', 'bmp', 'jxr', 'psd', 'zip', 'tar', 'rar', 'gz', 'bz2', '7z', 'dmg', 'mp4', 'mid', 'mkv', 'webm', 'mov', 'avi', 'mpg', 'mp2', 'mp3', 'm4a', 'oga', 'ogg', 'ogv', 'opus', 'flac', 'wav', 'spx', 'amr', 'pdf', 'epub', 'exe', 'swf', 'rtf', 'wasm', 'woff', 'woff2', 'eot', 'ttf', 'otf', 'ico', 'flv', 'ps', 'xz', 'sqlite', 'nes', 'crx', 'xpi', 'cab', 'deb', 'ar', 'rpm', 'Z', 'lz', 'msi', 'mxf', 'mts', 'blend', 'bpg', 'docx', 'pptx', 'xlsx', '3gp', '3g2', 'jp2', 'jpm', 'jpx', 'mj2', 'aif', 'qcp', 'odt', 'ods', 'odp', 'xml', 'mobi', 'heic', 'cur', 'ktx', 'ape', 'wv', 'wmv', 'wma', 'dcm', 'ics', 'glb', 'pcap', 'dsf', 'lnk', 'alias', 'voc', 'ac3', 'm4v', 'm4p', 'm4b', 'f4v', 'f4p', 'f4b', 'f4a', 'mie', 'asf', 'ogm', 'ogx', 'mpc', 'arrow', 'shp' ], mimeTypes: [ 'image/jpeg', 'image/png', 'image/gif', 'image/webp', 'image/flif', 'image/x-canon-cr2', 'image/tiff', 'image/bmp', 'image/vnd.ms-photo', 'image/vnd.adobe.photoshop', 'application/epub+zip', 'application/x-xpinstall', 'application/vnd.oasis.opendocument.text', 'application/vnd.oasis.opendocument.spreadsheet', 'application/vnd.oasis.opendocument.presentation', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/zip', 'application/x-tar', 'application/x-rar-compressed', 'application/gzip', 'application/x-bzip2', 'application/x-7z-compressed', 'application/x-apple-diskimage', 'application/x-apache-arrow', 'video/mp4', 'audio/midi', 'video/x-matroska', 'video/webm', 'video/quicktime', 'video/vnd.avi', 'audio/vnd.wave', 'audio/qcelp', 'audio/x-ms-wma', 'video/x-ms-asf', 'application/vnd.ms-asf', 'video/mpeg', 'video/3gpp', 'audio/mpeg', 'audio/mp4', // RFC 4337 'audio/opus', 'video/ogg', 'audio/ogg', 'application/ogg', 'audio/x-flac', 'audio/ape', 'audio/wavpack', 'audio/amr', 'application/pdf', 'application/x-msdownload', 'application/x-shockwave-flash', 'application/rtf', 'application/wasm', 'font/woff', 'font/woff2', 'application/vnd.ms-fontobject', 'font/ttf', 'font/otf', 'image/x-icon', 'video/x-flv', 'application/postscript', 'application/x-xz', 'application/x-sqlite3', 'application/x-nintendo-nes-rom', 'application/x-google-chrome-extension', 'application/vnd.ms-cab-compressed', 'application/x-deb', 'application/x-unix-archive', 'application/x-rpm', 'application/x-compress', 'application/x-lzip', 'application/x-msi', 'application/x-mie', 'application/mxf', 'video/mp2t', 'application/x-blender', 'image/bpg', 'image/jp2', 'image/jpx', 'image/jpm', 'image/mj2', 'audio/aiff', 'application/xml', 'application/x-mobipocket-ebook', 'image/heif', 'image/heif-sequence', 'image/heic', 'image/heic-sequence', 'image/ktx', 'application/dicom', 'audio/x-musepack', 'text/calendar', 'model/gltf-binary', 'application/vnd.tcpdump.pcap', 'audio/x-dsf', // Non-standard 'application/x.ms.shortcut', // Invented by us 'application/x.apple.alias', // Invented by us 'audio/x-voc', 'audio/vnd.dolby.dd-raw', 'audio/x-m4a', 'image/apng', 'image/x-olympus-orf', 'image/x-sony-arw', 'image/x-adobe-dng', 'image/x-nikon-nef', 'image/x-panasonic-rw2', 'image/x-fujifilm-raf', 'video/x-m4v', 'video/3gpp2', 'application/x-esri-shape' ] }; /***/ }), /* 1180 */ /***/ (function(module, exports, __webpack_require__) { /** * Saves the data into the cozy blindly without check. * * @module addData */ const bluebird = __webpack_require__(25); const omit = __webpack_require__(944); const log = __webpack_require__(2).namespace('addData'); const { getCozyMetadata } = __webpack_require__(1059); /** * Saves the data into the cozy blindly without check. * * You need at least the `POST` permission for the given doctype in your manifest, to be able to * use this function. * * Parameters: * * * `documents`: an array of objects corresponding to the data you want to save in the cozy * * `doctype` (string): the doctype where you want to save data (ex: 'io.cozy.bills') * * `options` (object): option object * + `sourceAccount` (String): id of the source account * + `sourceAccountIdentifier` (String): identifier unique to the account targetted by the connector. It is the login most of the time * * ```javascript * const documents = [ * { * name: 'toto', * height: 1.8 * }, * { * name: 'titi', * height: 1.7 * } * ] * * return addData(documents, 'io.cozy.height') * ``` * * @alias module:addData */ const addData = (entries, doctype, options = {}) => { const cozy = __webpack_require__(617); return bluebird.mapSeries(entries, async entry => { log('debug', entry, 'Adding this entry'); const metaEntry = { cozyMetadata: getCozyMetadata({ ...entry.cozyMetadata, sourceAccount: options.sourceAccount, sourceAccountIdentifier: options.sourceAccountIdentifier }), ...entry }; const dbEntry = await (metaEntry._id ? cozy.data.update(doctype, metaEntry, omit(metaEntry, '_rev')) : cozy.data.create(doctype, metaEntry)); // Also update the original entry _id to allow saveBills' // linkBankOperation entries to have an id metaEntry._id = dbEntry._id; return dbEntry; }); }; module.exports = addData; /***/ }), /* 1181 */ /***/ (function(module, exports, __webpack_require__) { /** * Finds links between bills and bank operations. * * @module linkBankOperations */ const bluebird = __webpack_require__(25); const log = __webpack_require__(2).namespace('linkBankOperations'); const { findDebitOperation, findCreditOperation } = __webpack_require__(1182); const fs = __webpack_require__(167); const defaults = __webpack_require__(465); const groupBy = __webpack_require__(1037); const flatten = __webpack_require__(598); const sumBy = __webpack_require__(1160); const geco = __webpack_require__(1193); const format = __webpack_require__(1097); const cozyClient = __webpack_require__(617); const DOCTYPE_OPERATIONS = 'io.cozy.bank.operations'; const DEFAULT_AMOUNT_DELTA = 0.001; const DEFAULT_PAST_WINDOW = 15; const DEFAULT_FUTURE_WINDOW = 29; const fmtDate = function (x) { return new Date(x).toISOString().substr(0, 10); }; const getBillDate = bill => bill.originalDate || bill.date; class Linker { constructor(cozyClient) { this.cozyClient = cozyClient; this.toUpdate = []; this.groupVendors = ['Numéricable', 'Ameli', 'MGEN', 'Humanis']; } async removeBillsFromOperations(bills, operations) { log('info', `Removing ${bills.length} bills from bank operations`); for (let op of operations) { let needUpdate = false; let billsAttribute = op.bills || []; for (let bill of bills) { const billLongId = `io.cozy.bills:${bill._id}`; // if bill id found in op bills, do something if (billsAttribute.indexOf(billLongId) >= 0) { needUpdate = true; billsAttribute = billsAttribute.filter(billId => billId !== billLongId && billId !== `io.cozy.bills:${bill.original}`); if (bill.original) { billsAttribute.push(`io.cozy.bills:${bill.original}`); } } } if (needUpdate) { log('info', `Bank operation ${op._id}: Replacing ${JSON.stringify(op.bills)} by ${JSON.stringify(billsAttribute)}`); await this.updateAttributes(DOCTYPE_OPERATIONS, op, { bills: billsAttribute }); } } } addBillToOperation(bill, operation) { if (!bill._id) { log('warn', 'bill has no id, impossible to add it to an operation'); return Promise.resolve(); } const billId = `io.cozy.bills:${bill._id}`; if (operation.bills && operation.bills.indexOf(billId) > -1) { return Promise.resolve(); } const billIds = operation.bills || []; billIds.push(billId); const attributes = { bills: billIds }; return this.updateAttributes(DOCTYPE_OPERATIONS, operation, attributes); } addReimbursementToOperation(bill, debitOperation, matchingOperation) { if (!bill._id) { log('warn', 'bill has no id, impossible to add it as a reimbursement'); return Promise.resolve(); } const billId = `io.cozy.bills:${bill._id}`; if (debitOperation.reimbursements && debitOperation.reimbursements.map(b => b.billId).indexOf(billId) > -1) { return Promise.resolve(); } const reimbursements = debitOperation.reimbursements || []; reimbursements.push({ billId, amount: bill.amount, operationId: matchingOperation && matchingOperation._id }); return this.updateAttributes(DOCTYPE_OPERATIONS, debitOperation, { reimbursements: reimbursements }); } /* Buffer update operations */ updateAttributes(doctype, doc, attrs) { Object.assign(doc, attrs); this.toUpdate.push(doc); return Promise.resolve(); } /* Commit updates */ commitChanges() { log('debug', `linkBankOperations: commiting ${this.toUpdate.length} changes`); return cozyClient.fetchJSON('POST', `/data/${DOCTYPE_OPERATIONS}/_bulk_docs`, { docs: this.toUpdate }); } getOptions(opts = {}) { const options = { ...opts }; if (typeof options.identifiers === 'string') { options.identifiers = [options.identifiers.toLowerCase()]; } else if (Array.isArray(options.identifiers)) { options.identifiers = options.identifiers.map(id => id.toLowerCase()); } else { throw new Error('linkBankOperations cannot be called without "identifiers" option'); } defaults(options, { amountDelta: DEFAULT_AMOUNT_DELTA }); defaults(options, { minAmountDelta: options.amountDelta, maxAmountDelta: options.amountDelta, pastWindow: DEFAULT_PAST_WINDOW, futureWindow: DEFAULT_FUTURE_WINDOW }); return options; } async linkBillToCreditOperation(bill, debitOperation, allOperations, options) { const creditOperation = await findCreditOperation(this.cozyClient, bill, options, allOperations); const promises = []; if (creditOperation) { promises.push(this.addBillToOperation(bill, creditOperation)); } if (creditOperation && debitOperation) { log('debug', `reimbursement: Matching bill ${bill.subtype || bill.filename} (${fmtDate(bill.date)}) with credit operation ${creditOperation.label} (${fmtDate(creditOperation.date)})`); promises.push(this.addReimbursementToOperation(bill, debitOperation, creditOperation)); } await Promise.all(promises); return creditOperation; } async linkBillToDebitOperation(bill, allOperations, options) { return findDebitOperation(this.cozyClient, bill, options, allOperations).then(operation => { if (operation) { log('debug', `bills: Matching bill ${bill.subtype || bill.filename} (${fmtDate(bill.date)}) with debit operation ${operation.label} (${fmtDate(operation.date)})`); return this.addBillToOperation(bill, operation).then(() => operation); } }); } /** * Link bills to * - their matching banking operation (debit) * - to their reimbursement (credit) */ async linkBillsToOperations(bills, options) { options = this.getOptions(options); const result = {}; const allOperations = await this.cozyClient.data.findAll('io.cozy.bank.operations'); if (options.billsToRemove && options.billsToRemove.length) { this.removeBillsFromOperations(options.billsToRemove, allOperations); } // when bill comes from a third party payer, // no transaction is visible on the bank account bills = bills.filter(bill => !bill.isThirdPartyPayer === true); await bluebird.each(bills, async bill => { const res = result[bill._id] = { bill: bill }; // the bills combination phase is very time consuming. We can avoid it when we run the // connector in standalone mode if (allOperations.length === 0) { return result; } const debitOperation = await this.linkBillToDebitOperation(bill, allOperations, options); if (debitOperation) { res.debitOperation = debitOperation; } if (bill.isRefund) { const creditOperation = await this.linkBillToCreditOperation(bill, debitOperation, allOperations, options); if (creditOperation) { res.creditOperation = creditOperation; } } }); await this.findCombinations(result, options, allOperations); await this.commitChanges(); return result; } async findCombinations(result, options, allOperations) { log('debug', 'finding combinations'); let found; do { found = false; const unlinkedBills = this.getUnlinkedBills(result); log('debug', `findCombinations: There are ${unlinkedBills.length} unlinked bills`); const billsGroups = this.groupBills(unlinkedBills); log('debug', `findCombinations: Groups: ${billsGroups.length}`); const combinations = flatten(billsGroups.map(billsGroup => this.generateBillsCombinations(billsGroup))); log('debug', `Generated ${combinations.length} bills combinations`); const combinedBills = combinations.map(combination => this.combineBills(...combination)); for (const combinedBill of combinedBills) { const debitOperation = await findDebitOperation(this.cozyClient, combinedBill, options, allOperations); if (debitOperation) { found = true; log('debug', combinedBill, 'Matching bills combination'); log('debug', debitOperation, 'Matching debit debitOperation'); combinedBill.originalBills.forEach(async originalBill => { const res = result[originalBill._id]; res.debitOperation = debitOperation; if (res.creditOperation && res.debitOperation) { await this.addReimbursementToOperation(originalBill, debitOperation, res.creditOperation); } }); break; } } } while (found); return result; } getUnlinkedBills(bills) { const unlinkedBills = Object.values(bills).filter(bill => !bill.debitOperation).map(bill => bill.bill); return unlinkedBills; } billCanBeGrouped(bill) { return getBillDate(bill) && (bill.type === 'health_costs' || this.groupVendors.includes(bill.vendor)); } groupBills(bills) { const billsToGroup = bills.filter(bill => this.billCanBeGrouped(bill)); const groups = groupBy(billsToGroup, bill => { return [format(getBillDate(bill), 'YYYY-MM-DD'), bill.vendor]; }); return Object.values(groups); } generateBillsCombinations(bills) { const MIN_ITEMS_IN_COMBINATION = 2; const combinations = []; for (let n = MIN_ITEMS_IN_COMBINATION; n <= bills.length; ++n) { const combinationsN = geco.gen(bills.length, n, bills); combinations.push(...combinationsN); } return combinations; } combineBills(...bills) { return { ...bills[0], _id: ['combined', ...bills.map(bill => bill._id)].join(':'), amount: sumBy(bills, bill => bill.amount), originalAmount: sumBy(bills, bill => bill.originalAmount), originalBills: bills }; } } const jsonTee = filename => res => { fs.writeFileSync(filename, JSON.stringify(res, null, 2)); return res; }; /** * Will soon move to a dedicated service. You should not use it. * * Finds links between bills and bank operations. * * @alias module:linkBankOperations */ const linkBankOperations = (bills, doctype, fields, options = {}) => { // Use the custom bank identifier from user if any if (fields.bank_identifier && fields.bank_identifier.length) { options.identifiers = [fields.bank_identifier]; } const cozyClient = __webpack_require__(617); const linker = new Linker(cozyClient); const prom = linker.linkBillsToOperations(bills, options).catch(err => { log('warn', err, 'Problem when linking operations'); }); if (process.env.LINK_RESULTS_FILENAME) { prom.then(jsonTee(process.env.LINK_RESULTS_FILENAME)); } return prom; }; module.exports = linkBankOperations; Object.assign(module.exports, { Linker }); /***/ }), /* 1182 */ /***/ (function(module, exports, __webpack_require__) { const { operationsFilters } = __webpack_require__(1183); const { findNeighboringOperations } = __webpack_require__(1192); const { sortedOperations } = __webpack_require__(1188); const findOperation = (cozyClient, bill, options, allOperations) => { // By default, a bill is an expense. If it is not, it should be // declared as a refund: isRefund=true. if (options.credit && !bill.isRefund) return; return findNeighboringOperations(cozyClient, bill, options, allOperations).then(operations => { operations = operationsFilters(bill, operations, options); operations = sortedOperations(bill, operations); return operations[0]; }); }; const findDebitOperation = findOperation; const findCreditOperation = (cozyClient, bill, options, allOperations) => { const creditOptions = Object.assign({}, options, { credit: true }); return findOperation(cozyClient, bill, creditOptions, allOperations); }; module.exports = { findDebitOperation, findCreditOperation }; /***/ }), /* 1183 */ /***/ (function(module, exports, __webpack_require__) { const includes = __webpack_require__(1184); const some = __webpack_require__(541); const sumBy = __webpack_require__(1160); const isWithinRange = __webpack_require__(1187); const { getIdentifiers, getDateRangeFromBill, getAmountRangeFromBill } = __webpack_require__(1188); // constants const HEALTH_VENDORS = ['Ameli', 'Harmonie', 'Malakoff Mederic', 'MGEN', 'Generali', 'ascoreSante', 'EoviMCD', 'Humanis', 'Alan', 'lamutuellegenerale']; // TODO: to import from each konnector const HEALTH_EXPENSE_CAT = '400610'; const HEALTH_INSURANCE_CAT = '400620'; const UNCATEGORIZED_CAT_ID_OPERATION = '0'; // TODO: import it from cozy-bank // helpers const getCategoryId = o => { return o.manualCategoryId || o.automaticCategoryId || UNCATEGORIZED_CAT_ID_OPERATION; }; const isHealthOperation = operation => { const catId = getCategoryId(operation); if (operation.amount < 0) { return catId === HEALTH_EXPENSE_CAT; } else { return catId === HEALTH_EXPENSE_CAT || catId === HEALTH_INSURANCE_CAT; } }; const isUncategorizedOperation = operation => { const catId = getCategoryId(operation); return catId == UNCATEGORIZED_CAT_ID_OPERATION; }; const isHealthBill = bill => { return includes(HEALTH_VENDORS, bill.vendor); }; // filters const filterByIdentifiers = identifiers => { identifiers = identifiers.map(i => i.toLowerCase()); const identifierFilter = operation => { const label = operation.label.toLowerCase(); return some(identifiers, identifier => includes(label, identifier)); }; return identifierFilter; }; const filterByDates = ({ minDate, maxDate }) => { const dateFilter = operation => { return isWithinRange(operation.date, minDate, maxDate); }; return dateFilter; }; const filterByAmounts = ({ minAmount, maxAmount }) => { const amountFilter = operation => { return operation.amount >= minAmount && operation.amount <= maxAmount; }; return amountFilter; }; const filterByCategory = (bill, options = {}) => { const isHealth = isHealthBill(bill); const categoryFilter = operation => { if (options.allowUncategorized === true && isUncategorizedOperation(operation)) { return true; } return isHealth ? isHealthOperation(operation) : !isHealthOperation(operation); }; return categoryFilter; }; /** * Check that the sum of the reimbursements + the amount of the bill is not * greater that the amount of the operation */ const filterByReimbursements = bill => { const reimbursementFilter = operation => { const sumReimbursements = sumBy(operation.reimbursements, 'amount'); return sumReimbursements + bill.amount <= -operation.amount; }; return reimbursementFilter; }; // combine filters const operationsFilters = (bill, operations, options) => { const filterByConditions = filters => op => { for (let f of filters) { const res = f(op); if (!res) { return false; } } return true; }; const fByDates = filterByDates(getDateRangeFromBill(bill, options)); const fByAmounts = filterByAmounts(getAmountRangeFromBill(bill, options)); const fByCategory = filterByCategory(bill, options); const fByReimbursements = filterByReimbursements(bill, options); const conditions = [fByDates, fByAmounts, fByCategory]; if (!options.credit) { conditions.push(fByReimbursements); } // We filters with identifiers when // - we search a credit operation // - or when is bill is in the health category if (options.credit || !isHealthBill(bill)) { const fbyIdentifiers = filterByIdentifiers(getIdentifiers(options)); conditions.push(fbyIdentifiers); } return operations.filter(filterByConditions(conditions)); }; module.exports = { filterByIdentifiers, filterByDates, filterByAmounts, filterByCategory, filterByReimbursements, operationsFilters }; /***/ }), /* 1184 */ /***/ (function(module, exports, __webpack_require__) { var baseIndexOf = __webpack_require__(445), isArrayLike = __webpack_require__(386), isString = __webpack_require__(74), toInteger = __webpack_require__(454), values = __webpack_require__(1185); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max; /** * Checks if `value` is in `collection`. If `collection` is a string, it's * checked for a substring of `value`, otherwise * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * is used for equality comparisons. If `fromIndex` is negative, it's used as * the offset from the end of `collection`. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object|string} collection The collection to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=0] The index to search from. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. * @returns {boolean} Returns `true` if `value` is found, else `false`. * @example * * _.includes([1, 2, 3], 1); * // => true * * _.includes([1, 2, 3], 1, 2); * // => false * * _.includes({ 'a': 1, 'b': 2 }, 1); * // => true * * _.includes('abcd', 'bc'); * // => true */ function includes(collection, value, fromIndex, guard) { collection = isArrayLike(collection) ? collection : values(collection); fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; var length = collection.length; if (fromIndex < 0) { fromIndex = nativeMax(length + fromIndex, 0); } return isString(collection) ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) : (!!length && baseIndexOf(collection, value, fromIndex) > -1); } module.exports = includes; /***/ }), /* 1185 */ /***/ (function(module, exports, __webpack_require__) { var baseValues = __webpack_require__(1186), keys = __webpack_require__(390); /** * Creates an array of the own enumerable string keyed property values of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property values. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.values(new Foo); * // => [1, 2] (iteration order is not guaranteed) * * _.values('hi'); * // => ['h', 'i'] */ function values(object) { return object == null ? [] : baseValues(object, keys(object)); } module.exports = values; /***/ }), /* 1186 */ /***/ (function(module, exports, __webpack_require__) { var arrayMap = __webpack_require__(580); /** * The base implementation of `_.values` and `_.valuesIn` which creates an * array of `object` property values corresponding to the property names * of `props`. * * @private * @param {Object} object The object to query. * @param {Array} props The property names to get values for. * @returns {Object} Returns the array of property values. */ function baseValues(object, props) { return arrayMap(props, function(key) { return object[key]; }); } module.exports = baseValues; /***/ }), /* 1187 */ /***/ (function(module, exports, __webpack_require__) { var parse = __webpack_require__(1099) /** * @category Range Helpers * @summary Is the given date within the range? * * @description * Is the given date within the range? * * @param {Date|String|Number} date - the date to check * @param {Date|String|Number} startDate - the start of range * @param {Date|String|Number} endDate - the end of range * @returns {Boolean} the date is within the range * @throws {Error} startDate cannot be after endDate * * @example * // For the date within the range: * isWithinRange( * new Date(2014, 0, 3), new Date(2014, 0, 1), new Date(2014, 0, 7) * ) * //=> true * * @example * // For the date outside of the range: * isWithinRange( * new Date(2014, 0, 10), new Date(2014, 0, 1), new Date(2014, 0, 7) * ) * //=> false */ function isWithinRange (dirtyDate, dirtyStartDate, dirtyEndDate) { var time = parse(dirtyDate).getTime() var startTime = parse(dirtyStartDate).getTime() var endTime = parse(dirtyEndDate).getTime() if (startTime > endTime) { throw new Error('The start of the range cannot be after the end of the range') } return time >= startTime && time <= endTime } module.exports = isWithinRange /***/ }), /* 1188 */ /***/ (function(module, exports, __webpack_require__) { const sortBy = __webpack_require__(1089); const addDays = __webpack_require__(1156); const subDays = __webpack_require__(1189); const differenceInDays = __webpack_require__(1190); const getOperationAmountFromBill = (bill, options) => { const searchingCredit = options && options.credit; return searchingCredit ? bill.groupAmount || bill.amount : -(bill.originalAmount || bill.amount); }; const getOperationDateFromBill = (bill, options) => { const isCredit = options && options.credit; const date = isCredit ? bill.date : bill.originalDate || bill.date; return date ? new Date(date) : new Date(); }; const getIdentifiers = options => options.identifiers; const getDateRangeFromBill = (bill, options) => { const date = getOperationDateFromBill(bill, options); return { minDate: subDays(date, options.pastWindow), maxDate: addDays(date, options.futureWindow) }; }; const getAmountRangeFromBill = (bill, options) => { const amount = getOperationAmountFromBill(bill, options); return { minAmount: amount - options.minAmountDelta, maxAmount: amount + options.maxAmountDelta }; }; const getTotalReimbursements = operation => { if (!operation.reimbursements) return 0; return operation.reimbursements.reduce((s, r) => s + r.amount, 0); }; // when we want to match an invoice with an operation according criteria, // it is possible that several operations are returned to us. // So we want to find the bill that comes closest. // This function will sort this list const sortedOperations = (bill, operations) => { const buildSortFunction = bill => { // it's not possible to sort with 2 parameters as the same time // Date is more important so it have a biggest weight, // but this value is random. const dateWeight = 0.7; const amountWeight = 1 - dateWeight; const opDate = getOperationDateFromBill(bill); const opAmount = getOperationAmountFromBill(bill); return operation => { const dateDiff = Math.abs(differenceInDays(opDate, operation.date)); const amountDiff = Math.abs(opAmount - operation.amount); return dateWeight * dateDiff + amountWeight * amountDiff; }; }; return sortBy(operations, buildSortFunction(bill)); }; module.exports = { getOperationAmountFromBill, getOperationDateFromBill, getIdentifiers, getDateRangeFromBill, getAmountRangeFromBill, getTotalReimbursements, sortedOperations }; /***/ }), /* 1189 */ /***/ (function(module, exports, __webpack_require__) { var addDays = __webpack_require__(1156) /** * @category Day Helpers * @summary Subtract the specified number of days from the given date. * * @description * Subtract the specified number of days from the given date. * * @param {Date|String|Number} date - the date to be changed * @param {Number} amount - the amount of days to be subtracted * @returns {Date} the new date with the days subtracted * * @example * // Subtract 10 days from 1 September 2014: * var result = subDays(new Date(2014, 8, 1), 10) * //=> Fri Aug 22 2014 00:00:00 */ function subDays (dirtyDate, dirtyAmount) { var amount = Number(dirtyAmount) return addDays(dirtyDate, -amount) } module.exports = subDays /***/ }), /* 1190 */ /***/ (function(module, exports, __webpack_require__) { var parse = __webpack_require__(1099) var differenceInCalendarDays = __webpack_require__(1103) var compareAsc = __webpack_require__(1191) /** * @category Day Helpers * @summary Get the number of full days between the given dates. * * @description * Get the number of full days between the given dates. * * @param {Date|String|Number} dateLeft - the later date * @param {Date|String|Number} dateRight - the earlier date * @returns {Number} the number of full days * * @example * // How many full days are between * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00? * var result = differenceInDays( * new Date(2012, 6, 2, 0, 0), * new Date(2011, 6, 2, 23, 0) * ) * //=> 365 */ function differenceInDays (dirtyDateLeft, dirtyDateRight) { var dateLeft = parse(dirtyDateLeft) var dateRight = parse(dirtyDateRight) var sign = compareAsc(dateLeft, dateRight) var difference = Math.abs(differenceInCalendarDays(dateLeft, dateRight)) dateLeft.setDate(dateLeft.getDate() - sign * difference) // Math.abs(diff in full days - diff in calendar days) === 1 if last calendar day is not full // If so, result must be decreased by 1 in absolute value var isLastDayNotFull = compareAsc(dateLeft, dateRight) === -sign return sign * (difference - isLastDayNotFull) } module.exports = differenceInDays /***/ }), /* 1191 */ /***/ (function(module, exports, __webpack_require__) { var parse = __webpack_require__(1099) /** * @category Common Helpers * @summary Compare the two dates and return -1, 0 or 1. * * @description * Compare the two dates and return 1 if the first date is after the second, * -1 if the first date is before the second or 0 if dates are equal. * * @param {Date|String|Number} dateLeft - the first date to compare * @param {Date|String|Number} dateRight - the second date to compare * @returns {Number} the result of the comparison * * @example * // Compare 11 February 1987 and 10 July 1989: * var result = compareAsc( * new Date(1987, 1, 11), * new Date(1989, 6, 10) * ) * //=> -1 * * @example * // Sort the array of dates: * var result = [ * new Date(1995, 6, 2), * new Date(1987, 1, 11), * new Date(1989, 6, 10) * ].sort(compareAsc) * //=> [ * // Wed Feb 11 1987 00:00:00, * // Mon Jul 10 1989 00:00:00, * // Sun Jul 02 1995 00:00:00 * // ] */ function compareAsc (dirtyDateLeft, dirtyDateRight) { var dateLeft = parse(dirtyDateLeft) var timeLeft = dateLeft.getTime() var dateRight = parse(dirtyDateRight) var timeRight = dateRight.getTime() if (timeLeft < timeRight) { return -1 } else if (timeLeft > timeRight) { return 1 } else { return 0 } } module.exports = compareAsc /***/ }), /* 1192 */ /***/ (function(module, exports, __webpack_require__) { const { getDateRangeFromBill, getAmountRangeFromBill } = __webpack_require__(1188); // cozy-stack limit to 100 elements max const COZY_STACK_QUERY_LIMIT = 100; // Get the operations corresponding to the date interval // around the date of the bill const createDateSelector = (bill, options) => { const { minDate, maxDate } = getDateRangeFromBill(bill, options); return { $gt: minDate.toISOString(), $lt: maxDate.toISOString() }; }; // Get the operations corresponding to the date interval // around the amount of the bill const createAmountSelector = (bill, options) => { const { minAmount, maxAmount } = getAmountRangeFromBill(bill, options); return { $gt: minAmount, $lt: maxAmount }; }; const getQueryOptions = (bill, options, ids) => { const queryOptions = { selector: { date: createDateSelector(bill, options), amount: createAmountSelector(bill, options) }, sort: [{ date: 'desc' }, { amount: 'desc' }], COZY_STACK_QUERY_LIMIT }; if (ids.length > 0) { queryOptions.skip = ids.length; } return queryOptions; }; const and = conditions => obj => { for (let c of conditions) { if (!c(obj)) { return false; } } return true; }; const findByMangoQuerySimple = (docs, query) => { const selector = query.selector; const filters = Object.keys(selector).map(attr => doc => { const attrSel = selector[attr]; const conditions = Object.keys(attrSel).map($operator => doc => { const val = doc[attr]; const selValue = attrSel[$operator]; if ($operator == '$gt') { return val > selValue; } else if ($operator == '$lt') { return val < selValue; } else { throw new Error(`Unknown operator ${$operator}`); } }); return and(conditions)(doc); }); return docs.filter(and(filters)); }; const findNeighboringOperations = async (cozyClient, bill, options, allOperations) => { const queryOptions = getQueryOptions(bill, options, []); const neighboringOperations = findByMangoQuerySimple(allOperations, queryOptions); return neighboringOperations; }; module.exports = { findByMangoQuerySimple, findNeighboringOperations }; /***/ }), /* 1193 */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__( 1194 ).Geco; /***/ }), /* 1194 */ /***/ (function(module, exports, __webpack_require__) { /* * Geco, a CAT (Constant Amortized Time) recursive generator* * for k-combinations, chosen from a given set S of n elements, * with and without replacement. * * https://en.wikipedia.org/wiki/Lexicographical_order#Colexicographic_order * * Copyright(c) 2018-present Guglielmo Ferri <44gatti@gmail.com> * MIT Licensed */ exports.Geco = Object.assign( __webpack_require__( 1195 ), __webpack_require__( 1198 ) ); /***/ }), /* 1195 */ /***/ (function(module, exports, __webpack_require__) { /* * Geco, a CAT (Constant Amortized Time) recursive generator* * for k-combinations, chosen from a given set S of n elements, * with and without replacement. * * https://en.wikipedia.org/wiki/Lexicographical_order#Colexicographic_order * * Copyright(c) 2018-present Guglielmo Ferri <44gatti@gmail.com> * MIT Licensed */ module.exports = ( function () { const balloc = Buffer.alloc , Toni = __webpack_require__( 1196 ) ; return { // CAT generator for combinations without replacement get : function ( n, k ) { if ( ! n || ( n < k ) ) throw new RangeError( 'check input values' ) ; // buffer for generating combinations const buff = balloc( n, 0 ) // colex recursive generator , colex_gen = function *( n, k ) { if ( n === 0 ) yield buff; else { if ( k < n ) { buff[ n - 1 ] = 0; yield* colex_gen( n - 1, k ); } if ( k > 0 ) { buff[ n - 1 ] = 1; yield* colex_gen( n - 1, k - 1 ); } } } // generating colex order for k <= n/2. , colex_gen_2 = function *( n, k ) { if ( k === 0 ) yield buff; else { if ( k < n ) { buff[ n - 1 ] = 0; yield* colex_gen_2( n - 1, k ); } buff[ n - 1 ] = 1; yield* colex_gen_2( n - 1, k - 1); buff[ n - 1 ] = 0; } } ; return ( k > n / 2 ) ? colex_gen( n , k ) : colex_gen_2( n, k ) ; } , get_bm : function ( n, k ) { if ( ! n || ( n < k ) ) throw new RangeError( 'check input values' ) ; // bitmap for generating combinations const bmap = Toni( n ) // colex recursive generator , colex_gen = function *( n, k ) { if ( n === 0 ) yield bmap; else { if ( k < n ) { bmap.del( n - 1 ); yield* colex_gen( n - 1, k ); } if ( k > 0 ) { bmap.add( n - 1 ); yield* colex_gen( n - 1, k - 1 ); } } } // generating colex order for k <= n/2. , colex_gen_2 = function *( n, k ) { if ( k === 0 ) yield bmap; else { if ( k < n ) { bmap.del( n - 1 ); yield* colex_gen_2( n - 1, k ); } bmap.add( n - 1 ); yield* colex_gen_2( n - 1, k - 1); bmap.del( n - 1 ); } } ; return ( k > n / 2 ) ? colex_gen( n , k ) : colex_gen_2( n, k ) ; } , gen : function *( n, k, set, bitmap ) { // k should be < n let list = set || 0 , llen = list.length , ok = list && llen && n && ( n >= k ) && ( n <= llen ) , result, comb, c, bm, b , iter = null ; if ( ! ok ) throw new RangeError( 'check input values' ) ; // iterate on current result if ( bitmap ) { // use Toni bitmap iter = this.get_bm( n, k ); for ( bm of iter ) { result = []; b = 0; for ( ; b < n; ++b ) if ( bm.chk( b ) ) result.push( list[ b ] ); yield result; } return; } // use a Buffer iter = this.get( n, k ); for ( comb of iter ) { result = []; c = 0; for ( ; c < n; ++c ) if ( comb[ c ] ) result.push( list[ c ] ); yield result; } } // get total number of combinations , cnt : ( n, k ) => { let p = [ 1, 1 ] , c = 0 ; for ( ; c < k; ++c ) { p[ 0 ] *= n - c; p[ 1 ] *= k - c; } return p[ 0 ] / p[ 1 ]; } } ; } )(); /***/ }), /* 1196 */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__( 1197 ).Toni; /***/ }), /* 1197 */ /***/ (function(module, exports) { /* * Toni, a simple and efficient bitmap implementation for positive integer sets * (max 32 bits), with no element repetition, using bitwise operations and a Buffer. * Modifying a single bit instead of an entire byte, obviously saves 87.5% of Buffer * space, but it also implies a gain greater than 200% in performances, when it was * used with big integer ranges. * * http://en.wikipedia.org/wiki/Bit_array * * Copyright(c) 2014-present Guglielmo Ferri <44gatti@gmail.com> * MIT Licensed */ exports.Toni = ( function () { var log = console.log , abs = Math.abs , ceil = Math.ceil , max = Math.max , min = Math.min // table of powers , bpower = new Buffer( [ 128, 64, 32, 16, 8, 4, 2, 1 ] ) // count the number of bits set to 1 for every 1-byte number , cbits = function ( b ) { // divide et impera method for 8 bits var v = b - ( ( b >>> 1 ) & 0x55 ); v = ( v & 0x33 ) + ( ( v >>> 2 ) & 0x33 ); return v + ( v >>> 4 ) & 0x0f; } , bctable = ( function () { var i = 0 , table = new Buffer( 256 ) , v = -1 ; for ( ; i < 256; ++i ) table[ i ] = cbits( i ); return table; } )() , Toni = function ( range ) { var me = this , is = me instanceof Toni ; if ( ! is ) return new Toni( range ); // limit range to 4 bytes, (32 bits numbers) using >>> 0 var r = ( abs( + range ) >>> 0 ) || 1 , bytes = max( ceil( r / 8 ), 1 ) , bitmap = new Buffer( bytes ) ; bitmap.fill( 0x00 ); me.bitmap = bitmap; // bytes needed me.bmlen = bytes << 3 >>> 0; me.items = 0; me.range = r; // bit count table for 1 byte me.bctable = bctable; } , tproto = Toni.prototype ; tproto.clear = function () { var me = this ; me.bitmap.fill( 0x00 ); me.items = 0; return me; }; tproto.add = function ( value ) { var me = this , v = abs( value ) , bitmap = me.bitmap , range = me.range ; // check value range if ( ( v >= me.bmlen ) || ( v >= range ) ) return -1; /* * generally, bucket and mask could be calculated respectively as floor( v / 8 ) * and bpower[ v % 8 ], but seen that values > 2^32 are not allowed, then we can * speed up things using bitwise shiftings. */ var buck = v >>> 3 , mask = bpower[ v & 7 ] , up = mask & bitmap[ buck ] ; return up ? -1 : ++me.items | ( bitmap[ buck ] |= mask ); }; // get/access the bit at a given index i, b = B[i] tproto.chk = function ( value ) { var me = this , v = abs( value ) , range = me.range ; // check value range if ( ( me.bmlen <= v ) || ( v >= range ) ) return 0; // see #add return bpower[ v & 7 ] & me.bitmap[ v >>> 3 ] ? 1 : 0; }; tproto.del = function ( value ) { var me = this , v = value , range = me.range , bitmap = me.bitmap ; // check value range if ( ( me.bmlen <= v ) || ( v >= range ) ) return -1; var buck = v >>> 3 , mask = bpower[ v & 7 ] , up = mask & bitmap[ buck ] ; return up ? --me.items | ( bitmap[ buck ] ^= mask ) : -1; }; // it returns the occurrences of bit 1 until index i tproto.rank = function ( i ) { var me = this , bitmap = me.bitmap , bmlen = me.bmlen , buck = null , boff = -1 , bshift = -1 , b = 0 , bcnt = 0 , index = min( i >>> 0, me.bmlen ) ; if ( index > bmlen ) return -1; // last bucket to count with btable buck = index >>> 3; // bits remaining to count boff = 1 + ( index - ( buck << 3 ) ); bshift = 8 - boff; if ( buck ) { // log( ' - bytes to count: %d', buck ); for ( b = 0; b < buck ; ++b ) bcnt += bctable[ bitmap[ b ] ]; } bcnt += bctable[ bitmap[ b ] >>> bshift ]; return bcnt; }; // it returns the position of the i-th occurrence of bit 1 // tproto.select = function ( index ) { // var me = this // ; // return; // }; return Toni; } )(); /***/ }), /* 1198 */ /***/ (function(module, exports) { /* * Geco, a CAT (Constant Amortized Time) recursive generator* * for k-combinations, chosen from a given set S of n elements, * with and without replacement. * * https://en.wikipedia.org/wiki/Lexicographical_order#Colexicographic_order * * Copyright(c) 2018-present Guglielmo Ferri <44gatti@gmail.com> * MIT Licensed */ module.exports = ( function () { const balloc = Buffer.alloc , bfrom = Buffer.from , isBuffer = Buffer.isBuffer , isInteger = Number.isInteger , mgen = function ( k, v, rep ) { const rlen = rep.length // get the total number of elements , total = ( () => { let [ i, t ] = [ 1, rep[ 0 ] ]; if ( rlen > 1 ) for ( ; i < rlen; ++i ) t += rep[ i ]; return t; } )() // choose the correct fn , up = k > total >> 1 // init the correct gen buffer ( v === rlen ), for k > n/2, k <= 2 , buff = up ? bfrom( rep ) : balloc( v, 0 ) // k <= n/2, TODO k > n/2 , colex_gen = function *( k, v, tot ) { if ( k === 0 ) yield buff; else { let c = v - 1 , occ = rep[ c ] , r = tot - occ , l = k > r ? k - r : 0 , m = occ < k ? occ : k ; for ( ; l <= m; ++l ) { buff[ c ] = l; yield* colex_gen( k - l, c, r ); buff[ c ] = 0; } } } ; // check k range if ( k >= total ) new RangeError( 'k value should be lesser than total elements' ); return colex_gen( k, v, total ) ; } ; return { mget : function ( k, v, rep ) { let rlen = -1 , b = -1 , read = null , write = null // get the total number of elements , total = -1 , ok = k && v && rep ; if ( ! ok ) return new RangeError( 'missing or wrong input values' ); // check repetitions type if ( isBuffer( rep ) && ( rlen = rep.length ) ) { b = rlen / v; if ( b === 1 ) return mgen( k, v, rep ); if ( ( b !== 2 ) && ( b !== 4 ) ) return new RangeError( 'repetitions buffer length should be a multiple of v' ); // set the correct read/write fn, only 4, 2, 1 bytes are allowed [ read, write ] = [ `readUInt${ b << 3 }BE`, `writeUInt${ b << 3 }BE` ]; // get the total number of elements total = ( () => { let [ i, t ] = [ b, rep[ read ]( 0 ) ]; if ( rlen > b ) for ( ; i < rlen; i += b ) t += rep[ read ]( i ); return t; } )(); } else if ( isInteger( rep ) ) { // use rep value as default repetitions for every value, build a buffer accordingly if ( rep < 257 ) return mgen( k, v, balloc( v, rep ) ); if ( rep < 65537 ) b = 2; else if ( rep < 4294967297 ) b = 4; else return new RangeError( 'repetitions should be < 2^32 + 1' ); rlen = v << ( b >>> 1 ); total = v * rep; // set the correct read/write fn, only 4, 2, 1 bytes are allowed [ read, write ] = [ `readUInt${ b << 3 }BE`, `writeUInt${ b << 3 }BE` ]; rep = balloc( rlen ); // fill the reference buffer of repetitions with v identical values for ( let i = 0; i < rlen; i += b ) rep[ write ]( v ); } else return new RangeError( 'repetitions should be represented as: a buffer or an integer' ); // check k range if ( k >= total ) new RangeError( 'k should be lesser than the total sum of repetitions' ); // choose the correct colex fn let up = k > total >> 1 // init the correct gen buffer, for k > n/2, k <= 2 , buff = up ? bfrom( rep ) : balloc( rlen, 0 ) // k <= n/2, TODO k > n/2 , colex_gen = function *( k, v, tot ) { if ( k === 0 ) yield buff; else { let c = v - 1 , occ = rep[ read ]( c * b ) , r = tot - occ , l = k > r ? k - r : 0 , m = occ < k ? occ : k ; for ( ; l <= m; ++l ) { buff[ write ]( l, c * b ); yield* colex_gen( k - l, c, r ); buff[ write ]( 0, c * b ); } } } ; return colex_gen( k, v, total ) ; } } ; } )(); /***/ }), /* 1199 */ /***/ (function(module, exports, __webpack_require__) { /** * Provides an handy method to log the user in, * on HTML form pages. On success, it resolves to a promise with a parsed body. * * @module signin */ const errors = __webpack_require__(1176); const rerrors = __webpack_require__(1200); const log = __webpack_require__(2).namespace('cozy-konnector-libs'); const requestFactory = __webpack_require__(22); const cheerio = __webpack_require__(279); /** * Provides an handy method to log the user in, * on HTML form pages. On success, it resolves to a promise with a parsed body. * * Errors: * * - LOGIN_FAILED if the validate predicate is false * - INVALID_FORM if the element matched by `formSelector` is not a form or has * no `action` attribute * - UNKNOWN_PARSING_STRATEGY if `parse` is not one of the accepted values: * `raw`, `cheerio`, `json`. * - VENDOR_DOWN if a request throws a RequestError, or StatusCodeError * * It does not submit values provided through `select` tags, except if populated * by user with `formData`. * * - `url` is the url to access the html form * * - `formSelector` is used by cheerio to uniquely identify the form in which to * log in * * - `formData` is an object `{ name: value, … }`. It is used to populate the * form, in the proper inputs with the same name as the properties of this * object, before submitting it. It can also be a function that returns this * object. The page at `url` would be given as argument, right after having * been parsed through `cheerio`. * * - `parse` allow the user to resolve `signin` with a preparsed body. The * choice of the strategy for the parsing is one of : `raw`, `json` or * `cheerio`. `cheerio` being the default. * * - `validate` is a predicate taking three arguments `statusCode`, `parsedBody` and `fullResponse`. * If it is false, `LOGIN_FAILED` is thrown, otherwise the * signin resolves with `parsedBody` value. * * - `requestOpts` allows to pass eventual options to the `signin`'s * `requestFactory`. It could be useful for pages using `latin1` `encoding` * for instance. * * @example * == basic example : == * ```javascript * const $ = signin({ * url: `http://quotes.toscrape.com/login`, * formSelector: 'form', * formData: { username, password } * }) * ``` * If the behavior of the targeted website is not standard. You can pass a validate function which * will allow you to: * - detect if the credentials work or not -> LOGIN_FAILED * - detect if actions from the user are needed -> USER_ACTION_NEEDED * - detect if the targeted website is out -> VENDOR_DOWN * * @example * ```javascript * const $ = signin({ * url: `http://quotes.toscrape.com/login`, * formSelector: 'form', * formData: { username, password }, * validate: (statusCode, $, fullResponse) { * if (statusCode !== 200) return false // LOGIN_FAILED * if ($('.cgu').length) throw new Error('USER_ACTION_NEEDED') * if (fullResponse.request.uri.href.includes('error')) throw new Error('VENDOR_DOWN') * } * }) * ``` * * Do not forget that the use of the signin function is not mandatory in a connector and won't work * if the signin page does not use html forms. Here, a simple POST request may be a lot more * simple. * * @alias module:signin */ function signin({ url, formSelector, formData = {}, parse = 'cheerio', validate = defaultValidate, ...requestOpts } = {}) { // Check for mandatory arguments if (url === undefined) { throw new Error('signin: `url` must be defined'); } if (formSelector === undefined) { throw new Error('signin: `formSelector` must be defined'); } const rq = requestOpts.requestInstance || requestFactory({ jar: true, json: false, ...requestOpts }); const parseBody = getStrategy(parse); return rq({ uri: url, transform: body => cheerio.load(body) }).catch(handleRequestErrors).then($ => { const data = typeof formData === 'function' ? formData($) : formData; const [action, inputs] = parseForm($, formSelector, url); for (let name in data) { inputs[name] = data[name]; } return submitForm(rq, __webpack_require__(83).resolve(url, action), inputs, parseBody, url); }).then(([statusCode, parsedBody, fullResponse]) => { if (!validate(statusCode, parsedBody, fullResponse)) { throw new Error(errors.LOGIN_FAILED); } else { return Promise.resolve(parsedBody); } }); } function defaultValidate(statusCode) { return statusCode === 200; } function getStrategy(parseStrategy) { switch (parseStrategy) { case 'cheerio': return cheerio.load; case 'json': return JSON.parse; case 'raw': return body => body; default: { const err = `signin: parsing strategy \`${parseStrategy}\` unknown. `; const hint = 'Use one of `raw`, `cheerio` or `json`'; log('error', err + hint); throw new Error('UNKNOWN_PARSING_STRATEGY'); } } } function parseForm($, formSelector, currentUrl) { const form = $(formSelector).first(); const action = form.attr('action') || currentUrl; if (!form.is('form')) { const err = 'element matching `' + formSelector + '` is not a `form`'; log('error', err); throw new Error('INVALID_FORM'); } const inputs = {}; const arr = form.serializeArray(); for (let input of arr) { inputs[input.name] = input.value; } return [action, inputs]; } function submitForm(rq, uri, inputs, parseBody, referer) { return rq({ uri: uri, method: 'POST', form: { ...inputs }, transform: (body, response) => [response.statusCode, parseBody(body), response], headers: { Referer: referer } }).catch(handleRequestErrors); } function handleRequestErrors(err) { if (err instanceof rerrors.RequestError || err instanceof rerrors.StatusCodeError) { log('error', err); throw new Error(errors.VENDOR_DOWN); } else { return Promise.reject(err); } } module.exports = signin; /***/ }), /* 1200 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = __webpack_require__(1201); /***/ }), /* 1201 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = __webpack_require__(64); /***/ }), /* 1202 */ /***/ (function(module, exports, __webpack_require__) { /** * Creates or updates the given entries according to if they already * exist in the cozy or not * * @module updateOrCreate */ const bluebird = __webpack_require__(25); const log = __webpack_require__(2).namespace('updateOrCreate'); const cozy = __webpack_require__(617); const get = __webpack_require__(571); const { getCozyMetadata } = __webpack_require__(1059); /** * Creates or updates the given entries according to if they already * exist in the cozy or not * * You need the full permission for the given doctype in your manifest, to be able to * use this function. * * * `entries` (object array): Documents to save * * `doctype` (string): Doctype of the documents * * `matchingAttributes` (string array): attributes in each entry used to check if an entry already exists in the Cozy * * `options` (object): general option affecting metadata : * + `sourceAccount` (String): id of the source account * + `sourceAccountIdentifier` (String): identifier unique to the account targetted by the connector. It is the login most of the time * * @alias module:updateOrCreate */ const updateOrCreate = (entries = [], doctype, matchingAttributes = [], options = {}) => { return cozy.data.findAll(doctype).then(existings => bluebird.mapSeries(entries, entry => { const metaEntry = { cozyMetadata: getCozyMetadata({ ...entry.cozyMetadata, sourceAccount: options.sourceAccount, sourceAccountIdentifier: options.sourceAccountIdentifier }), ...entry }; // try to find a corresponding existing element const toUpdate = existings.find(doc => matchingAttributes.reduce((isMatching, matchingAttribute) => isMatching && get(doc, matchingAttribute) === get(metaEntry, matchingAttribute), true)); if (toUpdate) { log('debug', 'updating'); if (toUpdate.cozyMetadata) metaEntry.cozyMetadata.createdAt = toUpdate.cozyMetadata.createdAt; return cozy.data.updateAttributes(doctype, toUpdate._id, metaEntry); } else { log('debug', 'creating'); return cozy.data.create(doctype, metaEntry); } })); }; module.exports = updateOrCreate; /***/ }), /* 1203 */ /***/ (function(module, exports, __webpack_require__) { /** * Helper to set or merge io.cozy.identities * See https://github.com/cozy/cozy-doctypes/blob/master/docs/io.cozy.identities.md * * @module saveIdentity */ const log = __webpack_require__(2).namespace('saveIdentity'); const updateOrCreate = __webpack_require__(1202); /** * Set or merge a io.cozy.identities * * You need full permission for the doctype io.cozy.identities in your * manifest, to be able to use this function. * * Parameters: * * * `contact` (object): the identity to create/update as an object io.cozy.contacts * * `accountIdentifier` (string): a string that represent the account use, if available fields.login * * `options` (object): options which will be given to updateOrCreate directly : * + `sourceAccount` (String): id of the source account * + `sourceAccountIdentifier` (String): identifier unique to the account targetted by the connector. It is the login most of the time * * * ```javascript * const { saveIdentity } = require('cozy-konnector-libs') * const identity = * { * name: 'toto', * email: { 'address': 'toto@example.com' } * } * * return saveIdentity(identity, fields.login) * ``` * * @alias module:saveIdentity */ const saveIdentity = async (contact, accountIdentifier, options = {}) => { log('info', 'saving user identity'); if (accountIdentifier == null) { log('warn', "Can't set identity as no accountIdentifier was provided"); return; } if (contact == null) { log('warn', "Can't set identity as no contact was provided"); return; } // Format contact if needed if (contact.phone) { contact.phone = formatPhone(contact.phone); } if (contact.address) { contact.address = formatAddress(contact.address); } const identity = { identifier: accountIdentifier, contact }; await updateOrCreate([identity], 'io.cozy.identities', ['identifier', 'cozyMetadata.createdByApp'], { ...options, sourceAccountIdentifier: accountIdentifier }); return; }; /* Remove html and cariage return in address */ function formatAddress(address) { for (const element of address) { if (element.formattedAddress) { element.formattedAddress = element.formattedAddress.replace(/<[^>]*>/g, '') // Remove all html Tag .replace(/\r\n|[\n\r]/g, ' '); // Remove all kind of return character address[address.indexOf(element)] = element; } } return address; } /* Replace all characters in a phone number except '+' or digits */ function formatPhone(phone) { for (const element of phone) { if (element.number) { element.number = element.number.replace(/[^\d.+]/g, ''); phone[phone.indexOf(element)] = element; } } return phone; } module.exports = saveIdentity; /***/ }), /* 1204 */ /***/ (function(module, exports, __webpack_require__) { /* global __APP_VERSION__ */ const log = __webpack_require__(2); const Raven = __webpack_require__(1205); const { getDomain, getInstance } = __webpack_require__(1233); let isRavenConfigured = false; const ENV_DEV = 'development'; const ENV_SELF = 'selfhost'; const ENV_PROD = 'production'; const domainToEnv = { 'cozy.tools': ENV_DEV, 'cozy.works': ENV_DEV, 'cozy.rocks': ENV_PROD, 'mycozy.cloud': ENV_PROD }; const getEnvironmentFromDomain = domain => { return domainToEnv[domain] || ENV_SELF; }; // Available in Projet > Settings > Client Keys // Example : https://5f94cb7772deadbeef123456:39e4e34fdeadbeef123456a9ae31caba74c@sentry.cozycloud.cc/12 const SENTRY_DSN = process.env.SENTRY_DSN; const afterFatalError = function (_err, sendErr, eventId) { if (!sendErr) { log('info', 'Successfully sent fatal error with eventId ' + eventId + ' to Sentry'); } process.exit(1); }; const afterCaptureException = function (sendErr, eventId) { if (!sendErr) { log('info', 'Successfully sent exception with eventId ' + eventId + ' to Sentry'); } process.exit(1); }; const setupSentry = function () { try { log('info', 'process.env.SENTRY_DSN found, setting up Raven'); const release = typeof __APP_VERSION__ !== 'undefined' ? __APP_VERSION__ : 'dev'; const domain = getDomain(); const environment = getEnvironmentFromDomain(domain); const instance = getInstance(); Raven.config(SENTRY_DSN, { release, environment, autoBreadcrumbs: { console: true } }).install(afterFatalError); Raven.mergeContext({ tags: { domain, instance } }); isRavenConfigured = true; log('info', 'Raven configured !'); } catch (e) { log('warn', 'Could not load Raven, errors will not be sent to Sentry'); log('warn', e); } }; module.exports.captureExceptionAndDie = function (err) { log('info', 'Capture exception and die'); if (!isRavenConfigured) { process.exit(1); } else { try { log('info', 'Sending exception to Sentry'); Raven.captureException(err, { fingerprint: [err.message || err] }, afterCaptureException); } catch (e) { log('warn', 'Could not send error to Sentry, exiting...'); log('warn', e); log('warn', err); process.exit(1); } } }; module.exports.wrapIfSentrySetUp = function (obj, method) { if (SENTRY_DSN && SENTRY_DSN !== 'false') { obj[method] = Raven.wrap(obj[method]); } }; if (SENTRY_DSN && SENTRY_DSN !== 'false') { setupSentry(); } /***/ }), /* 1205 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = __webpack_require__(1206); module.exports.utils = __webpack_require__(1210); module.exports.transports = __webpack_require__(1211); module.exports.parsers = __webpack_require__(1208); // To infinity and beyond Error.stackTraceLimit = Infinity; /***/ }), /* 1206 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var stringify = __webpack_require__(1207); var parsers = __webpack_require__(1208); var zlib = __webpack_require__(101); var utils = __webpack_require__(1210); var uuid = __webpack_require__(1216); var transports = __webpack_require__(1211); var nodeUtil = __webpack_require__(9); // nodeUtil to avoid confusion with "utils" var events = __webpack_require__(268); var domain = __webpack_require__(1221); var md5 = __webpack_require__(1222); var instrumentor = __webpack_require__(1226); var extend = utils.extend; function Raven() { this.breadcrumbs = { record: this.captureBreadcrumb.bind(this) }; } nodeUtil.inherits(Raven, events.EventEmitter); extend(Raven.prototype, { config: function config(dsn, options) { // We get lots of users using raven-node when they want raven-js, hence this warning if it seems like a browser if ( typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined' ) { utils.consoleAlertOnce( "This looks like a browser environment; are you sure you don't want Raven.js for browser JavaScript? https://sentry.io/for/javascript" ); } if (arguments.length === 0) { // no arguments, use default from environment dsn = global.process.env.SENTRY_DSN; options = {}; } if (typeof dsn === 'object') { // They must only be passing through options options = dsn; dsn = global.process.env.SENTRY_DSN; } options = options || {}; this.raw_dsn = dsn; this.dsn = utils.parseDSN(dsn); this.name = options.name || global.process.env.SENTRY_NAME || __webpack_require__(19).hostname(); this.root = options.root || global.process.cwd(); this.transport = options.transport || transports[this.dsn.protocol]; this.sendTimeout = options.sendTimeout || 1; this.release = options.release || global.process.env.SENTRY_RELEASE; this.environment = options.environment || global.process.env.SENTRY_ENVIRONMENT || global.process.env.NODE_ENV; // autoBreadcrumbs: true enables all, autoBreadcrumbs: false disables all // autoBreadcrumbs: { http: true } enables a single type this.autoBreadcrumbs = options.autoBreadcrumbs || false; // default to 30, don't allow higher than 100 this.maxBreadcrumbs = Math.max(0, Math.min(options.maxBreadcrumbs || 30, 100)); this.captureUnhandledRejections = options.captureUnhandledRejections; this.loggerName = options.logger; this.dataCallback = options.dataCallback; this.shouldSendCallback = options.shouldSendCallback; this.sampleRate = typeof options.sampleRate === 'undefined' ? 1 : options.sampleRate; this.maxReqQueueCount = options.maxReqQueueCount || 100; this.parseUser = options.parseUser; this.stacktrace = options.stacktrace || false; if (!this.dsn) { utils.consoleAlert('no DSN provided, error reporting disabled'); } if (this.dsn.protocol === 'https') { // In case we want to provide our own SSL certificates / keys this.ca = options.ca || null; } // enabled if a dsn is set this._enabled = !!this.dsn; var globalContext = (this._globalContext = {}); if (options.tags) { globalContext.tags = options.tags; } if (options.extra) { globalContext.extra = options.extra; } this.onFatalError = this.defaultOnFatalError = function(err, sendErr, eventId) { console.error(err && err.stack ? err.stack : err); global.process.exit(1); }; this.uncaughtErrorHandler = this.makeErrorHandler(); this.on('error', function(err) { utils.consoleAlert('failed to send exception to sentry: ' + err.message); }); return this; }, install: function install(cb) { if (this.installed) return this; if (typeof cb === 'function') { this.onFatalError = cb; } global.process.on('uncaughtException', this.uncaughtErrorHandler); if (this.captureUnhandledRejections) { var self = this; global.process.on('unhandledRejection', function(reason, promise) { var context = (promise.domain && promise.domain.sentryContext) || {}; context.extra = context.extra || {}; context.extra.unhandledPromiseRejection = true; self.captureException(reason, context, function(sendErr, eventId) { if (!sendErr) { var reasonMessage = (reason && reason.message) || reason; utils.consoleAlert( 'unhandledRejection captured\n' + 'Event ID: ' + eventId + '\n' + 'Reason: ' + reasonMessage ); } }); }); } instrumentor.instrument(this, this.autoBreadcrumbs); this.installed = true; return this; }, uninstall: function uninstall() { if (!this.installed) return this; instrumentor.deinstrument(this); // todo: this works for tests for now, but isn't what we ultimately want to be doing global.process.removeAllListeners('uncaughtException'); global.process.removeAllListeners('unhandledRejection'); this.installed = false; return this; }, makeErrorHandler: function() { var self = this; var caughtFirstError = false; var caughtSecondError = false; var calledFatalError = false; var firstError; return function(err) { if (!caughtFirstError) { // this is the first uncaught error and the ultimate reason for shutting down // we want to do absolutely everything possible to ensure it gets captured // also we want to make sure we don't go recursion crazy if more errors happen after this one firstError = err; caughtFirstError = true; self.captureException(err, {level: 'fatal'}, function(sendErr, eventId) { if (!calledFatalError) { calledFatalError = true; self.onFatalError(err, sendErr, eventId); } }); } else if (calledFatalError) { // we hit an error *after* calling onFatalError - pretty boned at this point, just shut it down utils.consoleAlert( 'uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown' ); self.defaultOnFatalError(err); } else if (!caughtSecondError) { // two cases for how we can hit this branch: // - capturing of first error blew up and we just caught the exception from that // - quit trying to capture, proceed with shutdown // - a second independent error happened while waiting for first error to capture // - want to avoid causing premature shutdown before first error capture finishes // it's hard to immediately tell case 1 from case 2 without doing some fancy/questionable domain stuff // so let's instead just delay a bit before we proceed with our action here // in case 1, we just wait a bit unnecessarily but ultimately do the same thing // in case 2, the delay hopefully made us wait long enough for the capture to finish // two potential nonideal outcomes: // nonideal case 1: capturing fails fast, we sit around for a few seconds unnecessarily before proceeding correctly by calling onFatalError // nonideal case 2: case 2 happens, 1st error is captured but slowly, timeout completes before capture and we treat second error as the sendErr of (nonexistent) failure from trying to capture first error // note that after hitting this branch, we might catch more errors where (caughtSecondError && !calledFatalError) // we ignore them - they don't matter to us, we're just waiting for the second error timeout to finish caughtSecondError = true; setTimeout(function() { if (!calledFatalError) { // it was probably case 1, let's treat err as the sendErr and call onFatalError calledFatalError = true; self.onFatalError(firstError, err); } else { // it was probably case 2, our first error finished capturing while we waited, cool, do nothing } }, (self.sendTimeout + 1) * 1000); // capturing could take at least sendTimeout to fail, plus an arbitrary second for how long it takes to collect surrounding source etc } }; }, generateEventId: function generateEventId() { return uuid().replace(/-/g, ''); }, process: function process(eventId, kwargs, cb) { // prod codepaths shouldn't hit this branch, for testing if (typeof eventId === 'object') { cb = kwargs; kwargs = eventId; eventId = this.generateEventId(); } var domainContext = (domain.active && domain.active.sentryContext) || {}; var globalContext = this._globalContext || {}; kwargs.user = extend({}, globalContext.user, domainContext.user, kwargs.user); kwargs.tags = extend({}, globalContext.tags, domainContext.tags, kwargs.tags); kwargs.extra = extend({}, globalContext.extra, domainContext.extra, kwargs.extra); // Perform a shallow copy of breadcrums to not send one that we'll capture below through as well kwargs.breadcrumbs = { values: (domainContext.breadcrumbs && domainContext.breadcrumbs.slice()) || (globalContext.breadcrumbs && globalContext.breadcrumbs.slice()) || [] }; /* `request` is our specified property name for the http interface: https://docs.sentry.io/clientdev/interfaces/http/ `req` is the conventional name for a request object in node/express/etc we want to enable someone to pass a `request` property to kwargs according to http interface but also want to provide convenience for passing a req object and having us parse it out so we only parse a `req` property if the `request` property is absent/empty (and hence we won't clobber) parseUser returns a partial kwargs object with a `request` property and possibly a `user` property */ var request = this._createRequestObject( globalContext.request, domainContext.request, kwargs.request ); delete kwargs.request; if (Object.keys(request).length === 0) { request = this._createRequestObject( globalContext.req, domainContext.req, kwargs.req ); delete kwargs.req; } if (Object.keys(request).length > 0) { var parseUser = Object.keys(kwargs.user).length === 0 ? this.parseUser : false; extend(kwargs, parsers.parseRequest(request, parseUser)); } else { kwargs.request = {}; } kwargs.modules = utils.getModules(); kwargs.server_name = kwargs.server_name || this.name; if (typeof global.process.version !== 'undefined') { kwargs.extra.node = global.process.version; } kwargs.environment = kwargs.environment || this.environment; kwargs.logger = kwargs.logger || this.loggerName; kwargs.event_id = eventId; kwargs.timestamp = new Date().toISOString().split('.')[0]; kwargs.project = this.dsn && this.dsn.project_id; kwargs.platform = 'node'; kwargs.release = this.release; // Cleanup empty properties before sending them to the server Object.keys(kwargs).forEach(function(key) { if (kwargs[key] == null || kwargs[key] === '') { delete kwargs[key]; } }); if (this.dataCallback) { kwargs = this.dataCallback(kwargs); } // Capture breadcrumb before sending it, as we also want to have it even when // it was dropped due to sampleRate or shouldSendCallback this.captureBreadcrumb({ category: 'sentry', message: kwargs.message, event_id: kwargs.event_id, level: kwargs.level || 'error' // presume error unless specified }); var shouldSend = true; if (!this._enabled) shouldSend = false; if (this.shouldSendCallback && !this.shouldSendCallback(kwargs)) shouldSend = false; if (Math.random() >= this.sampleRate) shouldSend = false; if (shouldSend) { this.send(kwargs, cb); } else { // wish there was a good way to communicate to cb why we didn't send; worth considering cb api change? // could be shouldSendCallback, could be disabled, could be sample rate // avoiding setImmediate here because node 0.8 cb && setTimeout(function() { cb(null, eventId); }, 0); } }, send: function send(kwargs, cb) { var self = this; var skwargs = stringify(kwargs); var eventId = kwargs.event_id; zlib.deflate(skwargs, function(err, buff) { var message = buff.toString('base64'), timestamp = new Date().getTime(), headers = { 'X-Sentry-Auth': utils.getAuthHeader( timestamp, self.dsn.public_key, self.dsn.private_key ), 'Content-Type': 'application/octet-stream', 'Content-Length': message.length }; self.transport.send(self, message, headers, eventId, cb); }); }, captureMessage: function captureMessage(message, kwargs, cb) { if (!cb && typeof kwargs === 'function') { cb = kwargs; kwargs = {}; } else { kwargs = utils.isPlainObject(kwargs) ? extend({}, kwargs) : {}; } var eventId = this.generateEventId(); if (this.stacktrace) { var ex = new Error(message); console.log(ex); utils.parseStack( ex, function(frames) { // We trim last frame, as it's our `new Error(message)` statement itself, which is redundant kwargs.stacktrace = { frames: frames.slice(0, -1) }; this.process(eventId, parsers.parseText(message, kwargs), cb); }.bind(this) ); } else { this.process(eventId, parsers.parseText(message, kwargs), cb); } return eventId; }, captureException: function captureException(err, kwargs, cb) { if (!cb && typeof kwargs === 'function') { cb = kwargs; kwargs = {}; } else { kwargs = utils.isPlainObject(kwargs) ? extend({}, kwargs) : {}; } if (!utils.isError(err)) { if (utils.isPlainObject(err)) { // This will allow us to group events based on top-level keys // which is much better than creating new group when any key/value change var keys = Object.keys(err).sort(); var message = 'Non-Error exception captured with keys: ' + utils.serializeKeysForMessage(keys); kwargs = extend(kwargs, { message: message, fingerprint: [md5(keys)], extra: kwargs.extra || {} }); kwargs.extra.__serialized__ = utils.serializeException(err); err = new Error(message); } else { // This handles when someone does: // throw "something awesome"; // We synthesize an Error here so we can extract a (rough) stack trace. err = new Error(err); } } var self = this; var eventId = this.generateEventId(); parsers.parseError(err, kwargs, function(kw) { self.process(eventId, kw, cb); }); return eventId; }, context: function(ctx, func) { if (!func && typeof ctx === 'function') { func = ctx; ctx = {}; } // todo/note: raven-js takes an args param to do apply(this, args) // i don't think it's correct/necessary to bind this to the wrap call // and i don't know if we need to support the args param; it's undocumented return this.wrap(ctx, func).apply(null); }, wrap: function(options, func) { if (!this.installed) { utils.consoleAlertOnce( 'Raven has not been installed, therefore no breadcrumbs will be captured. Call `Raven.config(...).install()` to fix this.' ); } if (!func && typeof options === 'function') { func = options; options = {}; } var wrapDomain = domain.create(); // todo: better property name than sentryContext, maybe __raven__ or sth? wrapDomain.sentryContext = options; wrapDomain.on('error', this.uncaughtErrorHandler); var wrapped = wrapDomain.bind(func); for (var property in func) { if ({}.hasOwnProperty.call(func, property)) { wrapped[property] = func[property]; } } wrapped.prototype = func.prototype; wrapped.__raven__ = true; wrapped.__inner__ = func; // note: domain.bind sets wrapped.domain, but it's not documented, unsure if we should rely on that wrapped.__domain__ = wrapDomain; return wrapped; }, interceptErr: function(options, func) { if (!func && typeof options === 'function') { func = options; options = {}; } var self = this; var wrapped = function() { var err = arguments[0]; if (utils.isError(err)) { self.captureException(err, options); } else { func.apply(null, arguments); } }; // repetitive with wrap for (var property in func) { if ({}.hasOwnProperty.call(func, property)) { wrapped[property] = func[property]; } } wrapped.prototype = func.prototype; wrapped.__raven__ = true; wrapped.__inner__ = func; return wrapped; }, setContext: function setContext(ctx) { if (domain.active) { domain.active.sentryContext = ctx; } else { this._globalContext = ctx; } return this; }, mergeContext: function mergeContext(ctx) { extend(this.getContext(), ctx); return this; }, getContext: function getContext() { if (domain.active) { if (!domain.active.sentryContext) { domain.active.sentryContext = {}; utils.consoleAlert('sentry context not found on active domain'); } return domain.active.sentryContext; } return this._globalContext; }, setCallbackHelper: function(propertyName, callback) { var original = this[propertyName]; if (typeof callback === 'function') { this[propertyName] = function(data) { return callback(data, original); }; } else { this[propertyName] = callback; } return this; }, /* * Set the dataCallback option * * @param {function} callback The callback to run which allows the * data blob to be mutated before sending * @return {Raven} */ setDataCallback: function(callback) { return this.setCallbackHelper('dataCallback', callback); }, /* * Set the shouldSendCallback option * * @param {function} callback The callback to run which allows * introspecting the blob before sending * @return {Raven} */ setShouldSendCallback: function(callback) { return this.setCallbackHelper('shouldSendCallback', callback); }, requestHandler: function() { var self = this; return function ravenRequestMiddleware(req, res, next) { self.context({req: req}, function() { domain.active.add(req); domain.active.add(res); next(); }); }; }, errorHandler: function() { var self = this; return function ravenErrorMiddleware(err, req, res, next) { var status = err.status || err.statusCode || err.status_code || (err.output && err.output.statusCode) || 500; // skip anything not marked as an internal server error if (status < 500) return next(err); var eventId = self.captureException(err, {req: req}); res.sentry = eventId; return next(err); }; }, captureBreadcrumb: function(breadcrumb) { // Avoid capturing global-scoped breadcrumbs before instrumentation finishes if (!this.installed) return; breadcrumb = extend( { timestamp: +new Date() / 1000 }, breadcrumb ); var currCtx = this.getContext(); if (!currCtx.breadcrumbs) currCtx.breadcrumbs = []; currCtx.breadcrumbs.push(breadcrumb); if (currCtx.breadcrumbs.length > this.maxBreadcrumbs) { currCtx.breadcrumbs.shift(); } this.setContext(currCtx); }, _createRequestObject: function() { /** * When using proxy, some of the attributes of req/request objects are non-enumerable. * To make sure, that they are still available to us after we consolidate our sources * (eg. globalContext.request + domainContext.request + kwargs.request), * we manually pull them out from original objects. * * Same scenario happens when some frameworks (eg. Koa) decide to use request within * request. eg `this.request.req`, which adds aliases to the main `request` object. * By manually reassigning them here, we don't need to add additional checks * like `req.method || (req.req && req.req.method)` * * We don't use Object.assign/extend as it's only merging over objects own properties, * and we don't want to go through all of the properties as well, as we simply don't * need all of them. **/ var sources = Array.from(arguments).filter(function(source) { return Object.prototype.toString.call(source) === '[object Object]'; }); sources = [{}].concat(sources); var request = extend.apply(null, sources); var nonEnumerables = [ 'headers', 'hostname', 'ip', 'method', 'protocol', 'query', 'secure', 'url' ]; nonEnumerables.forEach(function(key) { sources.forEach(function(source) { if (source[key]) request[key] = source[key]; }); }); /** * Check for 'host' *only* after we checked for 'hostname' first. * This way we can avoid the noise coming from Express deprecation warning * https://github.com/expressjs/express/blob/b97faff6e2aa4d34d79485fe4331cb0eec13ad57/lib/request.js#L450-L452 * REF: https://github.com/getsentry/raven-node/issues/96#issuecomment-354748884 **/ if (!request.hasOwnProperty('hostname')) { sources.forEach(function(source) { if (source.host) request.host = source.host; }); } return request; } }); // Maintain old API compat, need to make sure arguments length is preserved function Client(dsn, options) { if (dsn instanceof Client) return dsn; var ravenInstance = new Raven(); return ravenInstance.config.apply(ravenInstance, arguments); } nodeUtil.inherits(Client, Raven); // Singleton-by-default but not strictly enforced // todo these extra export props are sort of an adhoc mess, better way to manage? var defaultInstance = new Raven(); defaultInstance.Client = Client; defaultInstance.version = __webpack_require__(1215).version; defaultInstance.disableConsoleAlerts = utils.disableConsoleAlerts; module.exports = defaultInstance; /***/ }), /* 1207 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* json-stringify-safe Like JSON.stringify, but doesn't throw on circular references. Originally forked from https://github.com/isaacs/json-stringify-safe version 5.0.1 on 2017-09-21 and modified to handle Errors serialization. Tests for this are in test/vendor. ISC license: https://github.com/isaacs/json-stringify-safe/blob/master/LICENSE */ exports = module.exports = stringify; exports.getSerialize = serializer; function stringify(obj, replacer, spaces, cycleReplacer) { return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces); } // https://github.com/ftlabs/js-abbreviate/blob/fa709e5f139e7770a71827b1893f22418097fbda/index.js#L95-L106 function stringifyError(value) { var err = { // These properties are implemented as magical getters and don't show up in for in stack: value.stack, message: value.message, name: value.name }; for (var i in value) { if (Object.prototype.hasOwnProperty.call(value, i)) { err[i] = value[i]; } } return err; } function serializer(replacer, cycleReplacer) { var stack = []; var keys = []; if (cycleReplacer == null) { cycleReplacer = function(key, value) { if (stack[0] === value) { return '[Circular ~]'; } return '[Circular ~.' + keys.slice(0, stack.indexOf(value)).join('.') + ']'; }; } return function(key, value) { if (stack.length > 0) { var thisPos = stack.indexOf(this); ~thisPos ? stack.splice(thisPos + 1) : stack.push(this); ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key); if (~stack.indexOf(value)) { value = cycleReplacer.call(this, key, value); } } else { stack.push(value); } return replacer == null ? value instanceof Error ? stringifyError(value) : value : replacer.call(this, key, value); }; } /***/ }), /* 1208 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var cookie = __webpack_require__(1209); var urlParser = __webpack_require__(83); var stringify = __webpack_require__(1207); var utils = __webpack_require__(1210); module.exports.parseText = function parseText(message, kwargs) { kwargs = kwargs || {}; kwargs.message = message; return kwargs; }; module.exports.parseError = function parseError(err, kwargs, cb) { utils.parseStack(err, function(frames) { var name = ({}.hasOwnProperty.call(err, 'name') ? err.name : err.constructor.name) + ''; if (typeof kwargs.message === 'undefined') { kwargs.message = name + ': ' + (err.message || '<no message>'); } kwargs.exception = [ { type: name, value: err.message, stacktrace: { frames: frames } } ]; // Save additional error properties to `extra` under the error type (e.g. `extra.AttributeError`) var extraErrorProps; for (var key in err) { if (err.hasOwnProperty(key)) { if (key !== 'name' && key !== 'message' && key !== 'stack' && key !== 'domain') { extraErrorProps = extraErrorProps || {}; extraErrorProps[key] = err[key]; } } } if (extraErrorProps) { kwargs.extra = kwargs.extra || {}; kwargs.extra[name] = extraErrorProps; } if (!kwargs.transaction && !kwargs.culprit) { for (var n = frames.length - 1; n >= 0; n--) { if (frames[n].in_app) { kwargs.transaction = utils.getTransaction(frames[n]); break; } } } cb(kwargs); }); }; module.exports.parseRequest = function parseRequest(req, parseUser) { var kwargs = {}; // headers: // node, express: req.headers // koa: req.header var headers = req.headers || req.header || {}; // method: // node, express, koa: req.method var method = req.method; // host: // express: req.hostname in > 4 and req.host in < 4 // koa: req.host // node: req.headers.host var host = req.hostname || req.host || headers.host || '<no host>'; // protocol: // node: <n/a> // express, koa: req.protocol var protocol = req.protocol === 'https' || req.secure || (req.socket || {}).encrypted ? 'https' : 'http'; // url (including path and query string): // node, express: req.originalUrl // koa: req.url var originalUrl = req.originalUrl || req.url; // absolute url var absoluteUrl = protocol + '://' + host + originalUrl; // query string: // node: req.url (raw) // express, koa: req.query var query = req.query || urlParser.parse(originalUrl || '', true).query; // cookies: // node, express, koa: req.headers.cookie var cookies = cookie.parse(headers.cookie || ''); // body data: // node, express, koa: req.body var data = req.body; if (['GET', 'HEAD'].indexOf(method) === -1) { if (typeof data === 'undefined') { data = '<unavailable>'; } } if (data && typeof data !== 'string' && {}.toString.call(data) !== '[object String]') { // Make sure the request body is a string data = stringify(data); } // http interface var http = { method: method, query_string: query, headers: headers, cookies: cookies, data: data, url: absoluteUrl }; // expose http interface kwargs.request = http; // user: typically found on req.user in express/passport patterns // five cases for parseUser value: // absent: grab only id, username, email from req.user // false: capture nothing // true: capture all keys from req.user // array: provided whitelisted keys to grab from req.user // function :: req -> user: custom parsing function if (parseUser == null) parseUser = ['id', 'username', 'email']; if (parseUser) { var user = {}; if (typeof parseUser === 'function') { user = parseUser(req); } else if (req.user) { if (parseUser === true) { for (var key in req.user) { if ({}.hasOwnProperty.call(req.user, key)) { user[key] = req.user[key]; } } } else { parseUser.forEach(function(fieldName) { if ({}.hasOwnProperty.call(req.user, fieldName)) { user[fieldName] = req.user[fieldName]; } }); } } // client ip: // node: req.connection.remoteAddress // express, koa: req.ip var ip = req.ip || (req.connection && req.connection.remoteAddress); if (ip) { user.ip_address = ip; } kwargs.user = user; } return kwargs; }; /***/ }), /* 1209 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * cookie * Copyright(c) 2012-2014 Roman Shtylman * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module exports. * @public */ exports.parse = parse; exports.serialize = serialize; /** * Module variables. * @private */ var decode = decodeURIComponent; var encode = encodeURIComponent; var pairSplitRegExp = /; */; /** * RegExp to match field-content in RFC 7230 sec 3.2 * * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] * field-vchar = VCHAR / obs-text * obs-text = %x80-FF */ var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/; /** * Parse a cookie header. * * Parse the given cookie header string into an object * The object has the various cookies as keys(names) => values * * @param {string} str * @param {object} [options] * @return {object} * @public */ function parse(str, options) { if (typeof str !== 'string') { throw new TypeError('argument str must be a string'); } var obj = {} var opt = options || {}; var pairs = str.split(pairSplitRegExp); var dec = opt.decode || decode; for (var i = 0; i < pairs.length; i++) { var pair = pairs[i]; var eq_idx = pair.indexOf('='); // skip things that don't look like key=value if (eq_idx < 0) { continue; } var key = pair.substr(0, eq_idx).trim() var val = pair.substr(++eq_idx, pair.length).trim(); // quoted values if ('"' == val[0]) { val = val.slice(1, -1); } // only assign once if (undefined == obj[key]) { obj[key] = tryDecode(val, dec); } } return obj; } /** * Serialize data into a cookie header. * * Serialize the a name value pair into a cookie string suitable for * http headers. An optional options object specified cookie parameters. * * serialize('foo', 'bar', { httpOnly: true }) * => "foo=bar; httpOnly" * * @param {string} name * @param {string} val * @param {object} [options] * @return {string} * @public */ function serialize(name, val, options) { var opt = options || {}; var enc = opt.encode || encode; if (typeof enc !== 'function') { throw new TypeError('option encode is invalid'); } if (!fieldContentRegExp.test(name)) { throw new TypeError('argument name is invalid'); } var value = enc(val); if (value && !fieldContentRegExp.test(value)) { throw new TypeError('argument val is invalid'); } var str = name + '=' + value; if (null != opt.maxAge) { var maxAge = opt.maxAge - 0; if (isNaN(maxAge)) throw new Error('maxAge should be a Number'); str += '; Max-Age=' + Math.floor(maxAge); } if (opt.domain) { if (!fieldContentRegExp.test(opt.domain)) { throw new TypeError('option domain is invalid'); } str += '; Domain=' + opt.domain; } if (opt.path) { if (!fieldContentRegExp.test(opt.path)) { throw new TypeError('option path is invalid'); } str += '; Path=' + opt.path; } if (opt.expires) { if (typeof opt.expires.toUTCString !== 'function') { throw new TypeError('option expires is invalid'); } str += '; Expires=' + opt.expires.toUTCString(); } if (opt.httpOnly) { str += '; HttpOnly'; } if (opt.secure) { str += '; Secure'; } if (opt.sameSite) { var sameSite = typeof opt.sameSite === 'string' ? opt.sameSite.toLowerCase() : opt.sameSite; switch (sameSite) { case true: str += '; SameSite=Strict'; break; case 'lax': str += '; SameSite=Lax'; break; case 'strict': str += '; SameSite=Strict'; break; default: throw new TypeError('option sameSite is invalid'); } } return str; } /** * Try decoding a string using a decoding function. * * @param {string} str * @param {function} decode * @private */ function tryDecode(str, decode) { try { return decode(str); } catch (e) { return str; } } /***/ }), /* 1210 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var fs = __webpack_require__(167); var url = __webpack_require__(83); var transports = __webpack_require__(1211); var path = __webpack_require__(160); var lsmod = __webpack_require__(1213); var stacktrace = __webpack_require__(1214); var stringify = __webpack_require__(1207); var ravenVersion = __webpack_require__(1215).version; var protocolMap = { http: 80, https: 443 }; var consoleAlerts = new Set(); // Default Node.js REPL depth var MAX_SERIALIZE_EXCEPTION_DEPTH = 3; // 50kB, as 100kB is max payload size, so half sounds reasonable var MAX_SERIALIZE_EXCEPTION_SIZE = 50 * 1024; var MAX_SERIALIZE_KEYS_LENGTH = 40; function utf8Length(value) { return ~-encodeURI(value).split(/%..|./).length; } function jsonSize(value) { return utf8Length(JSON.stringify(value)); } function isError(what) { return ( Object.prototype.toString.call(what) === '[object Error]' || what instanceof Error ); } module.exports.isError = isError; function isPlainObject(what) { return Object.prototype.toString.call(what) === '[object Object]'; } module.exports.isPlainObject = isPlainObject; function serializeValue(value) { var maxLength = 40; if (typeof value === 'string') { return value.length <= maxLength ? value : value.substr(0, maxLength - 1) + '\u2026'; } else if ( typeof value === 'number' || typeof value === 'boolean' || typeof value === 'undefined' ) { return value; } var type = Object.prototype.toString.call(value); // Node.js REPL notation if (type === '[object Object]') return '[Object]'; if (type === '[object Array]') return '[Array]'; if (type === '[object Function]') return value.name ? '[Function: ' + value.name + ']' : '[Function]'; return value; } function serializeObject(value, depth) { if (depth === 0) return serializeValue(value); if (isPlainObject(value)) { return Object.keys(value).reduce(function(acc, key) { acc[key] = serializeObject(value[key], depth - 1); return acc; }, {}); } else if (Array.isArray(value)) { return value.map(function(val) { return serializeObject(val, depth - 1); }); } return serializeValue(value); } function serializeException(ex, depth, maxSize) { if (!isPlainObject(ex)) return ex; depth = typeof depth !== 'number' ? MAX_SERIALIZE_EXCEPTION_DEPTH : depth; maxSize = typeof depth !== 'number' ? MAX_SERIALIZE_EXCEPTION_SIZE : maxSize; var serialized = serializeObject(ex, depth); if (jsonSize(stringify(serialized)) > maxSize) { return serializeException(ex, depth - 1); } return serialized; } module.exports.serializeException = serializeException; function serializeKeysForMessage(keys, maxLength) { if (typeof keys === 'number' || typeof keys === 'string') return keys.toString(); if (!Array.isArray(keys)) return ''; keys = keys.filter(function(key) { return typeof key === 'string'; }); if (keys.length === 0) return '[object has no keys]'; maxLength = typeof maxLength !== 'number' ? MAX_SERIALIZE_KEYS_LENGTH : maxLength; if (keys[0].length >= maxLength) return keys[0]; for (var usedKeys = keys.length; usedKeys > 0; usedKeys--) { var serialized = keys.slice(0, usedKeys).join(', '); if (serialized.length > maxLength) continue; if (usedKeys === keys.length) return serialized; return serialized + '\u2026'; } return ''; } module.exports.serializeKeysForMessage = serializeKeysForMessage; module.exports.disableConsoleAlerts = function disableConsoleAlerts() { consoleAlerts = false; }; module.exports.enableConsoleAlerts = function enableConsoleAlerts() { consoleAlerts = new Set(); }; module.exports.consoleAlert = function consoleAlert(msg) { if (consoleAlerts) { console.warn('raven@' + ravenVersion + ' alert: ' + msg); } }; module.exports.consoleAlertOnce = function consoleAlertOnce(msg) { if (consoleAlerts && !consoleAlerts.has(msg)) { consoleAlerts.add(msg); console.warn('raven@' + ravenVersion + ' alert: ' + msg); } }; module.exports.extend = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; module.exports.getAuthHeader = function getAuthHeader(timestamp, apiKey, apiSecret) { var header = ['Sentry sentry_version=5']; header.push('sentry_timestamp=' + timestamp); header.push('sentry_client=raven-node/' + ravenVersion); header.push('sentry_key=' + apiKey); if (apiSecret) header.push('sentry_secret=' + apiSecret); return header.join(', '); }; module.exports.parseDSN = function parseDSN(dsn) { if (!dsn) { // Let a falsey value return false explicitly return false; } try { var parsed = url.parse(dsn), response = { protocol: parsed.protocol.slice(0, -1), public_key: parsed.auth.split(':')[0], host: parsed.host.split(':')[0] }; if (parsed.auth.split(':')[1]) { response.private_key = parsed.auth.split(':')[1]; } if (~response.protocol.indexOf('+')) { response.protocol = response.protocol.split('+')[1]; } if (!transports.hasOwnProperty(response.protocol)) { throw new Error('Invalid transport'); } var index = parsed.pathname.lastIndexOf('/'); response.path = parsed.pathname.substr(0, index + 1); response.project_id = parsed.pathname.substr(index + 1); response.port = ~~parsed.port || protocolMap[response.protocol] || 443; return response; } catch (e) { throw new Error('Invalid Sentry DSN: ' + dsn); } }; module.exports.getTransaction = function getTransaction(frame) { if (frame.module || frame.function) { return (frame.module || '?') + ' at ' + (frame.function || '?'); } return '<unknown>'; }; var moduleCache; module.exports.getModules = function getModules() { if (!moduleCache) { moduleCache = lsmod(); } return moduleCache; }; module.exports.fill = function(obj, name, replacement, track) { var orig = obj[name]; obj[name] = replacement(orig); if (track) { track.push([obj, name, orig]); } }; var LINES_OF_CONTEXT = 7; function getFunction(line) { try { return ( line.getFunctionName() || line.getTypeName() + '.' + (line.getMethodName() || '<anonymous>') ); } catch (e) { // This seems to happen sometimes when using 'use strict', // stemming from `getTypeName`. // [TypeError: Cannot read property 'constructor' of undefined] return '<anonymous>'; } } var mainModule = ((__webpack_require__.c[__webpack_require__.s] && __webpack_require__.c[__webpack_require__.s].filename && path.dirname(__webpack_require__.c[__webpack_require__.s].filename)) || global.process.cwd()) + '/'; function getModule(filename, base) { if (!base) base = mainModule; // It's specifically a module var file = path.basename(filename, '.js'); filename = path.dirname(filename); var n = filename.lastIndexOf('/node_modules/'); if (n > -1) { // /node_modules/ is 14 chars return filename.substr(n + 14).replace(/\//g, '.') + ':' + file; } // Let's see if it's a part of the main module // To be a part of main module, it has to share the same base n = (filename + '/').lastIndexOf(base, 0); if (n === 0) { var module = filename.substr(base.length).replace(/\//g, '.'); if (module) module += ':'; module += file; return module; } return file; } function readSourceFiles(filenames, cb) { // we're relying on filenames being de-duped already if (filenames.length === 0) return setTimeout(cb, 0, {}); var sourceFiles = {}; var numFilesToRead = filenames.length; return filenames.forEach(function(filename) { fs.readFile(filename, function(readErr, file) { if (!readErr) sourceFiles[filename] = file.toString().split('\n'); if (--numFilesToRead === 0) cb(sourceFiles); }); }); } // This is basically just `trim_line` from https://github.com/getsentry/sentry/blob/master/src/sentry/lang/javascript/processor.py#L67 function snipLine(line, colno) { var ll = line.length; if (ll <= 150) return line; if (colno > ll) colno = ll; var start = Math.max(colno - 60, 0); if (start < 5) start = 0; var end = Math.min(start + 140, ll); if (end > ll - 5) end = ll; if (end === ll) start = Math.max(end - 140, 0); line = line.slice(start, end); if (start > 0) line = '{snip} ' + line; if (end < ll) line += ' {snip}'; return line; } function snipLine0(line) { return snipLine(line, 0); } function parseStack(err, cb) { if (!err) return cb([]); var stack = stacktrace.parse(err); if (!stack || !Array.isArray(stack) || !stack.length || !stack[0].getFileName) { // the stack is not the useful thing we were expecting :/ return cb([]); } // Sentry expects the stack trace to be oldest -> newest, v8 provides newest -> oldest stack.reverse(); var frames = []; var filesToRead = {}; stack.forEach(function(line) { var frame = { filename: line.getFileName() || '', lineno: line.getLineNumber(), colno: line.getColumnNumber(), function: getFunction(line) }; var isInternal = line.isNative() || (frame.filename[0] !== '/' && frame.filename[0] !== '.' && frame.filename.indexOf(':\\') !== 1); // in_app is all that's not an internal Node function or a module within node_modules // note that isNative appears to return true even for node core libraries // see https://github.com/getsentry/raven-node/issues/176 frame.in_app = !isInternal && frame.filename.indexOf('node_modules/') === -1; // Extract a module name based on the filename if (frame.filename) { frame.module = getModule(frame.filename); if (!isInternal) filesToRead[frame.filename] = true; } frames.push(frame); }); return readSourceFiles(Object.keys(filesToRead), function(sourceFiles) { frames.forEach(function(frame) { if (frame.filename && sourceFiles[frame.filename]) { var lines = sourceFiles[frame.filename]; try { frame.pre_context = lines .slice(Math.max(0, frame.lineno - (LINES_OF_CONTEXT + 1)), frame.lineno - 1) .map(snipLine0); frame.context_line = snipLine(lines[frame.lineno - 1], frame.colno); frame.post_context = lines .slice(frame.lineno, frame.lineno + LINES_OF_CONTEXT) .map(snipLine0); } catch (e) { // anomaly, being defensive in case // unlikely to ever happen in practice but can definitely happen in theory } } }); cb(frames); }); } // expose basically for testing because I don't know what I'm doing module.exports.parseStack = parseStack; module.exports.getModule = getModule; /***/ }), /* 1211 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var events = __webpack_require__(268); var util = __webpack_require__(9); var timeoutReq = __webpack_require__(1212); var http = __webpack_require__(98); var https = __webpack_require__(99); var agentOptions = {keepAlive: true, maxSockets: 100}; var httpAgent = new http.Agent(agentOptions); var httpsAgent = new https.Agent(agentOptions); function Transport() {} util.inherits(Transport, events.EventEmitter); function HTTPTransport(options) { this.defaultPort = 80; this.transport = http; this.options = options || {}; this.agent = httpAgent; } util.inherits(HTTPTransport, Transport); HTTPTransport.prototype.send = function(client, message, headers, eventId, cb) { var options = { hostname: client.dsn.host, path: client.dsn.path + 'api/' + client.dsn.project_id + '/store/', headers: headers, method: 'POST', port: client.dsn.port || this.defaultPort, ca: client.ca, agent: this.agent }; for (var key in this.options) { if (this.options.hasOwnProperty(key)) { options[key] = this.options[key]; } } // prevent off heap memory explosion var _name = this.agent.getName({host: client.dsn.host, port: client.dsn.port}); var _requests = this.agent.requests[_name]; if (_requests && Object.keys(_requests).length > client.maxReqQueueCount) { // other feedback strategy client.emit('error', new Error('client req queue is full..')); return; } var req = this.transport.request(options, function(res) { res.setEncoding('utf8'); if (res.statusCode >= 200 && res.statusCode < 300) { client.emit('logged', eventId); cb && cb(null, eventId); } else { var reason = res.headers['x-sentry-error']; var e = new Error('HTTP Error (' + res.statusCode + '): ' + reason); e.response = res; e.statusCode = res.statusCode; e.reason = reason; e.sendMessage = message; e.requestHeaders = headers; e.eventId = eventId; client.emit('error', e); cb && cb(e); } // force the socket to drain var noop = function() {}; res.on('data', noop); res.on('end', noop); }); timeoutReq(req, client.sendTimeout * 1000); var cbFired = false; req.on('error', function(e) { client.emit('error', e); if (!cbFired) { cb && cb(e); cbFired = true; } }); req.end(message); }; function HTTPSTransport(options) { this.defaultPort = 443; this.transport = https; this.options = options || {}; this.agent = httpsAgent; } util.inherits(HTTPSTransport, HTTPTransport); module.exports.http = new HTTPTransport(); module.exports.https = new HTTPSTransport(); module.exports.Transport = Transport; module.exports.HTTPTransport = HTTPTransport; module.exports.HTTPSTransport = HTTPSTransport; /***/ }), /* 1212 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function (req, time) { if (req.timeoutTimer) { return req; } var delays = isNaN(time) ? time : {socket: time, connect: time}; var host = req._headers ? (' to ' + req._headers.host) : ''; if (delays.connect !== undefined) { req.timeoutTimer = setTimeout(function timeoutHandler() { req.abort(); var e = new Error('Connection timed out on request' + host); e.code = 'ETIMEDOUT'; req.emit('error', e); }, delays.connect); } // Clear the connection timeout timer once a socket is assigned to the // request and is connected. req.on('socket', function assign(socket) { // Socket may come from Agent pool and may be already connected. if (!(socket.connecting || socket._connecting)) { connect(); return; } socket.once('connect', connect); }); function clear() { if (req.timeoutTimer) { clearTimeout(req.timeoutTimer); req.timeoutTimer = null; } } function connect() { clear(); if (delays.socket !== undefined) { // Abort the request if there is no activity on the socket for more // than `delays.socket` milliseconds. req.setTimeout(delays.socket, function socketTimeoutHandler() { req.abort(); var e = new Error('Socket timed out on request' + host); e.code = 'ESOCKETTIMEDOUT'; req.emit('error', e); }); } } return req.on('error', clear); }; /***/ }), /* 1213 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Original repository: https://github.com/defunctzombie/node-lsmod/ // // [2018-02-09] @kamilogorek - Handle scoped packages structure // builtin var fs = __webpack_require__(167); var path = __webpack_require__(160); // node 0.6 support fs.existsSync = fs.existsSync || path.existsSync; // mainPaths are the paths where our mainprog will be able to load from // we store these to avoid grabbing the modules that were loaded as a result // of a dependency module loading its dependencies, we only care about deps our // mainprog loads var mainPaths = (__webpack_require__.c[__webpack_require__.s] && __webpack_require__.c[__webpack_require__.s].paths) || []; module.exports = function() { var paths = Object.keys(__webpack_require__.c || []); // module information var infos = {}; // paths we have already inspected to avoid traversing again var seen = {}; paths.forEach(function(p) { /* eslint-disable consistent-return */ var dir = p; (function updir() { var orig = dir; dir = path.dirname(orig); if (/@[^/]+$/.test(dir)) { dir = path.dirname(dir); } if (!dir || orig === dir || seen[orig]) { return; } else if (mainPaths.indexOf(dir) < 0) { return updir(); } var pkgfile = path.join(orig, 'package.json'); var exists = fs.existsSync(pkgfile); seen[orig] = true; // travel up the tree if no package.json here if (!exists) { return updir(); } try { var info = JSON.parse(fs.readFileSync(pkgfile, 'utf8')); infos[info.name] = info.version; } catch (e) {} })(); /* eslint-enable consistent-return */ }); return infos; }; /***/ }), /* 1214 */ /***/ (function(module, exports) { exports.get = function(belowFn) { var oldLimit = Error.stackTraceLimit; Error.stackTraceLimit = Infinity; var dummyObject = {}; var v8Handler = Error.prepareStackTrace; Error.prepareStackTrace = function(dummyObject, v8StackTrace) { return v8StackTrace; }; Error.captureStackTrace(dummyObject, belowFn || exports.get); var v8StackTrace = dummyObject.stack; Error.prepareStackTrace = v8Handler; Error.stackTraceLimit = oldLimit; return v8StackTrace; }; exports.parse = function(err) { if (!err.stack) { return []; } var self = this; var lines = err.stack.split('\n').slice(1); return lines .map(function(line) { if (line.match(/^\s*[-]{4,}$/)) { return self._createParsedCallSite({ fileName: line, lineNumber: null, functionName: null, typeName: null, methodName: null, columnNumber: null, 'native': null, }); } var lineMatch = line.match(/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/); if (!lineMatch) { return; } var object = null; var method = null; var functionName = null; var typeName = null; var methodName = null; var isNative = (lineMatch[5] === 'native'); if (lineMatch[1]) { functionName = lineMatch[1]; var methodStart = functionName.lastIndexOf('.'); if (functionName[methodStart-1] == '.') methodStart--; if (methodStart > 0) { object = functionName.substr(0, methodStart); method = functionName.substr(methodStart + 1); var objectEnd = object.indexOf('.Module'); if (objectEnd > 0) { functionName = functionName.substr(objectEnd + 1); object = object.substr(0, objectEnd); } } typeName = null; } if (method) { typeName = object; methodName = method; } if (method === '<anonymous>') { methodName = null; functionName = null; } var properties = { fileName: lineMatch[2] || null, lineNumber: parseInt(lineMatch[3], 10) || null, functionName: functionName, typeName: typeName, methodName: methodName, columnNumber: parseInt(lineMatch[4], 10) || null, 'native': isNative, }; return self._createParsedCallSite(properties); }) .filter(function(callSite) { return !!callSite; }); }; function CallSite(properties) { for (var property in properties) { this[property] = properties[property]; } } var strProperties = [ 'this', 'typeName', 'functionName', 'methodName', 'fileName', 'lineNumber', 'columnNumber', 'function', 'evalOrigin' ]; var boolProperties = [ 'topLevel', 'eval', 'native', 'constructor' ]; strProperties.forEach(function (property) { CallSite.prototype[property] = null; CallSite.prototype['get' + property[0].toUpperCase() + property.substr(1)] = function () { return this[property]; } }); boolProperties.forEach(function (property) { CallSite.prototype[property] = false; CallSite.prototype['is' + property[0].toUpperCase() + property.substr(1)] = function () { return this[property]; } }); exports._createParsedCallSite = function(properties) { return new CallSite(properties); }; /***/ }), /* 1215 */ /***/ (function(module) { module.exports = JSON.parse("{\"name\":\"raven\",\"description\":\"A standalone (Node.js) client for Sentry\",\"keywords\":[\"debugging\",\"errors\",\"exceptions\",\"logging\",\"raven\",\"sentry\"],\"version\":\"2.6.4\",\"repository\":\"git://github.com/getsentry/raven-js.git\",\"license\":\"BSD-2-Clause\",\"homepage\":\"https://github.com/getsentry/raven-js\",\"author\":\"Matt Robenolt <matt@ydekproductions.com>\",\"main\":\"index.js\",\"bin\":{\"raven\":\"./bin/raven\"},\"scripts\":{\"lint\":\"eslint .\",\"test\":\"NODE_ENV=test istanbul cover _mocha -- --reporter dot && NODE_ENV=test coffee ./test/run.coffee\",\"test-mocha\":\"NODE_ENV=test mocha\",\"test-full\":\"npm run test && cd test/instrumentation && ./run.sh\"},\"engines\":{\"node\":\">= 4.0.0\"},\"dependencies\":{\"cookie\":\"0.3.1\",\"md5\":\"^2.2.1\",\"stack-trace\":\"0.0.10\",\"timed-out\":\"4.0.1\",\"uuid\":\"3.3.2\"},\"devDependencies\":{\"coffee-script\":\"~1.10.0\",\"connect\":\"*\",\"eslint\":\"^4.5.0\",\"eslint-config-prettier\":\"^2.3.0\",\"express\":\"*\",\"glob\":\"~3.1.13\",\"istanbul\":\"^0.4.3\",\"mocha\":\"~3.1.2\",\"nock\":\"~9.0.0\",\"prettier\":\"^1.6.1\",\"should\":\"11.2.0\",\"sinon\":\"^3.3.0\"},\"prettier\":{\"singleQuote\":true,\"bracketSpacing\":false,\"printWidth\":90}}"); /***/ }), /* 1216 */ /***/ (function(module, exports, __webpack_require__) { var v1 = __webpack_require__(1217); var v4 = __webpack_require__(1220); var uuid = v4; uuid.v1 = v1; uuid.v4 = v4; module.exports = uuid; /***/ }), /* 1217 */ /***/ (function(module, exports, __webpack_require__) { var rng = __webpack_require__(1218); var bytesToUuid = __webpack_require__(1219); // **`v1()` - Generate time-based UUID** // // Inspired by https://github.com/LiosK/UUID.js // and http://docs.python.org/library/uuid.html var _nodeId; var _clockseq; // Previous uuid creation time var _lastMSecs = 0; var _lastNSecs = 0; // See https://github.com/broofa/node-uuid for API details function v1(options, buf, offset) { var i = buf && offset || 0; var b = buf || []; options = options || {}; var node = options.node || _nodeId; var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not // specified. We do this lazily to minimize issues related to insufficient // system entropy. See #189 if (node == null || clockseq == null) { var seedBytes = rng(); if (node == null) { // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) node = _nodeId = [ seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5] ]; } if (clockseq == null) { // Per 4.2.2, randomize (14 bit) clockseq clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; } } // UUID timestamps are 100 nano-second units since the Gregorian epoch, // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime(); // Per 4.2.1.2, use count of uuid's generated during the current clock // cycle to simulate higher resolution clock var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000; // Per 4.2.1.2, Bump clockseq on clock regression if (dt < 0 && options.clockseq === undefined) { clockseq = clockseq + 1 & 0x3fff; } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new // time interval if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { nsecs = 0; } // Per 4.2.1.2 Throw error if too many uuids are requested if (nsecs >= 10000) { throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec'); } _lastMSecs = msecs; _lastNSecs = nsecs; _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch msecs += 12219292800000; // `time_low` var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; b[i++] = tl >>> 24 & 0xff; b[i++] = tl >>> 16 & 0xff; b[i++] = tl >>> 8 & 0xff; b[i++] = tl & 0xff; // `time_mid` var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff; b[i++] = tmh >>> 8 & 0xff; b[i++] = tmh & 0xff; // `time_high_and_version` b[i++] = tmh >>> 24 & 0xf | 0x10; // include version b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` b[i++] = clockseq & 0xff; // `node` for (var n = 0; n < 6; ++n) { b[i + n] = node[n]; } return buf ? buf : bytesToUuid(b); } module.exports = v1; /***/ }), /* 1218 */ /***/ (function(module, exports, __webpack_require__) { // Unique ID creation requires a high quality random # generator. In node.js // this is pretty straight-forward - we use the crypto API. var crypto = __webpack_require__(94); module.exports = function nodeRNG() { return crypto.randomBytes(16); }; /***/ }), /* 1219 */ /***/ (function(module, exports) { /** * Convert array of 16 byte values to UUID string format of the form: * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */ var byteToHex = []; for (var i = 0; i < 256; ++i) { byteToHex[i] = (i + 0x100).toString(16).substr(1); } function bytesToUuid(buf, offset) { var i = offset || 0; var bth = byteToHex; // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4 return ([bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]]]).join(''); } module.exports = bytesToUuid; /***/ }), /* 1220 */ /***/ (function(module, exports, __webpack_require__) { var rng = __webpack_require__(1218); var bytesToUuid = __webpack_require__(1219); function v4(options, buf, offset) { var i = buf && offset || 0; if (typeof(options) == 'string') { buf = options === 'binary' ? new Array(16) : null; options = null; } options = options || {}; var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` rnds[6] = (rnds[6] & 0x0f) | 0x40; rnds[8] = (rnds[8] & 0x3f) | 0x80; // Copy bytes to buffer, if provided if (buf) { for (var ii = 0; ii < 16; ++ii) { buf[i + ii] = rnds[ii]; } } return buf || bytesToUuid(rnds); } module.exports = v4; /***/ }), /* 1221 */ /***/ (function(module, exports) { module.exports = require("domain"); /***/ }), /* 1222 */ /***/ (function(module, exports, __webpack_require__) { (function(){ var crypt = __webpack_require__(1223), utf8 = __webpack_require__(1224).utf8, isBuffer = __webpack_require__(1225), bin = __webpack_require__(1224).bin, // The core md5 = function (message, options) { // Convert to byte array if (message.constructor == String) if (options && options.encoding === 'binary') message = bin.stringToBytes(message); else message = utf8.stringToBytes(message); else if (isBuffer(message)) message = Array.prototype.slice.call(message, 0); else if (!Array.isArray(message)) message = message.toString(); // else, assume byte array already var m = crypt.bytesToWords(message), l = message.length * 8, a = 1732584193, b = -271733879, c = -1732584194, d = 271733878; // Swap endian for (var i = 0; i < m.length; i++) { m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF | ((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00; } // Padding m[l >>> 5] |= 0x80 << (l % 32); m[(((l + 64) >>> 9) << 4) + 14] = l; // Method shortcuts var FF = md5._ff, GG = md5._gg, HH = md5._hh, II = md5._ii; for (var i = 0; i < m.length; i += 16) { var aa = a, bb = b, cc = c, dd = d; a = FF(a, b, c, d, m[i+ 0], 7, -680876936); d = FF(d, a, b, c, m[i+ 1], 12, -389564586); c = FF(c, d, a, b, m[i+ 2], 17, 606105819); b = FF(b, c, d, a, m[i+ 3], 22, -1044525330); a = FF(a, b, c, d, m[i+ 4], 7, -176418897); d = FF(d, a, b, c, m[i+ 5], 12, 1200080426); c = FF(c, d, a, b, m[i+ 6], 17, -1473231341); b = FF(b, c, d, a, m[i+ 7], 22, -45705983); a = FF(a, b, c, d, m[i+ 8], 7, 1770035416); d = FF(d, a, b, c, m[i+ 9], 12, -1958414417); c = FF(c, d, a, b, m[i+10], 17, -42063); b = FF(b, c, d, a, m[i+11], 22, -1990404162); a = FF(a, b, c, d, m[i+12], 7, 1804603682); d = FF(d, a, b, c, m[i+13], 12, -40341101); c = FF(c, d, a, b, m[i+14], 17, -1502002290); b = FF(b, c, d, a, m[i+15], 22, 1236535329); a = GG(a, b, c, d, m[i+ 1], 5, -165796510); d = GG(d, a, b, c, m[i+ 6], 9, -1069501632); c = GG(c, d, a, b, m[i+11], 14, 643717713); b = GG(b, c, d, a, m[i+ 0], 20, -373897302); a = GG(a, b, c, d, m[i+ 5], 5, -701558691); d = GG(d, a, b, c, m[i+10], 9, 38016083); c = GG(c, d, a, b, m[i+15], 14, -660478335); b = GG(b, c, d, a, m[i+ 4], 20, -405537848); a = GG(a, b, c, d, m[i+ 9], 5, 568446438); d = GG(d, a, b, c, m[i+14], 9, -1019803690); c = GG(c, d, a, b, m[i+ 3], 14, -187363961); b = GG(b, c, d, a, m[i+ 8], 20, 1163531501); a = GG(a, b, c, d, m[i+13], 5, -1444681467); d = GG(d, a, b, c, m[i+ 2], 9, -51403784); c = GG(c, d, a, b, m[i+ 7], 14, 1735328473); b = GG(b, c, d, a, m[i+12], 20, -1926607734); a = HH(a, b, c, d, m[i+ 5], 4, -378558); d = HH(d, a, b, c, m[i+ 8], 11, -2022574463); c = HH(c, d, a, b, m[i+11], 16, 1839030562); b = HH(b, c, d, a, m[i+14], 23, -35309556); a = HH(a, b, c, d, m[i+ 1], 4, -1530992060); d = HH(d, a, b, c, m[i+ 4], 11, 1272893353); c = HH(c, d, a, b, m[i+ 7], 16, -155497632); b = HH(b, c, d, a, m[i+10], 23, -1094730640); a = HH(a, b, c, d, m[i+13], 4, 681279174); d = HH(d, a, b, c, m[i+ 0], 11, -358537222); c = HH(c, d, a, b, m[i+ 3], 16, -722521979); b = HH(b, c, d, a, m[i+ 6], 23, 76029189); a = HH(a, b, c, d, m[i+ 9], 4, -640364487); d = HH(d, a, b, c, m[i+12], 11, -421815835); c = HH(c, d, a, b, m[i+15], 16, 530742520); b = HH(b, c, d, a, m[i+ 2], 23, -995338651); a = II(a, b, c, d, m[i+ 0], 6, -198630844); d = II(d, a, b, c, m[i+ 7], 10, 1126891415); c = II(c, d, a, b, m[i+14], 15, -1416354905); b = II(b, c, d, a, m[i+ 5], 21, -57434055); a = II(a, b, c, d, m[i+12], 6, 1700485571); d = II(d, a, b, c, m[i+ 3], 10, -1894986606); c = II(c, d, a, b, m[i+10], 15, -1051523); b = II(b, c, d, a, m[i+ 1], 21, -2054922799); a = II(a, b, c, d, m[i+ 8], 6, 1873313359); d = II(d, a, b, c, m[i+15], 10, -30611744); c = II(c, d, a, b, m[i+ 6], 15, -1560198380); b = II(b, c, d, a, m[i+13], 21, 1309151649); a = II(a, b, c, d, m[i+ 4], 6, -145523070); d = II(d, a, b, c, m[i+11], 10, -1120210379); c = II(c, d, a, b, m[i+ 2], 15, 718787259); b = II(b, c, d, a, m[i+ 9], 21, -343485551); a = (a + aa) >>> 0; b = (b + bb) >>> 0; c = (c + cc) >>> 0; d = (d + dd) >>> 0; } return crypt.endian([a, b, c, d]); }; // Auxiliary functions md5._ff = function (a, b, c, d, x, s, t) { var n = a + (b & c | ~b & d) + (x >>> 0) + t; return ((n << s) | (n >>> (32 - s))) + b; }; md5._gg = function (a, b, c, d, x, s, t) { var n = a + (b & d | c & ~d) + (x >>> 0) + t; return ((n << s) | (n >>> (32 - s))) + b; }; md5._hh = function (a, b, c, d, x, s, t) { var n = a + (b ^ c ^ d) + (x >>> 0) + t; return ((n << s) | (n >>> (32 - s))) + b; }; md5._ii = function (a, b, c, d, x, s, t) { var n = a + (c ^ (b | ~d)) + (x >>> 0) + t; return ((n << s) | (n >>> (32 - s))) + b; }; // Package private blocksize md5._blocksize = 16; md5._digestsize = 16; module.exports = function (message, options) { if (message === undefined || message === null) throw new Error('Illegal argument ' + message); var digestbytes = crypt.wordsToBytes(md5(message, options)); return options && options.asBytes ? digestbytes : options && options.asString ? bin.bytesToString(digestbytes) : crypt.bytesToHex(digestbytes); }; })(); /***/ }), /* 1223 */ /***/ (function(module, exports) { (function() { var base64map = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', crypt = { // Bit-wise rotation left rotl: function(n, b) { return (n << b) | (n >>> (32 - b)); }, // Bit-wise rotation right rotr: function(n, b) { return (n << (32 - b)) | (n >>> b); }, // Swap big-endian to little-endian and vice versa endian: function(n) { // If number given, swap endian if (n.constructor == Number) { return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00; } // Else, assume array and swap all items for (var i = 0; i < n.length; i++) n[i] = crypt.endian(n[i]); return n; }, // Generate an array of any length of random bytes randomBytes: function(n) { for (var bytes = []; n > 0; n--) bytes.push(Math.floor(Math.random() * 256)); return bytes; }, // Convert a byte array to big-endian 32-bit words bytesToWords: function(bytes) { for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8) words[b >>> 5] |= bytes[i] << (24 - b % 32); return words; }, // Convert big-endian 32-bit words to a byte array wordsToBytes: function(words) { for (var bytes = [], b = 0; b < words.length * 32; b += 8) bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF); return bytes; }, // Convert a byte array to a hex string bytesToHex: function(bytes) { for (var hex = [], i = 0; i < bytes.length; i++) { hex.push((bytes[i] >>> 4).toString(16)); hex.push((bytes[i] & 0xF).toString(16)); } return hex.join(''); }, // Convert a hex string to a byte array hexToBytes: function(hex) { for (var bytes = [], c = 0; c < hex.length; c += 2) bytes.push(parseInt(hex.substr(c, 2), 16)); return bytes; }, // Convert a byte array to a base-64 string bytesToBase64: function(bytes) { for (var base64 = [], i = 0; i < bytes.length; i += 3) { var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2]; for (var j = 0; j < 4; j++) if (i * 8 + j * 6 <= bytes.length * 8) base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F)); else base64.push('='); } return base64.join(''); }, // Convert a base-64 string to a byte array base64ToBytes: function(base64) { // Remove non-base-64 characters base64 = base64.replace(/[^A-Z0-9+\/]/ig, ''); for (var bytes = [], i = 0, imod4 = 0; i < base64.length; imod4 = ++i % 4) { if (imod4 == 0) continue; bytes.push(((base64map.indexOf(base64.charAt(i - 1)) & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2)) | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2))); } return bytes; } }; module.exports = crypt; })(); /***/ }), /* 1224 */ /***/ (function(module, exports) { var charenc = { // UTF-8 encoding utf8: { // Convert a string to a byte array stringToBytes: function(str) { return charenc.bin.stringToBytes(unescape(encodeURIComponent(str))); }, // Convert a byte array to a string bytesToString: function(bytes) { return decodeURIComponent(escape(charenc.bin.bytesToString(bytes))); } }, // Binary encoding bin: { // Convert a string to a byte array stringToBytes: function(str) { for (var bytes = [], i = 0; i < str.length; i++) bytes.push(str.charCodeAt(i) & 0xFF); return bytes; }, // Convert a byte array to a string bytesToString: function(bytes) { for (var str = [], i = 0; i < bytes.length; i++) str.push(String.fromCharCode(bytes[i])); return str.join(''); } } }; module.exports = charenc; /***/ }), /* 1225 */ /***/ (function(module, exports) { /*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh <https://feross.org> * @license MIT */ // The _isBuffer check is for Safari 5-7 support, because it's missing // Object.prototype.constructor. Remove this eventually module.exports = function (obj) { return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer) } function isBuffer (obj) { return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) } // For Node v0.10 support. Remove this eventually. function isSlowBuffer (obj) { return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) } /***/ }), /* 1226 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var utils = __webpack_require__(1210); var defaultOnConfig = { console: true, http: true }; var defaultConfig = { console: false, http: false, pg: false }; function instrument(Raven, config) { if (config === false) { return; } else if (config === true) { config = defaultOnConfig; } else { config = utils.extend({}, defaultConfig, config); } Raven.instrumentedOriginals = []; Raven.instrumentedModules = []; var Module = __webpack_require__(1227); utils.fill( Module, '_load', function(origLoad) { return function(moduleId, parent, isMain) { var origModule = origLoad.apply(this, arguments); if (config[moduleId] && Raven.instrumentedModules.indexOf(moduleId) === -1) { Raven.instrumentedModules.push(moduleId); return __webpack_require__(1228)("./" + moduleId)(Raven, origModule, Raven.instrumentedOriginals); } return origModule; }; }, Raven.instrumentedOriginals ); // special case: since console is built-in and app-level code won't require() it, do that here if (config.console) { __webpack_require__(1232); } // observation: when the https module does its own require('http'), it *does not* hit our hooked require to instrument http on the fly // but if we've previously instrumented http, https *does* get our already-instrumented version // this is because raven's transports are required before this instrumentation takes place, which loads https (and http) // so module cache will have uninstrumented http; proactively loading it here ensures instrumented version is in module cache // alternatively we could refactor to load our transports later, but this is easier and doesn't have much drawback if (config.http) { __webpack_require__(98); } } function deinstrument(Raven) { if (!Raven.instrumentedOriginals) return; var original; // eslint-disable-next-line no-cond-assign while ((original = Raven.instrumentedOriginals.shift())) { var obj = original[0]; var name = original[1]; var orig = original[2]; obj[name] = orig; } } module.exports = { instrument: instrument, deinstrument: deinstrument }; /***/ }), /* 1227 */ /***/ (function(module, exports) { module.exports = require("module"); /***/ }), /* 1228 */ /***/ (function(module, exports, __webpack_require__) { var map = { "./console": 1229, "./console.js": 1229, "./http": 1230, "./http.js": 1230, "./instrumentor": 1226, "./instrumentor.js": 1226, "./pg": 1231, "./pg.js": 1231 }; function webpackContext(req) { var id = webpackContextResolve(req); return __webpack_require__(id); } function webpackContextResolve(req) { if(!__webpack_require__.o(map, req)) { var e = new Error("Cannot find module '" + req + "'"); e.code = 'MODULE_NOT_FOUND'; throw e; } return map[req]; } webpackContext.keys = function webpackContextKeys() { return Object.keys(map); }; webpackContext.resolve = webpackContextResolve; module.exports = webpackContext; webpackContext.id = 1228; /***/ }), /* 1229 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(9); var utils = __webpack_require__(1210); module.exports = function(Raven, console, originals) { var wrapConsoleMethod = function(level) { if (!(level in console)) { return; } utils.fill( console, level, function(originalConsoleLevel) { var sentryLevel = level === 'warn' ? 'warning' : level; return function() { var args = [].slice.call(arguments); Raven.captureBreadcrumb({ message: util.format.apply(null, args), level: sentryLevel, category: 'console' }); originalConsoleLevel.apply(console, args); }; }, originals ); }; ['debug', 'info', 'warn', 'error', 'log'].forEach(wrapConsoleMethod); return console; }; /***/ }), /* 1230 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(9); var utils = __webpack_require__(1210); module.exports = function(Raven, http, originals) { var OrigClientRequest = http.ClientRequest; var ClientRequest = function(options, cb) { // Note: this won't capture a breadcrumb if a response never comes // It would be useful to know if that was the case, though, so // todo: revisit to see if we can capture sth indicating response never came // possibility: capture one breadcrumb for "req sent" and one for "res recvd" // seems excessive but solves the problem and *is* strictly more information // could be useful for weird response sequencing bug scenarios OrigClientRequest.call(this, options, cb); // We could just always reconstruct this from this.agent, this._headers, this.path, etc // but certain other http-instrumenting libraries (like nock, which we use for tests) fail to // maintain the guarantee that after calling OrigClientRequest, those fields will be populated if (typeof options === 'string') { this.__ravenBreadcrumbUrl = options; } else { var protocol = options.protocol || ''; var hostname = options.hostname || options.host || ''; // Don't log standard :80 (http) and :443 (https) ports to reduce the noise var port = !options.port || options.port === 80 || options.port === 443 ? '' : ':' + options.port; var path = options.path || '/'; this.__ravenBreadcrumbUrl = protocol + '//' + hostname + port + path; } }; util.inherits(ClientRequest, OrigClientRequest); utils.fill(ClientRequest.prototype, 'emit', function(origEmit) { return function(evt, maybeResp) { if (evt === 'response' && this.__ravenBreadcrumbUrl) { if (!Raven.dsn || this.__ravenBreadcrumbUrl.indexOf(Raven.dsn.host) === -1) { Raven.captureBreadcrumb({ type: 'http', category: 'http', data: { method: this.method, url: this.__ravenBreadcrumbUrl, status_code: maybeResp.statusCode } }); } } return origEmit.apply(this, arguments); }; }); utils.fill( http, 'ClientRequest', function() { return ClientRequest; }, originals ); // http.request orig refs module-internal ClientRequest, not exported one, so // it still points at orig ClientRequest after our monkeypatch; these reimpls // just get that reference updated to use our new ClientRequest utils.fill( http, 'request', function() { return function(options, cb) { return new http.ClientRequest(options, cb); }; }, originals ); utils.fill( http, 'get', function() { return function(options, cb) { var req = http.request(options, cb); req.end(); return req; }; }, originals ); return http; }; /***/ }), /* 1231 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function(Raven, pg, originals) { // Using fill helper here is hard because of `this` binding var origQuery = pg.Connection.prototype.query; pg.Connection.prototype.query = function(text) { Raven.captureBreadcrumb({ category: 'postgres', message: text }); origQuery.call(this, text); }; // todo thread this through // originals.push([pg.Connection.prototype, 'query', origQuery]); }; /***/ }), /* 1232 */ /***/ (function(module, exports) { module.exports = require("console"); /***/ }), /* 1233 */ /***/ (function(module, exports) { const DOMAIN_REGEXP = /^https?:\/\/([a-zA-Z0-9-.]+)(?::\d{2,5})?\/?$/; const getDomain = cozyUrl => { cozyUrl = cozyUrl || process.env.COZY_URL; return cozyUrl.match(DOMAIN_REGEXP)[1].split('.').slice(-2).join('.'); }; const getInstance = cozyUrl => { cozyUrl = cozyUrl || process.env.COZY_URL; return cozyUrl.match(DOMAIN_REGEXP)[1].split('.').slice(-3).join('.'); }; module.exports = { getDomain, getInstance }; /***/ }), /* 1234 */ /***/ (function(module, exports, __webpack_require__) { var before = __webpack_require__(1235); /** * Creates a function that is restricted to invoking `func` once. Repeat calls * to the function return the value of the first invocation. The `func` is * invoked with the `this` binding and arguments of the created function. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. * @example * * var initialize = _.once(createApplication); * initialize(); * initialize(); * // => `createApplication` is invoked once */ function once(func) { return before(2, func); } module.exports = once; /***/ }), /* 1235 */ /***/ (function(module, exports, __webpack_require__) { var toInteger = __webpack_require__(454); /** Error message constants. */ var FUNC_ERROR_TEXT = 'Expected a function'; /** * Creates a function that invokes `func`, with the `this` binding and arguments * of the created function, while it's called less than `n` times. Subsequent * calls to the created function return the result of the last `func` invocation. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {number} n The number of calls at which `func` is no longer invoked. * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. * @example * * jQuery(element).on('click', _.before(5, addContactToList)); * // => Allows adding up to 4 contacts to the list. */ function before(n, func) { var result; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } n = toInteger(n); return function() { if (--n > 0) { result = func.apply(this, arguments); } if (n <= 1) { func = undefined; } return result; }; } module.exports = before; /***/ }), /* 1236 */ /***/ (function(module, exports, __webpack_require__) { const log = __webpack_require__(2).namespace('Error Interception'); const handleUncaughtException = err => { log('critical', err.message, 'uncaught exception'); process.exit(1); }; const handleUnhandledRejection = err => { log('critical', err.message, 'unhandled exception'); process.exit(1); }; const handleSigterm = () => { log('critical', 'The konnector got a SIGTERM'); process.exit(128 + 15); }; const handleSigint = () => { log('critical', 'The konnector got a SIGINT'); process.exit(128 + 2); }; let attached = false; /** * Attach event handlers to catch uncaught exceptions/rejections and signals. * Log them as critical and exit the process accordingly. * If the cleanup function has not been called, calling again the function * is a no-op. * * @param {Process} prcs - Process object, default to current process * @returns {Function} When called, removes the signal handlers */ const attachProcessEventHandlers = (prcs = process) => { if (attached) { return; } attached = true; prcs.on('uncaughtException', handleUncaughtException); prcs.on('unhandledRejection', handleUnhandledRejection); prcs.on('SIGTERM', handleSigterm); prcs.on('SIGINT', handleSigint); return () => { attached = false; prcs.removeEventListener('uncaughtException', handleUncaughtException); prcs.removeEventListener('unhandledRejection', handleUnhandledRejection); prcs.removeEventListener('SIGTERM', handleSigterm); prcs.removeEventListener('SIGINT', handleSigint); }; }; module.exports = { attachProcessEventHandlers }; /***/ }), /* 1237 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const log = __webpack_require__(2).namespace('CookieKonnector'); const BaseKonnector = __webpack_require__(1170); const requestFactory = __webpack_require__(22); const { CookieJar } = __webpack_require__(270); const JAR_ACCOUNT_KEY = 'session'; /** * @class * Connector base class extending BaseKonnector which handles cookie session in a central way * It also handles saving cookie session in the account and automatically restore it for the next * connector run. * All cozy-konnector-libs tools using request are proposed as methods of this class to force them * to use the central cookie which can be saved/restored. * You need at least the `GET` and `PUT` permissions on `io.cozy.accounts` in your manifest to allow * it to save/restore cookies * * @example * ```javascript * const { CookieKonnector } = require('cozy-konnector-libs') * class MyConnector extends CookieKonnector { * async fetch(fields) { * // the code of your connector * await this.request('https://...') * } * async testSession() { * const $ = await this.request('https://...') * return $('') * } * } * const connector = new MyKonnector({ * cheerio: true, * json: false * }) * connector.run() * ``` * */ class CookieKonnector extends BaseKonnector { /** * Constructor * * @param {Function} requestFactoryOptions - Option object passed to requestFactory to * initialize this.request. It is still possible to change this.request doing : * * ```javascript * this.request = this.requestFactory(...) * ``` * * Please not you have to run the connector yourself doing : * * ```javascript * connector.run() * ``` */ constructor(requestFactoryOptions) { super(); if (!this.testSession) { throw new Error('Could not find a testSession method. CookieKonnector needs it to test if a session is valid. Please implement it'); } this._jar = requestFactory().jar(); this.request = this.requestFactory(requestFactoryOptions); } /** * Initializes the current connector with data coming from the associated account * and also the session * * @returns {Promise} with the fields as an object */ async initAttributes(cozyFields, account) { await super.initAttributes(cozyFields, account); await this.initSession(); } /** * Hook called when the connector is ended */ async end() { await this.saveSession(); return super.end(); } /** * Calls cozy-konnector-libs requestFactory forcing this._jar as the cookie * * @param {object} options - requestFactory option * @returns {object} - The resulting request object */ requestFactory(options) { this._jar = this._jar || requestFactory().jar(); return requestFactory({ ...options, jar: this._jar }); } /** * Reset cookie session with a new empty session and save it to the associated account * * @returns {Promise} */ async resetSession() { log('info', 'Reset cookie session...'); this._jar = requestFactory().jar(); return this.saveSession(); } /** * Get the cookie session from the account if any * * @returns {Promise} true or false if the session in the account exists or not */ async initSession() { const accountData = this.getAccountData(); try { if (this._account.state === 'RESET_SESSION') { log('info', 'RESET_SESSION state found'); await this.resetSession(); await this.updateAccountAttributes({ state: null }); } } catch (err) { log('warn', 'Could not reset the session'); log('warn', err.message); } try { let jar = null; if (accountData && accountData.auth) { jar = JSON.parse(accountData.auth[JAR_ACCOUNT_KEY]); } if (jar) { log('info', 'found saved session, using it...'); this._jar._jar = CookieJar.fromJSON(jar, this._jar._jar.store); return true; } } catch (err) { log('info', 'Could not parse session'); } log('info', 'Found no session'); return false; } /** * Saves the current cookie session to the account * * @returns {Promise} */ async saveSession(obj) { const accountData = { ...this._account.data, auth: {} }; if (obj && obj.getCookieJar) { this._jar._jar = obj.getCookieJar(); } accountData.auth[JAR_ACCOUNT_KEY] = JSON.stringify(this._jar._jar.toJSON()); await this.saveAccountData(accountData); log('info', 'saved the session'); } /** * This is signin function from cozy-konnector-libs which is forced to use the current cookies * and current request from CookieKonnector. It also automatically saves the session after * signin if it is a success. * * @returns {Promise} */ async signin(options) { const result = await super.signin({ ...options, requestInstance: this.request }); await this.saveSession(); return result; } /** * This is saveFiles function from cozy-konnector-libs which is forced to use the current cookies * and current request from CookieKonnector. * * @returns {Promise} */ saveFiles(entries, fields, options) { return super.saveFiles(entries, fields, { ...options, requestInstance: this.request }); } /** * This is saveBills function from cozy-konnector-libs which is forced to use the current cookies * and current request from CookieKonnector. * * @returns {Promise} */ saveBills(entries, fields, options) { return super.saveBills(entries, fields, { ...options, requestInstance: this.request }); } } module.exports = CookieKonnector; /***/ }), /* 1238 */ /***/ (function(module, exports, __webpack_require__) { const { URL } = __webpack_require__(83); const computeWidth = $table => { let out = 0; const tds = $table.find('tr').first().find('td,th'); for (var i = 0; i < tds.length; i++) { out += parseInt(tds.eq(i).attr('colspan')) || 1; } return out; }; const makeLinkOpts = ($el, opts) => { if ($el.attr('href') === undefined) return undefined; if ($el.attr('href').indexOf('javascript:') === 0) return undefined; if ($el.attr('href').indexOf('#') === 0) return undefined; return { link: new URL($el.attr('href'), opts.baseURL).toString(), color: '0x0000FF' }; }; function htmlToPDF($, frag, $parent, opts) { let pdf, helveticaBold, helveticaEm; // pdfjs is an optional dependency, this is why the requires are done in // a try/catch. webpack detects this and does not crash when building // if requires are done in a try/catch. try { pdf = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module 'pdfjs'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())); helveticaBold = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module 'pdfjs/font/Helvetica-Bold'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())); helveticaEm = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module 'pdfjs/font/Helvetica-Oblique'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())); } catch (err) { throw new Error('pdfjs dependency is missing. Please add it in your package.json'); } opts = Object.assign({ baseURL: '', filter: () => true, txtOpts: {} }, opts); const children = $parent.contents(); let text = opts.text; let parentDL = null; const getText = () => { if (!text) text = frag.text('', opts.txtOpts); return text; }; children.each((i, el) => { if (el.nodeType === 3 && el.data.trim() !== '') { getText().add(el.data); } else if (el.nodeType === 1) { const $el = $(el); if (!opts.filter($el)) return; switch (el.tagName) { case 'a': getText().add($el.text(), makeLinkOpts($el, opts)); break; case 'strong': case 'b': getText().add($el.text(), { font: helveticaBold }); break; case 'em': getText().add($el.text(), { font: helveticaEm }); break; case 'span': htmlToPDF($, frag, $el, Object.assign({}, opts, { text: text })); break; case 'br': getText().br(); break; case 'i': case 'select': case 'input': case 'label': case 'form': case 'fieldset': case 'textarea': case 'button': case 'img': case 'script': case 'caption': // ignore break; case 'table': { text = null; let width = computeWidth($el); let tableState = { tableWidth: width }; htmlToPDF($, frag.table({ widths: Array.from(Array(width), () => '*'), borderWidth: 1 }), $el, Object.assign({}, opts, { tableState })); break; } case 'tr': { text = null; opts.tableState.colRemaining = opts.tableState.tableWidth; let row = frag.row(); htmlToPDF($, row, $el, opts); if (opts.tableState.colRemaining > 0) { row.cell({ colspan: opts.tableState.colRemaining }); } break; } case 'dl': text = null; htmlToPDF($, frag.table({ widths: [5 * pdf.cm, null], borderWidth: 1 }), $el, { ...opts, tableState: { tableWidth: 2, colRemaining: 2 } }); parentDL = null; break; case 'dt': if (!parentDL) { parentDL = frag; } else { frag = parentDL; } frag = frag.row(); // fall through the rest of the procedure case 'dd': case 'th': case 'td': { text = null; const colspan = Math.min(opts.tableState.tableWidth, parseInt($el.attr('colspan')) || 1); opts.tableState.colRemaining -= colspan; htmlToPDF($, frag.cell({ padding: 5, colspan: colspan }), $el, opts); break; } case 'h1': case 'h2': case 'h3': case 'h4': case 'h5': text = null; htmlToPDF($, frag, //.cell({ paddingTop: 1 * pdf.cm }), $el, Object.assign({}, opts, { txtOpts: { fontSize: 30 - parseInt(el.tagName.replace('h', '')) * 2 } })); break; case 'div': case 'p': case 'ul': text = null; htmlToPDF($, frag.cell(), $el, opts); break; case 'thead': case 'tfoot': case 'tbody': case 'small': case 'li': text = null; htmlToPDF($, frag, $el, opts); break; default: text = null; htmlToPDF($, frag, $el, opts); } } }); } function createCozyPDFDocument(headline, url) { let pdf, helveticaBold; // pdfjs is an optional dependency, this is why the requires are done in // a try/catch. webpack detects this and does not crash when building // if requires are done in a try/catch. try { pdf = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module 'pdfjs'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())); helveticaBold = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module 'pdfjs/font/Helvetica-Bold'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())); } catch (err) { throw new Error('pdfjs dependency is missing. Please add it in your package.json'); } var doc = new pdf.Document(); const cell = doc.cell({ paddingBottom: 0.5 * pdf.cm }).text(); cell.add(headline, { font: helveticaBold, fontSize: 14 }); cell.add(url, { link: url, color: '0x0000FF' }); return doc; } module.exports = { htmlToPDF, createCozyPDFDocument }; /***/ }), /* 1239 */ /***/ (function(module, exports, __webpack_require__) { const isEqualWith = __webpack_require__(1240); const omit = __webpack_require__(944); const maybeToISO = date => { try { return date.toISOString ? date.toISOString() : date; } catch (e) { return date; } }; const looseDates = (val, otherVal) => { // Loose equality for dates since when coming from Couch, they // are ISO strings whereas just after scraping they are `Date`s. if (val instanceof Date) { return maybeToISO(val) === maybeToISO(otherVal); } }; /** * Simple Model for Documents. Allows to specify * `shouldSave`, `shouldUpdate` as methods. * * Has useful `isEqual` method * */ class Document { constructor(attrs) { if (this.validate) { this.validate(attrs); } Object.assign(this, attrs, { metadata: { version: attrs.metadata && attrs.metadata.version || this.constructor.version } }); } toJSON() { return this; } /** * Compares to another document deeply. * * `_id` and `_rev` are by default ignored in the comparison. * * By default, will compare dates loosely since you often * compare existing documents (dates in ISO string) with documents * that just have been scraped where dates are `Date`s. */ isEqual(other, ignoreAttrs = ['_id', '_rev'], strict = false) { return isEqualWith(omit(this, ignoreAttrs), omit(other, ignoreAttrs), !strict && looseDates); } } module.exports = Document; /***/ }), /* 1240 */ /***/ (function(module, exports, __webpack_require__) { var baseIsEqual = __webpack_require__(546); /** * This method is like `_.isEqual` except that it accepts `customizer` which * is invoked to compare values. If `customizer` returns `undefined`, comparisons * are handled by the method instead. The `customizer` is invoked with up to * six arguments: (objValue, othValue [, index|key, object, other, stack]). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @param {Function} [customizer] The function to customize comparisons. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * function isGreeting(value) { * return /^h(?:i|ello)$/.test(value); * } * * function customizer(objValue, othValue) { * if (isGreeting(objValue) && isGreeting(othValue)) { * return true; * } * } * * var array = ['hello', 'goodbye']; * var other = ['hi', 'goodbye']; * * _.isEqualWith(array, other, customizer); * // => true */ function isEqualWith(value, other, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; var result = customizer ? customizer(value, other) : undefined; return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; } module.exports = isEqualWith; /***/ }), /* 1241 */ /***/ (function(module, exports, __webpack_require__) { const log = __webpack_require__(2).namespace('scrape'); /** * Declarative scraping. * * Describe your items attributes and where to find/parse them * instead of imperatively building them. * * Heavily inspired by [artoo] scraping method. * * [artoo]: https://medialab.github.io/artoo/ */ const mkSpec = function (spec) { if (typeof spec === 'string') { return { sel: spec }; } else { return spec; } }; /** * Scrape a cheerio object for properties * * @param {cheerio} $ - Cheerio node which will be scraped * @param {object|string} spec(s) - Options object describing what you want to scrape * @param {string} [childSelector] - If passed, scrape will return an array of items * @returns {object|Array} - Item(s) scraped * @example * * `scrape` can be used to declaratively extract data : * * - For one object : * * ``` * const item = scrape($('#item'), { * title: '.title', * content: '.content' * }) * ``` * * - For a list of objects : * * ``` * const items = scrape($('#content'), { * title: '.title', * content: '.content' * }, '.item') * ``` * * For more power, you can use `object`s for each retriever : * * ``` * const items = scrape($('#content'), { * title: '.title', * content: '.content', * link: { * sel: 'a', * attr: 'href' * }, * }, '.item') * ``` * * Here the `href` attribute of the `a` inside `.item`s would have been * put into the `link` attribute of the items returned by `scrape`. * * Available options : * * - `sel`: the CSS selector used to target the HTML node from which data will be scraped * - `attr`: the HTML attribute from which to extract data * - `parse`: function applied to the value extracted (`{ sel: '.price', parse: parseAmount }`) * - `fn`: if you need something more complicated than `attr`, you can use this function, it receives * the complete DOM node. `{ sel: '.person', fn: $node => $node.attr('data-name') + $node.attr('data-firstname') }` */ const scrape = ($, specs, childSelector) => { // Only one value shorthand if (typeof specs === 'string' || specs.sel && typeof specs.sel === 'string') { const { val } = scrape($, { val: specs }); return val; } // Several items shorthand if (childSelector !== undefined) { return Array.from(($.find || $)(childSelector)).map(e => scrape($(e), specs)); } // Several properties "normal" case const res = {}; Object.keys(specs).forEach(specName => { try { const spec = mkSpec(specs[specName]); let data = spec.sel ? $.find(spec.sel) : $; if (spec.index) { data = data.get(spec.index); } let val; if (spec.fn) { val = spec.fn(data); } else if (spec.attr) { val = data.attr(spec.attr); } else { val = data; val = val && val.text(); val = val && val.trim(); } if (spec.parse) { val = spec.parse(val); } res[specName] = val; } catch (e) { log('warn', 'Could not parse for', specName); log('warn', e); } }); return res; }; module.exports = scrape; /***/ }), /* 1242 */ /***/ (function(module, exports) { /** * Returns the given name, replacing characters that could be an issue when * used in a filename with spaces. * * @module normalizeFilename */ const normalizableCharsRegExp = /[<>:"/\\|?*\0\s]+/g; /** * Returns the given name, replacing characters that could be an issue when * used in a filename with spaces. * * Replaced characters include: * * - Those forbidden on one or many popular OS or filesystem: `<>:"/\|?*` * - Those forbidden by the cozy-stack `\0`, `\r` and `\n` * - Multiple spaces and/or tabs are replaced with a single space * - Leading & trailing spaces and/or tabs are removed * * An exception will be thrown in case there is not any filename-compatible * character in the given name. * * Parameters: * * - `basename` is whatever string you want to generate the filename from * - `ext` is an optional file extension, with or without leading dot * * ```javascript * const { normalizeFilename } = require('cozy-konnector-libs') * * const filename = normalizeFilename('*foo/bar: <baz> \\"qux"\t???', '.txt') * // `filename` === `foo bar baz qux.txt` * ``` * * @alias module:normalizeFilename */ const normalizeFilename = (basename, ext) => { const filename = basename.replace(normalizableCharsRegExp, ' ').trim(); if (filename === '') { throw new Error('Cannot find any filename-compatible character in ' + JSON.stringify(filename) + '!'); } if (ext == null) ext = '';else if (!ext.startsWith('.')) ext = '.' + ext; return filename + ext; }; module.exports = normalizeFilename; /***/ }), /* 1243 */ /***/ (function(module, exports, __webpack_require__) { /** * Use every possible means to solve a captcha. At the moment, Anticaptcha web service is used if * any related secret key is found in COZY_PARAMETERS environment variable. * * @module solveCaptcha */ const log = __webpack_require__(2).namespace('solveCaptcha'); const errors = __webpack_require__(1176); const request = __webpack_require__(24); const sleep = __webpack_require__(9).promisify(global.setTimeout); const connectorStartTime = Date.now(); const DEFAULT_TIMEOUT = connectorStartTime + 3 * 60 * 1000; // 3 minutes by default to let 1 min to the connector to fetch files /** * Use every possible means to solve a captcha. At the moment, Anticaptcha web service is used if * any related secret key is found in COZY_PARAMETERS environment variable. * If you do not want to solve the captcha each time the connector is run, please also use * CookieKonnector which will help you save the session. * * Parameters: * * - `params` is an array of objects with any attributes with some mandatory attributes : * + `type` (String): (default recaptcha) type of captcha to solve. can be "recaptcha" or "image" at the moment * + `timeout` (Number): (default 3 minutes after now) time when the solver should stop trying to * solve the captcha * + `websiteKey` (String): the key you can find on the targeted website (for recaptcha) * + `websiteURL` (String): The URL of the page showing the captcha (for recaptcha) * + `body` (String): The base64 encoded image (for image captcha) * Returns: Promise with the solved captcha response as a string * * @example * * ```javascript * const { solveCaptcha } = require('cozy-konnector-libs') * * const solvedKey = await solveCaptcha({ * websiteKey: 'the key in the webpage', * websiteURL: 'http://quotes.toscrape.com/login', * }) * // now use the solveKey to submit your form * ``` * * @alias module:solveCaptcha */ const solveCaptcha = async (params = {}) => { const defaultParams = { type: 'recaptcha', timeout: DEFAULT_TIMEOUT }; params = { ...defaultParams, ...params }; const secrets = JSON.parse(process.env.COZY_PARAMETERS || '{}').secret; if (params.type === 'recaptcha') { checkMandatoryParams(params, ['websiteKey', 'websiteURL']); const { websiteKey, websiteURL } = params; return solveWithAntiCaptcha({ websiteKey, websiteURL, type: 'NoCaptchaTaskProxyless' }, params.timeout, secrets, 'gRecaptchaResponse'); } else if (params.type === 'recaptchav3') { checkMandatoryParams(params, ['websiteKey', 'websiteURL', 'pageAction', 'minScore']); const { websiteKey, websiteURL, pageAction, minScore } = params; return solveWithAntiCaptcha({ websiteKey, websiteURL, pageAction, minScore, type: 'RecaptchaV3TaskProxyless' }, params.timeout, secrets, 'gRecaptchaResponse'); } else if (params.type === 'image') { checkMandatoryParams(params, ['body']); return solveWithAntiCaptcha({ body: params.body, type: 'ImageToTextTask' }, params.timeout, secrets, 'text'); } }; function checkMandatoryParams(params = {}, mandatoryParams = []) { const keys = Object.keys(params); const missingKeys = mandatoryParams.filter(key => !keys.includes(key)); if (missingKeys.length) { throw new Error(`${missingKeys.join(', ')} are mandatory to solve the captcha`); } } async function solveWithAntiCaptcha(taskParams, timeout = DEFAULT_TIMEOUT, secrets, resultAttribute = 'gRecaptchaResponse') { const antiCaptchaApiUrl = 'https://api.anti-captcha.com'; let gRecaptchaResponse = null; const startTime = Date.now(); // we try to solve the captcha with anticaptcha const clientKey = secrets.antiCaptchaClientKey; if (clientKey) { log('info', ' Creating captcha resolution task...'); const task = await request.post(`${antiCaptchaApiUrl}/createTask`, { body: { clientKey, task: taskParams }, json: true }); if (task && task.taskId) { log('info', ` Task id : ${task.taskId}`); while (!gRecaptchaResponse) { const resp = await request.post(`${antiCaptchaApiUrl}/getTaskResult`, { body: { clientKey, taskId: task.taskId }, json: true }); if (resp.status === 'ready') { if (resp.errorId) { log('error', `Anticaptcha error: ${JSON.stringify(resp)}`); throw new Error(errors.CAPTCHA_RESOLUTION_FAILED); } log('warn', ` Found Recaptcha response : ${JSON.stringify(resp)}`); return resp.solution[resultAttribute]; } else { log('info', ` ${Math.round((Date.now() - startTime) / 1000)}s...`); if (Date.now() > timeout) { log('warn', ` Captcha resolution timeout`); throw new Error(errors.CAPTCHA_RESOLUTION_FAILED + '.TIMEOUT'); } await sleep(10000); } } } else { log('warn', 'Could not create anticaptcha task'); log('warn', JSON.stringify(task)); } } else { log('warn', 'Could not find any anticaptcha secret key'); } throw new Error(errors.CAPTCHA_RESOLUTION_FAILED); } module.exports = solveCaptcha; /***/ }), /* 1244 */ /***/ (function(module, exports, __webpack_require__) { function getAccountId() { try { return false ? undefined : JSON.parse(process.env.COZY_FIELDS).account } catch (err) { throw new Error(`You must provide 'account' in COZY_FIELDS: ${err.message}`) } } module.exports = getAccountId /***/ }), /* 1245 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(module) {var require;//! moment.js //! version : 2.25.3 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com ;(function (global, factory) { true ? module.exports = factory() : undefined }(this, (function () { 'use strict'; var hookCallback; function hooks() { return hookCallback.apply(null, arguments); } // This is done to register the method called with moment() // without creating circular dependencies. function setHookCallback(callback) { hookCallback = callback; } function isArray(input) { return ( input instanceof Array || Object.prototype.toString.call(input) === '[object Array]' ); } function isObject(input) { // IE8 will treat undefined and null as object if it wasn't for // input != null return ( input != null && Object.prototype.toString.call(input) === '[object Object]' ); } function hasOwnProp(a, b) { return Object.prototype.hasOwnProperty.call(a, b); } function isObjectEmpty(obj) { if (Object.getOwnPropertyNames) { return Object.getOwnPropertyNames(obj).length === 0; } else { var k; for (k in obj) { if (hasOwnProp(obj, k)) { return false; } } return true; } } function isUndefined(input) { return input === void 0; } function isNumber(input) { return ( typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]' ); } function isDate(input) { return ( input instanceof Date || Object.prototype.toString.call(input) === '[object Date]' ); } function map(arr, fn) { var res = [], i; for (i = 0; i < arr.length; ++i) { res.push(fn(arr[i], i)); } return res; } function extend(a, b) { for (var i in b) { if (hasOwnProp(b, i)) { a[i] = b[i]; } } if (hasOwnProp(b, 'toString')) { a.toString = b.toString; } if (hasOwnProp(b, 'valueOf')) { a.valueOf = b.valueOf; } return a; } function createUTC(input, format, locale, strict) { return createLocalOrUTC(input, format, locale, strict, true).utc(); } function defaultParsingFlags() { // We need to deep clone this object. return { empty: false, unusedTokens: [], unusedInput: [], overflow: -2, charsLeftOver: 0, nullInput: false, invalidEra: null, invalidMonth: null, invalidFormat: false, userInvalidated: false, iso: false, parsedDateParts: [], era: null, meridiem: null, rfc2822: false, weekdayMismatch: false, }; } function getParsingFlags(m) { if (m._pf == null) { m._pf = defaultParsingFlags(); } return m._pf; } var some; if (Array.prototype.some) { some = Array.prototype.some; } else { some = function (fun) { var t = Object(this), len = t.length >>> 0, i; for (i = 0; i < len; i++) { if (i in t && fun.call(this, t[i], i, t)) { return true; } } return false; }; } function isValid(m) { if (m._isValid == null) { var flags = getParsingFlags(m), parsedParts = some.call(flags.parsedDateParts, function (i) { return i != null; }), isNowValid = !isNaN(m._d.getTime()) && flags.overflow < 0 && !flags.empty && !flags.invalidEra && !flags.invalidMonth && !flags.invalidWeekday && !flags.weekdayMismatch && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || (flags.meridiem && parsedParts)); if (m._strict) { isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === undefined; } if (Object.isFrozen == null || !Object.isFrozen(m)) { m._isValid = isNowValid; } else { return isNowValid; } } return m._isValid; } function createInvalid(flags) { var m = createUTC(NaN); if (flags != null) { extend(getParsingFlags(m), flags); } else { getParsingFlags(m).userInvalidated = true; } return m; } // Plugins that add properties should also add the key here (null value), // so we can properly clone ourselves. var momentProperties = (hooks.momentProperties = []), updateInProgress = false; function copyConfig(to, from) { var i, prop, val; if (!isUndefined(from._isAMomentObject)) { to._isAMomentObject = from._isAMomentObject; } if (!isUndefined(from._i)) { to._i = from._i; } if (!isUndefined(from._f)) { to._f = from._f; } if (!isUndefined(from._l)) { to._l = from._l; } if (!isUndefined(from._strict)) { to._strict = from._strict; } if (!isUndefined(from._tzm)) { to._tzm = from._tzm; } if (!isUndefined(from._isUTC)) { to._isUTC = from._isUTC; } if (!isUndefined(from._offset)) { to._offset = from._offset; } if (!isUndefined(from._pf)) { to._pf = getParsingFlags(from); } if (!isUndefined(from._locale)) { to._locale = from._locale; } if (momentProperties.length > 0) { for (i = 0; i < momentProperties.length; i++) { prop = momentProperties[i]; val = from[prop]; if (!isUndefined(val)) { to[prop] = val; } } } return to; } // Moment prototype object function Moment(config) { copyConfig(this, config); this._d = new Date(config._d != null ? config._d.getTime() : NaN); if (!this.isValid()) { this._d = new Date(NaN); } // Prevent infinite loop in case updateOffset creates new moment // objects. if (updateInProgress === false) { updateInProgress = true; hooks.updateOffset(this); updateInProgress = false; } } function isMoment(obj) { return ( obj instanceof Moment || (obj != null && obj._isAMomentObject != null) ); } function warn(msg) { if ( hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn ) { console.warn('Deprecation warning: ' + msg); } } function deprecate(msg, fn) { var firstTime = true; return extend(function () { if (hooks.deprecationHandler != null) { hooks.deprecationHandler(null, msg); } if (firstTime) { var args = [], arg, i, key; for (i = 0; i < arguments.length; i++) { arg = ''; if (typeof arguments[i] === 'object') { arg += '\n[' + i + '] '; for (key in arguments[0]) { if (hasOwnProp(arguments[0], key)) { arg += key + ': ' + arguments[0][key] + ', '; } } arg = arg.slice(0, -2); // Remove trailing comma and space } else { arg = arguments[i]; } args.push(arg); } warn( msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + new Error().stack ); firstTime = false; } return fn.apply(this, arguments); }, fn); } var deprecations = {}; function deprecateSimple(name, msg) { if (hooks.deprecationHandler != null) { hooks.deprecationHandler(name, msg); } if (!deprecations[name]) { warn(msg); deprecations[name] = true; } } hooks.suppressDeprecationWarnings = false; hooks.deprecationHandler = null; function isFunction(input) { return ( (typeof Function !== 'undefined' && input instanceof Function) || Object.prototype.toString.call(input) === '[object Function]' ); } function set(config) { var prop, i; for (i in config) { if (hasOwnProp(config, i)) { prop = config[i]; if (isFunction(prop)) { this[i] = prop; } else { this['_' + i] = prop; } } } this._config = config; // Lenient ordinal parsing accepts just a number in addition to // number + (possibly) stuff coming from _dayOfMonthOrdinalParse. // TODO: Remove "ordinalParse" fallback in next major release. this._dayOfMonthOrdinalParseLenient = new RegExp( (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + '|' + /\d{1,2}/.source ); } function mergeConfigs(parentConfig, childConfig) { var res = extend({}, parentConfig), prop; for (prop in childConfig) { if (hasOwnProp(childConfig, prop)) { if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) { res[prop] = {}; extend(res[prop], parentConfig[prop]); extend(res[prop], childConfig[prop]); } else if (childConfig[prop] != null) { res[prop] = childConfig[prop]; } else { delete res[prop]; } } } for (prop in parentConfig) { if ( hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject(parentConfig[prop]) ) { // make sure changes to properties don't modify parent config res[prop] = extend({}, res[prop]); } } return res; } function Locale(config) { if (config != null) { this.set(config); } } var keys; if (Object.keys) { keys = Object.keys; } else { keys = function (obj) { var i, res = []; for (i in obj) { if (hasOwnProp(obj, i)) { res.push(i); } } return res; }; } var defaultCalendar = { sameDay: '[Today at] LT', nextDay: '[Tomorrow at] LT', nextWeek: 'dddd [at] LT', lastDay: '[Yesterday at] LT', lastWeek: '[Last] dddd [at] LT', sameElse: 'L', }; function calendar(key, mom, now) { var output = this._calendar[key] || this._calendar['sameElse']; return isFunction(output) ? output.call(mom, now) : output; } function zeroFill(number, targetLength, forceSign) { var absNumber = '' + Math.abs(number), zerosToFill = targetLength - absNumber.length, sign = number >= 0; return ( (sign ? (forceSign ? '+' : '') : '-') + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber ); } var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g, localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, formatFunctions = {}, formatTokenFunctions = {}; // token: 'M' // padded: ['MM', 2] // ordinal: 'Mo' // callback: function () { this.month() + 1 } function addFormatToken(token, padded, ordinal, callback) { var func = callback; if (typeof callback === 'string') { func = function () { return this[callback](); }; } if (token) { formatTokenFunctions[token] = func; } if (padded) { formatTokenFunctions[padded[0]] = function () { return zeroFill(func.apply(this, arguments), padded[1], padded[2]); }; } if (ordinal) { formatTokenFunctions[ordinal] = function () { return this.localeData().ordinal( func.apply(this, arguments), token ); }; } } function removeFormattingTokens(input) { if (input.match(/\[[\s\S]/)) { return input.replace(/^\[|\]$/g, ''); } return input.replace(/\\/g, ''); } function makeFormatFunction(format) { var array = format.match(formattingTokens), i, length; for (i = 0, length = array.length; i < length; i++) { if (formatTokenFunctions[array[i]]) { array[i] = formatTokenFunctions[array[i]]; } else { array[i] = removeFormattingTokens(array[i]); } } return function (mom) { var output = '', i; for (i = 0; i < length; i++) { output += isFunction(array[i]) ? array[i].call(mom, format) : array[i]; } return output; }; } // format date using native date object function formatMoment(m, format) { if (!m.isValid()) { return m.localeData().invalidDate(); } format = expandFormat(format, m.localeData()); formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format); return formatFunctions[format](m); } function expandFormat(format, locale) { var i = 5; function replaceLongDateFormatTokens(input) { return locale.longDateFormat(input) || input; } localFormattingTokens.lastIndex = 0; while (i >= 0 && localFormattingTokens.test(format)) { format = format.replace( localFormattingTokens, replaceLongDateFormatTokens ); localFormattingTokens.lastIndex = 0; i -= 1; } return format; } var defaultLongDateFormat = { 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', }; function longDateFormat(key) { var format = this._longDateFormat[key], formatUpper = this._longDateFormat[key.toUpperCase()]; if (format || !formatUpper) { return format; } this._longDateFormat[key] = formatUpper .match(formattingTokens) .map(function (tok) { if ( tok === 'MMMM' || tok === 'MM' || tok === 'DD' || tok === 'dddd' ) { return tok.slice(1); } return tok; }) .join(''); return this._longDateFormat[key]; } var defaultInvalidDate = 'Invalid date'; function invalidDate() { return this._invalidDate; } var defaultOrdinal = '%d', defaultDayOfMonthOrdinalParse = /\d{1,2}/; function ordinal(number) { return this._ordinal.replace('%d', number); } var defaultRelativeTime = { future: 'in %s', past: '%s ago', s: 'a few seconds', ss: '%d seconds', m: 'a minute', mm: '%d minutes', h: 'an hour', hh: '%d hours', d: 'a day', dd: '%d days', w: 'a week', ww: '%d weeks', M: 'a month', MM: '%d months', y: 'a year', yy: '%d years', }; function relativeTime(number, withoutSuffix, string, isFuture) { var output = this._relativeTime[string]; return isFunction(output) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number); } function pastFuture(diff, output) { var format = this._relativeTime[diff > 0 ? 'future' : 'past']; return isFunction(format) ? format(output) : format.replace(/%s/i, output); } var aliases = {}; function addUnitAlias(unit, shorthand) { var lowerCase = unit.toLowerCase(); aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit; } function normalizeUnits(units) { return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined; } function normalizeObjectUnits(inputObject) { var normalizedInput = {}, normalizedProp, prop; for (prop in inputObject) { if (hasOwnProp(inputObject, prop)) { normalizedProp = normalizeUnits(prop); if (normalizedProp) { normalizedInput[normalizedProp] = inputObject[prop]; } } } return normalizedInput; } var priorities = {}; function addUnitPriority(unit, priority) { priorities[unit] = priority; } function getPrioritizedUnits(unitsObj) { var units = [], u; for (u in unitsObj) { if (hasOwnProp(unitsObj, u)) { units.push({ unit: u, priority: priorities[u] }); } } units.sort(function (a, b) { return a.priority - b.priority; }); return units; } function isLeapYear(year) { return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; } function absFloor(number) { if (number < 0) { // -0 -> 0 return Math.ceil(number) || 0; } else { return Math.floor(number); } } function toInt(argumentForCoercion) { var coercedNumber = +argumentForCoercion, value = 0; if (coercedNumber !== 0 && isFinite(coercedNumber)) { value = absFloor(coercedNumber); } return value; } function makeGetSet(unit, keepTime) { return function (value) { if (value != null) { set$1(this, unit, value); hooks.updateOffset(this, keepTime); return this; } else { return get(this, unit); } }; } function get(mom, unit) { return mom.isValid() ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN; } function set$1(mom, unit, value) { if (mom.isValid() && !isNaN(value)) { if ( unit === 'FullYear' && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29 ) { value = toInt(value); mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit]( value, mom.month(), daysInMonth(value, mom.month()) ); } else { mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); } } } // MOMENTS function stringGet(units) { units = normalizeUnits(units); if (isFunction(this[units])) { return this[units](); } return this; } function stringSet(units, value) { if (typeof units === 'object') { units = normalizeObjectUnits(units); var prioritized = getPrioritizedUnits(units), i; for (i = 0; i < prioritized.length; i++) { this[prioritized[i].unit](units[prioritized[i].unit]); } } else { units = normalizeUnits(units); if (isFunction(this[units])) { return this[units](value); } } return this; } var match1 = /\d/, // 0 - 9 match2 = /\d\d/, // 00 - 99 match3 = /\d{3}/, // 000 - 999 match4 = /\d{4}/, // 0000 - 9999 match6 = /[+-]?\d{6}/, // -999999 - 999999 match1to2 = /\d\d?/, // 0 - 99 match3to4 = /\d\d\d\d?/, // 999 - 9999 match5to6 = /\d\d\d\d\d\d?/, // 99999 - 999999 match1to3 = /\d{1,3}/, // 0 - 999 match1to4 = /\d{1,4}/, // 0 - 9999 match1to6 = /[+-]?\d{1,6}/, // -999999 - 999999 matchUnsigned = /\d+/, // 0 - inf matchSigned = /[+-]?\d+/, // -inf - inf matchOffset = /Z|[+-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, // +00 -00 +00:00 -00:00 +0000 -0000 or Z matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123 // any word (or two) characters or numbers including two/three word month in arabic. // includes scottish gaelic two word and hyphenated months matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i, regexes; regexes = {}; function addRegexToken(token, regex, strictRegex) { regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) { return isStrict && strictRegex ? strictRegex : regex; }; } function getParseRegexForToken(token, config) { if (!hasOwnProp(regexes, token)) { return new RegExp(unescapeFormat(token)); } return regexes[token](config._strict, config._locale); } // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript function unescapeFormat(s) { return regexEscape( s .replace('\\', '') .replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function ( matched, p1, p2, p3, p4 ) { return p1 || p2 || p3 || p4; }) ); } function regexEscape(s) { return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); } var tokens = {}; function addParseToken(token, callback) { var i, func = callback; if (typeof token === 'string') { token = [token]; } if (isNumber(callback)) { func = function (input, array) { array[callback] = toInt(input); }; } for (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) { if (input != null && hasOwnProp(tokens, token)) { tokens[token](input, config._a, config, token); } } var YEAR = 0, MONTH = 1, DATE = 2, HOUR = 3, MINUTE = 4, SECOND = 5, MILLISECOND = 6, WEEK = 7, WEEKDAY = 8; function mod(n, x) { return ((n % x) + x) % x; } var indexOf; if (Array.prototype.indexOf) { indexOf = Array.prototype.indexOf; } else { indexOf = function (o) { // I know var i; for (i = 0; i < this.length; ++i) { if (this[i] === o) { return i; } } return -1; }; } function daysInMonth(year, month) { if (isNaN(year) || isNaN(month)) { return NaN; } var modMonth = mod(month, 12); year += (month - modMonth) / 12; return modMonth === 1 ? isLeapYear(year) ? 29 : 28 : 31 - ((modMonth % 7) % 2); } // FORMATTING 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); }); // ALIASES addUnitAlias('month', 'M'); // PRIORITY addUnitPriority('month', 8); // PARSING addRegexToken('M', match1to2); addRegexToken('MM', match1to2, match2); addRegexToken('MMM', function (isStrict, locale) { return locale.monthsShortRegex(isStrict); }); addRegexToken('MMMM', function (isStrict, locale) { return locale.monthsRegex(isStrict); }); addParseToken(['M', 'MM'], function (input, array) { array[MONTH] = toInt(input) - 1; }); addParseToken(['MMM', 'MMMM'], function (input, array, config, token) { var month = config._locale.monthsParse(input, token, config._strict); // if we didn't find a month name, mark the date as invalid. if (month != null) { array[MONTH] = month; } else { getParsingFlags(config).invalidMonth = input; } }); // LOCALES var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split( '_' ), defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split( '_' ), MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/, defaultMonthsShortRegex = matchWord, defaultMonthsRegex = matchWord; function localeMonths(m, format) { if (!m) { return isArray(this._months) ? this._months : this._months['standalone']; } return isArray(this._months) ? this._months[m.month()] : this._months[ (this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone' ][m.month()]; } function localeMonthsShort(m, format) { if (!m) { return isArray(this._monthsShort) ? this._monthsShort : this._monthsShort['standalone']; } return isArray(this._monthsShort) ? this._monthsShort[m.month()] : this._monthsShort[ MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone' ][m.month()]; } function handleStrictParse(monthName, format, strict) { var i, ii, mom, llc = monthName.toLocaleLowerCase(); if (!this._monthsParse) { // this is not used this._monthsParse = []; this._longMonthsParse = []; this._shortMonthsParse = []; for (i = 0; i < 12; ++i) { mom = createUTC([2000, i]); this._shortMonthsParse[i] = this.monthsShort( mom, '' ).toLocaleLowerCase(); this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase(); } } if (strict) { if (format === 'MMM') { ii = indexOf.call(this._shortMonthsParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._longMonthsParse, llc); return ii !== -1 ? ii : null; } } else { if (format === 'MMM') { ii = indexOf.call(this._shortMonthsParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._longMonthsParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._longMonthsParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._shortMonthsParse, llc); return ii !== -1 ? ii : null; } } } function localeMonthsParse(monthName, format, strict) { var i, mom, regex; if (this._monthsParseExact) { return handleStrictParse.call(this, monthName, format, strict); } if (!this._monthsParse) { this._monthsParse = []; this._longMonthsParse = []; this._shortMonthsParse = []; } // TODO: add sorting // Sorting makes sure if one month (or abbr) is a prefix of another // see sorting in computeMonthsParse for (i = 0; i < 12; i++) { // make the regex if we don't have it already mom = createUTC([2000, i]); if (strict && !this._longMonthsParse[i]) { this._longMonthsParse[i] = new RegExp( '^' + this.months(mom, '').replace('.', '') + '$', 'i' ); this._shortMonthsParse[i] = new RegExp( '^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i' ); } if (!strict && !this._monthsParse[i]) { regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); } // test the regex if ( strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName) ) { return i; } else if ( strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName) ) { return i; } else if (!strict && this._monthsParse[i].test(monthName)) { return i; } } } // MOMENTS function setMonth(mom, value) { var dayOfMonth; if (!mom.isValid()) { // No op return mom; } if (typeof value === 'string') { if (/^\d+$/.test(value)) { value = toInt(value); } else { value = mom.localeData().monthsParse(value); // TODO: Another silent failure? if (!isNumber(value)) { return mom; } } } dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value)); mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth); return mom; } function getSetMonth(value) { if (value != null) { setMonth(this, value); hooks.updateOffset(this, true); return this; } else { return get(this, 'Month'); } } function getDaysInMonth() { return daysInMonth(this.year(), this.month()); } function monthsShortRegex(isStrict) { if (this._monthsParseExact) { if (!hasOwnProp(this, '_monthsRegex')) { computeMonthsParse.call(this); } if (isStrict) { return this._monthsShortStrictRegex; } else { return this._monthsShortRegex; } } else { if (!hasOwnProp(this, '_monthsShortRegex')) { this._monthsShortRegex = defaultMonthsShortRegex; } return this._monthsShortStrictRegex && isStrict ? this._monthsShortStrictRegex : this._monthsShortRegex; } } function monthsRegex(isStrict) { if (this._monthsParseExact) { if (!hasOwnProp(this, '_monthsRegex')) { computeMonthsParse.call(this); } if (isStrict) { return this._monthsStrictRegex; } else { return this._monthsRegex; } } else { if (!hasOwnProp(this, '_monthsRegex')) { this._monthsRegex = defaultMonthsRegex; } return this._monthsStrictRegex && isStrict ? this._monthsStrictRegex : this._monthsRegex; } } function computeMonthsParse() { function cmpLenRev(a, b) { return b.length - a.length; } var shortPieces = [], longPieces = [], mixedPieces = [], i, mom; for (i = 0; i < 12; i++) { // make the regex if we don't have it already mom = createUTC([2000, i]); shortPieces.push(this.monthsShort(mom, '')); longPieces.push(this.months(mom, '')); mixedPieces.push(this.months(mom, '')); mixedPieces.push(this.monthsShort(mom, '')); } // Sorting makes sure if one month (or abbr) is a prefix of another it // will match the longer piece. shortPieces.sort(cmpLenRev); longPieces.sort(cmpLenRev); mixedPieces.sort(cmpLenRev); for (i = 0; i < 12; i++) { shortPieces[i] = regexEscape(shortPieces[i]); longPieces[i] = regexEscape(longPieces[i]); } for (i = 0; i < 24; i++) { mixedPieces[i] = regexEscape(mixedPieces[i]); } this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); this._monthsShortRegex = this._monthsRegex; this._monthsStrictRegex = new RegExp( '^(' + longPieces.join('|') + ')', 'i' ); this._monthsShortStrictRegex = new RegExp( '^(' + shortPieces.join('|') + ')', 'i' ); } // FORMATTING addFormatToken('Y', 0, 0, function () { var y = this.year(); return y <= 9999 ? zeroFill(y, 4) : '+' + y; }); 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, true], 0, 'year'); // ALIASES addUnitAlias('year', 'y'); // PRIORITIES addUnitPriority('year', 1); // PARSING addRegexToken('Y', matchSigned); addRegexToken('YY', match1to2, match2); addRegexToken('YYYY', match1to4, match4); addRegexToken('YYYYY', match1to6, match6); addRegexToken('YYYYYY', match1to6, match6); addParseToken(['YYYYY', 'YYYYYY'], YEAR); addParseToken('YYYY', function (input, array) { array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input); }); addParseToken('YY', function (input, array) { array[YEAR] = hooks.parseTwoDigitYear(input); }); addParseToken('Y', function (input, array) { array[YEAR] = parseInt(input, 10); }); // HELPERS function daysInYear(year) { return isLeapYear(year) ? 366 : 365; } // HOOKS hooks.parseTwoDigitYear = function (input) { return toInt(input) + (toInt(input) > 68 ? 1900 : 2000); }; // MOMENTS var getSetYear = makeGetSet('FullYear', true); function getIsLeapYear() { return isLeapYear(this.year()); } function createDate(y, m, d, h, M, s, ms) { // can't just apply() to create a date: // https://stackoverflow.com/q/181348 var date; // the date constructor remaps years 0-99 to 1900-1999 if (y < 100 && y >= 0) { // preserve leap years using a full 400 year cycle, then reset date = new Date(y + 400, m, d, h, M, s, ms); if (isFinite(date.getFullYear())) { date.setFullYear(y); } } else { date = new Date(y, m, d, h, M, s, ms); } return date; } function createUTCDate(y) { var date, args; // the Date.UTC function remaps years 0-99 to 1900-1999 if (y < 100 && y >= 0) { args = Array.prototype.slice.call(arguments); // preserve leap years using a full 400 year cycle, then reset args[0] = y + 400; date = new Date(Date.UTC.apply(null, args)); if (isFinite(date.getUTCFullYear())) { date.setUTCFullYear(y); } } else { date = new Date(Date.UTC.apply(null, arguments)); } return date; } // start-of-first-week - start-of-year function firstWeekOffset(year, dow, doy) { var // first-week day -- which january is always in the first week (4 for iso, 1 for other) fwd = 7 + dow - doy, // first-week day local weekday -- which local weekday is fwd fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7; return -fwdlw + fwd - 1; } // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday function dayOfYearFromWeeks(year, week, weekday, dow, doy) { var localWeekday = (7 + weekday - dow) % 7, weekOffset = firstWeekOffset(year, dow, doy), dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, resYear, resDayOfYear; if (dayOfYear <= 0) { resYear = year - 1; resDayOfYear = daysInYear(resYear) + dayOfYear; } else if (dayOfYear > daysInYear(year)) { resYear = year + 1; resDayOfYear = dayOfYear - daysInYear(year); } else { resYear = year; resDayOfYear = dayOfYear; } return { year: resYear, dayOfYear: resDayOfYear, }; } function weekOfYear(mom, dow, doy) { var weekOffset = firstWeekOffset(mom.year(), dow, doy), week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, resWeek, resYear; if (week < 1) { resYear = mom.year() - 1; resWeek = week + weeksInYear(resYear, dow, doy); } else if (week > weeksInYear(mom.year(), dow, doy)) { resWeek = week - weeksInYear(mom.year(), dow, doy); resYear = mom.year() + 1; } else { resYear = mom.year(); resWeek = week; } return { week: resWeek, year: resYear, }; } function weeksInYear(year, dow, doy) { var weekOffset = firstWeekOffset(year, dow, doy), weekOffsetNext = firstWeekOffset(year + 1, dow, doy); return (daysInYear(year) - weekOffset + weekOffsetNext) / 7; } // FORMATTING addFormatToken('w', ['ww', 2], 'wo', 'week'); addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); // ALIASES addUnitAlias('week', 'w'); addUnitAlias('isoWeek', 'W'); // PRIORITIES addUnitPriority('week', 5); addUnitPriority('isoWeek', 5); // PARSING 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); }); // HELPERS // LOCALES function localeWeek(mom) { return weekOfYear(mom, this._week.dow, this._week.doy).week; } var defaultLocaleWeek = { dow: 0, // Sunday is the first day of the week. doy: 6, // The week that contains Jan 6th is the first week of the year. }; function localeFirstDayOfWeek() { return this._week.dow; } function localeFirstDayOfYear() { return this._week.doy; } // MOMENTS function getSetWeek(input) { var week = this.localeData().week(this); return input == null ? week : this.add((input - week) * 7, 'd'); } function getSetISOWeek(input) { var week = weekOfYear(this, 1, 4).week; return input == null ? week : this.add((input - week) * 7, 'd'); } // FORMATTING 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'); // ALIASES addUnitAlias('day', 'd'); addUnitAlias('weekday', 'e'); addUnitAlias('isoWeekday', 'E'); // PRIORITY addUnitPriority('day', 11); addUnitPriority('weekday', 11); addUnitPriority('isoWeekday', 11); // PARSING addRegexToken('d', match1to2); addRegexToken('e', match1to2); addRegexToken('E', match1to2); addRegexToken('dd', function (isStrict, locale) { return locale.weekdaysMinRegex(isStrict); }); addRegexToken('ddd', function (isStrict, locale) { return locale.weekdaysShortRegex(isStrict); }); addRegexToken('dddd', function (isStrict, locale) { return locale.weekdaysRegex(isStrict); }); addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) { var weekday = config._locale.weekdaysParse(input, token, config._strict); // if we didn't get a weekday name, mark the date as invalid if (weekday != null) { week.d = weekday; } else { getParsingFlags(config).invalidWeekday = input; } }); addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) { week[token] = toInt(input); }); // HELPERS function parseWeekday(input, locale) { if (typeof input !== 'string') { return input; } if (!isNaN(input)) { return parseInt(input, 10); } input = locale.weekdaysParse(input); if (typeof input === 'number') { return input; } return null; } function parseIsoWeekday(input, locale) { if (typeof input === 'string') { return locale.weekdaysParse(input) % 7 || 7; } return isNaN(input) ? null : input; } // LOCALES function shiftWeekdays(ws, n) { return ws.slice(n, 7).concat(ws.slice(0, n)); } var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split( '_' ), defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), defaultWeekdaysRegex = matchWord, defaultWeekdaysShortRegex = matchWord, defaultWeekdaysMinRegex = matchWord; function localeWeekdays(m, format) { var weekdays = isArray(this._weekdays) ? this._weekdays : this._weekdays[ m && m !== true && this._weekdays.isFormat.test(format) ? 'format' : 'standalone' ]; return m === true ? shiftWeekdays(weekdays, this._week.dow) : m ? weekdays[m.day()] : weekdays; } function localeWeekdaysShort(m) { return m === true ? shiftWeekdays(this._weekdaysShort, this._week.dow) : m ? this._weekdaysShort[m.day()] : this._weekdaysShort; } function localeWeekdaysMin(m) { return m === true ? shiftWeekdays(this._weekdaysMin, this._week.dow) : m ? this._weekdaysMin[m.day()] : this._weekdaysMin; } function handleStrictParse$1(weekdayName, format, strict) { var i, ii, mom, llc = weekdayName.toLocaleLowerCase(); if (!this._weekdaysParse) { this._weekdaysParse = []; this._shortWeekdaysParse = []; this._minWeekdaysParse = []; for (i = 0; i < 7; ++i) { mom = createUTC([2000, 1]).day(i); this._minWeekdaysParse[i] = this.weekdaysMin( mom, '' ).toLocaleLowerCase(); this._shortWeekdaysParse[i] = this.weekdaysShort( mom, '' ).toLocaleLowerCase(); this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase(); } } if (strict) { if (format === 'dddd') { ii = indexOf.call(this._weekdaysParse, llc); return ii !== -1 ? ii : null; } else if (format === 'ddd') { ii = indexOf.call(this._shortWeekdaysParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._minWeekdaysParse, llc); return ii !== -1 ? ii : null; } } else { if (format === 'dddd') { ii = indexOf.call(this._weekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._shortWeekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._minWeekdaysParse, llc); return ii !== -1 ? ii : null; } else if (format === 'ddd') { ii = indexOf.call(this._shortWeekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._weekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._minWeekdaysParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._minWeekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._weekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._shortWeekdaysParse, llc); return ii !== -1 ? ii : null; } } } function localeWeekdaysParse(weekdayName, format, strict) { var i, mom, regex; if (this._weekdaysParseExact) { return handleStrictParse$1.call(this, weekdayName, format, strict); } if (!this._weekdaysParse) { this._weekdaysParse = []; this._minWeekdaysParse = []; this._shortWeekdaysParse = []; this._fullWeekdaysParse = []; } for (i = 0; i < 7; i++) { // make the regex if we don't have it already mom = createUTC([2000, 1]).day(i); if (strict && !this._fullWeekdaysParse[i]) { this._fullWeekdaysParse[i] = new RegExp( '^' + this.weekdays(mom, '').replace('.', '\\.?') + '$', 'i' ); this._shortWeekdaysParse[i] = new RegExp( '^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$', 'i' ); this._minWeekdaysParse[i] = new RegExp( '^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$', 'i' ); } if (!this._weekdaysParse[i]) { regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); } // test the regex if ( strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName) ) { return i; } else if ( strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName) ) { return i; } else if ( strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName) ) { return i; } else if (!strict && this._weekdaysParse[i].test(weekdayName)) { return i; } } } // MOMENTS function getSetDayOfWeek(input) { if (!this.isValid()) { return input != null ? this : NaN; } var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); if (input != null) { input = parseWeekday(input, this.localeData()); return this.add(input - day, 'd'); } else { return day; } } function getSetLocaleDayOfWeek(input) { if (!this.isValid()) { return input != null ? this : NaN; } var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; return input == null ? weekday : this.add(input - weekday, 'd'); } function getSetISODayOfWeek(input) { if (!this.isValid()) { return input != null ? this : NaN; } // behaves the same as moment#day except // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) // as a setter, sunday should belong to the previous week. if (input != null) { var weekday = parseIsoWeekday(input, this.localeData()); return this.day(this.day() % 7 ? weekday : weekday - 7); } else { return this.day() || 7; } } function weekdaysRegex(isStrict) { if (this._weekdaysParseExact) { if (!hasOwnProp(this, '_weekdaysRegex')) { computeWeekdaysParse.call(this); } if (isStrict) { return this._weekdaysStrictRegex; } else { return this._weekdaysRegex; } } else { if (!hasOwnProp(this, '_weekdaysRegex')) { this._weekdaysRegex = defaultWeekdaysRegex; } return this._weekdaysStrictRegex && isStrict ? this._weekdaysStrictRegex : this._weekdaysRegex; } } function weekdaysShortRegex(isStrict) { if (this._weekdaysParseExact) { if (!hasOwnProp(this, '_weekdaysRegex')) { computeWeekdaysParse.call(this); } if (isStrict) { return this._weekdaysShortStrictRegex; } else { return this._weekdaysShortRegex; } } else { if (!hasOwnProp(this, '_weekdaysShortRegex')) { this._weekdaysShortRegex = defaultWeekdaysShortRegex; } return this._weekdaysShortStrictRegex && isStrict ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex; } } function weekdaysMinRegex(isStrict) { if (this._weekdaysParseExact) { if (!hasOwnProp(this, '_weekdaysRegex')) { computeWeekdaysParse.call(this); } if (isStrict) { return this._weekdaysMinStrictRegex; } else { return this._weekdaysMinRegex; } } else { if (!hasOwnProp(this, '_weekdaysMinRegex')) { this._weekdaysMinRegex = defaultWeekdaysMinRegex; } return this._weekdaysMinStrictRegex && isStrict ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex; } } function computeWeekdaysParse() { function cmpLenRev(a, b) { return b.length - a.length; } var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [], i, mom, minp, shortp, longp; for (i = 0; i < 7; i++) { // make the regex if we don't have it already mom = createUTC([2000, 1]).day(i); minp = regexEscape(this.weekdaysMin(mom, '')); shortp = regexEscape(this.weekdaysShort(mom, '')); longp = regexEscape(this.weekdays(mom, '')); minPieces.push(minp); shortPieces.push(shortp); longPieces.push(longp); mixedPieces.push(minp); mixedPieces.push(shortp); mixedPieces.push(longp); } // Sorting makes sure if one weekday (or abbr) is a prefix of another it // will match the longer piece. minPieces.sort(cmpLenRev); shortPieces.sort(cmpLenRev); longPieces.sort(cmpLenRev); mixedPieces.sort(cmpLenRev); this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); this._weekdaysShortRegex = this._weekdaysRegex; this._weekdaysMinRegex = this._weekdaysRegex; this._weekdaysStrictRegex = new RegExp( '^(' + longPieces.join('|') + ')', 'i' ); this._weekdaysShortStrictRegex = new RegExp( '^(' + shortPieces.join('|') + ')', 'i' ); this._weekdaysMinStrictRegex = new RegExp( '^(' + minPieces.join('|') + ')', 'i' ); } // FORMATTING function hFormat() { return this.hours() % 12 || 12; } function kFormat() { return this.hours() || 24; } addFormatToken('H', ['HH', 2], 0, 'hour'); addFormatToken('h', ['hh', 2], 0, hFormat); addFormatToken('k', ['kk', 2], 0, kFormat); addFormatToken('hmm', 0, 0, function () { return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2); }); addFormatToken('hmmss', 0, 0, function () { return ( '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2) ); }); addFormatToken('Hmm', 0, 0, function () { return '' + this.hours() + zeroFill(this.minutes(), 2); }); addFormatToken('Hmmss', 0, 0, function () { return ( '' + this.hours() + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2) ); }); function meridiem(token, lowercase) { addFormatToken(token, 0, 0, function () { return this.localeData().meridiem( this.hours(), this.minutes(), lowercase ); }); } meridiem('a', true); meridiem('A', false); // ALIASES addUnitAlias('hour', 'h'); // PRIORITY addUnitPriority('hour', 13); // PARSING function matchMeridiem(isStrict, locale) { return locale._meridiemParse; } addRegexToken('a', matchMeridiem); addRegexToken('A', matchMeridiem); addRegexToken('H', match1to2); addRegexToken('h', match1to2); addRegexToken('k', match1to2); addRegexToken('HH', match1to2, match2); addRegexToken('hh', match1to2, match2); addRegexToken('kk', match1to2, match2); addRegexToken('hmm', match3to4); addRegexToken('hmmss', match5to6); addRegexToken('Hmm', match3to4); addRegexToken('Hmmss', match5to6); addParseToken(['H', 'HH'], HOUR); addParseToken(['k', 'kk'], function (input, array, config) { var kInput = toInt(input); array[HOUR] = kInput === 24 ? 0 : kInput; }); addParseToken(['a', 'A'], function (input, array, config) { config._isPm = config._locale.isPM(input); config._meridiem = input; }); addParseToken(['h', 'hh'], function (input, array, config) { array[HOUR] = toInt(input); getParsingFlags(config).bigHour = true; }); addParseToken('hmm', function (input, array, config) { var pos = input.length - 2; array[HOUR] = toInt(input.substr(0, pos)); array[MINUTE] = toInt(input.substr(pos)); getParsingFlags(config).bigHour = true; }); addParseToken('hmmss', function (input, array, config) { var pos1 = input.length - 4, pos2 = input.length - 2; array[HOUR] = toInt(input.substr(0, pos1)); array[MINUTE] = toInt(input.substr(pos1, 2)); array[SECOND] = toInt(input.substr(pos2)); getParsingFlags(config).bigHour = true; }); addParseToken('Hmm', function (input, array, config) { var pos = input.length - 2; array[HOUR] = toInt(input.substr(0, pos)); array[MINUTE] = toInt(input.substr(pos)); }); addParseToken('Hmmss', function (input, array, config) { var pos1 = input.length - 4, pos2 = input.length - 2; array[HOUR] = toInt(input.substr(0, pos1)); array[MINUTE] = toInt(input.substr(pos1, 2)); array[SECOND] = toInt(input.substr(pos2)); }); // LOCALES function localeIsPM(input) { // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays // Using charAt should be more compatible. return (input + '').toLowerCase().charAt(0) === 'p'; } var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i, // Setting the hour should keep the time, because the user explicitly // specified which hour they want. So trying to maintain the same hour (in // a new timezone) makes sense. Adding/subtracting hours does not follow // this rule. getSetHour = makeGetSet('Hours', true); function localeMeridiem(hours, minutes, isLower) { if (hours > 11) { return isLower ? 'pm' : 'PM'; } else { return isLower ? 'am' : 'AM'; } } var baseConfig = { calendar: defaultCalendar, longDateFormat: defaultLongDateFormat, invalidDate: defaultInvalidDate, ordinal: defaultOrdinal, dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse, relativeTime: defaultRelativeTime, months: defaultLocaleMonths, monthsShort: defaultLocaleMonthsShort, week: defaultLocaleWeek, weekdays: defaultLocaleWeekdays, weekdaysMin: defaultLocaleWeekdaysMin, weekdaysShort: defaultLocaleWeekdaysShort, meridiemParse: defaultLocaleMeridiemParse, }; // internal storage for locale config files var locales = {}, localeFamilies = {}, globalLocale; function commonPrefix(arr1, arr2) { var i, minl = Math.min(arr1.length, arr2.length); for (i = 0; i < minl; i += 1) { if (arr1[i] !== arr2[i]) { return i; } } return minl; } function normalizeLocale(key) { return key ? key.toLowerCase().replace('_', '-') : key; } // pick the locale from the array // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root function chooseLocale(names) { var i = 0, j, next, locale, split; while (i < names.length) { split = normalizeLocale(names[i]).split('-'); j = split.length; next = normalizeLocale(names[i + 1]); next = next ? next.split('-') : null; while (j > 0) { locale = loadLocale(split.slice(0, j).join('-')); if (locale) { return locale; } if ( next && next.length >= j && commonPrefix(split, next) >= j - 1 ) { //the next array item is better than a shallower substring of this one break; } j--; } i++; } return globalLocale; } function loadLocale(name) { var oldLocale = null, aliasedRequire; // TODO: Find a better way to register and load all the locales in Node if ( locales[name] === undefined && typeof module !== 'undefined' && module && module.exports ) { try { oldLocale = globalLocale._abbr; aliasedRequire = require; __webpack_require__(1246)("./" + name); getSetGlobalLocale(oldLocale); } catch (e) { // mark as not found to avoid repeating expensive file require call causing high CPU // when trying to find en-US, en_US, en-us for every format call locales[name] = null; // null means not found } } return locales[name]; } // This function will load locale and then set the global locale. If // no arguments are passed in, it will simply return the current global // locale key. function getSetGlobalLocale(key, values) { var data; if (key) { if (isUndefined(values)) { data = getLocale(key); } else { data = defineLocale(key, values); } if (data) { // moment.duration._locale = moment._locale = data; globalLocale = data; } else { if (typeof console !== 'undefined' && console.warn) { //warn user if arguments are passed but the locale could not be set console.warn( 'Locale ' + key + ' not found. Did you forget to load it?' ); } } } return globalLocale._abbr; } function defineLocale(name, config) { if (config !== null) { var locale, parentConfig = baseConfig; config.abbr = name; if (locales[name] != null) { deprecateSimple( 'defineLocaleOverride', 'use moment.updateLocale(localeName, config) to change ' + 'an existing locale. moment.defineLocale(localeName, ' + 'config) should only be used for creating a new locale ' + 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.' ); parentConfig = locales[name]._config; } else if (config.parentLocale != null) { if (locales[config.parentLocale] != null) { parentConfig = locales[config.parentLocale]._config; } else { locale = loadLocale(config.parentLocale); if (locale != null) { parentConfig = locale._config; } else { if (!localeFamilies[config.parentLocale]) { localeFamilies[config.parentLocale] = []; } localeFamilies[config.parentLocale].push({ name: name, config: config, }); return null; } } } locales[name] = new Locale(mergeConfigs(parentConfig, config)); if (localeFamilies[name]) { localeFamilies[name].forEach(function (x) { defineLocale(x.name, x.config); }); } // backwards compat for now: also set the locale // make sure we set the locale AFTER all child locales have been // created, so we won't end up with the child locale set. getSetGlobalLocale(name); return locales[name]; } else { // useful for testing delete locales[name]; return null; } } function updateLocale(name, config) { if (config != null) { var locale, tmpLocale, parentConfig = baseConfig; if (locales[name] != null && locales[name].parentLocale != null) { // Update existing child locale in-place to avoid memory-leaks locales[name].set(mergeConfigs(locales[name]._config, config)); } else { // MERGE tmpLocale = loadLocale(name); if (tmpLocale != null) { parentConfig = tmpLocale._config; } config = mergeConfigs(parentConfig, config); if (tmpLocale == null) { // updateLocale is called for creating a new locale // Set abbr so it will have a name (getters return // undefined otherwise). config.abbr = name; } locale = new Locale(config); locale.parentLocale = locales[name]; locales[name] = locale; } // backwards compat for now: also set the locale getSetGlobalLocale(name); } else { // pass null for config to unupdate, useful for tests if (locales[name] != null) { if (locales[name].parentLocale != null) { locales[name] = locales[name].parentLocale; if (name === getSetGlobalLocale()) { getSetGlobalLocale(name); } } else if (locales[name] != null) { delete locales[name]; } } } return locales[name]; } // returns locale data function getLocale(key) { var locale; if (key && key._locale && key._locale._abbr) { key = key._locale._abbr; } if (!key) { return globalLocale; } if (!isArray(key)) { //short-circuit everything else locale = loadLocale(key); if (locale) { return locale; } key = [key]; } return chooseLocale(key); } function listLocales() { return keys(locales); } function checkOverflow(m) { var overflow, a = m._a; if (a && getParsingFlags(m).overflow === -2) { overflow = a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR : a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : -1; if ( getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE) ) { overflow = DATE; } if (getParsingFlags(m)._overflowWeeks && overflow === -1) { overflow = WEEK; } if (getParsingFlags(m)._overflowWeekday && overflow === -1) { overflow = WEEKDAY; } getParsingFlags(m).overflow = overflow; } return m; } // iso 8601 regex // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, tzRegex = /Z|[+-]\d\d(?::?\d\d)?/, isoDates = [ ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/], ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/], ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/], ['GGGG-[W]WW', /\d{4}-W\d\d/, false], ['YYYY-DDD', /\d{4}-\d{3}/], ['YYYY-MM', /\d{4}-\d\d/, false], ['YYYYYYMMDD', /[+-]\d{10}/], ['YYYYMMDD', /\d{8}/], ['GGGG[W]WWE', /\d{4}W\d{3}/], ['GGGG[W]WW', /\d{4}W\d{2}/, false], ['YYYYDDD', /\d{7}/], ['YYYYMM', /\d{6}/, false], ['YYYY', /\d{4}/, false], ], // iso time formats and regexes isoTimes = [ ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/], ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/], ['HH:mm:ss', /\d\d:\d\d:\d\d/], ['HH:mm', /\d\d:\d\d/], ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/], ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/], ['HHmmss', /\d\d\d\d\d\d/], ['HHmm', /\d\d\d\d/], ['HH', /\d\d/], ], aspNetJsonRegex = /^\/?Date\((-?\d+)/i, // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3 rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/, obsOffsets = { UT: 0, GMT: 0, EDT: -4 * 60, EST: -5 * 60, CDT: -5 * 60, CST: -6 * 60, MDT: -6 * 60, MST: -7 * 60, PDT: -7 * 60, PST: -8 * 60, }; // date from iso format function configFromISO(config) { var i, l, string = config._i, match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), allowTime, dateFormat, timeFormat, tzFormat; if (match) { getParsingFlags(config).iso = true; for (i = 0, l = isoDates.length; i < l; i++) { if (isoDates[i][1].exec(match[1])) { dateFormat = isoDates[i][0]; allowTime = isoDates[i][2] !== false; break; } } if (dateFormat == null) { config._isValid = false; return; } if (match[3]) { for (i = 0, l = isoTimes.length; i < l; i++) { if (isoTimes[i][1].exec(match[3])) { // match[2] should be 'T' or space timeFormat = (match[2] || ' ') + isoTimes[i][0]; break; } } if (timeFormat == null) { config._isValid = false; return; } } if (!allowTime && timeFormat != null) { config._isValid = false; return; } if (match[4]) { if (tzRegex.exec(match[4])) { tzFormat = 'Z'; } else { config._isValid = false; return; } } config._f = dateFormat + (timeFormat || '') + (tzFormat || ''); configFromStringAndFormat(config); } else { config._isValid = false; } } function extractFromRFC2822Strings( yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr ) { var result = [ untruncateYear(yearStr), defaultLocaleMonthsShort.indexOf(monthStr), parseInt(dayStr, 10), parseInt(hourStr, 10), parseInt(minuteStr, 10), ]; if (secondStr) { result.push(parseInt(secondStr, 10)); } return result; } function untruncateYear(yearStr) { var year = parseInt(yearStr, 10); if (year <= 49) { return 2000 + year; } else if (year <= 999) { return 1900 + year; } return year; } function preprocessRFC2822(s) { // Remove comments and folding whitespace and replace multiple-spaces with a single space return s .replace(/\([^)]*\)|[\n\t]/g, ' ') .replace(/(\s\s+)/g, ' ') .replace(/^\s\s*/, '') .replace(/\s\s*$/, ''); } function checkWeekday(weekdayStr, parsedInput, config) { if (weekdayStr) { // TODO: Replace the vanilla JS Date object with an independent day-of-week check. var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr), weekdayActual = new Date( parsedInput[0], parsedInput[1], parsedInput[2] ).getDay(); if (weekdayProvided !== weekdayActual) { getParsingFlags(config).weekdayMismatch = true; config._isValid = false; return false; } } return true; } function calculateOffset(obsOffset, militaryOffset, numOffset) { if (obsOffset) { return obsOffsets[obsOffset]; } else if (militaryOffset) { // the only allowed military tz is Z return 0; } else { var hm = parseInt(numOffset, 10), m = hm % 100, h = (hm - m) / 100; return h * 60 + m; } } // date and time from ref 2822 format function configFromRFC2822(config) { var match = rfc2822.exec(preprocessRFC2822(config._i)), parsedArray; if (match) { parsedArray = extractFromRFC2822Strings( match[4], match[3], match[2], match[5], match[6], match[7] ); if (!checkWeekday(match[1], parsedArray, config)) { return; } config._a = parsedArray; config._tzm = calculateOffset(match[8], match[9], match[10]); config._d = createUTCDate.apply(null, config._a); config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); getParsingFlags(config).rfc2822 = true; } else { config._isValid = false; } } // date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict function configFromString(config) { var matched = aspNetJsonRegex.exec(config._i); if (matched !== null) { config._d = new Date(+matched[1]); return; } configFromISO(config); if (config._isValid === false) { delete config._isValid; } else { return; } configFromRFC2822(config); if (config._isValid === false) { delete config._isValid; } else { return; } if (config._strict) { config._isValid = false; } else { // Final attempt, use Input Fallback hooks.createFromInputFallback(config); } } hooks.createFromInputFallback = deprecate( 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' + 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' + 'discouraged and will be removed in an upcoming major release. Please refer to ' + 'http://momentjs.com/guides/#/warnings/js-date/ for more info.', function (config) { config._d = new Date(config._i + (config._useUTC ? ' UTC' : '')); } ); // Pick the first defined of two or three arguments. function defaults(a, b, c) { if (a != null) { return a; } if (b != null) { return b; } return c; } function currentDateArray(config) { // hooks is actually the exported moment object var nowValue = new Date(hooks.now()); if (config._useUTC) { return [ nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate(), ]; } return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()]; } // convert an array to a date. // the array should mirror the parameters below // note: all values past the year are optional and will default to the lowest possible value. // [year, month, day , hour, minute, second, millisecond] function configFromArray(config) { var i, date, input = [], currentDate, expectedWeekday, yearToUse; if (config._d) { return; } currentDate = currentDateArray(config); //compute day of the year from weeks and weekdays if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { dayOfYearFromWeekInfo(config); } //if the day of the year is set, figure out what it is if (config._dayOfYear != null) { yearToUse = defaults(config._a[YEAR], currentDate[YEAR]); if ( config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0 ) { getParsingFlags(config)._overflowDayOfYear = true; } date = createUTCDate(yearToUse, 0, config._dayOfYear); config._a[MONTH] = date.getUTCMonth(); config._a[DATE] = date.getUTCDate(); } // Default to current date. // * if no year, month, day of month are given, default to today // * if day of month is given, default month and year // * if month is given, default only year // * if year is given, don't default anything for (i = 0; i < 3 && config._a[i] == null; ++i) { config._a[i] = input[i] = currentDate[i]; } // Zero out whatever was not defaulted, including time for (; i < 7; i++) { config._a[i] = input[i] = config._a[i] == null ? (i === 2 ? 1 : 0) : config._a[i]; } // Check for 24:00:00.000 if ( config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0 ) { config._nextDay = true; config._a[HOUR] = 0; } config._d = (config._useUTC ? createUTCDate : createDate).apply( null, input ); expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay(); // Apply timezone offset from input. The actual utcOffset can be changed // with parseZone. if (config._tzm != null) { config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); } if (config._nextDay) { config._a[HOUR] = 24; } // check for mismatching day of week if ( config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday ) { getParsingFlags(config).weekdayMismatch = true; } } function dayOfYearFromWeekInfo(config) { var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek; w = config._w; if (w.GG != null || w.W != null || w.E != null) { dow = 1; doy = 4; // TODO: We need to take the current isoWeekYear, but that depends on // how we interpret now (local, utc, fixed offset). So create // a now version of current config (take local/utc/offset flags, and // create now). weekYear = defaults( w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year ); week = defaults(w.W, 1); weekday = defaults(w.E, 1); if (weekday < 1 || weekday > 7) { weekdayOverflow = true; } } else { dow = config._locale._week.dow; doy = config._locale._week.doy; curWeek = weekOfYear(createLocal(), dow, doy); weekYear = defaults(w.gg, config._a[YEAR], curWeek.year); // Default to current week. week = defaults(w.w, curWeek.week); if (w.d != null) { // weekday -- low day numbers are considered next week weekday = w.d; if (weekday < 0 || weekday > 6) { weekdayOverflow = true; } } else if (w.e != null) { // local weekday -- counting starts from beginning of week weekday = w.e + dow; if (w.e < 0 || w.e > 6) { weekdayOverflow = true; } } else { // default to beginning of week weekday = dow; } } if (week < 1 || week > weeksInYear(weekYear, dow, doy)) { getParsingFlags(config)._overflowWeeks = true; } else if (weekdayOverflow != null) { getParsingFlags(config)._overflowWeekday = true; } else { temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy); config._a[YEAR] = temp.year; config._dayOfYear = temp.dayOfYear; } } // constant that refers to the ISO standard hooks.ISO_8601 = function () {}; // constant that refers to the RFC 2822 form hooks.RFC_2822 = function () {}; // date from string and format string function configFromStringAndFormat(config) { // TODO: Move this to another part of the creation flow to prevent circular deps if (config._f === hooks.ISO_8601) { configFromISO(config); return; } if (config._f === hooks.RFC_2822) { configFromRFC2822(config); return; } config._a = []; getParsingFlags(config).empty = true; // This array is used to make a Date, either with `new Date` or `Date.UTC` var string = '' + config._i, i, parsedInput, tokens, token, skipped, stringLength = string.length, totalParsedInputLength = 0, era; tokens = expandFormat(config._f, config._locale).match(formattingTokens) || []; for (i = 0; i < tokens.length; i++) { token = tokens[i]; parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; // console.log('token', token, 'parsedInput', parsedInput, // 'regex', getParseRegexForToken(token, config)); if (parsedInput) { skipped = string.substr(0, string.indexOf(parsedInput)); if (skipped.length > 0) { getParsingFlags(config).unusedInput.push(skipped); } string = string.slice( string.indexOf(parsedInput) + parsedInput.length ); totalParsedInputLength += parsedInput.length; } // don't parse if it's not a known token if (formatTokenFunctions[token]) { if (parsedInput) { getParsingFlags(config).empty = false; } else { getParsingFlags(config).unusedTokens.push(token); } addTimeToArrayFromToken(token, parsedInput, config); } else if (config._strict && !parsedInput) { getParsingFlags(config).unusedTokens.push(token); } } // add remaining unparsed input length to the string getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength; if (string.length > 0) { getParsingFlags(config).unusedInput.push(string); } // clear _12h flag if hour is <= 12 if ( config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && config._a[HOUR] > 0 ) { getParsingFlags(config).bigHour = undefined; } getParsingFlags(config).parsedDateParts = config._a.slice(0); getParsingFlags(config).meridiem = config._meridiem; // handle meridiem config._a[HOUR] = meridiemFixWrap( config._locale, config._a[HOUR], config._meridiem ); // handle era era = getParsingFlags(config).era; if (era !== null) { config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]); } configFromArray(config); checkOverflow(config); } function meridiemFixWrap(locale, hour, meridiem) { var isPm; if (meridiem == null) { // nothing to do return hour; } if (locale.meridiemHour != null) { return locale.meridiemHour(hour, meridiem); } else if (locale.isPM != null) { // Fallback isPm = locale.isPM(meridiem); if (isPm && hour < 12) { hour += 12; } if (!isPm && hour === 12) { hour = 0; } return hour; } else { // this is not supposed to happen return hour; } } // date from string and array of format strings function configFromStringAndArray(config) { var tempConfig, bestMoment, scoreToBeat, i, currentScore, validFormatFound, bestFormatIsValid = false; if (config._f.length === 0) { getParsingFlags(config).invalidFormat = true; config._d = new Date(NaN); return; } for (i = 0; i < config._f.length; i++) { currentScore = 0; validFormatFound = false; tempConfig = copyConfig({}, config); if (config._useUTC != null) { tempConfig._useUTC = config._useUTC; } tempConfig._f = config._f[i]; configFromStringAndFormat(tempConfig); if (isValid(tempConfig)) { validFormatFound = true; } // if there is any input that was not parsed add a penalty for that format currentScore += getParsingFlags(tempConfig).charsLeftOver; //or tokens currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10; getParsingFlags(tempConfig).score = currentScore; if (!bestFormatIsValid) { if ( scoreToBeat == null || currentScore < scoreToBeat || validFormatFound ) { scoreToBeat = currentScore; bestMoment = tempConfig; if (validFormatFound) { bestFormatIsValid = true; } } } else { if (currentScore < scoreToBeat) { scoreToBeat = currentScore; bestMoment = tempConfig; } } } extend(config, bestMoment || tempConfig); } function configFromObject(config) { if (config._d) { return; } var i = normalizeObjectUnits(config._i), dayOrDate = i.day === undefined ? i.date : i.day; config._a = map( [i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond], function (obj) { return obj && parseInt(obj, 10); } ); configFromArray(config); } function createFromConfig(config) { var res = new Moment(checkOverflow(prepareConfig(config))); if (res._nextDay) { // Adding is smart enough around DST res.add(1, 'd'); res._nextDay = undefined; } return res; } function prepareConfig(config) { var input = config._i, format = config._f; config._locale = config._locale || getLocale(config._l); if (input === null || (format === undefined && input === '')) { return createInvalid({ nullInput: true }); } if (typeof input === 'string') { config._i = input = config._locale.preparse(input); } if (isMoment(input)) { return new Moment(checkOverflow(input)); } else if (isDate(input)) { config._d = input; } else if (isArray(format)) { configFromStringAndArray(config); } else if (format) { configFromStringAndFormat(config); } else { configFromInput(config); } if (!isValid(config)) { config._d = null; } return config; } function configFromInput(config) { var input = config._i; if (isUndefined(input)) { config._d = new Date(hooks.now()); } else if (isDate(input)) { config._d = new Date(input.valueOf()); } else if (typeof input === 'string') { configFromString(config); } else if (isArray(input)) { config._a = map(input.slice(0), function (obj) { return parseInt(obj, 10); }); configFromArray(config); } else if (isObject(input)) { configFromObject(config); } else if (isNumber(input)) { // from milliseconds config._d = new Date(input); } else { hooks.createFromInputFallback(config); } } function createLocalOrUTC(input, format, locale, strict, isUTC) { var c = {}; if (format === true || format === false) { strict = format; format = undefined; } if (locale === true || locale === false) { strict = locale; locale = undefined; } if ( (isObject(input) && isObjectEmpty(input)) || (isArray(input) && input.length === 0) ) { input = undefined; } // object construction must be done this way. // https://github.com/moment/moment/issues/1423 c._isAMomentObject = true; c._useUTC = c._isUTC = isUTC; c._l = locale; c._i = input; c._f = format; c._strict = strict; return createFromConfig(c); } function createLocal(input, format, locale, strict) { return createLocalOrUTC(input, format, locale, strict, false); } var prototypeMin = deprecate( 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/', function () { var other = createLocal.apply(null, arguments); if (this.isValid() && other.isValid()) { return other < this ? this : other; } else { return createInvalid(); } } ), prototypeMax = deprecate( 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/', function () { var other = createLocal.apply(null, arguments); if (this.isValid() && other.isValid()) { return other > this ? this : other; } else { return createInvalid(); } } ); // Pick a moment m from moments so that m[fn](other) is true for all // other. This relies on the function fn to be transitive. // // moments should either be an array of moment objects or an array, whose // first element is an array of moment objects. function pickBy(fn, moments) { var res, i; if (moments.length === 1 && isArray(moments[0])) { moments = moments[0]; } if (!moments.length) { return createLocal(); } res = moments[0]; for (i = 1; i < moments.length; ++i) { if (!moments[i].isValid() || moments[i][fn](res)) { res = moments[i]; } } return res; } // TODO: Use [].sort instead? function min() { var args = [].slice.call(arguments, 0); return pickBy('isBefore', args); } function max() { var args = [].slice.call(arguments, 0); return pickBy('isAfter', args); } var now = function () { return Date.now ? Date.now() : +new Date(); }; var ordering = [ 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond', ]; function isDurationValid(m) { var key, unitHasDecimal = false, i; for (key in m) { if ( hasOwnProp(m, key) && !( indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])) ) ) { return false; } } for (i = 0; i < ordering.length; ++i) { if (m[ordering[i]]) { if (unitHasDecimal) { return false; // only allow non-integers for smallest unit } if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) { unitHasDecimal = true; } } } return true; } function isValid$1() { return this._isValid; } function createInvalid$1() { return createDuration(NaN); } function Duration(duration) { var normalizedInput = normalizeObjectUnits(duration), years = normalizedInput.year || 0, quarters = normalizedInput.quarter || 0, months = normalizedInput.month || 0, weeks = normalizedInput.week || normalizedInput.isoWeek || 0, days = normalizedInput.day || 0, hours = normalizedInput.hour || 0, minutes = normalizedInput.minute || 0, seconds = normalizedInput.second || 0, milliseconds = normalizedInput.millisecond || 0; this._isValid = isDurationValid(normalizedInput); // representation for dateAddRemove this._milliseconds = +milliseconds + seconds * 1e3 + // 1000 minutes * 6e4 + // 1000 * 60 hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978 // Because of dateAddRemove treats 24 hours as different from a // day when working around DST, we need to store them separately this._days = +days + weeks * 7; // It is impossible to translate months into days without knowing // which months you are are talking about, so we have to store // it separately. this._months = +months + quarters * 3 + years * 12; this._data = {}; this._locale = getLocale(); this._bubble(); } function isDuration(obj) { return obj instanceof Duration; } function absRound(number) { if (number < 0) { return Math.round(-1 * number) * -1; } else { return Math.round(number); } } // compare two arrays, return the number of differences function compareArrays(array1, array2, dontConvert) { var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), diffs = 0, i; for (i = 0; i < len; i++) { if ( (dontConvert && array1[i] !== array2[i]) || (!dontConvert && toInt(array1[i]) !== toInt(array2[i])) ) { diffs++; } } return diffs + lengthDiff; } // FORMATTING function offset(token, separator) { addFormatToken(token, 0, 0, function () { var offset = this.utcOffset(), sign = '+'; if (offset < 0) { offset = -offset; sign = '-'; } return ( sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~offset % 60, 2) ); }); } offset('Z', ':'); offset('ZZ', ''); // PARSING addRegexToken('Z', matchShortOffset); addRegexToken('ZZ', matchShortOffset); addParseToken(['Z', 'ZZ'], function (input, array, config) { config._useUTC = true; config._tzm = offsetFromString(matchShortOffset, input); }); // HELPERS // timezone chunker // '+10:00' > ['10', '00'] // '-1530' > ['-15', '30'] var chunkOffset = /([\+\-]|\d\d)/gi; function offsetFromString(matcher, string) { var matches = (string || '').match(matcher), chunk, parts, minutes; if (matches === null) { return null; } chunk = matches[matches.length - 1] || []; parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; minutes = +(parts[1] * 60) + toInt(parts[2]); return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes; } // Return a moment from input, that is local/utc/zone equivalent to model. function cloneWithOffset(input, model) { var res, diff; if (model._isUTC) { res = model.clone(); diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf(); // Use low-level api, because this fn is low-level api. res._d.setTime(res._d.valueOf() + diff); hooks.updateOffset(res, false); return res; } else { return createLocal(input).local(); } } function getDateOffset(m) { // On Firefox.24 Date#getTimezoneOffset returns a floating point. // https://github.com/moment/moment/pull/1871 return -Math.round(m._d.getTimezoneOffset()); } // HOOKS // This function will be called whenever a moment is mutated. // It is intended to keep the offset in sync with the timezone. hooks.updateOffset = function () {}; // MOMENTS // keepLocalTime = true means only change the timezone, without // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]--> // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset // +0200, so we adjust the time as needed, to be valid. // // Keeping the time actually adds/subtracts (one hour) // from the actual represented time. That is why we call updateOffset // a second time. In case it wants us to change the offset again // _changeInProgress == true case, then we have to adjust, because // there is no such time in the given timezone. function getSetOffset(input, keepLocalTime, keepMinutes) { var offset = this._offset || 0, localAdjust; if (!this.isValid()) { return input != null ? this : NaN; } if (input != null) { if (typeof input === 'string') { input = offsetFromString(matchShortOffset, input); if (input === null) { return this; } } else if (Math.abs(input) < 16 && !keepMinutes) { input = input * 60; } if (!this._isUTC && keepLocalTime) { localAdjust = getDateOffset(this); } this._offset = input; this._isUTC = true; if (localAdjust != null) { this.add(localAdjust, 'm'); } if (offset !== input) { if (!keepLocalTime || this._changeInProgress) { addSubtract( this, createDuration(input - offset, 'm'), 1, false ); } else if (!this._changeInProgress) { this._changeInProgress = true; hooks.updateOffset(this, true); this._changeInProgress = null; } } return this; } else { return this._isUTC ? offset : getDateOffset(this); } } function getSetZone(input, keepLocalTime) { if (input != null) { if (typeof input !== 'string') { input = -input; } this.utcOffset(input, keepLocalTime); return this; } else { return -this.utcOffset(); } } function setOffsetToUTC(keepLocalTime) { return this.utcOffset(0, keepLocalTime); } function setOffsetToLocal(keepLocalTime) { if (this._isUTC) { this.utcOffset(0, keepLocalTime); this._isUTC = false; if (keepLocalTime) { this.subtract(getDateOffset(this), 'm'); } } return this; } function setOffsetToParsedOffset() { if (this._tzm != null) { this.utcOffset(this._tzm, false, true); } else if (typeof this._i === 'string') { var tZone = offsetFromString(matchOffset, this._i); if (tZone != null) { this.utcOffset(tZone); } else { this.utcOffset(0, true); } } return this; } function hasAlignedHourOffset(input) { if (!this.isValid()) { return false; } input = input ? createLocal(input).utcOffset() : 0; return (this.utcOffset() - input) % 60 === 0; } function isDaylightSavingTime() { return ( this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset() ); } function isDaylightSavingTimeShifted() { if (!isUndefined(this._isDSTShifted)) { return this._isDSTShifted; } var c = {}, other; copyConfig(c, this); c = prepareConfig(c); if (c._a) { other = c._isUTC ? createUTC(c._a) : createLocal(c._a); this._isDSTShifted = this.isValid() && compareArrays(c._a, other.toArray()) > 0; } else { this._isDSTShifted = false; } return this._isDSTShifted; } function isLocal() { return this.isValid() ? !this._isUTC : false; } function isUtcOffset() { return this.isValid() ? this._isUTC : false; } function isUtc() { return this.isValid() ? this._isUTC && this._offset === 0 : false; } // ASP.NET json date format regex var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/, // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere // and further modified to allow for strings containing both week and day isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/; function createDuration(input, key) { var duration = input, // matching against regexp is expensive, do it on demand match = null, sign, ret, diffRes; if (isDuration(input)) { duration = { ms: input._milliseconds, d: input._days, M: input._months, }; } else if (isNumber(input) || !isNaN(+input)) { duration = {}; if (key) { duration[key] = +input; } else { duration.milliseconds = +input; } } else if ((match = aspNetRegex.exec(input))) { sign = match[1] === '-' ? -1 : 1; duration = { y: 0, d: toInt(match[DATE]) * sign, h: toInt(match[HOUR]) * sign, m: toInt(match[MINUTE]) * sign, s: toInt(match[SECOND]) * sign, ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign, // the millisecond decimal point is included in the match }; } else if ((match = isoRegex.exec(input))) { sign = match[1] === '-' ? -1 : 1; duration = { y: parseIso(match[2], sign), M: parseIso(match[3], sign), w: parseIso(match[4], sign), d: parseIso(match[5], sign), h: parseIso(match[6], sign), m: parseIso(match[7], sign), s: parseIso(match[8], sign), }; } else if (duration == null) { // checks for null or undefined duration = {}; } else if ( typeof duration === 'object' && ('from' in duration || 'to' in duration) ) { diffRes = momentsDifference( createLocal(duration.from), createLocal(duration.to) ); duration = {}; duration.ms = diffRes.milliseconds; duration.M = diffRes.months; } ret = new Duration(duration); if (isDuration(input) && hasOwnProp(input, '_locale')) { ret._locale = input._locale; } if (isDuration(input) && hasOwnProp(input, '_isValid')) { ret._isValid = input._isValid; } return ret; } createDuration.fn = Duration.prototype; createDuration.invalid = createInvalid$1; function parseIso(inp, sign) { // We'd normally use ~~inp for this, but unfortunately it also // converts floats to ints. // inp may be undefined, so careful calling replace on it. var res = inp && parseFloat(inp.replace(',', '.')); // apply sign while we're at it return (isNaN(res) ? 0 : res) * sign; } function positiveMomentsDifference(base, other) { var res = {}; res.months = other.month() - base.month() + (other.year() - base.year()) * 12; if (base.clone().add(res.months, 'M').isAfter(other)) { --res.months; } res.milliseconds = +other - +base.clone().add(res.months, 'M'); return res; } function momentsDifference(base, other) { var res; if (!(base.isValid() && other.isValid())) { return { milliseconds: 0, months: 0 }; } other = cloneWithOffset(other, base); if (base.isBefore(other)) { res = positiveMomentsDifference(base, other); } else { res = positiveMomentsDifference(other, base); res.milliseconds = -res.milliseconds; res.months = -res.months; } return res; } // TODO: remove 'name' arg after deprecation is removed function createAdder(direction, name) { return function (val, period) { var dur, tmp; //invert the arguments, but complain about it if (period !== null && !isNaN(+period)) { deprecateSimple( name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' + 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.' ); tmp = val; val = period; period = tmp; } dur = createDuration(val, period); addSubtract(this, dur, direction); return this; }; } function addSubtract(mom, duration, isAdding, updateOffset) { var milliseconds = duration._milliseconds, days = absRound(duration._days), months = absRound(duration._months); if (!mom.isValid()) { // No op return; } updateOffset = updateOffset == null ? true : updateOffset; if (months) { setMonth(mom, get(mom, 'Month') + months * isAdding); } if (days) { set$1(mom, 'Date', get(mom, 'Date') + days * isAdding); } if (milliseconds) { mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding); } if (updateOffset) { hooks.updateOffset(mom, days || months); } } var add = createAdder(1, 'add'), subtract = createAdder(-1, 'subtract'); function isString(input) { return typeof input === 'string' || input instanceof String; } // type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined function isMomentInput(input) { return ( isMoment(input) || isDate(input) || isString(input) || isNumber(input) || isNumberOrStringArray(input) || isMomentInputObject(input) || input === null || input === undefined ); } function isMomentInputObject(input) { var objectTest = isObject(input) && !isObjectEmpty(input), propertyTest = false, properties = [ 'years', 'year', 'y', 'months', 'month', 'M', 'days', 'day', 'd', 'dates', 'date', 'D', 'hours', 'hour', 'h', 'minutes', 'minute', 'm', 'seconds', 'second', 's', 'milliseconds', 'millisecond', 'ms', ], i, property; for (i = 0; i < properties.length; i += 1) { property = properties[i]; propertyTest = propertyTest || hasOwnProp(input, property); } return objectTest && propertyTest; } function isNumberOrStringArray(input) { var arrayTest = isArray(input), dataTypeTest = false; if (arrayTest) { dataTypeTest = input.filter(function (item) { return !isNumber(item) && isString(input); }).length === 0; } return arrayTest && dataTypeTest; } function isCalendarSpec(input) { var objectTest = isObject(input) && !isObjectEmpty(input), propertyTest = false, properties = [ 'sameDay', 'nextDay', 'lastDay', 'nextWeek', 'lastWeek', 'sameElse', ], i, property; for (i = 0; i < properties.length; i += 1) { property = properties[i]; propertyTest = propertyTest || hasOwnProp(input, property); } return objectTest && propertyTest; } function getCalendarFormat(myMoment, now) { var diff = myMoment.diff(now, 'days', true); return diff < -6 ? 'sameElse' : diff < -1 ? 'lastWeek' : diff < 0 ? 'lastDay' : diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : 'sameElse'; } function calendar$1(time, formats) { // Support for single parameter, formats only overload to the calendar function if (arguments.length === 1) { if (isMomentInput(arguments[0])) { time = arguments[0]; formats = undefined; } else if (isCalendarSpec(arguments[0])) { formats = arguments[0]; time = undefined; } } // We want to compare the start of today, vs this. // Getting start-of-today depends on whether we're local/utc/offset or not. var now = time || createLocal(), sod = cloneWithOffset(now, this).startOf('day'), format = hooks.calendarFormat(this, sod) || 'sameElse', output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]); return this.format( output || this.localeData().calendar(format, this, createLocal(now)) ); } function clone() { return new Moment(this); } function isAfter(input, units) { var localInput = isMoment(input) ? input : createLocal(input); if (!(this.isValid() && localInput.isValid())) { return false; } units = normalizeUnits(units) || 'millisecond'; if (units === 'millisecond') { return this.valueOf() > localInput.valueOf(); } else { return localInput.valueOf() < this.clone().startOf(units).valueOf(); } } function isBefore(input, units) { var localInput = isMoment(input) ? input : createLocal(input); if (!(this.isValid() && localInput.isValid())) { return false; } units = normalizeUnits(units) || 'millisecond'; if (units === 'millisecond') { return this.valueOf() < localInput.valueOf(); } else { return this.clone().endOf(units).valueOf() < localInput.valueOf(); } } function isBetween(from, to, units, inclusivity) { var localFrom = isMoment(from) ? from : createLocal(from), localTo = isMoment(to) ? to : createLocal(to); if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) { return false; } inclusivity = inclusivity || '()'; return ( (inclusivity[0] === '(' ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) && (inclusivity[1] === ')' ? this.isBefore(localTo, units) : !this.isAfter(localTo, units)) ); } function isSame(input, units) { var localInput = isMoment(input) ? input : createLocal(input), inputMs; if (!(this.isValid() && localInput.isValid())) { return false; } units = normalizeUnits(units) || 'millisecond'; if (units === 'millisecond') { return this.valueOf() === localInput.valueOf(); } else { inputMs = localInput.valueOf(); return ( this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf() ); } } function isSameOrAfter(input, units) { return this.isSame(input, units) || this.isAfter(input, units); } function isSameOrBefore(input, units) { return this.isSame(input, units) || this.isBefore(input, units); } function diff(input, units, asFloat) { var that, zoneDelta, output; if (!this.isValid()) { return NaN; } that = cloneWithOffset(input, this); if (!that.isValid()) { return NaN; } zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; units = normalizeUnits(units); switch (units) { case 'year': output = monthDiff(this, that) / 12; break; case 'month': output = monthDiff(this, that); break; case 'quarter': output = monthDiff(this, that) / 3; break; case 'second': output = (this - that) / 1e3; break; // 1000 case 'minute': output = (this - that) / 6e4; break; // 1000 * 60 case 'hour': output = (this - that) / 36e5; break; // 1000 * 60 * 60 case 'day': output = (this - that - zoneDelta) / 864e5; break; // 1000 * 60 * 60 * 24, negate dst case 'week': output = (this - that - zoneDelta) / 6048e5; break; // 1000 * 60 * 60 * 24 * 7, negate dst default: output = this - that; } return asFloat ? output : absFloor(output); } function monthDiff(a, b) { if (a.date() < b.date()) { // end-of-month calculations work correct when the start month has more // days than the end month. return -monthDiff(b, a); } // difference in months var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()), // b is in (anchor - 1 month, anchor + 1 month) anchor = a.clone().add(wholeMonthDiff, 'months'), anchor2, adjust; if (b - anchor < 0) { anchor2 = a.clone().add(wholeMonthDiff - 1, 'months'); // linear across the month adjust = (b - anchor) / (anchor - anchor2); } else { anchor2 = a.clone().add(wholeMonthDiff + 1, 'months'); // linear across the month adjust = (b - anchor) / (anchor2 - anchor); } //check for negative zero, return zero if negative zero return -(wholeMonthDiff + adjust) || 0; } hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ'; hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]'; function toString() { return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ'); } function toISOString(keepOffset) { if (!this.isValid()) { return null; } var utc = keepOffset !== true, m = utc ? this.clone().utc() : this; if (m.year() < 0 || m.year() > 9999) { return formatMoment( m, utc ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ' ); } if (isFunction(Date.prototype.toISOString)) { // native implementation is ~50x faster, use it when we can if (utc) { return this.toDate().toISOString(); } else { return new Date(this.valueOf() + this.utcOffset() * 60 * 1000) .toISOString() .replace('Z', formatMoment(m, 'Z')); } } return formatMoment( m, utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ' ); } /** * Return a human readable representation of a moment that can * also be evaluated to get a new moment which is the same * * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects */ function inspect() { if (!this.isValid()) { return 'moment.invalid(/* ' + this._i + ' */)'; } var func = 'moment', zone = '', prefix, year, datetime, suffix; if (!this.isLocal()) { func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone'; zone = 'Z'; } prefix = '[' + func + '("]'; year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY'; datetime = '-MM-DD[T]HH:mm:ss.SSS'; suffix = zone + '[")]'; return this.format(prefix + year + datetime + suffix); } function format(inputString) { if (!inputString) { inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat; } var output = formatMoment(this, inputString); return this.localeData().postformat(output); } function from(time, withoutSuffix) { if ( this.isValid() && ((isMoment(time) && time.isValid()) || createLocal(time).isValid()) ) { return createDuration({ to: this, from: time }) .locale(this.locale()) .humanize(!withoutSuffix); } else { return this.localeData().invalidDate(); } } function fromNow(withoutSuffix) { return this.from(createLocal(), withoutSuffix); } function to(time, withoutSuffix) { if ( this.isValid() && ((isMoment(time) && time.isValid()) || createLocal(time).isValid()) ) { return createDuration({ from: this, to: time }) .locale(this.locale()) .humanize(!withoutSuffix); } else { return this.localeData().invalidDate(); } } function toNow(withoutSuffix) { return this.to(createLocal(), withoutSuffix); } // If passed a locale key, it will set the locale for this // instance. Otherwise, it will return the locale configuration // variables for this instance. function locale(key) { var newLocaleData; if (key === undefined) { return this._locale._abbr; } else { newLocaleData = getLocale(key); if (newLocaleData != null) { this._locale = newLocaleData; } return this; } } var lang = deprecate( 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', function (key) { if (key === undefined) { return this.localeData(); } else { return this.locale(key); } } ); function localeData() { return this._locale; } var MS_PER_SECOND = 1000, MS_PER_MINUTE = 60 * MS_PER_SECOND, MS_PER_HOUR = 60 * MS_PER_MINUTE, MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR; // actual modulo - handles negative numbers (for dates before 1970): function mod$1(dividend, divisor) { return ((dividend % divisor) + divisor) % divisor; } function localStartOfDate(y, m, d) { // the date constructor remaps years 0-99 to 1900-1999 if (y < 100 && y >= 0) { // preserve leap years using a full 400 year cycle, then reset return new Date(y + 400, m, d) - MS_PER_400_YEARS; } else { return new Date(y, m, d).valueOf(); } } function utcStartOfDate(y, m, d) { // Date.UTC remaps years 0-99 to 1900-1999 if (y < 100 && y >= 0) { // preserve leap years using a full 400 year cycle, then reset return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS; } else { return Date.UTC(y, m, d); } } function startOf(units) { var time, startOfDate; units = normalizeUnits(units); if (units === undefined || units === 'millisecond' || !this.isValid()) { return this; } startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; switch (units) { case 'year': time = startOfDate(this.year(), 0, 1); break; case 'quarter': time = startOfDate( this.year(), this.month() - (this.month() % 3), 1 ); break; case 'month': time = startOfDate(this.year(), this.month(), 1); break; case 'week': time = startOfDate( this.year(), this.month(), this.date() - this.weekday() ); break; case 'isoWeek': time = startOfDate( this.year(), this.month(), this.date() - (this.isoWeekday() - 1) ); break; case 'day': case 'date': time = startOfDate(this.year(), this.month(), this.date()); break; case 'hour': time = this._d.valueOf(); time -= mod$1( time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR ); break; case 'minute': time = this._d.valueOf(); time -= mod$1(time, MS_PER_MINUTE); break; case 'second': time = this._d.valueOf(); time -= mod$1(time, MS_PER_SECOND); break; } this._d.setTime(time); hooks.updateOffset(this, true); return this; } function endOf(units) { var time, startOfDate; units = normalizeUnits(units); if (units === undefined || units === 'millisecond' || !this.isValid()) { return this; } startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; switch (units) { case 'year': time = startOfDate(this.year() + 1, 0, 1) - 1; break; case 'quarter': time = startOfDate( this.year(), this.month() - (this.month() % 3) + 3, 1 ) - 1; break; case 'month': time = startOfDate(this.year(), this.month() + 1, 1) - 1; break; case 'week': time = startOfDate( this.year(), this.month(), this.date() - this.weekday() + 7 ) - 1; break; case 'isoWeek': time = startOfDate( this.year(), this.month(), this.date() - (this.isoWeekday() - 1) + 7 ) - 1; break; case 'day': case 'date': time = startOfDate(this.year(), this.month(), this.date() + 1) - 1; break; case 'hour': time = this._d.valueOf(); time += MS_PER_HOUR - mod$1( time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR ) - 1; break; case 'minute': time = this._d.valueOf(); time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1; break; case 'second': time = this._d.valueOf(); time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1; break; } this._d.setTime(time); hooks.updateOffset(this, true); return this; } function valueOf() { return this._d.valueOf() - (this._offset || 0) * 60000; } function unix() { return Math.floor(this.valueOf() / 1000); } function toDate() { return new Date(this.valueOf()); } function toArray() { var m = this; return [ m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond(), ]; } function toObject() { 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(), }; } function toJSON() { // new Date(NaN).toJSON() === null return this.isValid() ? this.toISOString() : null; } function isValid$2() { return isValid(this); } function parsingFlags() { return extend({}, getParsingFlags(this)); } function invalidAt() { return getParsingFlags(this).overflow; } function creationData() { return { input: this._i, format: this._f, locale: this._locale, isUTC: this._isUTC, strict: this._strict, }; } addFormatToken('N', 0, 0, 'eraAbbr'); addFormatToken('NN', 0, 0, 'eraAbbr'); addFormatToken('NNN', 0, 0, 'eraAbbr'); addFormatToken('NNNN', 0, 0, 'eraName'); addFormatToken('NNNNN', 0, 0, 'eraNarrow'); addFormatToken('y', ['y', 1], 'yo', 'eraYear'); addFormatToken('y', ['yy', 2], 0, 'eraYear'); addFormatToken('y', ['yyy', 3], 0, 'eraYear'); addFormatToken('y', ['yyyy', 4], 0, 'eraYear'); addRegexToken('N', matchEraAbbr); addRegexToken('NN', matchEraAbbr); addRegexToken('NNN', matchEraAbbr); addRegexToken('NNNN', matchEraName); addRegexToken('NNNNN', matchEraNarrow); addParseToken(['N', 'NN', 'NNN', 'NNNN', 'NNNNN'], function ( input, array, config, token ) { var era = config._locale.erasParse(input, token, config._strict); if (era) { getParsingFlags(config).era = era; } else { getParsingFlags(config).invalidEra = input; } }); addRegexToken('y', matchUnsigned); addRegexToken('yy', matchUnsigned); addRegexToken('yyy', matchUnsigned); addRegexToken('yyyy', matchUnsigned); addRegexToken('yo', matchEraYearOrdinal); addParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR); addParseToken(['yo'], function (input, array, config, token) { var match; if (config._locale._eraYearOrdinalRegex) { match = input.match(config._locale._eraYearOrdinalRegex); } if (config._locale.eraYearOrdinalParse) { array[YEAR] = config._locale.eraYearOrdinalParse(input, match); } else { array[YEAR] = parseInt(input, 10); } }); function localeEras(m, format) { var i, l, date, eras = this._eras || getLocale('en')._eras; for (i = 0, l = eras.length; i < l; ++i) { switch (typeof eras[i].since) { case 'string': // truncate time date = hooks(eras[i].since).startOf('day'); eras[i].since = date.valueOf(); break; } switch (typeof eras[i].until) { case 'undefined': eras[i].until = +Infinity; break; case 'string': // truncate time date = hooks(eras[i].until).startOf('day').valueOf(); eras[i].until = date.valueOf(); break; } } return eras; } function localeErasParse(eraName, format, strict) { var i, l, eras = this.eras(), name, abbr, narrow; eraName = eraName.toUpperCase(); for (i = 0, l = eras.length; i < l; ++i) { name = eras[i].name.toUpperCase(); abbr = eras[i].abbr.toUpperCase(); narrow = eras[i].narrow.toUpperCase(); if (strict) { switch (format) { case 'N': case 'NN': case 'NNN': if (abbr === eraName) { return eras[i]; } break; case 'NNNN': if (name === eraName) { return eras[i]; } break; case 'NNNNN': if (narrow === eraName) { return eras[i]; } break; } } else if ([name, abbr, narrow].indexOf(eraName) >= 0) { return eras[i]; } } } function localeErasConvertYear(era, year) { var dir = era.since <= era.until ? +1 : -1; if (year === undefined) { return hooks(era.since).year(); } else { return hooks(era.since).year() + (year - era.offset) * dir; } } function getEraName() { var i, l, val, eras = this.localeData().eras(); for (i = 0, l = eras.length; i < l; ++i) { // truncate time val = this.startOf('day').valueOf(); if (eras[i].since <= val && val <= eras[i].until) { return eras[i].name; } if (eras[i].until <= val && val <= eras[i].since) { return eras[i].name; } } return ''; } function getEraNarrow() { var i, l, val, eras = this.localeData().eras(); for (i = 0, l = eras.length; i < l; ++i) { // truncate time val = this.startOf('day').valueOf(); if (eras[i].since <= val && val <= eras[i].until) { return eras[i].narrow; } if (eras[i].until <= val && val <= eras[i].since) { return eras[i].narrow; } } return ''; } function getEraAbbr() { var i, l, val, eras = this.localeData().eras(); for (i = 0, l = eras.length; i < l; ++i) { // truncate time val = this.startOf('day').valueOf(); if (eras[i].since <= val && val <= eras[i].until) { return eras[i].abbr; } if (eras[i].until <= val && val <= eras[i].since) { return eras[i].abbr; } } return ''; } function getEraYear() { var i, l, dir, val, eras = this.localeData().eras(); for (i = 0, l = eras.length; i < l; ++i) { dir = eras[i].since <= eras[i].until ? +1 : -1; // truncate time val = this.startOf('day').valueOf(); if ( (eras[i].since <= val && val <= eras[i].until) || (eras[i].until <= val && val <= eras[i].since) ) { return ( (this.year() - hooks(eras[i].since).year()) * dir + eras[i].offset ); } } return this.year(); } function erasNameRegex(isStrict) { if (!hasOwnProp(this, '_erasNameRegex')) { computeErasParse.call(this); } return isStrict ? this._erasNameRegex : this._erasRegex; } function erasAbbrRegex(isStrict) { if (!hasOwnProp(this, '_erasAbbrRegex')) { computeErasParse.call(this); } return isStrict ? this._erasAbbrRegex : this._erasRegex; } function erasNarrowRegex(isStrict) { if (!hasOwnProp(this, '_erasNarrowRegex')) { computeErasParse.call(this); } return isStrict ? this._erasNarrowRegex : this._erasRegex; } function matchEraAbbr(isStrict, locale) { return locale.erasAbbrRegex(isStrict); } function matchEraName(isStrict, locale) { return locale.erasNameRegex(isStrict); } function matchEraNarrow(isStrict, locale) { return locale.erasNarrowRegex(isStrict); } function matchEraYearOrdinal(isStrict, locale) { return locale._eraYearOrdinalRegex || matchUnsigned; } function computeErasParse() { var abbrPieces = [], namePieces = [], narrowPieces = [], mixedPieces = [], i, l, eras = this.eras(); for (i = 0, l = eras.length; i < l; ++i) { namePieces.push(regexEscape(eras[i].name)); abbrPieces.push(regexEscape(eras[i].abbr)); narrowPieces.push(regexEscape(eras[i].narrow)); mixedPieces.push(regexEscape(eras[i].name)); mixedPieces.push(regexEscape(eras[i].abbr)); mixedPieces.push(regexEscape(eras[i].narrow)); } this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i'); this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i'); this._erasNarrowRegex = new RegExp( '^(' + narrowPieces.join('|') + ')', 'i' ); } // FORMATTING addFormatToken(0, ['gg', 2], 0, function () { return this.weekYear() % 100; }); addFormatToken(0, ['GG', 2], 0, function () { return this.isoWeekYear() % 100; }); function addWeekYearFormatToken(token, getter) { addFormatToken(0, [token, token.length], 0, getter); } addWeekYearFormatToken('gggg', 'weekYear'); addWeekYearFormatToken('ggggg', 'weekYear'); addWeekYearFormatToken('GGGG', 'isoWeekYear'); addWeekYearFormatToken('GGGGG', 'isoWeekYear'); // ALIASES addUnitAlias('weekYear', 'gg'); addUnitAlias('isoWeekYear', 'GG'); // PRIORITY addUnitPriority('weekYear', 1); addUnitPriority('isoWeekYear', 1); // PARSING 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] = hooks.parseTwoDigitYear(input); }); // MOMENTS function getSetWeekYear(input) { return getSetWeekYearHelper.call( this, input, this.week(), this.weekday(), this.localeData()._week.dow, this.localeData()._week.doy ); } function getSetISOWeekYear(input) { return getSetWeekYearHelper.call( this, input, this.isoWeek(), this.isoWeekday(), 1, 4 ); } function getISOWeeksInYear() { return weeksInYear(this.year(), 1, 4); } function getISOWeeksInISOWeekYear() { return weeksInYear(this.isoWeekYear(), 1, 4); } function getWeeksInYear() { var weekInfo = this.localeData()._week; return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); } function getWeeksInWeekYear() { var weekInfo = this.localeData()._week; return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy); } function getSetWeekYearHelper(input, week, weekday, dow, doy) { var weeksTarget; if (input == null) { return weekOfYear(this, dow, doy).year; } else { weeksTarget = weeksInYear(input, dow, doy); if (week > weeksTarget) { week = weeksTarget; } return setWeekAll.call(this, input, week, weekday, dow, doy); } } function setWeekAll(weekYear, week, weekday, dow, doy) { var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); this.year(date.getUTCFullYear()); this.month(date.getUTCMonth()); this.date(date.getUTCDate()); return this; } // FORMATTING addFormatToken('Q', 0, 'Qo', 'quarter'); // ALIASES addUnitAlias('quarter', 'Q'); // PRIORITY addUnitPriority('quarter', 7); // PARSING addRegexToken('Q', match1); addParseToken('Q', function (input, array) { array[MONTH] = (toInt(input) - 1) * 3; }); // MOMENTS function getSetQuarter(input) { return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + (this.month() % 3)); } // FORMATTING addFormatToken('D', ['DD', 2], 'Do', 'date'); // ALIASES addUnitAlias('date', 'D'); // PRIORITY addUnitPriority('date', 9); // PARSING addRegexToken('D', match1to2); addRegexToken('DD', match1to2, match2); addRegexToken('Do', function (isStrict, locale) { // TODO: Remove "ordinalParse" fallback in next major release. return isStrict ? locale._dayOfMonthOrdinalParse || locale._ordinalParse : locale._dayOfMonthOrdinalParseLenient; }); addParseToken(['D', 'DD'], DATE); addParseToken('Do', function (input, array) { array[DATE] = toInt(input.match(match1to2)[0]); }); // MOMENTS var getSetDayOfMonth = makeGetSet('Date', true); // FORMATTING addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); // ALIASES addUnitAlias('dayOfYear', 'DDD'); // PRIORITY addUnitPriority('dayOfYear', 4); // PARSING addRegexToken('DDD', match1to3); addRegexToken('DDDD', match3); addParseToken(['DDD', 'DDDD'], function (input, array, config) { config._dayOfYear = toInt(input); }); // HELPERS // MOMENTS function getSetDayOfYear(input) { var dayOfYear = Math.round( (this.clone().startOf('day') - this.clone().startOf('year')) / 864e5 ) + 1; return input == null ? dayOfYear : this.add(input - dayOfYear, 'd'); } // FORMATTING addFormatToken('m', ['mm', 2], 0, 'minute'); // ALIASES addUnitAlias('minute', 'm'); // PRIORITY addUnitPriority('minute', 14); // PARSING addRegexToken('m', match1to2); addRegexToken('mm', match1to2, match2); addParseToken(['m', 'mm'], MINUTE); // MOMENTS var getSetMinute = makeGetSet('Minutes', false); // FORMATTING addFormatToken('s', ['ss', 2], 0, 'second'); // ALIASES addUnitAlias('second', 's'); // PRIORITY addUnitPriority('second', 15); // PARSING addRegexToken('s', match1to2); addRegexToken('ss', match1to2, match2); addParseToken(['s', 'ss'], SECOND); // MOMENTS var getSetSecond = makeGetSet('Seconds', false); // FORMATTING 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 this.millisecond() * 10; }); addFormatToken(0, ['SSSSS', 5], 0, function () { return this.millisecond() * 100; }); addFormatToken(0, ['SSSSSS', 6], 0, function () { return this.millisecond() * 1000; }); addFormatToken(0, ['SSSSSSS', 7], 0, function () { return this.millisecond() * 10000; }); addFormatToken(0, ['SSSSSSSS', 8], 0, function () { return this.millisecond() * 100000; }); addFormatToken(0, ['SSSSSSSSS', 9], 0, function () { return this.millisecond() * 1000000; }); // ALIASES addUnitAlias('millisecond', 'ms'); // PRIORITY addUnitPriority('millisecond', 16); // PARSING addRegexToken('S', match1to3, match1); addRegexToken('SS', match1to3, match2); addRegexToken('SSS', match1to3, match3); var token, getSetMillisecond; for (token = 'SSSS'; token.length <= 9; token += 'S') { addRegexToken(token, matchUnsigned); } function parseMs(input, array) { array[MILLISECOND] = toInt(('0.' + input) * 1000); } for (token = 'S'; token.length <= 9; token += 'S') { addParseToken(token, parseMs); } getSetMillisecond = makeGetSet('Milliseconds', false); // FORMATTING addFormatToken('z', 0, 0, 'zoneAbbr'); addFormatToken('zz', 0, 0, 'zoneName'); // MOMENTS function getZoneAbbr() { return this._isUTC ? 'UTC' : ''; } function getZoneName() { return this._isUTC ? 'Coordinated Universal Time' : ''; } var proto = Moment.prototype; proto.add = add; proto.calendar = calendar$1; proto.clone = clone; proto.diff = diff; proto.endOf = endOf; proto.format = format; proto.from = from; proto.fromNow = fromNow; proto.to = to; proto.toNow = toNow; proto.get = stringGet; proto.invalidAt = invalidAt; proto.isAfter = isAfter; proto.isBefore = isBefore; proto.isBetween = isBetween; proto.isSame = isSame; proto.isSameOrAfter = isSameOrAfter; proto.isSameOrBefore = isSameOrBefore; proto.isValid = isValid$2; proto.lang = lang; proto.locale = locale; proto.localeData = localeData; proto.max = prototypeMax; proto.min = prototypeMin; proto.parsingFlags = parsingFlags; proto.set = stringSet; proto.startOf = startOf; proto.subtract = subtract; proto.toArray = toArray; proto.toObject = toObject; proto.toDate = toDate; proto.toISOString = toISOString; proto.inspect = inspect; if (typeof Symbol !== 'undefined' && Symbol.for != null) { proto[Symbol.for('nodejs.util.inspect.custom')] = function () { return 'Moment<' + this.format() + '>'; }; } proto.toJSON = toJSON; proto.toString = toString; proto.unix = unix; proto.valueOf = valueOf; proto.creationData = creationData; proto.eraName = getEraName; proto.eraNarrow = getEraNarrow; proto.eraAbbr = getEraAbbr; proto.eraYear = getEraYear; proto.year = getSetYear; proto.isLeapYear = getIsLeapYear; proto.weekYear = getSetWeekYear; proto.isoWeekYear = getSetISOWeekYear; proto.quarter = proto.quarters = getSetQuarter; proto.month = getSetMonth; proto.daysInMonth = getDaysInMonth; proto.week = proto.weeks = getSetWeek; proto.isoWeek = proto.isoWeeks = getSetISOWeek; proto.weeksInYear = getWeeksInYear; proto.weeksInWeekYear = getWeeksInWeekYear; proto.isoWeeksInYear = getISOWeeksInYear; proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear; proto.date = getSetDayOfMonth; proto.day = proto.days = getSetDayOfWeek; proto.weekday = getSetLocaleDayOfWeek; proto.isoWeekday = getSetISODayOfWeek; proto.dayOfYear = getSetDayOfYear; proto.hour = proto.hours = getSetHour; proto.minute = proto.minutes = getSetMinute; proto.second = proto.seconds = getSetSecond; proto.millisecond = proto.milliseconds = getSetMillisecond; proto.utcOffset = getSetOffset; proto.utc = setOffsetToUTC; proto.local = setOffsetToLocal; proto.parseZone = setOffsetToParsedOffset; proto.hasAlignedHourOffset = hasAlignedHourOffset; proto.isDST = isDaylightSavingTime; proto.isLocal = isLocal; proto.isUtcOffset = isUtcOffset; proto.isUtc = isUtc; proto.isUTC = isUtc; proto.zoneAbbr = getZoneAbbr; proto.zoneName = getZoneName; proto.dates = deprecate( 'dates accessor is deprecated. Use date instead.', getSetDayOfMonth ); proto.months = deprecate( 'months accessor is deprecated. Use month instead', getSetMonth ); proto.years = deprecate( 'years accessor is deprecated. Use year instead', getSetYear ); proto.zone = deprecate( 'moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone ); proto.isDSTShifted = deprecate( 'isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted ); function createUnix(input) { return createLocal(input * 1000); } function createInZone() { return createLocal.apply(null, arguments).parseZone(); } function preParsePostFormat(string) { return string; } var proto$1 = Locale.prototype; proto$1.calendar = calendar; proto$1.longDateFormat = longDateFormat; proto$1.invalidDate = invalidDate; proto$1.ordinal = ordinal; proto$1.preparse = preParsePostFormat; proto$1.postformat = preParsePostFormat; proto$1.relativeTime = relativeTime; proto$1.pastFuture = pastFuture; proto$1.set = set; proto$1.eras = localeEras; proto$1.erasParse = localeErasParse; proto$1.erasConvertYear = localeErasConvertYear; proto$1.erasAbbrRegex = erasAbbrRegex; proto$1.erasNameRegex = erasNameRegex; proto$1.erasNarrowRegex = erasNarrowRegex; proto$1.months = localeMonths; proto$1.monthsShort = localeMonthsShort; proto$1.monthsParse = localeMonthsParse; proto$1.monthsRegex = monthsRegex; proto$1.monthsShortRegex = monthsShortRegex; proto$1.week = localeWeek; proto$1.firstDayOfYear = localeFirstDayOfYear; proto$1.firstDayOfWeek = localeFirstDayOfWeek; proto$1.weekdays = localeWeekdays; proto$1.weekdaysMin = localeWeekdaysMin; proto$1.weekdaysShort = localeWeekdaysShort; proto$1.weekdaysParse = localeWeekdaysParse; proto$1.weekdaysRegex = weekdaysRegex; proto$1.weekdaysShortRegex = weekdaysShortRegex; proto$1.weekdaysMinRegex = weekdaysMinRegex; proto$1.isPM = localeIsPM; proto$1.meridiem = localeMeridiem; function get$1(format, index, field, setter) { var locale = getLocale(), utc = createUTC().set(setter, index); return locale[field](utc, format); } function listMonthsImpl(format, index, field) { if (isNumber(format)) { index = format; format = undefined; } format = format || ''; if (index != null) { return get$1(format, index, field, 'month'); } var i, out = []; for (i = 0; i < 12; i++) { out[i] = get$1(format, i, field, 'month'); } return out; } // () // (5) // (fmt, 5) // (fmt) // (true) // (true, 5) // (true, fmt, 5) // (true, fmt) function listWeekdaysImpl(localeSorted, format, index, field) { if (typeof localeSorted === 'boolean') { if (isNumber(format)) { index = format; format = undefined; } format = format || ''; } else { format = localeSorted; index = format; localeSorted = false; if (isNumber(format)) { index = format; format = undefined; } format = format || ''; } var locale = getLocale(), shift = localeSorted ? locale._week.dow : 0, i, out = []; if (index != null) { return get$1(format, (index + shift) % 7, field, 'day'); } for (i = 0; i < 7; i++) { out[i] = get$1(format, (i + shift) % 7, field, 'day'); } return out; } function listMonths(format, index) { return listMonthsImpl(format, index, 'months'); } function listMonthsShort(format, index) { return listMonthsImpl(format, index, 'monthsShort'); } function listWeekdays(localeSorted, format, index) { return listWeekdaysImpl(localeSorted, format, index, 'weekdays'); } function listWeekdaysShort(localeSorted, format, index) { return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort'); } function listWeekdaysMin(localeSorted, format, index) { return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin'); } getSetGlobalLocale('en', { eras: [ { since: '0001-01-01', until: +Infinity, offset: 1, name: 'Anno Domini', narrow: 'AD', abbr: 'AD', }, { since: '0000-12-31', until: -Infinity, offset: 1, name: 'Before Christ', narrow: 'BC', abbr: 'BC', }, ], dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/, ordinal: function (number) { var b = number % 10, output = toInt((number % 100) / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th'; return number + output; }, }); // Side effect imports hooks.lang = deprecate( 'moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale ); hooks.langData = deprecate( 'moment.langData is deprecated. Use moment.localeData instead.', getLocale ); var mathAbs = Math.abs; function abs() { var data = this._data; 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); return this; } function addSubtract$1(duration, input, value, direction) { var other = createDuration(input, value); duration._milliseconds += direction * other._milliseconds; duration._days += direction * other._days; duration._months += direction * other._months; return duration._bubble(); } // supports only 2.0-style add(1, 's') or add(duration) function add$1(input, value) { return addSubtract$1(this, input, value, 1); } // supports only 2.0-style subtract(1, 's') or subtract(duration) function subtract$1(input, value) { return addSubtract$1(this, input, value, -1); } function absCeil(number) { if (number < 0) { return Math.floor(number); } else { return Math.ceil(number); } } function bubble() { var milliseconds = this._milliseconds, days = this._days, months = this._months, data = this._data, seconds, minutes, hours, years, monthsFromDays; // if we have a mix of positive and negative values, bubble down first // check: https://github.com/moment/moment/issues/2166 if ( !( (milliseconds >= 0 && days >= 0 && months >= 0) || (milliseconds <= 0 && days <= 0 && months <= 0) ) ) { milliseconds += absCeil(monthsToDays(months) + days) * 864e5; days = 0; months = 0; } // The following code bubbles up values, see the tests for // examples of what that means. data.milliseconds = milliseconds % 1000; seconds = absFloor(milliseconds / 1000); data.seconds = seconds % 60; minutes = absFloor(seconds / 60); data.minutes = minutes % 60; hours = absFloor(minutes / 60); data.hours = hours % 24; days += absFloor(hours / 24); // convert days to months monthsFromDays = absFloor(daysToMonths(days)); months += monthsFromDays; days -= absCeil(monthsToDays(monthsFromDays)); // 12 months -> 1 year years = absFloor(months / 12); months %= 12; data.days = days; data.months = months; data.years = years; return this; } function daysToMonths(days) { // 400 years have 146097 days (taking into account leap year rules) // 400 years have 12 months === 4800 return (days * 4800) / 146097; } function monthsToDays(months) { // the reverse of daysToMonths return (months * 146097) / 4800; } function as(units) { if (!this.isValid()) { return NaN; } var days, months, milliseconds = this._milliseconds; units = normalizeUnits(units); if (units === 'month' || units === 'quarter' || units === 'year') { days = this._days + milliseconds / 864e5; months = this._months + daysToMonths(days); switch (units) { case 'month': return months; case 'quarter': return months / 3; case 'year': return months / 12; } } else { // handle milliseconds separately because of floating point math errors (issue #1867) days = this._days + Math.round(monthsToDays(this._months)); switch (units) { case 'week': return days / 7 + milliseconds / 6048e5; case 'day': return days + milliseconds / 864e5; case 'hour': return days * 24 + milliseconds / 36e5; case 'minute': return days * 1440 + milliseconds / 6e4; case 'second': return days * 86400 + milliseconds / 1000; // Math.floor prevents floating point math errors here case 'millisecond': return Math.floor(days * 864e5) + milliseconds; default: throw new Error('Unknown unit ' + units); } } } // TODO: Use this.as('ms')? function valueOf$1() { if (!this.isValid()) { return NaN; } return ( this._milliseconds + this._days * 864e5 + (this._months % 12) * 2592e6 + toInt(this._months / 12) * 31536e6 ); } 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'), asQuarters = makeAs('Q'), asYears = makeAs('y'); function clone$1() { return createDuration(this); } function get$2(units) { units = normalizeUnits(units); return this.isValid() ? this[units + 's']() : NaN; } function makeGetter(name) { return function () { return this.isValid() ? this._data[name] : NaN; }; } var milliseconds = makeGetter('milliseconds'), seconds = makeGetter('seconds'), minutes = makeGetter('minutes'), hours = makeGetter('hours'), days = makeGetter('days'), months = makeGetter('months'), years = makeGetter('years'); function weeks() { return absFloor(this.days() / 7); } var round = Math.round, thresholds = { ss: 44, // a few seconds to seconds s: 45, // seconds to minute m: 45, // minutes to hour h: 22, // hours to day d: 26, // days to month/week w: null, // weeks to month M: 11, // months to year }; // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); } function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) { var duration = 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')), weeks = round(duration.as('w')), years = round(duration.as('y')), a = (seconds <= thresholds.ss && ['s', seconds]) || (seconds < thresholds.s && ['ss', seconds]) || (minutes <= 1 && ['m']) || (minutes < thresholds.m && ['mm', minutes]) || (hours <= 1 && ['h']) || (hours < thresholds.h && ['hh', hours]) || (days <= 1 && ['d']) || (days < thresholds.d && ['dd', days]); if (thresholds.w != null) { a = a || (weeks <= 1 && ['w']) || (weeks < thresholds.w && ['ww', weeks]); } a = a || (months <= 1 && ['M']) || (months < thresholds.M && ['MM', months]) || (years <= 1 && ['y']) || ['yy', years]; a[2] = withoutSuffix; a[3] = +posNegDuration > 0; a[4] = locale; return substituteTimeAgo.apply(null, a); } // This function allows you to set the rounding function for relative time strings function getSetRelativeTimeRounding(roundingFunction) { if (roundingFunction === undefined) { return round; } if (typeof roundingFunction === 'function') { round = roundingFunction; return true; } return false; } // This function allows you to set a threshold for relative time strings function getSetRelativeTimeThreshold(threshold, limit) { if (thresholds[threshold] === undefined) { return false; } if (limit === undefined) { return thresholds[threshold]; } thresholds[threshold] = limit; if (threshold === 's') { thresholds.ss = limit - 1; } return true; } function humanize(argWithSuffix, argThresholds) { if (!this.isValid()) { return this.localeData().invalidDate(); } var withSuffix = false, th = thresholds, locale, output; if (typeof argWithSuffix === 'object') { argThresholds = argWithSuffix; argWithSuffix = false; } if (typeof argWithSuffix === 'boolean') { withSuffix = argWithSuffix; } if (typeof argThresholds === 'object') { th = Object.assign({}, thresholds, argThresholds); if (argThresholds.s != null && argThresholds.ss == null) { th.ss = argThresholds.s - 1; } } locale = this.localeData(); output = relativeTime$1(this, !withSuffix, th, locale); if (withSuffix) { output = locale.pastFuture(+this, output); } return locale.postformat(output); } var abs$1 = Math.abs; function sign(x) { return (x > 0) - (x < 0) || +x; } function toISOString$1() { // for ISO strings we do not use the normal bubbling rules: // * milliseconds bubble up until they become hours // * days do not bubble at all // * months bubble up until they become years // This is because there is no context-free conversion between hours and days // (think of clock changes) // and also not between days and months (28-31 days per month) if (!this.isValid()) { return this.localeData().invalidDate(); } var seconds = abs$1(this._milliseconds) / 1000, days = abs$1(this._days), months = abs$1(this._months), minutes, hours, years, s, total = this.asSeconds(), totalSign, ymSign, daysSign, hmsSign; if (!total) { // this is the same as C#'s (Noda) and python (isodate)... // but not other JS (goog.date) return 'P0D'; } // 3600 seconds -> 60 minutes -> 1 hour minutes = absFloor(seconds / 60); hours = absFloor(minutes / 60); seconds %= 60; minutes %= 60; // 12 months -> 1 year years = absFloor(months / 12); months %= 12; // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : ''; totalSign = total < 0 ? '-' : ''; ymSign = sign(this._months) !== sign(total) ? '-' : ''; daysSign = sign(this._days) !== sign(total) ? '-' : ''; hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : ''; return ( totalSign + 'P' + (years ? ymSign + years + 'Y' : '') + (months ? ymSign + months + 'M' : '') + (days ? daysSign + days + 'D' : '') + (hours || minutes || seconds ? 'T' : '') + (hours ? hmsSign + hours + 'H' : '') + (minutes ? hmsSign + minutes + 'M' : '') + (seconds ? hmsSign + s + 'S' : '') ); } var proto$2 = Duration.prototype; proto$2.isValid = isValid$1; proto$2.abs = abs; proto$2.add = add$1; proto$2.subtract = subtract$1; proto$2.as = as; proto$2.asMilliseconds = asMilliseconds; proto$2.asSeconds = asSeconds; proto$2.asMinutes = asMinutes; proto$2.asHours = asHours; proto$2.asDays = asDays; proto$2.asWeeks = asWeeks; proto$2.asMonths = asMonths; proto$2.asQuarters = asQuarters; proto$2.asYears = asYears; proto$2.valueOf = valueOf$1; proto$2._bubble = bubble; proto$2.clone = clone$1; proto$2.get = get$2; proto$2.milliseconds = milliseconds; proto$2.seconds = seconds; proto$2.minutes = minutes; proto$2.hours = hours; proto$2.days = days; proto$2.weeks = weeks; proto$2.months = months; proto$2.years = years; proto$2.humanize = humanize; proto$2.toISOString = toISOString$1; proto$2.toString = toISOString$1; proto$2.toJSON = toISOString$1; proto$2.locale = locale; proto$2.localeData = localeData; proto$2.toIsoString = deprecate( 'toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1 ); proto$2.lang = lang; // FORMATTING addFormatToken('X', 0, 0, 'unix'); addFormatToken('x', 0, 0, 'valueOf'); // PARSING addRegexToken('x', matchSigned); addRegexToken('X', matchTimestamp); addParseToken('X', function (input, array, config) { config._d = new Date(parseFloat(input) * 1000); }); addParseToken('x', function (input, array, config) { config._d = new Date(toInt(input)); }); //! moment.js hooks.version = '2.25.3'; setHookCallback(createLocal); hooks.fn = proto; hooks.min = min; hooks.max = max; hooks.now = now; hooks.utc = createUTC; hooks.unix = createUnix; hooks.months = listMonths; hooks.isDate = isDate; hooks.locale = getSetGlobalLocale; hooks.invalid = createInvalid; hooks.duration = createDuration; hooks.isMoment = isMoment; hooks.weekdays = listWeekdays; hooks.parseZone = createInZone; hooks.localeData = getLocale; hooks.isDuration = isDuration; hooks.monthsShort = listMonthsShort; hooks.weekdaysMin = listWeekdaysMin; hooks.defineLocale = defineLocale; hooks.updateLocale = updateLocale; hooks.locales = listLocales; hooks.weekdaysShort = listWeekdaysShort; hooks.normalizeUnits = normalizeUnits; hooks.relativeTimeRounding = getSetRelativeTimeRounding; hooks.relativeTimeThreshold = getSetRelativeTimeThreshold; hooks.calendarFormat = getCalendarFormat; hooks.prototype = proto; // currently HTML5 input type only supports 24-hour formats hooks.HTML5_FMT = { DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // <input type="datetime-local" /> DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // <input type="datetime-local" step="1" /> DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // <input type="datetime-local" step="0.001" /> DATE: 'YYYY-MM-DD', // <input type="date" /> TIME: 'HH:mm', // <input type="time" /> TIME_SECONDS: 'HH:mm:ss', // <input type="time" step="1" /> TIME_MS: 'HH:mm:ss.SSS', // <input type="time" step="0.001" /> WEEK: 'GGGG-[W]WW', // <input type="week" /> MONTH: 'YYYY-MM', // <input type="month" /> }; return hooks; }))); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(13)(module))) /***/ }), /* 1246 */ /***/ (function(module, exports, __webpack_require__) { var map = { "./af": 1247, "./af.js": 1247, "./ar": 1248, "./ar-dz": 1249, "./ar-dz.js": 1249, "./ar-kw": 1250, "./ar-kw.js": 1250, "./ar-ly": 1251, "./ar-ly.js": 1251, "./ar-ma": 1252, "./ar-ma.js": 1252, "./ar-sa": 1253, "./ar-sa.js": 1253, "./ar-tn": 1254, "./ar-tn.js": 1254, "./ar.js": 1248, "./az": 1255, "./az.js": 1255, "./be": 1256, "./be.js": 1256, "./bg": 1257, "./bg.js": 1257, "./bm": 1258, "./bm.js": 1258, "./bn": 1259, "./bn.js": 1259, "./bo": 1260, "./bo.js": 1260, "./br": 1261, "./br.js": 1261, "./bs": 1262, "./bs.js": 1262, "./ca": 1263, "./ca.js": 1263, "./cs": 1264, "./cs.js": 1264, "./cv": 1265, "./cv.js": 1265, "./cy": 1266, "./cy.js": 1266, "./da": 1267, "./da.js": 1267, "./de": 1268, "./de-at": 1269, "./de-at.js": 1269, "./de-ch": 1270, "./de-ch.js": 1270, "./de.js": 1268, "./dv": 1271, "./dv.js": 1271, "./el": 1272, "./el.js": 1272, "./en-au": 1273, "./en-au.js": 1273, "./en-ca": 1274, "./en-ca.js": 1274, "./en-gb": 1275, "./en-gb.js": 1275, "./en-ie": 1276, "./en-ie.js": 1276, "./en-il": 1277, "./en-il.js": 1277, "./en-in": 1278, "./en-in.js": 1278, "./en-nz": 1279, "./en-nz.js": 1279, "./en-sg": 1280, "./en-sg.js": 1280, "./eo": 1281, "./eo.js": 1281, "./es": 1282, "./es-do": 1283, "./es-do.js": 1283, "./es-us": 1284, "./es-us.js": 1284, "./es.js": 1282, "./et": 1285, "./et.js": 1285, "./eu": 1286, "./eu.js": 1286, "./fa": 1287, "./fa.js": 1287, "./fi": 1288, "./fi.js": 1288, "./fil": 1289, "./fil.js": 1289, "./fo": 1290, "./fo.js": 1290, "./fr": 1291, "./fr-ca": 1292, "./fr-ca.js": 1292, "./fr-ch": 1293, "./fr-ch.js": 1293, "./fr.js": 1291, "./fy": 1294, "./fy.js": 1294, "./ga": 1295, "./ga.js": 1295, "./gd": 1296, "./gd.js": 1296, "./gl": 1297, "./gl.js": 1297, "./gom-deva": 1298, "./gom-deva.js": 1298, "./gom-latn": 1299, "./gom-latn.js": 1299, "./gu": 1300, "./gu.js": 1300, "./he": 1301, "./he.js": 1301, "./hi": 1302, "./hi.js": 1302, "./hr": 1303, "./hr.js": 1303, "./hu": 1304, "./hu.js": 1304, "./hy-am": 1305, "./hy-am.js": 1305, "./id": 1306, "./id.js": 1306, "./is": 1307, "./is.js": 1307, "./it": 1308, "./it-ch": 1309, "./it-ch.js": 1309, "./it.js": 1308, "./ja": 1310, "./ja.js": 1310, "./jv": 1311, "./jv.js": 1311, "./ka": 1312, "./ka.js": 1312, "./kk": 1313, "./kk.js": 1313, "./km": 1314, "./km.js": 1314, "./kn": 1315, "./kn.js": 1315, "./ko": 1316, "./ko.js": 1316, "./ku": 1317, "./ku.js": 1317, "./ky": 1318, "./ky.js": 1318, "./lb": 1319, "./lb.js": 1319, "./lo": 1320, "./lo.js": 1320, "./lt": 1321, "./lt.js": 1321, "./lv": 1322, "./lv.js": 1322, "./me": 1323, "./me.js": 1323, "./mi": 1324, "./mi.js": 1324, "./mk": 1325, "./mk.js": 1325, "./ml": 1326, "./ml.js": 1326, "./mn": 1327, "./mn.js": 1327, "./mr": 1328, "./mr.js": 1328, "./ms": 1329, "./ms-my": 1330, "./ms-my.js": 1330, "./ms.js": 1329, "./mt": 1331, "./mt.js": 1331, "./my": 1332, "./my.js": 1332, "./nb": 1333, "./nb.js": 1333, "./ne": 1334, "./ne.js": 1334, "./nl": 1335, "./nl-be": 1336, "./nl-be.js": 1336, "./nl.js": 1335, "./nn": 1337, "./nn.js": 1337, "./oc-lnc": 1338, "./oc-lnc.js": 1338, "./pa-in": 1339, "./pa-in.js": 1339, "./pl": 1340, "./pl.js": 1340, "./pt": 1341, "./pt-br": 1342, "./pt-br.js": 1342, "./pt.js": 1341, "./ro": 1343, "./ro.js": 1343, "./ru": 1344, "./ru.js": 1344, "./sd": 1345, "./sd.js": 1345, "./se": 1346, "./se.js": 1346, "./si": 1347, "./si.js": 1347, "./sk": 1348, "./sk.js": 1348, "./sl": 1349, "./sl.js": 1349, "./sq": 1350, "./sq.js": 1350, "./sr": 1351, "./sr-cyrl": 1352, "./sr-cyrl.js": 1352, "./sr.js": 1351, "./ss": 1353, "./ss.js": 1353, "./sv": 1354, "./sv.js": 1354, "./sw": 1355, "./sw.js": 1355, "./ta": 1356, "./ta.js": 1356, "./te": 1357, "./te.js": 1357, "./tet": 1358, "./tet.js": 1358, "./tg": 1359, "./tg.js": 1359, "./th": 1360, "./th.js": 1360, "./tl-ph": 1361, "./tl-ph.js": 1361, "./tlh": 1362, "./tlh.js": 1362, "./tr": 1363, "./tr.js": 1363, "./tzl": 1364, "./tzl.js": 1364, "./tzm": 1365, "./tzm-latn": 1366, "./tzm-latn.js": 1366, "./tzm.js": 1365, "./ug-cn": 1367, "./ug-cn.js": 1367, "./uk": 1368, "./uk.js": 1368, "./ur": 1369, "./ur.js": 1369, "./uz": 1370, "./uz-latn": 1371, "./uz-latn.js": 1371, "./uz.js": 1370, "./vi": 1372, "./vi.js": 1372, "./x-pseudo": 1373, "./x-pseudo.js": 1373, "./yo": 1374, "./yo.js": 1374, "./zh-cn": 1375, "./zh-cn.js": 1375, "./zh-hk": 1376, "./zh-hk.js": 1376, "./zh-mo": 1377, "./zh-mo.js": 1377, "./zh-tw": 1378, "./zh-tw.js": 1378 }; function webpackContext(req) { var id = webpackContextResolve(req); return __webpack_require__(id); } function webpackContextResolve(req) { if(!__webpack_require__.o(map, req)) { var e = new Error("Cannot find module '" + req + "'"); e.code = 'MODULE_NOT_FOUND'; throw e; } return map[req]; } webpackContext.keys = function webpackContextKeys() { return Object.keys(map); }; webpackContext.resolve = webpackContextResolve; module.exports = webpackContext; webpackContext.id = 1246; /***/ }), /* 1247 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Afrikaans [af] //! author : Werner Mollentze : https://github.com/wernerm ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var af = moment.defineLocale('af', { months: 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split( '_' ), monthsShort: 'Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'), weekdays: 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split( '_' ), weekdaysShort: 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'), weekdaysMin: 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'), meridiemParse: /vm|nm/i, isPM: function (input) { return /^nm$/i.test(input); }, meridiem: function (hours, minutes, isLower) { if (hours < 12) { return isLower ? 'vm' : 'VM'; } else { return isLower ? 'nm' : 'NM'; } }, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, calendar: { sameDay: '[Vandag om] LT', nextDay: '[Môre om] LT', nextWeek: 'dddd [om] LT', lastDay: '[Gister om] LT', lastWeek: '[Laas] dddd [om] LT', sameElse: 'L', }, relativeTime: { future: 'oor %s', past: '%s gelede', s: "'n paar sekondes", ss: '%d sekondes', m: "'n minuut", mm: '%d minute', h: "'n uur", hh: '%d ure', d: "'n dag", dd: '%d dae', M: "'n maand", MM: '%d maande', y: "'n jaar", yy: '%d jaar', }, dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/, ordinal: function (number) { return ( number + (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de') ); // Thanks to Joris Röling : https://github.com/jjupiter }, week: { dow: 1, // Maandag is die eerste dag van die week. doy: 4, // Die week wat die 4de Januarie bevat is die eerste week van die jaar. }, }); return af; }))); /***/ }), /* 1248 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Arabic [ar] //! author : Abdel Said: https://github.com/abdelsaid //! author : Ahmed Elkhatib //! author : forabi https://github.com/forabi ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var symbolMap = { '1': '١', '2': '٢', '3': '٣', '4': '٤', '5': '٥', '6': '٦', '7': '٧', '8': '٨', '9': '٩', '0': '٠', }, numberMap = { '١': '1', '٢': '2', '٣': '3', '٤': '4', '٥': '5', '٦': '6', '٧': '7', '٨': '8', '٩': '9', '٠': '0', }, pluralForm = function (n) { return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5; }, plurals = { s: [ 'أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية', ], m: [ 'أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة', ], h: [ 'أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة', ], d: [ 'أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم', ], M: [ 'أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر', ], y: [ 'أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام', ], }, pluralize = function (u) { return function (number, withoutSuffix, string, isFuture) { var f = pluralForm(number), str = plurals[u][pluralForm(number)]; if (f === 2) { str = str[withoutSuffix ? 0 : 1]; } return str.replace(/%d/i, number); }; }, months = [ 'يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر', ]; var ar = moment.defineLocale('ar', { months: months, monthsShort: months, weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'), weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'D/\u200FM/\u200FYYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd D MMMM YYYY HH:mm', }, meridiemParse: /ص|م/, isPM: function (input) { return 'م' === input; }, meridiem: function (hour, minute, isLower) { if (hour < 12) { return 'ص'; } else { return 'م'; } }, calendar: { sameDay: '[اليوم عند الساعة] LT', nextDay: '[غدًا عند الساعة] LT', nextWeek: 'dddd [عند الساعة] LT', lastDay: '[أمس عند الساعة] LT', lastWeek: 'dddd [عند الساعة] LT', sameElse: 'L', }, relativeTime: { future: 'بعد %s', past: 'منذ %s', s: pluralize('s'), ss: pluralize('s'), m: pluralize('m'), mm: pluralize('m'), h: pluralize('h'), hh: pluralize('h'), d: pluralize('d'), dd: pluralize('d'), M: pluralize('M'), MM: pluralize('M'), y: pluralize('y'), yy: pluralize('y'), }, preparse: function (string) { return string .replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) { return numberMap[match]; }) .replace(/،/g, ','); }, postformat: function (string) { return string .replace(/\d/g, function (match) { return symbolMap[match]; }) .replace(/,/g, '،'); }, week: { dow: 6, // Saturday is the first day of the week. doy: 12, // The week that contains Jan 12th is the first week of the year. }, }); return ar; }))); /***/ }), /* 1249 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Arabic (Algeria) [ar-dz] //! author : Noureddine LOUAHEDJ : https://github.com/noureddineme ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var arDz = moment.defineLocale('ar-dz', { months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split( '_' ), monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split( '_' ), weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), weekdaysShort: 'احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'), weekdaysMin: 'أح_إث_ثلا_أر_خم_جم_سب'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd D MMMM YYYY HH:mm', }, calendar: { sameDay: '[اليوم على الساعة] LT', nextDay: '[غدا على الساعة] LT', nextWeek: 'dddd [على الساعة] LT', lastDay: '[أمس على الساعة] LT', lastWeek: 'dddd [على الساعة] LT', sameElse: 'L', }, relativeTime: { future: 'في %s', past: 'منذ %s', s: 'ثوان', ss: '%d ثانية', m: 'دقيقة', mm: '%d دقائق', h: 'ساعة', hh: '%d ساعات', d: 'يوم', dd: '%d أيام', M: 'شهر', MM: '%d أشهر', y: 'سنة', yy: '%d سنوات', }, week: { dow: 0, // Sunday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return arDz; }))); /***/ }), /* 1250 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Arabic (Kuwait) [ar-kw] //! author : Nusret Parlak: https://github.com/nusretparlak ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var arKw = moment.defineLocale('ar-kw', { months: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split( '_' ), monthsShort: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split( '_' ), weekdays: 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), weekdaysShort: 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'), weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd D MMMM YYYY HH:mm', }, calendar: { sameDay: '[اليوم على الساعة] LT', nextDay: '[غدا على الساعة] LT', nextWeek: 'dddd [على الساعة] LT', lastDay: '[أمس على الساعة] LT', lastWeek: 'dddd [على الساعة] LT', sameElse: 'L', }, relativeTime: { future: 'في %s', past: 'منذ %s', s: 'ثوان', ss: '%d ثانية', m: 'دقيقة', mm: '%d دقائق', h: 'ساعة', hh: '%d ساعات', d: 'يوم', dd: '%d أيام', M: 'شهر', MM: '%d أشهر', y: 'سنة', yy: '%d سنوات', }, week: { dow: 0, // Sunday is the first day of the week. doy: 12, // The week that contains Jan 12th is the first week of the year. }, }); return arKw; }))); /***/ }), /* 1251 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Arabic (Lybia) [ar-ly] //! author : Ali Hmer: https://github.com/kikoanis ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var symbolMap = { '1': '1', '2': '2', '3': '3', '4': '4', '5': '5', '6': '6', '7': '7', '8': '8', '9': '9', '0': '0', }, pluralForm = function (n) { return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5; }, plurals = { s: [ 'أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية', ], m: [ 'أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة', ], h: [ 'أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة', ], d: [ 'أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم', ], M: [ 'أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر', ], y: [ 'أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام', ], }, pluralize = function (u) { return function (number, withoutSuffix, string, isFuture) { var f = pluralForm(number), str = plurals[u][pluralForm(number)]; if (f === 2) { str = str[withoutSuffix ? 0 : 1]; } return str.replace(/%d/i, number); }; }, months = [ 'يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر', ]; var arLy = moment.defineLocale('ar-ly', { months: months, monthsShort: months, weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'), weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'D/\u200FM/\u200FYYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd D MMMM YYYY HH:mm', }, meridiemParse: /ص|م/, isPM: function (input) { return 'م' === input; }, meridiem: function (hour, minute, isLower) { if (hour < 12) { return 'ص'; } else { return 'م'; } }, calendar: { sameDay: '[اليوم عند الساعة] LT', nextDay: '[غدًا عند الساعة] LT', nextWeek: 'dddd [عند الساعة] LT', lastDay: '[أمس عند الساعة] LT', lastWeek: 'dddd [عند الساعة] LT', sameElse: 'L', }, relativeTime: { future: 'بعد %s', past: 'منذ %s', s: pluralize('s'), ss: pluralize('s'), m: pluralize('m'), mm: pluralize('m'), h: pluralize('h'), hh: pluralize('h'), d: pluralize('d'), dd: pluralize('d'), M: pluralize('M'), MM: pluralize('M'), y: pluralize('y'), yy: pluralize('y'), }, preparse: function (string) { return string.replace(/،/g, ','); }, postformat: function (string) { return string .replace(/\d/g, function (match) { return symbolMap[match]; }) .replace(/,/g, '،'); }, week: { dow: 6, // Saturday is the first day of the week. doy: 12, // The week that contains Jan 12th is the first week of the year. }, }); return arLy; }))); /***/ }), /* 1252 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Arabic (Morocco) [ar-ma] //! author : ElFadili Yassine : https://github.com/ElFadiliY //! author : Abdel Said : https://github.com/abdelsaid ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var arMa = moment.defineLocale('ar-ma', { months: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split( '_' ), monthsShort: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split( '_' ), weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), weekdaysShort: 'احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'), weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd D MMMM YYYY HH:mm', }, calendar: { sameDay: '[اليوم على الساعة] LT', nextDay: '[غدا على الساعة] LT', nextWeek: 'dddd [على الساعة] LT', lastDay: '[أمس على الساعة] LT', lastWeek: 'dddd [على الساعة] LT', sameElse: 'L', }, relativeTime: { future: 'في %s', past: 'منذ %s', s: 'ثوان', ss: '%d ثانية', m: 'دقيقة', mm: '%d دقائق', h: 'ساعة', hh: '%d ساعات', d: 'يوم', dd: '%d أيام', M: 'شهر', MM: '%d أشهر', y: 'سنة', yy: '%d سنوات', }, week: { dow: 6, // Saturday is the first day of the week. doy: 12, // The week that contains Jan 12th is the first week of the year. }, }); return arMa; }))); /***/ }), /* 1253 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Arabic (Saudi Arabia) [ar-sa] //! author : Suhail Alkowaileet : https://github.com/xsoh ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var symbolMap = { '1': '١', '2': '٢', '3': '٣', '4': '٤', '5': '٥', '6': '٦', '7': '٧', '8': '٨', '9': '٩', '0': '٠', }, numberMap = { '١': '1', '٢': '2', '٣': '3', '٤': '4', '٥': '5', '٦': '6', '٧': '7', '٨': '8', '٩': '9', '٠': '0', }; var arSa = moment.defineLocale('ar-sa', { months: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split( '_' ), monthsShort: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split( '_' ), weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'), weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd D MMMM YYYY HH:mm', }, meridiemParse: /ص|م/, isPM: function (input) { return 'م' === input; }, meridiem: function (hour, minute, isLower) { if (hour < 12) { return 'ص'; } else { return 'م'; } }, calendar: { sameDay: '[اليوم على الساعة] LT', nextDay: '[غدا على الساعة] LT', nextWeek: 'dddd [على الساعة] LT', lastDay: '[أمس على الساعة] LT', lastWeek: 'dddd [على الساعة] LT', sameElse: 'L', }, relativeTime: { future: 'في %s', past: 'منذ %s', s: 'ثوان', ss: '%d ثانية', m: 'دقيقة', mm: '%d دقائق', h: 'ساعة', hh: '%d ساعات', d: 'يوم', dd: '%d أيام', M: 'شهر', MM: '%d أشهر', y: 'سنة', yy: '%d سنوات', }, preparse: function (string) { return string .replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) { return numberMap[match]; }) .replace(/،/g, ','); }, postformat: function (string) { return string .replace(/\d/g, function (match) { return symbolMap[match]; }) .replace(/,/g, '،'); }, week: { dow: 0, // Sunday is the first day of the week. doy: 6, // The week that contains Jan 6th is the first week of the year. }, }); return arSa; }))); /***/ }), /* 1254 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Arabic (Tunisia) [ar-tn] //! author : Nader Toukabri : https://github.com/naderio ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var arTn = moment.defineLocale('ar-tn', { months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split( '_' ), monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split( '_' ), weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'), weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd D MMMM YYYY HH:mm', }, calendar: { sameDay: '[اليوم على الساعة] LT', nextDay: '[غدا على الساعة] LT', nextWeek: 'dddd [على الساعة] LT', lastDay: '[أمس على الساعة] LT', lastWeek: 'dddd [على الساعة] LT', sameElse: 'L', }, relativeTime: { future: 'في %s', past: 'منذ %s', s: 'ثوان', ss: '%d ثانية', m: 'دقيقة', mm: '%d دقائق', h: 'ساعة', hh: '%d ساعات', d: 'يوم', dd: '%d أيام', M: 'شهر', MM: '%d أشهر', y: 'سنة', yy: '%d سنوات', }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return arTn; }))); /***/ }), /* 1255 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Azerbaijani [az] //! author : topchiyev : https://github.com/topchiyev ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var suffixes = { 1: '-inci', 5: '-inci', 8: '-inci', 70: '-inci', 80: '-inci', 2: '-nci', 7: '-nci', 20: '-nci', 50: '-nci', 3: '-üncü', 4: '-üncü', 100: '-üncü', 6: '-ncı', 9: '-uncu', 10: '-uncu', 30: '-uncu', 60: '-ıncı', 90: '-ıncı', }; var az = moment.defineLocale('az', { months: 'yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr'.split( '_' ), monthsShort: 'yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek'.split('_'), weekdays: 'Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə'.split( '_' ), weekdaysShort: 'Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən'.split('_'), weekdaysMin: 'Bz_BE_ÇA_Çə_CA_Cü_Şə'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD.MM.YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, calendar: { sameDay: '[bugün saat] LT', nextDay: '[sabah saat] LT', nextWeek: '[gələn həftə] dddd [saat] LT', lastDay: '[dünən] LT', lastWeek: '[keçən həftə] dddd [saat] LT', sameElse: 'L', }, relativeTime: { future: '%s sonra', past: '%s əvvəl', s: 'birneçə saniyə', ss: '%d saniyə', m: 'bir dəqiqə', mm: '%d dəqiqə', h: 'bir saat', hh: '%d saat', d: 'bir gün', dd: '%d gün', M: 'bir ay', MM: '%d ay', y: 'bir il', yy: '%d il', }, meridiemParse: /gecə|səhər|gündüz|axşam/, isPM: function (input) { return /^(gündüz|axşam)$/.test(input); }, meridiem: function (hour, minute, isLower) { if (hour < 4) { return 'gecə'; } else if (hour < 12) { return 'səhər'; } else if (hour < 17) { return 'gündüz'; } else { return 'axşam'; } }, dayOfMonthOrdinalParse: /\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/, ordinal: function (number) { if (number === 0) { // special case for zero return number + '-ıncı'; } var a = number % 10, b = (number % 100) - a, c = number >= 100 ? 100 : null; return number + (suffixes[a] || suffixes[b] || suffixes[c]); }, week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return az; }))); /***/ }), /* 1256 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Belarusian [be] //! author : Dmitry Demidov : https://github.com/demidov91 //! author: Praleska: http://praleska.pro/ //! Author : Menelion Elensúle : https://github.com/Oire ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration function plural(word, num) { var forms = word.split('_'); return num % 10 === 1 && num % 100 !== 11 ? forms[0] : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]; } function relativeTimeWithPlural(number, withoutSuffix, key) { var format = { ss: withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд', mm: withoutSuffix ? 'хвіліна_хвіліны_хвілін' : 'хвіліну_хвіліны_хвілін', hh: withoutSuffix ? 'гадзіна_гадзіны_гадзін' : 'гадзіну_гадзіны_гадзін', dd: 'дзень_дні_дзён', MM: 'месяц_месяцы_месяцаў', yy: 'год_гады_гадоў', }; if (key === 'm') { return withoutSuffix ? 'хвіліна' : 'хвіліну'; } else if (key === 'h') { return withoutSuffix ? 'гадзіна' : 'гадзіну'; } else { return number + ' ' + plural(format[key], +number); } } var be = moment.defineLocale('be', { months: { format: 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split( '_' ), standalone: 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split( '_' ), }, monthsShort: 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split( '_' ), weekdays: { format: 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split( '_' ), standalone: 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split( '_' ), isFormat: /\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/, }, weekdaysShort: 'нд_пн_ат_ср_чц_пт_сб'.split('_'), weekdaysMin: 'нд_пн_ат_ср_чц_пт_сб'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD.MM.YYYY', LL: 'D MMMM YYYY г.', LLL: 'D MMMM YYYY г., HH:mm', LLLL: 'dddd, D MMMM YYYY г., HH:mm', }, calendar: { sameDay: '[Сёння ў] LT', nextDay: '[Заўтра ў] LT', lastDay: '[Учора ў] LT', nextWeek: function () { return '[У] dddd [ў] LT'; }, lastWeek: function () { switch (this.day()) { case 0: case 3: case 5: case 6: return '[У мінулую] dddd [ў] LT'; case 1: case 2: case 4: return '[У мінулы] dddd [ў] LT'; } }, sameElse: 'L', }, relativeTime: { future: 'праз %s', past: '%s таму', s: 'некалькі секунд', m: relativeTimeWithPlural, mm: relativeTimeWithPlural, h: relativeTimeWithPlural, hh: relativeTimeWithPlural, d: 'дзень', dd: relativeTimeWithPlural, M: 'месяц', MM: relativeTimeWithPlural, y: 'год', yy: relativeTimeWithPlural, }, meridiemParse: /ночы|раніцы|дня|вечара/, isPM: function (input) { return /^(дня|вечара)$/.test(input); }, meridiem: function (hour, minute, isLower) { if (hour < 4) { return 'ночы'; } else if (hour < 12) { return 'раніцы'; } else if (hour < 17) { return 'дня'; } else { return 'вечара'; } }, dayOfMonthOrdinalParse: /\d{1,2}-(і|ы|га)/, ordinal: function (number, period) { switch (period) { case 'M': case 'd': case 'DDD': case 'w': case 'W': return (number % 10 === 2 || number % 10 === 3) && number % 100 !== 12 && number % 100 !== 13 ? number + '-і' : number + '-ы'; case 'D': return number + '-га'; default: return number; } }, week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return be; }))); /***/ }), /* 1257 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Bulgarian [bg] //! author : Krasen Borisov : https://github.com/kraz ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var bg = moment.defineLocale('bg', { months: 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split( '_' ), monthsShort: 'яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'), weekdays: 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split( '_' ), weekdaysShort: 'нед_пон_вто_сря_чет_пет_съб'.split('_'), weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'), longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', L: 'D.MM.YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY H:mm', LLLL: 'dddd, D MMMM YYYY H:mm', }, calendar: { sameDay: '[Днес в] LT', nextDay: '[Утре в] LT', nextWeek: 'dddd [в] LT', lastDay: '[Вчера в] LT', lastWeek: function () { switch (this.day()) { case 0: case 3: case 6: return '[Миналата] dddd [в] LT'; case 1: case 2: case 4: case 5: return '[Миналия] dddd [в] LT'; } }, sameElse: 'L', }, relativeTime: { future: 'след %s', past: 'преди %s', s: 'няколко секунди', ss: '%d секунди', m: 'минута', mm: '%d минути', h: 'час', hh: '%d часа', d: 'ден', dd: '%d дена', M: 'месец', MM: '%d месеца', y: 'година', yy: '%d години', }, dayOfMonthOrdinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/, ordinal: function (number) { var lastDigit = number % 10, last2Digits = number % 100; if (number === 0) { return number + '-ев'; } else if (last2Digits === 0) { return number + '-ен'; } else if (last2Digits > 10 && last2Digits < 20) { return number + '-ти'; } else if (lastDigit === 1) { return number + '-ви'; } else if (lastDigit === 2) { return number + '-ри'; } else if (lastDigit === 7 || lastDigit === 8) { return number + '-ми'; } else { return number + '-ти'; } }, week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return bg; }))); /***/ }), /* 1258 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Bambara [bm] //! author : Estelle Comment : https://github.com/estellecomment ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var bm = moment.defineLocale('bm', { months: 'Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo'.split( '_' ), monthsShort: 'Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des'.split('_'), weekdays: 'Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri'.split('_'), weekdaysShort: 'Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib'.split('_'), weekdaysMin: 'Ka_Nt_Ta_Ar_Al_Ju_Si'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'MMMM [tile] D [san] YYYY', LLL: 'MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm', LLLL: 'dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm', }, calendar: { sameDay: '[Bi lɛrɛ] LT', nextDay: '[Sini lɛrɛ] LT', nextWeek: 'dddd [don lɛrɛ] LT', lastDay: '[Kunu lɛrɛ] LT', lastWeek: 'dddd [tɛmɛnen lɛrɛ] LT', sameElse: 'L', }, relativeTime: { future: '%s kɔnɔ', past: 'a bɛ %s bɔ', s: 'sanga dama dama', ss: 'sekondi %d', m: 'miniti kelen', mm: 'miniti %d', h: 'lɛrɛ kelen', hh: 'lɛrɛ %d', d: 'tile kelen', dd: 'tile %d', M: 'kalo kelen', MM: 'kalo %d', y: 'san kelen', yy: 'san %d', }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return bm; }))); /***/ }), /* 1259 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Bengali [bn] //! author : Kaushik Gandhi : https://github.com/kaushikgandhi ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var symbolMap = { '1': '১', '2': '২', '3': '৩', '4': '৪', '5': '৫', '6': '৬', '7': '৭', '8': '৮', '9': '৯', '0': '০', }, numberMap = { '১': '1', '২': '2', '৩': '3', '৪': '4', '৫': '5', '৬': '6', '৭': '7', '৮': '8', '৯': '9', '০': '0', }; var bn = moment.defineLocale('bn', { months: 'জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split( '_' ), monthsShort: 'জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে'.split( '_' ), weekdays: 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার'.split( '_' ), weekdaysShort: 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি'.split('_'), weekdaysMin: 'রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি'.split('_'), longDateFormat: { LT: 'A h:mm সময়', LTS: 'A h:mm:ss সময়', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY, A h:mm সময়', LLLL: 'dddd, D MMMM YYYY, A h:mm সময়', }, calendar: { sameDay: '[আজ] LT', nextDay: '[আগামীকাল] LT', nextWeek: 'dddd, LT', lastDay: '[গতকাল] LT', lastWeek: '[গত] dddd, LT', sameElse: 'L', }, relativeTime: { future: '%s পরে', past: '%s আগে', s: 'কয়েক সেকেন্ড', ss: '%d সেকেন্ড', m: 'এক মিনিট', mm: '%d মিনিট', h: 'এক ঘন্টা', hh: '%d ঘন্টা', d: 'এক দিন', dd: '%d দিন', M: 'এক মাস', MM: '%d মাস', y: 'এক বছর', yy: '%d বছর', }, preparse: function (string) { return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) { return numberMap[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { return symbolMap[match]; }); }, meridiemParse: /রাত|সকাল|দুপুর|বিকাল|রাত/, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if ( (meridiem === 'রাত' && hour >= 4) || (meridiem === 'দুপুর' && hour < 5) || meridiem === 'বিকাল' ) { return hour + 12; } else { return hour; } }, meridiem: function (hour, minute, isLower) { if (hour < 4) { return 'রাত'; } else if (hour < 10) { return 'সকাল'; } else if (hour < 17) { return 'দুপুর'; } else if (hour < 20) { return 'বিকাল'; } else { return 'রাত'; } }, week: { dow: 0, // Sunday is the first day of the week. doy: 6, // The week that contains Jan 6th is the first week of the year. }, }); return bn; }))); /***/ }), /* 1260 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Tibetan [bo] //! author : Thupten N. Chakrishar : https://github.com/vajradog ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var symbolMap = { '1': '༡', '2': '༢', '3': '༣', '4': '༤', '5': '༥', '6': '༦', '7': '༧', '8': '༨', '9': '༩', '0': '༠', }, numberMap = { '༡': '1', '༢': '2', '༣': '3', '༤': '4', '༥': '5', '༦': '6', '༧': '7', '༨': '8', '༩': '9', '༠': '0', }; var bo = moment.defineLocale('bo', { months: 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split( '_' ), monthsShort: 'ཟླ་1_ཟླ་2_ཟླ་3_ཟླ་4_ཟླ་5_ཟླ་6_ཟླ་7_ཟླ་8_ཟླ་9_ཟླ་10_ཟླ་11_ཟླ་12'.split( '_' ), monthsShortRegex: /^(ཟླ་\d{1,2})/, monthsParseExact: true, weekdays: 'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split( '_' ), weekdaysShort: 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split( '_' ), weekdaysMin: 'ཉི_ཟླ_མིག_ལྷག_ཕུར_སངས_སྤེན'.split('_'), longDateFormat: { LT: 'A h:mm', LTS: 'A h:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY, A h:mm', LLLL: 'dddd, D MMMM YYYY, A h:mm', }, calendar: { sameDay: '[དི་རིང] LT', nextDay: '[སང་ཉིན] LT', nextWeek: '[བདུན་ཕྲག་རྗེས་མ], LT', lastDay: '[ཁ་སང] LT', lastWeek: '[བདུན་ཕྲག་མཐའ་མ] dddd, LT', sameElse: 'L', }, relativeTime: { future: '%s ལ་', past: '%s སྔན་ལ', s: 'ལམ་སང', ss: '%d སྐར་ཆ།', m: 'སྐར་མ་གཅིག', mm: '%d སྐར་མ', h: 'ཆུ་ཚོད་གཅིག', hh: '%d ཆུ་ཚོད', d: 'ཉིན་གཅིག', dd: '%d ཉིན་', M: 'ཟླ་བ་གཅིག', MM: '%d ཟླ་བ', y: 'ལོ་གཅིག', yy: '%d ལོ', }, preparse: function (string) { return string.replace(/[༡༢༣༤༥༦༧༨༩༠]/g, function (match) { return numberMap[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { return symbolMap[match]; }); }, meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if ( (meridiem === 'མཚན་མོ' && hour >= 4) || (meridiem === 'ཉིན་གུང' && hour < 5) || meridiem === 'དགོང་དག' ) { return hour + 12; } else { return hour; } }, meridiem: function (hour, minute, isLower) { if (hour < 4) { return 'མཚན་མོ'; } else if (hour < 10) { return 'ཞོགས་ཀས'; } else if (hour < 17) { return 'ཉིན་གུང'; } else if (hour < 20) { return 'དགོང་དག'; } else { return 'མཚན་མོ'; } }, week: { dow: 0, // Sunday is the first day of the week. doy: 6, // The week that contains Jan 6th is the first week of the year. }, }); return bo; }))); /***/ }), /* 1261 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Breton [br] //! author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration function relativeTimeWithMutation(number, withoutSuffix, key) { var format = { mm: 'munutenn', MM: 'miz', dd: 'devezh', }; return number + ' ' + mutation(format[key], number); } function specialMutationForYears(number) { switch (lastNumber(number)) { case 1: case 3: case 4: case 5: case 9: return number + ' bloaz'; default: return number + ' vloaz'; } } function lastNumber(number) { if (number > 9) { return lastNumber(number % 10); } return number; } function mutation(text, number) { if (number === 2) { return softMutation(text); } return text; } function softMutation(text) { var mutationTable = { m: 'v', b: 'v', d: 'z', }; if (mutationTable[text.charAt(0)] === undefined) { return text; } return mutationTable[text.charAt(0)] + text.substring(1); } var br = moment.defineLocale('br', { months: "Genver_C'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split( '_' ), monthsShort: "Gen_C'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split('_'), weekdays: "Sul_Lun_Meurzh_Merc'her_Yaou_Gwener_Sadorn".split('_'), weekdaysShort: 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'), weekdaysMin: 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D [a viz] MMMM YYYY', LLL: 'D [a viz] MMMM YYYY HH:mm', LLLL: 'dddd, D [a viz] MMMM YYYY HH:mm', }, calendar: { sameDay: '[Hiziv da] LT', nextDay: "[Warc'hoazh da] LT", nextWeek: 'dddd [da] LT', lastDay: "[Dec'h da] LT", lastWeek: 'dddd [paset da] LT', sameElse: 'L', }, relativeTime: { future: 'a-benn %s', past: "%s 'zo", s: 'un nebeud segondennoù', ss: '%d eilenn', m: 'ur vunutenn', mm: relativeTimeWithMutation, h: 'un eur', hh: '%d eur', d: 'un devezh', dd: relativeTimeWithMutation, M: 'ur miz', MM: relativeTimeWithMutation, y: 'ur bloaz', yy: specialMutationForYears, }, dayOfMonthOrdinalParse: /\d{1,2}(añ|vet)/, ordinal: function (number) { var output = number === 1 ? 'añ' : 'vet'; return number + output; }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return br; }))); /***/ }), /* 1262 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Bosnian [bs] //! author : Nedim Cholich : https://github.com/frontyard //! based on (hr) translation by Bojan Marković ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration function translate(number, withoutSuffix, key) { var result = number + ' '; switch (key) { case 'ss': if (number === 1) { result += 'sekunda'; } else if (number === 2 || number === 3 || number === 4) { result += 'sekunde'; } else { result += 'sekundi'; } return result; case 'm': return withoutSuffix ? 'jedna minuta' : 'jedne minute'; case 'mm': if (number === 1) { result += 'minuta'; } else if (number === 2 || number === 3 || number === 4) { result += 'minute'; } else { result += 'minuta'; } return result; case 'h': return withoutSuffix ? 'jedan sat' : 'jednog sata'; case 'hh': if (number === 1) { result += 'sat'; } else if (number === 2 || number === 3 || number === 4) { result += 'sata'; } else { result += 'sati'; } return result; case 'dd': if (number === 1) { result += 'dan'; } else { result += 'dana'; } return result; case 'MM': if (number === 1) { result += 'mjesec'; } else if (number === 2 || number === 3 || number === 4) { result += 'mjeseca'; } else { result += 'mjeseci'; } return result; case 'yy': if (number === 1) { result += 'godina'; } else if (number === 2 || number === 3 || number === 4) { result += 'godine'; } else { result += 'godina'; } return result; } } var bs = moment.defineLocale('bs', { months: 'januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar'.split( '_' ), monthsShort: 'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split( '_' ), monthsParseExact: true, weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split( '_' ), weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'), weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', L: 'DD.MM.YYYY', LL: 'D. MMMM YYYY', LLL: 'D. MMMM YYYY H:mm', LLLL: 'dddd, D. MMMM YYYY H:mm', }, calendar: { sameDay: '[danas u] LT', nextDay: '[sutra u] LT', nextWeek: function () { switch (this.day()) { case 0: return '[u] [nedjelju] [u] LT'; case 3: return '[u] [srijedu] [u] LT'; case 6: return '[u] [subotu] [u] LT'; case 1: case 2: case 4: case 5: return '[u] dddd [u] LT'; } }, lastDay: '[jučer u] LT', lastWeek: function () { switch (this.day()) { case 0: case 3: return '[prošlu] dddd [u] LT'; case 6: return '[prošle] [subote] [u] LT'; case 1: case 2: case 4: case 5: return '[prošli] dddd [u] LT'; } }, sameElse: 'L', }, relativeTime: { future: 'za %s', past: 'prije %s', s: 'par sekundi', ss: translate, m: translate, mm: translate, h: translate, hh: translate, d: 'dan', dd: translate, M: 'mjesec', MM: translate, y: 'godinu', yy: translate, }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return bs; }))); /***/ }), /* 1263 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Catalan [ca] //! author : Juan G. Hurtado : https://github.com/juanghurtado ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var ca = moment.defineLocale('ca', { months: { standalone: 'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split( '_' ), format: "de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split( '_' ), isFormat: /D[oD]?(\s)+MMMM/, }, monthsShort: 'gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.'.split( '_' ), monthsParseExact: true, weekdays: 'diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte'.split( '_' ), weekdaysShort: 'dg._dl._dt._dc._dj._dv._ds.'.split('_'), weekdaysMin: 'dg_dl_dt_dc_dj_dv_ds'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM [de] YYYY', ll: 'D MMM YYYY', LLL: 'D MMMM [de] YYYY [a les] H:mm', lll: 'D MMM YYYY, H:mm', LLLL: 'dddd D MMMM [de] YYYY [a les] H:mm', llll: 'ddd D MMM YYYY, H:mm', }, calendar: { sameDay: function () { return '[avui a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT'; }, nextDay: function () { return '[demà a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT'; }, nextWeek: function () { return 'dddd [a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT'; }, lastDay: function () { return '[ahir a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT'; }, lastWeek: function () { return ( '[el] dddd [passat a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT' ); }, sameElse: 'L', }, relativeTime: { future: "d'aquí %s", past: 'fa %s', s: 'uns segons', ss: '%d segons', m: 'un minut', mm: '%d minuts', h: 'una hora', hh: '%d hores', d: 'un dia', dd: '%d dies', M: 'un mes', MM: '%d mesos', y: 'un any', yy: '%d anys', }, dayOfMonthOrdinalParse: /\d{1,2}(r|n|t|è|a)/, ordinal: function (number, period) { var output = number === 1 ? 'r' : number === 2 ? 'n' : number === 3 ? 'r' : number === 4 ? 't' : 'è'; if (period === 'w' || period === 'W') { output = 'a'; } return number + output; }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return ca; }))); /***/ }), /* 1264 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Czech [cs] //! author : petrbela : https://github.com/petrbela ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var months = 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split( '_' ), monthsShort = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_'), monthsParse = [ /^led/i, /^úno/i, /^bře/i, /^dub/i, /^kvě/i, /^(čvn|červen$|června)/i, /^(čvc|červenec|července)/i, /^srp/i, /^zář/i, /^říj/i, /^lis/i, /^pro/i, ], // NOTE: 'červen' is substring of 'červenec'; therefore 'červenec' must precede 'červen' in the regex to be fully matched. // Otherwise parser matches '1. červenec' as '1. červen' + 'ec'. monthsRegex = /^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i; function plural(n) { return n > 1 && n < 5 && ~~(n / 10) !== 1; } function translate(number, withoutSuffix, key, isFuture) { var result = number + ' '; switch (key) { case 's': // a few seconds / in a few seconds / a few seconds ago return withoutSuffix || isFuture ? 'pár sekund' : 'pár sekundami'; case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago if (withoutSuffix || isFuture) { return result + (plural(number) ? 'sekundy' : 'sekund'); } else { return result + 'sekundami'; } case 'm': // a minute / in a minute / a minute ago return withoutSuffix ? 'minuta' : isFuture ? 'minutu' : 'minutou'; case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago if (withoutSuffix || isFuture) { return result + (plural(number) ? 'minuty' : 'minut'); } else { return result + 'minutami'; } case 'h': // an hour / in an hour / an hour ago return withoutSuffix ? 'hodina' : isFuture ? 'hodinu' : 'hodinou'; case 'hh': // 9 hours / in 9 hours / 9 hours ago if (withoutSuffix || isFuture) { return result + (plural(number) ? 'hodiny' : 'hodin'); } else { return result + 'hodinami'; } case 'd': // a day / in a day / a day ago return withoutSuffix || isFuture ? 'den' : 'dnem'; case 'dd': // 9 days / in 9 days / 9 days ago if (withoutSuffix || isFuture) { return result + (plural(number) ? 'dny' : 'dní'); } else { return result + 'dny'; } case 'M': // a month / in a month / a month ago return withoutSuffix || isFuture ? 'měsíc' : 'měsícem'; case 'MM': // 9 months / in 9 months / 9 months ago if (withoutSuffix || isFuture) { return result + (plural(number) ? 'měsíce' : 'měsíců'); } else { return result + 'měsíci'; } case 'y': // a year / in a year / a year ago return withoutSuffix || isFuture ? 'rok' : 'rokem'; case 'yy': // 9 years / in 9 years / 9 years ago if (withoutSuffix || isFuture) { return result + (plural(number) ? 'roky' : 'let'); } else { return result + 'lety'; } } } var cs = moment.defineLocale('cs', { months: months, monthsShort: monthsShort, monthsRegex: monthsRegex, monthsShortRegex: monthsRegex, // NOTE: 'červen' is substring of 'červenec'; therefore 'červenec' must precede 'červen' in the regex to be fully matched. // Otherwise parser matches '1. červenec' as '1. červen' + 'ec'. monthsStrictRegex: /^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i, monthsShortStrictRegex: /^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i, monthsParse: monthsParse, longMonthsParse: monthsParse, shortMonthsParse: monthsParse, weekdays: 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'), weekdaysShort: 'ne_po_út_st_čt_pá_so'.split('_'), weekdaysMin: 'ne_po_út_st_čt_pá_so'.split('_'), longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', L: 'DD.MM.YYYY', LL: 'D. MMMM YYYY', LLL: 'D. MMMM YYYY H:mm', LLLL: 'dddd D. MMMM YYYY H:mm', l: 'D. M. YYYY', }, calendar: { sameDay: '[dnes v] LT', nextDay: '[zítra v] LT', nextWeek: function () { switch (this.day()) { case 0: return '[v neděli v] LT'; case 1: case 2: return '[v] dddd [v] LT'; case 3: return '[ve středu v] LT'; case 4: return '[ve čtvrtek v] LT'; case 5: return '[v pátek v] LT'; case 6: return '[v sobotu v] LT'; } }, lastDay: '[včera v] LT', lastWeek: function () { switch (this.day()) { case 0: return '[minulou neděli v] LT'; case 1: case 2: return '[minulé] dddd [v] LT'; case 3: return '[minulou středu v] LT'; case 4: case 5: return '[minulý] dddd [v] LT'; case 6: return '[minulou sobotu v] LT'; } }, sameElse: 'L', }, relativeTime: { future: 'za %s', past: 'před %s', s: translate, ss: translate, m: translate, mm: translate, h: translate, hh: translate, d: translate, dd: translate, M: translate, MM: translate, y: translate, yy: translate, }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return cs; }))); /***/ }), /* 1265 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Chuvash [cv] //! author : Anatoly Mironov : https://github.com/mirontoli ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var cv = moment.defineLocale('cv', { months: 'кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав'.split( '_' ), monthsShort: 'кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш'.split('_'), weekdays: 'вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун'.split( '_' ), weekdaysShort: 'выр_тун_ытл_юн_кӗҫ_эрн_шӑм'.split('_'), weekdaysMin: 'вр_тн_ыт_юн_кҫ_эр_шм'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD-MM-YYYY', LL: 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]', LLL: 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm', LLLL: 'dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm', }, calendar: { sameDay: '[Паян] LT [сехетре]', nextDay: '[Ыран] LT [сехетре]', lastDay: '[Ӗнер] LT [сехетре]', nextWeek: '[Ҫитес] dddd LT [сехетре]', lastWeek: '[Иртнӗ] dddd LT [сехетре]', sameElse: 'L', }, relativeTime: { future: function (output) { var affix = /сехет$/i.exec(output) ? 'рен' : /ҫул$/i.exec(output) ? 'тан' : 'ран'; return output + affix; }, past: '%s каялла', s: 'пӗр-ик ҫеккунт', ss: '%d ҫеккунт', m: 'пӗр минут', mm: '%d минут', h: 'пӗр сехет', hh: '%d сехет', d: 'пӗр кун', dd: '%d кун', M: 'пӗр уйӑх', MM: '%d уйӑх', y: 'пӗр ҫул', yy: '%d ҫул', }, dayOfMonthOrdinalParse: /\d{1,2}-мӗш/, ordinal: '%d-мӗш', week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return cv; }))); /***/ }), /* 1266 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Welsh [cy] //! author : Robert Allen : https://github.com/robgallen //! author : https://github.com/ryangreaves ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var cy = moment.defineLocale('cy', { months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split( '_' ), monthsShort: 'Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag'.split( '_' ), weekdays: 'Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn'.split( '_' ), weekdaysShort: 'Sul_Llun_Maw_Mer_Iau_Gwe_Sad'.split('_'), weekdaysMin: 'Su_Ll_Ma_Me_Ia_Gw_Sa'.split('_'), weekdaysParseExact: true, // time formats are the same as en-gb longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, calendar: { sameDay: '[Heddiw am] LT', nextDay: '[Yfory am] LT', nextWeek: 'dddd [am] LT', lastDay: '[Ddoe am] LT', lastWeek: 'dddd [diwethaf am] LT', sameElse: 'L', }, relativeTime: { future: 'mewn %s', past: '%s yn ôl', s: 'ychydig eiliadau', ss: '%d eiliad', m: 'munud', mm: '%d munud', h: 'awr', hh: '%d awr', d: 'diwrnod', dd: '%d diwrnod', M: 'mis', MM: '%d mis', y: 'blwyddyn', yy: '%d flynedd', }, dayOfMonthOrdinalParse: /\d{1,2}(fed|ain|af|il|ydd|ed|eg)/, // traditional ordinal numbers above 31 are not commonly used in colloquial Welsh ordinal: function (number) { var b = number, output = '', lookup = [ '', 'af', 'il', 'ydd', 'ydd', 'ed', 'ed', 'ed', 'fed', 'fed', 'fed', // 1af to 10fed 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'fed', // 11eg to 20fed ]; if (b > 20) { if (b === 40 || b === 50 || b === 60 || b === 80 || b === 100) { output = 'fed'; // not 30ain, 70ain or 90ain } else { output = 'ain'; } } else if (b > 0) { output = lookup[b]; } return number + output; }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return cy; }))); /***/ }), /* 1267 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Danish [da] //! author : Ulrik Nielsen : https://github.com/mrbase ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var da = moment.defineLocale('da', { months: 'januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december'.split( '_' ), monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'), weekdays: 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'), weekdaysShort: 'søn_man_tir_ons_tor_fre_lør'.split('_'), weekdaysMin: 'sø_ma_ti_on_to_fr_lø'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD.MM.YYYY', LL: 'D. MMMM YYYY', LLL: 'D. MMMM YYYY HH:mm', LLLL: 'dddd [d.] D. MMMM YYYY [kl.] HH:mm', }, calendar: { sameDay: '[i dag kl.] LT', nextDay: '[i morgen kl.] LT', nextWeek: 'på dddd [kl.] LT', lastDay: '[i går kl.] LT', lastWeek: '[i] dddd[s kl.] LT', sameElse: 'L', }, relativeTime: { future: 'om %s', past: '%s siden', s: 'få sekunder', ss: '%d sekunder', m: 'et minut', mm: '%d minutter', h: 'en time', hh: '%d timer', d: 'en dag', dd: '%d dage', M: 'en måned', MM: '%d måneder', y: 'et år', yy: '%d år', }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return da; }))); /***/ }), /* 1268 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : German [de] //! author : lluchs : https://github.com/lluchs //! author: Menelion Elensúle: https://github.com/Oire //! author : Mikolaj Dadela : https://github.com/mik01aj ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration function processRelativeTime(number, withoutSuffix, key, isFuture) { var format = { m: ['eine Minute', 'einer Minute'], h: ['eine Stunde', 'einer Stunde'], d: ['ein Tag', 'einem Tag'], dd: [number + ' Tage', number + ' Tagen'], M: ['ein Monat', 'einem Monat'], MM: [number + ' Monate', number + ' Monaten'], y: ['ein Jahr', 'einem Jahr'], yy: [number + ' Jahre', number + ' Jahren'], }; return withoutSuffix ? format[key][0] : format[key][1]; } var de = moment.defineLocale('de', { months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split( '_' ), monthsShort: 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split( '_' ), monthsParseExact: true, weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split( '_' ), weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'), weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD.MM.YYYY', LL: 'D. MMMM YYYY', LLL: 'D. MMMM YYYY HH:mm', LLLL: 'dddd, D. MMMM YYYY HH:mm', }, calendar: { sameDay: '[heute um] LT [Uhr]', sameElse: 'L', nextDay: '[morgen um] LT [Uhr]', nextWeek: 'dddd [um] LT [Uhr]', lastDay: '[gestern um] LT [Uhr]', lastWeek: '[letzten] dddd [um] LT [Uhr]', }, relativeTime: { future: 'in %s', past: 'vor %s', s: 'ein paar Sekunden', ss: '%d Sekunden', m: processRelativeTime, mm: '%d Minuten', h: processRelativeTime, hh: '%d Stunden', d: processRelativeTime, dd: processRelativeTime, M: processRelativeTime, MM: processRelativeTime, y: processRelativeTime, yy: processRelativeTime, }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return de; }))); /***/ }), /* 1269 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : German (Austria) [de-at] //! author : lluchs : https://github.com/lluchs //! author: Menelion Elensúle: https://github.com/Oire //! author : Martin Groller : https://github.com/MadMG //! author : Mikolaj Dadela : https://github.com/mik01aj ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration function processRelativeTime(number, withoutSuffix, key, isFuture) { var format = { m: ['eine Minute', 'einer Minute'], h: ['eine Stunde', 'einer Stunde'], d: ['ein Tag', 'einem Tag'], dd: [number + ' Tage', number + ' Tagen'], M: ['ein Monat', 'einem Monat'], MM: [number + ' Monate', number + ' Monaten'], y: ['ein Jahr', 'einem Jahr'], yy: [number + ' Jahre', number + ' Jahren'], }; return withoutSuffix ? format[key][0] : format[key][1]; } var deAt = moment.defineLocale('de-at', { months: 'Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split( '_' ), monthsShort: 'Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split( '_' ), monthsParseExact: true, weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split( '_' ), weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'), weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD.MM.YYYY', LL: 'D. MMMM YYYY', LLL: 'D. MMMM YYYY HH:mm', LLLL: 'dddd, D. MMMM YYYY HH:mm', }, calendar: { sameDay: '[heute um] LT [Uhr]', sameElse: 'L', nextDay: '[morgen um] LT [Uhr]', nextWeek: 'dddd [um] LT [Uhr]', lastDay: '[gestern um] LT [Uhr]', lastWeek: '[letzten] dddd [um] LT [Uhr]', }, relativeTime: { future: 'in %s', past: 'vor %s', s: 'ein paar Sekunden', ss: '%d Sekunden', m: processRelativeTime, mm: '%d Minuten', h: processRelativeTime, hh: '%d Stunden', d: processRelativeTime, dd: processRelativeTime, M: processRelativeTime, MM: processRelativeTime, y: processRelativeTime, yy: processRelativeTime, }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return deAt; }))); /***/ }), /* 1270 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : German (Switzerland) [de-ch] //! author : sschueller : https://github.com/sschueller ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration function processRelativeTime(number, withoutSuffix, key, isFuture) { var format = { m: ['eine Minute', 'einer Minute'], h: ['eine Stunde', 'einer Stunde'], d: ['ein Tag', 'einem Tag'], dd: [number + ' Tage', number + ' Tagen'], M: ['ein Monat', 'einem Monat'], MM: [number + ' Monate', number + ' Monaten'], y: ['ein Jahr', 'einem Jahr'], yy: [number + ' Jahre', number + ' Jahren'], }; return withoutSuffix ? format[key][0] : format[key][1]; } var deCh = moment.defineLocale('de-ch', { months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split( '_' ), monthsShort: 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split( '_' ), monthsParseExact: true, weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split( '_' ), weekdaysShort: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'), weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD.MM.YYYY', LL: 'D. MMMM YYYY', LLL: 'D. MMMM YYYY HH:mm', LLLL: 'dddd, D. MMMM YYYY HH:mm', }, calendar: { sameDay: '[heute um] LT [Uhr]', sameElse: 'L', nextDay: '[morgen um] LT [Uhr]', nextWeek: 'dddd [um] LT [Uhr]', lastDay: '[gestern um] LT [Uhr]', lastWeek: '[letzten] dddd [um] LT [Uhr]', }, relativeTime: { future: 'in %s', past: 'vor %s', s: 'ein paar Sekunden', ss: '%d Sekunden', m: processRelativeTime, mm: '%d Minuten', h: processRelativeTime, hh: '%d Stunden', d: processRelativeTime, dd: processRelativeTime, M: processRelativeTime, MM: processRelativeTime, y: processRelativeTime, yy: processRelativeTime, }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return deCh; }))); /***/ }), /* 1271 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Maldivian [dv] //! author : Jawish Hameed : https://github.com/jawish ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var months = [ 'ޖެނުއަރީ', 'ފެބްރުއަރީ', 'މާރިޗު', 'އޭޕްރީލު', 'މޭ', 'ޖޫން', 'ޖުލައި', 'އޯގަސްޓު', 'ސެޕްޓެމްބަރު', 'އޮކްޓޯބަރު', 'ނޮވެމްބަރު', 'ޑިސެމްބަރު', ], weekdays = [ 'އާދިއްތަ', 'ހޯމަ', 'އަންގާރަ', 'ބުދަ', 'ބުރާސްފަތި', 'ހުކުރު', 'ހޮނިހިރު', ]; var dv = moment.defineLocale('dv', { months: months, monthsShort: months, weekdays: weekdays, weekdaysShort: weekdays, weekdaysMin: 'އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'D/M/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd D MMMM YYYY HH:mm', }, meridiemParse: /މކ|މފ/, isPM: function (input) { return 'މފ' === input; }, meridiem: function (hour, minute, isLower) { if (hour < 12) { return 'މކ'; } else { return 'މފ'; } }, calendar: { sameDay: '[މިއަދު] LT', nextDay: '[މާދަމާ] LT', nextWeek: 'dddd LT', lastDay: '[އިއްޔެ] LT', lastWeek: '[ފާއިތުވި] dddd LT', sameElse: 'L', }, relativeTime: { future: 'ތެރޭގައި %s', past: 'ކުރިން %s', s: 'ސިކުންތުކޮޅެއް', ss: 'd% ސިކުންތު', m: 'މިނިޓެއް', mm: 'މިނިޓު %d', h: 'ގަޑިއިރެއް', hh: 'ގަޑިއިރު %d', d: 'ދުވަހެއް', dd: 'ދުވަސް %d', M: 'މަހެއް', MM: 'މަސް %d', y: 'އަހަރެއް', yy: 'އަހަރު %d', }, preparse: function (string) { return string.replace(/،/g, ','); }, postformat: function (string) { return string.replace(/,/g, '،'); }, week: { dow: 7, // Sunday is the first day of the week. doy: 12, // The week that contains Jan 12th is the first week of the year. }, }); return dv; }))); /***/ }), /* 1272 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Greek [el] //! author : Aggelos Karalias : https://github.com/mehiel ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration function isFunction(input) { return ( (typeof Function !== 'undefined' && input instanceof Function) || Object.prototype.toString.call(input) === '[object Function]' ); } var el = moment.defineLocale('el', { monthsNominativeEl: 'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split( '_' ), monthsGenitiveEl: 'Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου'.split( '_' ), months: function (momentToFormat, format) { if (!momentToFormat) { return this._monthsNominativeEl; } else if ( typeof format === 'string' && /D/.test(format.substring(0, format.indexOf('MMMM'))) ) { // if there is a day number before 'MMMM' return this._monthsGenitiveEl[momentToFormat.month()]; } else { return this._monthsNominativeEl[momentToFormat.month()]; } }, monthsShort: 'Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ'.split('_'), weekdays: 'Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο'.split( '_' ), weekdaysShort: 'Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ'.split('_'), weekdaysMin: 'Κυ_Δε_Τρ_Τε_Πε_Πα_Σα'.split('_'), meridiem: function (hours, minutes, isLower) { if (hours > 11) { return isLower ? 'μμ' : 'ΜΜ'; } else { return isLower ? 'πμ' : 'ΠΜ'; } }, isPM: function (input) { return (input + '').toLowerCase()[0] === 'μ'; }, meridiemParse: /[ΠΜ]\.?Μ?\.?/i, longDateFormat: { LT: 'h:mm A', LTS: 'h:mm:ss A', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY h:mm A', LLLL: 'dddd, D MMMM YYYY h:mm A', }, calendarEl: { sameDay: '[Σήμερα {}] LT', nextDay: '[Αύριο {}] LT', nextWeek: 'dddd [{}] LT', lastDay: '[Χθες {}] LT', lastWeek: function () { switch (this.day()) { case 6: return '[το προηγούμενο] dddd [{}] LT'; default: return '[την προηγούμενη] dddd [{}] LT'; } }, sameElse: 'L', }, calendar: function (key, mom) { var output = this._calendarEl[key], hours = mom && mom.hours(); if (isFunction(output)) { output = output.apply(mom); } return output.replace('{}', hours % 12 === 1 ? 'στη' : 'στις'); }, relativeTime: { future: 'σε %s', past: '%s πριν', s: 'λίγα δευτερόλεπτα', ss: '%d δευτερόλεπτα', m: 'ένα λεπτό', mm: '%d λεπτά', h: 'μία ώρα', hh: '%d ώρες', d: 'μία μέρα', dd: '%d μέρες', M: 'ένας μήνας', MM: '%d μήνες', y: 'ένας χρόνος', yy: '%d χρόνια', }, dayOfMonthOrdinalParse: /\d{1,2}η/, ordinal: '%dη', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4st is the first week of the year. }, }); return el; }))); /***/ }), /* 1273 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : English (Australia) [en-au] //! author : Jared Morse : https://github.com/jarcoal ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var enAu = moment.defineLocale('en-au', { months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split( '_' ), monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split( '_' ), weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), longDateFormat: { LT: 'h:mm A', LTS: 'h:mm:ss A', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY h:mm A', LLLL: 'dddd, D MMMM YYYY h:mm A', }, calendar: { sameDay: '[Today at] LT', nextDay: '[Tomorrow at] LT', nextWeek: 'dddd [at] LT', lastDay: '[Yesterday at] LT', lastWeek: '[Last] dddd [at] LT', sameElse: 'L', }, relativeTime: { future: 'in %s', past: '%s ago', s: 'a few seconds', ss: '%d 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', }, dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/, ordinal: function (number) { var b = number % 10, output = ~~((number % 100) / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th'; return number + output; }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return enAu; }))); /***/ }), /* 1274 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : English (Canada) [en-ca] //! author : Jonathan Abourbih : https://github.com/jonbca ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var enCa = moment.defineLocale('en-ca', { months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split( '_' ), monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split( '_' ), weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), longDateFormat: { LT: 'h:mm A', LTS: 'h:mm:ss A', L: 'YYYY-MM-DD', LL: 'MMMM D, YYYY', LLL: 'MMMM D, YYYY h:mm A', LLLL: 'dddd, MMMM D, YYYY h:mm A', }, calendar: { sameDay: '[Today at] LT', nextDay: '[Tomorrow at] LT', nextWeek: 'dddd [at] LT', lastDay: '[Yesterday at] LT', lastWeek: '[Last] dddd [at] LT', sameElse: 'L', }, relativeTime: { future: 'in %s', past: '%s ago', s: 'a few seconds', ss: '%d 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', }, dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/, ordinal: function (number) { var b = number % 10, output = ~~((number % 100) / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th'; return number + output; }, }); return enCa; }))); /***/ }), /* 1275 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : English (United Kingdom) [en-gb] //! author : Chris Gedrim : https://github.com/chrisgedrim ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var enGb = moment.defineLocale('en-gb', { months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split( '_' ), monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split( '_' ), weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, calendar: { sameDay: '[Today at] LT', nextDay: '[Tomorrow at] LT', nextWeek: 'dddd [at] LT', lastDay: '[Yesterday at] LT', lastWeek: '[Last] dddd [at] LT', sameElse: 'L', }, relativeTime: { future: 'in %s', past: '%s ago', s: 'a few seconds', ss: '%d 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', }, dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/, ordinal: function (number) { var b = number % 10, output = ~~((number % 100) / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th'; return number + output; }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return enGb; }))); /***/ }), /* 1276 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : English (Ireland) [en-ie] //! author : Chris Cartlidge : https://github.com/chriscartlidge ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var enIe = moment.defineLocale('en-ie', { months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split( '_' ), monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split( '_' ), weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd D MMMM YYYY HH:mm', }, calendar: { sameDay: '[Today at] LT', nextDay: '[Tomorrow at] LT', nextWeek: 'dddd [at] LT', lastDay: '[Yesterday at] LT', lastWeek: '[Last] dddd [at] LT', sameElse: 'L', }, relativeTime: { future: 'in %s', past: '%s ago', s: 'a few seconds', ss: '%d 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', }, dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/, ordinal: function (number) { var b = number % 10, output = ~~((number % 100) / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th'; return number + output; }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return enIe; }))); /***/ }), /* 1277 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : English (Israel) [en-il] //! author : Chris Gedrim : https://github.com/chrisgedrim ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var enIl = moment.defineLocale('en-il', { months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split( '_' ), monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split( '_' ), weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, calendar: { sameDay: '[Today at] LT', nextDay: '[Tomorrow at] LT', nextWeek: 'dddd [at] LT', lastDay: '[Yesterday at] LT', lastWeek: '[Last] dddd [at] LT', sameElse: 'L', }, relativeTime: { future: 'in %s', past: '%s ago', s: 'a few seconds', ss: '%d 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', }, dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/, ordinal: function (number) { var b = number % 10, output = ~~((number % 100) / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th'; return number + output; }, }); return enIl; }))); /***/ }), /* 1278 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : English (India) [en-in] //! author : Jatin Agrawal : https://github.com/jatinag22 ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var enIn = moment.defineLocale('en-in', { months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split( '_' ), monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split( '_' ), weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), longDateFormat: { LT: 'h:mm A', LTS: 'h:mm:ss A', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY h:mm A', LLLL: 'dddd, D MMMM YYYY h:mm A', }, calendar: { sameDay: '[Today at] LT', nextDay: '[Tomorrow at] LT', nextWeek: 'dddd [at] LT', lastDay: '[Yesterday at] LT', lastWeek: '[Last] dddd [at] LT', sameElse: 'L', }, relativeTime: { future: 'in %s', past: '%s ago', s: 'a few seconds', ss: '%d 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', }, dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/, ordinal: function (number) { var b = number % 10, output = ~~((number % 100) / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th'; return number + output; }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return enIn; }))); /***/ }), /* 1279 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : English (New Zealand) [en-nz] //! author : Luke McGregor : https://github.com/lukemcgregor ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var enNz = moment.defineLocale('en-nz', { months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split( '_' ), monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split( '_' ), weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), longDateFormat: { LT: 'h:mm A', LTS: 'h:mm:ss A', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY h:mm A', LLLL: 'dddd, D MMMM YYYY h:mm A', }, calendar: { sameDay: '[Today at] LT', nextDay: '[Tomorrow at] LT', nextWeek: 'dddd [at] LT', lastDay: '[Yesterday at] LT', lastWeek: '[Last] dddd [at] LT', sameElse: 'L', }, relativeTime: { future: 'in %s', past: '%s ago', s: 'a few seconds', ss: '%d 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', }, dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/, ordinal: function (number) { var b = number % 10, output = ~~((number % 100) / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th'; return number + output; }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return enNz; }))); /***/ }), /* 1280 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : English (Singapore) [en-sg] //! author : Matthew Castrillon-Madrigal : https://github.com/techdimension ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var enSg = moment.defineLocale('en-sg', { months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split( '_' ), monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split( '_' ), weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, calendar: { sameDay: '[Today at] LT', nextDay: '[Tomorrow at] LT', nextWeek: 'dddd [at] LT', lastDay: '[Yesterday at] LT', lastWeek: '[Last] dddd [at] LT', sameElse: 'L', }, relativeTime: { future: 'in %s', past: '%s ago', s: 'a few seconds', ss: '%d 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', }, dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/, ordinal: function (number) { var b = number % 10, output = ~~((number % 100) / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th'; return number + output; }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return enSg; }))); /***/ }), /* 1281 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Esperanto [eo] //! author : Colin Dean : https://github.com/colindean //! author : Mia Nordentoft Imperatori : https://github.com/miestasmia //! comment : miestasmia corrected the translation by colindean //! comment : Vivakvo corrected the translation by colindean and miestasmia ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var eo = moment.defineLocale('eo', { months: 'januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro'.split( '_' ), monthsShort: 'jan_feb_mart_apr_maj_jun_jul_aŭg_sept_okt_nov_dec'.split('_'), weekdays: 'dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato'.split('_'), weekdaysShort: 'dim_lun_mard_merk_ĵaŭ_ven_sab'.split('_'), weekdaysMin: 'di_lu_ma_me_ĵa_ve_sa'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'YYYY-MM-DD', LL: '[la] D[-an de] MMMM, YYYY', LLL: '[la] D[-an de] MMMM, YYYY HH:mm', LLLL: 'dddd[n], [la] D[-an de] MMMM, YYYY HH:mm', llll: 'ddd, [la] D[-an de] MMM, YYYY HH:mm', }, meridiemParse: /[ap]\.t\.m/i, isPM: function (input) { return input.charAt(0).toLowerCase() === 'p'; }, meridiem: function (hours, minutes, isLower) { if (hours > 11) { return isLower ? 'p.t.m.' : 'P.T.M.'; } else { return isLower ? 'a.t.m.' : 'A.T.M.'; } }, calendar: { sameDay: '[Hodiaŭ je] LT', nextDay: '[Morgaŭ je] LT', nextWeek: 'dddd[n je] LT', lastDay: '[Hieraŭ je] LT', lastWeek: '[pasintan] dddd[n je] LT', sameElse: 'L', }, relativeTime: { future: 'post %s', past: 'antaŭ %s', s: 'kelkaj sekundoj', ss: '%d sekundoj', m: 'unu minuto', mm: '%d minutoj', h: 'unu horo', hh: '%d horoj', d: 'unu tago', //ne 'diurno', ĉar estas uzita por proksimumo dd: '%d tagoj', M: 'unu monato', MM: '%d monatoj', y: 'unu jaro', yy: '%d jaroj', }, dayOfMonthOrdinalParse: /\d{1,2}a/, ordinal: '%da', week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return eo; }))); /***/ }), /* 1282 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Spanish [es] //! author : Julio Napurí : https://github.com/julionc ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split( '_' ), monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'), monthsParse = [ /^ene/i, /^feb/i, /^mar/i, /^abr/i, /^may/i, /^jun/i, /^jul/i, /^ago/i, /^sep/i, /^oct/i, /^nov/i, /^dic/i, ], monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i; var es = moment.defineLocale('es', { months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split( '_' ), monthsShort: function (m, format) { if (!m) { return monthsShortDot; } else if (/-MMM-/.test(format)) { return monthsShort[m.month()]; } else { return monthsShortDot[m.month()]; } }, monthsRegex: monthsRegex, monthsShortRegex: monthsRegex, monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i, monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i, monthsParse: monthsParse, longMonthsParse: monthsParse, shortMonthsParse: monthsParse, weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'), weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', L: 'DD/MM/YYYY', LL: 'D [de] MMMM [de] YYYY', LLL: 'D [de] MMMM [de] YYYY H:mm', LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm', }, calendar: { sameDay: function () { return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; }, nextDay: function () { return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; }, nextWeek: function () { return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; }, lastDay: function () { return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; }, lastWeek: function () { return ( '[el] dddd [pasado a la' + (this.hours() !== 1 ? 's' : '') + '] LT' ); }, sameElse: 'L', }, relativeTime: { future: 'en %s', past: 'hace %s', s: 'unos segundos', ss: '%d segundos', m: 'un minuto', mm: '%d minutos', h: 'una hora', hh: '%d horas', d: 'un día', dd: '%d días', M: 'un mes', MM: '%d meses', y: 'un año', yy: '%d años', }, dayOfMonthOrdinalParse: /\d{1,2}º/, ordinal: '%dº', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, invalidDate: 'Fecha invalida', }); return es; }))); /***/ }), /* 1283 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Spanish (Dominican Republic) [es-do] ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split( '_' ), monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'), monthsParse = [ /^ene/i, /^feb/i, /^mar/i, /^abr/i, /^may/i, /^jun/i, /^jul/i, /^ago/i, /^sep/i, /^oct/i, /^nov/i, /^dic/i, ], monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i; var esDo = moment.defineLocale('es-do', { months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split( '_' ), monthsShort: function (m, format) { if (!m) { return monthsShortDot; } else if (/-MMM-/.test(format)) { return monthsShort[m.month()]; } else { return monthsShortDot[m.month()]; } }, monthsRegex: monthsRegex, monthsShortRegex: monthsRegex, monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i, monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i, monthsParse: monthsParse, longMonthsParse: monthsParse, shortMonthsParse: monthsParse, weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'), weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'h:mm A', LTS: 'h:mm:ss A', L: 'DD/MM/YYYY', LL: 'D [de] MMMM [de] YYYY', LLL: 'D [de] MMMM [de] YYYY h:mm A', LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A', }, calendar: { sameDay: function () { return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; }, nextDay: function () { return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; }, nextWeek: function () { return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; }, lastDay: function () { return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; }, lastWeek: function () { return ( '[el] dddd [pasado a la' + (this.hours() !== 1 ? 's' : '') + '] LT' ); }, sameElse: 'L', }, relativeTime: { future: 'en %s', past: 'hace %s', s: 'unos segundos', ss: '%d segundos', m: 'un minuto', mm: '%d minutos', h: 'una hora', hh: '%d horas', d: 'un día', dd: '%d días', M: 'un mes', MM: '%d meses', y: 'un año', yy: '%d años', }, dayOfMonthOrdinalParse: /\d{1,2}º/, ordinal: '%dº', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return esDo; }))); /***/ }), /* 1284 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Spanish (United States) [es-us] //! author : bustta : https://github.com/bustta //! author : chrisrodz : https://github.com/chrisrodz ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split( '_' ), monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'), monthsParse = [ /^ene/i, /^feb/i, /^mar/i, /^abr/i, /^may/i, /^jun/i, /^jul/i, /^ago/i, /^sep/i, /^oct/i, /^nov/i, /^dic/i, ], monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i; var esUs = moment.defineLocale('es-us', { months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split( '_' ), monthsShort: function (m, format) { if (!m) { return monthsShortDot; } else if (/-MMM-/.test(format)) { return monthsShort[m.month()]; } else { return monthsShortDot[m.month()]; } }, monthsRegex: monthsRegex, monthsShortRegex: monthsRegex, monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i, monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i, monthsParse: monthsParse, longMonthsParse: monthsParse, shortMonthsParse: monthsParse, weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'), weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'h:mm A', LTS: 'h:mm:ss A', L: 'MM/DD/YYYY', LL: 'D [de] MMMM [de] YYYY', LLL: 'D [de] MMMM [de] YYYY h:mm A', LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A', }, calendar: { sameDay: function () { return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; }, nextDay: function () { return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; }, nextWeek: function () { return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; }, lastDay: function () { return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; }, lastWeek: function () { return ( '[el] dddd [pasado a la' + (this.hours() !== 1 ? 's' : '') + '] LT' ); }, sameElse: 'L', }, relativeTime: { future: 'en %s', past: 'hace %s', s: 'unos segundos', ss: '%d segundos', m: 'un minuto', mm: '%d minutos', h: 'una hora', hh: '%d horas', d: 'un día', dd: '%d días', M: 'un mes', MM: '%d meses', y: 'un año', yy: '%d años', }, dayOfMonthOrdinalParse: /\d{1,2}º/, ordinal: '%dº', week: { dow: 0, // Sunday is the first day of the week. doy: 6, // The week that contains Jan 6th is the first week of the year. }, }); return esUs; }))); /***/ }), /* 1285 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Estonian [et] //! author : Henry Kehlmann : https://github.com/madhenry //! improvements : Illimar Tambek : https://github.com/ragulka ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration function processRelativeTime(number, withoutSuffix, key, isFuture) { var format = { s: ['mõne sekundi', 'mõni sekund', 'paar sekundit'], ss: [number + 'sekundi', number + 'sekundit'], m: ['ühe minuti', 'üks minut'], mm: [number + ' minuti', number + ' minutit'], h: ['ühe tunni', 'tund aega', 'üks tund'], hh: [number + ' tunni', number + ' tundi'], d: ['ühe päeva', 'üks päev'], M: ['kuu aja', 'kuu aega', 'üks kuu'], MM: [number + ' kuu', number + ' kuud'], y: ['ühe aasta', 'aasta', 'üks aasta'], yy: [number + ' aasta', number + ' aastat'], }; if (withoutSuffix) { return format[key][2] ? format[key][2] : format[key][1]; } return isFuture ? format[key][0] : format[key][1]; } var et = moment.defineLocale('et', { months: 'jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember'.split( '_' ), monthsShort: 'jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets'.split( '_' ), weekdays: 'pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev'.split( '_' ), weekdaysShort: 'P_E_T_K_N_R_L'.split('_'), weekdaysMin: 'P_E_T_K_N_R_L'.split('_'), longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', L: 'DD.MM.YYYY', LL: 'D. MMMM YYYY', LLL: 'D. MMMM YYYY H:mm', LLLL: 'dddd, D. MMMM YYYY H:mm', }, calendar: { sameDay: '[Täna,] LT', nextDay: '[Homme,] LT', nextWeek: '[Järgmine] dddd LT', lastDay: '[Eile,] LT', lastWeek: '[Eelmine] dddd LT', sameElse: 'L', }, relativeTime: { future: '%s pärast', past: '%s tagasi', s: processRelativeTime, ss: processRelativeTime, m: processRelativeTime, mm: processRelativeTime, h: processRelativeTime, hh: processRelativeTime, d: processRelativeTime, dd: '%d päeva', M: processRelativeTime, MM: processRelativeTime, y: processRelativeTime, yy: processRelativeTime, }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return et; }))); /***/ }), /* 1286 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Basque [eu] //! author : Eneko Illarramendi : https://github.com/eillarra ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var eu = moment.defineLocale('eu', { months: 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split( '_' ), monthsShort: 'urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.'.split( '_' ), monthsParseExact: true, weekdays: 'igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata'.split( '_' ), weekdaysShort: 'ig._al._ar._az._og._ol._lr.'.split('_'), weekdaysMin: 'ig_al_ar_az_og_ol_lr'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'YYYY-MM-DD', LL: 'YYYY[ko] MMMM[ren] D[a]', LLL: 'YYYY[ko] MMMM[ren] D[a] HH:mm', LLLL: 'dddd, YYYY[ko] MMMM[ren] D[a] HH:mm', l: 'YYYY-M-D', ll: 'YYYY[ko] MMM D[a]', lll: 'YYYY[ko] MMM D[a] HH:mm', llll: 'ddd, YYYY[ko] MMM D[a] HH:mm', }, calendar: { sameDay: '[gaur] LT[etan]', nextDay: '[bihar] LT[etan]', nextWeek: 'dddd LT[etan]', lastDay: '[atzo] LT[etan]', lastWeek: '[aurreko] dddd LT[etan]', sameElse: 'L', }, relativeTime: { future: '%s barru', past: 'duela %s', s: 'segundo batzuk', ss: '%d segundo', m: 'minutu bat', mm: '%d minutu', h: 'ordu bat', hh: '%d ordu', d: 'egun bat', dd: '%d egun', M: 'hilabete bat', MM: '%d hilabete', y: 'urte bat', yy: '%d urte', }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return eu; }))); /***/ }), /* 1287 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Persian [fa] //! author : Ebrahim Byagowi : https://github.com/ebraminio ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var symbolMap = { '1': '۱', '2': '۲', '3': '۳', '4': '۴', '5': '۵', '6': '۶', '7': '۷', '8': '۸', '9': '۹', '0': '۰', }, numberMap = { '۱': '1', '۲': '2', '۳': '3', '۴': '4', '۵': '5', '۶': '6', '۷': '7', '۸': '8', '۹': '9', '۰': '0', }; var fa = moment.defineLocale('fa', { months: 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split( '_' ), monthsShort: 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split( '_' ), weekdays: 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split( '_' ), weekdaysShort: 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split( '_' ), weekdaysMin: 'ی_د_س_چ_پ_ج_ش'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, meridiemParse: /قبل از ظهر|بعد از ظهر/, isPM: function (input) { return /بعد از ظهر/.test(input); }, meridiem: function (hour, minute, isLower) { if (hour < 12) { return 'قبل از ظهر'; } else { return 'بعد از ظهر'; } }, calendar: { sameDay: '[امروز ساعت] LT', nextDay: '[فردا ساعت] LT', nextWeek: 'dddd [ساعت] LT', lastDay: '[دیروز ساعت] LT', lastWeek: 'dddd [پیش] [ساعت] LT', sameElse: 'L', }, relativeTime: { future: 'در %s', past: '%s پیش', s: 'چند ثانیه', ss: '%d ثانیه', m: 'یک دقیقه', mm: '%d دقیقه', h: 'یک ساعت', hh: '%d ساعت', d: 'یک روز', dd: '%d روز', M: 'یک ماه', MM: '%d ماه', y: 'یک سال', yy: '%d سال', }, preparse: function (string) { return string .replace(/[۰-۹]/g, function (match) { return numberMap[match]; }) .replace(/،/g, ','); }, postformat: function (string) { return string .replace(/\d/g, function (match) { return symbolMap[match]; }) .replace(/,/g, '،'); }, dayOfMonthOrdinalParse: /\d{1,2}م/, ordinal: '%dم', week: { dow: 6, // Saturday is the first day of the week. doy: 12, // The week that contains Jan 12th is the first week of the year. }, }); return fa; }))); /***/ }), /* 1288 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Finnish [fi] //! author : Tarmo Aidantausta : https://github.com/bleadof ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var numbersPast = 'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split( ' ' ), numbersFuture = [ 'nolla', 'yhden', 'kahden', 'kolmen', 'neljän', 'viiden', 'kuuden', numbersPast[7], numbersPast[8], numbersPast[9], ]; function translate(number, withoutSuffix, key, isFuture) { var result = ''; switch (key) { case 's': return isFuture ? 'muutaman sekunnin' : 'muutama sekunti'; case 'ss': return isFuture ? 'sekunnin' : 'sekuntia'; case 'm': return isFuture ? 'minuutin' : 'minuutti'; case 'mm': result = isFuture ? 'minuutin' : 'minuuttia'; break; case 'h': return isFuture ? 'tunnin' : 'tunti'; case 'hh': result = isFuture ? 'tunnin' : 'tuntia'; break; case 'd': return isFuture ? 'päivän' : 'päivä'; case 'dd': result = isFuture ? 'päivän' : 'päivää'; break; case 'M': return isFuture ? 'kuukauden' : 'kuukausi'; case 'MM': result = isFuture ? 'kuukauden' : 'kuukautta'; break; case 'y': return isFuture ? 'vuoden' : 'vuosi'; case 'yy': result = isFuture ? 'vuoden' : 'vuotta'; break; } result = verbalNumber(number, isFuture) + ' ' + result; return result; } function verbalNumber(number, isFuture) { return number < 10 ? isFuture ? numbersFuture[number] : numbersPast[number] : number; } var fi = moment.defineLocale('fi', { months: 'tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu'.split( '_' ), monthsShort: 'tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu'.split( '_' ), weekdays: 'sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai'.split( '_' ), weekdaysShort: 'su_ma_ti_ke_to_pe_la'.split('_'), weekdaysMin: 'su_ma_ti_ke_to_pe_la'.split('_'), longDateFormat: { LT: 'HH.mm', LTS: 'HH.mm.ss', L: 'DD.MM.YYYY', LL: 'Do MMMM[ta] YYYY', LLL: 'Do MMMM[ta] YYYY, [klo] HH.mm', LLLL: 'dddd, Do MMMM[ta] YYYY, [klo] HH.mm', l: 'D.M.YYYY', ll: 'Do MMM YYYY', lll: 'Do MMM YYYY, [klo] HH.mm', llll: 'ddd, Do MMM YYYY, [klo] HH.mm', }, calendar: { sameDay: '[tänään] [klo] LT', nextDay: '[huomenna] [klo] LT', nextWeek: 'dddd [klo] LT', lastDay: '[eilen] [klo] LT', lastWeek: '[viime] dddd[na] [klo] LT', sameElse: 'L', }, relativeTime: { future: '%s päästä', past: '%s sitten', s: translate, ss: translate, m: translate, mm: translate, h: translate, hh: translate, d: translate, dd: translate, M: translate, MM: translate, y: translate, yy: translate, }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return fi; }))); /***/ }), /* 1289 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Filipino [fil] //! author : Dan Hagman : https://github.com/hagmandan //! author : Matthew Co : https://github.com/matthewdeeco ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var fil = moment.defineLocale('fil', { months: 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split( '_' ), monthsShort: 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'), weekdays: 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split( '_' ), weekdaysShort: 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'), weekdaysMin: 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'MM/D/YYYY', LL: 'MMMM D, YYYY', LLL: 'MMMM D, YYYY HH:mm', LLLL: 'dddd, MMMM DD, YYYY HH:mm', }, calendar: { sameDay: 'LT [ngayong araw]', nextDay: '[Bukas ng] LT', nextWeek: 'LT [sa susunod na] dddd', lastDay: 'LT [kahapon]', lastWeek: 'LT [noong nakaraang] dddd', sameElse: 'L', }, relativeTime: { future: 'sa loob ng %s', past: '%s ang nakalipas', s: 'ilang segundo', ss: '%d segundo', m: 'isang minuto', mm: '%d minuto', h: 'isang oras', hh: '%d oras', d: 'isang araw', dd: '%d araw', M: 'isang buwan', MM: '%d buwan', y: 'isang taon', yy: '%d taon', }, dayOfMonthOrdinalParse: /\d{1,2}/, ordinal: function (number) { return number; }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return fil; }))); /***/ }), /* 1290 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Faroese [fo] //! author : Ragnar Johannesen : https://github.com/ragnar123 //! author : Kristian Sakarisson : https://github.com/sakarisson ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var fo = moment.defineLocale('fo', { months: 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split( '_' ), monthsShort: 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'), weekdays: 'sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur'.split( '_' ), weekdaysShort: 'sun_mán_týs_mik_hós_frí_ley'.split('_'), weekdaysMin: 'su_má_tý_mi_hó_fr_le'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd D. MMMM, YYYY HH:mm', }, calendar: { sameDay: '[Í dag kl.] LT', nextDay: '[Í morgin kl.] LT', nextWeek: 'dddd [kl.] LT', lastDay: '[Í gjár kl.] LT', lastWeek: '[síðstu] dddd [kl] LT', sameElse: 'L', }, relativeTime: { future: 'um %s', past: '%s síðani', s: 'fá sekund', ss: '%d sekundir', m: 'ein minuttur', mm: '%d minuttir', h: 'ein tími', hh: '%d tímar', d: 'ein dagur', dd: '%d dagar', M: 'ein mánaður', MM: '%d mánaðir', y: 'eitt ár', yy: '%d ár', }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return fo; }))); /***/ }), /* 1291 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : French [fr] //! author : John Fischer : https://github.com/jfroffice ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var fr = moment.defineLocale('fr', { months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split( '_' ), monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split( '_' ), monthsParseExact: true, weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'), weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'), weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd D MMMM YYYY HH:mm', }, calendar: { sameDay: '[Aujourd’hui à] LT', nextDay: '[Demain à] LT', nextWeek: 'dddd [à] LT', lastDay: '[Hier à] LT', lastWeek: 'dddd [dernier à] LT', sameElse: 'L', }, relativeTime: { future: 'dans %s', past: 'il y a %s', s: 'quelques secondes', ss: '%d secondes', m: 'une minute', mm: '%d minutes', h: 'une heure', hh: '%d heures', d: 'un jour', dd: '%d jours', M: 'un mois', MM: '%d mois', y: 'un an', yy: '%d ans', }, dayOfMonthOrdinalParse: /\d{1,2}(er|)/, ordinal: function (number, period) { switch (period) { // TODO: Return 'e' when day of month > 1. Move this case inside // block for masculine words below. // See https://github.com/moment/moment/issues/3375 case 'D': return number + (number === 1 ? 'er' : ''); // Words with masculine grammatical gender: mois, trimestre, jour default: case 'M': case 'Q': case 'DDD': case 'd': return number + (number === 1 ? 'er' : 'e'); // Words with feminine grammatical gender: semaine case 'w': case 'W': return number + (number === 1 ? 're' : 'e'); } }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return fr; }))); /***/ }), /* 1292 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : French (Canada) [fr-ca] //! author : Jonathan Abourbih : https://github.com/jonbca ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var frCa = moment.defineLocale('fr-ca', { months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split( '_' ), monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split( '_' ), monthsParseExact: true, weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'), weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'), weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'YYYY-MM-DD', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd D MMMM YYYY HH:mm', }, calendar: { sameDay: '[Aujourd’hui à] LT', nextDay: '[Demain à] LT', nextWeek: 'dddd [à] LT', lastDay: '[Hier à] LT', lastWeek: 'dddd [dernier à] LT', sameElse: 'L', }, relativeTime: { future: 'dans %s', past: 'il y a %s', s: 'quelques secondes', ss: '%d secondes', m: 'une minute', mm: '%d minutes', h: 'une heure', hh: '%d heures', d: 'un jour', dd: '%d jours', M: 'un mois', MM: '%d mois', y: 'un an', yy: '%d ans', }, dayOfMonthOrdinalParse: /\d{1,2}(er|e)/, ordinal: function (number, period) { switch (period) { // Words with masculine grammatical gender: mois, trimestre, jour default: case 'M': case 'Q': case 'D': case 'DDD': case 'd': return number + (number === 1 ? 'er' : 'e'); // Words with feminine grammatical gender: semaine case 'w': case 'W': return number + (number === 1 ? 're' : 'e'); } }, }); return frCa; }))); /***/ }), /* 1293 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : French (Switzerland) [fr-ch] //! author : Gaspard Bucher : https://github.com/gaspard ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var frCh = moment.defineLocale('fr-ch', { months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split( '_' ), monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split( '_' ), monthsParseExact: true, weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'), weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'), weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD.MM.YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd D MMMM YYYY HH:mm', }, calendar: { sameDay: '[Aujourd’hui à] LT', nextDay: '[Demain à] LT', nextWeek: 'dddd [à] LT', lastDay: '[Hier à] LT', lastWeek: 'dddd [dernier à] LT', sameElse: 'L', }, relativeTime: { future: 'dans %s', past: 'il y a %s', s: 'quelques secondes', ss: '%d secondes', m: 'une minute', mm: '%d minutes', h: 'une heure', hh: '%d heures', d: 'un jour', dd: '%d jours', M: 'un mois', MM: '%d mois', y: 'un an', yy: '%d ans', }, dayOfMonthOrdinalParse: /\d{1,2}(er|e)/, ordinal: function (number, period) { switch (period) { // Words with masculine grammatical gender: mois, trimestre, jour default: case 'M': case 'Q': case 'D': case 'DDD': case 'd': return number + (number === 1 ? 'er' : 'e'); // Words with feminine grammatical gender: semaine case 'w': case 'W': return number + (number === 1 ? 're' : 'e'); } }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return frCh; }))); /***/ }), /* 1294 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Frisian [fy] //! author : Robin van der Vliet : https://github.com/robin0van0der0v ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var monthsShortWithDots = 'jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.'.split( '_' ), monthsShortWithoutDots = 'jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des'.split( '_' ); var fy = moment.defineLocale('fy', { months: 'jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber'.split( '_' ), monthsShort: function (m, format) { if (!m) { return monthsShortWithDots; } else if (/-MMM-/.test(format)) { return monthsShortWithoutDots[m.month()]; } else { return monthsShortWithDots[m.month()]; } }, monthsParseExact: true, weekdays: 'snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon'.split( '_' ), weekdaysShort: 'si._mo._ti._wo._to._fr._so.'.split('_'), weekdaysMin: 'Si_Mo_Ti_Wo_To_Fr_So'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD-MM-YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd D MMMM YYYY HH:mm', }, calendar: { sameDay: '[hjoed om] LT', nextDay: '[moarn om] LT', nextWeek: 'dddd [om] LT', lastDay: '[juster om] LT', lastWeek: '[ôfrûne] dddd [om] LT', sameElse: 'L', }, relativeTime: { future: 'oer %s', past: '%s lyn', s: 'in pear sekonden', ss: '%d sekonden', m: 'ien minút', mm: '%d minuten', h: 'ien oere', hh: '%d oeren', d: 'ien dei', dd: '%d dagen', M: 'ien moanne', MM: '%d moannen', y: 'ien jier', yy: '%d jierren', }, dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/, ordinal: function (number) { return ( number + (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de') ); }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return fy; }))); /***/ }), /* 1295 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Irish or Irish Gaelic [ga] //! author : André Silva : https://github.com/askpt ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var months = [ 'Eanáir', 'Feabhra', 'Márta', 'Aibreán', 'Bealtaine', 'Meitheamh', 'Iúil', 'Lúnasa', 'Meán Fómhair', 'Deireadh Fómhair', 'Samhain', 'Nollaig', ], monthsShort = [ 'Ean', 'Feabh', 'Márt', 'Aib', 'Beal', 'Meith', 'Iúil', 'Lún', 'M.F.', 'D.F.', 'Samh', 'Noll', ], weekdays = [ 'Dé Domhnaigh', 'Dé Luain', 'Dé Máirt', 'Dé Céadaoin', 'Déardaoin', 'Dé hAoine', 'Dé Sathairn', ], weekdaysShort = ['Domh', 'Luan', 'Máirt', 'Céad', 'Déar', 'Aoine', 'Sath'], weekdaysMin = ['Do', 'Lu', 'Má', 'Cé', 'Dé', 'A', 'Sa']; var ga = moment.defineLocale('ga', { months: months, monthsShort: monthsShort, monthsParseExact: true, weekdays: weekdays, weekdaysShort: weekdaysShort, weekdaysMin: weekdaysMin, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, calendar: { sameDay: '[Inniu ag] LT', nextDay: '[Amárach ag] LT', nextWeek: 'dddd [ag] LT', lastDay: '[Inné ag] LT', lastWeek: 'dddd [seo caite] [ag] LT', sameElse: 'L', }, relativeTime: { future: 'i %s', past: '%s ó shin', s: 'cúpla soicind', ss: '%d soicind', m: 'nóiméad', mm: '%d nóiméad', h: 'uair an chloig', hh: '%d uair an chloig', d: 'lá', dd: '%d lá', M: 'mí', MM: '%d míonna', y: 'bliain', yy: '%d bliain', }, dayOfMonthOrdinalParse: /\d{1,2}(d|na|mh)/, ordinal: function (number) { var output = number === 1 ? 'd' : number % 10 === 2 ? 'na' : 'mh'; return number + output; }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return ga; }))); /***/ }), /* 1296 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Scottish Gaelic [gd] //! author : Jon Ashdown : https://github.com/jonashdown ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var months = [ 'Am Faoilleach', 'An Gearran', 'Am Màrt', 'An Giblean', 'An Cèitean', 'An t-Ògmhios', 'An t-Iuchar', 'An Lùnastal', 'An t-Sultain', 'An Dàmhair', 'An t-Samhain', 'An Dùbhlachd', ], monthsShort = [ 'Faoi', 'Gear', 'Màrt', 'Gibl', 'Cèit', 'Ògmh', 'Iuch', 'Lùn', 'Sult', 'Dàmh', 'Samh', 'Dùbh', ], weekdays = [ 'Didòmhnaich', 'Diluain', 'Dimàirt', 'Diciadain', 'Diardaoin', 'Dihaoine', 'Disathairne', ], weekdaysShort = ['Did', 'Dil', 'Dim', 'Dic', 'Dia', 'Dih', 'Dis'], weekdaysMin = ['Dò', 'Lu', 'Mà', 'Ci', 'Ar', 'Ha', 'Sa']; var gd = moment.defineLocale('gd', { months: months, monthsShort: monthsShort, monthsParseExact: true, weekdays: weekdays, weekdaysShort: weekdaysShort, weekdaysMin: weekdaysMin, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, calendar: { sameDay: '[An-diugh aig] LT', nextDay: '[A-màireach aig] LT', nextWeek: 'dddd [aig] LT', lastDay: '[An-dè aig] LT', lastWeek: 'dddd [seo chaidh] [aig] LT', sameElse: 'L', }, relativeTime: { future: 'ann an %s', past: 'bho chionn %s', s: 'beagan diogan', ss: '%d diogan', m: 'mionaid', mm: '%d mionaidean', h: 'uair', hh: '%d uairean', d: 'latha', dd: '%d latha', M: 'mìos', MM: '%d mìosan', y: 'bliadhna', yy: '%d bliadhna', }, dayOfMonthOrdinalParse: /\d{1,2}(d|na|mh)/, ordinal: function (number) { var output = number === 1 ? 'd' : number % 10 === 2 ? 'na' : 'mh'; return number + output; }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return gd; }))); /***/ }), /* 1297 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Galician [gl] //! author : Juan G. Hurtado : https://github.com/juanghurtado ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var gl = moment.defineLocale('gl', { months: 'xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro'.split( '_' ), monthsShort: 'xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.'.split( '_' ), monthsParseExact: true, weekdays: 'domingo_luns_martes_mércores_xoves_venres_sábado'.split('_'), weekdaysShort: 'dom._lun._mar._mér._xov._ven._sáb.'.split('_'), weekdaysMin: 'do_lu_ma_mé_xo_ve_sá'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', L: 'DD/MM/YYYY', LL: 'D [de] MMMM [de] YYYY', LLL: 'D [de] MMMM [de] YYYY H:mm', LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm', }, calendar: { sameDay: function () { return '[hoxe ' + (this.hours() !== 1 ? 'ás' : 'á') + '] LT'; }, nextDay: function () { return '[mañá ' + (this.hours() !== 1 ? 'ás' : 'á') + '] LT'; }, nextWeek: function () { return 'dddd [' + (this.hours() !== 1 ? 'ás' : 'a') + '] LT'; }, lastDay: function () { return '[onte ' + (this.hours() !== 1 ? 'á' : 'a') + '] LT'; }, lastWeek: function () { return ( '[o] dddd [pasado ' + (this.hours() !== 1 ? 'ás' : 'a') + '] LT' ); }, sameElse: 'L', }, relativeTime: { future: function (str) { if (str.indexOf('un') === 0) { return 'n' + str; } return 'en ' + str; }, past: 'hai %s', s: 'uns segundos', ss: '%d segundos', m: 'un minuto', mm: '%d minutos', h: 'unha hora', hh: '%d horas', d: 'un día', dd: '%d días', M: 'un mes', MM: '%d meses', y: 'un ano', yy: '%d anos', }, dayOfMonthOrdinalParse: /\d{1,2}º/, ordinal: '%dº', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return gl; }))); /***/ }), /* 1298 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Konkani Devanagari script [gom-deva] //! author : The Discoverer : https://github.com/WikiDiscoverer ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration function processRelativeTime(number, withoutSuffix, key, isFuture) { var format = { s: ['थोडया सॅकंडांनी', 'थोडे सॅकंड'], ss: [number + ' सॅकंडांनी', number + ' सॅकंड'], m: ['एका मिणटान', 'एक मिनूट'], mm: [number + ' मिणटांनी', number + ' मिणटां'], h: ['एका वरान', 'एक वर'], hh: [number + ' वरांनी', number + ' वरां'], d: ['एका दिसान', 'एक दीस'], dd: [number + ' दिसांनी', number + ' दीस'], M: ['एका म्हयन्यान', 'एक म्हयनो'], MM: [number + ' म्हयन्यानी', number + ' म्हयने'], y: ['एका वर्सान', 'एक वर्स'], yy: [number + ' वर्सांनी', number + ' वर्सां'], }; return isFuture ? format[key][0] : format[key][1]; } var gomDeva = moment.defineLocale('gom-deva', { months: { standalone: 'जानेवारी_फेब्रुवारी_मार्च_एप्रील_मे_जून_जुलय_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split( '_' ), format: 'जानेवारीच्या_फेब्रुवारीच्या_मार्चाच्या_एप्रीलाच्या_मेयाच्या_जूनाच्या_जुलयाच्या_ऑगस्टाच्या_सप्टेंबराच्या_ऑक्टोबराच्या_नोव्हेंबराच्या_डिसेंबराच्या'.split( '_' ), isFormat: /MMMM(\s)+D[oD]?/, }, monthsShort: 'जाने._फेब्रु._मार्च_एप्री._मे_जून_जुल._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split( '_' ), monthsParseExact: true, weekdays: 'आयतार_सोमार_मंगळार_बुधवार_बिरेस्तार_सुक्रार_शेनवार'.split('_'), weekdaysShort: 'आयत._सोम._मंगळ._बुध._ब्रेस्त._सुक्र._शेन.'.split('_'), weekdaysMin: 'आ_सो_मं_बु_ब्रे_सु_शे'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'A h:mm [वाजतां]', LTS: 'A h:mm:ss [वाजतां]', L: 'DD-MM-YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY A h:mm [वाजतां]', LLLL: 'dddd, MMMM Do, YYYY, A h:mm [वाजतां]', llll: 'ddd, D MMM YYYY, A h:mm [वाजतां]', }, calendar: { sameDay: '[आयज] LT', nextDay: '[फाल्यां] LT', nextWeek: '[फुडलो] dddd[,] LT', lastDay: '[काल] LT', lastWeek: '[फाटलो] dddd[,] LT', sameElse: 'L', }, relativeTime: { future: '%s', past: '%s आदीं', s: processRelativeTime, ss: processRelativeTime, m: processRelativeTime, mm: processRelativeTime, h: processRelativeTime, hh: processRelativeTime, d: processRelativeTime, dd: processRelativeTime, M: processRelativeTime, MM: processRelativeTime, y: processRelativeTime, yy: processRelativeTime, }, dayOfMonthOrdinalParse: /\d{1,2}(वेर)/, ordinal: function (number, period) { switch (period) { // the ordinal 'वेर' only applies to day of the month case 'D': return number + 'वेर'; default: case 'M': case 'Q': case 'DDD': case 'd': case 'w': case 'W': return number; } }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, meridiemParse: /राती|सकाळीं|दनपारां|सांजे/, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if (meridiem === 'राती') { return hour < 4 ? hour : hour + 12; } else if (meridiem === 'सकाळीं') { return hour; } else if (meridiem === 'दनपारां') { return hour > 12 ? hour : hour + 12; } else if (meridiem === 'सांजे') { return hour + 12; } }, meridiem: function (hour, minute, isLower) { if (hour < 4) { return 'राती'; } else if (hour < 12) { return 'सकाळीं'; } else if (hour < 16) { return 'दनपारां'; } else if (hour < 20) { return 'सांजे'; } else { return 'राती'; } }, }); return gomDeva; }))); /***/ }), /* 1299 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Konkani Latin script [gom-latn] //! author : The Discoverer : https://github.com/WikiDiscoverer ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration function processRelativeTime(number, withoutSuffix, key, isFuture) { var format = { s: ['thoddea sekondamni', 'thodde sekond'], ss: [number + ' sekondamni', number + ' sekond'], m: ['eka mintan', 'ek minut'], mm: [number + ' mintamni', number + ' mintam'], h: ['eka voran', 'ek vor'], hh: [number + ' voramni', number + ' voram'], d: ['eka disan', 'ek dis'], dd: [number + ' disamni', number + ' dis'], M: ['eka mhoinean', 'ek mhoino'], MM: [number + ' mhoineamni', number + ' mhoine'], y: ['eka vorsan', 'ek voros'], yy: [number + ' vorsamni', number + ' vorsam'], }; return isFuture ? format[key][0] : format[key][1]; } var gomLatn = moment.defineLocale('gom-latn', { months: { standalone: 'Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr'.split( '_' ), format: 'Janerachea_Febrerachea_Marsachea_Abrilachea_Maiachea_Junachea_Julaiachea_Agostachea_Setembrachea_Otubrachea_Novembrachea_Dezembrachea'.split( '_' ), isFormat: /MMMM(\s)+D[oD]?/, }, monthsShort: 'Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.'.split( '_' ), monthsParseExact: true, weekdays: "Aitar_Somar_Mongllar_Budhvar_Birestar_Sukrar_Son'var".split('_'), weekdaysShort: 'Ait._Som._Mon._Bud._Bre._Suk._Son.'.split('_'), weekdaysMin: 'Ai_Sm_Mo_Bu_Br_Su_Sn'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'A h:mm [vazta]', LTS: 'A h:mm:ss [vazta]', L: 'DD-MM-YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY A h:mm [vazta]', LLLL: 'dddd, MMMM Do, YYYY, A h:mm [vazta]', llll: 'ddd, D MMM YYYY, A h:mm [vazta]', }, calendar: { sameDay: '[Aiz] LT', nextDay: '[Faleam] LT', nextWeek: '[Fuddlo] dddd[,] LT', lastDay: '[Kal] LT', lastWeek: '[Fattlo] dddd[,] LT', sameElse: 'L', }, relativeTime: { future: '%s', past: '%s adim', s: processRelativeTime, ss: processRelativeTime, m: processRelativeTime, mm: processRelativeTime, h: processRelativeTime, hh: processRelativeTime, d: processRelativeTime, dd: processRelativeTime, M: processRelativeTime, MM: processRelativeTime, y: processRelativeTime, yy: processRelativeTime, }, dayOfMonthOrdinalParse: /\d{1,2}(er)/, ordinal: function (number, period) { switch (period) { // the ordinal 'er' only applies to day of the month case 'D': return number + 'er'; default: case 'M': case 'Q': case 'DDD': case 'd': case 'w': case 'W': return number; } }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, meridiemParse: /rati|sokallim|donparam|sanje/, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if (meridiem === 'rati') { return hour < 4 ? hour : hour + 12; } else if (meridiem === 'sokallim') { return hour; } else if (meridiem === 'donparam') { return hour > 12 ? hour : hour + 12; } else if (meridiem === 'sanje') { return hour + 12; } }, meridiem: function (hour, minute, isLower) { if (hour < 4) { return 'rati'; } else if (hour < 12) { return 'sokallim'; } else if (hour < 16) { return 'donparam'; } else if (hour < 20) { return 'sanje'; } else { return 'rati'; } }, }); return gomLatn; }))); /***/ }), /* 1300 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Gujarati [gu] //! author : Kaushik Thanki : https://github.com/Kaushik1987 ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var symbolMap = { '1': '૧', '2': '૨', '3': '૩', '4': '૪', '5': '૫', '6': '૬', '7': '૭', '8': '૮', '9': '૯', '0': '૦', }, numberMap = { '૧': '1', '૨': '2', '૩': '3', '૪': '4', '૫': '5', '૬': '6', '૭': '7', '૮': '8', '૯': '9', '૦': '0', }; var gu = moment.defineLocale('gu', { months: 'જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર'.split( '_' ), monthsShort: 'જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.'.split( '_' ), monthsParseExact: true, weekdays: 'રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર'.split( '_' ), weekdaysShort: 'રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ'.split('_'), weekdaysMin: 'ર_સો_મં_બુ_ગુ_શુ_શ'.split('_'), longDateFormat: { LT: 'A h:mm વાગ્યે', LTS: 'A h:mm:ss વાગ્યે', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY, A h:mm વાગ્યે', LLLL: 'dddd, D MMMM YYYY, A h:mm વાગ્યે', }, calendar: { sameDay: '[આજ] LT', nextDay: '[કાલે] LT', nextWeek: 'dddd, LT', lastDay: '[ગઇકાલે] LT', lastWeek: '[પાછલા] dddd, LT', sameElse: 'L', }, relativeTime: { future: '%s મા', past: '%s પેહલા', s: 'અમુક પળો', ss: '%d સેકંડ', m: 'એક મિનિટ', mm: '%d મિનિટ', h: 'એક કલાક', hh: '%d કલાક', d: 'એક દિવસ', dd: '%d દિવસ', M: 'એક મહિનો', MM: '%d મહિનો', y: 'એક વર્ષ', yy: '%d વર્ષ', }, preparse: function (string) { return string.replace(/[૧૨૩૪૫૬૭૮૯૦]/g, function (match) { return numberMap[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { return symbolMap[match]; }); }, // Gujarati notation for meridiems are quite fuzzy in practice. While there exists // a rigid notion of a 'Pahar' it is not used as rigidly in modern Gujarati. meridiemParse: /રાત|બપોર|સવાર|સાંજ/, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if (meridiem === 'રાત') { return hour < 4 ? hour : hour + 12; } else if (meridiem === 'સવાર') { return hour; } else if (meridiem === 'બપોર') { return hour >= 10 ? hour : hour + 12; } else if (meridiem === 'સાંજ') { return hour + 12; } }, meridiem: function (hour, minute, isLower) { if (hour < 4) { return 'રાત'; } else if (hour < 10) { return 'સવાર'; } else if (hour < 17) { return 'બપોર'; } else if (hour < 20) { return 'સાંજ'; } else { return 'રાત'; } }, week: { dow: 0, // Sunday is the first day of the week. doy: 6, // The week that contains Jan 6th is the first week of the year. }, }); return gu; }))); /***/ }), /* 1301 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Hebrew [he] //! author : Tomer Cohen : https://github.com/tomer //! author : Moshe Simantov : https://github.com/DevelopmentIL //! author : Tal Ater : https://github.com/TalAter ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var he = moment.defineLocale('he', { months: 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split( '_' ), monthsShort: 'ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳'.split( '_' ), weekdays: 'ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת'.split('_'), weekdaysShort: 'א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'), weekdaysMin: 'א_ב_ג_ד_ה_ו_ש'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D [ב]MMMM YYYY', LLL: 'D [ב]MMMM YYYY HH:mm', LLLL: 'dddd, D [ב]MMMM YYYY HH:mm', l: 'D/M/YYYY', ll: 'D MMM YYYY', lll: 'D MMM YYYY HH:mm', llll: 'ddd, D MMM YYYY HH:mm', }, calendar: { sameDay: '[היום ב־]LT', nextDay: '[מחר ב־]LT', nextWeek: 'dddd [בשעה] LT', lastDay: '[אתמול ב־]LT', lastWeek: '[ביום] dddd [האחרון בשעה] LT', sameElse: 'L', }, relativeTime: { future: 'בעוד %s', past: 'לפני %s', s: 'מספר שניות', ss: '%d שניות', m: 'דקה', mm: '%d דקות', h: 'שעה', hh: function (number) { if (number === 2) { return 'שעתיים'; } return number + ' שעות'; }, d: 'יום', dd: function (number) { if (number === 2) { return 'יומיים'; } return number + ' ימים'; }, M: 'חודש', MM: function (number) { if (number === 2) { return 'חודשיים'; } return number + ' חודשים'; }, y: 'שנה', yy: function (number) { if (number === 2) { return 'שנתיים'; } else if (number % 10 === 0 && number !== 10) { return number + ' שנה'; } return number + ' שנים'; }, }, meridiemParse: /אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i, isPM: function (input) { return /^(אחה"צ|אחרי הצהריים|בערב)$/.test(input); }, meridiem: function (hour, minute, isLower) { if (hour < 5) { return 'לפנות בוקר'; } else if (hour < 10) { return 'בבוקר'; } else if (hour < 12) { return isLower ? 'לפנה"צ' : 'לפני הצהריים'; } else if (hour < 18) { return isLower ? 'אחה"צ' : 'אחרי הצהריים'; } else { return 'בערב'; } }, }); return he; }))); /***/ }), /* 1302 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Hindi [hi] //! author : Mayank Singhal : https://github.com/mayanksinghal ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var symbolMap = { '1': '१', '2': '२', '3': '३', '4': '४', '5': '५', '6': '६', '7': '७', '8': '८', '9': '९', '0': '०', }, numberMap = { '१': '1', '२': '2', '३': '3', '४': '4', '५': '5', '६': '6', '७': '7', '८': '8', '९': '9', '०': '0', }; var hi = moment.defineLocale('hi', { months: 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split( '_' ), monthsShort: 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split( '_' ), monthsParseExact: true, weekdays: 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'), weekdaysShort: 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split('_'), weekdaysMin: 'र_सो_मं_बु_गु_शु_श'.split('_'), longDateFormat: { LT: 'A h:mm बजे', LTS: 'A h:mm:ss बजे', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY, A h:mm बजे', LLLL: 'dddd, D MMMM YYYY, A h:mm बजे', }, calendar: { sameDay: '[आज] LT', nextDay: '[कल] LT', nextWeek: 'dddd, LT', lastDay: '[कल] LT', lastWeek: '[पिछले] dddd, LT', sameElse: 'L', }, relativeTime: { future: '%s में', past: '%s पहले', s: 'कुछ ही क्षण', ss: '%d सेकंड', m: 'एक मिनट', mm: '%d मिनट', h: 'एक घंटा', hh: '%d घंटे', d: 'एक दिन', dd: '%d दिन', M: 'एक महीने', MM: '%d महीने', y: 'एक वर्ष', yy: '%d वर्ष', }, preparse: function (string) { return string.replace(/[१२३४५६७८९०]/g, function (match) { return numberMap[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { return symbolMap[match]; }); }, // Hindi notation for meridiems are quite fuzzy in practice. While there exists // a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi. meridiemParse: /रात|सुबह|दोपहर|शाम/, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if (meridiem === 'रात') { return hour < 4 ? hour : hour + 12; } else if (meridiem === 'सुबह') { return hour; } else if (meridiem === 'दोपहर') { return hour >= 10 ? hour : hour + 12; } else if (meridiem === 'शाम') { return hour + 12; } }, meridiem: function (hour, minute, isLower) { if (hour < 4) { return 'रात'; } else if (hour < 10) { return 'सुबह'; } else if (hour < 17) { return 'दोपहर'; } else if (hour < 20) { return 'शाम'; } else { return 'रात'; } }, week: { dow: 0, // Sunday is the first day of the week. doy: 6, // The week that contains Jan 6th is the first week of the year. }, }); return hi; }))); /***/ }), /* 1303 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Croatian [hr] //! author : Bojan Marković : https://github.com/bmarkovic ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration function translate(number, withoutSuffix, key) { var result = number + ' '; switch (key) { case 'ss': if (number === 1) { result += 'sekunda'; } else if (number === 2 || number === 3 || number === 4) { result += 'sekunde'; } else { result += 'sekundi'; } return result; case 'm': return withoutSuffix ? 'jedna minuta' : 'jedne minute'; case 'mm': if (number === 1) { result += 'minuta'; } else if (number === 2 || number === 3 || number === 4) { result += 'minute'; } else { result += 'minuta'; } return result; case 'h': return withoutSuffix ? 'jedan sat' : 'jednog sata'; case 'hh': if (number === 1) { result += 'sat'; } else if (number === 2 || number === 3 || number === 4) { result += 'sata'; } else { result += 'sati'; } return result; case 'dd': if (number === 1) { result += 'dan'; } else { result += 'dana'; } return result; case 'MM': if (number === 1) { result += 'mjesec'; } else if (number === 2 || number === 3 || number === 4) { result += 'mjeseca'; } else { result += 'mjeseci'; } return result; case 'yy': if (number === 1) { result += 'godina'; } else if (number === 2 || number === 3 || number === 4) { result += 'godine'; } else { result += 'godina'; } return result; } } var hr = moment.defineLocale('hr', { months: { format: 'siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca'.split( '_' ), standalone: 'siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split( '_' ), }, monthsShort: 'sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.'.split( '_' ), monthsParseExact: true, weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split( '_' ), weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'), weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', L: 'DD.MM.YYYY', LL: 'Do MMMM YYYY', LLL: 'Do MMMM YYYY H:mm', LLLL: 'dddd, Do MMMM YYYY H:mm', }, calendar: { sameDay: '[danas u] LT', nextDay: '[sutra u] LT', nextWeek: function () { switch (this.day()) { case 0: return '[u] [nedjelju] [u] LT'; case 3: return '[u] [srijedu] [u] LT'; case 6: return '[u] [subotu] [u] LT'; case 1: case 2: case 4: case 5: return '[u] dddd [u] LT'; } }, lastDay: '[jučer u] LT', lastWeek: function () { switch (this.day()) { case 0: return '[prošlu] [nedjelju] [u] LT'; case 3: return '[prošlu] [srijedu] [u] LT'; case 6: return '[prošle] [subote] [u] LT'; case 1: case 2: case 4: case 5: return '[prošli] dddd [u] LT'; } }, sameElse: 'L', }, relativeTime: { future: 'za %s', past: 'prije %s', s: 'par sekundi', ss: translate, m: translate, mm: translate, h: translate, hh: translate, d: 'dan', dd: translate, M: 'mjesec', MM: translate, y: 'godinu', yy: translate, }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return hr; }))); /***/ }), /* 1304 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Hungarian [hu] //! author : Adam Brunner : https://github.com/adambrunner ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var weekEndings = 'vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton'.split( ' ' ); function translate(number, withoutSuffix, key, isFuture) { var num = number; switch (key) { case 's': return isFuture || withoutSuffix ? 'néhány másodperc' : 'néhány másodperce'; case 'ss': return num + (isFuture || withoutSuffix) ? ' másodperc' : ' másodperce'; case 'm': return 'egy' + (isFuture || withoutSuffix ? ' perc' : ' perce'); case 'mm': return num + (isFuture || withoutSuffix ? ' perc' : ' perce'); case 'h': return 'egy' + (isFuture || withoutSuffix ? ' óra' : ' órája'); case 'hh': return num + (isFuture || withoutSuffix ? ' óra' : ' órája'); case 'd': return 'egy' + (isFuture || withoutSuffix ? ' nap' : ' napja'); case 'dd': return num + (isFuture || withoutSuffix ? ' nap' : ' napja'); case 'M': return 'egy' + (isFuture || withoutSuffix ? ' hónap' : ' hónapja'); case 'MM': return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja'); case 'y': return 'egy' + (isFuture || withoutSuffix ? ' év' : ' éve'); case 'yy': return num + (isFuture || withoutSuffix ? ' év' : ' éve'); } return ''; } function week(isFuture) { return ( (isFuture ? '' : '[múlt] ') + '[' + weekEndings[this.day()] + '] LT[-kor]' ); } var hu = moment.defineLocale('hu', { months: 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split( '_' ), monthsShort: 'jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec'.split( '_' ), weekdays: 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'), weekdaysShort: 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'), weekdaysMin: 'v_h_k_sze_cs_p_szo'.split('_'), longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', L: 'YYYY.MM.DD.', LL: 'YYYY. MMMM D.', LLL: 'YYYY. MMMM D. H:mm', LLLL: 'YYYY. MMMM D., dddd H:mm', }, meridiemParse: /de|du/i, isPM: function (input) { return input.charAt(1).toLowerCase() === 'u'; }, meridiem: function (hours, minutes, isLower) { if (hours < 12) { return isLower === true ? 'de' : 'DE'; } else { return isLower === true ? 'du' : 'DU'; } }, calendar: { sameDay: '[ma] LT[-kor]', nextDay: '[holnap] LT[-kor]', nextWeek: function () { return week.call(this, true); }, lastDay: '[tegnap] LT[-kor]', lastWeek: function () { return week.call(this, false); }, sameElse: 'L', }, relativeTime: { future: '%s múlva', past: '%s', s: translate, ss: translate, m: translate, mm: translate, h: translate, hh: translate, d: translate, dd: translate, M: translate, MM: translate, y: translate, yy: translate, }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return hu; }))); /***/ }), /* 1305 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Armenian [hy-am] //! author : Armendarabyan : https://github.com/armendarabyan ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var hyAm = moment.defineLocale('hy-am', { months: { format: 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split( '_' ), standalone: 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split( '_' ), }, monthsShort: 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'), weekdays: 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split( '_' ), weekdaysShort: 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'), weekdaysMin: 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD.MM.YYYY', LL: 'D MMMM YYYY թ.', LLL: 'D MMMM YYYY թ., HH:mm', LLLL: 'dddd, D MMMM YYYY թ., HH:mm', }, calendar: { sameDay: '[այսօր] LT', nextDay: '[վաղը] LT', lastDay: '[երեկ] LT', nextWeek: function () { return 'dddd [օրը ժամը] LT'; }, lastWeek: function () { return '[անցած] dddd [օրը ժամը] LT'; }, sameElse: 'L', }, relativeTime: { future: '%s հետո', past: '%s առաջ', s: 'մի քանի վայրկյան', ss: '%d վայրկյան', m: 'րոպե', mm: '%d րոպե', h: 'ժամ', hh: '%d ժամ', d: 'օր', dd: '%d օր', M: 'ամիս', MM: '%d ամիս', y: 'տարի', yy: '%d տարի', }, meridiemParse: /գիշերվա|առավոտվա|ցերեկվա|երեկոյան/, isPM: function (input) { return /^(ցերեկվա|երեկոյան)$/.test(input); }, meridiem: function (hour) { if (hour < 4) { return 'գիշերվա'; } else if (hour < 12) { return 'առավոտվա'; } else if (hour < 17) { return 'ցերեկվա'; } else { return 'երեկոյան'; } }, dayOfMonthOrdinalParse: /\d{1,2}|\d{1,2}-(ին|րդ)/, ordinal: function (number, period) { switch (period) { case 'DDD': case 'w': case 'W': case 'DDDo': if (number === 1) { return number + '-ին'; } return number + '-րդ'; default: return number; } }, week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return hyAm; }))); /***/ }), /* 1306 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Indonesian [id] //! author : Mohammad Satrio Utomo : https://github.com/tyok //! reference: http://id.wikisource.org/wiki/Pedoman_Umum_Ejaan_Bahasa_Indonesia_yang_Disempurnakan ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var id = moment.defineLocale('id', { months: 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split( '_' ), monthsShort: 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des'.split('_'), weekdays: 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'), weekdaysShort: 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'), weekdaysMin: 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'), longDateFormat: { LT: 'HH.mm', LTS: 'HH.mm.ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY [pukul] HH.mm', LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm', }, meridiemParse: /pagi|siang|sore|malam/, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if (meridiem === 'pagi') { return hour; } else if (meridiem === 'siang') { return hour >= 11 ? hour : hour + 12; } else if (meridiem === 'sore' || meridiem === 'malam') { return hour + 12; } }, meridiem: function (hours, minutes, isLower) { if (hours < 11) { return 'pagi'; } else if (hours < 15) { return 'siang'; } else if (hours < 19) { return 'sore'; } else { return 'malam'; } }, calendar: { sameDay: '[Hari ini pukul] LT', nextDay: '[Besok pukul] LT', nextWeek: 'dddd [pukul] LT', lastDay: '[Kemarin pukul] LT', lastWeek: 'dddd [lalu pukul] LT', sameElse: 'L', }, relativeTime: { future: 'dalam %s', past: '%s yang lalu', s: 'beberapa detik', ss: '%d detik', m: 'semenit', mm: '%d menit', h: 'sejam', hh: '%d jam', d: 'sehari', dd: '%d hari', M: 'sebulan', MM: '%d bulan', y: 'setahun', yy: '%d tahun', }, week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return id; }))); /***/ }), /* 1307 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Icelandic [is] //! author : Hinrik Örn Sigurðsson : https://github.com/hinrik ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration function plural(n) { if (n % 100 === 11) { return true; } else if (n % 10 === 1) { return false; } return true; } function translate(number, withoutSuffix, key, isFuture) { var result = number + ' '; switch (key) { case 's': return withoutSuffix || isFuture ? 'nokkrar sekúndur' : 'nokkrum sekúndum'; case 'ss': if (plural(number)) { return ( result + (withoutSuffix || isFuture ? 'sekúndur' : 'sekúndum') ); } return result + 'sekúnda'; case 'm': return withoutSuffix ? 'mínúta' : 'mínútu'; case 'mm': if (plural(number)) { return ( result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum') ); } else if (withoutSuffix) { return result + 'mínúta'; } return result + 'mínútu'; case 'hh': if (plural(number)) { return ( result + (withoutSuffix || isFuture ? 'klukkustundir' : 'klukkustundum') ); } return result + 'klukkustund'; case 'd': if (withoutSuffix) { return 'dagur'; } return isFuture ? 'dag' : 'degi'; case 'dd': if (plural(number)) { if (withoutSuffix) { return result + 'dagar'; } return result + (isFuture ? 'daga' : 'dögum'); } else if (withoutSuffix) { return result + 'dagur'; } return result + (isFuture ? 'dag' : 'degi'); case 'M': if (withoutSuffix) { return 'mánuður'; } return isFuture ? 'mánuð' : 'mánuði'; case 'MM': if (plural(number)) { if (withoutSuffix) { return result + 'mánuðir'; } return result + (isFuture ? 'mánuði' : 'mánuðum'); } else if (withoutSuffix) { return result + 'mánuður'; } return result + (isFuture ? 'mánuð' : 'mánuði'); case 'y': return withoutSuffix || isFuture ? 'ár' : 'ári'; case 'yy': if (plural(number)) { return result + (withoutSuffix || isFuture ? 'ár' : 'árum'); } return result + (withoutSuffix || isFuture ? 'ár' : 'ári'); } } var is = moment.defineLocale('is', { months: 'janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember'.split( '_' ), monthsShort: 'jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des'.split('_'), weekdays: 'sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur'.split( '_' ), weekdaysShort: 'sun_mán_þri_mið_fim_fös_lau'.split('_'), weekdaysMin: 'Su_Má_Þr_Mi_Fi_Fö_La'.split('_'), longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', L: 'DD.MM.YYYY', LL: 'D. MMMM YYYY', LLL: 'D. MMMM YYYY [kl.] H:mm', LLLL: 'dddd, D. MMMM YYYY [kl.] H:mm', }, calendar: { sameDay: '[í dag kl.] LT', nextDay: '[á morgun kl.] LT', nextWeek: 'dddd [kl.] LT', lastDay: '[í gær kl.] LT', lastWeek: '[síðasta] dddd [kl.] LT', sameElse: 'L', }, relativeTime: { future: 'eftir %s', past: 'fyrir %s síðan', s: translate, ss: translate, m: translate, mm: translate, h: 'klukkustund', hh: translate, d: translate, dd: translate, M: translate, MM: translate, y: translate, yy: translate, }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return is; }))); /***/ }), /* 1308 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Italian [it] //! author : Lorenzo : https://github.com/aliem //! author: Mattia Larentis: https://github.com/nostalgiaz //! author: Marco : https://github.com/Manfre98 ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var it = moment.defineLocale('it', { months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split( '_' ), monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'), weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split( '_' ), weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'), weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd D MMMM YYYY HH:mm', }, calendar: { sameDay: function () { return ( '[Oggi a' + (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") + ']LT' ); }, nextDay: function () { return ( '[Domani a' + (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") + ']LT' ); }, nextWeek: function () { return ( 'dddd [a' + (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") + ']LT' ); }, lastDay: function () { return ( '[Ieri a' + (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") + ']LT' ); }, lastWeek: function () { switch (this.day()) { case 0: return ( '[La scorsa] dddd [a' + (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") + ']LT' ); default: return ( '[Lo scorso] dddd [a' + (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") + ']LT' ); } }, sameElse: 'L', }, relativeTime: { future: function (s) { return (/^[0-9].+$/.test(s) ? 'tra' : 'in') + ' ' + s; }, past: '%s fa', s: 'alcuni secondi', ss: '%d secondi', m: 'un minuto', mm: '%d minuti', h: "un'ora", hh: '%d ore', d: 'un giorno', dd: '%d giorni', M: 'un mese', MM: '%d mesi', y: 'un anno', yy: '%d anni', }, dayOfMonthOrdinalParse: /\d{1,2}º/, ordinal: '%dº', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return it; }))); /***/ }), /* 1309 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Italian (Switzerland) [it-ch] //! author : xfh : https://github.com/xfh ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var itCh = moment.defineLocale('it-ch', { months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split( '_' ), monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'), weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split( '_' ), weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'), weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD.MM.YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd D MMMM YYYY HH:mm', }, calendar: { sameDay: '[Oggi alle] LT', nextDay: '[Domani alle] LT', nextWeek: 'dddd [alle] LT', lastDay: '[Ieri alle] LT', lastWeek: function () { switch (this.day()) { case 0: return '[la scorsa] dddd [alle] LT'; default: return '[lo scorso] dddd [alle] LT'; } }, sameElse: 'L', }, relativeTime: { future: function (s) { return (/^[0-9].+$/.test(s) ? 'tra' : 'in') + ' ' + s; }, past: '%s fa', s: 'alcuni secondi', ss: '%d secondi', m: 'un minuto', mm: '%d minuti', h: "un'ora", hh: '%d ore', d: 'un giorno', dd: '%d giorni', M: 'un mese', MM: '%d mesi', y: 'un anno', yy: '%d anni', }, dayOfMonthOrdinalParse: /\d{1,2}º/, ordinal: '%dº', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return itCh; }))); /***/ }), /* 1310 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Japanese [ja] //! author : LI Long : https://github.com/baryon ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var ja = moment.defineLocale('ja', { eras: [ { since: '2019-05-01', offset: 1, name: '令和', narrow: '㋿', abbr: 'R', }, { since: '1989-01-08', until: '2019-04-30', offset: 1, name: '平成', narrow: '㍻', abbr: 'H', }, { since: '1926-12-25', until: '1989-01-07', offset: 1, name: '昭和', narrow: '㍼', abbr: 'S', }, { since: '1912-07-30', until: '1926-12-24', offset: 1, name: '大正', narrow: '㍽', abbr: 'T', }, { since: '1873-01-01', until: '1912-07-29', offset: 6, name: '明治', narrow: '㍾', abbr: 'M', }, { since: '0001-01-01', until: '1873-12-31', offset: 1, name: '西暦', narrow: 'AD', abbr: 'AD', }, { since: '0000-12-31', until: -Infinity, offset: 1, name: '紀元前', narrow: 'BC', abbr: 'BC', }, ], eraYearOrdinalRegex: /(元|\d+)年/, eraYearOrdinalParse: function (input, match) { return match[1] === '元' ? 1 : parseInt(match[1] || input, 10); }, months: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split( '_' ), weekdays: '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'), weekdaysShort: '日_月_火_水_木_金_土'.split('_'), weekdaysMin: '日_月_火_水_木_金_土'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'YYYY/MM/DD', LL: 'YYYY年M月D日', LLL: 'YYYY年M月D日 HH:mm', LLLL: 'YYYY年M月D日 dddd HH:mm', l: 'YYYY/MM/DD', ll: 'YYYY年M月D日', lll: 'YYYY年M月D日 HH:mm', llll: 'YYYY年M月D日(ddd) HH:mm', }, meridiemParse: /午前|午後/i, isPM: function (input) { return input === '午後'; }, meridiem: function (hour, minute, isLower) { if (hour < 12) { return '午前'; } else { return '午後'; } }, calendar: { sameDay: '[今日] LT', nextDay: '[明日] LT', nextWeek: function (now) { if (now.week() !== this.week()) { return '[来週]dddd LT'; } else { return 'dddd LT'; } }, lastDay: '[昨日] LT', lastWeek: function (now) { if (this.week() !== now.week()) { return '[先週]dddd LT'; } else { return 'dddd LT'; } }, sameElse: 'L', }, dayOfMonthOrdinalParse: /\d{1,2}日/, ordinal: function (number, period) { switch (period) { case 'y': return number === 1 ? '元年' : number + '年'; case 'd': case 'D': case 'DDD': return number + '日'; default: return number; } }, relativeTime: { future: '%s後', past: '%s前', s: '数秒', ss: '%d秒', m: '1分', mm: '%d分', h: '1時間', hh: '%d時間', d: '1日', dd: '%d日', M: '1ヶ月', MM: '%dヶ月', y: '1年', yy: '%d年', }, }); return ja; }))); /***/ }), /* 1311 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Javanese [jv] //! author : Rony Lantip : https://github.com/lantip //! reference: http://jv.wikipedia.org/wiki/Basa_Jawa ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var jv = moment.defineLocale('jv', { months: 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember'.split( '_' ), monthsShort: 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des'.split('_'), weekdays: 'Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu'.split('_'), weekdaysShort: 'Min_Sen_Sel_Reb_Kem_Jem_Sep'.split('_'), weekdaysMin: 'Mg_Sn_Sl_Rb_Km_Jm_Sp'.split('_'), longDateFormat: { LT: 'HH.mm', LTS: 'HH.mm.ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY [pukul] HH.mm', LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm', }, meridiemParse: /enjing|siyang|sonten|ndalu/, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if (meridiem === 'enjing') { return hour; } else if (meridiem === 'siyang') { return hour >= 11 ? hour : hour + 12; } else if (meridiem === 'sonten' || meridiem === 'ndalu') { return hour + 12; } }, meridiem: function (hours, minutes, isLower) { if (hours < 11) { return 'enjing'; } else if (hours < 15) { return 'siyang'; } else if (hours < 19) { return 'sonten'; } else { return 'ndalu'; } }, calendar: { sameDay: '[Dinten puniko pukul] LT', nextDay: '[Mbenjang pukul] LT', nextWeek: 'dddd [pukul] LT', lastDay: '[Kala wingi pukul] LT', lastWeek: 'dddd [kepengker pukul] LT', sameElse: 'L', }, relativeTime: { future: 'wonten ing %s', past: '%s ingkang kepengker', s: 'sawetawis detik', ss: '%d detik', m: 'setunggal menit', mm: '%d menit', h: 'setunggal jam', hh: '%d jam', d: 'sedinten', dd: '%d dinten', M: 'sewulan', MM: '%d wulan', y: 'setaun', yy: '%d taun', }, week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return jv; }))); /***/ }), /* 1312 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Georgian [ka] //! author : Irakli Janiashvili : https://github.com/IrakliJani ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var ka = moment.defineLocale('ka', { months: 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split( '_' ), monthsShort: 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'), weekdays: { standalone: 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split( '_' ), format: 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split( '_' ), isFormat: /(წინა|შემდეგ)/, }, weekdaysShort: 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'), weekdaysMin: 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, calendar: { sameDay: '[დღეს] LT[-ზე]', nextDay: '[ხვალ] LT[-ზე]', lastDay: '[გუშინ] LT[-ზე]', nextWeek: '[შემდეგ] dddd LT[-ზე]', lastWeek: '[წინა] dddd LT-ზე', sameElse: 'L', }, relativeTime: { future: function (s) { return s.replace(/(წამ|წუთ|საათ|წელ|დღ|თვ)(ი|ე)/, function ( $0, $1, $2 ) { return $2 === 'ი' ? $1 + 'ში' : $1 + $2 + 'ში'; }); }, past: function (s) { if (/(წამი|წუთი|საათი|დღე|თვე)/.test(s)) { return s.replace(/(ი|ე)$/, 'ის წინ'); } if (/წელი/.test(s)) { return s.replace(/წელი$/, 'წლის წინ'); } return s; }, s: 'რამდენიმე წამი', ss: '%d წამი', m: 'წუთი', mm: '%d წუთი', h: 'საათი', hh: '%d საათი', d: 'დღე', dd: '%d დღე', M: 'თვე', MM: '%d თვე', y: 'წელი', yy: '%d წელი', }, dayOfMonthOrdinalParse: /0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/, ordinal: function (number) { if (number === 0) { return number; } if (number === 1) { return number + '-ლი'; } if ( number < 20 || (number <= 100 && number % 20 === 0) || number % 100 === 0 ) { return 'მე-' + number; } return number + '-ე'; }, week: { dow: 1, doy: 7, }, }); return ka; }))); /***/ }), /* 1313 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Kazakh [kk] //! authors : Nurlan Rakhimzhanov : https://github.com/nurlan ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var suffixes = { 0: '-ші', 1: '-ші', 2: '-ші', 3: '-ші', 4: '-ші', 5: '-ші', 6: '-шы', 7: '-ші', 8: '-ші', 9: '-шы', 10: '-шы', 20: '-шы', 30: '-шы', 40: '-шы', 50: '-ші', 60: '-шы', 70: '-ші', 80: '-ші', 90: '-шы', 100: '-ші', }; var kk = moment.defineLocale('kk', { months: 'қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан'.split( '_' ), monthsShort: 'қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел'.split('_'), weekdays: 'жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі'.split( '_' ), weekdaysShort: 'жек_дүй_сей_сәр_бей_жұм_сен'.split('_'), weekdaysMin: 'жк_дй_сй_ср_бй_жм_сн'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD.MM.YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, calendar: { sameDay: '[Бүгін сағат] LT', nextDay: '[Ертең сағат] LT', nextWeek: 'dddd [сағат] LT', lastDay: '[Кеше сағат] LT', lastWeek: '[Өткен аптаның] dddd [сағат] LT', sameElse: 'L', }, relativeTime: { future: '%s ішінде', past: '%s бұрын', s: 'бірнеше секунд', ss: '%d секунд', m: 'бір минут', mm: '%d минут', h: 'бір сағат', hh: '%d сағат', d: 'бір күн', dd: '%d күн', M: 'бір ай', MM: '%d ай', y: 'бір жыл', yy: '%d жыл', }, dayOfMonthOrdinalParse: /\d{1,2}-(ші|шы)/, ordinal: function (number) { var a = number % 10, b = number >= 100 ? 100 : null; return number + (suffixes[number] || suffixes[a] || suffixes[b]); }, week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return kk; }))); /***/ }), /* 1314 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Cambodian [km] //! author : Kruy Vanna : https://github.com/kruyvanna ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var symbolMap = { '1': '១', '2': '២', '3': '៣', '4': '៤', '5': '៥', '6': '៦', '7': '៧', '8': '៨', '9': '៩', '0': '០', }, numberMap = { '១': '1', '២': '2', '៣': '3', '៤': '4', '៥': '5', '៦': '6', '៧': '7', '៨': '8', '៩': '9', '០': '0', }; var km = moment.defineLocale('km', { months: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split( '_' ), monthsShort: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split( '_' ), weekdays: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'), weekdaysShort: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'), weekdaysMin: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, meridiemParse: /ព្រឹក|ល្ងាច/, isPM: function (input) { return input === 'ល្ងាច'; }, meridiem: function (hour, minute, isLower) { if (hour < 12) { return 'ព្រឹក'; } else { return 'ល្ងាច'; } }, calendar: { sameDay: '[ថ្ងៃនេះ ម៉ោង] LT', nextDay: '[ស្អែក ម៉ោង] LT', nextWeek: 'dddd [ម៉ោង] LT', lastDay: '[ម្សិលមិញ ម៉ោង] LT', lastWeek: 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT', sameElse: 'L', }, relativeTime: { future: '%sទៀត', past: '%sមុន', s: 'ប៉ុន្មានវិនាទី', ss: '%d វិនាទី', m: 'មួយនាទី', mm: '%d នាទី', h: 'មួយម៉ោង', hh: '%d ម៉ោង', d: 'មួយថ្ងៃ', dd: '%d ថ្ងៃ', M: 'មួយខែ', MM: '%d ខែ', y: 'មួយឆ្នាំ', yy: '%d ឆ្នាំ', }, dayOfMonthOrdinalParse: /ទី\d{1,2}/, ordinal: 'ទី%d', preparse: function (string) { return string.replace(/[១២៣៤៥៦៧៨៩០]/g, function (match) { return numberMap[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { return symbolMap[match]; }); }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return km; }))); /***/ }), /* 1315 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Kannada [kn] //! author : Rajeev Naik : https://github.com/rajeevnaikte ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var symbolMap = { '1': '೧', '2': '೨', '3': '೩', '4': '೪', '5': '೫', '6': '೬', '7': '೭', '8': '೮', '9': '೯', '0': '೦', }, numberMap = { '೧': '1', '೨': '2', '೩': '3', '೪': '4', '೫': '5', '೬': '6', '೭': '7', '೮': '8', '೯': '9', '೦': '0', }; var kn = moment.defineLocale('kn', { months: 'ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್'.split( '_' ), monthsShort: 'ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ'.split( '_' ), monthsParseExact: true, weekdays: 'ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ'.split( '_' ), weekdaysShort: 'ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ'.split('_'), weekdaysMin: 'ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ'.split('_'), longDateFormat: { LT: 'A h:mm', LTS: 'A h:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY, A h:mm', LLLL: 'dddd, D MMMM YYYY, A h:mm', }, calendar: { sameDay: '[ಇಂದು] LT', nextDay: '[ನಾಳೆ] LT', nextWeek: 'dddd, LT', lastDay: '[ನಿನ್ನೆ] LT', lastWeek: '[ಕೊನೆಯ] dddd, LT', sameElse: 'L', }, relativeTime: { future: '%s ನಂತರ', past: '%s ಹಿಂದೆ', s: 'ಕೆಲವು ಕ್ಷಣಗಳು', ss: '%d ಸೆಕೆಂಡುಗಳು', m: 'ಒಂದು ನಿಮಿಷ', mm: '%d ನಿಮಿಷ', h: 'ಒಂದು ಗಂಟೆ', hh: '%d ಗಂಟೆ', d: 'ಒಂದು ದಿನ', dd: '%d ದಿನ', M: 'ಒಂದು ತಿಂಗಳು', MM: '%d ತಿಂಗಳು', y: 'ಒಂದು ವರ್ಷ', yy: '%d ವರ್ಷ', }, preparse: function (string) { return string.replace(/[೧೨೩೪೫೬೭೮೯೦]/g, function (match) { return numberMap[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { return symbolMap[match]; }); }, meridiemParse: /ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if (meridiem === 'ರಾತ್ರಿ') { return hour < 4 ? hour : hour + 12; } else if (meridiem === 'ಬೆಳಿಗ್ಗೆ') { return hour; } else if (meridiem === 'ಮಧ್ಯಾಹ್ನ') { return hour >= 10 ? hour : hour + 12; } else if (meridiem === 'ಸಂಜೆ') { return hour + 12; } }, meridiem: function (hour, minute, isLower) { if (hour < 4) { return 'ರಾತ್ರಿ'; } else if (hour < 10) { return 'ಬೆಳಿಗ್ಗೆ'; } else if (hour < 17) { return 'ಮಧ್ಯಾಹ್ನ'; } else if (hour < 20) { return 'ಸಂಜೆ'; } else { return 'ರಾತ್ರಿ'; } }, dayOfMonthOrdinalParse: /\d{1,2}(ನೇ)/, ordinal: function (number) { return number + 'ನೇ'; }, week: { dow: 0, // Sunday is the first day of the week. doy: 6, // The week that contains Jan 6th is the first week of the year. }, }); return kn; }))); /***/ }), /* 1316 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Korean [ko] //! author : Kyungwook, Park : https://github.com/kyungw00k //! author : Jeeeyul Lee <jeeeyul@gmail.com> ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var ko = moment.defineLocale('ko', { months: '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'), monthsShort: '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split( '_' ), weekdays: '일요일_월요일_화요일_수요일_목요일_금요일_토요일'.split('_'), weekdaysShort: '일_월_화_수_목_금_토'.split('_'), weekdaysMin: '일_월_화_수_목_금_토'.split('_'), longDateFormat: { LT: 'A h:mm', LTS: 'A h:mm:ss', L: 'YYYY.MM.DD.', LL: 'YYYY년 MMMM D일', LLL: 'YYYY년 MMMM D일 A h:mm', LLLL: 'YYYY년 MMMM D일 dddd A h:mm', l: 'YYYY.MM.DD.', ll: 'YYYY년 MMMM D일', lll: 'YYYY년 MMMM D일 A h:mm', llll: 'YYYY년 MMMM D일 dddd A h:mm', }, calendar: { sameDay: '오늘 LT', nextDay: '내일 LT', nextWeek: 'dddd LT', lastDay: '어제 LT', lastWeek: '지난주 dddd LT', sameElse: 'L', }, relativeTime: { future: '%s 후', past: '%s 전', s: '몇 초', ss: '%d초', m: '1분', mm: '%d분', h: '한 시간', hh: '%d시간', d: '하루', dd: '%d일', M: '한 달', MM: '%d달', y: '일 년', yy: '%d년', }, dayOfMonthOrdinalParse: /\d{1,2}(일|월|주)/, ordinal: function (number, period) { switch (period) { case 'd': case 'D': case 'DDD': return number + '일'; case 'M': return number + '월'; case 'w': case 'W': return number + '주'; default: return number; } }, meridiemParse: /오전|오후/, isPM: function (token) { return token === '오후'; }, meridiem: function (hour, minute, isUpper) { return hour < 12 ? '오전' : '오후'; }, }); return ko; }))); /***/ }), /* 1317 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Kurdish [ku] //! author : Shahram Mebashar : https://github.com/ShahramMebashar ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var symbolMap = { '1': '١', '2': '٢', '3': '٣', '4': '٤', '5': '٥', '6': '٦', '7': '٧', '8': '٨', '9': '٩', '0': '٠', }, numberMap = { '١': '1', '٢': '2', '٣': '3', '٤': '4', '٥': '5', '٦': '6', '٧': '7', '٨': '8', '٩': '9', '٠': '0', }, months = [ 'کانونی دووەم', 'شوبات', 'ئازار', 'نیسان', 'ئایار', 'حوزەیران', 'تەمموز', 'ئاب', 'ئەیلوول', 'تشرینی یەكەم', 'تشرینی دووەم', 'كانونی یەکەم', ]; var ku = moment.defineLocale('ku', { months: months, monthsShort: months, weekdays: 'یهكشهممه_دووشهممه_سێشهممه_چوارشهممه_پێنجشهممه_ههینی_شهممه'.split( '_' ), weekdaysShort: 'یهكشهم_دووشهم_سێشهم_چوارشهم_پێنجشهم_ههینی_شهممه'.split( '_' ), weekdaysMin: 'ی_د_س_چ_پ_ه_ش'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, meridiemParse: /ئێواره|بهیانی/, isPM: function (input) { return /ئێواره/.test(input); }, meridiem: function (hour, minute, isLower) { if (hour < 12) { return 'بهیانی'; } else { return 'ئێواره'; } }, calendar: { sameDay: '[ئهمرۆ كاتژمێر] LT', nextDay: '[بهیانی كاتژمێر] LT', nextWeek: 'dddd [كاتژمێر] LT', lastDay: '[دوێنێ كاتژمێر] LT', lastWeek: 'dddd [كاتژمێر] LT', sameElse: 'L', }, relativeTime: { future: 'له %s', past: '%s', s: 'چهند چركهیهك', ss: 'چركه %d', m: 'یهك خولهك', mm: '%d خولهك', h: 'یهك كاتژمێر', hh: '%d كاتژمێر', d: 'یهك ڕۆژ', dd: '%d ڕۆژ', M: 'یهك مانگ', MM: '%d مانگ', y: 'یهك ساڵ', yy: '%d ساڵ', }, preparse: function (string) { return string .replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) { return numberMap[match]; }) .replace(/،/g, ','); }, postformat: function (string) { return string .replace(/\d/g, function (match) { return symbolMap[match]; }) .replace(/,/g, '،'); }, week: { dow: 6, // Saturday is the first day of the week. doy: 12, // The week that contains Jan 12th is the first week of the year. }, }); return ku; }))); /***/ }), /* 1318 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Kyrgyz [ky] //! author : Chyngyz Arystan uulu : https://github.com/chyngyz ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var suffixes = { 0: '-чү', 1: '-чи', 2: '-чи', 3: '-чү', 4: '-чү', 5: '-чи', 6: '-чы', 7: '-чи', 8: '-чи', 9: '-чу', 10: '-чу', 20: '-чы', 30: '-чу', 40: '-чы', 50: '-чү', 60: '-чы', 70: '-чи', 80: '-чи', 90: '-чу', 100: '-чү', }; var ky = moment.defineLocale('ky', { months: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split( '_' ), monthsShort: 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split( '_' ), weekdays: 'Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби'.split( '_' ), weekdaysShort: 'Жек_Дүй_Шей_Шар_Бей_Жум_Ише'.split('_'), weekdaysMin: 'Жк_Дй_Шй_Шр_Бй_Жм_Иш'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD.MM.YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, calendar: { sameDay: '[Бүгүн саат] LT', nextDay: '[Эртең саат] LT', nextWeek: 'dddd [саат] LT', lastDay: '[Кечээ саат] LT', lastWeek: '[Өткөн аптанын] dddd [күнү] [саат] LT', sameElse: 'L', }, relativeTime: { future: '%s ичинде', past: '%s мурун', s: 'бирнече секунд', ss: '%d секунд', m: 'бир мүнөт', mm: '%d мүнөт', h: 'бир саат', hh: '%d саат', d: 'бир күн', dd: '%d күн', M: 'бир ай', MM: '%d ай', y: 'бир жыл', yy: '%d жыл', }, dayOfMonthOrdinalParse: /\d{1,2}-(чи|чы|чү|чу)/, ordinal: function (number) { var a = number % 10, b = number >= 100 ? 100 : null; return number + (suffixes[number] || suffixes[a] || suffixes[b]); }, week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return ky; }))); /***/ }), /* 1319 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Luxembourgish [lb] //! author : mweimerskirch : https://github.com/mweimerskirch //! author : David Raison : https://github.com/kwisatz ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration function processRelativeTime(number, withoutSuffix, key, isFuture) { var format = { m: ['eng Minutt', 'enger Minutt'], h: ['eng Stonn', 'enger Stonn'], d: ['een Dag', 'engem Dag'], M: ['ee Mount', 'engem Mount'], y: ['ee Joer', 'engem Joer'], }; return withoutSuffix ? format[key][0] : format[key][1]; } function processFutureTime(string) { var number = string.substr(0, string.indexOf(' ')); if (eifelerRegelAppliesToNumber(number)) { return 'a ' + string; } return 'an ' + string; } function processPastTime(string) { var number = string.substr(0, string.indexOf(' ')); if (eifelerRegelAppliesToNumber(number)) { return 'viru ' + string; } return 'virun ' + string; } /** * Returns true if the word before the given number loses the '-n' ending. * e.g. 'an 10 Deeg' but 'a 5 Deeg' * * @param number {integer} * @returns {boolean} */ function eifelerRegelAppliesToNumber(number) { number = parseInt(number, 10); if (isNaN(number)) { return false; } if (number < 0) { // Negative Number --> always true return true; } else if (number < 10) { // Only 1 digit if (4 <= number && number <= 7) { return true; } return false; } else if (number < 100) { // 2 digits var lastDigit = number % 10, firstDigit = number / 10; if (lastDigit === 0) { return eifelerRegelAppliesToNumber(firstDigit); } return eifelerRegelAppliesToNumber(lastDigit); } else if (number < 10000) { // 3 or 4 digits --> recursively check first digit while (number >= 10) { number = number / 10; } return eifelerRegelAppliesToNumber(number); } else { // Anything larger than 4 digits: recursively check first n-3 digits number = number / 1000; return eifelerRegelAppliesToNumber(number); } } var lb = moment.defineLocale('lb', { months: 'Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember'.split( '_' ), monthsShort: 'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split( '_' ), monthsParseExact: true, weekdays: 'Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg'.split( '_' ), weekdaysShort: 'So._Mé._Dë._Më._Do._Fr._Sa.'.split('_'), weekdaysMin: 'So_Mé_Dë_Më_Do_Fr_Sa'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'H:mm [Auer]', LTS: 'H:mm:ss [Auer]', L: 'DD.MM.YYYY', LL: 'D. MMMM YYYY', LLL: 'D. MMMM YYYY H:mm [Auer]', LLLL: 'dddd, D. MMMM YYYY H:mm [Auer]', }, calendar: { sameDay: '[Haut um] LT', sameElse: 'L', nextDay: '[Muer um] LT', nextWeek: 'dddd [um] LT', lastDay: '[Gëschter um] LT', lastWeek: function () { // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule switch (this.day()) { case 2: case 4: return '[Leschten] dddd [um] LT'; default: return '[Leschte] dddd [um] LT'; } }, }, relativeTime: { future: processFutureTime, past: processPastTime, s: 'e puer Sekonnen', ss: '%d Sekonnen', m: processRelativeTime, mm: '%d Minutten', h: processRelativeTime, hh: '%d Stonnen', d: processRelativeTime, dd: '%d Deeg', M: processRelativeTime, MM: '%d Méint', y: processRelativeTime, yy: '%d Joer', }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return lb; }))); /***/ }), /* 1320 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Lao [lo] //! author : Ryan Hart : https://github.com/ryanhart2 ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var lo = moment.defineLocale('lo', { months: 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split( '_' ), monthsShort: 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split( '_' ), weekdays: 'ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'), weekdaysShort: 'ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'), weekdaysMin: 'ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'ວັນdddd D MMMM YYYY HH:mm', }, meridiemParse: /ຕອນເຊົ້າ|ຕອນແລງ/, isPM: function (input) { return input === 'ຕອນແລງ'; }, meridiem: function (hour, minute, isLower) { if (hour < 12) { return 'ຕອນເຊົ້າ'; } else { return 'ຕອນແລງ'; } }, calendar: { sameDay: '[ມື້ນີ້ເວລາ] LT', nextDay: '[ມື້ອື່ນເວລາ] LT', nextWeek: '[ວັນ]dddd[ໜ້າເວລາ] LT', lastDay: '[ມື້ວານນີ້ເວລາ] LT', lastWeek: '[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT', sameElse: 'L', }, relativeTime: { future: 'ອີກ %s', past: '%sຜ່ານມາ', s: 'ບໍ່ເທົ່າໃດວິນາທີ', ss: '%d ວິນາທີ', m: '1 ນາທີ', mm: '%d ນາທີ', h: '1 ຊົ່ວໂມງ', hh: '%d ຊົ່ວໂມງ', d: '1 ມື້', dd: '%d ມື້', M: '1 ເດືອນ', MM: '%d ເດືອນ', y: '1 ປີ', yy: '%d ປີ', }, dayOfMonthOrdinalParse: /(ທີ່)\d{1,2}/, ordinal: function (number) { return 'ທີ່' + number; }, }); return lo; }))); /***/ }), /* 1321 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Lithuanian [lt] //! author : Mindaugas Mozūras : https://github.com/mmozuras ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var units = { ss: 'sekundė_sekundžių_sekundes', m: 'minutė_minutės_minutę', mm: 'minutės_minučių_minutes', h: 'valanda_valandos_valandą', hh: 'valandos_valandų_valandas', d: 'diena_dienos_dieną', dd: 'dienos_dienų_dienas', M: 'mėnuo_mėnesio_mėnesį', MM: 'mėnesiai_mėnesių_mėnesius', y: 'metai_metų_metus', yy: 'metai_metų_metus', }; function translateSeconds(number, withoutSuffix, key, isFuture) { if (withoutSuffix) { return 'kelios sekundės'; } else { return isFuture ? 'kelių sekundžių' : 'kelias sekundes'; } } function translateSingular(number, withoutSuffix, key, isFuture) { return withoutSuffix ? forms(key)[0] : isFuture ? forms(key)[1] : forms(key)[2]; } function special(number) { return number % 10 === 0 || (number > 10 && number < 20); } function forms(key) { return units[key].split('_'); } function translate(number, withoutSuffix, key, isFuture) { var result = number + ' '; if (number === 1) { return ( result + translateSingular(number, withoutSuffix, key[0], isFuture) ); } else if (withoutSuffix) { return result + (special(number) ? forms(key)[1] : forms(key)[0]); } else { if (isFuture) { return result + forms(key)[1]; } else { return result + (special(number) ? forms(key)[1] : forms(key)[2]); } } } var lt = moment.defineLocale('lt', { months: { format: 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split( '_' ), standalone: 'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split( '_' ), isFormat: /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/, }, monthsShort: 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'), weekdays: { format: 'sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį'.split( '_' ), standalone: 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split( '_' ), isFormat: /dddd HH:mm/, }, weekdaysShort: 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'), weekdaysMin: 'S_P_A_T_K_Pn_Š'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'YYYY-MM-DD', LL: 'YYYY [m.] MMMM D [d.]', LLL: 'YYYY [m.] MMMM D [d.], HH:mm [val.]', LLLL: 'YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]', l: 'YYYY-MM-DD', ll: 'YYYY [m.] MMMM D [d.]', lll: 'YYYY [m.] MMMM D [d.], HH:mm [val.]', llll: 'YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]', }, calendar: { sameDay: '[Šiandien] LT', nextDay: '[Rytoj] LT', nextWeek: 'dddd LT', lastDay: '[Vakar] LT', lastWeek: '[Praėjusį] dddd LT', sameElse: 'L', }, relativeTime: { future: 'po %s', past: 'prieš %s', s: translateSeconds, ss: translate, m: translateSingular, mm: translate, h: translateSingular, hh: translate, d: translateSingular, dd: translate, M: translateSingular, MM: translate, y: translateSingular, yy: translate, }, dayOfMonthOrdinalParse: /\d{1,2}-oji/, ordinal: function (number) { return number + '-oji'; }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return lt; }))); /***/ }), /* 1322 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Latvian [lv] //! author : Kristaps Karlsons : https://github.com/skakri //! author : Jānis Elmeris : https://github.com/JanisE ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var units = { ss: 'sekundes_sekundēm_sekunde_sekundes'.split('_'), m: 'minūtes_minūtēm_minūte_minūtes'.split('_'), mm: 'minūtes_minūtēm_minūte_minūtes'.split('_'), h: 'stundas_stundām_stunda_stundas'.split('_'), hh: 'stundas_stundām_stunda_stundas'.split('_'), d: 'dienas_dienām_diena_dienas'.split('_'), dd: 'dienas_dienām_diena_dienas'.split('_'), M: 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'), MM: 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'), y: 'gada_gadiem_gads_gadi'.split('_'), yy: 'gada_gadiem_gads_gadi'.split('_'), }; /** * @param withoutSuffix boolean true = a length of time; false = before/after a period of time. */ function format(forms, number, withoutSuffix) { if (withoutSuffix) { // E.g. "21 minūte", "3 minūtes". return number % 10 === 1 && number % 100 !== 11 ? forms[2] : forms[3]; } else { // E.g. "21 minūtes" as in "pēc 21 minūtes". // E.g. "3 minūtēm" as in "pēc 3 minūtēm". return number % 10 === 1 && number % 100 !== 11 ? forms[0] : forms[1]; } } function relativeTimeWithPlural(number, withoutSuffix, key) { return number + ' ' + format(units[key], number, withoutSuffix); } function relativeTimeWithSingular(number, withoutSuffix, key) { return format(units[key], number, withoutSuffix); } function relativeSeconds(number, withoutSuffix) { return withoutSuffix ? 'dažas sekundes' : 'dažām sekundēm'; } var lv = moment.defineLocale('lv', { months: 'janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris'.split( '_' ), monthsShort: 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'), weekdays: 'svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena'.split( '_' ), weekdaysShort: 'Sv_P_O_T_C_Pk_S'.split('_'), weekdaysMin: 'Sv_P_O_T_C_Pk_S'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD.MM.YYYY.', LL: 'YYYY. [gada] D. MMMM', LLL: 'YYYY. [gada] D. MMMM, HH:mm', LLLL: 'YYYY. [gada] D. MMMM, dddd, HH:mm', }, calendar: { sameDay: '[Šodien pulksten] LT', nextDay: '[Rīt pulksten] LT', nextWeek: 'dddd [pulksten] LT', lastDay: '[Vakar pulksten] LT', lastWeek: '[Pagājušā] dddd [pulksten] LT', sameElse: 'L', }, relativeTime: { future: 'pēc %s', past: 'pirms %s', s: relativeSeconds, ss: relativeTimeWithPlural, m: relativeTimeWithSingular, mm: relativeTimeWithPlural, h: relativeTimeWithSingular, hh: relativeTimeWithPlural, d: relativeTimeWithSingular, dd: relativeTimeWithPlural, M: relativeTimeWithSingular, MM: relativeTimeWithPlural, y: relativeTimeWithSingular, yy: relativeTimeWithPlural, }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return lv; }))); /***/ }), /* 1323 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Montenegrin [me] //! author : Miodrag Nikač <miodrag@restartit.me> : https://github.com/miodragnikac ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var translator = { words: { //Different grammatical cases ss: ['sekund', 'sekunda', 'sekundi'], m: ['jedan minut', 'jednog minuta'], mm: ['minut', 'minuta', 'minuta'], h: ['jedan sat', 'jednog sata'], hh: ['sat', 'sata', 'sati'], dd: ['dan', 'dana', 'dana'], MM: ['mjesec', 'mjeseca', 'mjeseci'], yy: ['godina', 'godine', 'godina'], }, correctGrammaticalCase: function (number, wordKey) { return number === 1 ? wordKey[0] : number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]; }, translate: function (number, withoutSuffix, key) { var wordKey = translator.words[key]; if (key.length === 1) { return withoutSuffix ? wordKey[0] : wordKey[1]; } else { return ( number + ' ' + translator.correctGrammaticalCase(number, wordKey) ); } }, }; var me = moment.defineLocale('me', { months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split( '_' ), monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split( '_' ), monthsParseExact: true, weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split( '_' ), weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'), weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', L: 'DD.MM.YYYY', LL: 'D. MMMM YYYY', LLL: 'D. MMMM YYYY H:mm', LLLL: 'dddd, D. MMMM YYYY H:mm', }, calendar: { sameDay: '[danas u] LT', nextDay: '[sjutra u] LT', nextWeek: function () { switch (this.day()) { case 0: return '[u] [nedjelju] [u] LT'; case 3: return '[u] [srijedu] [u] LT'; case 6: return '[u] [subotu] [u] LT'; case 1: case 2: case 4: case 5: return '[u] dddd [u] LT'; } }, lastDay: '[juče u] LT', lastWeek: function () { var lastWeekDays = [ '[prošle] [nedjelje] [u] LT', '[prošlog] [ponedjeljka] [u] LT', '[prošlog] [utorka] [u] LT', '[prošle] [srijede] [u] LT', '[prošlog] [četvrtka] [u] LT', '[prošlog] [petka] [u] LT', '[prošle] [subote] [u] LT', ]; return lastWeekDays[this.day()]; }, sameElse: 'L', }, relativeTime: { future: 'za %s', past: 'prije %s', s: 'nekoliko sekundi', ss: translator.translate, m: translator.translate, mm: translator.translate, h: translator.translate, hh: translator.translate, d: 'dan', dd: translator.translate, M: 'mjesec', MM: translator.translate, y: 'godinu', yy: translator.translate, }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return me; }))); /***/ }), /* 1324 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Maori [mi] //! author : John Corrigan <robbiecloset@gmail.com> : https://github.com/johnideal ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var mi = moment.defineLocale('mi', { months: 'Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea'.split( '_' ), monthsShort: 'Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki'.split( '_' ), monthsRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i, monthsStrictRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i, monthsShortRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i, monthsShortStrictRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i, weekdays: 'Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei'.split('_'), weekdaysShort: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'), weekdaysMin: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY [i] HH:mm', LLLL: 'dddd, D MMMM YYYY [i] HH:mm', }, calendar: { sameDay: '[i teie mahana, i] LT', nextDay: '[apopo i] LT', nextWeek: 'dddd [i] LT', lastDay: '[inanahi i] LT', lastWeek: 'dddd [whakamutunga i] LT', sameElse: 'L', }, relativeTime: { future: 'i roto i %s', past: '%s i mua', s: 'te hēkona ruarua', ss: '%d hēkona', m: 'he meneti', mm: '%d meneti', h: 'te haora', hh: '%d haora', d: 'he ra', dd: '%d ra', M: 'he marama', MM: '%d marama', y: 'he tau', yy: '%d tau', }, dayOfMonthOrdinalParse: /\d{1,2}º/, ordinal: '%dº', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return mi; }))); /***/ }), /* 1325 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Macedonian [mk] //! author : Borislav Mickov : https://github.com/B0k0 //! author : Sashko Todorov : https://github.com/bkyceh ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var mk = moment.defineLocale('mk', { months: 'јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември'.split( '_' ), monthsShort: 'јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек'.split('_'), weekdays: 'недела_понеделник_вторник_среда_четврток_петок_сабота'.split( '_' ), weekdaysShort: 'нед_пон_вто_сре_чет_пет_саб'.split('_'), weekdaysMin: 'нe_пo_вт_ср_че_пе_сa'.split('_'), longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', L: 'D.MM.YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY H:mm', LLLL: 'dddd, D MMMM YYYY H:mm', }, calendar: { sameDay: '[Денес во] LT', nextDay: '[Утре во] LT', nextWeek: '[Во] dddd [во] LT', lastDay: '[Вчера во] LT', lastWeek: function () { switch (this.day()) { case 0: case 3: case 6: return '[Изминатата] dddd [во] LT'; case 1: case 2: case 4: case 5: return '[Изминатиот] dddd [во] LT'; } }, sameElse: 'L', }, relativeTime: { future: 'за %s', past: 'пред %s', s: 'неколку секунди', ss: '%d секунди', m: 'една минута', mm: '%d минути', h: 'еден час', hh: '%d часа', d: 'еден ден', dd: '%d дена', M: 'еден месец', MM: '%d месеци', y: 'една година', yy: '%d години', }, dayOfMonthOrdinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/, ordinal: function (number) { var lastDigit = number % 10, last2Digits = number % 100; if (number === 0) { return number + '-ев'; } else if (last2Digits === 0) { return number + '-ен'; } else if (last2Digits > 10 && last2Digits < 20) { return number + '-ти'; } else if (lastDigit === 1) { return number + '-ви'; } else if (lastDigit === 2) { return number + '-ри'; } else if (lastDigit === 7 || lastDigit === 8) { return number + '-ми'; } else { return number + '-ти'; } }, week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return mk; }))); /***/ }), /* 1326 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Malayalam [ml] //! author : Floyd Pink : https://github.com/floydpink ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var ml = moment.defineLocale('ml', { months: 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split( '_' ), monthsShort: 'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split( '_' ), monthsParseExact: true, weekdays: 'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split( '_' ), weekdaysShort: 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split('_'), weekdaysMin: 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split('_'), longDateFormat: { LT: 'A h:mm -നു', LTS: 'A h:mm:ss -നു', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY, A h:mm -നു', LLLL: 'dddd, D MMMM YYYY, A h:mm -നു', }, calendar: { sameDay: '[ഇന്ന്] LT', nextDay: '[നാളെ] LT', nextWeek: 'dddd, LT', lastDay: '[ഇന്നലെ] LT', lastWeek: '[കഴിഞ്ഞ] dddd, LT', sameElse: 'L', }, relativeTime: { future: '%s കഴിഞ്ഞ്', past: '%s മുൻപ്', s: 'അൽപ നിമിഷങ്ങൾ', ss: '%d സെക്കൻഡ്', m: 'ഒരു മിനിറ്റ്', mm: '%d മിനിറ്റ്', h: 'ഒരു മണിക്കൂർ', hh: '%d മണിക്കൂർ', d: 'ഒരു ദിവസം', dd: '%d ദിവസം', M: 'ഒരു മാസം', MM: '%d മാസം', y: 'ഒരു വർഷം', yy: '%d വർഷം', }, meridiemParse: /രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if ( (meridiem === 'രാത്രി' && hour >= 4) || meridiem === 'ഉച്ച കഴിഞ്ഞ്' || meridiem === 'വൈകുന്നേരം' ) { return hour + 12; } else { return hour; } }, meridiem: function (hour, minute, isLower) { if (hour < 4) { return 'രാത്രി'; } else if (hour < 12) { return 'രാവിലെ'; } else if (hour < 17) { return 'ഉച്ച കഴിഞ്ഞ്'; } else if (hour < 20) { return 'വൈകുന്നേരം'; } else { return 'രാത്രി'; } }, }); return ml; }))); /***/ }), /* 1327 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Mongolian [mn] //! author : Javkhlantugs Nyamdorj : https://github.com/javkhaanj7 ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration function translate(number, withoutSuffix, key, isFuture) { switch (key) { case 's': return withoutSuffix ? 'хэдхэн секунд' : 'хэдхэн секундын'; case 'ss': return number + (withoutSuffix ? ' секунд' : ' секундын'); case 'm': case 'mm': return number + (withoutSuffix ? ' минут' : ' минутын'); case 'h': case 'hh': return number + (withoutSuffix ? ' цаг' : ' цагийн'); case 'd': case 'dd': return number + (withoutSuffix ? ' өдөр' : ' өдрийн'); case 'M': case 'MM': return number + (withoutSuffix ? ' сар' : ' сарын'); case 'y': case 'yy': return number + (withoutSuffix ? ' жил' : ' жилийн'); default: return number; } } var mn = moment.defineLocale('mn', { months: 'Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар'.split( '_' ), monthsShort: '1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар'.split( '_' ), monthsParseExact: true, weekdays: 'Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба'.split('_'), weekdaysShort: 'Ням_Дав_Мяг_Лха_Пүр_Баа_Бям'.split('_'), weekdaysMin: 'Ня_Да_Мя_Лх_Пү_Ба_Бя'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'YYYY-MM-DD', LL: 'YYYY оны MMMMын D', LLL: 'YYYY оны MMMMын D HH:mm', LLLL: 'dddd, YYYY оны MMMMын D HH:mm', }, meridiemParse: /ҮӨ|ҮХ/i, isPM: function (input) { return input === 'ҮХ'; }, meridiem: function (hour, minute, isLower) { if (hour < 12) { return 'ҮӨ'; } else { return 'ҮХ'; } }, calendar: { sameDay: '[Өнөөдөр] LT', nextDay: '[Маргааш] LT', nextWeek: '[Ирэх] dddd LT', lastDay: '[Өчигдөр] LT', lastWeek: '[Өнгөрсөн] dddd LT', sameElse: 'L', }, relativeTime: { future: '%s дараа', past: '%s өмнө', s: translate, ss: translate, m: translate, mm: translate, h: translate, hh: translate, d: translate, dd: translate, M: translate, MM: translate, y: translate, yy: translate, }, dayOfMonthOrdinalParse: /\d{1,2} өдөр/, ordinal: function (number, period) { switch (period) { case 'd': case 'D': case 'DDD': return number + ' өдөр'; default: return number; } }, }); return mn; }))); /***/ }), /* 1328 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Marathi [mr] //! author : Harshad Kale : https://github.com/kalehv //! author : Vivek Athalye : https://github.com/vnathalye ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var symbolMap = { '1': '१', '2': '२', '3': '३', '4': '४', '5': '५', '6': '६', '7': '७', '8': '८', '9': '९', '0': '०', }, numberMap = { '१': '1', '२': '2', '३': '3', '४': '4', '५': '5', '६': '6', '७': '7', '८': '8', '९': '9', '०': '0', }; function relativeTimeMr(number, withoutSuffix, string, isFuture) { var output = ''; if (withoutSuffix) { switch (string) { case 's': output = 'काही सेकंद'; break; case 'ss': output = '%d सेकंद'; break; case 'm': output = 'एक मिनिट'; break; case 'mm': output = '%d मिनिटे'; break; case 'h': output = 'एक तास'; break; case 'hh': output = '%d तास'; break; case 'd': output = 'एक दिवस'; break; case 'dd': output = '%d दिवस'; break; case 'M': output = 'एक महिना'; break; case 'MM': output = '%d महिने'; break; case 'y': output = 'एक वर्ष'; break; case 'yy': output = '%d वर्षे'; break; } } else { switch (string) { case 's': output = 'काही सेकंदां'; break; case 'ss': output = '%d सेकंदां'; break; case 'm': output = 'एका मिनिटा'; break; case 'mm': output = '%d मिनिटां'; break; case 'h': output = 'एका तासा'; break; case 'hh': output = '%d तासां'; break; case 'd': output = 'एका दिवसा'; break; case 'dd': output = '%d दिवसां'; break; case 'M': output = 'एका महिन्या'; break; case 'MM': output = '%d महिन्यां'; break; case 'y': output = 'एका वर्षा'; break; case 'yy': output = '%d वर्षां'; break; } } return output.replace(/%d/i, number); } var mr = moment.defineLocale('mr', { months: 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split( '_' ), monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split( '_' ), monthsParseExact: true, weekdays: 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'), weekdaysShort: 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split('_'), weekdaysMin: 'र_सो_मं_बु_गु_शु_श'.split('_'), longDateFormat: { LT: 'A h:mm वाजता', LTS: 'A h:mm:ss वाजता', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY, A h:mm वाजता', LLLL: 'dddd, D MMMM YYYY, A h:mm वाजता', }, calendar: { sameDay: '[आज] LT', nextDay: '[उद्या] LT', nextWeek: 'dddd, LT', lastDay: '[काल] LT', lastWeek: '[मागील] dddd, LT', sameElse: 'L', }, relativeTime: { future: '%sमध्ये', past: '%sपूर्वी', s: relativeTimeMr, ss: relativeTimeMr, m: relativeTimeMr, mm: relativeTimeMr, h: relativeTimeMr, hh: relativeTimeMr, d: relativeTimeMr, dd: relativeTimeMr, M: relativeTimeMr, MM: relativeTimeMr, y: relativeTimeMr, yy: relativeTimeMr, }, preparse: function (string) { return string.replace(/[१२३४५६७८९०]/g, function (match) { return numberMap[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { return symbolMap[match]; }); }, meridiemParse: /पहाटे|सकाळी|दुपारी|सायंकाळी|रात्री/, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if (meridiem === 'पहाटे' || meridiem === 'सकाळी') { return hour; } else if ( meridiem === 'दुपारी' || meridiem === 'सायंकाळी' || meridiem === 'रात्री' ) { return hour >= 12 ? hour : hour + 12; } }, meridiem: function (hour, minute, isLower) { if (hour >= 0 && hour < 6) { return 'पहाटे'; } else if (hour < 12) { return 'सकाळी'; } else if (hour < 17) { return 'दुपारी'; } else if (hour < 20) { return 'सायंकाळी'; } else { return 'रात्री'; } }, week: { dow: 0, // Sunday is the first day of the week. doy: 6, // The week that contains Jan 6th is the first week of the year. }, }); return mr; }))); /***/ }), /* 1329 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Malay [ms] //! author : Weldan Jamili : https://github.com/weldan ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var ms = moment.defineLocale('ms', { months: 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split( '_' ), monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'), weekdays: 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'), weekdaysShort: 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'), weekdaysMin: 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'), longDateFormat: { LT: 'HH.mm', LTS: 'HH.mm.ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY [pukul] HH.mm', LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm', }, meridiemParse: /pagi|tengahari|petang|malam/, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if (meridiem === 'pagi') { return hour; } else if (meridiem === 'tengahari') { return hour >= 11 ? hour : hour + 12; } else if (meridiem === 'petang' || meridiem === 'malam') { return hour + 12; } }, meridiem: function (hours, minutes, isLower) { if (hours < 11) { return 'pagi'; } else if (hours < 15) { return 'tengahari'; } else if (hours < 19) { return 'petang'; } else { return 'malam'; } }, calendar: { sameDay: '[Hari ini pukul] LT', nextDay: '[Esok pukul] LT', nextWeek: 'dddd [pukul] LT', lastDay: '[Kelmarin pukul] LT', lastWeek: 'dddd [lepas pukul] LT', sameElse: 'L', }, relativeTime: { future: 'dalam %s', past: '%s yang lepas', s: 'beberapa saat', ss: '%d saat', m: 'seminit', mm: '%d minit', h: 'sejam', hh: '%d jam', d: 'sehari', dd: '%d hari', M: 'sebulan', MM: '%d bulan', y: 'setahun', yy: '%d tahun', }, week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return ms; }))); /***/ }), /* 1330 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Malay [ms-my] //! note : DEPRECATED, the correct one is [ms] //! author : Weldan Jamili : https://github.com/weldan ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var msMy = moment.defineLocale('ms-my', { months: 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split( '_' ), monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'), weekdays: 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'), weekdaysShort: 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'), weekdaysMin: 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'), longDateFormat: { LT: 'HH.mm', LTS: 'HH.mm.ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY [pukul] HH.mm', LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm', }, meridiemParse: /pagi|tengahari|petang|malam/, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if (meridiem === 'pagi') { return hour; } else if (meridiem === 'tengahari') { return hour >= 11 ? hour : hour + 12; } else if (meridiem === 'petang' || meridiem === 'malam') { return hour + 12; } }, meridiem: function (hours, minutes, isLower) { if (hours < 11) { return 'pagi'; } else if (hours < 15) { return 'tengahari'; } else if (hours < 19) { return 'petang'; } else { return 'malam'; } }, calendar: { sameDay: '[Hari ini pukul] LT', nextDay: '[Esok pukul] LT', nextWeek: 'dddd [pukul] LT', lastDay: '[Kelmarin pukul] LT', lastWeek: 'dddd [lepas pukul] LT', sameElse: 'L', }, relativeTime: { future: 'dalam %s', past: '%s yang lepas', s: 'beberapa saat', ss: '%d saat', m: 'seminit', mm: '%d minit', h: 'sejam', hh: '%d jam', d: 'sehari', dd: '%d hari', M: 'sebulan', MM: '%d bulan', y: 'setahun', yy: '%d tahun', }, week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return msMy; }))); /***/ }), /* 1331 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Maltese (Malta) [mt] //! author : Alessandro Maruccia : https://github.com/alesma ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var mt = moment.defineLocale('mt', { months: 'Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru'.split( '_' ), monthsShort: 'Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ'.split('_'), weekdays: 'Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt'.split( '_' ), weekdaysShort: 'Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib'.split('_'), weekdaysMin: 'Ħa_Tn_Tl_Er_Ħa_Ġi_Si'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, calendar: { sameDay: '[Illum fil-]LT', nextDay: '[Għada fil-]LT', nextWeek: 'dddd [fil-]LT', lastDay: '[Il-bieraħ fil-]LT', lastWeek: 'dddd [li għadda] [fil-]LT', sameElse: 'L', }, relativeTime: { future: 'f’ %s', past: '%s ilu', s: 'ftit sekondi', ss: '%d sekondi', m: 'minuta', mm: '%d minuti', h: 'siegħa', hh: '%d siegħat', d: 'ġurnata', dd: '%d ġranet', M: 'xahar', MM: '%d xhur', y: 'sena', yy: '%d sni', }, dayOfMonthOrdinalParse: /\d{1,2}º/, ordinal: '%dº', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return mt; }))); /***/ }), /* 1332 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Burmese [my] //! author : Squar team, mysquar.com //! author : David Rossellat : https://github.com/gholadr //! author : Tin Aung Lin : https://github.com/thanyawzinmin ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var symbolMap = { '1': '၁', '2': '၂', '3': '၃', '4': '၄', '5': '၅', '6': '၆', '7': '၇', '8': '၈', '9': '၉', '0': '၀', }, numberMap = { '၁': '1', '၂': '2', '၃': '3', '၄': '4', '၅': '5', '၆': '6', '၇': '7', '၈': '8', '၉': '9', '၀': '0', }; var my = moment.defineLocale('my', { months: 'ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ'.split( '_' ), monthsShort: 'ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ'.split('_'), weekdays: 'တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ'.split( '_' ), weekdaysShort: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'), weekdaysMin: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd D MMMM YYYY HH:mm', }, calendar: { sameDay: '[ယနေ.] LT [မှာ]', nextDay: '[မနက်ဖြန်] LT [မှာ]', nextWeek: 'dddd LT [မှာ]', lastDay: '[မနေ.က] LT [မှာ]', lastWeek: '[ပြီးခဲ့သော] dddd LT [မှာ]', sameElse: 'L', }, relativeTime: { future: 'လာမည့် %s မှာ', past: 'လွန်ခဲ့သော %s က', s: 'စက္ကန်.အနည်းငယ်', ss: '%d စက္ကန့်', m: 'တစ်မိနစ်', mm: '%d မိနစ်', h: 'တစ်နာရီ', hh: '%d နာရီ', d: 'တစ်ရက်', dd: '%d ရက်', M: 'တစ်လ', MM: '%d လ', y: 'တစ်နှစ်', yy: '%d နှစ်', }, preparse: function (string) { return string.replace(/[၁၂၃၄၅၆၇၈၉၀]/g, function (match) { return numberMap[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { return symbolMap[match]; }); }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return my; }))); /***/ }), /* 1333 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Norwegian Bokmål [nb] //! authors : Espen Hovlandsdal : https://github.com/rexxars //! Sigurd Gartmann : https://github.com/sigurdga //! Stephen Ramthun : https://github.com/stephenramthun ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var nb = moment.defineLocale('nb', { months: 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split( '_' ), monthsShort: 'jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.'.split( '_' ), monthsParseExact: true, weekdays: 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'), weekdaysShort: 'sø._ma._ti._on._to._fr._lø.'.split('_'), weekdaysMin: 'sø_ma_ti_on_to_fr_lø'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD.MM.YYYY', LL: 'D. MMMM YYYY', LLL: 'D. MMMM YYYY [kl.] HH:mm', LLLL: 'dddd D. MMMM YYYY [kl.] HH:mm', }, calendar: { sameDay: '[i dag kl.] LT', nextDay: '[i morgen kl.] LT', nextWeek: 'dddd [kl.] LT', lastDay: '[i går kl.] LT', lastWeek: '[forrige] dddd [kl.] LT', sameElse: 'L', }, relativeTime: { future: 'om %s', past: '%s siden', s: 'noen sekunder', ss: '%d sekunder', m: 'ett minutt', mm: '%d minutter', h: 'en time', hh: '%d timer', d: 'en dag', dd: '%d dager', M: 'en måned', MM: '%d måneder', y: 'ett år', yy: '%d år', }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return nb; }))); /***/ }), /* 1334 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Nepalese [ne] //! author : suvash : https://github.com/suvash ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var symbolMap = { '1': '१', '2': '२', '3': '३', '4': '४', '5': '५', '6': '६', '7': '७', '8': '८', '9': '९', '0': '०', }, numberMap = { '१': '1', '२': '2', '३': '3', '४': '4', '५': '5', '६': '6', '७': '7', '८': '8', '९': '9', '०': '0', }; var ne = moment.defineLocale('ne', { months: 'जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर'.split( '_' ), monthsShort: 'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split( '_' ), monthsParseExact: true, weekdays: 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split( '_' ), weekdaysShort: 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split('_'), weekdaysMin: 'आ._सो._मं._बु._बि._शु._श.'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'Aको h:mm बजे', LTS: 'Aको h:mm:ss बजे', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY, Aको h:mm बजे', LLLL: 'dddd, D MMMM YYYY, Aको h:mm बजे', }, preparse: function (string) { return string.replace(/[१२३४५६७८९०]/g, function (match) { return numberMap[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { return symbolMap[match]; }); }, meridiemParse: /राति|बिहान|दिउँसो|साँझ/, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if (meridiem === 'राति') { return hour < 4 ? hour : hour + 12; } else if (meridiem === 'बिहान') { return hour; } else if (meridiem === 'दिउँसो') { return hour >= 10 ? hour : hour + 12; } else if (meridiem === 'साँझ') { return hour + 12; } }, meridiem: function (hour, minute, isLower) { if (hour < 3) { return 'राति'; } else if (hour < 12) { return 'बिहान'; } else if (hour < 16) { return 'दिउँसो'; } else if (hour < 20) { return 'साँझ'; } else { return 'राति'; } }, calendar: { sameDay: '[आज] LT', nextDay: '[भोलि] LT', nextWeek: '[आउँदो] dddd[,] LT', lastDay: '[हिजो] LT', lastWeek: '[गएको] dddd[,] LT', sameElse: 'L', }, relativeTime: { future: '%sमा', past: '%s अगाडि', s: 'केही क्षण', ss: '%d सेकेण्ड', m: 'एक मिनेट', mm: '%d मिनेट', h: 'एक घण्टा', hh: '%d घण्टा', d: 'एक दिन', dd: '%d दिन', M: 'एक महिना', MM: '%d महिना', y: 'एक बर्ष', yy: '%d बर्ष', }, week: { dow: 0, // Sunday is the first day of the week. doy: 6, // The week that contains Jan 6th is the first week of the year. }, }); return ne; }))); /***/ }), /* 1335 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Dutch [nl] //! author : Joris Röling : https://github.com/jorisroling //! author : Jacob Middag : https://github.com/middagj ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split( '_' ), monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split( '_' ), monthsParse = [ /^jan/i, /^feb/i, /^maart|mrt.?$/i, /^apr/i, /^mei$/i, /^jun[i.]?$/i, /^jul[i.]?$/i, /^aug/i, /^sep/i, /^okt/i, /^nov/i, /^dec/i, ], monthsRegex = /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i; var nl = moment.defineLocale('nl', { months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split( '_' ), monthsShort: function (m, format) { if (!m) { return monthsShortWithDots; } else if (/-MMM-/.test(format)) { return monthsShortWithoutDots[m.month()]; } else { return monthsShortWithDots[m.month()]; } }, monthsRegex: monthsRegex, monthsShortRegex: monthsRegex, monthsStrictRegex: /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i, monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i, monthsParse: monthsParse, longMonthsParse: monthsParse, shortMonthsParse: monthsParse, weekdays: 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split( '_' ), weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'), weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD-MM-YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd D MMMM YYYY HH:mm', }, calendar: { sameDay: '[vandaag om] LT', nextDay: '[morgen om] LT', nextWeek: 'dddd [om] LT', lastDay: '[gisteren om] LT', lastWeek: '[afgelopen] dddd [om] LT', sameElse: 'L', }, relativeTime: { future: 'over %s', past: '%s geleden', s: 'een paar seconden', ss: '%d seconden', m: 'één minuut', mm: '%d minuten', h: 'één uur', hh: '%d uur', d: 'één dag', dd: '%d dagen', M: 'één maand', MM: '%d maanden', y: 'één jaar', yy: '%d jaar', }, dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/, ordinal: function (number) { return ( number + (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de') ); }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return nl; }))); /***/ }), /* 1336 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Dutch (Belgium) [nl-be] //! author : Joris Röling : https://github.com/jorisroling //! author : Jacob Middag : https://github.com/middagj ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split( '_' ), monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split( '_' ), monthsParse = [ /^jan/i, /^feb/i, /^maart|mrt.?$/i, /^apr/i, /^mei$/i, /^jun[i.]?$/i, /^jul[i.]?$/i, /^aug/i, /^sep/i, /^okt/i, /^nov/i, /^dec/i, ], monthsRegex = /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i; var nlBe = moment.defineLocale('nl-be', { months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split( '_' ), monthsShort: function (m, format) { if (!m) { return monthsShortWithDots; } else if (/-MMM-/.test(format)) { return monthsShortWithoutDots[m.month()]; } else { return monthsShortWithDots[m.month()]; } }, monthsRegex: monthsRegex, monthsShortRegex: monthsRegex, monthsStrictRegex: /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i, monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i, monthsParse: monthsParse, longMonthsParse: monthsParse, shortMonthsParse: monthsParse, weekdays: 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split( '_' ), weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'), weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd D MMMM YYYY HH:mm', }, calendar: { sameDay: '[vandaag om] LT', nextDay: '[morgen om] LT', nextWeek: 'dddd [om] LT', lastDay: '[gisteren om] LT', lastWeek: '[afgelopen] dddd [om] LT', sameElse: 'L', }, relativeTime: { future: 'over %s', past: '%s geleden', s: 'een paar seconden', ss: '%d seconden', m: 'één minuut', mm: '%d minuten', h: 'één uur', hh: '%d uur', d: 'één dag', dd: '%d dagen', M: 'één maand', MM: '%d maanden', y: 'één jaar', yy: '%d jaar', }, dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/, ordinal: function (number) { return ( number + (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de') ); }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return nlBe; }))); /***/ }), /* 1337 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Nynorsk [nn] //! authors : https://github.com/mechuwind //! Stephen Ramthun : https://github.com/stephenramthun ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var nn = moment.defineLocale('nn', { months: 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split( '_' ), monthsShort: 'jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.'.split( '_' ), monthsParseExact: true, weekdays: 'sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag'.split('_'), weekdaysShort: 'su._må._ty._on._to._fr._lau.'.split('_'), weekdaysMin: 'su_må_ty_on_to_fr_la'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD.MM.YYYY', LL: 'D. MMMM YYYY', LLL: 'D. MMMM YYYY [kl.] H:mm', LLLL: 'dddd D. MMMM YYYY [kl.] HH:mm', }, calendar: { sameDay: '[I dag klokka] LT', nextDay: '[I morgon klokka] LT', nextWeek: 'dddd [klokka] LT', lastDay: '[I går klokka] LT', lastWeek: '[Føregåande] dddd [klokka] LT', sameElse: 'L', }, relativeTime: { future: 'om %s', past: '%s sidan', s: 'nokre sekund', ss: '%d sekund', m: 'eit minutt', mm: '%d minutt', h: 'ein time', hh: '%d timar', d: 'ein dag', dd: '%d dagar', M: 'ein månad', MM: '%d månader', y: 'eit år', yy: '%d år', }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return nn; }))); /***/ }), /* 1338 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Occitan, lengadocian dialecte [oc-lnc] //! author : Quentin PAGÈS : https://github.com/Quenty31 ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var ocLnc = moment.defineLocale('oc-lnc', { months: { standalone: 'genièr_febrièr_març_abril_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre'.split( '_' ), format: "de genièr_de febrièr_de març_d'abril_de mai_de junh_de julhet_d'agost_de setembre_d'octòbre_de novembre_de decembre".split( '_' ), isFormat: /D[oD]?(\s)+MMMM/, }, monthsShort: 'gen._febr._març_abr._mai_junh_julh._ago._set._oct._nov._dec.'.split( '_' ), monthsParseExact: true, weekdays: 'dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte'.split( '_' ), weekdaysShort: 'dg._dl._dm._dc._dj._dv._ds.'.split('_'), weekdaysMin: 'dg_dl_dm_dc_dj_dv_ds'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM [de] YYYY', ll: 'D MMM YYYY', LLL: 'D MMMM [de] YYYY [a] H:mm', lll: 'D MMM YYYY, H:mm', LLLL: 'dddd D MMMM [de] YYYY [a] H:mm', llll: 'ddd D MMM YYYY, H:mm', }, calendar: { sameDay: '[uèi a] LT', nextDay: '[deman a] LT', nextWeek: 'dddd [a] LT', lastDay: '[ièr a] LT', lastWeek: 'dddd [passat a] LT', sameElse: 'L', }, relativeTime: { future: "d'aquí %s", past: 'fa %s', s: 'unas segondas', ss: '%d segondas', m: 'una minuta', mm: '%d minutas', h: 'una ora', hh: '%d oras', d: 'un jorn', dd: '%d jorns', M: 'un mes', MM: '%d meses', y: 'un an', yy: '%d ans', }, dayOfMonthOrdinalParse: /\d{1,2}(r|n|t|è|a)/, ordinal: function (number, period) { var output = number === 1 ? 'r' : number === 2 ? 'n' : number === 3 ? 'r' : number === 4 ? 't' : 'è'; if (period === 'w' || period === 'W') { output = 'a'; } return number + output; }, week: { dow: 1, // Monday is the first day of the week. doy: 4, }, }); return ocLnc; }))); /***/ }), /* 1339 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Punjabi (India) [pa-in] //! author : Harpreet Singh : https://github.com/harpreetkhalsagtbit ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var symbolMap = { '1': '੧', '2': '੨', '3': '੩', '4': '੪', '5': '੫', '6': '੬', '7': '੭', '8': '੮', '9': '੯', '0': '੦', }, numberMap = { '੧': '1', '੨': '2', '੩': '3', '੪': '4', '੫': '5', '੬': '6', '੭': '7', '੮': '8', '੯': '9', '੦': '0', }; var paIn = moment.defineLocale('pa-in', { // There are months name as per Nanakshahi Calendar but they are not used as rigidly in modern Punjabi. months: 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split( '_' ), monthsShort: 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split( '_' ), weekdays: 'ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ'.split( '_' ), weekdaysShort: 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'), weekdaysMin: 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'), longDateFormat: { LT: 'A h:mm ਵਜੇ', LTS: 'A h:mm:ss ਵਜੇ', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY, A h:mm ਵਜੇ', LLLL: 'dddd, D MMMM YYYY, A h:mm ਵਜੇ', }, calendar: { sameDay: '[ਅਜ] LT', nextDay: '[ਕਲ] LT', nextWeek: '[ਅਗਲਾ] dddd, LT', lastDay: '[ਕਲ] LT', lastWeek: '[ਪਿਛਲੇ] dddd, LT', sameElse: 'L', }, relativeTime: { future: '%s ਵਿੱਚ', past: '%s ਪਿਛਲੇ', s: 'ਕੁਝ ਸਕਿੰਟ', ss: '%d ਸਕਿੰਟ', m: 'ਇਕ ਮਿੰਟ', mm: '%d ਮਿੰਟ', h: 'ਇੱਕ ਘੰਟਾ', hh: '%d ਘੰਟੇ', d: 'ਇੱਕ ਦਿਨ', dd: '%d ਦਿਨ', M: 'ਇੱਕ ਮਹੀਨਾ', MM: '%d ਮਹੀਨੇ', y: 'ਇੱਕ ਸਾਲ', yy: '%d ਸਾਲ', }, preparse: function (string) { return string.replace(/[੧੨੩੪੫੬੭੮੯੦]/g, function (match) { return numberMap[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { return symbolMap[match]; }); }, // Punjabi notation for meridiems are quite fuzzy in practice. While there exists // a rigid notion of a 'Pahar' it is not used as rigidly in modern Punjabi. meridiemParse: /ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if (meridiem === 'ਰਾਤ') { return hour < 4 ? hour : hour + 12; } else if (meridiem === 'ਸਵੇਰ') { return hour; } else if (meridiem === 'ਦੁਪਹਿਰ') { return hour >= 10 ? hour : hour + 12; } else if (meridiem === 'ਸ਼ਾਮ') { return hour + 12; } }, meridiem: function (hour, minute, isLower) { if (hour < 4) { return 'ਰਾਤ'; } else if (hour < 10) { return 'ਸਵੇਰ'; } else if (hour < 17) { return 'ਦੁਪਹਿਰ'; } else if (hour < 20) { return 'ਸ਼ਾਮ'; } else { return 'ਰਾਤ'; } }, week: { dow: 0, // Sunday is the first day of the week. doy: 6, // The week that contains Jan 6th is the first week of the year. }, }); return paIn; }))); /***/ }), /* 1340 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Polish [pl] //! author : Rafal Hirsz : https://github.com/evoL ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var monthsNominative = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split( '_' ), monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split( '_' ); function plural(n) { return n % 10 < 5 && n % 10 > 1 && ~~(n / 10) % 10 !== 1; } function translate(number, withoutSuffix, key) { var result = number + ' '; switch (key) { case 'ss': return result + (plural(number) ? 'sekundy' : 'sekund'); case 'm': return withoutSuffix ? 'minuta' : 'minutę'; case 'mm': return result + (plural(number) ? 'minuty' : 'minut'); case 'h': return withoutSuffix ? 'godzina' : 'godzinę'; case 'hh': return result + (plural(number) ? 'godziny' : 'godzin'); case 'MM': return result + (plural(number) ? 'miesiące' : 'miesięcy'); case 'yy': return result + (plural(number) ? 'lata' : 'lat'); } } var pl = moment.defineLocale('pl', { months: function (momentToFormat, format) { if (!momentToFormat) { return monthsNominative; } else if (format === '') { // Hack: if format empty we know this is used to generate // RegExp by moment. Give then back both valid forms of months // in RegExp ready format. return ( '(' + monthsSubjective[momentToFormat.month()] + '|' + monthsNominative[momentToFormat.month()] + ')' ); } else if (/D MMMM/.test(format)) { return monthsSubjective[momentToFormat.month()]; } else { return monthsNominative[momentToFormat.month()]; } }, monthsShort: 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'), weekdays: 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split( '_' ), weekdaysShort: 'ndz_pon_wt_śr_czw_pt_sob'.split('_'), weekdaysMin: 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD.MM.YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, calendar: { sameDay: '[Dziś o] LT', nextDay: '[Jutro o] LT', nextWeek: function () { switch (this.day()) { case 0: return '[W niedzielę o] LT'; case 2: return '[We wtorek o] LT'; case 3: return '[W środę o] LT'; case 6: return '[W sobotę o] LT'; default: return '[W] dddd [o] LT'; } }, lastDay: '[Wczoraj o] LT', lastWeek: function () { switch (this.day()) { case 0: return '[W zeszłą niedzielę o] LT'; case 3: return '[W zeszłą środę o] LT'; case 6: return '[W zeszłą sobotę o] LT'; default: return '[W zeszły] dddd [o] LT'; } }, sameElse: 'L', }, relativeTime: { future: 'za %s', past: '%s temu', s: 'kilka sekund', ss: translate, m: translate, mm: translate, h: translate, hh: translate, d: '1 dzień', dd: '%d dni', M: 'miesiąc', MM: translate, y: 'rok', yy: translate, }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return pl; }))); /***/ }), /* 1341 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Portuguese [pt] //! author : Jefferson : https://github.com/jalex79 ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var pt = moment.defineLocale('pt', { months: 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split( '_' ), monthsShort: 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'), weekdays: 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split( '_' ), weekdaysShort: 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'), weekdaysMin: 'Do_2ª_3ª_4ª_5ª_6ª_Sá'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D [de] MMMM [de] YYYY', LLL: 'D [de] MMMM [de] YYYY HH:mm', LLLL: 'dddd, D [de] MMMM [de] YYYY HH:mm', }, calendar: { sameDay: '[Hoje às] LT', nextDay: '[Amanhã às] LT', nextWeek: 'dddd [às] LT', lastDay: '[Ontem às] LT', lastWeek: function () { return this.day() === 0 || this.day() === 6 ? '[Último] dddd [às] LT' // Saturday + Sunday : '[Última] dddd [às] LT'; // Monday - Friday }, sameElse: 'L', }, relativeTime: { future: 'em %s', past: 'há %s', s: 'segundos', ss: '%d segundos', m: 'um minuto', mm: '%d minutos', h: 'uma hora', hh: '%d horas', d: 'um dia', dd: '%d dias', M: 'um mês', MM: '%d meses', y: 'um ano', yy: '%d anos', }, dayOfMonthOrdinalParse: /\d{1,2}º/, ordinal: '%dº', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return pt; }))); /***/ }), /* 1342 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Portuguese (Brazil) [pt-br] //! author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var ptBr = moment.defineLocale('pt-br', { months: 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split( '_' ), monthsShort: 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'), weekdays: 'domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado'.split( '_' ), weekdaysShort: 'dom_seg_ter_qua_qui_sex_sáb'.split('_'), weekdaysMin: 'do_2ª_3ª_4ª_5ª_6ª_sá'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D [de] MMMM [de] YYYY', LLL: 'D [de] MMMM [de] YYYY [às] HH:mm', LLLL: 'dddd, D [de] MMMM [de] YYYY [às] HH:mm', }, calendar: { sameDay: '[Hoje às] LT', nextDay: '[Amanhã às] LT', nextWeek: 'dddd [às] LT', lastDay: '[Ontem às] LT', lastWeek: function () { return this.day() === 0 || this.day() === 6 ? '[Último] dddd [às] LT' // Saturday + Sunday : '[Última] dddd [às] LT'; // Monday - Friday }, sameElse: 'L', }, relativeTime: { future: 'em %s', past: 'há %s', s: 'poucos segundos', ss: '%d segundos', m: 'um minuto', mm: '%d minutos', h: 'uma hora', hh: '%d horas', d: 'um dia', dd: '%d dias', M: 'um mês', MM: '%d meses', y: 'um ano', yy: '%d anos', }, dayOfMonthOrdinalParse: /\d{1,2}º/, ordinal: '%dº', }); return ptBr; }))); /***/ }), /* 1343 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Romanian [ro] //! author : Vlad Gurdiga : https://github.com/gurdiga //! author : Valentin Agachi : https://github.com/avaly //! author : Emanuel Cepoi : https://github.com/cepem ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration function relativeTimeWithPlural(number, withoutSuffix, key) { var format = { ss: 'secunde', mm: 'minute', hh: 'ore', dd: 'zile', MM: 'luni', yy: 'ani', }, separator = ' '; if (number % 100 >= 20 || (number >= 100 && number % 100 === 0)) { separator = ' de '; } return number + separator + format[key]; } var ro = moment.defineLocale('ro', { months: 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split( '_' ), monthsShort: 'ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split( '_' ), monthsParseExact: true, weekdays: 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'), weekdaysShort: 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'), weekdaysMin: 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'), longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', L: 'DD.MM.YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY H:mm', LLLL: 'dddd, D MMMM YYYY H:mm', }, calendar: { sameDay: '[azi la] LT', nextDay: '[mâine la] LT', nextWeek: 'dddd [la] LT', lastDay: '[ieri la] LT', lastWeek: '[fosta] dddd [la] LT', sameElse: 'L', }, relativeTime: { future: 'peste %s', past: '%s în urmă', s: 'câteva secunde', ss: relativeTimeWithPlural, m: 'un minut', mm: relativeTimeWithPlural, h: 'o oră', hh: relativeTimeWithPlural, d: 'o zi', dd: relativeTimeWithPlural, M: 'o lună', MM: relativeTimeWithPlural, y: 'un an', yy: relativeTimeWithPlural, }, week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return ro; }))); /***/ }), /* 1344 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Russian [ru] //! author : Viktorminator : https://github.com/Viktorminator //! Author : Menelion Elensúle : https://github.com/Oire //! author : Коренберг Марк : https://github.com/socketpair ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration function plural(word, num) { var forms = word.split('_'); return num % 10 === 1 && num % 100 !== 11 ? forms[0] : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]; } function relativeTimeWithPlural(number, withoutSuffix, key) { var format = { ss: withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд', mm: withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут', hh: 'час_часа_часов', dd: 'день_дня_дней', MM: 'месяц_месяца_месяцев', yy: 'год_года_лет', }; if (key === 'm') { return withoutSuffix ? 'минута' : 'минуту'; } else { return number + ' ' + plural(format[key], +number); } } var monthsParse = [ /^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[йя]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i, ]; // http://new.gramota.ru/spravka/rules/139-prop : § 103 // Сокращения месяцев: http://new.gramota.ru/spravka/buro/search-answer?s=242637 // CLDR data: http://www.unicode.org/cldr/charts/28/summary/ru.html#1753 var ru = moment.defineLocale('ru', { months: { format: 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split( '_' ), standalone: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split( '_' ), }, monthsShort: { // по CLDR именно "июл." и "июн.", но какой смысл менять букву на точку ? format: 'янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.'.split( '_' ), standalone: 'янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.'.split( '_' ), }, weekdays: { standalone: 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split( '_' ), format: 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split( '_' ), isFormat: /\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/, }, weekdaysShort: 'вс_пн_вт_ср_чт_пт_сб'.split('_'), weekdaysMin: 'вс_пн_вт_ср_чт_пт_сб'.split('_'), monthsParse: monthsParse, longMonthsParse: monthsParse, shortMonthsParse: monthsParse, // полные названия с падежами, по три буквы, для некоторых, по 4 буквы, сокращения с точкой и без точки monthsRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i, // копия предыдущего monthsShortRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i, // полные названия с падежами monthsStrictRegex: /^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i, // Выражение, которое соотвествует только сокращённым формам monthsShortStrictRegex: /^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i, longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', L: 'DD.MM.YYYY', LL: 'D MMMM YYYY г.', LLL: 'D MMMM YYYY г., H:mm', LLLL: 'dddd, D MMMM YYYY г., H:mm', }, calendar: { sameDay: '[Сегодня, в] LT', nextDay: '[Завтра, в] LT', lastDay: '[Вчера, в] LT', nextWeek: function (now) { if (now.week() !== this.week()) { switch (this.day()) { case 0: return '[В следующее] dddd, [в] LT'; case 1: case 2: case 4: return '[В следующий] dddd, [в] LT'; case 3: case 5: case 6: return '[В следующую] dddd, [в] LT'; } } else { if (this.day() === 2) { return '[Во] dddd, [в] LT'; } else { return '[В] dddd, [в] LT'; } } }, lastWeek: function (now) { if (now.week() !== this.week()) { switch (this.day()) { case 0: return '[В прошлое] dddd, [в] LT'; case 1: case 2: case 4: return '[В прошлый] dddd, [в] LT'; case 3: case 5: case 6: return '[В прошлую] dddd, [в] LT'; } } else { if (this.day() === 2) { return '[Во] dddd, [в] LT'; } else { return '[В] dddd, [в] LT'; } } }, sameElse: 'L', }, relativeTime: { future: 'через %s', past: '%s назад', s: 'несколько секунд', ss: relativeTimeWithPlural, m: relativeTimeWithPlural, mm: relativeTimeWithPlural, h: 'час', hh: relativeTimeWithPlural, d: 'день', dd: relativeTimeWithPlural, M: 'месяц', MM: relativeTimeWithPlural, y: 'год', yy: relativeTimeWithPlural, }, meridiemParse: /ночи|утра|дня|вечера/i, isPM: function (input) { return /^(дня|вечера)$/.test(input); }, meridiem: function (hour, minute, isLower) { if (hour < 4) { return 'ночи'; } else if (hour < 12) { return 'утра'; } else if (hour < 17) { return 'дня'; } else { return 'вечера'; } }, dayOfMonthOrdinalParse: /\d{1,2}-(й|го|я)/, ordinal: function (number, period) { switch (period) { case 'M': case 'd': case 'DDD': return number + '-й'; case 'D': return number + '-го'; case 'w': case 'W': return number + '-я'; default: return number; } }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return ru; }))); /***/ }), /* 1345 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Sindhi [sd] //! author : Narain Sagar : https://github.com/narainsagar ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var months = [ 'جنوري', 'فيبروري', 'مارچ', 'اپريل', 'مئي', 'جون', 'جولاءِ', 'آگسٽ', 'سيپٽمبر', 'آڪٽوبر', 'نومبر', 'ڊسمبر', ], days = ['آچر', 'سومر', 'اڱارو', 'اربع', 'خميس', 'جمع', 'ڇنڇر']; var sd = moment.defineLocale('sd', { months: months, monthsShort: months, weekdays: days, weekdaysShort: days, weekdaysMin: days, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd، D MMMM YYYY HH:mm', }, meridiemParse: /صبح|شام/, isPM: function (input) { return 'شام' === input; }, meridiem: function (hour, minute, isLower) { if (hour < 12) { return 'صبح'; } return 'شام'; }, calendar: { sameDay: '[اڄ] LT', nextDay: '[سڀاڻي] LT', nextWeek: 'dddd [اڳين هفتي تي] LT', lastDay: '[ڪالهه] LT', lastWeek: '[گزريل هفتي] dddd [تي] LT', sameElse: 'L', }, relativeTime: { future: '%s پوء', past: '%s اڳ', s: 'چند سيڪنڊ', ss: '%d سيڪنڊ', m: 'هڪ منٽ', mm: '%d منٽ', h: 'هڪ ڪلاڪ', hh: '%d ڪلاڪ', d: 'هڪ ڏينهن', dd: '%d ڏينهن', M: 'هڪ مهينو', MM: '%d مهينا', y: 'هڪ سال', yy: '%d سال', }, preparse: function (string) { return string.replace(/،/g, ','); }, postformat: function (string) { return string.replace(/,/g, '،'); }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return sd; }))); /***/ }), /* 1346 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Northern Sami [se] //! authors : Bård Rolstad Henriksen : https://github.com/karamell ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var se = moment.defineLocale('se', { months: 'ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu'.split( '_' ), monthsShort: 'ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov'.split( '_' ), weekdays: 'sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat'.split( '_' ), weekdaysShort: 'sotn_vuos_maŋ_gask_duor_bear_láv'.split('_'), weekdaysMin: 's_v_m_g_d_b_L'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD.MM.YYYY', LL: 'MMMM D. [b.] YYYY', LLL: 'MMMM D. [b.] YYYY [ti.] HH:mm', LLLL: 'dddd, MMMM D. [b.] YYYY [ti.] HH:mm', }, calendar: { sameDay: '[otne ti] LT', nextDay: '[ihttin ti] LT', nextWeek: 'dddd [ti] LT', lastDay: '[ikte ti] LT', lastWeek: '[ovddit] dddd [ti] LT', sameElse: 'L', }, relativeTime: { future: '%s geažes', past: 'maŋit %s', s: 'moadde sekunddat', ss: '%d sekunddat', m: 'okta minuhta', mm: '%d minuhtat', h: 'okta diimmu', hh: '%d diimmut', d: 'okta beaivi', dd: '%d beaivvit', M: 'okta mánnu', MM: '%d mánut', y: 'okta jahki', yy: '%d jagit', }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return se; }))); /***/ }), /* 1347 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Sinhalese [si] //! author : Sampath Sitinamaluwa : https://github.com/sampathsris ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration /*jshint -W100*/ var si = moment.defineLocale('si', { months: 'ජනවාරි_පෙබරවාරි_මාර්තු_අප්රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්'.split( '_' ), monthsShort: 'ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ'.split( '_' ), weekdays: 'ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා'.split( '_' ), weekdaysShort: 'ඉරි_සඳු_අඟ_බදා_බ්රහ_සිකු_සෙන'.split('_'), weekdaysMin: 'ඉ_ස_අ_බ_බ්ර_සි_සෙ'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'a h:mm', LTS: 'a h:mm:ss', L: 'YYYY/MM/DD', LL: 'YYYY MMMM D', LLL: 'YYYY MMMM D, a h:mm', LLLL: 'YYYY MMMM D [වැනි] dddd, a h:mm:ss', }, calendar: { sameDay: '[අද] LT[ට]', nextDay: '[හෙට] LT[ට]', nextWeek: 'dddd LT[ට]', lastDay: '[ඊයේ] LT[ට]', lastWeek: '[පසුගිය] dddd LT[ට]', sameElse: 'L', }, relativeTime: { future: '%sකින්', past: '%sකට පෙර', s: 'තත්පර කිහිපය', ss: 'තත්පර %d', m: 'මිනිත්තුව', mm: 'මිනිත්තු %d', h: 'පැය', hh: 'පැය %d', d: 'දිනය', dd: 'දින %d', M: 'මාසය', MM: 'මාස %d', y: 'වසර', yy: 'වසර %d', }, dayOfMonthOrdinalParse: /\d{1,2} වැනි/, ordinal: function (number) { return number + ' වැනි'; }, meridiemParse: /පෙර වරු|පස් වරු|පෙ.ව|ප.ව./, isPM: function (input) { return input === 'ප.ව.' || input === 'පස් වරු'; }, meridiem: function (hours, minutes, isLower) { if (hours > 11) { return isLower ? 'ප.ව.' : 'පස් වරු'; } else { return isLower ? 'පෙ.ව.' : 'පෙර වරු'; } }, }); return si; }))); /***/ }), /* 1348 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Slovak [sk] //! author : Martin Minka : https://github.com/k2s //! based on work of petrbela : https://github.com/petrbela ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var months = 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split( '_' ), monthsShort = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_'); function plural(n) { return n > 1 && n < 5; } function translate(number, withoutSuffix, key, isFuture) { var result = number + ' '; switch (key) { case 's': // a few seconds / in a few seconds / a few seconds ago return withoutSuffix || isFuture ? 'pár sekúnd' : 'pár sekundami'; case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago if (withoutSuffix || isFuture) { return result + (plural(number) ? 'sekundy' : 'sekúnd'); } else { return result + 'sekundami'; } case 'm': // a minute / in a minute / a minute ago return withoutSuffix ? 'minúta' : isFuture ? 'minútu' : 'minútou'; case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago if (withoutSuffix || isFuture) { return result + (plural(number) ? 'minúty' : 'minút'); } else { return result + 'minútami'; } case 'h': // an hour / in an hour / an hour ago return withoutSuffix ? 'hodina' : isFuture ? 'hodinu' : 'hodinou'; case 'hh': // 9 hours / in 9 hours / 9 hours ago if (withoutSuffix || isFuture) { return result + (plural(number) ? 'hodiny' : 'hodín'); } else { return result + 'hodinami'; } case 'd': // a day / in a day / a day ago return withoutSuffix || isFuture ? 'deň' : 'dňom'; case 'dd': // 9 days / in 9 days / 9 days ago if (withoutSuffix || isFuture) { return result + (plural(number) ? 'dni' : 'dní'); } else { return result + 'dňami'; } case 'M': // a month / in a month / a month ago return withoutSuffix || isFuture ? 'mesiac' : 'mesiacom'; case 'MM': // 9 months / in 9 months / 9 months ago if (withoutSuffix || isFuture) { return result + (plural(number) ? 'mesiace' : 'mesiacov'); } else { return result + 'mesiacmi'; } case 'y': // a year / in a year / a year ago return withoutSuffix || isFuture ? 'rok' : 'rokom'; case 'yy': // 9 years / in 9 years / 9 years ago if (withoutSuffix || isFuture) { return result + (plural(number) ? 'roky' : 'rokov'); } else { return result + 'rokmi'; } } } var sk = moment.defineLocale('sk', { months: months, monthsShort: monthsShort, weekdays: 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'), weekdaysShort: 'ne_po_ut_st_št_pi_so'.split('_'), weekdaysMin: 'ne_po_ut_st_št_pi_so'.split('_'), longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', L: 'DD.MM.YYYY', LL: 'D. MMMM YYYY', LLL: 'D. MMMM YYYY H:mm', LLLL: 'dddd D. MMMM YYYY H:mm', }, calendar: { sameDay: '[dnes o] LT', nextDay: '[zajtra o] LT', nextWeek: function () { switch (this.day()) { case 0: return '[v nedeľu o] LT'; case 1: case 2: return '[v] dddd [o] LT'; case 3: return '[v stredu o] LT'; case 4: return '[vo štvrtok o] LT'; case 5: return '[v piatok o] LT'; case 6: return '[v sobotu o] LT'; } }, lastDay: '[včera o] LT', lastWeek: function () { switch (this.day()) { case 0: return '[minulú nedeľu o] LT'; case 1: case 2: return '[minulý] dddd [o] LT'; case 3: return '[minulú stredu o] LT'; case 4: case 5: return '[minulý] dddd [o] LT'; case 6: return '[minulú sobotu o] LT'; } }, sameElse: 'L', }, relativeTime: { future: 'za %s', past: 'pred %s', s: translate, ss: translate, m: translate, mm: translate, h: translate, hh: translate, d: translate, dd: translate, M: translate, MM: translate, y: translate, yy: translate, }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return sk; }))); /***/ }), /* 1349 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Slovenian [sl] //! author : Robert Sedovšek : https://github.com/sedovsek ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration function processRelativeTime(number, withoutSuffix, key, isFuture) { var result = number + ' '; switch (key) { case 's': return withoutSuffix || isFuture ? 'nekaj sekund' : 'nekaj sekundami'; case 'ss': if (number === 1) { result += withoutSuffix ? 'sekundo' : 'sekundi'; } else if (number === 2) { result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah'; } else if (number < 5) { result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah'; } else { result += 'sekund'; } return result; case 'm': return withoutSuffix ? 'ena minuta' : 'eno minuto'; case 'mm': if (number === 1) { result += withoutSuffix ? 'minuta' : 'minuto'; } else if (number === 2) { result += withoutSuffix || isFuture ? 'minuti' : 'minutama'; } else if (number < 5) { result += withoutSuffix || isFuture ? 'minute' : 'minutami'; } else { result += withoutSuffix || isFuture ? 'minut' : 'minutami'; } return result; case 'h': return withoutSuffix ? 'ena ura' : 'eno uro'; case 'hh': if (number === 1) { result += withoutSuffix ? 'ura' : 'uro'; } else if (number === 2) { result += withoutSuffix || isFuture ? 'uri' : 'urama'; } else if (number < 5) { result += withoutSuffix || isFuture ? 'ure' : 'urami'; } else { result += withoutSuffix || isFuture ? 'ur' : 'urami'; } return result; case 'd': return withoutSuffix || isFuture ? 'en dan' : 'enim dnem'; case 'dd': if (number === 1) { result += withoutSuffix || isFuture ? 'dan' : 'dnem'; } else if (number === 2) { result += withoutSuffix || isFuture ? 'dni' : 'dnevoma'; } else { result += withoutSuffix || isFuture ? 'dni' : 'dnevi'; } return result; case 'M': return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem'; case 'MM': if (number === 1) { result += withoutSuffix || isFuture ? 'mesec' : 'mesecem'; } else if (number === 2) { result += withoutSuffix || isFuture ? 'meseca' : 'mesecema'; } else if (number < 5) { result += withoutSuffix || isFuture ? 'mesece' : 'meseci'; } else { result += withoutSuffix || isFuture ? 'mesecev' : 'meseci'; } return result; case 'y': return withoutSuffix || isFuture ? 'eno leto' : 'enim letom'; case 'yy': if (number === 1) { result += withoutSuffix || isFuture ? 'leto' : 'letom'; } else if (number === 2) { result += withoutSuffix || isFuture ? 'leti' : 'letoma'; } else if (number < 5) { result += withoutSuffix || isFuture ? 'leta' : 'leti'; } else { result += withoutSuffix || isFuture ? 'let' : 'leti'; } return result; } } var sl = moment.defineLocale('sl', { months: 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split( '_' ), monthsShort: 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split( '_' ), monthsParseExact: true, weekdays: 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'), weekdaysShort: 'ned._pon._tor._sre._čet._pet._sob.'.split('_'), weekdaysMin: 'ne_po_to_sr_če_pe_so'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', L: 'DD. MM. YYYY', LL: 'D. MMMM YYYY', LLL: 'D. MMMM YYYY H:mm', LLLL: 'dddd, D. MMMM YYYY H:mm', }, calendar: { sameDay: '[danes ob] LT', nextDay: '[jutri ob] LT', nextWeek: function () { switch (this.day()) { case 0: return '[v] [nedeljo] [ob] LT'; case 3: return '[v] [sredo] [ob] LT'; case 6: return '[v] [soboto] [ob] LT'; case 1: case 2: case 4: case 5: return '[v] dddd [ob] LT'; } }, lastDay: '[včeraj ob] LT', lastWeek: function () { switch (this.day()) { case 0: return '[prejšnjo] [nedeljo] [ob] LT'; case 3: return '[prejšnjo] [sredo] [ob] LT'; case 6: return '[prejšnjo] [soboto] [ob] LT'; case 1: case 2: case 4: case 5: return '[prejšnji] dddd [ob] LT'; } }, sameElse: 'L', }, relativeTime: { future: 'čez %s', past: 'pred %s', s: processRelativeTime, ss: processRelativeTime, m: processRelativeTime, mm: processRelativeTime, h: processRelativeTime, hh: processRelativeTime, d: processRelativeTime, dd: processRelativeTime, M: processRelativeTime, MM: processRelativeTime, y: processRelativeTime, yy: processRelativeTime, }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return sl; }))); /***/ }), /* 1350 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Albanian [sq] //! author : Flakërim Ismani : https://github.com/flakerimi //! author : Menelion Elensúle : https://github.com/Oire //! author : Oerd Cukalla : https://github.com/oerd ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var sq = moment.defineLocale('sq', { months: 'Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor'.split( '_' ), monthsShort: 'Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj'.split('_'), weekdays: 'E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë'.split( '_' ), weekdaysShort: 'Die_Hën_Mar_Mër_Enj_Pre_Sht'.split('_'), weekdaysMin: 'D_H_Ma_Më_E_P_Sh'.split('_'), weekdaysParseExact: true, meridiemParse: /PD|MD/, isPM: function (input) { return input.charAt(0) === 'M'; }, meridiem: function (hours, minutes, isLower) { return hours < 12 ? 'PD' : 'MD'; }, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, calendar: { sameDay: '[Sot në] LT', nextDay: '[Nesër në] LT', nextWeek: 'dddd [në] LT', lastDay: '[Dje në] LT', lastWeek: 'dddd [e kaluar në] LT', sameElse: 'L', }, relativeTime: { future: 'në %s', past: '%s më parë', s: 'disa sekonda', ss: '%d sekonda', m: 'një minutë', mm: '%d minuta', h: 'një orë', hh: '%d orë', d: 'një ditë', dd: '%d ditë', M: 'një muaj', MM: '%d muaj', y: 'një vit', yy: '%d vite', }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return sq; }))); /***/ }), /* 1351 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Serbian [sr] //! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var translator = { words: { //Different grammatical cases ss: ['sekunda', 'sekunde', 'sekundi'], m: ['jedan minut', 'jedne minute'], mm: ['minut', 'minute', 'minuta'], h: ['jedan sat', 'jednog sata'], hh: ['sat', 'sata', 'sati'], dd: ['dan', 'dana', 'dana'], MM: ['mesec', 'meseca', 'meseci'], yy: ['godina', 'godine', 'godina'], }, correctGrammaticalCase: function (number, wordKey) { return number === 1 ? wordKey[0] : number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]; }, translate: function (number, withoutSuffix, key) { var wordKey = translator.words[key]; if (key.length === 1) { return withoutSuffix ? wordKey[0] : wordKey[1]; } else { return ( number + ' ' + translator.correctGrammaticalCase(number, wordKey) ); } }, }; var sr = moment.defineLocale('sr', { months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split( '_' ), monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split( '_' ), monthsParseExact: true, weekdays: 'nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota'.split( '_' ), weekdaysShort: 'ned._pon._uto._sre._čet._pet._sub.'.split('_'), weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', L: 'DD.MM.YYYY', LL: 'D. MMMM YYYY', LLL: 'D. MMMM YYYY H:mm', LLLL: 'dddd, D. MMMM YYYY H:mm', }, calendar: { sameDay: '[danas u] LT', nextDay: '[sutra u] LT', nextWeek: function () { switch (this.day()) { case 0: return '[u] [nedelju] [u] LT'; case 3: return '[u] [sredu] [u] LT'; case 6: return '[u] [subotu] [u] LT'; case 1: case 2: case 4: case 5: return '[u] dddd [u] LT'; } }, lastDay: '[juče u] LT', lastWeek: function () { var lastWeekDays = [ '[prošle] [nedelje] [u] LT', '[prošlog] [ponedeljka] [u] LT', '[prošlog] [utorka] [u] LT', '[prošle] [srede] [u] LT', '[prošlog] [četvrtka] [u] LT', '[prošlog] [petka] [u] LT', '[prošle] [subote] [u] LT', ]; return lastWeekDays[this.day()]; }, sameElse: 'L', }, relativeTime: { future: 'za %s', past: 'pre %s', s: 'nekoliko sekundi', ss: translator.translate, m: translator.translate, mm: translator.translate, h: translator.translate, hh: translator.translate, d: 'dan', dd: translator.translate, M: 'mesec', MM: translator.translate, y: 'godinu', yy: translator.translate, }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return sr; }))); /***/ }), /* 1352 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Serbian Cyrillic [sr-cyrl] //! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var translator = { words: { //Different grammatical cases ss: ['секунда', 'секунде', 'секунди'], m: ['један минут', 'једне минуте'], mm: ['минут', 'минуте', 'минута'], h: ['један сат', 'једног сата'], hh: ['сат', 'сата', 'сати'], dd: ['дан', 'дана', 'дана'], MM: ['месец', 'месеца', 'месеци'], yy: ['година', 'године', 'година'], }, correctGrammaticalCase: function (number, wordKey) { return number === 1 ? wordKey[0] : number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]; }, translate: function (number, withoutSuffix, key) { var wordKey = translator.words[key]; if (key.length === 1) { return withoutSuffix ? wordKey[0] : wordKey[1]; } else { return ( number + ' ' + translator.correctGrammaticalCase(number, wordKey) ); } }, }; var srCyrl = moment.defineLocale('sr-cyrl', { months: 'јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар'.split( '_' ), monthsShort: 'јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.'.split( '_' ), monthsParseExact: true, weekdays: 'недеља_понедељак_уторак_среда_четвртак_петак_субота'.split('_'), weekdaysShort: 'нед._пон._уто._сре._чет._пет._суб.'.split('_'), weekdaysMin: 'не_по_ут_ср_че_пе_су'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', L: 'DD.MM.YYYY', LL: 'D. MMMM YYYY', LLL: 'D. MMMM YYYY H:mm', LLLL: 'dddd, D. MMMM YYYY H:mm', }, calendar: { sameDay: '[данас у] LT', nextDay: '[сутра у] LT', nextWeek: function () { switch (this.day()) { case 0: return '[у] [недељу] [у] LT'; case 3: return '[у] [среду] [у] LT'; case 6: return '[у] [суботу] [у] LT'; case 1: case 2: case 4: case 5: return '[у] dddd [у] LT'; } }, lastDay: '[јуче у] LT', lastWeek: function () { var lastWeekDays = [ '[прошле] [недеље] [у] LT', '[прошлог] [понедељка] [у] LT', '[прошлог] [уторка] [у] LT', '[прошле] [среде] [у] LT', '[прошлог] [четвртка] [у] LT', '[прошлог] [петка] [у] LT', '[прошле] [суботе] [у] LT', ]; return lastWeekDays[this.day()]; }, sameElse: 'L', }, relativeTime: { future: 'за %s', past: 'пре %s', s: 'неколико секунди', ss: translator.translate, m: translator.translate, mm: translator.translate, h: translator.translate, hh: translator.translate, d: 'дан', dd: translator.translate, M: 'месец', MM: translator.translate, y: 'годину', yy: translator.translate, }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return srCyrl; }))); /***/ }), /* 1353 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : siSwati [ss] //! author : Nicolai Davies<mail@nicolai.io> : https://github.com/nicolaidavies ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var ss = moment.defineLocale('ss', { months: "Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split( '_' ), monthsShort: 'Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo'.split('_'), weekdays: 'Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo'.split( '_' ), weekdaysShort: 'Lis_Umb_Lsb_Les_Lsi_Lsh_Umg'.split('_'), weekdaysMin: 'Li_Us_Lb_Lt_Ls_Lh_Ug'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'h:mm A', LTS: 'h:mm:ss A', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY h:mm A', LLLL: 'dddd, D MMMM YYYY h:mm A', }, calendar: { sameDay: '[Namuhla nga] LT', nextDay: '[Kusasa nga] LT', nextWeek: 'dddd [nga] LT', lastDay: '[Itolo nga] LT', lastWeek: 'dddd [leliphelile] [nga] LT', sameElse: 'L', }, relativeTime: { future: 'nga %s', past: 'wenteka nga %s', s: 'emizuzwana lomcane', ss: '%d mzuzwana', m: 'umzuzu', mm: '%d emizuzu', h: 'lihora', hh: '%d emahora', d: 'lilanga', dd: '%d emalanga', M: 'inyanga', MM: '%d tinyanga', y: 'umnyaka', yy: '%d iminyaka', }, meridiemParse: /ekuseni|emini|entsambama|ebusuku/, meridiem: function (hours, minutes, isLower) { if (hours < 11) { return 'ekuseni'; } else if (hours < 15) { return 'emini'; } else if (hours < 19) { return 'entsambama'; } else { return 'ebusuku'; } }, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if (meridiem === 'ekuseni') { return hour; } else if (meridiem === 'emini') { return hour >= 11 ? hour : hour + 12; } else if (meridiem === 'entsambama' || meridiem === 'ebusuku') { if (hour === 0) { return 0; } return hour + 12; } }, dayOfMonthOrdinalParse: /\d{1,2}/, ordinal: '%d', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return ss; }))); /***/ }), /* 1354 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Swedish [sv] //! author : Jens Alm : https://github.com/ulmus ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var sv = moment.defineLocale('sv', { months: 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split( '_' ), monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'), weekdays: 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'), weekdaysShort: 'sön_mån_tis_ons_tor_fre_lör'.split('_'), weekdaysMin: 'sö_må_ti_on_to_fr_lö'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'YYYY-MM-DD', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY [kl.] HH:mm', LLLL: 'dddd D MMMM YYYY [kl.] HH:mm', lll: 'D MMM YYYY HH:mm', llll: 'ddd D MMM YYYY HH:mm', }, calendar: { sameDay: '[Idag] LT', nextDay: '[Imorgon] LT', lastDay: '[Igår] LT', nextWeek: '[På] dddd LT', lastWeek: '[I] dddd[s] LT', sameElse: 'L', }, relativeTime: { future: 'om %s', past: 'för %s sedan', s: 'några sekunder', ss: '%d sekunder', m: 'en minut', mm: '%d minuter', h: 'en timme', hh: '%d timmar', d: 'en dag', dd: '%d dagar', M: 'en månad', MM: '%d månader', y: 'ett år', yy: '%d år', }, dayOfMonthOrdinalParse: /\d{1,2}(\:e|\:a)/, ordinal: function (number) { var b = number % 10, output = ~~((number % 100) / 10) === 1 ? ':e' : b === 1 ? ':a' : b === 2 ? ':a' : b === 3 ? ':e' : ':e'; return number + output; }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return sv; }))); /***/ }), /* 1355 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Swahili [sw] //! author : Fahad Kassim : https://github.com/fadsel ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var sw = moment.defineLocale('sw', { months: 'Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba'.split( '_' ), monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des'.split('_'), weekdays: 'Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi'.split( '_' ), weekdaysShort: 'Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos'.split('_'), weekdaysMin: 'J2_J3_J4_J5_Al_Ij_J1'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD.MM.YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, calendar: { sameDay: '[leo saa] LT', nextDay: '[kesho saa] LT', nextWeek: '[wiki ijayo] dddd [saat] LT', lastDay: '[jana] LT', lastWeek: '[wiki iliyopita] dddd [saat] LT', sameElse: 'L', }, relativeTime: { future: '%s baadaye', past: 'tokea %s', s: 'hivi punde', ss: 'sekunde %d', m: 'dakika moja', mm: 'dakika %d', h: 'saa limoja', hh: 'masaa %d', d: 'siku moja', dd: 'masiku %d', M: 'mwezi mmoja', MM: 'miezi %d', y: 'mwaka mmoja', yy: 'miaka %d', }, week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return sw; }))); /***/ }), /* 1356 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Tamil [ta] //! author : Arjunkumar Krishnamoorthy : https://github.com/tk120404 ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var symbolMap = { '1': '௧', '2': '௨', '3': '௩', '4': '௪', '5': '௫', '6': '௬', '7': '௭', '8': '௮', '9': '௯', '0': '௦', }, numberMap = { '௧': '1', '௨': '2', '௩': '3', '௪': '4', '௫': '5', '௬': '6', '௭': '7', '௮': '8', '௯': '9', '௦': '0', }; var ta = moment.defineLocale('ta', { months: 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split( '_' ), monthsShort: 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split( '_' ), weekdays: 'ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை'.split( '_' ), weekdaysShort: 'ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி'.split( '_' ), weekdaysMin: 'ஞா_தி_செ_பு_வி_வெ_ச'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY, HH:mm', LLLL: 'dddd, D MMMM YYYY, HH:mm', }, calendar: { sameDay: '[இன்று] LT', nextDay: '[நாளை] LT', nextWeek: 'dddd, LT', lastDay: '[நேற்று] LT', lastWeek: '[கடந்த வாரம்] dddd, LT', sameElse: 'L', }, relativeTime: { future: '%s இல்', past: '%s முன்', s: 'ஒரு சில விநாடிகள்', ss: '%d விநாடிகள்', m: 'ஒரு நிமிடம்', mm: '%d நிமிடங்கள்', h: 'ஒரு மணி நேரம்', hh: '%d மணி நேரம்', d: 'ஒரு நாள்', dd: '%d நாட்கள்', M: 'ஒரு மாதம்', MM: '%d மாதங்கள்', y: 'ஒரு வருடம்', yy: '%d ஆண்டுகள்', }, dayOfMonthOrdinalParse: /\d{1,2}வது/, ordinal: function (number) { return number + 'வது'; }, preparse: function (string) { return string.replace(/[௧௨௩௪௫௬௭௮௯௦]/g, function (match) { return numberMap[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { return symbolMap[match]; }); }, // refer http://ta.wikipedia.org/s/1er1 meridiemParse: /யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/, meridiem: function (hour, minute, isLower) { if (hour < 2) { return ' யாமம்'; } else if (hour < 6) { return ' வைகறை'; // வைகறை } else if (hour < 10) { return ' காலை'; // காலை } else if (hour < 14) { return ' நண்பகல்'; // நண்பகல் } else if (hour < 18) { return ' எற்பாடு'; // எற்பாடு } else if (hour < 22) { return ' மாலை'; // மாலை } else { return ' யாமம்'; } }, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if (meridiem === 'யாமம்') { return hour < 2 ? hour : hour + 12; } else if (meridiem === 'வைகறை' || meridiem === 'காலை') { return hour; } else if (meridiem === 'நண்பகல்') { return hour >= 10 ? hour : hour + 12; } else { return hour + 12; } }, week: { dow: 0, // Sunday is the first day of the week. doy: 6, // The week that contains Jan 6th is the first week of the year. }, }); return ta; }))); /***/ }), /* 1357 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Telugu [te] //! author : Krishna Chaitanya Thota : https://github.com/kcthota ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var te = moment.defineLocale('te', { months: 'జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్'.split( '_' ), monthsShort: 'జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.'.split( '_' ), monthsParseExact: true, weekdays: 'ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం'.split( '_' ), weekdaysShort: 'ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని'.split('_'), weekdaysMin: 'ఆ_సో_మం_బు_గు_శు_శ'.split('_'), longDateFormat: { LT: 'A h:mm', LTS: 'A h:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY, A h:mm', LLLL: 'dddd, D MMMM YYYY, A h:mm', }, calendar: { sameDay: '[నేడు] LT', nextDay: '[రేపు] LT', nextWeek: 'dddd, LT', lastDay: '[నిన్న] LT', lastWeek: '[గత] dddd, LT', sameElse: 'L', }, relativeTime: { future: '%s లో', past: '%s క్రితం', s: 'కొన్ని క్షణాలు', ss: '%d సెకన్లు', m: 'ఒక నిమిషం', mm: '%d నిమిషాలు', h: 'ఒక గంట', hh: '%d గంటలు', d: 'ఒక రోజు', dd: '%d రోజులు', M: 'ఒక నెల', MM: '%d నెలలు', y: 'ఒక సంవత్సరం', yy: '%d సంవత్సరాలు', }, dayOfMonthOrdinalParse: /\d{1,2}వ/, ordinal: '%dవ', meridiemParse: /రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if (meridiem === 'రాత్రి') { return hour < 4 ? hour : hour + 12; } else if (meridiem === 'ఉదయం') { return hour; } else if (meridiem === 'మధ్యాహ్నం') { return hour >= 10 ? hour : hour + 12; } else if (meridiem === 'సాయంత్రం') { return hour + 12; } }, meridiem: function (hour, minute, isLower) { if (hour < 4) { return 'రాత్రి'; } else if (hour < 10) { return 'ఉదయం'; } else if (hour < 17) { return 'మధ్యాహ్నం'; } else if (hour < 20) { return 'సాయంత్రం'; } else { return 'రాత్రి'; } }, week: { dow: 0, // Sunday is the first day of the week. doy: 6, // The week that contains Jan 6th is the first week of the year. }, }); return te; }))); /***/ }), /* 1358 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Tetun Dili (East Timor) [tet] //! author : Joshua Brooks : https://github.com/joshbrooks //! author : Onorio De J. Afonso : https://github.com/marobo //! author : Sonia Simoes : https://github.com/soniasimoes ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var tet = moment.defineLocale('tet', { months: 'Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru'.split( '_' ), monthsShort: 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'), weekdays: 'Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu'.split('_'), weekdaysShort: 'Dom_Seg_Ters_Kua_Kint_Sest_Sab'.split('_'), weekdaysMin: 'Do_Seg_Te_Ku_Ki_Ses_Sa'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, calendar: { sameDay: '[Ohin iha] LT', nextDay: '[Aban iha] LT', nextWeek: 'dddd [iha] LT', lastDay: '[Horiseik iha] LT', lastWeek: 'dddd [semana kotuk] [iha] LT', sameElse: 'L', }, relativeTime: { future: 'iha %s', past: '%s liuba', s: 'segundu balun', ss: 'segundu %d', m: 'minutu ida', mm: 'minutu %d', h: 'oras ida', hh: 'oras %d', d: 'loron ida', dd: 'loron %d', M: 'fulan ida', MM: 'fulan %d', y: 'tinan ida', yy: 'tinan %d', }, dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/, ordinal: function (number) { var b = number % 10, output = ~~((number % 100) / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th'; return number + output; }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return tet; }))); /***/ }), /* 1359 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Tajik [tg] //! author : Orif N. Jr. : https://github.com/orif-jr ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var suffixes = { 0: '-ум', 1: '-ум', 2: '-юм', 3: '-юм', 4: '-ум', 5: '-ум', 6: '-ум', 7: '-ум', 8: '-ум', 9: '-ум', 10: '-ум', 12: '-ум', 13: '-ум', 20: '-ум', 30: '-юм', 40: '-ум', 50: '-ум', 60: '-ум', 70: '-ум', 80: '-ум', 90: '-ум', 100: '-ум', }; var tg = moment.defineLocale('tg', { months: 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split( '_' ), monthsShort: 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'), weekdays: 'якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе'.split( '_' ), weekdaysShort: 'яшб_дшб_сшб_чшб_пшб_ҷум_шнб'.split('_'), weekdaysMin: 'яш_дш_сш_чш_пш_ҷм_шб'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, calendar: { sameDay: '[Имрӯз соати] LT', nextDay: '[Пагоҳ соати] LT', lastDay: '[Дирӯз соати] LT', nextWeek: 'dddd[и] [ҳафтаи оянда соати] LT', lastWeek: 'dddd[и] [ҳафтаи гузашта соати] LT', sameElse: 'L', }, relativeTime: { future: 'баъди %s', past: '%s пеш', s: 'якчанд сония', m: 'як дақиқа', mm: '%d дақиқа', h: 'як соат', hh: '%d соат', d: 'як рӯз', dd: '%d рӯз', M: 'як моҳ', MM: '%d моҳ', y: 'як сол', yy: '%d сол', }, meridiemParse: /шаб|субҳ|рӯз|бегоҳ/, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if (meridiem === 'шаб') { return hour < 4 ? hour : hour + 12; } else if (meridiem === 'субҳ') { return hour; } else if (meridiem === 'рӯз') { return hour >= 11 ? hour : hour + 12; } else if (meridiem === 'бегоҳ') { return hour + 12; } }, meridiem: function (hour, minute, isLower) { if (hour < 4) { return 'шаб'; } else if (hour < 11) { return 'субҳ'; } else if (hour < 16) { return 'рӯз'; } else if (hour < 19) { return 'бегоҳ'; } else { return 'шаб'; } }, dayOfMonthOrdinalParse: /\d{1,2}-(ум|юм)/, ordinal: function (number) { var a = number % 10, b = number >= 100 ? 100 : null; return number + (suffixes[number] || suffixes[a] || suffixes[b]); }, week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 1th is the first week of the year. }, }); return tg; }))); /***/ }), /* 1360 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Thai [th] //! author : Kridsada Thanabulpong : https://github.com/sirn ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var th = moment.defineLocale('th', { months: 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split( '_' ), monthsShort: 'ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.'.split( '_' ), monthsParseExact: true, weekdays: 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์'.split('_'), weekdaysShort: 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์'.split('_'), // yes, three characters difference weekdaysMin: 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY เวลา H:mm', LLLL: 'วันddddที่ D MMMM YYYY เวลา H:mm', }, meridiemParse: /ก่อนเที่ยง|หลังเที่ยง/, isPM: function (input) { return input === 'หลังเที่ยง'; }, meridiem: function (hour, minute, isLower) { if (hour < 12) { return 'ก่อนเที่ยง'; } else { return 'หลังเที่ยง'; } }, calendar: { sameDay: '[วันนี้ เวลา] LT', nextDay: '[พรุ่งนี้ เวลา] LT', nextWeek: 'dddd[หน้า เวลา] LT', lastDay: '[เมื่อวานนี้ เวลา] LT', lastWeek: '[วัน]dddd[ที่แล้ว เวลา] LT', sameElse: 'L', }, relativeTime: { future: 'อีก %s', past: '%sที่แล้ว', s: 'ไม่กี่วินาที', ss: '%d วินาที', m: '1 นาที', mm: '%d นาที', h: '1 ชั่วโมง', hh: '%d ชั่วโมง', d: '1 วัน', dd: '%d วัน', M: '1 เดือน', MM: '%d เดือน', y: '1 ปี', yy: '%d ปี', }, }); return th; }))); /***/ }), /* 1361 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Tagalog (Philippines) [tl-ph] //! author : Dan Hagman : https://github.com/hagmandan ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var tlPh = moment.defineLocale('tl-ph', { months: 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split( '_' ), monthsShort: 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'), weekdays: 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split( '_' ), weekdaysShort: 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'), weekdaysMin: 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'MM/D/YYYY', LL: 'MMMM D, YYYY', LLL: 'MMMM D, YYYY HH:mm', LLLL: 'dddd, MMMM DD, YYYY HH:mm', }, calendar: { sameDay: 'LT [ngayong araw]', nextDay: '[Bukas ng] LT', nextWeek: 'LT [sa susunod na] dddd', lastDay: 'LT [kahapon]', lastWeek: 'LT [noong nakaraang] dddd', sameElse: 'L', }, relativeTime: { future: 'sa loob ng %s', past: '%s ang nakalipas', s: 'ilang segundo', ss: '%d segundo', m: 'isang minuto', mm: '%d minuto', h: 'isang oras', hh: '%d oras', d: 'isang araw', dd: '%d araw', M: 'isang buwan', MM: '%d buwan', y: 'isang taon', yy: '%d taon', }, dayOfMonthOrdinalParse: /\d{1,2}/, ordinal: function (number) { return number; }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return tlPh; }))); /***/ }), /* 1362 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Klingon [tlh] //! author : Dominika Kruk : https://github.com/amaranthrose ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var numbersNouns = 'pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut'.split('_'); function translateFuture(output) { var time = output; time = output.indexOf('jaj') !== -1 ? time.slice(0, -3) + 'leS' : output.indexOf('jar') !== -1 ? time.slice(0, -3) + 'waQ' : output.indexOf('DIS') !== -1 ? time.slice(0, -3) + 'nem' : time + ' pIq'; return time; } function translatePast(output) { var time = output; time = output.indexOf('jaj') !== -1 ? time.slice(0, -3) + 'Hu’' : output.indexOf('jar') !== -1 ? time.slice(0, -3) + 'wen' : output.indexOf('DIS') !== -1 ? time.slice(0, -3) + 'ben' : time + ' ret'; return time; } function translate(number, withoutSuffix, string, isFuture) { var numberNoun = numberAsNoun(number); switch (string) { case 'ss': return numberNoun + ' lup'; case 'mm': return numberNoun + ' tup'; case 'hh': return numberNoun + ' rep'; case 'dd': return numberNoun + ' jaj'; case 'MM': return numberNoun + ' jar'; case 'yy': return numberNoun + ' DIS'; } } function numberAsNoun(number) { var hundred = Math.floor((number % 1000) / 100), ten = Math.floor((number % 100) / 10), one = number % 10, word = ''; if (hundred > 0) { word += numbersNouns[hundred] + 'vatlh'; } if (ten > 0) { word += (word !== '' ? ' ' : '') + numbersNouns[ten] + 'maH'; } if (one > 0) { word += (word !== '' ? ' ' : '') + numbersNouns[one]; } return word === '' ? 'pagh' : word; } var tlh = moment.defineLocale('tlh', { months: 'tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’'.split( '_' ), monthsShort: 'jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’'.split( '_' ), monthsParseExact: true, weekdays: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split( '_' ), weekdaysShort: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split( '_' ), weekdaysMin: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split( '_' ), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD.MM.YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, calendar: { sameDay: '[DaHjaj] LT', nextDay: '[wa’leS] LT', nextWeek: 'LLL', lastDay: '[wa’Hu’] LT', lastWeek: 'LLL', sameElse: 'L', }, relativeTime: { future: translateFuture, past: translatePast, s: 'puS lup', ss: translate, m: 'wa’ tup', mm: translate, h: 'wa’ rep', hh: translate, d: 'wa’ jaj', dd: translate, M: 'wa’ jar', MM: translate, y: 'wa’ DIS', yy: translate, }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return tlh; }))); /***/ }), /* 1363 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Turkish [tr] //! authors : Erhan Gundogan : https://github.com/erhangundogan, //! Burak Yiğit Kaya: https://github.com/BYK ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var suffixes = { 1: "'inci", 5: "'inci", 8: "'inci", 70: "'inci", 80: "'inci", 2: "'nci", 7: "'nci", 20: "'nci", 50: "'nci", 3: "'üncü", 4: "'üncü", 100: "'üncü", 6: "'ncı", 9: "'uncu", 10: "'uncu", 30: "'uncu", 60: "'ıncı", 90: "'ıncı", }; var tr = moment.defineLocale('tr', { months: 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split( '_' ), monthsShort: 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split('_'), weekdays: 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split( '_' ), weekdaysShort: 'Paz_Pts_Sal_Çar_Per_Cum_Cts'.split('_'), weekdaysMin: 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD.MM.YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, calendar: { sameDay: '[bugün saat] LT', nextDay: '[yarın saat] LT', nextWeek: '[gelecek] dddd [saat] LT', lastDay: '[dün] LT', lastWeek: '[geçen] dddd [saat] LT', sameElse: 'L', }, relativeTime: { future: '%s sonra', past: '%s önce', s: 'birkaç saniye', ss: '%d saniye', m: 'bir dakika', mm: '%d dakika', h: 'bir saat', hh: '%d saat', d: 'bir gün', dd: '%d gün', M: 'bir ay', MM: '%d ay', y: 'bir yıl', yy: '%d yıl', }, ordinal: function (number, period) { switch (period) { case 'd': case 'D': case 'Do': case 'DD': return number; default: if (number === 0) { // special case for zero return number + "'ıncı"; } var a = number % 10, b = (number % 100) - a, c = number >= 100 ? 100 : null; return number + (suffixes[a] || suffixes[b] || suffixes[c]); } }, week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return tr; }))); /***/ }), /* 1364 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Talossan [tzl] //! author : Robin van der Vliet : https://github.com/robin0van0der0v //! author : Iustì Canun ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration // After the year there should be a slash and the amount of years since December 26, 1979 in Roman numerals. // This is currently too difficult (maybe even impossible) to add. var tzl = moment.defineLocale('tzl', { months: 'Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar'.split( '_' ), monthsShort: 'Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec'.split('_'), weekdays: 'Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi'.split('_'), weekdaysShort: 'Súl_Lún_Mai_Már_Xhú_Vié_Sát'.split('_'), weekdaysMin: 'Sú_Lú_Ma_Má_Xh_Vi_Sá'.split('_'), longDateFormat: { LT: 'HH.mm', LTS: 'HH.mm.ss', L: 'DD.MM.YYYY', LL: 'D. MMMM [dallas] YYYY', LLL: 'D. MMMM [dallas] YYYY HH.mm', LLLL: 'dddd, [li] D. MMMM [dallas] YYYY HH.mm', }, meridiemParse: /d\'o|d\'a/i, isPM: function (input) { return "d'o" === input.toLowerCase(); }, meridiem: function (hours, minutes, isLower) { if (hours > 11) { return isLower ? "d'o" : "D'O"; } else { return isLower ? "d'a" : "D'A"; } }, calendar: { sameDay: '[oxhi à] LT', nextDay: '[demà à] LT', nextWeek: 'dddd [à] LT', lastDay: '[ieiri à] LT', lastWeek: '[sür el] dddd [lasteu à] LT', sameElse: 'L', }, relativeTime: { future: 'osprei %s', past: 'ja%s', s: processRelativeTime, ss: processRelativeTime, m: processRelativeTime, mm: processRelativeTime, h: processRelativeTime, hh: processRelativeTime, d: processRelativeTime, dd: processRelativeTime, M: processRelativeTime, MM: processRelativeTime, y: processRelativeTime, yy: processRelativeTime, }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); function processRelativeTime(number, withoutSuffix, key, isFuture) { var format = { s: ['viensas secunds', "'iensas secunds"], ss: [number + ' secunds', '' + number + ' secunds'], m: ["'n míut", "'iens míut"], mm: [number + ' míuts', '' + number + ' míuts'], h: ["'n þora", "'iensa þora"], hh: [number + ' þoras', '' + number + ' þoras'], d: ["'n ziua", "'iensa ziua"], dd: [number + ' ziuas', '' + number + ' ziuas'], M: ["'n mes", "'iens mes"], MM: [number + ' mesen', '' + number + ' mesen'], y: ["'n ar", "'iens ar"], yy: [number + ' ars', '' + number + ' ars'], }; return isFuture ? format[key][0] : withoutSuffix ? format[key][0] : format[key][1]; } return tzl; }))); /***/ }), /* 1365 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Central Atlas Tamazight [tzm] //! author : Abdel Said : https://github.com/abdelsaid ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var tzm = moment.defineLocale('tzm', { months: 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split( '_' ), monthsShort: 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split( '_' ), weekdays: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'), weekdaysShort: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'), weekdaysMin: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd D MMMM YYYY HH:mm', }, calendar: { sameDay: '[ⴰⵙⴷⵅ ⴴ] LT', nextDay: '[ⴰⵙⴽⴰ ⴴ] LT', nextWeek: 'dddd [ⴴ] LT', lastDay: '[ⴰⵚⴰⵏⵜ ⴴ] LT', lastWeek: 'dddd [ⴴ] LT', sameElse: 'L', }, relativeTime: { future: 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s', past: 'ⵢⴰⵏ %s', s: 'ⵉⵎⵉⴽ', ss: '%d ⵉⵎⵉⴽ', m: 'ⵎⵉⵏⵓⴺ', mm: '%d ⵎⵉⵏⵓⴺ', h: 'ⵙⴰⵄⴰ', hh: '%d ⵜⴰⵙⵙⴰⵄⵉⵏ', d: 'ⴰⵙⵙ', dd: '%d oⵙⵙⴰⵏ', M: 'ⴰⵢoⵓⵔ', MM: '%d ⵉⵢⵢⵉⵔⵏ', y: 'ⴰⵙⴳⴰⵙ', yy: '%d ⵉⵙⴳⴰⵙⵏ', }, week: { dow: 6, // Saturday is the first day of the week. doy: 12, // The week that contains Jan 12th is the first week of the year. }, }); return tzm; }))); /***/ }), /* 1366 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Central Atlas Tamazight Latin [tzm-latn] //! author : Abdel Said : https://github.com/abdelsaid ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var tzmLatn = moment.defineLocale('tzm-latn', { months: 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split( '_' ), monthsShort: 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split( '_' ), weekdays: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'), weekdaysShort: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'), weekdaysMin: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd D MMMM YYYY HH:mm', }, calendar: { sameDay: '[asdkh g] LT', nextDay: '[aska g] LT', nextWeek: 'dddd [g] LT', lastDay: '[assant g] LT', lastWeek: 'dddd [g] LT', sameElse: 'L', }, relativeTime: { future: 'dadkh s yan %s', past: 'yan %s', s: 'imik', ss: '%d imik', m: 'minuḍ', mm: '%d minuḍ', h: 'saɛa', hh: '%d tassaɛin', d: 'ass', dd: '%d ossan', M: 'ayowr', MM: '%d iyyirn', y: 'asgas', yy: '%d isgasn', }, week: { dow: 6, // Saturday is the first day of the week. doy: 12, // The week that contains Jan 12th is the first week of the year. }, }); return tzmLatn; }))); /***/ }), /* 1367 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js language configuration //! locale : Uyghur (China) [ug-cn] //! author: boyaq : https://github.com/boyaq ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js language configuration var ugCn = moment.defineLocale('ug-cn', { months: 'يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر'.split( '_' ), monthsShort: 'يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر'.split( '_' ), weekdays: 'يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە'.split( '_' ), weekdaysShort: 'يە_دۈ_سە_چا_پە_جۈ_شە'.split('_'), weekdaysMin: 'يە_دۈ_سە_چا_پە_جۈ_شە'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'YYYY-MM-DD', LL: 'YYYY-يىلىM-ئاينىڭD-كۈنى', LLL: 'YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm', LLLL: 'dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm', }, meridiemParse: /يېرىم كېچە|سەھەر|چۈشتىن بۇرۇن|چۈش|چۈشتىن كېيىن|كەچ/, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if ( meridiem === 'يېرىم كېچە' || meridiem === 'سەھەر' || meridiem === 'چۈشتىن بۇرۇن' ) { return hour; } else if (meridiem === 'چۈشتىن كېيىن' || meridiem === 'كەچ') { return hour + 12; } else { return hour >= 11 ? hour : hour + 12; } }, meridiem: function (hour, minute, isLower) { var hm = hour * 100 + minute; if (hm < 600) { return 'يېرىم كېچە'; } else if (hm < 900) { return 'سەھەر'; } else if (hm < 1130) { return 'چۈشتىن بۇرۇن'; } else if (hm < 1230) { return 'چۈش'; } else if (hm < 1800) { return 'چۈشتىن كېيىن'; } else { return 'كەچ'; } }, calendar: { sameDay: '[بۈگۈن سائەت] LT', nextDay: '[ئەتە سائەت] LT', nextWeek: '[كېلەركى] dddd [سائەت] LT', lastDay: '[تۆنۈگۈن] LT', lastWeek: '[ئالدىنقى] dddd [سائەت] LT', sameElse: 'L', }, relativeTime: { future: '%s كېيىن', past: '%s بۇرۇن', s: 'نەچچە سېكونت', ss: '%d سېكونت', m: 'بىر مىنۇت', mm: '%d مىنۇت', h: 'بىر سائەت', hh: '%d سائەت', d: 'بىر كۈن', dd: '%d كۈن', M: 'بىر ئاي', MM: '%d ئاي', y: 'بىر يىل', yy: '%d يىل', }, dayOfMonthOrdinalParse: /\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/, ordinal: function (number, period) { switch (period) { case 'd': case 'D': case 'DDD': return number + '-كۈنى'; case 'w': case 'W': return number + '-ھەپتە'; default: return number; } }, preparse: function (string) { return string.replace(/،/g, ','); }, postformat: function (string) { return string.replace(/,/g, '،'); }, week: { // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效 dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 1st is the first week of the year. }, }); return ugCn; }))); /***/ }), /* 1368 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Ukrainian [uk] //! author : zemlanin : https://github.com/zemlanin //! Author : Menelion Elensúle : https://github.com/Oire ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration function plural(word, num) { var forms = word.split('_'); return num % 10 === 1 && num % 100 !== 11 ? forms[0] : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]; } function relativeTimeWithPlural(number, withoutSuffix, key) { var format = { ss: withoutSuffix ? 'секунда_секунди_секунд' : 'секунду_секунди_секунд', mm: withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин', hh: withoutSuffix ? 'година_години_годин' : 'годину_години_годин', dd: 'день_дні_днів', MM: 'місяць_місяці_місяців', yy: 'рік_роки_років', }; if (key === 'm') { return withoutSuffix ? 'хвилина' : 'хвилину'; } else if (key === 'h') { return withoutSuffix ? 'година' : 'годину'; } else { return number + ' ' + plural(format[key], +number); } } function weekdaysCaseReplace(m, format) { var weekdays = { nominative: 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split( '_' ), accusative: 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split( '_' ), genitive: 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split( '_' ), }, nounCase; if (m === true) { return weekdays['nominative'] .slice(1, 7) .concat(weekdays['nominative'].slice(0, 1)); } if (!m) { return weekdays['nominative']; } nounCase = /(\[[ВвУу]\]) ?dddd/.test(format) ? 'accusative' : /\[?(?:минулої|наступної)? ?\] ?dddd/.test(format) ? 'genitive' : 'nominative'; return weekdays[nounCase][m.day()]; } function processHoursFunction(str) { return function () { return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT'; }; } var uk = moment.defineLocale('uk', { months: { format: 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split( '_' ), standalone: 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split( '_' ), }, monthsShort: 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split( '_' ), weekdays: weekdaysCaseReplace, weekdaysShort: 'нд_пн_вт_ср_чт_пт_сб'.split('_'), weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD.MM.YYYY', LL: 'D MMMM YYYY р.', LLL: 'D MMMM YYYY р., HH:mm', LLLL: 'dddd, D MMMM YYYY р., HH:mm', }, calendar: { sameDay: processHoursFunction('[Сьогодні '), nextDay: processHoursFunction('[Завтра '), lastDay: processHoursFunction('[Вчора '), nextWeek: processHoursFunction('[У] dddd ['), lastWeek: function () { switch (this.day()) { case 0: case 3: case 5: case 6: return processHoursFunction('[Минулої] dddd [').call(this); case 1: case 2: case 4: return processHoursFunction('[Минулого] dddd [').call(this); } }, sameElse: 'L', }, relativeTime: { future: 'за %s', past: '%s тому', s: 'декілька секунд', ss: relativeTimeWithPlural, m: relativeTimeWithPlural, mm: relativeTimeWithPlural, h: 'годину', hh: relativeTimeWithPlural, d: 'день', dd: relativeTimeWithPlural, M: 'місяць', MM: relativeTimeWithPlural, y: 'рік', yy: relativeTimeWithPlural, }, // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason meridiemParse: /ночі|ранку|дня|вечора/, isPM: function (input) { return /^(дня|вечора)$/.test(input); }, meridiem: function (hour, minute, isLower) { if (hour < 4) { return 'ночі'; } else if (hour < 12) { return 'ранку'; } else if (hour < 17) { return 'дня'; } else { return 'вечора'; } }, dayOfMonthOrdinalParse: /\d{1,2}-(й|го)/, ordinal: function (number, period) { switch (period) { case 'M': case 'd': case 'DDD': case 'w': case 'W': return number + '-й'; case 'D': return number + '-го'; default: return number; } }, week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return uk; }))); /***/ }), /* 1369 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Urdu [ur] //! author : Sawood Alam : https://github.com/ibnesayeed //! author : Zack : https://github.com/ZackVision ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var months = [ 'جنوری', 'فروری', 'مارچ', 'اپریل', 'مئی', 'جون', 'جولائی', 'اگست', 'ستمبر', 'اکتوبر', 'نومبر', 'دسمبر', ], days = ['اتوار', 'پیر', 'منگل', 'بدھ', 'جمعرات', 'جمعہ', 'ہفتہ']; var ur = moment.defineLocale('ur', { months: months, monthsShort: months, weekdays: days, weekdaysShort: days, weekdaysMin: days, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd، D MMMM YYYY HH:mm', }, meridiemParse: /صبح|شام/, isPM: function (input) { return 'شام' === input; }, meridiem: function (hour, minute, isLower) { if (hour < 12) { return 'صبح'; } return 'شام'; }, calendar: { sameDay: '[آج بوقت] LT', nextDay: '[کل بوقت] LT', nextWeek: 'dddd [بوقت] LT', lastDay: '[گذشتہ روز بوقت] LT', lastWeek: '[گذشتہ] dddd [بوقت] LT', sameElse: 'L', }, relativeTime: { future: '%s بعد', past: '%s قبل', s: 'چند سیکنڈ', ss: '%d سیکنڈ', m: 'ایک منٹ', mm: '%d منٹ', h: 'ایک گھنٹہ', hh: '%d گھنٹے', d: 'ایک دن', dd: '%d دن', M: 'ایک ماہ', MM: '%d ماہ', y: 'ایک سال', yy: '%d سال', }, preparse: function (string) { return string.replace(/،/g, ','); }, postformat: function (string) { return string.replace(/,/g, '،'); }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return ur; }))); /***/ }), /* 1370 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Uzbek [uz] //! author : Sardor Muminov : https://github.com/muminoff ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var uz = moment.defineLocale('uz', { months: 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split( '_' ), monthsShort: 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'), weekdays: 'Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба'.split('_'), weekdaysShort: 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'), weekdaysMin: 'Як_Ду_Се_Чо_Па_Жу_Ша'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'D MMMM YYYY, dddd HH:mm', }, calendar: { sameDay: '[Бугун соат] LT [да]', nextDay: '[Эртага] LT [да]', nextWeek: 'dddd [куни соат] LT [да]', lastDay: '[Кеча соат] LT [да]', lastWeek: '[Утган] dddd [куни соат] LT [да]', sameElse: 'L', }, relativeTime: { future: 'Якин %s ичида', past: 'Бир неча %s олдин', s: 'фурсат', ss: '%d фурсат', m: 'бир дакика', mm: '%d дакика', h: 'бир соат', hh: '%d соат', d: 'бир кун', dd: '%d кун', M: 'бир ой', MM: '%d ой', y: 'бир йил', yy: '%d йил', }, week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 4th is the first week of the year. }, }); return uz; }))); /***/ }), /* 1371 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Uzbek Latin [uz-latn] //! author : Rasulbek Mirzayev : github.com/Rasulbeeek ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var uzLatn = moment.defineLocale('uz-latn', { months: 'Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr'.split( '_' ), monthsShort: 'Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek'.split('_'), weekdays: 'Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba'.split( '_' ), weekdaysShort: 'Yak_Dush_Sesh_Chor_Pay_Jum_Shan'.split('_'), weekdaysMin: 'Ya_Du_Se_Cho_Pa_Ju_Sha'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'D MMMM YYYY, dddd HH:mm', }, calendar: { sameDay: '[Bugun soat] LT [da]', nextDay: '[Ertaga] LT [da]', nextWeek: 'dddd [kuni soat] LT [da]', lastDay: '[Kecha soat] LT [da]', lastWeek: "[O'tgan] dddd [kuni soat] LT [da]", sameElse: 'L', }, relativeTime: { future: 'Yaqin %s ichida', past: 'Bir necha %s oldin', s: 'soniya', ss: '%d soniya', m: 'bir daqiqa', mm: '%d daqiqa', h: 'bir soat', hh: '%d soat', d: 'bir kun', dd: '%d kun', M: 'bir oy', MM: '%d oy', y: 'bir yil', yy: '%d yil', }, week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return uzLatn; }))); /***/ }), /* 1372 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Vietnamese [vi] //! author : Bang Nguyen : https://github.com/bangnk //! author : Chien Kira : https://github.com/chienkira ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var vi = moment.defineLocale('vi', { months: 'tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12'.split( '_' ), monthsShort: 'Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12'.split( '_' ), monthsParseExact: true, weekdays: 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split( '_' ), weekdaysShort: 'CN_T2_T3_T4_T5_T6_T7'.split('_'), weekdaysMin: 'CN_T2_T3_T4_T5_T6_T7'.split('_'), weekdaysParseExact: true, meridiemParse: /sa|ch/i, isPM: function (input) { return /^ch$/i.test(input); }, meridiem: function (hours, minutes, isLower) { if (hours < 12) { return isLower ? 'sa' : 'SA'; } else { return isLower ? 'ch' : 'CH'; } }, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM [năm] YYYY', LLL: 'D MMMM [năm] YYYY HH:mm', LLLL: 'dddd, D MMMM [năm] YYYY HH:mm', l: 'DD/M/YYYY', ll: 'D MMM YYYY', lll: 'D MMM YYYY HH:mm', llll: 'ddd, D MMM YYYY HH:mm', }, calendar: { sameDay: '[Hôm nay lúc] LT', nextDay: '[Ngày mai lúc] LT', nextWeek: 'dddd [tuần tới lúc] LT', lastDay: '[Hôm qua lúc] LT', lastWeek: 'dddd [tuần trước lúc] LT', sameElse: 'L', }, relativeTime: { future: '%s tới', past: '%s trước', s: 'vài giây', ss: '%d giây', m: 'một phút', mm: '%d phút', h: 'một giờ', hh: '%d giờ', d: 'một ngày', dd: '%d ngày', M: 'một tháng', MM: '%d tháng', y: 'một năm', yy: '%d năm', }, dayOfMonthOrdinalParse: /\d{1,2}/, ordinal: function (number) { return number; }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return vi; }))); /***/ }), /* 1373 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Pseudo [x-pseudo] //! author : Andrew Hood : https://github.com/andrewhood125 ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var xPseudo = moment.defineLocale('x-pseudo', { months: 'J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér'.split( '_' ), monthsShort: 'J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc'.split( '_' ), monthsParseExact: true, weekdays: 'S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý'.split( '_' ), weekdaysShort: 'S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát'.split('_'), weekdaysMin: 'S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, calendar: { sameDay: '[T~ódá~ý át] LT', nextDay: '[T~ómó~rró~w át] LT', nextWeek: 'dddd [át] LT', lastDay: '[Ý~ést~érdá~ý át] LT', lastWeek: '[L~ást] dddd [át] LT', sameElse: 'L', }, relativeTime: { future: 'í~ñ %s', past: '%s á~gó', s: 'á ~féw ~sécó~ñds', ss: '%d s~écóñ~ds', m: 'á ~míñ~úté', mm: '%d m~íñú~tés', h: 'á~ñ hó~úr', hh: '%d h~óúrs', d: 'á ~dáý', dd: '%d d~áýs', M: 'á ~móñ~th', MM: '%d m~óñt~hs', y: 'á ~ýéár', yy: '%d ý~éárs', }, dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/, ordinal: function (number) { var b = number % 10, output = ~~((number % 100) / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th'; return number + output; }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return xPseudo; }))); /***/ }), /* 1374 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Yoruba Nigeria [yo] //! author : Atolagbe Abisoye : https://github.com/andela-batolagbe ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var yo = moment.defineLocale('yo', { months: 'Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀'.split( '_' ), monthsShort: 'Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀'.split('_'), weekdays: 'Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta'.split('_'), weekdaysShort: 'Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá'.split('_'), weekdaysMin: 'Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb'.split('_'), longDateFormat: { LT: 'h:mm A', LTS: 'h:mm:ss A', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY h:mm A', LLLL: 'dddd, D MMMM YYYY h:mm A', }, calendar: { sameDay: '[Ònì ni] LT', nextDay: '[Ọ̀la ni] LT', nextWeek: "dddd [Ọsẹ̀ tón'bọ] [ni] LT", lastDay: '[Àna ni] LT', lastWeek: 'dddd [Ọsẹ̀ tólọ́] [ni] LT', sameElse: 'L', }, relativeTime: { future: 'ní %s', past: '%s kọjá', s: 'ìsẹjú aayá die', ss: 'aayá %d', m: 'ìsẹjú kan', mm: 'ìsẹjú %d', h: 'wákati kan', hh: 'wákati %d', d: 'ọjọ́ kan', dd: 'ọjọ́ %d', M: 'osù kan', MM: 'osù %d', y: 'ọdún kan', yy: 'ọdún %d', }, dayOfMonthOrdinalParse: /ọjọ́\s\d{1,2}/, ordinal: 'ọjọ́ %d', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return yo; }))); /***/ }), /* 1375 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Chinese (China) [zh-cn] //! author : suupic : https://github.com/suupic //! author : Zeno Zeng : https://github.com/zenozeng ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var zhCn = moment.defineLocale('zh-cn', { months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split( '_' ), monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split( '_' ), weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'), weekdaysShort: '周日_周一_周二_周三_周四_周五_周六'.split('_'), weekdaysMin: '日_一_二_三_四_五_六'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'YYYY/MM/DD', LL: 'YYYY年M月D日', LLL: 'YYYY年M月D日Ah点mm分', LLLL: 'YYYY年M月D日ddddAh点mm分', l: 'YYYY/M/D', ll: 'YYYY年M月D日', lll: 'YYYY年M月D日 HH:mm', llll: 'YYYY年M月D日dddd HH:mm', }, meridiemParse: /凌晨|早上|上午|中午|下午|晚上/, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') { return hour; } else if (meridiem === '下午' || meridiem === '晚上') { return hour + 12; } else { // '中午' return hour >= 11 ? hour : hour + 12; } }, meridiem: function (hour, minute, isLower) { var hm = hour * 100 + minute; if (hm < 600) { return '凌晨'; } else if (hm < 900) { return '早上'; } else if (hm < 1130) { return '上午'; } else if (hm < 1230) { return '中午'; } else if (hm < 1800) { return '下午'; } else { return '晚上'; } }, calendar: { sameDay: '[今天]LT', nextDay: '[明天]LT', nextWeek: '[下]ddddLT', lastDay: '[昨天]LT', lastWeek: '[上]ddddLT', sameElse: 'L', }, dayOfMonthOrdinalParse: /\d{1,2}(日|月|周)/, ordinal: function (number, period) { switch (period) { case 'd': case 'D': case 'DDD': return number + '日'; case 'M': return number + '月'; case 'w': case 'W': return number + '周'; default: return number; } }, relativeTime: { future: '%s后', past: '%s前', s: '几秒', ss: '%d 秒', m: '1 分钟', mm: '%d 分钟', h: '1 小时', hh: '%d 小时', d: '1 天', dd: '%d 天', M: '1 个月', MM: '%d 个月', y: '1 年', yy: '%d 年', }, week: { // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效 dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return zhCn; }))); /***/ }), /* 1376 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Chinese (Hong Kong) [zh-hk] //! author : Ben : https://github.com/ben-lin //! author : Chris Lam : https://github.com/hehachris //! author : Konstantin : https://github.com/skfd //! author : Anthony : https://github.com/anthonylau ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var zhHk = moment.defineLocale('zh-hk', { months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split( '_' ), monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split( '_' ), weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'), weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'), weekdaysMin: '日_一_二_三_四_五_六'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'YYYY/MM/DD', LL: 'YYYY年M月D日', LLL: 'YYYY年M月D日 HH:mm', LLLL: 'YYYY年M月D日dddd HH:mm', l: 'YYYY/M/D', ll: 'YYYY年M月D日', lll: 'YYYY年M月D日 HH:mm', llll: 'YYYY年M月D日dddd HH:mm', }, meridiemParse: /凌晨|早上|上午|中午|下午|晚上/, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') { return hour; } else if (meridiem === '中午') { return hour >= 11 ? hour : hour + 12; } else if (meridiem === '下午' || meridiem === '晚上') { return hour + 12; } }, meridiem: function (hour, minute, isLower) { var hm = hour * 100 + minute; if (hm < 600) { return '凌晨'; } else if (hm < 900) { return '早上'; } else if (hm < 1200) { return '上午'; } else if (hm === 1200) { return '中午'; } else if (hm < 1800) { return '下午'; } else { return '晚上'; } }, calendar: { sameDay: '[今天]LT', nextDay: '[明天]LT', nextWeek: '[下]ddddLT', lastDay: '[昨天]LT', lastWeek: '[上]ddddLT', sameElse: 'L', }, dayOfMonthOrdinalParse: /\d{1,2}(日|月|週)/, ordinal: function (number, period) { switch (period) { case 'd': case 'D': case 'DDD': return number + '日'; case 'M': return number + '月'; case 'w': case 'W': return number + '週'; default: return number; } }, relativeTime: { future: '%s後', past: '%s前', s: '幾秒', ss: '%d 秒', m: '1 分鐘', mm: '%d 分鐘', h: '1 小時', hh: '%d 小時', d: '1 天', dd: '%d 天', M: '1 個月', MM: '%d 個月', y: '1 年', yy: '%d 年', }, }); return zhHk; }))); /***/ }), /* 1377 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Chinese (Macau) [zh-mo] //! author : Ben : https://github.com/ben-lin //! author : Chris Lam : https://github.com/hehachris //! author : Tan Yuanhong : https://github.com/le0tan ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var zhMo = moment.defineLocale('zh-mo', { months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split( '_' ), monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split( '_' ), weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'), weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'), weekdaysMin: '日_一_二_三_四_五_六'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'YYYY年M月D日', LLL: 'YYYY年M月D日 HH:mm', LLLL: 'YYYY年M月D日dddd HH:mm', l: 'D/M/YYYY', ll: 'YYYY年M月D日', lll: 'YYYY年M月D日 HH:mm', llll: 'YYYY年M月D日dddd HH:mm', }, meridiemParse: /凌晨|早上|上午|中午|下午|晚上/, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') { return hour; } else if (meridiem === '中午') { return hour >= 11 ? hour : hour + 12; } else if (meridiem === '下午' || meridiem === '晚上') { return hour + 12; } }, meridiem: function (hour, minute, isLower) { var hm = hour * 100 + minute; if (hm < 600) { return '凌晨'; } else if (hm < 900) { return '早上'; } else if (hm < 1130) { return '上午'; } else if (hm < 1230) { return '中午'; } else if (hm < 1800) { return '下午'; } else { return '晚上'; } }, calendar: { sameDay: '[今天] LT', nextDay: '[明天] LT', nextWeek: '[下]dddd LT', lastDay: '[昨天] LT', lastWeek: '[上]dddd LT', sameElse: 'L', }, dayOfMonthOrdinalParse: /\d{1,2}(日|月|週)/, ordinal: function (number, period) { switch (period) { case 'd': case 'D': case 'DDD': return number + '日'; case 'M': return number + '月'; case 'w': case 'W': return number + '週'; default: return number; } }, relativeTime: { future: '%s內', past: '%s前', s: '幾秒', ss: '%d 秒', m: '1 分鐘', mm: '%d 分鐘', h: '1 小時', hh: '%d 小時', d: '1 天', dd: '%d 天', M: '1 個月', MM: '%d 個月', y: '1 年', yy: '%d 年', }, }); return zhMo; }))); /***/ }), /* 1378 */ /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Chinese (Taiwan) [zh-tw] //! author : Ben : https://github.com/ben-lin //! author : Chris Lam : https://github.com/hehachris ;(function (global, factory) { true ? factory(__webpack_require__(1245)) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var zhTw = moment.defineLocale('zh-tw', { months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split( '_' ), monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split( '_' ), weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'), weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'), weekdaysMin: '日_一_二_三_四_五_六'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'YYYY/MM/DD', LL: 'YYYY年M月D日', LLL: 'YYYY年M月D日 HH:mm', LLLL: 'YYYY年M月D日dddd HH:mm', l: 'YYYY/M/D', ll: 'YYYY年M月D日', lll: 'YYYY年M月D日 HH:mm', llll: 'YYYY年M月D日dddd HH:mm', }, meridiemParse: /凌晨|早上|上午|中午|下午|晚上/, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') { return hour; } else if (meridiem === '中午') { return hour >= 11 ? hour : hour + 12; } else if (meridiem === '下午' || meridiem === '晚上') { return hour + 12; } }, meridiem: function (hour, minute, isLower) { var hm = hour * 100 + minute; if (hm < 600) { return '凌晨'; } else if (hm < 900) { return '早上'; } else if (hm < 1130) { return '上午'; } else if (hm < 1230) { return '中午'; } else if (hm < 1800) { return '下午'; } else { return '晚上'; } }, calendar: { sameDay: '[今天] LT', nextDay: '[明天] LT', nextWeek: '[下]dddd LT', lastDay: '[昨天] LT', lastWeek: '[上]dddd LT', sameElse: 'L', }, dayOfMonthOrdinalParse: /\d{1,2}(日|月|週)/, ordinal: function (number, period) { switch (period) { case 'd': case 'D': case 'DDD': return number + '日'; case 'M': return number + '月'; case 'w': case 'W': return number + '週'; default: return number; } }, relativeTime: { future: '%s後', past: '%s前', s: '幾秒', ss: '%d 秒', m: '1 分鐘', mm: '%d 分鐘', h: '1 小時', hh: '%d 小時', d: '1 天', dd: '%d 天', M: '1 個月', MM: '%d 個月', y: '1 年', yy: '%d 年', }, }); return zhTw; }))); /***/ }), /* 1379 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(module) { var Bluebird = __webpack_require__(25).getNewLibraryCopy(), configure = __webpack_require__(1380), stealthyRequire = __webpack_require__(77); try { // Load Request freshly - so that users can require an unaltered request instance! var request = stealthyRequire(__webpack_require__.c, function () { return __webpack_require__(78); }, function () { __webpack_require__(270); }, module); } catch (err) { /* istanbul ignore next */ var EOL = __webpack_require__(19).EOL; /* istanbul ignore next */ console.error(EOL + '###' + EOL + '### The "request" library is not installed automatically anymore.' + EOL + '### But is a dependency of "request-promise".' + EOL + '### Please install it with:' + EOL + '### npm install request --save' + EOL + '###' + EOL); /* istanbul ignore next */ throw err; } Bluebird.config({cancellation: true}); configure({ request: request, PromiseImpl: Bluebird, expose: [ 'then', 'catch', 'finally', 'cancel', 'promise' // Would you like to expose more Bluebird methods? Try e.g. `rp(...).promise().tap(...)` first. `.promise()` returns the full-fledged Bluebird promise. ], constructorMixin: function (resolve, reject, onCancel) { var self = this; onCancel(function () { self.abort(); }); } }); request.bindCLS = function RP$bindCLS() { throw new Error('CLS support was dropped. To get it back read: https://github.com/request/request-promise/wiki/Getting-Back-Support-for-Continuation-Local-Storage'); }; module.exports = request; /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(13)(module))) /***/ }), /* 1380 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var core = __webpack_require__(1381), isArray = __webpack_require__(75), isFunction = __webpack_require__(65), isObjectLike = __webpack_require__(73); module.exports = function (options) { var errorText = 'Please verify options'; // For better minification because this string is repeating if (!isObjectLike(options)) { throw new TypeError(errorText); } if (!isFunction(options.request)) { throw new TypeError(errorText + '.request'); } if (!isArray(options.expose) || options.expose.length === 0) { throw new TypeError(errorText + '.expose'); } var plumbing = core({ PromiseImpl: options.PromiseImpl, constructorMixin: options.constructorMixin }); // Intercepting Request's init method var originalInit = options.request.Request.prototype.init; options.request.Request.prototype.init = function RP$initInterceptor(requestOptions) { // Init may be called again - currently in case of redirects if (isObjectLike(requestOptions) && !this._callback && !this._rp_promise) { plumbing.init.call(this, requestOptions); } return originalInit.apply(this, arguments); }; // Exposing the Promise capabilities var thenExposed = false; for ( var i = 0; i < options.expose.length; i+=1 ) { var method = options.expose[i]; plumbing[ method === 'promise' ? 'exposePromise' : 'exposePromiseMethod' ]( options.request.Request.prototype, null, '_rp_promise', method ); if (method === 'then') { thenExposed = true; } } if (!thenExposed) { throw new Error('Please expose "then"'); } }; /***/ }), /* 1381 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var errors = __webpack_require__(1382), isFunction = __webpack_require__(65), isObjectLike = __webpack_require__(73), isString = __webpack_require__(74), isUndefined = __webpack_require__(76); module.exports = function (options) { var errorText = 'Please verify options'; // For better minification because this string is repeating if (!isObjectLike(options)) { throw new TypeError(errorText); } if (!isFunction(options.PromiseImpl)) { throw new TypeError(errorText + '.PromiseImpl'); } if (!isUndefined(options.constructorMixin) && !isFunction(options.constructorMixin)) { throw new TypeError(errorText + '.PromiseImpl'); } var PromiseImpl = options.PromiseImpl; var constructorMixin = options.constructorMixin; var plumbing = {}; plumbing.init = function (requestOptions) { var self = this; self._rp_promise = new PromiseImpl(function (resolve, reject) { self._rp_resolve = resolve; self._rp_reject = reject; if (constructorMixin) { constructorMixin.apply(self, arguments); // Using arguments since specific Promise libraries may pass additional parameters } }); self._rp_callbackOrig = requestOptions.callback; requestOptions.callback = self.callback = function RP$callback(err, response, body) { plumbing.callback.call(self, err, response, body); }; if (isString(requestOptions.method)) { requestOptions.method = requestOptions.method.toUpperCase(); } requestOptions.transform = requestOptions.transform || plumbing.defaultTransformations[requestOptions.method]; self._rp_options = requestOptions; self._rp_options.simple = requestOptions.simple !== false; self._rp_options.resolveWithFullResponse = requestOptions.resolveWithFullResponse === true; self._rp_options.transform2xxOnly = requestOptions.transform2xxOnly === true; }; plumbing.defaultTransformations = { HEAD: function (body, response, resolveWithFullResponse) { return resolveWithFullResponse ? response : response.headers; } }; plumbing.callback = function (err, response, body) { var self = this; var origCallbackThrewException = false, thrownException = null; if (isFunction(self._rp_callbackOrig)) { try { self._rp_callbackOrig.apply(self, arguments); // TODO: Apply to self mimics behavior of request@2. Is that also right for request@next? } catch (e) { origCallbackThrewException = true; thrownException = e; } } var is2xx = !err && /^2/.test('' + response.statusCode); if (err) { self._rp_reject(new errors.RequestError(err, self._rp_options, response)); } else if (self._rp_options.simple && !is2xx) { if (isFunction(self._rp_options.transform) && self._rp_options.transform2xxOnly === false) { (new PromiseImpl(function (resolve) { resolve(self._rp_options.transform(body, response, self._rp_options.resolveWithFullResponse)); // transform may return a Promise })) .then(function (transformedResponse) { self._rp_reject(new errors.StatusCodeError(response.statusCode, body, self._rp_options, transformedResponse)); }) .catch(function (transformErr) { self._rp_reject(new errors.TransformError(transformErr, self._rp_options, response)); }); } else { self._rp_reject(new errors.StatusCodeError(response.statusCode, body, self._rp_options, response)); } } else { if (isFunction(self._rp_options.transform) && (is2xx || self._rp_options.transform2xxOnly === false)) { (new PromiseImpl(function (resolve) { resolve(self._rp_options.transform(body, response, self._rp_options.resolveWithFullResponse)); // transform may return a Promise })) .then(function (transformedResponse) { self._rp_resolve(transformedResponse); }) .catch(function (transformErr) { self._rp_reject(new errors.TransformError(transformErr, self._rp_options, response)); }); } else if (self._rp_options.resolveWithFullResponse) { self._rp_resolve(response); } else { self._rp_resolve(body); } } if (origCallbackThrewException) { throw thrownException; } }; plumbing.exposePromiseMethod = function (exposeTo, bindTo, promisePropertyKey, methodToExpose, exposeAs) { exposeAs = exposeAs || methodToExpose; if (exposeAs in exposeTo) { throw new Error('Unable to expose method "' + exposeAs + '"'); } exposeTo[exposeAs] = function RP$exposed() { var self = bindTo || this; return self[promisePropertyKey][methodToExpose].apply(self[promisePropertyKey], arguments); }; }; plumbing.exposePromise = function (exposeTo, bindTo, promisePropertyKey, exposeAs) { exposeAs = exposeAs || 'promise'; if (exposeAs in exposeTo) { throw new Error('Unable to expose method "' + exposeAs + '"'); } exposeTo[exposeAs] = function RP$promise() { var self = bindTo || this; return self[promisePropertyKey]; }; }; return plumbing; }; /***/ }), /* 1382 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; function RequestError(cause, options, response) { this.name = 'RequestError'; this.message = String(cause); this.cause = cause; this.error = cause; // legacy attribute this.options = options; this.response = response; if (Error.captureStackTrace) { // required for non-V8 environments Error.captureStackTrace(this); } } RequestError.prototype = Object.create(Error.prototype); RequestError.prototype.constructor = RequestError; function StatusCodeError(statusCode, body, options, response) { this.name = 'StatusCodeError'; this.statusCode = statusCode; this.message = statusCode + ' - ' + (JSON && JSON.stringify ? JSON.stringify(body) : body); this.error = body; // legacy attribute this.options = options; this.response = response; if (Error.captureStackTrace) { // required for non-V8 environments Error.captureStackTrace(this); } } StatusCodeError.prototype = Object.create(Error.prototype); StatusCodeError.prototype.constructor = StatusCodeError; function TransformError(cause, options, response) { this.name = 'TransformError'; this.message = String(cause); this.cause = cause; this.error = cause; // legacy attribute this.options = options; this.response = response; if (Error.captureStackTrace) { // required for non-V8 environments Error.captureStackTrace(this); } } TransformError.prototype = Object.create(Error.prototype); TransformError.prototype.constructor = TransformError; module.exports = { RequestError: RequestError, StatusCodeError: StatusCodeError, TransformError: TransformError }; /***/ }), /* 1383 */ /***/ (function(module, exports, __webpack_require__) { var moment = module.exports = __webpack_require__(1384); moment.tz.load(__webpack_require__(1385)); /***/ }), /* 1384 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;//! moment-timezone.js //! version : 0.5.28 //! Copyright (c) JS Foundation and other contributors //! license : MIT //! github.com/moment/moment-timezone (function (root, factory) { "use strict"; /*global define*/ if ( true && module.exports) { module.exports = factory(__webpack_require__(1245)); // Node } else if (true) { !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1245)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); // AMD } else {} }(this, function (moment) { "use strict"; // Do not load moment-timezone a second time. // if (moment.tz !== undefined) { // logError('Moment Timezone ' + moment.tz.version + ' was already loaded ' + (moment.tz.dataVersion ? 'with data from ' : 'without any data') + moment.tz.dataVersion); // return moment; // } var VERSION = "0.5.28", zones = {}, links = {}, countries = {}, names = {}, guesses = {}, cachedGuess; if (!moment || typeof moment.version !== 'string') { logError('Moment Timezone requires Moment.js. See https://momentjs.com/timezone/docs/#/use-it/browser/'); } var momentVersion = moment.version.split('.'), major = +momentVersion[0], minor = +momentVersion[1]; // Moment.js version check if (major < 2 || (major === 2 && minor < 6)) { logError('Moment Timezone requires Moment.js >= 2.6.0. You are using Moment.js ' + moment.version + '. See momentjs.com'); } /************************************ Unpacking ************************************/ function charCodeToInt(charCode) { if (charCode > 96) { return charCode - 87; } else if (charCode > 64) { return charCode - 29; } return charCode - 48; } function unpackBase60(string) { var i = 0, parts = string.split('.'), whole = parts[0], fractional = parts[1] || '', multiplier = 1, num, out = 0, sign = 1; // handle negative numbers if (string.charCodeAt(0) === 45) { i = 1; sign = -1; } // handle digits before the decimal for (i; i < whole.length; i++) { num = charCodeToInt(whole.charCodeAt(i)); out = 60 * out + num; } // handle digits after the decimal for (i = 0; i < fractional.length; i++) { multiplier = multiplier / 60; num = charCodeToInt(fractional.charCodeAt(i)); out += num * multiplier; } return out * sign; } function arrayToInt (array) { for (var i = 0; i < array.length; i++) { array[i] = unpackBase60(array[i]); } } function intToUntil (array, length) { for (var i = 0; i < length; i++) { array[i] = Math.round((array[i - 1] || 0) + (array[i] * 60000)); // minutes to milliseconds } array[length - 1] = Infinity; } function mapIndices (source, indices) { var out = [], i; for (i = 0; i < indices.length; i++) { out[i] = source[indices[i]]; } return out; } function unpack (string) { var data = string.split('|'), offsets = data[2].split(' '), indices = data[3].split(''), untils = data[4].split(' '); arrayToInt(offsets); arrayToInt(indices); arrayToInt(untils); intToUntil(untils, indices.length); return { name : data[0], abbrs : mapIndices(data[1].split(' '), indices), offsets : mapIndices(offsets, indices), untils : untils, population : data[5] | 0 }; } /************************************ Zone object ************************************/ function Zone (packedString) { if (packedString) { this._set(unpack(packedString)); } } Zone.prototype = { _set : function (unpacked) { this.name = unpacked.name; this.abbrs = unpacked.abbrs; this.untils = unpacked.untils; this.offsets = unpacked.offsets; this.population = unpacked.population; }, _index : function (timestamp) { var target = +timestamp, untils = this.untils, i; for (i = 0; i < untils.length; i++) { if (target < untils[i]) { return i; } } }, countries : function () { var zone_name = this.name; return Object.keys(countries).filter(function (country_code) { return countries[country_code].zones.indexOf(zone_name) !== -1; }); }, parse : function (timestamp) { var target = +timestamp, offsets = this.offsets, untils = this.untils, max = untils.length - 1, offset, offsetNext, offsetPrev, i; for (i = 0; i < max; i++) { offset = offsets[i]; offsetNext = offsets[i + 1]; offsetPrev = offsets[i ? i - 1 : i]; if (offset < offsetNext && tz.moveAmbiguousForward) { offset = offsetNext; } else if (offset > offsetPrev && tz.moveInvalidForward) { offset = offsetPrev; } if (target < untils[i] - (offset * 60000)) { return offsets[i]; } } return offsets[max]; }, abbr : function (mom) { return this.abbrs[this._index(mom)]; }, offset : function (mom) { logError("zone.offset has been deprecated in favor of zone.utcOffset"); return this.offsets[this._index(mom)]; }, utcOffset : function (mom) { return this.offsets[this._index(mom)]; } }; /************************************ Country object ************************************/ function Country (country_name, zone_names) { this.name = country_name; this.zones = zone_names; } /************************************ Current Timezone ************************************/ function OffsetAt(at) { var timeString = at.toTimeString(); var abbr = timeString.match(/\([a-z ]+\)/i); if (abbr && abbr[0]) { // 17:56:31 GMT-0600 (CST) // 17:56:31 GMT-0600 (Central Standard Time) abbr = abbr[0].match(/[A-Z]/g); abbr = abbr ? abbr.join('') : undefined; } else { // 17:56:31 CST // 17:56:31 GMT+0800 (台北標準時間) abbr = timeString.match(/[A-Z]{3,5}/g); abbr = abbr ? abbr[0] : undefined; } if (abbr === 'GMT') { abbr = undefined; } this.at = +at; this.abbr = abbr; this.offset = at.getTimezoneOffset(); } function ZoneScore(zone) { this.zone = zone; this.offsetScore = 0; this.abbrScore = 0; } ZoneScore.prototype.scoreOffsetAt = function (offsetAt) { this.offsetScore += Math.abs(this.zone.utcOffset(offsetAt.at) - offsetAt.offset); if (this.zone.abbr(offsetAt.at).replace(/[^A-Z]/g, '') !== offsetAt.abbr) { this.abbrScore++; } }; function findChange(low, high) { var mid, diff; while ((diff = ((high.at - low.at) / 12e4 | 0) * 6e4)) { mid = new OffsetAt(new Date(low.at + diff)); if (mid.offset === low.offset) { low = mid; } else { high = mid; } } return low; } function userOffsets() { var startYear = new Date().getFullYear() - 2, last = new OffsetAt(new Date(startYear, 0, 1)), offsets = [last], change, next, i; for (i = 1; i < 48; i++) { next = new OffsetAt(new Date(startYear, i, 1)); if (next.offset !== last.offset) { change = findChange(last, next); offsets.push(change); offsets.push(new OffsetAt(new Date(change.at + 6e4))); } last = next; } for (i = 0; i < 4; i++) { offsets.push(new OffsetAt(new Date(startYear + i, 0, 1))); offsets.push(new OffsetAt(new Date(startYear + i, 6, 1))); } return offsets; } function sortZoneScores (a, b) { if (a.offsetScore !== b.offsetScore) { return a.offsetScore - b.offsetScore; } if (a.abbrScore !== b.abbrScore) { return a.abbrScore - b.abbrScore; } if (a.zone.population !== b.zone.population) { return b.zone.population - a.zone.population; } return b.zone.name.localeCompare(a.zone.name); } function addToGuesses (name, offsets) { var i, offset; arrayToInt(offsets); for (i = 0; i < offsets.length; i++) { offset = offsets[i]; guesses[offset] = guesses[offset] || {}; guesses[offset][name] = true; } } function guessesForUserOffsets (offsets) { var offsetsLength = offsets.length, filteredGuesses = {}, out = [], i, j, guessesOffset; for (i = 0; i < offsetsLength; i++) { guessesOffset = guesses[offsets[i].offset] || {}; for (j in guessesOffset) { if (guessesOffset.hasOwnProperty(j)) { filteredGuesses[j] = true; } } } for (i in filteredGuesses) { if (filteredGuesses.hasOwnProperty(i)) { out.push(names[i]); } } return out; } function rebuildGuess () { // use Intl API when available and returning valid time zone try { var intlName = Intl.DateTimeFormat().resolvedOptions().timeZone; if (intlName && intlName.length > 3) { var name = names[normalizeName(intlName)]; if (name) { return name; } logError("Moment Timezone found " + intlName + " from the Intl api, but did not have that data loaded."); } } catch (e) { // Intl unavailable, fall back to manual guessing. } var offsets = userOffsets(), offsetsLength = offsets.length, guesses = guessesForUserOffsets(offsets), zoneScores = [], zoneScore, i, j; for (i = 0; i < guesses.length; i++) { zoneScore = new ZoneScore(getZone(guesses[i]), offsetsLength); for (j = 0; j < offsetsLength; j++) { zoneScore.scoreOffsetAt(offsets[j]); } zoneScores.push(zoneScore); } zoneScores.sort(sortZoneScores); return zoneScores.length > 0 ? zoneScores[0].zone.name : undefined; } function guess (ignoreCache) { if (!cachedGuess || ignoreCache) { cachedGuess = rebuildGuess(); } return cachedGuess; } /************************************ Global Methods ************************************/ function normalizeName (name) { return (name || '').toLowerCase().replace(/\//g, '_'); } function addZone (packed) { var i, name, split, normalized; if (typeof packed === "string") { packed = [packed]; } for (i = 0; i < packed.length; i++) { split = packed[i].split('|'); name = split[0]; normalized = normalizeName(name); zones[normalized] = packed[i]; names[normalized] = name; addToGuesses(normalized, split[2].split(' ')); } } function getZone (name, caller) { name = normalizeName(name); var zone = zones[name]; var link; if (zone instanceof Zone) { return zone; } if (typeof zone === 'string') { zone = new Zone(zone); zones[name] = zone; return zone; } // Pass getZone to prevent recursion more than 1 level deep if (links[name] && caller !== getZone && (link = getZone(links[name], getZone))) { zone = zones[name] = new Zone(); zone._set(link); zone.name = names[name]; return zone; } return null; } function getNames () { var i, out = []; for (i in names) { if (names.hasOwnProperty(i) && (zones[i] || zones[links[i]]) && names[i]) { out.push(names[i]); } } return out.sort(); } function getCountryNames () { return Object.keys(countries); } function addLink (aliases) { var i, alias, normal0, normal1; if (typeof aliases === "string") { aliases = [aliases]; } for (i = 0; i < aliases.length; i++) { alias = aliases[i].split('|'); normal0 = normalizeName(alias[0]); normal1 = normalizeName(alias[1]); links[normal0] = normal1; names[normal0] = alias[0]; links[normal1] = normal0; names[normal1] = alias[1]; } } function addCountries (data) { var i, country_code, country_zones, split; if (!data || !data.length) return; for (i = 0; i < data.length; i++) { split = data[i].split('|'); country_code = split[0].toUpperCase(); country_zones = split[1].split(' '); countries[country_code] = new Country( country_code, country_zones ); } } function getCountry (name) { name = name.toUpperCase(); return countries[name] || null; } function zonesForCountry(country, with_offset) { country = getCountry(country); if (!country) return null; var zones = country.zones.sort(); if (with_offset) { return zones.map(function (zone_name) { var zone = getZone(zone_name); return { name: zone_name, offset: zone.utcOffset(new Date()) }; }); } return zones; } function loadData (data) { addZone(data.zones); addLink(data.links); addCountries(data.countries); tz.dataVersion = data.version; } function zoneExists (name) { if (!zoneExists.didShowError) { zoneExists.didShowError = true; logError("moment.tz.zoneExists('" + name + "') has been deprecated in favor of !moment.tz.zone('" + name + "')"); } return !!getZone(name); } function needsOffset (m) { var isUnixTimestamp = (m._f === 'X' || m._f === 'x'); return !!(m._a && (m._tzm === undefined) && !isUnixTimestamp); } function logError (message) { if (typeof console !== 'undefined' && typeof console.error === 'function') { console.error(message); } } /************************************ moment.tz namespace ************************************/ function tz (input) { var args = Array.prototype.slice.call(arguments, 0, -1), name = arguments[arguments.length - 1], zone = getZone(name), out = moment.utc.apply(null, args); if (zone && !moment.isMoment(input) && needsOffset(out)) { out.add(zone.parse(out), 'minutes'); } out.tz(name); return out; } tz.version = VERSION; tz.dataVersion = ''; tz._zones = zones; tz._links = links; tz._names = names; tz._countries = countries; tz.add = addZone; tz.link = addLink; tz.load = loadData; tz.zone = getZone; tz.zoneExists = zoneExists; // deprecated in 0.1.0 tz.guess = guess; tz.names = getNames; tz.Zone = Zone; tz.unpack = unpack; tz.unpackBase60 = unpackBase60; tz.needsOffset = needsOffset; tz.moveInvalidForward = true; tz.moveAmbiguousForward = false; tz.countries = getCountryNames; tz.zonesForCountry = zonesForCountry; /************************************ Interface with Moment.js ************************************/ var fn = moment.fn; moment.tz = tz; moment.defaultZone = null; moment.updateOffset = function (mom, keepTime) { var zone = moment.defaultZone, offset; if (mom._z === undefined) { if (zone && needsOffset(mom) && !mom._isUTC) { mom._d = moment.utc(mom._a)._d; mom.utc().add(zone.parse(mom), 'minutes'); } mom._z = zone; } if (mom._z) { offset = mom._z.utcOffset(mom); if (Math.abs(offset) < 16) { offset = offset / 60; } if (mom.utcOffset !== undefined) { var z = mom._z; mom.utcOffset(-offset, keepTime); mom._z = z; } else { mom.zone(offset, keepTime); } } }; fn.tz = function (name, keepTime) { if (name) { if (typeof name !== 'string') { throw new Error('Time zone name must be a string, got ' + name + ' [' + typeof name + ']'); } this._z = getZone(name); if (this._z) { moment.updateOffset(this, keepTime); } else { logError("Moment Timezone has no data for " + name + ". See http://momentjs.com/timezone/docs/#/data-loading/."); } return this; } if (this._z) { return this._z.name; } }; function abbrWrap (old) { return function () { if (this._z) { return this._z.abbr(this); } return old.call(this); }; } function resetZoneWrap (old) { return function () { this._z = null; return old.apply(this, arguments); }; } function resetZoneWrap2 (old) { return function () { if (arguments.length > 0) this._z = null; return old.apply(this, arguments); }; } fn.zoneName = abbrWrap(fn.zoneName); fn.zoneAbbr = abbrWrap(fn.zoneAbbr); fn.utc = resetZoneWrap(fn.utc); fn.local = resetZoneWrap(fn.local); fn.utcOffset = resetZoneWrap2(fn.utcOffset); moment.tz.setDefault = function(name) { if (major < 2 || (major === 2 && minor < 9)) { logError('Moment Timezone setDefault() requires Moment.js >= 2.9.0. You are using Moment.js ' + moment.version + '.'); } moment.defaultZone = name ? getZone(name) : null; return moment; }; // Cloning a moment should include the _z property. var momentProperties = moment.momentProperties; if (Object.prototype.toString.call(momentProperties) === '[object Array]') { // moment 2.8.1+ momentProperties.push('_z'); momentProperties.push('_a'); } else if (momentProperties) { // moment 2.7.0 momentProperties._z = null; } // INJECT DATA return moment; })); /***/ }), /* 1385 */ /***/ (function(module) { module.exports = JSON.parse("{\"version\":\"2019c\",\"zones\":[\"Africa/Abidjan|LMT GMT|g.8 0|01|-2ldXH.Q|48e5\",\"Africa/Accra|LMT GMT +0020|.Q 0 -k|012121212121212121212121212121212121212121212121|-26BbX.8 6tzX.8 MnE 1BAk MnE 1BAk MnE 1BAk MnE 1C0k MnE 1BAk MnE 1BAk MnE 1BAk MnE 1C0k MnE 1BAk MnE 1BAk MnE 1BAk MnE 1C0k MnE 1BAk MnE 1BAk MnE 1BAk MnE 1C0k MnE 1BAk MnE 1BAk MnE 1BAk MnE 1C0k MnE 1BAk MnE 1BAk MnE|41e5\",\"Africa/Nairobi|LMT EAT +0230 +0245|-2r.g -30 -2u -2J|01231|-1F3Cr.g 3Dzr.g okMu MFXJ|47e5\",\"Africa/Algiers|PMT WET WEST CET CEST|-9.l 0 -10 -10 -20|0121212121212121343431312123431213|-2nco9.l cNb9.l HA0 19A0 1iM0 11c0 1oo0 Wo0 1rc0 QM0 1EM0 UM0 DA0 Imo0 rd0 De0 9Xz0 1fb0 1ap0 16K0 2yo0 mEp0 hwL0 jxA0 11A0 dDd0 17b0 11B0 1cN0 2Dy0 1cN0 1fB0 1cL0|26e5\",\"Africa/Lagos|LMT WAT|-d.A -10|01|-22y0d.A|17e6\",\"Africa/Bissau|LMT -01 GMT|12.k 10 0|012|-2ldX0 2xoo0|39e4\",\"Africa/Maputo|LMT CAT|-2a.k -20|01|-2GJea.k|26e5\",\"Africa/Cairo|EET EEST|-20 -30|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-1bIO0 vb0 1ip0 11z0 1iN0 1nz0 12p0 1pz0 10N0 1pz0 16p0 1jz0 s3d0 Vz0 1oN0 11b0 1oO0 10N0 1pz0 10N0 1pb0 10N0 1pb0 10N0 1pb0 10N0 1pz0 10N0 1pb0 10N0 1pb0 11d0 1oL0 11d0 1pb0 11d0 1oL0 11d0 1oL0 11d0 1oL0 11d0 1pb0 11d0 1oL0 11d0 1oL0 11d0 1oL0 11d0 1pb0 11d0 1oL0 11d0 1oL0 11d0 1oL0 11d0 1pb0 11d0 1oL0 11d0 1WL0 rd0 1Rz0 wp0 1pb0 11d0 1oL0 11d0 1oL0 11d0 1oL0 11d0 1pb0 11d0 1qL0 Xd0 1oL0 11d0 1oL0 11d0 1pb0 11d0 1oL0 11d0 1oL0 11d0 1ny0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 WL0 1qN0 Rb0 1wp0 On0 1zd0 Lz0 1EN0 Fb0 c10 8n0 8Nd0 gL0 e10 mn0|15e6\",\"Africa/Casablanca|LMT +00 +01|u.k 0 -10|01212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212|-2gMnt.E 130Lt.E rb0 Dd0 dVb0 b6p0 TX0 EoB0 LL0 gnd0 rz0 43d0 AL0 1Nd0 XX0 1Cp0 pz0 dEp0 4mn0 SyN0 AL0 1Nd0 wn0 1FB0 Db0 1zd0 Lz0 1Nf0 wM0 co0 go0 1o00 s00 dA0 vc0 11A0 A00 e00 y00 11A0 uM0 e00 Dc0 11A0 s00 e00 IM0 WM0 mo0 gM0 LA0 WM0 jA0 e00 28M0 e00 2600 e00 28M0 e00 2600 gM0 2600 e00 28M0 e00 2600 gM0 2600 e00 28M0 e00 2600 e00 28M0 e00 2600 gM0 2600 e00 28M0 e00 2600 gM0 2600 e00 2600 gM0 2600 e00 28M0 e00 2600 gM0|32e5\",\"Africa/Ceuta|WET WEST CET CEST|0 -10 -10 -20|010101010101010101010232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232|-25KN0 11z0 drd0 18p0 3HX0 17d0 1fz0 1a10 1io0 1a00 1y7o0 LL0 gnd0 rz0 43d0 AL0 1Nd0 XX0 1Cp0 pz0 dEp0 4VB0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|85e3\",\"Africa/El_Aaiun|LMT -01 +00 +01|Q.M 10 0 -10|012323232323232323232323232323232323232323232323232323232323232323232323232323232323|-1rDz7.c 1GVA7.c 6L0 AL0 1Nd0 XX0 1Cp0 pz0 1cBB0 AL0 1Nd0 wn0 1FB0 Db0 1zd0 Lz0 1Nf0 wM0 co0 go0 1o00 s00 dA0 vc0 11A0 A00 e00 y00 11A0 uM0 e00 Dc0 11A0 s00 e00 IM0 WM0 mo0 gM0 LA0 WM0 jA0 e00 28M0 e00 2600 e00 28M0 e00 2600 gM0 2600 e00 28M0 e00 2600 gM0 2600 e00 28M0 e00 2600 e00 28M0 e00 2600 gM0 2600 e00 28M0 e00 2600 gM0 2600 e00 2600 gM0 2600 e00 28M0 e00 2600 gM0|20e4\",\"Africa/Johannesburg|SAST SAST SAST|-1u -20 -30|012121|-2GJdu 1Ajdu 1cL0 1cN0 1cL0|84e5\",\"Africa/Juba|LMT CAT CAST EAT|-26.s -20 -30 -30|01212121212121212121212121212121213|-1yW26.s 1zK06.s 16L0 1iN0 17b0 1jd0 17b0 1ip0 17z0 1i10 17X0 1hB0 18n0 1hd0 19b0 1gp0 19z0 1iN0 17b0 1ip0 17z0 1i10 18n0 1hd0 18L0 1gN0 19b0 1gp0 19z0 1iN0 17z0 1i10 17X0 yGd0|\",\"Africa/Khartoum|LMT CAT CAST EAT|-2a.8 -20 -30 -30|012121212121212121212121212121212131|-1yW2a.8 1zK0a.8 16L0 1iN0 17b0 1jd0 17b0 1ip0 17z0 1i10 17X0 1hB0 18n0 1hd0 19b0 1gp0 19z0 1iN0 17b0 1ip0 17z0 1i10 18n0 1hd0 18L0 1gN0 19b0 1gp0 19z0 1iN0 17z0 1i10 17X0 yGd0 HjL0|51e5\",\"Africa/Monrovia|MMT MMT GMT|H.8 I.u 0|012|-23Lzg.Q 28G01.m|11e5\",\"Africa/Ndjamena|LMT WAT WAST|-10.c -10 -20|0121|-2le10.c 2J3c0.c Wn0|13e5\",\"Africa/Sao_Tome|LMT GMT WAT|A.J 0 -10|0121|-2le00 4i6N0 2q00|\",\"Africa/Tripoli|LMT CET CEST EET|-Q.I -10 -20 -20|012121213121212121212121213123123|-21JcQ.I 1hnBQ.I vx0 4iP0 xx0 4eN0 Bb0 7ip0 U0n0 A10 1db0 1cN0 1db0 1dd0 1db0 1eN0 1bb0 1e10 1cL0 1c10 1db0 1dd0 1db0 1cN0 1db0 1q10 fAn0 1ep0 1db0 AKq0 TA0 1o00|11e5\",\"Africa/Tunis|PMT CET CEST|-9.l -10 -20|0121212121212121212121212121212121|-2nco9.l 18pa9.l 1qM0 DA0 3Tc0 11B0 1ze0 WM0 7z0 3d0 14L0 1cN0 1f90 1ar0 16J0 1gXB0 WM0 1rA0 11c0 nwo0 Ko0 1cM0 1cM0 1rA0 10M0 zuM0 10N0 1aN0 1qM0 WM0 1qM0 11A0 1o00|20e5\",\"Africa/Windhoek|+0130 SAST SAST CAT WAT|-1u -20 -30 -20 -10|01213434343434343434343434343434343434343434343434343|-2GJdu 1Ajdu 1cL0 1SqL0 9Io0 16P0 1nX0 11B0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0|32e4\",\"America/Adak|NST NWT NPT BST BDT AHST HST HDT|b0 a0 a0 b0 a0 a0 a0 90|012034343434343434343434343434343456767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676|-17SX0 8wW0 iB0 Qlb0 52O0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 cm0 10q0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|326\",\"America/Anchorage|AST AWT APT AHST AHDT YST AKST AKDT|a0 90 90 a0 90 90 90 80|012034343434343434343434343434343456767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676|-17T00 8wX0 iA0 Qlb0 52O0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 cm0 10q0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|30e4\",\"America/Port_of_Spain|LMT AST|46.4 40|01|-2kNvR.U|43e3\",\"America/Araguaina|LMT -03 -02|3c.M 30 20|0121212121212121212121212121212121212121212121212121|-2glwL.c HdKL.c 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 qe10 xb0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 dMN0 Lz0 1zd0 Rb0 1wN0 Wn0 1tB0 Rb0 1tB0 WL0 1tB0 Rb0 1zd0 On0 1HB0 FX0 ny10 Lz0|14e4\",\"America/Argentina/Buenos_Aires|CMT -04 -03 -02|4g.M 40 30 20|01212121212121212121212121212121212121212123232323232323232|-20UHH.c pKnH.c Mn0 1iN0 Tb0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 MN0 2jz0 MN0 4lX0 u10 5Lb0 1pB0 Fnz0 u10 uL0 1vd0 SL0 1vd0 SL0 1vd0 17z0 1cN0 1fz0 1cN0 1cL0 1cN0 asn0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Rb0 1wp0 Rb0 1wp0 TX0 A4p0 uL0 1qN0 WL0|\",\"America/Argentina/Catamarca|CMT -04 -03 -02|4g.M 40 30 20|01212121212121212121212121212121212121212123232323132321232|-20UHH.c pKnH.c Mn0 1iN0 Tb0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 MN0 2jz0 MN0 4lX0 u10 5Lb0 1pB0 Fnz0 u10 uL0 1vd0 SL0 1vd0 SL0 1vd0 17z0 1cN0 1fz0 1cN0 1cL0 1cN0 asn0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Rb0 1wq0 Ra0 1wp0 TX0 rlB0 7B0 8zb0 uL0|\",\"America/Argentina/Cordoba|CMT -04 -03 -02|4g.M 40 30 20|01212121212121212121212121212121212121212123232323132323232|-20UHH.c pKnH.c Mn0 1iN0 Tb0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 MN0 2jz0 MN0 4lX0 u10 5Lb0 1pB0 Fnz0 u10 uL0 1vd0 SL0 1vd0 SL0 1vd0 17z0 1cN0 1fz0 1cN0 1cL0 1cN0 asn0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Rb0 1wq0 Ra0 1wp0 TX0 A4p0 uL0 1qN0 WL0|\",\"America/Argentina/Jujuy|CMT -04 -03 -02|4g.M 40 30 20|012121212121212121212121212121212121212121232323121323232|-20UHH.c pKnH.c Mn0 1iN0 Tb0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 MN0 2jz0 MN0 4lX0 u10 5Lb0 1pB0 Fnz0 u10 uL0 1vd0 SL0 1vd0 SL0 1vd0 17z0 1cN0 1fz0 1cN0 1cL0 1cN0 asn0 Db0 zvd0 Bz0 1tB0 TX0 1ze0 TX0 1ld0 WK0 1wp0 TX0 A4p0 uL0|\",\"America/Argentina/La_Rioja|CMT -04 -03 -02|4g.M 40 30 20|012121212121212121212121212121212121212121232323231232321232|-20UHH.c pKnH.c Mn0 1iN0 Tb0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 MN0 2jz0 MN0 4lX0 u10 5Lb0 1pB0 Fnz0 u10 uL0 1vd0 SL0 1vd0 SL0 1vd0 17z0 1cN0 1fz0 1cN0 1cL0 1cN0 asn0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Qn0 qO0 16n0 Rb0 1wp0 TX0 rlB0 7B0 8zb0 uL0|\",\"America/Argentina/Mendoza|CMT -04 -03 -02|4g.M 40 30 20|01212121212121212121212121212121212121212123232312121321232|-20UHH.c pKnH.c Mn0 1iN0 Tb0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 MN0 2jz0 MN0 4lX0 u10 5Lb0 1pB0 Fnz0 u10 uL0 1vd0 SL0 1vd0 SL0 1vd0 17z0 1cN0 1fz0 1cN0 1cL0 1cN0 asn0 Db0 zvd0 Bz0 1tB0 TX0 1u20 SL0 1vd0 Tb0 1wp0 TW0 ri10 Op0 7TX0 uL0|\",\"America/Argentina/Rio_Gallegos|CMT -04 -03 -02|4g.M 40 30 20|01212121212121212121212121212121212121212123232323232321232|-20UHH.c pKnH.c Mn0 1iN0 Tb0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 MN0 2jz0 MN0 4lX0 u10 5Lb0 1pB0 Fnz0 u10 uL0 1vd0 SL0 1vd0 SL0 1vd0 17z0 1cN0 1fz0 1cN0 1cL0 1cN0 asn0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Rb0 1wp0 Rb0 1wp0 TX0 rlB0 7B0 8zb0 uL0|\",\"America/Argentina/Salta|CMT -04 -03 -02|4g.M 40 30 20|012121212121212121212121212121212121212121232323231323232|-20UHH.c pKnH.c Mn0 1iN0 Tb0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 MN0 2jz0 MN0 4lX0 u10 5Lb0 1pB0 Fnz0 u10 uL0 1vd0 SL0 1vd0 SL0 1vd0 17z0 1cN0 1fz0 1cN0 1cL0 1cN0 asn0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Rb0 1wq0 Ra0 1wp0 TX0 A4p0 uL0|\",\"America/Argentina/San_Juan|CMT -04 -03 -02|4g.M 40 30 20|012121212121212121212121212121212121212121232323231232321232|-20UHH.c pKnH.c Mn0 1iN0 Tb0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 MN0 2jz0 MN0 4lX0 u10 5Lb0 1pB0 Fnz0 u10 uL0 1vd0 SL0 1vd0 SL0 1vd0 17z0 1cN0 1fz0 1cN0 1cL0 1cN0 asn0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Qn0 qO0 16n0 Rb0 1wp0 TX0 rld0 m10 8lb0 uL0|\",\"America/Argentina/San_Luis|CMT -04 -03 -02|4g.M 40 30 20|012121212121212121212121212121212121212121232323121212321212|-20UHH.c pKnH.c Mn0 1iN0 Tb0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 MN0 2jz0 MN0 4lX0 u10 5Lb0 1pB0 Fnz0 u10 uL0 1vd0 SL0 1vd0 SL0 1vd0 17z0 1cN0 1fz0 1cN0 1cL0 1cN0 asn0 Db0 zvd0 Bz0 1tB0 XX0 1q20 SL0 AN0 vDb0 m10 8lb0 8L0 jd0 1qN0 WL0 1qN0|\",\"America/Argentina/Tucuman|CMT -04 -03 -02|4g.M 40 30 20|0121212121212121212121212121212121212121212323232313232123232|-20UHH.c pKnH.c Mn0 1iN0 Tb0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 MN0 2jz0 MN0 4lX0 u10 5Lb0 1pB0 Fnz0 u10 uL0 1vd0 SL0 1vd0 SL0 1vd0 17z0 1cN0 1fz0 1cN0 1cL0 1cN0 asn0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Rb0 1wq0 Ra0 1wp0 TX0 rlB0 4N0 8BX0 uL0 1qN0 WL0|\",\"America/Argentina/Ushuaia|CMT -04 -03 -02|4g.M 40 30 20|01212121212121212121212121212121212121212123232323232321232|-20UHH.c pKnH.c Mn0 1iN0 Tb0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 MN0 2jz0 MN0 4lX0 u10 5Lb0 1pB0 Fnz0 u10 uL0 1vd0 SL0 1vd0 SL0 1vd0 17z0 1cN0 1fz0 1cN0 1cL0 1cN0 asn0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Rb0 1wp0 Rb0 1wp0 TX0 rkN0 8p0 8zb0 uL0|\",\"America/Curacao|LMT -0430 AST|4z.L 4u 40|012|-2kV7o.d 28KLS.d|15e4\",\"America/Asuncion|AMT -04 -03|3O.E 40 30|012121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212|-1x589.k 1DKM9.k 3CL0 3Dd0 10L0 1pB0 10n0 1pB0 10n0 1pB0 1cL0 1dd0 1db0 1dd0 1cL0 1dd0 1cL0 1dd0 1cL0 1dd0 1db0 1dd0 1cL0 1dd0 1cL0 1dd0 1cL0 1dd0 1db0 1dd0 1cL0 1lB0 14n0 1dd0 1cL0 1fd0 WL0 1rd0 1aL0 1dB0 Xz0 1qp0 Xb0 1qN0 10L0 1rB0 TX0 1tB0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 1cL0 WN0 1qL0 11B0 1nX0 1ip0 WL0 1qN0 WL0 1qN0 WL0 1tB0 TX0 1tB0 TX0 1tB0 19X0 1a10 1fz0 1a10 1fz0 1cN0 17b0 1ip0 17b0 1ip0 17b0 1ip0 19X0 1fB0 19X0 1fB0 19X0 1ip0 17b0 1ip0 17b0 1ip0 19X0 1fB0 19X0 1fB0 19X0 1fB0 19X0 1ip0 17b0 1ip0 17b0 1ip0 19X0 1fB0 19X0 1fB0 19X0 1ip0 17b0 1ip0 17b0 1ip0 19X0 1fB0 19X0 1fB0 19X0 1fB0 19X0 1ip0 17b0 1ip0 17b0 1ip0|28e5\",\"America/Atikokan|CST CDT CWT CPT EST|60 50 50 50 50|0101234|-25TQ0 1in0 Rnb0 3je0 8x30 iw0|28e2\",\"America/Bahia_Banderas|LMT MST CST PST MDT CDT|71 70 60 80 60 50|0121212131414141414141414141414141414152525252525252525252525252525252525252525252525252525252|-1UQF0 deL0 8lc0 17c0 10M0 1dd0 otX0 gmN0 P2N0 13Vd0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nW0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0|84e3\",\"America/Bahia|LMT -03 -02|2y.4 30 20|01212121212121212121212121212121212121212121212121212121212121|-2glxp.U HdLp.U 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 qe10 xb0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 1EN0 Lz0 1C10 IL0 1HB0 Db0 1HB0 On0 1zd0 On0 1zd0 Lz0 1zd0 Rb0 1wN0 Wn0 1tB0 Rb0 1tB0 WL0 1tB0 Rb0 1zd0 On0 1HB0 FX0 l5B0 Rb0|27e5\",\"America/Barbados|LMT BMT AST ADT|3W.t 3W.t 40 30|01232323232|-1Q0I1.v jsM0 1ODC1.v IL0 1ip0 17b0 1ip0 17b0 1ld0 13b0|28e4\",\"America/Belem|LMT -03 -02|3d.U 30 20|012121212121212121212121212121|-2glwK.4 HdKK.4 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 qe10 xb0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0|20e5\",\"America/Belize|LMT CST -0530 CDT|5Q.M 60 5u 50|01212121212121212121212121212121212121212121212121213131|-2kBu7.c fPA7.c Onu 1zcu Rbu 1wou Rbu 1wou Rbu 1zcu Onu 1zcu Onu 1zcu Rbu 1wou Rbu 1wou Rbu 1wou Rbu 1zcu Onu 1zcu Onu 1zcu Rbu 1wou Rbu 1wou Rbu 1zcu Onu 1zcu Onu 1zcu Onu 1zcu Rbu 1wou Rbu 1wou Rbu 1zcu Onu 1zcu Onu 1zcu Rbu 1wou Rbu 1f0Mu qn0 lxB0 mn0|57e3\",\"America/Blanc-Sablon|AST ADT AWT APT|40 30 30 30|010230|-25TS0 1in0 UGp0 8x50 iu0|11e2\",\"America/Boa_Vista|LMT -04 -03|42.E 40 30|0121212121212121212121212121212121|-2glvV.k HdKV.k 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 qe10 xb0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0 smp0 WL0 1tB0 2L0|62e2\",\"America/Bogota|BMT -05 -04|4U.g 50 40|0121|-2eb73.I 38yo3.I 2en0|90e5\",\"America/Boise|PST PDT MST MWT MPT MDT|80 70 70 60 60 60|0101023425252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252|-261q0 1nX0 11B0 1nX0 8C10 JCL0 8x20 ix0 QwN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 Dd0 1Kn0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|21e4\",\"America/Cambridge_Bay|-00 MST MWT MPT MDDT MDT CST CDT EST|0 70 60 60 50 60 60 50 50|0123141515151515151515151515151515151515151515678651515151515151515151515151515151515151515151515151515151515151515151515151|-21Jc0 RO90 8x20 ix0 LCL0 1fA0 zgO0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11A0 1nX0 2K0 WQ0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|15e2\",\"America/Campo_Grande|LMT -04 -03|3C.s 40 30|01212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2glwl.w HdLl.w 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 qe10 xb0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 1EN0 Lz0 1C10 IL0 1HB0 Db0 1HB0 On0 1zd0 On0 1zd0 Lz0 1zd0 Rb0 1wN0 Wn0 1tB0 Rb0 1tB0 WL0 1tB0 Rb0 1zd0 On0 1HB0 FX0 1C10 Lz0 1Ip0 HX0 1zd0 On0 1HB0 IL0 1wp0 On0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 Rb0 1zd0 Lz0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 On0 1zd0 On0 1HB0 FX0|77e4\",\"America/Cancun|LMT CST EST EDT CDT|5L.4 60 50 40 50|0123232341414141414141414141414141414141412|-1UQG0 2q2o0 yLB0 1lb0 14p0 1lb0 14p0 Lz0 xB0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 Dd0|63e4\",\"America/Caracas|CMT -0430 -04|4r.E 4u 40|01212|-2kV7w.k 28KM2.k 1IwOu kqo0|29e5\",\"America/Cayenne|LMT -04 -03|3t.k 40 30|012|-2mrwu.E 2gWou.E|58e3\",\"America/Panama|CMT EST|5j.A 50|01|-2uduE.o|15e5\",\"America/Chicago|CST CDT EST CWT CPT|60 50 50 50 50|01010101010101010101010101010101010102010101010103401010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-261s0 1nX0 11B0 1nX0 1wp0 TX0 WN0 1qL0 1cN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 11B0 1Hz0 14p0 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 RB0 8x30 iw0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|92e5\",\"America/Chihuahua|LMT MST CST CDT MDT|74.k 70 60 50 60|0121212323241414141414141414141414141414141414141414141414141414141414141414141414141414141|-1UQF0 deL0 8lc0 17c0 10M0 1dd0 2zQN0 1lb0 14p0 1lb0 14q0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0|81e4\",\"America/Costa_Rica|SJMT CST CDT|5A.d 60 50|0121212121|-1Xd6n.L 2lu0n.L Db0 1Kp0 Db0 pRB0 15b0 1kp0 mL0|12e5\",\"America/Creston|MST PST|70 80|010|-29DR0 43B0|53e2\",\"America/Cuiaba|LMT -04 -03|3I.k 40 30|012121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2glwf.E HdLf.E 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 qe10 xb0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 1EN0 Lz0 1C10 IL0 1HB0 Db0 1HB0 On0 1zd0 On0 1zd0 Lz0 1zd0 Rb0 1wN0 Wn0 1tB0 Rb0 1tB0 WL0 1tB0 Rb0 1zd0 On0 1HB0 FX0 4a10 HX0 1zd0 On0 1HB0 IL0 1wp0 On0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 Rb0 1zd0 Lz0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 On0 1zd0 On0 1HB0 FX0|54e4\",\"America/Danmarkshavn|LMT -03 -02 GMT|1e.E 30 20 0|01212121212121212121212121212121213|-2a5WJ.k 2z5fJ.k 19U0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 DC0|8\",\"America/Dawson_Creek|PST PDT PWT PPT MST|80 70 70 70 70|0102301010101010101010101010101010101010101010101010101014|-25TO0 1in0 UGp0 8x10 iy0 3NB0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 ML0|12e3\",\"America/Dawson|YST YDT YWT YPT YDDT PST PDT|90 80 80 80 70 80 70|0101023040565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565|-25TN0 1in0 1o10 13V0 Ser0 8x00 iz0 LCL0 1fA0 jrA0 fNd0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|13e2\",\"America/Denver|MST MDT MWT MPT|70 60 60 60|01010101023010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-261r0 1nX0 11B0 1nX0 11B0 1qL0 WN0 mn0 Ord0 8x20 ix0 LCN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|26e5\",\"America/Detroit|LMT CST EST EWT EPT EDT|5w.b 60 50 40 40 40|0123425252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252|-2Cgir.N peqr.N 156L0 8x40 iv0 6fd0 11z0 JxX1 SMX 1cN0 1cL0 aW10 1cL0 s10 1Vz0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|37e5\",\"America/Edmonton|LMT MST MDT MWT MPT|7x.Q 70 60 60 60|0121212121212134121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2yd4q.8 shdq.8 1in0 17d0 hz0 2dB0 1fz0 1a10 11z0 1qN0 WL0 1qN0 11z0 IGN0 8x20 ix0 3NB0 11z0 XQp0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|10e5\",\"America/Eirunepe|LMT -05 -04|4D.s 50 40|0121212121212121212121212121212121|-2glvk.w HdLk.w 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 qe10 xb0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0 dPB0 On0 yTd0 d5X0|31e3\",\"America/El_Salvador|LMT CST CDT|5U.M 60 50|012121|-1XiG3.c 2Fvc3.c WL0 1qN0 WL0|11e5\",\"America/Tijuana|LMT MST PST PDT PWT PPT|7M.4 70 80 70 70 70|012123245232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232|-1UQE0 4PX0 8mM0 8lc0 SN0 1cL0 pHB0 83r0 zI0 5O10 1Rz0 cOO0 11A0 1o00 11A0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 BUp0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 U10 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|20e5\",\"America/Fort_Nelson|PST PDT PWT PPT MST|80 70 70 70 70|01023010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010104|-25TO0 1in0 UGp0 8x10 iy0 3NB0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0|39e2\",\"America/Fort_Wayne|CST CDT CWT CPT EST EDT|60 50 50 50 50 40|010101023010101010101010101040454545454545454545454545454545454545454545454545454545454545454545454|-261s0 1nX0 11B0 1nX0 QI10 Db0 RB0 8x30 iw0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 5Tz0 1o10 qLb0 1cL0 1cN0 1cL0 1qhd0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|\",\"America/Fortaleza|LMT -03 -02|2y 30 20|0121212121212121212121212121212121212121|-2glxq HdLq 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 qe10 xb0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 nsp0 WL0 1tB0 5z0 2mN0 On0|34e5\",\"America/Glace_Bay|LMT AST ADT AWT APT|3X.M 40 30 30 30|012134121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2IsI0.c CwO0.c 1in0 UGp0 8x50 iu0 iq10 11z0 Jg10 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|19e3\",\"America/Godthab|LMT -03 -02|3q.U 30 20|0121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2a5Ux.4 2z5dx.4 19U0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|17e3\",\"America/Goose_Bay|NST NDT NST NDT NWT NPT AST ADT ADDT|3u.Q 2u.Q 3u 2u 2u 2u 40 30 20|010232323232323245232323232323232323232323232323232323232326767676767676767676767676767676767676767676768676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676|-25TSt.8 1in0 DXb0 2HbX.8 WL0 1qN0 WL0 1qN0 WL0 1tB0 TX0 1tB0 WL0 1qN0 WL0 1qN0 7UHu itu 1tB0 WL0 1qN0 WL0 1qN0 WL0 1qN0 WL0 1tB0 WL0 1ld0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 S10 g0u 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14n1 1lb0 14p0 1nW0 11C0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zcX Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|76e2\",\"America/Grand_Turk|KMT EST EDT AST|57.a 50 40 40|01212121212121212121212121212121212121212121212121212121212121212121212121232121212121212121212121212121212121212121|-2l1uQ.O 2HHBQ.O 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 5Ip0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|37e2\",\"America/Guatemala|LMT CST CDT|62.4 60 50|0121212121|-24KhV.U 2efXV.U An0 mtd0 Nz0 ifB0 17b0 zDB0 11z0|13e5\",\"America/Guayaquil|QMT -05 -04|5e 50 40|0121|-1yVSK 2uILK rz0|27e5\",\"America/Guyana|LMT -0345 -03 -04|3Q.E 3J 30 40|0123|-2dvU7.k 2r6LQ.k Bxbf|80e4\",\"America/Halifax|LMT AST ADT AWT APT|4e.o 40 30 30 30|0121212121212121212121212121212121212121212121212134121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2IsHJ.A xzzJ.A 1db0 3I30 1in0 3HX0 IL0 1E10 ML0 1yN0 Pb0 1Bd0 Mn0 1Bd0 Rz0 1w10 Xb0 1w10 LX0 1w10 Xb0 1w10 Lz0 1C10 Jz0 1E10 OL0 1yN0 Un0 1qp0 Xb0 1qp0 11X0 1w10 Lz0 1HB0 LX0 1C10 FX0 1w10 Xb0 1qp0 Xb0 1BB0 LX0 1td0 Xb0 1qp0 Xb0 Rf0 8x50 iu0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 3Qp0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 3Qp0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 6i10 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|39e4\",\"America/Havana|HMT CST CDT|5t.A 50 40|012121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-1Meuu.o 72zu.o ML0 sld0 An0 1Nd0 Db0 1Nd0 An0 6Ep0 An0 1Nd0 An0 JDd0 Mn0 1Ap0 On0 1fd0 11X0 1qN0 WL0 1wp0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 14n0 1ld0 14L0 1kN0 15b0 1kp0 1cL0 1cN0 1fz0 1a10 1fz0 1fB0 11z0 14p0 1nX0 11B0 1nX0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 14n0 1ld0 14n0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 1a10 1in0 1a10 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 17c0 1o00 11A0 1qM0 11A0 1o00 11A0 1o00 14o0 1lc0 14o0 1lc0 11A0 6i00 Rc0 1wo0 U00 1tA0 Rc0 1wo0 U00 1wo0 U00 1zc0 U00 1qM0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0|21e5\",\"America/Hermosillo|LMT MST CST PST MDT|7n.Q 70 60 80 60|0121212131414141|-1UQF0 deL0 8lc0 17c0 10M0 1dd0 otX0 gmN0 P2N0 13Vd0 1lb0 14p0 1lb0 14p0 1lb0|64e4\",\"America/Indiana/Knox|CST CDT CWT CPT EST|60 50 50 50 50|0101023010101010101010101010101010101040101010101010101010101010101010101010101010101010141010101010101010101010101010101010101010101010101010101010101010|-261s0 1nX0 11B0 1nX0 SgN0 8x30 iw0 3NB0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 1fz0 1cN0 1cL0 1cN0 11z0 1o10 11z0 1o10 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 3Cn0 8wp0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 z8o0 1o00 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|\",\"America/Indiana/Marengo|CST CDT CWT CPT EST EDT|60 50 50 50 50 40|0101023010101010101010104545454545414545454545454545454545454545454545454545454545454545454545454545454|-261s0 1nX0 11B0 1nX0 SgN0 8x30 iw0 dyN0 11z0 6fd0 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 jrz0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1VA0 LA0 1BX0 1e6p0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|\",\"America/Indiana/Petersburg|CST CDT CWT CPT EST EDT|60 50 50 50 50 40|01010230101010101010101010104010101010101010101010141014545454545454545454545454545454545454545454545454545454545454|-261s0 1nX0 11B0 1nX0 SgN0 8x30 iw0 njX0 WN0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 3Fb0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 19co0 1o00 Rd0 1zb0 Oo0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|\",\"America/Indiana/Tell_City|CST CDT CWT CPT EST EDT|60 50 50 50 50 40|01010230101010101010101010401054541010101010101010101010101010101010101010101010101010101010101010|-261s0 1nX0 11B0 1nX0 SgN0 8x30 iw0 njX0 WN0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 8wn0 1cN0 1cL0 1cN0 1cK0 1cN0 1cL0 1qhd0 1o00 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|\",\"America/Indiana/Vevay|CST CDT CWT CPT EST EDT|60 50 50 50 50 40|010102304545454545454545454545454545454545454545454545454545454545454545454545454|-261s0 1nX0 11B0 1nX0 SgN0 8x30 iw0 kPB0 Awn0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1lnd0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|\",\"America/Indiana/Vincennes|CST CDT CWT CPT EST EDT|60 50 50 50 50 40|01010230101010101010101010101010454541014545454545454545454545454545454545454545454545454545454545454|-261s0 1nX0 11B0 1nX0 SgN0 8x30 iw0 1o10 11z0 g0p0 11z0 1o10 11z0 1qL0 WN0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 1fz0 1cN0 WL0 1qN0 1cL0 1cN0 1cL0 1cN0 caL0 1cL0 1cN0 1cL0 1qhd0 1o00 Rd0 1zb0 Oo0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|\",\"America/Indiana/Winamac|CST CDT CWT CPT EST EDT|60 50 50 50 50 40|01010230101010101010101010101010101010454541054545454545454545454545454545454545454545454545454545454545454|-261s0 1nX0 11B0 1nX0 SgN0 8x30 iw0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 1fz0 1cN0 1cL0 1cN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 jrz0 1cL0 1cN0 1cL0 1qhd0 1o00 Rd0 1za0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|\",\"America/Inuvik|-00 PST PDDT MST MDT|0 80 60 70 60|0121343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343|-FnA0 tWU0 1fA0 wPe0 2pz0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|35e2\",\"America/Iqaluit|-00 EWT EPT EST EDDT EDT CST CDT|0 40 40 50 30 40 60 50|01234353535353535353535353535353535353535353567353535353535353535353535353535353535353535353535353535353535353535353535353|-16K00 7nX0 iv0 LCL0 1fA0 zgO0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11C0 1nX0 11A0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|67e2\",\"America/Jamaica|KMT EST EDT|57.a 50 40|0121212121212121212121|-2l1uQ.O 2uM1Q.O 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0|94e4\",\"America/Juneau|PST PWT PPT PDT YDT YST AKST AKDT|80 70 70 70 80 90 90 80|01203030303030303030303030403030356767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676|-17T20 8x10 iy0 Vo10 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cM0 1cM0 1cL0 1cN0 1fz0 1a10 1fz0 co0 10q0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|33e3\",\"America/Kentucky/Louisville|CST CDT CWT CPT EST EDT|60 50 50 50 50 40|0101010102301010101010101010101010101454545454545414545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454|-261s0 1nX0 11B0 1nX0 3Fd0 Nb0 LPd0 11z0 RB0 8x30 iw0 1nX1 e0X 9vd0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 xz0 gso0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1VA0 LA0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|\",\"America/Kentucky/Monticello|CST CDT CWT CPT EST EDT|60 50 50 50 50 40|0101023010101010101010101010101010101010101010101010101010101010101010101454545454545454545454545454545454545454545454545454545454545454545454545454|-261s0 1nX0 11B0 1nX0 SgN0 8x30 iw0 SWp0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11A0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|\",\"America/La_Paz|CMT BST -04|4w.A 3w.A 40|012|-1x37r.o 13b0|19e5\",\"America/Lima|LMT -05 -04|58.A 50 40|0121212121212121|-2tyGP.o 1bDzP.o zX0 1aN0 1cL0 1cN0 1cL0 1PrB0 zX0 1O10 zX0 6Gp0 zX0 98p0 zX0|11e6\",\"America/Los_Angeles|PST PDT PWT PPT|80 70 70 70|010102301010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-261q0 1nX0 11B0 1nX0 SgN0 8x10 iy0 5Wp1 1VaX 3dA0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1a00 1fA0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|15e6\",\"America/Maceio|LMT -03 -02|2m.Q 30 20|012121212121212121212121212121212121212121|-2glxB.8 HdLB.8 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 qe10 xb0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 dMN0 Lz0 8Q10 WL0 1tB0 5z0 2mN0 On0|93e4\",\"America/Managua|MMT CST EST CDT|5J.c 60 50 50|0121313121213131|-1quie.M 1yAMe.M 4mn0 9Up0 Dz0 1K10 Dz0 s3F0 1KH0 DB0 9In0 k8p0 19X0 1o30 11y0|22e5\",\"America/Manaus|LMT -04 -03|40.4 40 30|01212121212121212121212121212121|-2glvX.U HdKX.U 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 qe10 xb0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0 dPB0 On0|19e5\",\"America/Martinique|FFMT AST ADT|44.k 40 30|0121|-2mPTT.E 2LPbT.E 19X0|39e4\",\"America/Matamoros|LMT CST CDT|6E 60 50|0121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-1UQG0 2FjC0 1nX0 i6p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 U10 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|45e4\",\"America/Mazatlan|LMT MST CST PST MDT|75.E 70 60 80 60|0121212131414141414141414141414141414141414141414141414141414141414141414141414141414141414141|-1UQF0 deL0 8lc0 17c0 10M0 1dd0 otX0 gmN0 P2N0 13Vd0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0|44e4\",\"America/Menominee|CST CDT CWT CPT EST|60 50 50 50 50|01010230101041010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-261s0 1nX0 11B0 1nX0 SgN0 8x30 iw0 1o10 11z0 LCN0 1fz0 6410 9Jb0 1cM0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|85e2\",\"America/Merida|LMT CST EST CDT|5W.s 60 50 50|0121313131313131313131313131313131313131313131313131313131313131313131313131313131313131|-1UQG0 2q2o0 2hz0 wu30 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0|11e5\",\"America/Metlakatla|PST PWT PPT PDT AKST AKDT|80 70 70 70 90 80|01203030303030303030303030303030304545450454545454545454545454545454545454545454|-17T20 8x10 iy0 Vo10 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1hU10 Rd0 1zb0 Op0 1zb0 Op0 1zb0 uM0 jB0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|14e2\",\"America/Mexico_City|LMT MST CST CDT CWT|6A.A 70 60 50 50|012121232324232323232323232323232323232323232323232323232323232323232323232323232323232323232323232|-1UQF0 deL0 8lc0 17c0 10M0 1dd0 gEn0 TX0 3xd0 Jb0 6zB0 SL0 e5d0 17b0 1Pff0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0|20e6\",\"America/Miquelon|LMT AST -03 -02|3I.E 40 30 20|012323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232|-2mKkf.k 2LTAf.k gQ10 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|61e2\",\"America/Moncton|EST AST ADT AWT APT|50 40 30 30 30|012121212121212121212134121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2IsH0 CwN0 1in0 zAo0 An0 1Nd0 An0 1Nd0 An0 1Nd0 An0 1Nd0 An0 1Nd0 An0 1K10 Lz0 1zB0 NX0 1u10 Wn0 S20 8x50 iu0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 3Cp0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14n1 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 ReX 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|64e3\",\"America/Monterrey|LMT CST CDT|6F.g 60 50|0121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-1UQG0 2FjC0 1nX0 i6p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0|41e5\",\"America/Montevideo|LMT MMT -04 -03 -0330 -0230 -02 -0130|3I.P 3I.P 40 30 3u 2u 20 1u|012343434343434343434343435353636353636375363636363636363636363636363636363636363636363|-2tRUf.9 sVc0 8jcf.9 1db0 1dcu 1cLu 1dcu 1cLu ircu 11zu 1o0u 11zu 1o0u 11zu 1o0u 11zu 1qMu WLu 1qMu WLu 1fAu 1cLu 1o0u 11zu NAu 3jXu zXu Dq0u 19Xu pcu jz0 cm10 19X0 6tB0 1fbu 3o0u jX0 4vB0 xz0 3Cp0 mmu 1a10 IMu Db0 4c10 uL0 1Nd0 An0 1SN0 uL0 mp0 28L0 iPB0 un0 1SN0 xz0 1zd0 Lz0 1zd0 Rb0 1zd0 On0 1wp0 Rb0 s8p0 1fB0 1ip0 11z0 1ld0 14n0 1o10 11z0 1o10 11z0 1o10 14n0 1ld0 14n0 1ld0 14n0 1o10 11z0 1o10 11z0 1o10 11z0|17e5\",\"America/Toronto|EST EDT EWT EPT|50 40 40 40|01010101010101010101010101010101010101010101012301010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-25TR0 1in0 11Wu 1nzu 1fD0 WJ0 1wr0 Nb0 1Ap0 On0 1zd0 On0 1wp0 TX0 1tB0 TX0 1tB0 TX0 1tB0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 4kM0 8x40 iv0 1o10 11z0 1nX0 11z0 1o10 11z0 1o10 1qL0 11D0 1nX0 11B0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|65e5\",\"America/Nassau|LMT EST EDT|59.u 50 40|012121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2kNuO.u 26XdO.u 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|24e4\",\"America/New_York|EST EDT EWT EPT|50 40 40 40|01010101010101010101010101010101010101010101010102301010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-261t0 1nX0 11B0 1nX0 11B0 1qL0 1a10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 RB0 8x40 iv0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|21e6\",\"America/Nipigon|EST EDT EWT EPT|50 40 40 40|010123010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-25TR0 1in0 Rnb0 3je0 8x40 iv0 19yN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|16e2\",\"America/Nome|NST NWT NPT BST BDT YST AKST AKDT|b0 a0 a0 b0 a0 90 90 80|012034343434343434343434343434343456767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676|-17SX0 8wW0 iB0 Qlb0 52O0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 cl0 10q0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|38e2\",\"America/Noronha|LMT -02 -01|29.E 20 10|0121212121212121212121212121212121212121|-2glxO.k HdKO.k 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 qe10 xb0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 nsp0 WL0 1tB0 2L0 2pB0 On0|30e2\",\"America/North_Dakota/Beulah|MST MDT MWT MPT CST CDT|70 60 60 60 60 50|010102301010101010101010101010101010101010101010101010101010101010101010101010101010101010101014545454545454545454545454545454545454545454545454545454|-261r0 1nX0 11B0 1nX0 SgN0 8x20 ix0 QwN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Oo0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|\",\"America/North_Dakota/Center|MST MDT MWT MPT CST CDT|70 60 60 60 60 50|010102301010101010101010101010101010101010101010101010101014545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454|-261r0 1nX0 11B0 1nX0 SgN0 8x20 ix0 QwN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14o0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|\",\"America/North_Dakota/New_Salem|MST MDT MWT MPT CST CDT|70 60 60 60 60 50|010102301010101010101010101010101010101010101010101010101010101010101010101010101454545454545454545454545454545454545454545454545454545454545454545454|-261r0 1nX0 11B0 1nX0 SgN0 8x20 ix0 QwN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14o0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|\",\"America/Ojinaga|LMT MST CST CDT MDT|6V.E 70 60 50 60|0121212323241414141414141414141414141414141414141414141414141414141414141414141414141414141|-1UQF0 deL0 8lc0 17c0 10M0 1dd0 2zQN0 1lb0 14p0 1lb0 14q0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 U10 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|23e3\",\"America/Pangnirtung|-00 AST AWT APT ADDT ADT EDT EST CST CDT|0 40 30 30 20 30 40 50 60 50|012314151515151515151515151515151515167676767689767676767676767676767676767676767676767676767676767676767676767676767676767|-1XiM0 PnG0 8x50 iu0 LCL0 1fA0 zgO0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1o00 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11C0 1nX0 11A0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|14e2\",\"America/Paramaribo|LMT PMT PMT -0330 -03|3E.E 3E.Q 3E.A 3u 30|01234|-2nDUj.k Wqo0.c qanX.I 1yVXN.o|24e4\",\"America/Phoenix|MST MDT MWT|70 60 60|01010202010|-261r0 1nX0 11B0 1nX0 SgN0 4Al1 Ap0 1db0 SWqX 1cL0|42e5\",\"America/Port-au-Prince|PPMT EST EDT|4N 50 40|01212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-28RHb 2FnMb 19X0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14q0 1o00 11A0 1o00 11A0 1o00 14o0 1lc0 14o0 1lc0 14o0 1o00 11A0 1o00 11A0 1o00 14o0 1lc0 14o0 1lc0 i6n0 1nX0 11B0 1nX0 d430 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 3iN0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|23e5\",\"America/Rio_Branco|LMT -05 -04|4v.c 50 40|01212121212121212121212121212121|-2glvs.M HdLs.M 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 qe10 xb0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0 NBd0 d5X0|31e4\",\"America/Porto_Velho|LMT -04 -03|4f.A 40 30|012121212121212121212121212121|-2glvI.o HdKI.o 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 qe10 xb0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0|37e4\",\"America/Puerto_Rico|AST AWT APT|40 30 30|0120|-17lU0 7XT0 iu0|24e5\",\"America/Punta_Arenas|SMT -05 -04 -03|4G.K 50 40 30|0102021212121212121232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323|-2q2jh.e fJAh.e 5knG.K 1Vzh.e jRAG.K 1pbh.e 11d0 1oL0 11d0 1oL0 11d0 1oL0 11d0 1pb0 11d0 nHX0 op0 blz0 ko0 Qeo0 WL0 1zd0 On0 1ip0 11z0 1o10 11z0 1qN0 WL0 1ld0 14n0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 WL0 1qN0 1cL0 1cN0 11z0 1o10 11z0 1qN0 WL0 1fB0 19X0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1ip0 1fz0 1fB0 11z0 1qN0 WL0 1qN0 WL0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1o10 19X0 1fB0 1nX0 G10 1EL0 Op0 1zb0 Rd0 1wn0 Rd0 46n0 Ap0|\",\"America/Rainy_River|CST CDT CWT CPT|60 50 50 50|010123010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-25TQ0 1in0 Rnb0 3je0 8x30 iw0 19yN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|842\",\"America/Rankin_Inlet|-00 CST CDDT CDT EST|0 60 40 50 50|012131313131313131313131313131313131313131313431313131313131313131313131313131313131313131313131313131313131313131313131|-vDc0 keu0 1fA0 zgO0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|26e2\",\"America/Recife|LMT -03 -02|2j.A 30 20|0121212121212121212121212121212121212121|-2glxE.o HdLE.o 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 qe10 xb0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 nsp0 WL0 1tB0 2L0 2pB0 On0|33e5\",\"America/Regina|LMT MST MDT MWT MPT CST|6W.A 70 60 60 60 60|012121212121212121212121341212121212121212121212121215|-2AD51.o uHe1.o 1in0 s2L0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 66N0 1cL0 1cN0 19X0 1fB0 1cL0 1fB0 1cL0 1cN0 1cL0 M30 8x20 ix0 1ip0 1cL0 1ip0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 3NB0 1cL0 1cN0|19e4\",\"America/Resolute|-00 CST CDDT CDT EST|0 60 40 50 50|012131313131313131313131313131313131313131313431313131313431313131313131313131313131313131313131313131313131313131313131|-SnA0 GWS0 1fA0 zgO0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|229\",\"America/Santarem|LMT -04 -03|3C.M 40 30|0121212121212121212121212121212|-2glwl.c HdLl.c 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 qe10 xb0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0 NBd0|21e4\",\"America/Santiago|SMT -05 -04 -03|4G.K 50 40 30|010202121212121212321232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323|-2q2jh.e fJAh.e 5knG.K 1Vzh.e jRAG.K 1pbh.e 11d0 1oL0 11d0 1oL0 11d0 1oL0 11d0 1pb0 11d0 nHX0 op0 9Bz0 jb0 1oN0 ko0 Qeo0 WL0 1zd0 On0 1ip0 11z0 1o10 11z0 1qN0 WL0 1ld0 14n0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 WL0 1qN0 1cL0 1cN0 11z0 1o10 11z0 1qN0 WL0 1fB0 19X0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1ip0 1fz0 1fB0 11z0 1qN0 WL0 1qN0 WL0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1o10 19X0 1fB0 1nX0 G10 1EL0 Op0 1zb0 Rd0 1wn0 Rd0 46n0 Ap0 1Nb0 Ap0 1Nb0 Ap0 1zb0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 11B0 1nX0 11B0|62e5\",\"America/Santo_Domingo|SDMT EST EDT -0430 AST|4E 50 40 4u 40|01213131313131414|-1ttjk 1lJMk Mn0 6sp0 Lbu 1Cou yLu 1RAu wLu 1QMu xzu 1Q0u xXu 1PAu 13jB0 e00|29e5\",\"America/Sao_Paulo|LMT -03 -02|36.s 30 20|01212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2glwR.w HdKR.w 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 pTd0 PX0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 1EN0 Lz0 1C10 IL0 1HB0 Db0 1HB0 On0 1zd0 On0 1zd0 Lz0 1zd0 Rb0 1wN0 Wn0 1tB0 Rb0 1tB0 WL0 1tB0 Rb0 1zd0 On0 1HB0 FX0 1C10 Lz0 1Ip0 HX0 1zd0 On0 1HB0 IL0 1wp0 On0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 Rb0 1zd0 Lz0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 On0 1zd0 On0 1HB0 FX0|20e6\",\"America/Scoresbysund|LMT -02 -01 +00|1r.Q 20 10 0|0121323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232|-2a5Ww.8 2z5ew.8 1a00 1cK0 1cL0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|452\",\"America/Sitka|PST PWT PPT PDT YST AKST AKDT|80 70 70 70 90 90 80|01203030303030303030303030303030345656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565|-17T20 8x10 iy0 Vo10 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 co0 10q0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|90e2\",\"America/St_Johns|NST NDT NST NDT NWT NPT NDDT|3u.Q 2u.Q 3u 2u 2u 2u 1u|01010101010101010101010101010101010102323232323232324523232323232323232323232323232323232323232323232323232323232323232323232323232323232326232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232|-28oit.8 14L0 1nB0 1in0 1gm0 Dz0 1JB0 1cL0 1cN0 1cL0 1fB0 19X0 1fB0 19X0 1fB0 19X0 1fB0 19X0 1fB0 1cL0 1cN0 1cL0 1fB0 19X0 1fB0 19X0 1fB0 19X0 1fB0 19X0 1fB0 1cL0 1fB0 19X0 1fB0 19X0 10O0 eKX.8 19X0 1iq0 WL0 1qN0 WL0 1qN0 WL0 1tB0 TX0 1tB0 WL0 1qN0 WL0 1qN0 7UHu itu 1tB0 WL0 1qN0 WL0 1qN0 WL0 1qN0 WL0 1tB0 WL0 1ld0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14n1 1lb0 14p0 1nW0 11C0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zcX Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|11e4\",\"America/Swift_Current|LMT MST MDT MWT MPT CST|7b.k 70 60 60 60 60|012134121212121212121215|-2AD4M.E uHdM.E 1in0 UGp0 8x20 ix0 1o10 17b0 1ip0 11z0 1o10 11z0 1o10 11z0 isN0 1cL0 3Cp0 1cL0 1cN0 11z0 1qN0 WL0 pMp0|16e3\",\"America/Tegucigalpa|LMT CST CDT|5M.Q 60 50|01212121|-1WGGb.8 2ETcb.8 WL0 1qN0 WL0 GRd0 AL0|11e5\",\"America/Thule|LMT AST ADT|4z.8 40 30|012121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2a5To.Q 31NBo.Q 1cL0 1cN0 1cL0 1fB0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|656\",\"America/Thunder_Bay|CST EST EWT EPT EDT|60 50 40 40 40|0123141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141|-2q5S0 1iaN0 8x40 iv0 XNB0 1cL0 1cN0 1fz0 1cN0 1cL0 3Cp0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|11e4\",\"America/Vancouver|PST PDT PWT PPT|80 70 70 70|0102301010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-25TO0 1in0 UGp0 8x10 iy0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|23e5\",\"America/Whitehorse|YST YDT YWT YPT YDDT PST PDT|90 80 80 80 70 80 70|0101023040565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565|-25TN0 1in0 1o10 13V0 Ser0 8x00 iz0 LCL0 1fA0 3NA0 vrd0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|23e3\",\"America/Winnipeg|CST CDT CWT CPT|60 50 50 50|010101023010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-2aIi0 WL0 3ND0 1in0 Jap0 Rb0 aCN0 8x30 iw0 1tB0 11z0 1ip0 11z0 1o10 11z0 1o10 11z0 1rd0 10L0 1op0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 1cL0 1cN0 11z0 6i10 WL0 6i10 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1a00 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1a00 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 14o0 1lc0 14o0 1o00 11A0 1o00 11A0 1o00 14o0 1lc0 14o0 1lc0 14o0 1o00 11A0 1o00 11A0 1o00 14o0 1lc0 14o0 1lc0 14o0 1lc0 14o0 1o00 11A0 1o00 11A0 1o00 14o0 1lc0 14o0 1lc0 14o0 1o00 11A0 1o00 11A0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|66e4\",\"America/Yakutat|YST YWT YPT YDT AKST AKDT|90 80 80 80 90 80|01203030303030303030303030303030304545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454|-17T10 8x00 iz0 Vo10 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 cn0 10q0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|642\",\"America/Yellowknife|-00 MST MWT MPT MDDT MDT|0 70 60 60 50 60|012314151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151|-1pdA0 hix0 8x20 ix0 LCL0 1fA0 zgO0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|19e3\",\"Antarctica/Casey|-00 +08 +11|0 -80 -b0|01212121|-2q00 1DjS0 T90 40P0 KL0 blz0 3m10|10\",\"Antarctica/Davis|-00 +07 +05|0 -70 -50|01012121|-vyo0 iXt0 alj0 1D7v0 VB0 3Wn0 KN0|70\",\"Antarctica/DumontDUrville|-00 +10|0 -a0|0101|-U0o0 cfq0 bFm0|80\",\"Antarctica/Macquarie|AEST AEDT -00 +11|-a0 -b0 0 -b0|0102010101010101010101010101010101010101010101010101010101010101010101010101010101010101013|-29E80 19X0 4SL0 1ayy0 Lvs0 1cM0 1o00 Rc0 1wo0 Rc0 1wo0 U00 1wo0 LA0 1C00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 11A0 1qM0 WM0 1qM0 Oo0 1zc0 Oo0 1zc0 Oo0 1wo0 WM0 1tA0 WM0 1tA0 U00 1tA0 U00 1tA0 11A0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 11A0 1o00 1io0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1cM0 1a00 1io0 1cM0 1cM0 1cM0 1cM0 1cM0|1\",\"Antarctica/Mawson|-00 +06 +05|0 -60 -50|012|-CEo0 2fyk0|60\",\"Pacific/Auckland|NZMT NZST NZST NZDT|-bu -cu -c0 -d0|01020202020202020202020202023232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323|-1GCVu Lz0 1tB0 11zu 1o0u 11zu 1o0u 11zu 1o0u 14nu 1lcu 14nu 1lcu 1lbu 11Au 1nXu 11Au 1nXu 11Au 1nXu 11Au 1nXu 11Au 1qLu WMu 1qLu 11Au 1n1bu IM0 1C00 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1qM0 14o0 1lc0 14o0 1lc0 14o0 1lc0 17c0 1io0 17c0 1io0 17c0 1io0 17c0 1lc0 14o0 1lc0 14o0 1lc0 17c0 1io0 17c0 1io0 17c0 1lc0 14o0 1lc0 14o0 1lc0 17c0 1io0 17c0 1io0 17c0 1io0 17c0 1io0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1io0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00|14e5\",\"Antarctica/Palmer|-00 -03 -04 -02|0 30 40 20|0121212121213121212121212121212121212121212121212121212121212121212121212121212121|-cao0 nD0 1vd0 SL0 1vd0 17z0 1cN0 1fz0 1cN0 1cL0 1cN0 asn0 Db0 jsN0 14N0 11z0 1o10 11z0 1qN0 WL0 1qN0 WL0 1qN0 1cL0 1cN0 11z0 1o10 11z0 1qN0 WL0 1fB0 19X0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1ip0 1fz0 1fB0 11z0 1qN0 WL0 1qN0 WL0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1o10 19X0 1fB0 1nX0 G10 1EL0 Op0 1zb0 Rd0 1wn0 Rd0 46n0 Ap0|40\",\"Antarctica/Rothera|-00 -03|0 30|01|gOo0|130\",\"Antarctica/Syowa|-00 +03|0 -30|01|-vs00|20\",\"Antarctica/Troll|-00 +00 +02|0 0 -20|01212121212121212121212121212121212121212121212121212121212121212121|1puo0 hd0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|40\",\"Antarctica/Vostok|-00 +06|0 -60|01|-tjA0|25\",\"Europe/Oslo|CET CEST|-10 -20|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-2awM0 Qm0 W6o0 5pf0 WM0 1fA0 1cM0 1cM0 1cM0 1cM0 wJc0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1qM0 WM0 zpc0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|62e4\",\"Asia/Riyadh|LMT +03|-36.Q -30|01|-TvD6.Q|57e5\",\"Asia/Almaty|LMT +05 +06 +07|-57.M -50 -60 -70|012323232323232323232321232323232323232323232323232|-1Pc57.M eUo7.M 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0|15e5\",\"Asia/Amman|LMT EET EEST|-2n.I -20 -30|0121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-1yW2n.I 1HiMn.I KL0 1oN0 11b0 1oN0 11b0 1pd0 1dz0 1cp0 11b0 1op0 11b0 fO10 1db0 1e10 1cL0 1cN0 1cL0 1cN0 1fz0 1pd0 10n0 1ld0 14n0 1hB0 15b0 1ip0 19X0 1cN0 1cL0 1cN0 17b0 1ld0 14o0 1lc0 17c0 1io0 17c0 1io0 17c0 1So0 y00 1fc0 1dc0 1co0 1dc0 1cM0 1cM0 1cM0 1o00 11A0 1lc0 17c0 1cM0 1cM0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 4bX0 Dd0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0|25e5\",\"Asia/Anadyr|LMT +12 +13 +14 +11|-bN.U -c0 -d0 -e0 -b0|01232121212121212121214121212121212121212121212121212121212141|-1PcbN.U eUnN.U 23CL0 1db0 2q10 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 2sp0 WM0|13e3\",\"Asia/Aqtau|LMT +04 +05 +06|-3l.4 -40 -50 -60|012323232323232323232123232312121212121212121212|-1Pc3l.4 eUnl.4 24PX0 2pX0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cN0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0|15e4\",\"Asia/Aqtobe|LMT +04 +05 +06|-3M.E -40 -50 -60|0123232323232323232321232323232323232323232323232|-1Pc3M.E eUnM.E 23CL0 3Db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0|27e4\",\"Asia/Ashgabat|LMT +04 +05 +06|-3R.w -40 -50 -60|0123232323232323232323212|-1Pc3R.w eUnR.w 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0|41e4\",\"Asia/Atyrau|LMT +03 +05 +06 +04|-3r.I -30 -50 -60 -40|01232323232323232323242323232323232324242424242|-1Pc3r.I eUor.I 24PW0 2pX0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 2sp0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0|\",\"Asia/Baghdad|BMT +03 +04|-2V.A -30 -40|012121212121212121212121212121212121212121212121212121|-26BeV.A 2ACnV.A 11b0 1cp0 1dz0 1dd0 1db0 1cN0 1cp0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1de0 1dc0 1dc0 1dc0 1cM0 1dc0 1cM0 1dc0 1cM0 1dc0 1dc0 1dc0 1cM0 1dc0 1cM0 1dc0 1cM0 1dc0 1dc0 1dc0 1cM0 1dc0 1cM0 1dc0 1cM0 1dc0 1dc0 1dc0 1cM0 1dc0 1cM0 1dc0 1cM0 1dc0|66e5\",\"Asia/Qatar|LMT +04 +03|-3q.8 -40 -30|012|-21Jfq.8 27BXq.8|96e4\",\"Asia/Baku|LMT +03 +04 +05|-3j.o -30 -40 -50|01232323232323232323232123232323232323232323232323232323232323232|-1Pc3j.o 1jUoj.o WCL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 1cM0 9Je0 1o00 11z0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00|27e5\",\"Asia/Bangkok|BMT +07|-6G.4 -70|01|-218SG.4|15e6\",\"Asia/Barnaul|LMT +06 +07 +08|-5z -60 -70 -80|0123232323232323232323212323232321212121212121212121212121212121212|-21S5z pCnz 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 p90 LE0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0 3rd0|\",\"Asia/Beirut|EET EEST|-20 -30|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-21aq0 1on0 1410 1db0 19B0 1in0 1ip0 WL0 1lQp0 11b0 1oN0 11b0 1oN0 11b0 1pd0 11b0 1oN0 11b0 q6N0 En0 1oN0 11b0 1oN0 11b0 1oN0 11b0 1pd0 11b0 1oN0 11b0 1op0 11b0 dA10 17b0 1iN0 17b0 1iN0 17b0 1iN0 17b0 1vB0 SL0 1mp0 13z0 1iN0 17b0 1iN0 17b0 1jd0 12n0 1a10 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0|22e5\",\"Asia/Bishkek|LMT +05 +06 +07|-4W.o -50 -60 -70|012323232323232323232321212121212121212121212121212|-1Pc4W.o eUnW.o 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2e00 1tX0 17b0 1ip0 17b0 1ip0 17b0 1ip0 17b0 1ip0 19X0 1cPu 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0|87e4\",\"Asia/Brunei|LMT +0730 +08|-7D.E -7u -80|012|-1KITD.E gDc9.E|42e4\",\"Asia/Kolkata|MMT IST +0630|-5l.a -5u -6u|012121|-2zOtl.a 1r2LP.a 1un0 HB0 7zX0|15e6\",\"Asia/Chita|LMT +08 +09 +10|-7x.Q -80 -90 -a0|012323232323232323232321232323232323232323232323232323232323232312|-21Q7x.Q pAnx.Q 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0 3re0|33e4\",\"Asia/Choibalsan|LMT +07 +08 +10 +09|-7C -70 -80 -a0 -90|0123434343434343434343434343434343434343434343424242|-2APHC 2UkoC cKn0 1da0 1dd0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 1cL0 1cN0 1cL0 1cN0 1cL0 6hD0 11z0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 3Db0 h1f0 1cJ0 1cP0 1cJ0|38e3\",\"Asia/Shanghai|CST CDT|-80 -90|010101010101010101010101010|-1c2w0 Rz0 11d0 1wL0 A10 8HX0 1G10 Tz0 1ip0 1jX0 1cN0 11b0 1oN0 aL0 1tU30 Rb0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0|23e6\",\"Asia/Colombo|MMT +0530 +06 +0630|-5j.w -5u -60 -6u|01231321|-2zOtj.w 1rFbN.w 1zzu 7Apu 23dz0 11zu n3cu|22e5\",\"Asia/Dhaka|HMT +0630 +0530 +06 +07|-5R.k -6u -5u -60 -70|0121343|-18LFR.k 1unn.k HB0 m6n0 2kxbu 1i00|16e6\",\"Asia/Damascus|LMT EET EEST|-2p.c -20 -30|01212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-21Jep.c Hep.c 17b0 1ip0 17b0 1ip0 17b0 1ip0 19X0 1xRB0 11X0 1oN0 10L0 1pB0 11b0 1oN0 10L0 1mp0 13X0 1oN0 11b0 1pd0 11b0 1oN0 11b0 1oN0 11b0 1oN0 11b0 1pd0 11b0 1oN0 11b0 1oN0 11b0 1oN0 11b0 1pd0 11b0 1oN0 Nb0 1AN0 Nb0 bcp0 19X0 1gp0 19X0 3ld0 1xX0 Vd0 1Bz0 Sp0 1vX0 10p0 1dz0 1cN0 1cL0 1db0 1db0 1g10 1an0 1ap0 1db0 1fd0 1db0 1cN0 1db0 1dd0 1db0 1cp0 1dz0 1c10 1dX0 1cN0 1db0 1dd0 1db0 1cN0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1db0 1cN0 1db0 1cN0 19z0 1fB0 1qL0 11B0 1on0 Wp0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0|26e5\",\"Asia/Dili|LMT +08 +09|-8m.k -80 -90|01212|-2le8m.k 1dnXm.k 1nfA0 Xld0|19e4\",\"Asia/Dubai|LMT +04|-3F.c -40|01|-21JfF.c|39e5\",\"Asia/Dushanbe|LMT +05 +06 +07|-4z.c -50 -60 -70|012323232323232323232321|-1Pc4z.c eUnz.c 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2hB0|76e4\",\"Asia/Famagusta|LMT EET EEST +03|-2f.M -20 -30 -30|0121212121212121212121212121212121212121212121212121212121212121212121212121212121212312121212121212121212121212121212121212121|-1Vc2f.M 2a3cf.M 1cL0 1qp0 Xz0 19B0 19X0 1fB0 1db0 1cp0 1cL0 1fB0 19X0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 1cL0 1cN0 1cL0 1cN0 1o30 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 15U0 2Ks0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|\",\"Asia/Gaza|EET EEST IST IDT|-20 -30 -20 -30|0101010101010101010101010101010123232323232323232323232323232320101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-1c2q0 5Rb0 10r0 1px0 10N0 1pz0 16p0 1jB0 16p0 1jx0 pBd0 Vz0 1oN0 11b0 1oO0 10N0 1pz0 10N0 1pb0 10N0 1pb0 10N0 1pb0 10N0 1pz0 10N0 1pb0 10N0 1pb0 11d0 1oL0 dW0 hfB0 Db0 1fB0 Rb0 bXd0 gM0 8Q00 IM0 1wM0 11z0 1C10 IL0 1s10 10n0 1o10 WL0 1zd0 On0 1ld0 11z0 1o10 14n0 1o10 14n0 1nd0 12n0 1nd0 Xz0 1q10 12n0 M10 C00 17c0 1io0 17c0 1io0 17c0 1o00 1cL0 1fB0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 17c0 1io0 18N0 1bz0 19z0 1gp0 1610 1iL0 11z0 1o10 14o0 1lA1 SKX 1xd1 MKX 1AN0 1a00 1fA0 1cL0 1cN0 1nX0 1210 1nz0 1220 1qL0 WN0 1qL0 WN0 1qL0 11c0 1oo0 11c0 1rc0 Wo0 1rc0 Wo0 1rc0 11c0 1oo0 11c0 1oo0 11c0 1oo0 11c0 1rc0 Wo0 1rc0 11c0 1oo0 11c0 1oo0 11c0 1oo0 11c0 1oo0 11c0 1rc0 Wo0 1rc0 11c0 1oo0 11c0 1oo0 11c0 1oo0 11c0 1rc0|18e5\",\"Asia/Hebron|EET EEST IST IDT|-20 -30 -20 -30|010101010101010101010101010101012323232323232323232323232323232010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-1c2q0 5Rb0 10r0 1px0 10N0 1pz0 16p0 1jB0 16p0 1jx0 pBd0 Vz0 1oN0 11b0 1oO0 10N0 1pz0 10N0 1pb0 10N0 1pb0 10N0 1pb0 10N0 1pz0 10N0 1pb0 10N0 1pb0 11d0 1oL0 dW0 hfB0 Db0 1fB0 Rb0 bXd0 gM0 8Q00 IM0 1wM0 11z0 1C10 IL0 1s10 10n0 1o10 WL0 1zd0 On0 1ld0 11z0 1o10 14n0 1o10 14n0 1nd0 12n0 1nd0 Xz0 1q10 12n0 M10 C00 17c0 1io0 17c0 1io0 17c0 1o00 1cL0 1fB0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 17c0 1io0 18N0 1bz0 19z0 1gp0 1610 1iL0 12L0 1mN0 14o0 1lc0 Tb0 1xd1 MKX bB0 cn0 1cN0 1a00 1fA0 1cL0 1cN0 1nX0 1210 1nz0 1220 1qL0 WN0 1qL0 WN0 1qL0 11c0 1oo0 11c0 1rc0 Wo0 1rc0 Wo0 1rc0 11c0 1oo0 11c0 1oo0 11c0 1oo0 11c0 1rc0 Wo0 1rc0 11c0 1oo0 11c0 1oo0 11c0 1oo0 11c0 1oo0 11c0 1rc0 Wo0 1rc0 11c0 1oo0 11c0 1oo0 11c0 1oo0 11c0 1rc0|25e4\",\"Asia/Ho_Chi_Minh|LMT PLMT +07 +08 +09|-76.E -76.u -70 -80 -90|0123423232|-2yC76.E bK00.a 1h7b6.u 5lz0 18o0 3Oq0 k5b0 aW00 BAM0|90e5\",\"Asia/Hong_Kong|LMT HKT HKST HKWT JST|-7A.G -80 -90 -8u -90|0123412121212121212121212121212121212121212121212121212121212121212121|-2CFH0 1taO0 Hc0 xUu 9tBu 11z0 1tDu Rc0 1wo0 11A0 1cM0 11A0 1o00 11A0 1o00 11A0 1o00 14o0 1o00 11A0 1nX0 U10 1tz0 U10 1wn0 Rd0 1wn0 U10 1tz0 U10 1tz0 U10 1tz0 U10 1wn0 Rd0 1wn0 Rd0 1wn0 U10 1tz0 U10 1tz0 17d0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 s10 1Vz0 1cN0 1cL0 1cN0 1cL0 6fd0 14n0|73e5\",\"Asia/Hovd|LMT +06 +07 +08|-66.A -60 -70 -80|012323232323232323232323232323232323232323232323232|-2APG6.A 2Uko6.A cKn0 1db0 1dd0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 1cL0 1cN0 1cL0 1cN0 1cL0 6hD0 11z0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 kEp0 1cJ0 1cP0 1cJ0|81e3\",\"Asia/Irkutsk|IMT +07 +08 +09|-6V.5 -70 -80 -90|01232323232323232323232123232323232323232323232323232323232323232|-21zGV.5 pjXV.5 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0|60e4\",\"Europe/Istanbul|IMT EET EEST +03 +04|-1U.U -20 -30 -30 -40|0121212121212121212121212121212121212121212121234312121212121212121212121212121212121212121212121212121212121212123|-2ogNU.U dzzU.U 11b0 8tB0 1on0 1410 1db0 19B0 1in0 3Rd0 Un0 1oN0 11b0 zSN0 CL0 mp0 1Vz0 1gN0 8yn0 1yp0 ML0 1kp0 17b0 1ip0 17b0 1fB0 19X0 1ip0 19X0 1ip0 17b0 qdB0 38L0 1jd0 Tz0 l6O0 11A0 WN0 1qL0 TB0 1tX0 U10 1tz0 11B0 1in0 17d0 z90 cne0 pb0 2Cp0 1800 14o0 1dc0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1a00 1fA0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WO0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 Xc0 1qo0 WM0 1qM0 11A0 1o00 1200 1nA0 11A0 1tA0 U00 15w0|13e6\",\"Asia/Jakarta|BMT +0720 +0730 +09 +08 WIB|-77.c -7k -7u -90 -80 -70|01232425|-1Q0Tk luM0 mPzO 8vWu 6kpu 4PXu xhcu|31e6\",\"Asia/Jayapura|LMT +09 +0930 WIT|-9m.M -90 -9u -90|0123|-1uu9m.M sMMm.M L4nu|26e4\",\"Asia/Jerusalem|JMT IST IDT IDDT|-2k.E -20 -30 -40|012121212121321212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-26Bek.E SyMk.E 5Rb0 10r0 1px0 10N0 1pz0 16p0 1jB0 16p0 1jx0 3LB0 Em0 or0 1cn0 1dB0 16n0 10O0 1ja0 1tC0 14o0 1cM0 1a00 11A0 1Na0 An0 1MP0 AJ0 1Kp0 LC0 1oo0 Wl0 EQN0 Db0 1fB0 Rb0 bXd0 gM0 8Q00 IM0 1wM0 11z0 1C10 IL0 1s10 10n0 1o10 WL0 1zd0 On0 1ld0 11z0 1o10 14n0 1o10 14n0 1nd0 12n0 1nd0 Xz0 1q10 12n0 1hB0 1dX0 1ep0 1aL0 1eN0 17X0 1nf0 11z0 1tB0 19W0 1e10 17b0 1ep0 1gL0 18N0 1fz0 1eN0 17b0 1gq0 1gn0 19d0 1dz0 1c10 17X0 1hB0 1gn0 19d0 1dz0 1c10 17X0 1kp0 1dz0 1c10 1aL0 1eN0 1oL0 10N0 1oL0 10N0 1oL0 10N0 1rz0 W10 1rz0 W10 1rz0 10N0 1oL0 10N0 1oL0 10N0 1rz0 W10 1rz0 W10 1rz0 10N0 1oL0 10N0 1oL0 10N0 1oL0 10N0 1rz0 W10 1rz0 W10 1rz0 10N0 1oL0 10N0 1oL0 10N0 1rz0 W10 1rz0 W10 1rz0 W10 1rz0 10N0 1oL0 10N0 1oL0|81e4\",\"Asia/Kabul|+04 +0430|-40 -4u|01|-10Qs0|46e5\",\"Asia/Kamchatka|LMT +11 +12 +13|-ay.A -b0 -c0 -d0|012323232323232323232321232323232323232323232323232323232323212|-1SLKy.A ivXy.A 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 2sp0 WM0|18e4\",\"Asia/Karachi|LMT +0530 +0630 +05 PKT PKST|-4s.c -5u -6u -50 -50 -60|012134545454|-2xoss.c 1qOKW.c 7zX0 eup0 LqMu 1fy00 1cL0 dK10 11b0 1610 1jX0|24e6\",\"Asia/Urumqi|LMT +06|-5O.k -60|01|-1GgtO.k|32e5\",\"Asia/Kathmandu|LMT +0530 +0545|-5F.g -5u -5J|012|-21JhF.g 2EGMb.g|12e5\",\"Asia/Khandyga|LMT +08 +09 +10 +11|-92.d -80 -90 -a0 -b0|0123232323232323232323212323232323232323232323232343434343434343432|-21Q92.d pAp2.d 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 qK0 yN0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 17V0 7zD0|66e2\",\"Asia/Krasnoyarsk|LMT +06 +07 +08|-6b.q -60 -70 -80|01232323232323232323232123232323232323232323232323232323232323232|-21Hib.q prAb.q 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0|10e5\",\"Asia/Kuala_Lumpur|SMT +07 +0720 +0730 +09 +08|-6T.p -70 -7k -7u -90 -80|0123435|-2Bg6T.p 17anT.p l5XE 17bO 8Fyu 1so1u|71e5\",\"Asia/Kuching|LMT +0730 +08 +0820 +09|-7l.k -7u -80 -8k -90|0123232323232323242|-1KITl.k gDbP.k 6ynu AnE 1O0k AnE 1NAk AnE 1NAk AnE 1NAk AnE 1O0k AnE 1NAk AnE pAk 8Fz0|13e4\",\"Asia/Macau|LMT CST +09 +10 CDT|-7y.a -80 -90 -a0 -90|012323214141414141414141414141414141414141414141414141414141414141414141|-2CFHy.a 1uqKy.a PX0 1kn0 15B0 11b0 4Qq0 1oM0 11c0 1ko0 1u00 11A0 1cM0 11c0 1o00 11A0 1o00 11A0 1oo0 1400 1o00 11A0 1o00 U00 1tA0 U00 1wo0 Rc0 1wru U10 1tz0 U10 1tz0 U10 1tz0 U10 1wn0 Rd0 1wn0 Rd0 1wn0 U10 1tz0 U10 1tz0 17d0 1cK0 1cO0 1cK0 1cO0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 s10 1Vz0 1cN0 1cL0 1cN0 1cL0 6fd0 14n0|57e4\",\"Asia/Magadan|LMT +10 +11 +12|-a3.c -a0 -b0 -c0|012323232323232323232321232323232323232323232323232323232323232312|-1Pca3.c eUo3.c 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0 3Cq0|95e3\",\"Asia/Makassar|LMT MMT +08 +09 WITA|-7V.A -7V.A -80 -90 -80|01234|-21JjV.A vfc0 myLV.A 8ML0|15e5\",\"Asia/Manila|PST PDT JST|-80 -90 -90|010201010|-1kJI0 AL0 cK10 65X0 mXB0 vX0 VK10 1db0|24e6\",\"Asia/Nicosia|LMT EET EEST|-2d.s -20 -30|01212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-1Vc2d.s 2a3cd.s 1cL0 1qp0 Xz0 19B0 19X0 1fB0 1db0 1cp0 1cL0 1fB0 19X0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 1cL0 1cN0 1cL0 1cN0 1o30 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|32e4\",\"Asia/Novokuznetsk|LMT +06 +07 +08|-5M.M -60 -70 -80|012323232323232323232321232323232323232323232323232323232323212|-1PctM.M eULM.M 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 2sp0 WM0|55e4\",\"Asia/Novosibirsk|LMT +06 +07 +08|-5v.E -60 -70 -80|0123232323232323232323212323212121212121212121212121212121212121212|-21Qnv.E pAFv.E 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 ml0 Os0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0 4eN0|15e5\",\"Asia/Omsk|LMT +05 +06 +07|-4R.u -50 -60 -70|01232323232323232323232123232323232323232323232323232323232323232|-224sR.u pMLR.u 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0|12e5\",\"Asia/Oral|LMT +03 +05 +06 +04|-3p.o -30 -50 -60 -40|01232323232323232424242424242424242424242424242|-1Pc3p.o eUop.o 23CK0 3Db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 2pB0 1cM0 1fA0 1cM0 1cM0 IM0 1EM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0|27e4\",\"Asia/Pontianak|LMT PMT +0730 +09 +08 WITA WIB|-7h.k -7h.k -7u -90 -80 -80 -70|012324256|-2ua7h.k XE00 munL.k 8Rau 6kpu 4PXu xhcu Wqnu|23e4\",\"Asia/Pyongyang|LMT KST JST KST|-8n -8u -90 -90|012313|-2um8n 97XR 1lTzu 2Onc0 6BA0|29e5\",\"Asia/Qostanay|LMT +04 +05 +06|-4e.s -40 -50 -60|012323232323232323232123232323232323232323232323|-1Pc4e.s eUoe.s 23CL0 3Db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0|\",\"Asia/Qyzylorda|LMT +04 +05 +06|-4l.Q -40 -50 -60|01232323232323232323232323232323232323232323232|-1Pc4l.Q eUol.Q 23CL0 3Db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 3ao0 1EM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 zQl0|73e4\",\"Asia/Rangoon|RMT +0630 +09|-6o.L -6u -90|0121|-21Jio.L SmnS.L 7j9u|48e5\",\"Asia/Sakhalin|LMT +09 +11 +12 +10|-9u.M -90 -b0 -c0 -a0|01232323232323232323232423232323232424242424242424242424242424242|-2AGVu.M 1BoMu.M 1qFa0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 2pB0 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0 3rd0|58e4\",\"Asia/Samarkand|LMT +04 +05 +06|-4r.R -40 -50 -60|01232323232323232323232|-1Pc4r.R eUor.R 23CL0 3Db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0|36e4\",\"Asia/Seoul|LMT KST JST KST KDT KDT|-8r.Q -8u -90 -90 -a0 -9u|012343434343151515151515134343|-2um8r.Q 97XV.Q 1m1zu 6CM0 Fz0 1kN0 14n0 1kN0 14L0 1zd0 On0 69B0 2I0u OL0 1FB0 Rb0 1qN0 TX0 1tB0 TX0 1tB0 TX0 1tB0 TX0 2ap0 12FBu 11A0 1o00 11A0|23e6\",\"Asia/Srednekolymsk|LMT +10 +11 +12|-ae.Q -a0 -b0 -c0|01232323232323232323232123232323232323232323232323232323232323232|-1Pcae.Q eUoe.Q 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0|35e2\",\"Asia/Taipei|CST JST CDT|-80 -90 -90|01020202020202020202020202020202020202020|-1iw80 joM0 1yo0 Tz0 1ip0 1jX0 1cN0 11b0 1oN0 11b0 1oN0 11b0 1oN0 11b0 10N0 1BX0 10p0 1pz0 10p0 1pz0 10p0 1db0 1dd0 1db0 1cN0 1db0 1cN0 1db0 1cN0 1db0 1BB0 ML0 1Bd0 ML0 uq10 1db0 1cN0 1db0 97B0 AL0|74e5\",\"Asia/Tashkent|LMT +05 +06 +07|-4B.b -50 -60 -70|012323232323232323232321|-1Pc4B.b eUnB.b 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0|23e5\",\"Asia/Tbilisi|TBMT +03 +04 +05|-2X.b -30 -40 -50|0123232323232323232323212121232323232323232323212|-1Pc2X.b 1jUnX.b WCL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 1cK0 1cL0 1cN0 1cL0 1cN0 2pz0 1cL0 1fB0 3Nz0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 An0 Os0 WM0|11e5\",\"Asia/Tehran|LMT TMT +0330 +04 +05 +0430|-3p.I -3p.I -3u -40 -50 -4u|01234325252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252|-2btDp.I 1d3c0 1huLT.I TXu 1pz0 sN0 vAu 1cL0 1dB0 1en0 pNB0 UL0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 64p0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0|14e6\",\"Asia/Thimphu|LMT +0530 +06|-5W.A -5u -60|012|-Su5W.A 1BGMs.A|79e3\",\"Asia/Tokyo|JST JDT|-90 -a0|010101010|-QJJ0 Rc0 1lc0 14o0 1zc0 Oo0 1zc0 Oo0|38e6\",\"Asia/Tomsk|LMT +06 +07 +08|-5D.P -60 -70 -80|0123232323232323232323212323232323232323232323212121212121212121212|-21NhD.P pxzD.P 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 co0 1bB0 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0 3Qp0|10e5\",\"Asia/Ulaanbaatar|LMT +07 +08 +09|-77.w -70 -80 -90|012323232323232323232323232323232323232323232323232|-2APH7.w 2Uko7.w cKn0 1db0 1dd0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 1cL0 1cN0 1cL0 1cN0 1cL0 6hD0 11z0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 kEp0 1cJ0 1cP0 1cJ0|12e5\",\"Asia/Ust-Nera|LMT +08 +09 +12 +11 +10|-9w.S -80 -90 -c0 -b0 -a0|012343434343434343434345434343434343434343434343434343434343434345|-21Q9w.S pApw.S 23CL0 1d90 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 17V0 7zD0|65e2\",\"Asia/Vladivostok|LMT +09 +10 +11|-8L.v -90 -a0 -b0|01232323232323232323232123232323232323232323232323232323232323232|-1SJIL.v itXL.v 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0|60e4\",\"Asia/Yakutsk|LMT +08 +09 +10|-8C.W -80 -90 -a0|01232323232323232323232123232323232323232323232323232323232323232|-21Q8C.W pAoC.W 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0|28e4\",\"Asia/Yekaterinburg|LMT PMT +04 +05 +06|-42.x -3J.5 -40 -50 -60|012343434343434343434343234343434343434343434343434343434343434343|-2ag42.x 7mQh.s qBvJ.5 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0|14e5\",\"Asia/Yerevan|LMT +03 +04 +05|-2W -30 -40 -50|0123232323232323232323212121212323232323232323232323232323232|-1Pc2W 1jUnW WCL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 4RX0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0|13e5\",\"Atlantic/Azores|HMT -02 -01 +00 WET|1S.w 20 10 0 0|01212121212121212121212121212121212121212121232123212321232121212121212121212121212121212121212121232323232323232323232323232323234323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232|-2ldW0 aPX0 Sp0 LX0 1vc0 Tc0 1uM0 SM0 1vc0 Tc0 1vc0 SM0 1vc0 6600 1co0 3E00 17c0 1fA0 1a00 1io0 1a00 1io0 17c0 3I00 17c0 1cM0 1cM0 3Fc0 1cM0 1a00 1fA0 1io0 17c0 1cM0 1cM0 1a00 1fA0 1io0 1qM0 Dc0 1tA0 1cM0 1dc0 1400 gL0 IM0 s10 U00 dX0 Rc0 pd0 Rc0 gL0 Oo0 pd0 Rc0 gL0 Oo0 pd0 14o0 1cM0 1cP0 1cM0 1cM0 1cM0 1cM0 1cM0 3Co0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 qIl0 1cM0 1fA0 1cM0 1cM0 1cN0 1cL0 1cN0 1cM0 1cM0 1cM0 1cM0 1cN0 1cL0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cL0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|25e4\",\"Atlantic/Bermuda|LMT AST ADT|4j.i 40 30|0121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-1BnRE.G 1LTbE.G 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|65e3\",\"Atlantic/Canary|LMT -01 WET WEST|11.A 10 0 -10|01232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232|-1UtaW.o XPAW.o 1lAK0 1a10 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|54e4\",\"Atlantic/Cape_Verde|LMT -02 -01|1y.4 20 10|01212|-2ldW0 1eEo0 7zX0 1djf0|50e4\",\"Atlantic/Faroe|LMT WET WEST|r.4 0 -10|01212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2uSnw.U 2Wgow.U 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|49e3\",\"Atlantic/Madeira|FMT -01 +00 +01 WET WEST|17.A 10 0 -10 0 -10|01212121212121212121212121212121212121212121232123212321232121212121212121212121212121212121212121454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454|-2ldX0 aPX0 Sp0 LX0 1vc0 Tc0 1uM0 SM0 1vc0 Tc0 1vc0 SM0 1vc0 6600 1co0 3E00 17c0 1fA0 1a00 1io0 1a00 1io0 17c0 3I00 17c0 1cM0 1cM0 3Fc0 1cM0 1a00 1fA0 1io0 17c0 1cM0 1cM0 1a00 1fA0 1io0 1qM0 Dc0 1tA0 1cM0 1dc0 1400 gL0 IM0 s10 U00 dX0 Rc0 pd0 Rc0 gL0 Oo0 pd0 Rc0 gL0 Oo0 pd0 14o0 1cM0 1cP0 1cM0 1cM0 1cM0 1cM0 1cM0 3Co0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 qIl0 1cM0 1fA0 1cM0 1cM0 1cN0 1cL0 1cN0 1cM0 1cM0 1cM0 1cM0 1cN0 1cL0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|27e4\",\"Atlantic/Reykjavik|LMT -01 +00 GMT|1s 10 0 0|012121212121212121212121212121212121212121212121212121212121212121213|-2uWmw mfaw 1Bd0 ML0 1LB0 Cn0 1LB0 3fX0 C10 HrX0 1cO0 LB0 1EL0 LA0 1C00 Oo0 1wo0 Rc0 1wo0 Rc0 1wo0 Rc0 1zc0 Oo0 1zc0 14o0 1lc0 14o0 1lc0 14o0 1o00 11A0 1lc0 14o0 1o00 14o0 1lc0 14o0 1lc0 14o0 1lc0 14o0 1lc0 14o0 1o00 14o0 1lc0 14o0 1lc0 14o0 1lc0 14o0 1lc0 14o0 1lc0 14o0 1o00 14o0 1lc0 14o0 1lc0 14o0 1lc0 14o0 1lc0 14o0 1o00 14o0|12e4\",\"Atlantic/South_Georgia|-02|20|0||30\",\"Atlantic/Stanley|SMT -04 -03 -02|3P.o 40 30 20|012121212121212323212121212121212121212121212121212121212121212121212|-2kJw8.A 12bA8.A 19X0 1fB0 19X0 1ip0 19X0 1fB0 19X0 1fB0 19X0 1fB0 Cn0 1Cc10 WL0 1qL0 U10 1tz0 2mN0 WN0 1qL0 WN0 1qL0 WN0 1qL0 WN0 1tz0 U10 1tz0 WN0 1qL0 WN0 1qL0 WN0 1qL0 WN0 1qL0 WN0 1tz0 WN0 1qL0 WN0 1qL0 WN0 1qL0 WN0 1qL0 WN0 1qN0 U10 1wn0 Rd0 1wn0 U10 1tz0 U10 1tz0 U10 1tz0 U10 1tz0 U10 1wn0 U10 1tz0 U10 1tz0 U10|21e2\",\"Australia/Sydney|AEST AEDT|-a0 -b0|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101|-293lX xcX 10jd0 yL0 1cN0 1cL0 1fB0 19X0 17c10 LA0 1C00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 14o0 1o00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 U00 1qM0 WM0 1tA0 WM0 1tA0 U00 1tA0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 11A0 1o00 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 11A0 1o00 WM0 1qM0 14o0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0|40e5\",\"Australia/Adelaide|ACST ACDT|-9u -au|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101|-293lt xcX 10jd0 yL0 1cN0 1cL0 1fB0 19X0 17c10 LA0 1C00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 U00 1qM0 WM0 1tA0 WM0 1tA0 U00 1tA0 U00 1tA0 Oo0 1zc0 WM0 1qM0 Rc0 1zc0 U00 1tA0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 11A0 1o00 WM0 1qM0 14o0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0|11e5\",\"Australia/Brisbane|AEST AEDT|-a0 -b0|01010101010101010|-293lX xcX 10jd0 yL0 1cN0 1cL0 1fB0 19X0 17c10 LA0 H1A0 Oo0 1zc0 Oo0 1zc0 Oo0|20e5\",\"Australia/Broken_Hill|ACST ACDT|-9u -au|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101|-293lt xcX 10jd0 yL0 1cN0 1cL0 1fB0 19X0 17c10 LA0 1C00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 14o0 1o00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 U00 1qM0 WM0 1tA0 WM0 1tA0 U00 1tA0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 11A0 1o00 WM0 1qM0 14o0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0|18e3\",\"Australia/Currie|AEST AEDT|-a0 -b0|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101|-29E80 19X0 10jd0 yL0 1cN0 1cL0 1fB0 19X0 17c10 LA0 1C00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 11A0 1qM0 WM0 1qM0 Oo0 1zc0 Oo0 1zc0 Oo0 1wo0 WM0 1tA0 WM0 1tA0 U00 1tA0 U00 1tA0 11A0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 11A0 1o00 1io0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1cM0 1a00 1io0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0|746\",\"Australia/Darwin|ACST ACDT|-9u -au|010101010|-293lt xcX 10jd0 yL0 1cN0 1cL0 1fB0 19X0|12e4\",\"Australia/Eucla|+0845 +0945|-8J -9J|0101010101010101010|-293kI xcX 10jd0 yL0 1cN0 1cL0 1gSp0 Oo0 l5A0 Oo0 iJA0 G00 zU00 IM0 1qM0 11A0 1o00 11A0|368\",\"Australia/Hobart|AEST AEDT|-a0 -b0|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101|-29E80 19X0 10jd0 yL0 1cN0 1cL0 1fB0 19X0 VfB0 1cM0 1o00 Rc0 1wo0 Rc0 1wo0 U00 1wo0 LA0 1C00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 11A0 1qM0 WM0 1qM0 Oo0 1zc0 Oo0 1zc0 Oo0 1wo0 WM0 1tA0 WM0 1tA0 U00 1tA0 U00 1tA0 11A0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 11A0 1o00 1io0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1cM0 1a00 1io0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0|21e4\",\"Australia/Lord_Howe|AEST +1030 +1130 +11|-a0 -au -bu -b0|0121212121313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313|raC0 1zdu Rb0 1zd0 On0 1zd0 On0 1zd0 On0 1zd0 TXu 1qMu WLu 1tAu WLu 1tAu TXu 1tAu Onu 1zcu Onu 1zcu Onu 1zcu Rbu 1zcu Onu 1zcu Onu 1zcu 11zu 1o0u 11zu 1o0u 11zu 1o0u 11zu 1qMu WLu 11Au 1nXu 1qMu 11zu 1o0u 11zu 1o0u 11zu 1qMu WLu 1qMu 11zu 1o0u WLu 1qMu 14nu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1fAu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1fAu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1fzu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1fAu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1fAu 1cLu 1cMu 1cLu 1cMu|347\",\"Australia/Lindeman|AEST AEDT|-a0 -b0|010101010101010101010|-293lX xcX 10jd0 yL0 1cN0 1cL0 1fB0 19X0 17c10 LA0 H1A0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0|10\",\"Australia/Melbourne|AEST AEDT|-a0 -b0|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101|-293lX xcX 10jd0 yL0 1cN0 1cL0 1fB0 19X0 17c10 LA0 1C00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 U00 1qM0 WM0 1qM0 11A0 1tA0 U00 1tA0 U00 1tA0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 11A0 1o00 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 11A0 1o00 WM0 1qM0 14o0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0|39e5\",\"Australia/Perth|AWST AWDT|-80 -90|0101010101010101010|-293jX xcX 10jd0 yL0 1cN0 1cL0 1gSp0 Oo0 l5A0 Oo0 iJA0 G00 zU00 IM0 1qM0 11A0 1o00 11A0|18e5\",\"CET|CET CEST|-10 -20|01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-2aFe0 11d0 1iO0 11A0 1o00 11A0 Qrc0 6i00 WM0 1fA0 1cM0 1cM0 1cM0 16M0 1gMM0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|\",\"Pacific/Easter|EMT -07 -06 -05|7h.s 70 60 50|012121212121212121212121212123232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323|-1uSgG.w 1s4IG.w WL0 1zd0 On0 1ip0 11z0 1o10 11z0 1qN0 WL0 1ld0 14n0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 WL0 1qN0 11z0 1o10 2pA0 11z0 1o10 11z0 1qN0 WL0 1qN0 WL0 1qN0 1cL0 1cN0 11z0 1o10 11z0 1qN0 WL0 1fB0 19X0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1ip0 1fz0 1fB0 11z0 1qN0 WL0 1qN0 WL0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1o10 19X0 1fB0 1nX0 G10 1EL0 Op0 1zb0 Rd0 1wn0 Rd0 46n0 Ap0 1Nb0 Ap0 1Nb0 Ap0 1zb0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 11B0 1nX0 11B0|30e2\",\"CST6CDT|CST CDT CWT CPT|60 50 50 50|010102301010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-261s0 1nX0 11B0 1nX0 SgN0 8x30 iw0 QwN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|\",\"EET|EET EEST|-20 -30|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|hDB0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|\",\"Europe/Dublin|DMT IST GMT BST IST|p.l -y.D 0 -10 -10|01232323232324242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242|-2ax9y.D Rc0 1fzy.D 14M0 1fc0 1g00 1co0 1dc0 1co0 1oo0 1400 1dc0 19A0 1io0 1io0 WM0 1o00 14o0 1o00 17c0 1io0 17c0 1fA0 1a00 1lc0 17c0 1io0 17c0 1fA0 1a00 1io0 17c0 1io0 17c0 1fA0 1cM0 1io0 17c0 1fA0 1a00 1io0 17c0 1io0 17c0 1fA0 1a00 1io0 1qM0 Dc0 g600 14o0 1wo0 17c0 1io0 11A0 1o00 17c0 1fA0 1a00 1fA0 1cM0 1fA0 1a00 17c0 1fA0 1a00 1io0 17c0 1lc0 17c0 1fA0 1a00 1io0 17c0 1io0 17c0 1fA0 1a00 1a00 1qM0 WM0 1qM0 11A0 1o00 WM0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1tA0 IM0 90o0 U00 1tA0 U00 1tA0 U00 1tA0 U00 1tA0 WM0 1qM0 WM0 1qM0 WM0 1tA0 U00 1tA0 U00 1tA0 11z0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 14o0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|12e5\",\"EST|EST|50|0||\",\"EST5EDT|EST EDT EWT EPT|50 40 40 40|010102301010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-261t0 1nX0 11B0 1nX0 SgN0 8x40 iv0 QwN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|\",\"Etc/GMT-0|GMT|0|0||\",\"Etc/GMT-1|+01|-10|0||\",\"Pacific/Port_Moresby|+10|-a0|0||25e4\",\"Etc/GMT-11|+11|-b0|0||\",\"Pacific/Tarawa|+12|-c0|0||29e3\",\"Etc/GMT-13|+13|-d0|0||\",\"Etc/GMT-14|+14|-e0|0||\",\"Etc/GMT-2|+02|-20|0||\",\"Etc/GMT-3|+03|-30|0||\",\"Etc/GMT-4|+04|-40|0||\",\"Etc/GMT-5|+05|-50|0||\",\"Etc/GMT-6|+06|-60|0||\",\"Indian/Christmas|+07|-70|0||21e2\",\"Etc/GMT-8|+08|-80|0||\",\"Pacific/Palau|+09|-90|0||21e3\",\"Etc/GMT+1|-01|10|0||\",\"Etc/GMT+10|-10|a0|0||\",\"Etc/GMT+11|-11|b0|0||\",\"Etc/GMT+12|-12|c0|0||\",\"Etc/GMT+3|-03|30|0||\",\"Etc/GMT+4|-04|40|0||\",\"Etc/GMT+5|-05|50|0||\",\"Etc/GMT+6|-06|60|0||\",\"Etc/GMT+7|-07|70|0||\",\"Etc/GMT+8|-08|80|0||\",\"Etc/GMT+9|-09|90|0||\",\"Etc/UTC|UTC|0|0||\",\"Europe/Amsterdam|AMT NST +0120 +0020 CEST CET|-j.w -1j.w -1k -k -20 -10|010101010101010101010101010101010101010101012323234545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545|-2aFcj.w 11b0 1iP0 11A0 1io0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1co0 1io0 1yo0 Pc0 1a00 1fA0 1Bc0 Mo0 1tc0 Uo0 1tA0 U00 1uo0 W00 1s00 VA0 1so0 Vc0 1sM0 UM0 1wo0 Rc0 1u00 Wo0 1rA0 W00 1s00 VA0 1sM0 UM0 1w00 fV0 BCX.w 1tA0 U00 1u00 Wo0 1sm0 601k WM0 1fA0 1cM0 1cM0 1cM0 16M0 1gMM0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|16e5\",\"Europe/Andorra|WET CET CEST|0 -10 -20|012121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-UBA0 1xIN0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|79e3\",\"Europe/Astrakhan|LMT +03 +04 +05|-3c.c -30 -40 -50|012323232323232323212121212121212121212121212121212121212121212|-1Pcrc.c eUMc.c 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 2pB0 1cM0 1fA0 1cM0 3Co0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0 3rd0|10e5\",\"Europe/Athens|AMT EET EEST CEST CET|-1y.Q -20 -30 -20 -10|012123434121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2a61x.Q CNbx.Q mn0 kU10 9b0 3Es0 Xa0 1fb0 1dd0 k3X0 Nz0 SCp0 1vc0 SO0 1cM0 1a00 1ao0 1fc0 1a10 1fG0 1cg0 1dX0 1bX0 1cQ0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|35e5\",\"Europe/London|GMT BST BDST|0 -10 -20|0101010101010101010101010101010101010101010101010121212121210101210101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-2axa0 Rc0 1fA0 14M0 1fc0 1g00 1co0 1dc0 1co0 1oo0 1400 1dc0 19A0 1io0 1io0 WM0 1o00 14o0 1o00 17c0 1io0 17c0 1fA0 1a00 1lc0 17c0 1io0 17c0 1fA0 1a00 1io0 17c0 1io0 17c0 1fA0 1cM0 1io0 17c0 1fA0 1a00 1io0 17c0 1io0 17c0 1fA0 1a00 1io0 1qM0 Dc0 2Rz0 Dc0 1zc0 Oo0 1zc0 Rc0 1wo0 17c0 1iM0 FA0 xB0 1fA0 1a00 14o0 bb0 LA0 xB0 Rc0 1wo0 11A0 1o00 17c0 1fA0 1a00 1fA0 1cM0 1fA0 1a00 17c0 1fA0 1a00 1io0 17c0 1lc0 17c0 1fA0 1a00 1io0 17c0 1io0 17c0 1fA0 1a00 1a00 1qM0 WM0 1qM0 11A0 1o00 WM0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1tA0 IM0 90o0 U00 1tA0 U00 1tA0 U00 1tA0 U00 1tA0 WM0 1qM0 WM0 1qM0 WM0 1tA0 U00 1tA0 U00 1tA0 11z0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 14o0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|10e6\",\"Europe/Belgrade|CET CEST|-10 -20|01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-19RC0 3IP0 WM0 1fA0 1cM0 1cM0 1rc0 Qo0 1vmo0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|12e5\",\"Europe/Berlin|CET CEST CEMT|-10 -20 -30|01010101010101210101210101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-2aFe0 11d0 1iO0 11A0 1o00 11A0 Qrc0 6i00 WM0 1fA0 1cM0 1cM0 1cM0 kL0 Nc0 m10 WM0 1ao0 1cp0 dX0 jz0 Dd0 1io0 17c0 1fA0 1a00 1ehA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|41e5\",\"Europe/Prague|CET CEST GMT|-10 -20 0|01010101010101010201010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-2aFe0 11d0 1iO0 11A0 1o00 11A0 Qrc0 6i00 WM0 1fA0 1cM0 1cM0 1cM0 1cM0 1qM0 11c0 mp0 xA0 mn0 17c0 1io0 17c0 1fc0 1ao0 1bNc0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|13e5\",\"Europe/Brussels|WET CET CEST WEST|0 -10 -20 -10|0121212103030303030303030303030303030303030303030303212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2ehc0 3zX0 11c0 1iO0 11A0 1o00 11A0 my0 Ic0 1qM0 Rc0 1EM0 UM0 1u00 10o0 1io0 1io0 17c0 1a00 1fA0 1cM0 1cM0 1io0 17c0 1fA0 1a00 1io0 1a30 1io0 17c0 1fA0 1a00 1io0 17c0 1cM0 1cM0 1a00 1io0 1cM0 1cM0 1a00 1fA0 1io0 17c0 1cM0 1cM0 1a00 1fA0 1io0 1qM0 Dc0 y00 5Wn0 WM0 1fA0 1cM0 16M0 1iM0 16M0 1C00 Uo0 1eeo0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|21e5\",\"Europe/Bucharest|BMT EET EEST|-1I.o -20 -30|0121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-1xApI.o 20LI.o RA0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1Axc0 On0 1fA0 1a10 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cK0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cL0 1cN0 1cL0 1fB0 1nX0 11E0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|19e5\",\"Europe/Budapest|CET CEST|-10 -20|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-2aFe0 11d0 1iO0 11A0 1ip0 17b0 1op0 1tb0 Q2m0 3Ne0 WM0 1fA0 1cM0 1cM0 1oJ0 1dc0 1030 1fA0 1cM0 1cM0 1cM0 1cM0 1fA0 1a00 1iM0 1fA0 8Ha0 Rb0 1wN0 Rb0 1BB0 Lz0 1C20 LB0 SNX0 1a10 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|17e5\",\"Europe/Zurich|CET CEST|-10 -20|01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-19Lc0 11A0 1o00 11A0 1xG10 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|38e4\",\"Europe/Chisinau|CMT BMT EET EEST CEST CET MSK MSD|-1T -1I.o -20 -30 -20 -10 -30 -40|012323232323232323234545467676767676767676767323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232|-26jdT wGMa.A 20LI.o RA0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 27A0 2en0 39g0 WM0 1fA0 1cM0 V90 1t7z0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 gL0 WO0 1cM0 1cM0 1cK0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 1nX0 11D0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|67e4\",\"Europe/Copenhagen|CET CEST|-10 -20|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-2azC0 Tz0 VuO0 60q0 WM0 1fA0 1cM0 1cM0 1cM0 S00 1HA0 Nc0 1C00 Dc0 1Nc0 Ao0 1h5A0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|12e5\",\"Europe/Gibraltar|GMT BST BDST CET CEST|0 -10 -20 -10 -20|010101010101010101010101010101010101010101010101012121212121010121010101010101010101034343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343|-2axa0 Rc0 1fA0 14M0 1fc0 1g00 1co0 1dc0 1co0 1oo0 1400 1dc0 19A0 1io0 1io0 WM0 1o00 14o0 1o00 17c0 1io0 17c0 1fA0 1a00 1lc0 17c0 1io0 17c0 1fA0 1a00 1io0 17c0 1io0 17c0 1fA0 1cM0 1io0 17c0 1fA0 1a00 1io0 17c0 1io0 17c0 1fA0 1a00 1io0 1qM0 Dc0 2Rz0 Dc0 1zc0 Oo0 1zc0 Rc0 1wo0 17c0 1iM0 FA0 xB0 1fA0 1a00 14o0 bb0 LA0 xB0 Rc0 1wo0 11A0 1o00 17c0 1fA0 1a00 1fA0 1cM0 1fA0 1a00 17c0 1fA0 1a00 1io0 17c0 1lc0 17c0 1fA0 10Jz0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|30e3\",\"Europe/Helsinki|HMT EET EEST|-1D.N -20 -30|0121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-1WuND.N OULD.N 1dA0 1xGq0 1cM0 1cM0 1cM0 1cN0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|12e5\",\"Europe/Kaliningrad|CET CEST EET EEST MSK MSD +03|-10 -20 -20 -30 -30 -40 -30|01010101010101232454545454545454543232323232323232323232323232323232323232323262|-2aFe0 11d0 1iO0 11A0 1o00 11A0 Qrc0 6i00 WM0 1fA0 1cM0 1cM0 1cM0 390 7A0 1en0 12N0 1pbb0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cN0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0|44e4\",\"Europe/Kiev|KMT EET MSK CEST CET MSD EEST|-22.4 -20 -30 -20 -10 -40 -30|0123434252525252525252525256161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161|-1Pc22.4 eUo2.4 rnz0 2Hg0 WM0 1fA0 da0 1v4m0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 Db0 3220 1cK0 1cL0 1cN0 1cL0 1cN0 1cL0 1cQ0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|34e5\",\"Europe/Kirov|LMT +03 +04 +05|-3i.M -30 -40 -50|01232323232323232321212121212121212121212121212121212121212121|-22WM0 qH90 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 2pB0 1cM0 1fA0 1cM0 3Co0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0|48e4\",\"Europe/Lisbon|LMT WET WEST WEMT CET CEST|A.J 0 -10 -20 -10 -20|012121212121212121212121212121212121212121212321232123212321212121212121212121212121212121212121214121212121212121212121212121212124545454212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2le00 aPX0 Sp0 LX0 1vc0 Tc0 1uM0 SM0 1vc0 Tc0 1vc0 SM0 1vc0 6600 1co0 3E00 17c0 1fA0 1a00 1io0 1a00 1io0 17c0 3I00 17c0 1cM0 1cM0 3Fc0 1cM0 1a00 1fA0 1io0 17c0 1cM0 1cM0 1a00 1fA0 1io0 1qM0 Dc0 1tA0 1cM0 1dc0 1400 gL0 IM0 s10 U00 dX0 Rc0 pd0 Rc0 gL0 Oo0 pd0 Rc0 gL0 Oo0 pd0 14o0 1cM0 1cP0 1cM0 1cM0 1cM0 1cM0 1cM0 3Co0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 pvy0 1cM0 1cM0 1fA0 1cM0 1cM0 1cN0 1cL0 1cN0 1cM0 1cM0 1cM0 1cM0 1cN0 1cL0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|27e5\",\"Europe/Luxembourg|LMT CET CEST WET WEST WEST WET|-o.A -10 -20 0 -10 -20 -10|0121212134343434343434343434343434343434343434343434565651212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2DG0o.A t6mo.A TB0 1nX0 Up0 1o20 11A0 rW0 CM0 1qP0 R90 1EO0 UK0 1u20 10m0 1ip0 1in0 17e0 19W0 1fB0 1db0 1cp0 1in0 17d0 1fz0 1a10 1in0 1a10 1in0 17f0 1fA0 1a00 1io0 17c0 1cM0 1cM0 1a00 1io0 1cM0 1cM0 1a00 1fA0 1io0 17c0 1cM0 1cM0 1a00 1fA0 1io0 1qM0 Dc0 vA0 60L0 WM0 1fA0 1cM0 17c0 1io0 16M0 1C00 Uo0 1eeo0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|54e4\",\"Europe/Madrid|WET WEST WEMT CET CEST|0 -10 -20 -10 -20|010101010101010101210343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343|-25Td0 19B0 1cL0 1dd0 b1z0 18p0 3HX0 17d0 1fz0 1a10 1io0 1a00 1in0 17d0 iIn0 Hd0 1cL0 bb0 1200 2s20 14n0 5aL0 Mp0 1vz0 17d0 1in0 17d0 1in0 17d0 1in0 17d0 6hX0 11B0 XHX0 1a10 1fz0 1a10 19X0 1cN0 1fz0 1a10 1fC0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|62e5\",\"Europe/Malta|CET CEST|-10 -20|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-2arB0 Lz0 1cN0 1db0 1410 1on0 Wp0 1qL0 17d0 1cL0 M3B0 5M20 WM0 1fA0 1co0 17c0 1iM0 16m0 1de0 1lc0 14m0 1lc0 WO0 1qM0 GTW0 On0 1C10 LA0 1C00 LA0 1EM0 LA0 1C00 LA0 1zc0 Oo0 1C00 Oo0 1co0 1cM0 1lA0 Xc0 1qq0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1iN0 19z0 1fB0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|42e4\",\"Europe/Minsk|MMT EET MSK CEST CET MSD EEST +03|-1O -20 -30 -20 -10 -40 -30 -30|01234343252525252525252525261616161616161616161616161616161616161617|-1Pc1O eUnO qNX0 3gQ0 WM0 1fA0 1cM0 Al0 1tsn0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 3Fc0 1cN0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0|19e5\",\"Europe/Monaco|PMT WET WEST WEMT CET CEST|-9.l 0 -10 -20 -10 -20|01212121212121212121212121212121212121212121212121232323232345454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454|-2nco9.l cNb9.l HA0 19A0 1iM0 11c0 1oo0 Wo0 1rc0 QM0 1EM0 UM0 1u00 10o0 1io0 1wo0 Rc0 1a00 1fA0 1cM0 1cM0 1io0 17c0 1fA0 1a00 1io0 1a00 1io0 17c0 1fA0 1a00 1io0 17c0 1cM0 1cM0 1a00 1io0 1cM0 1cM0 1a00 1fA0 1io0 17c0 1cM0 1cM0 1a00 1fA0 1io0 1qM0 Df0 2RV0 11z0 11B0 1ze0 WM0 1fA0 1cM0 1fa0 1aq0 16M0 1ekn0 1cL0 1fC0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|38e3\",\"Europe/Moscow|MMT MMT MST MDST MSD MSK +05 EET EEST MSK|-2u.h -2v.j -3v.j -4v.j -40 -30 -50 -20 -30 -40|012132345464575454545454545454545458754545454545454545454545454545454545454595|-2ag2u.h 2pyW.W 1bA0 11X0 GN0 1Hb0 c4v.j ik0 3DA0 dz0 15A0 c10 2q10 iM10 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cN0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0|16e6\",\"Europe/Paris|PMT WET WEST CEST CET WEMT|-9.l 0 -10 -20 -10 -20|0121212121212121212121212121212121212121212121212123434352543434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434|-2nco8.l cNb8.l HA0 19A0 1iM0 11c0 1oo0 Wo0 1rc0 QM0 1EM0 UM0 1u00 10o0 1io0 1wo0 Rc0 1a00 1fA0 1cM0 1cM0 1io0 17c0 1fA0 1a00 1io0 1a00 1io0 17c0 1fA0 1a00 1io0 17c0 1cM0 1cM0 1a00 1io0 1cM0 1cM0 1a00 1fA0 1io0 17c0 1cM0 1cM0 1a00 1fA0 1io0 1qM0 Df0 Ik0 5M30 WM0 1fA0 1cM0 Vx0 hB0 1aq0 16M0 1ekn0 1cL0 1fC0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|11e6\",\"Europe/Riga|RMT LST EET MSK CEST CET MSD EEST|-1A.y -2A.y -20 -30 -20 -10 -40 -30|010102345454536363636363636363727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272|-25TzA.y 11A0 1iM0 ko0 gWm0 yDXA.y 2bX0 3fE0 WM0 1fA0 1cM0 1cM0 4m0 1sLy0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cN0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cN0 1o00 11A0 1o00 11A0 1qM0 3oo0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|64e4\",\"Europe/Rome|CET CEST|-10 -20|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-2arB0 Lz0 1cN0 1db0 1410 1on0 Wp0 1qL0 17d0 1cL0 M3B0 5M20 WM0 1fA0 1cM0 16M0 1iM0 16m0 1de0 1lc0 14m0 1lc0 WO0 1qM0 GTW0 On0 1C10 LA0 1C00 LA0 1EM0 LA0 1C00 LA0 1zc0 Oo0 1C00 Oo0 1C00 LA0 1zc0 Oo0 1C00 LA0 1C00 LA0 1zc0 Oo0 1C00 Oo0 1zc0 Oo0 1fC0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|39e5\",\"Europe/Samara|LMT +03 +04 +05|-3k.k -30 -40 -50|0123232323232323232121232323232323232323232323232323232323212|-22WM0 qH90 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 2pB0 1cM0 1fA0 2y10 14m0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 2sp0 WM0|12e5\",\"Europe/Saratov|LMT +03 +04 +05|-34.i -30 -40 -50|012323232323232321212121212121212121212121212121212121212121212|-22WM0 qH90 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 2pB0 1cM0 1cM0 1cM0 1fA0 1cM0 3Co0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0 5810|\",\"Europe/Simferopol|SMT EET MSK CEST CET MSD EEST MSK|-2g -20 -30 -20 -10 -40 -30 -40|012343432525252525252525252161616525252616161616161616161616161616161616172|-1Pc2g eUog rEn0 2qs0 WM0 1fA0 1cM0 3V0 1u0L0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1Q00 4eL0 1cL0 1cN0 1cL0 1cN0 dX0 WL0 1cN0 1cL0 1fB0 1o30 11B0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11z0 1nW0|33e4\",\"Europe/Sofia|EET CET CEST EEST|-20 -10 -20 -30|01212103030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030|-168L0 WM0 1fA0 1cM0 1cM0 1cN0 1mKH0 1dd0 1fb0 1ap0 1fb0 1a20 1fy0 1a30 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cK0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 1nX0 11E0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|12e5\",\"Europe/Stockholm|CET CEST|-10 -20|01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-2azC0 TB0 2yDe0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|15e5\",\"Europe/Tallinn|TMT CET CEST EET MSK MSD EEST|-1D -10 -20 -20 -30 -40 -30|012103421212454545454545454546363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363|-26oND teD 11A0 1Ta0 4rXl KSLD 2FX0 2Jg0 WM0 1fA0 1cM0 18J0 1sTX0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cN0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o10 11A0 1qM0 5QM0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|41e4\",\"Europe/Tirane|LMT CET CEST|-1j.k -10 -20|01212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2glBj.k 14pcj.k 5LC0 WM0 4M0 1fCK0 10n0 1op0 11z0 1pd0 11z0 1qN0 WL0 1qp0 Xb0 1qp0 Xb0 1qp0 11z0 1lB0 11z0 1qN0 11z0 1iN0 16n0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|42e4\",\"Europe/Ulyanovsk|LMT +03 +04 +05 +02|-3d.A -30 -40 -50 -20|01232323232323232321214121212121212121212121212121212121212121212|-22WM0 qH90 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 2pB0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0 3rd0|13e5\",\"Europe/Uzhgorod|CET CEST MSK MSD EET EEST|-10 -20 -30 -40 -20 -30|010101023232323232323232320454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454|-1cqL0 6i00 WM0 1fA0 1cM0 1ml0 1Cp0 1r3W0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1Q00 1Nf0 2pw0 1cL0 1cN0 1cL0 1cN0 1cL0 1cQ0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|11e4\",\"Europe/Vienna|CET CEST|-10 -20|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-2aFe0 11d0 1iO0 11A0 1o00 11A0 3KM0 14o0 LA00 6i00 WM0 1fA0 1cM0 1cM0 1cM0 400 2qM0 1ao0 1co0 1cM0 1io0 17c0 1gHa0 19X0 1cP0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|18e5\",\"Europe/Vilnius|WMT KMT CET EET MSK CEST MSD EEST|-1o -1z.A -10 -20 -30 -20 -40 -30|012324525254646464646464646473737373737373737352537373737373737373737373737373737373737373737373737373737373737373737373|-293do 6ILM.o 1Ooz.A zz0 Mfd0 29W0 3is0 WM0 1fA0 1cM0 LV0 1tgL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cN0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11B0 1o00 11A0 1qM0 8io0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|54e4\",\"Europe/Volgograd|LMT +03 +04 +05|-2V.E -30 -40 -50|012323232323232321212121212121212121212121212121212121212121212|-21IqV.E psLV.E 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 2pB0 1cM0 1cM0 1cM0 1fA0 1cM0 3Co0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0 9Jd0|10e5\",\"Europe/Warsaw|WMT CET CEST EET EEST|-1o -10 -20 -20 -30|012121234312121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2ctdo 1LXo 11d0 1iO0 11A0 1o00 11A0 1on0 11A0 6zy0 HWP0 5IM0 WM0 1fA0 1cM0 1dz0 1mL0 1en0 15B0 1aq0 1nA0 11A0 1io0 17c0 1fA0 1a00 iDX0 LA0 1cM0 1cM0 1C00 Oo0 1cM0 1cM0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1C00 LA0 uso0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cN0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|17e5\",\"Europe/Zaporozhye|+0220 EET MSK CEST CET MSD EEST|-2k -20 -30 -20 -10 -40 -30|01234342525252525252525252526161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161|-1Pc2k eUok rdb0 2RE0 WM0 1fA0 8m0 1v9a0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cK0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cQ0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|77e4\",\"HST|HST|a0|0||\",\"Indian/Chagos|LMT +05 +06|-4N.E -50 -60|012|-2xosN.E 3AGLN.E|30e2\",\"Indian/Cocos|+0630|-6u|0||596\",\"Indian/Kerguelen|-00 +05|0 -50|01|-MG00|130\",\"Indian/Mahe|LMT +04|-3F.M -40|01|-2yO3F.M|79e3\",\"Indian/Maldives|MMT +05|-4S -50|01|-olgS|35e4\",\"Indian/Mauritius|LMT +04 +05|-3O -40 -50|012121|-2xorO 34unO 14L0 12kr0 11z0|15e4\",\"Indian/Reunion|LMT +04|-3F.Q -40|01|-2mDDF.Q|84e4\",\"Pacific/Kwajalein|+11 +10 +09 -12 +12|-b0 -a0 -90 c0 -c0|012034|-1kln0 akp0 6Up0 12ry0 Wan0|14e3\",\"MET|MET MEST|-10 -20|01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-2aFe0 11d0 1iO0 11A0 1o00 11A0 Qrc0 6i00 WM0 1fA0 1cM0 1cM0 1cM0 16M0 1gMM0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|\",\"MST|MST|70|0||\",\"MST7MDT|MST MDT MWT MPT|70 60 60 60|010102301010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-261r0 1nX0 11B0 1nX0 SgN0 8x20 ix0 QwN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|\",\"Pacific/Chatham|+1215 +1245 +1345|-cf -cJ -dJ|012121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212|-WqAf 1adef IM0 1C00 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1qM0 14o0 1lc0 14o0 1lc0 14o0 1lc0 17c0 1io0 17c0 1io0 17c0 1io0 17c0 1lc0 14o0 1lc0 14o0 1lc0 17c0 1io0 17c0 1io0 17c0 1lc0 14o0 1lc0 14o0 1lc0 17c0 1io0 17c0 1io0 17c0 1io0 17c0 1io0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1io0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00|600\",\"Pacific/Apia|LMT -1130 -11 -10 +14 +13|bq.U bu b0 a0 -e0 -d0|01232345454545454545454545454545454545454545454545454545454|-2nDMx.4 1yW03.4 2rRbu 1ff0 1a00 CI0 AQ0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1io0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00|37e3\",\"Pacific/Bougainville|+10 +09 +11|-a0 -90 -b0|0102|-16Wy0 7CN0 2MQp0|18e4\",\"Pacific/Chuuk|+10 +09|-a0 -90|01010|-2ewy0 axB0 RVX0 axd0|49e3\",\"Pacific/Efate|LMT +11 +12|-bd.g -b0 -c0|0121212121212121212121|-2l9nd.g 2Szcd.g 1cL0 1oN0 10L0 1fB0 19X0 1fB0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 Lz0 1Nd0 An0|66e3\",\"Pacific/Enderbury|-12 -11 +13|c0 b0 -d0|012|nIc0 B7X0|1\",\"Pacific/Fakaofo|-11 +13|b0 -d0|01|1Gfn0|483\",\"Pacific/Fiji|LMT +12 +13|-bT.I -c0 -d0|0121212121212121212121212121212121212121212121212121212121212121|-2bUzT.I 3m8NT.I LA0 1EM0 IM0 nJc0 LA0 1o00 Rc0 1wo0 Ao0 1Nc0 Ao0 1Q00 xz0 1SN0 uM0 1SM0 uM0 1VA0 s00 1VA0 s00 1VA0 s00 20o0 pc0 20o0 s00 20o0 pc0 20o0 pc0 20o0 pc0 20o0 pc0 20o0 s00 1VA0 s00 20o0 pc0 20o0 pc0 20o0 pc0 20o0 pc0 20o0 s00 20o0 pc0 20o0 pc0 20o0 pc0 20o0 pc0 20o0 s00 1VA0 s00|88e4\",\"Pacific/Galapagos|LMT -05 -06|5W.o 50 60|01212|-1yVS1.A 2dTz1.A gNd0 rz0|25e3\",\"Pacific/Gambier|LMT -09|8X.M 90|01|-2jof0.c|125\",\"Pacific/Guadalcanal|LMT +11|-aD.M -b0|01|-2joyD.M|11e4\",\"Pacific/Guam|GST +09 GDT ChST|-a0 -90 -b0 -a0|01020202020202020203|-18jK0 6pB0 AhB0 3QL0 g2p0 3p91 WOX rX0 1zd0 Rb0 1wp0 Rb0 5xd0 rX0 5sN0 zb1 1C0X On0 ULb0|17e4\",\"Pacific/Honolulu|HST HDT HWT HPT HST|au 9u 9u 9u a0|0102304|-1thLu 8x0 lef0 8wWu iAu 46p0|37e4\",\"Pacific/Kiritimati|-1040 -10 +14|aE a0 -e0|012|nIaE B7Xk|51e2\",\"Pacific/Kosrae|+11 +09 +10 +12|-b0 -90 -a0 -c0|01021030|-2ewz0 axC0 HBy0 akp0 axd0 WOK0 1bdz0|66e2\",\"Pacific/Majuro|+11 +09 +10 +12|-b0 -90 -a0 -c0|0102103|-2ewz0 axC0 HBy0 akp0 6RB0 12um0|28e3\",\"Pacific/Marquesas|LMT -0930|9i 9u|01|-2joeG|86e2\",\"Pacific/Pago_Pago|LMT SST|bm.M b0|01|-2nDMB.c|37e2\",\"Pacific/Nauru|LMT +1130 +09 +12|-b7.E -bu -90 -c0|01213|-1Xdn7.E QCnB.E 7mqu 1lnbu|10e3\",\"Pacific/Niue|-1120 -1130 -11|bk bu b0|012|-KfME 17y0a|12e2\",\"Pacific/Norfolk|+1112 +1130 +1230 +11 +12|-bc -bu -cu -b0 -c0|012134343434343434343434343434343434343434|-Kgbc W01G Oo0 1COo0 9Jcu 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0|25e4\",\"Pacific/Noumea|LMT +11 +12|-b5.M -b0 -c0|01212121|-2l9n5.M 2EqM5.M xX0 1PB0 yn0 HeP0 Ao0|98e3\",\"Pacific/Pitcairn|-0830 -08|8u 80|01|18Vku|56\",\"Pacific/Pohnpei|+11 +09 +10|-b0 -90 -a0|010210|-2ewz0 axC0 HBy0 akp0 axd0|34e3\",\"Pacific/Rarotonga|-1030 -0930 -10|au 9u a0|012121212121212121212121212|lyWu IL0 1zcu Onu 1zcu Onu 1zcu Rbu 1zcu Onu 1zcu Onu 1zcu Onu 1zcu Onu 1zcu Onu 1zcu Rbu 1zcu Onu 1zcu Onu 1zcu Onu|13e3\",\"Pacific/Tahiti|LMT -10|9W.g a0|01|-2joe1.I|18e4\",\"Pacific/Tongatapu|+1220 +13 +14|-ck -d0 -e0|0121212121|-1aB0k 2n5dk 15A0 1wo0 xz0 1Q10 xz0 zWN0 s00|75e3\",\"PST8PDT|PST PDT PWT PPT|80 70 70 70|010102301010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-261q0 1nX0 11B0 1nX0 SgN0 8x10 iy0 QwN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|\",\"WET|WET WEST|0 -10|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|hDB0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|\"],\"links\":[\"Africa/Abidjan|Africa/Bamako\",\"Africa/Abidjan|Africa/Banjul\",\"Africa/Abidjan|Africa/Conakry\",\"Africa/Abidjan|Africa/Dakar\",\"Africa/Abidjan|Africa/Freetown\",\"Africa/Abidjan|Africa/Lome\",\"Africa/Abidjan|Africa/Nouakchott\",\"Africa/Abidjan|Africa/Ouagadougou\",\"Africa/Abidjan|Africa/Timbuktu\",\"Africa/Abidjan|Atlantic/St_Helena\",\"Africa/Cairo|Egypt\",\"Africa/Johannesburg|Africa/Maseru\",\"Africa/Johannesburg|Africa/Mbabane\",\"Africa/Lagos|Africa/Bangui\",\"Africa/Lagos|Africa/Brazzaville\",\"Africa/Lagos|Africa/Douala\",\"Africa/Lagos|Africa/Kinshasa\",\"Africa/Lagos|Africa/Libreville\",\"Africa/Lagos|Africa/Luanda\",\"Africa/Lagos|Africa/Malabo\",\"Africa/Lagos|Africa/Niamey\",\"Africa/Lagos|Africa/Porto-Novo\",\"Africa/Maputo|Africa/Blantyre\",\"Africa/Maputo|Africa/Bujumbura\",\"Africa/Maputo|Africa/Gaborone\",\"Africa/Maputo|Africa/Harare\",\"Africa/Maputo|Africa/Kigali\",\"Africa/Maputo|Africa/Lubumbashi\",\"Africa/Maputo|Africa/Lusaka\",\"Africa/Nairobi|Africa/Addis_Ababa\",\"Africa/Nairobi|Africa/Asmara\",\"Africa/Nairobi|Africa/Asmera\",\"Africa/Nairobi|Africa/Dar_es_Salaam\",\"Africa/Nairobi|Africa/Djibouti\",\"Africa/Nairobi|Africa/Kampala\",\"Africa/Nairobi|Africa/Mogadishu\",\"Africa/Nairobi|Indian/Antananarivo\",\"Africa/Nairobi|Indian/Comoro\",\"Africa/Nairobi|Indian/Mayotte\",\"Africa/Tripoli|Libya\",\"America/Adak|America/Atka\",\"America/Adak|US/Aleutian\",\"America/Anchorage|US/Alaska\",\"America/Argentina/Buenos_Aires|America/Buenos_Aires\",\"America/Argentina/Catamarca|America/Argentina/ComodRivadavia\",\"America/Argentina/Catamarca|America/Catamarca\",\"America/Argentina/Cordoba|America/Cordoba\",\"America/Argentina/Cordoba|America/Rosario\",\"America/Argentina/Jujuy|America/Jujuy\",\"America/Argentina/Mendoza|America/Mendoza\",\"America/Atikokan|America/Coral_Harbour\",\"America/Chicago|US/Central\",\"America/Curacao|America/Aruba\",\"America/Curacao|America/Kralendijk\",\"America/Curacao|America/Lower_Princes\",\"America/Denver|America/Shiprock\",\"America/Denver|Navajo\",\"America/Denver|US/Mountain\",\"America/Detroit|US/Michigan\",\"America/Edmonton|Canada/Mountain\",\"America/Fort_Wayne|America/Indiana/Indianapolis\",\"America/Fort_Wayne|America/Indianapolis\",\"America/Fort_Wayne|US/East-Indiana\",\"America/Halifax|Canada/Atlantic\",\"America/Havana|Cuba\",\"America/Indiana/Knox|America/Knox_IN\",\"America/Indiana/Knox|US/Indiana-Starke\",\"America/Jamaica|Jamaica\",\"America/Kentucky/Louisville|America/Louisville\",\"America/Los_Angeles|US/Pacific\",\"America/Los_Angeles|US/Pacific-New\",\"America/Manaus|Brazil/West\",\"America/Mazatlan|Mexico/BajaSur\",\"America/Mexico_City|Mexico/General\",\"America/New_York|US/Eastern\",\"America/Noronha|Brazil/DeNoronha\",\"America/Panama|America/Cayman\",\"America/Phoenix|US/Arizona\",\"America/Port_of_Spain|America/Anguilla\",\"America/Port_of_Spain|America/Antigua\",\"America/Port_of_Spain|America/Dominica\",\"America/Port_of_Spain|America/Grenada\",\"America/Port_of_Spain|America/Guadeloupe\",\"America/Port_of_Spain|America/Marigot\",\"America/Port_of_Spain|America/Montserrat\",\"America/Port_of_Spain|America/St_Barthelemy\",\"America/Port_of_Spain|America/St_Kitts\",\"America/Port_of_Spain|America/St_Lucia\",\"America/Port_of_Spain|America/St_Thomas\",\"America/Port_of_Spain|America/St_Vincent\",\"America/Port_of_Spain|America/Tortola\",\"America/Port_of_Spain|America/Virgin\",\"America/Regina|Canada/Saskatchewan\",\"America/Rio_Branco|America/Porto_Acre\",\"America/Rio_Branco|Brazil/Acre\",\"America/Santiago|Chile/Continental\",\"America/Sao_Paulo|Brazil/East\",\"America/St_Johns|Canada/Newfoundland\",\"America/Tijuana|America/Ensenada\",\"America/Tijuana|America/Santa_Isabel\",\"America/Tijuana|Mexico/BajaNorte\",\"America/Toronto|America/Montreal\",\"America/Toronto|Canada/Eastern\",\"America/Vancouver|Canada/Pacific\",\"America/Whitehorse|Canada/Yukon\",\"America/Winnipeg|Canada/Central\",\"Asia/Ashgabat|Asia/Ashkhabad\",\"Asia/Bangkok|Asia/Phnom_Penh\",\"Asia/Bangkok|Asia/Vientiane\",\"Asia/Dhaka|Asia/Dacca\",\"Asia/Dubai|Asia/Muscat\",\"Asia/Ho_Chi_Minh|Asia/Saigon\",\"Asia/Hong_Kong|Hongkong\",\"Asia/Jerusalem|Asia/Tel_Aviv\",\"Asia/Jerusalem|Israel\",\"Asia/Kathmandu|Asia/Katmandu\",\"Asia/Kolkata|Asia/Calcutta\",\"Asia/Kuala_Lumpur|Asia/Singapore\",\"Asia/Kuala_Lumpur|Singapore\",\"Asia/Macau|Asia/Macao\",\"Asia/Makassar|Asia/Ujung_Pandang\",\"Asia/Nicosia|Europe/Nicosia\",\"Asia/Qatar|Asia/Bahrain\",\"Asia/Rangoon|Asia/Yangon\",\"Asia/Riyadh|Asia/Aden\",\"Asia/Riyadh|Asia/Kuwait\",\"Asia/Seoul|ROK\",\"Asia/Shanghai|Asia/Chongqing\",\"Asia/Shanghai|Asia/Chungking\",\"Asia/Shanghai|Asia/Harbin\",\"Asia/Shanghai|PRC\",\"Asia/Taipei|ROC\",\"Asia/Tehran|Iran\",\"Asia/Thimphu|Asia/Thimbu\",\"Asia/Tokyo|Japan\",\"Asia/Ulaanbaatar|Asia/Ulan_Bator\",\"Asia/Urumqi|Asia/Kashgar\",\"Atlantic/Faroe|Atlantic/Faeroe\",\"Atlantic/Reykjavik|Iceland\",\"Atlantic/South_Georgia|Etc/GMT+2\",\"Australia/Adelaide|Australia/South\",\"Australia/Brisbane|Australia/Queensland\",\"Australia/Broken_Hill|Australia/Yancowinna\",\"Australia/Darwin|Australia/North\",\"Australia/Hobart|Australia/Tasmania\",\"Australia/Lord_Howe|Australia/LHI\",\"Australia/Melbourne|Australia/Victoria\",\"Australia/Perth|Australia/West\",\"Australia/Sydney|Australia/ACT\",\"Australia/Sydney|Australia/Canberra\",\"Australia/Sydney|Australia/NSW\",\"Etc/GMT-0|Etc/GMT\",\"Etc/GMT-0|Etc/GMT+0\",\"Etc/GMT-0|Etc/GMT0\",\"Etc/GMT-0|Etc/Greenwich\",\"Etc/GMT-0|GMT\",\"Etc/GMT-0|GMT+0\",\"Etc/GMT-0|GMT-0\",\"Etc/GMT-0|GMT0\",\"Etc/GMT-0|Greenwich\",\"Etc/UTC|Etc/UCT\",\"Etc/UTC|Etc/Universal\",\"Etc/UTC|Etc/Zulu\",\"Etc/UTC|UCT\",\"Etc/UTC|UTC\",\"Etc/UTC|Universal\",\"Etc/UTC|Zulu\",\"Europe/Belgrade|Europe/Ljubljana\",\"Europe/Belgrade|Europe/Podgorica\",\"Europe/Belgrade|Europe/Sarajevo\",\"Europe/Belgrade|Europe/Skopje\",\"Europe/Belgrade|Europe/Zagreb\",\"Europe/Chisinau|Europe/Tiraspol\",\"Europe/Dublin|Eire\",\"Europe/Helsinki|Europe/Mariehamn\",\"Europe/Istanbul|Asia/Istanbul\",\"Europe/Istanbul|Turkey\",\"Europe/Lisbon|Portugal\",\"Europe/London|Europe/Belfast\",\"Europe/London|Europe/Guernsey\",\"Europe/London|Europe/Isle_of_Man\",\"Europe/London|Europe/Jersey\",\"Europe/London|GB\",\"Europe/London|GB-Eire\",\"Europe/Moscow|W-SU\",\"Europe/Oslo|Arctic/Longyearbyen\",\"Europe/Oslo|Atlantic/Jan_Mayen\",\"Europe/Prague|Europe/Bratislava\",\"Europe/Rome|Europe/San_Marino\",\"Europe/Rome|Europe/Vatican\",\"Europe/Warsaw|Poland\",\"Europe/Zurich|Europe/Busingen\",\"Europe/Zurich|Europe/Vaduz\",\"Indian/Christmas|Etc/GMT-7\",\"Pacific/Auckland|Antarctica/McMurdo\",\"Pacific/Auckland|Antarctica/South_Pole\",\"Pacific/Auckland|NZ\",\"Pacific/Chatham|NZ-CHAT\",\"Pacific/Chuuk|Pacific/Truk\",\"Pacific/Chuuk|Pacific/Yap\",\"Pacific/Easter|Chile/EasterIsland\",\"Pacific/Guam|Pacific/Saipan\",\"Pacific/Honolulu|Pacific/Johnston\",\"Pacific/Honolulu|US/Hawaii\",\"Pacific/Kwajalein|Kwajalein\",\"Pacific/Pago_Pago|Pacific/Midway\",\"Pacific/Pago_Pago|Pacific/Samoa\",\"Pacific/Pago_Pago|US/Samoa\",\"Pacific/Palau|Etc/GMT-9\",\"Pacific/Pohnpei|Pacific/Ponape\",\"Pacific/Port_Moresby|Etc/GMT-10\",\"Pacific/Tarawa|Etc/GMT-12\",\"Pacific/Tarawa|Pacific/Funafuti\",\"Pacific/Tarawa|Pacific/Wake\",\"Pacific/Tarawa|Pacific/Wallis\"],\"countries\":[\"AD|Europe/Andorra\",\"AE|Asia/Dubai\",\"AF|Asia/Kabul\",\"AG|America/Port_of_Spain America/Antigua\",\"AI|America/Port_of_Spain America/Anguilla\",\"AL|Europe/Tirane\",\"AM|Asia/Yerevan\",\"AO|Africa/Lagos Africa/Luanda\",\"AQ|Antarctica/Casey Antarctica/Davis Antarctica/DumontDUrville Antarctica/Mawson Antarctica/Palmer Antarctica/Rothera Antarctica/Syowa Antarctica/Troll Antarctica/Vostok Pacific/Auckland Antarctica/McMurdo\",\"AR|America/Argentina/Buenos_Aires America/Argentina/Cordoba America/Argentina/Salta America/Argentina/Jujuy America/Argentina/Tucuman America/Argentina/Catamarca America/Argentina/La_Rioja America/Argentina/San_Juan America/Argentina/Mendoza America/Argentina/San_Luis America/Argentina/Rio_Gallegos America/Argentina/Ushuaia\",\"AS|Pacific/Pago_Pago\",\"AT|Europe/Vienna\",\"AU|Australia/Lord_Howe Antarctica/Macquarie Australia/Hobart Australia/Currie Australia/Melbourne Australia/Sydney Australia/Broken_Hill Australia/Brisbane Australia/Lindeman Australia/Adelaide Australia/Darwin Australia/Perth Australia/Eucla\",\"AW|America/Curacao America/Aruba\",\"AX|Europe/Helsinki Europe/Mariehamn\",\"AZ|Asia/Baku\",\"BA|Europe/Belgrade Europe/Sarajevo\",\"BB|America/Barbados\",\"BD|Asia/Dhaka\",\"BE|Europe/Brussels\",\"BF|Africa/Abidjan Africa/Ouagadougou\",\"BG|Europe/Sofia\",\"BH|Asia/Qatar Asia/Bahrain\",\"BI|Africa/Maputo Africa/Bujumbura\",\"BJ|Africa/Lagos Africa/Porto-Novo\",\"BL|America/Port_of_Spain America/St_Barthelemy\",\"BM|Atlantic/Bermuda\",\"BN|Asia/Brunei\",\"BO|America/La_Paz\",\"BQ|America/Curacao America/Kralendijk\",\"BR|America/Noronha America/Belem America/Fortaleza America/Recife America/Araguaina America/Maceio America/Bahia America/Sao_Paulo America/Campo_Grande America/Cuiaba America/Santarem America/Porto_Velho America/Boa_Vista America/Manaus America/Eirunepe America/Rio_Branco\",\"BS|America/Nassau\",\"BT|Asia/Thimphu\",\"BW|Africa/Maputo Africa/Gaborone\",\"BY|Europe/Minsk\",\"BZ|America/Belize\",\"CA|America/St_Johns America/Halifax America/Glace_Bay America/Moncton America/Goose_Bay America/Blanc-Sablon America/Toronto America/Nipigon America/Thunder_Bay America/Iqaluit America/Pangnirtung America/Atikokan America/Winnipeg America/Rainy_River America/Resolute America/Rankin_Inlet America/Regina America/Swift_Current America/Edmonton America/Cambridge_Bay America/Yellowknife America/Inuvik America/Creston America/Dawson_Creek America/Fort_Nelson America/Vancouver America/Whitehorse America/Dawson\",\"CC|Indian/Cocos\",\"CD|Africa/Maputo Africa/Lagos Africa/Kinshasa Africa/Lubumbashi\",\"CF|Africa/Lagos Africa/Bangui\",\"CG|Africa/Lagos Africa/Brazzaville\",\"CH|Europe/Zurich\",\"CI|Africa/Abidjan\",\"CK|Pacific/Rarotonga\",\"CL|America/Santiago America/Punta_Arenas Pacific/Easter\",\"CM|Africa/Lagos Africa/Douala\",\"CN|Asia/Shanghai Asia/Urumqi\",\"CO|America/Bogota\",\"CR|America/Costa_Rica\",\"CU|America/Havana\",\"CV|Atlantic/Cape_Verde\",\"CW|America/Curacao\",\"CX|Indian/Christmas\",\"CY|Asia/Nicosia Asia/Famagusta\",\"CZ|Europe/Prague\",\"DE|Europe/Zurich Europe/Berlin Europe/Busingen\",\"DJ|Africa/Nairobi Africa/Djibouti\",\"DK|Europe/Copenhagen\",\"DM|America/Port_of_Spain America/Dominica\",\"DO|America/Santo_Domingo\",\"DZ|Africa/Algiers\",\"EC|America/Guayaquil Pacific/Galapagos\",\"EE|Europe/Tallinn\",\"EG|Africa/Cairo\",\"EH|Africa/El_Aaiun\",\"ER|Africa/Nairobi Africa/Asmara\",\"ES|Europe/Madrid Africa/Ceuta Atlantic/Canary\",\"ET|Africa/Nairobi Africa/Addis_Ababa\",\"FI|Europe/Helsinki\",\"FJ|Pacific/Fiji\",\"FK|Atlantic/Stanley\",\"FM|Pacific/Chuuk Pacific/Pohnpei Pacific/Kosrae\",\"FO|Atlantic/Faroe\",\"FR|Europe/Paris\",\"GA|Africa/Lagos Africa/Libreville\",\"GB|Europe/London\",\"GD|America/Port_of_Spain America/Grenada\",\"GE|Asia/Tbilisi\",\"GF|America/Cayenne\",\"GG|Europe/London Europe/Guernsey\",\"GH|Africa/Accra\",\"GI|Europe/Gibraltar\",\"GL|America/Godthab America/Danmarkshavn America/Scoresbysund America/Thule\",\"GM|Africa/Abidjan Africa/Banjul\",\"GN|Africa/Abidjan Africa/Conakry\",\"GP|America/Port_of_Spain America/Guadeloupe\",\"GQ|Africa/Lagos Africa/Malabo\",\"GR|Europe/Athens\",\"GS|Atlantic/South_Georgia\",\"GT|America/Guatemala\",\"GU|Pacific/Guam\",\"GW|Africa/Bissau\",\"GY|America/Guyana\",\"HK|Asia/Hong_Kong\",\"HN|America/Tegucigalpa\",\"HR|Europe/Belgrade Europe/Zagreb\",\"HT|America/Port-au-Prince\",\"HU|Europe/Budapest\",\"ID|Asia/Jakarta Asia/Pontianak Asia/Makassar Asia/Jayapura\",\"IE|Europe/Dublin\",\"IL|Asia/Jerusalem\",\"IM|Europe/London Europe/Isle_of_Man\",\"IN|Asia/Kolkata\",\"IO|Indian/Chagos\",\"IQ|Asia/Baghdad\",\"IR|Asia/Tehran\",\"IS|Atlantic/Reykjavik\",\"IT|Europe/Rome\",\"JE|Europe/London Europe/Jersey\",\"JM|America/Jamaica\",\"JO|Asia/Amman\",\"JP|Asia/Tokyo\",\"KE|Africa/Nairobi\",\"KG|Asia/Bishkek\",\"KH|Asia/Bangkok Asia/Phnom_Penh\",\"KI|Pacific/Tarawa Pacific/Enderbury Pacific/Kiritimati\",\"KM|Africa/Nairobi Indian/Comoro\",\"KN|America/Port_of_Spain America/St_Kitts\",\"KP|Asia/Pyongyang\",\"KR|Asia/Seoul\",\"KW|Asia/Riyadh Asia/Kuwait\",\"KY|America/Panama America/Cayman\",\"KZ|Asia/Almaty Asia/Qyzylorda Asia/Qostanay Asia/Aqtobe Asia/Aqtau Asia/Atyrau Asia/Oral\",\"LA|Asia/Bangkok Asia/Vientiane\",\"LB|Asia/Beirut\",\"LC|America/Port_of_Spain America/St_Lucia\",\"LI|Europe/Zurich Europe/Vaduz\",\"LK|Asia/Colombo\",\"LR|Africa/Monrovia\",\"LS|Africa/Johannesburg Africa/Maseru\",\"LT|Europe/Vilnius\",\"LU|Europe/Luxembourg\",\"LV|Europe/Riga\",\"LY|Africa/Tripoli\",\"MA|Africa/Casablanca\",\"MC|Europe/Monaco\",\"MD|Europe/Chisinau\",\"ME|Europe/Belgrade Europe/Podgorica\",\"MF|America/Port_of_Spain America/Marigot\",\"MG|Africa/Nairobi Indian/Antananarivo\",\"MH|Pacific/Majuro Pacific/Kwajalein\",\"MK|Europe/Belgrade Europe/Skopje\",\"ML|Africa/Abidjan Africa/Bamako\",\"MM|Asia/Yangon\",\"MN|Asia/Ulaanbaatar Asia/Hovd Asia/Choibalsan\",\"MO|Asia/Macau\",\"MP|Pacific/Guam Pacific/Saipan\",\"MQ|America/Martinique\",\"MR|Africa/Abidjan Africa/Nouakchott\",\"MS|America/Port_of_Spain America/Montserrat\",\"MT|Europe/Malta\",\"MU|Indian/Mauritius\",\"MV|Indian/Maldives\",\"MW|Africa/Maputo Africa/Blantyre\",\"MX|America/Mexico_City America/Cancun America/Merida America/Monterrey America/Matamoros America/Mazatlan America/Chihuahua America/Ojinaga America/Hermosillo America/Tijuana America/Bahia_Banderas\",\"MY|Asia/Kuala_Lumpur Asia/Kuching\",\"MZ|Africa/Maputo\",\"NA|Africa/Windhoek\",\"NC|Pacific/Noumea\",\"NE|Africa/Lagos Africa/Niamey\",\"NF|Pacific/Norfolk\",\"NG|Africa/Lagos\",\"NI|America/Managua\",\"NL|Europe/Amsterdam\",\"NO|Europe/Oslo\",\"NP|Asia/Kathmandu\",\"NR|Pacific/Nauru\",\"NU|Pacific/Niue\",\"NZ|Pacific/Auckland Pacific/Chatham\",\"OM|Asia/Dubai Asia/Muscat\",\"PA|America/Panama\",\"PE|America/Lima\",\"PF|Pacific/Tahiti Pacific/Marquesas Pacific/Gambier\",\"PG|Pacific/Port_Moresby Pacific/Bougainville\",\"PH|Asia/Manila\",\"PK|Asia/Karachi\",\"PL|Europe/Warsaw\",\"PM|America/Miquelon\",\"PN|Pacific/Pitcairn\",\"PR|America/Puerto_Rico\",\"PS|Asia/Gaza Asia/Hebron\",\"PT|Europe/Lisbon Atlantic/Madeira Atlantic/Azores\",\"PW|Pacific/Palau\",\"PY|America/Asuncion\",\"QA|Asia/Qatar\",\"RE|Indian/Reunion\",\"RO|Europe/Bucharest\",\"RS|Europe/Belgrade\",\"RU|Europe/Kaliningrad Europe/Moscow Europe/Simferopol Europe/Kirov Europe/Astrakhan Europe/Volgograd Europe/Saratov Europe/Ulyanovsk Europe/Samara Asia/Yekaterinburg Asia/Omsk Asia/Novosibirsk Asia/Barnaul Asia/Tomsk Asia/Novokuznetsk Asia/Krasnoyarsk Asia/Irkutsk Asia/Chita Asia/Yakutsk Asia/Khandyga Asia/Vladivostok Asia/Ust-Nera Asia/Magadan Asia/Sakhalin Asia/Srednekolymsk Asia/Kamchatka Asia/Anadyr\",\"RW|Africa/Maputo Africa/Kigali\",\"SA|Asia/Riyadh\",\"SB|Pacific/Guadalcanal\",\"SC|Indian/Mahe\",\"SD|Africa/Khartoum\",\"SE|Europe/Stockholm\",\"SG|Asia/Singapore\",\"SH|Africa/Abidjan Atlantic/St_Helena\",\"SI|Europe/Belgrade Europe/Ljubljana\",\"SJ|Europe/Oslo Arctic/Longyearbyen\",\"SK|Europe/Prague Europe/Bratislava\",\"SL|Africa/Abidjan Africa/Freetown\",\"SM|Europe/Rome Europe/San_Marino\",\"SN|Africa/Abidjan Africa/Dakar\",\"SO|Africa/Nairobi Africa/Mogadishu\",\"SR|America/Paramaribo\",\"SS|Africa/Juba\",\"ST|Africa/Sao_Tome\",\"SV|America/El_Salvador\",\"SX|America/Curacao America/Lower_Princes\",\"SY|Asia/Damascus\",\"SZ|Africa/Johannesburg Africa/Mbabane\",\"TC|America/Grand_Turk\",\"TD|Africa/Ndjamena\",\"TF|Indian/Reunion Indian/Kerguelen\",\"TG|Africa/Abidjan Africa/Lome\",\"TH|Asia/Bangkok\",\"TJ|Asia/Dushanbe\",\"TK|Pacific/Fakaofo\",\"TL|Asia/Dili\",\"TM|Asia/Ashgabat\",\"TN|Africa/Tunis\",\"TO|Pacific/Tongatapu\",\"TR|Europe/Istanbul\",\"TT|America/Port_of_Spain\",\"TV|Pacific/Funafuti\",\"TW|Asia/Taipei\",\"TZ|Africa/Nairobi Africa/Dar_es_Salaam\",\"UA|Europe/Simferopol Europe/Kiev Europe/Uzhgorod Europe/Zaporozhye\",\"UG|Africa/Nairobi Africa/Kampala\",\"UM|Pacific/Pago_Pago Pacific/Wake Pacific/Honolulu Pacific/Midway\",\"US|America/New_York America/Detroit America/Kentucky/Louisville America/Kentucky/Monticello America/Indiana/Indianapolis America/Indiana/Vincennes America/Indiana/Winamac America/Indiana/Marengo America/Indiana/Petersburg America/Indiana/Vevay America/Chicago America/Indiana/Tell_City America/Indiana/Knox America/Menominee America/North_Dakota/Center America/North_Dakota/New_Salem America/North_Dakota/Beulah America/Denver America/Boise America/Phoenix America/Los_Angeles America/Anchorage America/Juneau America/Sitka America/Metlakatla America/Yakutat America/Nome America/Adak Pacific/Honolulu\",\"UY|America/Montevideo\",\"UZ|Asia/Samarkand Asia/Tashkent\",\"VA|Europe/Rome Europe/Vatican\",\"VC|America/Port_of_Spain America/St_Vincent\",\"VE|America/Caracas\",\"VG|America/Port_of_Spain America/Tortola\",\"VI|America/Port_of_Spain America/St_Thomas\",\"VN|Asia/Bangkok Asia/Ho_Chi_Minh\",\"VU|Pacific/Efate\",\"WF|Pacific/Wallis\",\"WS|Pacific/Apia\",\"YE|Asia/Riyadh Asia/Aden\",\"YT|Africa/Nairobi Indian/Mayotte\",\"ZA|Africa/Johannesburg\",\"ZM|Africa/Maputo Africa/Lusaka\",\"ZW|Africa/Maputo Africa/Harare\"]}"); /***/ }) /******/ ]);