From 74a592f6a38f54ff2363d79006aeddc21f551bbf Mon Sep 17 00:00:00 2001 From: Casper Date: Sat, 4 Mar 2023 14:58:04 +0800 Subject: [PATCH] chore(dist): prepare for v0.6.0 --- dist/index.js | 135 +++++++++++++++++++++++----------------------- dist/index.js.map | 2 +- 2 files changed, 69 insertions(+), 68 deletions(-) diff --git a/dist/index.js b/dist/index.js index a62e0d28c..1c4a7092a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -75,7 +75,7 @@ const action = () => __awaiter(void 0, void 0, void 0, function* () { const utcOffset = Number(core.getInput('UTC_OFFSET', { required: false })); core.info(`UTC offset: ${utcOffset}`); const exclude = core.getInput('EXCLUE', { required: false }).split(','); - core.info(`Excluded languages: ${utcOffset}`); + core.info(`Excluded languages: ${exclude}`); try { // Remove old output core.info(`Remove old cards...`); @@ -728,11 +728,12 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Theme = exports.ThemeMap = void 0; exports.ThemeMap = new Map(); class Theme { - constructor(title, text, background, stroke, icon, chart) { + constructor(title, text, background, stroke, strokeOpacity, icon, chart) { this.title = title; this.text = text; this.background = background; this.stroke = stroke; + this.strokeOpacity = strokeOpacity; this.icon = icon; this.chart = chart; } @@ -741,70 +742,70 @@ exports.Theme = Theme; // Set up themes // We support short hex color, hex color and RGBA hex // ThemeMap.set(name, new Theme('title', 'text', 'background', 'stroke', 'icon', 'chart')); -exports.ThemeMap.set('2077', new Theme('#ff0055', '#03d8f3', '#141321', '#141321', '#fcee0c', '#00ffc8')); -exports.ThemeMap.set('algolia', new Theme('#00aeff', '#ffffff', '#050f2c', '#00000000', '#2dde98', '#00aeff')); -exports.ThemeMap.set('apprentice', new Theme('#ffffff', '#bcbcbc', '#262626', '#00000000', '#ffffaf', '#ffffff')); -exports.ThemeMap.set('aura_dark', new Theme('#ff7372', '#dbdbdb', '#252334', '#00000000', '#6cffd0', '#ff7372')); -exports.ThemeMap.set('aura', new Theme('#a277ff', '#61ffca', '#15141b', '#00000000', '#ffca85', '#a277ff')); -exports.ThemeMap.set('ayu_mirage', new Theme('#f4cd7c', '#c7c8c2', '#1f2430', '#00000000', '#73d0ff', '#f4cd7c')); -exports.ThemeMap.set('bear', new Theme('#e03c8a', '#bcb28d', '#1f2023', '#00000000', '#00aeff', '#e03c8a')); -exports.ThemeMap.set('blue_green', new Theme('#2f97c1', '#0cf574', '#040f0f', '#00000000', '#f5b700', '#2f97c1')); -exports.ThemeMap.set('blueberry', new Theme('#82aaff', '#27e8a7', '#242938', '#00000000', '#89ddff', '#82aaff')); -exports.ThemeMap.set('buefy', new Theme('#7957d5', '#363636', '#ffffff', '#00000000', '#ff3860', '#7957d5')); -exports.ThemeMap.set('calm', new Theme('#e07a5f', '#ebcfb2', '#373f51', '#00000000', '#edae49', '#e07a5f')); -exports.ThemeMap.set('chartreuse_dark', new Theme('#7fff00', '#fff', '#000', '#000000', '#00aeff', '#7fff00')); -exports.ThemeMap.set('city_lights', new Theme('#5d8cb3', '#718ca1', '#1d252c', '#00000000', '#4798ff', '#5d8cb3')); -exports.ThemeMap.set('cobalt', new Theme('#e683d9', '#75eeb2', '#193549', '#00000000', '#0480ef', '#e683d9')); -exports.ThemeMap.set('cobalt2', new Theme('#ffc600', '#0088ff', '#193549', '#00000000', '#ffffff', '#ffc600')); -exports.ThemeMap.set('codeSTACKr', new Theme('#ff652f', '#ffffff', '#09131b', '#0c1a25', '#ffe400', '#ff652f')); -exports.ThemeMap.set('darcula', new Theme('#ba5f17', '#bebebe', '#242424', '#00000000', '#ffb74d', '#ba5f17')); -exports.ThemeMap.set('dark', new Theme('#fff', '#9f9f9f', '#151515', '#00000000', '#79ff97', '#fff')); -exports.ThemeMap.set('date_night', new Theme('#da7885', '#e1b2a2', '#170f0c', '#170f0c', '#bb8470', '#da7885')); -exports.ThemeMap.set('default', new Theme('#586e75', '#586e75', '#ffffff', '#e4e2e2', '#586e75', '#586e75')); -exports.ThemeMap.set('discord_old_blurple', new Theme('#7289da', '#ffffff', '#2c2f33', '#00000000', '#7289da', '#7289da')); -exports.ThemeMap.set('dracula', new Theme('#ff79c6', '#ffb86c', '#282a36', '#282a36', '#6272a4', '#bd93f9')); -exports.ThemeMap.set('flag_india', new Theme('#ff8f1c', '#509e2f', '#ffffff', '#00000000', '#250e62', '#ff8f1c')); -exports.ThemeMap.set('github_dark', new Theme('#0366d6', '#77909c', '#0d1117', '#2e343b', '#8b949e', '#40c463')); -exports.ThemeMap.set('github', new Theme('#0366d6', '#586069', '#ffffff', '#e4e2e2', '#586069', '#40c463')); -exports.ThemeMap.set('gotham', new Theme('#2aa889', '#99d1ce', '#0c1014', '#00000000', '#599cab', '#2aa889')); -exports.ThemeMap.set('graywhite', new Theme('#24292e', '#24292e', '#ffffff', '#00000000', '#24292e', '#24292e')); -exports.ThemeMap.set('great_gatsby', new Theme('#ffa726', '#ffd95b', '#000000', '#00000000', '#ffb74d', '#ffa726')); -exports.ThemeMap.set('gruvbox', new Theme('#fabd2f', '#8ec07c', '#282828', '#282828', '#fe8019', '#fe8019')); -exports.ThemeMap.set('highcontrast', new Theme('#e7f216', '#fff', '#000', '#00000000', '#00ffff', '#e7f216')); -exports.ThemeMap.set('jolly', new Theme('#ff64da', '#ffffff', '#291b3e', '#00000000', '#a960ff', '#ff64da')); -exports.ThemeMap.set('kacho_ga', new Theme('#bf4a3f', '#d9c8a9', '#402b23', '#00000000', '#a64833', '#bf4a3f')); -exports.ThemeMap.set('maroongold', new Theme('#f7ef8a', '#e0aa3e', '#260000', '#00000000', '#f7ef8a', '#f7ef8a')); -exports.ThemeMap.set('material_palenight', new Theme('#c792ea', '#a6accd', '#292d3e', '#00000000', '#89ddff', '#c792ea')); -exports.ThemeMap.set('merko', new Theme('#abd200', '#68b587', '#0a0f0b', '#00000000', '#b7d364', '#abd200')); -exports.ThemeMap.set('midnight_purple', new Theme('#9745f5', '#ffffff', '#000000', '#00000000', '#9f4bff', '#9745f5')); -exports.ThemeMap.set('moltack', new Theme('#86092c', '#574038', '#f5e1c0', '#00000000', '#86092c', '#86092c')); -exports.ThemeMap.set('monokai', new Theme('#eb1f6a', '#ffffff', '#2c292d', '#2c292d', '#e28905', '#ae81ff')); -exports.ThemeMap.set('moonlight', new Theme('#ff757f', '#f8f8f8', '#222436', '#222436', '#599dff', '#ff757f')); -exports.ThemeMap.set('nightowl', new Theme('#c792ea', '#7fdbca', '#011627', '#00000000', '#ffeb95', '#c792ea')); -exports.ThemeMap.set('noctis_minimus', new Theme('#d3b692', '#c5cdd3', '#1b2932', '#00000000', '#72b7c0', '#d3b692')); -exports.ThemeMap.set('nord_bright', new Theme('#3b4252', '#2e3440', '#eceff4', '#e5e9f0', '#8fbcbb', '#88c0d0')); -exports.ThemeMap.set('nord_dark', new Theme('#eceff4', '#e5e9f0', '#2e3440', '#eceff4', '#8fbcbb', '#88c0d0')); -exports.ThemeMap.set('ocean_dark', new Theme('#8957b2', '#92d534', '#151a28', '#00000000', '#ffffff', '#8957b2')); -exports.ThemeMap.set('omni', new Theme('#ff79c6', '#e1e1e6', '#191622', '#00000000', '#e7de79', '#ff79c6')); -exports.ThemeMap.set('onedark', new Theme('#e4bf7a', '#df6d74', '#282c34', '#00000000', '#8eb573', '#e4bf7a')); -exports.ThemeMap.set('outrun', new Theme('#ffcc00', '#8080ff', '#141439', '#00000000', '#ff1aff', '#ffcc00')); -exports.ThemeMap.set('panda', new Theme('#19f9d899', '#ff75b5', '#31353a', '#00000000', '#19f9d899', '#19f9d899')); -exports.ThemeMap.set('prussian', new Theme('#bddfff', '#6e93b5', '#172f45', '#00000000', '#38a0ff', '#bddfff')); -exports.ThemeMap.set('radical', new Theme('#fe428e', '#a9fef7', '#141321', '#141321', '#f8d847', '#ae81ff')); -exports.ThemeMap.set('react', new Theme('#61dafb', '#ffffff', '#20232a', '#00000000', '#61dafb', '#61dafb')); -exports.ThemeMap.set('rose_pine', new Theme('#9ccfd8', '#e0def4', '#191724', '#00000000', '#ebbcba', '#9ccfd8')); -exports.ThemeMap.set('shades_of_purple', new Theme('#fad000', '#a599e9', '#2d2b55', '#00000000', '#b362ff', '#fad000')); -exports.ThemeMap.set('slateorange', new Theme('#faa627', '#ffffff', '#36393f', '#00000000', '#faa627', '#faa627')); -exports.ThemeMap.set('solarized_dark', new Theme('#268bd2', '#839496', '#073642', '#073642', '#b58900', '#859900')); -exports.ThemeMap.set('solarized', new Theme('#268bd2', '#586e75', '#fdf6e3', '#fdf6e3', '#b58900', '#859900')); -exports.ThemeMap.set('swift', new Theme('#000000', '#000000', '#f7f7f7', '#00000000', '#f05237', '#000000')); -exports.ThemeMap.set('synthwave', new Theme('#e2e9ec', '#e5289e', '#2b213a', '#00000000', '#ef8539', '#e2e9ec')); -exports.ThemeMap.set('tokyonight', new Theme('#70a5fd', '#38bdae', '#1a1b27', '#1a1b27', '#bf91f3', '#bf91f3')); -exports.ThemeMap.set('transparent', new Theme('#006AFF', '#417E87', '#00000000', '#00000000', '#0579C3', '#006AFF')); -exports.ThemeMap.set('vision_friendly_dark', new Theme('#ffb000', '#ffffff', '#000000', '#00000000', '#785ef0', '#ffb000')); -exports.ThemeMap.set('vue', new Theme('#41b883', '#000000', '#ffffff', '#e4e2e2', '#41b883', '#41b883')); -exports.ThemeMap.set('yeblu', new Theme('#ffff00', '#ffffff', '#002046', '#00000000', '#ffff00', '#ffff00')); -exports.ThemeMap.set('zenburn', new Theme('#f0dfaf', '#dcdccc', '#3f3f3f', '#3f3f3f', '#8cd0d3', '#7f9f7f')); +exports.ThemeMap.set('2077', new Theme('#ff0055', '#03d8f3', '#141321', '#141321', 1, '#fcee0c', '#00ffc8')); +exports.ThemeMap.set('algolia', new Theme('#00aeff', '#ffffff', '#050f2c', '#000000', 0, '#2dde98', '#00aeff')); +exports.ThemeMap.set('apprentice', new Theme('#ffffff', '#bcbcbc', '#262626', '#000000', 0, '#ffffaf', '#ffffff')); +exports.ThemeMap.set('aura_dark', new Theme('#ff7372', '#dbdbdb', '#252334', '#000000', 0, '#6cffd0', '#ff7372')); +exports.ThemeMap.set('aura', new Theme('#a277ff', '#61ffca', '#15141b', '#000000', 0, '#ffca85', '#a277ff')); +exports.ThemeMap.set('ayu_mirage', new Theme('#f4cd7c', '#c7c8c2', '#1f2430', '#000000', 0, '#73d0ff', '#f4cd7c')); +exports.ThemeMap.set('bear', new Theme('#e03c8a', '#bcb28d', '#1f2023', '#000000', 0, '#00aeff', '#e03c8a')); +exports.ThemeMap.set('blue_green', new Theme('#2f97c1', '#0cf574', '#040f0f', '#000000', 0, '#f5b700', '#2f97c1')); +exports.ThemeMap.set('blueberry', new Theme('#82aaff', '#27e8a7', '#242938', '#000000', 0, '#89ddff', '#82aaff')); +exports.ThemeMap.set('buefy', new Theme('#7957d5', '#363636', '#ffffff', '#000000', 0, '#ff3860', '#7957d5')); +exports.ThemeMap.set('calm', new Theme('#e07a5f', '#ebcfb2', '#373f51', '#000000', 0, '#edae49', '#e07a5f')); +exports.ThemeMap.set('chartreuse_dark', new Theme('#7fff00', '#fff', '#000', '#000000', 1, '#00aeff', '#7fff00')); +exports.ThemeMap.set('city_lights', new Theme('#5d8cb3', '#718ca1', '#1d252c', '#000000', 0, '#4798ff', '#5d8cb3')); +exports.ThemeMap.set('cobalt', new Theme('#e683d9', '#75eeb2', '#193549', '#000000', 0, '#0480ef', '#e683d9')); +exports.ThemeMap.set('cobalt2', new Theme('#ffc600', '#0088ff', '#193549', '#000000', 0, '#ffffff', '#ffc600')); +exports.ThemeMap.set('codeSTACKr', new Theme('#ff652f', '#ffffff', '#09131b', '#0c1a25', 1, '#ffe400', '#ff652f')); +exports.ThemeMap.set('darcula', new Theme('#ba5f17', '#bebebe', '#242424', '#000000', 0, '#ffb74d', '#ba5f17')); +exports.ThemeMap.set('dark', new Theme('#fff', '#9f9f9f', '#151515', '#000000', 0, '#79ff97', '#fff')); +exports.ThemeMap.set('date_night', new Theme('#da7885', '#e1b2a2', '#170f0c', '#170f0c', 1, '#bb8470', '#da7885')); +exports.ThemeMap.set('default', new Theme('#586e75', '#586e75', '#ffffff', '#e4e2e2', 1, '#586e75', '#586e75')); +exports.ThemeMap.set('discord_old_blurple', new Theme('#7289da', '#ffffff', '#2c2f33', '#000000', 0, '#7289da', '#7289da')); +exports.ThemeMap.set('dracula', new Theme('#ff79c6', '#ffb86c', '#282a36', '#282a36', 1, '#6272a4', '#bd93f9')); +exports.ThemeMap.set('flag_india', new Theme('#ff8f1c', '#509e2f', '#ffffff', '#000000', 0, '#250e62', '#ff8f1c')); +exports.ThemeMap.set('github_dark', new Theme('#0366d6', '#77909c', '#0d1117', '#2e343b', 1, '#8b949e', '#40c463')); +exports.ThemeMap.set('github', new Theme('#0366d6', '#586069', '#ffffff', '#e4e2e2', 1, '#586069', '#40c463')); +exports.ThemeMap.set('gotham', new Theme('#2aa889', '#99d1ce', '#0c1014', '#000000', 0, '#599cab', '#2aa889')); +exports.ThemeMap.set('graywhite', new Theme('#24292e', '#24292e', '#ffffff', '#000000', 0, '#24292e', '#24292e')); +exports.ThemeMap.set('great_gatsby', new Theme('#ffa726', '#ffd95b', '#000000', '#000000', 0, '#ffb74d', '#ffa726')); +exports.ThemeMap.set('gruvbox', new Theme('#fabd2f', '#8ec07c', '#282828', '#282828', 1, '#fe8019', '#fe8019')); +exports.ThemeMap.set('highcontrast', new Theme('#e7f216', '#fff', '#000', '#000000', 0, '#00ffff', '#e7f216')); +exports.ThemeMap.set('jolly', new Theme('#ff64da', '#ffffff', '#291b3e', '#000000', 0, '#a960ff', '#ff64da')); +exports.ThemeMap.set('kacho_ga', new Theme('#bf4a3f', '#d9c8a9', '#402b23', '#000000', 0, '#a64833', '#bf4a3f')); +exports.ThemeMap.set('maroongold', new Theme('#f7ef8a', '#e0aa3e', '#260000', '#000000', 0, '#f7ef8a', '#f7ef8a')); +exports.ThemeMap.set('material_palenight', new Theme('#c792ea', '#a6accd', '#292d3e', '#000000', 0, '#89ddff', '#c792ea')); +exports.ThemeMap.set('merko', new Theme('#abd200', '#68b587', '#0a0f0b', '#000000', 0, '#b7d364', '#abd200')); +exports.ThemeMap.set('midnight_purple', new Theme('#9745f5', '#ffffff', '#000000', '#000000', 0, '#9f4bff', '#9745f5')); +exports.ThemeMap.set('moltack', new Theme('#86092c', '#574038', '#f5e1c0', '#000000', 0, '#86092c', '#86092c')); +exports.ThemeMap.set('monokai', new Theme('#eb1f6a', '#ffffff', '#2c292d', '#2c292d', 1, '#e28905', '#ae81ff')); +exports.ThemeMap.set('moonlight', new Theme('#ff757f', '#f8f8f8', '#222436', '#222436', 1, '#599dff', '#ff757f')); +exports.ThemeMap.set('nightowl', new Theme('#c792ea', '#7fdbca', '#011627', '#000000', 0, '#ffeb95', '#c792ea')); +exports.ThemeMap.set('noctis_minimus', new Theme('#d3b692', '#c5cdd3', '#1b2932', '#000000', 0, '#72b7c0', '#d3b692')); +exports.ThemeMap.set('nord_bright', new Theme('#3b4252', '#2e3440', '#eceff4', '#e5e9f0', 1, '#8fbcbb', '#88c0d0')); +exports.ThemeMap.set('nord_dark', new Theme('#eceff4', '#e5e9f0', '#2e3440', '#eceff4', 1, '#8fbcbb', '#88c0d0')); +exports.ThemeMap.set('ocean_dark', new Theme('#8957b2', '#92d534', '#151a28', '#000000', 0, '#ffffff', '#8957b2')); +exports.ThemeMap.set('omni', new Theme('#ff79c6', '#e1e1e6', '#191622', '#000000', 0, '#e7de79', '#ff79c6')); +exports.ThemeMap.set('onedark', new Theme('#e4bf7a', '#df6d74', '#282c34', '#000000', 0, '#8eb573', '#e4bf7a')); +exports.ThemeMap.set('outrun', new Theme('#ffcc00', '#8080ff', '#141439', '#000000', 0, '#ff1aff', '#ffcc00')); +exports.ThemeMap.set('panda', new Theme('#19f9d899', '#ff75b5', '#31353a', '#000000', 0, '#19f9d899', '#19f9d899')); +exports.ThemeMap.set('prussian', new Theme('#bddfff', '#6e93b5', '#172f45', '#000000', 0, '#38a0ff', '#bddfff')); +exports.ThemeMap.set('radical', new Theme('#fe428e', '#a9fef7', '#141321', '#141321', 1, '#f8d847', '#ae81ff')); +exports.ThemeMap.set('react', new Theme('#61dafb', '#ffffff', '#20232a', '#000000', 0, '#61dafb', '#61dafb')); +exports.ThemeMap.set('rose_pine', new Theme('#9ccfd8', '#e0def4', '#191724', '#000000', 0, '#ebbcba', '#9ccfd8')); +exports.ThemeMap.set('shades_of_purple', new Theme('#fad000', '#a599e9', '#2d2b55', '#000000', 0, '#b362ff', '#fad000')); +exports.ThemeMap.set('slateorange', new Theme('#faa627', '#ffffff', '#36393f', '#000000', 0, '#faa627', '#faa627')); +exports.ThemeMap.set('solarized_dark', new Theme('#268bd2', '#839496', '#073642', '#073642', 1, '#b58900', '#859900')); +exports.ThemeMap.set('solarized', new Theme('#268bd2', '#586e75', '#fdf6e3', '#fdf6e3', 1, '#b58900', '#859900')); +exports.ThemeMap.set('swift', new Theme('#000000', '#000000', '#f7f7f7', '#000000', 0, '#f05237', '#000000')); +exports.ThemeMap.set('synthwave', new Theme('#e2e9ec', '#e5289e', '#2b213a', '#000000', 0, '#ef8539', '#e2e9ec')); +exports.ThemeMap.set('tokyonight', new Theme('#70a5fd', '#38bdae', '#1a1b27', '#1a1b27', 1, '#bf91f3', '#bf91f3')); +exports.ThemeMap.set('transparent', new Theme('#006AFF', '#417E87', '#00000000', '#000000', 0, '#0579C3', '#006AFF')); +exports.ThemeMap.set('vision_friendly_dark', new Theme('#ffb000', '#ffffff', '#000000', '#000000', 0, '#785ef0', '#ffb000')); +exports.ThemeMap.set('vue', new Theme('#41b883', '#000000', '#ffffff', '#e4e2e2', 1, '#41b883', '#41b883')); +exports.ThemeMap.set('yeblu', new Theme('#ffff00', '#ffffff', '#002046', '#000000', 0, '#ffff00', '#ffff00')); +exports.ThemeMap.set('zenburn', new Theme('#f0dfaf', '#dcdccc', '#3f3f3f', '#3f3f3f', 1, '#8cd0d3', '#7f9f7f')); /***/ }), @@ -1399,7 +1400,7 @@ class Card { .attr('stroke', `${theme.stroke}`) .attr('stroke-width', '1') .attr('fill', `${theme.background}`) - .attr('stroke-opacity', 1); + .attr('stroke-opacity', `${theme.strokeOpacity}`); const isEmptyTitle = this.title == ''; if (!isEmptyTitle) { this.svg diff --git a/dist/index.js.map b/dist/index.js.map index 9e15bf558..98d289464 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../webpack://github-profile-summary-cards/./lib/app.js","../webpack://github-profile-summary-cards/./lib/cards/most-commit-language-card.js","../webpack://github-profile-summary-cards/./lib/cards/productive-time-card.js","../webpack://github-profile-summary-cards/./lib/cards/profile-details-card.js","../webpack://github-profile-summary-cards/./lib/cards/repos-per-language-card.js","../webpack://github-profile-summary-cards/./lib/cards/stats-card.js","../webpack://github-profile-summary-cards/./lib/const/icon.js","../webpack://github-profile-summary-cards/./lib/const/theme.js","../webpack://github-profile-summary-cards/./lib/github-api/commits-per-language.js","../webpack://github-profile-summary-cards/./lib/github-api/contributions-by-year.js","../webpack://github-profile-summary-cards/./lib/github-api/productive-time.js","../webpack://github-profile-summary-cards/./lib/github-api/profile-details.js","../webpack://github-profile-summary-cards/./lib/github-api/repos-per-language.js","../webpack://github-profile-summary-cards/./lib/templates/card.js","../webpack://github-profile-summary-cards/./lib/templates/donut-chart-card.js","../webpack://github-profile-summary-cards/./lib/templates/productive-time-card.js","../webpack://github-profile-summary-cards/./lib/templates/profile-details-card.js","../webpack://github-profile-summary-cards/./lib/templates/stats-card.js","../webpack://github-profile-summary-cards/./lib/utils/file-writer.js","../webpack://github-profile-summary-cards/./lib/utils/request.js","../webpack://github-profile-summary-cards/./lib/utils/translator.js","../webpack://github-profile-summary-cards/./node_modules/@actions/core/lib/command.js","../webpack://github-profile-summary-cards/./node_modules/@actions/core/lib/core.js","../webpack://github-profile-summary-cards/./node_modules/@actions/core/lib/file-command.js","../webpack://github-profile-summary-cards/./node_modules/@actions/core/lib/oidc-utils.js","../webpack://github-profile-summary-cards/./node_modules/@actions/core/lib/path-utils.js","../webpack://github-profile-summary-cards/./node_modules/@actions/core/lib/summary.js","../webpack://github-profile-summary-cards/./node_modules/@actions/core/lib/utils.js","../webpack://github-profile-summary-cards/./node_modules/@actions/core/node_modules/@actions/http-client/lib/auth.js","../webpack://github-profile-summary-cards/./node_modules/@actions/core/node_modules/@actions/http-client/lib/index.js","../webpack://github-profile-summary-cards/./node_modules/@actions/core/node_modules/@actions/http-client/lib/proxy.js","../webpack://github-profile-summary-cards/./node_modules/@tootallnate/once/dist/index.js","../webpack://github-profile-summary-cards/./node_modules/abab/index.js","../webpack://github-profile-summary-cards/./node_modules/abab/lib/atob.js","../webpack://github-profile-summary-cards/./node_modules/abab/lib/btoa.js","../webpack://github-profile-summary-cards/./node_modules/agent-base/dist/src/index.js","../webpack://github-profile-summary-cards/./node_modules/agent-base/dist/src/promisify.js","../webpack://github-profile-summary-cards/./node_modules/asynckit/index.js","../webpack://github-profile-summary-cards/./node_modules/asynckit/lib/abort.js","../webpack://github-profile-summary-cards/./node_modules/asynckit/lib/async.js","../webpack://github-profile-summary-cards/./node_modules/asynckit/lib/defer.js","../webpack://github-profile-summary-cards/./node_modules/asynckit/lib/iterate.js","../webpack://github-profile-summary-cards/./node_modules/asynckit/lib/state.js","../webpack://github-profile-summary-cards/./node_modules/asynckit/lib/terminator.js","../webpack://github-profile-summary-cards/./node_modules/asynckit/parallel.js","../webpack://github-profile-summary-cards/./node_modules/asynckit/serial.js","../webpack://github-profile-summary-cards/./node_modules/asynckit/serialOrdered.js","../webpack://github-profile-summary-cards/./node_modules/axios/index.js","../webpack://github-profile-summary-cards/./node_modules/axios/lib/adapters/http.js","../webpack://github-profile-summary-cards/./node_modules/axios/lib/adapters/xhr.js","../webpack://github-profile-summary-cards/./node_modules/axios/lib/axios.js","../webpack://github-profile-summary-cards/./node_modules/axios/lib/cancel/Cancel.js","../webpack://github-profile-summary-cards/./node_modules/axios/lib/cancel/CancelToken.js","../webpack://github-profile-summary-cards/./node_modules/axios/lib/cancel/isCancel.js","../webpack://github-profile-summary-cards/./node_modules/axios/lib/core/Axios.js","../webpack://github-profile-summary-cards/./node_modules/axios/lib/core/InterceptorManager.js","../webpack://github-profile-summary-cards/./node_modules/axios/lib/core/buildFullPath.js","../webpack://github-profile-summary-cards/./node_modules/axios/lib/core/createError.js","../webpack://github-profile-summary-cards/./node_modules/axios/lib/core/dispatchRequest.js","../webpack://github-profile-summary-cards/./node_modules/axios/lib/core/enhanceError.js","../webpack://github-profile-summary-cards/./node_modules/axios/lib/core/mergeConfig.js","../webpack://github-profile-summary-cards/./node_modules/axios/lib/core/settle.js","../webpack://github-profile-summary-cards/./node_modules/axios/lib/core/transformData.js","../webpack://github-profile-summary-cards/./node_modules/axios/lib/defaults.js","../webpack://github-profile-summary-cards/./node_modules/axios/lib/helpers/bind.js","../webpack://github-profile-summary-cards/./node_modules/axios/lib/helpers/buildURL.js","../webpack://github-profile-summary-cards/./node_modules/axios/lib/helpers/combineURLs.js","../webpack://github-profile-summary-cards/./node_modules/axios/lib/helpers/cookies.js","../webpack://github-profile-summary-cards/./node_modules/axios/lib/helpers/isAbsoluteURL.js","../webpack://github-profile-summary-cards/./node_modules/axios/lib/helpers/isAxiosError.js","../webpack://github-profile-summary-cards/./node_modules/axios/lib/helpers/isURLSameOrigin.js","../webpack://github-profile-summary-cards/./node_modules/axios/lib/helpers/normalizeHeaderName.js","../webpack://github-profile-summary-cards/./node_modules/axios/lib/helpers/parseHeaders.js","../webpack://github-profile-summary-cards/./node_modules/axios/lib/helpers/spread.js","../webpack://github-profile-summary-cards/./node_modules/axios/lib/helpers/validator.js","../webpack://github-profile-summary-cards/./node_modules/axios/lib/utils.js","../webpack://github-profile-summary-cards/./node_modules/browser-process-hrtime/index.js","../webpack://github-profile-summary-cards/./node_modules/combined-stream/lib/combined_stream.js","../webpack://github-profile-summary-cards/./node_modules/cssom/lib/CSSDocumentRule.js","../webpack://github-profile-summary-cards/./node_modules/cssom/lib/CSSFontFaceRule.js","../webpack://github-profile-summary-cards/./node_modules/cssom/lib/CSSHostRule.js","../webpack://github-profile-summary-cards/./node_modules/cssom/lib/CSSImportRule.js","../webpack://github-profile-summary-cards/./node_modules/cssom/lib/CSSKeyframeRule.js","../webpack://github-profile-summary-cards/./node_modules/cssom/lib/CSSKeyframesRule.js","../webpack://github-profile-summary-cards/./node_modules/cssom/lib/CSSMediaRule.js","../webpack://github-profile-summary-cards/./node_modules/cssom/lib/CSSRule.js","../webpack://github-profile-summary-cards/./node_modules/cssom/lib/CSSStyleDeclaration.js","../webpack://github-profile-summary-cards/./node_modules/cssom/lib/CSSStyleRule.js","../webpack://github-profile-summary-cards/./node_modules/cssom/lib/CSSStyleSheet.js","../webpack://github-profile-summary-cards/./node_modules/cssom/lib/CSSSupportsRule.js","../webpack://github-profile-summary-cards/./node_modules/cssom/lib/CSSValue.js","../webpack://github-profile-summary-cards/./node_modules/cssom/lib/CSSValueExpression.js","../webpack://github-profile-summary-cards/./node_modules/cssom/lib/MatcherList.js","../webpack://github-profile-summary-cards/./node_modules/cssom/lib/MediaList.js","../webpack://github-profile-summary-cards/./node_modules/cssom/lib/StyleSheet.js","../webpack://github-profile-summary-cards/./node_modules/cssom/lib/clone.js","../webpack://github-profile-summary-cards/./node_modules/cssom/lib/index.js","../webpack://github-profile-summary-cards/./node_modules/cssom/lib/parse.js","../webpack://github-profile-summary-cards/./node_modules/cssstyle/lib/CSSStyleDeclaration.js","../webpack://github-profile-summary-cards/./node_modules/cssstyle/lib/allExtraProperties.js","../webpack://github-profile-summary-cards/./node_modules/cssstyle/lib/allProperties.js","../webpack://github-profile-summary-cards/./node_modules/cssstyle/lib/allWebkitProperties.js","../webpack://github-profile-summary-cards/./node_modules/cssstyle/lib/constants.js","../webpack://github-profile-summary-cards/./node_modules/cssstyle/lib/implementedProperties.js","../webpack://github-profile-summary-cards/./node_modules/cssstyle/lib/parsers.js","../webpack://github-profile-summary-cards/./node_modules/cssstyle/lib/properties.js","../webpack://github-profile-summary-cards/./node_modules/cssstyle/lib/utils/colorSpace.js","../webpack://github-profile-summary-cards/./node_modules/cssstyle/lib/utils/getBasicPropertyDescriptor.js","../webpack://github-profile-summary-cards/./node_modules/cssstyle/node_modules/cssom/lib/CSSDocumentRule.js","../webpack://github-profile-summary-cards/./node_modules/cssstyle/node_modules/cssom/lib/CSSFontFaceRule.js","../webpack://github-profile-summary-cards/./node_modules/cssstyle/node_modules/cssom/lib/CSSHostRule.js","../webpack://github-profile-summary-cards/./node_modules/cssstyle/node_modules/cssom/lib/CSSImportRule.js","../webpack://github-profile-summary-cards/./node_modules/cssstyle/node_modules/cssom/lib/CSSKeyframeRule.js","../webpack://github-profile-summary-cards/./node_modules/cssstyle/node_modules/cssom/lib/CSSKeyframesRule.js","../webpack://github-profile-summary-cards/./node_modules/cssstyle/node_modules/cssom/lib/CSSMediaRule.js","../webpack://github-profile-summary-cards/./node_modules/cssstyle/node_modules/cssom/lib/CSSRule.js","../webpack://github-profile-summary-cards/./node_modules/cssstyle/node_modules/cssom/lib/CSSStyleDeclaration.js","../webpack://github-profile-summary-cards/./node_modules/cssstyle/node_modules/cssom/lib/CSSStyleRule.js","../webpack://github-profile-summary-cards/./node_modules/cssstyle/node_modules/cssom/lib/CSSStyleSheet.js","../webpack://github-profile-summary-cards/./node_modules/cssstyle/node_modules/cssom/lib/CSSSupportsRule.js","../webpack://github-profile-summary-cards/./node_modules/cssstyle/node_modules/cssom/lib/CSSValue.js","../webpack://github-profile-summary-cards/./node_modules/cssstyle/node_modules/cssom/lib/CSSValueExpression.js","../webpack://github-profile-summary-cards/./node_modules/cssstyle/node_modules/cssom/lib/MatcherList.js","../webpack://github-profile-summary-cards/./node_modules/cssstyle/node_modules/cssom/lib/MediaList.js","../webpack://github-profile-summary-cards/./node_modules/cssstyle/node_modules/cssom/lib/StyleSheet.js","../webpack://github-profile-summary-cards/./node_modules/cssstyle/node_modules/cssom/lib/clone.js","../webpack://github-profile-summary-cards/./node_modules/cssstyle/node_modules/cssom/lib/index.js","../webpack://github-profile-summary-cards/./node_modules/cssstyle/node_modules/cssom/lib/parse.js","../webpack://github-profile-summary-cards/./node_modules/d3-array/dist/d3-array.js","../webpack://github-profile-summary-cards/./node_modules/d3-axis/dist/d3-axis.js","../webpack://github-profile-summary-cards/./node_modules/d3-brush/dist/d3-brush.js","../webpack://github-profile-summary-cards/./node_modules/d3-chord/dist/d3-chord.js","../webpack://github-profile-summary-cards/./node_modules/d3-color/dist/d3-color.js","../webpack://github-profile-summary-cards/./node_modules/d3-contour/dist/d3-contour.js","../webpack://github-profile-summary-cards/./node_modules/d3-delaunay/dist/d3-delaunay.js","../webpack://github-profile-summary-cards/./node_modules/d3-dispatch/dist/d3-dispatch.js","../webpack://github-profile-summary-cards/./node_modules/d3-drag/dist/d3-drag.js","../webpack://github-profile-summary-cards/./node_modules/d3-dsv/dist/d3-dsv.js","../webpack://github-profile-summary-cards/./node_modules/d3-ease/dist/d3-ease.js","../webpack://github-profile-summary-cards/./node_modules/d3-fetch/dist/d3-fetch.js","../webpack://github-profile-summary-cards/./node_modules/d3-force/dist/d3-force.js","../webpack://github-profile-summary-cards/./node_modules/d3-format/dist/d3-format.js","../webpack://github-profile-summary-cards/./node_modules/d3-geo/dist/d3-geo.js","../webpack://github-profile-summary-cards/./node_modules/d3-hierarchy/dist/d3-hierarchy.js","../webpack://github-profile-summary-cards/./node_modules/d3-interpolate/dist/d3-interpolate.js","../webpack://github-profile-summary-cards/./node_modules/d3-path/dist/d3-path.js","../webpack://github-profile-summary-cards/./node_modules/d3-polygon/dist/d3-polygon.js","../webpack://github-profile-summary-cards/./node_modules/d3-quadtree/dist/d3-quadtree.js","../webpack://github-profile-summary-cards/./node_modules/d3-random/dist/d3-random.js","../webpack://github-profile-summary-cards/./node_modules/d3-scale-chromatic/dist/d3-scale-chromatic.js","../webpack://github-profile-summary-cards/./node_modules/d3-scale/dist/d3-scale.js","../webpack://github-profile-summary-cards/./node_modules/d3-selection/dist/d3-selection.js","../webpack://github-profile-summary-cards/./node_modules/d3-shape/dist/d3-shape.js","../webpack://github-profile-summary-cards/./node_modules/d3-time-format/dist/d3-time-format.js","../webpack://github-profile-summary-cards/./node_modules/d3-time/dist/d3-time.js","../webpack://github-profile-summary-cards/./node_modules/d3-timer/dist/d3-timer.js","../webpack://github-profile-summary-cards/./node_modules/d3-transition/dist/d3-transition.js","../webpack://github-profile-summary-cards/./node_modules/d3-zoom/dist/d3-zoom.js","../webpack://github-profile-summary-cards/./node_modules/d3/dist/d3.node.js","../webpack://github-profile-summary-cards/./node_modules/data-urls/lib/parser.js","../webpack://github-profile-summary-cards/./node_modules/data-urls/lib/utils.js","../webpack://github-profile-summary-cards/./node_modules/debug/node_modules/ms/index.js","../webpack://github-profile-summary-cards/./node_modules/debug/src/browser.js","../webpack://github-profile-summary-cards/./node_modules/debug/src/common.js","../webpack://github-profile-summary-cards/./node_modules/debug/src/index.js","../webpack://github-profile-summary-cards/./node_modules/debug/src/node.js","../webpack://github-profile-summary-cards/./node_modules/decimal.js/decimal.js","../webpack://github-profile-summary-cards/./node_modules/delayed-stream/lib/delayed_stream.js","../webpack://github-profile-summary-cards/./node_modules/domexception/lib/DOMException-impl.js","../webpack://github-profile-summary-cards/./node_modules/domexception/lib/DOMException.js","../webpack://github-profile-summary-cards/./node_modules/domexception/lib/utils.js","../webpack://github-profile-summary-cards/./node_modules/domexception/node_modules/webidl-conversions/lib/index.js","../webpack://github-profile-summary-cards/./node_modules/domexception/webidl2js-wrapper.js","../webpack://github-profile-summary-cards/./node_modules/follow-redirects/debug.js","../webpack://github-profile-summary-cards/./node_modules/follow-redirects/index.js","../webpack://github-profile-summary-cards/./node_modules/form-data/lib/form_data.js","../webpack://github-profile-summary-cards/./node_modules/form-data/lib/populate.js","../webpack://github-profile-summary-cards/./node_modules/has-flag/index.js","../webpack://github-profile-summary-cards/./node_modules/html-encoding-sniffer/lib/html-encoding-sniffer.js","../webpack://github-profile-summary-cards/./node_modules/http-proxy-agent/dist/agent.js","../webpack://github-profile-summary-cards/./node_modules/http-proxy-agent/dist/index.js","../webpack://github-profile-summary-cards/./node_modules/https-proxy-agent/dist/agent.js","../webpack://github-profile-summary-cards/./node_modules/https-proxy-agent/dist/index.js","../webpack://github-profile-summary-cards/./node_modules/https-proxy-agent/dist/parse-proxy-response.js","../webpack://github-profile-summary-cards/./node_modules/iconv-lite/encodings/dbcs-codec.js","../webpack://github-profile-summary-cards/./node_modules/iconv-lite/encodings/dbcs-data.js","../webpack://github-profile-summary-cards/./node_modules/iconv-lite/encodings/index.js","../webpack://github-profile-summary-cards/./node_modules/iconv-lite/encodings/internal.js","../webpack://github-profile-summary-cards/./node_modules/iconv-lite/encodings/sbcs-codec.js","../webpack://github-profile-summary-cards/./node_modules/iconv-lite/encodings/sbcs-data-generated.js","../webpack://github-profile-summary-cards/./node_modules/iconv-lite/encodings/sbcs-data.js","../webpack://github-profile-summary-cards/./node_modules/iconv-lite/encodings/utf16.js","../webpack://github-profile-summary-cards/./node_modules/iconv-lite/encodings/utf7.js","../webpack://github-profile-summary-cards/./node_modules/iconv-lite/lib/bom-handling.js","../webpack://github-profile-summary-cards/./node_modules/iconv-lite/lib/extend-node.js","../webpack://github-profile-summary-cards/./node_modules/iconv-lite/lib/index.js","../webpack://github-profile-summary-cards/./node_modules/iconv-lite/lib/streams.js","../webpack://github-profile-summary-cards/./node_modules/is-potential-custom-element-name/index.js","../webpack://github-profile-summary-cards/./node_modules/js-abbreviation-number/dist/index.js","../webpack://github-profile-summary-cards/./node_modules/js-abbreviation-number/dist/src/abbreviateNumber.js","../webpack://github-profile-summary-cards/./node_modules/js-abbreviation-number/dist/src/const.js","../webpack://github-profile-summary-cards/./node_modules/js-abbreviation-number/dist/src/unabbreviateNumber.js","../webpack://github-profile-summary-cards/./node_modules/js-abbreviation-number/dist/src/utils.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/api.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/browser/Window.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/browser/default-stylesheet.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/browser/not-implemented.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/browser/parser/html.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/browser/parser/index.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/browser/parser/xml.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/browser/resources/async-resource-queue.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/browser/resources/no-op-resource-loader.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/browser/resources/per-document-resource-loader.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/browser/resources/request-manager.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/browser/resources/resource-loader.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/browser/resources/resource-queue.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/level2/style.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/level3/xpath.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/aborting/AbortController-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/aborting/AbortSignal-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/attributes.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/attributes/Attr-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/attributes/NamedNodeMap-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/constraint-validation/DefaultConstraintValidation-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/constraint-validation/ValidityState-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/cssom/StyleSheetList-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/custom-elements/CustomElementRegistry-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/documents.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/domparsing/DOMParser-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/domparsing/InnerHTML-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/domparsing/XMLSerializer-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/domparsing/parse5-adapter-serialization.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/domparsing/serialization.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/events/CloseEvent-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/events/CompositionEvent-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/events/CustomEvent-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/events/ErrorEvent-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/events/Event-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/events/EventModifierMixin-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/events/FocusEvent-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/events/HashChangeEvent-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/events/InputEvent-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/events/KeyboardEvent-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/events/MessageEvent-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/events/MouseEvent-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/events/PageTransitionEvent-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/events/PopStateEvent-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/events/ProgressEvent-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/events/StorageEvent-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/events/TouchEvent-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/events/UIEvent-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/events/WheelEvent-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/fetch/Headers-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/fetch/header-list.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/fetch/header-types.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/file-api/Blob-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/file-api/File-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/file-api/FileList-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/file-api/FileReader-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/AbortController.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/AbortSignal.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/AbstractRange.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/AddEventListenerOptions.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/AssignedNodesOptions.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/Attr.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/BarProp.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/BinaryType.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/Blob.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/BlobCallback.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/BlobPropertyBag.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/CDATASection.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/CharacterData.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/CloseEvent.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/CloseEventInit.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/Comment.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/CompositionEvent.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/CompositionEventInit.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/CustomElementConstructor.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/CustomElementRegistry.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/CustomEvent.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/CustomEventInit.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/DOMImplementation.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/DOMParser.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/DOMStringMap.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/DOMTokenList.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/Document.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/DocumentFragment.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/DocumentType.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/Element.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/ElementCreationOptions.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/ElementDefinitionOptions.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/EndingType.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/ErrorEvent.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/ErrorEventInit.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/Event.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/EventHandlerNonNull.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/EventInit.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/EventListener.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/EventListenerOptions.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/EventModifierInit.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/External.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/File.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/FileList.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/FilePropertyBag.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/FileReader.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/FocusEvent.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/FocusEventInit.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/FormData.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/Function.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/GetRootNodeOptions.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLAnchorElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLAreaElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLAudioElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLBRElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLBaseElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLBodyElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLButtonElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLCollection.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLDListElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLDataElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLDataListElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLDetailsElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLDialogElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLDirectoryElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLDivElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLEmbedElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLFieldSetElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLFontElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLFormElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLFrameElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLFrameSetElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLHRElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLHeadElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLHeadingElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLHtmlElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLIFrameElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLImageElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLInputElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLLIElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLLabelElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLLegendElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLLinkElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLMapElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLMarqueeElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLMediaElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLMenuElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLMetaElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLMeterElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLModElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLOListElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLObjectElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLOptGroupElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLOptionElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLOptionsCollection.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLOutputElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLParagraphElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLParamElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLPictureElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLPreElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLProgressElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLQuoteElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLScriptElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLSelectElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLSlotElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLSourceElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLSpanElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLStyleElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLTableCaptionElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLTableCellElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLTableColElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLTableElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLTableRowElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLTableSectionElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLTemplateElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLTextAreaElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLTimeElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLTitleElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLTrackElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLUListElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLUnknownElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HTMLVideoElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HashChangeEvent.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/HashChangeEventInit.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/Headers.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/History.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/InputEvent.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/InputEventInit.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/KeyboardEvent.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/KeyboardEventInit.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/Location.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/MessageEvent.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/MessageEventInit.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/MimeType.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/MimeTypeArray.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/MouseEvent.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/MouseEventInit.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/MutationCallback.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/MutationObserver.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/MutationObserverInit.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/MutationRecord.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/NamedNodeMap.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/Navigator.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/Node.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/NodeFilter.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/NodeIterator.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/NodeList.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/OnBeforeUnloadEventHandlerNonNull.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/OnErrorEventHandlerNonNull.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/PageTransitionEvent.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/PageTransitionEventInit.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/Performance.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/Plugin.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/PluginArray.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/PopStateEvent.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/PopStateEventInit.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/ProcessingInstruction.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/ProgressEvent.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/ProgressEventInit.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/Range.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/SVGAnimatedString.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/SVGElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/SVGGraphicsElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/SVGNumber.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/SVGSVGElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/SVGStringList.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/SVGTitleElement.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/Screen.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/Selection.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/SelectionMode.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/ShadowRoot.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/ShadowRootInit.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/ShadowRootMode.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/StaticRange.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/StaticRangeInit.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/Storage.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/StorageEvent.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/StorageEventInit.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/StyleSheetList.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/SupportedType.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/Text.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/TextTrackKind.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/TouchEvent.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/TouchEventInit.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/TreeWalker.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/UIEvent.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/UIEventInit.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/ValidityState.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/WebSocket.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/WheelEvent.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/WheelEventInit.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/XMLDocument.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/XMLHttpRequest.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/XMLHttpRequestEventTarget.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/XMLHttpRequestResponseType.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/XMLHttpRequestUpload.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/XMLSerializer.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/generated/utils.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/agent-factory.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/binary-data.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/create-element.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/create-event-accessor.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/custom-elements.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/dates-and-times.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/details.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/document-base-url.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/events.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/focusing.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/form-controls.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/html-constructor.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/http-request.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/internal-constants.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/iterable-weak-set.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/json.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/mutation-observers.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/namespaces.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/node.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/number-and-date-inputs.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/ordered-set.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/runtime-script-errors.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/selectors.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/shadow-dom.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/strings.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/style-rules.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/stylesheets.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/svg/basic-types.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/svg/render.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/text.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/traversal.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/helpers/validate-names.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/hr-time/Performance-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/interfaces.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/mutation-observer/MutationObserver-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/mutation-observer/MutationRecord-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/named-properties-window.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/navigator/MimeType-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/navigator/MimeTypeArray-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/navigator/Navigator-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/navigator/NavigatorConcurrentHardware-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/navigator/NavigatorCookies-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/navigator/NavigatorID-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/navigator/NavigatorLanguage-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/navigator/NavigatorOnLine-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/navigator/NavigatorPlugins-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/navigator/Plugin-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/navigator/PluginArray-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/node-document-position.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/node-type.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/node.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/CDATASection-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/CharacterData-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/ChildNode-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/Comment-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/DOMImplementation-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/DOMStringMap-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/DOMTokenList-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/Document-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/DocumentFragment-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/DocumentOrShadowRoot-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/DocumentType-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/Element-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/ElementCSSInlineStyle-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/GlobalEventHandlers-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLAnchorElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLAreaElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLAudioElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLBRElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLBaseElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLBodyElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLButtonElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLCollection-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLDListElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLDataElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLDataListElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLDetailsElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLDialogElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLDirectoryElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLDivElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLEmbedElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLFieldSetElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLFontElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLFormElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLFrameElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLFrameSetElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLHRElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLHeadElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLHeadingElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLHtmlElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLHyperlinkElementUtils-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLIFrameElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLImageElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLInputElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLLIElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLLabelElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLLegendElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLLinkElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLMapElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLMarqueeElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLMediaElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLMenuElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLMetaElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLMeterElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLModElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLOListElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLObjectElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLOptGroupElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLOptionElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLOptionsCollection-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLOrSVGElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLOutputElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLParagraphElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLParamElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLPictureElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLPreElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLProgressElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLQuoteElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLScriptElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLSelectElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLSlotElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLSourceElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLSpanElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLStyleElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableCaptionElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableCellElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableColElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableRowElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableSectionElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLTemplateElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLTextAreaElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLTimeElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLTitleElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLTrackElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLUListElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLUnknownElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/HTMLVideoElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/Node-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/NodeList-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/NonDocumentTypeChildNode-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/NonElementParentNode-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/ParentNode-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/ProcessingInstruction-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/SVGElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/SVGGraphicsElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/SVGSVGElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/SVGTests-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/SVGTitleElement-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/ShadowRoot-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/Slotable-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/Text-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/WindowEventHandlers-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/nodes/XMLDocument-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/post-message.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/range/AbstractRange-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/range/Range-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/range/StaticRange-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/range/boundary-point.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/selection/Selection-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/svg/SVGAnimatedString-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/svg/SVGListBase.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/svg/SVGNumber-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/svg/SVGStringList-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/traversal/NodeIterator-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/traversal/TreeWalker-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/traversal/helpers.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/websockets/WebSocket-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/webstorage/Storage-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/window/BarProp-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/window/External-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/window/History-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/window/Location-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/window/Screen-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/window/SessionHistory.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/window/navigation.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/xhr/FormData-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequestEventTarget-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequestUpload-impl.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/living/xhr/xhr-utils.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/named-properties-tracker.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/utils.js","../webpack://github-profile-summary-cards/./node_modules/jsdom/lib/jsdom/virtual-console.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_DataView.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_Hash.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_ListCache.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_Map.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_MapCache.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_Promise.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_Set.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_SetCache.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_Stack.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_Symbol.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_Uint8Array.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_WeakMap.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_apply.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_arrayFilter.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_arrayLikeKeys.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_arrayMap.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_arrayPush.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_arraySome.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_assocIndexOf.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_baseEach.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_baseFlatten.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_baseFor.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_baseForOwn.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_baseGet.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_baseGetAllKeys.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_baseGetTag.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_baseHasIn.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_baseIsArguments.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_baseIsEqual.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_baseIsEqualDeep.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_baseIsMatch.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_baseIsNative.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_baseIsTypedArray.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_baseIteratee.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_baseKeys.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_baseMap.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_baseMatches.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_baseMatchesProperty.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_baseOrderBy.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_baseProperty.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_basePropertyDeep.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_baseRest.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_baseSetToString.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_baseSortBy.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_baseTimes.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_baseToString.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_baseUnary.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_cacheHas.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_castPath.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_compareAscending.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_compareMultiple.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_coreJsData.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_createBaseEach.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_createBaseFor.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_defineProperty.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_equalArrays.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_equalByTag.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_equalObjects.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_freeGlobal.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_getAllKeys.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_getMapData.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_getMatchData.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_getNative.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_getRawTag.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_getSymbols.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_getTag.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_getValue.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_hasPath.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_hashClear.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_hashDelete.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_hashGet.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_hashHas.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_hashSet.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_isFlattenable.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_isIndex.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_isIterateeCall.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_isKey.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_isKeyable.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_isMasked.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_isPrototype.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_isStrictComparable.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_listCacheClear.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_listCacheDelete.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_listCacheGet.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_listCacheHas.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_listCacheSet.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_mapCacheClear.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_mapCacheDelete.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_mapCacheGet.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_mapCacheHas.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_mapCacheSet.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_mapToArray.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_matchesStrictComparable.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_memoizeCapped.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_nativeCreate.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_nativeKeys.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_nodeUtil.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_objectToString.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_overArg.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_overRest.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_root.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_setCacheAdd.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_setCacheHas.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_setToArray.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_setToString.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_shortOut.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_stackClear.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_stackDelete.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_stackGet.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_stackHas.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_stackSet.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_stringToPath.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_toKey.js","../webpack://github-profile-summary-cards/./node_modules/lodash/_toSource.js","../webpack://github-profile-summary-cards/./node_modules/lodash/constant.js","../webpack://github-profile-summary-cards/./node_modules/lodash/eq.js","../webpack://github-profile-summary-cards/./node_modules/lodash/get.js","../webpack://github-profile-summary-cards/./node_modules/lodash/hasIn.js","../webpack://github-profile-summary-cards/./node_modules/lodash/identity.js","../webpack://github-profile-summary-cards/./node_modules/lodash/isArguments.js","../webpack://github-profile-summary-cards/./node_modules/lodash/isArray.js","../webpack://github-profile-summary-cards/./node_modules/lodash/isArrayLike.js","../webpack://github-profile-summary-cards/./node_modules/lodash/isBuffer.js","../webpack://github-profile-summary-cards/./node_modules/lodash/isFunction.js","../webpack://github-profile-summary-cards/./node_modules/lodash/isLength.js","../webpack://github-profile-summary-cards/./node_modules/lodash/isObject.js","../webpack://github-profile-summary-cards/./node_modules/lodash/isObjectLike.js","../webpack://github-profile-summary-cards/./node_modules/lodash/isSymbol.js","../webpack://github-profile-summary-cards/./node_modules/lodash/isTypedArray.js","../webpack://github-profile-summary-cards/./node_modules/lodash/keys.js","../webpack://github-profile-summary-cards/./node_modules/lodash/memoize.js","../webpack://github-profile-summary-cards/./node_modules/lodash/property.js","../webpack://github-profile-summary-cards/./node_modules/lodash/sortBy.js","../webpack://github-profile-summary-cards/./node_modules/lodash/stubArray.js","../webpack://github-profile-summary-cards/./node_modules/lodash/stubFalse.js","../webpack://github-profile-summary-cards/./node_modules/lodash/toString.js","../webpack://github-profile-summary-cards/./node_modules/mime-db/index.js","../webpack://github-profile-summary-cards/./node_modules/mime-types/index.js","../webpack://github-profile-summary-cards/./node_modules/moment/moment.js","../webpack://github-profile-summary-cards/./node_modules/nwsapi/src/nwsapi.js","../webpack://github-profile-summary-cards/./node_modules/parse5/lib/common/doctype.js","../webpack://github-profile-summary-cards/./node_modules/parse5/lib/common/error-codes.js","../webpack://github-profile-summary-cards/./node_modules/parse5/lib/common/foreign-content.js","../webpack://github-profile-summary-cards/./node_modules/parse5/lib/common/html.js","../webpack://github-profile-summary-cards/./node_modules/parse5/lib/common/unicode.js","../webpack://github-profile-summary-cards/./node_modules/parse5/lib/extensions/error-reporting/mixin-base.js","../webpack://github-profile-summary-cards/./node_modules/parse5/lib/extensions/error-reporting/parser-mixin.js","../webpack://github-profile-summary-cards/./node_modules/parse5/lib/extensions/error-reporting/preprocessor-mixin.js","../webpack://github-profile-summary-cards/./node_modules/parse5/lib/extensions/error-reporting/tokenizer-mixin.js","../webpack://github-profile-summary-cards/./node_modules/parse5/lib/extensions/location-info/open-element-stack-mixin.js","../webpack://github-profile-summary-cards/./node_modules/parse5/lib/extensions/location-info/parser-mixin.js","../webpack://github-profile-summary-cards/./node_modules/parse5/lib/extensions/location-info/tokenizer-mixin.js","../webpack://github-profile-summary-cards/./node_modules/parse5/lib/extensions/position-tracking/preprocessor-mixin.js","../webpack://github-profile-summary-cards/./node_modules/parse5/lib/index.js","../webpack://github-profile-summary-cards/./node_modules/parse5/lib/parser/formatting-element-list.js","../webpack://github-profile-summary-cards/./node_modules/parse5/lib/parser/index.js","../webpack://github-profile-summary-cards/./node_modules/parse5/lib/parser/open-element-stack.js","../webpack://github-profile-summary-cards/./node_modules/parse5/lib/serializer/index.js","../webpack://github-profile-summary-cards/./node_modules/parse5/lib/tokenizer/index.js","../webpack://github-profile-summary-cards/./node_modules/parse5/lib/tokenizer/named-entity-data.js","../webpack://github-profile-summary-cards/./node_modules/parse5/lib/tokenizer/preprocessor.js","../webpack://github-profile-summary-cards/./node_modules/parse5/lib/tree-adapters/default.js","../webpack://github-profile-summary-cards/./node_modules/parse5/lib/utils/merge-options.js","../webpack://github-profile-summary-cards/./node_modules/parse5/lib/utils/mixin.js","../webpack://github-profile-summary-cards/./node_modules/psl/index.js","../webpack://github-profile-summary-cards/./node_modules/retry-axios/dist/index.js","../webpack://github-profile-summary-cards/./node_modules/safer-buffer/safer.js","../webpack://github-profile-summary-cards/./node_modules/saxes/saxes.js","../webpack://github-profile-summary-cards/./node_modules/supports-color/index.js","../webpack://github-profile-summary-cards/./node_modules/symbol-tree/lib/SymbolTree.js","../webpack://github-profile-summary-cards/./node_modules/symbol-tree/lib/SymbolTreeNode.js","../webpack://github-profile-summary-cards/./node_modules/symbol-tree/lib/TreeIterator.js","../webpack://github-profile-summary-cards/./node_modules/symbol-tree/lib/TreePosition.js","../webpack://github-profile-summary-cards/./node_modules/tough-cookie/lib/cookie.js","../webpack://github-profile-summary-cards/./node_modules/tough-cookie/lib/memstore.js","../webpack://github-profile-summary-cards/./node_modules/tough-cookie/lib/pathMatch.js","../webpack://github-profile-summary-cards/./node_modules/tough-cookie/lib/permuteDomain.js","../webpack://github-profile-summary-cards/./node_modules/tough-cookie/lib/pubsuffix-psl.js","../webpack://github-profile-summary-cards/./node_modules/tough-cookie/lib/store.js","../webpack://github-profile-summary-cards/./node_modules/tough-cookie/lib/version.js","../webpack://github-profile-summary-cards/./node_modules/tr46/index.js","../webpack://github-profile-summary-cards/./node_modules/tr46/lib/regexes.js","../webpack://github-profile-summary-cards/./node_modules/tr46/lib/statusMapping.js","../webpack://github-profile-summary-cards/./node_modules/tunnel/index.js","../webpack://github-profile-summary-cards/./node_modules/tunnel/lib/tunnel.js","../webpack://github-profile-summary-cards/./node_modules/universalify/index.js","../webpack://github-profile-summary-cards/./node_modules/uuid/dist/esm-node/rng.js","../webpack://github-profile-summary-cards/./node_modules/uuid/dist/esm-node/regex.js","../webpack://github-profile-summary-cards/./node_modules/uuid/dist/esm-node/validate.js","../webpack://github-profile-summary-cards/./node_modules/uuid/dist/esm-node/stringify.js","../webpack://github-profile-summary-cards/./node_modules/uuid/dist/esm-node/v1.js","../webpack://github-profile-summary-cards/./node_modules/uuid/dist/esm-node/parse.js","../webpack://github-profile-summary-cards/./node_modules/uuid/dist/esm-node/v35.js","../webpack://github-profile-summary-cards/./node_modules/uuid/dist/esm-node/md5.js","../webpack://github-profile-summary-cards/./node_modules/uuid/dist/esm-node/v3.js","../webpack://github-profile-summary-cards/./node_modules/uuid/dist/esm-node/v4.js","../webpack://github-profile-summary-cards/./node_modules/uuid/dist/esm-node/sha1.js","../webpack://github-profile-summary-cards/./node_modules/uuid/dist/esm-node/v5.js","../webpack://github-profile-summary-cards/./node_modules/uuid/dist/esm-node/nil.js","../webpack://github-profile-summary-cards/./node_modules/uuid/dist/esm-node/version.js","../webpack://github-profile-summary-cards/./node_modules/uuid/dist/esm-node/index.js","../webpack://github-profile-summary-cards/./node_modules/w3c-hr-time/index.js","../webpack://github-profile-summary-cards/./node_modules/w3c-hr-time/lib/calculate-clock-offset.js","../webpack://github-profile-summary-cards/./node_modules/w3c-hr-time/lib/clock-is-accurate.js","../webpack://github-profile-summary-cards/./node_modules/w3c-hr-time/lib/global-monotonic-clock.js","../webpack://github-profile-summary-cards/./node_modules/w3c-hr-time/lib/performance.js","../webpack://github-profile-summary-cards/./node_modules/w3c-hr-time/lib/utils.js","../webpack://github-profile-summary-cards/./node_modules/w3c-xmlserializer/lib/attributes.js","../webpack://github-profile-summary-cards/./node_modules/w3c-xmlserializer/lib/constants.js","../webpack://github-profile-summary-cards/./node_modules/w3c-xmlserializer/lib/serialize.js","../webpack://github-profile-summary-cards/./node_modules/webidl-conversions/lib/index.js","../webpack://github-profile-summary-cards/./node_modules/whatwg-encoding/lib/whatwg-encoding.js","../webpack://github-profile-summary-cards/./node_modules/whatwg-mimetype/lib/mime-type.js","../webpack://github-profile-summary-cards/./node_modules/whatwg-mimetype/lib/parser.js","../webpack://github-profile-summary-cards/./node_modules/whatwg-mimetype/lib/serializer.js","../webpack://github-profile-summary-cards/./node_modules/whatwg-mimetype/lib/utils.js","../webpack://github-profile-summary-cards/./node_modules/whatwg-url/dist/Function.js","../webpack://github-profile-summary-cards/./node_modules/whatwg-url/dist/URL-impl.js","../webpack://github-profile-summary-cards/./node_modules/whatwg-url/dist/URL.js","../webpack://github-profile-summary-cards/./node_modules/whatwg-url/dist/URLSearchParams-impl.js","../webpack://github-profile-summary-cards/./node_modules/whatwg-url/dist/URLSearchParams.js","../webpack://github-profile-summary-cards/./node_modules/whatwg-url/dist/encoding.js","../webpack://github-profile-summary-cards/./node_modules/whatwg-url/dist/infra.js","../webpack://github-profile-summary-cards/./node_modules/whatwg-url/dist/percent-encoding.js","../webpack://github-profile-summary-cards/./node_modules/whatwg-url/dist/url-state-machine.js","../webpack://github-profile-summary-cards/./node_modules/whatwg-url/dist/urlencoded.js","../webpack://github-profile-summary-cards/./node_modules/whatwg-url/dist/utils.js","../webpack://github-profile-summary-cards/./node_modules/whatwg-url/index.js","../webpack://github-profile-summary-cards/./node_modules/whatwg-url/webidl2js-wrapper.js","../webpack://github-profile-summary-cards/./node_modules/ws/index.js","../webpack://github-profile-summary-cards/./node_modules/ws/lib/buffer-util.js","../webpack://github-profile-summary-cards/./node_modules/ws/lib/constants.js","../webpack://github-profile-summary-cards/./node_modules/ws/lib/event-target.js","../webpack://github-profile-summary-cards/./node_modules/ws/lib/extension.js","../webpack://github-profile-summary-cards/./node_modules/ws/lib/limiter.js","../webpack://github-profile-summary-cards/./node_modules/ws/lib/permessage-deflate.js","../webpack://github-profile-summary-cards/./node_modules/ws/lib/receiver.js","../webpack://github-profile-summary-cards/./node_modules/ws/lib/sender.js","../webpack://github-profile-summary-cards/./node_modules/ws/lib/stream.js","../webpack://github-profile-summary-cards/./node_modules/ws/lib/validation.js","../webpack://github-profile-summary-cards/./node_modules/ws/lib/websocket-server.js","../webpack://github-profile-summary-cards/./node_modules/ws/lib/websocket.js","../webpack://github-profile-summary-cards/./node_modules/xml-name-validator/lib/generated-parser.js","../webpack://github-profile-summary-cards/./node_modules/xml-name-validator/lib/xml-name-validator.js","../webpack://github-profile-summary-cards/./node_modules/xmlchars/xml/1.0/ed5.js","../webpack://github-profile-summary-cards/./node_modules/xmlchars/xml/1.1/ed2.js","../webpack://github-profile-summary-cards/./node_modules/xmlchars/xmlns/1.0/ed3.js","../webpack://github-profile-summary-cards/./node_modules/@vercel/ncc/dist/ncc/@@notfound.js","../webpack://github-profile-summary-cards/external \"assert\"","../webpack://github-profile-summary-cards/external \"buffer\"","../webpack://github-profile-summary-cards/external \"child_process\"","../webpack://github-profile-summary-cards/external \"crypto\"","../webpack://github-profile-summary-cards/external \"events\"","../webpack://github-profile-summary-cards/external \"fs\"","../webpack://github-profile-summary-cards/external \"http\"","../webpack://github-profile-summary-cards/external \"https\"","../webpack://github-profile-summary-cards/external \"net\"","../webpack://github-profile-summary-cards/external \"os\"","../webpack://github-profile-summary-cards/external \"path\"","../webpack://github-profile-summary-cards/external \"punycode\"","../webpack://github-profile-summary-cards/external \"stream\"","../webpack://github-profile-summary-cards/external \"string_decoder\"","../webpack://github-profile-summary-cards/external \"tls\"","../webpack://github-profile-summary-cards/external \"tty\"","../webpack://github-profile-summary-cards/external \"url\"","../webpack://github-profile-summary-cards/external \"util\"","../webpack://github-profile-summary-cards/external \"vm\"","../webpack://github-profile-summary-cards/external \"zlib\"","../webpack://github-profile-summary-cards/webpack/bootstrap","../webpack://github-profile-summary-cards/webpack/runtime/compat get default export","../webpack://github-profile-summary-cards/webpack/runtime/define property getters","../webpack://github-profile-summary-cards/webpack/runtime/hasOwnProperty shorthand","../webpack://github-profile-summary-cards/webpack/runtime/make namespace object","../webpack://github-profile-summary-cards/webpack/runtime/node module decorator","../webpack://github-profile-summary-cards/webpack/runtime/compat","../webpack://github-profile-summary-cards/webpack/startup"],"sourcesContent":["\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst core = __importStar(require(\"@actions/core\"));\nconst profile_details_card_1 = require(\"./cards/profile-details-card\");\nconst repos_per_language_card_1 = require(\"./cards/repos-per-language-card\");\nconst most_commit_language_card_1 = require(\"./cards/most-commit-language-card\");\nconst stats_card_1 = require(\"./cards/stats-card\");\nconst productive_time_card_1 = require(\"./cards/productive-time-card\");\nconst child_process_1 = require(\"child_process\");\nconst translator_1 = require(\"./utils/translator\");\nconst file_writer_1 = require(\"./utils/file-writer\");\nconst execCmd = (cmd, args = []) => new Promise((resolve, reject) => {\n const app = (0, child_process_1.spawn)(cmd, args, { stdio: 'pipe' });\n let stdout = '';\n app.stdout.on('data', data => {\n stdout = data;\n });\n app.on('close', code => {\n if (code !== 0 && !stdout.includes('nothing to commit')) {\n const err = new Error(`${cmd} ${args} \\n ${stdout} \\n Invalid status code: ${code}`);\n return reject(err);\n }\n return resolve(code);\n });\n app.on('error', reject);\n});\nconst commitFile = () => __awaiter(void 0, void 0, void 0, function* () {\n yield execCmd('git', ['config', '--global', 'user.email', 'profile-summary-cards-bot@example.com']);\n yield execCmd('git', ['config', '--global', 'user.name', 'profile-summary-cards[bot]']);\n yield execCmd('git', ['add', file_writer_1.OUTPUT_PATH]);\n yield execCmd('git', ['commit', '-m', 'Generate profile summary cards']);\n yield execCmd('git', ['push']);\n});\n// main\nconst action = () => __awaiter(void 0, void 0, void 0, function* () {\n core.info(`Start...`);\n const username = core.getInput('USERNAME', { required: true });\n core.info(`Username: ${username}`);\n const utcOffset = Number(core.getInput('UTC_OFFSET', { required: false }));\n core.info(`UTC offset: ${utcOffset}`);\n const exclude = core.getInput('EXCLUE', { required: false }).split(',');\n core.info(`Excluded languages: ${utcOffset}`);\n try {\n // Remove old output\n core.info(`Remove old cards...`);\n yield execCmd('sudo', ['rm', '-rf', file_writer_1.OUTPUT_PATH]);\n // ProfileDetailsCard\n try {\n core.info(`Creating ProfileDetailsCard...`);\n yield (0, profile_details_card_1.createProfileDetailsCard)(username);\n }\n catch (error) {\n core.error(`Error when creating ProfileDetailsCard \\n${error.stack}`);\n }\n // ReposPerLanguageCard\n try {\n core.info(`Creating ReposPerLanguageCard...`);\n yield (0, repos_per_language_card_1.createReposPerLanguageCard)(username, exclude);\n }\n catch (error) {\n core.error(`Error when creating ReposPerLanguageCard \\n${error.stack}`);\n }\n // CommitsPerLanguageCard\n try {\n core.info(`Creating CommitsPerLanguageCard...`);\n yield (0, most_commit_language_card_1.createCommitsPerLanguageCard)(username, exclude);\n }\n catch (error) {\n core.error(`Error when creating CommitsPerLanguageCard \\n${error.stack}`);\n }\n // StatsCard\n try {\n core.info(`Creating StatsCard...`);\n yield (0, stats_card_1.createStatsCard)(username);\n }\n catch (error) {\n core.error(`Error when creating StatsCard \\n${error.stack}`);\n }\n // ProductiveTimeCard\n try {\n core.info(`Creating ProductiveTimeCard...`);\n yield (0, productive_time_card_1.createProductiveTimeCard)(username, utcOffset);\n }\n catch (error) {\n core.error(`Error when creating ProductiveTimeCard \\n${error.stack}`);\n }\n // generate markdown\n try {\n core.info(`Creating preview markdown...`);\n (0, file_writer_1.generatePreviewMarkdown)(true);\n }\n catch (error) {\n core.error(`Error when creating preview markdown \\n${error.stack}`);\n }\n // Commit changes\n core.info(`Commit file...`);\n let retry = 0;\n const maxRetry = 3;\n while (retry < maxRetry) {\n retry += 1;\n try {\n yield commitFile();\n }\n catch (error) {\n if (retry == maxRetry) {\n throw error;\n }\n core.warning(`Commit failed. Retry...`);\n }\n }\n }\n catch (error) {\n core.error(error);\n core.setFailed(error.message);\n }\n});\nconst main = (username, utcOffset, exclude) => __awaiter(void 0, void 0, void 0, function* () {\n try {\n yield (0, profile_details_card_1.createProfileDetailsCard)(username);\n yield (0, repos_per_language_card_1.createReposPerLanguageCard)(username, exclude);\n yield (0, most_commit_language_card_1.createCommitsPerLanguageCard)(username, exclude);\n yield (0, stats_card_1.createStatsCard)(username);\n yield (0, productive_time_card_1.createProductiveTimeCard)(username, utcOffset);\n (0, file_writer_1.generatePreviewMarkdown)(false);\n }\n catch (error) {\n console.error(error);\n }\n});\n// program entry point\n// check if run in github action\nif (process.argv.length == 2) {\n action();\n}\nelse {\n const username = process.argv[2];\n const utcOffset = Number(process.argv[3]);\n const exclude = [];\n if (process.argv[4]) {\n process.argv[4].split(',').forEach(function (val) {\n exclude.push((0, translator_1.translateLanguage)(val));\n });\n }\n main(username, utcOffset, exclude);\n}\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getCommitsLanguageSVGWithThemeName = exports.createCommitsPerLanguageCard = void 0;\nconst theme_1 = require(\"../const/theme\");\nconst commits_per_language_1 = require(\"../github-api/commits-per-language\");\nconst donut_chart_card_1 = require(\"../templates/donut-chart-card\");\nconst file_writer_1 = require(\"../utils/file-writer\");\nconst createCommitsPerLanguageCard = function (username, exclude) {\n return __awaiter(this, void 0, void 0, function* () {\n const statsData = yield getCommitsLanguageData(username, exclude);\n for (const themeName of theme_1.ThemeMap.keys()) {\n const svgString = getCommitsLanguageSVG(statsData, themeName);\n // output to folder, use 2- prefix for sort in preview\n (0, file_writer_1.writeSVG)(themeName, '2-most-commit-language', svgString);\n }\n });\n};\nexports.createCommitsPerLanguageCard = createCommitsPerLanguageCard;\nconst getCommitsLanguageSVGWithThemeName = function (username, themeName, exclude) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!theme_1.ThemeMap.has(themeName))\n throw new Error('Theme does not exist');\n const langData = yield getCommitsLanguageData(username, exclude);\n return getCommitsLanguageSVG(langData, themeName);\n });\n};\nexports.getCommitsLanguageSVGWithThemeName = getCommitsLanguageSVGWithThemeName;\nconst getCommitsLanguageSVG = function (langData, themeName) {\n if (langData.length == 0) {\n langData.push({\n name: 'There are no',\n value: 1,\n color: '#586e75'\n });\n langData.push({\n name: 'any commits',\n value: 1,\n color: '#586e75'\n });\n langData.push({\n name: 'in the last year',\n value: 1,\n color: '#586e75'\n });\n }\n const svgString = (0, donut_chart_card_1.createDonutChartCard)('Top Languages by Commit', langData, theme_1.ThemeMap.get(themeName));\n return svgString;\n};\nconst getCommitsLanguageData = function (username, exclude) {\n return __awaiter(this, void 0, void 0, function* () {\n const commitLanguages = yield (0, commits_per_language_1.getCommitLanguage)(username, exclude);\n let langData = [];\n // make a pie data\n for (const [key, value] of commitLanguages.getLanguageMap()) {\n langData.push({\n name: key,\n value: value.count,\n color: value.color\n });\n }\n langData.sort(function (a, b) {\n return b.value - a.value;\n });\n langData = langData.slice(0, 5); // get top 5\n return langData;\n });\n};\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getProductiveTimeSVGWithThemeName = exports.createProductiveTimeCard = void 0;\nconst theme_1 = require(\"../const/theme\");\nconst productive_time_1 = require(\"../github-api/productive-time\");\nconst productive_time_card_1 = require(\"../templates/productive-time-card\");\nconst file_writer_1 = require(\"../utils/file-writer\");\nconst createProductiveTimeCard = function (username, utcOffset) {\n return __awaiter(this, void 0, void 0, function* () {\n const productiveTimeData = yield getProductiveTimeData(username, utcOffset);\n for (const themeName of theme_1.ThemeMap.keys()) {\n const svgString = getProductiveTimeSVG(productiveTimeData, themeName, utcOffset);\n // output to folder, use 4- prefix for sort in preview\n (0, file_writer_1.writeSVG)(themeName, '4-productive-time', svgString);\n }\n });\n};\nexports.createProductiveTimeCard = createProductiveTimeCard;\nconst getProductiveTimeSVGWithThemeName = function (username, themeName, utcOffset) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!theme_1.ThemeMap.has(themeName))\n throw new Error('Theme does not exist');\n const productiveTimeData = yield getProductiveTimeData(username, utcOffset);\n return getProductiveTimeSVG(productiveTimeData, themeName, utcOffset);\n });\n};\nexports.getProductiveTimeSVGWithThemeName = getProductiveTimeSVGWithThemeName;\nconst getProductiveTimeSVG = function (productiveTimeData, themeName, utcOffset) {\n const svgString = (0, productive_time_card_1.createProductiveCard)(productiveTimeData, theme_1.ThemeMap.get(themeName), utcOffset);\n return svgString;\n};\nconst adjustOffset = function (offset, RoundRobin) {\n if (offset % 1 == 0) {\n return offset;\n // offset % 1 should be 0.3 or 0.7 but its js and it gives 0.29999 or -0.299999 thats why this frankenstein\n }\n else if ((offset % 1 > 0.29 && offset % 1 < 0.31) || (offset % 1 < -0.29 && offset % 1 > -0.31)) {\n // toggle up and down between hour\n RoundRobin.offset = (RoundRobin.offset + 1) % 2;\n return RoundRobin.offset === 0 ? Math.floor(offset) : Math.ceil(offset);\n }\n else if ((offset % 1 > 0.44 && offset % 1 < 0.46) || (offset % 1 < -0.44 && offset % 1 > -0.45)) {\n // distrubute 1 : 3 ratio for 0.45 utc time\n RoundRobin.offset = (RoundRobin.offset + 1) % 4;\n return RoundRobin.offset === 0 ? Math.floor(offset) : Math.ceil(offset);\n }\n else {\n // flood down , if utc is given right it will never be executed\n return Math.floor(offset);\n }\n};\nconst getProductiveTimeData = function (username, utcOffset) {\n return __awaiter(this, void 0, void 0, function* () {\n const until = new Date();\n const since = new Date();\n since.setFullYear(since.getFullYear() - 1);\n const productiveTime = yield (0, productive_time_1.getProductiveTime)(username, until.toISOString(), since.toISOString());\n // process productiveTime\n const chartData = new Array(24);\n chartData.fill(0);\n const roundRobin = {\n offset: 0\n };\n for (const time of productiveTime.productiveDate) {\n const hour = new Date(time).getUTCHours(); // We use UTC+0 here\n const afterOffset = adjustOffset(Number(hour) + Number(utcOffset), roundRobin); // Add offset to hour\n // convert afterOffset to 0-23\n if (afterOffset < 0) {\n // if afterOffset is negative, we need to add 24 to get the correct hour\n chartData[24 + afterOffset] += 1;\n }\n else if (afterOffset > 23) {\n // if afterOffset is greater than 23, we need to subtract 24 to get the correct hour\n chartData[afterOffset - 24] += 1;\n }\n else {\n // if afterOffset is between 0 and 23, we can use it as the hour\n chartData[afterOffset] += 1;\n }\n }\n return chartData;\n });\n};\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getProfileDetailsSVGWithThemeName = exports.createProfileDetailsCard = void 0;\nconst theme_1 = require(\"../const/theme\");\nconst icon_1 = require(\"../const/icon\");\nconst js_abbreviation_number_1 = require(\"js-abbreviation-number\");\nconst profile_details_1 = require(\"../github-api/profile-details\");\nconst contributions_by_year_1 = require(\"../github-api/contributions-by-year\");\nconst profile_details_card_1 = require(\"../templates/profile-details-card\");\nconst file_writer_1 = require(\"../utils/file-writer\");\nconst createProfileDetailsCard = function (username) {\n return __awaiter(this, void 0, void 0, function* () {\n const profileDetailsData = yield getProfileDetailsData(username);\n for (const themeName of theme_1.ThemeMap.keys()) {\n const title = profileDetailsData[0].name == null ? `${username}` : `${username} (${profileDetailsData[0].name})`;\n const svgString = getProfileDetailsSVG(title, profileDetailsData[0].contributions, profileDetailsData[1], themeName);\n // output to folder, use 0- prefix for sort in preview\n (0, file_writer_1.writeSVG)(themeName, '0-profile-details', svgString);\n }\n });\n};\nexports.createProfileDetailsCard = createProfileDetailsCard;\nconst getProfileDetailsSVGWithThemeName = function (username, themeName) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!theme_1.ThemeMap.has(themeName))\n throw new Error('Theme does not exist');\n const profileDetailsData = yield getProfileDetailsData(username);\n const title = profileDetailsData[0].name == null ? `${username}` : `${username} (${profileDetailsData[0].name})`;\n return getProfileDetailsSVG(title, profileDetailsData[0].contributions, profileDetailsData[1], themeName);\n });\n};\nexports.getProfileDetailsSVGWithThemeName = getProfileDetailsSVGWithThemeName;\nconst getProfileDetailsSVG = function (title, contributionsData, userDetails, themeName) {\n const svgString = (0, profile_details_card_1.createDetailCard)(`${title}`, userDetails, contributionsData, theme_1.ThemeMap.get(themeName));\n return svgString;\n};\nconst getProfileDateJoined = function (profileDetails) {\n const s = (unit) => {\n return unit === 1 ? '' : 's';\n };\n const now = Date.now();\n const created = new Date(profileDetails.createdAt);\n const diff = new Date(now - created.getTime());\n const years = diff.getUTCFullYear() - new Date(0).getUTCFullYear();\n const months = diff.getUTCMonth() - new Date(0).getUTCMonth();\n const days = diff.getUTCDate() - new Date(0).getUTCDate();\n return years\n ? `${years} year${s(years)} ago`\n : months\n ? `${months} month${s(months)} ago`\n : `${days} day${s(days)} ago`;\n};\nconst getProfileDetailsData = function (username) {\n return __awaiter(this, void 0, void 0, function* () {\n const profileDetails = yield (0, profile_details_1.getProfileDetails)(username);\n let totalContributions = 0;\n if (process.env.VERCEL) {\n // If running on vercel, we only calculate for last 1 year to avoid hobby timeout limit\n profileDetails.contributionYears = profileDetails.contributionYears.slice(0, 1);\n for (const year of profileDetails.contributionYears) {\n totalContributions += (yield (0, contributions_by_year_1.getContributionByYear)(username, year)).totalContributions;\n }\n }\n else {\n for (const year of profileDetails.contributionYears) {\n totalContributions += (yield (0, contributions_by_year_1.getContributionByYear)(username, year)).totalContributions;\n }\n }\n const userDetails = [\n // If running on vercel, we only display for last 1 year contributions count\n !process.env.VERCEL\n ? {\n index: 0,\n icon: icon_1.Icon.GITHUB,\n name: 'Contributions',\n value: `${(0, js_abbreviation_number_1.abbreviateNumber)(totalContributions, 2)} Contributions on GitHub`\n }\n : {\n index: 0,\n icon: icon_1.Icon.GITHUB,\n name: 'Contributions',\n value: `${(0, js_abbreviation_number_1.abbreviateNumber)(totalContributions, 2)} Contributions in ${profileDetails.contributionYears[0]}`\n },\n {\n index: 1,\n icon: icon_1.Icon.REPOS,\n name: 'Public Repos',\n value: `${(0, js_abbreviation_number_1.abbreviateNumber)(profileDetails.totalPublicRepos, 2)} Public Repos`\n },\n {\n index: 2,\n icon: icon_1.Icon.CLOCK,\n name: 'JoinedAt',\n value: `Joined GitHub ${getProfileDateJoined(profileDetails)}`\n }\n ];\n // hard code here, cuz I'm lazy\n if (profileDetails.email) {\n userDetails.push({\n index: 3,\n icon: icon_1.Icon.EMAIL,\n name: 'Email',\n value: profileDetails['email']\n });\n }\n else if (profileDetails.company) {\n userDetails.push({\n index: 3,\n icon: icon_1.Icon.COMPANY,\n name: 'Company',\n value: profileDetails['company']\n });\n }\n else if (profileDetails.location) {\n userDetails.push({\n index: 3,\n icon: icon_1.Icon.LOCATION,\n name: 'Location',\n value: profileDetails['location']\n });\n }\n return [profileDetails, userDetails];\n });\n};\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getReposPerLanguageSVGWithThemeName = exports.createReposPerLanguageCard = void 0;\nconst theme_1 = require(\"../const/theme\");\nconst repos_per_language_1 = require(\"../github-api/repos-per-language\");\nconst donut_chart_card_1 = require(\"../templates/donut-chart-card\");\nconst file_writer_1 = require(\"../utils/file-writer\");\nconst createReposPerLanguageCard = function (username, exclude) {\n return __awaiter(this, void 0, void 0, function* () {\n const langData = yield getRepoLanguageData(username, exclude);\n for (const themeName of theme_1.ThemeMap.keys()) {\n const svgString = getReposPerLanguageSVG(langData, themeName);\n // output to folder, use 1- prefix for sort in preview\n (0, file_writer_1.writeSVG)(themeName, '1-repos-per-language', svgString);\n }\n });\n};\nexports.createReposPerLanguageCard = createReposPerLanguageCard;\nconst getReposPerLanguageSVGWithThemeName = function (username, themeName, exclude) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!theme_1.ThemeMap.has(themeName))\n throw new Error('Theme does not exist');\n const langData = yield getRepoLanguageData(username, exclude);\n return getReposPerLanguageSVG(langData, themeName);\n });\n};\nexports.getReposPerLanguageSVGWithThemeName = getReposPerLanguageSVGWithThemeName;\nconst getReposPerLanguageSVG = function (langData, themeName) {\n const svgString = (0, donut_chart_card_1.createDonutChartCard)('Top Languages by Repo', langData, theme_1.ThemeMap.get(themeName));\n return svgString;\n};\nconst getRepoLanguageData = function (username, exclude) {\n return __awaiter(this, void 0, void 0, function* () {\n const repoLanguages = yield (0, repos_per_language_1.getRepoLanguages)(username, exclude);\n let langData = [];\n // make a pie data\n for (const [key, value] of repoLanguages.getLanguageMap()) {\n langData.push({\n name: key,\n value: value.count,\n color: value.color\n });\n }\n langData.sort(function (a, b) {\n return b.value - a.value;\n });\n langData = langData.slice(0, 5); // get top 5\n return langData;\n });\n};\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getStatsSVGWithThemeName = exports.createStatsCard = void 0;\nconst theme_1 = require(\"../const/theme\");\nconst icon_1 = require(\"../const/icon\");\nconst js_abbreviation_number_1 = require(\"js-abbreviation-number\");\nconst profile_details_1 = require(\"../github-api/profile-details\");\nconst contributions_by_year_1 = require(\"../github-api/contributions-by-year\");\nconst stats_card_1 = require(\"../templates/stats-card\");\nconst file_writer_1 = require(\"../utils/file-writer\");\nconst createStatsCard = function (username) {\n return __awaiter(this, void 0, void 0, function* () {\n const statsData = yield getStatsData(username);\n for (const themeName of theme_1.ThemeMap.keys()) {\n const svgString = getStatsSVG(statsData, themeName);\n // output to folder, use 3- prefix for sort in preview\n (0, file_writer_1.writeSVG)(themeName, '3-stats', svgString);\n }\n });\n};\nexports.createStatsCard = createStatsCard;\nconst getStatsSVGWithThemeName = function (username, themeName) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!theme_1.ThemeMap.has(themeName))\n throw new Error('Theme does not exist');\n const statsData = yield getStatsData(username);\n return getStatsSVG(statsData, themeName);\n });\n};\nexports.getStatsSVGWithThemeName = getStatsSVGWithThemeName;\nconst getStatsSVG = function (StatsData, themeName) {\n const title = 'Stats';\n const svgString = (0, stats_card_1.createStatsCard)(`${title}`, StatsData, theme_1.ThemeMap.get(themeName));\n return svgString;\n};\nconst getStatsData = function (username) {\n return __awaiter(this, void 0, void 0, function* () {\n const profileDetails = yield (0, profile_details_1.getProfileDetails)(username);\n const totalStars = profileDetails.totalStars;\n let totalCommitContributions = 0;\n const totalPullRequestContributions = profileDetails.totalPullRequestContributions;\n const totalIssueContributions = profileDetails.totalIssueContributions;\n const totalRepositoryContributions = profileDetails.totalRepositoryContributions;\n if (process.env.VERCEL) {\n // If running on vercel, we only calculate for last 1 year to avoid Vercel timeout limit\n profileDetails.contributionYears = profileDetails.contributionYears.slice(0, 1);\n for (const year of profileDetails.contributionYears) {\n const contributions = yield (0, contributions_by_year_1.getContributionByYear)(username, year);\n totalCommitContributions += contributions.totalCommitContributions;\n }\n }\n else {\n for (const year of profileDetails.contributionYears) {\n const contributions = yield (0, contributions_by_year_1.getContributionByYear)(username, year);\n totalCommitContributions += contributions.totalCommitContributions;\n }\n }\n const statsData = [\n {\n index: 0,\n icon: icon_1.Icon.STAR,\n name: 'Total Stars:',\n value: `${(0, js_abbreviation_number_1.abbreviateNumber)(totalStars, 1)}`\n },\n // If running on vercel, we only display for last 1 year commits count\n !process.env.VERCEL\n ? {\n index: 1,\n icon: icon_1.Icon.COMMIT,\n name: 'Total Commits:',\n value: `${(0, js_abbreviation_number_1.abbreviateNumber)(totalCommitContributions, 1)}`\n }\n : {\n index: 1,\n icon: icon_1.Icon.COMMIT,\n name: `${profileDetails.contributionYears[0]} Commits:`,\n value: `${(0, js_abbreviation_number_1.abbreviateNumber)(totalCommitContributions, 1)}`\n },\n {\n index: 2,\n icon: icon_1.Icon.PULL_REQUEST,\n name: 'Total PRs:',\n value: `${(0, js_abbreviation_number_1.abbreviateNumber)(totalPullRequestContributions, 1)}`\n },\n {\n index: 3,\n icon: icon_1.Icon.ISSUE,\n name: 'Total Issues:',\n value: `${(0, js_abbreviation_number_1.abbreviateNumber)(totalIssueContributions, 1)}`\n },\n {\n index: 4,\n icon: icon_1.Icon.REPOS,\n name: 'Contributed to:',\n value: `${(0, js_abbreviation_number_1.abbreviateNumber)(totalRepositoryContributions, 1)}`\n }\n ];\n return statsData;\n });\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Icon = void 0;\n// icons are from https://primer.style/octicons/\nexports.Icon = {\n GITHUB: ``,\n EMAIL: ``,\n CLOCK: ``,\n REPOS: ``,\n COMPANY: ``,\n LOCATION: ``,\n STAR: ``,\n MERGE: ``,\n PR: ``,\n CODE_REVIEW: ``,\n ISSUE: ``,\n COMMIT: ``,\n PULL_REQUEST: ``\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Theme = exports.ThemeMap = void 0;\nexports.ThemeMap = new Map();\nclass Theme {\n constructor(title, text, background, stroke, icon, chart) {\n this.title = title;\n this.text = text;\n this.background = background;\n this.stroke = stroke;\n this.icon = icon;\n this.chart = chart;\n }\n}\nexports.Theme = Theme;\n// Set up themes\n// We support short hex color, hex color and RGBA hex\n// ThemeMap.set(name, new Theme('title', 'text', 'background', 'stroke', 'icon', 'chart'));\nexports.ThemeMap.set('2077', new Theme('#ff0055', '#03d8f3', '#141321', '#141321', '#fcee0c', '#00ffc8'));\nexports.ThemeMap.set('algolia', new Theme('#00aeff', '#ffffff', '#050f2c', '#00000000', '#2dde98', '#00aeff'));\nexports.ThemeMap.set('apprentice', new Theme('#ffffff', '#bcbcbc', '#262626', '#00000000', '#ffffaf', '#ffffff'));\nexports.ThemeMap.set('aura_dark', new Theme('#ff7372', '#dbdbdb', '#252334', '#00000000', '#6cffd0', '#ff7372'));\nexports.ThemeMap.set('aura', new Theme('#a277ff', '#61ffca', '#15141b', '#00000000', '#ffca85', '#a277ff'));\nexports.ThemeMap.set('ayu_mirage', new Theme('#f4cd7c', '#c7c8c2', '#1f2430', '#00000000', '#73d0ff', '#f4cd7c'));\nexports.ThemeMap.set('bear', new Theme('#e03c8a', '#bcb28d', '#1f2023', '#00000000', '#00aeff', '#e03c8a'));\nexports.ThemeMap.set('blue_green', new Theme('#2f97c1', '#0cf574', '#040f0f', '#00000000', '#f5b700', '#2f97c1'));\nexports.ThemeMap.set('blueberry', new Theme('#82aaff', '#27e8a7', '#242938', '#00000000', '#89ddff', '#82aaff'));\nexports.ThemeMap.set('buefy', new Theme('#7957d5', '#363636', '#ffffff', '#00000000', '#ff3860', '#7957d5'));\nexports.ThemeMap.set('calm', new Theme('#e07a5f', '#ebcfb2', '#373f51', '#00000000', '#edae49', '#e07a5f'));\nexports.ThemeMap.set('chartreuse_dark', new Theme('#7fff00', '#fff', '#000', '#000000', '#00aeff', '#7fff00'));\nexports.ThemeMap.set('city_lights', new Theme('#5d8cb3', '#718ca1', '#1d252c', '#00000000', '#4798ff', '#5d8cb3'));\nexports.ThemeMap.set('cobalt', new Theme('#e683d9', '#75eeb2', '#193549', '#00000000', '#0480ef', '#e683d9'));\nexports.ThemeMap.set('cobalt2', new Theme('#ffc600', '#0088ff', '#193549', '#00000000', '#ffffff', '#ffc600'));\nexports.ThemeMap.set('codeSTACKr', new Theme('#ff652f', '#ffffff', '#09131b', '#0c1a25', '#ffe400', '#ff652f'));\nexports.ThemeMap.set('darcula', new Theme('#ba5f17', '#bebebe', '#242424', '#00000000', '#ffb74d', '#ba5f17'));\nexports.ThemeMap.set('dark', new Theme('#fff', '#9f9f9f', '#151515', '#00000000', '#79ff97', '#fff'));\nexports.ThemeMap.set('date_night', new Theme('#da7885', '#e1b2a2', '#170f0c', '#170f0c', '#bb8470', '#da7885'));\nexports.ThemeMap.set('default', new Theme('#586e75', '#586e75', '#ffffff', '#e4e2e2', '#586e75', '#586e75'));\nexports.ThemeMap.set('discord_old_blurple', new Theme('#7289da', '#ffffff', '#2c2f33', '#00000000', '#7289da', '#7289da'));\nexports.ThemeMap.set('dracula', new Theme('#ff79c6', '#ffb86c', '#282a36', '#282a36', '#6272a4', '#bd93f9'));\nexports.ThemeMap.set('flag_india', new Theme('#ff8f1c', '#509e2f', '#ffffff', '#00000000', '#250e62', '#ff8f1c'));\nexports.ThemeMap.set('github_dark', new Theme('#0366d6', '#77909c', '#0d1117', '#2e343b', '#8b949e', '#40c463'));\nexports.ThemeMap.set('github', new Theme('#0366d6', '#586069', '#ffffff', '#e4e2e2', '#586069', '#40c463'));\nexports.ThemeMap.set('gotham', new Theme('#2aa889', '#99d1ce', '#0c1014', '#00000000', '#599cab', '#2aa889'));\nexports.ThemeMap.set('graywhite', new Theme('#24292e', '#24292e', '#ffffff', '#00000000', '#24292e', '#24292e'));\nexports.ThemeMap.set('great_gatsby', new Theme('#ffa726', '#ffd95b', '#000000', '#00000000', '#ffb74d', '#ffa726'));\nexports.ThemeMap.set('gruvbox', new Theme('#fabd2f', '#8ec07c', '#282828', '#282828', '#fe8019', '#fe8019'));\nexports.ThemeMap.set('highcontrast', new Theme('#e7f216', '#fff', '#000', '#00000000', '#00ffff', '#e7f216'));\nexports.ThemeMap.set('jolly', new Theme('#ff64da', '#ffffff', '#291b3e', '#00000000', '#a960ff', '#ff64da'));\nexports.ThemeMap.set('kacho_ga', new Theme('#bf4a3f', '#d9c8a9', '#402b23', '#00000000', '#a64833', '#bf4a3f'));\nexports.ThemeMap.set('maroongold', new Theme('#f7ef8a', '#e0aa3e', '#260000', '#00000000', '#f7ef8a', '#f7ef8a'));\nexports.ThemeMap.set('material_palenight', new Theme('#c792ea', '#a6accd', '#292d3e', '#00000000', '#89ddff', '#c792ea'));\nexports.ThemeMap.set('merko', new Theme('#abd200', '#68b587', '#0a0f0b', '#00000000', '#b7d364', '#abd200'));\nexports.ThemeMap.set('midnight_purple', new Theme('#9745f5', '#ffffff', '#000000', '#00000000', '#9f4bff', '#9745f5'));\nexports.ThemeMap.set('moltack', new Theme('#86092c', '#574038', '#f5e1c0', '#00000000', '#86092c', '#86092c'));\nexports.ThemeMap.set('monokai', new Theme('#eb1f6a', '#ffffff', '#2c292d', '#2c292d', '#e28905', '#ae81ff'));\nexports.ThemeMap.set('moonlight', new Theme('#ff757f', '#f8f8f8', '#222436', '#222436', '#599dff', '#ff757f'));\nexports.ThemeMap.set('nightowl', new Theme('#c792ea', '#7fdbca', '#011627', '#00000000', '#ffeb95', '#c792ea'));\nexports.ThemeMap.set('noctis_minimus', new Theme('#d3b692', '#c5cdd3', '#1b2932', '#00000000', '#72b7c0', '#d3b692'));\nexports.ThemeMap.set('nord_bright', new Theme('#3b4252', '#2e3440', '#eceff4', '#e5e9f0', '#8fbcbb', '#88c0d0'));\nexports.ThemeMap.set('nord_dark', new Theme('#eceff4', '#e5e9f0', '#2e3440', '#eceff4', '#8fbcbb', '#88c0d0'));\nexports.ThemeMap.set('ocean_dark', new Theme('#8957b2', '#92d534', '#151a28', '#00000000', '#ffffff', '#8957b2'));\nexports.ThemeMap.set('omni', new Theme('#ff79c6', '#e1e1e6', '#191622', '#00000000', '#e7de79', '#ff79c6'));\nexports.ThemeMap.set('onedark', new Theme('#e4bf7a', '#df6d74', '#282c34', '#00000000', '#8eb573', '#e4bf7a'));\nexports.ThemeMap.set('outrun', new Theme('#ffcc00', '#8080ff', '#141439', '#00000000', '#ff1aff', '#ffcc00'));\nexports.ThemeMap.set('panda', new Theme('#19f9d899', '#ff75b5', '#31353a', '#00000000', '#19f9d899', '#19f9d899'));\nexports.ThemeMap.set('prussian', new Theme('#bddfff', '#6e93b5', '#172f45', '#00000000', '#38a0ff', '#bddfff'));\nexports.ThemeMap.set('radical', new Theme('#fe428e', '#a9fef7', '#141321', '#141321', '#f8d847', '#ae81ff'));\nexports.ThemeMap.set('react', new Theme('#61dafb', '#ffffff', '#20232a', '#00000000', '#61dafb', '#61dafb'));\nexports.ThemeMap.set('rose_pine', new Theme('#9ccfd8', '#e0def4', '#191724', '#00000000', '#ebbcba', '#9ccfd8'));\nexports.ThemeMap.set('shades_of_purple', new Theme('#fad000', '#a599e9', '#2d2b55', '#00000000', '#b362ff', '#fad000'));\nexports.ThemeMap.set('slateorange', new Theme('#faa627', '#ffffff', '#36393f', '#00000000', '#faa627', '#faa627'));\nexports.ThemeMap.set('solarized_dark', new Theme('#268bd2', '#839496', '#073642', '#073642', '#b58900', '#859900'));\nexports.ThemeMap.set('solarized', new Theme('#268bd2', '#586e75', '#fdf6e3', '#fdf6e3', '#b58900', '#859900'));\nexports.ThemeMap.set('swift', new Theme('#000000', '#000000', '#f7f7f7', '#00000000', '#f05237', '#000000'));\nexports.ThemeMap.set('synthwave', new Theme('#e2e9ec', '#e5289e', '#2b213a', '#00000000', '#ef8539', '#e2e9ec'));\nexports.ThemeMap.set('tokyonight', new Theme('#70a5fd', '#38bdae', '#1a1b27', '#1a1b27', '#bf91f3', '#bf91f3'));\nexports.ThemeMap.set('transparent', new Theme('#006AFF', '#417E87', '#00000000', '#00000000', '#0579C3', '#006AFF'));\nexports.ThemeMap.set('vision_friendly_dark', new Theme('#ffb000', '#ffffff', '#000000', '#00000000', '#785ef0', '#ffb000'));\nexports.ThemeMap.set('vue', new Theme('#41b883', '#000000', '#ffffff', '#e4e2e2', '#41b883', '#41b883'));\nexports.ThemeMap.set('yeblu', new Theme('#ffff00', '#ffffff', '#002046', '#00000000', '#ffff00', '#ffff00'));\nexports.ThemeMap.set('zenburn', new Theme('#f0dfaf', '#dcdccc', '#3f3f3f', '#3f3f3f', '#8cd0d3', '#7f9f7f'));\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getCommitLanguage = exports.CommitLanguages = exports.CommitLanguageInfo = void 0;\nconst request_1 = __importDefault(require(\"../utils/request\"));\nclass CommitLanguageInfo {\n constructor(name, color = '#586e75', count) {\n this.name = name;\n this.color = color;\n this.count = count;\n }\n}\nexports.CommitLanguageInfo = CommitLanguageInfo;\nclass CommitLanguages {\n constructor() {\n this.languageMap = new Map();\n }\n addLanguageCount(name, color, count) {\n if (this.languageMap.has(name)) {\n const lang = this.languageMap.get(name);\n lang.count += count;\n this.languageMap.set(name, lang);\n }\n else {\n this.languageMap.set(name, new CommitLanguageInfo(name, color, count));\n }\n }\n getLanguageMap() {\n return this.languageMap;\n }\n}\nexports.CommitLanguages = CommitLanguages;\nconst fetcher = (token, variables) => {\n return (0, request_1.default)({\n Authorization: `bearer ${token}`\n }, {\n query: `\n query CommitLanguages($login: String!) {\n user(login: $login) {\n contributionsCollection {\n commitContributionsByRepository(maxRepositories: 100) {\n repository {\n primaryLanguage {\n name\n color\n }\n }\n contributions {\n totalCount\n }\n }\n }\n }\n }\n `,\n variables\n });\n};\n// repos per language\nfunction getCommitLanguage(username, exclude) {\n return __awaiter(this, void 0, void 0, function* () {\n const commitLanguages = new CommitLanguages();\n const res = yield fetcher(process.env.GITHUB_TOKEN, {\n login: username\n });\n if (res.data.errors) {\n throw Error(res.data.errors[0].message || 'GetCommitLanguage failed');\n }\n res.data.data.user.contributionsCollection.commitContributionsByRepository.forEach((node) => {\n if (node.repository.primaryLanguage == null) {\n return;\n }\n const langName = node.repository.primaryLanguage.name;\n const langColor = node.repository.primaryLanguage.color;\n const totalCount = node.contributions.totalCount;\n if (!exclude.includes(langName)) {\n commitLanguages.addLanguageCount(langName, langColor, totalCount);\n }\n });\n return commitLanguages;\n });\n}\nexports.getCommitLanguage = getCommitLanguage;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getContributionByYear = exports.ConrtibutionByYear = void 0;\nconst request_1 = __importDefault(require(\"../utils/request\"));\nclass ConrtibutionByYear {\n constructor(year, totalCommitContributions, totalContributions) {\n this.year = year;\n this.totalCommitContributions = totalCommitContributions;\n this.totalContributions = totalContributions;\n }\n}\nexports.ConrtibutionByYear = ConrtibutionByYear;\nconst fetcher = (token, variables, year) => {\n return (0, request_1.default)({\n Authorization: `bearer ${token}`\n }, {\n query: `\n query ContributionsByYear($login: String!) {\n user(login: $login) {\n ${year\n ? `contributionsCollection(from: \"${year}-01-01T00:00:00Z\", to: \"${year}-12-31T23:59:59Z\") {`\n : 'contributionsCollection {'}\n totalCommitContributions\n contributionCalendar {\n totalContributions\n }\n }\n }\n }\n `,\n variables\n });\n};\nfunction getContributionByYear(username, year) {\n return __awaiter(this, void 0, void 0, function* () {\n const res = yield fetcher(process.env.GITHUB_TOKEN, {\n login: username\n }, year);\n if (res.data.errors) {\n throw Error(res.data.errors[0].message || 'GetContributionByYear failed');\n }\n const user = res.data.data.user;\n const result = new ConrtibutionByYear(year, user.contributionsCollection.totalCommitContributions, user.contributionsCollection.contributionCalendar.totalContributions);\n return result;\n });\n}\nexports.getContributionByYear = getContributionByYear;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getProductiveTime = exports.ProfuctiveTime = void 0;\nconst request_1 = __importDefault(require(\"../utils/request\"));\nclass ProfuctiveTime {\n constructor() {\n this.productiveDate = [];\n }\n addProductiveDate(date) {\n this.productiveDate.push(date);\n }\n}\nexports.ProfuctiveTime = ProfuctiveTime;\nconst userIdFetcher = (token, variables) => {\n return (0, request_1.default)({\n Authorization: `bearer ${token}`\n }, {\n query: `\n query getUserId($login: String!) {\n user(login: $login) {\n id\n }\n }\n `,\n variables\n });\n};\n// We use commit datetime to caculate productive time\nconst fetcher = (token, variables) => {\n return (0, request_1.default)({\n Authorization: `bearer ${token}`\n }, {\n query: `\n query ProductiveTime($login: String!,$userId: ID!,$until: GitTimestamp!,,$since: GitTimestamp!) {\n user(login: $login) {\n contributionsCollection{\n commitContributionsByRepository(maxRepositories:50) {\n repository {\n defaultBranchRef {\n target {\n ... on Commit {\n history(first: 50,since: $since,until: $until,author:{id:$userId}) {\n edges {\n node {\n message\n author{\n email\n }\n committedDate\n }\n }\n }\n }\n }\n }\n name\n }\n }\n }\n }\n }\n `,\n variables\n });\n};\n// get productive time\nfunction getProductiveTime(username, until, since) {\n return __awaiter(this, void 0, void 0, function* () {\n const userIdResponse = yield userIdFetcher(process.env.GITHUB_TOKEN, {\n login: username\n });\n if (userIdResponse.data.errors) {\n throw Error(userIdResponse.data.errors[0].message || 'GetProductiveTime failed');\n }\n const userId = userIdResponse.data.data.user.id;\n const res = yield fetcher(process.env.GITHUB_TOKEN, {\n login: username,\n userId: userId,\n until: until,\n since: since\n });\n if (res.data.errors) {\n throw Error(res.data.errors[0].message || 'GetProductiveTime failed');\n }\n const productiveTime = new ProfuctiveTime();\n res.data.data.user.contributionsCollection.commitContributionsByRepository.forEach((node) => {\n if (node.repository.defaultBranchRef != null) {\n node.repository.defaultBranchRef.target.history.edges.forEach(node => {\n productiveTime.addProductiveDate(node.node.committedDate);\n });\n }\n });\n return productiveTime;\n });\n}\nexports.getProductiveTime = getProductiveTime;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getProfileDetails = exports.ProfileContribution = exports.ProfileDetails = void 0;\nconst request_1 = __importDefault(require(\"../utils/request\"));\nclass ProfileDetails {\n constructor(id, name, email, createdAt) {\n this.company = null;\n this.websiteUrl = null;\n this.twitterUsername = null;\n this.location = null;\n this.totalPublicRepos = 0;\n this.totalStars = 0;\n this.totalIssueContributions = 0;\n this.totalPullRequestContributions = 0;\n this.totalRepositoryContributions = 0;\n this.contributions = [];\n this.contributionYears = [];\n this.id = id;\n this.name = name;\n this.email = email;\n this.createdAt = createdAt;\n }\n}\nexports.ProfileDetails = ProfileDetails;\nclass ProfileContribution {\n constructor(date, count) {\n this.contributionCount = 0;\n this.date = date;\n this.contributionCount = count;\n }\n}\nexports.ProfileContribution = ProfileContribution;\nconst fetcher = (token, variables) => {\n // contain private need token permission\n // contributionsCollection default to a year ago\n return (0, request_1.default)({\n Authorization: `bearer ${token}`\n }, {\n query: `\n query UserDetails($login: String!) {\n user(login: $login) {\n id\n name\n email\n createdAt\n twitterUsername\n company\n location\n websiteUrl\n repositories(first: 100,privacy:PUBLIC, isFork: false, ownerAffiliations: OWNER, orderBy: {direction: DESC, field: STARGAZERS}) {\n totalCount\n nodes {\n stargazers {\n totalCount\n }\n }\n }\n contributionsCollection {\n contributionCalendar {\n weeks {\n contributionDays {\n contributionCount\n date\n }\n }\n }\n contributionYears\n }\n repositoriesContributedTo(first: 1,includeUserRepositories:true, privacy:PUBLIC, contributionTypes: [COMMIT, ISSUE, PULL_REQUEST, REPOSITORY]) {\n totalCount\n }\n pullRequests(first: 1) {\n totalCount\n }\n issues(first: 1) {\n totalCount\n }\n }\n }\n\n `,\n variables\n });\n};\nfunction getProfileDetails(username) {\n return __awaiter(this, void 0, void 0, function* () {\n const res = yield fetcher(process.env.GITHUB_TOKEN, {\n login: username\n });\n if (res.data.errors) {\n throw Error(res.data.errors[0].message || 'GetProfileDetails failed');\n }\n const user = res.data.data.user;\n const profileDetails = new ProfileDetails(user.id, user.name, user.email, user.createdAt);\n profileDetails.totalPublicRepos = user.repositories.totalCount;\n profileDetails.totalStars = user.repositories.nodes.reduce((stars, curr) => {\n return stars + curr.stargazers.totalCount;\n }, 0);\n profileDetails.websiteUrl = user.websiteUrl;\n profileDetails.totalIssueContributions = user.issues.totalCount;\n profileDetails.totalPullRequestContributions = user.pullRequests.totalCount;\n profileDetails.totalRepositoryContributions = user.repositoriesContributedTo.totalCount;\n profileDetails.company = user.company;\n profileDetails.location = user.location;\n profileDetails.twitterUsername = user.twitterUsername;\n profileDetails.contributionYears = user.contributionsCollection.contributionYears;\n // contributions into array\n for (const week of user.contributionsCollection.contributionCalendar.weeks) {\n for (const day of week.contributionDays) {\n profileDetails.contributions.push(new ProfileContribution(new Date(day.date), day.contributionCount));\n }\n }\n return profileDetails;\n });\n}\nexports.getProfileDetails = getProfileDetails;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRepoLanguages = exports.RepoLanguages = exports.RepoLanguageInfo = void 0;\nconst request_1 = __importDefault(require(\"../utils/request\"));\nclass RepoLanguageInfo {\n constructor(name, color = '#586e75', count) {\n this.name = name;\n this.color = color;\n this.count = count;\n }\n}\nexports.RepoLanguageInfo = RepoLanguageInfo;\nclass RepoLanguages {\n constructor() {\n this.languageMap = new Map();\n }\n addLanguage(name, color) {\n if (this.languageMap.has(name)) {\n const lang = this.languageMap.get(name);\n lang.count += 1;\n this.languageMap.set(name, lang);\n }\n else {\n this.languageMap.set(name, new RepoLanguageInfo(name, color, 1));\n }\n }\n getLanguageMap() {\n return this.languageMap;\n }\n}\nexports.RepoLanguages = RepoLanguages;\nconst fetcher = (token, variables) => {\n // contain private repo need token permission\n return (0, request_1.default)({\n Authorization: `bearer ${token}`\n }, {\n query: `\n query ReposPerLanguage($login: String!,$endCursor: String) {\n user(login: $login) {\n repositories(isFork: false, first: 100, after: $endCursor,ownerAffiliations: OWNER) {\n nodes {\n primaryLanguage {\n name\n color\n }\n }\n pageInfo{\n endCursor\n hasNextPage\n }\n }\n }\n }\n `,\n variables\n });\n};\n// repos per language\nfunction getRepoLanguages(username, exclude) {\n return __awaiter(this, void 0, void 0, function* () {\n let hasNextPage = true;\n let cursor = null;\n const repoLanguages = new RepoLanguages();\n const nodes = [];\n while (hasNextPage) {\n const res = yield fetcher(process.env.GITHUB_TOKEN, {\n login: username,\n endCursor: cursor\n });\n if (res.data.errors) {\n throw Error(res.data.errors[0].message || 'GetRepoLanguage fail');\n }\n cursor = res.data.data.user.repositories.pageInfo.endCursor;\n hasNextPage = res.data.data.user.repositories.pageInfo.hasNextPage;\n nodes.push(...res.data.data.user.repositories.nodes);\n }\n nodes.forEach(node => {\n if (node.primaryLanguage) {\n const langName = node.primaryLanguage.name;\n const langColor = node.primaryLanguage.color;\n if (!exclude.includes(langName)) {\n repoLanguages.addLanguage(langName, langColor);\n }\n }\n });\n return repoLanguages;\n });\n}\nexports.getRepoLanguages = getRepoLanguages;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Card = void 0;\nconst d3 = __importStar(require(\"d3\"));\nconst jsdom_1 = require(\"jsdom\");\nclass Card {\n constructor(title = 'Title', width = 1280, height = 1024, theme, xPadding = 30, yPadding = 40) {\n this.title = title;\n this.width = width;\n this.height = height;\n this.xPadding = xPadding;\n this.yPadding = yPadding;\n // use fake dom let us can get html element\n const fakeDom = new jsdom_1.JSDOM('');\n this.body = d3.select(fakeDom.window.document).select('body');\n this.svg = this.body\n .append('div')\n .attr('class', 'container')\n .append('svg')\n .attr('xmlns', 'http://www.w3.org/2000/svg')\n .attr('width', width)\n .attr('height', height)\n .attr('viewBox', `0 0 ${this.width} ${this.height}`);\n this.svg.append('style').html(`* {\n font-family: 'Segoe UI', Ubuntu, \"Helvetica Neue\", Sans-Serif\n }`);\n this.svg\n .append('rect')\n .attr('x', 1.5)\n .attr('y', 1.5)\n .attr('rx', 5)\n .attr('ry', 5)\n .attr('height', '100%')\n .attr('width', '100%')\n .attr('stroke', `${theme.stroke}`)\n .attr('stroke-width', '1')\n .attr('fill', `${theme.background}`)\n .attr('stroke-opacity', 1);\n const isEmptyTitle = this.title == '';\n if (!isEmptyTitle) {\n this.svg\n .append('text')\n .attr('x', this.xPadding)\n .attr('y', this.yPadding)\n .style('font-size', `22px`)\n .style('fill', `${theme.title}`)\n .text(this.title);\n }\n this.svg = this.svg.append('g').attr('transform', 'translate(0,40)');\n }\n getSVG() {\n return this.svg;\n }\n toString() {\n return this.body.select('.container').html();\n }\n}\nexports.Card = Card;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createDonutChartCard = void 0;\nconst card_1 = require(\"./card\");\nconst d3 = __importStar(require(\"d3\"));\nfunction createDonutChartCard(title, data, theme) {\n const pie = d3.pie().value(function (d) {\n return d.value;\n });\n const pieData = pie(data);\n const card = new card_1.Card(title, 340, 200, theme);\n const margin = 10;\n const radius = (Math.min(card.width, card.height) - 2 * margin - card.yPadding) / 2;\n const arc = d3\n .arc()\n .outerRadius(radius - 10)\n .innerRadius(radius / 2);\n const svg = card.getSVG();\n // draw language node\n const panel = svg.append('g').attr('transform', `translate(${card.xPadding + margin},${0})`);\n const labelHeight = 14;\n panel\n .selectAll(null)\n .data(pieData)\n .enter()\n .append('rect')\n .attr('y', d => labelHeight * d.index * 1.8 + card.height / 2 - radius - 12) // rect y-coordinate need fix,so I decrease y, but I don't know why this need fix.\n .attr('width', labelHeight)\n .attr('height', labelHeight)\n .attr('fill', pieData => pieData.data.color)\n .attr('stroke', `${theme.background}`)\n .style('stroke-width', '1px');\n // set language text\n panel\n .selectAll(null)\n .data(pieData)\n .enter()\n .append('text')\n .text(d => {\n return d.data.name;\n })\n .attr('x', labelHeight * 1.2)\n .attr('y', d => labelHeight * d.index * 1.8 + card.height / 2 - radius)\n .style('fill', theme.text)\n .style('font-size', `${labelHeight}px`);\n // draw pie chart\n const g = svg\n .append('g')\n .attr('transform', `translate( ${card.width - radius - margin - card.xPadding}, ${(card.height - card.yPadding) / 2} )`)\n .selectAll('.arc')\n .data(pieData)\n .enter()\n .append('g')\n .attr('class', 'arc');\n g.append('path')\n .attr('d', arc)\n .style('fill', function (pieData) {\n return pieData.data.color;\n })\n .attr('stroke', `${theme.background}`)\n .style('stroke-width', '2px');\n return card.toString();\n}\nexports.createDonutChartCard = createDonutChartCard;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createProductiveCard = void 0;\nconst card_1 = require(\"./card\");\nconst d3 = __importStar(require(\"d3\"));\nconst d3Axis = __importStar(require(\"d3-axis\"));\nfunction createProductiveCard(chartData, theme, utcOffset) {\n const title = 'Commits ' + '(UTC ' + (utcOffset >= 0 ? '+' : '') + utcOffset.toFixed(2) + ')';\n const card = new card_1.Card(title, 340, 200, theme);\n const svg = card.getSVG();\n const chartWidth = card.width - 60;\n const chartHeight = 100;\n const bottomScaleBand = d3.scaleBand().range([0, chartWidth]).padding(0.1);\n const bottomAxis = d3Axis.axisBottom(bottomScaleBand);\n if (chartData.length != 24) {\n throw Error('productive time array size should be 24');\n }\n bottomScaleBand.domain(chartData.map(function (_, index, __) {\n return index;\n }));\n const yMax = Math.max(...chartData.map(function (d) {\n return d;\n }));\n const y = d3.scaleLinear().range([chartHeight, 0]);\n y.domain([0, yMax]);\n y.nice();\n const chartPanel = svg\n .append('g')\n .attr('color', theme.chart)\n .attr('transform', `translate(${(card.width - chartWidth) / 2 + 5},${card.yPadding / 2})`);\n const xAxis = bottomAxis.tickValues([0, 6, 12, 18, 23]);\n // Add the X Axis\n const g = chartPanel.append('g').attr('color', theme.text).attr('transform', `translate(0,${chartHeight})`);\n g.call(xAxis);\n // custom x axis, here is svg magic\n // Add more space for first bar\n g.select('.domain').attr('d', `M${0 - bottomScaleBand(1) + bottomScaleBand(0) + bottomScaleBand.bandwidth()},0.5H${chartWidth}.5`);\n // Add the Y Axis\n chartPanel\n .append('g')\n .attr('color', theme.text)\n // Add gap before first bar\n .attr('transform', `translate(${0 - bottomScaleBand(1) + bottomScaleBand(0) + bottomScaleBand.bandwidth()},0)`)\n .call(d3.axisLeft(y).ticks(5));\n chartPanel\n .selectAll('.bar')\n .data(chartData)\n .enter()\n .append('rect')\n .attr('class', 'bar')\n .style('hover', 'green')\n .attr('fill', theme.chart)\n .attr('x', function (_, index) {\n return bottomScaleBand(index);\n })\n .attr('y', function (d) {\n return y(Number(d));\n })\n .attr('width', bottomScaleBand.bandwidth())\n .attr('height', function (d) {\n return chartHeight - y(Number(d));\n });\n chartPanel\n .append('g')\n .append('text')\n .text('per day hour')\n .attr('y', 130)\n .attr('x', 220)\n .style('fill', theme.text)\n .style('font-size', `10px`);\n return card.toString();\n}\nexports.createProductiveCard = createProductiveCard;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createDetailCard = void 0;\nconst card_1 = require(\"./card\");\nconst d3 = __importStar(require(\"d3\"));\nconst moment_1 = __importDefault(require(\"moment\"));\nfunction createDetailCard(title, userDetails, contributionsData, theme) {\n const card = new card_1.Card(title, 700, 200, theme);\n const svg = card.getSVG();\n // draw icon\n const panel = svg.append('g').attr('transform', `translate(30,30)`);\n const labelHeight = 14;\n panel\n .selectAll(null)\n .data(userDetails)\n .enter()\n .append('g')\n .attr('transform', d => {\n const y = labelHeight * d.index * 2;\n return `translate(0,${y})`;\n })\n .attr('width', labelHeight)\n .attr('height', labelHeight)\n .attr('fill', theme.icon)\n .html(d => d.icon);\n // draw text\n panel\n .selectAll(null)\n .data(userDetails)\n .enter()\n .append('text')\n .text(d => {\n return d.value;\n })\n .attr('x', labelHeight * 1.5)\n .attr('y', d => labelHeight * d.index * 2 + labelHeight)\n .style('fill', theme.text)\n .style('font-size', `${labelHeight}px`);\n // process chart data\n const lineChartData = [];\n for (const data of contributionsData) {\n const formatDate = (0, moment_1.default)(data.date).format('YYYY-MM');\n data.date = new Date(formatDate);\n const lastIndex = lineChartData.length - 1;\n if (lineChartData.length == 0 || lineChartData[lastIndex].date.getTime() !== data.date.getTime()) {\n lineChartData.push({\n contributionCount: data.contributionCount,\n date: data.date\n }); // use new object\n }\n else {\n lineChartData[lastIndex].contributionCount += data.contributionCount;\n }\n }\n // prepare chart data\n const chartRightMargin = 30;\n const chartWidth = card.width - 2 * card.xPadding - chartRightMargin - 230;\n const chartHeight = card.height - 2 * card.yPadding - 10;\n const x = d3.scaleTime().range([0, chartWidth]);\n x.domain(d3.extent(lineChartData, function (d) {\n return d.date;\n }));\n // eslint-disable-next-line prefer-spread\n const yMax = Math.max.apply(Math, lineChartData.map(function (o) {\n return o.contributionCount;\n }));\n const y = d3.scaleLinear().range([chartHeight, 0]);\n y.domain([0, yMax]);\n y.nice();\n const valueline = d3\n .area()\n .x(function (d) {\n return x(d.date);\n })\n .y0(y(0))\n .y1(function (d) {\n return y(d.contributionCount);\n })\n .curve(d3.curveMonotoneX);\n const chartPanel = svg\n .append('g')\n .attr('color', theme.chart)\n .attr('transform', `translate(${card.width - chartWidth - card.xPadding + 5},10)`);\n // draw chart line\n chartPanel\n .append('path')\n .data([lineChartData])\n .attr('transform', `translate(${-chartRightMargin},0)`)\n .attr('stroke', theme.chart)\n .attr('fill', theme.chart)\n .attr('opacity', 1)\n .attr('d', valueline);\n // Add the X Axis\n const xAxis = d3\n .axisBottom(x)\n .tickFormat(d3.timeFormat('%y/%m'))\n .tickValues(lineChartData\n .filter((_, i) => {\n return i % 2 === 0;\n })\n .map(d => {\n return d.date;\n }));\n chartPanel\n .append('g')\n .attr('color', theme.text)\n .attr('transform', `translate(${-chartRightMargin},${chartHeight})`)\n .call(xAxis);\n // Add the Y Axis\n chartPanel\n .append('g')\n .attr('color', theme.text)\n .attr('transform', `translate(${chartWidth - chartRightMargin},0)`)\n .call(d3.axisRight(y).ticks(8));\n // hard code this coordinate becuz I'm too lazy\n chartPanel\n .append('g')\n .append('text')\n .text('contributions in the last year')\n .attr('y', title.length > 30 ? 140 : -15) // if the title is too long, then put text to the bottom\n .attr('x', 230)\n .style('fill', theme.text)\n .style('font-size', `10px`);\n return card.toString();\n}\nexports.createDetailCard = createDetailCard;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createStatsCard = void 0;\nconst card_1 = require(\"./card\");\nconst icon_1 = require(\"../const/icon\");\nfunction createStatsCard(title, statsData, theme) {\n const card = new card_1.Card(title, 340, 200, theme);\n const svg = card.getSVG();\n // draw icon\n const panel = svg.append('g').attr('transform', `translate(30,20)`);\n const labelHeight = 14;\n panel\n .selectAll(null)\n .data(statsData)\n .enter()\n .append('g')\n .attr('transform', d => {\n const y = labelHeight * d.index * 1.8;\n return `translate(0,${y})`;\n })\n .attr('width', labelHeight)\n .attr('height', labelHeight)\n .attr('fill', theme.icon)\n .html(d => d.icon);\n // draw text\n panel\n .selectAll(null)\n .data(statsData)\n .enter()\n .append('text')\n .text(d => {\n return `${d.name}`;\n })\n .attr('x', labelHeight * 1.5)\n .attr('y', d => labelHeight * d.index * 1.8 + labelHeight)\n .style('fill', theme.text)\n .style('font-size', `${labelHeight}px`);\n panel\n .selectAll(null)\n .data(statsData)\n .enter()\n .append('text')\n .text(d => {\n return `${d.value}`;\n })\n .attr('x', 130)\n .attr('y', d => labelHeight * d.index * 1.8 + labelHeight)\n .style('fill', theme.text)\n .style('font-size', `${labelHeight}px`);\n const panelForGitHubLogo = svg.append('g').attr('transform', `translate(220,20)`);\n panelForGitHubLogo.append('g').attr('transform', `scale(6)`).style('fill', theme.icon).html(icon_1.Icon.GITHUB);\n return card.toString();\n}\nexports.createStatsCard = createStatsCard;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generatePreviewMarkdown = exports.writeSVG = exports.OUTPUT_PATH = void 0;\nconst core = __importStar(require(\"@actions/core\"));\nconst fs_1 = require(\"fs\");\nconst theme_1 = require(\"../const/theme\");\nexports.OUTPUT_PATH = './profile-summary-card-output/';\nconst GITHUB_REPOSITORY = process.env.GITHUB_REPOSITORY;\n// If neither a branch or tag is available for the event type, the variable will not exist. https://docs.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables\nconst GITHUB_BRANCH = process.env.GITHUB_REF == undefined\n ? core.getInput('BRANCH_NAME', { required: false })\n : process.env.GITHUB_REF.split('/').pop();\nconst writeSVG = function (folder, filename, svgString) {\n const targetFolder = `${exports.OUTPUT_PATH}${folder}/`;\n (0, fs_1.mkdirSync)(targetFolder, { recursive: true });\n (0, fs_1.writeFileSync)(`${targetFolder}${filename}.svg`, svgString);\n};\nexports.writeSVG = writeSVG;\nfunction getAllFileInFolder(folder) {\n const files = [];\n (0, fs_1.readdirSync)(folder).forEach(file => {\n files.push(file);\n });\n return files;\n}\nconst generatePreviewMarkdown = function (isInGithubAction) {\n const targetFolder = `${exports.OUTPUT_PATH}`;\n let readmeContent = '';\n const urlPrefix = isInGithubAction\n ? `https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/${GITHUB_BRANCH}/profile-summary-card-output`\n : `.`;\n // First, we generate preview readme for each theme\n for (const themeName of theme_1.ThemeMap.keys()) {\n generateThemePreviewReadme(urlPrefix, themeName);\n }\n readmeContent += `\n# Theme Preview\n\nHere are all cards with themes.\n| :bell: | If only show Top Languages card here, then you maybe forgot to use [Personal access token](https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets) instead of GITHUB_TOKEN in workflow. |\n| :-------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n\n`;\n for (const themeName of theme_1.ThemeMap.keys()) {\n readmeContent += `## [${themeName}](./${themeName}/README.md)`;\n readmeContent += getThemeMarkdown(`${urlPrefix}/${themeName}`);\n }\n (0, fs_1.writeFileSync)(`${targetFolder}README.md`, readmeContent);\n};\nexports.generatePreviewMarkdown = generatePreviewMarkdown;\nfunction generateThemePreviewReadme(urlPrefix, themeName) {\n let themePreviewMarkdown = '';\n themePreviewMarkdown += `## ${themeName}`;\n themePreviewMarkdown += `\\n`;\n themePreviewMarkdown += getThemeMarkdown('.');\n themePreviewMarkdown += '### Now you can add this to your markdown';\n themePreviewMarkdown += `\n\\`\\`\\`\n${getThemeMarkdown(`${urlPrefix}/${themeName}`)}\n\\`\\`\\`\n`;\n themePreviewMarkdown += `\\n`;\n themePreviewMarkdown += `### Each card usage`;\n for (const file of getAllFileInFolder(exports.OUTPUT_PATH + themeName)) {\n if (!file.endsWith('svg'))\n continue;\n themePreviewMarkdown += `\n---\n\n![](./${file})\n\n\\`\\`\\`\n![](${urlPrefix}/${themeName}/${file})\n\\`\\`\\`\n\n `;\n themePreviewMarkdown += `\\n`;\n }\n (0, fs_1.writeFileSync)(`${exports.OUTPUT_PATH}${themeName}/README.md`, themePreviewMarkdown);\n}\nfunction getThemeMarkdown(urlPrefix) {\n let result = '';\n result += `\n[![](${urlPrefix}/0-profile-details.svg)](https://github.com/vn7n24fzkq/github-profile-summary-cards)\n[![](${urlPrefix}/1-repos-per-language.svg)](https://github.com/vn7n24fzkq/github-profile-summary-cards) [![](${urlPrefix}/2-most-commit-language.svg)](https://github.com/vn7n24fzkq/github-profile-summary-cards)\n[![](${urlPrefix}/3-stats.svg)](https://github.com/vn7n24fzkq/github-profile-summary-cards) [![](${urlPrefix}/4-productive-time.svg)](https://github.com/vn7n24fzkq/github-profile-summary-cards)\n`;\n return result;\n}\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst core_1 = __importDefault(require(\"@actions/core\"));\nconst retry_axios_1 = __importDefault(require(\"retry-axios\"));\nconst axios_1 = __importDefault(require(\"axios\"));\nretry_axios_1.default.attach();\nfunction request(header, data) {\n return (0, axios_1.default)({\n url: 'https://api.github.com/graphql',\n method: 'post',\n headers: header,\n data: data,\n raxConfig: {\n retry: 10,\n noResponseRetries: 3,\n retryDelay: 1000,\n backoffType: 'linear',\n httpMethodsToRetry: ['POST'],\n onRetryAttempt: err => {\n const cfg = retry_axios_1.default.getConfig(err);\n core_1.default.warning(err);\n core_1.default.warning(`Retry attempt #${cfg === null || cfg === void 0 ? void 0 : cfg.currentRetryAttempt}`);\n }\n }\n });\n}\nexports.default = request;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.translateLanguage = void 0;\nconst translateLanguage = function async(lang) {\n // this is a list of all Github supported languages\n // that have known aliases\n // aliases with non URL safe characters have been removed\n // https://github.com/github/linguist/blob/master/lib/linguist/languages.yml\n // some keys added (cs: C#) etc.\n const dict = {\n ags: 'AGS Script',\n aspx: 'ASP.NET',\n ats2: 'ATS',\n actionscript3: 'ActionScript',\n as3: 'ActionScript',\n ada95: 'Ada',\n ada2005: 'Ada',\n acfm: 'Adobe Font Metrics',\n amfm: 'Adobe Font Metrics',\n abuild: 'Alpine Abuild',\n apkbuild: 'Alpine Abuild',\n altium: 'Altium Designer',\n aconf: 'ApacheConf',\n apache: 'ApacheConf',\n osascript: 'AppleScript',\n asm: 'Assembly',\n nasm: 'Assembly',\n ahk: 'AutoHotkey',\n au3: 'AutoIt',\n AutoIt3: 'AutoIt',\n AutoItScript: 'AutoIt',\n bat: 'Batchfile',\n batch: 'Batchfile',\n dosbatch: 'Batchfile',\n winbatch: 'Batchfile',\n be: 'Berry',\n b3d: 'BlitzBasic',\n blitz3d: 'BlitzBasic',\n blitzplus: 'BlitzBasic',\n bplus: 'BlitzBasic',\n bmax: 'BlitzMax',\n csharp: 'C#',\n cs: 'C#',\n cake: 'C#',\n cakescript: 'C#',\n cpp: 'C++',\n c2hs: 'C2hs Haskell',\n cds: 'CAP CDS',\n Cabal: 'Cabal Config',\n Carto: 'CartoCSS',\n chpl: 'Chapel',\n checksum: 'Checksums',\n hash: 'Checksums',\n hashes: 'Checksums',\n sum: 'Checksums',\n sums: 'Checksums',\n asp: 'Classic ASP',\n soy: 'Closure Templates',\n CoNLL: 'CoNLL-U',\n ql: 'CodeQL',\n coffee: 'CoffeeScript',\n cfm: 'ColdFusion',\n cfml: 'ColdFusion',\n cfc: 'ColdFusion CFC',\n lisp: 'Common Lisp',\n cwl: 'Common Workflow Language',\n pyrex: 'Cython',\n Dlang: 'D',\n dcl: 'DIGITAL Command Language',\n byond: 'DM',\n dpatch: 'Darcs Patch',\n udiff: 'Diff',\n Containerfile: 'Dockerfile',\n email: 'E-mail',\n eml: 'E-mail',\n mail: 'E-mail',\n mbox: 'E-mail',\n Earthfile: 'Earthly',\n elisp: 'Emacs Lisp',\n emacs: 'Emacs Lisp',\n fsharp: 'F#',\n fstar: 'F*',\n FIGfont: 'FIGlet Font',\n fb: 'FreeBasic',\n ftl: 'FreeMarker',\n pot: 'Gettext Catalog',\n cucumber: 'Gherkin',\n gitattributes: 'Git Attributes',\n gitconfig: 'Git Config',\n gitmodules: 'Git Config',\n golang: 'Go',\n gf: 'Grammatical Framework',\n gsp: 'Groovy Server Pages',\n terraform: 'HCL',\n xhtml: 'HTML',\n ecr: 'HTML+ECR',\n eex: 'HTML+EEX',\n heex: 'HTML+EEX',\n leex: 'HTML+EEX',\n erb: 'HTML+ERB',\n rhtml: 'HTML+ERB',\n razor: 'HTML+Razor',\n hbs: 'Handlebars',\n htmlbars: 'Handlebars',\n hylang: 'Hy',\n igor: 'IGOR Pro',\n igorpro: 'IGOR Pro',\n dosini: 'INI',\n irc: 'IRC log',\n ignore: 'Ignore List',\n gitignore: 'Ignore List',\n ijm: 'ImageJ Macro',\n i7: 'Inform 7',\n inform7: 'Inform 7',\n geojson: 'JSON',\n jsonl: 'JSON',\n topojson: 'JSON',\n jsonc: 'JSON with Comments',\n jsp: 'Java Server Pages',\n js: 'JavaScript',\n node: 'JavaScript',\n mps: 'JetBrains MPS',\n django: 'Jinja',\n htmldjango: 'Jinja',\n ksy: 'Kaitai Struct',\n kak: 'KakouneScript',\n kakscript: 'KakouneScript',\n pcbnew: 'KiCad Layout',\n lassoscript: 'Lasso',\n flex: 'Lex',\n litcoffee: 'Literate CoffeeScript',\n lhaskell: 'Literate Haskell',\n lhs: 'Literate Haskell',\n ls: 'LiveScript',\n mumps: 'M',\n autoconf: 'M4Sugar',\n octave: 'MATLAB',\n m2: 'Macaulay2',\n bsdmake: 'Makefile',\n make: 'Makefile',\n mf: 'Makefile',\n pandoc: 'Markdown',\n markojs: 'Marko',\n mma: 'Mathematica',\n wolfram: 'Mathematica',\n wl: 'Mathematica',\n maxmsp: 'Max',\n m68k: 'Motorola 68K Assembly',\n amusewiki: 'Muse',\n npmrc: 'NPM Config',\n nixos: 'Nix',\n nush: 'Nu',\n njk: 'Nunjucks',\n objc: 'Objective-C',\n objectivec: 'Objective-C',\n objectivej: 'Objective-J',\n objj: 'Objective-J',\n odinlang: 'Odin',\n progress: 'OpenEdge ABL',\n openedge: 'OpenEdge ABL',\n abl: 'OpenEdge ABL',\n openrc: 'OpenRC runscript',\n AFDKO: 'OpenType Feature File',\n inc: 'PHP',\n povray: 'POV-Ray SDL',\n pasm: 'Parrot Assembly',\n pir: 'Parrot Internal Representation',\n delphi: 'Pascal',\n objectpascal: 'Pascal',\n cperl: 'Perl',\n postscr: 'PostScript',\n posh: 'PowerShell',\n pwsh: 'PowerShell',\n protobuf: 'Protocol Buffer',\n python3: 'Python',\n py: 'Python',\n rusthon: 'Python',\n pycon: 'Python console',\n qsharp: 'Q#',\n R: 'R',\n Rscript: 'R',\n splus: 'R',\n arexx: 'REXX',\n rpcgen: 'RPC',\n oncrpc: 'RPC',\n xdr: 'RPC',\n sqlrpgle: 'RPGLE',\n specfile: 'RPM Spec',\n perl6: 'Raku',\n raw: 'Raw token data',\n inputrc: 'Readline Config',\n readline: 'Readline Config',\n redirects: 'Redirect Rules',\n regexp: 'Regular Expression',\n regex: 'Regular Expression',\n renpy: \"Ren'Py\",\n groff: 'Roff',\n man: 'Roff',\n manpage: 'Roff',\n mdoc: 'Roff',\n nroff: 'Roff',\n troff: 'Roff',\n jruby: 'Ruby',\n macruby: 'Ruby',\n rake: 'Ruby',\n rb: 'Ruby',\n rbx: 'Ruby',\n rs: 'Rust',\n sepolicy: 'SELinux Policy',\n stla: 'STL',\n saltstate: 'SaltStack',\n salt: 'SaltStack',\n sh: 'Shell',\n bash: 'Shell',\n zsh: 'Shell',\n shellcheckrc: 'ShellCheck Config',\n console: 'ShellSession',\n coccinelle: 'SmPL',\n squeak: 'Smalltalk',\n sourcemod: 'SourcePawn',\n sml: 'Standard ML',\n bazel: 'Starlark',\n bzl: 'Starlark',\n latex: 'TeX',\n fundamental: 'Text',\n tl: 'Type Language',\n ts: 'TypeScript',\n gas: 'Unix Assembly',\n Ur: 'UrWeb',\n vlang: 'V',\n vb6: 'VBA',\n keyvalues: 'Valve Data Format',\n vdf: 'Valve Data Format',\n vtl: 'Velocity Template Language',\n velocity: 'Velocity Template Language',\n help: 'Vim Help File',\n vimhelp: 'Vim Help File',\n vim: 'Vim Script',\n viml: 'Vim Script',\n nvim: 'Vim Script',\n SnipMate: 'Vim Snippet',\n UltiSnip: 'Vim Snippet',\n UltiSnips: 'Vim Snippet',\n NeoSnippet: 'Vim Snippet',\n vbnet: 'Visual Basic .NET',\n wast: 'WebAssembly',\n wasm: 'WebAssembly',\n vtt: 'WebVTT',\n wgetrc: 'Wget Config',\n mediawiki: 'Wikitext',\n wiki: 'Wikitext',\n wrenlang: 'Wren',\n xbm: 'X BitMap',\n xpm: 'X PixMap',\n xten: 'X10',\n rss: 'XML',\n xsd: 'XML',\n wsdl: 'XML',\n xsl: 'XSLT',\n yml: 'YAML',\n snippet: 'YASnippet',\n yas: 'YASnippet',\n bro: 'Zeek',\n curlrc: 'cURL Config',\n rst: 'reStructuredText',\n robots: 'robots.txt',\n advpl: 'xBase',\n clipper: 'xBase',\n html: 'HTML',\n foxpro: 'xBase'\n };\n if (dict[lang] !== undefined) {\n return dict[lang];\n }\n return lang.charAt(0).toUpperCase() + lang.slice(1);\n};\nexports.translateLanguage = translateLanguage;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.issue = exports.issueCommand = void 0;\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\n/**\n * Commands\n *\n * Command Format:\n * ::name key=value,key=value::message\n *\n * Examples:\n * ::warning::This is the message\n * ::set-env name=MY_VAR::some value\n */\nfunction issueCommand(command, properties, message) {\n const cmd = new Command(command, properties, message);\n process.stdout.write(cmd.toString() + os.EOL);\n}\nexports.issueCommand = issueCommand;\nfunction issue(name, message = '') {\n issueCommand(name, {}, message);\n}\nexports.issue = issue;\nconst CMD_STRING = '::';\nclass Command {\n constructor(command, properties, message) {\n if (!command) {\n command = 'missing.command';\n }\n this.command = command;\n this.properties = properties;\n this.message = message;\n }\n toString() {\n let cmdStr = CMD_STRING + this.command;\n if (this.properties && Object.keys(this.properties).length > 0) {\n cmdStr += ' ';\n let first = true;\n for (const key in this.properties) {\n if (this.properties.hasOwnProperty(key)) {\n const val = this.properties[key];\n if (val) {\n if (first) {\n first = false;\n }\n else {\n cmdStr += ',';\n }\n cmdStr += `${key}=${escapeProperty(val)}`;\n }\n }\n }\n }\n cmdStr += `${CMD_STRING}${escapeData(this.message)}`;\n return cmdStr;\n }\n}\nfunction escapeData(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A');\n}\nfunction escapeProperty(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A')\n .replace(/:/g, '%3A')\n .replace(/,/g, '%2C');\n}\n//# sourceMappingURL=command.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;\nconst command_1 = require(\"./command\");\nconst file_command_1 = require(\"./file-command\");\nconst utils_1 = require(\"./utils\");\nconst os = __importStar(require(\"os\"));\nconst path = __importStar(require(\"path\"));\nconst uuid_1 = require(\"uuid\");\nconst oidc_utils_1 = require(\"./oidc-utils\");\n/**\n * The code to exit an action\n */\nvar ExitCode;\n(function (ExitCode) {\n /**\n * A code indicating that the action was successful\n */\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\n /**\n * A code indicating that the action was a failure\n */\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\n})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));\n//-----------------------------------------------------------------------\n// Variables\n//-----------------------------------------------------------------------\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction exportVariable(name, val) {\n const convertedVal = utils_1.toCommandValue(val);\n process.env[name] = convertedVal;\n const filePath = process.env['GITHUB_ENV'] || '';\n if (filePath) {\n const delimiter = `ghadelimiter_${uuid_1.v4()}`;\n // These should realistically never happen, but just in case someone finds a way to exploit uuid generation let's not allow keys or values that contain the delimiter.\n if (name.includes(delimiter)) {\n throw new Error(`Unexpected input: name should not contain the delimiter \"${delimiter}\"`);\n }\n if (convertedVal.includes(delimiter)) {\n throw new Error(`Unexpected input: value should not contain the delimiter \"${delimiter}\"`);\n }\n const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;\n file_command_1.issueCommand('ENV', commandValue);\n }\n else {\n command_1.issueCommand('set-env', { name }, convertedVal);\n }\n}\nexports.exportVariable = exportVariable;\n/**\n * Registers a secret which will get masked from logs\n * @param secret value of the secret\n */\nfunction setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}\nexports.setSecret = setSecret;\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nfunction addPath(inputPath) {\n const filePath = process.env['GITHUB_PATH'] || '';\n if (filePath) {\n file_command_1.issueCommand('PATH', inputPath);\n }\n else {\n command_1.issueCommand('add-path', {}, inputPath);\n }\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\n}\nexports.addPath = addPath;\n/**\n * Gets the value of an input.\n * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.\n * Returns an empty string if the value is not defined.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nfunction getInput(name, options) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`);\n }\n if (options && options.trimWhitespace === false) {\n return val;\n }\n return val.trim();\n}\nexports.getInput = getInput;\n/**\n * Gets the values of an multiline input. Each value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string[]\n *\n */\nfunction getMultilineInput(name, options) {\n const inputs = getInput(name, options)\n .split('\\n')\n .filter(x => x !== '');\n return inputs;\n}\nexports.getMultilineInput = getMultilineInput;\n/**\n * Gets the input value of the boolean type in the YAML 1.2 \"core schema\" specification.\n * Support boolean input list: `true | True | TRUE | false | False | FALSE` .\n * The return value is also in boolean type.\n * ref: https://yaml.org/spec/1.2/spec.html#id2804923\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns boolean\n */\nfunction getBooleanInput(name, options) {\n const trueValue = ['true', 'True', 'TRUE'];\n const falseValue = ['false', 'False', 'FALSE'];\n const val = getInput(name, options);\n if (trueValue.includes(val))\n return true;\n if (falseValue.includes(val))\n return false;\n throw new TypeError(`Input does not meet YAML 1.2 \"Core Schema\" specification: ${name}\\n` +\n `Support boolean input list: \\`true | True | TRUE | false | False | FALSE\\``);\n}\nexports.getBooleanInput = getBooleanInput;\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction setOutput(name, value) {\n process.stdout.write(os.EOL);\n command_1.issueCommand('set-output', { name }, value);\n}\nexports.setOutput = setOutput;\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nfunction setCommandEcho(enabled) {\n command_1.issue('echo', enabled ? 'on' : 'off');\n}\nexports.setCommandEcho = setCommandEcho;\n//-----------------------------------------------------------------------\n// Results\n//-----------------------------------------------------------------------\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nfunction setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}\nexports.setFailed = setFailed;\n//-----------------------------------------------------------------------\n// Logging Commands\n//-----------------------------------------------------------------------\n/**\n * Gets whether Actions Step Debug is on or not\n */\nfunction isDebug() {\n return process.env['RUNNER_DEBUG'] === '1';\n}\nexports.isDebug = isDebug;\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nfunction debug(message) {\n command_1.issueCommand('debug', {}, message);\n}\nexports.debug = debug;\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction error(message, properties = {}) {\n command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.error = error;\n/**\n * Adds a warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction warning(message, properties = {}) {\n command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.warning = warning;\n/**\n * Adds a notice issue\n * @param message notice issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction notice(message, properties = {}) {\n command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.notice = notice;\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nfunction info(message) {\n process.stdout.write(message + os.EOL);\n}\nexports.info = info;\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nfunction startGroup(name) {\n command_1.issue('group', name);\n}\nexports.startGroup = startGroup;\n/**\n * End an output group.\n */\nfunction endGroup() {\n command_1.issue('endgroup');\n}\nexports.endGroup = endGroup;\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nfunction group(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n startGroup(name);\n let result;\n try {\n result = yield fn();\n }\n finally {\n endGroup();\n }\n return result;\n });\n}\nexports.group = group;\n//-----------------------------------------------------------------------\n// Wrapper action state\n//-----------------------------------------------------------------------\n/**\n * Saves state for current action, the state can only be retrieved by this action's post job execution.\n *\n * @param name name of the state to store\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction saveState(name, value) {\n command_1.issueCommand('save-state', { name }, value);\n}\nexports.saveState = saveState;\n/**\n * Gets the value of an state set by this action's main execution.\n *\n * @param name name of the state to get\n * @returns string\n */\nfunction getState(name) {\n return process.env[`STATE_${name}`] || '';\n}\nexports.getState = getState;\nfunction getIDToken(aud) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield oidc_utils_1.OidcClient.getIDToken(aud);\n });\n}\nexports.getIDToken = getIDToken;\n/**\n * Summary exports\n */\nvar summary_1 = require(\"./summary\");\nObject.defineProperty(exports, \"summary\", { enumerable: true, get: function () { return summary_1.summary; } });\n/**\n * @deprecated use core.summary\n */\nvar summary_2 = require(\"./summary\");\nObject.defineProperty(exports, \"markdownSummary\", { enumerable: true, get: function () { return summary_2.markdownSummary; } });\n/**\n * Path exports\n */\nvar path_utils_1 = require(\"./path-utils\");\nObject.defineProperty(exports, \"toPosixPath\", { enumerable: true, get: function () { return path_utils_1.toPosixPath; } });\nObject.defineProperty(exports, \"toWin32Path\", { enumerable: true, get: function () { return path_utils_1.toWin32Path; } });\nObject.defineProperty(exports, \"toPlatformPath\", { enumerable: true, get: function () { return path_utils_1.toPlatformPath; } });\n//# sourceMappingURL=core.js.map","\"use strict\";\n// For internal use, subject to change.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.issueCommand = void 0;\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst fs = __importStar(require(\"fs\"));\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\nfunction issueCommand(command, message) {\n const filePath = process.env[`GITHUB_${command}`];\n if (!filePath) {\n throw new Error(`Unable to find environment variable for file command ${command}`);\n }\n if (!fs.existsSync(filePath)) {\n throw new Error(`Missing file at path: ${filePath}`);\n }\n fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {\n encoding: 'utf8'\n });\n}\nexports.issueCommand = issueCommand;\n//# sourceMappingURL=file-command.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OidcClient = void 0;\nconst http_client_1 = require(\"@actions/http-client\");\nconst auth_1 = require(\"@actions/http-client/lib/auth\");\nconst core_1 = require(\"./core\");\nclass OidcClient {\n static createHttpClient(allowRetry = true, maxRetry = 10) {\n const requestOptions = {\n allowRetries: allowRetry,\n maxRetries: maxRetry\n };\n return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);\n }\n static getRequestToken() {\n const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];\n if (!token) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');\n }\n return token;\n }\n static getIDTokenUrl() {\n const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];\n if (!runtimeUrl) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');\n }\n return runtimeUrl;\n }\n static getCall(id_token_url) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const httpclient = OidcClient.createHttpClient();\n const res = yield httpclient\n .getJson(id_token_url)\n .catch(error => {\n throw new Error(`Failed to get ID Token. \\n \n Error Code : ${error.statusCode}\\n \n Error Message: ${error.result.message}`);\n });\n const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;\n if (!id_token) {\n throw new Error('Response json body do not have ID Token field');\n }\n return id_token;\n });\n }\n static getIDToken(audience) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n // New ID Token is requested from action service\n let id_token_url = OidcClient.getIDTokenUrl();\n if (audience) {\n const encodedAudience = encodeURIComponent(audience);\n id_token_url = `${id_token_url}&audience=${encodedAudience}`;\n }\n core_1.debug(`ID token url is ${id_token_url}`);\n const id_token = yield OidcClient.getCall(id_token_url);\n core_1.setSecret(id_token);\n return id_token;\n }\n catch (error) {\n throw new Error(`Error message: ${error.message}`);\n }\n });\n }\n}\nexports.OidcClient = OidcClient;\n//# sourceMappingURL=oidc-utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;\nconst path = __importStar(require(\"path\"));\n/**\n * toPosixPath converts the given path to the posix form. On Windows, \\\\ will be\n * replaced with /.\n *\n * @param pth. Path to transform.\n * @return string Posix path.\n */\nfunction toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}\nexports.toPosixPath = toPosixPath;\n/**\n * toWin32Path converts the given path to the win32 form. On Linux, / will be\n * replaced with \\\\.\n *\n * @param pth. Path to transform.\n * @return string Win32 path.\n */\nfunction toWin32Path(pth) {\n return pth.replace(/[/]/g, '\\\\');\n}\nexports.toWin32Path = toWin32Path;\n/**\n * toPlatformPath converts the given path to a platform-specific path. It does\n * this by replacing instances of / and \\ with the platform-specific path\n * separator.\n *\n * @param pth The path to platformize.\n * @return string The platform-specific path.\n */\nfunction toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}\nexports.toPlatformPath = toPlatformPath;\n//# sourceMappingURL=path-utils.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;\nconst os_1 = require(\"os\");\nconst fs_1 = require(\"fs\");\nconst { access, appendFile, writeFile } = fs_1.promises;\nexports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';\nexports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';\nclass Summary {\n constructor() {\n this._buffer = '';\n }\n /**\n * Finds the summary file path from the environment, rejects if env var is not found or file does not exist\n * Also checks r/w permissions.\n *\n * @returns step summary file path\n */\n filePath() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._filePath) {\n return this._filePath;\n }\n const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];\n if (!pathFromEnv) {\n throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);\n }\n try {\n yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);\n }\n catch (_a) {\n throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);\n }\n this._filePath = pathFromEnv;\n return this._filePath;\n });\n }\n /**\n * Wraps content in an HTML tag, adding any HTML attributes\n *\n * @param {string} tag HTML tag to wrap\n * @param {string | null} content content within the tag\n * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add\n *\n * @returns {string} content wrapped in HTML element\n */\n wrap(tag, content, attrs = {}) {\n const htmlAttrs = Object.entries(attrs)\n .map(([key, value]) => ` ${key}=\"${value}\"`)\n .join('');\n if (!content) {\n return `<${tag}${htmlAttrs}>`;\n }\n return `<${tag}${htmlAttrs}>${content}`;\n }\n /**\n * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.\n *\n * @param {SummaryWriteOptions} [options] (optional) options for write operation\n *\n * @returns {Promise} summary instance\n */\n write(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);\n const filePath = yield this.filePath();\n const writeFunc = overwrite ? writeFile : appendFile;\n yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });\n return this.emptyBuffer();\n });\n }\n /**\n * Clears the summary buffer and wipes the summary file\n *\n * @returns {Summary} summary instance\n */\n clear() {\n return __awaiter(this, void 0, void 0, function* () {\n return this.emptyBuffer().write({ overwrite: true });\n });\n }\n /**\n * Returns the current summary buffer as a string\n *\n * @returns {string} string of summary buffer\n */\n stringify() {\n return this._buffer;\n }\n /**\n * If the summary buffer is empty\n *\n * @returns {boolen} true if the buffer is empty\n */\n isEmptyBuffer() {\n return this._buffer.length === 0;\n }\n /**\n * Resets the summary buffer without writing to summary file\n *\n * @returns {Summary} summary instance\n */\n emptyBuffer() {\n this._buffer = '';\n return this;\n }\n /**\n * Adds raw text to the summary buffer\n *\n * @param {string} text content to add\n * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)\n *\n * @returns {Summary} summary instance\n */\n addRaw(text, addEOL = false) {\n this._buffer += text;\n return addEOL ? this.addEOL() : this;\n }\n /**\n * Adds the operating system-specific end-of-line marker to the buffer\n *\n * @returns {Summary} summary instance\n */\n addEOL() {\n return this.addRaw(os_1.EOL);\n }\n /**\n * Adds an HTML codeblock to the summary buffer\n *\n * @param {string} code content to render within fenced code block\n * @param {string} lang (optional) language to syntax highlight code\n *\n * @returns {Summary} summary instance\n */\n addCodeBlock(code, lang) {\n const attrs = Object.assign({}, (lang && { lang }));\n const element = this.wrap('pre', this.wrap('code', code), attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML list to the summary buffer\n *\n * @param {string[]} items list of items to render\n * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)\n *\n * @returns {Summary} summary instance\n */\n addList(items, ordered = false) {\n const tag = ordered ? 'ol' : 'ul';\n const listItems = items.map(item => this.wrap('li', item)).join('');\n const element = this.wrap(tag, listItems);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML table to the summary buffer\n *\n * @param {SummaryTableCell[]} rows table rows\n *\n * @returns {Summary} summary instance\n */\n addTable(rows) {\n const tableBody = rows\n .map(row => {\n const cells = row\n .map(cell => {\n if (typeof cell === 'string') {\n return this.wrap('td', cell);\n }\n const { header, data, colspan, rowspan } = cell;\n const tag = header ? 'th' : 'td';\n const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));\n return this.wrap(tag, data, attrs);\n })\n .join('');\n return this.wrap('tr', cells);\n })\n .join('');\n const element = this.wrap('table', tableBody);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds a collapsable HTML details element to the summary buffer\n *\n * @param {string} label text for the closed state\n * @param {string} content collapsable content\n *\n * @returns {Summary} summary instance\n */\n addDetails(label, content) {\n const element = this.wrap('details', this.wrap('summary', label) + content);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML image tag to the summary buffer\n *\n * @param {string} src path to the image you to embed\n * @param {string} alt text description of the image\n * @param {SummaryImageOptions} options (optional) addition image attributes\n *\n * @returns {Summary} summary instance\n */\n addImage(src, alt, options) {\n const { width, height } = options || {};\n const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));\n const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML section heading element\n *\n * @param {string} text heading text\n * @param {number | string} [level=1] (optional) the heading level, default: 1\n *\n * @returns {Summary} summary instance\n */\n addHeading(text, level) {\n const tag = `h${level}`;\n const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)\n ? tag\n : 'h1';\n const element = this.wrap(allowedTag, text);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML thematic break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addSeparator() {\n const element = this.wrap('hr', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML line break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addBreak() {\n const element = this.wrap('br', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML blockquote to the summary buffer\n *\n * @param {string} text quote text\n * @param {string} cite (optional) citation url\n *\n * @returns {Summary} summary instance\n */\n addQuote(text, cite) {\n const attrs = Object.assign({}, (cite && { cite }));\n const element = this.wrap('blockquote', text, attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML anchor tag to the summary buffer\n *\n * @param {string} text link text/content\n * @param {string} href hyperlink\n *\n * @returns {Summary} summary instance\n */\n addLink(text, href) {\n const element = this.wrap('a', text, { href });\n return this.addRaw(element).addEOL();\n }\n}\nconst _summary = new Summary();\n/**\n * @deprecated use `core.summary`\n */\nexports.markdownSummary = _summary;\nexports.summary = _summary;\n//# sourceMappingURL=summary.js.map","\"use strict\";\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toCommandProperties = exports.toCommandValue = void 0;\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nfunction toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}\nexports.toCommandValue = toCommandValue;\n/**\n *\n * @param annotationProperties\n * @returns The command properties to send with the actual annotation command\n * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646\n */\nfunction toCommandProperties(annotationProperties) {\n if (!Object.keys(annotationProperties).length) {\n return {};\n }\n return {\n title: annotationProperties.title,\n file: annotationProperties.file,\n line: annotationProperties.startLine,\n endLine: annotationProperties.endLine,\n col: annotationProperties.startColumn,\n endColumn: annotationProperties.endColumn\n };\n}\nexports.toCommandProperties = toCommandProperties;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;\nclass BasicCredentialHandler {\n constructor(username, password) {\n this.username = username;\n this.password = password;\n }\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.BasicCredentialHandler = BasicCredentialHandler;\nclass BearerCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Bearer ${this.token}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.BearerCredentialHandler = BearerCredentialHandler;\nclass PersonalAccessTokenCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;\n//# sourceMappingURL=auth.js.map","\"use strict\";\n/* eslint-disable @typescript-eslint/no-explicit-any */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;\nconst http = __importStar(require(\"http\"));\nconst https = __importStar(require(\"https\"));\nconst pm = __importStar(require(\"./proxy\"));\nconst tunnel = __importStar(require(\"tunnel\"));\nvar HttpCodes;\n(function (HttpCodes) {\n HttpCodes[HttpCodes[\"OK\"] = 200] = \"OK\";\n HttpCodes[HttpCodes[\"MultipleChoices\"] = 300] = \"MultipleChoices\";\n HttpCodes[HttpCodes[\"MovedPermanently\"] = 301] = \"MovedPermanently\";\n HttpCodes[HttpCodes[\"ResourceMoved\"] = 302] = \"ResourceMoved\";\n HttpCodes[HttpCodes[\"SeeOther\"] = 303] = \"SeeOther\";\n HttpCodes[HttpCodes[\"NotModified\"] = 304] = \"NotModified\";\n HttpCodes[HttpCodes[\"UseProxy\"] = 305] = \"UseProxy\";\n HttpCodes[HttpCodes[\"SwitchProxy\"] = 306] = \"SwitchProxy\";\n HttpCodes[HttpCodes[\"TemporaryRedirect\"] = 307] = \"TemporaryRedirect\";\n HttpCodes[HttpCodes[\"PermanentRedirect\"] = 308] = \"PermanentRedirect\";\n HttpCodes[HttpCodes[\"BadRequest\"] = 400] = \"BadRequest\";\n HttpCodes[HttpCodes[\"Unauthorized\"] = 401] = \"Unauthorized\";\n HttpCodes[HttpCodes[\"PaymentRequired\"] = 402] = \"PaymentRequired\";\n HttpCodes[HttpCodes[\"Forbidden\"] = 403] = \"Forbidden\";\n HttpCodes[HttpCodes[\"NotFound\"] = 404] = \"NotFound\";\n HttpCodes[HttpCodes[\"MethodNotAllowed\"] = 405] = \"MethodNotAllowed\";\n HttpCodes[HttpCodes[\"NotAcceptable\"] = 406] = \"NotAcceptable\";\n HttpCodes[HttpCodes[\"ProxyAuthenticationRequired\"] = 407] = \"ProxyAuthenticationRequired\";\n HttpCodes[HttpCodes[\"RequestTimeout\"] = 408] = \"RequestTimeout\";\n HttpCodes[HttpCodes[\"Conflict\"] = 409] = \"Conflict\";\n HttpCodes[HttpCodes[\"Gone\"] = 410] = \"Gone\";\n HttpCodes[HttpCodes[\"TooManyRequests\"] = 429] = \"TooManyRequests\";\n HttpCodes[HttpCodes[\"InternalServerError\"] = 500] = \"InternalServerError\";\n HttpCodes[HttpCodes[\"NotImplemented\"] = 501] = \"NotImplemented\";\n HttpCodes[HttpCodes[\"BadGateway\"] = 502] = \"BadGateway\";\n HttpCodes[HttpCodes[\"ServiceUnavailable\"] = 503] = \"ServiceUnavailable\";\n HttpCodes[HttpCodes[\"GatewayTimeout\"] = 504] = \"GatewayTimeout\";\n})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));\nvar Headers;\n(function (Headers) {\n Headers[\"Accept\"] = \"accept\";\n Headers[\"ContentType\"] = \"content-type\";\n})(Headers = exports.Headers || (exports.Headers = {}));\nvar MediaTypes;\n(function (MediaTypes) {\n MediaTypes[\"ApplicationJson\"] = \"application/json\";\n})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));\n/**\n * Returns the proxy URL, depending upon the supplied url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\nfunction getProxyUrl(serverUrl) {\n const proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}\nexports.getProxyUrl = getProxyUrl;\nconst HttpRedirectCodes = [\n HttpCodes.MovedPermanently,\n HttpCodes.ResourceMoved,\n HttpCodes.SeeOther,\n HttpCodes.TemporaryRedirect,\n HttpCodes.PermanentRedirect\n];\nconst HttpResponseRetryCodes = [\n HttpCodes.BadGateway,\n HttpCodes.ServiceUnavailable,\n HttpCodes.GatewayTimeout\n];\nconst RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];\nconst ExponentialBackoffCeiling = 10;\nconst ExponentialBackoffTimeSlice = 5;\nclass HttpClientError extends Error {\n constructor(message, statusCode) {\n super(message);\n this.name = 'HttpClientError';\n this.statusCode = statusCode;\n Object.setPrototypeOf(this, HttpClientError.prototype);\n }\n}\nexports.HttpClientError = HttpClientError;\nclass HttpClientResponse {\n constructor(message) {\n this.message = message;\n }\n readBody() {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n let output = Buffer.alloc(0);\n this.message.on('data', (chunk) => {\n output = Buffer.concat([output, chunk]);\n });\n this.message.on('end', () => {\n resolve(output.toString());\n });\n }));\n });\n }\n}\nexports.HttpClientResponse = HttpClientResponse;\nfunction isHttps(requestUrl) {\n const parsedUrl = new URL(requestUrl);\n return parsedUrl.protocol === 'https:';\n}\nexports.isHttps = isHttps;\nclass HttpClient {\n constructor(userAgent, handlers, requestOptions) {\n this._ignoreSslError = false;\n this._allowRedirects = true;\n this._allowRedirectDowngrade = false;\n this._maxRedirects = 50;\n this._allowRetries = false;\n this._maxRetries = 1;\n this._keepAlive = false;\n this._disposed = false;\n this.userAgent = userAgent;\n this.handlers = handlers || [];\n this.requestOptions = requestOptions;\n if (requestOptions) {\n if (requestOptions.ignoreSslError != null) {\n this._ignoreSslError = requestOptions.ignoreSslError;\n }\n this._socketTimeout = requestOptions.socketTimeout;\n if (requestOptions.allowRedirects != null) {\n this._allowRedirects = requestOptions.allowRedirects;\n }\n if (requestOptions.allowRedirectDowngrade != null) {\n this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;\n }\n if (requestOptions.maxRedirects != null) {\n this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);\n }\n if (requestOptions.keepAlive != null) {\n this._keepAlive = requestOptions.keepAlive;\n }\n if (requestOptions.allowRetries != null) {\n this._allowRetries = requestOptions.allowRetries;\n }\n if (requestOptions.maxRetries != null) {\n this._maxRetries = requestOptions.maxRetries;\n }\n }\n }\n options(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});\n });\n }\n get(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('GET', requestUrl, null, additionalHeaders || {});\n });\n }\n del(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('DELETE', requestUrl, null, additionalHeaders || {});\n });\n }\n post(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('POST', requestUrl, data, additionalHeaders || {});\n });\n }\n patch(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('PATCH', requestUrl, data, additionalHeaders || {});\n });\n }\n put(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('PUT', requestUrl, data, additionalHeaders || {});\n });\n }\n head(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('HEAD', requestUrl, null, additionalHeaders || {});\n });\n }\n sendStream(verb, requestUrl, stream, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request(verb, requestUrl, stream, additionalHeaders);\n });\n }\n /**\n * Gets a typed object from an endpoint\n * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise\n */\n getJson(requestUrl, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n const res = yield this.get(requestUrl, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n postJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.post(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n putJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.put(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n patchJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.patch(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n /**\n * Makes a raw http request.\n * All other methods such as get, post, patch, and request ultimately call this.\n * Prefer get, del, post and patch\n */\n request(verb, requestUrl, data, headers) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._disposed) {\n throw new Error('Client has already been disposed.');\n }\n const parsedUrl = new URL(requestUrl);\n let info = this._prepareRequest(verb, parsedUrl, headers);\n // Only perform retries on reads since writes may not be idempotent.\n const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)\n ? this._maxRetries + 1\n : 1;\n let numTries = 0;\n let response;\n do {\n response = yield this.requestRaw(info, data);\n // Check if it's an authentication challenge\n if (response &&\n response.message &&\n response.message.statusCode === HttpCodes.Unauthorized) {\n let authenticationHandler;\n for (const handler of this.handlers) {\n if (handler.canHandleAuthentication(response)) {\n authenticationHandler = handler;\n break;\n }\n }\n if (authenticationHandler) {\n return authenticationHandler.handleAuthentication(this, info, data);\n }\n else {\n // We have received an unauthorized response but have no handlers to handle it.\n // Let the response return to the caller.\n return response;\n }\n }\n let redirectsRemaining = this._maxRedirects;\n while (response.message.statusCode &&\n HttpRedirectCodes.includes(response.message.statusCode) &&\n this._allowRedirects &&\n redirectsRemaining > 0) {\n const redirectUrl = response.message.headers['location'];\n if (!redirectUrl) {\n // if there's no location to redirect to, we won't\n break;\n }\n const parsedRedirectUrl = new URL(redirectUrl);\n if (parsedUrl.protocol === 'https:' &&\n parsedUrl.protocol !== parsedRedirectUrl.protocol &&\n !this._allowRedirectDowngrade) {\n throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');\n }\n // we need to finish reading the response before reassigning response\n // which will leak the open socket.\n yield response.readBody();\n // strip authorization header if redirected to a different hostname\n if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {\n for (const header in headers) {\n // header names are case insensitive\n if (header.toLowerCase() === 'authorization') {\n delete headers[header];\n }\n }\n }\n // let's make the request with the new redirectUrl\n info = this._prepareRequest(verb, parsedRedirectUrl, headers);\n response = yield this.requestRaw(info, data);\n redirectsRemaining--;\n }\n if (!response.message.statusCode ||\n !HttpResponseRetryCodes.includes(response.message.statusCode)) {\n // If not a retry code, return immediately instead of retrying\n return response;\n }\n numTries += 1;\n if (numTries < maxTries) {\n yield response.readBody();\n yield this._performExponentialBackoff(numTries);\n }\n } while (numTries < maxTries);\n return response;\n });\n }\n /**\n * Needs to be called if keepAlive is set to true in request options.\n */\n dispose() {\n if (this._agent) {\n this._agent.destroy();\n }\n this._disposed = true;\n }\n /**\n * Raw request.\n * @param info\n * @param data\n */\n requestRaw(info, data) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => {\n function callbackForResult(err, res) {\n if (err) {\n reject(err);\n }\n else if (!res) {\n // If `err` is not passed, then `res` must be passed.\n reject(new Error('Unknown error'));\n }\n else {\n resolve(res);\n }\n }\n this.requestRawWithCallback(info, data, callbackForResult);\n });\n });\n }\n /**\n * Raw request with callback.\n * @param info\n * @param data\n * @param onResult\n */\n requestRawWithCallback(info, data, onResult) {\n if (typeof data === 'string') {\n if (!info.options.headers) {\n info.options.headers = {};\n }\n info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n }\n let callbackCalled = false;\n function handleResult(err, res) {\n if (!callbackCalled) {\n callbackCalled = true;\n onResult(err, res);\n }\n }\n const req = info.httpModule.request(info.options, (msg) => {\n const res = new HttpClientResponse(msg);\n handleResult(undefined, res);\n });\n let socket;\n req.on('socket', sock => {\n socket = sock;\n });\n // If we ever get disconnected, we want the socket to timeout eventually\n req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n if (socket) {\n socket.end();\n }\n handleResult(new Error(`Request timeout: ${info.options.path}`));\n });\n req.on('error', function (err) {\n // err has statusCode property\n // res should have headers\n handleResult(err);\n });\n if (data && typeof data === 'string') {\n req.write(data, 'utf8');\n }\n if (data && typeof data !== 'string') {\n data.on('close', function () {\n req.end();\n });\n data.pipe(req);\n }\n else {\n req.end();\n }\n }\n /**\n * Gets an http agent. This function is useful when you need an http agent that handles\n * routing through a proxy server - depending upon the url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\n getAgent(serverUrl) {\n const parsedUrl = new URL(serverUrl);\n return this._getAgent(parsedUrl);\n }\n _prepareRequest(method, requestUrl, headers) {\n const info = {};\n info.parsedUrl = requestUrl;\n const usingSsl = info.parsedUrl.protocol === 'https:';\n info.httpModule = usingSsl ? https : http;\n const defaultPort = usingSsl ? 443 : 80;\n info.options = {};\n info.options.host = info.parsedUrl.hostname;\n info.options.port = info.parsedUrl.port\n ? parseInt(info.parsedUrl.port)\n : defaultPort;\n info.options.path =\n (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');\n info.options.method = method;\n info.options.headers = this._mergeHeaders(headers);\n if (this.userAgent != null) {\n info.options.headers['user-agent'] = this.userAgent;\n }\n info.options.agent = this._getAgent(info.parsedUrl);\n // gives handlers an opportunity to participate\n if (this.handlers) {\n for (const handler of this.handlers) {\n handler.prepareRequest(info.options);\n }\n }\n return info;\n }\n _mergeHeaders(headers) {\n if (this.requestOptions && this.requestOptions.headers) {\n return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));\n }\n return lowercaseKeys(headers || {});\n }\n _getExistingOrDefaultHeader(additionalHeaders, header, _default) {\n let clientHeader;\n if (this.requestOptions && this.requestOptions.headers) {\n clientHeader = lowercaseKeys(this.requestOptions.headers)[header];\n }\n return additionalHeaders[header] || clientHeader || _default;\n }\n _getAgent(parsedUrl) {\n let agent;\n const proxyUrl = pm.getProxyUrl(parsedUrl);\n const useProxy = proxyUrl && proxyUrl.hostname;\n if (this._keepAlive && useProxy) {\n agent = this._proxyAgent;\n }\n if (this._keepAlive && !useProxy) {\n agent = this._agent;\n }\n // if agent is already assigned use that agent.\n if (agent) {\n return agent;\n }\n const usingSsl = parsedUrl.protocol === 'https:';\n let maxSockets = 100;\n if (this.requestOptions) {\n maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;\n }\n // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.\n if (proxyUrl && proxyUrl.hostname) {\n const agentOptions = {\n maxSockets,\n keepAlive: this._keepAlive,\n proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {\n proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`\n })), { host: proxyUrl.hostname, port: proxyUrl.port })\n };\n let tunnelAgent;\n const overHttps = proxyUrl.protocol === 'https:';\n if (usingSsl) {\n tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;\n }\n else {\n tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;\n }\n agent = tunnelAgent(agentOptions);\n this._proxyAgent = agent;\n }\n // if reusing agent across request and tunneling agent isn't assigned create a new agent\n if (this._keepAlive && !agent) {\n const options = { keepAlive: this._keepAlive, maxSockets };\n agent = usingSsl ? new https.Agent(options) : new http.Agent(options);\n this._agent = agent;\n }\n // if not using private agent and tunnel agent isn't setup then use global agent\n if (!agent) {\n agent = usingSsl ? https.globalAgent : http.globalAgent;\n }\n if (usingSsl && this._ignoreSslError) {\n // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n // we have to cast it to any and change it directly\n agent.options = Object.assign(agent.options || {}, {\n rejectUnauthorized: false\n });\n }\n return agent;\n }\n _performExponentialBackoff(retryNumber) {\n return __awaiter(this, void 0, void 0, function* () {\n retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);\n const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);\n return new Promise(resolve => setTimeout(() => resolve(), ms));\n });\n }\n _processResponse(res, options) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n const statusCode = res.message.statusCode || 0;\n const response = {\n statusCode,\n result: null,\n headers: {}\n };\n // not found leads to null obj returned\n if (statusCode === HttpCodes.NotFound) {\n resolve(response);\n }\n // get the result from the body\n function dateTimeDeserializer(key, value) {\n if (typeof value === 'string') {\n const a = new Date(value);\n if (!isNaN(a.valueOf())) {\n return a;\n }\n }\n return value;\n }\n let obj;\n let contents;\n try {\n contents = yield res.readBody();\n if (contents && contents.length > 0) {\n if (options && options.deserializeDates) {\n obj = JSON.parse(contents, dateTimeDeserializer);\n }\n else {\n obj = JSON.parse(contents);\n }\n response.result = obj;\n }\n response.headers = res.message.headers;\n }\n catch (err) {\n // Invalid resource (contents not json); leaving result obj null\n }\n // note that 3xx redirects are handled by the http layer.\n if (statusCode > 299) {\n let msg;\n // if exception/error in body, attempt to get better error\n if (obj && obj.message) {\n msg = obj.message;\n }\n else if (contents && contents.length > 0) {\n // it may be the case that the exception is in the body message as string\n msg = contents;\n }\n else {\n msg = `Failed request: (${statusCode})`;\n }\n const err = new HttpClientError(msg, statusCode);\n err.result = response.result;\n reject(err);\n }\n else {\n resolve(response);\n }\n }));\n });\n }\n}\nexports.HttpClient = HttpClient;\nconst lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.checkBypass = exports.getProxyUrl = void 0;\nfunction getProxyUrl(reqUrl) {\n const usingSsl = reqUrl.protocol === 'https:';\n if (checkBypass(reqUrl)) {\n return undefined;\n }\n const proxyVar = (() => {\n if (usingSsl) {\n return process.env['https_proxy'] || process.env['HTTPS_PROXY'];\n }\n else {\n return process.env['http_proxy'] || process.env['HTTP_PROXY'];\n }\n })();\n if (proxyVar) {\n return new URL(proxyVar);\n }\n else {\n return undefined;\n }\n}\nexports.getProxyUrl = getProxyUrl;\nfunction checkBypass(reqUrl) {\n if (!reqUrl.hostname) {\n return false;\n }\n const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';\n if (!noProxy) {\n return false;\n }\n // Determine the request port\n let reqPort;\n if (reqUrl.port) {\n reqPort = Number(reqUrl.port);\n }\n else if (reqUrl.protocol === 'http:') {\n reqPort = 80;\n }\n else if (reqUrl.protocol === 'https:') {\n reqPort = 443;\n }\n // Format the request hostname and hostname with port\n const upperReqHosts = [reqUrl.hostname.toUpperCase()];\n if (typeof reqPort === 'number') {\n upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);\n }\n // Compare request host against noproxy\n for (const upperNoProxyItem of noProxy\n .split(',')\n .map(x => x.trim().toUpperCase())\n .filter(x => x)) {\n if (upperReqHosts.some(x => x === upperNoProxyItem)) {\n return true;\n }\n }\n return false;\n}\nexports.checkBypass = checkBypass;\n//# sourceMappingURL=proxy.js.map","\"use strict\";\nfunction noop() { }\nfunction once(emitter, name) {\n const o = once.spread(emitter, name);\n const r = o.then((args) => args[0]);\n r.cancel = o.cancel;\n return r;\n}\n(function (once) {\n function spread(emitter, name) {\n let c = null;\n const p = new Promise((resolve, reject) => {\n function cancel() {\n emitter.removeListener(name, onEvent);\n emitter.removeListener('error', onError);\n p.cancel = noop;\n }\n function onEvent(...args) {\n cancel();\n resolve(args);\n }\n function onError(err) {\n cancel();\n reject(err);\n }\n c = cancel;\n emitter.on(name, onEvent);\n emitter.on('error', onError);\n });\n if (!c) {\n throw new TypeError('Could not get `cancel()` function');\n }\n p.cancel = c;\n return p;\n }\n once.spread = spread;\n})(once || (once = {}));\nmodule.exports = once;\n//# sourceMappingURL=index.js.map","\"use strict\";\n\nconst atob = require(\"./lib/atob\");\nconst btoa = require(\"./lib/btoa\");\n\nmodule.exports = {\n atob,\n btoa\n};\n","\"use strict\";\n\n/**\n * Implementation of atob() according to the HTML and Infra specs, except that\n * instead of throwing INVALID_CHARACTER_ERR we return null.\n */\nfunction atob(data) {\n // Web IDL requires DOMStrings to just be converted using ECMAScript\n // ToString, which in our case amounts to using a template literal.\n data = `${data}`;\n // \"Remove all ASCII whitespace from data.\"\n data = data.replace(/[ \\t\\n\\f\\r]/g, \"\");\n // \"If data's length divides by 4 leaving no remainder, then: if data ends\n // with one or two U+003D (=) code points, then remove them from data.\"\n if (data.length % 4 === 0) {\n data = data.replace(/==?$/, \"\");\n }\n // \"If data's length divides by 4 leaving a remainder of 1, then return\n // failure.\"\n //\n // \"If data contains a code point that is not one of\n //\n // U+002B (+)\n // U+002F (/)\n // ASCII alphanumeric\n //\n // then return failure.\"\n if (data.length % 4 === 1 || /[^+/0-9A-Za-z]/.test(data)) {\n return null;\n }\n // \"Let output be an empty byte sequence.\"\n let output = \"\";\n // \"Let buffer be an empty buffer that can have bits appended to it.\"\n //\n // We append bits via left-shift and or. accumulatedBits is used to track\n // when we've gotten to 24 bits.\n let buffer = 0;\n let accumulatedBits = 0;\n // \"Let position be a position variable for data, initially pointing at the\n // start of data.\"\n //\n // \"While position does not point past the end of data:\"\n for (let i = 0; i < data.length; i++) {\n // \"Find the code point pointed to by position in the second column of\n // Table 1: The Base 64 Alphabet of RFC 4648. Let n be the number given in\n // the first cell of the same row.\n //\n // \"Append to buffer the six bits corresponding to n, most significant bit\n // first.\"\n //\n // atobLookup() implements the table from RFC 4648.\n buffer <<= 6;\n buffer |= atobLookup(data[i]);\n accumulatedBits += 6;\n // \"If buffer has accumulated 24 bits, interpret them as three 8-bit\n // big-endian numbers. Append three bytes with values equal to those\n // numbers to output, in the same order, and then empty buffer.\"\n if (accumulatedBits === 24) {\n output += String.fromCharCode((buffer & 0xff0000) >> 16);\n output += String.fromCharCode((buffer & 0xff00) >> 8);\n output += String.fromCharCode(buffer & 0xff);\n buffer = accumulatedBits = 0;\n }\n // \"Advance position by 1.\"\n }\n // \"If buffer is not empty, it contains either 12 or 18 bits. If it contains\n // 12 bits, then discard the last four and interpret the remaining eight as\n // an 8-bit big-endian number. If it contains 18 bits, then discard the last\n // two and interpret the remaining 16 as two 8-bit big-endian numbers. Append\n // the one or two bytes with values equal to those one or two numbers to\n // output, in the same order.\"\n if (accumulatedBits === 12) {\n buffer >>= 4;\n output += String.fromCharCode(buffer);\n } else if (accumulatedBits === 18) {\n buffer >>= 2;\n output += String.fromCharCode((buffer & 0xff00) >> 8);\n output += String.fromCharCode(buffer & 0xff);\n }\n // \"Return output.\"\n return output;\n}\n/**\n * A lookup table for atob(), which converts an ASCII character to the\n * corresponding six-bit number.\n */\n\nconst keystr =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\nfunction atobLookup(chr) {\n const index = keystr.indexOf(chr);\n // Throw exception if character is not in the lookup string; should not be hit in tests\n return index < 0 ? undefined : index;\n}\n\nmodule.exports = atob;\n","\"use strict\";\n\n/**\n * btoa() as defined by the HTML and Infra specs, which mostly just references\n * RFC 4648.\n */\nfunction btoa(s) {\n let i;\n // String conversion as required by Web IDL.\n s = `${s}`;\n // \"The btoa() method must throw an \"InvalidCharacterError\" DOMException if\n // data contains any character whose code point is greater than U+00FF.\"\n for (i = 0; i < s.length; i++) {\n if (s.charCodeAt(i) > 255) {\n return null;\n }\n }\n let out = \"\";\n for (i = 0; i < s.length; i += 3) {\n const groupsOfSix = [undefined, undefined, undefined, undefined];\n groupsOfSix[0] = s.charCodeAt(i) >> 2;\n groupsOfSix[1] = (s.charCodeAt(i) & 0x03) << 4;\n if (s.length > i + 1) {\n groupsOfSix[1] |= s.charCodeAt(i + 1) >> 4;\n groupsOfSix[2] = (s.charCodeAt(i + 1) & 0x0f) << 2;\n }\n if (s.length > i + 2) {\n groupsOfSix[2] |= s.charCodeAt(i + 2) >> 6;\n groupsOfSix[3] = s.charCodeAt(i + 2) & 0x3f;\n }\n for (let j = 0; j < groupsOfSix.length; j++) {\n if (typeof groupsOfSix[j] === \"undefined\") {\n out += \"=\";\n } else {\n out += btoaLookup(groupsOfSix[j]);\n }\n }\n }\n return out;\n}\n\n/**\n * Lookup table for btoa(), which converts a six-bit number into the\n * corresponding ASCII character.\n */\nconst keystr =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\nfunction btoaLookup(index) {\n if (index >= 0 && index < 64) {\n return keystr[index];\n }\n\n // Throw INVALID_CHARACTER_ERR exception here -- won't be hit in the tests.\n return undefined;\n}\n\nmodule.exports = btoa;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nconst events_1 = require(\"events\");\nconst debug_1 = __importDefault(require(\"debug\"));\nconst promisify_1 = __importDefault(require(\"./promisify\"));\nconst debug = debug_1.default('agent-base');\nfunction isAgent(v) {\n return Boolean(v) && typeof v.addRequest === 'function';\n}\nfunction isSecureEndpoint() {\n const { stack } = new Error();\n if (typeof stack !== 'string')\n return false;\n return stack.split('\\n').some(l => l.indexOf('(https.js:') !== -1 || l.indexOf('node:https:') !== -1);\n}\nfunction createAgent(callback, opts) {\n return new createAgent.Agent(callback, opts);\n}\n(function (createAgent) {\n /**\n * Base `http.Agent` implementation.\n * No pooling/keep-alive is implemented by default.\n *\n * @param {Function} callback\n * @api public\n */\n class Agent extends events_1.EventEmitter {\n constructor(callback, _opts) {\n super();\n let opts = _opts;\n if (typeof callback === 'function') {\n this.callback = callback;\n }\n else if (callback) {\n opts = callback;\n }\n // Timeout for the socket to be returned from the callback\n this.timeout = null;\n if (opts && typeof opts.timeout === 'number') {\n this.timeout = opts.timeout;\n }\n // These aren't actually used by `agent-base`, but are required\n // for the TypeScript definition files in `@types/node` :/\n this.maxFreeSockets = 1;\n this.maxSockets = 1;\n this.maxTotalSockets = Infinity;\n this.sockets = {};\n this.freeSockets = {};\n this.requests = {};\n this.options = {};\n }\n get defaultPort() {\n if (typeof this.explicitDefaultPort === 'number') {\n return this.explicitDefaultPort;\n }\n return isSecureEndpoint() ? 443 : 80;\n }\n set defaultPort(v) {\n this.explicitDefaultPort = v;\n }\n get protocol() {\n if (typeof this.explicitProtocol === 'string') {\n return this.explicitProtocol;\n }\n return isSecureEndpoint() ? 'https:' : 'http:';\n }\n set protocol(v) {\n this.explicitProtocol = v;\n }\n callback(req, opts, fn) {\n throw new Error('\"agent-base\" has no default implementation, you must subclass and override `callback()`');\n }\n /**\n * Called by node-core's \"_http_client.js\" module when creating\n * a new HTTP request with this Agent instance.\n *\n * @api public\n */\n addRequest(req, _opts) {\n const opts = Object.assign({}, _opts);\n if (typeof opts.secureEndpoint !== 'boolean') {\n opts.secureEndpoint = isSecureEndpoint();\n }\n if (opts.host == null) {\n opts.host = 'localhost';\n }\n if (opts.port == null) {\n opts.port = opts.secureEndpoint ? 443 : 80;\n }\n if (opts.protocol == null) {\n opts.protocol = opts.secureEndpoint ? 'https:' : 'http:';\n }\n if (opts.host && opts.path) {\n // If both a `host` and `path` are specified then it's most\n // likely the result of a `url.parse()` call... we need to\n // remove the `path` portion so that `net.connect()` doesn't\n // attempt to open that as a unix socket file.\n delete opts.path;\n }\n delete opts.agent;\n delete opts.hostname;\n delete opts._defaultAgent;\n delete opts.defaultPort;\n delete opts.createConnection;\n // Hint to use \"Connection: close\"\n // XXX: non-documented `http` module API :(\n req._last = true;\n req.shouldKeepAlive = false;\n let timedOut = false;\n let timeoutId = null;\n const timeoutMs = opts.timeout || this.timeout;\n const onerror = (err) => {\n if (req._hadError)\n return;\n req.emit('error', err);\n // For Safety. Some additional errors might fire later on\n // and we need to make sure we don't double-fire the error event.\n req._hadError = true;\n };\n const ontimeout = () => {\n timeoutId = null;\n timedOut = true;\n const err = new Error(`A \"socket\" was not created for HTTP request before ${timeoutMs}ms`);\n err.code = 'ETIMEOUT';\n onerror(err);\n };\n const callbackError = (err) => {\n if (timedOut)\n return;\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n onerror(err);\n };\n const onsocket = (socket) => {\n if (timedOut)\n return;\n if (timeoutId != null) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n if (isAgent(socket)) {\n // `socket` is actually an `http.Agent` instance, so\n // relinquish responsibility for this `req` to the Agent\n // from here on\n debug('Callback returned another Agent instance %o', socket.constructor.name);\n socket.addRequest(req, opts);\n return;\n }\n if (socket) {\n socket.once('free', () => {\n this.freeSocket(socket, opts);\n });\n req.onSocket(socket);\n return;\n }\n const err = new Error(`no Duplex stream was returned to agent-base for \\`${req.method} ${req.path}\\``);\n onerror(err);\n };\n if (typeof this.callback !== 'function') {\n onerror(new Error('`callback` is not defined'));\n return;\n }\n if (!this.promisifiedCallback) {\n if (this.callback.length >= 3) {\n debug('Converting legacy callback function to promise');\n this.promisifiedCallback = promisify_1.default(this.callback);\n }\n else {\n this.promisifiedCallback = this.callback;\n }\n }\n if (typeof timeoutMs === 'number' && timeoutMs > 0) {\n timeoutId = setTimeout(ontimeout, timeoutMs);\n }\n if ('port' in opts && typeof opts.port !== 'number') {\n opts.port = Number(opts.port);\n }\n try {\n debug('Resolving socket for %o request: %o', opts.protocol, `${req.method} ${req.path}`);\n Promise.resolve(this.promisifiedCallback(req, opts)).then(onsocket, callbackError);\n }\n catch (err) {\n Promise.reject(err).catch(callbackError);\n }\n }\n freeSocket(socket, opts) {\n debug('Freeing socket %o %o', socket.constructor.name, opts);\n socket.destroy();\n }\n destroy() {\n debug('Destroying agent %o', this.constructor.name);\n }\n }\n createAgent.Agent = Agent;\n // So that `instanceof` works correctly\n createAgent.prototype = createAgent.Agent.prototype;\n})(createAgent || (createAgent = {}));\nmodule.exports = createAgent;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction promisify(fn) {\n return function (req, opts) {\n return new Promise((resolve, reject) => {\n fn.call(this, req, opts, (err, rtn) => {\n if (err) {\n reject(err);\n }\n else {\n resolve(rtn);\n }\n });\n });\n };\n}\nexports.default = promisify;\n//# sourceMappingURL=promisify.js.map","module.exports =\n{\n parallel : require('./parallel.js'),\n serial : require('./serial.js'),\n serialOrdered : require('./serialOrdered.js')\n};\n","// API\nmodule.exports = abort;\n\n/**\n * Aborts leftover active jobs\n *\n * @param {object} state - current state object\n */\nfunction abort(state)\n{\n Object.keys(state.jobs).forEach(clean.bind(state));\n\n // reset leftover jobs\n state.jobs = {};\n}\n\n/**\n * Cleans up leftover job by invoking abort function for the provided job id\n *\n * @this state\n * @param {string|number} key - job id to abort\n */\nfunction clean(key)\n{\n if (typeof this.jobs[key] == 'function')\n {\n this.jobs[key]();\n }\n}\n","var defer = require('./defer.js');\n\n// API\nmodule.exports = async;\n\n/**\n * Runs provided callback asynchronously\n * even if callback itself is not\n *\n * @param {function} callback - callback to invoke\n * @returns {function} - augmented callback\n */\nfunction async(callback)\n{\n var isAsync = false;\n\n // check if async happened\n defer(function() { isAsync = true; });\n\n return function async_callback(err, result)\n {\n if (isAsync)\n {\n callback(err, result);\n }\n else\n {\n defer(function nextTick_callback()\n {\n callback(err, result);\n });\n }\n };\n}\n","module.exports = defer;\n\n/**\n * Runs provided function on next iteration of the event loop\n *\n * @param {function} fn - function to run\n */\nfunction defer(fn)\n{\n var nextTick = typeof setImmediate == 'function'\n ? setImmediate\n : (\n typeof process == 'object' && typeof process.nextTick == 'function'\n ? process.nextTick\n : null\n );\n\n if (nextTick)\n {\n nextTick(fn);\n }\n else\n {\n setTimeout(fn, 0);\n }\n}\n","var async = require('./async.js')\n , abort = require('./abort.js')\n ;\n\n// API\nmodule.exports = iterate;\n\n/**\n * Iterates over each job object\n *\n * @param {array|object} list - array or object (named list) to iterate over\n * @param {function} iterator - iterator to run\n * @param {object} state - current job status\n * @param {function} callback - invoked when all elements processed\n */\nfunction iterate(list, iterator, state, callback)\n{\n // store current index\n var key = state['keyedList'] ? state['keyedList'][state.index] : state.index;\n\n state.jobs[key] = runJob(iterator, key, list[key], function(error, output)\n {\n // don't repeat yourself\n // skip secondary callbacks\n if (!(key in state.jobs))\n {\n return;\n }\n\n // clean up jobs\n delete state.jobs[key];\n\n if (error)\n {\n // don't process rest of the results\n // stop still active jobs\n // and reset the list\n abort(state);\n }\n else\n {\n state.results[key] = output;\n }\n\n // return salvaged results\n callback(error, state.results);\n });\n}\n\n/**\n * Runs iterator over provided job element\n *\n * @param {function} iterator - iterator to invoke\n * @param {string|number} key - key/index of the element in the list of jobs\n * @param {mixed} item - job description\n * @param {function} callback - invoked after iterator is done with the job\n * @returns {function|mixed} - job abort function or something else\n */\nfunction runJob(iterator, key, item, callback)\n{\n var aborter;\n\n // allow shortcut if iterator expects only two arguments\n if (iterator.length == 2)\n {\n aborter = iterator(item, async(callback));\n }\n // otherwise go with full three arguments\n else\n {\n aborter = iterator(item, key, async(callback));\n }\n\n return aborter;\n}\n","// API\nmodule.exports = state;\n\n/**\n * Creates initial state object\n * for iteration over list\n *\n * @param {array|object} list - list to iterate over\n * @param {function|null} sortMethod - function to use for keys sort,\n * or `null` to keep them as is\n * @returns {object} - initial state object\n */\nfunction state(list, sortMethod)\n{\n var isNamedList = !Array.isArray(list)\n , initState =\n {\n index : 0,\n keyedList: isNamedList || sortMethod ? Object.keys(list) : null,\n jobs : {},\n results : isNamedList ? {} : [],\n size : isNamedList ? Object.keys(list).length : list.length\n }\n ;\n\n if (sortMethod)\n {\n // sort array keys based on it's values\n // sort object's keys just on own merit\n initState.keyedList.sort(isNamedList ? sortMethod : function(a, b)\n {\n return sortMethod(list[a], list[b]);\n });\n }\n\n return initState;\n}\n","var abort = require('./abort.js')\n , async = require('./async.js')\n ;\n\n// API\nmodule.exports = terminator;\n\n/**\n * Terminates jobs in the attached state context\n *\n * @this AsyncKitState#\n * @param {function} callback - final callback to invoke after termination\n */\nfunction terminator(callback)\n{\n if (!Object.keys(this.jobs).length)\n {\n return;\n }\n\n // fast forward iteration index\n this.index = this.size;\n\n // abort jobs\n abort(this);\n\n // send back results we have so far\n async(callback)(null, this.results);\n}\n","var iterate = require('./lib/iterate.js')\n , initState = require('./lib/state.js')\n , terminator = require('./lib/terminator.js')\n ;\n\n// Public API\nmodule.exports = parallel;\n\n/**\n * Runs iterator over provided array elements in parallel\n *\n * @param {array|object} list - array or object (named list) to iterate over\n * @param {function} iterator - iterator to run\n * @param {function} callback - invoked when all elements processed\n * @returns {function} - jobs terminator\n */\nfunction parallel(list, iterator, callback)\n{\n var state = initState(list);\n\n while (state.index < (state['keyedList'] || list).length)\n {\n iterate(list, iterator, state, function(error, result)\n {\n if (error)\n {\n callback(error, result);\n return;\n }\n\n // looks like it's the last one\n if (Object.keys(state.jobs).length === 0)\n {\n callback(null, state.results);\n return;\n }\n });\n\n state.index++;\n }\n\n return terminator.bind(state, callback);\n}\n","var serialOrdered = require('./serialOrdered.js');\n\n// Public API\nmodule.exports = serial;\n\n/**\n * Runs iterator over provided array elements in series\n *\n * @param {array|object} list - array or object (named list) to iterate over\n * @param {function} iterator - iterator to run\n * @param {function} callback - invoked when all elements processed\n * @returns {function} - jobs terminator\n */\nfunction serial(list, iterator, callback)\n{\n return serialOrdered(list, iterator, null, callback);\n}\n","var iterate = require('./lib/iterate.js')\n , initState = require('./lib/state.js')\n , terminator = require('./lib/terminator.js')\n ;\n\n// Public API\nmodule.exports = serialOrdered;\n// sorting helpers\nmodule.exports.ascending = ascending;\nmodule.exports.descending = descending;\n\n/**\n * Runs iterator over provided sorted array elements in series\n *\n * @param {array|object} list - array or object (named list) to iterate over\n * @param {function} iterator - iterator to run\n * @param {function} sortMethod - custom sort function\n * @param {function} callback - invoked when all elements processed\n * @returns {function} - jobs terminator\n */\nfunction serialOrdered(list, iterator, sortMethod, callback)\n{\n var state = initState(list, sortMethod);\n\n iterate(list, iterator, state, function iteratorHandler(error, result)\n {\n if (error)\n {\n callback(error, result);\n return;\n }\n\n state.index++;\n\n // are we there yet?\n if (state.index < (state['keyedList'] || list).length)\n {\n iterate(list, iterator, state, iteratorHandler);\n return;\n }\n\n // done here\n callback(null, state.results);\n });\n\n return terminator.bind(state, callback);\n}\n\n/*\n * -- Sort methods\n */\n\n/**\n * sort helper to sort array elements in ascending order\n *\n * @param {mixed} a - an item to compare\n * @param {mixed} b - an item to compare\n * @returns {number} - comparison result\n */\nfunction ascending(a, b)\n{\n return a < b ? -1 : a > b ? 1 : 0;\n}\n\n/**\n * sort helper to sort array elements in descending order\n *\n * @param {mixed} a - an item to compare\n * @param {mixed} b - an item to compare\n * @returns {number} - comparison result\n */\nfunction descending(a, b)\n{\n return -1 * ascending(a, b);\n}\n","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar buildFullPath = require('../core/buildFullPath');\nvar buildURL = require('./../helpers/buildURL');\nvar http = require('http');\nvar https = require('https');\nvar httpFollow = require('follow-redirects').http;\nvar httpsFollow = require('follow-redirects').https;\nvar url = require('url');\nvar zlib = require('zlib');\nvar pkg = require('./../../package.json');\nvar createError = require('../core/createError');\nvar enhanceError = require('../core/enhanceError');\n\nvar isHttps = /https:?/;\n\n/**\n *\n * @param {http.ClientRequestArgs} options\n * @param {AxiosProxyConfig} proxy\n * @param {string} location\n */\nfunction setProxy(options, proxy, location) {\n options.hostname = proxy.host;\n options.host = proxy.host;\n options.port = proxy.port;\n options.path = location;\n\n // Basic proxy authorization\n if (proxy.auth) {\n var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64');\n options.headers['Proxy-Authorization'] = 'Basic ' + base64;\n }\n\n // If a proxy is used, any redirects must also pass through the proxy\n options.beforeRedirect = function beforeRedirect(redirection) {\n redirection.headers.host = redirection.host;\n setProxy(redirection, proxy, redirection.href);\n };\n}\n\n/*eslint consistent-return:0*/\nmodule.exports = function httpAdapter(config) {\n return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) {\n var resolve = function resolve(value) {\n resolvePromise(value);\n };\n var reject = function reject(value) {\n rejectPromise(value);\n };\n var data = config.data;\n var headers = config.headers;\n\n // Set User-Agent (required by some servers)\n // See https://github.com/axios/axios/issues/69\n if ('User-Agent' in headers || 'user-agent' in headers) {\n // User-Agent is specified; handle case where no UA header is desired\n if (!headers['User-Agent'] && !headers['user-agent']) {\n delete headers['User-Agent'];\n delete headers['user-agent'];\n }\n // Otherwise, use specified value\n } else {\n // Only set header if it hasn't been set in config\n headers['User-Agent'] = 'axios/' + pkg.version;\n }\n\n if (data && !utils.isStream(data)) {\n if (Buffer.isBuffer(data)) {\n // Nothing to do...\n } else if (utils.isArrayBuffer(data)) {\n data = Buffer.from(new Uint8Array(data));\n } else if (utils.isString(data)) {\n data = Buffer.from(data, 'utf-8');\n } else {\n return reject(createError(\n 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',\n config\n ));\n }\n\n // Add Content-Length header if data exists\n headers['Content-Length'] = data.length;\n }\n\n // HTTP basic authentication\n var auth = undefined;\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n auth = username + ':' + password;\n }\n\n // Parse url\n var fullPath = buildFullPath(config.baseURL, config.url);\n var parsed = url.parse(fullPath);\n var protocol = parsed.protocol || 'http:';\n\n if (!auth && parsed.auth) {\n var urlAuth = parsed.auth.split(':');\n var urlUsername = urlAuth[0] || '';\n var urlPassword = urlAuth[1] || '';\n auth = urlUsername + ':' + urlPassword;\n }\n\n if (auth) {\n delete headers.Authorization;\n }\n\n var isHttpsRequest = isHttps.test(protocol);\n var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;\n\n var options = {\n path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\\?/, ''),\n method: config.method.toUpperCase(),\n headers: headers,\n agent: agent,\n agents: { http: config.httpAgent, https: config.httpsAgent },\n auth: auth\n };\n\n if (config.socketPath) {\n options.socketPath = config.socketPath;\n } else {\n options.hostname = parsed.hostname;\n options.port = parsed.port;\n }\n\n var proxy = config.proxy;\n if (!proxy && proxy !== false) {\n var proxyEnv = protocol.slice(0, -1) + '_proxy';\n var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()];\n if (proxyUrl) {\n var parsedProxyUrl = url.parse(proxyUrl);\n var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY;\n var shouldProxy = true;\n\n if (noProxyEnv) {\n var noProxy = noProxyEnv.split(',').map(function trim(s) {\n return s.trim();\n });\n\n shouldProxy = !noProxy.some(function proxyMatch(proxyElement) {\n if (!proxyElement) {\n return false;\n }\n if (proxyElement === '*') {\n return true;\n }\n if (proxyElement[0] === '.' &&\n parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) {\n return true;\n }\n\n return parsed.hostname === proxyElement;\n });\n }\n\n if (shouldProxy) {\n proxy = {\n host: parsedProxyUrl.hostname,\n port: parsedProxyUrl.port,\n protocol: parsedProxyUrl.protocol\n };\n\n if (parsedProxyUrl.auth) {\n var proxyUrlAuth = parsedProxyUrl.auth.split(':');\n proxy.auth = {\n username: proxyUrlAuth[0],\n password: proxyUrlAuth[1]\n };\n }\n }\n }\n }\n\n if (proxy) {\n options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : '');\n setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);\n }\n\n var transport;\n var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true);\n if (config.transport) {\n transport = config.transport;\n } else if (config.maxRedirects === 0) {\n transport = isHttpsProxy ? https : http;\n } else {\n if (config.maxRedirects) {\n options.maxRedirects = config.maxRedirects;\n }\n transport = isHttpsProxy ? httpsFollow : httpFollow;\n }\n\n if (config.maxBodyLength > -1) {\n options.maxBodyLength = config.maxBodyLength;\n }\n\n // Create the request\n var req = transport.request(options, function handleResponse(res) {\n if (req.aborted) return;\n\n // uncompress the response body transparently if required\n var stream = res;\n\n // return the last request in case of redirects\n var lastRequest = res.req || req;\n\n\n // if no content, is HEAD request or decompress disabled we should not decompress\n if (res.statusCode !== 204 && lastRequest.method !== 'HEAD' && config.decompress !== false) {\n switch (res.headers['content-encoding']) {\n /*eslint default-case:0*/\n case 'gzip':\n case 'compress':\n case 'deflate':\n // add the unzipper to the body stream processing pipeline\n stream = stream.pipe(zlib.createUnzip());\n\n // remove the content-encoding in order to not confuse downstream operations\n delete res.headers['content-encoding'];\n break;\n }\n }\n\n var response = {\n status: res.statusCode,\n statusText: res.statusMessage,\n headers: res.headers,\n config: config,\n request: lastRequest\n };\n\n if (config.responseType === 'stream') {\n response.data = stream;\n settle(resolve, reject, response);\n } else {\n var responseBuffer = [];\n var totalResponseBytes = 0;\n stream.on('data', function handleStreamData(chunk) {\n responseBuffer.push(chunk);\n totalResponseBytes += chunk.length;\n\n // make sure the content length is not over the maxContentLength if specified\n if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {\n stream.destroy();\n reject(createError('maxContentLength size of ' + config.maxContentLength + ' exceeded',\n config, null, lastRequest));\n }\n });\n\n stream.on('error', function handleStreamError(err) {\n if (req.aborted) return;\n reject(enhanceError(err, config, null, lastRequest));\n });\n\n stream.on('end', function handleStreamEnd() {\n var responseData = Buffer.concat(responseBuffer);\n if (config.responseType !== 'arraybuffer') {\n responseData = responseData.toString(config.responseEncoding);\n if (!config.responseEncoding || config.responseEncoding === 'utf8') {\n responseData = utils.stripBOM(responseData);\n }\n }\n\n response.data = responseData;\n settle(resolve, reject, response);\n });\n }\n });\n\n // Handle errors\n req.on('error', function handleRequestError(err) {\n if (req.aborted && err.code !== 'ERR_FR_TOO_MANY_REDIRECTS') return;\n reject(enhanceError(err, config, null, req));\n });\n\n // Handle request timeout\n if (config.timeout) {\n // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.\n var timeout = parseInt(config.timeout, 10);\n\n if (isNaN(timeout)) {\n reject(createError(\n 'error trying to parse `config.timeout` to int',\n config,\n 'ERR_PARSE_TIMEOUT',\n req\n ));\n\n return;\n }\n\n // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.\n // And timer callback will be fired, and abort() will be invoked before connection, then get \"socket hang up\" and code ECONNRESET.\n // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.\n // And then these socket which be hang up will devoring CPU little by little.\n // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.\n req.setTimeout(timeout, function handleRequestTimeout() {\n req.abort();\n reject(createError(\n 'timeout of ' + timeout + 'ms exceeded',\n config,\n config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n req\n ));\n });\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (req.aborted) return;\n\n req.abort();\n reject(cancel);\n });\n }\n\n // Send the request\n if (utils.isStream(data)) {\n data.on('error', function handleStreamError(err) {\n reject(enhanceError(err, config, null, req));\n }).pipe(req);\n } else {\n req.end(data);\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('./../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\nvar enhanceError = require('./core/enhanceError');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar pkg = require('./../../package.json');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\nvar currentVerArr = pkg.version.split('.');\n\n/**\n * Compare package versions\n * @param {string} version\n * @param {string?} thanVersion\n * @returns {boolean}\n */\nfunction isOlderVersion(version, thanVersion) {\n var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr;\n var destVer = version.split('.');\n for (var i = 0; i < 3; i++) {\n if (pkgVersionArr[i] > destVer[i]) {\n return true;\n } else if (pkgVersionArr[i] < destVer[i]) {\n return false;\n }\n }\n return false;\n}\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator\n * @param {string?} version\n * @param {string} message\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n var isDeprecated = version && isOlderVersion(version);\n\n function formatMessage(opt, desc) {\n return '[Axios v' + pkg.version + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed in ' + version));\n }\n\n if (isDeprecated && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n isOlderVersion: isOlderVersion,\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n","module.exports = process.hrtime || hrtime\n\n// polyfil for window.performance.now\nvar performance = global.performance || {}\nvar performanceNow =\n performance.now ||\n performance.mozNow ||\n performance.msNow ||\n performance.oNow ||\n performance.webkitNow ||\n function(){ return (new Date()).getTime() }\n\n// generate timestamp or delta\n// see http://nodejs.org/api/process.html#process_process_hrtime\nfunction hrtime(previousTimestamp){\n var clocktime = performanceNow.call(performance)*1e-3\n var seconds = Math.floor(clocktime)\n var nanoseconds = Math.floor((clocktime%1)*1e9)\n if (previousTimestamp) {\n seconds = seconds - previousTimestamp[0]\n nanoseconds = nanoseconds - previousTimestamp[1]\n if (nanoseconds<0) {\n seconds--\n nanoseconds += 1e9\n }\n }\n return [seconds,nanoseconds]\n}","var util = require('util');\nvar Stream = require('stream').Stream;\nvar DelayedStream = require('delayed-stream');\n\nmodule.exports = CombinedStream;\nfunction CombinedStream() {\n this.writable = false;\n this.readable = true;\n this.dataSize = 0;\n this.maxDataSize = 2 * 1024 * 1024;\n this.pauseStreams = true;\n\n this._released = false;\n this._streams = [];\n this._currentStream = null;\n this._insideLoop = false;\n this._pendingNext = false;\n}\nutil.inherits(CombinedStream, Stream);\n\nCombinedStream.create = function(options) {\n var combinedStream = new this();\n\n options = options || {};\n for (var option in options) {\n combinedStream[option] = options[option];\n }\n\n return combinedStream;\n};\n\nCombinedStream.isStreamLike = function(stream) {\n return (typeof stream !== 'function')\n && (typeof stream !== 'string')\n && (typeof stream !== 'boolean')\n && (typeof stream !== 'number')\n && (!Buffer.isBuffer(stream));\n};\n\nCombinedStream.prototype.append = function(stream) {\n var isStreamLike = CombinedStream.isStreamLike(stream);\n\n if (isStreamLike) {\n if (!(stream instanceof DelayedStream)) {\n var newStream = DelayedStream.create(stream, {\n maxDataSize: Infinity,\n pauseStream: this.pauseStreams,\n });\n stream.on('data', this._checkDataSize.bind(this));\n stream = newStream;\n }\n\n this._handleErrors(stream);\n\n if (this.pauseStreams) {\n stream.pause();\n }\n }\n\n this._streams.push(stream);\n return this;\n};\n\nCombinedStream.prototype.pipe = function(dest, options) {\n Stream.prototype.pipe.call(this, dest, options);\n this.resume();\n return dest;\n};\n\nCombinedStream.prototype._getNext = function() {\n this._currentStream = null;\n\n if (this._insideLoop) {\n this._pendingNext = true;\n return; // defer call\n }\n\n this._insideLoop = true;\n try {\n do {\n this._pendingNext = false;\n this._realGetNext();\n } while (this._pendingNext);\n } finally {\n this._insideLoop = false;\n }\n};\n\nCombinedStream.prototype._realGetNext = function() {\n var stream = this._streams.shift();\n\n\n if (typeof stream == 'undefined') {\n this.end();\n return;\n }\n\n if (typeof stream !== 'function') {\n this._pipeNext(stream);\n return;\n }\n\n var getStream = stream;\n getStream(function(stream) {\n var isStreamLike = CombinedStream.isStreamLike(stream);\n if (isStreamLike) {\n stream.on('data', this._checkDataSize.bind(this));\n this._handleErrors(stream);\n }\n\n this._pipeNext(stream);\n }.bind(this));\n};\n\nCombinedStream.prototype._pipeNext = function(stream) {\n this._currentStream = stream;\n\n var isStreamLike = CombinedStream.isStreamLike(stream);\n if (isStreamLike) {\n stream.on('end', this._getNext.bind(this));\n stream.pipe(this, {end: false});\n return;\n }\n\n var value = stream;\n this.write(value);\n this._getNext();\n};\n\nCombinedStream.prototype._handleErrors = function(stream) {\n var self = this;\n stream.on('error', function(err) {\n self._emitError(err);\n });\n};\n\nCombinedStream.prototype.write = function(data) {\n this.emit('data', data);\n};\n\nCombinedStream.prototype.pause = function() {\n if (!this.pauseStreams) {\n return;\n }\n\n if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause();\n this.emit('pause');\n};\n\nCombinedStream.prototype.resume = function() {\n if (!this._released) {\n this._released = true;\n this.writable = true;\n this._getNext();\n }\n\n if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume();\n this.emit('resume');\n};\n\nCombinedStream.prototype.end = function() {\n this._reset();\n this.emit('end');\n};\n\nCombinedStream.prototype.destroy = function() {\n this._reset();\n this.emit('close');\n};\n\nCombinedStream.prototype._reset = function() {\n this.writable = false;\n this._streams = [];\n this._currentStream = null;\n};\n\nCombinedStream.prototype._checkDataSize = function() {\n this._updateDataSize();\n if (this.dataSize <= this.maxDataSize) {\n return;\n }\n\n var message =\n 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.';\n this._emitError(new Error(message));\n};\n\nCombinedStream.prototype._updateDataSize = function() {\n this.dataSize = 0;\n\n var self = this;\n this._streams.forEach(function(stream) {\n if (!stream.dataSize) {\n return;\n }\n\n self.dataSize += stream.dataSize;\n });\n\n if (this._currentStream && this._currentStream.dataSize) {\n this.dataSize += this._currentStream.dataSize;\n }\n};\n\nCombinedStream.prototype._emitError = function(err) {\n this._reset();\n this.emit('error', err);\n};\n","//.CommonJS\nvar CSSOM = {\n CSSRule: require(\"./CSSRule\").CSSRule,\n MatcherList: require(\"./MatcherList\").MatcherList\n};\n///CommonJS\n\n\n/**\n * @constructor\n * @see https://developer.mozilla.org/en/CSS/@-moz-document\n */\nCSSOM.CSSDocumentRule = function CSSDocumentRule() {\n CSSOM.CSSRule.call(this);\n this.matcher = new CSSOM.MatcherList();\n this.cssRules = [];\n};\n\nCSSOM.CSSDocumentRule.prototype = new CSSOM.CSSRule();\nCSSOM.CSSDocumentRule.prototype.constructor = CSSOM.CSSDocumentRule;\nCSSOM.CSSDocumentRule.prototype.type = 10;\n//FIXME\n//CSSOM.CSSDocumentRule.prototype.insertRule = CSSStyleSheet.prototype.insertRule;\n//CSSOM.CSSDocumentRule.prototype.deleteRule = CSSStyleSheet.prototype.deleteRule;\n\nObject.defineProperty(CSSOM.CSSDocumentRule.prototype, \"cssText\", {\n get: function() {\n var cssTexts = [];\n for (var i=0, length=this.cssRules.length; i < length; i++) {\n cssTexts.push(this.cssRules[i].cssText);\n }\n return \"@-moz-document \" + this.matcher.matcherText + \" {\" + cssTexts.join(\"\") + \"}\";\n }\n});\n\n\n//.CommonJS\nexports.CSSDocumentRule = CSSOM.CSSDocumentRule;\n///CommonJS\n","//.CommonJS\nvar CSSOM = {\n\tCSSStyleDeclaration: require(\"./CSSStyleDeclaration\").CSSStyleDeclaration,\n\tCSSRule: require(\"./CSSRule\").CSSRule\n};\n///CommonJS\n\n\n/**\n * @constructor\n * @see http://dev.w3.org/csswg/cssom/#css-font-face-rule\n */\nCSSOM.CSSFontFaceRule = function CSSFontFaceRule() {\n\tCSSOM.CSSRule.call(this);\n\tthis.style = new CSSOM.CSSStyleDeclaration();\n\tthis.style.parentRule = this;\n};\n\nCSSOM.CSSFontFaceRule.prototype = new CSSOM.CSSRule();\nCSSOM.CSSFontFaceRule.prototype.constructor = CSSOM.CSSFontFaceRule;\nCSSOM.CSSFontFaceRule.prototype.type = 5;\n//FIXME\n//CSSOM.CSSFontFaceRule.prototype.insertRule = CSSStyleSheet.prototype.insertRule;\n//CSSOM.CSSFontFaceRule.prototype.deleteRule = CSSStyleSheet.prototype.deleteRule;\n\n// http://www.opensource.apple.com/source/WebCore/WebCore-955.66.1/css/WebKitCSSFontFaceRule.cpp\nObject.defineProperty(CSSOM.CSSFontFaceRule.prototype, \"cssText\", {\n get: function() {\n return \"@font-face {\" + this.style.cssText + \"}\";\n }\n});\n\n\n//.CommonJS\nexports.CSSFontFaceRule = CSSOM.CSSFontFaceRule;\n///CommonJS\n","//.CommonJS\nvar CSSOM = {\n\tCSSRule: require(\"./CSSRule\").CSSRule\n};\n///CommonJS\n\n\n/**\n * @constructor\n * @see http://www.w3.org/TR/shadow-dom/#host-at-rule\n */\nCSSOM.CSSHostRule = function CSSHostRule() {\n\tCSSOM.CSSRule.call(this);\n\tthis.cssRules = [];\n};\n\nCSSOM.CSSHostRule.prototype = new CSSOM.CSSRule();\nCSSOM.CSSHostRule.prototype.constructor = CSSOM.CSSHostRule;\nCSSOM.CSSHostRule.prototype.type = 1001;\n//FIXME\n//CSSOM.CSSHostRule.prototype.insertRule = CSSStyleSheet.prototype.insertRule;\n//CSSOM.CSSHostRule.prototype.deleteRule = CSSStyleSheet.prototype.deleteRule;\n\nObject.defineProperty(CSSOM.CSSHostRule.prototype, \"cssText\", {\n\tget: function() {\n\t\tvar cssTexts = [];\n\t\tfor (var i=0, length=this.cssRules.length; i < length; i++) {\n\t\t\tcssTexts.push(this.cssRules[i].cssText);\n\t\t}\n\t\treturn \"@host {\" + cssTexts.join(\"\") + \"}\";\n\t}\n});\n\n\n//.CommonJS\nexports.CSSHostRule = CSSOM.CSSHostRule;\n///CommonJS\n","//.CommonJS\nvar CSSOM = {\n\tCSSRule: require(\"./CSSRule\").CSSRule,\n\tCSSStyleSheet: require(\"./CSSStyleSheet\").CSSStyleSheet,\n\tMediaList: require(\"./MediaList\").MediaList\n};\n///CommonJS\n\n\n/**\n * @constructor\n * @see http://dev.w3.org/csswg/cssom/#cssimportrule\n * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSImportRule\n */\nCSSOM.CSSImportRule = function CSSImportRule() {\n\tCSSOM.CSSRule.call(this);\n\tthis.href = \"\";\n\tthis.media = new CSSOM.MediaList();\n\tthis.styleSheet = new CSSOM.CSSStyleSheet();\n};\n\nCSSOM.CSSImportRule.prototype = new CSSOM.CSSRule();\nCSSOM.CSSImportRule.prototype.constructor = CSSOM.CSSImportRule;\nCSSOM.CSSImportRule.prototype.type = 3;\n\nObject.defineProperty(CSSOM.CSSImportRule.prototype, \"cssText\", {\n get: function() {\n var mediaText = this.media.mediaText;\n return \"@import url(\" + this.href + \")\" + (mediaText ? \" \" + mediaText : \"\") + \";\";\n },\n set: function(cssText) {\n var i = 0;\n\n /**\n * @import url(partial.css) screen, handheld;\n * || |\n * after-import media\n * |\n * url\n */\n var state = '';\n\n var buffer = '';\n var index;\n for (var character; (character = cssText.charAt(i)); i++) {\n\n switch (character) {\n case ' ':\n case '\\t':\n case '\\r':\n case '\\n':\n case '\\f':\n if (state === 'after-import') {\n state = 'url';\n } else {\n buffer += character;\n }\n break;\n\n case '@':\n if (!state && cssText.indexOf('@import', i) === i) {\n state = 'after-import';\n i += 'import'.length;\n buffer = '';\n }\n break;\n\n case 'u':\n if (state === 'url' && cssText.indexOf('url(', i) === i) {\n index = cssText.indexOf(')', i + 1);\n if (index === -1) {\n throw i + ': \")\" not found';\n }\n i += 'url('.length;\n var url = cssText.slice(i, index);\n if (url[0] === url[url.length - 1]) {\n if (url[0] === '\"' || url[0] === \"'\") {\n url = url.slice(1, -1);\n }\n }\n this.href = url;\n i = index;\n state = 'media';\n }\n break;\n\n case '\"':\n if (state === 'url') {\n index = cssText.indexOf('\"', i + 1);\n if (!index) {\n throw i + \": '\\\"' not found\";\n }\n this.href = cssText.slice(i + 1, index);\n i = index;\n state = 'media';\n }\n break;\n\n case \"'\":\n if (state === 'url') {\n index = cssText.indexOf(\"'\", i + 1);\n if (!index) {\n throw i + ': \"\\'\" not found';\n }\n this.href = cssText.slice(i + 1, index);\n i = index;\n state = 'media';\n }\n break;\n\n case ';':\n if (state === 'media') {\n if (buffer) {\n this.media.mediaText = buffer.trim();\n }\n }\n break;\n\n default:\n if (state === 'media') {\n buffer += character;\n }\n break;\n }\n }\n }\n});\n\n\n//.CommonJS\nexports.CSSImportRule = CSSOM.CSSImportRule;\n///CommonJS\n","//.CommonJS\nvar CSSOM = {\n\tCSSRule: require(\"./CSSRule\").CSSRule,\n\tCSSStyleDeclaration: require('./CSSStyleDeclaration').CSSStyleDeclaration\n};\n///CommonJS\n\n\n/**\n * @constructor\n * @see http://www.w3.org/TR/css3-animations/#DOM-CSSKeyframeRule\n */\nCSSOM.CSSKeyframeRule = function CSSKeyframeRule() {\n\tCSSOM.CSSRule.call(this);\n\tthis.keyText = '';\n\tthis.style = new CSSOM.CSSStyleDeclaration();\n\tthis.style.parentRule = this;\n};\n\nCSSOM.CSSKeyframeRule.prototype = new CSSOM.CSSRule();\nCSSOM.CSSKeyframeRule.prototype.constructor = CSSOM.CSSKeyframeRule;\nCSSOM.CSSKeyframeRule.prototype.type = 8;\n//FIXME\n//CSSOM.CSSKeyframeRule.prototype.insertRule = CSSStyleSheet.prototype.insertRule;\n//CSSOM.CSSKeyframeRule.prototype.deleteRule = CSSStyleSheet.prototype.deleteRule;\n\n// http://www.opensource.apple.com/source/WebCore/WebCore-955.66.1/css/WebKitCSSKeyframeRule.cpp\nObject.defineProperty(CSSOM.CSSKeyframeRule.prototype, \"cssText\", {\n get: function() {\n return this.keyText + \" {\" + this.style.cssText + \"} \";\n }\n});\n\n\n//.CommonJS\nexports.CSSKeyframeRule = CSSOM.CSSKeyframeRule;\n///CommonJS\n","//.CommonJS\nvar CSSOM = {\n\tCSSRule: require(\"./CSSRule\").CSSRule\n};\n///CommonJS\n\n\n/**\n * @constructor\n * @see http://www.w3.org/TR/css3-animations/#DOM-CSSKeyframesRule\n */\nCSSOM.CSSKeyframesRule = function CSSKeyframesRule() {\n\tCSSOM.CSSRule.call(this);\n\tthis.name = '';\n\tthis.cssRules = [];\n};\n\nCSSOM.CSSKeyframesRule.prototype = new CSSOM.CSSRule();\nCSSOM.CSSKeyframesRule.prototype.constructor = CSSOM.CSSKeyframesRule;\nCSSOM.CSSKeyframesRule.prototype.type = 7;\n//FIXME\n//CSSOM.CSSKeyframesRule.prototype.insertRule = CSSStyleSheet.prototype.insertRule;\n//CSSOM.CSSKeyframesRule.prototype.deleteRule = CSSStyleSheet.prototype.deleteRule;\n\n// http://www.opensource.apple.com/source/WebCore/WebCore-955.66.1/css/WebKitCSSKeyframesRule.cpp\nObject.defineProperty(CSSOM.CSSKeyframesRule.prototype, \"cssText\", {\n get: function() {\n var cssTexts = [];\n for (var i=0, length=this.cssRules.length; i < length; i++) {\n cssTexts.push(\" \" + this.cssRules[i].cssText);\n }\n return \"@\" + (this._vendorPrefix || '') + \"keyframes \" + this.name + \" { \\n\" + cssTexts.join(\"\\n\") + \"\\n}\";\n }\n});\n\n\n//.CommonJS\nexports.CSSKeyframesRule = CSSOM.CSSKeyframesRule;\n///CommonJS\n","//.CommonJS\nvar CSSOM = {\n\tCSSRule: require(\"./CSSRule\").CSSRule,\n\tMediaList: require(\"./MediaList\").MediaList\n};\n///CommonJS\n\n\n/**\n * @constructor\n * @see http://dev.w3.org/csswg/cssom/#cssmediarule\n * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSMediaRule\n */\nCSSOM.CSSMediaRule = function CSSMediaRule() {\n\tCSSOM.CSSRule.call(this);\n\tthis.media = new CSSOM.MediaList();\n\tthis.cssRules = [];\n};\n\nCSSOM.CSSMediaRule.prototype = new CSSOM.CSSRule();\nCSSOM.CSSMediaRule.prototype.constructor = CSSOM.CSSMediaRule;\nCSSOM.CSSMediaRule.prototype.type = 4;\n//FIXME\n//CSSOM.CSSMediaRule.prototype.insertRule = CSSStyleSheet.prototype.insertRule;\n//CSSOM.CSSMediaRule.prototype.deleteRule = CSSStyleSheet.prototype.deleteRule;\n\n// http://opensource.apple.com/source/WebCore/WebCore-658.28/css/CSSMediaRule.cpp\nObject.defineProperty(CSSOM.CSSMediaRule.prototype, \"cssText\", {\n get: function() {\n var cssTexts = [];\n for (var i=0, length=this.cssRules.length; i < length; i++) {\n cssTexts.push(this.cssRules[i].cssText);\n }\n return \"@media \" + this.media.mediaText + \" {\" + cssTexts.join(\"\") + \"}\";\n }\n});\n\n\n//.CommonJS\nexports.CSSMediaRule = CSSOM.CSSMediaRule;\n///CommonJS\n","//.CommonJS\nvar CSSOM = {};\n///CommonJS\n\n\n/**\n * @constructor\n * @see http://dev.w3.org/csswg/cssom/#the-cssrule-interface\n * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule\n */\nCSSOM.CSSRule = function CSSRule() {\n\tthis.parentRule = null;\n\tthis.parentStyleSheet = null;\n};\n\nCSSOM.CSSRule.UNKNOWN_RULE = 0; // obsolete\nCSSOM.CSSRule.STYLE_RULE = 1;\nCSSOM.CSSRule.CHARSET_RULE = 2; // obsolete\nCSSOM.CSSRule.IMPORT_RULE = 3;\nCSSOM.CSSRule.MEDIA_RULE = 4;\nCSSOM.CSSRule.FONT_FACE_RULE = 5;\nCSSOM.CSSRule.PAGE_RULE = 6;\nCSSOM.CSSRule.KEYFRAMES_RULE = 7;\nCSSOM.CSSRule.KEYFRAME_RULE = 8;\nCSSOM.CSSRule.MARGIN_RULE = 9;\nCSSOM.CSSRule.NAMESPACE_RULE = 10;\nCSSOM.CSSRule.COUNTER_STYLE_RULE = 11;\nCSSOM.CSSRule.SUPPORTS_RULE = 12;\nCSSOM.CSSRule.DOCUMENT_RULE = 13;\nCSSOM.CSSRule.FONT_FEATURE_VALUES_RULE = 14;\nCSSOM.CSSRule.VIEWPORT_RULE = 15;\nCSSOM.CSSRule.REGION_STYLE_RULE = 16;\n\n\nCSSOM.CSSRule.prototype = {\n\tconstructor: CSSOM.CSSRule\n\t//FIXME\n};\n\n\n//.CommonJS\nexports.CSSRule = CSSOM.CSSRule;\n///CommonJS\n","//.CommonJS\nvar CSSOM = {};\n///CommonJS\n\n\n/**\n * @constructor\n * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration\n */\nCSSOM.CSSStyleDeclaration = function CSSStyleDeclaration(){\n\tthis.length = 0;\n\tthis.parentRule = null;\n\n\t// NON-STANDARD\n\tthis._importants = {};\n};\n\n\nCSSOM.CSSStyleDeclaration.prototype = {\n\n\tconstructor: CSSOM.CSSStyleDeclaration,\n\n\t/**\n\t *\n\t * @param {string} name\n\t * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-getPropertyValue\n\t * @return {string} the value of the property if it has been explicitly set for this declaration block.\n\t * Returns the empty string if the property has not been set.\n\t */\n\tgetPropertyValue: function(name) {\n\t\treturn this[name] || \"\";\n\t},\n\n\t/**\n\t *\n\t * @param {string} name\n\t * @param {string} value\n\t * @param {string} [priority=null] \"important\" or null\n\t * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-setProperty\n\t */\n\tsetProperty: function(name, value, priority) {\n\t\tif (this[name]) {\n\t\t\t// Property already exist. Overwrite it.\n\t\t\tvar index = Array.prototype.indexOf.call(this, name);\n\t\t\tif (index < 0) {\n\t\t\t\tthis[this.length] = name;\n\t\t\t\tthis.length++;\n\t\t\t}\n\t\t} else {\n\t\t\t// New property.\n\t\t\tthis[this.length] = name;\n\t\t\tthis.length++;\n\t\t}\n\t\tthis[name] = value + \"\";\n\t\tthis._importants[name] = priority;\n\t},\n\n\t/**\n\t *\n\t * @param {string} name\n\t * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-removeProperty\n\t * @return {string} the value of the property if it has been explicitly set for this declaration block.\n\t * Returns the empty string if the property has not been set or the property name does not correspond to a known CSS property.\n\t */\n\tremoveProperty: function(name) {\n\t\tif (!(name in this)) {\n\t\t\treturn \"\";\n\t\t}\n\t\tvar index = Array.prototype.indexOf.call(this, name);\n\t\tif (index < 0) {\n\t\t\treturn \"\";\n\t\t}\n\t\tvar prevValue = this[name];\n\t\tthis[name] = \"\";\n\n\t\t// That's what WebKit and Opera do\n\t\tArray.prototype.splice.call(this, index, 1);\n\n\t\t// That's what Firefox does\n\t\t//this[index] = \"\"\n\n\t\treturn prevValue;\n\t},\n\n\tgetPropertyCSSValue: function() {\n\t\t//FIXME\n\t},\n\n\t/**\n\t *\n\t * @param {String} name\n\t */\n\tgetPropertyPriority: function(name) {\n\t\treturn this._importants[name] || \"\";\n\t},\n\n\n\t/**\n\t * element.style.overflow = \"auto\"\n\t * element.style.getPropertyShorthand(\"overflow-x\")\n\t * -> \"overflow\"\n\t */\n\tgetPropertyShorthand: function() {\n\t\t//FIXME\n\t},\n\n\tisPropertyImplicit: function() {\n\t\t//FIXME\n\t},\n\n\t// Doesn't work in IE < 9\n\tget cssText(){\n\t\tvar properties = [];\n\t\tfor (var i=0, length=this.length; i < length; ++i) {\n\t\t\tvar name = this[i];\n\t\t\tvar value = this.getPropertyValue(name);\n\t\t\tvar priority = this.getPropertyPriority(name);\n\t\t\tif (priority) {\n\t\t\t\tpriority = \" !\" + priority;\n\t\t\t}\n\t\t\tproperties[i] = name + \": \" + value + priority + \";\";\n\t\t}\n\t\treturn properties.join(\" \");\n\t},\n\n\tset cssText(text){\n\t\tvar i, name;\n\t\tfor (i = this.length; i--;) {\n\t\t\tname = this[i];\n\t\t\tthis[name] = \"\";\n\t\t}\n\t\tArray.prototype.splice.call(this, 0, this.length);\n\t\tthis._importants = {};\n\n\t\tvar dummyRule = CSSOM.parse('#bogus{' + text + '}').cssRules[0].style;\n\t\tvar length = dummyRule.length;\n\t\tfor (i = 0; i < length; ++i) {\n\t\t\tname = dummyRule[i];\n\t\t\tthis.setProperty(dummyRule[i], dummyRule.getPropertyValue(name), dummyRule.getPropertyPriority(name));\n\t\t}\n\t}\n};\n\n\n//.CommonJS\nexports.CSSStyleDeclaration = CSSOM.CSSStyleDeclaration;\nCSSOM.parse = require('./parse').parse; // Cannot be included sooner due to the mutual dependency between parse.js and CSSStyleDeclaration.js\n///CommonJS\n","//.CommonJS\nvar CSSOM = {\n\tCSSStyleDeclaration: require(\"./CSSStyleDeclaration\").CSSStyleDeclaration,\n\tCSSRule: require(\"./CSSRule\").CSSRule\n};\n///CommonJS\n\n\n/**\n * @constructor\n * @see http://dev.w3.org/csswg/cssom/#cssstylerule\n * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleRule\n */\nCSSOM.CSSStyleRule = function CSSStyleRule() {\n\tCSSOM.CSSRule.call(this);\n\tthis.selectorText = \"\";\n\tthis.style = new CSSOM.CSSStyleDeclaration();\n\tthis.style.parentRule = this;\n};\n\nCSSOM.CSSStyleRule.prototype = new CSSOM.CSSRule();\nCSSOM.CSSStyleRule.prototype.constructor = CSSOM.CSSStyleRule;\nCSSOM.CSSStyleRule.prototype.type = 1;\n\nObject.defineProperty(CSSOM.CSSStyleRule.prototype, \"cssText\", {\n\tget: function() {\n\t\tvar text;\n\t\tif (this.selectorText) {\n\t\t\ttext = this.selectorText + \" {\" + this.style.cssText + \"}\";\n\t\t} else {\n\t\t\ttext = \"\";\n\t\t}\n\t\treturn text;\n\t},\n\tset: function(cssText) {\n\t\tvar rule = CSSOM.CSSStyleRule.parse(cssText);\n\t\tthis.style = rule.style;\n\t\tthis.selectorText = rule.selectorText;\n\t}\n});\n\n\n/**\n * NON-STANDARD\n * lightweight version of parse.js.\n * @param {string} ruleText\n * @return CSSStyleRule\n */\nCSSOM.CSSStyleRule.parse = function(ruleText) {\n\tvar i = 0;\n\tvar state = \"selector\";\n\tvar index;\n\tvar j = i;\n\tvar buffer = \"\";\n\n\tvar SIGNIFICANT_WHITESPACE = {\n\t\t\"selector\": true,\n\t\t\"value\": true\n\t};\n\n\tvar styleRule = new CSSOM.CSSStyleRule();\n\tvar name, priority=\"\";\n\n\tfor (var character; (character = ruleText.charAt(i)); i++) {\n\n\t\tswitch (character) {\n\n\t\tcase \" \":\n\t\tcase \"\\t\":\n\t\tcase \"\\r\":\n\t\tcase \"\\n\":\n\t\tcase \"\\f\":\n\t\t\tif (SIGNIFICANT_WHITESPACE[state]) {\n\t\t\t\t// Squash 2 or more white-spaces in the row into 1\n\t\t\t\tswitch (ruleText.charAt(i - 1)) {\n\t\t\t\t\tcase \" \":\n\t\t\t\t\tcase \"\\t\":\n\t\t\t\t\tcase \"\\r\":\n\t\t\t\t\tcase \"\\n\":\n\t\t\t\t\tcase \"\\f\":\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbuffer += \" \";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\n\t\t// String\n\t\tcase '\"':\n\t\t\tj = i + 1;\n\t\t\tindex = ruleText.indexOf('\"', j) + 1;\n\t\t\tif (!index) {\n\t\t\t\tthrow '\" is missing';\n\t\t\t}\n\t\t\tbuffer += ruleText.slice(i, index);\n\t\t\ti = index - 1;\n\t\t\tbreak;\n\n\t\tcase \"'\":\n\t\t\tj = i + 1;\n\t\t\tindex = ruleText.indexOf(\"'\", j) + 1;\n\t\t\tif (!index) {\n\t\t\t\tthrow \"' is missing\";\n\t\t\t}\n\t\t\tbuffer += ruleText.slice(i, index);\n\t\t\ti = index - 1;\n\t\t\tbreak;\n\n\t\t// Comment\n\t\tcase \"/\":\n\t\t\tif (ruleText.charAt(i + 1) === \"*\") {\n\t\t\t\ti += 2;\n\t\t\t\tindex = ruleText.indexOf(\"*/\", i);\n\t\t\t\tif (index === -1) {\n\t\t\t\t\tthrow new SyntaxError(\"Missing */\");\n\t\t\t\t} else {\n\t\t\t\t\ti = index + 1;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tbuffer += character;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \"{\":\n\t\t\tif (state === \"selector\") {\n\t\t\t\tstyleRule.selectorText = buffer.trim();\n\t\t\t\tbuffer = \"\";\n\t\t\t\tstate = \"name\";\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \":\":\n\t\t\tif (state === \"name\") {\n\t\t\t\tname = buffer.trim();\n\t\t\t\tbuffer = \"\";\n\t\t\t\tstate = \"value\";\n\t\t\t} else {\n\t\t\t\tbuffer += character;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \"!\":\n\t\t\tif (state === \"value\" && ruleText.indexOf(\"!important\", i) === i) {\n\t\t\t\tpriority = \"important\";\n\t\t\t\ti += \"important\".length;\n\t\t\t} else {\n\t\t\t\tbuffer += character;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \";\":\n\t\t\tif (state === \"value\") {\n\t\t\t\tstyleRule.style.setProperty(name, buffer.trim(), priority);\n\t\t\t\tpriority = \"\";\n\t\t\t\tbuffer = \"\";\n\t\t\t\tstate = \"name\";\n\t\t\t} else {\n\t\t\t\tbuffer += character;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \"}\":\n\t\t\tif (state === \"value\") {\n\t\t\t\tstyleRule.style.setProperty(name, buffer.trim(), priority);\n\t\t\t\tpriority = \"\";\n\t\t\t\tbuffer = \"\";\n\t\t\t} else if (state === \"name\") {\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tbuffer += character;\n\t\t\t}\n\t\t\tstate = \"selector\";\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbuffer += character;\n\t\t\tbreak;\n\n\t\t}\n\t}\n\n\treturn styleRule;\n\n};\n\n\n//.CommonJS\nexports.CSSStyleRule = CSSOM.CSSStyleRule;\n///CommonJS\n","//.CommonJS\nvar CSSOM = {\n\tStyleSheet: require(\"./StyleSheet\").StyleSheet,\n\tCSSStyleRule: require(\"./CSSStyleRule\").CSSStyleRule\n};\n///CommonJS\n\n\n/**\n * @constructor\n * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleSheet\n */\nCSSOM.CSSStyleSheet = function CSSStyleSheet() {\n\tCSSOM.StyleSheet.call(this);\n\tthis.cssRules = [];\n};\n\n\nCSSOM.CSSStyleSheet.prototype = new CSSOM.StyleSheet();\nCSSOM.CSSStyleSheet.prototype.constructor = CSSOM.CSSStyleSheet;\n\n\n/**\n * Used to insert a new rule into the style sheet. The new rule now becomes part of the cascade.\n *\n * sheet = new Sheet(\"body {margin: 0}\")\n * sheet.toString()\n * -> \"body{margin:0;}\"\n * sheet.insertRule(\"img {border: none}\", 0)\n * -> 0\n * sheet.toString()\n * -> \"img{border:none;}body{margin:0;}\"\n *\n * @param {string} rule\n * @param {number} index\n * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleSheet-insertRule\n * @return {number} The index within the style sheet's rule collection of the newly inserted rule.\n */\nCSSOM.CSSStyleSheet.prototype.insertRule = function(rule, index) {\n\tif (index < 0 || index > this.cssRules.length) {\n\t\tthrow new RangeError(\"INDEX_SIZE_ERR\");\n\t}\n\tvar cssRule = CSSOM.parse(rule).cssRules[0];\n\tcssRule.parentStyleSheet = this;\n\tthis.cssRules.splice(index, 0, cssRule);\n\treturn index;\n};\n\n\n/**\n * Used to delete a rule from the style sheet.\n *\n * sheet = new Sheet(\"img{border:none} body{margin:0}\")\n * sheet.toString()\n * -> \"img{border:none;}body{margin:0;}\"\n * sheet.deleteRule(0)\n * sheet.toString()\n * -> \"body{margin:0;}\"\n *\n * @param {number} index within the style sheet's rule list of the rule to remove.\n * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleSheet-deleteRule\n */\nCSSOM.CSSStyleSheet.prototype.deleteRule = function(index) {\n\tif (index < 0 || index >= this.cssRules.length) {\n\t\tthrow new RangeError(\"INDEX_SIZE_ERR\");\n\t}\n\tthis.cssRules.splice(index, 1);\n};\n\n\n/**\n * NON-STANDARD\n * @return {string} serialize stylesheet\n */\nCSSOM.CSSStyleSheet.prototype.toString = function() {\n\tvar result = \"\";\n\tvar rules = this.cssRules;\n\tfor (var i=0; i 1000 ? '1000px' : 'auto');\n * }\n */\nCSSOM.CSSValueExpression.prototype.parse = function() {\n\tvar token = this._token,\n\t\t\tidx = this._idx;\n\n\tvar character = '',\n\t\t\texpression = '',\n\t\t\terror = '',\n\t\t\tinfo,\n\t\t\tparen = [];\n\n\n\tfor (; ; ++idx) {\n\t\tcharacter = token.charAt(idx);\n\n\t\t// end of token\n\t\tif (character === '') {\n\t\t\terror = 'css expression error: unfinished expression!';\n\t\t\tbreak;\n\t\t}\n\n\t\tswitch(character) {\n\t\t\tcase '(':\n\t\t\t\tparen.push(character);\n\t\t\t\texpression += character;\n\t\t\t\tbreak;\n\n\t\t\tcase ')':\n\t\t\t\tparen.pop(character);\n\t\t\t\texpression += character;\n\t\t\t\tbreak;\n\n\t\t\tcase '/':\n\t\t\t\tif ((info = this._parseJSComment(token, idx))) { // comment?\n\t\t\t\t\tif (info.error) {\n\t\t\t\t\t\terror = 'css expression error: unfinished comment in expression!';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tidx = info.idx;\n\t\t\t\t\t\t// ignore the comment\n\t\t\t\t\t}\n\t\t\t\t} else if ((info = this._parseJSRexExp(token, idx))) { // regexp\n\t\t\t\t\tidx = info.idx;\n\t\t\t\t\texpression += info.text;\n\t\t\t\t} else { // other\n\t\t\t\t\texpression += character;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase \"'\":\n\t\t\tcase '\"':\n\t\t\t\tinfo = this._parseJSString(token, idx, character);\n\t\t\t\tif (info) { // string\n\t\t\t\t\tidx = info.idx;\n\t\t\t\t\texpression += info.text;\n\t\t\t\t} else {\n\t\t\t\t\texpression += character;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\texpression += character;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (error) {\n\t\t\tbreak;\n\t\t}\n\n\t\t// end of expression\n\t\tif (paren.length === 0) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tvar ret;\n\tif (error) {\n\t\tret = {\n\t\t\terror: error\n\t\t};\n\t} else {\n\t\tret = {\n\t\t\tidx: idx,\n\t\t\texpression: expression\n\t\t};\n\t}\n\n\treturn ret;\n};\n\n\n/**\n *\n * @return {Object|false}\n * - idx:\n * - text:\n * or\n * - error:\n * or\n * false\n *\n */\nCSSOM.CSSValueExpression.prototype._parseJSComment = function(token, idx) {\n\tvar nextChar = token.charAt(idx + 1),\n\t\t\ttext;\n\n\tif (nextChar === '/' || nextChar === '*') {\n\t\tvar startIdx = idx,\n\t\t\t\tendIdx,\n\t\t\t\tcommentEndChar;\n\n\t\tif (nextChar === '/') { // line comment\n\t\t\tcommentEndChar = '\\n';\n\t\t} else if (nextChar === '*') { // block comment\n\t\t\tcommentEndChar = '*/';\n\t\t}\n\n\t\tendIdx = token.indexOf(commentEndChar, startIdx + 1 + 1);\n\t\tif (endIdx !== -1) {\n\t\t\tendIdx = endIdx + commentEndChar.length - 1;\n\t\t\ttext = token.substring(idx, endIdx + 1);\n\t\t\treturn {\n\t\t\t\tidx: endIdx,\n\t\t\t\ttext: text\n\t\t\t};\n\t\t} else {\n\t\t\tvar error = 'css expression error: unfinished comment in expression!';\n\t\t\treturn {\n\t\t\t\terror: error\n\t\t\t};\n\t\t}\n\t} else {\n\t\treturn false;\n\t}\n};\n\n\n/**\n *\n * @return {Object|false}\n *\t\t\t\t\t- idx:\n *\t\t\t\t\t- text:\n *\t\t\t\t\tor \n *\t\t\t\t\tfalse\n *\n */\nCSSOM.CSSValueExpression.prototype._parseJSString = function(token, idx, sep) {\n\tvar endIdx = this._findMatchedIdx(token, idx, sep),\n\t\t\ttext;\n\n\tif (endIdx === -1) {\n\t\treturn false;\n\t} else {\n\t\ttext = token.substring(idx, endIdx + sep.length);\n\n\t\treturn {\n\t\t\tidx: endIdx,\n\t\t\ttext: text\n\t\t};\n\t}\n};\n\n\n/**\n * parse regexp in css expression\n *\n * @return {Object|false}\n *\t\t\t\t- idx:\n *\t\t\t\t- regExp:\n *\t\t\t\tor \n *\t\t\t\tfalse\n */\n\n/*\n\nall legal RegExp\n \n/a/\n(/a/)\n[/a/]\n[12, /a/]\n\n!/a/\n\n+/a/\n-/a/\n* /a/\n/ /a/\n%/a/\n\n===/a/\n!==/a/\n==/a/\n!=/a/\n>/a/\n>=/a/\n>/a/\n>>>/a/\n\n&&/a/\n||/a/\n?/a/\n=/a/\n,/a/\n\n\t\tdelete /a/\n\t\t\t\tin /a/\ninstanceof /a/\n\t\t\t\tnew /a/\n\t\ttypeof /a/\n\t\t\tvoid /a/\n\n*/\nCSSOM.CSSValueExpression.prototype._parseJSRexExp = function(token, idx) {\n\tvar before = token.substring(0, idx).replace(/\\s+$/, \"\"),\n\t\t\tlegalRegx = [\n\t\t\t\t/^$/,\n\t\t\t\t/\\($/,\n\t\t\t\t/\\[$/,\n\t\t\t\t/\\!$/,\n\t\t\t\t/\\+$/,\n\t\t\t\t/\\-$/,\n\t\t\t\t/\\*$/,\n\t\t\t\t/\\/\\s+/,\n\t\t\t\t/\\%$/,\n\t\t\t\t/\\=$/,\n\t\t\t\t/\\>$/,\n\t\t\t\t/<$/,\n\t\t\t\t/\\&$/,\n\t\t\t\t/\\|$/,\n\t\t\t\t/\\^$/,\n\t\t\t\t/\\~$/,\n\t\t\t\t/\\?$/,\n\t\t\t\t/\\,$/,\n\t\t\t\t/delete$/,\n\t\t\t\t/in$/,\n\t\t\t\t/instanceof$/,\n\t\t\t\t/new$/,\n\t\t\t\t/typeof$/,\n\t\t\t\t/void$/\n\t\t\t];\n\n\tvar isLegal = legalRegx.some(function(reg) {\n\t\treturn reg.test(before);\n\t});\n\n\tif (!isLegal) {\n\t\treturn false;\n\t} else {\n\t\tvar sep = '/';\n\n\t\t// same logic as string\n\t\treturn this._parseJSString(token, idx, sep);\n\t}\n};\n\n\n/**\n *\n * find next sep(same line) index in `token`\n *\n * @return {Number}\n *\n */\nCSSOM.CSSValueExpression.prototype._findMatchedIdx = function(token, idx, sep) {\n\tvar startIdx = idx,\n\t\t\tendIdx;\n\n\tvar NOT_FOUND = -1;\n\n\twhile(true) {\n\t\tendIdx = token.indexOf(sep, startIdx + 1);\n\n\t\tif (endIdx === -1) { // not found\n\t\t\tendIdx = NOT_FOUND;\n\t\t\tbreak;\n\t\t} else {\n\t\t\tvar text = token.substring(idx + 1, endIdx),\n\t\t\t\t\tmatched = text.match(/\\\\+$/);\n\t\t\tif (!matched || matched[0] % 2 === 0) { // not escaped\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tstartIdx = endIdx;\n\t\t\t}\n\t\t}\n\t}\n\n\t// boundary must be in the same line(js sting or regexp)\n\tvar nextNewLineIdx = token.indexOf('\\n', idx + 1);\n\tif (nextNewLineIdx < endIdx) {\n\t\tendIdx = NOT_FOUND;\n\t}\n\n\n\treturn endIdx;\n};\n\n\n\n\n//.CommonJS\nexports.CSSValueExpression = CSSOM.CSSValueExpression;\n///CommonJS\n","//.CommonJS\nvar CSSOM = {};\n///CommonJS\n\n\n/**\n * @constructor\n * @see https://developer.mozilla.org/en/CSS/@-moz-document\n */\nCSSOM.MatcherList = function MatcherList(){\n this.length = 0;\n};\n\nCSSOM.MatcherList.prototype = {\n\n constructor: CSSOM.MatcherList,\n\n /**\n * @return {string}\n */\n get matcherText() {\n return Array.prototype.join.call(this, \", \");\n },\n\n /**\n * @param {string} value\n */\n set matcherText(value) {\n // just a temporary solution, actually it may be wrong by just split the value with ',', because a url can include ','.\n var values = value.split(\",\");\n var length = this.length = values.length;\n for (var i=0; i 0;\n\n\t\t\t\t\twhile (ancestorRules.length > 0) {\n\t\t\t\t\t\tparentRule = ancestorRules.pop();\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tparentRule.constructor.name === \"CSSMediaRule\"\n\t\t\t\t\t\t\t|| parentRule.constructor.name === \"CSSSupportsRule\"\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tprevScope = currentScope;\n\t\t\t\t\t\t\tcurrentScope = parentRule;\n\t\t\t\t\t\t\tcurrentScope.cssRules.push(prevScope);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (ancestorRules.length === 0) {\n\t\t\t\t\t\t\thasAncestors = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (!hasAncestors) {\n\t\t\t\t\t\tcurrentScope.__ends = i + 1;\n\t\t\t\t\t\tstyleSheet.cssRules.push(currentScope);\n\t\t\t\t\t\tcurrentScope = styleSheet;\n\t\t\t\t\t\tparentRule = null;\n\t\t\t\t\t}\n\n\t\t\t\t\tbuffer = \"\";\n\t\t\t\t\tstate = \"before-selector\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tswitch (state) {\n\t\t\t\tcase \"before-selector\":\n\t\t\t\t\tstate = \"selector\";\n\t\t\t\t\tstyleRule = new CSSOM.CSSStyleRule();\n\t\t\t\t\tstyleRule.__starts = i;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"before-name\":\n\t\t\t\t\tstate = \"name\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"before-value\":\n\t\t\t\t\tstate = \"value\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"importRule-begin\":\n\t\t\t\t\tstate = \"importRule\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbuffer += character;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn styleSheet;\n};\n\n\n//.CommonJS\nexports.parse = CSSOM.parse;\n// The following modules cannot be included sooner due to the mutual dependency with parse.js\nCSSOM.CSSStyleSheet = require(\"./CSSStyleSheet\").CSSStyleSheet;\nCSSOM.CSSStyleRule = require(\"./CSSStyleRule\").CSSStyleRule;\nCSSOM.CSSImportRule = require(\"./CSSImportRule\").CSSImportRule;\nCSSOM.CSSMediaRule = require(\"./CSSMediaRule\").CSSMediaRule;\nCSSOM.CSSSupportsRule = require(\"./CSSSupportsRule\").CSSSupportsRule;\nCSSOM.CSSFontFaceRule = require(\"./CSSFontFaceRule\").CSSFontFaceRule;\nCSSOM.CSSHostRule = require(\"./CSSHostRule\").CSSHostRule;\nCSSOM.CSSStyleDeclaration = require('./CSSStyleDeclaration').CSSStyleDeclaration;\nCSSOM.CSSKeyframeRule = require('./CSSKeyframeRule').CSSKeyframeRule;\nCSSOM.CSSKeyframesRule = require('./CSSKeyframesRule').CSSKeyframesRule;\nCSSOM.CSSValueExpression = require('./CSSValueExpression').CSSValueExpression;\nCSSOM.CSSDocumentRule = require('./CSSDocumentRule').CSSDocumentRule;\n///CommonJS\n","/*********************************************************************\n * This is a fork from the CSS Style Declaration part of\n * https://github.com/NV/CSSOM\n ********************************************************************/\n'use strict';\nvar CSSOM = require('cssom');\nvar allProperties = require('./allProperties');\nvar allExtraProperties = require('./allExtraProperties');\nvar implementedProperties = require('./implementedProperties');\nvar { dashedToCamelCase } = require('./parsers');\nvar getBasicPropertyDescriptor = require('./utils/getBasicPropertyDescriptor');\n\n/**\n * @constructor\n * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration\n */\nvar CSSStyleDeclaration = function CSSStyleDeclaration(onChangeCallback) {\n this._values = {};\n this._importants = {};\n this._length = 0;\n this._onChange =\n onChangeCallback ||\n function() {\n return;\n };\n};\nCSSStyleDeclaration.prototype = {\n constructor: CSSStyleDeclaration,\n\n /**\n *\n * @param {string} name\n * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-getPropertyValue\n * @return {string} the value of the property if it has been explicitly set for this declaration block.\n * Returns the empty string if the property has not been set.\n */\n getPropertyValue: function(name) {\n if (!this._values.hasOwnProperty(name)) {\n return '';\n }\n return this._values[name].toString();\n },\n\n /**\n *\n * @param {string} name\n * @param {string} value\n * @param {string} [priority=null] \"important\" or null\n * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-setProperty\n */\n setProperty: function(name, value, priority) {\n if (value === undefined) {\n return;\n }\n if (value === null || value === '') {\n this.removeProperty(name);\n return;\n }\n var isCustomProperty = name.indexOf('--') === 0;\n if (isCustomProperty) {\n this._setProperty(name, value, priority);\n return;\n }\n var lowercaseName = name.toLowerCase();\n if (!allProperties.has(lowercaseName) && !allExtraProperties.has(lowercaseName)) {\n return;\n }\n\n this[lowercaseName] = value;\n this._importants[lowercaseName] = priority;\n },\n _setProperty: function(name, value, priority) {\n if (value === undefined) {\n return;\n }\n if (value === null || value === '') {\n this.removeProperty(name);\n return;\n }\n if (this._values[name]) {\n // Property already exist. Overwrite it.\n var index = Array.prototype.indexOf.call(this, name);\n if (index < 0) {\n this[this._length] = name;\n this._length++;\n }\n } else {\n // New property.\n this[this._length] = name;\n this._length++;\n }\n this._values[name] = value;\n this._importants[name] = priority;\n this._onChange(this.cssText);\n },\n\n /**\n *\n * @param {string} name\n * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-removeProperty\n * @return {string} the value of the property if it has been explicitly set for this declaration block.\n * Returns the empty string if the property has not been set or the property name does not correspond to a known CSS property.\n */\n removeProperty: function(name) {\n if (!this._values.hasOwnProperty(name)) {\n return '';\n }\n\n var prevValue = this._values[name];\n delete this._values[name];\n delete this._importants[name];\n\n var index = Array.prototype.indexOf.call(this, name);\n if (index < 0) {\n return prevValue;\n }\n\n // That's what WebKit and Opera do\n Array.prototype.splice.call(this, index, 1);\n\n // That's what Firefox does\n //this[index] = \"\"\n\n this._onChange(this.cssText);\n return prevValue;\n },\n\n /**\n *\n * @param {String} name\n */\n getPropertyPriority: function(name) {\n return this._importants[name] || '';\n },\n\n getPropertyCSSValue: function() {\n //FIXME\n return;\n },\n\n /**\n * element.style.overflow = \"auto\"\n * element.style.getPropertyShorthand(\"overflow-x\")\n * -> \"overflow\"\n */\n getPropertyShorthand: function() {\n //FIXME\n return;\n },\n\n isPropertyImplicit: function() {\n //FIXME\n return;\n },\n\n /**\n * http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-item\n */\n item: function(index) {\n index = parseInt(index, 10);\n if (index < 0 || index >= this._length) {\n return '';\n }\n return this[index];\n },\n};\n\nObject.defineProperties(CSSStyleDeclaration.prototype, {\n cssText: {\n get: function() {\n var properties = [];\n var i;\n var name;\n var value;\n var priority;\n for (i = 0; i < this._length; i++) {\n name = this[i];\n value = this.getPropertyValue(name);\n priority = this.getPropertyPriority(name);\n if (priority !== '') {\n priority = ' !' + priority;\n }\n properties.push([name, ': ', value, priority, ';'].join(''));\n }\n return properties.join(' ');\n },\n set: function(value) {\n var i;\n this._values = {};\n Array.prototype.splice.call(this, 0, this._length);\n this._importants = {};\n var dummyRule;\n try {\n dummyRule = CSSOM.parse('#bogus{' + value + '}').cssRules[0].style;\n } catch (err) {\n // malformed css, just return\n return;\n }\n var rule_length = dummyRule.length;\n var name;\n for (i = 0; i < rule_length; ++i) {\n name = dummyRule[i];\n this.setProperty(\n dummyRule[i],\n dummyRule.getPropertyValue(name),\n dummyRule.getPropertyPriority(name)\n );\n }\n this._onChange(this.cssText);\n },\n enumerable: true,\n configurable: true,\n },\n parentRule: {\n get: function() {\n return null;\n },\n enumerable: true,\n configurable: true,\n },\n length: {\n get: function() {\n return this._length;\n },\n /**\n * This deletes indices if the new length is less then the current\n * length. If the new length is more, it does nothing, the new indices\n * will be undefined until set.\n **/\n set: function(value) {\n var i;\n for (i = value; i < this._length; i++) {\n delete this[i];\n }\n this._length = value;\n },\n enumerable: true,\n configurable: true,\n },\n});\n\nrequire('./properties')(CSSStyleDeclaration.prototype);\n\nallProperties.forEach(function(property) {\n if (!implementedProperties.has(property)) {\n var declaration = getBasicPropertyDescriptor(property);\n Object.defineProperty(CSSStyleDeclaration.prototype, property, declaration);\n Object.defineProperty(CSSStyleDeclaration.prototype, dashedToCamelCase(property), declaration);\n }\n});\n\nallExtraProperties.forEach(function(property) {\n if (!implementedProperties.has(property)) {\n var declaration = getBasicPropertyDescriptor(property);\n Object.defineProperty(CSSStyleDeclaration.prototype, property, declaration);\n Object.defineProperty(CSSStyleDeclaration.prototype, dashedToCamelCase(property), declaration);\n }\n});\n\nexports.CSSStyleDeclaration = CSSStyleDeclaration;\n","'use strict';\n\n/**\n * This file contains all implemented properties that are not a part of any\n * current specifications or drafts, but are handled by browsers nevertheless.\n */\n\nvar allWebkitProperties = require('./allWebkitProperties');\n\nmodule.exports = new Set(\n [\n 'background-position-x',\n 'background-position-y',\n 'background-repeat-x',\n 'background-repeat-y',\n 'color-interpolation',\n 'color-profile',\n 'color-rendering',\n 'css-float',\n 'enable-background',\n 'fill',\n 'fill-opacity',\n 'fill-rule',\n 'glyph-orientation-horizontal',\n 'image-rendering',\n 'kerning',\n 'marker',\n 'marker-end',\n 'marker-mid',\n 'marker-offset',\n 'marker-start',\n 'marks',\n 'pointer-events',\n 'shape-rendering',\n 'size',\n 'src',\n 'stop-color',\n 'stop-opacity',\n 'stroke',\n 'stroke-dasharray',\n 'stroke-dashoffset',\n 'stroke-linecap',\n 'stroke-linejoin',\n 'stroke-miterlimit',\n 'stroke-opacity',\n 'stroke-width',\n 'text-anchor',\n 'text-line-through',\n 'text-line-through-color',\n 'text-line-through-mode',\n 'text-line-through-style',\n 'text-line-through-width',\n 'text-overline',\n 'text-overline-color',\n 'text-overline-mode',\n 'text-overline-style',\n 'text-overline-width',\n 'text-rendering',\n 'text-underline',\n 'text-underline-color',\n 'text-underline-mode',\n 'text-underline-style',\n 'text-underline-width',\n 'unicode-range',\n 'vector-effect',\n ].concat(allWebkitProperties)\n);\n","'use strict';\n\n// autogenerated - 4/29/2020\n\n/*\n *\n * https://www.w3.org/Style/CSS/all-properties.en.html\n */\n\nmodule.exports = new Set([\n 'align-content',\n 'align-items',\n 'align-self',\n 'alignment-baseline',\n 'all',\n 'animation',\n 'animation-delay',\n 'animation-direction',\n 'animation-duration',\n 'animation-fill-mode',\n 'animation-iteration-count',\n 'animation-name',\n 'animation-play-state',\n 'animation-timing-function',\n 'appearance',\n 'azimuth',\n 'background',\n 'background-attachment',\n 'background-blend-mode',\n 'background-clip',\n 'background-color',\n 'background-image',\n 'background-origin',\n 'background-position',\n 'background-repeat',\n 'background-size',\n 'baseline-shift',\n 'block-overflow',\n 'block-size',\n 'bookmark-label',\n 'bookmark-level',\n 'bookmark-state',\n 'border',\n 'border-block',\n 'border-block-color',\n 'border-block-end',\n 'border-block-end-color',\n 'border-block-end-style',\n 'border-block-end-width',\n 'border-block-start',\n 'border-block-start-color',\n 'border-block-start-style',\n 'border-block-start-width',\n 'border-block-style',\n 'border-block-width',\n 'border-bottom',\n 'border-bottom-color',\n 'border-bottom-left-radius',\n 'border-bottom-right-radius',\n 'border-bottom-style',\n 'border-bottom-width',\n 'border-boundary',\n 'border-collapse',\n 'border-color',\n 'border-end-end-radius',\n 'border-end-start-radius',\n 'border-image',\n 'border-image-outset',\n 'border-image-repeat',\n 'border-image-slice',\n 'border-image-source',\n 'border-image-width',\n 'border-inline',\n 'border-inline-color',\n 'border-inline-end',\n 'border-inline-end-color',\n 'border-inline-end-style',\n 'border-inline-end-width',\n 'border-inline-start',\n 'border-inline-start-color',\n 'border-inline-start-style',\n 'border-inline-start-width',\n 'border-inline-style',\n 'border-inline-width',\n 'border-left',\n 'border-left-color',\n 'border-left-style',\n 'border-left-width',\n 'border-radius',\n 'border-right',\n 'border-right-color',\n 'border-right-style',\n 'border-right-width',\n 'border-spacing',\n 'border-start-end-radius',\n 'border-start-start-radius',\n 'border-style',\n 'border-top',\n 'border-top-color',\n 'border-top-left-radius',\n 'border-top-right-radius',\n 'border-top-style',\n 'border-top-width',\n 'border-width',\n 'bottom',\n 'box-decoration-break',\n 'box-shadow',\n 'box-sizing',\n 'box-snap',\n 'break-after',\n 'break-before',\n 'break-inside',\n 'caption-side',\n 'caret',\n 'caret-color',\n 'caret-shape',\n 'chains',\n 'clear',\n 'clip',\n 'clip-path',\n 'clip-rule',\n 'color',\n 'color-adjust',\n 'color-interpolation-filters',\n 'color-scheme',\n 'column-count',\n 'column-fill',\n 'column-gap',\n 'column-rule',\n 'column-rule-color',\n 'column-rule-style',\n 'column-rule-width',\n 'column-span',\n 'column-width',\n 'columns',\n 'contain',\n 'content',\n 'continue',\n 'counter-increment',\n 'counter-reset',\n 'counter-set',\n 'cue',\n 'cue-after',\n 'cue-before',\n 'cursor',\n 'direction',\n 'display',\n 'dominant-baseline',\n 'elevation',\n 'empty-cells',\n 'filter',\n 'flex',\n 'flex-basis',\n 'flex-direction',\n 'flex-flow',\n 'flex-grow',\n 'flex-shrink',\n 'flex-wrap',\n 'float',\n 'flood-color',\n 'flood-opacity',\n 'flow',\n 'flow-from',\n 'flow-into',\n 'font',\n 'font-family',\n 'font-feature-settings',\n 'font-kerning',\n 'font-language-override',\n 'font-optical-sizing',\n 'font-palette',\n 'font-size',\n 'font-size-adjust',\n 'font-stretch',\n 'font-style',\n 'font-synthesis',\n 'font-synthesis-small-caps',\n 'font-synthesis-style',\n 'font-synthesis-weight',\n 'font-variant',\n 'font-variant-alternates',\n 'font-variant-caps',\n 'font-variant-east-asian',\n 'font-variant-emoji',\n 'font-variant-ligatures',\n 'font-variant-numeric',\n 'font-variant-position',\n 'font-variation-settings',\n 'font-weight',\n 'footnote-display',\n 'footnote-policy',\n 'forced-color-adjust',\n 'gap',\n 'glyph-orientation-vertical',\n 'grid',\n 'grid-area',\n 'grid-auto-columns',\n 'grid-auto-flow',\n 'grid-auto-rows',\n 'grid-column',\n 'grid-column-end',\n 'grid-column-start',\n 'grid-row',\n 'grid-row-end',\n 'grid-row-start',\n 'grid-template',\n 'grid-template-areas',\n 'grid-template-columns',\n 'grid-template-rows',\n 'hanging-punctuation',\n 'height',\n 'hyphenate-character',\n 'hyphenate-limit-chars',\n 'hyphenate-limit-last',\n 'hyphenate-limit-lines',\n 'hyphenate-limit-zone',\n 'hyphens',\n 'image-orientation',\n 'image-rendering',\n 'image-resolution',\n 'initial-letters',\n 'initial-letters-align',\n 'initial-letters-wrap',\n 'inline-size',\n 'inline-sizing',\n 'inset',\n 'inset-block',\n 'inset-block-end',\n 'inset-block-start',\n 'inset-inline',\n 'inset-inline-end',\n 'inset-inline-start',\n 'isolation',\n 'justify-content',\n 'justify-items',\n 'justify-self',\n 'left',\n 'letter-spacing',\n 'lighting-color',\n 'line-break',\n 'line-clamp',\n 'line-grid',\n 'line-height',\n 'line-padding',\n 'line-snap',\n 'list-style',\n 'list-style-image',\n 'list-style-position',\n 'list-style-type',\n 'margin',\n 'margin-block',\n 'margin-block-end',\n 'margin-block-start',\n 'margin-bottom',\n 'margin-inline',\n 'margin-inline-end',\n 'margin-inline-start',\n 'margin-left',\n 'margin-right',\n 'margin-top',\n 'marker-side',\n 'mask',\n 'mask-border',\n 'mask-border-mode',\n 'mask-border-outset',\n 'mask-border-repeat',\n 'mask-border-slice',\n 'mask-border-source',\n 'mask-border-width',\n 'mask-clip',\n 'mask-composite',\n 'mask-image',\n 'mask-mode',\n 'mask-origin',\n 'mask-position',\n 'mask-repeat',\n 'mask-size',\n 'mask-type',\n 'max-block-size',\n 'max-height',\n 'max-inline-size',\n 'max-lines',\n 'max-width',\n 'min-block-size',\n 'min-height',\n 'min-inline-size',\n 'min-width',\n 'mix-blend-mode',\n 'nav-down',\n 'nav-left',\n 'nav-right',\n 'nav-up',\n 'object-fit',\n 'object-position',\n 'offset',\n 'offset-after',\n 'offset-anchor',\n 'offset-before',\n 'offset-distance',\n 'offset-end',\n 'offset-path',\n 'offset-position',\n 'offset-rotate',\n 'offset-start',\n 'opacity',\n 'order',\n 'orphans',\n 'outline',\n 'outline-color',\n 'outline-offset',\n 'outline-style',\n 'outline-width',\n 'overflow',\n 'overflow-block',\n 'overflow-inline',\n 'overflow-wrap',\n 'overflow-x',\n 'overflow-y',\n 'padding',\n 'padding-block',\n 'padding-block-end',\n 'padding-block-start',\n 'padding-bottom',\n 'padding-inline',\n 'padding-inline-end',\n 'padding-inline-start',\n 'padding-left',\n 'padding-right',\n 'padding-top',\n 'page',\n 'page-break-after',\n 'page-break-before',\n 'page-break-inside',\n 'pause',\n 'pause-after',\n 'pause-before',\n 'pitch',\n 'pitch-range',\n 'place-content',\n 'place-items',\n 'place-self',\n 'play-during',\n 'position',\n 'quotes',\n 'region-fragment',\n 'resize',\n 'rest',\n 'rest-after',\n 'rest-before',\n 'richness',\n 'right',\n 'row-gap',\n 'ruby-align',\n 'ruby-merge',\n 'ruby-position',\n 'running',\n 'scroll-behavior',\n 'scroll-margin',\n 'scroll-margin-block',\n 'scroll-margin-block-end',\n 'scroll-margin-block-start',\n 'scroll-margin-bottom',\n 'scroll-margin-inline',\n 'scroll-margin-inline-end',\n 'scroll-margin-inline-start',\n 'scroll-margin-left',\n 'scroll-margin-right',\n 'scroll-margin-top',\n 'scroll-padding',\n 'scroll-padding-block',\n 'scroll-padding-block-end',\n 'scroll-padding-block-start',\n 'scroll-padding-bottom',\n 'scroll-padding-inline',\n 'scroll-padding-inline-end',\n 'scroll-padding-inline-start',\n 'scroll-padding-left',\n 'scroll-padding-right',\n 'scroll-padding-top',\n 'scroll-snap-align',\n 'scroll-snap-stop',\n 'scroll-snap-type',\n 'shape-image-threshold',\n 'shape-inside',\n 'shape-margin',\n 'shape-outside',\n 'spatial-navigation-action',\n 'spatial-navigation-contain',\n 'spatial-navigation-function',\n 'speak',\n 'speak-as',\n 'speak-header',\n 'speak-numeral',\n 'speak-punctuation',\n 'speech-rate',\n 'stress',\n 'string-set',\n 'tab-size',\n 'table-layout',\n 'text-align',\n 'text-align-all',\n 'text-align-last',\n 'text-combine-upright',\n 'text-decoration',\n 'text-decoration-color',\n 'text-decoration-line',\n 'text-decoration-style',\n 'text-emphasis',\n 'text-emphasis-color',\n 'text-emphasis-position',\n 'text-emphasis-style',\n 'text-group-align',\n 'text-indent',\n 'text-justify',\n 'text-orientation',\n 'text-overflow',\n 'text-shadow',\n 'text-space-collapse',\n 'text-space-trim',\n 'text-spacing',\n 'text-transform',\n 'text-underline-position',\n 'text-wrap',\n 'top',\n 'transform',\n 'transform-box',\n 'transform-origin',\n 'transition',\n 'transition-delay',\n 'transition-duration',\n 'transition-property',\n 'transition-timing-function',\n 'unicode-bidi',\n 'user-select',\n 'vertical-align',\n 'visibility',\n 'voice-balance',\n 'voice-duration',\n 'voice-family',\n 'voice-pitch',\n 'voice-range',\n 'voice-rate',\n 'voice-stress',\n 'voice-volume',\n 'volume',\n 'white-space',\n 'widows',\n 'width',\n 'will-change',\n 'word-boundary-detection',\n 'word-boundary-expansion',\n 'word-break',\n 'word-spacing',\n 'word-wrap',\n 'wrap-after',\n 'wrap-before',\n 'wrap-flow',\n 'wrap-inside',\n 'wrap-through',\n 'writing-mode',\n 'z-index',\n]);\n","'use strict';\n\n/**\n * This file contains all implemented properties that are not a part of any\n * current specifications or drafts, but are handled by browsers nevertheless.\n */\n\nmodule.exports = [\n 'animation',\n 'animation-delay',\n 'animation-direction',\n 'animation-duration',\n 'animation-fill-mode',\n 'animation-iteration-count',\n 'animation-name',\n 'animation-play-state',\n 'animation-timing-function',\n 'appearance',\n 'aspect-ratio',\n 'backface-visibility',\n 'background-clip',\n 'background-composite',\n 'background-origin',\n 'background-size',\n 'border-after',\n 'border-after-color',\n 'border-after-style',\n 'border-after-width',\n 'border-before',\n 'border-before-color',\n 'border-before-style',\n 'border-before-width',\n 'border-end',\n 'border-end-color',\n 'border-end-style',\n 'border-end-width',\n 'border-fit',\n 'border-horizontal-spacing',\n 'border-image',\n 'border-radius',\n 'border-start',\n 'border-start-color',\n 'border-start-style',\n 'border-start-width',\n 'border-vertical-spacing',\n 'box-align',\n 'box-direction',\n 'box-flex',\n 'box-flex-group',\n 'box-lines',\n 'box-ordinal-group',\n 'box-orient',\n 'box-pack',\n 'box-reflect',\n 'box-shadow',\n 'color-correction',\n 'column-axis',\n 'column-break-after',\n 'column-break-before',\n 'column-break-inside',\n 'column-count',\n 'column-gap',\n 'column-rule',\n 'column-rule-color',\n 'column-rule-style',\n 'column-rule-width',\n 'columns',\n 'column-span',\n 'column-width',\n 'filter',\n 'flex-align',\n 'flex-direction',\n 'flex-flow',\n 'flex-item-align',\n 'flex-line-pack',\n 'flex-order',\n 'flex-pack',\n 'flex-wrap',\n 'flow-from',\n 'flow-into',\n 'font-feature-settings',\n 'font-kerning',\n 'font-size-delta',\n 'font-smoothing',\n 'font-variant-ligatures',\n 'highlight',\n 'hyphenate-character',\n 'hyphenate-limit-after',\n 'hyphenate-limit-before',\n 'hyphenate-limit-lines',\n 'hyphens',\n 'line-align',\n 'line-box-contain',\n 'line-break',\n 'line-clamp',\n 'line-grid',\n 'line-snap',\n 'locale',\n 'logical-height',\n 'logical-width',\n 'margin-after',\n 'margin-after-collapse',\n 'margin-before',\n 'margin-before-collapse',\n 'margin-bottom-collapse',\n 'margin-collapse',\n 'margin-end',\n 'margin-start',\n 'margin-top-collapse',\n 'marquee',\n 'marquee-direction',\n 'marquee-increment',\n 'marquee-repetition',\n 'marquee-speed',\n 'marquee-style',\n 'mask',\n 'mask-attachment',\n 'mask-box-image',\n 'mask-box-image-outset',\n 'mask-box-image-repeat',\n 'mask-box-image-slice',\n 'mask-box-image-source',\n 'mask-box-image-width',\n 'mask-clip',\n 'mask-composite',\n 'mask-image',\n 'mask-origin',\n 'mask-position',\n 'mask-position-x',\n 'mask-position-y',\n 'mask-repeat',\n 'mask-repeat-x',\n 'mask-repeat-y',\n 'mask-size',\n 'match-nearest-mail-blockquote-color',\n 'max-logical-height',\n 'max-logical-width',\n 'min-logical-height',\n 'min-logical-width',\n 'nbsp-mode',\n 'overflow-scrolling',\n 'padding-after',\n 'padding-before',\n 'padding-end',\n 'padding-start',\n 'perspective',\n 'perspective-origin',\n 'perspective-origin-x',\n 'perspective-origin-y',\n 'print-color-adjust',\n 'region-break-after',\n 'region-break-before',\n 'region-break-inside',\n 'region-overflow',\n 'rtl-ordering',\n 'svg-shadow',\n 'tap-highlight-color',\n 'text-combine',\n 'text-decorations-in-effect',\n 'text-emphasis',\n 'text-emphasis-color',\n 'text-emphasis-position',\n 'text-emphasis-style',\n 'text-fill-color',\n 'text-orientation',\n 'text-security',\n 'text-size-adjust',\n 'text-stroke',\n 'text-stroke-color',\n 'text-stroke-width',\n 'transform',\n 'transform-origin',\n 'transform-origin-x',\n 'transform-origin-y',\n 'transform-origin-z',\n 'transform-style',\n 'transition',\n 'transition-delay',\n 'transition-duration',\n 'transition-property',\n 'transition-timing-function',\n 'user-drag',\n 'user-modify',\n 'user-select',\n 'wrap',\n 'wrap-flow',\n 'wrap-margin',\n 'wrap-padding',\n 'wrap-shape-inside',\n 'wrap-shape-outside',\n 'wrap-through',\n 'writing-mode',\n 'zoom',\n].map(prop => 'webkit-' + prop);\n","'use strict';\n\nmodule.exports.POSITION_AT_SHORTHAND = {\n first: 0,\n second: 1,\n};\n","'use strict';\n\n// autogenerated - 4/29/2020\n\n/*\n *\n * https://www.w3.org/Style/CSS/all-properties.en.html\n */\n\nvar implementedProperties = new Set();\nimplementedProperties.add(\"azimuth\");\nimplementedProperties.add(\"background\");\nimplementedProperties.add(\"background-attachment\");\nimplementedProperties.add(\"background-color\");\nimplementedProperties.add(\"background-image\");\nimplementedProperties.add(\"background-position\");\nimplementedProperties.add(\"background-repeat\");\nimplementedProperties.add(\"border\");\nimplementedProperties.add(\"border-bottom\");\nimplementedProperties.add(\"border-bottom-color\");\nimplementedProperties.add(\"border-bottom-style\");\nimplementedProperties.add(\"border-bottom-width\");\nimplementedProperties.add(\"border-collapse\");\nimplementedProperties.add(\"border-color\");\nimplementedProperties.add(\"border-left\");\nimplementedProperties.add(\"border-left-color\");\nimplementedProperties.add(\"border-left-style\");\nimplementedProperties.add(\"border-left-width\");\nimplementedProperties.add(\"border-right\");\nimplementedProperties.add(\"border-right-color\");\nimplementedProperties.add(\"border-right-style\");\nimplementedProperties.add(\"border-right-width\");\nimplementedProperties.add(\"border-spacing\");\nimplementedProperties.add(\"border-style\");\nimplementedProperties.add(\"border-top\");\nimplementedProperties.add(\"border-top-color\");\nimplementedProperties.add(\"border-top-style\");\nimplementedProperties.add(\"border-top-width\");\nimplementedProperties.add(\"border-width\");\nimplementedProperties.add(\"bottom\");\nimplementedProperties.add(\"clear\");\nimplementedProperties.add(\"clip\");\nimplementedProperties.add(\"color\");\nimplementedProperties.add(\"css-float\");\nimplementedProperties.add(\"flex\");\nimplementedProperties.add(\"flex-basis\");\nimplementedProperties.add(\"flex-grow\");\nimplementedProperties.add(\"flex-shrink\");\nimplementedProperties.add(\"float\");\nimplementedProperties.add(\"flood-color\");\nimplementedProperties.add(\"font\");\nimplementedProperties.add(\"font-family\");\nimplementedProperties.add(\"font-size\");\nimplementedProperties.add(\"font-style\");\nimplementedProperties.add(\"font-variant\");\nimplementedProperties.add(\"font-weight\");\nimplementedProperties.add(\"height\");\nimplementedProperties.add(\"left\");\nimplementedProperties.add(\"lighting-color\");\nimplementedProperties.add(\"line-height\");\nimplementedProperties.add(\"margin\");\nimplementedProperties.add(\"margin-bottom\");\nimplementedProperties.add(\"margin-left\");\nimplementedProperties.add(\"margin-right\");\nimplementedProperties.add(\"margin-top\");\nimplementedProperties.add(\"opacity\");\nimplementedProperties.add(\"outline-color\");\nimplementedProperties.add(\"padding\");\nimplementedProperties.add(\"padding-bottom\");\nimplementedProperties.add(\"padding-left\");\nimplementedProperties.add(\"padding-right\");\nimplementedProperties.add(\"padding-top\");\nimplementedProperties.add(\"right\");\nimplementedProperties.add(\"stop-color\");\nimplementedProperties.add(\"text-line-through-color\");\nimplementedProperties.add(\"text-overline-color\");\nimplementedProperties.add(\"text-underline-color\");\nimplementedProperties.add(\"top\");\nimplementedProperties.add(\"webkit-border-after-color\");\nimplementedProperties.add(\"webkit-border-before-color\");\nimplementedProperties.add(\"webkit-border-end-color\");\nimplementedProperties.add(\"webkit-border-start-color\");\nimplementedProperties.add(\"webkit-column-rule-color\");\nimplementedProperties.add(\"webkit-match-nearest-mail-blockquote-color\");\nimplementedProperties.add(\"webkit-tap-highlight-color\");\nimplementedProperties.add(\"webkit-text-emphasis-color\");\nimplementedProperties.add(\"webkit-text-fill-color\");\nimplementedProperties.add(\"webkit-text-stroke-color\");\nimplementedProperties.add(\"width\");\nmodule.exports = implementedProperties;\n","/*********************************************************************\n * These are commonly used parsers for CSS Values they take a string *\n * to parse and return a string after it's been converted, if needed *\n ********************************************************************/\n'use strict';\n\nconst namedColors = require('./named_colors.json');\nconst { hslToRgb } = require('./utils/colorSpace');\n\nexports.TYPES = {\n INTEGER: 1,\n NUMBER: 2,\n LENGTH: 3,\n PERCENT: 4,\n URL: 5,\n COLOR: 6,\n STRING: 7,\n ANGLE: 8,\n KEYWORD: 9,\n NULL_OR_EMPTY_STR: 10,\n CALC: 11,\n};\n\n// rough regular expressions\nvar integerRegEx = /^[-+]?[0-9]+$/;\nvar numberRegEx = /^[-+]?[0-9]*\\.?[0-9]+$/;\nvar lengthRegEx = /^(0|[-+]?[0-9]*\\.?[0-9]+(in|cm|em|mm|pt|pc|px|ex|rem|vh|vw|ch))$/;\nvar percentRegEx = /^[-+]?[0-9]*\\.?[0-9]+%$/;\nvar urlRegEx = /^url\\(\\s*([^)]*)\\s*\\)$/;\nvar stringRegEx = /^(\"[^\"]*\"|'[^']*')$/;\nvar colorRegEx1 = /^#([0-9a-fA-F]{3,4}){1,2}$/;\nvar colorRegEx2 = /^rgb\\(([^)]*)\\)$/;\nvar colorRegEx3 = /^rgba\\(([^)]*)\\)$/;\nvar calcRegEx = /^calc\\(([^)]*)\\)$/;\nvar colorRegEx4 = /^hsla?\\(\\s*(-?\\d+|-?\\d*.\\d+)\\s*,\\s*(-?\\d+|-?\\d*.\\d+)%\\s*,\\s*(-?\\d+|-?\\d*.\\d+)%\\s*(,\\s*(-?\\d+|-?\\d*.\\d+)\\s*)?\\)/;\nvar angleRegEx = /^([-+]?[0-9]*\\.?[0-9]+)(deg|grad|rad)$/;\n\n// This will return one of the above types based on the passed in string\nexports.valueType = function valueType(val) {\n if (val === '' || val === null) {\n return exports.TYPES.NULL_OR_EMPTY_STR;\n }\n if (typeof val === 'number') {\n val = val.toString();\n }\n\n if (typeof val !== 'string') {\n return undefined;\n }\n\n if (integerRegEx.test(val)) {\n return exports.TYPES.INTEGER;\n }\n if (numberRegEx.test(val)) {\n return exports.TYPES.NUMBER;\n }\n if (lengthRegEx.test(val)) {\n return exports.TYPES.LENGTH;\n }\n if (percentRegEx.test(val)) {\n return exports.TYPES.PERCENT;\n }\n if (urlRegEx.test(val)) {\n return exports.TYPES.URL;\n }\n if (calcRegEx.test(val)) {\n return exports.TYPES.CALC;\n }\n if (stringRegEx.test(val)) {\n return exports.TYPES.STRING;\n }\n if (angleRegEx.test(val)) {\n return exports.TYPES.ANGLE;\n }\n if (colorRegEx1.test(val)) {\n return exports.TYPES.COLOR;\n }\n\n var res = colorRegEx2.exec(val);\n var parts;\n if (res !== null) {\n parts = res[1].split(/\\s*,\\s*/);\n if (parts.length !== 3) {\n return undefined;\n }\n if (\n parts.every(percentRegEx.test.bind(percentRegEx)) ||\n parts.every(integerRegEx.test.bind(integerRegEx))\n ) {\n return exports.TYPES.COLOR;\n }\n return undefined;\n }\n res = colorRegEx3.exec(val);\n if (res !== null) {\n parts = res[1].split(/\\s*,\\s*/);\n if (parts.length !== 4) {\n return undefined;\n }\n if (\n parts.slice(0, 3).every(percentRegEx.test.bind(percentRegEx)) ||\n parts.slice(0, 3).every(integerRegEx.test.bind(integerRegEx))\n ) {\n if (numberRegEx.test(parts[3])) {\n return exports.TYPES.COLOR;\n }\n }\n return undefined;\n }\n\n if (colorRegEx4.test(val)) {\n return exports.TYPES.COLOR;\n }\n\n // could still be a color, one of the standard keyword colors\n val = val.toLowerCase();\n\n if (namedColors.includes(val)) {\n return exports.TYPES.COLOR;\n }\n\n switch (val) {\n // the following are deprecated in CSS3\n case 'activeborder':\n case 'activecaption':\n case 'appworkspace':\n case 'background':\n case 'buttonface':\n case 'buttonhighlight':\n case 'buttonshadow':\n case 'buttontext':\n case 'captiontext':\n case 'graytext':\n case 'highlight':\n case 'highlighttext':\n case 'inactiveborder':\n case 'inactivecaption':\n case 'inactivecaptiontext':\n case 'infobackground':\n case 'infotext':\n case 'menu':\n case 'menutext':\n case 'scrollbar':\n case 'threeddarkshadow':\n case 'threedface':\n case 'threedhighlight':\n case 'threedlightshadow':\n case 'threedshadow':\n case 'window':\n case 'windowframe':\n case 'windowtext':\n return exports.TYPES.COLOR;\n default:\n return exports.TYPES.KEYWORD;\n }\n};\n\nexports.parseInteger = function parseInteger(val) {\n var type = exports.valueType(val);\n if (type === exports.TYPES.NULL_OR_EMPTY_STR) {\n return val;\n }\n if (type !== exports.TYPES.INTEGER) {\n return undefined;\n }\n return String(parseInt(val, 10));\n};\n\nexports.parseNumber = function parseNumber(val) {\n var type = exports.valueType(val);\n if (type === exports.TYPES.NULL_OR_EMPTY_STR) {\n return val;\n }\n if (type !== exports.TYPES.NUMBER && type !== exports.TYPES.INTEGER) {\n return undefined;\n }\n return String(parseFloat(val));\n};\n\nexports.parseLength = function parseLength(val) {\n if (val === 0 || val === '0') {\n return '0px';\n }\n var type = exports.valueType(val);\n if (type === exports.TYPES.NULL_OR_EMPTY_STR) {\n return val;\n }\n if (type !== exports.TYPES.LENGTH) {\n return undefined;\n }\n return val;\n};\n\nexports.parsePercent = function parsePercent(val) {\n if (val === 0 || val === '0') {\n return '0%';\n }\n var type = exports.valueType(val);\n if (type === exports.TYPES.NULL_OR_EMPTY_STR) {\n return val;\n }\n if (type !== exports.TYPES.PERCENT) {\n return undefined;\n }\n return val;\n};\n\n// either a length or a percent\nexports.parseMeasurement = function parseMeasurement(val) {\n var type = exports.valueType(val);\n if (type === exports.TYPES.CALC) {\n return val;\n }\n\n var length = exports.parseLength(val);\n if (length !== undefined) {\n return length;\n }\n return exports.parsePercent(val);\n};\n\nexports.parseUrl = function parseUrl(val) {\n var type = exports.valueType(val);\n if (type === exports.TYPES.NULL_OR_EMPTY_STR) {\n return val;\n }\n var res = urlRegEx.exec(val);\n // does it match the regex?\n if (!res) {\n return undefined;\n }\n var str = res[1];\n // if it starts with single or double quotes, does it end with the same?\n if ((str[0] === '\"' || str[0] === \"'\") && str[0] !== str[str.length - 1]) {\n return undefined;\n }\n if (str[0] === '\"' || str[0] === \"'\") {\n str = str.substr(1, str.length - 2);\n }\n\n var i;\n for (i = 0; i < str.length; i++) {\n switch (str[i]) {\n case '(':\n case ')':\n case ' ':\n case '\\t':\n case '\\n':\n case \"'\":\n case '\"':\n return undefined;\n case '\\\\':\n i++;\n break;\n }\n }\n\n return 'url(' + str + ')';\n};\n\nexports.parseString = function parseString(val) {\n var type = exports.valueType(val);\n if (type === exports.TYPES.NULL_OR_EMPTY_STR) {\n return val;\n }\n if (type !== exports.TYPES.STRING) {\n return undefined;\n }\n var i;\n for (i = 1; i < val.length - 1; i++) {\n switch (val[i]) {\n case val[0]:\n return undefined;\n case '\\\\':\n i++;\n while (i < val.length - 1 && /[0-9A-Fa-f]/.test(val[i])) {\n i++;\n }\n break;\n }\n }\n if (i >= val.length) {\n return undefined;\n }\n return val;\n};\n\nexports.parseColor = function parseColor(val) {\n var type = exports.valueType(val);\n if (type === exports.TYPES.NULL_OR_EMPTY_STR) {\n return val;\n }\n var red,\n green,\n blue,\n hue,\n saturation,\n lightness,\n alpha = 1;\n var parts;\n var res = colorRegEx1.exec(val);\n // is it #aaa, #ababab, #aaaa, #abababaa\n if (res) {\n var defaultHex = val.substr(1);\n var hex = val.substr(1);\n if (hex.length === 3 || hex.length === 4) {\n hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];\n\n if (defaultHex.length === 4) {\n hex = hex + defaultHex[3] + defaultHex[3];\n }\n }\n red = parseInt(hex.substr(0, 2), 16);\n green = parseInt(hex.substr(2, 2), 16);\n blue = parseInt(hex.substr(4, 2), 16);\n if (hex.length === 8) {\n var hexAlpha = hex.substr(6, 2);\n var hexAlphaToRgbaAlpha = Number((parseInt(hexAlpha, 16) / 255).toFixed(3));\n\n return 'rgba(' + red + ', ' + green + ', ' + blue + ', ' + hexAlphaToRgbaAlpha + ')';\n }\n return 'rgb(' + red + ', ' + green + ', ' + blue + ')';\n }\n\n res = colorRegEx2.exec(val);\n if (res) {\n parts = res[1].split(/\\s*,\\s*/);\n if (parts.length !== 3) {\n return undefined;\n }\n if (parts.every(percentRegEx.test.bind(percentRegEx))) {\n red = Math.floor((parseFloat(parts[0].slice(0, -1)) * 255) / 100);\n green = Math.floor((parseFloat(parts[1].slice(0, -1)) * 255) / 100);\n blue = Math.floor((parseFloat(parts[2].slice(0, -1)) * 255) / 100);\n } else if (parts.every(integerRegEx.test.bind(integerRegEx))) {\n red = parseInt(parts[0], 10);\n green = parseInt(parts[1], 10);\n blue = parseInt(parts[2], 10);\n } else {\n return undefined;\n }\n red = Math.min(255, Math.max(0, red));\n green = Math.min(255, Math.max(0, green));\n blue = Math.min(255, Math.max(0, blue));\n return 'rgb(' + red + ', ' + green + ', ' + blue + ')';\n }\n\n res = colorRegEx3.exec(val);\n if (res) {\n parts = res[1].split(/\\s*,\\s*/);\n if (parts.length !== 4) {\n return undefined;\n }\n if (parts.slice(0, 3).every(percentRegEx.test.bind(percentRegEx))) {\n red = Math.floor((parseFloat(parts[0].slice(0, -1)) * 255) / 100);\n green = Math.floor((parseFloat(parts[1].slice(0, -1)) * 255) / 100);\n blue = Math.floor((parseFloat(parts[2].slice(0, -1)) * 255) / 100);\n alpha = parseFloat(parts[3]);\n } else if (parts.slice(0, 3).every(integerRegEx.test.bind(integerRegEx))) {\n red = parseInt(parts[0], 10);\n green = parseInt(parts[1], 10);\n blue = parseInt(parts[2], 10);\n alpha = parseFloat(parts[3]);\n } else {\n return undefined;\n }\n if (isNaN(alpha)) {\n alpha = 1;\n }\n red = Math.min(255, Math.max(0, red));\n green = Math.min(255, Math.max(0, green));\n blue = Math.min(255, Math.max(0, blue));\n alpha = Math.min(1, Math.max(0, alpha));\n if (alpha === 1) {\n return 'rgb(' + red + ', ' + green + ', ' + blue + ')';\n }\n return 'rgba(' + red + ', ' + green + ', ' + blue + ', ' + alpha + ')';\n }\n\n res = colorRegEx4.exec(val);\n if (res) {\n const [, _hue, _saturation, _lightness, _alphaString = ''] = res;\n const _alpha = parseFloat(_alphaString.replace(',', '').trim());\n if (!_hue || !_saturation || !_lightness) {\n return undefined;\n }\n hue = parseFloat(_hue);\n saturation = parseInt(_saturation, 10);\n lightness = parseInt(_lightness, 10);\n if (_alpha && numberRegEx.test(_alpha)) {\n alpha = parseFloat(_alpha);\n }\n\n const [r, g, b] = hslToRgb(hue, saturation / 100, lightness / 100);\n if (!_alphaString || alpha === 1) {\n return 'rgb(' + r + ', ' + g + ', ' + b + ')';\n }\n return 'rgba(' + r + ', ' + g + ', ' + b + ', ' + alpha + ')';\n }\n\n if (type === exports.TYPES.COLOR) {\n return val;\n }\n return undefined;\n};\n\nexports.parseAngle = function parseAngle(val) {\n var type = exports.valueType(val);\n if (type === exports.TYPES.NULL_OR_EMPTY_STR) {\n return val;\n }\n if (type !== exports.TYPES.ANGLE) {\n return undefined;\n }\n var res = angleRegEx.exec(val);\n var flt = parseFloat(res[1]);\n if (res[2] === 'rad') {\n flt *= 180 / Math.PI;\n } else if (res[2] === 'grad') {\n flt *= 360 / 400;\n }\n\n while (flt < 0) {\n flt += 360;\n }\n while (flt > 360) {\n flt -= 360;\n }\n return flt + 'deg';\n};\n\nexports.parseKeyword = function parseKeyword(val, valid_keywords) {\n var type = exports.valueType(val);\n if (type === exports.TYPES.NULL_OR_EMPTY_STR) {\n return val;\n }\n if (type !== exports.TYPES.KEYWORD) {\n return undefined;\n }\n val = val.toString().toLowerCase();\n var i;\n for (i = 0; i < valid_keywords.length; i++) {\n if (valid_keywords[i].toLowerCase() === val) {\n return valid_keywords[i];\n }\n }\n return undefined;\n};\n\n// utility to translate from border-width to borderWidth\nvar dashedToCamelCase = function(dashed) {\n var i;\n var camel = '';\n var nextCap = false;\n for (i = 0; i < dashed.length; i++) {\n if (dashed[i] !== '-') {\n camel += nextCap ? dashed[i].toUpperCase() : dashed[i];\n nextCap = false;\n } else {\n nextCap = true;\n }\n }\n return camel;\n};\nexports.dashedToCamelCase = dashedToCamelCase;\n\nvar is_space = /\\s/;\nvar opening_deliminators = ['\"', \"'\", '('];\nvar closing_deliminators = ['\"', \"'\", ')'];\n// this splits on whitespace, but keeps quoted and parened parts together\nvar getParts = function(str) {\n var deliminator_stack = [];\n var length = str.length;\n var i;\n var parts = [];\n var current_part = '';\n var opening_index;\n var closing_index;\n for (i = 0; i < length; i++) {\n opening_index = opening_deliminators.indexOf(str[i]);\n closing_index = closing_deliminators.indexOf(str[i]);\n if (is_space.test(str[i])) {\n if (deliminator_stack.length === 0) {\n if (current_part !== '') {\n parts.push(current_part);\n }\n current_part = '';\n } else {\n current_part += str[i];\n }\n } else {\n if (str[i] === '\\\\') {\n i++;\n current_part += str[i];\n } else {\n current_part += str[i];\n if (\n closing_index !== -1 &&\n closing_index === deliminator_stack[deliminator_stack.length - 1]\n ) {\n deliminator_stack.pop();\n } else if (opening_index !== -1) {\n deliminator_stack.push(opening_index);\n }\n }\n }\n }\n if (current_part !== '') {\n parts.push(current_part);\n }\n return parts;\n};\n\n/*\n * this either returns undefined meaning that it isn't valid\n * or returns an object where the keys are dashed short\n * hand properties and the values are the values to set\n * on them\n */\nexports.shorthandParser = function parse(v, shorthand_for) {\n var obj = {};\n var type = exports.valueType(v);\n if (type === exports.TYPES.NULL_OR_EMPTY_STR) {\n Object.keys(shorthand_for).forEach(function(property) {\n obj[property] = '';\n });\n return obj;\n }\n\n if (typeof v === 'number') {\n v = v.toString();\n }\n\n if (typeof v !== 'string') {\n return undefined;\n }\n\n if (v.toLowerCase() === 'inherit') {\n return {};\n }\n var parts = getParts(v);\n var valid = true;\n parts.forEach(function(part, i) {\n var part_valid = false;\n Object.keys(shorthand_for).forEach(function(property) {\n if (shorthand_for[property].isValid(part, i)) {\n part_valid = true;\n obj[property] = part;\n }\n });\n valid = valid && part_valid;\n });\n if (!valid) {\n return undefined;\n }\n return obj;\n};\n\nexports.shorthandSetter = function(property, shorthand_for) {\n return function(v) {\n var obj = exports.shorthandParser(v, shorthand_for);\n if (obj === undefined) {\n return;\n }\n //console.log('shorthandSetter for:', property, 'obj:', obj);\n Object.keys(obj).forEach(function(subprop) {\n // in case subprop is an implicit property, this will clear\n // *its* subpropertiesX\n var camel = dashedToCamelCase(subprop);\n this[camel] = obj[subprop];\n // in case it gets translated into something else (0 -> 0px)\n obj[subprop] = this[camel];\n this.removeProperty(subprop);\n // don't add in empty properties\n if (obj[subprop] !== '') {\n this._values[subprop] = obj[subprop];\n }\n }, this);\n Object.keys(shorthand_for).forEach(function(subprop) {\n if (!obj.hasOwnProperty(subprop)) {\n this.removeProperty(subprop);\n delete this._values[subprop];\n }\n }, this);\n // in case the value is something like 'none' that removes all values,\n // check that the generated one is not empty, first remove the property\n // if it already exists, then call the shorthandGetter, if it's an empty\n // string, don't set the property\n this.removeProperty(property);\n var calculated = exports.shorthandGetter(property, shorthand_for).call(this);\n if (calculated !== '') {\n this._setProperty(property, calculated);\n }\n };\n};\n\nexports.shorthandGetter = function(property, shorthand_for) {\n return function() {\n if (this._values[property] !== undefined) {\n return this.getPropertyValue(property);\n }\n return Object.keys(shorthand_for)\n .map(function(subprop) {\n return this.getPropertyValue(subprop);\n }, this)\n .filter(function(value) {\n return value !== '';\n })\n .join(' ');\n };\n};\n\n// isValid(){1,4} | inherit\n// if one, it applies to all\n// if two, the first applies to the top and bottom, and the second to left and right\n// if three, the first applies to the top, the second to left and right, the third bottom\n// if four, top, right, bottom, left\nexports.implicitSetter = function(property_before, property_after, isValid, parser) {\n property_after = property_after || '';\n if (property_after !== '') {\n property_after = '-' + property_after;\n }\n var part_names = ['top', 'right', 'bottom', 'left'];\n\n return function(v) {\n if (typeof v === 'number') {\n v = v.toString();\n }\n if (typeof v !== 'string') {\n return undefined;\n }\n var parts;\n if (v.toLowerCase() === 'inherit' || v === '') {\n parts = [v];\n } else {\n parts = getParts(v);\n }\n if (parts.length < 1 || parts.length > 4) {\n return undefined;\n }\n\n if (!parts.every(isValid)) {\n return undefined;\n }\n\n parts = parts.map(function(part) {\n return parser(part);\n });\n this._setProperty(property_before + property_after, parts.join(' '));\n if (parts.length === 1) {\n parts[1] = parts[0];\n }\n if (parts.length === 2) {\n parts[2] = parts[0];\n }\n if (parts.length === 3) {\n parts[3] = parts[1];\n }\n\n for (var i = 0; i < 4; i++) {\n var property = property_before + '-' + part_names[i] + property_after;\n this.removeProperty(property);\n if (parts[i] !== '') {\n this._values[property] = parts[i];\n }\n }\n return v;\n };\n};\n\n//\n// Companion to implicitSetter, but for the individual parts.\n// This sets the individual value, and checks to see if all four\n// sub-parts are set. If so, it sets the shorthand version and removes\n// the individual parts from the cssText.\n//\nexports.subImplicitSetter = function(prefix, part, isValid, parser) {\n var property = prefix + '-' + part;\n var subparts = [prefix + '-top', prefix + '-right', prefix + '-bottom', prefix + '-left'];\n\n return function(v) {\n if (typeof v === 'number') {\n v = v.toString();\n }\n if (typeof v !== 'string') {\n return undefined;\n }\n if (!isValid(v)) {\n return undefined;\n }\n v = parser(v);\n this._setProperty(property, v);\n var parts = [];\n for (var i = 0; i < 4; i++) {\n if (this._values[subparts[i]] == null || this._values[subparts[i]] === '') {\n break;\n }\n parts.push(this._values[subparts[i]]);\n }\n if (parts.length === 4) {\n for (i = 0; i < 4; i++) {\n this.removeProperty(subparts[i]);\n this._values[subparts[i]] = parts[i];\n }\n this._setProperty(prefix, parts.join(' '));\n }\n return v;\n };\n};\n\nvar camel_to_dashed = /[A-Z]/g;\nvar first_segment = /^\\([^-]\\)-/;\nvar vendor_prefixes = ['o', 'moz', 'ms', 'webkit'];\nexports.camelToDashed = function(camel_case) {\n var match;\n var dashed = camel_case.replace(camel_to_dashed, '-$&').toLowerCase();\n match = dashed.match(first_segment);\n if (match && vendor_prefixes.indexOf(match[1]) !== -1) {\n dashed = '-' + dashed;\n }\n return dashed;\n};\n","'use strict';\n\n// autogenerated - 4/29/2020\n\n/*\n *\n * https://www.w3.org/Style/CSS/all-properties.en.html\n */\n\nvar external_dependency_parsers_0 = require(\"./parsers.js\");\n\nvar external_dependency_constants_1 = require(\"./constants.js\");\n\nvar azimuth_export_definition;\nazimuth_export_definition = {\n set: function (v) {\n var valueType = external_dependency_parsers_0.valueType(v);\n\n if (valueType === external_dependency_parsers_0.TYPES.ANGLE) {\n return this._setProperty('azimuth', external_dependency_parsers_0.parseAngle(v));\n }\n\n if (valueType === external_dependency_parsers_0.TYPES.KEYWORD) {\n var keywords = v.toLowerCase().trim().split(/\\s+/);\n var hasBehind = false;\n\n if (keywords.length > 2) {\n return;\n }\n\n var behindIndex = keywords.indexOf('behind');\n hasBehind = behindIndex !== -1;\n\n if (keywords.length === 2) {\n if (!hasBehind) {\n return;\n }\n\n keywords.splice(behindIndex, 1);\n }\n\n if (keywords[0] === 'leftwards' || keywords[0] === 'rightwards') {\n if (hasBehind) {\n return;\n }\n\n return this._setProperty('azimuth', keywords[0]);\n }\n\n if (keywords[0] === 'behind') {\n return this._setProperty('azimuth', '180deg');\n }\n\n switch (keywords[0]) {\n case 'left-side':\n return this._setProperty('azimuth', '270deg');\n\n case 'far-left':\n return this._setProperty('azimuth', (hasBehind ? 240 : 300) + 'deg');\n\n case 'left':\n return this._setProperty('azimuth', (hasBehind ? 220 : 320) + 'deg');\n\n case 'center-left':\n return this._setProperty('azimuth', (hasBehind ? 200 : 340) + 'deg');\n\n case 'center':\n return this._setProperty('azimuth', (hasBehind ? 180 : 0) + 'deg');\n\n case 'center-right':\n return this._setProperty('azimuth', (hasBehind ? 160 : 20) + 'deg');\n\n case 'right':\n return this._setProperty('azimuth', (hasBehind ? 140 : 40) + 'deg');\n\n case 'far-right':\n return this._setProperty('azimuth', (hasBehind ? 120 : 60) + 'deg');\n\n case 'right-side':\n return this._setProperty('azimuth', '90deg');\n\n default:\n return;\n }\n }\n },\n get: function () {\n return this.getPropertyValue('azimuth');\n },\n enumerable: true,\n configurable: true\n};\nvar backgroundColor_export_isValid, backgroundColor_export_definition;\n\nvar backgroundColor_local_var_parse = function parse(v) {\n var parsed = external_dependency_parsers_0.parseColor(v);\n\n if (parsed !== undefined) {\n return parsed;\n }\n\n if (external_dependency_parsers_0.valueType(v) === external_dependency_parsers_0.TYPES.KEYWORD && (v.toLowerCase() === 'transparent' || v.toLowerCase() === 'inherit')) {\n return v;\n }\n\n return undefined;\n};\n\nbackgroundColor_export_isValid = function isValid(v) {\n return backgroundColor_local_var_parse(v) !== undefined;\n};\n\nbackgroundColor_export_definition = {\n set: function (v) {\n var parsed = backgroundColor_local_var_parse(v);\n\n if (parsed === undefined) {\n return;\n }\n\n this._setProperty('background-color', parsed);\n },\n get: function () {\n return this.getPropertyValue('background-color');\n },\n enumerable: true,\n configurable: true\n};\nvar backgroundImage_export_isValid, backgroundImage_export_definition;\n\nvar backgroundImage_local_var_parse = function parse(v) {\n var parsed = external_dependency_parsers_0.parseUrl(v);\n\n if (parsed !== undefined) {\n return parsed;\n }\n\n if (external_dependency_parsers_0.valueType(v) === external_dependency_parsers_0.TYPES.KEYWORD && (v.toLowerCase() === 'none' || v.toLowerCase() === 'inherit')) {\n return v;\n }\n\n return undefined;\n};\n\nbackgroundImage_export_isValid = function isValid(v) {\n return backgroundImage_local_var_parse(v) !== undefined;\n};\n\nbackgroundImage_export_definition = {\n set: function (v) {\n this._setProperty('background-image', backgroundImage_local_var_parse(v));\n },\n get: function () {\n return this.getPropertyValue('background-image');\n },\n enumerable: true,\n configurable: true\n};\nvar backgroundRepeat_export_isValid, backgroundRepeat_export_definition;\n\nvar backgroundRepeat_local_var_parse = function parse(v) {\n if (external_dependency_parsers_0.valueType(v) === external_dependency_parsers_0.TYPES.KEYWORD && (v.toLowerCase() === 'repeat' || v.toLowerCase() === 'repeat-x' || v.toLowerCase() === 'repeat-y' || v.toLowerCase() === 'no-repeat' || v.toLowerCase() === 'inherit')) {\n return v;\n }\n\n return undefined;\n};\n\nbackgroundRepeat_export_isValid = function isValid(v) {\n return backgroundRepeat_local_var_parse(v) !== undefined;\n};\n\nbackgroundRepeat_export_definition = {\n set: function (v) {\n this._setProperty('background-repeat', backgroundRepeat_local_var_parse(v));\n },\n get: function () {\n return this.getPropertyValue('background-repeat');\n },\n enumerable: true,\n configurable: true\n};\nvar backgroundAttachment_export_isValid, backgroundAttachment_export_definition;\n\nvar backgroundAttachment_local_var_isValid = backgroundAttachment_export_isValid = function isValid(v) {\n return external_dependency_parsers_0.valueType(v) === external_dependency_parsers_0.TYPES.KEYWORD && (v.toLowerCase() === 'scroll' || v.toLowerCase() === 'fixed' || v.toLowerCase() === 'inherit');\n};\n\nbackgroundAttachment_export_definition = {\n set: function (v) {\n if (!backgroundAttachment_local_var_isValid(v)) {\n return;\n }\n\n this._setProperty('background-attachment', v);\n },\n get: function () {\n return this.getPropertyValue('background-attachment');\n },\n enumerable: true,\n configurable: true\n};\nvar backgroundPosition_export_isValid, backgroundPosition_export_definition;\nvar backgroundPosition_local_var_valid_keywords = ['top', 'center', 'bottom', 'left', 'right'];\n\nvar backgroundPosition_local_var_parse = function parse(v) {\n if (v === '' || v === null) {\n return undefined;\n }\n\n var parts = v.split(/\\s+/);\n\n if (parts.length > 2 || parts.length < 1) {\n return undefined;\n }\n\n var types = [];\n parts.forEach(function (part, index) {\n types[index] = external_dependency_parsers_0.valueType(part);\n });\n\n if (parts.length === 1) {\n if (types[0] === external_dependency_parsers_0.TYPES.LENGTH || types[0] === external_dependency_parsers_0.TYPES.PERCENT) {\n return v;\n }\n\n if (types[0] === external_dependency_parsers_0.TYPES.KEYWORD) {\n if (backgroundPosition_local_var_valid_keywords.indexOf(v.toLowerCase()) !== -1 || v.toLowerCase() === 'inherit') {\n return v;\n }\n }\n\n return undefined;\n }\n\n if ((types[0] === external_dependency_parsers_0.TYPES.LENGTH || types[0] === external_dependency_parsers_0.TYPES.PERCENT) && (types[1] === external_dependency_parsers_0.TYPES.LENGTH || types[1] === external_dependency_parsers_0.TYPES.PERCENT)) {\n return v;\n }\n\n if (types[0] !== external_dependency_parsers_0.TYPES.KEYWORD || types[1] !== external_dependency_parsers_0.TYPES.KEYWORD) {\n return undefined;\n }\n\n if (backgroundPosition_local_var_valid_keywords.indexOf(parts[0]) !== -1 && backgroundPosition_local_var_valid_keywords.indexOf(parts[1]) !== -1) {\n return v;\n }\n\n return undefined;\n};\n\nbackgroundPosition_export_isValid = function isValid(v) {\n return backgroundPosition_local_var_parse(v) !== undefined;\n};\n\nbackgroundPosition_export_definition = {\n set: function (v) {\n this._setProperty('background-position', backgroundPosition_local_var_parse(v));\n },\n get: function () {\n return this.getPropertyValue('background-position');\n },\n enumerable: true,\n configurable: true\n};\nvar background_export_definition;\nvar background_local_var_shorthand_for = {\n 'background-color': {\n isValid: backgroundColor_export_isValid,\n definition: backgroundColor_export_definition\n },\n 'background-image': {\n isValid: backgroundImage_export_isValid,\n definition: backgroundImage_export_definition\n },\n 'background-repeat': {\n isValid: backgroundRepeat_export_isValid,\n definition: backgroundRepeat_export_definition\n },\n 'background-attachment': {\n isValid: backgroundAttachment_export_isValid,\n definition: backgroundAttachment_export_definition\n },\n 'background-position': {\n isValid: backgroundPosition_export_isValid,\n definition: backgroundPosition_export_definition\n }\n};\nbackground_export_definition = {\n set: external_dependency_parsers_0.shorthandSetter('background', background_local_var_shorthand_for),\n get: external_dependency_parsers_0.shorthandGetter('background', background_local_var_shorthand_for),\n enumerable: true,\n configurable: true\n};\nvar borderWidth_export_isValid, borderWidth_export_definition;\n// the valid border-widths:\nvar borderWidth_local_var_widths = ['thin', 'medium', 'thick'];\n\nborderWidth_export_isValid = function parse(v) {\n var length = external_dependency_parsers_0.parseLength(v);\n\n if (length !== undefined) {\n return true;\n }\n\n if (typeof v !== 'string') {\n return false;\n }\n\n if (v === '') {\n return true;\n }\n\n v = v.toLowerCase();\n\n if (borderWidth_local_var_widths.indexOf(v) === -1) {\n return false;\n }\n\n return true;\n};\n\nvar borderWidth_local_var_isValid = borderWidth_export_isValid;\n\nvar borderWidth_local_var_parser = function (v) {\n var length = external_dependency_parsers_0.parseLength(v);\n\n if (length !== undefined) {\n return length;\n }\n\n if (borderWidth_local_var_isValid(v)) {\n return v.toLowerCase();\n }\n\n return undefined;\n};\n\nborderWidth_export_definition = {\n set: external_dependency_parsers_0.implicitSetter('border', 'width', borderWidth_local_var_isValid, borderWidth_local_var_parser),\n get: function () {\n return this.getPropertyValue('border-width');\n },\n enumerable: true,\n configurable: true\n};\nvar borderStyle_export_isValid, borderStyle_export_definition;\n// the valid border-styles:\nvar borderStyle_local_var_styles = ['none', 'hidden', 'dotted', 'dashed', 'solid', 'double', 'groove', 'ridge', 'inset', 'outset'];\n\nborderStyle_export_isValid = function parse(v) {\n return typeof v === 'string' && (v === '' || borderStyle_local_var_styles.indexOf(v) !== -1);\n};\n\nvar borderStyle_local_var_isValid = borderStyle_export_isValid;\n\nvar borderStyle_local_var_parser = function (v) {\n if (borderStyle_local_var_isValid(v)) {\n return v.toLowerCase();\n }\n\n return undefined;\n};\n\nborderStyle_export_definition = {\n set: external_dependency_parsers_0.implicitSetter('border', 'style', borderStyle_local_var_isValid, borderStyle_local_var_parser),\n get: function () {\n return this.getPropertyValue('border-style');\n },\n enumerable: true,\n configurable: true\n};\nvar borderColor_export_isValid, borderColor_export_definition;\n\nborderColor_export_isValid = function parse(v) {\n if (typeof v !== 'string') {\n return false;\n }\n\n return v === '' || v.toLowerCase() === 'transparent' || external_dependency_parsers_0.valueType(v) === external_dependency_parsers_0.TYPES.COLOR;\n};\n\nvar borderColor_local_var_isValid = borderColor_export_isValid;\n\nvar borderColor_local_var_parser = function (v) {\n if (borderColor_local_var_isValid(v)) {\n return v.toLowerCase();\n }\n\n return undefined;\n};\n\nborderColor_export_definition = {\n set: external_dependency_parsers_0.implicitSetter('border', 'color', borderColor_local_var_isValid, borderColor_local_var_parser),\n get: function () {\n return this.getPropertyValue('border-color');\n },\n enumerable: true,\n configurable: true\n};\nvar border_export_definition;\nvar border_local_var_shorthand_for = {\n 'border-width': {\n isValid: borderWidth_export_isValid,\n definition: borderWidth_export_definition\n },\n 'border-style': {\n isValid: borderStyle_export_isValid,\n definition: borderStyle_export_definition\n },\n 'border-color': {\n isValid: borderColor_export_isValid,\n definition: borderColor_export_definition\n }\n};\nvar border_local_var_myShorthandSetter = external_dependency_parsers_0.shorthandSetter('border', border_local_var_shorthand_for);\nvar border_local_var_myShorthandGetter = external_dependency_parsers_0.shorthandGetter('border', border_local_var_shorthand_for);\nborder_export_definition = {\n set: function (v) {\n if (v.toString().toLowerCase() === 'none') {\n v = '';\n }\n\n border_local_var_myShorthandSetter.call(this, v);\n this.removeProperty('border-top');\n this.removeProperty('border-left');\n this.removeProperty('border-right');\n this.removeProperty('border-bottom');\n this._values['border-top'] = this._values.border;\n this._values['border-left'] = this._values.border;\n this._values['border-right'] = this._values.border;\n this._values['border-bottom'] = this._values.border;\n },\n get: border_local_var_myShorthandGetter,\n enumerable: true,\n configurable: true\n};\nvar borderBottomWidth_export_isValid, borderBottomWidth_export_definition;\nvar borderBottomWidth_local_var_isValid = borderBottomWidth_export_isValid = borderWidth_export_isValid;\nborderBottomWidth_export_definition = {\n set: function (v) {\n if (borderBottomWidth_local_var_isValid(v)) {\n this._setProperty('border-bottom-width', v);\n }\n },\n get: function () {\n return this.getPropertyValue('border-bottom-width');\n },\n enumerable: true,\n configurable: true\n};\nvar borderBottomStyle_export_isValid, borderBottomStyle_export_definition;\nborderBottomStyle_export_isValid = borderStyle_export_isValid;\nborderBottomStyle_export_definition = {\n set: function (v) {\n if (borderStyle_export_isValid(v)) {\n if (v.toLowerCase() === 'none') {\n v = '';\n this.removeProperty('border-bottom-width');\n }\n\n this._setProperty('border-bottom-style', v);\n }\n },\n get: function () {\n return this.getPropertyValue('border-bottom-style');\n },\n enumerable: true,\n configurable: true\n};\nvar borderBottomColor_export_isValid, borderBottomColor_export_definition;\nvar borderBottomColor_local_var_isValid = borderBottomColor_export_isValid = borderColor_export_isValid;\nborderBottomColor_export_definition = {\n set: function (v) {\n if (borderBottomColor_local_var_isValid(v)) {\n this._setProperty('border-bottom-color', v);\n }\n },\n get: function () {\n return this.getPropertyValue('border-bottom-color');\n },\n enumerable: true,\n configurable: true\n};\nvar borderBottom_export_definition;\nvar borderBottom_local_var_shorthand_for = {\n 'border-bottom-width': {\n isValid: borderBottomWidth_export_isValid,\n definition: borderBottomWidth_export_definition\n },\n 'border-bottom-style': {\n isValid: borderBottomStyle_export_isValid,\n definition: borderBottomStyle_export_definition\n },\n 'border-bottom-color': {\n isValid: borderBottomColor_export_isValid,\n definition: borderBottomColor_export_definition\n }\n};\nborderBottom_export_definition = {\n set: external_dependency_parsers_0.shorthandSetter('border-bottom', borderBottom_local_var_shorthand_for),\n get: external_dependency_parsers_0.shorthandGetter('border-bottom', borderBottom_local_var_shorthand_for),\n enumerable: true,\n configurable: true\n};\nvar borderCollapse_export_definition;\n\nvar borderCollapse_local_var_parse = function parse(v) {\n if (external_dependency_parsers_0.valueType(v) === external_dependency_parsers_0.TYPES.KEYWORD && (v.toLowerCase() === 'collapse' || v.toLowerCase() === 'separate' || v.toLowerCase() === 'inherit')) {\n return v;\n }\n\n return undefined;\n};\n\nborderCollapse_export_definition = {\n set: function (v) {\n this._setProperty('border-collapse', borderCollapse_local_var_parse(v));\n },\n get: function () {\n return this.getPropertyValue('border-collapse');\n },\n enumerable: true,\n configurable: true\n};\nvar borderLeftWidth_export_isValid, borderLeftWidth_export_definition;\nvar borderLeftWidth_local_var_isValid = borderLeftWidth_export_isValid = borderWidth_export_isValid;\nborderLeftWidth_export_definition = {\n set: function (v) {\n if (borderLeftWidth_local_var_isValid(v)) {\n this._setProperty('border-left-width', v);\n }\n },\n get: function () {\n return this.getPropertyValue('border-left-width');\n },\n enumerable: true,\n configurable: true\n};\nvar borderLeftStyle_export_isValid, borderLeftStyle_export_definition;\nborderLeftStyle_export_isValid = borderStyle_export_isValid;\nborderLeftStyle_export_definition = {\n set: function (v) {\n if (borderStyle_export_isValid(v)) {\n if (v.toLowerCase() === 'none') {\n v = '';\n this.removeProperty('border-left-width');\n }\n\n this._setProperty('border-left-style', v);\n }\n },\n get: function () {\n return this.getPropertyValue('border-left-style');\n },\n enumerable: true,\n configurable: true\n};\nvar borderLeftColor_export_isValid, borderLeftColor_export_definition;\nvar borderLeftColor_local_var_isValid = borderLeftColor_export_isValid = borderColor_export_isValid;\nborderLeftColor_export_definition = {\n set: function (v) {\n if (borderLeftColor_local_var_isValid(v)) {\n this._setProperty('border-left-color', v);\n }\n },\n get: function () {\n return this.getPropertyValue('border-left-color');\n },\n enumerable: true,\n configurable: true\n};\nvar borderLeft_export_definition;\nvar borderLeft_local_var_shorthand_for = {\n 'border-left-width': {\n isValid: borderLeftWidth_export_isValid,\n definition: borderLeftWidth_export_definition\n },\n 'border-left-style': {\n isValid: borderLeftStyle_export_isValid,\n definition: borderLeftStyle_export_definition\n },\n 'border-left-color': {\n isValid: borderLeftColor_export_isValid,\n definition: borderLeftColor_export_definition\n }\n};\nborderLeft_export_definition = {\n set: external_dependency_parsers_0.shorthandSetter('border-left', borderLeft_local_var_shorthand_for),\n get: external_dependency_parsers_0.shorthandGetter('border-left', borderLeft_local_var_shorthand_for),\n enumerable: true,\n configurable: true\n};\nvar borderRightWidth_export_isValid, borderRightWidth_export_definition;\nvar borderRightWidth_local_var_isValid = borderRightWidth_export_isValid = borderWidth_export_isValid;\nborderRightWidth_export_definition = {\n set: function (v) {\n if (borderRightWidth_local_var_isValid(v)) {\n this._setProperty('border-right-width', v);\n }\n },\n get: function () {\n return this.getPropertyValue('border-right-width');\n },\n enumerable: true,\n configurable: true\n};\nvar borderRightStyle_export_isValid, borderRightStyle_export_definition;\nborderRightStyle_export_isValid = borderStyle_export_isValid;\nborderRightStyle_export_definition = {\n set: function (v) {\n if (borderStyle_export_isValid(v)) {\n if (v.toLowerCase() === 'none') {\n v = '';\n this.removeProperty('border-right-width');\n }\n\n this._setProperty('border-right-style', v);\n }\n },\n get: function () {\n return this.getPropertyValue('border-right-style');\n },\n enumerable: true,\n configurable: true\n};\nvar borderRightColor_export_isValid, borderRightColor_export_definition;\nvar borderRightColor_local_var_isValid = borderRightColor_export_isValid = borderColor_export_isValid;\nborderRightColor_export_definition = {\n set: function (v) {\n if (borderRightColor_local_var_isValid(v)) {\n this._setProperty('border-right-color', v);\n }\n },\n get: function () {\n return this.getPropertyValue('border-right-color');\n },\n enumerable: true,\n configurable: true\n};\nvar borderRight_export_definition;\nvar borderRight_local_var_shorthand_for = {\n 'border-right-width': {\n isValid: borderRightWidth_export_isValid,\n definition: borderRightWidth_export_definition\n },\n 'border-right-style': {\n isValid: borderRightStyle_export_isValid,\n definition: borderRightStyle_export_definition\n },\n 'border-right-color': {\n isValid: borderRightColor_export_isValid,\n definition: borderRightColor_export_definition\n }\n};\nborderRight_export_definition = {\n set: external_dependency_parsers_0.shorthandSetter('border-right', borderRight_local_var_shorthand_for),\n get: external_dependency_parsers_0.shorthandGetter('border-right', borderRight_local_var_shorthand_for),\n enumerable: true,\n configurable: true\n};\nvar borderSpacing_export_definition;\n\n// ? | inherit\n// if one, it applies to both horizontal and verical spacing\n// if two, the first applies to the horizontal and the second applies to vertical spacing\nvar borderSpacing_local_var_parse = function parse(v) {\n if (v === '' || v === null) {\n return undefined;\n }\n\n if (v === 0) {\n return '0px';\n }\n\n if (v.toLowerCase() === 'inherit') {\n return v;\n }\n\n var parts = v.split(/\\s+/);\n\n if (parts.length !== 1 && parts.length !== 2) {\n return undefined;\n }\n\n parts.forEach(function (part) {\n if (external_dependency_parsers_0.valueType(part) !== external_dependency_parsers_0.TYPES.LENGTH) {\n return undefined;\n }\n });\n return v;\n};\n\nborderSpacing_export_definition = {\n set: function (v) {\n this._setProperty('border-spacing', borderSpacing_local_var_parse(v));\n },\n get: function () {\n return this.getPropertyValue('border-spacing');\n },\n enumerable: true,\n configurable: true\n};\nvar borderTopWidth_export_isValid, borderTopWidth_export_definition;\nborderTopWidth_export_isValid = borderWidth_export_isValid;\nborderTopWidth_export_definition = {\n set: function (v) {\n if (borderWidth_export_isValid(v)) {\n this._setProperty('border-top-width', v);\n }\n },\n get: function () {\n return this.getPropertyValue('border-top-width');\n },\n enumerable: true,\n configurable: true\n};\nvar borderTopStyle_export_isValid, borderTopStyle_export_definition;\nborderTopStyle_export_isValid = borderStyle_export_isValid;\nborderTopStyle_export_definition = {\n set: function (v) {\n if (borderStyle_export_isValid(v)) {\n if (v.toLowerCase() === 'none') {\n v = '';\n this.removeProperty('border-top-width');\n }\n\n this._setProperty('border-top-style', v);\n }\n },\n get: function () {\n return this.getPropertyValue('border-top-style');\n },\n enumerable: true,\n configurable: true\n};\nvar borderTopColor_export_isValid, borderTopColor_export_definition;\nvar borderTopColor_local_var_isValid = borderTopColor_export_isValid = borderColor_export_isValid;\nborderTopColor_export_definition = {\n set: function (v) {\n if (borderTopColor_local_var_isValid(v)) {\n this._setProperty('border-top-color', v);\n }\n },\n get: function () {\n return this.getPropertyValue('border-top-color');\n },\n enumerable: true,\n configurable: true\n};\nvar borderTop_export_definition;\nvar borderTop_local_var_shorthand_for = {\n 'border-top-width': {\n isValid: borderTopWidth_export_isValid,\n definition: borderTopWidth_export_definition\n },\n 'border-top-style': {\n isValid: borderTopStyle_export_isValid,\n definition: borderTopStyle_export_definition\n },\n 'border-top-color': {\n isValid: borderTopColor_export_isValid,\n definition: borderTopColor_export_definition\n }\n};\nborderTop_export_definition = {\n set: external_dependency_parsers_0.shorthandSetter('border-top', borderTop_local_var_shorthand_for),\n get: external_dependency_parsers_0.shorthandGetter('border-top', borderTop_local_var_shorthand_for),\n enumerable: true,\n configurable: true\n};\nvar bottom_export_definition;\nbottom_export_definition = {\n set: function (v) {\n this._setProperty('bottom', external_dependency_parsers_0.parseMeasurement(v));\n },\n get: function () {\n return this.getPropertyValue('bottom');\n },\n enumerable: true,\n configurable: true\n};\nvar clear_export_definition;\nvar clear_local_var_clear_keywords = ['none', 'left', 'right', 'both', 'inherit'];\nclear_export_definition = {\n set: function (v) {\n this._setProperty('clear', external_dependency_parsers_0.parseKeyword(v, clear_local_var_clear_keywords));\n },\n get: function () {\n return this.getPropertyValue('clear');\n },\n enumerable: true,\n configurable: true\n};\nvar clip_export_definition;\nvar clip_local_var_shape_regex = /^rect\\((.*)\\)$/i;\n\nvar clip_local_var_parse = function (val) {\n if (val === '' || val === null) {\n return val;\n }\n\n if (typeof val !== 'string') {\n return undefined;\n }\n\n val = val.toLowerCase();\n\n if (val === 'auto' || val === 'inherit') {\n return val;\n }\n\n var matches = val.match(clip_local_var_shape_regex);\n\n if (!matches) {\n return undefined;\n }\n\n var parts = matches[1].split(/\\s*,\\s*/);\n\n if (parts.length !== 4) {\n return undefined;\n }\n\n var valid = parts.every(function (part, index) {\n var measurement = external_dependency_parsers_0.parseMeasurement(part);\n parts[index] = measurement;\n return measurement !== undefined;\n });\n\n if (!valid) {\n return undefined;\n }\n\n parts = parts.join(', ');\n return val.replace(matches[1], parts);\n};\n\nclip_export_definition = {\n set: function (v) {\n this._setProperty('clip', clip_local_var_parse(v));\n },\n get: function () {\n return this.getPropertyValue('clip');\n },\n enumerable: true,\n configurable: true\n};\nvar color_export_definition;\ncolor_export_definition = {\n set: function (v) {\n this._setProperty('color', external_dependency_parsers_0.parseColor(v));\n },\n get: function () {\n return this.getPropertyValue('color');\n },\n enumerable: true,\n configurable: true\n};\nvar cssFloat_export_definition;\ncssFloat_export_definition = {\n set: function (v) {\n this._setProperty('float', v);\n },\n get: function () {\n return this.getPropertyValue('float');\n },\n enumerable: true,\n configurable: true\n};\nvar flexGrow_export_isValid, flexGrow_export_definition;\n\nflexGrow_export_isValid = function isValid(v, positionAtFlexShorthand) {\n return external_dependency_parsers_0.parseNumber(v) !== undefined && positionAtFlexShorthand === external_dependency_constants_1.POSITION_AT_SHORTHAND.first;\n};\n\nflexGrow_export_definition = {\n set: function (v) {\n this._setProperty('flex-grow', external_dependency_parsers_0.parseNumber(v));\n },\n get: function () {\n return this.getPropertyValue('flex-grow');\n },\n enumerable: true,\n configurable: true\n};\nvar flexShrink_export_isValid, flexShrink_export_definition;\n\nflexShrink_export_isValid = function isValid(v, positionAtFlexShorthand) {\n return external_dependency_parsers_0.parseNumber(v) !== undefined && positionAtFlexShorthand === external_dependency_constants_1.POSITION_AT_SHORTHAND.second;\n};\n\nflexShrink_export_definition = {\n set: function (v) {\n this._setProperty('flex-shrink', external_dependency_parsers_0.parseNumber(v));\n },\n get: function () {\n return this.getPropertyValue('flex-shrink');\n },\n enumerable: true,\n configurable: true\n};\nvar flexBasis_export_isValid, flexBasis_export_definition;\n\nfunction flexBasis_local_fn_parse(v) {\n if (String(v).toLowerCase() === 'auto') {\n return 'auto';\n }\n\n if (String(v).toLowerCase() === 'inherit') {\n return 'inherit';\n }\n\n return external_dependency_parsers_0.parseMeasurement(v);\n}\n\nflexBasis_export_isValid = function isValid(v) {\n return flexBasis_local_fn_parse(v) !== undefined;\n};\n\nflexBasis_export_definition = {\n set: function (v) {\n this._setProperty('flex-basis', flexBasis_local_fn_parse(v));\n },\n get: function () {\n return this.getPropertyValue('flex-basis');\n },\n enumerable: true,\n configurable: true\n};\nvar flex_export_isValid, flex_export_definition;\nvar flex_local_var_shorthand_for = {\n 'flex-grow': {\n isValid: flexGrow_export_isValid,\n definition: flexGrow_export_definition\n },\n 'flex-shrink': {\n isValid: flexShrink_export_isValid,\n definition: flexShrink_export_definition\n },\n 'flex-basis': {\n isValid: flexBasis_export_isValid,\n definition: flexBasis_export_definition\n }\n};\nvar flex_local_var_myShorthandSetter = external_dependency_parsers_0.shorthandSetter('flex', flex_local_var_shorthand_for);\n\nflex_export_isValid = function isValid(v) {\n return external_dependency_parsers_0.shorthandParser(v, flex_local_var_shorthand_for) !== undefined;\n};\n\nflex_export_definition = {\n set: function (v) {\n var normalizedValue = String(v).trim().toLowerCase();\n\n if (normalizedValue === 'none') {\n flex_local_var_myShorthandSetter.call(this, '0 0 auto');\n return;\n }\n\n if (normalizedValue === 'initial') {\n flex_local_var_myShorthandSetter.call(this, '0 1 auto');\n return;\n }\n\n if (normalizedValue === 'auto') {\n this.removeProperty('flex-grow');\n this.removeProperty('flex-shrink');\n this.setProperty('flex-basis', normalizedValue);\n return;\n }\n\n flex_local_var_myShorthandSetter.call(this, v);\n },\n get: external_dependency_parsers_0.shorthandGetter('flex', flex_local_var_shorthand_for),\n enumerable: true,\n configurable: true\n};\nvar float_export_definition;\nfloat_export_definition = {\n set: function (v) {\n this._setProperty('float', v);\n },\n get: function () {\n return this.getPropertyValue('float');\n },\n enumerable: true,\n configurable: true\n};\nvar floodColor_export_definition;\nfloodColor_export_definition = {\n set: function (v) {\n this._setProperty('flood-color', external_dependency_parsers_0.parseColor(v));\n },\n get: function () {\n return this.getPropertyValue('flood-color');\n },\n enumerable: true,\n configurable: true\n};\nvar fontFamily_export_isValid, fontFamily_export_definition;\nvar fontFamily_local_var_partsRegEx = /\\s*,\\s*/;\n\nfontFamily_export_isValid = function isValid(v) {\n if (v === '' || v === null) {\n return true;\n }\n\n var parts = v.split(fontFamily_local_var_partsRegEx);\n var len = parts.length;\n var i;\n var type;\n\n for (i = 0; i < len; i++) {\n type = external_dependency_parsers_0.valueType(parts[i]);\n\n if (type === external_dependency_parsers_0.TYPES.STRING || type === external_dependency_parsers_0.TYPES.KEYWORD) {\n return true;\n }\n }\n\n return false;\n};\n\nfontFamily_export_definition = {\n set: function (v) {\n this._setProperty('font-family', v);\n },\n get: function () {\n return this.getPropertyValue('font-family');\n },\n enumerable: true,\n configurable: true\n};\nvar fontSize_export_isValid, fontSize_export_definition;\nvar fontSize_local_var_absoluteSizes = ['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'];\nvar fontSize_local_var_relativeSizes = ['larger', 'smaller'];\n\nfontSize_export_isValid = function (v) {\n var type = external_dependency_parsers_0.valueType(v.toLowerCase());\n return type === external_dependency_parsers_0.TYPES.LENGTH || type === external_dependency_parsers_0.TYPES.PERCENT || type === external_dependency_parsers_0.TYPES.KEYWORD && fontSize_local_var_absoluteSizes.indexOf(v.toLowerCase()) !== -1 || type === external_dependency_parsers_0.TYPES.KEYWORD && fontSize_local_var_relativeSizes.indexOf(v.toLowerCase()) !== -1;\n};\n\nfunction fontSize_local_fn_parse(v) {\n const valueAsString = String(v).toLowerCase();\n const optionalArguments = fontSize_local_var_absoluteSizes.concat(fontSize_local_var_relativeSizes);\n const isOptionalArgument = optionalArguments.some(stringValue => stringValue.toLowerCase() === valueAsString);\n return isOptionalArgument ? valueAsString : external_dependency_parsers_0.parseMeasurement(v);\n}\n\nfontSize_export_definition = {\n set: function (v) {\n this._setProperty('font-size', fontSize_local_fn_parse(v));\n },\n get: function () {\n return this.getPropertyValue('font-size');\n },\n enumerable: true,\n configurable: true\n};\nvar fontStyle_export_isValid, fontStyle_export_definition;\nvar fontStyle_local_var_valid_styles = ['normal', 'italic', 'oblique', 'inherit'];\n\nfontStyle_export_isValid = function (v) {\n return fontStyle_local_var_valid_styles.indexOf(v.toLowerCase()) !== -1;\n};\n\nfontStyle_export_definition = {\n set: function (v) {\n this._setProperty('font-style', v);\n },\n get: function () {\n return this.getPropertyValue('font-style');\n },\n enumerable: true,\n configurable: true\n};\nvar fontVariant_export_isValid, fontVariant_export_definition;\nvar fontVariant_local_var_valid_variants = ['normal', 'small-caps', 'inherit'];\n\nfontVariant_export_isValid = function isValid(v) {\n return fontVariant_local_var_valid_variants.indexOf(v.toLowerCase()) !== -1;\n};\n\nfontVariant_export_definition = {\n set: function (v) {\n this._setProperty('font-variant', v);\n },\n get: function () {\n return this.getPropertyValue('font-variant');\n },\n enumerable: true,\n configurable: true\n};\nvar fontWeight_export_isValid, fontWeight_export_definition;\nvar fontWeight_local_var_valid_weights = ['normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '700', '800', '900', 'inherit'];\n\nfontWeight_export_isValid = function isValid(v) {\n return fontWeight_local_var_valid_weights.indexOf(v.toLowerCase()) !== -1;\n};\n\nfontWeight_export_definition = {\n set: function (v) {\n this._setProperty('font-weight', v);\n },\n get: function () {\n return this.getPropertyValue('font-weight');\n },\n enumerable: true,\n configurable: true\n};\nvar lineHeight_export_isValid, lineHeight_export_definition;\n\nlineHeight_export_isValid = function isValid(v) {\n var type = external_dependency_parsers_0.valueType(v);\n return type === external_dependency_parsers_0.TYPES.KEYWORD && v.toLowerCase() === 'normal' || v.toLowerCase() === 'inherit' || type === external_dependency_parsers_0.TYPES.NUMBER || type === external_dependency_parsers_0.TYPES.LENGTH || type === external_dependency_parsers_0.TYPES.PERCENT;\n};\n\nlineHeight_export_definition = {\n set: function (v) {\n this._setProperty('line-height', v);\n },\n get: function () {\n return this.getPropertyValue('line-height');\n },\n enumerable: true,\n configurable: true\n};\nvar font_export_definition;\nvar font_local_var_shorthand_for = {\n 'font-family': {\n isValid: fontFamily_export_isValid,\n definition: fontFamily_export_definition\n },\n 'font-size': {\n isValid: fontSize_export_isValid,\n definition: fontSize_export_definition\n },\n 'font-style': {\n isValid: fontStyle_export_isValid,\n definition: fontStyle_export_definition\n },\n 'font-variant': {\n isValid: fontVariant_export_isValid,\n definition: fontVariant_export_definition\n },\n 'font-weight': {\n isValid: fontWeight_export_isValid,\n definition: fontWeight_export_definition\n },\n 'line-height': {\n isValid: lineHeight_export_isValid,\n definition: lineHeight_export_definition\n }\n};\nvar font_local_var_static_fonts = ['caption', 'icon', 'menu', 'message-box', 'small-caption', 'status-bar', 'inherit'];\nvar font_local_var_setter = external_dependency_parsers_0.shorthandSetter('font', font_local_var_shorthand_for);\nfont_export_definition = {\n set: function (v) {\n var short = external_dependency_parsers_0.shorthandParser(v, font_local_var_shorthand_for);\n\n if (short !== undefined) {\n return font_local_var_setter.call(this, v);\n }\n\n if (external_dependency_parsers_0.valueType(v) === external_dependency_parsers_0.TYPES.KEYWORD && font_local_var_static_fonts.indexOf(v.toLowerCase()) !== -1) {\n this._setProperty('font', v);\n }\n },\n get: external_dependency_parsers_0.shorthandGetter('font', font_local_var_shorthand_for),\n enumerable: true,\n configurable: true\n};\nvar height_export_definition;\n\nfunction height_local_fn_parse(v) {\n if (String(v).toLowerCase() === 'auto') {\n return 'auto';\n }\n\n if (String(v).toLowerCase() === 'inherit') {\n return 'inherit';\n }\n\n return external_dependency_parsers_0.parseMeasurement(v);\n}\n\nheight_export_definition = {\n set: function (v) {\n this._setProperty('height', height_local_fn_parse(v));\n },\n get: function () {\n return this.getPropertyValue('height');\n },\n enumerable: true,\n configurable: true\n};\nvar left_export_definition;\nleft_export_definition = {\n set: function (v) {\n this._setProperty('left', external_dependency_parsers_0.parseMeasurement(v));\n },\n get: function () {\n return this.getPropertyValue('left');\n },\n enumerable: true,\n configurable: true\n};\nvar lightingColor_export_definition;\nlightingColor_export_definition = {\n set: function (v) {\n this._setProperty('lighting-color', external_dependency_parsers_0.parseColor(v));\n },\n get: function () {\n return this.getPropertyValue('lighting-color');\n },\n enumerable: true,\n configurable: true\n};\nvar margin_export_definition, margin_export_isValid, margin_export_parser;\nvar margin_local_var_TYPES = external_dependency_parsers_0.TYPES;\n\nvar margin_local_var_isValid = function (v) {\n if (v.toLowerCase() === 'auto') {\n return true;\n }\n\n var type = external_dependency_parsers_0.valueType(v);\n return type === margin_local_var_TYPES.LENGTH || type === margin_local_var_TYPES.PERCENT || type === margin_local_var_TYPES.INTEGER && (v === '0' || v === 0);\n};\n\nvar margin_local_var_parser = function (v) {\n var V = v.toLowerCase();\n\n if (V === 'auto') {\n return V;\n }\n\n return external_dependency_parsers_0.parseMeasurement(v);\n};\n\nvar margin_local_var_mySetter = external_dependency_parsers_0.implicitSetter('margin', '', margin_local_var_isValid, margin_local_var_parser);\nvar margin_local_var_myGlobal = external_dependency_parsers_0.implicitSetter('margin', '', function () {\n return true;\n}, function (v) {\n return v;\n});\nmargin_export_definition = {\n set: function (v) {\n if (typeof v === 'number') {\n v = String(v);\n }\n\n if (typeof v !== 'string') {\n return;\n }\n\n var V = v.toLowerCase();\n\n switch (V) {\n case 'inherit':\n case 'initial':\n case 'unset':\n case '':\n margin_local_var_myGlobal.call(this, V);\n break;\n\n default:\n margin_local_var_mySetter.call(this, v);\n break;\n }\n },\n get: function () {\n return this.getPropertyValue('margin');\n },\n enumerable: true,\n configurable: true\n};\nmargin_export_isValid = margin_local_var_isValid;\nmargin_export_parser = margin_local_var_parser;\nvar marginBottom_export_definition;\nmarginBottom_export_definition = {\n set: external_dependency_parsers_0.subImplicitSetter('margin', 'bottom', {\n definition: margin_export_definition,\n isValid: margin_export_isValid,\n parser: margin_export_parser\n }.isValid, {\n definition: margin_export_definition,\n isValid: margin_export_isValid,\n parser: margin_export_parser\n }.parser),\n get: function () {\n return this.getPropertyValue('margin-bottom');\n },\n enumerable: true,\n configurable: true\n};\nvar marginLeft_export_definition;\nmarginLeft_export_definition = {\n set: external_dependency_parsers_0.subImplicitSetter('margin', 'left', {\n definition: margin_export_definition,\n isValid: margin_export_isValid,\n parser: margin_export_parser\n }.isValid, {\n definition: margin_export_definition,\n isValid: margin_export_isValid,\n parser: margin_export_parser\n }.parser),\n get: function () {\n return this.getPropertyValue('margin-left');\n },\n enumerable: true,\n configurable: true\n};\nvar marginRight_export_definition;\nmarginRight_export_definition = {\n set: external_dependency_parsers_0.subImplicitSetter('margin', 'right', {\n definition: margin_export_definition,\n isValid: margin_export_isValid,\n parser: margin_export_parser\n }.isValid, {\n definition: margin_export_definition,\n isValid: margin_export_isValid,\n parser: margin_export_parser\n }.parser),\n get: function () {\n return this.getPropertyValue('margin-right');\n },\n enumerable: true,\n configurable: true\n};\nvar marginTop_export_definition;\nmarginTop_export_definition = {\n set: external_dependency_parsers_0.subImplicitSetter('margin', 'top', {\n definition: margin_export_definition,\n isValid: margin_export_isValid,\n parser: margin_export_parser\n }.isValid, {\n definition: margin_export_definition,\n isValid: margin_export_isValid,\n parser: margin_export_parser\n }.parser),\n get: function () {\n return this.getPropertyValue('margin-top');\n },\n enumerable: true,\n configurable: true\n};\nvar opacity_export_definition;\nopacity_export_definition = {\n set: function (v) {\n this._setProperty('opacity', external_dependency_parsers_0.parseNumber(v));\n },\n get: function () {\n return this.getPropertyValue('opacity');\n },\n enumerable: true,\n configurable: true\n};\nvar outlineColor_export_definition;\noutlineColor_export_definition = {\n set: function (v) {\n this._setProperty('outline-color', external_dependency_parsers_0.parseColor(v));\n },\n get: function () {\n return this.getPropertyValue('outline-color');\n },\n enumerable: true,\n configurable: true\n};\nvar padding_export_definition, padding_export_isValid, padding_export_parser;\nvar padding_local_var_TYPES = external_dependency_parsers_0.TYPES;\n\nvar padding_local_var_isValid = function (v) {\n var type = external_dependency_parsers_0.valueType(v);\n return type === padding_local_var_TYPES.LENGTH || type === padding_local_var_TYPES.PERCENT || type === padding_local_var_TYPES.INTEGER && (v === '0' || v === 0);\n};\n\nvar padding_local_var_parser = function (v) {\n return external_dependency_parsers_0.parseMeasurement(v);\n};\n\nvar padding_local_var_mySetter = external_dependency_parsers_0.implicitSetter('padding', '', padding_local_var_isValid, padding_local_var_parser);\nvar padding_local_var_myGlobal = external_dependency_parsers_0.implicitSetter('padding', '', function () {\n return true;\n}, function (v) {\n return v;\n});\npadding_export_definition = {\n set: function (v) {\n if (typeof v === 'number') {\n v = String(v);\n }\n\n if (typeof v !== 'string') {\n return;\n }\n\n var V = v.toLowerCase();\n\n switch (V) {\n case 'inherit':\n case 'initial':\n case 'unset':\n case '':\n padding_local_var_myGlobal.call(this, V);\n break;\n\n default:\n padding_local_var_mySetter.call(this, v);\n break;\n }\n },\n get: function () {\n return this.getPropertyValue('padding');\n },\n enumerable: true,\n configurable: true\n};\npadding_export_isValid = padding_local_var_isValid;\npadding_export_parser = padding_local_var_parser;\nvar paddingBottom_export_definition;\npaddingBottom_export_definition = {\n set: external_dependency_parsers_0.subImplicitSetter('padding', 'bottom', {\n definition: padding_export_definition,\n isValid: padding_export_isValid,\n parser: padding_export_parser\n }.isValid, {\n definition: padding_export_definition,\n isValid: padding_export_isValid,\n parser: padding_export_parser\n }.parser),\n get: function () {\n return this.getPropertyValue('padding-bottom');\n },\n enumerable: true,\n configurable: true\n};\nvar paddingLeft_export_definition;\npaddingLeft_export_definition = {\n set: external_dependency_parsers_0.subImplicitSetter('padding', 'left', {\n definition: padding_export_definition,\n isValid: padding_export_isValid,\n parser: padding_export_parser\n }.isValid, {\n definition: padding_export_definition,\n isValid: padding_export_isValid,\n parser: padding_export_parser\n }.parser),\n get: function () {\n return this.getPropertyValue('padding-left');\n },\n enumerable: true,\n configurable: true\n};\nvar paddingRight_export_definition;\npaddingRight_export_definition = {\n set: external_dependency_parsers_0.subImplicitSetter('padding', 'right', {\n definition: padding_export_definition,\n isValid: padding_export_isValid,\n parser: padding_export_parser\n }.isValid, {\n definition: padding_export_definition,\n isValid: padding_export_isValid,\n parser: padding_export_parser\n }.parser),\n get: function () {\n return this.getPropertyValue('padding-right');\n },\n enumerable: true,\n configurable: true\n};\nvar paddingTop_export_definition;\npaddingTop_export_definition = {\n set: external_dependency_parsers_0.subImplicitSetter('padding', 'top', {\n definition: padding_export_definition,\n isValid: padding_export_isValid,\n parser: padding_export_parser\n }.isValid, {\n definition: padding_export_definition,\n isValid: padding_export_isValid,\n parser: padding_export_parser\n }.parser),\n get: function () {\n return this.getPropertyValue('padding-top');\n },\n enumerable: true,\n configurable: true\n};\nvar right_export_definition;\nright_export_definition = {\n set: function (v) {\n this._setProperty('right', external_dependency_parsers_0.parseMeasurement(v));\n },\n get: function () {\n return this.getPropertyValue('right');\n },\n enumerable: true,\n configurable: true\n};\nvar stopColor_export_definition;\nstopColor_export_definition = {\n set: function (v) {\n this._setProperty('stop-color', external_dependency_parsers_0.parseColor(v));\n },\n get: function () {\n return this.getPropertyValue('stop-color');\n },\n enumerable: true,\n configurable: true\n};\nvar textLineThroughColor_export_definition;\ntextLineThroughColor_export_definition = {\n set: function (v) {\n this._setProperty('text-line-through-color', external_dependency_parsers_0.parseColor(v));\n },\n get: function () {\n return this.getPropertyValue('text-line-through-color');\n },\n enumerable: true,\n configurable: true\n};\nvar textOverlineColor_export_definition;\ntextOverlineColor_export_definition = {\n set: function (v) {\n this._setProperty('text-overline-color', external_dependency_parsers_0.parseColor(v));\n },\n get: function () {\n return this.getPropertyValue('text-overline-color');\n },\n enumerable: true,\n configurable: true\n};\nvar textUnderlineColor_export_definition;\ntextUnderlineColor_export_definition = {\n set: function (v) {\n this._setProperty('text-underline-color', external_dependency_parsers_0.parseColor(v));\n },\n get: function () {\n return this.getPropertyValue('text-underline-color');\n },\n enumerable: true,\n configurable: true\n};\nvar top_export_definition;\ntop_export_definition = {\n set: function (v) {\n this._setProperty('top', external_dependency_parsers_0.parseMeasurement(v));\n },\n get: function () {\n return this.getPropertyValue('top');\n },\n enumerable: true,\n configurable: true\n};\nvar webkitBorderAfterColor_export_definition;\nwebkitBorderAfterColor_export_definition = {\n set: function (v) {\n this._setProperty('-webkit-border-after-color', external_dependency_parsers_0.parseColor(v));\n },\n get: function () {\n return this.getPropertyValue('-webkit-border-after-color');\n },\n enumerable: true,\n configurable: true\n};\nvar webkitBorderBeforeColor_export_definition;\nwebkitBorderBeforeColor_export_definition = {\n set: function (v) {\n this._setProperty('-webkit-border-before-color', external_dependency_parsers_0.parseColor(v));\n },\n get: function () {\n return this.getPropertyValue('-webkit-border-before-color');\n },\n enumerable: true,\n configurable: true\n};\nvar webkitBorderEndColor_export_definition;\nwebkitBorderEndColor_export_definition = {\n set: function (v) {\n this._setProperty('-webkit-border-end-color', external_dependency_parsers_0.parseColor(v));\n },\n get: function () {\n return this.getPropertyValue('-webkit-border-end-color');\n },\n enumerable: true,\n configurable: true\n};\nvar webkitBorderStartColor_export_definition;\nwebkitBorderStartColor_export_definition = {\n set: function (v) {\n this._setProperty('-webkit-border-start-color', external_dependency_parsers_0.parseColor(v));\n },\n get: function () {\n return this.getPropertyValue('-webkit-border-start-color');\n },\n enumerable: true,\n configurable: true\n};\nvar webkitColumnRuleColor_export_definition;\nwebkitColumnRuleColor_export_definition = {\n set: function (v) {\n this._setProperty('-webkit-column-rule-color', external_dependency_parsers_0.parseColor(v));\n },\n get: function () {\n return this.getPropertyValue('-webkit-column-rule-color');\n },\n enumerable: true,\n configurable: true\n};\nvar webkitMatchNearestMailBlockquoteColor_export_definition;\nwebkitMatchNearestMailBlockquoteColor_export_definition = {\n set: function (v) {\n this._setProperty('-webkit-match-nearest-mail-blockquote-color', external_dependency_parsers_0.parseColor(v));\n },\n get: function () {\n return this.getPropertyValue('-webkit-match-nearest-mail-blockquote-color');\n },\n enumerable: true,\n configurable: true\n};\nvar webkitTapHighlightColor_export_definition;\nwebkitTapHighlightColor_export_definition = {\n set: function (v) {\n this._setProperty('-webkit-tap-highlight-color', external_dependency_parsers_0.parseColor(v));\n },\n get: function () {\n return this.getPropertyValue('-webkit-tap-highlight-color');\n },\n enumerable: true,\n configurable: true\n};\nvar webkitTextEmphasisColor_export_definition;\nwebkitTextEmphasisColor_export_definition = {\n set: function (v) {\n this._setProperty('-webkit-text-emphasis-color', external_dependency_parsers_0.parseColor(v));\n },\n get: function () {\n return this.getPropertyValue('-webkit-text-emphasis-color');\n },\n enumerable: true,\n configurable: true\n};\nvar webkitTextFillColor_export_definition;\nwebkitTextFillColor_export_definition = {\n set: function (v) {\n this._setProperty('-webkit-text-fill-color', external_dependency_parsers_0.parseColor(v));\n },\n get: function () {\n return this.getPropertyValue('-webkit-text-fill-color');\n },\n enumerable: true,\n configurable: true\n};\nvar webkitTextStrokeColor_export_definition;\nwebkitTextStrokeColor_export_definition = {\n set: function (v) {\n this._setProperty('-webkit-text-stroke-color', external_dependency_parsers_0.parseColor(v));\n },\n get: function () {\n return this.getPropertyValue('-webkit-text-stroke-color');\n },\n enumerable: true,\n configurable: true\n};\nvar width_export_definition;\n\nfunction width_local_fn_parse(v) {\n if (String(v).toLowerCase() === 'auto') {\n return 'auto';\n }\n\n if (String(v).toLowerCase() === 'inherit') {\n return 'inherit';\n }\n\n return external_dependency_parsers_0.parseMeasurement(v);\n}\n\nwidth_export_definition = {\n set: function (v) {\n this._setProperty('width', width_local_fn_parse(v));\n },\n get: function () {\n return this.getPropertyValue('width');\n },\n enumerable: true,\n configurable: true\n};\n\nmodule.exports = function (prototype) {\n Object.defineProperties(prototype, {\n azimuth: azimuth_export_definition,\n backgroundColor: backgroundColor_export_definition,\n \"background-color\": backgroundColor_export_definition,\n backgroundImage: backgroundImage_export_definition,\n \"background-image\": backgroundImage_export_definition,\n backgroundRepeat: backgroundRepeat_export_definition,\n \"background-repeat\": backgroundRepeat_export_definition,\n backgroundAttachment: backgroundAttachment_export_definition,\n \"background-attachment\": backgroundAttachment_export_definition,\n backgroundPosition: backgroundPosition_export_definition,\n \"background-position\": backgroundPosition_export_definition,\n background: background_export_definition,\n borderWidth: borderWidth_export_definition,\n \"border-width\": borderWidth_export_definition,\n borderStyle: borderStyle_export_definition,\n \"border-style\": borderStyle_export_definition,\n borderColor: borderColor_export_definition,\n \"border-color\": borderColor_export_definition,\n border: border_export_definition,\n borderBottomWidth: borderBottomWidth_export_definition,\n \"border-bottom-width\": borderBottomWidth_export_definition,\n borderBottomStyle: borderBottomStyle_export_definition,\n \"border-bottom-style\": borderBottomStyle_export_definition,\n borderBottomColor: borderBottomColor_export_definition,\n \"border-bottom-color\": borderBottomColor_export_definition,\n borderBottom: borderBottom_export_definition,\n \"border-bottom\": borderBottom_export_definition,\n borderCollapse: borderCollapse_export_definition,\n \"border-collapse\": borderCollapse_export_definition,\n borderLeftWidth: borderLeftWidth_export_definition,\n \"border-left-width\": borderLeftWidth_export_definition,\n borderLeftStyle: borderLeftStyle_export_definition,\n \"border-left-style\": borderLeftStyle_export_definition,\n borderLeftColor: borderLeftColor_export_definition,\n \"border-left-color\": borderLeftColor_export_definition,\n borderLeft: borderLeft_export_definition,\n \"border-left\": borderLeft_export_definition,\n borderRightWidth: borderRightWidth_export_definition,\n \"border-right-width\": borderRightWidth_export_definition,\n borderRightStyle: borderRightStyle_export_definition,\n \"border-right-style\": borderRightStyle_export_definition,\n borderRightColor: borderRightColor_export_definition,\n \"border-right-color\": borderRightColor_export_definition,\n borderRight: borderRight_export_definition,\n \"border-right\": borderRight_export_definition,\n borderSpacing: borderSpacing_export_definition,\n \"border-spacing\": borderSpacing_export_definition,\n borderTopWidth: borderTopWidth_export_definition,\n \"border-top-width\": borderTopWidth_export_definition,\n borderTopStyle: borderTopStyle_export_definition,\n \"border-top-style\": borderTopStyle_export_definition,\n borderTopColor: borderTopColor_export_definition,\n \"border-top-color\": borderTopColor_export_definition,\n borderTop: borderTop_export_definition,\n \"border-top\": borderTop_export_definition,\n bottom: bottom_export_definition,\n clear: clear_export_definition,\n clip: clip_export_definition,\n color: color_export_definition,\n cssFloat: cssFloat_export_definition,\n \"css-float\": cssFloat_export_definition,\n flexGrow: flexGrow_export_definition,\n \"flex-grow\": flexGrow_export_definition,\n flexShrink: flexShrink_export_definition,\n \"flex-shrink\": flexShrink_export_definition,\n flexBasis: flexBasis_export_definition,\n \"flex-basis\": flexBasis_export_definition,\n flex: flex_export_definition,\n float: float_export_definition,\n floodColor: floodColor_export_definition,\n \"flood-color\": floodColor_export_definition,\n fontFamily: fontFamily_export_definition,\n \"font-family\": fontFamily_export_definition,\n fontSize: fontSize_export_definition,\n \"font-size\": fontSize_export_definition,\n fontStyle: fontStyle_export_definition,\n \"font-style\": fontStyle_export_definition,\n fontVariant: fontVariant_export_definition,\n \"font-variant\": fontVariant_export_definition,\n fontWeight: fontWeight_export_definition,\n \"font-weight\": fontWeight_export_definition,\n lineHeight: lineHeight_export_definition,\n \"line-height\": lineHeight_export_definition,\n font: font_export_definition,\n height: height_export_definition,\n left: left_export_definition,\n lightingColor: lightingColor_export_definition,\n \"lighting-color\": lightingColor_export_definition,\n margin: margin_export_definition,\n marginBottom: marginBottom_export_definition,\n \"margin-bottom\": marginBottom_export_definition,\n marginLeft: marginLeft_export_definition,\n \"margin-left\": marginLeft_export_definition,\n marginRight: marginRight_export_definition,\n \"margin-right\": marginRight_export_definition,\n marginTop: marginTop_export_definition,\n \"margin-top\": marginTop_export_definition,\n opacity: opacity_export_definition,\n outlineColor: outlineColor_export_definition,\n \"outline-color\": outlineColor_export_definition,\n padding: padding_export_definition,\n paddingBottom: paddingBottom_export_definition,\n \"padding-bottom\": paddingBottom_export_definition,\n paddingLeft: paddingLeft_export_definition,\n \"padding-left\": paddingLeft_export_definition,\n paddingRight: paddingRight_export_definition,\n \"padding-right\": paddingRight_export_definition,\n paddingTop: paddingTop_export_definition,\n \"padding-top\": paddingTop_export_definition,\n right: right_export_definition,\n stopColor: stopColor_export_definition,\n \"stop-color\": stopColor_export_definition,\n textLineThroughColor: textLineThroughColor_export_definition,\n \"text-line-through-color\": textLineThroughColor_export_definition,\n textOverlineColor: textOverlineColor_export_definition,\n \"text-overline-color\": textOverlineColor_export_definition,\n textUnderlineColor: textUnderlineColor_export_definition,\n \"text-underline-color\": textUnderlineColor_export_definition,\n top: top_export_definition,\n webkitBorderAfterColor: webkitBorderAfterColor_export_definition,\n \"webkit-border-after-color\": webkitBorderAfterColor_export_definition,\n webkitBorderBeforeColor: webkitBorderBeforeColor_export_definition,\n \"webkit-border-before-color\": webkitBorderBeforeColor_export_definition,\n webkitBorderEndColor: webkitBorderEndColor_export_definition,\n \"webkit-border-end-color\": webkitBorderEndColor_export_definition,\n webkitBorderStartColor: webkitBorderStartColor_export_definition,\n \"webkit-border-start-color\": webkitBorderStartColor_export_definition,\n webkitColumnRuleColor: webkitColumnRuleColor_export_definition,\n \"webkit-column-rule-color\": webkitColumnRuleColor_export_definition,\n webkitMatchNearestMailBlockquoteColor: webkitMatchNearestMailBlockquoteColor_export_definition,\n \"webkit-match-nearest-mail-blockquote-color\": webkitMatchNearestMailBlockquoteColor_export_definition,\n webkitTapHighlightColor: webkitTapHighlightColor_export_definition,\n \"webkit-tap-highlight-color\": webkitTapHighlightColor_export_definition,\n webkitTextEmphasisColor: webkitTextEmphasisColor_export_definition,\n \"webkit-text-emphasis-color\": webkitTextEmphasisColor_export_definition,\n webkitTextFillColor: webkitTextFillColor_export_definition,\n \"webkit-text-fill-color\": webkitTextFillColor_export_definition,\n webkitTextStrokeColor: webkitTextStrokeColor_export_definition,\n \"webkit-text-stroke-color\": webkitTextStrokeColor_export_definition,\n width: width_export_definition\n });\n};\n","'use strict';\n\nconst hueToRgb = (t1, t2, hue) => {\n if (hue < 0) hue += 6;\n if (hue >= 6) hue -= 6;\n\n if (hue < 1) return (t2 - t1) * hue + t1;\n else if (hue < 3) return t2;\n else if (hue < 4) return (t2 - t1) * (4 - hue) + t1;\n else return t1;\n};\n\n// https://www.w3.org/TR/css-color-4/#hsl-to-rgb\nexports.hslToRgb = (hue, sat, light) => {\n const t2 = light <= 0.5 ? light * (sat + 1) : light + sat - light * sat;\n const t1 = light * 2 - t2;\n const r = hueToRgb(t1, t2, hue + 2);\n const g = hueToRgb(t1, t2, hue);\n const b = hueToRgb(t1, t2, hue - 2);\n return [Math.round(r * 255), Math.round(g * 255), Math.round(b * 255)];\n};\n","'use strict';\n\nmodule.exports = function getBasicPropertyDescriptor(name) {\n return {\n set: function(v) {\n this._setProperty(name, v);\n },\n get: function() {\n return this.getPropertyValue(name);\n },\n enumerable: true,\n configurable: true,\n };\n};\n","//.CommonJS\nvar CSSOM = {\n CSSRule: require(\"./CSSRule\").CSSRule,\n MatcherList: require(\"./MatcherList\").MatcherList\n};\n///CommonJS\n\n\n/**\n * @constructor\n * @see https://developer.mozilla.org/en/CSS/@-moz-document\n */\nCSSOM.CSSDocumentRule = function CSSDocumentRule() {\n CSSOM.CSSRule.call(this);\n this.matcher = new CSSOM.MatcherList();\n this.cssRules = [];\n};\n\nCSSOM.CSSDocumentRule.prototype = new CSSOM.CSSRule();\nCSSOM.CSSDocumentRule.prototype.constructor = CSSOM.CSSDocumentRule;\nCSSOM.CSSDocumentRule.prototype.type = 10;\n//FIXME\n//CSSOM.CSSDocumentRule.prototype.insertRule = CSSStyleSheet.prototype.insertRule;\n//CSSOM.CSSDocumentRule.prototype.deleteRule = CSSStyleSheet.prototype.deleteRule;\n\nObject.defineProperty(CSSOM.CSSDocumentRule.prototype, \"cssText\", {\n get: function() {\n var cssTexts = [];\n for (var i=0, length=this.cssRules.length; i < length; i++) {\n cssTexts.push(this.cssRules[i].cssText);\n }\n return \"@-moz-document \" + this.matcher.matcherText + \" {\" + cssTexts.join(\"\") + \"}\";\n }\n});\n\n\n//.CommonJS\nexports.CSSDocumentRule = CSSOM.CSSDocumentRule;\n///CommonJS\n","//.CommonJS\nvar CSSOM = {\n\tCSSStyleDeclaration: require(\"./CSSStyleDeclaration\").CSSStyleDeclaration,\n\tCSSRule: require(\"./CSSRule\").CSSRule\n};\n///CommonJS\n\n\n/**\n * @constructor\n * @see http://dev.w3.org/csswg/cssom/#css-font-face-rule\n */\nCSSOM.CSSFontFaceRule = function CSSFontFaceRule() {\n\tCSSOM.CSSRule.call(this);\n\tthis.style = new CSSOM.CSSStyleDeclaration();\n\tthis.style.parentRule = this;\n};\n\nCSSOM.CSSFontFaceRule.prototype = new CSSOM.CSSRule();\nCSSOM.CSSFontFaceRule.prototype.constructor = CSSOM.CSSFontFaceRule;\nCSSOM.CSSFontFaceRule.prototype.type = 5;\n//FIXME\n//CSSOM.CSSFontFaceRule.prototype.insertRule = CSSStyleSheet.prototype.insertRule;\n//CSSOM.CSSFontFaceRule.prototype.deleteRule = CSSStyleSheet.prototype.deleteRule;\n\n// http://www.opensource.apple.com/source/WebCore/WebCore-955.66.1/css/WebKitCSSFontFaceRule.cpp\nObject.defineProperty(CSSOM.CSSFontFaceRule.prototype, \"cssText\", {\n get: function() {\n return \"@font-face {\" + this.style.cssText + \"}\";\n }\n});\n\n\n//.CommonJS\nexports.CSSFontFaceRule = CSSOM.CSSFontFaceRule;\n///CommonJS\n","//.CommonJS\nvar CSSOM = {\n\tCSSRule: require(\"./CSSRule\").CSSRule\n};\n///CommonJS\n\n\n/**\n * @constructor\n * @see http://www.w3.org/TR/shadow-dom/#host-at-rule\n */\nCSSOM.CSSHostRule = function CSSHostRule() {\n\tCSSOM.CSSRule.call(this);\n\tthis.cssRules = [];\n};\n\nCSSOM.CSSHostRule.prototype = new CSSOM.CSSRule();\nCSSOM.CSSHostRule.prototype.constructor = CSSOM.CSSHostRule;\nCSSOM.CSSHostRule.prototype.type = 1001;\n//FIXME\n//CSSOM.CSSHostRule.prototype.insertRule = CSSStyleSheet.prototype.insertRule;\n//CSSOM.CSSHostRule.prototype.deleteRule = CSSStyleSheet.prototype.deleteRule;\n\nObject.defineProperty(CSSOM.CSSHostRule.prototype, \"cssText\", {\n\tget: function() {\n\t\tvar cssTexts = [];\n\t\tfor (var i=0, length=this.cssRules.length; i < length; i++) {\n\t\t\tcssTexts.push(this.cssRules[i].cssText);\n\t\t}\n\t\treturn \"@host {\" + cssTexts.join(\"\") + \"}\";\n\t}\n});\n\n\n//.CommonJS\nexports.CSSHostRule = CSSOM.CSSHostRule;\n///CommonJS\n","//.CommonJS\nvar CSSOM = {\n\tCSSRule: require(\"./CSSRule\").CSSRule,\n\tCSSStyleSheet: require(\"./CSSStyleSheet\").CSSStyleSheet,\n\tMediaList: require(\"./MediaList\").MediaList\n};\n///CommonJS\n\n\n/**\n * @constructor\n * @see http://dev.w3.org/csswg/cssom/#cssimportrule\n * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSImportRule\n */\nCSSOM.CSSImportRule = function CSSImportRule() {\n\tCSSOM.CSSRule.call(this);\n\tthis.href = \"\";\n\tthis.media = new CSSOM.MediaList();\n\tthis.styleSheet = new CSSOM.CSSStyleSheet();\n};\n\nCSSOM.CSSImportRule.prototype = new CSSOM.CSSRule();\nCSSOM.CSSImportRule.prototype.constructor = CSSOM.CSSImportRule;\nCSSOM.CSSImportRule.prototype.type = 3;\n\nObject.defineProperty(CSSOM.CSSImportRule.prototype, \"cssText\", {\n get: function() {\n var mediaText = this.media.mediaText;\n return \"@import url(\" + this.href + \")\" + (mediaText ? \" \" + mediaText : \"\") + \";\";\n },\n set: function(cssText) {\n var i = 0;\n\n /**\n * @import url(partial.css) screen, handheld;\n * || |\n * after-import media\n * |\n * url\n */\n var state = '';\n\n var buffer = '';\n var index;\n for (var character; (character = cssText.charAt(i)); i++) {\n\n switch (character) {\n case ' ':\n case '\\t':\n case '\\r':\n case '\\n':\n case '\\f':\n if (state === 'after-import') {\n state = 'url';\n } else {\n buffer += character;\n }\n break;\n\n case '@':\n if (!state && cssText.indexOf('@import', i) === i) {\n state = 'after-import';\n i += 'import'.length;\n buffer = '';\n }\n break;\n\n case 'u':\n if (state === 'url' && cssText.indexOf('url(', i) === i) {\n index = cssText.indexOf(')', i + 1);\n if (index === -1) {\n throw i + ': \")\" not found';\n }\n i += 'url('.length;\n var url = cssText.slice(i, index);\n if (url[0] === url[url.length - 1]) {\n if (url[0] === '\"' || url[0] === \"'\") {\n url = url.slice(1, -1);\n }\n }\n this.href = url;\n i = index;\n state = 'media';\n }\n break;\n\n case '\"':\n if (state === 'url') {\n index = cssText.indexOf('\"', i + 1);\n if (!index) {\n throw i + \": '\\\"' not found\";\n }\n this.href = cssText.slice(i + 1, index);\n i = index;\n state = 'media';\n }\n break;\n\n case \"'\":\n if (state === 'url') {\n index = cssText.indexOf(\"'\", i + 1);\n if (!index) {\n throw i + ': \"\\'\" not found';\n }\n this.href = cssText.slice(i + 1, index);\n i = index;\n state = 'media';\n }\n break;\n\n case ';':\n if (state === 'media') {\n if (buffer) {\n this.media.mediaText = buffer.trim();\n }\n }\n break;\n\n default:\n if (state === 'media') {\n buffer += character;\n }\n break;\n }\n }\n }\n});\n\n\n//.CommonJS\nexports.CSSImportRule = CSSOM.CSSImportRule;\n///CommonJS\n","//.CommonJS\nvar CSSOM = {\n\tCSSRule: require(\"./CSSRule\").CSSRule,\n\tCSSStyleDeclaration: require('./CSSStyleDeclaration').CSSStyleDeclaration\n};\n///CommonJS\n\n\n/**\n * @constructor\n * @see http://www.w3.org/TR/css3-animations/#DOM-CSSKeyframeRule\n */\nCSSOM.CSSKeyframeRule = function CSSKeyframeRule() {\n\tCSSOM.CSSRule.call(this);\n\tthis.keyText = '';\n\tthis.style = new CSSOM.CSSStyleDeclaration();\n\tthis.style.parentRule = this;\n};\n\nCSSOM.CSSKeyframeRule.prototype = new CSSOM.CSSRule();\nCSSOM.CSSKeyframeRule.prototype.constructor = CSSOM.CSSKeyframeRule;\nCSSOM.CSSKeyframeRule.prototype.type = 9;\n//FIXME\n//CSSOM.CSSKeyframeRule.prototype.insertRule = CSSStyleSheet.prototype.insertRule;\n//CSSOM.CSSKeyframeRule.prototype.deleteRule = CSSStyleSheet.prototype.deleteRule;\n\n// http://www.opensource.apple.com/source/WebCore/WebCore-955.66.1/css/WebKitCSSKeyframeRule.cpp\nObject.defineProperty(CSSOM.CSSKeyframeRule.prototype, \"cssText\", {\n get: function() {\n return this.keyText + \" {\" + this.style.cssText + \"} \";\n }\n});\n\n\n//.CommonJS\nexports.CSSKeyframeRule = CSSOM.CSSKeyframeRule;\n///CommonJS\n","//.CommonJS\nvar CSSOM = {\n\tCSSRule: require(\"./CSSRule\").CSSRule\n};\n///CommonJS\n\n\n/**\n * @constructor\n * @see http://www.w3.org/TR/css3-animations/#DOM-CSSKeyframesRule\n */\nCSSOM.CSSKeyframesRule = function CSSKeyframesRule() {\n\tCSSOM.CSSRule.call(this);\n\tthis.name = '';\n\tthis.cssRules = [];\n};\n\nCSSOM.CSSKeyframesRule.prototype = new CSSOM.CSSRule();\nCSSOM.CSSKeyframesRule.prototype.constructor = CSSOM.CSSKeyframesRule;\nCSSOM.CSSKeyframesRule.prototype.type = 8;\n//FIXME\n//CSSOM.CSSKeyframesRule.prototype.insertRule = CSSStyleSheet.prototype.insertRule;\n//CSSOM.CSSKeyframesRule.prototype.deleteRule = CSSStyleSheet.prototype.deleteRule;\n\n// http://www.opensource.apple.com/source/WebCore/WebCore-955.66.1/css/WebKitCSSKeyframesRule.cpp\nObject.defineProperty(CSSOM.CSSKeyframesRule.prototype, \"cssText\", {\n get: function() {\n var cssTexts = [];\n for (var i=0, length=this.cssRules.length; i < length; i++) {\n cssTexts.push(\" \" + this.cssRules[i].cssText);\n }\n return \"@\" + (this._vendorPrefix || '') + \"keyframes \" + this.name + \" { \\n\" + cssTexts.join(\"\\n\") + \"\\n}\";\n }\n});\n\n\n//.CommonJS\nexports.CSSKeyframesRule = CSSOM.CSSKeyframesRule;\n///CommonJS\n","//.CommonJS\nvar CSSOM = {\n\tCSSRule: require(\"./CSSRule\").CSSRule,\n\tMediaList: require(\"./MediaList\").MediaList\n};\n///CommonJS\n\n\n/**\n * @constructor\n * @see http://dev.w3.org/csswg/cssom/#cssmediarule\n * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSMediaRule\n */\nCSSOM.CSSMediaRule = function CSSMediaRule() {\n\tCSSOM.CSSRule.call(this);\n\tthis.media = new CSSOM.MediaList();\n\tthis.cssRules = [];\n};\n\nCSSOM.CSSMediaRule.prototype = new CSSOM.CSSRule();\nCSSOM.CSSMediaRule.prototype.constructor = CSSOM.CSSMediaRule;\nCSSOM.CSSMediaRule.prototype.type = 4;\n//FIXME\n//CSSOM.CSSMediaRule.prototype.insertRule = CSSStyleSheet.prototype.insertRule;\n//CSSOM.CSSMediaRule.prototype.deleteRule = CSSStyleSheet.prototype.deleteRule;\n\n// http://opensource.apple.com/source/WebCore/WebCore-658.28/css/CSSMediaRule.cpp\nObject.defineProperty(CSSOM.CSSMediaRule.prototype, \"cssText\", {\n get: function() {\n var cssTexts = [];\n for (var i=0, length=this.cssRules.length; i < length; i++) {\n cssTexts.push(this.cssRules[i].cssText);\n }\n return \"@media \" + this.media.mediaText + \" {\" + cssTexts.join(\"\") + \"}\";\n }\n});\n\n\n//.CommonJS\nexports.CSSMediaRule = CSSOM.CSSMediaRule;\n///CommonJS\n","//.CommonJS\nvar CSSOM = {};\n///CommonJS\n\n\n/**\n * @constructor\n * @see http://dev.w3.org/csswg/cssom/#the-cssrule-interface\n * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule\n */\nCSSOM.CSSRule = function CSSRule() {\n\tthis.parentRule = null;\n\tthis.parentStyleSheet = null;\n};\n\nCSSOM.CSSRule.UNKNOWN_RULE = 0; // obsolete\nCSSOM.CSSRule.STYLE_RULE = 1;\nCSSOM.CSSRule.CHARSET_RULE = 2; // obsolete\nCSSOM.CSSRule.IMPORT_RULE = 3;\nCSSOM.CSSRule.MEDIA_RULE = 4;\nCSSOM.CSSRule.FONT_FACE_RULE = 5;\nCSSOM.CSSRule.PAGE_RULE = 6;\nCSSOM.CSSRule.KEYFRAMES_RULE = 7;\nCSSOM.CSSRule.KEYFRAME_RULE = 8;\nCSSOM.CSSRule.MARGIN_RULE = 9;\nCSSOM.CSSRule.NAMESPACE_RULE = 10;\nCSSOM.CSSRule.COUNTER_STYLE_RULE = 11;\nCSSOM.CSSRule.SUPPORTS_RULE = 12;\nCSSOM.CSSRule.DOCUMENT_RULE = 13;\nCSSOM.CSSRule.FONT_FEATURE_VALUES_RULE = 14;\nCSSOM.CSSRule.VIEWPORT_RULE = 15;\nCSSOM.CSSRule.REGION_STYLE_RULE = 16;\n\n\nCSSOM.CSSRule.prototype = {\n\tconstructor: CSSOM.CSSRule\n\t//FIXME\n};\n\n\n//.CommonJS\nexports.CSSRule = CSSOM.CSSRule;\n///CommonJS\n","//.CommonJS\nvar CSSOM = {};\n///CommonJS\n\n\n/**\n * @constructor\n * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration\n */\nCSSOM.CSSStyleDeclaration = function CSSStyleDeclaration(){\n\tthis.length = 0;\n\tthis.parentRule = null;\n\n\t// NON-STANDARD\n\tthis._importants = {};\n};\n\n\nCSSOM.CSSStyleDeclaration.prototype = {\n\n\tconstructor: CSSOM.CSSStyleDeclaration,\n\n\t/**\n\t *\n\t * @param {string} name\n\t * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-getPropertyValue\n\t * @return {string} the value of the property if it has been explicitly set for this declaration block.\n\t * Returns the empty string if the property has not been set.\n\t */\n\tgetPropertyValue: function(name) {\n\t\treturn this[name] || \"\";\n\t},\n\n\t/**\n\t *\n\t * @param {string} name\n\t * @param {string} value\n\t * @param {string} [priority=null] \"important\" or null\n\t * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-setProperty\n\t */\n\tsetProperty: function(name, value, priority) {\n\t\tif (this[name]) {\n\t\t\t// Property already exist. Overwrite it.\n\t\t\tvar index = Array.prototype.indexOf.call(this, name);\n\t\t\tif (index < 0) {\n\t\t\t\tthis[this.length] = name;\n\t\t\t\tthis.length++;\n\t\t\t}\n\t\t} else {\n\t\t\t// New property.\n\t\t\tthis[this.length] = name;\n\t\t\tthis.length++;\n\t\t}\n\t\tthis[name] = value + \"\";\n\t\tthis._importants[name] = priority;\n\t},\n\n\t/**\n\t *\n\t * @param {string} name\n\t * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-removeProperty\n\t * @return {string} the value of the property if it has been explicitly set for this declaration block.\n\t * Returns the empty string if the property has not been set or the property name does not correspond to a known CSS property.\n\t */\n\tremoveProperty: function(name) {\n\t\tif (!(name in this)) {\n\t\t\treturn \"\";\n\t\t}\n\t\tvar index = Array.prototype.indexOf.call(this, name);\n\t\tif (index < 0) {\n\t\t\treturn \"\";\n\t\t}\n\t\tvar prevValue = this[name];\n\t\tthis[name] = \"\";\n\n\t\t// That's what WebKit and Opera do\n\t\tArray.prototype.splice.call(this, index, 1);\n\n\t\t// That's what Firefox does\n\t\t//this[index] = \"\"\n\n\t\treturn prevValue;\n\t},\n\n\tgetPropertyCSSValue: function() {\n\t\t//FIXME\n\t},\n\n\t/**\n\t *\n\t * @param {String} name\n\t */\n\tgetPropertyPriority: function(name) {\n\t\treturn this._importants[name] || \"\";\n\t},\n\n\n\t/**\n\t * element.style.overflow = \"auto\"\n\t * element.style.getPropertyShorthand(\"overflow-x\")\n\t * -> \"overflow\"\n\t */\n\tgetPropertyShorthand: function() {\n\t\t//FIXME\n\t},\n\n\tisPropertyImplicit: function() {\n\t\t//FIXME\n\t},\n\n\t// Doesn't work in IE < 9\n\tget cssText(){\n\t\tvar properties = [];\n\t\tfor (var i=0, length=this.length; i < length; ++i) {\n\t\t\tvar name = this[i];\n\t\t\tvar value = this.getPropertyValue(name);\n\t\t\tvar priority = this.getPropertyPriority(name);\n\t\t\tif (priority) {\n\t\t\t\tpriority = \" !\" + priority;\n\t\t\t}\n\t\t\tproperties[i] = name + \": \" + value + priority + \";\";\n\t\t}\n\t\treturn properties.join(\" \");\n\t},\n\n\tset cssText(text){\n\t\tvar i, name;\n\t\tfor (i = this.length; i--;) {\n\t\t\tname = this[i];\n\t\t\tthis[name] = \"\";\n\t\t}\n\t\tArray.prototype.splice.call(this, 0, this.length);\n\t\tthis._importants = {};\n\n\t\tvar dummyRule = CSSOM.parse('#bogus{' + text + '}').cssRules[0].style;\n\t\tvar length = dummyRule.length;\n\t\tfor (i = 0; i < length; ++i) {\n\t\t\tname = dummyRule[i];\n\t\t\tthis.setProperty(dummyRule[i], dummyRule.getPropertyValue(name), dummyRule.getPropertyPriority(name));\n\t\t}\n\t}\n};\n\n\n//.CommonJS\nexports.CSSStyleDeclaration = CSSOM.CSSStyleDeclaration;\nCSSOM.parse = require('./parse').parse; // Cannot be included sooner due to the mutual dependency between parse.js and CSSStyleDeclaration.js\n///CommonJS\n","//.CommonJS\nvar CSSOM = {\n\tCSSStyleDeclaration: require(\"./CSSStyleDeclaration\").CSSStyleDeclaration,\n\tCSSRule: require(\"./CSSRule\").CSSRule\n};\n///CommonJS\n\n\n/**\n * @constructor\n * @see http://dev.w3.org/csswg/cssom/#cssstylerule\n * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleRule\n */\nCSSOM.CSSStyleRule = function CSSStyleRule() {\n\tCSSOM.CSSRule.call(this);\n\tthis.selectorText = \"\";\n\tthis.style = new CSSOM.CSSStyleDeclaration();\n\tthis.style.parentRule = this;\n};\n\nCSSOM.CSSStyleRule.prototype = new CSSOM.CSSRule();\nCSSOM.CSSStyleRule.prototype.constructor = CSSOM.CSSStyleRule;\nCSSOM.CSSStyleRule.prototype.type = 1;\n\nObject.defineProperty(CSSOM.CSSStyleRule.prototype, \"cssText\", {\n\tget: function() {\n\t\tvar text;\n\t\tif (this.selectorText) {\n\t\t\ttext = this.selectorText + \" {\" + this.style.cssText + \"}\";\n\t\t} else {\n\t\t\ttext = \"\";\n\t\t}\n\t\treturn text;\n\t},\n\tset: function(cssText) {\n\t\tvar rule = CSSOM.CSSStyleRule.parse(cssText);\n\t\tthis.style = rule.style;\n\t\tthis.selectorText = rule.selectorText;\n\t}\n});\n\n\n/**\n * NON-STANDARD\n * lightweight version of parse.js.\n * @param {string} ruleText\n * @return CSSStyleRule\n */\nCSSOM.CSSStyleRule.parse = function(ruleText) {\n\tvar i = 0;\n\tvar state = \"selector\";\n\tvar index;\n\tvar j = i;\n\tvar buffer = \"\";\n\n\tvar SIGNIFICANT_WHITESPACE = {\n\t\t\"selector\": true,\n\t\t\"value\": true\n\t};\n\n\tvar styleRule = new CSSOM.CSSStyleRule();\n\tvar name, priority=\"\";\n\n\tfor (var character; (character = ruleText.charAt(i)); i++) {\n\n\t\tswitch (character) {\n\n\t\tcase \" \":\n\t\tcase \"\\t\":\n\t\tcase \"\\r\":\n\t\tcase \"\\n\":\n\t\tcase \"\\f\":\n\t\t\tif (SIGNIFICANT_WHITESPACE[state]) {\n\t\t\t\t// Squash 2 or more white-spaces in the row into 1\n\t\t\t\tswitch (ruleText.charAt(i - 1)) {\n\t\t\t\t\tcase \" \":\n\t\t\t\t\tcase \"\\t\":\n\t\t\t\t\tcase \"\\r\":\n\t\t\t\t\tcase \"\\n\":\n\t\t\t\t\tcase \"\\f\":\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbuffer += \" \";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\n\t\t// String\n\t\tcase '\"':\n\t\t\tj = i + 1;\n\t\t\tindex = ruleText.indexOf('\"', j) + 1;\n\t\t\tif (!index) {\n\t\t\t\tthrow '\" is missing';\n\t\t\t}\n\t\t\tbuffer += ruleText.slice(i, index);\n\t\t\ti = index - 1;\n\t\t\tbreak;\n\n\t\tcase \"'\":\n\t\t\tj = i + 1;\n\t\t\tindex = ruleText.indexOf(\"'\", j) + 1;\n\t\t\tif (!index) {\n\t\t\t\tthrow \"' is missing\";\n\t\t\t}\n\t\t\tbuffer += ruleText.slice(i, index);\n\t\t\ti = index - 1;\n\t\t\tbreak;\n\n\t\t// Comment\n\t\tcase \"/\":\n\t\t\tif (ruleText.charAt(i + 1) === \"*\") {\n\t\t\t\ti += 2;\n\t\t\t\tindex = ruleText.indexOf(\"*/\", i);\n\t\t\t\tif (index === -1) {\n\t\t\t\t\tthrow new SyntaxError(\"Missing */\");\n\t\t\t\t} else {\n\t\t\t\t\ti = index + 1;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tbuffer += character;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \"{\":\n\t\t\tif (state === \"selector\") {\n\t\t\t\tstyleRule.selectorText = buffer.trim();\n\t\t\t\tbuffer = \"\";\n\t\t\t\tstate = \"name\";\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \":\":\n\t\t\tif (state === \"name\") {\n\t\t\t\tname = buffer.trim();\n\t\t\t\tbuffer = \"\";\n\t\t\t\tstate = \"value\";\n\t\t\t} else {\n\t\t\t\tbuffer += character;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \"!\":\n\t\t\tif (state === \"value\" && ruleText.indexOf(\"!important\", i) === i) {\n\t\t\t\tpriority = \"important\";\n\t\t\t\ti += \"important\".length;\n\t\t\t} else {\n\t\t\t\tbuffer += character;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \";\":\n\t\t\tif (state === \"value\") {\n\t\t\t\tstyleRule.style.setProperty(name, buffer.trim(), priority);\n\t\t\t\tpriority = \"\";\n\t\t\t\tbuffer = \"\";\n\t\t\t\tstate = \"name\";\n\t\t\t} else {\n\t\t\t\tbuffer += character;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \"}\":\n\t\t\tif (state === \"value\") {\n\t\t\t\tstyleRule.style.setProperty(name, buffer.trim(), priority);\n\t\t\t\tpriority = \"\";\n\t\t\t\tbuffer = \"\";\n\t\t\t} else if (state === \"name\") {\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tbuffer += character;\n\t\t\t}\n\t\t\tstate = \"selector\";\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbuffer += character;\n\t\t\tbreak;\n\n\t\t}\n\t}\n\n\treturn styleRule;\n\n};\n\n\n//.CommonJS\nexports.CSSStyleRule = CSSOM.CSSStyleRule;\n///CommonJS\n","//.CommonJS\nvar CSSOM = {\n\tStyleSheet: require(\"./StyleSheet\").StyleSheet,\n\tCSSStyleRule: require(\"./CSSStyleRule\").CSSStyleRule\n};\n///CommonJS\n\n\n/**\n * @constructor\n * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleSheet\n */\nCSSOM.CSSStyleSheet = function CSSStyleSheet() {\n\tCSSOM.StyleSheet.call(this);\n\tthis.cssRules = [];\n};\n\n\nCSSOM.CSSStyleSheet.prototype = new CSSOM.StyleSheet();\nCSSOM.CSSStyleSheet.prototype.constructor = CSSOM.CSSStyleSheet;\n\n\n/**\n * Used to insert a new rule into the style sheet. The new rule now becomes part of the cascade.\n *\n * sheet = new Sheet(\"body {margin: 0}\")\n * sheet.toString()\n * -> \"body{margin:0;}\"\n * sheet.insertRule(\"img {border: none}\", 0)\n * -> 0\n * sheet.toString()\n * -> \"img{border:none;}body{margin:0;}\"\n *\n * @param {string} rule\n * @param {number} index\n * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleSheet-insertRule\n * @return {number} The index within the style sheet's rule collection of the newly inserted rule.\n */\nCSSOM.CSSStyleSheet.prototype.insertRule = function(rule, index) {\n\tif (index < 0 || index > this.cssRules.length) {\n\t\tthrow new RangeError(\"INDEX_SIZE_ERR\");\n\t}\n\tvar cssRule = CSSOM.parse(rule).cssRules[0];\n\tcssRule.parentStyleSheet = this;\n\tthis.cssRules.splice(index, 0, cssRule);\n\treturn index;\n};\n\n\n/**\n * Used to delete a rule from the style sheet.\n *\n * sheet = new Sheet(\"img{border:none} body{margin:0}\")\n * sheet.toString()\n * -> \"img{border:none;}body{margin:0;}\"\n * sheet.deleteRule(0)\n * sheet.toString()\n * -> \"body{margin:0;}\"\n *\n * @param {number} index within the style sheet's rule list of the rule to remove.\n * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleSheet-deleteRule\n */\nCSSOM.CSSStyleSheet.prototype.deleteRule = function(index) {\n\tif (index < 0 || index >= this.cssRules.length) {\n\t\tthrow new RangeError(\"INDEX_SIZE_ERR\");\n\t}\n\tthis.cssRules.splice(index, 1);\n};\n\n\n/**\n * NON-STANDARD\n * @return {string} serialize stylesheet\n */\nCSSOM.CSSStyleSheet.prototype.toString = function() {\n\tvar result = \"\";\n\tvar rules = this.cssRules;\n\tfor (var i=0; i 1000 ? '1000px' : 'auto');\n * }\n */\nCSSOM.CSSValueExpression.prototype.parse = function() {\n\tvar token = this._token,\n\t\t\tidx = this._idx;\n\n\tvar character = '',\n\t\t\texpression = '',\n\t\t\terror = '',\n\t\t\tinfo,\n\t\t\tparen = [];\n\n\n\tfor (; ; ++idx) {\n\t\tcharacter = token.charAt(idx);\n\n\t\t// end of token\n\t\tif (character === '') {\n\t\t\terror = 'css expression error: unfinished expression!';\n\t\t\tbreak;\n\t\t}\n\n\t\tswitch(character) {\n\t\t\tcase '(':\n\t\t\t\tparen.push(character);\n\t\t\t\texpression += character;\n\t\t\t\tbreak;\n\n\t\t\tcase ')':\n\t\t\t\tparen.pop(character);\n\t\t\t\texpression += character;\n\t\t\t\tbreak;\n\n\t\t\tcase '/':\n\t\t\t\tif ((info = this._parseJSComment(token, idx))) { // comment?\n\t\t\t\t\tif (info.error) {\n\t\t\t\t\t\terror = 'css expression error: unfinished comment in expression!';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tidx = info.idx;\n\t\t\t\t\t\t// ignore the comment\n\t\t\t\t\t}\n\t\t\t\t} else if ((info = this._parseJSRexExp(token, idx))) { // regexp\n\t\t\t\t\tidx = info.idx;\n\t\t\t\t\texpression += info.text;\n\t\t\t\t} else { // other\n\t\t\t\t\texpression += character;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase \"'\":\n\t\t\tcase '\"':\n\t\t\t\tinfo = this._parseJSString(token, idx, character);\n\t\t\t\tif (info) { // string\n\t\t\t\t\tidx = info.idx;\n\t\t\t\t\texpression += info.text;\n\t\t\t\t} else {\n\t\t\t\t\texpression += character;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\texpression += character;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (error) {\n\t\t\tbreak;\n\t\t}\n\n\t\t// end of expression\n\t\tif (paren.length === 0) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tvar ret;\n\tif (error) {\n\t\tret = {\n\t\t\terror: error\n\t\t};\n\t} else {\n\t\tret = {\n\t\t\tidx: idx,\n\t\t\texpression: expression\n\t\t};\n\t}\n\n\treturn ret;\n};\n\n\n/**\n *\n * @return {Object|false}\n * - idx:\n * - text:\n * or\n * - error:\n * or\n * false\n *\n */\nCSSOM.CSSValueExpression.prototype._parseJSComment = function(token, idx) {\n\tvar nextChar = token.charAt(idx + 1),\n\t\t\ttext;\n\n\tif (nextChar === '/' || nextChar === '*') {\n\t\tvar startIdx = idx,\n\t\t\t\tendIdx,\n\t\t\t\tcommentEndChar;\n\n\t\tif (nextChar === '/') { // line comment\n\t\t\tcommentEndChar = '\\n';\n\t\t} else if (nextChar === '*') { // block comment\n\t\t\tcommentEndChar = '*/';\n\t\t}\n\n\t\tendIdx = token.indexOf(commentEndChar, startIdx + 1 + 1);\n\t\tif (endIdx !== -1) {\n\t\t\tendIdx = endIdx + commentEndChar.length - 1;\n\t\t\ttext = token.substring(idx, endIdx + 1);\n\t\t\treturn {\n\t\t\t\tidx: endIdx,\n\t\t\t\ttext: text\n\t\t\t};\n\t\t} else {\n\t\t\tvar error = 'css expression error: unfinished comment in expression!';\n\t\t\treturn {\n\t\t\t\terror: error\n\t\t\t};\n\t\t}\n\t} else {\n\t\treturn false;\n\t}\n};\n\n\n/**\n *\n * @return {Object|false}\n *\t\t\t\t\t- idx:\n *\t\t\t\t\t- text:\n *\t\t\t\t\tor \n *\t\t\t\t\tfalse\n *\n */\nCSSOM.CSSValueExpression.prototype._parseJSString = function(token, idx, sep) {\n\tvar endIdx = this._findMatchedIdx(token, idx, sep),\n\t\t\ttext;\n\n\tif (endIdx === -1) {\n\t\treturn false;\n\t} else {\n\t\ttext = token.substring(idx, endIdx + sep.length);\n\n\t\treturn {\n\t\t\tidx: endIdx,\n\t\t\ttext: text\n\t\t};\n\t}\n};\n\n\n/**\n * parse regexp in css expression\n *\n * @return {Object|false}\n *\t\t\t\t- idx:\n *\t\t\t\t- regExp:\n *\t\t\t\tor \n *\t\t\t\tfalse\n */\n\n/*\n\nall legal RegExp\n \n/a/\n(/a/)\n[/a/]\n[12, /a/]\n\n!/a/\n\n+/a/\n-/a/\n* /a/\n/ /a/\n%/a/\n\n===/a/\n!==/a/\n==/a/\n!=/a/\n>/a/\n>=/a/\n>/a/\n>>>/a/\n\n&&/a/\n||/a/\n?/a/\n=/a/\n,/a/\n\n\t\tdelete /a/\n\t\t\t\tin /a/\ninstanceof /a/\n\t\t\t\tnew /a/\n\t\ttypeof /a/\n\t\t\tvoid /a/\n\n*/\nCSSOM.CSSValueExpression.prototype._parseJSRexExp = function(token, idx) {\n\tvar before = token.substring(0, idx).replace(/\\s+$/, \"\"),\n\t\t\tlegalRegx = [\n\t\t\t\t/^$/,\n\t\t\t\t/\\($/,\n\t\t\t\t/\\[$/,\n\t\t\t\t/\\!$/,\n\t\t\t\t/\\+$/,\n\t\t\t\t/\\-$/,\n\t\t\t\t/\\*$/,\n\t\t\t\t/\\/\\s+/,\n\t\t\t\t/\\%$/,\n\t\t\t\t/\\=$/,\n\t\t\t\t/\\>$/,\n\t\t\t\t/<$/,\n\t\t\t\t/\\&$/,\n\t\t\t\t/\\|$/,\n\t\t\t\t/\\^$/,\n\t\t\t\t/\\~$/,\n\t\t\t\t/\\?$/,\n\t\t\t\t/\\,$/,\n\t\t\t\t/delete$/,\n\t\t\t\t/in$/,\n\t\t\t\t/instanceof$/,\n\t\t\t\t/new$/,\n\t\t\t\t/typeof$/,\n\t\t\t\t/void$/\n\t\t\t];\n\n\tvar isLegal = legalRegx.some(function(reg) {\n\t\treturn reg.test(before);\n\t});\n\n\tif (!isLegal) {\n\t\treturn false;\n\t} else {\n\t\tvar sep = '/';\n\n\t\t// same logic as string\n\t\treturn this._parseJSString(token, idx, sep);\n\t}\n};\n\n\n/**\n *\n * find next sep(same line) index in `token`\n *\n * @return {Number}\n *\n */\nCSSOM.CSSValueExpression.prototype._findMatchedIdx = function(token, idx, sep) {\n\tvar startIdx = idx,\n\t\t\tendIdx;\n\n\tvar NOT_FOUND = -1;\n\n\twhile(true) {\n\t\tendIdx = token.indexOf(sep, startIdx + 1);\n\n\t\tif (endIdx === -1) { // not found\n\t\t\tendIdx = NOT_FOUND;\n\t\t\tbreak;\n\t\t} else {\n\t\t\tvar text = token.substring(idx + 1, endIdx),\n\t\t\t\t\tmatched = text.match(/\\\\+$/);\n\t\t\tif (!matched || matched[0] % 2 === 0) { // not escaped\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tstartIdx = endIdx;\n\t\t\t}\n\t\t}\n\t}\n\n\t// boundary must be in the same line(js sting or regexp)\n\tvar nextNewLineIdx = token.indexOf('\\n', idx + 1);\n\tif (nextNewLineIdx < endIdx) {\n\t\tendIdx = NOT_FOUND;\n\t}\n\n\n\treturn endIdx;\n};\n\n\n\n\n//.CommonJS\nexports.CSSValueExpression = CSSOM.CSSValueExpression;\n///CommonJS\n","//.CommonJS\nvar CSSOM = {};\n///CommonJS\n\n\n/**\n * @constructor\n * @see https://developer.mozilla.org/en/CSS/@-moz-document\n */\nCSSOM.MatcherList = function MatcherList(){\n this.length = 0;\n};\n\nCSSOM.MatcherList.prototype = {\n\n constructor: CSSOM.MatcherList,\n\n /**\n * @return {string}\n */\n get matcherText() {\n return Array.prototype.join.call(this, \", \");\n },\n\n /**\n * @param {string} value\n */\n set matcherText(value) {\n // just a temporary solution, actually it may be wrong by just split the value with ',', because a url can include ','.\n var values = value.split(\",\");\n var length = this.length = values.length;\n for (var i=0; i 0;\n\n\t\t\t\t\twhile (ancestorRules.length > 0) {\n\t\t\t\t\t\tparentRule = ancestorRules.pop();\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tparentRule.constructor.name === \"CSSMediaRule\"\n\t\t\t\t\t\t\t|| parentRule.constructor.name === \"CSSSupportsRule\"\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tprevScope = currentScope;\n\t\t\t\t\t\t\tcurrentScope = parentRule;\n\t\t\t\t\t\t\tcurrentScope.cssRules.push(prevScope);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (ancestorRules.length === 0) {\n\t\t\t\t\t\t\thasAncestors = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (!hasAncestors) {\n\t\t\t\t\t\tcurrentScope.__ends = i + 1;\n\t\t\t\t\t\tstyleSheet.cssRules.push(currentScope);\n\t\t\t\t\t\tcurrentScope = styleSheet;\n\t\t\t\t\t\tparentRule = null;\n\t\t\t\t\t}\n\n\t\t\t\t\tbuffer = \"\";\n\t\t\t\t\tstate = \"before-selector\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tswitch (state) {\n\t\t\t\tcase \"before-selector\":\n\t\t\t\t\tstate = \"selector\";\n\t\t\t\t\tstyleRule = new CSSOM.CSSStyleRule();\n\t\t\t\t\tstyleRule.__starts = i;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"before-name\":\n\t\t\t\t\tstate = \"name\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"before-value\":\n\t\t\t\t\tstate = \"value\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"importRule-begin\":\n\t\t\t\t\tstate = \"importRule\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbuffer += character;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn styleSheet;\n};\n\n\n//.CommonJS\nexports.parse = CSSOM.parse;\n// The following modules cannot be included sooner due to the mutual dependency with parse.js\nCSSOM.CSSStyleSheet = require(\"./CSSStyleSheet\").CSSStyleSheet;\nCSSOM.CSSStyleRule = require(\"./CSSStyleRule\").CSSStyleRule;\nCSSOM.CSSImportRule = require(\"./CSSImportRule\").CSSImportRule;\nCSSOM.CSSMediaRule = require(\"./CSSMediaRule\").CSSMediaRule;\nCSSOM.CSSSupportsRule = require(\"./CSSSupportsRule\").CSSSupportsRule;\nCSSOM.CSSFontFaceRule = require(\"./CSSFontFaceRule\").CSSFontFaceRule;\nCSSOM.CSSHostRule = require(\"./CSSHostRule\").CSSHostRule;\nCSSOM.CSSStyleDeclaration = require('./CSSStyleDeclaration').CSSStyleDeclaration;\nCSSOM.CSSKeyframeRule = require('./CSSKeyframeRule').CSSKeyframeRule;\nCSSOM.CSSKeyframesRule = require('./CSSKeyframesRule').CSSKeyframesRule;\nCSSOM.CSSValueExpression = require('./CSSValueExpression').CSSValueExpression;\nCSSOM.CSSDocumentRule = require('./CSSDocumentRule').CSSDocumentRule;\n///CommonJS\n","// https://d3js.org/d3-array/ v2.12.1 Copyright 2021 Mike Bostock\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\ntypeof define === 'function' && define.amd ? define(['exports'], factory) :\n(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.d3 = global.d3 || {}));\n}(this, (function (exports) { 'use strict';\n\nfunction ascending(a, b) {\n return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n\nfunction bisector(f) {\n let delta = f;\n let compare = f;\n\n if (f.length === 1) {\n delta = (d, x) => f(d) - x;\n compare = ascendingComparator(f);\n }\n\n function left(a, x, lo, hi) {\n if (lo == null) lo = 0;\n if (hi == null) hi = a.length;\n while (lo < hi) {\n const mid = (lo + hi) >>> 1;\n if (compare(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n }\n return lo;\n }\n\n function right(a, x, lo, hi) {\n if (lo == null) lo = 0;\n if (hi == null) hi = a.length;\n while (lo < hi) {\n const mid = (lo + hi) >>> 1;\n if (compare(a[mid], x) > 0) hi = mid;\n else lo = mid + 1;\n }\n return lo;\n }\n\n function center(a, x, lo, hi) {\n if (lo == null) lo = 0;\n if (hi == null) hi = a.length;\n const i = left(a, x, lo, hi - 1);\n return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;\n }\n\n return {left, center, right};\n}\n\nfunction ascendingComparator(f) {\n return (d, x) => ascending(f(d), x);\n}\n\nfunction number(x) {\n return x === null ? NaN : +x;\n}\n\nfunction* numbers(values, valueof) {\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n yield value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n yield value;\n }\n }\n }\n}\n\nconst ascendingBisect = bisector(ascending);\nconst bisectRight = ascendingBisect.right;\nconst bisectLeft = ascendingBisect.left;\nconst bisectCenter = bisector(number).center;\n\nfunction count(values, valueof) {\n let count = 0;\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n ++count;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n ++count;\n }\n }\n }\n return count;\n}\n\nfunction length$1(array) {\n return array.length | 0;\n}\n\nfunction empty(length) {\n return !(length > 0);\n}\n\nfunction arrayify(values) {\n return typeof values !== \"object\" || \"length\" in values ? values : Array.from(values);\n}\n\nfunction reducer(reduce) {\n return values => reduce(...values);\n}\n\nfunction cross(...values) {\n const reduce = typeof values[values.length - 1] === \"function\" && reducer(values.pop());\n values = values.map(arrayify);\n const lengths = values.map(length$1);\n const j = values.length - 1;\n const index = new Array(j + 1).fill(0);\n const product = [];\n if (j < 0 || lengths.some(empty)) return product;\n while (true) {\n product.push(index.map((j, i) => values[i][j]));\n let i = j;\n while (++index[i] === lengths[i]) {\n if (i === 0) return reduce ? product.map(reduce) : product;\n index[i--] = 0;\n }\n }\n}\n\nfunction cumsum(values, valueof) {\n var sum = 0, index = 0;\n return Float64Array.from(values, valueof === undefined\n ? v => (sum += +v || 0)\n : v => (sum += +valueof(v, index++, values) || 0));\n}\n\nfunction descending(a, b) {\n return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;\n}\n\nfunction variance(values, valueof) {\n let count = 0;\n let delta;\n let mean = 0;\n let sum = 0;\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n delta = value - mean;\n mean += delta / ++count;\n sum += delta * (value - mean);\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n delta = value - mean;\n mean += delta / ++count;\n sum += delta * (value - mean);\n }\n }\n }\n if (count > 1) return sum / (count - 1);\n}\n\nfunction deviation(values, valueof) {\n const v = variance(values, valueof);\n return v ? Math.sqrt(v) : v;\n}\n\nfunction extent(values, valueof) {\n let min;\n let max;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null) {\n if (min === undefined) {\n if (value >= value) min = max = value;\n } else {\n if (min > value) min = value;\n if (max < value) max = value;\n }\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null) {\n if (min === undefined) {\n if (value >= value) min = max = value;\n } else {\n if (min > value) min = value;\n if (max < value) max = value;\n }\n }\n }\n }\n return [min, max];\n}\n\n// https://github.com/python/cpython/blob/a74eea238f5baba15797e2e8b570d153bc8690a7/Modules/mathmodule.c#L1423\nclass Adder {\n constructor() {\n this._partials = new Float64Array(32);\n this._n = 0;\n }\n add(x) {\n const p = this._partials;\n let i = 0;\n for (let j = 0; j < this._n && j < 32; j++) {\n const y = p[j],\n hi = x + y,\n lo = Math.abs(x) < Math.abs(y) ? x - (hi - y) : y - (hi - x);\n if (lo) p[i++] = lo;\n x = hi;\n }\n p[i] = x;\n this._n = i + 1;\n return this;\n }\n valueOf() {\n const p = this._partials;\n let n = this._n, x, y, lo, hi = 0;\n if (n > 0) {\n hi = p[--n];\n while (n > 0) {\n x = hi;\n y = p[--n];\n hi = x + y;\n lo = y - (hi - x);\n if (lo) break;\n }\n if (n > 0 && ((lo < 0 && p[n - 1] < 0) || (lo > 0 && p[n - 1] > 0))) {\n y = lo * 2;\n x = hi + y;\n if (y == x - hi) hi = x;\n }\n }\n return hi;\n }\n}\n\nfunction fsum(values, valueof) {\n const adder = new Adder();\n if (valueof === undefined) {\n for (let value of values) {\n if (value = +value) {\n adder.add(value);\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if (value = +valueof(value, ++index, values)) {\n adder.add(value);\n }\n }\n }\n return +adder;\n}\n\nfunction fcumsum(values, valueof) {\n const adder = new Adder();\n let index = -1;\n return Float64Array.from(values, valueof === undefined\n ? v => adder.add(+v || 0)\n : v => adder.add(+valueof(v, ++index, values) || 0)\n );\n}\n\nclass InternMap extends Map {\n constructor(entries, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (entries != null) for (const [key, value] of entries) this.set(key, value);\n }\n get(key) {\n return super.get(intern_get(this, key));\n }\n has(key) {\n return super.has(intern_get(this, key));\n }\n set(key, value) {\n return super.set(intern_set(this, key), value);\n }\n delete(key) {\n return super.delete(intern_delete(this, key));\n }\n}\n\nclass InternSet extends Set {\n constructor(values, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (values != null) for (const value of values) this.add(value);\n }\n has(value) {\n return super.has(intern_get(this, value));\n }\n add(value) {\n return super.add(intern_set(this, value));\n }\n delete(value) {\n return super.delete(intern_delete(this, value));\n }\n}\n\nfunction intern_get({_intern, _key}, value) {\n const key = _key(value);\n return _intern.has(key) ? _intern.get(key) : value;\n}\n\nfunction intern_set({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) return _intern.get(key);\n _intern.set(key, value);\n return value;\n}\n\nfunction intern_delete({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) {\n value = _intern.get(value);\n _intern.delete(key);\n }\n return value;\n}\n\nfunction keyof(value) {\n return value !== null && typeof value === \"object\" ? value.valueOf() : value;\n}\n\nfunction identity(x) {\n return x;\n}\n\nfunction group(values, ...keys) {\n return nest(values, identity, identity, keys);\n}\n\nfunction groups(values, ...keys) {\n return nest(values, Array.from, identity, keys);\n}\n\nfunction rollup(values, reduce, ...keys) {\n return nest(values, identity, reduce, keys);\n}\n\nfunction rollups(values, reduce, ...keys) {\n return nest(values, Array.from, reduce, keys);\n}\n\nfunction index(values, ...keys) {\n return nest(values, identity, unique, keys);\n}\n\nfunction indexes(values, ...keys) {\n return nest(values, Array.from, unique, keys);\n}\n\nfunction unique(values) {\n if (values.length !== 1) throw new Error(\"duplicate key\");\n return values[0];\n}\n\nfunction nest(values, map, reduce, keys) {\n return (function regroup(values, i) {\n if (i >= keys.length) return reduce(values);\n const groups = new InternMap();\n const keyof = keys[i++];\n let index = -1;\n for (const value of values) {\n const key = keyof(value, ++index, values);\n const group = groups.get(key);\n if (group) group.push(value);\n else groups.set(key, [value]);\n }\n for (const [key, values] of groups) {\n groups.set(key, regroup(values, i));\n }\n return map(groups);\n })(values, 0);\n}\n\nfunction permute(source, keys) {\n return Array.from(keys, key => source[key]);\n}\n\nfunction sort(values, ...F) {\n if (typeof values[Symbol.iterator] !== \"function\") throw new TypeError(\"values is not iterable\");\n values = Array.from(values);\n let [f = ascending] = F;\n if (f.length === 1 || F.length > 1) {\n const index = Uint32Array.from(values, (d, i) => i);\n if (F.length > 1) {\n F = F.map(f => values.map(f));\n index.sort((i, j) => {\n for (const f of F) {\n const c = ascending(f[i], f[j]);\n if (c) return c;\n }\n });\n } else {\n f = values.map(f);\n index.sort((i, j) => ascending(f[i], f[j]));\n }\n return permute(values, index);\n }\n return values.sort(f);\n}\n\nfunction groupSort(values, reduce, key) {\n return (reduce.length === 1\n ? sort(rollup(values, reduce, key), (([ak, av], [bk, bv]) => ascending(av, bv) || ascending(ak, bk)))\n : sort(group(values, key), (([ak, av], [bk, bv]) => reduce(av, bv) || ascending(ak, bk))))\n .map(([key]) => key);\n}\n\nvar array = Array.prototype;\n\nvar slice = array.slice;\n\nfunction constant(x) {\n return function() {\n return x;\n };\n}\n\nvar e10 = Math.sqrt(50),\n e5 = Math.sqrt(10),\n e2 = Math.sqrt(2);\n\nfunction ticks(start, stop, count) {\n var reverse,\n i = -1,\n n,\n ticks,\n step;\n\n stop = +stop, start = +start, count = +count;\n if (start === stop && count > 0) return [start];\n if (reverse = stop < start) n = start, start = stop, stop = n;\n if ((step = tickIncrement(start, stop, count)) === 0 || !isFinite(step)) return [];\n\n if (step > 0) {\n let r0 = Math.round(start / step), r1 = Math.round(stop / step);\n if (r0 * step < start) ++r0;\n if (r1 * step > stop) --r1;\n ticks = new Array(n = r1 - r0 + 1);\n while (++i < n) ticks[i] = (r0 + i) * step;\n } else {\n step = -step;\n let r0 = Math.round(start * step), r1 = Math.round(stop * step);\n if (r0 / step < start) ++r0;\n if (r1 / step > stop) --r1;\n ticks = new Array(n = r1 - r0 + 1);\n while (++i < n) ticks[i] = (r0 + i) / step;\n }\n\n if (reverse) ticks.reverse();\n\n return ticks;\n}\n\nfunction tickIncrement(start, stop, count) {\n var step = (stop - start) / Math.max(0, count),\n power = Math.floor(Math.log(step) / Math.LN10),\n error = step / Math.pow(10, power);\n return power >= 0\n ? (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1) * Math.pow(10, power)\n : -Math.pow(10, -power) / (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1);\n}\n\nfunction tickStep(start, stop, count) {\n var step0 = Math.abs(stop - start) / Math.max(0, count),\n step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)),\n error = step0 / step1;\n if (error >= e10) step1 *= 10;\n else if (error >= e5) step1 *= 5;\n else if (error >= e2) step1 *= 2;\n return stop < start ? -step1 : step1;\n}\n\nfunction nice(start, stop, count) {\n let prestep;\n while (true) {\n const step = tickIncrement(start, stop, count);\n if (step === prestep || step === 0 || !isFinite(step)) {\n return [start, stop];\n } else if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n } else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n }\n prestep = step;\n }\n}\n\nfunction sturges(values) {\n return Math.ceil(Math.log(count(values)) / Math.LN2) + 1;\n}\n\nfunction bin() {\n var value = identity,\n domain = extent,\n threshold = sturges;\n\n function histogram(data) {\n if (!Array.isArray(data)) data = Array.from(data);\n\n var i,\n n = data.length,\n x,\n values = new Array(n);\n\n for (i = 0; i < n; ++i) {\n values[i] = value(data[i], i, data);\n }\n\n var xz = domain(values),\n x0 = xz[0],\n x1 = xz[1],\n tz = threshold(values, x0, x1);\n\n // Convert number of thresholds into uniform thresholds, and nice the\n // default domain accordingly.\n if (!Array.isArray(tz)) {\n const max = x1, tn = +tz;\n if (domain === extent) [x0, x1] = nice(x0, x1, tn);\n tz = ticks(x0, x1, tn);\n\n // If the last threshold is coincident with the domain’s upper bound, the\n // last bin will be zero-width. If the default domain is used, and this\n // last threshold is coincident with the maximum input value, we can\n // extend the niced upper bound by one tick to ensure uniform bin widths;\n // otherwise, we simply remove the last threshold. Note that we don’t\n // coerce values or the domain to numbers, and thus must be careful to\n // compare order (>=) rather than strict equality (===)!\n if (tz[tz.length - 1] >= x1) {\n if (max >= x1 && domain === extent) {\n const step = tickIncrement(x0, x1, tn);\n if (isFinite(step)) {\n if (step > 0) {\n x1 = (Math.floor(x1 / step) + 1) * step;\n } else if (step < 0) {\n x1 = (Math.ceil(x1 * -step) + 1) / -step;\n }\n }\n } else {\n tz.pop();\n }\n }\n }\n\n // Remove any thresholds outside the domain.\n var m = tz.length;\n while (tz[0] <= x0) tz.shift(), --m;\n while (tz[m - 1] > x1) tz.pop(), --m;\n\n var bins = new Array(m + 1),\n bin;\n\n // Initialize bins.\n for (i = 0; i <= m; ++i) {\n bin = bins[i] = [];\n bin.x0 = i > 0 ? tz[i - 1] : x0;\n bin.x1 = i < m ? tz[i] : x1;\n }\n\n // Assign data to bins by value, ignoring any outside the domain.\n for (i = 0; i < n; ++i) {\n x = values[i];\n if (x0 <= x && x <= x1) {\n bins[bisectRight(tz, x, 0, m)].push(data[i]);\n }\n }\n\n return bins;\n }\n\n histogram.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(_), histogram) : value;\n };\n\n histogram.domain = function(_) {\n return arguments.length ? (domain = typeof _ === \"function\" ? _ : constant([_[0], _[1]]), histogram) : domain;\n };\n\n histogram.thresholds = function(_) {\n return arguments.length ? (threshold = typeof _ === \"function\" ? _ : Array.isArray(_) ? constant(slice.call(_)) : constant(_), histogram) : threshold;\n };\n\n return histogram;\n}\n\nfunction max(values, valueof) {\n let max;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n }\n return max;\n}\n\nfunction min(values, valueof) {\n let min;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n }\n return min;\n}\n\n// Based on https://github.com/mourner/quickselect\n// ISC license, Copyright 2018 Vladimir Agafonkin.\nfunction quickselect(array, k, left = 0, right = array.length - 1, compare = ascending) {\n while (right > left) {\n if (right - left > 600) {\n const n = right - left + 1;\n const m = k - left + 1;\n const z = Math.log(n);\n const s = 0.5 * Math.exp(2 * z / 3);\n const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n quickselect(array, k, newLeft, newRight, compare);\n }\n\n const t = array[k];\n let i = left;\n let j = right;\n\n swap(array, left, k);\n if (compare(array[right], t) > 0) swap(array, left, right);\n\n while (i < j) {\n swap(array, i, j), ++i, --j;\n while (compare(array[i], t) < 0) ++i;\n while (compare(array[j], t) > 0) --j;\n }\n\n if (compare(array[left], t) === 0) swap(array, left, j);\n else ++j, swap(array, j, right);\n\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n return array;\n}\n\nfunction swap(array, i, j) {\n const t = array[i];\n array[i] = array[j];\n array[j] = t;\n}\n\nfunction quantile(values, p, valueof) {\n values = Float64Array.from(numbers(values, valueof));\n if (!(n = values.length)) return;\n if ((p = +p) <= 0 || n < 2) return min(values);\n if (p >= 1) return max(values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = max(quickselect(values, i0).subarray(0, i0 + 1)),\n value1 = min(values.subarray(i0 + 1));\n return value0 + (value1 - value0) * (i - i0);\n}\n\nfunction quantileSorted(values, p, valueof = number) {\n if (!(n = values.length)) return;\n if ((p = +p) <= 0 || n < 2) return +valueof(values[0], 0, values);\n if (p >= 1) return +valueof(values[n - 1], n - 1, values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = +valueof(values[i0], i0, values),\n value1 = +valueof(values[i0 + 1], i0 + 1, values);\n return value0 + (value1 - value0) * (i - i0);\n}\n\nfunction freedmanDiaconis(values, min, max) {\n return Math.ceil((max - min) / (2 * (quantile(values, 0.75) - quantile(values, 0.25)) * Math.pow(count(values), -1 / 3)));\n}\n\nfunction scott(values, min, max) {\n return Math.ceil((max - min) / (3.5 * deviation(values) * Math.pow(count(values), -1 / 3)));\n}\n\nfunction maxIndex(values, valueof) {\n let max;\n let maxIndex = -1;\n let index = -1;\n if (valueof === undefined) {\n for (const value of values) {\n ++index;\n if (value != null\n && (max < value || (max === undefined && value >= value))) {\n max = value, maxIndex = index;\n }\n }\n } else {\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (max < value || (max === undefined && value >= value))) {\n max = value, maxIndex = index;\n }\n }\n }\n return maxIndex;\n}\n\nfunction mean(values, valueof) {\n let count = 0;\n let sum = 0;\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n ++count, sum += value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n ++count, sum += value;\n }\n }\n }\n if (count) return sum / count;\n}\n\nfunction median(values, valueof) {\n return quantile(values, 0.5, valueof);\n}\n\nfunction* flatten(arrays) {\n for (const array of arrays) {\n yield* array;\n }\n}\n\nfunction merge(arrays) {\n return Array.from(flatten(arrays));\n}\n\nfunction minIndex(values, valueof) {\n let min;\n let minIndex = -1;\n let index = -1;\n if (valueof === undefined) {\n for (const value of values) {\n ++index;\n if (value != null\n && (min > value || (min === undefined && value >= value))) {\n min = value, minIndex = index;\n }\n }\n } else {\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (min > value || (min === undefined && value >= value))) {\n min = value, minIndex = index;\n }\n }\n }\n return minIndex;\n}\n\nfunction pairs(values, pairof = pair) {\n const pairs = [];\n let previous;\n let first = false;\n for (const value of values) {\n if (first) pairs.push(pairof(previous, value));\n previous = value;\n first = true;\n }\n return pairs;\n}\n\nfunction pair(a, b) {\n return [a, b];\n}\n\nfunction range(start, stop, step) {\n start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;\n\n var i = -1,\n n = Math.max(0, Math.ceil((stop - start) / step)) | 0,\n range = new Array(n);\n\n while (++i < n) {\n range[i] = start + i * step;\n }\n\n return range;\n}\n\nfunction least(values, compare = ascending) {\n let min;\n let defined = false;\n if (compare.length === 1) {\n let minValue;\n for (const element of values) {\n const value = compare(element);\n if (defined\n ? ascending(value, minValue) < 0\n : ascending(value, value) === 0) {\n min = element;\n minValue = value;\n defined = true;\n }\n }\n } else {\n for (const value of values) {\n if (defined\n ? compare(value, min) < 0\n : compare(value, value) === 0) {\n min = value;\n defined = true;\n }\n }\n }\n return min;\n}\n\nfunction leastIndex(values, compare = ascending) {\n if (compare.length === 1) return minIndex(values, compare);\n let minValue;\n let min = -1;\n let index = -1;\n for (const value of values) {\n ++index;\n if (min < 0\n ? compare(value, value) === 0\n : compare(value, minValue) < 0) {\n minValue = value;\n min = index;\n }\n }\n return min;\n}\n\nfunction greatest(values, compare = ascending) {\n let max;\n let defined = false;\n if (compare.length === 1) {\n let maxValue;\n for (const element of values) {\n const value = compare(element);\n if (defined\n ? ascending(value, maxValue) > 0\n : ascending(value, value) === 0) {\n max = element;\n maxValue = value;\n defined = true;\n }\n }\n } else {\n for (const value of values) {\n if (defined\n ? compare(value, max) > 0\n : compare(value, value) === 0) {\n max = value;\n defined = true;\n }\n }\n }\n return max;\n}\n\nfunction greatestIndex(values, compare = ascending) {\n if (compare.length === 1) return maxIndex(values, compare);\n let maxValue;\n let max = -1;\n let index = -1;\n for (const value of values) {\n ++index;\n if (max < 0\n ? compare(value, value) === 0\n : compare(value, maxValue) > 0) {\n maxValue = value;\n max = index;\n }\n }\n return max;\n}\n\nfunction scan(values, compare) {\n const index = leastIndex(values, compare);\n return index < 0 ? undefined : index;\n}\n\nvar shuffle = shuffler(Math.random);\n\nfunction shuffler(random) {\n return function shuffle(array, i0 = 0, i1 = array.length) {\n let m = i1 - (i0 = +i0);\n while (m) {\n const i = random() * m-- | 0, t = array[m + i0];\n array[m + i0] = array[i + i0];\n array[i + i0] = t;\n }\n return array;\n };\n}\n\nfunction sum(values, valueof) {\n let sum = 0;\n if (valueof === undefined) {\n for (let value of values) {\n if (value = +value) {\n sum += value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if (value = +valueof(value, ++index, values)) {\n sum += value;\n }\n }\n }\n return sum;\n}\n\nfunction transpose(matrix) {\n if (!(n = matrix.length)) return [];\n for (var i = -1, m = min(matrix, length), transpose = new Array(m); ++i < m;) {\n for (var j = -1, n, row = transpose[i] = new Array(n); ++j < n;) {\n row[j] = matrix[j][i];\n }\n }\n return transpose;\n}\n\nfunction length(d) {\n return d.length;\n}\n\nfunction zip() {\n return transpose(arguments);\n}\n\nfunction every(values, test) {\n if (typeof test !== \"function\") throw new TypeError(\"test is not a function\");\n let index = -1;\n for (const value of values) {\n if (!test(value, ++index, values)) {\n return false;\n }\n }\n return true;\n}\n\nfunction some(values, test) {\n if (typeof test !== \"function\") throw new TypeError(\"test is not a function\");\n let index = -1;\n for (const value of values) {\n if (test(value, ++index, values)) {\n return true;\n }\n }\n return false;\n}\n\nfunction filter(values, test) {\n if (typeof test !== \"function\") throw new TypeError(\"test is not a function\");\n const array = [];\n let index = -1;\n for (const value of values) {\n if (test(value, ++index, values)) {\n array.push(value);\n }\n }\n return array;\n}\n\nfunction map(values, mapper) {\n if (typeof values[Symbol.iterator] !== \"function\") throw new TypeError(\"values is not iterable\");\n if (typeof mapper !== \"function\") throw new TypeError(\"mapper is not a function\");\n return Array.from(values, (value, index) => mapper(value, index, values));\n}\n\nfunction reduce(values, reducer, value) {\n if (typeof reducer !== \"function\") throw new TypeError(\"reducer is not a function\");\n const iterator = values[Symbol.iterator]();\n let done, next, index = -1;\n if (arguments.length < 3) {\n ({done, value} = iterator.next());\n if (done) return;\n ++index;\n }\n while (({done, value: next} = iterator.next()), !done) {\n value = reducer(value, next, ++index, values);\n }\n return value;\n}\n\nfunction reverse(values) {\n if (typeof values[Symbol.iterator] !== \"function\") throw new TypeError(\"values is not iterable\");\n return Array.from(values).reverse();\n}\n\nfunction difference(values, ...others) {\n values = new Set(values);\n for (const other of others) {\n for (const value of other) {\n values.delete(value);\n }\n }\n return values;\n}\n\nfunction disjoint(values, other) {\n const iterator = other[Symbol.iterator](), set = new Set();\n for (const v of values) {\n if (set.has(v)) return false;\n let value, done;\n while (({value, done} = iterator.next())) {\n if (done) break;\n if (Object.is(v, value)) return false;\n set.add(value);\n }\n }\n return true;\n}\n\nfunction set(values) {\n return values instanceof Set ? values : new Set(values);\n}\n\nfunction intersection(values, ...others) {\n values = new Set(values);\n others = others.map(set);\n out: for (const value of values) {\n for (const other of others) {\n if (!other.has(value)) {\n values.delete(value);\n continue out;\n }\n }\n }\n return values;\n}\n\nfunction superset(values, other) {\n const iterator = values[Symbol.iterator](), set = new Set();\n for (const o of other) {\n if (set.has(o)) continue;\n let value, done;\n while (({value, done} = iterator.next())) {\n if (done) return false;\n set.add(value);\n if (Object.is(o, value)) break;\n }\n }\n return true;\n}\n\nfunction subset(values, other) {\n return superset(other, values);\n}\n\nfunction union(...others) {\n const set = new Set();\n for (const other of others) {\n for (const o of other) {\n set.add(o);\n }\n }\n return set;\n}\n\nexports.Adder = Adder;\nexports.InternMap = InternMap;\nexports.InternSet = InternSet;\nexports.ascending = ascending;\nexports.bin = bin;\nexports.bisect = bisectRight;\nexports.bisectCenter = bisectCenter;\nexports.bisectLeft = bisectLeft;\nexports.bisectRight = bisectRight;\nexports.bisector = bisector;\nexports.count = count;\nexports.cross = cross;\nexports.cumsum = cumsum;\nexports.descending = descending;\nexports.deviation = deviation;\nexports.difference = difference;\nexports.disjoint = disjoint;\nexports.every = every;\nexports.extent = extent;\nexports.fcumsum = fcumsum;\nexports.filter = filter;\nexports.fsum = fsum;\nexports.greatest = greatest;\nexports.greatestIndex = greatestIndex;\nexports.group = group;\nexports.groupSort = groupSort;\nexports.groups = groups;\nexports.histogram = bin;\nexports.index = index;\nexports.indexes = indexes;\nexports.intersection = intersection;\nexports.least = least;\nexports.leastIndex = leastIndex;\nexports.map = map;\nexports.max = max;\nexports.maxIndex = maxIndex;\nexports.mean = mean;\nexports.median = median;\nexports.merge = merge;\nexports.min = min;\nexports.minIndex = minIndex;\nexports.nice = nice;\nexports.pairs = pairs;\nexports.permute = permute;\nexports.quantile = quantile;\nexports.quantileSorted = quantileSorted;\nexports.quickselect = quickselect;\nexports.range = range;\nexports.reduce = reduce;\nexports.reverse = reverse;\nexports.rollup = rollup;\nexports.rollups = rollups;\nexports.scan = scan;\nexports.shuffle = shuffle;\nexports.shuffler = shuffler;\nexports.some = some;\nexports.sort = sort;\nexports.subset = subset;\nexports.sum = sum;\nexports.superset = superset;\nexports.thresholdFreedmanDiaconis = freedmanDiaconis;\nexports.thresholdScott = scott;\nexports.thresholdSturges = sturges;\nexports.tickIncrement = tickIncrement;\nexports.tickStep = tickStep;\nexports.ticks = ticks;\nexports.transpose = transpose;\nexports.union = union;\nexports.variance = variance;\nexports.zip = zip;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n","// https://d3js.org/d3-axis/ v2.1.0 Copyright 2021 Mike Bostock\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\ntypeof define === 'function' && define.amd ? define(['exports'], factory) :\n(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.d3 = global.d3 || {}));\n}(this, (function (exports) { 'use strict';\n\nvar slice = Array.prototype.slice;\n\nfunction identity(x) {\n return x;\n}\n\nvar top = 1,\n right = 2,\n bottom = 3,\n left = 4,\n epsilon = 1e-6;\n\nfunction translateX(x) {\n return \"translate(\" + x + \",0)\";\n}\n\nfunction translateY(y) {\n return \"translate(0,\" + y + \")\";\n}\n\nfunction number(scale) {\n return d => +scale(d);\n}\n\nfunction center(scale, offset) {\n offset = Math.max(0, scale.bandwidth() - offset * 2) / 2;\n if (scale.round()) offset = Math.round(offset);\n return d => +scale(d) + offset;\n}\n\nfunction entering() {\n return !this.__axis;\n}\n\nfunction axis(orient, scale) {\n var tickArguments = [],\n tickValues = null,\n tickFormat = null,\n tickSizeInner = 6,\n tickSizeOuter = 6,\n tickPadding = 3,\n offset = typeof window !== \"undefined\" && window.devicePixelRatio > 1 ? 0 : 0.5,\n k = orient === top || orient === left ? -1 : 1,\n x = orient === left || orient === right ? \"x\" : \"y\",\n transform = orient === top || orient === bottom ? translateX : translateY;\n\n function axis(context) {\n var values = tickValues == null ? (scale.ticks ? scale.ticks.apply(scale, tickArguments) : scale.domain()) : tickValues,\n format = tickFormat == null ? (scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : identity) : tickFormat,\n spacing = Math.max(tickSizeInner, 0) + tickPadding,\n range = scale.range(),\n range0 = +range[0] + offset,\n range1 = +range[range.length - 1] + offset,\n position = (scale.bandwidth ? center : number)(scale.copy(), offset),\n selection = context.selection ? context.selection() : context,\n path = selection.selectAll(\".domain\").data([null]),\n tick = selection.selectAll(\".tick\").data(values, scale).order(),\n tickExit = tick.exit(),\n tickEnter = tick.enter().append(\"g\").attr(\"class\", \"tick\"),\n line = tick.select(\"line\"),\n text = tick.select(\"text\");\n\n path = path.merge(path.enter().insert(\"path\", \".tick\")\n .attr(\"class\", \"domain\")\n .attr(\"stroke\", \"currentColor\"));\n\n tick = tick.merge(tickEnter);\n\n line = line.merge(tickEnter.append(\"line\")\n .attr(\"stroke\", \"currentColor\")\n .attr(x + \"2\", k * tickSizeInner));\n\n text = text.merge(tickEnter.append(\"text\")\n .attr(\"fill\", \"currentColor\")\n .attr(x, k * spacing)\n .attr(\"dy\", orient === top ? \"0em\" : orient === bottom ? \"0.71em\" : \"0.32em\"));\n\n if (context !== selection) {\n path = path.transition(context);\n tick = tick.transition(context);\n line = line.transition(context);\n text = text.transition(context);\n\n tickExit = tickExit.transition(context)\n .attr(\"opacity\", epsilon)\n .attr(\"transform\", function(d) { return isFinite(d = position(d)) ? transform(d + offset) : this.getAttribute(\"transform\"); });\n\n tickEnter\n .attr(\"opacity\", epsilon)\n .attr(\"transform\", function(d) { var p = this.parentNode.__axis; return transform((p && isFinite(p = p(d)) ? p : position(d)) + offset); });\n }\n\n tickExit.remove();\n\n path\n .attr(\"d\", orient === left || orient === right\n ? (tickSizeOuter ? \"M\" + k * tickSizeOuter + \",\" + range0 + \"H\" + offset + \"V\" + range1 + \"H\" + k * tickSizeOuter : \"M\" + offset + \",\" + range0 + \"V\" + range1)\n : (tickSizeOuter ? \"M\" + range0 + \",\" + k * tickSizeOuter + \"V\" + offset + \"H\" + range1 + \"V\" + k * tickSizeOuter : \"M\" + range0 + \",\" + offset + \"H\" + range1));\n\n tick\n .attr(\"opacity\", 1)\n .attr(\"transform\", function(d) { return transform(position(d) + offset); });\n\n line\n .attr(x + \"2\", k * tickSizeInner);\n\n text\n .attr(x, k * spacing)\n .text(format);\n\n selection.filter(entering)\n .attr(\"fill\", \"none\")\n .attr(\"font-size\", 10)\n .attr(\"font-family\", \"sans-serif\")\n .attr(\"text-anchor\", orient === right ? \"start\" : orient === left ? \"end\" : \"middle\");\n\n selection\n .each(function() { this.__axis = position; });\n }\n\n axis.scale = function(_) {\n return arguments.length ? (scale = _, axis) : scale;\n };\n\n axis.ticks = function() {\n return tickArguments = slice.call(arguments), axis;\n };\n\n axis.tickArguments = function(_) {\n return arguments.length ? (tickArguments = _ == null ? [] : slice.call(_), axis) : tickArguments.slice();\n };\n\n axis.tickValues = function(_) {\n return arguments.length ? (tickValues = _ == null ? null : slice.call(_), axis) : tickValues && tickValues.slice();\n };\n\n axis.tickFormat = function(_) {\n return arguments.length ? (tickFormat = _, axis) : tickFormat;\n };\n\n axis.tickSize = function(_) {\n return arguments.length ? (tickSizeInner = tickSizeOuter = +_, axis) : tickSizeInner;\n };\n\n axis.tickSizeInner = function(_) {\n return arguments.length ? (tickSizeInner = +_, axis) : tickSizeInner;\n };\n\n axis.tickSizeOuter = function(_) {\n return arguments.length ? (tickSizeOuter = +_, axis) : tickSizeOuter;\n };\n\n axis.tickPadding = function(_) {\n return arguments.length ? (tickPadding = +_, axis) : tickPadding;\n };\n\n axis.offset = function(_) {\n return arguments.length ? (offset = +_, axis) : offset;\n };\n\n return axis;\n}\n\nfunction axisTop(scale) {\n return axis(top, scale);\n}\n\nfunction axisRight(scale) {\n return axis(right, scale);\n}\n\nfunction axisBottom(scale) {\n return axis(bottom, scale);\n}\n\nfunction axisLeft(scale) {\n return axis(left, scale);\n}\n\nexports.axisBottom = axisBottom;\nexports.axisLeft = axisLeft;\nexports.axisRight = axisRight;\nexports.axisTop = axisTop;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n","// https://d3js.org/d3-brush/ v2.1.0 Copyright 2020 Mike Bostock\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-dispatch'), require('d3-drag'), require('d3-interpolate'), require('d3-selection'), require('d3-transition')) :\ntypeof define === 'function' && define.amd ? define(['exports', 'd3-dispatch', 'd3-drag', 'd3-interpolate', 'd3-selection', 'd3-transition'], factory) :\n(global = global || self, factory(global.d3 = global.d3 || {}, global.d3, global.d3, global.d3, global.d3, global.d3));\n}(this, function (exports, d3Dispatch, d3Drag, d3Interpolate, d3Selection, d3Transition) { 'use strict';\n\nvar constant = x => () => x;\n\nfunction BrushEvent(type, {\n sourceEvent,\n target,\n selection,\n mode,\n dispatch\n}) {\n Object.defineProperties(this, {\n type: {value: type, enumerable: true, configurable: true},\n sourceEvent: {value: sourceEvent, enumerable: true, configurable: true},\n target: {value: target, enumerable: true, configurable: true},\n selection: {value: selection, enumerable: true, configurable: true},\n mode: {value: mode, enumerable: true, configurable: true},\n _: {value: dispatch}\n });\n}\n\nfunction nopropagation(event) {\n event.stopImmediatePropagation();\n}\n\nfunction noevent(event) {\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n\nvar MODE_DRAG = {name: \"drag\"},\n MODE_SPACE = {name: \"space\"},\n MODE_HANDLE = {name: \"handle\"},\n MODE_CENTER = {name: \"center\"};\n\nconst {abs, max, min} = Math;\n\nfunction number1(e) {\n return [+e[0], +e[1]];\n}\n\nfunction number2(e) {\n return [number1(e[0]), number1(e[1])];\n}\n\nvar X = {\n name: \"x\",\n handles: [\"w\", \"e\"].map(type),\n input: function(x, e) { return x == null ? null : [[+x[0], e[0][1]], [+x[1], e[1][1]]]; },\n output: function(xy) { return xy && [xy[0][0], xy[1][0]]; }\n};\n\nvar Y = {\n name: \"y\",\n handles: [\"n\", \"s\"].map(type),\n input: function(y, e) { return y == null ? null : [[e[0][0], +y[0]], [e[1][0], +y[1]]]; },\n output: function(xy) { return xy && [xy[0][1], xy[1][1]]; }\n};\n\nvar XY = {\n name: \"xy\",\n handles: [\"n\", \"w\", \"e\", \"s\", \"nw\", \"ne\", \"sw\", \"se\"].map(type),\n input: function(xy) { return xy == null ? null : number2(xy); },\n output: function(xy) { return xy; }\n};\n\nvar cursors = {\n overlay: \"crosshair\",\n selection: \"move\",\n n: \"ns-resize\",\n e: \"ew-resize\",\n s: \"ns-resize\",\n w: \"ew-resize\",\n nw: \"nwse-resize\",\n ne: \"nesw-resize\",\n se: \"nwse-resize\",\n sw: \"nesw-resize\"\n};\n\nvar flipX = {\n e: \"w\",\n w: \"e\",\n nw: \"ne\",\n ne: \"nw\",\n se: \"sw\",\n sw: \"se\"\n};\n\nvar flipY = {\n n: \"s\",\n s: \"n\",\n nw: \"sw\",\n ne: \"se\",\n se: \"ne\",\n sw: \"nw\"\n};\n\nvar signsX = {\n overlay: +1,\n selection: +1,\n n: null,\n e: +1,\n s: null,\n w: -1,\n nw: -1,\n ne: +1,\n se: +1,\n sw: -1\n};\n\nvar signsY = {\n overlay: +1,\n selection: +1,\n n: -1,\n e: null,\n s: +1,\n w: null,\n nw: -1,\n ne: -1,\n se: +1,\n sw: +1\n};\n\nfunction type(t) {\n return {type: t};\n}\n\n// Ignore right-click, since that should open the context menu.\nfunction defaultFilter(event) {\n return !event.ctrlKey && !event.button;\n}\n\nfunction defaultExtent() {\n var svg = this.ownerSVGElement || this;\n if (svg.hasAttribute(\"viewBox\")) {\n svg = svg.viewBox.baseVal;\n return [[svg.x, svg.y], [svg.x + svg.width, svg.y + svg.height]];\n }\n return [[0, 0], [svg.width.baseVal.value, svg.height.baseVal.value]];\n}\n\nfunction defaultTouchable() {\n return navigator.maxTouchPoints || (\"ontouchstart\" in this);\n}\n\n// Like d3.local, but with the name “__brush” rather than auto-generated.\nfunction local(node) {\n while (!node.__brush) if (!(node = node.parentNode)) return;\n return node.__brush;\n}\n\nfunction empty(extent) {\n return extent[0][0] === extent[1][0]\n || extent[0][1] === extent[1][1];\n}\n\nfunction brushSelection(node) {\n var state = node.__brush;\n return state ? state.dim.output(state.selection) : null;\n}\n\nfunction brushX() {\n return brush$1(X);\n}\n\nfunction brushY() {\n return brush$1(Y);\n}\n\nfunction brush() {\n return brush$1(XY);\n}\n\nfunction brush$1(dim) {\n var extent = defaultExtent,\n filter = defaultFilter,\n touchable = defaultTouchable,\n keys = true,\n listeners = d3Dispatch.dispatch(\"start\", \"brush\", \"end\"),\n handleSize = 6,\n touchending;\n\n function brush(group) {\n var overlay = group\n .property(\"__brush\", initialize)\n .selectAll(\".overlay\")\n .data([type(\"overlay\")]);\n\n overlay.enter().append(\"rect\")\n .attr(\"class\", \"overlay\")\n .attr(\"pointer-events\", \"all\")\n .attr(\"cursor\", cursors.overlay)\n .merge(overlay)\n .each(function() {\n var extent = local(this).extent;\n d3Selection.select(this)\n .attr(\"x\", extent[0][0])\n .attr(\"y\", extent[0][1])\n .attr(\"width\", extent[1][0] - extent[0][0])\n .attr(\"height\", extent[1][1] - extent[0][1]);\n });\n\n group.selectAll(\".selection\")\n .data([type(\"selection\")])\n .enter().append(\"rect\")\n .attr(\"class\", \"selection\")\n .attr(\"cursor\", cursors.selection)\n .attr(\"fill\", \"#777\")\n .attr(\"fill-opacity\", 0.3)\n .attr(\"stroke\", \"#fff\")\n .attr(\"shape-rendering\", \"crispEdges\");\n\n var handle = group.selectAll(\".handle\")\n .data(dim.handles, function(d) { return d.type; });\n\n handle.exit().remove();\n\n handle.enter().append(\"rect\")\n .attr(\"class\", function(d) { return \"handle handle--\" + d.type; })\n .attr(\"cursor\", function(d) { return cursors[d.type]; });\n\n group\n .each(redraw)\n .attr(\"fill\", \"none\")\n .attr(\"pointer-events\", \"all\")\n .on(\"mousedown.brush\", started)\n .filter(touchable)\n .on(\"touchstart.brush\", started)\n .on(\"touchmove.brush\", touchmoved)\n .on(\"touchend.brush touchcancel.brush\", touchended)\n .style(\"touch-action\", \"none\")\n .style(\"-webkit-tap-highlight-color\", \"rgba(0,0,0,0)\");\n }\n\n brush.move = function(group, selection) {\n if (group.tween) {\n group\n .on(\"start.brush\", function(event) { emitter(this, arguments).beforestart().start(event); })\n .on(\"interrupt.brush end.brush\", function(event) { emitter(this, arguments).end(event); })\n .tween(\"brush\", function() {\n var that = this,\n state = that.__brush,\n emit = emitter(that, arguments),\n selection0 = state.selection,\n selection1 = dim.input(typeof selection === \"function\" ? selection.apply(this, arguments) : selection, state.extent),\n i = d3Interpolate.interpolate(selection0, selection1);\n\n function tween(t) {\n state.selection = t === 1 && selection1 === null ? null : i(t);\n redraw.call(that);\n emit.brush();\n }\n\n return selection0 !== null && selection1 !== null ? tween : tween(1);\n });\n } else {\n group\n .each(function() {\n var that = this,\n args = arguments,\n state = that.__brush,\n selection1 = dim.input(typeof selection === \"function\" ? selection.apply(that, args) : selection, state.extent),\n emit = emitter(that, args).beforestart();\n\n d3Transition.interrupt(that);\n state.selection = selection1 === null ? null : selection1;\n redraw.call(that);\n emit.start().brush().end();\n });\n }\n };\n\n brush.clear = function(group) {\n brush.move(group, null);\n };\n\n function redraw() {\n var group = d3Selection.select(this),\n selection = local(this).selection;\n\n if (selection) {\n group.selectAll(\".selection\")\n .style(\"display\", null)\n .attr(\"x\", selection[0][0])\n .attr(\"y\", selection[0][1])\n .attr(\"width\", selection[1][0] - selection[0][0])\n .attr(\"height\", selection[1][1] - selection[0][1]);\n\n group.selectAll(\".handle\")\n .style(\"display\", null)\n .attr(\"x\", function(d) { return d.type[d.type.length - 1] === \"e\" ? selection[1][0] - handleSize / 2 : selection[0][0] - handleSize / 2; })\n .attr(\"y\", function(d) { return d.type[0] === \"s\" ? selection[1][1] - handleSize / 2 : selection[0][1] - handleSize / 2; })\n .attr(\"width\", function(d) { return d.type === \"n\" || d.type === \"s\" ? selection[1][0] - selection[0][0] + handleSize : handleSize; })\n .attr(\"height\", function(d) { return d.type === \"e\" || d.type === \"w\" ? selection[1][1] - selection[0][1] + handleSize : handleSize; });\n }\n\n else {\n group.selectAll(\".selection,.handle\")\n .style(\"display\", \"none\")\n .attr(\"x\", null)\n .attr(\"y\", null)\n .attr(\"width\", null)\n .attr(\"height\", null);\n }\n }\n\n function emitter(that, args, clean) {\n var emit = that.__brush.emitter;\n return emit && (!clean || !emit.clean) ? emit : new Emitter(that, args, clean);\n }\n\n function Emitter(that, args, clean) {\n this.that = that;\n this.args = args;\n this.state = that.__brush;\n this.active = 0;\n this.clean = clean;\n }\n\n Emitter.prototype = {\n beforestart: function() {\n if (++this.active === 1) this.state.emitter = this, this.starting = true;\n return this;\n },\n start: function(event, mode) {\n if (this.starting) this.starting = false, this.emit(\"start\", event, mode);\n else this.emit(\"brush\", event);\n return this;\n },\n brush: function(event, mode) {\n this.emit(\"brush\", event, mode);\n return this;\n },\n end: function(event, mode) {\n if (--this.active === 0) delete this.state.emitter, this.emit(\"end\", event, mode);\n return this;\n },\n emit: function(type, event, mode) {\n var d = d3Selection.select(this.that).datum();\n listeners.call(\n type,\n this.that,\n new BrushEvent(type, {\n sourceEvent: event,\n target: brush,\n selection: dim.output(this.state.selection),\n mode,\n dispatch: listeners\n }),\n d\n );\n }\n };\n\n function started(event) {\n if (touchending && !event.touches) return;\n if (!filter.apply(this, arguments)) return;\n\n var that = this,\n type = event.target.__data__.type,\n mode = (keys && event.metaKey ? type = \"overlay\" : type) === \"selection\" ? MODE_DRAG : (keys && event.altKey ? MODE_CENTER : MODE_HANDLE),\n signX = dim === Y ? null : signsX[type],\n signY = dim === X ? null : signsY[type],\n state = local(that),\n extent = state.extent,\n selection = state.selection,\n W = extent[0][0], w0, w1,\n N = extent[0][1], n0, n1,\n E = extent[1][0], e0, e1,\n S = extent[1][1], s0, s1,\n dx = 0,\n dy = 0,\n moving,\n shifting = signX && signY && keys && event.shiftKey,\n lockX,\n lockY,\n points = Array.from(event.touches || [event], t => {\n const i = t.identifier;\n t = d3Selection.pointer(t, that);\n t.point0 = t.slice();\n t.identifier = i;\n return t;\n });\n\n if (type === \"overlay\") {\n if (selection) moving = true;\n const pts = [points[0], points[1] || points[0]];\n state.selection = selection = [[\n w0 = dim === Y ? W : min(pts[0][0], pts[1][0]),\n n0 = dim === X ? N : min(pts[0][1], pts[1][1])\n ], [\n e0 = dim === Y ? E : max(pts[0][0], pts[1][0]),\n s0 = dim === X ? S : max(pts[0][1], pts[1][1])\n ]];\n if (points.length > 1) move();\n } else {\n w0 = selection[0][0];\n n0 = selection[0][1];\n e0 = selection[1][0];\n s0 = selection[1][1];\n }\n\n w1 = w0;\n n1 = n0;\n e1 = e0;\n s1 = s0;\n\n var group = d3Selection.select(that)\n .attr(\"pointer-events\", \"none\");\n\n var overlay = group.selectAll(\".overlay\")\n .attr(\"cursor\", cursors[type]);\n\n d3Transition.interrupt(that);\n var emit = emitter(that, arguments, true).beforestart();\n\n if (event.touches) {\n emit.moved = moved;\n emit.ended = ended;\n } else {\n var view = d3Selection.select(event.view)\n .on(\"mousemove.brush\", moved, true)\n .on(\"mouseup.brush\", ended, true);\n if (keys) view\n .on(\"keydown.brush\", keydowned, true)\n .on(\"keyup.brush\", keyupped, true);\n\n d3Drag.dragDisable(event.view);\n }\n\n redraw.call(that);\n emit.start(event, mode.name);\n\n function moved(event) {\n for (const p of event.changedTouches || [event]) {\n for (const d of points)\n if (d.identifier === p.identifier) d.cur = d3Selection.pointer(p, that);\n }\n if (shifting && !lockX && !lockY && points.length === 1) {\n const point = points[0];\n if (abs(point.cur[0] - point[0]) > abs(point.cur[1] - point[1]))\n lockY = true;\n else\n lockX = true;\n }\n for (const point of points)\n if (point.cur) point[0] = point.cur[0], point[1] = point.cur[1];\n moving = true;\n noevent(event);\n move(event);\n }\n\n function move(event) {\n const point = points[0], point0 = point.point0;\n var t;\n\n dx = point[0] - point0[0];\n dy = point[1] - point0[1];\n\n switch (mode) {\n case MODE_SPACE:\n case MODE_DRAG: {\n if (signX) dx = max(W - w0, min(E - e0, dx)), w1 = w0 + dx, e1 = e0 + dx;\n if (signY) dy = max(N - n0, min(S - s0, dy)), n1 = n0 + dy, s1 = s0 + dy;\n break;\n }\n case MODE_HANDLE: {\n if (points[1]) {\n if (signX) w1 = max(W, min(E, points[0][0])), e1 = max(W, min(E, points[1][0])), signX = 1;\n if (signY) n1 = max(N, min(S, points[0][1])), s1 = max(N, min(S, points[1][1])), signY = 1;\n } else {\n if (signX < 0) dx = max(W - w0, min(E - w0, dx)), w1 = w0 + dx, e1 = e0;\n else if (signX > 0) dx = max(W - e0, min(E - e0, dx)), w1 = w0, e1 = e0 + dx;\n if (signY < 0) dy = max(N - n0, min(S - n0, dy)), n1 = n0 + dy, s1 = s0;\n else if (signY > 0) dy = max(N - s0, min(S - s0, dy)), n1 = n0, s1 = s0 + dy;\n }\n break;\n }\n case MODE_CENTER: {\n if (signX) w1 = max(W, min(E, w0 - dx * signX)), e1 = max(W, min(E, e0 + dx * signX));\n if (signY) n1 = max(N, min(S, n0 - dy * signY)), s1 = max(N, min(S, s0 + dy * signY));\n break;\n }\n }\n\n if (e1 < w1) {\n signX *= -1;\n t = w0, w0 = e0, e0 = t;\n t = w1, w1 = e1, e1 = t;\n if (type in flipX) overlay.attr(\"cursor\", cursors[type = flipX[type]]);\n }\n\n if (s1 < n1) {\n signY *= -1;\n t = n0, n0 = s0, s0 = t;\n t = n1, n1 = s1, s1 = t;\n if (type in flipY) overlay.attr(\"cursor\", cursors[type = flipY[type]]);\n }\n\n if (state.selection) selection = state.selection; // May be set by brush.move!\n if (lockX) w1 = selection[0][0], e1 = selection[1][0];\n if (lockY) n1 = selection[0][1], s1 = selection[1][1];\n\n if (selection[0][0] !== w1\n || selection[0][1] !== n1\n || selection[1][0] !== e1\n || selection[1][1] !== s1) {\n state.selection = [[w1, n1], [e1, s1]];\n redraw.call(that);\n emit.brush(event, mode.name);\n }\n }\n\n function ended(event) {\n nopropagation(event);\n if (event.touches) {\n if (event.touches.length) return;\n if (touchending) clearTimeout(touchending);\n touchending = setTimeout(function() { touchending = null; }, 500); // Ghost clicks are delayed!\n } else {\n d3Drag.dragEnable(event.view, moving);\n view.on(\"keydown.brush keyup.brush mousemove.brush mouseup.brush\", null);\n }\n group.attr(\"pointer-events\", \"all\");\n overlay.attr(\"cursor\", cursors.overlay);\n if (state.selection) selection = state.selection; // May be set by brush.move (on start)!\n if (empty(selection)) state.selection = null, redraw.call(that);\n emit.end(event, mode.name);\n }\n\n function keydowned(event) {\n switch (event.keyCode) {\n case 16: { // SHIFT\n shifting = signX && signY;\n break;\n }\n case 18: { // ALT\n if (mode === MODE_HANDLE) {\n if (signX) e0 = e1 - dx * signX, w0 = w1 + dx * signX;\n if (signY) s0 = s1 - dy * signY, n0 = n1 + dy * signY;\n mode = MODE_CENTER;\n move();\n }\n break;\n }\n case 32: { // SPACE; takes priority over ALT\n if (mode === MODE_HANDLE || mode === MODE_CENTER) {\n if (signX < 0) e0 = e1 - dx; else if (signX > 0) w0 = w1 - dx;\n if (signY < 0) s0 = s1 - dy; else if (signY > 0) n0 = n1 - dy;\n mode = MODE_SPACE;\n overlay.attr(\"cursor\", cursors.selection);\n move();\n }\n break;\n }\n default: return;\n }\n noevent(event);\n }\n\n function keyupped(event) {\n switch (event.keyCode) {\n case 16: { // SHIFT\n if (shifting) {\n lockX = lockY = shifting = false;\n move();\n }\n break;\n }\n case 18: { // ALT\n if (mode === MODE_CENTER) {\n if (signX < 0) e0 = e1; else if (signX > 0) w0 = w1;\n if (signY < 0) s0 = s1; else if (signY > 0) n0 = n1;\n mode = MODE_HANDLE;\n move();\n }\n break;\n }\n case 32: { // SPACE\n if (mode === MODE_SPACE) {\n if (event.altKey) {\n if (signX) e0 = e1 - dx * signX, w0 = w1 + dx * signX;\n if (signY) s0 = s1 - dy * signY, n0 = n1 + dy * signY;\n mode = MODE_CENTER;\n } else {\n if (signX < 0) e0 = e1; else if (signX > 0) w0 = w1;\n if (signY < 0) s0 = s1; else if (signY > 0) n0 = n1;\n mode = MODE_HANDLE;\n }\n overlay.attr(\"cursor\", cursors[type]);\n move();\n }\n break;\n }\n default: return;\n }\n noevent(event);\n }\n }\n\n function touchmoved(event) {\n emitter(this, arguments).moved(event);\n }\n\n function touchended(event) {\n emitter(this, arguments).ended(event);\n }\n\n function initialize() {\n var state = this.__brush || {selection: null};\n state.extent = number2(extent.apply(this, arguments));\n state.dim = dim;\n return state;\n }\n\n brush.extent = function(_) {\n return arguments.length ? (extent = typeof _ === \"function\" ? _ : constant(number2(_)), brush) : extent;\n };\n\n brush.filter = function(_) {\n return arguments.length ? (filter = typeof _ === \"function\" ? _ : constant(!!_), brush) : filter;\n };\n\n brush.touchable = function(_) {\n return arguments.length ? (touchable = typeof _ === \"function\" ? _ : constant(!!_), brush) : touchable;\n };\n\n brush.handleSize = function(_) {\n return arguments.length ? (handleSize = +_, brush) : handleSize;\n };\n\n brush.keyModifiers = function(_) {\n return arguments.length ? (keys = !!_, brush) : keys;\n };\n\n brush.on = function() {\n var value = listeners.on.apply(listeners, arguments);\n return value === listeners ? brush : value;\n };\n\n return brush;\n}\n\nexports.brush = brush;\nexports.brushSelection = brushSelection;\nexports.brushX = brushX;\nexports.brushY = brushY;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","// https://d3js.org/d3-chord/ v2.0.0 Copyright 2020 Mike Bostock\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-path')) :\ntypeof define === 'function' && define.amd ? define(['exports', 'd3-path'], factory) :\n(global = global || self, factory(global.d3 = global.d3 || {}, global.d3));\n}(this, function (exports, d3Path) { 'use strict';\n\nvar abs = Math.abs;\nvar cos = Math.cos;\nvar sin = Math.sin;\nvar pi = Math.PI;\nvar halfPi = pi / 2;\nvar tau = pi * 2;\nvar max = Math.max;\nvar epsilon = 1e-12;\n\nfunction range(i, j) {\n return Array.from({length: j - i}, (_, k) => i + k);\n}\n\nfunction compareValue(compare) {\n return function(a, b) {\n return compare(\n a.source.value + a.target.value,\n b.source.value + b.target.value\n );\n };\n}\n\nfunction chord() {\n return chord$1(false, false);\n}\n\nfunction chordTranspose() {\n return chord$1(false, true);\n}\n\nfunction chordDirected() {\n return chord$1(true, false);\n}\n\nfunction chord$1(directed, transpose) {\n var padAngle = 0,\n sortGroups = null,\n sortSubgroups = null,\n sortChords = null;\n\n function chord(matrix) {\n var n = matrix.length,\n groupSums = new Array(n),\n groupIndex = range(0, n),\n chords = new Array(n * n),\n groups = new Array(n),\n k = 0, dx;\n\n matrix = Float64Array.from({length: n * n}, transpose\n ? (_, i) => matrix[i % n][i / n | 0]\n : (_, i) => matrix[i / n | 0][i % n]);\n\n // Compute the scaling factor from value to angle in [0, 2pi].\n for (let i = 0; i < n; ++i) {\n let x = 0;\n for (let j = 0; j < n; ++j) x += matrix[i * n + j] + directed * matrix[j * n + i];\n k += groupSums[i] = x;\n }\n k = max(0, tau - padAngle * n) / k;\n dx = k ? padAngle : tau / n;\n\n // Compute the angles for each group and constituent chord.\n {\n let x = 0;\n if (sortGroups) groupIndex.sort((a, b) => sortGroups(groupSums[a], groupSums[b]));\n for (const i of groupIndex) {\n const x0 = x;\n if (directed) {\n const subgroupIndex = range(~n + 1, n).filter(j => j < 0 ? matrix[~j * n + i] : matrix[i * n + j]);\n if (sortSubgroups) subgroupIndex.sort((a, b) => sortSubgroups(a < 0 ? -matrix[~a * n + i] : matrix[i * n + a], b < 0 ? -matrix[~b * n + i] : matrix[i * n + b]));\n for (const j of subgroupIndex) {\n if (j < 0) {\n const chord = chords[~j * n + i] || (chords[~j * n + i] = {source: null, target: null});\n chord.target = {index: i, startAngle: x, endAngle: x += matrix[~j * n + i] * k, value: matrix[~j * n + i]};\n } else {\n const chord = chords[i * n + j] || (chords[i * n + j] = {source: null, target: null});\n chord.source = {index: i, startAngle: x, endAngle: x += matrix[i * n + j] * k, value: matrix[i * n + j]};\n }\n }\n groups[i] = {index: i, startAngle: x0, endAngle: x, value: groupSums[i]};\n } else {\n const subgroupIndex = range(0, n).filter(j => matrix[i * n + j] || matrix[j * n + i]);\n if (sortSubgroups) subgroupIndex.sort((a, b) => sortSubgroups(matrix[i * n + a], matrix[i * n + b]));\n for (const j of subgroupIndex) {\n let chord;\n if (i < j) {\n chord = chords[i * n + j] || (chords[i * n + j] = {source: null, target: null});\n chord.source = {index: i, startAngle: x, endAngle: x += matrix[i * n + j] * k, value: matrix[i * n + j]};\n } else {\n chord = chords[j * n + i] || (chords[j * n + i] = {source: null, target: null});\n chord.target = {index: i, startAngle: x, endAngle: x += matrix[i * n + j] * k, value: matrix[i * n + j]};\n if (i === j) chord.source = chord.target;\n }\n if (chord.source && chord.target && chord.source.value < chord.target.value) {\n const source = chord.source;\n chord.source = chord.target;\n chord.target = source;\n }\n }\n groups[i] = {index: i, startAngle: x0, endAngle: x, value: groupSums[i]};\n }\n x += dx;\n }\n }\n\n // Remove empty chords.\n chords = Object.values(chords);\n chords.groups = groups;\n return sortChords ? chords.sort(sortChords) : chords;\n }\n\n chord.padAngle = function(_) {\n return arguments.length ? (padAngle = max(0, _), chord) : padAngle;\n };\n\n chord.sortGroups = function(_) {\n return arguments.length ? (sortGroups = _, chord) : sortGroups;\n };\n\n chord.sortSubgroups = function(_) {\n return arguments.length ? (sortSubgroups = _, chord) : sortSubgroups;\n };\n\n chord.sortChords = function(_) {\n return arguments.length ? (_ == null ? sortChords = null : (sortChords = compareValue(_))._ = _, chord) : sortChords && sortChords._;\n };\n\n return chord;\n}\n\nvar slice = Array.prototype.slice;\n\nfunction constant(x) {\n return function() {\n return x;\n };\n}\n\nfunction defaultSource(d) {\n return d.source;\n}\n\nfunction defaultTarget(d) {\n return d.target;\n}\n\nfunction defaultRadius(d) {\n return d.radius;\n}\n\nfunction defaultStartAngle(d) {\n return d.startAngle;\n}\n\nfunction defaultEndAngle(d) {\n return d.endAngle;\n}\n\nfunction defaultPadAngle() {\n return 0;\n}\n\nfunction defaultArrowheadRadius() {\n return 10;\n}\n\nfunction ribbon(headRadius) {\n var source = defaultSource,\n target = defaultTarget,\n sourceRadius = defaultRadius,\n targetRadius = defaultRadius,\n startAngle = defaultStartAngle,\n endAngle = defaultEndAngle,\n padAngle = defaultPadAngle,\n context = null;\n\n function ribbon() {\n var buffer,\n s = source.apply(this, arguments),\n t = target.apply(this, arguments),\n ap = padAngle.apply(this, arguments) / 2,\n argv = slice.call(arguments),\n sr = +sourceRadius.apply(this, (argv[0] = s, argv)),\n sa0 = startAngle.apply(this, argv) - halfPi,\n sa1 = endAngle.apply(this, argv) - halfPi,\n tr = +targetRadius.apply(this, (argv[0] = t, argv)),\n ta0 = startAngle.apply(this, argv) - halfPi,\n ta1 = endAngle.apply(this, argv) - halfPi;\n\n if (!context) context = buffer = d3Path.path();\n\n if (ap > epsilon) {\n if (abs(sa1 - sa0) > ap * 2 + epsilon) sa1 > sa0 ? (sa0 += ap, sa1 -= ap) : (sa0 -= ap, sa1 += ap);\n else sa0 = sa1 = (sa0 + sa1) / 2;\n if (abs(ta1 - ta0) > ap * 2 + epsilon) ta1 > ta0 ? (ta0 += ap, ta1 -= ap) : (ta0 -= ap, ta1 += ap);\n else ta0 = ta1 = (ta0 + ta1) / 2;\n }\n\n context.moveTo(sr * cos(sa0), sr * sin(sa0));\n context.arc(0, 0, sr, sa0, sa1);\n if (sa0 !== ta0 || sa1 !== ta1) {\n if (headRadius) {\n var hr = +headRadius.apply(this, arguments), tr2 = tr - hr, ta2 = (ta0 + ta1) / 2;\n context.quadraticCurveTo(0, 0, tr2 * cos(ta0), tr2 * sin(ta0));\n context.lineTo(tr * cos(ta2), tr * sin(ta2));\n context.lineTo(tr2 * cos(ta1), tr2 * sin(ta1));\n } else {\n context.quadraticCurveTo(0, 0, tr * cos(ta0), tr * sin(ta0));\n context.arc(0, 0, tr, ta0, ta1);\n }\n }\n context.quadraticCurveTo(0, 0, sr * cos(sa0), sr * sin(sa0));\n context.closePath();\n\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n if (headRadius) ribbon.headRadius = function(_) {\n return arguments.length ? (headRadius = typeof _ === \"function\" ? _ : constant(+_), ribbon) : headRadius;\n };\n\n ribbon.radius = function(_) {\n return arguments.length ? (sourceRadius = targetRadius = typeof _ === \"function\" ? _ : constant(+_), ribbon) : sourceRadius;\n };\n\n ribbon.sourceRadius = function(_) {\n return arguments.length ? (sourceRadius = typeof _ === \"function\" ? _ : constant(+_), ribbon) : sourceRadius;\n };\n\n ribbon.targetRadius = function(_) {\n return arguments.length ? (targetRadius = typeof _ === \"function\" ? _ : constant(+_), ribbon) : targetRadius;\n };\n\n ribbon.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), ribbon) : startAngle;\n };\n\n ribbon.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), ribbon) : endAngle;\n };\n\n ribbon.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), ribbon) : padAngle;\n };\n\n ribbon.source = function(_) {\n return arguments.length ? (source = _, ribbon) : source;\n };\n\n ribbon.target = function(_) {\n return arguments.length ? (target = _, ribbon) : target;\n };\n\n ribbon.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), ribbon) : context;\n };\n\n return ribbon;\n}\n\nfunction ribbon$1() {\n return ribbon();\n}\n\nfunction ribbonArrow() {\n return ribbon(defaultArrowheadRadius);\n}\n\nexports.chord = chord;\nexports.chordDirected = chordDirected;\nexports.chordTranspose = chordTranspose;\nexports.ribbon = ribbon$1;\nexports.ribbonArrow = ribbonArrow;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","// https://d3js.org/d3-color/ v2.0.0 Copyright 2020 Mike Bostock\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\ntypeof define === 'function' && define.amd ? define(['exports'], factory) :\n(global = global || self, factory(global.d3 = global.d3 || {}));\n}(this, function (exports) { 'use strict';\n\nfunction define(constructor, factory, prototype) {\n constructor.prototype = factory.prototype = prototype;\n prototype.constructor = constructor;\n}\n\nfunction extend(parent, definition) {\n var prototype = Object.create(parent.prototype);\n for (var key in definition) prototype[key] = definition[key];\n return prototype;\n}\n\nfunction Color() {}\n\nvar darker = 0.7;\nvar brighter = 1 / darker;\n\nvar reI = \"\\\\s*([+-]?\\\\d+)\\\\s*\",\n reN = \"\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",\n reP = \"\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",\n reHex = /^#([0-9a-f]{3,8})$/,\n reRgbInteger = new RegExp(\"^rgb\\\\(\" + [reI, reI, reI] + \"\\\\)$\"),\n reRgbPercent = new RegExp(\"^rgb\\\\(\" + [reP, reP, reP] + \"\\\\)$\"),\n reRgbaInteger = new RegExp(\"^rgba\\\\(\" + [reI, reI, reI, reN] + \"\\\\)$\"),\n reRgbaPercent = new RegExp(\"^rgba\\\\(\" + [reP, reP, reP, reN] + \"\\\\)$\"),\n reHslPercent = new RegExp(\"^hsl\\\\(\" + [reN, reP, reP] + \"\\\\)$\"),\n reHslaPercent = new RegExp(\"^hsla\\\\(\" + [reN, reP, reP, reN] + \"\\\\)$\");\n\nvar named = {\n aliceblue: 0xf0f8ff,\n antiquewhite: 0xfaebd7,\n aqua: 0x00ffff,\n aquamarine: 0x7fffd4,\n azure: 0xf0ffff,\n beige: 0xf5f5dc,\n bisque: 0xffe4c4,\n black: 0x000000,\n blanchedalmond: 0xffebcd,\n blue: 0x0000ff,\n blueviolet: 0x8a2be2,\n brown: 0xa52a2a,\n burlywood: 0xdeb887,\n cadetblue: 0x5f9ea0,\n chartreuse: 0x7fff00,\n chocolate: 0xd2691e,\n coral: 0xff7f50,\n cornflowerblue: 0x6495ed,\n cornsilk: 0xfff8dc,\n crimson: 0xdc143c,\n cyan: 0x00ffff,\n darkblue: 0x00008b,\n darkcyan: 0x008b8b,\n darkgoldenrod: 0xb8860b,\n darkgray: 0xa9a9a9,\n darkgreen: 0x006400,\n darkgrey: 0xa9a9a9,\n darkkhaki: 0xbdb76b,\n darkmagenta: 0x8b008b,\n darkolivegreen: 0x556b2f,\n darkorange: 0xff8c00,\n darkorchid: 0x9932cc,\n darkred: 0x8b0000,\n darksalmon: 0xe9967a,\n darkseagreen: 0x8fbc8f,\n darkslateblue: 0x483d8b,\n darkslategray: 0x2f4f4f,\n darkslategrey: 0x2f4f4f,\n darkturquoise: 0x00ced1,\n darkviolet: 0x9400d3,\n deeppink: 0xff1493,\n deepskyblue: 0x00bfff,\n dimgray: 0x696969,\n dimgrey: 0x696969,\n dodgerblue: 0x1e90ff,\n firebrick: 0xb22222,\n floralwhite: 0xfffaf0,\n forestgreen: 0x228b22,\n fuchsia: 0xff00ff,\n gainsboro: 0xdcdcdc,\n ghostwhite: 0xf8f8ff,\n gold: 0xffd700,\n goldenrod: 0xdaa520,\n gray: 0x808080,\n green: 0x008000,\n greenyellow: 0xadff2f,\n grey: 0x808080,\n honeydew: 0xf0fff0,\n hotpink: 0xff69b4,\n indianred: 0xcd5c5c,\n indigo: 0x4b0082,\n ivory: 0xfffff0,\n khaki: 0xf0e68c,\n lavender: 0xe6e6fa,\n lavenderblush: 0xfff0f5,\n lawngreen: 0x7cfc00,\n lemonchiffon: 0xfffacd,\n lightblue: 0xadd8e6,\n lightcoral: 0xf08080,\n lightcyan: 0xe0ffff,\n lightgoldenrodyellow: 0xfafad2,\n lightgray: 0xd3d3d3,\n lightgreen: 0x90ee90,\n lightgrey: 0xd3d3d3,\n lightpink: 0xffb6c1,\n lightsalmon: 0xffa07a,\n lightseagreen: 0x20b2aa,\n lightskyblue: 0x87cefa,\n lightslategray: 0x778899,\n lightslategrey: 0x778899,\n lightsteelblue: 0xb0c4de,\n lightyellow: 0xffffe0,\n lime: 0x00ff00,\n limegreen: 0x32cd32,\n linen: 0xfaf0e6,\n magenta: 0xff00ff,\n maroon: 0x800000,\n mediumaquamarine: 0x66cdaa,\n mediumblue: 0x0000cd,\n mediumorchid: 0xba55d3,\n mediumpurple: 0x9370db,\n mediumseagreen: 0x3cb371,\n mediumslateblue: 0x7b68ee,\n mediumspringgreen: 0x00fa9a,\n mediumturquoise: 0x48d1cc,\n mediumvioletred: 0xc71585,\n midnightblue: 0x191970,\n mintcream: 0xf5fffa,\n mistyrose: 0xffe4e1,\n moccasin: 0xffe4b5,\n navajowhite: 0xffdead,\n navy: 0x000080,\n oldlace: 0xfdf5e6,\n olive: 0x808000,\n olivedrab: 0x6b8e23,\n orange: 0xffa500,\n orangered: 0xff4500,\n orchid: 0xda70d6,\n palegoldenrod: 0xeee8aa,\n palegreen: 0x98fb98,\n paleturquoise: 0xafeeee,\n palevioletred: 0xdb7093,\n papayawhip: 0xffefd5,\n peachpuff: 0xffdab9,\n peru: 0xcd853f,\n pink: 0xffc0cb,\n plum: 0xdda0dd,\n powderblue: 0xb0e0e6,\n purple: 0x800080,\n rebeccapurple: 0x663399,\n red: 0xff0000,\n rosybrown: 0xbc8f8f,\n royalblue: 0x4169e1,\n saddlebrown: 0x8b4513,\n salmon: 0xfa8072,\n sandybrown: 0xf4a460,\n seagreen: 0x2e8b57,\n seashell: 0xfff5ee,\n sienna: 0xa0522d,\n silver: 0xc0c0c0,\n skyblue: 0x87ceeb,\n slateblue: 0x6a5acd,\n slategray: 0x708090,\n slategrey: 0x708090,\n snow: 0xfffafa,\n springgreen: 0x00ff7f,\n steelblue: 0x4682b4,\n tan: 0xd2b48c,\n teal: 0x008080,\n thistle: 0xd8bfd8,\n tomato: 0xff6347,\n turquoise: 0x40e0d0,\n violet: 0xee82ee,\n wheat: 0xf5deb3,\n white: 0xffffff,\n whitesmoke: 0xf5f5f5,\n yellow: 0xffff00,\n yellowgreen: 0x9acd32\n};\n\ndefine(Color, color, {\n copy: function(channels) {\n return Object.assign(new this.constructor, this, channels);\n },\n displayable: function() {\n return this.rgb().displayable();\n },\n hex: color_formatHex, // Deprecated! Use color.formatHex.\n formatHex: color_formatHex,\n formatHsl: color_formatHsl,\n formatRgb: color_formatRgb,\n toString: color_formatRgb\n});\n\nfunction color_formatHex() {\n return this.rgb().formatHex();\n}\n\nfunction color_formatHsl() {\n return hslConvert(this).formatHsl();\n}\n\nfunction color_formatRgb() {\n return this.rgb().formatRgb();\n}\n\nfunction color(format) {\n var m, l;\n format = (format + \"\").trim().toLowerCase();\n return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000\n : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00\n : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000\n : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000\n : null) // invalid hex\n : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)\n : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)\n : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)\n : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)\n : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)\n : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)\n : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins\n : format === \"transparent\" ? new Rgb(NaN, NaN, NaN, 0)\n : null;\n}\n\nfunction rgbn(n) {\n return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);\n}\n\nfunction rgba(r, g, b, a) {\n if (a <= 0) r = g = b = NaN;\n return new Rgb(r, g, b, a);\n}\n\nfunction rgbConvert(o) {\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Rgb;\n o = o.rgb();\n return new Rgb(o.r, o.g, o.b, o.opacity);\n}\n\nfunction rgb(r, g, b, opacity) {\n return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);\n}\n\nfunction Rgb(r, g, b, opacity) {\n this.r = +r;\n this.g = +g;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Rgb, rgb, extend(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n rgb: function() {\n return this;\n },\n displayable: function() {\n return (-0.5 <= this.r && this.r < 255.5)\n && (-0.5 <= this.g && this.g < 255.5)\n && (-0.5 <= this.b && this.b < 255.5)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n hex: rgb_formatHex, // Deprecated! Use color.formatHex.\n formatHex: rgb_formatHex,\n formatRgb: rgb_formatRgb,\n toString: rgb_formatRgb\n}));\n\nfunction rgb_formatHex() {\n return \"#\" + hex(this.r) + hex(this.g) + hex(this.b);\n}\n\nfunction rgb_formatRgb() {\n var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));\n return (a === 1 ? \"rgb(\" : \"rgba(\")\n + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + \", \"\n + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + \", \"\n + Math.max(0, Math.min(255, Math.round(this.b) || 0))\n + (a === 1 ? \")\" : \", \" + a + \")\");\n}\n\nfunction hex(value) {\n value = Math.max(0, Math.min(255, Math.round(value) || 0));\n return (value < 16 ? \"0\" : \"\") + value.toString(16);\n}\n\nfunction hsla(h, s, l, a) {\n if (a <= 0) h = s = l = NaN;\n else if (l <= 0 || l >= 1) h = s = NaN;\n else if (s <= 0) h = NaN;\n return new Hsl(h, s, l, a);\n}\n\nfunction hslConvert(o) {\n if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Hsl;\n if (o instanceof Hsl) return o;\n o = o.rgb();\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n h = NaN,\n s = max - min,\n l = (max + min) / 2;\n if (s) {\n if (r === max) h = (g - b) / s + (g < b) * 6;\n else if (g === max) h = (b - r) / s + 2;\n else h = (r - g) / s + 4;\n s /= l < 0.5 ? max + min : 2 - max - min;\n h *= 60;\n } else {\n s = l > 0 && l < 1 ? 0 : h;\n }\n return new Hsl(h, s, l, o.opacity);\n}\n\nfunction hsl(h, s, l, opacity) {\n return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hsl(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Hsl, hsl, extend(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n rgb: function() {\n var h = this.h % 360 + (this.h < 0) * 360,\n s = isNaN(h) || isNaN(this.s) ? 0 : this.s,\n l = this.l,\n m2 = l + (l < 0.5 ? l : 1 - l) * s,\n m1 = 2 * l - m2;\n return new Rgb(\n hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),\n hsl2rgb(h, m1, m2),\n hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),\n this.opacity\n );\n },\n displayable: function() {\n return (0 <= this.s && this.s <= 1 || isNaN(this.s))\n && (0 <= this.l && this.l <= 1)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n formatHsl: function() {\n var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));\n return (a === 1 ? \"hsl(\" : \"hsla(\")\n + (this.h || 0) + \", \"\n + (this.s || 0) * 100 + \"%, \"\n + (this.l || 0) * 100 + \"%\"\n + (a === 1 ? \")\" : \", \" + a + \")\");\n }\n}));\n\n/* From FvD 13.37, CSS Color Module Level 3 */\nfunction hsl2rgb(h, m1, m2) {\n return (h < 60 ? m1 + (m2 - m1) * h / 60\n : h < 180 ? m2\n : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60\n : m1) * 255;\n}\n\nconst radians = Math.PI / 180;\nconst degrees = 180 / Math.PI;\n\n// https://observablehq.com/@mbostock/lab-and-rgb\nconst K = 18,\n Xn = 0.96422,\n Yn = 1,\n Zn = 0.82521,\n t0 = 4 / 29,\n t1 = 6 / 29,\n t2 = 3 * t1 * t1,\n t3 = t1 * t1 * t1;\n\nfunction labConvert(o) {\n if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity);\n if (o instanceof Hcl) return hcl2lab(o);\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var r = rgb2lrgb(o.r),\n g = rgb2lrgb(o.g),\n b = rgb2lrgb(o.b),\n y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z;\n if (r === g && g === b) x = z = y; else {\n x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn);\n z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn);\n }\n return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);\n}\n\nfunction gray(l, opacity) {\n return new Lab(l, 0, 0, opacity == null ? 1 : opacity);\n}\n\nfunction lab(l, a, b, opacity) {\n return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity);\n}\n\nfunction Lab(l, a, b, opacity) {\n this.l = +l;\n this.a = +a;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Lab, lab, extend(Color, {\n brighter: function(k) {\n return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n darker: function(k) {\n return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n rgb: function() {\n var y = (this.l + 16) / 116,\n x = isNaN(this.a) ? y : y + this.a / 500,\n z = isNaN(this.b) ? y : y - this.b / 200;\n x = Xn * lab2xyz(x);\n y = Yn * lab2xyz(y);\n z = Zn * lab2xyz(z);\n return new Rgb(\n lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z),\n lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z),\n lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z),\n this.opacity\n );\n }\n}));\n\nfunction xyz2lab(t) {\n return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;\n}\n\nfunction lab2xyz(t) {\n return t > t1 ? t * t * t : t2 * (t - t0);\n}\n\nfunction lrgb2rgb(x) {\n return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);\n}\n\nfunction rgb2lrgb(x) {\n return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);\n}\n\nfunction hclConvert(o) {\n if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity);\n if (!(o instanceof Lab)) o = labConvert(o);\n if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity);\n var h = Math.atan2(o.b, o.a) * degrees;\n return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);\n}\n\nfunction lch(l, c, h, opacity) {\n return arguments.length === 1 ? hclConvert(l) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nfunction hcl(h, c, l, opacity) {\n return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hcl(h, c, l, opacity) {\n this.h = +h;\n this.c = +c;\n this.l = +l;\n this.opacity = +opacity;\n}\n\nfunction hcl2lab(o) {\n if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity);\n var h = o.h * radians;\n return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);\n}\n\ndefine(Hcl, hcl, extend(Color, {\n brighter: function(k) {\n return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity);\n },\n darker: function(k) {\n return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity);\n },\n rgb: function() {\n return hcl2lab(this).rgb();\n }\n}));\n\nvar A = -0.14861,\n B = +1.78277,\n C = -0.29227,\n D = -0.90649,\n E = +1.97294,\n ED = E * D,\n EB = E * B,\n BC_DA = B * C - D * A;\n\nfunction cubehelixConvert(o) {\n if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),\n bl = b - l,\n k = (E * (g - l) - C * bl) / D,\n s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1\n h = s ? Math.atan2(k, bl) * degrees - 120 : NaN;\n return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);\n}\n\nfunction cubehelix(h, s, l, opacity) {\n return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Cubehelix(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Cubehelix, cubehelix, extend(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n rgb: function() {\n var h = isNaN(this.h) ? 0 : (this.h + 120) * radians,\n l = +this.l,\n a = isNaN(this.s) ? 0 : this.s * l * (1 - l),\n cosh = Math.cos(h),\n sinh = Math.sin(h);\n return new Rgb(\n 255 * (l + a * (A * cosh + B * sinh)),\n 255 * (l + a * (C * cosh + D * sinh)),\n 255 * (l + a * (E * cosh)),\n this.opacity\n );\n }\n}));\n\nexports.color = color;\nexports.cubehelix = cubehelix;\nexports.gray = gray;\nexports.hcl = hcl;\nexports.hsl = hsl;\nexports.lab = lab;\nexports.lch = lch;\nexports.rgb = rgb;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","// https://d3js.org/d3-contour/ v2.0.0 Copyright 2020 Mike Bostock\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-array')) :\ntypeof define === 'function' && define.amd ? define(['exports', 'd3-array'], factory) :\n(global = global || self, factory(global.d3 = global.d3 || {}, global.d3));\n}(this, function (exports, d3Array) { 'use strict';\n\nvar array = Array.prototype;\n\nvar slice = array.slice;\n\nfunction ascending(a, b) {\n return a - b;\n}\n\nfunction area(ring) {\n var i = 0, n = ring.length, area = ring[n - 1][1] * ring[0][0] - ring[n - 1][0] * ring[0][1];\n while (++i < n) area += ring[i - 1][1] * ring[i][0] - ring[i - 1][0] * ring[i][1];\n return area;\n}\n\nvar constant = x => () => x;\n\nfunction contains(ring, hole) {\n var i = -1, n = hole.length, c;\n while (++i < n) if (c = ringContains(ring, hole[i])) return c;\n return 0;\n}\n\nfunction ringContains(ring, point) {\n var x = point[0], y = point[1], contains = -1;\n for (var i = 0, n = ring.length, j = n - 1; i < n; j = i++) {\n var pi = ring[i], xi = pi[0], yi = pi[1], pj = ring[j], xj = pj[0], yj = pj[1];\n if (segmentContains(pi, pj, point)) return 0;\n if (((yi > y) !== (yj > y)) && ((x < (xj - xi) * (y - yi) / (yj - yi) + xi))) contains = -contains;\n }\n return contains;\n}\n\nfunction segmentContains(a, b, c) {\n var i; return collinear(a, b, c) && within(a[i = +(a[0] === b[0])], c[i], b[i]);\n}\n\nfunction collinear(a, b, c) {\n return (b[0] - a[0]) * (c[1] - a[1]) === (c[0] - a[0]) * (b[1] - a[1]);\n}\n\nfunction within(p, q, r) {\n return p <= q && q <= r || r <= q && q <= p;\n}\n\nfunction noop() {}\n\nvar cases = [\n [],\n [[[1.0, 1.5], [0.5, 1.0]]],\n [[[1.5, 1.0], [1.0, 1.5]]],\n [[[1.5, 1.0], [0.5, 1.0]]],\n [[[1.0, 0.5], [1.5, 1.0]]],\n [[[1.0, 1.5], [0.5, 1.0]], [[1.0, 0.5], [1.5, 1.0]]],\n [[[1.0, 0.5], [1.0, 1.5]]],\n [[[1.0, 0.5], [0.5, 1.0]]],\n [[[0.5, 1.0], [1.0, 0.5]]],\n [[[1.0, 1.5], [1.0, 0.5]]],\n [[[0.5, 1.0], [1.0, 0.5]], [[1.5, 1.0], [1.0, 1.5]]],\n [[[1.5, 1.0], [1.0, 0.5]]],\n [[[0.5, 1.0], [1.5, 1.0]]],\n [[[1.0, 1.5], [1.5, 1.0]]],\n [[[0.5, 1.0], [1.0, 1.5]]],\n []\n];\n\nfunction contours() {\n var dx = 1,\n dy = 1,\n threshold = d3Array.thresholdSturges,\n smooth = smoothLinear;\n\n function contours(values) {\n var tz = threshold(values);\n\n // Convert number of thresholds into uniform thresholds.\n if (!Array.isArray(tz)) {\n var domain = d3Array.extent(values), start = domain[0], stop = domain[1];\n tz = d3Array.tickStep(start, stop, tz);\n tz = d3Array.range(Math.floor(start / tz) * tz, Math.floor(stop / tz) * tz, tz);\n } else {\n tz = tz.slice().sort(ascending);\n }\n\n return tz.map(function(value) {\n return contour(values, value);\n });\n }\n\n // Accumulate, smooth contour rings, assign holes to exterior rings.\n // Based on https://github.com/mbostock/shapefile/blob/v0.6.2/shp/polygon.js\n function contour(values, value) {\n var polygons = [],\n holes = [];\n\n isorings(values, value, function(ring) {\n smooth(ring, values, value);\n if (area(ring) > 0) polygons.push([ring]);\n else holes.push(ring);\n });\n\n holes.forEach(function(hole) {\n for (var i = 0, n = polygons.length, polygon; i < n; ++i) {\n if (contains((polygon = polygons[i])[0], hole) !== -1) {\n polygon.push(hole);\n return;\n }\n }\n });\n\n return {\n type: \"MultiPolygon\",\n value: value,\n coordinates: polygons\n };\n }\n\n // Marching squares with isolines stitched into rings.\n // Based on https://github.com/topojson/topojson-client/blob/v3.0.0/src/stitch.js\n function isorings(values, value, callback) {\n var fragmentByStart = new Array,\n fragmentByEnd = new Array,\n x, y, t0, t1, t2, t3;\n\n // Special case for the first row (y = -1, t2 = t3 = 0).\n x = y = -1;\n t1 = values[0] >= value;\n cases[t1 << 1].forEach(stitch);\n while (++x < dx - 1) {\n t0 = t1, t1 = values[x + 1] >= value;\n cases[t0 | t1 << 1].forEach(stitch);\n }\n cases[t1 << 0].forEach(stitch);\n\n // General case for the intermediate rows.\n while (++y < dy - 1) {\n x = -1;\n t1 = values[y * dx + dx] >= value;\n t2 = values[y * dx] >= value;\n cases[t1 << 1 | t2 << 2].forEach(stitch);\n while (++x < dx - 1) {\n t0 = t1, t1 = values[y * dx + dx + x + 1] >= value;\n t3 = t2, t2 = values[y * dx + x + 1] >= value;\n cases[t0 | t1 << 1 | t2 << 2 | t3 << 3].forEach(stitch);\n }\n cases[t1 | t2 << 3].forEach(stitch);\n }\n\n // Special case for the last row (y = dy - 1, t0 = t1 = 0).\n x = -1;\n t2 = values[y * dx] >= value;\n cases[t2 << 2].forEach(stitch);\n while (++x < dx - 1) {\n t3 = t2, t2 = values[y * dx + x + 1] >= value;\n cases[t2 << 2 | t3 << 3].forEach(stitch);\n }\n cases[t2 << 3].forEach(stitch);\n\n function stitch(line) {\n var start = [line[0][0] + x, line[0][1] + y],\n end = [line[1][0] + x, line[1][1] + y],\n startIndex = index(start),\n endIndex = index(end),\n f, g;\n if (f = fragmentByEnd[startIndex]) {\n if (g = fragmentByStart[endIndex]) {\n delete fragmentByEnd[f.end];\n delete fragmentByStart[g.start];\n if (f === g) {\n f.ring.push(end);\n callback(f.ring);\n } else {\n fragmentByStart[f.start] = fragmentByEnd[g.end] = {start: f.start, end: g.end, ring: f.ring.concat(g.ring)};\n }\n } else {\n delete fragmentByEnd[f.end];\n f.ring.push(end);\n fragmentByEnd[f.end = endIndex] = f;\n }\n } else if (f = fragmentByStart[endIndex]) {\n if (g = fragmentByEnd[startIndex]) {\n delete fragmentByStart[f.start];\n delete fragmentByEnd[g.end];\n if (f === g) {\n f.ring.push(end);\n callback(f.ring);\n } else {\n fragmentByStart[g.start] = fragmentByEnd[f.end] = {start: g.start, end: f.end, ring: g.ring.concat(f.ring)};\n }\n } else {\n delete fragmentByStart[f.start];\n f.ring.unshift(start);\n fragmentByStart[f.start = startIndex] = f;\n }\n } else {\n fragmentByStart[startIndex] = fragmentByEnd[endIndex] = {start: startIndex, end: endIndex, ring: [start, end]};\n }\n }\n }\n\n function index(point) {\n return point[0] * 2 + point[1] * (dx + 1) * 4;\n }\n\n function smoothLinear(ring, values, value) {\n ring.forEach(function(point) {\n var x = point[0],\n y = point[1],\n xt = x | 0,\n yt = y | 0,\n v0,\n v1 = values[yt * dx + xt];\n if (x > 0 && x < dx && xt === x) {\n v0 = values[yt * dx + xt - 1];\n point[0] = x + (value - v0) / (v1 - v0) - 0.5;\n }\n if (y > 0 && y < dy && yt === y) {\n v0 = values[(yt - 1) * dx + xt];\n point[1] = y + (value - v0) / (v1 - v0) - 0.5;\n }\n });\n }\n\n contours.contour = contour;\n\n contours.size = function(_) {\n if (!arguments.length) return [dx, dy];\n var _0 = Math.floor(_[0]), _1 = Math.floor(_[1]);\n if (!(_0 >= 0 && _1 >= 0)) throw new Error(\"invalid size\");\n return dx = _0, dy = _1, contours;\n };\n\n contours.thresholds = function(_) {\n return arguments.length ? (threshold = typeof _ === \"function\" ? _ : Array.isArray(_) ? constant(slice.call(_)) : constant(_), contours) : threshold;\n };\n\n contours.smooth = function(_) {\n return arguments.length ? (smooth = _ ? smoothLinear : noop, contours) : smooth === smoothLinear;\n };\n\n return contours;\n}\n\n// TODO Optimize edge cases.\n// TODO Optimize index calculation.\n// TODO Optimize arguments.\nfunction blurX(source, target, r) {\n var n = source.width,\n m = source.height,\n w = (r << 1) + 1;\n for (var j = 0; j < m; ++j) {\n for (var i = 0, sr = 0; i < n + r; ++i) {\n if (i < n) {\n sr += source.data[i + j * n];\n }\n if (i >= r) {\n if (i >= w) {\n sr -= source.data[i - w + j * n];\n }\n target.data[i - r + j * n] = sr / Math.min(i + 1, n - 1 + w - i, w);\n }\n }\n }\n}\n\n// TODO Optimize edge cases.\n// TODO Optimize index calculation.\n// TODO Optimize arguments.\nfunction blurY(source, target, r) {\n var n = source.width,\n m = source.height,\n w = (r << 1) + 1;\n for (var i = 0; i < n; ++i) {\n for (var j = 0, sr = 0; j < m + r; ++j) {\n if (j < m) {\n sr += source.data[i + j * n];\n }\n if (j >= r) {\n if (j >= w) {\n sr -= source.data[i + (j - w) * n];\n }\n target.data[i + (j - r) * n] = sr / Math.min(j + 1, m - 1 + w - j, w);\n }\n }\n }\n}\n\nfunction defaultX(d) {\n return d[0];\n}\n\nfunction defaultY(d) {\n return d[1];\n}\n\nfunction defaultWeight() {\n return 1;\n}\n\nfunction density() {\n var x = defaultX,\n y = defaultY,\n weight = defaultWeight,\n dx = 960,\n dy = 500,\n r = 20, // blur radius\n k = 2, // log2(grid cell size)\n o = r * 3, // grid offset, to pad for blur\n n = (dx + o * 2) >> k, // grid width\n m = (dy + o * 2) >> k, // grid height\n threshold = constant(20);\n\n function density(data) {\n var values0 = new Float32Array(n * m),\n values1 = new Float32Array(n * m);\n\n data.forEach(function(d, i, data) {\n var xi = (+x(d, i, data) + o) >> k,\n yi = (+y(d, i, data) + o) >> k,\n wi = +weight(d, i, data);\n if (xi >= 0 && xi < n && yi >= 0 && yi < m) {\n values0[xi + yi * n] += wi;\n }\n });\n\n // TODO Optimize.\n blurX({width: n, height: m, data: values0}, {width: n, height: m, data: values1}, r >> k);\n blurY({width: n, height: m, data: values1}, {width: n, height: m, data: values0}, r >> k);\n blurX({width: n, height: m, data: values0}, {width: n, height: m, data: values1}, r >> k);\n blurY({width: n, height: m, data: values1}, {width: n, height: m, data: values0}, r >> k);\n blurX({width: n, height: m, data: values0}, {width: n, height: m, data: values1}, r >> k);\n blurY({width: n, height: m, data: values1}, {width: n, height: m, data: values0}, r >> k);\n\n var tz = threshold(values0);\n\n // Convert number of thresholds into uniform thresholds.\n if (!Array.isArray(tz)) {\n var stop = d3Array.max(values0);\n tz = d3Array.tickStep(0, stop, tz);\n tz = d3Array.range(0, Math.floor(stop / tz) * tz, tz);\n tz.shift();\n }\n\n return contours()\n .thresholds(tz)\n .size([n, m])\n (values0)\n .map(transform);\n }\n\n function transform(geometry) {\n geometry.value *= Math.pow(2, -2 * k); // Density in points per square pixel.\n geometry.coordinates.forEach(transformPolygon);\n return geometry;\n }\n\n function transformPolygon(coordinates) {\n coordinates.forEach(transformRing);\n }\n\n function transformRing(coordinates) {\n coordinates.forEach(transformPoint);\n }\n\n // TODO Optimize.\n function transformPoint(coordinates) {\n coordinates[0] = coordinates[0] * Math.pow(2, k) - o;\n coordinates[1] = coordinates[1] * Math.pow(2, k) - o;\n }\n\n function resize() {\n o = r * 3;\n n = (dx + o * 2) >> k;\n m = (dy + o * 2) >> k;\n return density;\n }\n\n density.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), density) : x;\n };\n\n density.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), density) : y;\n };\n\n density.weight = function(_) {\n return arguments.length ? (weight = typeof _ === \"function\" ? _ : constant(+_), density) : weight;\n };\n\n density.size = function(_) {\n if (!arguments.length) return [dx, dy];\n var _0 = +_[0], _1 = +_[1];\n if (!(_0 >= 0 && _1 >= 0)) throw new Error(\"invalid size\");\n return dx = _0, dy = _1, resize();\n };\n\n density.cellSize = function(_) {\n if (!arguments.length) return 1 << k;\n if (!((_ = +_) >= 1)) throw new Error(\"invalid cell size\");\n return k = Math.floor(Math.log(_) / Math.LN2), resize();\n };\n\n density.thresholds = function(_) {\n return arguments.length ? (threshold = typeof _ === \"function\" ? _ : Array.isArray(_) ? constant(slice.call(_)) : constant(_), density) : threshold;\n };\n\n density.bandwidth = function(_) {\n if (!arguments.length) return Math.sqrt(r * (r + 1));\n if (!((_ = +_) >= 0)) throw new Error(\"invalid bandwidth\");\n return r = Math.round((Math.sqrt(4 * _ * _ + 1) - 1) / 2), resize();\n };\n\n return density;\n}\n\nexports.contourDensity = density;\nexports.contours = contours;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","// https://github.com/d3/d3-delaunay v5.3.0 Copyright 2020 Mike Bostock\n// https://github.com/mapbox/delaunator v4.0.1. Copyright 2019 Mapbox, Inc.\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\ntypeof define === 'function' && define.amd ? define(['exports'], factory) :\n(global = global || self, factory(global.d3 = global.d3 || {}));\n}(this, function (exports) { 'use strict';\n\nconst EPSILON = Math.pow(2, -52);\nconst EDGE_STACK = new Uint32Array(512);\n\nclass Delaunator {\n\n static from(points, getX = defaultGetX, getY = defaultGetY) {\n const n = points.length;\n const coords = new Float64Array(n * 2);\n\n for (let i = 0; i < n; i++) {\n const p = points[i];\n coords[2 * i] = getX(p);\n coords[2 * i + 1] = getY(p);\n }\n\n return new Delaunator(coords);\n }\n\n constructor(coords) {\n const n = coords.length >> 1;\n if (n > 0 && typeof coords[0] !== 'number') throw new Error('Expected coords to contain numbers.');\n\n this.coords = coords;\n\n // arrays that will store the triangulation graph\n const maxTriangles = Math.max(2 * n - 5, 0);\n this._triangles = new Uint32Array(maxTriangles * 3);\n this._halfedges = new Int32Array(maxTriangles * 3);\n\n // temporary arrays for tracking the edges of the advancing convex hull\n this._hashSize = Math.ceil(Math.sqrt(n));\n this._hullPrev = new Uint32Array(n); // edge to prev edge\n this._hullNext = new Uint32Array(n); // edge to next edge\n this._hullTri = new Uint32Array(n); // edge to adjacent triangle\n this._hullHash = new Int32Array(this._hashSize).fill(-1); // angular edge hash\n\n // temporary arrays for sorting points\n this._ids = new Uint32Array(n);\n this._dists = new Float64Array(n);\n\n this.update();\n }\n\n update() {\n const {coords, _hullPrev: hullPrev, _hullNext: hullNext, _hullTri: hullTri, _hullHash: hullHash} = this;\n const n = coords.length >> 1;\n\n // populate an array of point indices; calculate input data bbox\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n\n for (let i = 0; i < n; i++) {\n const x = coords[2 * i];\n const y = coords[2 * i + 1];\n if (x < minX) minX = x;\n if (y < minY) minY = y;\n if (x > maxX) maxX = x;\n if (y > maxY) maxY = y;\n this._ids[i] = i;\n }\n const cx = (minX + maxX) / 2;\n const cy = (minY + maxY) / 2;\n\n let minDist = Infinity;\n let i0, i1, i2;\n\n // pick a seed point close to the center\n for (let i = 0; i < n; i++) {\n const d = dist(cx, cy, coords[2 * i], coords[2 * i + 1]);\n if (d < minDist) {\n i0 = i;\n minDist = d;\n }\n }\n const i0x = coords[2 * i0];\n const i0y = coords[2 * i0 + 1];\n\n minDist = Infinity;\n\n // find the point closest to the seed\n for (let i = 0; i < n; i++) {\n if (i === i0) continue;\n const d = dist(i0x, i0y, coords[2 * i], coords[2 * i + 1]);\n if (d < minDist && d > 0) {\n i1 = i;\n minDist = d;\n }\n }\n let i1x = coords[2 * i1];\n let i1y = coords[2 * i1 + 1];\n\n let minRadius = Infinity;\n\n // find the third point which forms the smallest circumcircle with the first two\n for (let i = 0; i < n; i++) {\n if (i === i0 || i === i1) continue;\n const r = circumradius(i0x, i0y, i1x, i1y, coords[2 * i], coords[2 * i + 1]);\n if (r < minRadius) {\n i2 = i;\n minRadius = r;\n }\n }\n let i2x = coords[2 * i2];\n let i2y = coords[2 * i2 + 1];\n\n if (minRadius === Infinity) {\n // order collinear points by dx (or dy if all x are identical)\n // and return the list as a hull\n for (let i = 0; i < n; i++) {\n this._dists[i] = (coords[2 * i] - coords[0]) || (coords[2 * i + 1] - coords[1]);\n }\n quicksort(this._ids, this._dists, 0, n - 1);\n const hull = new Uint32Array(n);\n let j = 0;\n for (let i = 0, d0 = -Infinity; i < n; i++) {\n const id = this._ids[i];\n if (this._dists[id] > d0) {\n hull[j++] = id;\n d0 = this._dists[id];\n }\n }\n this.hull = hull.subarray(0, j);\n this.triangles = new Uint32Array(0);\n this.halfedges = new Uint32Array(0);\n return;\n }\n\n // swap the order of the seed points for counter-clockwise orientation\n if (orient(i0x, i0y, i1x, i1y, i2x, i2y)) {\n const i = i1;\n const x = i1x;\n const y = i1y;\n i1 = i2;\n i1x = i2x;\n i1y = i2y;\n i2 = i;\n i2x = x;\n i2y = y;\n }\n\n const center = circumcenter(i0x, i0y, i1x, i1y, i2x, i2y);\n this._cx = center.x;\n this._cy = center.y;\n\n for (let i = 0; i < n; i++) {\n this._dists[i] = dist(coords[2 * i], coords[2 * i + 1], center.x, center.y);\n }\n\n // sort the points by distance from the seed triangle circumcenter\n quicksort(this._ids, this._dists, 0, n - 1);\n\n // set up the seed triangle as the starting hull\n this._hullStart = i0;\n let hullSize = 3;\n\n hullNext[i0] = hullPrev[i2] = i1;\n hullNext[i1] = hullPrev[i0] = i2;\n hullNext[i2] = hullPrev[i1] = i0;\n\n hullTri[i0] = 0;\n hullTri[i1] = 1;\n hullTri[i2] = 2;\n\n hullHash.fill(-1);\n hullHash[this._hashKey(i0x, i0y)] = i0;\n hullHash[this._hashKey(i1x, i1y)] = i1;\n hullHash[this._hashKey(i2x, i2y)] = i2;\n\n this.trianglesLen = 0;\n this._addTriangle(i0, i1, i2, -1, -1, -1);\n\n for (let k = 0, xp, yp; k < this._ids.length; k++) {\n const i = this._ids[k];\n const x = coords[2 * i];\n const y = coords[2 * i + 1];\n\n // skip near-duplicate points\n if (k > 0 && Math.abs(x - xp) <= EPSILON && Math.abs(y - yp) <= EPSILON) continue;\n xp = x;\n yp = y;\n\n // skip seed triangle points\n if (i === i0 || i === i1 || i === i2) continue;\n\n // find a visible edge on the convex hull using edge hash\n let start = 0;\n for (let j = 0, key = this._hashKey(x, y); j < this._hashSize; j++) {\n start = hullHash[(key + j) % this._hashSize];\n if (start !== -1 && start !== hullNext[start]) break;\n }\n\n start = hullPrev[start];\n let e = start, q;\n while (q = hullNext[e], !orient(x, y, coords[2 * e], coords[2 * e + 1], coords[2 * q], coords[2 * q + 1])) {\n e = q;\n if (e === start) {\n e = -1;\n break;\n }\n }\n if (e === -1) continue; // likely a near-duplicate point; skip it\n\n // add the first triangle from the point\n let t = this._addTriangle(e, i, hullNext[e], -1, -1, hullTri[e]);\n\n // recursively flip triangles from the point until they satisfy the Delaunay condition\n hullTri[i] = this._legalize(t + 2);\n hullTri[e] = t; // keep track of boundary triangles on the hull\n hullSize++;\n\n // walk forward through the hull, adding more triangles and flipping recursively\n let n = hullNext[e];\n while (q = hullNext[n], orient(x, y, coords[2 * n], coords[2 * n + 1], coords[2 * q], coords[2 * q + 1])) {\n t = this._addTriangle(n, i, q, hullTri[i], -1, hullTri[n]);\n hullTri[i] = this._legalize(t + 2);\n hullNext[n] = n; // mark as removed\n hullSize--;\n n = q;\n }\n\n // walk backward from the other side, adding more triangles and flipping\n if (e === start) {\n while (q = hullPrev[e], orient(x, y, coords[2 * q], coords[2 * q + 1], coords[2 * e], coords[2 * e + 1])) {\n t = this._addTriangle(q, i, e, -1, hullTri[e], hullTri[q]);\n this._legalize(t + 2);\n hullTri[q] = t;\n hullNext[e] = e; // mark as removed\n hullSize--;\n e = q;\n }\n }\n\n // update the hull indices\n this._hullStart = hullPrev[i] = e;\n hullNext[e] = hullPrev[n] = i;\n hullNext[i] = n;\n\n // save the two new edges in the hash table\n hullHash[this._hashKey(x, y)] = i;\n hullHash[this._hashKey(coords[2 * e], coords[2 * e + 1])] = e;\n }\n\n this.hull = new Uint32Array(hullSize);\n for (let i = 0, e = this._hullStart; i < hullSize; i++) {\n this.hull[i] = e;\n e = hullNext[e];\n }\n\n // trim typed triangle mesh arrays\n this.triangles = this._triangles.subarray(0, this.trianglesLen);\n this.halfedges = this._halfedges.subarray(0, this.trianglesLen);\n }\n\n _hashKey(x, y) {\n return Math.floor(pseudoAngle(x - this._cx, y - this._cy) * this._hashSize) % this._hashSize;\n }\n\n _legalize(a) {\n const {_triangles: triangles, _halfedges: halfedges, coords} = this;\n\n let i = 0;\n let ar = 0;\n\n // recursion eliminated with a fixed-size stack\n while (true) {\n const b = halfedges[a];\n\n /* if the pair of triangles doesn't satisfy the Delaunay condition\n * (p1 is inside the circumcircle of [p0, pl, pr]), flip them,\n * then do the same check/flip recursively for the new pair of triangles\n *\n * pl pl\n * /||\\ / \\\n * al/ || \\bl al/ \\a\n * / || \\ / \\\n * / a||b \\ flip /___ar___\\\n * p0\\ || /p1 => p0\\---bl---/p1\n * \\ || / \\ /\n * ar\\ || /br b\\ /br\n * \\||/ \\ /\n * pr pr\n */\n const a0 = a - a % 3;\n ar = a0 + (a + 2) % 3;\n\n if (b === -1) { // convex hull edge\n if (i === 0) break;\n a = EDGE_STACK[--i];\n continue;\n }\n\n const b0 = b - b % 3;\n const al = a0 + (a + 1) % 3;\n const bl = b0 + (b + 2) % 3;\n\n const p0 = triangles[ar];\n const pr = triangles[a];\n const pl = triangles[al];\n const p1 = triangles[bl];\n\n const illegal = inCircle(\n coords[2 * p0], coords[2 * p0 + 1],\n coords[2 * pr], coords[2 * pr + 1],\n coords[2 * pl], coords[2 * pl + 1],\n coords[2 * p1], coords[2 * p1 + 1]);\n\n if (illegal) {\n triangles[a] = p1;\n triangles[b] = p0;\n\n const hbl = halfedges[bl];\n\n // edge swapped on the other side of the hull (rare); fix the halfedge reference\n if (hbl === -1) {\n let e = this._hullStart;\n do {\n if (this._hullTri[e] === bl) {\n this._hullTri[e] = a;\n break;\n }\n e = this._hullPrev[e];\n } while (e !== this._hullStart);\n }\n this._link(a, hbl);\n this._link(b, halfedges[ar]);\n this._link(ar, bl);\n\n const br = b0 + (b + 1) % 3;\n\n // don't worry about hitting the cap: it can only happen on extremely degenerate input\n if (i < EDGE_STACK.length) {\n EDGE_STACK[i++] = br;\n }\n } else {\n if (i === 0) break;\n a = EDGE_STACK[--i];\n }\n }\n\n return ar;\n }\n\n _link(a, b) {\n this._halfedges[a] = b;\n if (b !== -1) this._halfedges[b] = a;\n }\n\n // add a new triangle given vertex indices and adjacent half-edge ids\n _addTriangle(i0, i1, i2, a, b, c) {\n const t = this.trianglesLen;\n\n this._triangles[t] = i0;\n this._triangles[t + 1] = i1;\n this._triangles[t + 2] = i2;\n\n this._link(t, a);\n this._link(t + 1, b);\n this._link(t + 2, c);\n\n this.trianglesLen += 3;\n\n return t;\n }\n}\n\n// monotonically increases with real angle, but doesn't need expensive trigonometry\nfunction pseudoAngle(dx, dy) {\n const p = dx / (Math.abs(dx) + Math.abs(dy));\n return (dy > 0 ? 3 - p : 1 + p) / 4; // [0..1]\n}\n\nfunction dist(ax, ay, bx, by) {\n const dx = ax - bx;\n const dy = ay - by;\n return dx * dx + dy * dy;\n}\n\n// return 2d orientation sign if we're confident in it through J. Shewchuk's error bound check\nfunction orientIfSure(px, py, rx, ry, qx, qy) {\n const l = (ry - py) * (qx - px);\n const r = (rx - px) * (qy - py);\n return Math.abs(l - r) >= 3.3306690738754716e-16 * Math.abs(l + r) ? l - r : 0;\n}\n\n// a more robust orientation test that's stable in a given triangle (to fix robustness issues)\nfunction orient(rx, ry, qx, qy, px, py) {\n const sign = orientIfSure(px, py, rx, ry, qx, qy) ||\n orientIfSure(rx, ry, qx, qy, px, py) ||\n orientIfSure(qx, qy, px, py, rx, ry);\n return sign < 0;\n}\n\nfunction inCircle(ax, ay, bx, by, cx, cy, px, py) {\n const dx = ax - px;\n const dy = ay - py;\n const ex = bx - px;\n const ey = by - py;\n const fx = cx - px;\n const fy = cy - py;\n\n const ap = dx * dx + dy * dy;\n const bp = ex * ex + ey * ey;\n const cp = fx * fx + fy * fy;\n\n return dx * (ey * cp - bp * fy) -\n dy * (ex * cp - bp * fx) +\n ap * (ex * fy - ey * fx) < 0;\n}\n\nfunction circumradius(ax, ay, bx, by, cx, cy) {\n const dx = bx - ax;\n const dy = by - ay;\n const ex = cx - ax;\n const ey = cy - ay;\n\n const bl = dx * dx + dy * dy;\n const cl = ex * ex + ey * ey;\n const d = 0.5 / (dx * ey - dy * ex);\n\n const x = (ey * bl - dy * cl) * d;\n const y = (dx * cl - ex * bl) * d;\n\n return x * x + y * y;\n}\n\nfunction circumcenter(ax, ay, bx, by, cx, cy) {\n const dx = bx - ax;\n const dy = by - ay;\n const ex = cx - ax;\n const ey = cy - ay;\n\n const bl = dx * dx + dy * dy;\n const cl = ex * ex + ey * ey;\n const d = 0.5 / (dx * ey - dy * ex);\n\n const x = ax + (ey * bl - dy * cl) * d;\n const y = ay + (dx * cl - ex * bl) * d;\n\n return {x, y};\n}\n\nfunction quicksort(ids, dists, left, right) {\n if (right - left <= 20) {\n for (let i = left + 1; i <= right; i++) {\n const temp = ids[i];\n const tempDist = dists[temp];\n let j = i - 1;\n while (j >= left && dists[ids[j]] > tempDist) ids[j + 1] = ids[j--];\n ids[j + 1] = temp;\n }\n } else {\n const median = (left + right) >> 1;\n let i = left + 1;\n let j = right;\n swap(ids, median, i);\n if (dists[ids[left]] > dists[ids[right]]) swap(ids, left, right);\n if (dists[ids[i]] > dists[ids[right]]) swap(ids, i, right);\n if (dists[ids[left]] > dists[ids[i]]) swap(ids, left, i);\n\n const temp = ids[i];\n const tempDist = dists[temp];\n while (true) {\n do i++; while (dists[ids[i]] < tempDist);\n do j--; while (dists[ids[j]] > tempDist);\n if (j < i) break;\n swap(ids, i, j);\n }\n ids[left + 1] = ids[j];\n ids[j] = temp;\n\n if (right - i + 1 >= j - left) {\n quicksort(ids, dists, i, right);\n quicksort(ids, dists, left, j - 1);\n } else {\n quicksort(ids, dists, left, j - 1);\n quicksort(ids, dists, i, right);\n }\n }\n}\n\nfunction swap(arr, i, j) {\n const tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n}\n\nfunction defaultGetX(p) {\n return p[0];\n}\nfunction defaultGetY(p) {\n return p[1];\n}\n\nconst epsilon = 1e-6;\n\nclass Path {\n constructor() {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n }\n moveTo(x, y) {\n this._ += `M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}`;\n }\n closePath() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._ += \"Z\";\n }\n }\n lineTo(x, y) {\n this._ += `L${this._x1 = +x},${this._y1 = +y}`;\n }\n arc(x, y, r) {\n x = +x, y = +y, r = +r;\n const x0 = x + r;\n const y0 = y;\n if (r < 0) throw new Error(\"negative radius\");\n if (this._x1 === null) this._ += `M${x0},${y0}`;\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) this._ += \"L\" + x0 + \",\" + y0;\n if (!r) return;\n this._ += `A${r},${r},0,1,1,${x - r},${y}A${r},${r},0,1,1,${this._x1 = x0},${this._y1 = y0}`;\n }\n rect(x, y, w, h) {\n this._ += `M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}h${+w}v${+h}h${-w}Z`;\n }\n value() {\n return this._ || null;\n }\n}\n\nclass Polygon {\n constructor() {\n this._ = [];\n }\n moveTo(x, y) {\n this._.push([x, y]);\n }\n closePath() {\n this._.push(this._[0].slice());\n }\n lineTo(x, y) {\n this._.push([x, y]);\n }\n value() {\n return this._.length ? this._ : null;\n }\n}\n\nclass Voronoi {\n constructor(delaunay, [xmin, ymin, xmax, ymax] = [0, 0, 960, 500]) {\n if (!((xmax = +xmax) >= (xmin = +xmin)) || !((ymax = +ymax) >= (ymin = +ymin))) throw new Error(\"invalid bounds\");\n this.delaunay = delaunay;\n this._circumcenters = new Float64Array(delaunay.points.length * 2);\n this.vectors = new Float64Array(delaunay.points.length * 2);\n this.xmax = xmax, this.xmin = xmin;\n this.ymax = ymax, this.ymin = ymin;\n this._init();\n }\n update() {\n this.delaunay.update();\n this._init();\n return this;\n }\n _init() {\n const {delaunay: {points, hull, triangles}, vectors} = this;\n\n // Compute circumcenters.\n const circumcenters = this.circumcenters = this._circumcenters.subarray(0, triangles.length / 3 * 2);\n for (let i = 0, j = 0, n = triangles.length, x, y; i < n; i += 3, j += 2) {\n const t1 = triangles[i] * 2;\n const t2 = triangles[i + 1] * 2;\n const t3 = triangles[i + 2] * 2;\n const x1 = points[t1];\n const y1 = points[t1 + 1];\n const x2 = points[t2];\n const y2 = points[t2 + 1];\n const x3 = points[t3];\n const y3 = points[t3 + 1];\n\n const dx = x2 - x1;\n const dy = y2 - y1;\n const ex = x3 - x1;\n const ey = y3 - y1;\n const bl = dx * dx + dy * dy;\n const cl = ex * ex + ey * ey;\n const ab = (dx * ey - dy * ex) * 2;\n\n if (!ab) {\n // degenerate case (collinear diagram)\n x = (x1 + x3) / 2 - 1e8 * ey;\n y = (y1 + y3) / 2 + 1e8 * ex;\n }\n else if (Math.abs(ab) < 1e-8) {\n // almost equal points (degenerate triangle)\n x = (x1 + x3) / 2;\n y = (y1 + y3) / 2;\n } else {\n const d = 1 / ab;\n x = x1 + (ey * bl - dy * cl) * d;\n y = y1 + (dx * cl - ex * bl) * d;\n }\n circumcenters[j] = x;\n circumcenters[j + 1] = y;\n }\n\n // Compute exterior cell rays.\n let h = hull[hull.length - 1];\n let p0, p1 = h * 4;\n let x0, x1 = points[2 * h];\n let y0, y1 = points[2 * h + 1];\n vectors.fill(0);\n for (let i = 0; i < hull.length; ++i) {\n h = hull[i];\n p0 = p1, x0 = x1, y0 = y1;\n p1 = h * 4, x1 = points[2 * h], y1 = points[2 * h + 1];\n vectors[p0 + 2] = vectors[p1] = y0 - y1;\n vectors[p0 + 3] = vectors[p1 + 1] = x1 - x0;\n }\n }\n render(context) {\n const buffer = context == null ? context = new Path : undefined;\n const {delaunay: {halfedges, inedges, hull}, circumcenters, vectors} = this;\n if (hull.length <= 1) return null;\n for (let i = 0, n = halfedges.length; i < n; ++i) {\n const j = halfedges[i];\n if (j < i) continue;\n const ti = Math.floor(i / 3) * 2;\n const tj = Math.floor(j / 3) * 2;\n const xi = circumcenters[ti];\n const yi = circumcenters[ti + 1];\n const xj = circumcenters[tj];\n const yj = circumcenters[tj + 1];\n this._renderSegment(xi, yi, xj, yj, context);\n }\n let h0, h1 = hull[hull.length - 1];\n for (let i = 0; i < hull.length; ++i) {\n h0 = h1, h1 = hull[i];\n const t = Math.floor(inedges[h1] / 3) * 2;\n const x = circumcenters[t];\n const y = circumcenters[t + 1];\n const v = h0 * 4;\n const p = this._project(x, y, vectors[v + 2], vectors[v + 3]);\n if (p) this._renderSegment(x, y, p[0], p[1], context);\n }\n return buffer && buffer.value();\n }\n renderBounds(context) {\n const buffer = context == null ? context = new Path : undefined;\n context.rect(this.xmin, this.ymin, this.xmax - this.xmin, this.ymax - this.ymin);\n return buffer && buffer.value();\n }\n renderCell(i, context) {\n const buffer = context == null ? context = new Path : undefined;\n const points = this._clip(i);\n if (points === null || !points.length) return;\n context.moveTo(points[0], points[1]);\n let n = points.length;\n while (points[0] === points[n-2] && points[1] === points[n-1] && n > 1) n -= 2;\n for (let i = 2; i < n; i += 2) {\n if (points[i] !== points[i-2] || points[i+1] !== points[i-1])\n context.lineTo(points[i], points[i + 1]);\n }\n context.closePath();\n return buffer && buffer.value();\n }\n *cellPolygons() {\n const {delaunay: {points}} = this;\n for (let i = 0, n = points.length / 2; i < n; ++i) {\n const cell = this.cellPolygon(i);\n if (cell) cell.index = i, yield cell;\n }\n }\n cellPolygon(i) {\n const polygon = new Polygon;\n this.renderCell(i, polygon);\n return polygon.value();\n }\n _renderSegment(x0, y0, x1, y1, context) {\n let S;\n const c0 = this._regioncode(x0, y0);\n const c1 = this._regioncode(x1, y1);\n if (c0 === 0 && c1 === 0) {\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n } else if (S = this._clipSegment(x0, y0, x1, y1, c0, c1)) {\n context.moveTo(S[0], S[1]);\n context.lineTo(S[2], S[3]);\n }\n }\n contains(i, x, y) {\n if ((x = +x, x !== x) || (y = +y, y !== y)) return false;\n return this.delaunay._step(i, x, y) === i;\n }\n *neighbors(i) {\n const ci = this._clip(i);\n if (ci) for (const j of this.delaunay.neighbors(i)) {\n const cj = this._clip(j);\n // find the common edge\n if (cj) loop: for (let ai = 0, li = ci.length; ai < li; ai += 2) {\n for (let aj = 0, lj = cj.length; aj < lj; aj += 2) {\n if (ci[ai] == cj[aj]\n && ci[ai + 1] == cj[aj + 1]\n && ci[(ai + 2) % li] == cj[(aj + lj - 2) % lj]\n && ci[(ai + 3) % li] == cj[(aj + lj - 1) % lj]\n ) {\n yield j;\n break loop;\n }\n }\n }\n }\n }\n _cell(i) {\n const {circumcenters, delaunay: {inedges, halfedges, triangles}} = this;\n const e0 = inedges[i];\n if (e0 === -1) return null; // coincident point\n const points = [];\n let e = e0;\n do {\n const t = Math.floor(e / 3);\n points.push(circumcenters[t * 2], circumcenters[t * 2 + 1]);\n e = e % 3 === 2 ? e - 2 : e + 1;\n if (triangles[e] !== i) break; // bad triangulation\n e = halfedges[e];\n } while (e !== e0 && e !== -1);\n return points;\n }\n _clip(i) {\n // degenerate case (1 valid point: return the box)\n if (i === 0 && this.delaunay.hull.length === 1) {\n return [this.xmax, this.ymin, this.xmax, this.ymax, this.xmin, this.ymax, this.xmin, this.ymin];\n }\n const points = this._cell(i);\n if (points === null) return null;\n const {vectors: V} = this;\n const v = i * 4;\n return V[v] || V[v + 1]\n ? this._clipInfinite(i, points, V[v], V[v + 1], V[v + 2], V[v + 3])\n : this._clipFinite(i, points);\n }\n _clipFinite(i, points) {\n const n = points.length;\n let P = null;\n let x0, y0, x1 = points[n - 2], y1 = points[n - 1];\n let c0, c1 = this._regioncode(x1, y1);\n let e0, e1;\n for (let j = 0; j < n; j += 2) {\n x0 = x1, y0 = y1, x1 = points[j], y1 = points[j + 1];\n c0 = c1, c1 = this._regioncode(x1, y1);\n if (c0 === 0 && c1 === 0) {\n e0 = e1, e1 = 0;\n if (P) P.push(x1, y1);\n else P = [x1, y1];\n } else {\n let S, sx0, sy0, sx1, sy1;\n if (c0 === 0) {\n if ((S = this._clipSegment(x0, y0, x1, y1, c0, c1)) === null) continue;\n [sx0, sy0, sx1, sy1] = S;\n } else {\n if ((S = this._clipSegment(x1, y1, x0, y0, c1, c0)) === null) continue;\n [sx1, sy1, sx0, sy0] = S;\n e0 = e1, e1 = this._edgecode(sx0, sy0);\n if (e0 && e1) this._edge(i, e0, e1, P, P.length);\n if (P) P.push(sx0, sy0);\n else P = [sx0, sy0];\n }\n e0 = e1, e1 = this._edgecode(sx1, sy1);\n if (e0 && e1) this._edge(i, e0, e1, P, P.length);\n if (P) P.push(sx1, sy1);\n else P = [sx1, sy1];\n }\n }\n if (P) {\n e0 = e1, e1 = this._edgecode(P[0], P[1]);\n if (e0 && e1) this._edge(i, e0, e1, P, P.length);\n } else if (this.contains(i, (this.xmin + this.xmax) / 2, (this.ymin + this.ymax) / 2)) {\n return [this.xmax, this.ymin, this.xmax, this.ymax, this.xmin, this.ymax, this.xmin, this.ymin];\n }\n return P;\n }\n _clipSegment(x0, y0, x1, y1, c0, c1) {\n while (true) {\n if (c0 === 0 && c1 === 0) return [x0, y0, x1, y1];\n if (c0 & c1) return null;\n let x, y, c = c0 || c1;\n if (c & 0b1000) x = x0 + (x1 - x0) * (this.ymax - y0) / (y1 - y0), y = this.ymax;\n else if (c & 0b0100) x = x0 + (x1 - x0) * (this.ymin - y0) / (y1 - y0), y = this.ymin;\n else if (c & 0b0010) y = y0 + (y1 - y0) * (this.xmax - x0) / (x1 - x0), x = this.xmax;\n else y = y0 + (y1 - y0) * (this.xmin - x0) / (x1 - x0), x = this.xmin;\n if (c0) x0 = x, y0 = y, c0 = this._regioncode(x0, y0);\n else x1 = x, y1 = y, c1 = this._regioncode(x1, y1);\n }\n }\n _clipInfinite(i, points, vx0, vy0, vxn, vyn) {\n let P = Array.from(points), p;\n if (p = this._project(P[0], P[1], vx0, vy0)) P.unshift(p[0], p[1]);\n if (p = this._project(P[P.length - 2], P[P.length - 1], vxn, vyn)) P.push(p[0], p[1]);\n if (P = this._clipFinite(i, P)) {\n for (let j = 0, n = P.length, c0, c1 = this._edgecode(P[n - 2], P[n - 1]); j < n; j += 2) {\n c0 = c1, c1 = this._edgecode(P[j], P[j + 1]);\n if (c0 && c1) j = this._edge(i, c0, c1, P, j), n = P.length;\n }\n } else if (this.contains(i, (this.xmin + this.xmax) / 2, (this.ymin + this.ymax) / 2)) {\n P = [this.xmin, this.ymin, this.xmax, this.ymin, this.xmax, this.ymax, this.xmin, this.ymax];\n }\n return P;\n }\n _edge(i, e0, e1, P, j) {\n while (e0 !== e1) {\n let x, y;\n switch (e0) {\n case 0b0101: e0 = 0b0100; continue; // top-left\n case 0b0100: e0 = 0b0110, x = this.xmax, y = this.ymin; break; // top\n case 0b0110: e0 = 0b0010; continue; // top-right\n case 0b0010: e0 = 0b1010, x = this.xmax, y = this.ymax; break; // right\n case 0b1010: e0 = 0b1000; continue; // bottom-right\n case 0b1000: e0 = 0b1001, x = this.xmin, y = this.ymax; break; // bottom\n case 0b1001: e0 = 0b0001; continue; // bottom-left\n case 0b0001: e0 = 0b0101, x = this.xmin, y = this.ymin; break; // left\n }\n if ((P[j] !== x || P[j + 1] !== y) && this.contains(i, x, y)) {\n P.splice(j, 0, x, y), j += 2;\n }\n }\n if (P.length > 4) {\n for (let i = 0; i < P.length; i+= 2) {\n const j = (i + 2) % P.length, k = (i + 4) % P.length;\n if (P[i] === P[j] && P[j] === P[k]\n || P[i + 1] === P[j + 1] && P[j + 1] === P[k + 1])\n P.splice(j, 2), i -= 2;\n }\n }\n return j;\n }\n _project(x0, y0, vx, vy) {\n let t = Infinity, c, x, y;\n if (vy < 0) { // top\n if (y0 <= this.ymin) return null;\n if ((c = (this.ymin - y0) / vy) < t) y = this.ymin, x = x0 + (t = c) * vx;\n } else if (vy > 0) { // bottom\n if (y0 >= this.ymax) return null;\n if ((c = (this.ymax - y0) / vy) < t) y = this.ymax, x = x0 + (t = c) * vx;\n }\n if (vx > 0) { // right\n if (x0 >= this.xmax) return null;\n if ((c = (this.xmax - x0) / vx) < t) x = this.xmax, y = y0 + (t = c) * vy;\n } else if (vx < 0) { // left\n if (x0 <= this.xmin) return null;\n if ((c = (this.xmin - x0) / vx) < t) x = this.xmin, y = y0 + (t = c) * vy;\n }\n return [x, y];\n }\n _edgecode(x, y) {\n return (x === this.xmin ? 0b0001\n : x === this.xmax ? 0b0010 : 0b0000)\n | (y === this.ymin ? 0b0100\n : y === this.ymax ? 0b1000 : 0b0000);\n }\n _regioncode(x, y) {\n return (x < this.xmin ? 0b0001\n : x > this.xmax ? 0b0010 : 0b0000)\n | (y < this.ymin ? 0b0100\n : y > this.ymax ? 0b1000 : 0b0000);\n }\n}\n\nconst tau = 2 * Math.PI, pow = Math.pow;\n\nfunction pointX(p) {\n return p[0];\n}\n\nfunction pointY(p) {\n return p[1];\n}\n\n// A triangulation is collinear if all its triangles have a non-null area\nfunction collinear(d) {\n const {triangles, coords} = d;\n for (let i = 0; i < triangles.length; i += 3) {\n const a = 2 * triangles[i],\n b = 2 * triangles[i + 1],\n c = 2 * triangles[i + 2],\n cross = (coords[c] - coords[a]) * (coords[b + 1] - coords[a + 1])\n - (coords[b] - coords[a]) * (coords[c + 1] - coords[a + 1]);\n if (cross > 1e-10) return false;\n }\n return true;\n}\n\nfunction jitter(x, y, r) {\n return [x + Math.sin(x + y) * r, y + Math.cos(x - y) * r];\n}\n\nclass Delaunay {\n static from(points, fx = pointX, fy = pointY, that) {\n return new Delaunay(\"length\" in points\n ? flatArray(points, fx, fy, that)\n : Float64Array.from(flatIterable(points, fx, fy, that)));\n }\n constructor(points) {\n this._delaunator = new Delaunator(points);\n this.inedges = new Int32Array(points.length / 2);\n this._hullIndex = new Int32Array(points.length / 2);\n this.points = this._delaunator.coords;\n this._init();\n }\n update() {\n this._delaunator.update();\n this._init();\n return this;\n }\n _init() {\n const d = this._delaunator, points = this.points;\n\n // check for collinear\n if (d.hull && d.hull.length > 2 && collinear(d)) {\n this.collinear = Int32Array.from({length: points.length/2}, (_,i) => i)\n .sort((i, j) => points[2 * i] - points[2 * j] || points[2 * i + 1] - points[2 * j + 1]); // for exact neighbors\n const e = this.collinear[0], f = this.collinear[this.collinear.length - 1],\n bounds = [ points[2 * e], points[2 * e + 1], points[2 * f], points[2 * f + 1] ],\n r = 1e-8 * Math.hypot(bounds[3] - bounds[1], bounds[2] - bounds[0]);\n for (let i = 0, n = points.length / 2; i < n; ++i) {\n const p = jitter(points[2 * i], points[2 * i + 1], r);\n points[2 * i] = p[0];\n points[2 * i + 1] = p[1];\n }\n this._delaunator = new Delaunator(points);\n } else {\n delete this.collinear;\n }\n\n const halfedges = this.halfedges = this._delaunator.halfedges;\n const hull = this.hull = this._delaunator.hull;\n const triangles = this.triangles = this._delaunator.triangles;\n const inedges = this.inedges.fill(-1);\n const hullIndex = this._hullIndex.fill(-1);\n\n // Compute an index from each point to an (arbitrary) incoming halfedge\n // Used to give the first neighbor of each point; for this reason,\n // on the hull we give priority to exterior halfedges\n for (let e = 0, n = halfedges.length; e < n; ++e) {\n const p = triangles[e % 3 === 2 ? e - 2 : e + 1];\n if (halfedges[e] === -1 || inedges[p] === -1) inedges[p] = e;\n }\n for (let i = 0, n = hull.length; i < n; ++i) {\n hullIndex[hull[i]] = i;\n }\n\n // degenerate case: 1 or 2 (distinct) points\n if (hull.length <= 2 && hull.length > 0) {\n this.triangles = new Int32Array(3).fill(-1);\n this.halfedges = new Int32Array(3).fill(-1);\n this.triangles[0] = hull[0];\n this.triangles[1] = hull[1];\n this.triangles[2] = hull[1];\n inedges[hull[0]] = 1;\n if (hull.length === 2) inedges[hull[1]] = 0;\n }\n }\n voronoi(bounds) {\n return new Voronoi(this, bounds);\n }\n *neighbors(i) {\n const {inedges, hull, _hullIndex, halfedges, triangles, collinear} = this;\n\n // degenerate case with several collinear points\n if (collinear) {\n const l = collinear.indexOf(i);\n if (l > 0) yield collinear[l - 1];\n if (l < collinear.length - 1) yield collinear[l + 1];\n return;\n }\n\n const e0 = inedges[i];\n if (e0 === -1) return; // coincident point\n let e = e0, p0 = -1;\n do {\n yield p0 = triangles[e];\n e = e % 3 === 2 ? e - 2 : e + 1;\n if (triangles[e] !== i) return; // bad triangulation\n e = halfedges[e];\n if (e === -1) {\n const p = hull[(_hullIndex[i] + 1) % hull.length];\n if (p !== p0) yield p;\n return;\n }\n } while (e !== e0);\n }\n find(x, y, i = 0) {\n if ((x = +x, x !== x) || (y = +y, y !== y)) return -1;\n const i0 = i;\n let c;\n while ((c = this._step(i, x, y)) >= 0 && c !== i && c !== i0) i = c;\n return c;\n }\n _step(i, x, y) {\n const {inedges, hull, _hullIndex, halfedges, triangles, points} = this;\n if (inedges[i] === -1 || !points.length) return (i + 1) % (points.length >> 1);\n let c = i;\n let dc = pow(x - points[i * 2], 2) + pow(y - points[i * 2 + 1], 2);\n const e0 = inedges[i];\n let e = e0;\n do {\n let t = triangles[e];\n const dt = pow(x - points[t * 2], 2) + pow(y - points[t * 2 + 1], 2);\n if (dt < dc) dc = dt, c = t;\n e = e % 3 === 2 ? e - 2 : e + 1;\n if (triangles[e] !== i) break; // bad triangulation\n e = halfedges[e];\n if (e === -1) {\n e = hull[(_hullIndex[i] + 1) % hull.length];\n if (e !== t) {\n if (pow(x - points[e * 2], 2) + pow(y - points[e * 2 + 1], 2) < dc) return e;\n }\n break;\n }\n } while (e !== e0);\n return c;\n }\n render(context) {\n const buffer = context == null ? context = new Path : undefined;\n const {points, halfedges, triangles} = this;\n for (let i = 0, n = halfedges.length; i < n; ++i) {\n const j = halfedges[i];\n if (j < i) continue;\n const ti = triangles[i] * 2;\n const tj = triangles[j] * 2;\n context.moveTo(points[ti], points[ti + 1]);\n context.lineTo(points[tj], points[tj + 1]);\n }\n this.renderHull(context);\n return buffer && buffer.value();\n }\n renderPoints(context, r = 2) {\n const buffer = context == null ? context = new Path : undefined;\n const {points} = this;\n for (let i = 0, n = points.length; i < n; i += 2) {\n const x = points[i], y = points[i + 1];\n context.moveTo(x + r, y);\n context.arc(x, y, r, 0, tau);\n }\n return buffer && buffer.value();\n }\n renderHull(context) {\n const buffer = context == null ? context = new Path : undefined;\n const {hull, points} = this;\n const h = hull[0] * 2, n = hull.length;\n context.moveTo(points[h], points[h + 1]);\n for (let i = 1; i < n; ++i) {\n const h = 2 * hull[i];\n context.lineTo(points[h], points[h + 1]);\n }\n context.closePath();\n return buffer && buffer.value();\n }\n hullPolygon() {\n const polygon = new Polygon;\n this.renderHull(polygon);\n return polygon.value();\n }\n renderTriangle(i, context) {\n const buffer = context == null ? context = new Path : undefined;\n const {points, triangles} = this;\n const t0 = triangles[i *= 3] * 2;\n const t1 = triangles[i + 1] * 2;\n const t2 = triangles[i + 2] * 2;\n context.moveTo(points[t0], points[t0 + 1]);\n context.lineTo(points[t1], points[t1 + 1]);\n context.lineTo(points[t2], points[t2 + 1]);\n context.closePath();\n return buffer && buffer.value();\n }\n *trianglePolygons() {\n const {triangles} = this;\n for (let i = 0, n = triangles.length / 3; i < n; ++i) {\n yield this.trianglePolygon(i);\n }\n }\n trianglePolygon(i) {\n const polygon = new Polygon;\n this.renderTriangle(i, polygon);\n return polygon.value();\n }\n}\n\nfunction flatArray(points, fx, fy, that) {\n const n = points.length;\n const array = new Float64Array(n * 2);\n for (let i = 0; i < n; ++i) {\n const p = points[i];\n array[i * 2] = fx.call(that, p, i, points);\n array[i * 2 + 1] = fy.call(that, p, i, points);\n }\n return array;\n}\n\nfunction* flatIterable(points, fx, fy, that) {\n let i = 0;\n for (const p of points) {\n yield fx.call(that, p, i, points);\n yield fy.call(that, p, i, points);\n ++i;\n }\n}\n\nexports.Delaunay = Delaunay;\nexports.Voronoi = Voronoi;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","// https://d3js.org/d3-dispatch/ v2.0.0 Copyright 2020 Mike Bostock\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\ntypeof define === 'function' && define.amd ? define(['exports'], factory) :\n(global = global || self, factory(global.d3 = global.d3 || {}));\n}(this, function (exports) { 'use strict';\n\nvar noop = {value: () => {}};\n\nfunction dispatch() {\n for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {\n if (!(t = arguments[i] + \"\") || (t in _) || /[\\s.]/.test(t)) throw new Error(\"illegal type: \" + t);\n _[t] = [];\n }\n return new Dispatch(_);\n}\n\nfunction Dispatch(_) {\n this._ = _;\n}\n\nfunction parseTypenames(typenames, types) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n if (t && !types.hasOwnProperty(t)) throw new Error(\"unknown type: \" + t);\n return {type: t, name: name};\n });\n}\n\nDispatch.prototype = dispatch.prototype = {\n constructor: Dispatch,\n on: function(typename, callback) {\n var _ = this._,\n T = parseTypenames(typename + \"\", _),\n t,\n i = -1,\n n = T.length;\n\n // If no callback was specified, return the callback of the given type and name.\n if (arguments.length < 2) {\n while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;\n return;\n }\n\n // If a type was specified, set the callback for the given type and name.\n // Otherwise, if a null callback was specified, remove callbacks of the given name.\n if (callback != null && typeof callback !== \"function\") throw new Error(\"invalid callback: \" + callback);\n while (++i < n) {\n if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);\n else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);\n }\n\n return this;\n },\n copy: function() {\n var copy = {}, _ = this._;\n for (var t in _) copy[t] = _[t].slice();\n return new Dispatch(copy);\n },\n call: function(type, that) {\n if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n },\n apply: function(type, that, args) {\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n }\n};\n\nfunction get(type, name) {\n for (var i = 0, n = type.length, c; i < n; ++i) {\n if ((c = type[i]).name === name) {\n return c.value;\n }\n }\n}\n\nfunction set(type, name, callback) {\n for (var i = 0, n = type.length; i < n; ++i) {\n if (type[i].name === name) {\n type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));\n break;\n }\n }\n if (callback != null) type.push({name: name, value: callback});\n return type;\n}\n\nexports.dispatch = dispatch;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","// https://d3js.org/d3-drag/ v2.0.0 Copyright 2020 Mike Bostock\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-dispatch'), require('d3-selection')) :\ntypeof define === 'function' && define.amd ? define(['exports', 'd3-dispatch', 'd3-selection'], factory) :\n(global = global || self, factory(global.d3 = global.d3 || {}, global.d3, global.d3));\n}(this, function (exports, d3Dispatch, d3Selection) { 'use strict';\n\nfunction nopropagation(event) {\n event.stopImmediatePropagation();\n}\n\nfunction noevent(event) {\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n\nfunction nodrag(view) {\n var root = view.document.documentElement,\n selection = d3Selection.select(view).on(\"dragstart.drag\", noevent, true);\n if (\"onselectstart\" in root) {\n selection.on(\"selectstart.drag\", noevent, true);\n } else {\n root.__noselect = root.style.MozUserSelect;\n root.style.MozUserSelect = \"none\";\n }\n}\n\nfunction yesdrag(view, noclick) {\n var root = view.document.documentElement,\n selection = d3Selection.select(view).on(\"dragstart.drag\", null);\n if (noclick) {\n selection.on(\"click.drag\", noevent, true);\n setTimeout(function() { selection.on(\"click.drag\", null); }, 0);\n }\n if (\"onselectstart\" in root) {\n selection.on(\"selectstart.drag\", null);\n } else {\n root.style.MozUserSelect = root.__noselect;\n delete root.__noselect;\n }\n}\n\nvar constant = x => () => x;\n\nfunction DragEvent(type, {\n sourceEvent,\n subject,\n target,\n identifier,\n active,\n x, y, dx, dy,\n dispatch\n}) {\n Object.defineProperties(this, {\n type: {value: type, enumerable: true, configurable: true},\n sourceEvent: {value: sourceEvent, enumerable: true, configurable: true},\n subject: {value: subject, enumerable: true, configurable: true},\n target: {value: target, enumerable: true, configurable: true},\n identifier: {value: identifier, enumerable: true, configurable: true},\n active: {value: active, enumerable: true, configurable: true},\n x: {value: x, enumerable: true, configurable: true},\n y: {value: y, enumerable: true, configurable: true},\n dx: {value: dx, enumerable: true, configurable: true},\n dy: {value: dy, enumerable: true, configurable: true},\n _: {value: dispatch}\n });\n}\n\nDragEvent.prototype.on = function() {\n var value = this._.on.apply(this._, arguments);\n return value === this._ ? this : value;\n};\n\n// Ignore right-click, since that should open the context menu.\nfunction defaultFilter(event) {\n return !event.ctrlKey && !event.button;\n}\n\nfunction defaultContainer() {\n return this.parentNode;\n}\n\nfunction defaultSubject(event, d) {\n return d == null ? {x: event.x, y: event.y} : d;\n}\n\nfunction defaultTouchable() {\n return navigator.maxTouchPoints || (\"ontouchstart\" in this);\n}\n\nfunction drag() {\n var filter = defaultFilter,\n container = defaultContainer,\n subject = defaultSubject,\n touchable = defaultTouchable,\n gestures = {},\n listeners = d3Dispatch.dispatch(\"start\", \"drag\", \"end\"),\n active = 0,\n mousedownx,\n mousedowny,\n mousemoving,\n touchending,\n clickDistance2 = 0;\n\n function drag(selection) {\n selection\n .on(\"mousedown.drag\", mousedowned)\n .filter(touchable)\n .on(\"touchstart.drag\", touchstarted)\n .on(\"touchmove.drag\", touchmoved)\n .on(\"touchend.drag touchcancel.drag\", touchended)\n .style(\"touch-action\", \"none\")\n .style(\"-webkit-tap-highlight-color\", \"rgba(0,0,0,0)\");\n }\n\n function mousedowned(event, d) {\n if (touchending || !filter.call(this, event, d)) return;\n var gesture = beforestart(this, container.call(this, event, d), event, d, \"mouse\");\n if (!gesture) return;\n d3Selection.select(event.view).on(\"mousemove.drag\", mousemoved, true).on(\"mouseup.drag\", mouseupped, true);\n nodrag(event.view);\n nopropagation(event);\n mousemoving = false;\n mousedownx = event.clientX;\n mousedowny = event.clientY;\n gesture(\"start\", event);\n }\n\n function mousemoved(event) {\n noevent(event);\n if (!mousemoving) {\n var dx = event.clientX - mousedownx, dy = event.clientY - mousedowny;\n mousemoving = dx * dx + dy * dy > clickDistance2;\n }\n gestures.mouse(\"drag\", event);\n }\n\n function mouseupped(event) {\n d3Selection.select(event.view).on(\"mousemove.drag mouseup.drag\", null);\n yesdrag(event.view, mousemoving);\n noevent(event);\n gestures.mouse(\"end\", event);\n }\n\n function touchstarted(event, d) {\n if (!filter.call(this, event, d)) return;\n var touches = event.changedTouches,\n c = container.call(this, event, d),\n n = touches.length, i, gesture;\n\n for (i = 0; i < n; ++i) {\n if (gesture = beforestart(this, c, event, d, touches[i].identifier, touches[i])) {\n nopropagation(event);\n gesture(\"start\", event, touches[i]);\n }\n }\n }\n\n function touchmoved(event) {\n var touches = event.changedTouches,\n n = touches.length, i, gesture;\n\n for (i = 0; i < n; ++i) {\n if (gesture = gestures[touches[i].identifier]) {\n noevent(event);\n gesture(\"drag\", event, touches[i]);\n }\n }\n }\n\n function touchended(event) {\n var touches = event.changedTouches,\n n = touches.length, i, gesture;\n\n if (touchending) clearTimeout(touchending);\n touchending = setTimeout(function() { touchending = null; }, 500); // Ghost clicks are delayed!\n for (i = 0; i < n; ++i) {\n if (gesture = gestures[touches[i].identifier]) {\n nopropagation(event);\n gesture(\"end\", event, touches[i]);\n }\n }\n }\n\n function beforestart(that, container, event, d, identifier, touch) {\n var dispatch = listeners.copy(),\n p = d3Selection.pointer(touch || event, container), dx, dy,\n s;\n\n if ((s = subject.call(that, new DragEvent(\"beforestart\", {\n sourceEvent: event,\n target: drag,\n identifier,\n active,\n x: p[0],\n y: p[1],\n dx: 0,\n dy: 0,\n dispatch\n }), d)) == null) return;\n\n dx = s.x - p[0] || 0;\n dy = s.y - p[1] || 0;\n\n return function gesture(type, event, touch) {\n var p0 = p, n;\n switch (type) {\n case \"start\": gestures[identifier] = gesture, n = active++; break;\n case \"end\": delete gestures[identifier], --active; // nobreak\n case \"drag\": p = d3Selection.pointer(touch || event, container), n = active; break;\n }\n dispatch.call(\n type,\n that,\n new DragEvent(type, {\n sourceEvent: event,\n subject: s,\n target: drag,\n identifier,\n active: n,\n x: p[0] + dx,\n y: p[1] + dy,\n dx: p[0] - p0[0],\n dy: p[1] - p0[1],\n dispatch\n }),\n d\n );\n };\n }\n\n drag.filter = function(_) {\n return arguments.length ? (filter = typeof _ === \"function\" ? _ : constant(!!_), drag) : filter;\n };\n\n drag.container = function(_) {\n return arguments.length ? (container = typeof _ === \"function\" ? _ : constant(_), drag) : container;\n };\n\n drag.subject = function(_) {\n return arguments.length ? (subject = typeof _ === \"function\" ? _ : constant(_), drag) : subject;\n };\n\n drag.touchable = function(_) {\n return arguments.length ? (touchable = typeof _ === \"function\" ? _ : constant(!!_), drag) : touchable;\n };\n\n drag.on = function() {\n var value = listeners.on.apply(listeners, arguments);\n return value === listeners ? drag : value;\n };\n\n drag.clickDistance = function(_) {\n return arguments.length ? (clickDistance2 = (_ = +_) * _, drag) : Math.sqrt(clickDistance2);\n };\n\n return drag;\n}\n\nexports.drag = drag;\nexports.dragDisable = nodrag;\nexports.dragEnable = yesdrag;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","// https://d3js.org/d3-dsv/ v2.0.0 Copyright 2020 Mike Bostock\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\ntypeof define === 'function' && define.amd ? define(['exports'], factory) :\n(global = global || self, factory(global.d3 = global.d3 || {}));\n}(this, function (exports) { 'use strict';\n\nvar EOL = {},\n EOF = {},\n QUOTE = 34,\n NEWLINE = 10,\n RETURN = 13;\n\nfunction objectConverter(columns) {\n return new Function(\"d\", \"return {\" + columns.map(function(name, i) {\n return JSON.stringify(name) + \": d[\" + i + \"] || \\\"\\\"\";\n }).join(\",\") + \"}\");\n}\n\nfunction customConverter(columns, f) {\n var object = objectConverter(columns);\n return function(row, i) {\n return f(object(row), i, columns);\n };\n}\n\n// Compute unique columns in order of discovery.\nfunction inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}\n\nfunction pad(value, width) {\n var s = value + \"\", length = s.length;\n return length < width ? new Array(width - length + 1).join(0) + s : s;\n}\n\nfunction formatYear(year) {\n return year < 0 ? \"-\" + pad(-year, 6)\n : year > 9999 ? \"+\" + pad(year, 6)\n : pad(year, 4);\n}\n\nfunction formatDate(date) {\n var hours = date.getUTCHours(),\n minutes = date.getUTCMinutes(),\n seconds = date.getUTCSeconds(),\n milliseconds = date.getUTCMilliseconds();\n return isNaN(date) ? \"Invalid Date\"\n : formatYear(date.getUTCFullYear()) + \"-\" + pad(date.getUTCMonth() + 1, 2) + \"-\" + pad(date.getUTCDate(), 2)\n + (milliseconds ? \"T\" + pad(hours, 2) + \":\" + pad(minutes, 2) + \":\" + pad(seconds, 2) + \".\" + pad(milliseconds, 3) + \"Z\"\n : seconds ? \"T\" + pad(hours, 2) + \":\" + pad(minutes, 2) + \":\" + pad(seconds, 2) + \"Z\"\n : minutes || hours ? \"T\" + pad(hours, 2) + \":\" + pad(minutes, 2) + \"Z\"\n : \"\");\n}\n\nfunction dsv(delimiter) {\n var reFormat = new RegExp(\"[\\\"\" + delimiter + \"\\n\\r]\"),\n DELIMITER = delimiter.charCodeAt(0);\n\n function parse(text, f) {\n var convert, columns, rows = parseRows(text, function(row, i) {\n if (convert) return convert(row, i - 1);\n columns = row, convert = f ? customConverter(row, f) : objectConverter(row);\n });\n rows.columns = columns || [];\n return rows;\n }\n\n function parseRows(text, f) {\n var rows = [], // output rows\n N = text.length,\n I = 0, // current character index\n n = 0, // current line number\n t, // current token\n eof = N <= 0, // current token followed by EOF?\n eol = false; // current token followed by EOL?\n\n // Strip the trailing newline.\n if (text.charCodeAt(N - 1) === NEWLINE) --N;\n if (text.charCodeAt(N - 1) === RETURN) --N;\n\n function token() {\n if (eof) return EOF;\n if (eol) return eol = false, EOL;\n\n // Unescape quotes.\n var i, j = I, c;\n if (text.charCodeAt(j) === QUOTE) {\n while (I++ < N && text.charCodeAt(I) !== QUOTE || text.charCodeAt(++I) === QUOTE);\n if ((i = I) >= N) eof = true;\n else if ((c = text.charCodeAt(I++)) === NEWLINE) eol = true;\n else if (c === RETURN) { eol = true; if (text.charCodeAt(I) === NEWLINE) ++I; }\n return text.slice(j + 1, i - 1).replace(/\"\"/g, \"\\\"\");\n }\n\n // Find next delimiter or newline.\n while (I < N) {\n if ((c = text.charCodeAt(i = I++)) === NEWLINE) eol = true;\n else if (c === RETURN) { eol = true; if (text.charCodeAt(I) === NEWLINE) ++I; }\n else if (c !== DELIMITER) continue;\n return text.slice(j, i);\n }\n\n // Return last token before EOF.\n return eof = true, text.slice(j, N);\n }\n\n while ((t = token()) !== EOF) {\n var row = [];\n while (t !== EOL && t !== EOF) row.push(t), t = token();\n if (f && (row = f(row, n++)) == null) continue;\n rows.push(row);\n }\n\n return rows;\n }\n\n function preformatBody(rows, columns) {\n return rows.map(function(row) {\n return columns.map(function(column) {\n return formatValue(row[column]);\n }).join(delimiter);\n });\n }\n\n function format(rows, columns) {\n if (columns == null) columns = inferColumns(rows);\n return [columns.map(formatValue).join(delimiter)].concat(preformatBody(rows, columns)).join(\"\\n\");\n }\n\n function formatBody(rows, columns) {\n if (columns == null) columns = inferColumns(rows);\n return preformatBody(rows, columns).join(\"\\n\");\n }\n\n function formatRows(rows) {\n return rows.map(formatRow).join(\"\\n\");\n }\n\n function formatRow(row) {\n return row.map(formatValue).join(delimiter);\n }\n\n function formatValue(value) {\n return value == null ? \"\"\n : value instanceof Date ? formatDate(value)\n : reFormat.test(value += \"\") ? \"\\\"\" + value.replace(/\"/g, \"\\\"\\\"\") + \"\\\"\"\n : value;\n }\n\n return {\n parse: parse,\n parseRows: parseRows,\n format: format,\n formatBody: formatBody,\n formatRows: formatRows,\n formatRow: formatRow,\n formatValue: formatValue\n };\n}\n\nvar csv = dsv(\",\");\n\nvar csvParse = csv.parse;\nvar csvParseRows = csv.parseRows;\nvar csvFormat = csv.format;\nvar csvFormatBody = csv.formatBody;\nvar csvFormatRows = csv.formatRows;\nvar csvFormatRow = csv.formatRow;\nvar csvFormatValue = csv.formatValue;\n\nvar tsv = dsv(\"\\t\");\n\nvar tsvParse = tsv.parse;\nvar tsvParseRows = tsv.parseRows;\nvar tsvFormat = tsv.format;\nvar tsvFormatBody = tsv.formatBody;\nvar tsvFormatRows = tsv.formatRows;\nvar tsvFormatRow = tsv.formatRow;\nvar tsvFormatValue = tsv.formatValue;\n\nfunction autoType(object) {\n for (var key in object) {\n var value = object[key].trim(), number, m;\n if (!value) value = null;\n else if (value === \"true\") value = true;\n else if (value === \"false\") value = false;\n else if (value === \"NaN\") value = NaN;\n else if (!isNaN(number = +value)) value = number;\n else if (m = value.match(/^([-+]\\d{2})?\\d{4}(-\\d{2}(-\\d{2})?)?(T\\d{2}:\\d{2}(:\\d{2}(\\.\\d{3})?)?(Z|[-+]\\d{2}:\\d{2})?)?$/)) {\n if (fixtz && !!m[4] && !m[7]) value = value.replace(/-/g, \"/\").replace(/T/, \" \");\n value = new Date(value);\n }\n else continue;\n object[key] = value;\n }\n return object;\n}\n\n// https://github.com/d3/d3-dsv/issues/45\nconst fixtz = new Date(\"2019-01-01T00:00\").getHours() || new Date(\"2019-07-01T00:00\").getHours();\n\nexports.autoType = autoType;\nexports.csvFormat = csvFormat;\nexports.csvFormatBody = csvFormatBody;\nexports.csvFormatRow = csvFormatRow;\nexports.csvFormatRows = csvFormatRows;\nexports.csvFormatValue = csvFormatValue;\nexports.csvParse = csvParse;\nexports.csvParseRows = csvParseRows;\nexports.dsvFormat = dsv;\nexports.tsvFormat = tsvFormat;\nexports.tsvFormatBody = tsvFormatBody;\nexports.tsvFormatRow = tsvFormatRow;\nexports.tsvFormatRows = tsvFormatRows;\nexports.tsvFormatValue = tsvFormatValue;\nexports.tsvParse = tsvParse;\nexports.tsvParseRows = tsvParseRows;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","// https://d3js.org/d3-ease/ v2.0.0 Copyright 2020 Mike Bostock\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\ntypeof define === 'function' && define.amd ? define(['exports'], factory) :\n(global = global || self, factory(global.d3 = global.d3 || {}));\n}(this, function (exports) { 'use strict';\n\nconst linear = t => +t;\n\nfunction quadIn(t) {\n return t * t;\n}\n\nfunction quadOut(t) {\n return t * (2 - t);\n}\n\nfunction quadInOut(t) {\n return ((t *= 2) <= 1 ? t * t : --t * (2 - t) + 1) / 2;\n}\n\nfunction cubicIn(t) {\n return t * t * t;\n}\n\nfunction cubicOut(t) {\n return --t * t * t + 1;\n}\n\nfunction cubicInOut(t) {\n return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;\n}\n\nvar exponent = 3;\n\nvar polyIn = (function custom(e) {\n e = +e;\n\n function polyIn(t) {\n return Math.pow(t, e);\n }\n\n polyIn.exponent = custom;\n\n return polyIn;\n})(exponent);\n\nvar polyOut = (function custom(e) {\n e = +e;\n\n function polyOut(t) {\n return 1 - Math.pow(1 - t, e);\n }\n\n polyOut.exponent = custom;\n\n return polyOut;\n})(exponent);\n\nvar polyInOut = (function custom(e) {\n e = +e;\n\n function polyInOut(t) {\n return ((t *= 2) <= 1 ? Math.pow(t, e) : 2 - Math.pow(2 - t, e)) / 2;\n }\n\n polyInOut.exponent = custom;\n\n return polyInOut;\n})(exponent);\n\nvar pi = Math.PI,\n halfPi = pi / 2;\n\nfunction sinIn(t) {\n return (+t === 1) ? 1 : 1 - Math.cos(t * halfPi);\n}\n\nfunction sinOut(t) {\n return Math.sin(t * halfPi);\n}\n\nfunction sinInOut(t) {\n return (1 - Math.cos(pi * t)) / 2;\n}\n\n// tpmt is two power minus ten times t scaled to [0,1]\nfunction tpmt(x) {\n return (Math.pow(2, -10 * x) - 0.0009765625) * 1.0009775171065494;\n}\n\nfunction expIn(t) {\n return tpmt(1 - +t);\n}\n\nfunction expOut(t) {\n return 1 - tpmt(t);\n}\n\nfunction expInOut(t) {\n return ((t *= 2) <= 1 ? tpmt(1 - t) : 2 - tpmt(t - 1)) / 2;\n}\n\nfunction circleIn(t) {\n return 1 - Math.sqrt(1 - t * t);\n}\n\nfunction circleOut(t) {\n return Math.sqrt(1 - --t * t);\n}\n\nfunction circleInOut(t) {\n return ((t *= 2) <= 1 ? 1 - Math.sqrt(1 - t * t) : Math.sqrt(1 - (t -= 2) * t) + 1) / 2;\n}\n\nvar b1 = 4 / 11,\n b2 = 6 / 11,\n b3 = 8 / 11,\n b4 = 3 / 4,\n b5 = 9 / 11,\n b6 = 10 / 11,\n b7 = 15 / 16,\n b8 = 21 / 22,\n b9 = 63 / 64,\n b0 = 1 / b1 / b1;\n\nfunction bounceIn(t) {\n return 1 - bounceOut(1 - t);\n}\n\nfunction bounceOut(t) {\n return (t = +t) < b1 ? b0 * t * t : t < b3 ? b0 * (t -= b2) * t + b4 : t < b6 ? b0 * (t -= b5) * t + b7 : b0 * (t -= b8) * t + b9;\n}\n\nfunction bounceInOut(t) {\n return ((t *= 2) <= 1 ? 1 - bounceOut(1 - t) : bounceOut(t - 1) + 1) / 2;\n}\n\nvar overshoot = 1.70158;\n\nvar backIn = (function custom(s) {\n s = +s;\n\n function backIn(t) {\n return (t = +t) * t * (s * (t - 1) + t);\n }\n\n backIn.overshoot = custom;\n\n return backIn;\n})(overshoot);\n\nvar backOut = (function custom(s) {\n s = +s;\n\n function backOut(t) {\n return --t * t * ((t + 1) * s + t) + 1;\n }\n\n backOut.overshoot = custom;\n\n return backOut;\n})(overshoot);\n\nvar backInOut = (function custom(s) {\n s = +s;\n\n function backInOut(t) {\n return ((t *= 2) < 1 ? t * t * ((s + 1) * t - s) : (t -= 2) * t * ((s + 1) * t + s) + 2) / 2;\n }\n\n backInOut.overshoot = custom;\n\n return backInOut;\n})(overshoot);\n\nvar tau = 2 * Math.PI,\n amplitude = 1,\n period = 0.3;\n\nvar elasticIn = (function custom(a, p) {\n var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);\n\n function elasticIn(t) {\n return a * tpmt(-(--t)) * Math.sin((s - t) / p);\n }\n\n elasticIn.amplitude = function(a) { return custom(a, p * tau); };\n elasticIn.period = function(p) { return custom(a, p); };\n\n return elasticIn;\n})(amplitude, period);\n\nvar elasticOut = (function custom(a, p) {\n var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);\n\n function elasticOut(t) {\n return 1 - a * tpmt(t = +t) * Math.sin((t + s) / p);\n }\n\n elasticOut.amplitude = function(a) { return custom(a, p * tau); };\n elasticOut.period = function(p) { return custom(a, p); };\n\n return elasticOut;\n})(amplitude, period);\n\nvar elasticInOut = (function custom(a, p) {\n var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);\n\n function elasticInOut(t) {\n return ((t = t * 2 - 1) < 0\n ? a * tpmt(-t) * Math.sin((s - t) / p)\n : 2 - a * tpmt(t) * Math.sin((s + t) / p)) / 2;\n }\n\n elasticInOut.amplitude = function(a) { return custom(a, p * tau); };\n elasticInOut.period = function(p) { return custom(a, p); };\n\n return elasticInOut;\n})(amplitude, period);\n\nexports.easeBack = backInOut;\nexports.easeBackIn = backIn;\nexports.easeBackInOut = backInOut;\nexports.easeBackOut = backOut;\nexports.easeBounce = bounceOut;\nexports.easeBounceIn = bounceIn;\nexports.easeBounceInOut = bounceInOut;\nexports.easeBounceOut = bounceOut;\nexports.easeCircle = circleInOut;\nexports.easeCircleIn = circleIn;\nexports.easeCircleInOut = circleInOut;\nexports.easeCircleOut = circleOut;\nexports.easeCubic = cubicInOut;\nexports.easeCubicIn = cubicIn;\nexports.easeCubicInOut = cubicInOut;\nexports.easeCubicOut = cubicOut;\nexports.easeElastic = elasticOut;\nexports.easeElasticIn = elasticIn;\nexports.easeElasticInOut = elasticInOut;\nexports.easeElasticOut = elasticOut;\nexports.easeExp = expInOut;\nexports.easeExpIn = expIn;\nexports.easeExpInOut = expInOut;\nexports.easeExpOut = expOut;\nexports.easeLinear = linear;\nexports.easePoly = polyInOut;\nexports.easePolyIn = polyIn;\nexports.easePolyInOut = polyInOut;\nexports.easePolyOut = polyOut;\nexports.easeQuad = quadInOut;\nexports.easeQuadIn = quadIn;\nexports.easeQuadInOut = quadInOut;\nexports.easeQuadOut = quadOut;\nexports.easeSin = sinInOut;\nexports.easeSinIn = sinIn;\nexports.easeSinInOut = sinInOut;\nexports.easeSinOut = sinOut;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","// https://d3js.org/d3-fetch/ v2.0.0 Copyright 2020 Mike Bostock\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-dsv')) :\ntypeof define === 'function' && define.amd ? define(['exports', 'd3-dsv'], factory) :\n(global = global || self, factory(global.d3 = global.d3 || {}, global.d3));\n}(this, function (exports, d3Dsv) { 'use strict';\n\nfunction responseBlob(response) {\n if (!response.ok) throw new Error(response.status + \" \" + response.statusText);\n return response.blob();\n}\n\nfunction blob(input, init) {\n return fetch(input, init).then(responseBlob);\n}\n\nfunction responseArrayBuffer(response) {\n if (!response.ok) throw new Error(response.status + \" \" + response.statusText);\n return response.arrayBuffer();\n}\n\nfunction buffer(input, init) {\n return fetch(input, init).then(responseArrayBuffer);\n}\n\nfunction responseText(response) {\n if (!response.ok) throw new Error(response.status + \" \" + response.statusText);\n return response.text();\n}\n\nfunction text(input, init) {\n return fetch(input, init).then(responseText);\n}\n\nfunction dsvParse(parse) {\n return function(input, init, row) {\n if (arguments.length === 2 && typeof init === \"function\") row = init, init = undefined;\n return text(input, init).then(function(response) {\n return parse(response, row);\n });\n };\n}\n\nfunction dsv(delimiter, input, init, row) {\n if (arguments.length === 3 && typeof init === \"function\") row = init, init = undefined;\n var format = d3Dsv.dsvFormat(delimiter);\n return text(input, init).then(function(response) {\n return format.parse(response, row);\n });\n}\n\nvar csv = dsvParse(d3Dsv.csvParse);\nvar tsv = dsvParse(d3Dsv.tsvParse);\n\nfunction image(input, init) {\n return new Promise(function(resolve, reject) {\n var image = new Image;\n for (var key in init) image[key] = init[key];\n image.onerror = reject;\n image.onload = function() { resolve(image); };\n image.src = input;\n });\n}\n\nfunction responseJson(response) {\n if (!response.ok) throw new Error(response.status + \" \" + response.statusText);\n if (response.status === 204 || response.status === 205) return;\n return response.json();\n}\n\nfunction json(input, init) {\n return fetch(input, init).then(responseJson);\n}\n\nfunction parser(type) {\n return (input, init) => text(input, init)\n .then(text => (new DOMParser).parseFromString(text, type));\n}\n\nvar xml = parser(\"application/xml\");\n\nvar html = parser(\"text/html\");\n\nvar svg = parser(\"image/svg+xml\");\n\nexports.blob = blob;\nexports.buffer = buffer;\nexports.csv = csv;\nexports.dsv = dsv;\nexports.html = html;\nexports.image = image;\nexports.json = json;\nexports.svg = svg;\nexports.text = text;\nexports.tsv = tsv;\nexports.xml = xml;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","// https://d3js.org/d3-force/ v2.1.1 Copyright 2020 Mike Bostock\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-quadtree'), require('d3-dispatch'), require('d3-timer')) :\ntypeof define === 'function' && define.amd ? define(['exports', 'd3-quadtree', 'd3-dispatch', 'd3-timer'], factory) :\n(global = global || self, factory(global.d3 = global.d3 || {}, global.d3, global.d3, global.d3));\n}(this, function (exports, d3Quadtree, d3Dispatch, d3Timer) { 'use strict';\n\nfunction center(x, y) {\n var nodes, strength = 1;\n\n if (x == null) x = 0;\n if (y == null) y = 0;\n\n function force() {\n var i,\n n = nodes.length,\n node,\n sx = 0,\n sy = 0;\n\n for (i = 0; i < n; ++i) {\n node = nodes[i], sx += node.x, sy += node.y;\n }\n\n for (sx = (sx / n - x) * strength, sy = (sy / n - y) * strength, i = 0; i < n; ++i) {\n node = nodes[i], node.x -= sx, node.y -= sy;\n }\n }\n\n force.initialize = function(_) {\n nodes = _;\n };\n\n force.x = function(_) {\n return arguments.length ? (x = +_, force) : x;\n };\n\n force.y = function(_) {\n return arguments.length ? (y = +_, force) : y;\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = +_, force) : strength;\n };\n\n return force;\n}\n\nfunction constant(x) {\n return function() {\n return x;\n };\n}\n\nfunction jiggle(random) {\n return (random() - 0.5) * 1e-6;\n}\n\nfunction x(d) {\n return d.x + d.vx;\n}\n\nfunction y(d) {\n return d.y + d.vy;\n}\n\nfunction collide(radius) {\n var nodes,\n radii,\n random,\n strength = 1,\n iterations = 1;\n\n if (typeof radius !== \"function\") radius = constant(radius == null ? 1 : +radius);\n\n function force() {\n var i, n = nodes.length,\n tree,\n node,\n xi,\n yi,\n ri,\n ri2;\n\n for (var k = 0; k < iterations; ++k) {\n tree = d3Quadtree.quadtree(nodes, x, y).visitAfter(prepare);\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n ri = radii[node.index], ri2 = ri * ri;\n xi = node.x + node.vx;\n yi = node.y + node.vy;\n tree.visit(apply);\n }\n }\n\n function apply(quad, x0, y0, x1, y1) {\n var data = quad.data, rj = quad.r, r = ri + rj;\n if (data) {\n if (data.index > node.index) {\n var x = xi - data.x - data.vx,\n y = yi - data.y - data.vy,\n l = x * x + y * y;\n if (l < r * r) {\n if (x === 0) x = jiggle(random), l += x * x;\n if (y === 0) y = jiggle(random), l += y * y;\n l = (r - (l = Math.sqrt(l))) / l * strength;\n node.vx += (x *= l) * (r = (rj *= rj) / (ri2 + rj));\n node.vy += (y *= l) * r;\n data.vx -= x * (r = 1 - r);\n data.vy -= y * r;\n }\n }\n return;\n }\n return x0 > xi + r || x1 < xi - r || y0 > yi + r || y1 < yi - r;\n }\n }\n\n function prepare(quad) {\n if (quad.data) return quad.r = radii[quad.data.index];\n for (var i = quad.r = 0; i < 4; ++i) {\n if (quad[i] && quad[i].r > quad.r) {\n quad.r = quad[i].r;\n }\n }\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length, node;\n radii = new Array(n);\n for (i = 0; i < n; ++i) node = nodes[i], radii[node.index] = +radius(node, i, nodes);\n }\n\n force.initialize = function(_nodes, _random) {\n nodes = _nodes;\n random = _random;\n initialize();\n };\n\n force.iterations = function(_) {\n return arguments.length ? (iterations = +_, force) : iterations;\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = +_, force) : strength;\n };\n\n force.radius = function(_) {\n return arguments.length ? (radius = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : radius;\n };\n\n return force;\n}\n\nfunction index(d) {\n return d.index;\n}\n\nfunction find(nodeById, nodeId) {\n var node = nodeById.get(nodeId);\n if (!node) throw new Error(\"node not found: \" + nodeId);\n return node;\n}\n\nfunction link(links) {\n var id = index,\n strength = defaultStrength,\n strengths,\n distance = constant(30),\n distances,\n nodes,\n count,\n bias,\n random,\n iterations = 1;\n\n if (links == null) links = [];\n\n function defaultStrength(link) {\n return 1 / Math.min(count[link.source.index], count[link.target.index]);\n }\n\n function force(alpha) {\n for (var k = 0, n = links.length; k < iterations; ++k) {\n for (var i = 0, link, source, target, x, y, l, b; i < n; ++i) {\n link = links[i], source = link.source, target = link.target;\n x = target.x + target.vx - source.x - source.vx || jiggle(random);\n y = target.y + target.vy - source.y - source.vy || jiggle(random);\n l = Math.sqrt(x * x + y * y);\n l = (l - distances[i]) / l * alpha * strengths[i];\n x *= l, y *= l;\n target.vx -= x * (b = bias[i]);\n target.vy -= y * b;\n source.vx += x * (b = 1 - b);\n source.vy += y * b;\n }\n }\n }\n\n function initialize() {\n if (!nodes) return;\n\n var i,\n n = nodes.length,\n m = links.length,\n nodeById = new Map(nodes.map((d, i) => [id(d, i, nodes), d])),\n link;\n\n for (i = 0, count = new Array(n); i < m; ++i) {\n link = links[i], link.index = i;\n if (typeof link.source !== \"object\") link.source = find(nodeById, link.source);\n if (typeof link.target !== \"object\") link.target = find(nodeById, link.target);\n count[link.source.index] = (count[link.source.index] || 0) + 1;\n count[link.target.index] = (count[link.target.index] || 0) + 1;\n }\n\n for (i = 0, bias = new Array(m); i < m; ++i) {\n link = links[i], bias[i] = count[link.source.index] / (count[link.source.index] + count[link.target.index]);\n }\n\n strengths = new Array(m), initializeStrength();\n distances = new Array(m), initializeDistance();\n }\n\n function initializeStrength() {\n if (!nodes) return;\n\n for (var i = 0, n = links.length; i < n; ++i) {\n strengths[i] = +strength(links[i], i, links);\n }\n }\n\n function initializeDistance() {\n if (!nodes) return;\n\n for (var i = 0, n = links.length; i < n; ++i) {\n distances[i] = +distance(links[i], i, links);\n }\n }\n\n force.initialize = function(_nodes, _random) {\n nodes = _nodes;\n random = _random;\n initialize();\n };\n\n force.links = function(_) {\n return arguments.length ? (links = _, initialize(), force) : links;\n };\n\n force.id = function(_) {\n return arguments.length ? (id = _, force) : id;\n };\n\n force.iterations = function(_) {\n return arguments.length ? (iterations = +_, force) : iterations;\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : constant(+_), initializeStrength(), force) : strength;\n };\n\n force.distance = function(_) {\n return arguments.length ? (distance = typeof _ === \"function\" ? _ : constant(+_), initializeDistance(), force) : distance;\n };\n\n return force;\n}\n\n// https://en.wikipedia.org/wiki/Linear_congruential_generator#Parameters_in_common_use\nconst a = 1664525;\nconst c = 1013904223;\nconst m = 4294967296; // 2^32\n\nfunction lcg() {\n let s = 1;\n return () => (s = (a * s + c) % m) / m;\n}\n\nfunction x$1(d) {\n return d.x;\n}\n\nfunction y$1(d) {\n return d.y;\n}\n\nvar initialRadius = 10,\n initialAngle = Math.PI * (3 - Math.sqrt(5));\n\nfunction simulation(nodes) {\n var simulation,\n alpha = 1,\n alphaMin = 0.001,\n alphaDecay = 1 - Math.pow(alphaMin, 1 / 300),\n alphaTarget = 0,\n velocityDecay = 0.6,\n forces = new Map(),\n stepper = d3Timer.timer(step),\n event = d3Dispatch.dispatch(\"tick\", \"end\"),\n random = lcg();\n\n if (nodes == null) nodes = [];\n\n function step() {\n tick();\n event.call(\"tick\", simulation);\n if (alpha < alphaMin) {\n stepper.stop();\n event.call(\"end\", simulation);\n }\n }\n\n function tick(iterations) {\n var i, n = nodes.length, node;\n\n if (iterations === undefined) iterations = 1;\n\n for (var k = 0; k < iterations; ++k) {\n alpha += (alphaTarget - alpha) * alphaDecay;\n\n forces.forEach(function(force) {\n force(alpha);\n });\n\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n if (node.fx == null) node.x += node.vx *= velocityDecay;\n else node.x = node.fx, node.vx = 0;\n if (node.fy == null) node.y += node.vy *= velocityDecay;\n else node.y = node.fy, node.vy = 0;\n }\n }\n\n return simulation;\n }\n\n function initializeNodes() {\n for (var i = 0, n = nodes.length, node; i < n; ++i) {\n node = nodes[i], node.index = i;\n if (node.fx != null) node.x = node.fx;\n if (node.fy != null) node.y = node.fy;\n if (isNaN(node.x) || isNaN(node.y)) {\n var radius = initialRadius * Math.sqrt(0.5 + i), angle = i * initialAngle;\n node.x = radius * Math.cos(angle);\n node.y = radius * Math.sin(angle);\n }\n if (isNaN(node.vx) || isNaN(node.vy)) {\n node.vx = node.vy = 0;\n }\n }\n }\n\n function initializeForce(force) {\n if (force.initialize) force.initialize(nodes, random);\n return force;\n }\n\n initializeNodes();\n\n return simulation = {\n tick: tick,\n\n restart: function() {\n return stepper.restart(step), simulation;\n },\n\n stop: function() {\n return stepper.stop(), simulation;\n },\n\n nodes: function(_) {\n return arguments.length ? (nodes = _, initializeNodes(), forces.forEach(initializeForce), simulation) : nodes;\n },\n\n alpha: function(_) {\n return arguments.length ? (alpha = +_, simulation) : alpha;\n },\n\n alphaMin: function(_) {\n return arguments.length ? (alphaMin = +_, simulation) : alphaMin;\n },\n\n alphaDecay: function(_) {\n return arguments.length ? (alphaDecay = +_, simulation) : +alphaDecay;\n },\n\n alphaTarget: function(_) {\n return arguments.length ? (alphaTarget = +_, simulation) : alphaTarget;\n },\n\n velocityDecay: function(_) {\n return arguments.length ? (velocityDecay = 1 - _, simulation) : 1 - velocityDecay;\n },\n\n randomSource: function(_) {\n return arguments.length ? (random = _, forces.forEach(initializeForce), simulation) : random;\n },\n\n force: function(name, _) {\n return arguments.length > 1 ? ((_ == null ? forces.delete(name) : forces.set(name, initializeForce(_))), simulation) : forces.get(name);\n },\n\n find: function(x, y, radius) {\n var i = 0,\n n = nodes.length,\n dx,\n dy,\n d2,\n node,\n closest;\n\n if (radius == null) radius = Infinity;\n else radius *= radius;\n\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n dx = x - node.x;\n dy = y - node.y;\n d2 = dx * dx + dy * dy;\n if (d2 < radius) closest = node, radius = d2;\n }\n\n return closest;\n },\n\n on: function(name, _) {\n return arguments.length > 1 ? (event.on(name, _), simulation) : event.on(name);\n }\n };\n}\n\nfunction manyBody() {\n var nodes,\n node,\n random,\n alpha,\n strength = constant(-30),\n strengths,\n distanceMin2 = 1,\n distanceMax2 = Infinity,\n theta2 = 0.81;\n\n function force(_) {\n var i, n = nodes.length, tree = d3Quadtree.quadtree(nodes, x$1, y$1).visitAfter(accumulate);\n for (alpha = _, i = 0; i < n; ++i) node = nodes[i], tree.visit(apply);\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length, node;\n strengths = new Array(n);\n for (i = 0; i < n; ++i) node = nodes[i], strengths[node.index] = +strength(node, i, nodes);\n }\n\n function accumulate(quad) {\n var strength = 0, q, c, weight = 0, x, y, i;\n\n // For internal nodes, accumulate forces from child quadrants.\n if (quad.length) {\n for (x = y = i = 0; i < 4; ++i) {\n if ((q = quad[i]) && (c = Math.abs(q.value))) {\n strength += q.value, weight += c, x += c * q.x, y += c * q.y;\n }\n }\n quad.x = x / weight;\n quad.y = y / weight;\n }\n\n // For leaf nodes, accumulate forces from coincident quadrants.\n else {\n q = quad;\n q.x = q.data.x;\n q.y = q.data.y;\n do strength += strengths[q.data.index];\n while (q = q.next);\n }\n\n quad.value = strength;\n }\n\n function apply(quad, x1, _, x2) {\n if (!quad.value) return true;\n\n var x = quad.x - node.x,\n y = quad.y - node.y,\n w = x2 - x1,\n l = x * x + y * y;\n\n // Apply the Barnes-Hut approximation if possible.\n // Limit forces for very close nodes; randomize direction if coincident.\n if (w * w / theta2 < l) {\n if (l < distanceMax2) {\n if (x === 0) x = jiggle(random), l += x * x;\n if (y === 0) y = jiggle(random), l += y * y;\n if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l);\n node.vx += x * quad.value * alpha / l;\n node.vy += y * quad.value * alpha / l;\n }\n return true;\n }\n\n // Otherwise, process points directly.\n else if (quad.length || l >= distanceMax2) return;\n\n // Limit forces for very close nodes; randomize direction if coincident.\n if (quad.data !== node || quad.next) {\n if (x === 0) x = jiggle(random), l += x * x;\n if (y === 0) y = jiggle(random), l += y * y;\n if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l);\n }\n\n do if (quad.data !== node) {\n w = strengths[quad.data.index] * alpha / l;\n node.vx += x * w;\n node.vy += y * w;\n } while (quad = quad.next);\n }\n\n force.initialize = function(_nodes, _random) {\n nodes = _nodes;\n random = _random;\n initialize();\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : strength;\n };\n\n force.distanceMin = function(_) {\n return arguments.length ? (distanceMin2 = _ * _, force) : Math.sqrt(distanceMin2);\n };\n\n force.distanceMax = function(_) {\n return arguments.length ? (distanceMax2 = _ * _, force) : Math.sqrt(distanceMax2);\n };\n\n force.theta = function(_) {\n return arguments.length ? (theta2 = _ * _, force) : Math.sqrt(theta2);\n };\n\n return force;\n}\n\nfunction radial(radius, x, y) {\n var nodes,\n strength = constant(0.1),\n strengths,\n radiuses;\n\n if (typeof radius !== \"function\") radius = constant(+radius);\n if (x == null) x = 0;\n if (y == null) y = 0;\n\n function force(alpha) {\n for (var i = 0, n = nodes.length; i < n; ++i) {\n var node = nodes[i],\n dx = node.x - x || 1e-6,\n dy = node.y - y || 1e-6,\n r = Math.sqrt(dx * dx + dy * dy),\n k = (radiuses[i] - r) * strengths[i] * alpha / r;\n node.vx += dx * k;\n node.vy += dy * k;\n }\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length;\n strengths = new Array(n);\n radiuses = new Array(n);\n for (i = 0; i < n; ++i) {\n radiuses[i] = +radius(nodes[i], i, nodes);\n strengths[i] = isNaN(radiuses[i]) ? 0 : +strength(nodes[i], i, nodes);\n }\n }\n\n force.initialize = function(_) {\n nodes = _, initialize();\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : strength;\n };\n\n force.radius = function(_) {\n return arguments.length ? (radius = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : radius;\n };\n\n force.x = function(_) {\n return arguments.length ? (x = +_, force) : x;\n };\n\n force.y = function(_) {\n return arguments.length ? (y = +_, force) : y;\n };\n\n return force;\n}\n\nfunction x$2(x) {\n var strength = constant(0.1),\n nodes,\n strengths,\n xz;\n\n if (typeof x !== \"function\") x = constant(x == null ? 0 : +x);\n\n function force(alpha) {\n for (var i = 0, n = nodes.length, node; i < n; ++i) {\n node = nodes[i], node.vx += (xz[i] - node.x) * strengths[i] * alpha;\n }\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length;\n strengths = new Array(n);\n xz = new Array(n);\n for (i = 0; i < n; ++i) {\n strengths[i] = isNaN(xz[i] = +x(nodes[i], i, nodes)) ? 0 : +strength(nodes[i], i, nodes);\n }\n }\n\n force.initialize = function(_) {\n nodes = _;\n initialize();\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : strength;\n };\n\n force.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : x;\n };\n\n return force;\n}\n\nfunction y$2(y) {\n var strength = constant(0.1),\n nodes,\n strengths,\n yz;\n\n if (typeof y !== \"function\") y = constant(y == null ? 0 : +y);\n\n function force(alpha) {\n for (var i = 0, n = nodes.length, node; i < n; ++i) {\n node = nodes[i], node.vy += (yz[i] - node.y) * strengths[i] * alpha;\n }\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length;\n strengths = new Array(n);\n yz = new Array(n);\n for (i = 0; i < n; ++i) {\n strengths[i] = isNaN(yz[i] = +y(nodes[i], i, nodes)) ? 0 : +strength(nodes[i], i, nodes);\n }\n }\n\n force.initialize = function(_) {\n nodes = _;\n initialize();\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : strength;\n };\n\n force.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : y;\n };\n\n return force;\n}\n\nexports.forceCenter = center;\nexports.forceCollide = collide;\nexports.forceLink = link;\nexports.forceManyBody = manyBody;\nexports.forceRadial = radial;\nexports.forceSimulation = simulation;\nexports.forceX = x$2;\nexports.forceY = y$2;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","// https://d3js.org/d3-format/ v2.0.0 Copyright 2020 Mike Bostock\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\ntypeof define === 'function' && define.amd ? define(['exports'], factory) :\n(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.d3 = global.d3 || {}));\n}(this, (function (exports) { 'use strict';\n\nfunction formatDecimal(x) {\n return Math.abs(x = Math.round(x)) >= 1e21\n ? x.toLocaleString(\"en\").replace(/,/g, \"\")\n : x.toString(10);\n}\n\n// Computes the decimal coefficient and exponent of the specified number x with\n// significant digits p, where x is positive and p is in [1, 21] or undefined.\n// For example, formatDecimalParts(1.23) returns [\"123\", 0].\nfunction formatDecimalParts(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n}\n\nfunction exponent(x) {\n return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;\n}\n\nfunction formatGroup(grouping, thousands) {\n return function(value, width) {\n var i = value.length,\n t = [],\n j = 0,\n g = grouping[0],\n length = 0;\n\n while (i > 0 && g > 0) {\n if (length + g + 1 > width) g = Math.max(1, width - length);\n t.push(value.substring(i -= g, i + g));\n if ((length += g + 1) > width) break;\n g = grouping[j = (j + 1) % grouping.length];\n }\n\n return t.reverse().join(thousands);\n };\n}\n\nfunction formatNumerals(numerals) {\n return function(value) {\n return value.replace(/[0-9]/g, function(i) {\n return numerals[+i];\n });\n };\n}\n\n// [[fill]align][sign][symbol][0][width][,][.precision][~][type]\nvar re = /^(?:(.)?([<>=^]))?([+\\-( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?(~)?([a-z%])?$/i;\n\nfunction formatSpecifier(specifier) {\n if (!(match = re.exec(specifier))) throw new Error(\"invalid format: \" + specifier);\n var match;\n return new FormatSpecifier({\n fill: match[1],\n align: match[2],\n sign: match[3],\n symbol: match[4],\n zero: match[5],\n width: match[6],\n comma: match[7],\n precision: match[8] && match[8].slice(1),\n trim: match[9],\n type: match[10]\n });\n}\n\nformatSpecifier.prototype = FormatSpecifier.prototype; // instanceof\n\nfunction FormatSpecifier(specifier) {\n this.fill = specifier.fill === undefined ? \" \" : specifier.fill + \"\";\n this.align = specifier.align === undefined ? \">\" : specifier.align + \"\";\n this.sign = specifier.sign === undefined ? \"-\" : specifier.sign + \"\";\n this.symbol = specifier.symbol === undefined ? \"\" : specifier.symbol + \"\";\n this.zero = !!specifier.zero;\n this.width = specifier.width === undefined ? undefined : +specifier.width;\n this.comma = !!specifier.comma;\n this.precision = specifier.precision === undefined ? undefined : +specifier.precision;\n this.trim = !!specifier.trim;\n this.type = specifier.type === undefined ? \"\" : specifier.type + \"\";\n}\n\nFormatSpecifier.prototype.toString = function() {\n return this.fill\n + this.align\n + this.sign\n + this.symbol\n + (this.zero ? \"0\" : \"\")\n + (this.width === undefined ? \"\" : Math.max(1, this.width | 0))\n + (this.comma ? \",\" : \"\")\n + (this.precision === undefined ? \"\" : \".\" + Math.max(0, this.precision | 0))\n + (this.trim ? \"~\" : \"\")\n + this.type;\n};\n\n// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.\nfunction formatTrim(s) {\n out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {\n switch (s[i]) {\n case \".\": i0 = i1 = i; break;\n case \"0\": if (i0 === 0) i0 = i; i1 = i; break;\n default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break;\n }\n }\n return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;\n}\n\nvar prefixExponent;\n\nfunction formatPrefixAuto(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1],\n i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,\n n = coefficient.length;\n return i === n ? coefficient\n : i > n ? coefficient + new Array(i - n + 1).join(\"0\")\n : i > 0 ? coefficient.slice(0, i) + \".\" + coefficient.slice(i)\n : \"0.\" + new Array(1 - i).join(\"0\") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y!\n}\n\nfunction formatRounded(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1];\n return exponent < 0 ? \"0.\" + new Array(-exponent).join(\"0\") + coefficient\n : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + \".\" + coefficient.slice(exponent + 1)\n : coefficient + new Array(exponent - coefficient.length + 2).join(\"0\");\n}\n\nvar formatTypes = {\n \"%\": (x, p) => (x * 100).toFixed(p),\n \"b\": (x) => Math.round(x).toString(2),\n \"c\": (x) => x + \"\",\n \"d\": formatDecimal,\n \"e\": (x, p) => x.toExponential(p),\n \"f\": (x, p) => x.toFixed(p),\n \"g\": (x, p) => x.toPrecision(p),\n \"o\": (x) => Math.round(x).toString(8),\n \"p\": (x, p) => formatRounded(x * 100, p),\n \"r\": formatRounded,\n \"s\": formatPrefixAuto,\n \"X\": (x) => Math.round(x).toString(16).toUpperCase(),\n \"x\": (x) => Math.round(x).toString(16)\n};\n\nfunction identity(x) {\n return x;\n}\n\nvar map = Array.prototype.map,\n prefixes = [\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"µ\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"];\n\nfunction formatLocale(locale) {\n var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + \"\"),\n currencyPrefix = locale.currency === undefined ? \"\" : locale.currency[0] + \"\",\n currencySuffix = locale.currency === undefined ? \"\" : locale.currency[1] + \"\",\n decimal = locale.decimal === undefined ? \".\" : locale.decimal + \"\",\n numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)),\n percent = locale.percent === undefined ? \"%\" : locale.percent + \"\",\n minus = locale.minus === undefined ? \"−\" : locale.minus + \"\",\n nan = locale.nan === undefined ? \"NaN\" : locale.nan + \"\";\n\n function newFormat(specifier) {\n specifier = formatSpecifier(specifier);\n\n var fill = specifier.fill,\n align = specifier.align,\n sign = specifier.sign,\n symbol = specifier.symbol,\n zero = specifier.zero,\n width = specifier.width,\n comma = specifier.comma,\n precision = specifier.precision,\n trim = specifier.trim,\n type = specifier.type;\n\n // The \"n\" type is an alias for \",g\".\n if (type === \"n\") comma = true, type = \"g\";\n\n // The \"\" type, and any invalid type, is an alias for \".12~g\".\n else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = \"g\";\n\n // If zero fill is specified, padding goes after sign and before digits.\n if (zero || (fill === \"0\" && align === \"=\")) zero = true, fill = \"0\", align = \"=\";\n\n // Compute the prefix and suffix.\n // For SI-prefix, the suffix is lazily computed.\n var prefix = symbol === \"$\" ? currencyPrefix : symbol === \"#\" && /[boxX]/.test(type) ? \"0\" + type.toLowerCase() : \"\",\n suffix = symbol === \"$\" ? currencySuffix : /[%p]/.test(type) ? percent : \"\";\n\n // What format function should we use?\n // Is this an integer type?\n // Can this type generate exponential notation?\n var formatType = formatTypes[type],\n maybeSuffix = /[defgprs%]/.test(type);\n\n // Set the default precision if not specified,\n // or clamp the specified precision to the supported range.\n // For significant precision, it must be in [1, 21].\n // For fixed precision, it must be in [0, 20].\n precision = precision === undefined ? 6\n : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))\n : Math.max(0, Math.min(20, precision));\n\n function format(value) {\n var valuePrefix = prefix,\n valueSuffix = suffix,\n i, n, c;\n\n if (type === \"c\") {\n valueSuffix = formatType(value) + valueSuffix;\n value = \"\";\n } else {\n value = +value;\n\n // Determine the sign. -0 is not less than 0, but 1 / -0 is!\n var valueNegative = value < 0 || 1 / value < 0;\n\n // Perform the initial formatting.\n value = isNaN(value) ? nan : formatType(Math.abs(value), precision);\n\n // Trim insignificant zeros.\n if (trim) value = formatTrim(value);\n\n // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.\n if (valueNegative && +value === 0 && sign !== \"+\") valueNegative = false;\n\n // Compute the prefix and suffix.\n valuePrefix = (valueNegative ? (sign === \"(\" ? sign : minus) : sign === \"-\" || sign === \"(\" ? \"\" : sign) + valuePrefix;\n valueSuffix = (type === \"s\" ? prefixes[8 + prefixExponent / 3] : \"\") + valueSuffix + (valueNegative && sign === \"(\" ? \")\" : \"\");\n\n // Break the formatted value into the integer “value” part that can be\n // grouped, and fractional or exponential “suffix” part that is not.\n if (maybeSuffix) {\n i = -1, n = value.length;\n while (++i < n) {\n if (c = value.charCodeAt(i), 48 > c || c > 57) {\n valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;\n value = value.slice(0, i);\n break;\n }\n }\n }\n }\n\n // If the fill character is not \"0\", grouping is applied before padding.\n if (comma && !zero) value = group(value, Infinity);\n\n // Compute the padding.\n var length = valuePrefix.length + value.length + valueSuffix.length,\n padding = length < width ? new Array(width - length + 1).join(fill) : \"\";\n\n // If the fill character is \"0\", grouping is applied after padding.\n if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = \"\";\n\n // Reconstruct the final output based on the desired alignment.\n switch (align) {\n case \"<\": value = valuePrefix + value + valueSuffix + padding; break;\n case \"=\": value = valuePrefix + padding + value + valueSuffix; break;\n case \"^\": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;\n default: value = padding + valuePrefix + value + valueSuffix; break;\n }\n\n return numerals(value);\n }\n\n format.toString = function() {\n return specifier + \"\";\n };\n\n return format;\n }\n\n function formatPrefix(specifier, value) {\n var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = \"f\", specifier)),\n e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,\n k = Math.pow(10, -e),\n prefix = prefixes[8 + e / 3];\n return function(value) {\n return f(k * value) + prefix;\n };\n }\n\n return {\n format: newFormat,\n formatPrefix: formatPrefix\n };\n}\n\nvar locale;\n\ndefaultLocale({\n thousands: \",\",\n grouping: [3],\n currency: [\"$\", \"\"]\n});\n\nfunction defaultLocale(definition) {\n locale = formatLocale(definition);\n exports.format = locale.format;\n exports.formatPrefix = locale.formatPrefix;\n return locale;\n}\n\nfunction precisionFixed(step) {\n return Math.max(0, -exponent(Math.abs(step)));\n}\n\nfunction precisionPrefix(step, value) {\n return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));\n}\n\nfunction precisionRound(step, max) {\n step = Math.abs(step), max = Math.abs(max) - step;\n return Math.max(0, exponent(max) - exponent(step)) + 1;\n}\n\nexports.FormatSpecifier = FormatSpecifier;\nexports.formatDefaultLocale = defaultLocale;\nexports.formatLocale = formatLocale;\nexports.formatSpecifier = formatSpecifier;\nexports.precisionFixed = precisionFixed;\nexports.precisionPrefix = precisionPrefix;\nexports.precisionRound = precisionRound;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n","// https://d3js.org/d3-geo/ v2.0.2 Copyright 2021 Mike Bostock\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-array')) :\ntypeof define === 'function' && define.amd ? define(['exports', 'd3-array'], factory) :\n(global = global || self, factory(global.d3 = global.d3 || {}, global.d3));\n}(this, function (exports, d3Array) { 'use strict';\n\nvar epsilon = 1e-6;\nvar epsilon2 = 1e-12;\nvar pi = Math.PI;\nvar halfPi = pi / 2;\nvar quarterPi = pi / 4;\nvar tau = pi * 2;\n\nvar degrees = 180 / pi;\nvar radians = pi / 180;\n\nvar abs = Math.abs;\nvar atan = Math.atan;\nvar atan2 = Math.atan2;\nvar cos = Math.cos;\nvar ceil = Math.ceil;\nvar exp = Math.exp;\nvar hypot = Math.hypot;\nvar log = Math.log;\nvar pow = Math.pow;\nvar sin = Math.sin;\nvar sign = Math.sign || function(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; };\nvar sqrt = Math.sqrt;\nvar tan = Math.tan;\n\nfunction acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nfunction asin(x) {\n return x > 1 ? halfPi : x < -1 ? -halfPi : Math.asin(x);\n}\n\nfunction haversin(x) {\n return (x = sin(x / 2)) * x;\n}\n\nfunction noop() {}\n\nfunction streamGeometry(geometry, stream) {\n if (geometry && streamGeometryType.hasOwnProperty(geometry.type)) {\n streamGeometryType[geometry.type](geometry, stream);\n }\n}\n\nvar streamObjectType = {\n Feature: function(object, stream) {\n streamGeometry(object.geometry, stream);\n },\n FeatureCollection: function(object, stream) {\n var features = object.features, i = -1, n = features.length;\n while (++i < n) streamGeometry(features[i].geometry, stream);\n }\n};\n\nvar streamGeometryType = {\n Sphere: function(object, stream) {\n stream.sphere();\n },\n Point: function(object, stream) {\n object = object.coordinates;\n stream.point(object[0], object[1], object[2]);\n },\n MultiPoint: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) object = coordinates[i], stream.point(object[0], object[1], object[2]);\n },\n LineString: function(object, stream) {\n streamLine(object.coordinates, stream, 0);\n },\n MultiLineString: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) streamLine(coordinates[i], stream, 0);\n },\n Polygon: function(object, stream) {\n streamPolygon(object.coordinates, stream);\n },\n MultiPolygon: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) streamPolygon(coordinates[i], stream);\n },\n GeometryCollection: function(object, stream) {\n var geometries = object.geometries, i = -1, n = geometries.length;\n while (++i < n) streamGeometry(geometries[i], stream);\n }\n};\n\nfunction streamLine(coordinates, stream, closed) {\n var i = -1, n = coordinates.length - closed, coordinate;\n stream.lineStart();\n while (++i < n) coordinate = coordinates[i], stream.point(coordinate[0], coordinate[1], coordinate[2]);\n stream.lineEnd();\n}\n\nfunction streamPolygon(coordinates, stream) {\n var i = -1, n = coordinates.length;\n stream.polygonStart();\n while (++i < n) streamLine(coordinates[i], stream, 1);\n stream.polygonEnd();\n}\n\nfunction geoStream(object, stream) {\n if (object && streamObjectType.hasOwnProperty(object.type)) {\n streamObjectType[object.type](object, stream);\n } else {\n streamGeometry(object, stream);\n }\n}\n\nvar areaRingSum = new d3Array.Adder();\n\n// hello?\n\nvar areaSum = new d3Array.Adder(),\n lambda00,\n phi00,\n lambda0,\n cosPhi0,\n sinPhi0;\n\nvar areaStream = {\n point: noop,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: function() {\n areaRingSum = new d3Array.Adder();\n areaStream.lineStart = areaRingStart;\n areaStream.lineEnd = areaRingEnd;\n },\n polygonEnd: function() {\n var areaRing = +areaRingSum;\n areaSum.add(areaRing < 0 ? tau + areaRing : areaRing);\n this.lineStart = this.lineEnd = this.point = noop;\n },\n sphere: function() {\n areaSum.add(tau);\n }\n};\n\nfunction areaRingStart() {\n areaStream.point = areaPointFirst;\n}\n\nfunction areaRingEnd() {\n areaPoint(lambda00, phi00);\n}\n\nfunction areaPointFirst(lambda, phi) {\n areaStream.point = areaPoint;\n lambda00 = lambda, phi00 = phi;\n lambda *= radians, phi *= radians;\n lambda0 = lambda, cosPhi0 = cos(phi = phi / 2 + quarterPi), sinPhi0 = sin(phi);\n}\n\nfunction areaPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n phi = phi / 2 + quarterPi; // half the angular distance from south pole\n\n // Spherical excess E for a spherical triangle with vertices: south pole,\n // previous point, current point. Uses a formula derived from Cagnoli’s\n // theorem. See Todhunter, Spherical Trig. (1871), Sec. 103, Eq. (2).\n var dLambda = lambda - lambda0,\n sdLambda = dLambda >= 0 ? 1 : -1,\n adLambda = sdLambda * dLambda,\n cosPhi = cos(phi),\n sinPhi = sin(phi),\n k = sinPhi0 * sinPhi,\n u = cosPhi0 * cosPhi + k * cos(adLambda),\n v = k * sdLambda * sin(adLambda);\n areaRingSum.add(atan2(v, u));\n\n // Advance the previous points.\n lambda0 = lambda, cosPhi0 = cosPhi, sinPhi0 = sinPhi;\n}\n\nfunction area(object) {\n areaSum = new d3Array.Adder();\n geoStream(object, areaStream);\n return areaSum * 2;\n}\n\nfunction spherical(cartesian) {\n return [atan2(cartesian[1], cartesian[0]), asin(cartesian[2])];\n}\n\nfunction cartesian(spherical) {\n var lambda = spherical[0], phi = spherical[1], cosPhi = cos(phi);\n return [cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi)];\n}\n\nfunction cartesianDot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n\nfunction cartesianCross(a, b) {\n return [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]];\n}\n\n// TODO return a\nfunction cartesianAddInPlace(a, b) {\n a[0] += b[0], a[1] += b[1], a[2] += b[2];\n}\n\nfunction cartesianScale(vector, k) {\n return [vector[0] * k, vector[1] * k, vector[2] * k];\n}\n\n// TODO return d\nfunction cartesianNormalizeInPlace(d) {\n var l = sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);\n d[0] /= l, d[1] /= l, d[2] /= l;\n}\n\nvar lambda0$1, phi0, lambda1, phi1, // bounds\n lambda2, // previous lambda-coordinate\n lambda00$1, phi00$1, // first point\n p0, // previous 3D point\n deltaSum,\n ranges,\n range;\n\nvar boundsStream = {\n point: boundsPoint,\n lineStart: boundsLineStart,\n lineEnd: boundsLineEnd,\n polygonStart: function() {\n boundsStream.point = boundsRingPoint;\n boundsStream.lineStart = boundsRingStart;\n boundsStream.lineEnd = boundsRingEnd;\n deltaSum = new d3Array.Adder();\n areaStream.polygonStart();\n },\n polygonEnd: function() {\n areaStream.polygonEnd();\n boundsStream.point = boundsPoint;\n boundsStream.lineStart = boundsLineStart;\n boundsStream.lineEnd = boundsLineEnd;\n if (areaRingSum < 0) lambda0$1 = -(lambda1 = 180), phi0 = -(phi1 = 90);\n else if (deltaSum > epsilon) phi1 = 90;\n else if (deltaSum < -epsilon) phi0 = -90;\n range[0] = lambda0$1, range[1] = lambda1;\n },\n sphere: function() {\n lambda0$1 = -(lambda1 = 180), phi0 = -(phi1 = 90);\n }\n};\n\nfunction boundsPoint(lambda, phi) {\n ranges.push(range = [lambda0$1 = lambda, lambda1 = lambda]);\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n}\n\nfunction linePoint(lambda, phi) {\n var p = cartesian([lambda * radians, phi * radians]);\n if (p0) {\n var normal = cartesianCross(p0, p),\n equatorial = [normal[1], -normal[0], 0],\n inflection = cartesianCross(equatorial, normal);\n cartesianNormalizeInPlace(inflection);\n inflection = spherical(inflection);\n var delta = lambda - lambda2,\n sign = delta > 0 ? 1 : -1,\n lambdai = inflection[0] * degrees * sign,\n phii,\n antimeridian = abs(delta) > 180;\n if (antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) {\n phii = inflection[1] * degrees;\n if (phii > phi1) phi1 = phii;\n } else if (lambdai = (lambdai + 360) % 360 - 180, antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) {\n phii = -inflection[1] * degrees;\n if (phii < phi0) phi0 = phii;\n } else {\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n }\n if (antimeridian) {\n if (lambda < lambda2) {\n if (angle(lambda0$1, lambda) > angle(lambda0$1, lambda1)) lambda1 = lambda;\n } else {\n if (angle(lambda, lambda1) > angle(lambda0$1, lambda1)) lambda0$1 = lambda;\n }\n } else {\n if (lambda1 >= lambda0$1) {\n if (lambda < lambda0$1) lambda0$1 = lambda;\n if (lambda > lambda1) lambda1 = lambda;\n } else {\n if (lambda > lambda2) {\n if (angle(lambda0$1, lambda) > angle(lambda0$1, lambda1)) lambda1 = lambda;\n } else {\n if (angle(lambda, lambda1) > angle(lambda0$1, lambda1)) lambda0$1 = lambda;\n }\n }\n }\n } else {\n ranges.push(range = [lambda0$1 = lambda, lambda1 = lambda]);\n }\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n p0 = p, lambda2 = lambda;\n}\n\nfunction boundsLineStart() {\n boundsStream.point = linePoint;\n}\n\nfunction boundsLineEnd() {\n range[0] = lambda0$1, range[1] = lambda1;\n boundsStream.point = boundsPoint;\n p0 = null;\n}\n\nfunction boundsRingPoint(lambda, phi) {\n if (p0) {\n var delta = lambda - lambda2;\n deltaSum.add(abs(delta) > 180 ? delta + (delta > 0 ? 360 : -360) : delta);\n } else {\n lambda00$1 = lambda, phi00$1 = phi;\n }\n areaStream.point(lambda, phi);\n linePoint(lambda, phi);\n}\n\nfunction boundsRingStart() {\n areaStream.lineStart();\n}\n\nfunction boundsRingEnd() {\n boundsRingPoint(lambda00$1, phi00$1);\n areaStream.lineEnd();\n if (abs(deltaSum) > epsilon) lambda0$1 = -(lambda1 = 180);\n range[0] = lambda0$1, range[1] = lambda1;\n p0 = null;\n}\n\n// Finds the left-right distance between two longitudes.\n// This is almost the same as (lambda1 - lambda0 + 360°) % 360°, except that we want\n// the distance between ±180° to be 360°.\nfunction angle(lambda0, lambda1) {\n return (lambda1 -= lambda0) < 0 ? lambda1 + 360 : lambda1;\n}\n\nfunction rangeCompare(a, b) {\n return a[0] - b[0];\n}\n\nfunction rangeContains(range, x) {\n return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x;\n}\n\nfunction bounds(feature) {\n var i, n, a, b, merged, deltaMax, delta;\n\n phi1 = lambda1 = -(lambda0$1 = phi0 = Infinity);\n ranges = [];\n geoStream(feature, boundsStream);\n\n // First, sort ranges by their minimum longitudes.\n if (n = ranges.length) {\n ranges.sort(rangeCompare);\n\n // Then, merge any ranges that overlap.\n for (i = 1, a = ranges[0], merged = [a]; i < n; ++i) {\n b = ranges[i];\n if (rangeContains(a, b[0]) || rangeContains(a, b[1])) {\n if (angle(a[0], b[1]) > angle(a[0], a[1])) a[1] = b[1];\n if (angle(b[0], a[1]) > angle(a[0], a[1])) a[0] = b[0];\n } else {\n merged.push(a = b);\n }\n }\n\n // Finally, find the largest gap between the merged ranges.\n // The final bounding box will be the inverse of this gap.\n for (deltaMax = -Infinity, n = merged.length - 1, i = 0, a = merged[n]; i <= n; a = b, ++i) {\n b = merged[i];\n if ((delta = angle(a[1], b[0])) > deltaMax) deltaMax = delta, lambda0$1 = b[0], lambda1 = a[1];\n }\n }\n\n ranges = range = null;\n\n return lambda0$1 === Infinity || phi0 === Infinity\n ? [[NaN, NaN], [NaN, NaN]]\n : [[lambda0$1, phi0], [lambda1, phi1]];\n}\n\nvar W0, W1,\n X0, Y0, Z0,\n X1, Y1, Z1,\n X2, Y2, Z2,\n lambda00$2, phi00$2, // first point\n x0, y0, z0; // previous point\n\nvar centroidStream = {\n sphere: noop,\n point: centroidPoint,\n lineStart: centroidLineStart,\n lineEnd: centroidLineEnd,\n polygonStart: function() {\n centroidStream.lineStart = centroidRingStart;\n centroidStream.lineEnd = centroidRingEnd;\n },\n polygonEnd: function() {\n centroidStream.lineStart = centroidLineStart;\n centroidStream.lineEnd = centroidLineEnd;\n }\n};\n\n// Arithmetic mean of Cartesian vectors.\nfunction centroidPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi);\n centroidPointCartesian(cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi));\n}\n\nfunction centroidPointCartesian(x, y, z) {\n ++W0;\n X0 += (x - X0) / W0;\n Y0 += (y - Y0) / W0;\n Z0 += (z - Z0) / W0;\n}\n\nfunction centroidLineStart() {\n centroidStream.point = centroidLinePointFirst;\n}\n\nfunction centroidLinePointFirst(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi);\n x0 = cosPhi * cos(lambda);\n y0 = cosPhi * sin(lambda);\n z0 = sin(phi);\n centroidStream.point = centroidLinePoint;\n centroidPointCartesian(x0, y0, z0);\n}\n\nfunction centroidLinePoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi),\n x = cosPhi * cos(lambda),\n y = cosPhi * sin(lambda),\n z = sin(phi),\n w = atan2(sqrt((w = y0 * z - z0 * y) * w + (w = z0 * x - x0 * z) * w + (w = x0 * y - y0 * x) * w), x0 * x + y0 * y + z0 * z);\n W1 += w;\n X1 += w * (x0 + (x0 = x));\n Y1 += w * (y0 + (y0 = y));\n Z1 += w * (z0 + (z0 = z));\n centroidPointCartesian(x0, y0, z0);\n}\n\nfunction centroidLineEnd() {\n centroidStream.point = centroidPoint;\n}\n\n// See J. E. Brock, The Inertia Tensor for a Spherical Triangle,\n// J. Applied Mechanics 42, 239 (1975).\nfunction centroidRingStart() {\n centroidStream.point = centroidRingPointFirst;\n}\n\nfunction centroidRingEnd() {\n centroidRingPoint(lambda00$2, phi00$2);\n centroidStream.point = centroidPoint;\n}\n\nfunction centroidRingPointFirst(lambda, phi) {\n lambda00$2 = lambda, phi00$2 = phi;\n lambda *= radians, phi *= radians;\n centroidStream.point = centroidRingPoint;\n var cosPhi = cos(phi);\n x0 = cosPhi * cos(lambda);\n y0 = cosPhi * sin(lambda);\n z0 = sin(phi);\n centroidPointCartesian(x0, y0, z0);\n}\n\nfunction centroidRingPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi),\n x = cosPhi * cos(lambda),\n y = cosPhi * sin(lambda),\n z = sin(phi),\n cx = y0 * z - z0 * y,\n cy = z0 * x - x0 * z,\n cz = x0 * y - y0 * x,\n m = hypot(cx, cy, cz),\n w = asin(m), // line weight = angle\n v = m && -w / m; // area weight multiplier\n X2.add(v * cx);\n Y2.add(v * cy);\n Z2.add(v * cz);\n W1 += w;\n X1 += w * (x0 + (x0 = x));\n Y1 += w * (y0 + (y0 = y));\n Z1 += w * (z0 + (z0 = z));\n centroidPointCartesian(x0, y0, z0);\n}\n\nfunction centroid(object) {\n W0 = W1 =\n X0 = Y0 = Z0 =\n X1 = Y1 = Z1 = 0;\n X2 = new d3Array.Adder();\n Y2 = new d3Array.Adder();\n Z2 = new d3Array.Adder();\n geoStream(object, centroidStream);\n\n var x = +X2,\n y = +Y2,\n z = +Z2,\n m = hypot(x, y, z);\n\n // If the area-weighted ccentroid is undefined, fall back to length-weighted ccentroid.\n if (m < epsilon2) {\n x = X1, y = Y1, z = Z1;\n // If the feature has zero length, fall back to arithmetic mean of point vectors.\n if (W1 < epsilon) x = X0, y = Y0, z = Z0;\n m = hypot(x, y, z);\n // If the feature still has an undefined ccentroid, then return.\n if (m < epsilon2) return [NaN, NaN];\n }\n\n return [atan2(y, x) * degrees, asin(z / m) * degrees];\n}\n\nfunction constant(x) {\n return function() {\n return x;\n };\n}\n\nfunction compose(a, b) {\n\n function compose(x, y) {\n return x = a(x, y), b(x[0], x[1]);\n }\n\n if (a.invert && b.invert) compose.invert = function(x, y) {\n return x = b.invert(x, y), x && a.invert(x[0], x[1]);\n };\n\n return compose;\n}\n\nfunction rotationIdentity(lambda, phi) {\n return [abs(lambda) > pi ? lambda + Math.round(-lambda / tau) * tau : lambda, phi];\n}\n\nrotationIdentity.invert = rotationIdentity;\n\nfunction rotateRadians(deltaLambda, deltaPhi, deltaGamma) {\n return (deltaLambda %= tau) ? (deltaPhi || deltaGamma ? compose(rotationLambda(deltaLambda), rotationPhiGamma(deltaPhi, deltaGamma))\n : rotationLambda(deltaLambda))\n : (deltaPhi || deltaGamma ? rotationPhiGamma(deltaPhi, deltaGamma)\n : rotationIdentity);\n}\n\nfunction forwardRotationLambda(deltaLambda) {\n return function(lambda, phi) {\n return lambda += deltaLambda, [lambda > pi ? lambda - tau : lambda < -pi ? lambda + tau : lambda, phi];\n };\n}\n\nfunction rotationLambda(deltaLambda) {\n var rotation = forwardRotationLambda(deltaLambda);\n rotation.invert = forwardRotationLambda(-deltaLambda);\n return rotation;\n}\n\nfunction rotationPhiGamma(deltaPhi, deltaGamma) {\n var cosDeltaPhi = cos(deltaPhi),\n sinDeltaPhi = sin(deltaPhi),\n cosDeltaGamma = cos(deltaGamma),\n sinDeltaGamma = sin(deltaGamma);\n\n function rotation(lambda, phi) {\n var cosPhi = cos(phi),\n x = cos(lambda) * cosPhi,\n y = sin(lambda) * cosPhi,\n z = sin(phi),\n k = z * cosDeltaPhi + x * sinDeltaPhi;\n return [\n atan2(y * cosDeltaGamma - k * sinDeltaGamma, x * cosDeltaPhi - z * sinDeltaPhi),\n asin(k * cosDeltaGamma + y * sinDeltaGamma)\n ];\n }\n\n rotation.invert = function(lambda, phi) {\n var cosPhi = cos(phi),\n x = cos(lambda) * cosPhi,\n y = sin(lambda) * cosPhi,\n z = sin(phi),\n k = z * cosDeltaGamma - y * sinDeltaGamma;\n return [\n atan2(y * cosDeltaGamma + z * sinDeltaGamma, x * cosDeltaPhi + k * sinDeltaPhi),\n asin(k * cosDeltaPhi - x * sinDeltaPhi)\n ];\n };\n\n return rotation;\n}\n\nfunction rotation(rotate) {\n rotate = rotateRadians(rotate[0] * radians, rotate[1] * radians, rotate.length > 2 ? rotate[2] * radians : 0);\n\n function forward(coordinates) {\n coordinates = rotate(coordinates[0] * radians, coordinates[1] * radians);\n return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;\n }\n\n forward.invert = function(coordinates) {\n coordinates = rotate.invert(coordinates[0] * radians, coordinates[1] * radians);\n return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;\n };\n\n return forward;\n}\n\n// Generates a circle centered at [0°, 0°], with a given radius and precision.\nfunction circleStream(stream, radius, delta, direction, t0, t1) {\n if (!delta) return;\n var cosRadius = cos(radius),\n sinRadius = sin(radius),\n step = direction * delta;\n if (t0 == null) {\n t0 = radius + direction * tau;\n t1 = radius - step / 2;\n } else {\n t0 = circleRadius(cosRadius, t0);\n t1 = circleRadius(cosRadius, t1);\n if (direction > 0 ? t0 < t1 : t0 > t1) t0 += direction * tau;\n }\n for (var point, t = t0; direction > 0 ? t > t1 : t < t1; t -= step) {\n point = spherical([cosRadius, -sinRadius * cos(t), -sinRadius * sin(t)]);\n stream.point(point[0], point[1]);\n }\n}\n\n// Returns the signed angle of a cartesian point relative to [cosRadius, 0, 0].\nfunction circleRadius(cosRadius, point) {\n point = cartesian(point), point[0] -= cosRadius;\n cartesianNormalizeInPlace(point);\n var radius = acos(-point[1]);\n return ((-point[2] < 0 ? -radius : radius) + tau - epsilon) % tau;\n}\n\nfunction circle() {\n var center = constant([0, 0]),\n radius = constant(90),\n precision = constant(6),\n ring,\n rotate,\n stream = {point: point};\n\n function point(x, y) {\n ring.push(x = rotate(x, y));\n x[0] *= degrees, x[1] *= degrees;\n }\n\n function circle() {\n var c = center.apply(this, arguments),\n r = radius.apply(this, arguments) * radians,\n p = precision.apply(this, arguments) * radians;\n ring = [];\n rotate = rotateRadians(-c[0] * radians, -c[1] * radians, 0).invert;\n circleStream(stream, r, p, 1);\n c = {type: \"Polygon\", coordinates: [ring]};\n ring = rotate = null;\n return c;\n }\n\n circle.center = function(_) {\n return arguments.length ? (center = typeof _ === \"function\" ? _ : constant([+_[0], +_[1]]), circle) : center;\n };\n\n circle.radius = function(_) {\n return arguments.length ? (radius = typeof _ === \"function\" ? _ : constant(+_), circle) : radius;\n };\n\n circle.precision = function(_) {\n return arguments.length ? (precision = typeof _ === \"function\" ? _ : constant(+_), circle) : precision;\n };\n\n return circle;\n}\n\nfunction clipBuffer() {\n var lines = [],\n line;\n return {\n point: function(x, y, m) {\n line.push([x, y, m]);\n },\n lineStart: function() {\n lines.push(line = []);\n },\n lineEnd: noop,\n rejoin: function() {\n if (lines.length > 1) lines.push(lines.pop().concat(lines.shift()));\n },\n result: function() {\n var result = lines;\n lines = [];\n line = null;\n return result;\n }\n };\n}\n\nfunction pointEqual(a, b) {\n return abs(a[0] - b[0]) < epsilon && abs(a[1] - b[1]) < epsilon;\n}\n\nfunction Intersection(point, points, other, entry) {\n this.x = point;\n this.z = points;\n this.o = other; // another intersection\n this.e = entry; // is an entry?\n this.v = false; // visited\n this.n = this.p = null; // next & previous\n}\n\n// A generalized polygon clipping algorithm: given a polygon that has been cut\n// into its visible line segments, and rejoins the segments by interpolating\n// along the clip edge.\nfunction clipRejoin(segments, compareIntersection, startInside, interpolate, stream) {\n var subject = [],\n clip = [],\n i,\n n;\n\n segments.forEach(function(segment) {\n if ((n = segment.length - 1) <= 0) return;\n var n, p0 = segment[0], p1 = segment[n], x;\n\n if (pointEqual(p0, p1)) {\n if (!p0[2] && !p1[2]) {\n stream.lineStart();\n for (i = 0; i < n; ++i) stream.point((p0 = segment[i])[0], p0[1]);\n stream.lineEnd();\n return;\n }\n // handle degenerate cases by moving the point\n p1[0] += 2 * epsilon;\n }\n\n subject.push(x = new Intersection(p0, segment, null, true));\n clip.push(x.o = new Intersection(p0, null, x, false));\n subject.push(x = new Intersection(p1, segment, null, false));\n clip.push(x.o = new Intersection(p1, null, x, true));\n });\n\n if (!subject.length) return;\n\n clip.sort(compareIntersection);\n link(subject);\n link(clip);\n\n for (i = 0, n = clip.length; i < n; ++i) {\n clip[i].e = startInside = !startInside;\n }\n\n var start = subject[0],\n points,\n point;\n\n while (1) {\n // Find first unvisited intersection.\n var current = start,\n isSubject = true;\n while (current.v) if ((current = current.n) === start) return;\n points = current.z;\n stream.lineStart();\n do {\n current.v = current.o.v = true;\n if (current.e) {\n if (isSubject) {\n for (i = 0, n = points.length; i < n; ++i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.n.x, 1, stream);\n }\n current = current.n;\n } else {\n if (isSubject) {\n points = current.p.z;\n for (i = points.length - 1; i >= 0; --i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.p.x, -1, stream);\n }\n current = current.p;\n }\n current = current.o;\n points = current.z;\n isSubject = !isSubject;\n } while (!current.v);\n stream.lineEnd();\n }\n}\n\nfunction link(array) {\n if (!(n = array.length)) return;\n var n,\n i = 0,\n a = array[0],\n b;\n while (++i < n) {\n a.n = b = array[i];\n b.p = a;\n a = b;\n }\n a.n = b = array[0];\n b.p = a;\n}\n\nfunction longitude(point) {\n if (abs(point[0]) <= pi)\n return point[0];\n else\n return sign(point[0]) * ((abs(point[0]) + pi) % tau - pi);\n}\n\nfunction polygonContains(polygon, point) {\n var lambda = longitude(point),\n phi = point[1],\n sinPhi = sin(phi),\n normal = [sin(lambda), -cos(lambda), 0],\n angle = 0,\n winding = 0;\n\n var sum = new d3Array.Adder();\n\n if (sinPhi === 1) phi = halfPi + epsilon;\n else if (sinPhi === -1) phi = -halfPi - epsilon;\n\n for (var i = 0, n = polygon.length; i < n; ++i) {\n if (!(m = (ring = polygon[i]).length)) continue;\n var ring,\n m,\n point0 = ring[m - 1],\n lambda0 = longitude(point0),\n phi0 = point0[1] / 2 + quarterPi,\n sinPhi0 = sin(phi0),\n cosPhi0 = cos(phi0);\n\n for (var j = 0; j < m; ++j, lambda0 = lambda1, sinPhi0 = sinPhi1, cosPhi0 = cosPhi1, point0 = point1) {\n var point1 = ring[j],\n lambda1 = longitude(point1),\n phi1 = point1[1] / 2 + quarterPi,\n sinPhi1 = sin(phi1),\n cosPhi1 = cos(phi1),\n delta = lambda1 - lambda0,\n sign = delta >= 0 ? 1 : -1,\n absDelta = sign * delta,\n antimeridian = absDelta > pi,\n k = sinPhi0 * sinPhi1;\n\n sum.add(atan2(k * sign * sin(absDelta), cosPhi0 * cosPhi1 + k * cos(absDelta)));\n angle += antimeridian ? delta + sign * tau : delta;\n\n // Are the longitudes either side of the point’s meridian (lambda),\n // and are the latitudes smaller than the parallel (phi)?\n if (antimeridian ^ lambda0 >= lambda ^ lambda1 >= lambda) {\n var arc = cartesianCross(cartesian(point0), cartesian(point1));\n cartesianNormalizeInPlace(arc);\n var intersection = cartesianCross(normal, arc);\n cartesianNormalizeInPlace(intersection);\n var phiArc = (antimeridian ^ delta >= 0 ? -1 : 1) * asin(intersection[2]);\n if (phi > phiArc || phi === phiArc && (arc[0] || arc[1])) {\n winding += antimeridian ^ delta >= 0 ? 1 : -1;\n }\n }\n }\n }\n\n // First, determine whether the South pole is inside or outside:\n //\n // It is inside if:\n // * the polygon winds around it in a clockwise direction.\n // * the polygon does not (cumulatively) wind around it, but has a negative\n // (counter-clockwise) area.\n //\n // Second, count the (signed) number of times a segment crosses a lambda\n // from the point to the South pole. If it is zero, then the point is the\n // same side as the South pole.\n\n return (angle < -epsilon || angle < epsilon && sum < -epsilon2) ^ (winding & 1);\n}\n\nfunction clip(pointVisible, clipLine, interpolate, start) {\n return function(sink) {\n var line = clipLine(sink),\n ringBuffer = clipBuffer(),\n ringSink = clipLine(ringBuffer),\n polygonStarted = false,\n polygon,\n segments,\n ring;\n\n var clip = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: function() {\n clip.point = pointRing;\n clip.lineStart = ringStart;\n clip.lineEnd = ringEnd;\n segments = [];\n polygon = [];\n },\n polygonEnd: function() {\n clip.point = point;\n clip.lineStart = lineStart;\n clip.lineEnd = lineEnd;\n segments = d3Array.merge(segments);\n var startInside = polygonContains(polygon, start);\n if (segments.length) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n clipRejoin(segments, compareIntersection, startInside, interpolate, sink);\n } else if (startInside) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n sink.lineStart();\n interpolate(null, null, 1, sink);\n sink.lineEnd();\n }\n if (polygonStarted) sink.polygonEnd(), polygonStarted = false;\n segments = polygon = null;\n },\n sphere: function() {\n sink.polygonStart();\n sink.lineStart();\n interpolate(null, null, 1, sink);\n sink.lineEnd();\n sink.polygonEnd();\n }\n };\n\n function point(lambda, phi) {\n if (pointVisible(lambda, phi)) sink.point(lambda, phi);\n }\n\n function pointLine(lambda, phi) {\n line.point(lambda, phi);\n }\n\n function lineStart() {\n clip.point = pointLine;\n line.lineStart();\n }\n\n function lineEnd() {\n clip.point = point;\n line.lineEnd();\n }\n\n function pointRing(lambda, phi) {\n ring.push([lambda, phi]);\n ringSink.point(lambda, phi);\n }\n\n function ringStart() {\n ringSink.lineStart();\n ring = [];\n }\n\n function ringEnd() {\n pointRing(ring[0][0], ring[0][1]);\n ringSink.lineEnd();\n\n var clean = ringSink.clean(),\n ringSegments = ringBuffer.result(),\n i, n = ringSegments.length, m,\n segment,\n point;\n\n ring.pop();\n polygon.push(ring);\n ring = null;\n\n if (!n) return;\n\n // No intersections.\n if (clean & 1) {\n segment = ringSegments[0];\n if ((m = segment.length - 1) > 0) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n sink.lineStart();\n for (i = 0; i < m; ++i) sink.point((point = segment[i])[0], point[1]);\n sink.lineEnd();\n }\n return;\n }\n\n // Rejoin connected segments.\n // TODO reuse ringBuffer.rejoin()?\n if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));\n\n segments.push(ringSegments.filter(validSegment));\n }\n\n return clip;\n };\n}\n\nfunction validSegment(segment) {\n return segment.length > 1;\n}\n\n// Intersections are sorted along the clip edge. For both antimeridian cutting\n// and circle clipping, the same comparison is used.\nfunction compareIntersection(a, b) {\n return ((a = a.x)[0] < 0 ? a[1] - halfPi - epsilon : halfPi - a[1])\n - ((b = b.x)[0] < 0 ? b[1] - halfPi - epsilon : halfPi - b[1]);\n}\n\nvar clipAntimeridian = clip(\n function() { return true; },\n clipAntimeridianLine,\n clipAntimeridianInterpolate,\n [-pi, -halfPi]\n);\n\n// Takes a line and cuts into visible segments. Return values: 0 - there were\n// intersections or the line was empty; 1 - no intersections; 2 - there were\n// intersections, and the first and last segments should be rejoined.\nfunction clipAntimeridianLine(stream) {\n var lambda0 = NaN,\n phi0 = NaN,\n sign0 = NaN,\n clean; // no intersections\n\n return {\n lineStart: function() {\n stream.lineStart();\n clean = 1;\n },\n point: function(lambda1, phi1) {\n var sign1 = lambda1 > 0 ? pi : -pi,\n delta = abs(lambda1 - lambda0);\n if (abs(delta - pi) < epsilon) { // line crosses a pole\n stream.point(lambda0, phi0 = (phi0 + phi1) / 2 > 0 ? halfPi : -halfPi);\n stream.point(sign0, phi0);\n stream.lineEnd();\n stream.lineStart();\n stream.point(sign1, phi0);\n stream.point(lambda1, phi0);\n clean = 0;\n } else if (sign0 !== sign1 && delta >= pi) { // line crosses antimeridian\n if (abs(lambda0 - sign0) < epsilon) lambda0 -= sign0 * epsilon; // handle degeneracies\n if (abs(lambda1 - sign1) < epsilon) lambda1 -= sign1 * epsilon;\n phi0 = clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1);\n stream.point(sign0, phi0);\n stream.lineEnd();\n stream.lineStart();\n stream.point(sign1, phi0);\n clean = 0;\n }\n stream.point(lambda0 = lambda1, phi0 = phi1);\n sign0 = sign1;\n },\n lineEnd: function() {\n stream.lineEnd();\n lambda0 = phi0 = NaN;\n },\n clean: function() {\n return 2 - clean; // if intersections, rejoin first and last segments\n }\n };\n}\n\nfunction clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1) {\n var cosPhi0,\n cosPhi1,\n sinLambda0Lambda1 = sin(lambda0 - lambda1);\n return abs(sinLambda0Lambda1) > epsilon\n ? atan((sin(phi0) * (cosPhi1 = cos(phi1)) * sin(lambda1)\n - sin(phi1) * (cosPhi0 = cos(phi0)) * sin(lambda0))\n / (cosPhi0 * cosPhi1 * sinLambda0Lambda1))\n : (phi0 + phi1) / 2;\n}\n\nfunction clipAntimeridianInterpolate(from, to, direction, stream) {\n var phi;\n if (from == null) {\n phi = direction * halfPi;\n stream.point(-pi, phi);\n stream.point(0, phi);\n stream.point(pi, phi);\n stream.point(pi, 0);\n stream.point(pi, -phi);\n stream.point(0, -phi);\n stream.point(-pi, -phi);\n stream.point(-pi, 0);\n stream.point(-pi, phi);\n } else if (abs(from[0] - to[0]) > epsilon) {\n var lambda = from[0] < to[0] ? pi : -pi;\n phi = direction * lambda / 2;\n stream.point(-lambda, phi);\n stream.point(0, phi);\n stream.point(lambda, phi);\n } else {\n stream.point(to[0], to[1]);\n }\n}\n\nfunction clipCircle(radius) {\n var cr = cos(radius),\n delta = 6 * radians,\n smallRadius = cr > 0,\n notHemisphere = abs(cr) > epsilon; // TODO optimise for this common case\n\n function interpolate(from, to, direction, stream) {\n circleStream(stream, radius, delta, direction, from, to);\n }\n\n function visible(lambda, phi) {\n return cos(lambda) * cos(phi) > cr;\n }\n\n // Takes a line and cuts into visible segments. Return values used for polygon\n // clipping: 0 - there were intersections or the line was empty; 1 - no\n // intersections 2 - there were intersections, and the first and last segments\n // should be rejoined.\n function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2))\n point1[2] = 1;\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1], 2);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1], 3);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }\n\n // Intersects the great circle between a and b with the clip circle.\n function intersect(a, b, two) {\n var pa = cartesian(a),\n pb = cartesian(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0], // normal\n n2 = cartesianCross(pa, pb),\n n2n2 = cartesianDot(n2, n2),\n n1n2 = n2[0], // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = cartesianCross(n1, n2),\n A = cartesianScale(n1, c1),\n B = cartesianScale(n2, c2);\n cartesianAddInPlace(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = cartesianDot(A, u),\n uu = cartesianDot(u, u),\n t2 = w * w - uu * (cartesianDot(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = sqrt(t2),\n q = cartesianScale(u, (-w - t) / uu);\n cartesianAddInPlace(q, A);\n q = spherical(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = abs(delta - pi) < epsilon,\n meridian = polar || delta < epsilon;\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian\n ? polar\n ? phi0 + phi1 > 0 ^ q[1] < (abs(q[0] - lambda0) < epsilon ? phi0 : phi1)\n : phi0 <= q[1] && q[1] <= phi1\n : delta > pi ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = cartesianScale(u, (-w + t) / uu);\n cartesianAddInPlace(q1, A);\n return [q, spherical(q1)];\n }\n }\n\n // Generates a 4-bit vector representing the location of a point relative to\n // the small circle's bounding box.\n function code(lambda, phi) {\n var r = smallRadius ? radius : pi - radius,\n code = 0;\n if (lambda < -r) code |= 1; // left\n else if (lambda > r) code |= 2; // right\n if (phi < -r) code |= 4; // below\n else if (phi > r) code |= 8; // above\n return code;\n }\n\n return clip(visible, clipLine, interpolate, smallRadius ? [0, -radius] : [-pi, radius - pi]);\n}\n\nfunction clipLine(a, b, x0, y0, x1, y1) {\n var ax = a[0],\n ay = a[1],\n bx = b[0],\n by = b[1],\n t0 = 0,\n t1 = 1,\n dx = bx - ax,\n dy = by - ay,\n r;\n\n r = x0 - ax;\n if (!dx && r > 0) return;\n r /= dx;\n if (dx < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dx > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = x1 - ax;\n if (!dx && r < 0) return;\n r /= dx;\n if (dx < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dx > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n r = y0 - ay;\n if (!dy && r > 0) return;\n r /= dy;\n if (dy < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dy > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = y1 - ay;\n if (!dy && r < 0) return;\n r /= dy;\n if (dy < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dy > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n if (t0 > 0) a[0] = ax + t0 * dx, a[1] = ay + t0 * dy;\n if (t1 < 1) b[0] = ax + t1 * dx, b[1] = ay + t1 * dy;\n return true;\n}\n\nvar clipMax = 1e9, clipMin = -clipMax;\n\n// TODO Use d3-polygon’s polygonContains here for the ring check?\n// TODO Eliminate duplicate buffering in clipBuffer and polygon.push?\n\nfunction clipRectangle(x0, y0, x1, y1) {\n\n function visible(x, y) {\n return x0 <= x && x <= x1 && y0 <= y && y <= y1;\n }\n\n function interpolate(from, to, direction, stream) {\n var a = 0, a1 = 0;\n if (from == null\n || (a = corner(from, direction)) !== (a1 = corner(to, direction))\n || comparePoint(from, to) < 0 ^ direction > 0) {\n do stream.point(a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0);\n while ((a = (a + direction + 4) % 4) !== a1);\n } else {\n stream.point(to[0], to[1]);\n }\n }\n\n function corner(p, direction) {\n return abs(p[0] - x0) < epsilon ? direction > 0 ? 0 : 3\n : abs(p[0] - x1) < epsilon ? direction > 0 ? 2 : 1\n : abs(p[1] - y0) < epsilon ? direction > 0 ? 1 : 0\n : direction > 0 ? 3 : 2; // abs(p[1] - y1) < epsilon\n }\n\n function compareIntersection(a, b) {\n return comparePoint(a.x, b.x);\n }\n\n function comparePoint(a, b) {\n var ca = corner(a, 1),\n cb = corner(b, 1);\n return ca !== cb ? ca - cb\n : ca === 0 ? b[1] - a[1]\n : ca === 1 ? a[0] - b[0]\n : ca === 2 ? a[1] - b[1]\n : b[0] - a[0];\n }\n\n return function(stream) {\n var activeStream = stream,\n bufferStream = clipBuffer(),\n segments,\n polygon,\n ring,\n x__, y__, v__, // first point\n x_, y_, v_, // previous point\n first,\n clean;\n\n var clipStream = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: polygonStart,\n polygonEnd: polygonEnd\n };\n\n function point(x, y) {\n if (visible(x, y)) activeStream.point(x, y);\n }\n\n function polygonInside() {\n var winding = 0;\n\n for (var i = 0, n = polygon.length; i < n; ++i) {\n for (var ring = polygon[i], j = 1, m = ring.length, point = ring[0], a0, a1, b0 = point[0], b1 = point[1]; j < m; ++j) {\n a0 = b0, a1 = b1, point = ring[j], b0 = point[0], b1 = point[1];\n if (a1 <= y1) { if (b1 > y1 && (b0 - a0) * (y1 - a1) > (b1 - a1) * (x0 - a0)) ++winding; }\n else { if (b1 <= y1 && (b0 - a0) * (y1 - a1) < (b1 - a1) * (x0 - a0)) --winding; }\n }\n }\n\n return winding;\n }\n\n // Buffer geometry within a polygon and then clip it en masse.\n function polygonStart() {\n activeStream = bufferStream, segments = [], polygon = [], clean = true;\n }\n\n function polygonEnd() {\n var startInside = polygonInside(),\n cleanInside = clean && startInside,\n visible = (segments = d3Array.merge(segments)).length;\n if (cleanInside || visible) {\n stream.polygonStart();\n if (cleanInside) {\n stream.lineStart();\n interpolate(null, null, 1, stream);\n stream.lineEnd();\n }\n if (visible) {\n clipRejoin(segments, compareIntersection, startInside, interpolate, stream);\n }\n stream.polygonEnd();\n }\n activeStream = stream, segments = polygon = ring = null;\n }\n\n function lineStart() {\n clipStream.point = linePoint;\n if (polygon) polygon.push(ring = []);\n first = true;\n v_ = false;\n x_ = y_ = NaN;\n }\n\n // TODO rather than special-case polygons, simply handle them separately.\n // Ideally, coincident intersection points should be jittered to avoid\n // clipping issues.\n function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }\n\n function linePoint(x, y) {\n var v = visible(x, y);\n if (polygon) ring.push([x, y]);\n if (first) {\n x__ = x, y__ = y, v__ = v;\n first = false;\n if (v) {\n activeStream.lineStart();\n activeStream.point(x, y);\n }\n } else {\n if (v && v_) activeStream.point(x, y);\n else {\n var a = [x_ = Math.max(clipMin, Math.min(clipMax, x_)), y_ = Math.max(clipMin, Math.min(clipMax, y_))],\n b = [x = Math.max(clipMin, Math.min(clipMax, x)), y = Math.max(clipMin, Math.min(clipMax, y))];\n if (clipLine(a, b, x0, y0, x1, y1)) {\n if (!v_) {\n activeStream.lineStart();\n activeStream.point(a[0], a[1]);\n }\n activeStream.point(b[0], b[1]);\n if (!v) activeStream.lineEnd();\n clean = false;\n } else if (v) {\n activeStream.lineStart();\n activeStream.point(x, y);\n clean = false;\n }\n }\n }\n x_ = x, y_ = y, v_ = v;\n }\n\n return clipStream;\n };\n}\n\nfunction extent() {\n var x0 = 0,\n y0 = 0,\n x1 = 960,\n y1 = 500,\n cache,\n cacheStream,\n clip;\n\n return clip = {\n stream: function(stream) {\n return cache && cacheStream === stream ? cache : cache = clipRectangle(x0, y0, x1, y1)(cacheStream = stream);\n },\n extent: function(_) {\n return arguments.length ? (x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1], cache = cacheStream = null, clip) : [[x0, y0], [x1, y1]];\n }\n };\n}\n\nvar lengthSum,\n lambda0$2,\n sinPhi0$1,\n cosPhi0$1;\n\nvar lengthStream = {\n sphere: noop,\n point: noop,\n lineStart: lengthLineStart,\n lineEnd: noop,\n polygonStart: noop,\n polygonEnd: noop\n};\n\nfunction lengthLineStart() {\n lengthStream.point = lengthPointFirst;\n lengthStream.lineEnd = lengthLineEnd;\n}\n\nfunction lengthLineEnd() {\n lengthStream.point = lengthStream.lineEnd = noop;\n}\n\nfunction lengthPointFirst(lambda, phi) {\n lambda *= radians, phi *= radians;\n lambda0$2 = lambda, sinPhi0$1 = sin(phi), cosPhi0$1 = cos(phi);\n lengthStream.point = lengthPoint;\n}\n\nfunction lengthPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var sinPhi = sin(phi),\n cosPhi = cos(phi),\n delta = abs(lambda - lambda0$2),\n cosDelta = cos(delta),\n sinDelta = sin(delta),\n x = cosPhi * sinDelta,\n y = cosPhi0$1 * sinPhi - sinPhi0$1 * cosPhi * cosDelta,\n z = sinPhi0$1 * sinPhi + cosPhi0$1 * cosPhi * cosDelta;\n lengthSum.add(atan2(sqrt(x * x + y * y), z));\n lambda0$2 = lambda, sinPhi0$1 = sinPhi, cosPhi0$1 = cosPhi;\n}\n\nfunction length(object) {\n lengthSum = new d3Array.Adder();\n geoStream(object, lengthStream);\n return +lengthSum;\n}\n\nvar coordinates = [null, null],\n object = {type: \"LineString\", coordinates: coordinates};\n\nfunction distance(a, b) {\n coordinates[0] = a;\n coordinates[1] = b;\n return length(object);\n}\n\nvar containsObjectType = {\n Feature: function(object, point) {\n return containsGeometry(object.geometry, point);\n },\n FeatureCollection: function(object, point) {\n var features = object.features, i = -1, n = features.length;\n while (++i < n) if (containsGeometry(features[i].geometry, point)) return true;\n return false;\n }\n};\n\nvar containsGeometryType = {\n Sphere: function() {\n return true;\n },\n Point: function(object, point) {\n return containsPoint(object.coordinates, point);\n },\n MultiPoint: function(object, point) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) if (containsPoint(coordinates[i], point)) return true;\n return false;\n },\n LineString: function(object, point) {\n return containsLine(object.coordinates, point);\n },\n MultiLineString: function(object, point) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) if (containsLine(coordinates[i], point)) return true;\n return false;\n },\n Polygon: function(object, point) {\n return containsPolygon(object.coordinates, point);\n },\n MultiPolygon: function(object, point) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) if (containsPolygon(coordinates[i], point)) return true;\n return false;\n },\n GeometryCollection: function(object, point) {\n var geometries = object.geometries, i = -1, n = geometries.length;\n while (++i < n) if (containsGeometry(geometries[i], point)) return true;\n return false;\n }\n};\n\nfunction containsGeometry(geometry, point) {\n return geometry && containsGeometryType.hasOwnProperty(geometry.type)\n ? containsGeometryType[geometry.type](geometry, point)\n : false;\n}\n\nfunction containsPoint(coordinates, point) {\n return distance(coordinates, point) === 0;\n}\n\nfunction containsLine(coordinates, point) {\n var ao, bo, ab;\n for (var i = 0, n = coordinates.length; i < n; i++) {\n bo = distance(coordinates[i], point);\n if (bo === 0) return true;\n if (i > 0) {\n ab = distance(coordinates[i], coordinates[i - 1]);\n if (\n ab > 0 &&\n ao <= ab &&\n bo <= ab &&\n (ao + bo - ab) * (1 - Math.pow((ao - bo) / ab, 2)) < epsilon2 * ab\n )\n return true;\n }\n ao = bo;\n }\n return false;\n}\n\nfunction containsPolygon(coordinates, point) {\n return !!polygonContains(coordinates.map(ringRadians), pointRadians(point));\n}\n\nfunction ringRadians(ring) {\n return ring = ring.map(pointRadians), ring.pop(), ring;\n}\n\nfunction pointRadians(point) {\n return [point[0] * radians, point[1] * radians];\n}\n\nfunction contains(object, point) {\n return (object && containsObjectType.hasOwnProperty(object.type)\n ? containsObjectType[object.type]\n : containsGeometry)(object, point);\n}\n\nfunction graticuleX(y0, y1, dy) {\n var y = d3Array.range(y0, y1 - epsilon, dy).concat(y1);\n return function(x) { return y.map(function(y) { return [x, y]; }); };\n}\n\nfunction graticuleY(x0, x1, dx) {\n var x = d3Array.range(x0, x1 - epsilon, dx).concat(x1);\n return function(y) { return x.map(function(x) { return [x, y]; }); };\n}\n\nfunction graticule() {\n var x1, x0, X1, X0,\n y1, y0, Y1, Y0,\n dx = 10, dy = dx, DX = 90, DY = 360,\n x, y, X, Y,\n precision = 2.5;\n\n function graticule() {\n return {type: \"MultiLineString\", coordinates: lines()};\n }\n\n function lines() {\n return d3Array.range(ceil(X0 / DX) * DX, X1, DX).map(X)\n .concat(d3Array.range(ceil(Y0 / DY) * DY, Y1, DY).map(Y))\n .concat(d3Array.range(ceil(x0 / dx) * dx, x1, dx).filter(function(x) { return abs(x % DX) > epsilon; }).map(x))\n .concat(d3Array.range(ceil(y0 / dy) * dy, y1, dy).filter(function(y) { return abs(y % DY) > epsilon; }).map(y));\n }\n\n graticule.lines = function() {\n return lines().map(function(coordinates) { return {type: \"LineString\", coordinates: coordinates}; });\n };\n\n graticule.outline = function() {\n return {\n type: \"Polygon\",\n coordinates: [\n X(X0).concat(\n Y(Y1).slice(1),\n X(X1).reverse().slice(1),\n Y(Y0).reverse().slice(1))\n ]\n };\n };\n\n graticule.extent = function(_) {\n if (!arguments.length) return graticule.extentMinor();\n return graticule.extentMajor(_).extentMinor(_);\n };\n\n graticule.extentMajor = function(_) {\n if (!arguments.length) return [[X0, Y0], [X1, Y1]];\n X0 = +_[0][0], X1 = +_[1][0];\n Y0 = +_[0][1], Y1 = +_[1][1];\n if (X0 > X1) _ = X0, X0 = X1, X1 = _;\n if (Y0 > Y1) _ = Y0, Y0 = Y1, Y1 = _;\n return graticule.precision(precision);\n };\n\n graticule.extentMinor = function(_) {\n if (!arguments.length) return [[x0, y0], [x1, y1]];\n x0 = +_[0][0], x1 = +_[1][0];\n y0 = +_[0][1], y1 = +_[1][1];\n if (x0 > x1) _ = x0, x0 = x1, x1 = _;\n if (y0 > y1) _ = y0, y0 = y1, y1 = _;\n return graticule.precision(precision);\n };\n\n graticule.step = function(_) {\n if (!arguments.length) return graticule.stepMinor();\n return graticule.stepMajor(_).stepMinor(_);\n };\n\n graticule.stepMajor = function(_) {\n if (!arguments.length) return [DX, DY];\n DX = +_[0], DY = +_[1];\n return graticule;\n };\n\n graticule.stepMinor = function(_) {\n if (!arguments.length) return [dx, dy];\n dx = +_[0], dy = +_[1];\n return graticule;\n };\n\n graticule.precision = function(_) {\n if (!arguments.length) return precision;\n precision = +_;\n x = graticuleX(y0, y1, 90);\n y = graticuleY(x0, x1, precision);\n X = graticuleX(Y0, Y1, 90);\n Y = graticuleY(X0, X1, precision);\n return graticule;\n };\n\n return graticule\n .extentMajor([[-180, -90 + epsilon], [180, 90 - epsilon]])\n .extentMinor([[-180, -80 - epsilon], [180, 80 + epsilon]]);\n}\n\nfunction graticule10() {\n return graticule()();\n}\n\nfunction interpolate(a, b) {\n var x0 = a[0] * radians,\n y0 = a[1] * radians,\n x1 = b[0] * radians,\n y1 = b[1] * radians,\n cy0 = cos(y0),\n sy0 = sin(y0),\n cy1 = cos(y1),\n sy1 = sin(y1),\n kx0 = cy0 * cos(x0),\n ky0 = cy0 * sin(x0),\n kx1 = cy1 * cos(x1),\n ky1 = cy1 * sin(x1),\n d = 2 * asin(sqrt(haversin(y1 - y0) + cy0 * cy1 * haversin(x1 - x0))),\n k = sin(d);\n\n var interpolate = d ? function(t) {\n var B = sin(t *= d) / k,\n A = sin(d - t) / k,\n x = A * kx0 + B * kx1,\n y = A * ky0 + B * ky1,\n z = A * sy0 + B * sy1;\n return [\n atan2(y, x) * degrees,\n atan2(z, sqrt(x * x + y * y)) * degrees\n ];\n } : function() {\n return [x0 * degrees, y0 * degrees];\n };\n\n interpolate.distance = d;\n\n return interpolate;\n}\n\nvar identity = x => x;\n\nvar areaSum$1 = new d3Array.Adder(),\n areaRingSum$1 = new d3Array.Adder(),\n x00,\n y00,\n x0$1,\n y0$1;\n\nvar areaStream$1 = {\n point: noop,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: function() {\n areaStream$1.lineStart = areaRingStart$1;\n areaStream$1.lineEnd = areaRingEnd$1;\n },\n polygonEnd: function() {\n areaStream$1.lineStart = areaStream$1.lineEnd = areaStream$1.point = noop;\n areaSum$1.add(abs(areaRingSum$1));\n areaRingSum$1 = new d3Array.Adder();\n },\n result: function() {\n var area = areaSum$1 / 2;\n areaSum$1 = new d3Array.Adder();\n return area;\n }\n};\n\nfunction areaRingStart$1() {\n areaStream$1.point = areaPointFirst$1;\n}\n\nfunction areaPointFirst$1(x, y) {\n areaStream$1.point = areaPoint$1;\n x00 = x0$1 = x, y00 = y0$1 = y;\n}\n\nfunction areaPoint$1(x, y) {\n areaRingSum$1.add(y0$1 * x - x0$1 * y);\n x0$1 = x, y0$1 = y;\n}\n\nfunction areaRingEnd$1() {\n areaPoint$1(x00, y00);\n}\n\nvar x0$2 = Infinity,\n y0$2 = x0$2,\n x1 = -x0$2,\n y1 = x1;\n\nvar boundsStream$1 = {\n point: boundsPoint$1,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: noop,\n polygonEnd: noop,\n result: function() {\n var bounds = [[x0$2, y0$2], [x1, y1]];\n x1 = y1 = -(y0$2 = x0$2 = Infinity);\n return bounds;\n }\n};\n\nfunction boundsPoint$1(x, y) {\n if (x < x0$2) x0$2 = x;\n if (x > x1) x1 = x;\n if (y < y0$2) y0$2 = y;\n if (y > y1) y1 = y;\n}\n\n// TODO Enforce positive area for exterior, negative area for interior?\n\nvar X0$1 = 0,\n Y0$1 = 0,\n Z0$1 = 0,\n X1$1 = 0,\n Y1$1 = 0,\n Z1$1 = 0,\n X2$1 = 0,\n Y2$1 = 0,\n Z2$1 = 0,\n x00$1,\n y00$1,\n x0$3,\n y0$3;\n\nvar centroidStream$1 = {\n point: centroidPoint$1,\n lineStart: centroidLineStart$1,\n lineEnd: centroidLineEnd$1,\n polygonStart: function() {\n centroidStream$1.lineStart = centroidRingStart$1;\n centroidStream$1.lineEnd = centroidRingEnd$1;\n },\n polygonEnd: function() {\n centroidStream$1.point = centroidPoint$1;\n centroidStream$1.lineStart = centroidLineStart$1;\n centroidStream$1.lineEnd = centroidLineEnd$1;\n },\n result: function() {\n var centroid = Z2$1 ? [X2$1 / Z2$1, Y2$1 / Z2$1]\n : Z1$1 ? [X1$1 / Z1$1, Y1$1 / Z1$1]\n : Z0$1 ? [X0$1 / Z0$1, Y0$1 / Z0$1]\n : [NaN, NaN];\n X0$1 = Y0$1 = Z0$1 =\n X1$1 = Y1$1 = Z1$1 =\n X2$1 = Y2$1 = Z2$1 = 0;\n return centroid;\n }\n};\n\nfunction centroidPoint$1(x, y) {\n X0$1 += x;\n Y0$1 += y;\n ++Z0$1;\n}\n\nfunction centroidLineStart$1() {\n centroidStream$1.point = centroidPointFirstLine;\n}\n\nfunction centroidPointFirstLine(x, y) {\n centroidStream$1.point = centroidPointLine;\n centroidPoint$1(x0$3 = x, y0$3 = y);\n}\n\nfunction centroidPointLine(x, y) {\n var dx = x - x0$3, dy = y - y0$3, z = sqrt(dx * dx + dy * dy);\n X1$1 += z * (x0$3 + x) / 2;\n Y1$1 += z * (y0$3 + y) / 2;\n Z1$1 += z;\n centroidPoint$1(x0$3 = x, y0$3 = y);\n}\n\nfunction centroidLineEnd$1() {\n centroidStream$1.point = centroidPoint$1;\n}\n\nfunction centroidRingStart$1() {\n centroidStream$1.point = centroidPointFirstRing;\n}\n\nfunction centroidRingEnd$1() {\n centroidPointRing(x00$1, y00$1);\n}\n\nfunction centroidPointFirstRing(x, y) {\n centroidStream$1.point = centroidPointRing;\n centroidPoint$1(x00$1 = x0$3 = x, y00$1 = y0$3 = y);\n}\n\nfunction centroidPointRing(x, y) {\n var dx = x - x0$3,\n dy = y - y0$3,\n z = sqrt(dx * dx + dy * dy);\n\n X1$1 += z * (x0$3 + x) / 2;\n Y1$1 += z * (y0$3 + y) / 2;\n Z1$1 += z;\n\n z = y0$3 * x - x0$3 * y;\n X2$1 += z * (x0$3 + x);\n Y2$1 += z * (y0$3 + y);\n Z2$1 += z * 3;\n centroidPoint$1(x0$3 = x, y0$3 = y);\n}\n\nfunction PathContext(context) {\n this._context = context;\n}\n\nPathContext.prototype = {\n _radius: 4.5,\n pointRadius: function(_) {\n return this._radius = _, this;\n },\n polygonStart: function() {\n this._line = 0;\n },\n polygonEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line === 0) this._context.closePath();\n this._point = NaN;\n },\n point: function(x, y) {\n switch (this._point) {\n case 0: {\n this._context.moveTo(x, y);\n this._point = 1;\n break;\n }\n case 1: {\n this._context.lineTo(x, y);\n break;\n }\n default: {\n this._context.moveTo(x + this._radius, y);\n this._context.arc(x, y, this._radius, 0, tau);\n break;\n }\n }\n },\n result: noop\n};\n\nvar lengthSum$1 = new d3Array.Adder(),\n lengthRing,\n x00$2,\n y00$2,\n x0$4,\n y0$4;\n\nvar lengthStream$1 = {\n point: noop,\n lineStart: function() {\n lengthStream$1.point = lengthPointFirst$1;\n },\n lineEnd: function() {\n if (lengthRing) lengthPoint$1(x00$2, y00$2);\n lengthStream$1.point = noop;\n },\n polygonStart: function() {\n lengthRing = true;\n },\n polygonEnd: function() {\n lengthRing = null;\n },\n result: function() {\n var length = +lengthSum$1;\n lengthSum$1 = new d3Array.Adder();\n return length;\n }\n};\n\nfunction lengthPointFirst$1(x, y) {\n lengthStream$1.point = lengthPoint$1;\n x00$2 = x0$4 = x, y00$2 = y0$4 = y;\n}\n\nfunction lengthPoint$1(x, y) {\n x0$4 -= x, y0$4 -= y;\n lengthSum$1.add(sqrt(x0$4 * x0$4 + y0$4 * y0$4));\n x0$4 = x, y0$4 = y;\n}\n\nfunction PathString() {\n this._string = [];\n}\n\nPathString.prototype = {\n _radius: 4.5,\n _circle: circle$1(4.5),\n pointRadius: function(_) {\n if ((_ = +_) !== this._radius) this._radius = _, this._circle = null;\n return this;\n },\n polygonStart: function() {\n this._line = 0;\n },\n polygonEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line === 0) this._string.push(\"Z\");\n this._point = NaN;\n },\n point: function(x, y) {\n switch (this._point) {\n case 0: {\n this._string.push(\"M\", x, \",\", y);\n this._point = 1;\n break;\n }\n case 1: {\n this._string.push(\"L\", x, \",\", y);\n break;\n }\n default: {\n if (this._circle == null) this._circle = circle$1(this._radius);\n this._string.push(\"M\", x, \",\", y, this._circle);\n break;\n }\n }\n },\n result: function() {\n if (this._string.length) {\n var result = this._string.join(\"\");\n this._string = [];\n return result;\n } else {\n return null;\n }\n }\n};\n\nfunction circle$1(radius) {\n return \"m0,\" + radius\n + \"a\" + radius + \",\" + radius + \" 0 1,1 0,\" + -2 * radius\n + \"a\" + radius + \",\" + radius + \" 0 1,1 0,\" + 2 * radius\n + \"z\";\n}\n\nfunction index(projection, context) {\n var pointRadius = 4.5,\n projectionStream,\n contextStream;\n\n function path(object) {\n if (object) {\n if (typeof pointRadius === \"function\") contextStream.pointRadius(+pointRadius.apply(this, arguments));\n geoStream(object, projectionStream(contextStream));\n }\n return contextStream.result();\n }\n\n path.area = function(object) {\n geoStream(object, projectionStream(areaStream$1));\n return areaStream$1.result();\n };\n\n path.measure = function(object) {\n geoStream(object, projectionStream(lengthStream$1));\n return lengthStream$1.result();\n };\n\n path.bounds = function(object) {\n geoStream(object, projectionStream(boundsStream$1));\n return boundsStream$1.result();\n };\n\n path.centroid = function(object) {\n geoStream(object, projectionStream(centroidStream$1));\n return centroidStream$1.result();\n };\n\n path.projection = function(_) {\n return arguments.length ? (projectionStream = _ == null ? (projection = null, identity) : (projection = _).stream, path) : projection;\n };\n\n path.context = function(_) {\n if (!arguments.length) return context;\n contextStream = _ == null ? (context = null, new PathString) : new PathContext(context = _);\n if (typeof pointRadius !== \"function\") contextStream.pointRadius(pointRadius);\n return path;\n };\n\n path.pointRadius = function(_) {\n if (!arguments.length) return pointRadius;\n pointRadius = typeof _ === \"function\" ? _ : (contextStream.pointRadius(+_), +_);\n return path;\n };\n\n return path.projection(projection).context(context);\n}\n\nfunction transform(methods) {\n return {\n stream: transformer(methods)\n };\n}\n\nfunction transformer(methods) {\n return function(stream) {\n var s = new TransformStream;\n for (var key in methods) s[key] = methods[key];\n s.stream = stream;\n return s;\n };\n}\n\nfunction TransformStream() {}\n\nTransformStream.prototype = {\n constructor: TransformStream,\n point: function(x, y) { this.stream.point(x, y); },\n sphere: function() { this.stream.sphere(); },\n lineStart: function() { this.stream.lineStart(); },\n lineEnd: function() { this.stream.lineEnd(); },\n polygonStart: function() { this.stream.polygonStart(); },\n polygonEnd: function() { this.stream.polygonEnd(); }\n};\n\nfunction fit(projection, fitBounds, object) {\n var clip = projection.clipExtent && projection.clipExtent();\n projection.scale(150).translate([0, 0]);\n if (clip != null) projection.clipExtent(null);\n geoStream(object, projection.stream(boundsStream$1));\n fitBounds(boundsStream$1.result());\n if (clip != null) projection.clipExtent(clip);\n return projection;\n}\n\nfunction fitExtent(projection, extent, object) {\n return fit(projection, function(b) {\n var w = extent[1][0] - extent[0][0],\n h = extent[1][1] - extent[0][1],\n k = Math.min(w / (b[1][0] - b[0][0]), h / (b[1][1] - b[0][1])),\n x = +extent[0][0] + (w - k * (b[1][0] + b[0][0])) / 2,\n y = +extent[0][1] + (h - k * (b[1][1] + b[0][1])) / 2;\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n\nfunction fitSize(projection, size, object) {\n return fitExtent(projection, [[0, 0], size], object);\n}\n\nfunction fitWidth(projection, width, object) {\n return fit(projection, function(b) {\n var w = +width,\n k = w / (b[1][0] - b[0][0]),\n x = (w - k * (b[1][0] + b[0][0])) / 2,\n y = -k * b[0][1];\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n\nfunction fitHeight(projection, height, object) {\n return fit(projection, function(b) {\n var h = +height,\n k = h / (b[1][1] - b[0][1]),\n x = -k * b[0][0],\n y = (h - k * (b[1][1] + b[0][1])) / 2;\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n\nvar maxDepth = 16, // maximum depth of subdivision\n cosMinDistance = cos(30 * radians); // cos(minimum angular distance)\n\nfunction resample(project, delta2) {\n return +delta2 ? resample$1(project, delta2) : resampleNone(project);\n}\n\nfunction resampleNone(project) {\n return transformer({\n point: function(x, y) {\n x = project(x, y);\n this.stream.point(x[0], x[1]);\n }\n });\n}\n\nfunction resample$1(project, delta2) {\n\n function resampleLineTo(x0, y0, lambda0, a0, b0, c0, x1, y1, lambda1, a1, b1, c1, depth, stream) {\n var dx = x1 - x0,\n dy = y1 - y0,\n d2 = dx * dx + dy * dy;\n if (d2 > 4 * delta2 && depth--) {\n var a = a0 + a1,\n b = b0 + b1,\n c = c0 + c1,\n m = sqrt(a * a + b * b + c * c),\n phi2 = asin(c /= m),\n lambda2 = abs(abs(c) - 1) < epsilon || abs(lambda0 - lambda1) < epsilon ? (lambda0 + lambda1) / 2 : atan2(b, a),\n p = project(lambda2, phi2),\n x2 = p[0],\n y2 = p[1],\n dx2 = x2 - x0,\n dy2 = y2 - y0,\n dz = dy * dx2 - dx * dy2;\n if (dz * dz / d2 > delta2 // perpendicular projected distance\n || abs((dx * dx2 + dy * dy2) / d2 - 0.5) > 0.3 // midpoint close to an end\n || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) { // angular distance\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x2, y2, lambda2, a /= m, b /= m, c, depth, stream);\n stream.point(x2, y2);\n resampleLineTo(x2, y2, lambda2, a, b, c, x1, y1, lambda1, a1, b1, c1, depth, stream);\n }\n }\n }\n return function(stream) {\n var lambda00, x00, y00, a00, b00, c00, // first point\n lambda0, x0, y0, a0, b0, c0; // previous point\n\n var resampleStream = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: function() { stream.polygonStart(); resampleStream.lineStart = ringStart; },\n polygonEnd: function() { stream.polygonEnd(); resampleStream.lineStart = lineStart; }\n };\n\n function point(x, y) {\n x = project(x, y);\n stream.point(x[0], x[1]);\n }\n\n function lineStart() {\n x0 = NaN;\n resampleStream.point = linePoint;\n stream.lineStart();\n }\n\n function linePoint(lambda, phi) {\n var c = cartesian([lambda, phi]), p = project(lambda, phi);\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x0 = p[0], y0 = p[1], lambda0 = lambda, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream);\n stream.point(x0, y0);\n }\n\n function lineEnd() {\n resampleStream.point = point;\n stream.lineEnd();\n }\n\n function ringStart() {\n lineStart();\n resampleStream.point = ringPoint;\n resampleStream.lineEnd = ringEnd;\n }\n\n function ringPoint(lambda, phi) {\n linePoint(lambda00 = lambda, phi), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0;\n resampleStream.point = linePoint;\n }\n\n function ringEnd() {\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x00, y00, lambda00, a00, b00, c00, maxDepth, stream);\n resampleStream.lineEnd = lineEnd;\n lineEnd();\n }\n\n return resampleStream;\n };\n}\n\nvar transformRadians = transformer({\n point: function(x, y) {\n this.stream.point(x * radians, y * radians);\n }\n});\n\nfunction transformRotate(rotate) {\n return transformer({\n point: function(x, y) {\n var r = rotate(x, y);\n return this.stream.point(r[0], r[1]);\n }\n });\n}\n\nfunction scaleTranslate(k, dx, dy, sx, sy) {\n function transform(x, y) {\n x *= sx; y *= sy;\n return [dx + k * x, dy - k * y];\n }\n transform.invert = function(x, y) {\n return [(x - dx) / k * sx, (dy - y) / k * sy];\n };\n return transform;\n}\n\nfunction scaleTranslateRotate(k, dx, dy, sx, sy, alpha) {\n if (!alpha) return scaleTranslate(k, dx, dy, sx, sy);\n var cosAlpha = cos(alpha),\n sinAlpha = sin(alpha),\n a = cosAlpha * k,\n b = sinAlpha * k,\n ai = cosAlpha / k,\n bi = sinAlpha / k,\n ci = (sinAlpha * dy - cosAlpha * dx) / k,\n fi = (sinAlpha * dx + cosAlpha * dy) / k;\n function transform(x, y) {\n x *= sx; y *= sy;\n return [a * x - b * y + dx, dy - b * x - a * y];\n }\n transform.invert = function(x, y) {\n return [sx * (ai * x - bi * y + ci), sy * (fi - bi * x - ai * y)];\n };\n return transform;\n}\n\nfunction projection(project) {\n return projectionMutator(function() { return project; })();\n}\n\nfunction projectionMutator(projectAt) {\n var project,\n k = 150, // scale\n x = 480, y = 250, // translate\n lambda = 0, phi = 0, // center\n deltaLambda = 0, deltaPhi = 0, deltaGamma = 0, rotate, // pre-rotate\n alpha = 0, // post-rotate angle\n sx = 1, // reflectX\n sy = 1, // reflectX\n theta = null, preclip = clipAntimeridian, // pre-clip angle\n x0 = null, y0, x1, y1, postclip = identity, // post-clip extent\n delta2 = 0.5, // precision\n projectResample,\n projectTransform,\n projectRotateTransform,\n cache,\n cacheStream;\n\n function projection(point) {\n return projectRotateTransform(point[0] * radians, point[1] * radians);\n }\n\n function invert(point) {\n point = projectRotateTransform.invert(point[0], point[1]);\n return point && [point[0] * degrees, point[1] * degrees];\n }\n\n projection.stream = function(stream) {\n return cache && cacheStream === stream ? cache : cache = transformRadians(transformRotate(rotate)(preclip(projectResample(postclip(cacheStream = stream)))));\n };\n\n projection.preclip = function(_) {\n return arguments.length ? (preclip = _, theta = undefined, reset()) : preclip;\n };\n\n projection.postclip = function(_) {\n return arguments.length ? (postclip = _, x0 = y0 = x1 = y1 = null, reset()) : postclip;\n };\n\n projection.clipAngle = function(_) {\n return arguments.length ? (preclip = +_ ? clipCircle(theta = _ * radians) : (theta = null, clipAntimeridian), reset()) : theta * degrees;\n };\n\n projection.clipExtent = function(_) {\n return arguments.length ? (postclip = _ == null ? (x0 = y0 = x1 = y1 = null, identity) : clipRectangle(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]];\n };\n\n projection.scale = function(_) {\n return arguments.length ? (k = +_, recenter()) : k;\n };\n\n projection.translate = function(_) {\n return arguments.length ? (x = +_[0], y = +_[1], recenter()) : [x, y];\n };\n\n projection.center = function(_) {\n return arguments.length ? (lambda = _[0] % 360 * radians, phi = _[1] % 360 * radians, recenter()) : [lambda * degrees, phi * degrees];\n };\n\n projection.rotate = function(_) {\n return arguments.length ? (deltaLambda = _[0] % 360 * radians, deltaPhi = _[1] % 360 * radians, deltaGamma = _.length > 2 ? _[2] % 360 * radians : 0, recenter()) : [deltaLambda * degrees, deltaPhi * degrees, deltaGamma * degrees];\n };\n\n projection.angle = function(_) {\n return arguments.length ? (alpha = _ % 360 * radians, recenter()) : alpha * degrees;\n };\n\n projection.reflectX = function(_) {\n return arguments.length ? (sx = _ ? -1 : 1, recenter()) : sx < 0;\n };\n\n projection.reflectY = function(_) {\n return arguments.length ? (sy = _ ? -1 : 1, recenter()) : sy < 0;\n };\n\n projection.precision = function(_) {\n return arguments.length ? (projectResample = resample(projectTransform, delta2 = _ * _), reset()) : sqrt(delta2);\n };\n\n projection.fitExtent = function(extent, object) {\n return fitExtent(projection, extent, object);\n };\n\n projection.fitSize = function(size, object) {\n return fitSize(projection, size, object);\n };\n\n projection.fitWidth = function(width, object) {\n return fitWidth(projection, width, object);\n };\n\n projection.fitHeight = function(height, object) {\n return fitHeight(projection, height, object);\n };\n\n function recenter() {\n var center = scaleTranslateRotate(k, 0, 0, sx, sy, alpha).apply(null, project(lambda, phi)),\n transform = scaleTranslateRotate(k, x - center[0], y - center[1], sx, sy, alpha);\n rotate = rotateRadians(deltaLambda, deltaPhi, deltaGamma);\n projectTransform = compose(project, transform);\n projectRotateTransform = compose(rotate, projectTransform);\n projectResample = resample(projectTransform, delta2);\n return reset();\n }\n\n function reset() {\n cache = cacheStream = null;\n return projection;\n }\n\n return function() {\n project = projectAt.apply(this, arguments);\n projection.invert = project.invert && invert;\n return recenter();\n };\n}\n\nfunction conicProjection(projectAt) {\n var phi0 = 0,\n phi1 = pi / 3,\n m = projectionMutator(projectAt),\n p = m(phi0, phi1);\n\n p.parallels = function(_) {\n return arguments.length ? m(phi0 = _[0] * radians, phi1 = _[1] * radians) : [phi0 * degrees, phi1 * degrees];\n };\n\n return p;\n}\n\nfunction cylindricalEqualAreaRaw(phi0) {\n var cosPhi0 = cos(phi0);\n\n function forward(lambda, phi) {\n return [lambda * cosPhi0, sin(phi) / cosPhi0];\n }\n\n forward.invert = function(x, y) {\n return [x / cosPhi0, asin(y * cosPhi0)];\n };\n\n return forward;\n}\n\nfunction conicEqualAreaRaw(y0, y1) {\n var sy0 = sin(y0), n = (sy0 + sin(y1)) / 2;\n\n // Are the parallels symmetrical around the Equator?\n if (abs(n) < epsilon) return cylindricalEqualAreaRaw(y0);\n\n var c = 1 + sy0 * (2 * n - sy0), r0 = sqrt(c) / n;\n\n function project(x, y) {\n var r = sqrt(c - 2 * n * sin(y)) / n;\n return [r * sin(x *= n), r0 - r * cos(x)];\n }\n\n project.invert = function(x, y) {\n var r0y = r0 - y,\n l = atan2(x, abs(r0y)) * sign(r0y);\n if (r0y * n < 0)\n l -= pi * sign(x) * sign(r0y);\n return [l / n, asin((c - (x * x + r0y * r0y) * n * n) / (2 * n))];\n };\n\n return project;\n}\n\nfunction conicEqualArea() {\n return conicProjection(conicEqualAreaRaw)\n .scale(155.424)\n .center([0, 33.6442]);\n}\n\nfunction albers() {\n return conicEqualArea()\n .parallels([29.5, 45.5])\n .scale(1070)\n .translate([480, 250])\n .rotate([96, 0])\n .center([-0.6, 38.7]);\n}\n\n// The projections must have mutually exclusive clip regions on the sphere,\n// as this will avoid emitting interleaving lines and polygons.\nfunction multiplex(streams) {\n var n = streams.length;\n return {\n point: function(x, y) { var i = -1; while (++i < n) streams[i].point(x, y); },\n sphere: function() { var i = -1; while (++i < n) streams[i].sphere(); },\n lineStart: function() { var i = -1; while (++i < n) streams[i].lineStart(); },\n lineEnd: function() { var i = -1; while (++i < n) streams[i].lineEnd(); },\n polygonStart: function() { var i = -1; while (++i < n) streams[i].polygonStart(); },\n polygonEnd: function() { var i = -1; while (++i < n) streams[i].polygonEnd(); }\n };\n}\n\n// A composite projection for the United States, configured by default for\n// 960×500. The projection also works quite well at 960×600 if you change the\n// scale to 1285 and adjust the translate accordingly. The set of standard\n// parallels for each region comes from USGS, which is published here:\n// http://egsc.usgs.gov/isb/pubs/MapProjections/projections.html#albers\nfunction albersUsa() {\n var cache,\n cacheStream,\n lower48 = albers(), lower48Point,\n alaska = conicEqualArea().rotate([154, 0]).center([-2, 58.5]).parallels([55, 65]), alaskaPoint, // EPSG:3338\n hawaii = conicEqualArea().rotate([157, 0]).center([-3, 19.9]).parallels([8, 18]), hawaiiPoint, // ESRI:102007\n point, pointStream = {point: function(x, y) { point = [x, y]; }};\n\n function albersUsa(coordinates) {\n var x = coordinates[0], y = coordinates[1];\n return point = null,\n (lower48Point.point(x, y), point)\n || (alaskaPoint.point(x, y), point)\n || (hawaiiPoint.point(x, y), point);\n }\n\n albersUsa.invert = function(coordinates) {\n var k = lower48.scale(),\n t = lower48.translate(),\n x = (coordinates[0] - t[0]) / k,\n y = (coordinates[1] - t[1]) / k;\n return (y >= 0.120 && y < 0.234 && x >= -0.425 && x < -0.214 ? alaska\n : y >= 0.166 && y < 0.234 && x >= -0.214 && x < -0.115 ? hawaii\n : lower48).invert(coordinates);\n };\n\n albersUsa.stream = function(stream) {\n return cache && cacheStream === stream ? cache : cache = multiplex([lower48.stream(cacheStream = stream), alaska.stream(stream), hawaii.stream(stream)]);\n };\n\n albersUsa.precision = function(_) {\n if (!arguments.length) return lower48.precision();\n lower48.precision(_), alaska.precision(_), hawaii.precision(_);\n return reset();\n };\n\n albersUsa.scale = function(_) {\n if (!arguments.length) return lower48.scale();\n lower48.scale(_), alaska.scale(_ * 0.35), hawaii.scale(_);\n return albersUsa.translate(lower48.translate());\n };\n\n albersUsa.translate = function(_) {\n if (!arguments.length) return lower48.translate();\n var k = lower48.scale(), x = +_[0], y = +_[1];\n\n lower48Point = lower48\n .translate(_)\n .clipExtent([[x - 0.455 * k, y - 0.238 * k], [x + 0.455 * k, y + 0.238 * k]])\n .stream(pointStream);\n\n alaskaPoint = alaska\n .translate([x - 0.307 * k, y + 0.201 * k])\n .clipExtent([[x - 0.425 * k + epsilon, y + 0.120 * k + epsilon], [x - 0.214 * k - epsilon, y + 0.234 * k - epsilon]])\n .stream(pointStream);\n\n hawaiiPoint = hawaii\n .translate([x - 0.205 * k, y + 0.212 * k])\n .clipExtent([[x - 0.214 * k + epsilon, y + 0.166 * k + epsilon], [x - 0.115 * k - epsilon, y + 0.234 * k - epsilon]])\n .stream(pointStream);\n\n return reset();\n };\n\n albersUsa.fitExtent = function(extent, object) {\n return fitExtent(albersUsa, extent, object);\n };\n\n albersUsa.fitSize = function(size, object) {\n return fitSize(albersUsa, size, object);\n };\n\n albersUsa.fitWidth = function(width, object) {\n return fitWidth(albersUsa, width, object);\n };\n\n albersUsa.fitHeight = function(height, object) {\n return fitHeight(albersUsa, height, object);\n };\n\n function reset() {\n cache = cacheStream = null;\n return albersUsa;\n }\n\n return albersUsa.scale(1070);\n}\n\nfunction azimuthalRaw(scale) {\n return function(x, y) {\n var cx = cos(x),\n cy = cos(y),\n k = scale(cx * cy);\n if (k === Infinity) return [2, 0];\n return [\n k * cy * sin(x),\n k * sin(y)\n ];\n }\n}\n\nfunction azimuthalInvert(angle) {\n return function(x, y) {\n var z = sqrt(x * x + y * y),\n c = angle(z),\n sc = sin(c),\n cc = cos(c);\n return [\n atan2(x * sc, z * cc),\n asin(z && y * sc / z)\n ];\n }\n}\n\nvar azimuthalEqualAreaRaw = azimuthalRaw(function(cxcy) {\n return sqrt(2 / (1 + cxcy));\n});\n\nazimuthalEqualAreaRaw.invert = azimuthalInvert(function(z) {\n return 2 * asin(z / 2);\n});\n\nfunction azimuthalEqualArea() {\n return projection(azimuthalEqualAreaRaw)\n .scale(124.75)\n .clipAngle(180 - 1e-3);\n}\n\nvar azimuthalEquidistantRaw = azimuthalRaw(function(c) {\n return (c = acos(c)) && c / sin(c);\n});\n\nazimuthalEquidistantRaw.invert = azimuthalInvert(function(z) {\n return z;\n});\n\nfunction azimuthalEquidistant() {\n return projection(azimuthalEquidistantRaw)\n .scale(79.4188)\n .clipAngle(180 - 1e-3);\n}\n\nfunction mercatorRaw(lambda, phi) {\n return [lambda, log(tan((halfPi + phi) / 2))];\n}\n\nmercatorRaw.invert = function(x, y) {\n return [x, 2 * atan(exp(y)) - halfPi];\n};\n\nfunction mercator() {\n return mercatorProjection(mercatorRaw)\n .scale(961 / tau);\n}\n\nfunction mercatorProjection(project) {\n var m = projection(project),\n center = m.center,\n scale = m.scale,\n translate = m.translate,\n clipExtent = m.clipExtent,\n x0 = null, y0, x1, y1; // clip extent\n\n m.scale = function(_) {\n return arguments.length ? (scale(_), reclip()) : scale();\n };\n\n m.translate = function(_) {\n return arguments.length ? (translate(_), reclip()) : translate();\n };\n\n m.center = function(_) {\n return arguments.length ? (center(_), reclip()) : center();\n };\n\n m.clipExtent = function(_) {\n return arguments.length ? ((_ == null ? x0 = y0 = x1 = y1 = null : (x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1])), reclip()) : x0 == null ? null : [[x0, y0], [x1, y1]];\n };\n\n function reclip() {\n var k = pi * scale(),\n t = m(rotation(m.rotate()).invert([0, 0]));\n return clipExtent(x0 == null\n ? [[t[0] - k, t[1] - k], [t[0] + k, t[1] + k]] : project === mercatorRaw\n ? [[Math.max(t[0] - k, x0), y0], [Math.min(t[0] + k, x1), y1]]\n : [[x0, Math.max(t[1] - k, y0)], [x1, Math.min(t[1] + k, y1)]]);\n }\n\n return reclip();\n}\n\nfunction tany(y) {\n return tan((halfPi + y) / 2);\n}\n\nfunction conicConformalRaw(y0, y1) {\n var cy0 = cos(y0),\n n = y0 === y1 ? sin(y0) : log(cy0 / cos(y1)) / log(tany(y1) / tany(y0)),\n f = cy0 * pow(tany(y0), n) / n;\n\n if (!n) return mercatorRaw;\n\n function project(x, y) {\n if (f > 0) { if (y < -halfPi + epsilon) y = -halfPi + epsilon; }\n else { if (y > halfPi - epsilon) y = halfPi - epsilon; }\n var r = f / pow(tany(y), n);\n return [r * sin(n * x), f - r * cos(n * x)];\n }\n\n project.invert = function(x, y) {\n var fy = f - y, r = sign(n) * sqrt(x * x + fy * fy),\n l = atan2(x, abs(fy)) * sign(fy);\n if (fy * n < 0)\n l -= pi * sign(x) * sign(fy);\n return [l / n, 2 * atan(pow(f / r, 1 / n)) - halfPi];\n };\n\n return project;\n}\n\nfunction conicConformal() {\n return conicProjection(conicConformalRaw)\n .scale(109.5)\n .parallels([30, 30]);\n}\n\nfunction equirectangularRaw(lambda, phi) {\n return [lambda, phi];\n}\n\nequirectangularRaw.invert = equirectangularRaw;\n\nfunction equirectangular() {\n return projection(equirectangularRaw)\n .scale(152.63);\n}\n\nfunction conicEquidistantRaw(y0, y1) {\n var cy0 = cos(y0),\n n = y0 === y1 ? sin(y0) : (cy0 - cos(y1)) / (y1 - y0),\n g = cy0 / n + y0;\n\n if (abs(n) < epsilon) return equirectangularRaw;\n\n function project(x, y) {\n var gy = g - y, nx = n * x;\n return [gy * sin(nx), g - gy * cos(nx)];\n }\n\n project.invert = function(x, y) {\n var gy = g - y,\n l = atan2(x, abs(gy)) * sign(gy);\n if (gy * n < 0)\n l -= pi * sign(x) * sign(gy);\n return [l / n, g - sign(n) * sqrt(x * x + gy * gy)];\n };\n\n return project;\n}\n\nfunction conicEquidistant() {\n return conicProjection(conicEquidistantRaw)\n .scale(131.154)\n .center([0, 13.9389]);\n}\n\nvar A1 = 1.340264,\n A2 = -0.081106,\n A3 = 0.000893,\n A4 = 0.003796,\n M = sqrt(3) / 2,\n iterations = 12;\n\nfunction equalEarthRaw(lambda, phi) {\n var l = asin(M * sin(phi)), l2 = l * l, l6 = l2 * l2 * l2;\n return [\n lambda * cos(l) / (M * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2))),\n l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2))\n ];\n}\n\nequalEarthRaw.invert = function(x, y) {\n var l = y, l2 = l * l, l6 = l2 * l2 * l2;\n for (var i = 0, delta, fy, fpy; i < iterations; ++i) {\n fy = l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2)) - y;\n fpy = A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2);\n l -= delta = fy / fpy, l2 = l * l, l6 = l2 * l2 * l2;\n if (abs(delta) < epsilon2) break;\n }\n return [\n M * x * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2)) / cos(l),\n asin(sin(l) / M)\n ];\n};\n\nfunction equalEarth() {\n return projection(equalEarthRaw)\n .scale(177.158);\n}\n\nfunction gnomonicRaw(x, y) {\n var cy = cos(y), k = cos(x) * cy;\n return [cy * sin(x) / k, sin(y) / k];\n}\n\ngnomonicRaw.invert = azimuthalInvert(atan);\n\nfunction gnomonic() {\n return projection(gnomonicRaw)\n .scale(144.049)\n .clipAngle(60);\n}\n\nfunction identity$1() {\n var k = 1, tx = 0, ty = 0, sx = 1, sy = 1, // scale, translate and reflect\n alpha = 0, ca, sa, // angle\n x0 = null, y0, x1, y1, // clip extent\n kx = 1, ky = 1,\n transform = transformer({\n point: function(x, y) {\n var p = projection([x, y]);\n this.stream.point(p[0], p[1]);\n }\n }),\n postclip = identity,\n cache,\n cacheStream;\n\n function reset() {\n kx = k * sx;\n ky = k * sy;\n cache = cacheStream = null;\n return projection;\n }\n\n function projection (p) {\n var x = p[0] * kx, y = p[1] * ky;\n if (alpha) {\n var t = y * ca - x * sa;\n x = x * ca + y * sa;\n y = t;\n } \n return [x + tx, y + ty];\n }\n projection.invert = function(p) {\n var x = p[0] - tx, y = p[1] - ty;\n if (alpha) {\n var t = y * ca + x * sa;\n x = x * ca - y * sa;\n y = t;\n }\n return [x / kx, y / ky];\n };\n projection.stream = function(stream) {\n return cache && cacheStream === stream ? cache : cache = transform(postclip(cacheStream = stream));\n };\n projection.postclip = function(_) {\n return arguments.length ? (postclip = _, x0 = y0 = x1 = y1 = null, reset()) : postclip;\n };\n projection.clipExtent = function(_) {\n return arguments.length ? (postclip = _ == null ? (x0 = y0 = x1 = y1 = null, identity) : clipRectangle(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]];\n };\n projection.scale = function(_) {\n return arguments.length ? (k = +_, reset()) : k;\n };\n projection.translate = function(_) {\n return arguments.length ? (tx = +_[0], ty = +_[1], reset()) : [tx, ty];\n };\n projection.angle = function(_) {\n return arguments.length ? (alpha = _ % 360 * radians, sa = sin(alpha), ca = cos(alpha), reset()) : alpha * degrees;\n };\n projection.reflectX = function(_) {\n return arguments.length ? (sx = _ ? -1 : 1, reset()) : sx < 0;\n };\n projection.reflectY = function(_) {\n return arguments.length ? (sy = _ ? -1 : 1, reset()) : sy < 0;\n };\n projection.fitExtent = function(extent, object) {\n return fitExtent(projection, extent, object);\n };\n projection.fitSize = function(size, object) {\n return fitSize(projection, size, object);\n };\n projection.fitWidth = function(width, object) {\n return fitWidth(projection, width, object);\n };\n projection.fitHeight = function(height, object) {\n return fitHeight(projection, height, object);\n };\n\n return projection;\n}\n\nfunction naturalEarth1Raw(lambda, phi) {\n var phi2 = phi * phi, phi4 = phi2 * phi2;\n return [\n lambda * (0.8707 - 0.131979 * phi2 + phi4 * (-0.013791 + phi4 * (0.003971 * phi2 - 0.001529 * phi4))),\n phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4)))\n ];\n}\n\nnaturalEarth1Raw.invert = function(x, y) {\n var phi = y, i = 25, delta;\n do {\n var phi2 = phi * phi, phi4 = phi2 * phi2;\n phi -= delta = (phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4))) - y) /\n (1.007226 + phi2 * (0.015085 * 3 + phi4 * (-0.044475 * 7 + 0.028874 * 9 * phi2 - 0.005916 * 11 * phi4)));\n } while (abs(delta) > epsilon && --i > 0);\n return [\n x / (0.8707 + (phi2 = phi * phi) * (-0.131979 + phi2 * (-0.013791 + phi2 * phi2 * phi2 * (0.003971 - 0.001529 * phi2)))),\n phi\n ];\n};\n\nfunction naturalEarth1() {\n return projection(naturalEarth1Raw)\n .scale(175.295);\n}\n\nfunction orthographicRaw(x, y) {\n return [cos(y) * sin(x), sin(y)];\n}\n\northographicRaw.invert = azimuthalInvert(asin);\n\nfunction orthographic() {\n return projection(orthographicRaw)\n .scale(249.5)\n .clipAngle(90 + epsilon);\n}\n\nfunction stereographicRaw(x, y) {\n var cy = cos(y), k = 1 + cos(x) * cy;\n return [cy * sin(x) / k, sin(y) / k];\n}\n\nstereographicRaw.invert = azimuthalInvert(function(z) {\n return 2 * atan(z);\n});\n\nfunction stereographic() {\n return projection(stereographicRaw)\n .scale(250)\n .clipAngle(142);\n}\n\nfunction transverseMercatorRaw(lambda, phi) {\n return [log(tan((halfPi + phi) / 2)), -lambda];\n}\n\ntransverseMercatorRaw.invert = function(x, y) {\n return [-y, 2 * atan(exp(x)) - halfPi];\n};\n\nfunction transverseMercator() {\n var m = mercatorProjection(transverseMercatorRaw),\n center = m.center,\n rotate = m.rotate;\n\n m.center = function(_) {\n return arguments.length ? center([-_[1], _[0]]) : (_ = center(), [_[1], -_[0]]);\n };\n\n m.rotate = function(_) {\n return arguments.length ? rotate([_[0], _[1], _.length > 2 ? _[2] + 90 : 90]) : (_ = rotate(), [_[0], _[1], _[2] - 90]);\n };\n\n return rotate([0, 0, 90])\n .scale(159.155);\n}\n\nexports.geoAlbers = albers;\nexports.geoAlbersUsa = albersUsa;\nexports.geoArea = area;\nexports.geoAzimuthalEqualArea = azimuthalEqualArea;\nexports.geoAzimuthalEqualAreaRaw = azimuthalEqualAreaRaw;\nexports.geoAzimuthalEquidistant = azimuthalEquidistant;\nexports.geoAzimuthalEquidistantRaw = azimuthalEquidistantRaw;\nexports.geoBounds = bounds;\nexports.geoCentroid = centroid;\nexports.geoCircle = circle;\nexports.geoClipAntimeridian = clipAntimeridian;\nexports.geoClipCircle = clipCircle;\nexports.geoClipExtent = extent;\nexports.geoClipRectangle = clipRectangle;\nexports.geoConicConformal = conicConformal;\nexports.geoConicConformalRaw = conicConformalRaw;\nexports.geoConicEqualArea = conicEqualArea;\nexports.geoConicEqualAreaRaw = conicEqualAreaRaw;\nexports.geoConicEquidistant = conicEquidistant;\nexports.geoConicEquidistantRaw = conicEquidistantRaw;\nexports.geoContains = contains;\nexports.geoDistance = distance;\nexports.geoEqualEarth = equalEarth;\nexports.geoEqualEarthRaw = equalEarthRaw;\nexports.geoEquirectangular = equirectangular;\nexports.geoEquirectangularRaw = equirectangularRaw;\nexports.geoGnomonic = gnomonic;\nexports.geoGnomonicRaw = gnomonicRaw;\nexports.geoGraticule = graticule;\nexports.geoGraticule10 = graticule10;\nexports.geoIdentity = identity$1;\nexports.geoInterpolate = interpolate;\nexports.geoLength = length;\nexports.geoMercator = mercator;\nexports.geoMercatorRaw = mercatorRaw;\nexports.geoNaturalEarth1 = naturalEarth1;\nexports.geoNaturalEarth1Raw = naturalEarth1Raw;\nexports.geoOrthographic = orthographic;\nexports.geoOrthographicRaw = orthographicRaw;\nexports.geoPath = index;\nexports.geoProjection = projection;\nexports.geoProjectionMutator = projectionMutator;\nexports.geoRotation = rotation;\nexports.geoStereographic = stereographic;\nexports.geoStereographicRaw = stereographicRaw;\nexports.geoStream = geoStream;\nexports.geoTransform = transform;\nexports.geoTransverseMercator = transverseMercator;\nexports.geoTransverseMercatorRaw = transverseMercatorRaw;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","// https://d3js.org/d3-hierarchy/ v2.0.0 Copyright 2020 Mike Bostock\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\ntypeof define === 'function' && define.amd ? define(['exports'], factory) :\n(global = global || self, factory(global.d3 = global.d3 || {}));\n}(this, function (exports) { 'use strict';\n\nfunction defaultSeparation(a, b) {\n return a.parent === b.parent ? 1 : 2;\n}\n\nfunction meanX(children) {\n return children.reduce(meanXReduce, 0) / children.length;\n}\n\nfunction meanXReduce(x, c) {\n return x + c.x;\n}\n\nfunction maxY(children) {\n return 1 + children.reduce(maxYReduce, 0);\n}\n\nfunction maxYReduce(y, c) {\n return Math.max(y, c.y);\n}\n\nfunction leafLeft(node) {\n var children;\n while (children = node.children) node = children[0];\n return node;\n}\n\nfunction leafRight(node) {\n var children;\n while (children = node.children) node = children[children.length - 1];\n return node;\n}\n\nfunction cluster() {\n var separation = defaultSeparation,\n dx = 1,\n dy = 1,\n nodeSize = false;\n\n function cluster(root) {\n var previousNode,\n x = 0;\n\n // First walk, computing the initial x & y values.\n root.eachAfter(function(node) {\n var children = node.children;\n if (children) {\n node.x = meanX(children);\n node.y = maxY(children);\n } else {\n node.x = previousNode ? x += separation(node, previousNode) : 0;\n node.y = 0;\n previousNode = node;\n }\n });\n\n var left = leafLeft(root),\n right = leafRight(root),\n x0 = left.x - separation(left, right) / 2,\n x1 = right.x + separation(right, left) / 2;\n\n // Second walk, normalizing x & y to the desired size.\n return root.eachAfter(nodeSize ? function(node) {\n node.x = (node.x - root.x) * dx;\n node.y = (root.y - node.y) * dy;\n } : function(node) {\n node.x = (node.x - x0) / (x1 - x0) * dx;\n node.y = (1 - (root.y ? node.y / root.y : 1)) * dy;\n });\n }\n\n cluster.separation = function(x) {\n return arguments.length ? (separation = x, cluster) : separation;\n };\n\n cluster.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? null : [dx, dy]);\n };\n\n cluster.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? [dx, dy] : null);\n };\n\n return cluster;\n}\n\nfunction count(node) {\n var sum = 0,\n children = node.children,\n i = children && children.length;\n if (!i) sum = 1;\n else while (--i >= 0) sum += children[i].value;\n node.value = sum;\n}\n\nfunction node_count() {\n return this.eachAfter(count);\n}\n\nfunction node_each(callback, that) {\n let index = -1;\n for (const node of this) {\n callback.call(that, node, ++index, this);\n }\n return this;\n}\n\nfunction node_eachBefore(callback, that) {\n var node = this, nodes = [node], children, i, index = -1;\n while (node = nodes.pop()) {\n callback.call(that, node, ++index, this);\n if (children = node.children) {\n for (i = children.length - 1; i >= 0; --i) {\n nodes.push(children[i]);\n }\n }\n }\n return this;\n}\n\nfunction node_eachAfter(callback, that) {\n var node = this, nodes = [node], next = [], children, i, n, index = -1;\n while (node = nodes.pop()) {\n next.push(node);\n if (children = node.children) {\n for (i = 0, n = children.length; i < n; ++i) {\n nodes.push(children[i]);\n }\n }\n }\n while (node = next.pop()) {\n callback.call(that, node, ++index, this);\n }\n return this;\n}\n\nfunction node_find(callback, that) {\n let index = -1;\n for (const node of this) {\n if (callback.call(that, node, ++index, this)) {\n return node;\n }\n }\n}\n\nfunction node_sum(value) {\n return this.eachAfter(function(node) {\n var sum = +value(node.data) || 0,\n children = node.children,\n i = children && children.length;\n while (--i >= 0) sum += children[i].value;\n node.value = sum;\n });\n}\n\nfunction node_sort(compare) {\n return this.eachBefore(function(node) {\n if (node.children) {\n node.children.sort(compare);\n }\n });\n}\n\nfunction node_path(end) {\n var start = this,\n ancestor = leastCommonAncestor(start, end),\n nodes = [start];\n while (start !== ancestor) {\n start = start.parent;\n nodes.push(start);\n }\n var k = nodes.length;\n while (end !== ancestor) {\n nodes.splice(k, 0, end);\n end = end.parent;\n }\n return nodes;\n}\n\nfunction leastCommonAncestor(a, b) {\n if (a === b) return a;\n var aNodes = a.ancestors(),\n bNodes = b.ancestors(),\n c = null;\n a = aNodes.pop();\n b = bNodes.pop();\n while (a === b) {\n c = a;\n a = aNodes.pop();\n b = bNodes.pop();\n }\n return c;\n}\n\nfunction node_ancestors() {\n var node = this, nodes = [node];\n while (node = node.parent) {\n nodes.push(node);\n }\n return nodes;\n}\n\nfunction node_descendants() {\n return Array.from(this);\n}\n\nfunction node_leaves() {\n var leaves = [];\n this.eachBefore(function(node) {\n if (!node.children) {\n leaves.push(node);\n }\n });\n return leaves;\n}\n\nfunction node_links() {\n var root = this, links = [];\n root.each(function(node) {\n if (node !== root) { // Don’t include the root’s parent, if any.\n links.push({source: node.parent, target: node});\n }\n });\n return links;\n}\n\nfunction* node_iterator() {\n var node = this, current, next = [node], children, i, n;\n do {\n current = next.reverse(), next = [];\n while (node = current.pop()) {\n yield node;\n if (children = node.children) {\n for (i = 0, n = children.length; i < n; ++i) {\n next.push(children[i]);\n }\n }\n }\n } while (next.length);\n}\n\nfunction hierarchy(data, children) {\n if (data instanceof Map) {\n data = [undefined, data];\n if (children === undefined) children = mapChildren;\n } else if (children === undefined) {\n children = objectChildren;\n }\n\n var root = new Node(data),\n node,\n nodes = [root],\n child,\n childs,\n i,\n n;\n\n while (node = nodes.pop()) {\n if ((childs = children(node.data)) && (n = (childs = Array.from(childs)).length)) {\n node.children = childs;\n for (i = n - 1; i >= 0; --i) {\n nodes.push(child = childs[i] = new Node(childs[i]));\n child.parent = node;\n child.depth = node.depth + 1;\n }\n }\n }\n\n return root.eachBefore(computeHeight);\n}\n\nfunction node_copy() {\n return hierarchy(this).eachBefore(copyData);\n}\n\nfunction objectChildren(d) {\n return d.children;\n}\n\nfunction mapChildren(d) {\n return Array.isArray(d) ? d[1] : null;\n}\n\nfunction copyData(node) {\n if (node.data.value !== undefined) node.value = node.data.value;\n node.data = node.data.data;\n}\n\nfunction computeHeight(node) {\n var height = 0;\n do node.height = height;\n while ((node = node.parent) && (node.height < ++height));\n}\n\nfunction Node(data) {\n this.data = data;\n this.depth =\n this.height = 0;\n this.parent = null;\n}\n\nNode.prototype = hierarchy.prototype = {\n constructor: Node,\n count: node_count,\n each: node_each,\n eachAfter: node_eachAfter,\n eachBefore: node_eachBefore,\n find: node_find,\n sum: node_sum,\n sort: node_sort,\n path: node_path,\n ancestors: node_ancestors,\n descendants: node_descendants,\n leaves: node_leaves,\n links: node_links,\n copy: node_copy,\n [Symbol.iterator]: node_iterator\n};\n\nfunction array(x) {\n return typeof x === \"object\" && \"length\" in x\n ? x // Array, TypedArray, NodeList, array-like\n : Array.from(x); // Map, Set, iterable, string, or anything else\n}\n\nfunction shuffle(array) {\n var m = array.length,\n t,\n i;\n\n while (m) {\n i = Math.random() * m-- | 0;\n t = array[m];\n array[m] = array[i];\n array[i] = t;\n }\n\n return array;\n}\n\nfunction enclose(circles) {\n var i = 0, n = (circles = shuffle(Array.from(circles))).length, B = [], p, e;\n\n while (i < n) {\n p = circles[i];\n if (e && enclosesWeak(e, p)) ++i;\n else e = encloseBasis(B = extendBasis(B, p)), i = 0;\n }\n\n return e;\n}\n\nfunction extendBasis(B, p) {\n var i, j;\n\n if (enclosesWeakAll(p, B)) return [p];\n\n // If we get here then B must have at least one element.\n for (i = 0; i < B.length; ++i) {\n if (enclosesNot(p, B[i])\n && enclosesWeakAll(encloseBasis2(B[i], p), B)) {\n return [B[i], p];\n }\n }\n\n // If we get here then B must have at least two elements.\n for (i = 0; i < B.length - 1; ++i) {\n for (j = i + 1; j < B.length; ++j) {\n if (enclosesNot(encloseBasis2(B[i], B[j]), p)\n && enclosesNot(encloseBasis2(B[i], p), B[j])\n && enclosesNot(encloseBasis2(B[j], p), B[i])\n && enclosesWeakAll(encloseBasis3(B[i], B[j], p), B)) {\n return [B[i], B[j], p];\n }\n }\n }\n\n // If we get here then something is very wrong.\n throw new Error;\n}\n\nfunction enclosesNot(a, b) {\n var dr = a.r - b.r, dx = b.x - a.x, dy = b.y - a.y;\n return dr < 0 || dr * dr < dx * dx + dy * dy;\n}\n\nfunction enclosesWeak(a, b) {\n var dr = a.r - b.r + Math.max(a.r, b.r, 1) * 1e-9, dx = b.x - a.x, dy = b.y - a.y;\n return dr > 0 && dr * dr > dx * dx + dy * dy;\n}\n\nfunction enclosesWeakAll(a, B) {\n for (var i = 0; i < B.length; ++i) {\n if (!enclosesWeak(a, B[i])) {\n return false;\n }\n }\n return true;\n}\n\nfunction encloseBasis(B) {\n switch (B.length) {\n case 1: return encloseBasis1(B[0]);\n case 2: return encloseBasis2(B[0], B[1]);\n case 3: return encloseBasis3(B[0], B[1], B[2]);\n }\n}\n\nfunction encloseBasis1(a) {\n return {\n x: a.x,\n y: a.y,\n r: a.r\n };\n}\n\nfunction encloseBasis2(a, b) {\n var x1 = a.x, y1 = a.y, r1 = a.r,\n x2 = b.x, y2 = b.y, r2 = b.r,\n x21 = x2 - x1, y21 = y2 - y1, r21 = r2 - r1,\n l = Math.sqrt(x21 * x21 + y21 * y21);\n return {\n x: (x1 + x2 + x21 / l * r21) / 2,\n y: (y1 + y2 + y21 / l * r21) / 2,\n r: (l + r1 + r2) / 2\n };\n}\n\nfunction encloseBasis3(a, b, c) {\n var x1 = a.x, y1 = a.y, r1 = a.r,\n x2 = b.x, y2 = b.y, r2 = b.r,\n x3 = c.x, y3 = c.y, r3 = c.r,\n a2 = x1 - x2,\n a3 = x1 - x3,\n b2 = y1 - y2,\n b3 = y1 - y3,\n c2 = r2 - r1,\n c3 = r3 - r1,\n d1 = x1 * x1 + y1 * y1 - r1 * r1,\n d2 = d1 - x2 * x2 - y2 * y2 + r2 * r2,\n d3 = d1 - x3 * x3 - y3 * y3 + r3 * r3,\n ab = a3 * b2 - a2 * b3,\n xa = (b2 * d3 - b3 * d2) / (ab * 2) - x1,\n xb = (b3 * c2 - b2 * c3) / ab,\n ya = (a3 * d2 - a2 * d3) / (ab * 2) - y1,\n yb = (a2 * c3 - a3 * c2) / ab,\n A = xb * xb + yb * yb - 1,\n B = 2 * (r1 + xa * xb + ya * yb),\n C = xa * xa + ya * ya - r1 * r1,\n r = -(A ? (B + Math.sqrt(B * B - 4 * A * C)) / (2 * A) : C / B);\n return {\n x: x1 + xa + xb * r,\n y: y1 + ya + yb * r,\n r: r\n };\n}\n\nfunction place(b, a, c) {\n var dx = b.x - a.x, x, a2,\n dy = b.y - a.y, y, b2,\n d2 = dx * dx + dy * dy;\n if (d2) {\n a2 = a.r + c.r, a2 *= a2;\n b2 = b.r + c.r, b2 *= b2;\n if (a2 > b2) {\n x = (d2 + b2 - a2) / (2 * d2);\n y = Math.sqrt(Math.max(0, b2 / d2 - x * x));\n c.x = b.x - x * dx - y * dy;\n c.y = b.y - x * dy + y * dx;\n } else {\n x = (d2 + a2 - b2) / (2 * d2);\n y = Math.sqrt(Math.max(0, a2 / d2 - x * x));\n c.x = a.x + x * dx - y * dy;\n c.y = a.y + x * dy + y * dx;\n }\n } else {\n c.x = a.x + c.r;\n c.y = a.y;\n }\n}\n\nfunction intersects(a, b) {\n var dr = a.r + b.r - 1e-6, dx = b.x - a.x, dy = b.y - a.y;\n return dr > 0 && dr * dr > dx * dx + dy * dy;\n}\n\nfunction score(node) {\n var a = node._,\n b = node.next._,\n ab = a.r + b.r,\n dx = (a.x * b.r + b.x * a.r) / ab,\n dy = (a.y * b.r + b.y * a.r) / ab;\n return dx * dx + dy * dy;\n}\n\nfunction Node$1(circle) {\n this._ = circle;\n this.next = null;\n this.previous = null;\n}\n\nfunction packEnclose(circles) {\n if (!(n = (circles = array(circles)).length)) return 0;\n\n var a, b, c, n, aa, ca, i, j, k, sj, sk;\n\n // Place the first circle.\n a = circles[0], a.x = 0, a.y = 0;\n if (!(n > 1)) return a.r;\n\n // Place the second circle.\n b = circles[1], a.x = -b.r, b.x = a.r, b.y = 0;\n if (!(n > 2)) return a.r + b.r;\n\n // Place the third circle.\n place(b, a, c = circles[2]);\n\n // Initialize the front-chain using the first three circles a, b and c.\n a = new Node$1(a), b = new Node$1(b), c = new Node$1(c);\n a.next = c.previous = b;\n b.next = a.previous = c;\n c.next = b.previous = a;\n\n // Attempt to place each remaining circle…\n pack: for (i = 3; i < n; ++i) {\n place(a._, b._, c = circles[i]), c = new Node$1(c);\n\n // Find the closest intersecting circle on the front-chain, if any.\n // “Closeness” is determined by linear distance along the front-chain.\n // “Ahead” or “behind” is likewise determined by linear distance.\n j = b.next, k = a.previous, sj = b._.r, sk = a._.r;\n do {\n if (sj <= sk) {\n if (intersects(j._, c._)) {\n b = j, a.next = b, b.previous = a, --i;\n continue pack;\n }\n sj += j._.r, j = j.next;\n } else {\n if (intersects(k._, c._)) {\n a = k, a.next = b, b.previous = a, --i;\n continue pack;\n }\n sk += k._.r, k = k.previous;\n }\n } while (j !== k.next);\n\n // Success! Insert the new circle c between a and b.\n c.previous = a, c.next = b, a.next = b.previous = b = c;\n\n // Compute the new closest circle pair to the centroid.\n aa = score(a);\n while ((c = c.next) !== b) {\n if ((ca = score(c)) < aa) {\n a = c, aa = ca;\n }\n }\n b = a.next;\n }\n\n // Compute the enclosing circle of the front chain.\n a = [b._], c = b; while ((c = c.next) !== b) a.push(c._); c = enclose(a);\n\n // Translate the circles to put the enclosing circle around the origin.\n for (i = 0; i < n; ++i) a = circles[i], a.x -= c.x, a.y -= c.y;\n\n return c.r;\n}\n\nfunction siblings(circles) {\n packEnclose(circles);\n return circles;\n}\n\nfunction optional(f) {\n return f == null ? null : required(f);\n}\n\nfunction required(f) {\n if (typeof f !== \"function\") throw new Error;\n return f;\n}\n\nfunction constantZero() {\n return 0;\n}\n\nfunction constant(x) {\n return function() {\n return x;\n };\n}\n\nfunction defaultRadius(d) {\n return Math.sqrt(d.value);\n}\n\nfunction index() {\n var radius = null,\n dx = 1,\n dy = 1,\n padding = constantZero;\n\n function pack(root) {\n root.x = dx / 2, root.y = dy / 2;\n if (radius) {\n root.eachBefore(radiusLeaf(radius))\n .eachAfter(packChildren(padding, 0.5))\n .eachBefore(translateChild(1));\n } else {\n root.eachBefore(radiusLeaf(defaultRadius))\n .eachAfter(packChildren(constantZero, 1))\n .eachAfter(packChildren(padding, root.r / Math.min(dx, dy)))\n .eachBefore(translateChild(Math.min(dx, dy) / (2 * root.r)));\n }\n return root;\n }\n\n pack.radius = function(x) {\n return arguments.length ? (radius = optional(x), pack) : radius;\n };\n\n pack.size = function(x) {\n return arguments.length ? (dx = +x[0], dy = +x[1], pack) : [dx, dy];\n };\n\n pack.padding = function(x) {\n return arguments.length ? (padding = typeof x === \"function\" ? x : constant(+x), pack) : padding;\n };\n\n return pack;\n}\n\nfunction radiusLeaf(radius) {\n return function(node) {\n if (!node.children) {\n node.r = Math.max(0, +radius(node) || 0);\n }\n };\n}\n\nfunction packChildren(padding, k) {\n return function(node) {\n if (children = node.children) {\n var children,\n i,\n n = children.length,\n r = padding(node) * k || 0,\n e;\n\n if (r) for (i = 0; i < n; ++i) children[i].r += r;\n e = packEnclose(children);\n if (r) for (i = 0; i < n; ++i) children[i].r -= r;\n node.r = e + r;\n }\n };\n}\n\nfunction translateChild(k) {\n return function(node) {\n var parent = node.parent;\n node.r *= k;\n if (parent) {\n node.x = parent.x + k * node.x;\n node.y = parent.y + k * node.y;\n }\n };\n}\n\nfunction roundNode(node) {\n node.x0 = Math.round(node.x0);\n node.y0 = Math.round(node.y0);\n node.x1 = Math.round(node.x1);\n node.y1 = Math.round(node.y1);\n}\n\nfunction treemapDice(parent, x0, y0, x1, y1) {\n var nodes = parent.children,\n node,\n i = -1,\n n = nodes.length,\n k = parent.value && (x1 - x0) / parent.value;\n\n while (++i < n) {\n node = nodes[i], node.y0 = y0, node.y1 = y1;\n node.x0 = x0, node.x1 = x0 += node.value * k;\n }\n}\n\nfunction partition() {\n var dx = 1,\n dy = 1,\n padding = 0,\n round = false;\n\n function partition(root) {\n var n = root.height + 1;\n root.x0 =\n root.y0 = padding;\n root.x1 = dx;\n root.y1 = dy / n;\n root.eachBefore(positionNode(dy, n));\n if (round) root.eachBefore(roundNode);\n return root;\n }\n\n function positionNode(dy, n) {\n return function(node) {\n if (node.children) {\n treemapDice(node, node.x0, dy * (node.depth + 1) / n, node.x1, dy * (node.depth + 2) / n);\n }\n var x0 = node.x0,\n y0 = node.y0,\n x1 = node.x1 - padding,\n y1 = node.y1 - padding;\n if (x1 < x0) x0 = x1 = (x0 + x1) / 2;\n if (y1 < y0) y0 = y1 = (y0 + y1) / 2;\n node.x0 = x0;\n node.y0 = y0;\n node.x1 = x1;\n node.y1 = y1;\n };\n }\n\n partition.round = function(x) {\n return arguments.length ? (round = !!x, partition) : round;\n };\n\n partition.size = function(x) {\n return arguments.length ? (dx = +x[0], dy = +x[1], partition) : [dx, dy];\n };\n\n partition.padding = function(x) {\n return arguments.length ? (padding = +x, partition) : padding;\n };\n\n return partition;\n}\n\nvar preroot = {depth: -1},\n ambiguous = {};\n\nfunction defaultId(d) {\n return d.id;\n}\n\nfunction defaultParentId(d) {\n return d.parentId;\n}\n\nfunction stratify() {\n var id = defaultId,\n parentId = defaultParentId;\n\n function stratify(data) {\n var nodes = Array.from(data),\n n = nodes.length,\n d,\n i,\n root,\n parent,\n node,\n nodeId,\n nodeKey,\n nodeByKey = new Map;\n\n for (i = 0; i < n; ++i) {\n d = nodes[i], node = nodes[i] = new Node(d);\n if ((nodeId = id(d, i, data)) != null && (nodeId += \"\")) {\n nodeKey = node.id = nodeId;\n nodeByKey.set(nodeKey, nodeByKey.has(nodeKey) ? ambiguous : node);\n }\n if ((nodeId = parentId(d, i, data)) != null && (nodeId += \"\")) {\n node.parent = nodeId;\n }\n }\n\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n if (nodeId = node.parent) {\n parent = nodeByKey.get(nodeId);\n if (!parent) throw new Error(\"missing: \" + nodeId);\n if (parent === ambiguous) throw new Error(\"ambiguous: \" + nodeId);\n if (parent.children) parent.children.push(node);\n else parent.children = [node];\n node.parent = parent;\n } else {\n if (root) throw new Error(\"multiple roots\");\n root = node;\n }\n }\n\n if (!root) throw new Error(\"no root\");\n root.parent = preroot;\n root.eachBefore(function(node) { node.depth = node.parent.depth + 1; --n; }).eachBefore(computeHeight);\n root.parent = null;\n if (n > 0) throw new Error(\"cycle\");\n\n return root;\n }\n\n stratify.id = function(x) {\n return arguments.length ? (id = required(x), stratify) : id;\n };\n\n stratify.parentId = function(x) {\n return arguments.length ? (parentId = required(x), stratify) : parentId;\n };\n\n return stratify;\n}\n\nfunction defaultSeparation$1(a, b) {\n return a.parent === b.parent ? 1 : 2;\n}\n\n// function radialSeparation(a, b) {\n// return (a.parent === b.parent ? 1 : 2) / a.depth;\n// }\n\n// This function is used to traverse the left contour of a subtree (or\n// subforest). It returns the successor of v on this contour. This successor is\n// either given by the leftmost child of v or by the thread of v. The function\n// returns null if and only if v is on the highest level of its subtree.\nfunction nextLeft(v) {\n var children = v.children;\n return children ? children[0] : v.t;\n}\n\n// This function works analogously to nextLeft.\nfunction nextRight(v) {\n var children = v.children;\n return children ? children[children.length - 1] : v.t;\n}\n\n// Shifts the current subtree rooted at w+. This is done by increasing\n// prelim(w+) and mod(w+) by shift.\nfunction moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}\n\n// All other shifts, applied to the smaller subtrees between w- and w+, are\n// performed by this function. To prepare the shifts, we have to adjust\n// change(w+), shift(w+), and change(w-).\nfunction executeShifts(v) {\n var shift = 0,\n change = 0,\n children = v.children,\n i = children.length,\n w;\n while (--i >= 0) {\n w = children[i];\n w.z += shift;\n w.m += shift;\n shift += w.s + (change += w.c);\n }\n}\n\n// If vi-’s ancestor is a sibling of v, returns vi-’s ancestor. Otherwise,\n// returns the specified (default) ancestor.\nfunction nextAncestor(vim, v, ancestor) {\n return vim.a.parent === v.parent ? vim.a : ancestor;\n}\n\nfunction TreeNode(node, i) {\n this._ = node;\n this.parent = null;\n this.children = null;\n this.A = null; // default ancestor\n this.a = this; // ancestor\n this.z = 0; // prelim\n this.m = 0; // mod\n this.c = 0; // change\n this.s = 0; // shift\n this.t = null; // thread\n this.i = i; // number\n}\n\nTreeNode.prototype = Object.create(Node.prototype);\n\nfunction treeRoot(root) {\n var tree = new TreeNode(root, 0),\n node,\n nodes = [tree],\n child,\n children,\n i,\n n;\n\n while (node = nodes.pop()) {\n if (children = node._.children) {\n node.children = new Array(n = children.length);\n for (i = n - 1; i >= 0; --i) {\n nodes.push(child = node.children[i] = new TreeNode(children[i], i));\n child.parent = node;\n }\n }\n }\n\n (tree.parent = new TreeNode(null, 0)).children = [tree];\n return tree;\n}\n\n// Node-link tree diagram using the Reingold-Tilford \"tidy\" algorithm\nfunction tree() {\n var separation = defaultSeparation$1,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n}\n\nfunction treemapSlice(parent, x0, y0, x1, y1) {\n var nodes = parent.children,\n node,\n i = -1,\n n = nodes.length,\n k = parent.value && (y1 - y0) / parent.value;\n\n while (++i < n) {\n node = nodes[i], node.x0 = x0, node.x1 = x1;\n node.y0 = y0, node.y1 = y0 += node.value * k;\n }\n}\n\nvar phi = (1 + Math.sqrt(5)) / 2;\n\nfunction squarifyRatio(ratio, parent, x0, y0, x1, y1) {\n var rows = [],\n nodes = parent.children,\n row,\n nodeValue,\n i0 = 0,\n i1 = 0,\n n = nodes.length,\n dx, dy,\n value = parent.value,\n sumValue,\n minValue,\n maxValue,\n newRatio,\n minRatio,\n alpha,\n beta;\n\n while (i0 < n) {\n dx = x1 - x0, dy = y1 - y0;\n\n // Find the next non-empty node.\n do sumValue = nodes[i1++].value; while (!sumValue && i1 < n);\n minValue = maxValue = sumValue;\n alpha = Math.max(dy / dx, dx / dy) / (value * ratio);\n beta = sumValue * sumValue * alpha;\n minRatio = Math.max(maxValue / beta, beta / minValue);\n\n // Keep adding nodes while the aspect ratio maintains or improves.\n for (; i1 < n; ++i1) {\n sumValue += nodeValue = nodes[i1].value;\n if (nodeValue < minValue) minValue = nodeValue;\n if (nodeValue > maxValue) maxValue = nodeValue;\n beta = sumValue * sumValue * alpha;\n newRatio = Math.max(maxValue / beta, beta / minValue);\n if (newRatio > minRatio) { sumValue -= nodeValue; break; }\n minRatio = newRatio;\n }\n\n // Position and record the row orientation.\n rows.push(row = {value: sumValue, dice: dx < dy, children: nodes.slice(i0, i1)});\n if (row.dice) treemapDice(row, x0, y0, x1, value ? y0 += dy * sumValue / value : y1);\n else treemapSlice(row, x0, y0, value ? x0 += dx * sumValue / value : x1, y1);\n value -= sumValue, i0 = i1;\n }\n\n return rows;\n}\n\nvar squarify = (function custom(ratio) {\n\n function squarify(parent, x0, y0, x1, y1) {\n squarifyRatio(ratio, parent, x0, y0, x1, y1);\n }\n\n squarify.ratio = function(x) {\n return custom((x = +x) > 1 ? x : 1);\n };\n\n return squarify;\n})(phi);\n\nfunction index$1() {\n var tile = squarify,\n round = false,\n dx = 1,\n dy = 1,\n paddingStack = [0],\n paddingInner = constantZero,\n paddingTop = constantZero,\n paddingRight = constantZero,\n paddingBottom = constantZero,\n paddingLeft = constantZero;\n\n function treemap(root) {\n root.x0 =\n root.y0 = 0;\n root.x1 = dx;\n root.y1 = dy;\n root.eachBefore(positionNode);\n paddingStack = [0];\n if (round) root.eachBefore(roundNode);\n return root;\n }\n\n function positionNode(node) {\n var p = paddingStack[node.depth],\n x0 = node.x0 + p,\n y0 = node.y0 + p,\n x1 = node.x1 - p,\n y1 = node.y1 - p;\n if (x1 < x0) x0 = x1 = (x0 + x1) / 2;\n if (y1 < y0) y0 = y1 = (y0 + y1) / 2;\n node.x0 = x0;\n node.y0 = y0;\n node.x1 = x1;\n node.y1 = y1;\n if (node.children) {\n p = paddingStack[node.depth + 1] = paddingInner(node) / 2;\n x0 += paddingLeft(node) - p;\n y0 += paddingTop(node) - p;\n x1 -= paddingRight(node) - p;\n y1 -= paddingBottom(node) - p;\n if (x1 < x0) x0 = x1 = (x0 + x1) / 2;\n if (y1 < y0) y0 = y1 = (y0 + y1) / 2;\n tile(node, x0, y0, x1, y1);\n }\n }\n\n treemap.round = function(x) {\n return arguments.length ? (round = !!x, treemap) : round;\n };\n\n treemap.size = function(x) {\n return arguments.length ? (dx = +x[0], dy = +x[1], treemap) : [dx, dy];\n };\n\n treemap.tile = function(x) {\n return arguments.length ? (tile = required(x), treemap) : tile;\n };\n\n treemap.padding = function(x) {\n return arguments.length ? treemap.paddingInner(x).paddingOuter(x) : treemap.paddingInner();\n };\n\n treemap.paddingInner = function(x) {\n return arguments.length ? (paddingInner = typeof x === \"function\" ? x : constant(+x), treemap) : paddingInner;\n };\n\n treemap.paddingOuter = function(x) {\n return arguments.length ? treemap.paddingTop(x).paddingRight(x).paddingBottom(x).paddingLeft(x) : treemap.paddingTop();\n };\n\n treemap.paddingTop = function(x) {\n return arguments.length ? (paddingTop = typeof x === \"function\" ? x : constant(+x), treemap) : paddingTop;\n };\n\n treemap.paddingRight = function(x) {\n return arguments.length ? (paddingRight = typeof x === \"function\" ? x : constant(+x), treemap) : paddingRight;\n };\n\n treemap.paddingBottom = function(x) {\n return arguments.length ? (paddingBottom = typeof x === \"function\" ? x : constant(+x), treemap) : paddingBottom;\n };\n\n treemap.paddingLeft = function(x) {\n return arguments.length ? (paddingLeft = typeof x === \"function\" ? x : constant(+x), treemap) : paddingLeft;\n };\n\n return treemap;\n}\n\nfunction binary(parent, x0, y0, x1, y1) {\n var nodes = parent.children,\n i, n = nodes.length,\n sum, sums = new Array(n + 1);\n\n for (sums[0] = sum = i = 0; i < n; ++i) {\n sums[i + 1] = sum += nodes[i].value;\n }\n\n partition(0, n, parent.value, x0, y0, x1, y1);\n\n function partition(i, j, value, x0, y0, x1, y1) {\n if (i >= j - 1) {\n var node = nodes[i];\n node.x0 = x0, node.y0 = y0;\n node.x1 = x1, node.y1 = y1;\n return;\n }\n\n var valueOffset = sums[i],\n valueTarget = (value / 2) + valueOffset,\n k = i + 1,\n hi = j - 1;\n\n while (k < hi) {\n var mid = k + hi >>> 1;\n if (sums[mid] < valueTarget) k = mid + 1;\n else hi = mid;\n }\n\n if ((valueTarget - sums[k - 1]) < (sums[k] - valueTarget) && i + 1 < k) --k;\n\n var valueLeft = sums[k] - valueOffset,\n valueRight = value - valueLeft;\n\n if ((x1 - x0) > (y1 - y0)) {\n var xk = value ? (x0 * valueRight + x1 * valueLeft) / value : x1;\n partition(i, k, valueLeft, x0, y0, xk, y1);\n partition(k, j, valueRight, xk, y0, x1, y1);\n } else {\n var yk = value ? (y0 * valueRight + y1 * valueLeft) / value : y1;\n partition(i, k, valueLeft, x0, y0, x1, yk);\n partition(k, j, valueRight, x0, yk, x1, y1);\n }\n }\n}\n\nfunction sliceDice(parent, x0, y0, x1, y1) {\n (parent.depth & 1 ? treemapSlice : treemapDice)(parent, x0, y0, x1, y1);\n}\n\nvar resquarify = (function custom(ratio) {\n\n function resquarify(parent, x0, y0, x1, y1) {\n if ((rows = parent._squarify) && (rows.ratio === ratio)) {\n var rows,\n row,\n nodes,\n i,\n j = -1,\n n,\n m = rows.length,\n value = parent.value;\n\n while (++j < m) {\n row = rows[j], nodes = row.children;\n for (i = row.value = 0, n = nodes.length; i < n; ++i) row.value += nodes[i].value;\n if (row.dice) treemapDice(row, x0, y0, x1, value ? y0 += (y1 - y0) * row.value / value : y1);\n else treemapSlice(row, x0, y0, value ? x0 += (x1 - x0) * row.value / value : x1, y1);\n value -= row.value;\n }\n } else {\n parent._squarify = rows = squarifyRatio(ratio, parent, x0, y0, x1, y1);\n rows.ratio = ratio;\n }\n }\n\n resquarify.ratio = function(x) {\n return custom((x = +x) > 1 ? x : 1);\n };\n\n return resquarify;\n})(phi);\n\nexports.cluster = cluster;\nexports.hierarchy = hierarchy;\nexports.pack = index;\nexports.packEnclose = enclose;\nexports.packSiblings = siblings;\nexports.partition = partition;\nexports.stratify = stratify;\nexports.tree = tree;\nexports.treemap = index$1;\nexports.treemapBinary = binary;\nexports.treemapDice = treemapDice;\nexports.treemapResquarify = resquarify;\nexports.treemapSlice = treemapSlice;\nexports.treemapSliceDice = sliceDice;\nexports.treemapSquarify = squarify;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","// https://d3js.org/d3-interpolate/ v2.0.1 Copyright 2020 Mike Bostock\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-color')) :\ntypeof define === 'function' && define.amd ? define(['exports', 'd3-color'], factory) :\n(global = global || self, factory(global.d3 = global.d3 || {}, global.d3));\n}(this, function (exports, d3Color) { 'use strict';\n\nfunction basis(t1, v0, v1, v2, v3) {\n var t2 = t1 * t1, t3 = t2 * t1;\n return ((1 - 3 * t1 + 3 * t2 - t3) * v0\n + (4 - 6 * t2 + 3 * t3) * v1\n + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2\n + t3 * v3) / 6;\n}\n\nfunction basis$1(values) {\n var n = values.length - 1;\n return function(t) {\n var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),\n v1 = values[i],\n v2 = values[i + 1],\n v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,\n v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n\nfunction basisClosed(values) {\n var n = values.length;\n return function(t) {\n var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),\n v0 = values[(i + n - 1) % n],\n v1 = values[i % n],\n v2 = values[(i + 1) % n],\n v3 = values[(i + 2) % n];\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n\nvar constant = x => () => x;\n\nfunction linear(a, d) {\n return function(t) {\n return a + t * d;\n };\n}\n\nfunction exponential(a, b, y) {\n return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {\n return Math.pow(a + t * b, y);\n };\n}\n\nfunction hue(a, b) {\n var d = b - a;\n return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);\n}\n\nfunction gamma(y) {\n return (y = +y) === 1 ? nogamma : function(a, b) {\n return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);\n };\n}\n\nfunction nogamma(a, b) {\n var d = b - a;\n return d ? linear(a, d) : constant(isNaN(a) ? b : a);\n}\n\nvar rgb = (function rgbGamma(y) {\n var color = gamma(y);\n\n function rgb(start, end) {\n var r = color((start = d3Color.rgb(start)).r, (end = d3Color.rgb(end)).r),\n g = color(start.g, end.g),\n b = color(start.b, end.b),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.r = r(t);\n start.g = g(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n rgb.gamma = rgbGamma;\n\n return rgb;\n})(1);\n\nfunction rgbSpline(spline) {\n return function(colors) {\n var n = colors.length,\n r = new Array(n),\n g = new Array(n),\n b = new Array(n),\n i, color;\n for (i = 0; i < n; ++i) {\n color = d3Color.rgb(colors[i]);\n r[i] = color.r || 0;\n g[i] = color.g || 0;\n b[i] = color.b || 0;\n }\n r = spline(r);\n g = spline(g);\n b = spline(b);\n color.opacity = 1;\n return function(t) {\n color.r = r(t);\n color.g = g(t);\n color.b = b(t);\n return color + \"\";\n };\n };\n}\n\nvar rgbBasis = rgbSpline(basis$1);\nvar rgbBasisClosed = rgbSpline(basisClosed);\n\nfunction numberArray(a, b) {\n if (!b) b = [];\n var n = a ? Math.min(b.length, a.length) : 0,\n c = b.slice(),\n i;\n return function(t) {\n for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;\n return c;\n };\n}\n\nfunction isNumberArray(x) {\n return ArrayBuffer.isView(x) && !(x instanceof DataView);\n}\n\nfunction array(a, b) {\n return (isNumberArray(b) ? numberArray : genericArray)(a, b);\n}\n\nfunction genericArray(a, b) {\n var nb = b ? b.length : 0,\n na = a ? Math.min(nb, a.length) : 0,\n x = new Array(na),\n c = new Array(nb),\n i;\n\n for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);\n for (; i < nb; ++i) c[i] = b[i];\n\n return function(t) {\n for (i = 0; i < na; ++i) c[i] = x[i](t);\n return c;\n };\n}\n\nfunction date(a, b) {\n var d = new Date;\n return a = +a, b = +b, function(t) {\n return d.setTime(a * (1 - t) + b * t), d;\n };\n}\n\nfunction number(a, b) {\n return a = +a, b = +b, function(t) {\n return a * (1 - t) + b * t;\n };\n}\n\nfunction object(a, b) {\n var i = {},\n c = {},\n k;\n\n if (a === null || typeof a !== \"object\") a = {};\n if (b === null || typeof b !== \"object\") b = {};\n\n for (k in b) {\n if (k in a) {\n i[k] = value(a[k], b[k]);\n } else {\n c[k] = b[k];\n }\n }\n\n return function(t) {\n for (k in i) c[k] = i[k](t);\n return c;\n };\n}\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,\n reB = new RegExp(reA.source, \"g\");\n\nfunction zero(b) {\n return function() {\n return b;\n };\n}\n\nfunction one(b) {\n return function(t) {\n return b(t) + \"\";\n };\n}\n\nfunction string(a, b) {\n var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n am, // current match in a\n bm, // current match in b\n bs, // string preceding current number in b, if any\n i = -1, // index in s\n s = [], // string constants and placeholders\n q = []; // number interpolators\n\n // Coerce inputs to strings.\n a = a + \"\", b = b + \"\";\n\n // Interpolate pairs of numbers in a & b.\n while ((am = reA.exec(a))\n && (bm = reB.exec(b))) {\n if ((bs = bm.index) > bi) { // a string precedes the next number in b\n bs = b.slice(bi, bs);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n if (s[i]) s[i] += bm; // coalesce with previous string\n else s[++i] = bm;\n } else { // interpolate non-matching numbers\n s[++i] = null;\n q.push({i: i, x: number(am, bm)});\n }\n bi = reB.lastIndex;\n }\n\n // Add remains of b.\n if (bi < b.length) {\n bs = b.slice(bi);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n\n // Special optimization for only a single match.\n // Otherwise, interpolate each of the numbers and rejoin the string.\n return s.length < 2 ? (q[0]\n ? one(q[0].x)\n : zero(b))\n : (b = q.length, function(t) {\n for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n });\n}\n\nfunction value(a, b) {\n var t = typeof b, c;\n return b == null || t === \"boolean\" ? constant(b)\n : (t === \"number\" ? number\n : t === \"string\" ? ((c = d3Color.color(b)) ? (b = c, rgb) : string)\n : b instanceof d3Color.color ? rgb\n : b instanceof Date ? date\n : isNumberArray(b) ? numberArray\n : Array.isArray(b) ? genericArray\n : typeof b.valueOf !== \"function\" && typeof b.toString !== \"function\" || isNaN(b) ? object\n : number)(a, b);\n}\n\nfunction discrete(range) {\n var n = range.length;\n return function(t) {\n return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];\n };\n}\n\nfunction hue$1(a, b) {\n var i = hue(+a, +b);\n return function(t) {\n var x = i(t);\n return x - 360 * Math.floor(x / 360);\n };\n}\n\nfunction round(a, b) {\n return a = +a, b = +b, function(t) {\n return Math.round(a * (1 - t) + b * t);\n };\n}\n\nvar degrees = 180 / Math.PI;\n\nvar identity = {\n translateX: 0,\n translateY: 0,\n rotate: 0,\n skewX: 0,\n scaleX: 1,\n scaleY: 1\n};\n\nfunction decompose(a, b, c, d, e, f) {\n var scaleX, scaleY, skewX;\n if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;\n if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;\n if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;\n if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;\n return {\n translateX: e,\n translateY: f,\n rotate: Math.atan2(b, a) * degrees,\n skewX: Math.atan(skewX) * degrees,\n scaleX: scaleX,\n scaleY: scaleY\n };\n}\n\nvar svgNode;\n\n/* eslint-disable no-undef */\nfunction parseCss(value) {\n const m = new (typeof DOMMatrix === \"function\" ? DOMMatrix : WebKitCSSMatrix)(value + \"\");\n return m.isIdentity ? identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f);\n}\n\nfunction parseSvg(value) {\n if (value == null) return identity;\n if (!svgNode) svgNode = document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n svgNode.setAttribute(\"transform\", value);\n if (!(value = svgNode.transform.baseVal.consolidate())) return identity;\n value = value.matrix;\n return decompose(value.a, value.b, value.c, value.d, value.e, value.f);\n}\n\nfunction interpolateTransform(parse, pxComma, pxParen, degParen) {\n\n function pop(s) {\n return s.length ? s.pop() + \" \" : \"\";\n }\n\n function translate(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(\"translate(\", null, pxComma, null, pxParen);\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb || yb) {\n s.push(\"translate(\" + xb + pxComma + yb + pxParen);\n }\n }\n\n function rotate(a, b, s, q) {\n if (a !== b) {\n if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path\n q.push({i: s.push(pop(s) + \"rotate(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"rotate(\" + b + degParen);\n }\n }\n\n function skewX(a, b, s, q) {\n if (a !== b) {\n q.push({i: s.push(pop(s) + \"skewX(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"skewX(\" + b + degParen);\n }\n }\n\n function scale(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(pop(s) + \"scale(\", null, \",\", null, \")\");\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb !== 1 || yb !== 1) {\n s.push(pop(s) + \"scale(\" + xb + \",\" + yb + \")\");\n }\n }\n\n return function(a, b) {\n var s = [], // string constants and placeholders\n q = []; // number interpolators\n a = parse(a), b = parse(b);\n translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);\n rotate(a.rotate, b.rotate, s, q);\n skewX(a.skewX, b.skewX, s, q);\n scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);\n a = b = null; // gc\n return function(t) {\n var i = -1, n = q.length, o;\n while (++i < n) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n };\n };\n}\n\nvar interpolateTransformCss = interpolateTransform(parseCss, \"px, \", \"px)\", \"deg)\");\nvar interpolateTransformSvg = interpolateTransform(parseSvg, \", \", \")\", \")\");\n\nvar epsilon2 = 1e-12;\n\nfunction cosh(x) {\n return ((x = Math.exp(x)) + 1 / x) / 2;\n}\n\nfunction sinh(x) {\n return ((x = Math.exp(x)) - 1 / x) / 2;\n}\n\nfunction tanh(x) {\n return ((x = Math.exp(2 * x)) - 1) / (x + 1);\n}\n\nvar zoom = (function zoomRho(rho, rho2, rho4) {\n\n // p0 = [ux0, uy0, w0]\n // p1 = [ux1, uy1, w1]\n function zoom(p0, p1) {\n var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],\n ux1 = p1[0], uy1 = p1[1], w1 = p1[2],\n dx = ux1 - ux0,\n dy = uy1 - uy0,\n d2 = dx * dx + dy * dy,\n i,\n S;\n\n // Special case for u0 ≅ u1.\n if (d2 < epsilon2) {\n S = Math.log(w1 / w0) / rho;\n i = function(t) {\n return [\n ux0 + t * dx,\n uy0 + t * dy,\n w0 * Math.exp(rho * t * S)\n ];\n };\n }\n\n // General case.\n else {\n var d1 = Math.sqrt(d2),\n b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),\n b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),\n r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),\n r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);\n S = (r1 - r0) / rho;\n i = function(t) {\n var s = t * S,\n coshr0 = cosh(r0),\n u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));\n return [\n ux0 + u * dx,\n uy0 + u * dy,\n w0 * coshr0 / cosh(rho * s + r0)\n ];\n };\n }\n\n i.duration = S * 1000 * rho / Math.SQRT2;\n\n return i;\n }\n\n zoom.rho = function(_) {\n var _1 = Math.max(1e-3, +_), _2 = _1 * _1, _4 = _2 * _2;\n return zoomRho(_1, _2, _4);\n };\n\n return zoom;\n})(Math.SQRT2, 2, 4);\n\nfunction hsl(hue) {\n return function(start, end) {\n var h = hue((start = d3Color.hsl(start)).h, (end = d3Color.hsl(end)).h),\n s = nogamma(start.s, end.s),\n l = nogamma(start.l, end.l),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\nvar hsl$1 = hsl(hue);\nvar hslLong = hsl(nogamma);\n\nfunction lab(start, end) {\n var l = nogamma((start = d3Color.lab(start)).l, (end = d3Color.lab(end)).l),\n a = nogamma(start.a, end.a),\n b = nogamma(start.b, end.b),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.l = l(t);\n start.a = a(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n}\n\nfunction hcl(hue) {\n return function(start, end) {\n var h = hue((start = d3Color.hcl(start)).h, (end = d3Color.hcl(end)).h),\n c = nogamma(start.c, end.c),\n l = nogamma(start.l, end.l),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.c = c(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\nvar hcl$1 = hcl(hue);\nvar hclLong = hcl(nogamma);\n\nfunction cubehelix(hue) {\n return (function cubehelixGamma(y) {\n y = +y;\n\n function cubehelix(start, end) {\n var h = hue((start = d3Color.cubehelix(start)).h, (end = d3Color.cubehelix(end)).h),\n s = nogamma(start.s, end.s),\n l = nogamma(start.l, end.l),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(Math.pow(t, y));\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n cubehelix.gamma = cubehelixGamma;\n\n return cubehelix;\n })(1);\n}\n\nvar cubehelix$1 = cubehelix(hue);\nvar cubehelixLong = cubehelix(nogamma);\n\nfunction piecewise(interpolate, values) {\n if (values === undefined) values = interpolate, interpolate = value;\n var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n);\n while (i < n) I[i] = interpolate(v, v = values[++i]);\n return function(t) {\n var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n)));\n return I[i](t - i);\n };\n}\n\nfunction quantize(interpolator, n) {\n var samples = new Array(n);\n for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1));\n return samples;\n}\n\nexports.interpolate = value;\nexports.interpolateArray = array;\nexports.interpolateBasis = basis$1;\nexports.interpolateBasisClosed = basisClosed;\nexports.interpolateCubehelix = cubehelix$1;\nexports.interpolateCubehelixLong = cubehelixLong;\nexports.interpolateDate = date;\nexports.interpolateDiscrete = discrete;\nexports.interpolateHcl = hcl$1;\nexports.interpolateHclLong = hclLong;\nexports.interpolateHsl = hsl$1;\nexports.interpolateHslLong = hslLong;\nexports.interpolateHue = hue$1;\nexports.interpolateLab = lab;\nexports.interpolateNumber = number;\nexports.interpolateNumberArray = numberArray;\nexports.interpolateObject = object;\nexports.interpolateRgb = rgb;\nexports.interpolateRgbBasis = rgbBasis;\nexports.interpolateRgbBasisClosed = rgbBasisClosed;\nexports.interpolateRound = round;\nexports.interpolateString = string;\nexports.interpolateTransformCss = interpolateTransformCss;\nexports.interpolateTransformSvg = interpolateTransformSvg;\nexports.interpolateZoom = zoom;\nexports.piecewise = piecewise;\nexports.quantize = quantize;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","// https://d3js.org/d3-path/ v2.0.0 Copyright 2020 Mike Bostock\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\ntypeof define === 'function' && define.amd ? define(['exports'], factory) :\n(global = global || self, factory(global.d3 = global.d3 || {}));\n}(this, function (exports) { 'use strict';\n\nconst pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction Path() {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n}\n\nfunction path() {\n return new Path;\n}\n\nPath.prototype = path.prototype = {\n constructor: Path,\n moveTo: function(x, y) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y);\n },\n closePath: function() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._ += \"Z\";\n }\n },\n lineTo: function(x, y) {\n this._ += \"L\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n quadraticCurveTo: function(x1, y1, x, y) {\n this._ += \"Q\" + (+x1) + \",\" + (+y1) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) {\n this._ += \"C\" + (+x1) + \",\" + (+y1) + \",\" + (+x2) + \",\" + (+y2) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n arcTo: function(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n var x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._ += \"M\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._ += \"L\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Otherwise, draw an arc!\n else {\n var x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._ += \"L\" + (x1 + t01 * x01) + \",\" + (y1 + t01 * y01);\n }\n\n this._ += \"A\" + r + \",\" + r + \",0,0,\" + (+(y01 * x20 > x01 * y20)) + \",\" + (this._x1 = x1 + t21 * x21) + \",\" + (this._y1 = y1 + t21 * y21);\n }\n },\n arc: function(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n var dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._ += \"M\" + x0 + \",\" + y0;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._ += \"L\" + x0 + \",\" + y0;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (x - dx) + \",\" + (y - dy) + \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (this._x1 = x0) + \",\" + (this._y1 = y0);\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,\" + (+(da >= pi)) + \",\" + cw + \",\" + (this._x1 = x + r * Math.cos(a1)) + \",\" + (this._y1 = y + r * Math.sin(a1));\n }\n },\n rect: function(x, y, w, h) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y) + \"h\" + (+w) + \"v\" + (+h) + \"h\" + (-w) + \"Z\";\n },\n toString: function() {\n return this._;\n }\n};\n\nexports.path = path;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","// https://d3js.org/d3-polygon/ v2.0.0 Copyright 2020 Mike Bostock\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\ntypeof define === 'function' && define.amd ? define(['exports'], factory) :\n(global = global || self, factory(global.d3 = global.d3 || {}));\n}(this, function (exports) { 'use strict';\n\nfunction area(polygon) {\n var i = -1,\n n = polygon.length,\n a,\n b = polygon[n - 1],\n area = 0;\n\n while (++i < n) {\n a = b;\n b = polygon[i];\n area += a[1] * b[0] - a[0] * b[1];\n }\n\n return area / 2;\n}\n\nfunction centroid(polygon) {\n var i = -1,\n n = polygon.length,\n x = 0,\n y = 0,\n a,\n b = polygon[n - 1],\n c,\n k = 0;\n\n while (++i < n) {\n a = b;\n b = polygon[i];\n k += c = a[0] * b[1] - b[0] * a[1];\n x += (a[0] + b[0]) * c;\n y += (a[1] + b[1]) * c;\n }\n\n return k *= 3, [x / k, y / k];\n}\n\n// Returns the 2D cross product of AB and AC vectors, i.e., the z-component of\n// the 3D cross product in a quadrant I Cartesian coordinate system (+x is\n// right, +y is up). Returns a positive value if ABC is counter-clockwise,\n// negative if clockwise, and zero if the points are collinear.\nfunction cross(a, b, c) {\n return (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]);\n}\n\nfunction lexicographicOrder(a, b) {\n return a[0] - b[0] || a[1] - b[1];\n}\n\n// Computes the upper convex hull per the monotone chain algorithm.\n// Assumes points.length >= 3, is sorted by x, unique in y.\n// Returns an array of indices into points in left-to-right order.\nfunction computeUpperHullIndexes(points) {\n const n = points.length,\n indexes = [0, 1];\n let size = 2, i;\n\n for (i = 2; i < n; ++i) {\n while (size > 1 && cross(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n indexes[size++] = i;\n }\n\n return indexes.slice(0, size); // remove popped points\n}\n\nfunction hull(points) {\n if ((n = points.length) < 3) return null;\n\n var i,\n n,\n sortedPoints = new Array(n),\n flippedPoints = new Array(n);\n\n for (i = 0; i < n; ++i) sortedPoints[i] = [+points[i][0], +points[i][1], i];\n sortedPoints.sort(lexicographicOrder);\n for (i = 0; i < n; ++i) flippedPoints[i] = [sortedPoints[i][0], -sortedPoints[i][1]];\n\n var upperIndexes = computeUpperHullIndexes(sortedPoints),\n lowerIndexes = computeUpperHullIndexes(flippedPoints);\n\n // Construct the hull polygon, removing possible duplicate endpoints.\n var skipLeft = lowerIndexes[0] === upperIndexes[0],\n skipRight = lowerIndexes[lowerIndexes.length - 1] === upperIndexes[upperIndexes.length - 1],\n hull = [];\n\n // Add upper hull in right-to-l order.\n // Then add lower hull in left-to-right order.\n for (i = upperIndexes.length - 1; i >= 0; --i) hull.push(points[sortedPoints[upperIndexes[i]][2]]);\n for (i = +skipLeft; i < lowerIndexes.length - skipRight; ++i) hull.push(points[sortedPoints[lowerIndexes[i]][2]]);\n\n return hull;\n}\n\nfunction contains(polygon, point) {\n var n = polygon.length,\n p = polygon[n - 1],\n x = point[0], y = point[1],\n x0 = p[0], y0 = p[1],\n x1, y1,\n inside = false;\n\n for (var i = 0; i < n; ++i) {\n p = polygon[i], x1 = p[0], y1 = p[1];\n if (((y1 > y) !== (y0 > y)) && (x < (x0 - x1) * (y - y1) / (y0 - y1) + x1)) inside = !inside;\n x0 = x1, y0 = y1;\n }\n\n return inside;\n}\n\nfunction length(polygon) {\n var i = -1,\n n = polygon.length,\n b = polygon[n - 1],\n xa,\n ya,\n xb = b[0],\n yb = b[1],\n perimeter = 0;\n\n while (++i < n) {\n xa = xb;\n ya = yb;\n b = polygon[i];\n xb = b[0];\n yb = b[1];\n xa -= xb;\n ya -= yb;\n perimeter += Math.hypot(xa, ya);\n }\n\n return perimeter;\n}\n\nexports.polygonArea = area;\nexports.polygonCentroid = centroid;\nexports.polygonContains = contains;\nexports.polygonHull = hull;\nexports.polygonLength = length;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","// https://d3js.org/d3-quadtree/ v2.0.0 Copyright 2020 Mike Bostock\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\ntypeof define === 'function' && define.amd ? define(['exports'], factory) :\n(global = global || self, factory(global.d3 = global.d3 || {}));\n}(this, function (exports) { 'use strict';\n\nfunction tree_add(d) {\n const x = +this._x.call(null, d),\n y = +this._y.call(null, d);\n return add(this.cover(x, y), x, y, d);\n}\n\nfunction add(tree, x, y, d) {\n if (isNaN(x) || isNaN(y)) return tree; // ignore invalid points\n\n var parent,\n node = tree._root,\n leaf = {data: d},\n x0 = tree._x0,\n y0 = tree._y0,\n x1 = tree._x1,\n y1 = tree._y1,\n xm,\n ym,\n xp,\n yp,\n right,\n bottom,\n i,\n j;\n\n // If the tree is empty, initialize the root as a leaf.\n if (!node) return tree._root = leaf, tree;\n\n // Find the existing leaf for the new point, or add it.\n while (node.length) {\n if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;\n if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;\n if (parent = node, !(node = node[i = bottom << 1 | right])) return parent[i] = leaf, tree;\n }\n\n // Is the new point is exactly coincident with the existing point?\n xp = +tree._x.call(null, node.data);\n yp = +tree._y.call(null, node.data);\n if (x === xp && y === yp) return leaf.next = node, parent ? parent[i] = leaf : tree._root = leaf, tree;\n\n // Otherwise, split the leaf node until the old and new point are separated.\n do {\n parent = parent ? parent[i] = new Array(4) : tree._root = new Array(4);\n if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;\n if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;\n } while ((i = bottom << 1 | right) === (j = (yp >= ym) << 1 | (xp >= xm)));\n return parent[j] = node, parent[i] = leaf, tree;\n}\n\nfunction addAll(data) {\n var d, i, n = data.length,\n x,\n y,\n xz = new Array(n),\n yz = new Array(n),\n x0 = Infinity,\n y0 = Infinity,\n x1 = -Infinity,\n y1 = -Infinity;\n\n // Compute the points and their extent.\n for (i = 0; i < n; ++i) {\n if (isNaN(x = +this._x.call(null, d = data[i])) || isNaN(y = +this._y.call(null, d))) continue;\n xz[i] = x;\n yz[i] = y;\n if (x < x0) x0 = x;\n if (x > x1) x1 = x;\n if (y < y0) y0 = y;\n if (y > y1) y1 = y;\n }\n\n // If there were no (valid) points, abort.\n if (x0 > x1 || y0 > y1) return this;\n\n // Expand the tree to cover the new points.\n this.cover(x0, y0).cover(x1, y1);\n\n // Add the new points.\n for (i = 0; i < n; ++i) {\n add(this, xz[i], yz[i], data[i]);\n }\n\n return this;\n}\n\nfunction tree_cover(x, y) {\n if (isNaN(x = +x) || isNaN(y = +y)) return this; // ignore invalid points\n\n var x0 = this._x0,\n y0 = this._y0,\n x1 = this._x1,\n y1 = this._y1;\n\n // If the quadtree has no extent, initialize them.\n // Integer extent are necessary so that if we later double the extent,\n // the existing quadrant boundaries don’t change due to floating point error!\n if (isNaN(x0)) {\n x1 = (x0 = Math.floor(x)) + 1;\n y1 = (y0 = Math.floor(y)) + 1;\n }\n\n // Otherwise, double repeatedly to cover.\n else {\n var z = x1 - x0 || 1,\n node = this._root,\n parent,\n i;\n\n while (x0 > x || x >= x1 || y0 > y || y >= y1) {\n i = (y < y0) << 1 | (x < x0);\n parent = new Array(4), parent[i] = node, node = parent, z *= 2;\n switch (i) {\n case 0: x1 = x0 + z, y1 = y0 + z; break;\n case 1: x0 = x1 - z, y1 = y0 + z; break;\n case 2: x1 = x0 + z, y0 = y1 - z; break;\n case 3: x0 = x1 - z, y0 = y1 - z; break;\n }\n }\n\n if (this._root && this._root.length) this._root = node;\n }\n\n this._x0 = x0;\n this._y0 = y0;\n this._x1 = x1;\n this._y1 = y1;\n return this;\n}\n\nfunction tree_data() {\n var data = [];\n this.visit(function(node) {\n if (!node.length) do data.push(node.data); while (node = node.next)\n });\n return data;\n}\n\nfunction tree_extent(_) {\n return arguments.length\n ? this.cover(+_[0][0], +_[0][1]).cover(+_[1][0], +_[1][1])\n : isNaN(this._x0) ? undefined : [[this._x0, this._y0], [this._x1, this._y1]];\n}\n\nfunction Quad(node, x0, y0, x1, y1) {\n this.node = node;\n this.x0 = x0;\n this.y0 = y0;\n this.x1 = x1;\n this.y1 = y1;\n}\n\nfunction tree_find(x, y, radius) {\n var data,\n x0 = this._x0,\n y0 = this._y0,\n x1,\n y1,\n x2,\n y2,\n x3 = this._x1,\n y3 = this._y1,\n quads = [],\n node = this._root,\n q,\n i;\n\n if (node) quads.push(new Quad(node, x0, y0, x3, y3));\n if (radius == null) radius = Infinity;\n else {\n x0 = x - radius, y0 = y - radius;\n x3 = x + radius, y3 = y + radius;\n radius *= radius;\n }\n\n while (q = quads.pop()) {\n\n // Stop searching if this quadrant can’t contain a closer node.\n if (!(node = q.node)\n || (x1 = q.x0) > x3\n || (y1 = q.y0) > y3\n || (x2 = q.x1) < x0\n || (y2 = q.y1) < y0) continue;\n\n // Bisect the current quadrant.\n if (node.length) {\n var xm = (x1 + x2) / 2,\n ym = (y1 + y2) / 2;\n\n quads.push(\n new Quad(node[3], xm, ym, x2, y2),\n new Quad(node[2], x1, ym, xm, y2),\n new Quad(node[1], xm, y1, x2, ym),\n new Quad(node[0], x1, y1, xm, ym)\n );\n\n // Visit the closest quadrant first.\n if (i = (y >= ym) << 1 | (x >= xm)) {\n q = quads[quads.length - 1];\n quads[quads.length - 1] = quads[quads.length - 1 - i];\n quads[quads.length - 1 - i] = q;\n }\n }\n\n // Visit this point. (Visiting coincident points isn’t necessary!)\n else {\n var dx = x - +this._x.call(null, node.data),\n dy = y - +this._y.call(null, node.data),\n d2 = dx * dx + dy * dy;\n if (d2 < radius) {\n var d = Math.sqrt(radius = d2);\n x0 = x - d, y0 = y - d;\n x3 = x + d, y3 = y + d;\n data = node.data;\n }\n }\n }\n\n return data;\n}\n\nfunction tree_remove(d) {\n if (isNaN(x = +this._x.call(null, d)) || isNaN(y = +this._y.call(null, d))) return this; // ignore invalid points\n\n var parent,\n node = this._root,\n retainer,\n previous,\n next,\n x0 = this._x0,\n y0 = this._y0,\n x1 = this._x1,\n y1 = this._y1,\n x,\n y,\n xm,\n ym,\n right,\n bottom,\n i,\n j;\n\n // If the tree is empty, initialize the root as a leaf.\n if (!node) return this;\n\n // Find the leaf node for the point.\n // While descending, also retain the deepest parent with a non-removed sibling.\n if (node.length) while (true) {\n if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;\n if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;\n if (!(parent = node, node = node[i = bottom << 1 | right])) return this;\n if (!node.length) break;\n if (parent[(i + 1) & 3] || parent[(i + 2) & 3] || parent[(i + 3) & 3]) retainer = parent, j = i;\n }\n\n // Find the point to remove.\n while (node.data !== d) if (!(previous = node, node = node.next)) return this;\n if (next = node.next) delete node.next;\n\n // If there are multiple coincident points, remove just the point.\n if (previous) return (next ? previous.next = next : delete previous.next), this;\n\n // If this is the root point, remove it.\n if (!parent) return this._root = next, this;\n\n // Remove this leaf.\n next ? parent[i] = next : delete parent[i];\n\n // If the parent now contains exactly one leaf, collapse superfluous parents.\n if ((node = parent[0] || parent[1] || parent[2] || parent[3])\n && node === (parent[3] || parent[2] || parent[1] || parent[0])\n && !node.length) {\n if (retainer) retainer[j] = node;\n else this._root = node;\n }\n\n return this;\n}\n\nfunction removeAll(data) {\n for (var i = 0, n = data.length; i < n; ++i) this.remove(data[i]);\n return this;\n}\n\nfunction tree_root() {\n return this._root;\n}\n\nfunction tree_size() {\n var size = 0;\n this.visit(function(node) {\n if (!node.length) do ++size; while (node = node.next)\n });\n return size;\n}\n\nfunction tree_visit(callback) {\n var quads = [], q, node = this._root, child, x0, y0, x1, y1;\n if (node) quads.push(new Quad(node, this._x0, this._y0, this._x1, this._y1));\n while (q = quads.pop()) {\n if (!callback(node = q.node, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1) && node.length) {\n var xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;\n if (child = node[3]) quads.push(new Quad(child, xm, ym, x1, y1));\n if (child = node[2]) quads.push(new Quad(child, x0, ym, xm, y1));\n if (child = node[1]) quads.push(new Quad(child, xm, y0, x1, ym));\n if (child = node[0]) quads.push(new Quad(child, x0, y0, xm, ym));\n }\n }\n return this;\n}\n\nfunction tree_visitAfter(callback) {\n var quads = [], next = [], q;\n if (this._root) quads.push(new Quad(this._root, this._x0, this._y0, this._x1, this._y1));\n while (q = quads.pop()) {\n var node = q.node;\n if (node.length) {\n var child, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1, xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;\n if (child = node[0]) quads.push(new Quad(child, x0, y0, xm, ym));\n if (child = node[1]) quads.push(new Quad(child, xm, y0, x1, ym));\n if (child = node[2]) quads.push(new Quad(child, x0, ym, xm, y1));\n if (child = node[3]) quads.push(new Quad(child, xm, ym, x1, y1));\n }\n next.push(q);\n }\n while (q = next.pop()) {\n callback(q.node, q.x0, q.y0, q.x1, q.y1);\n }\n return this;\n}\n\nfunction defaultX(d) {\n return d[0];\n}\n\nfunction tree_x(_) {\n return arguments.length ? (this._x = _, this) : this._x;\n}\n\nfunction defaultY(d) {\n return d[1];\n}\n\nfunction tree_y(_) {\n return arguments.length ? (this._y = _, this) : this._y;\n}\n\nfunction quadtree(nodes, x, y) {\n var tree = new Quadtree(x == null ? defaultX : x, y == null ? defaultY : y, NaN, NaN, NaN, NaN);\n return nodes == null ? tree : tree.addAll(nodes);\n}\n\nfunction Quadtree(x, y, x0, y0, x1, y1) {\n this._x = x;\n this._y = y;\n this._x0 = x0;\n this._y0 = y0;\n this._x1 = x1;\n this._y1 = y1;\n this._root = undefined;\n}\n\nfunction leaf_copy(leaf) {\n var copy = {data: leaf.data}, next = copy;\n while (leaf = leaf.next) next = next.next = {data: leaf.data};\n return copy;\n}\n\nvar treeProto = quadtree.prototype = Quadtree.prototype;\n\ntreeProto.copy = function() {\n var copy = new Quadtree(this._x, this._y, this._x0, this._y0, this._x1, this._y1),\n node = this._root,\n nodes,\n child;\n\n if (!node) return copy;\n\n if (!node.length) return copy._root = leaf_copy(node), copy;\n\n nodes = [{source: node, target: copy._root = new Array(4)}];\n while (node = nodes.pop()) {\n for (var i = 0; i < 4; ++i) {\n if (child = node.source[i]) {\n if (child.length) nodes.push({source: child, target: node.target[i] = new Array(4)});\n else node.target[i] = leaf_copy(child);\n }\n }\n }\n\n return copy;\n};\n\ntreeProto.add = tree_add;\ntreeProto.addAll = addAll;\ntreeProto.cover = tree_cover;\ntreeProto.data = tree_data;\ntreeProto.extent = tree_extent;\ntreeProto.find = tree_find;\ntreeProto.remove = tree_remove;\ntreeProto.removeAll = removeAll;\ntreeProto.root = tree_root;\ntreeProto.size = tree_size;\ntreeProto.visit = tree_visit;\ntreeProto.visitAfter = tree_visitAfter;\ntreeProto.x = tree_x;\ntreeProto.y = tree_y;\n\nexports.quadtree = quadtree;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","// https://d3js.org/d3-random/ v2.2.2 Copyright 2020 Mike Bostock\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\ntypeof define === 'function' && define.amd ? define(['exports'], factory) :\n(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.d3 = global.d3 || {}));\n}(this, (function (exports) { 'use strict';\n\nvar defaultSource = Math.random;\n\nvar uniform = (function sourceRandomUniform(source) {\n function randomUniform(min, max) {\n min = min == null ? 0 : +min;\n max = max == null ? 1 : +max;\n if (arguments.length === 1) max = min, min = 0;\n else max -= min;\n return function() {\n return source() * max + min;\n };\n }\n\n randomUniform.source = sourceRandomUniform;\n\n return randomUniform;\n})(defaultSource);\n\nvar int = (function sourceRandomInt(source) {\n function randomInt(min, max) {\n if (arguments.length < 2) max = min, min = 0;\n min = Math.floor(min);\n max = Math.floor(max) - min;\n return function() {\n return Math.floor(source() * max + min);\n };\n }\n\n randomInt.source = sourceRandomInt;\n\n return randomInt;\n})(defaultSource);\n\nvar normal = (function sourceRandomNormal(source) {\n function randomNormal(mu, sigma) {\n var x, r;\n mu = mu == null ? 0 : +mu;\n sigma = sigma == null ? 1 : +sigma;\n return function() {\n var y;\n\n // If available, use the second previously-generated uniform random.\n if (x != null) y = x, x = null;\n\n // Otherwise, generate a new x and y.\n else do {\n x = source() * 2 - 1;\n y = source() * 2 - 1;\n r = x * x + y * y;\n } while (!r || r > 1);\n\n return mu + sigma * y * Math.sqrt(-2 * Math.log(r) / r);\n };\n }\n\n randomNormal.source = sourceRandomNormal;\n\n return randomNormal;\n})(defaultSource);\n\nvar logNormal = (function sourceRandomLogNormal(source) {\n var N = normal.source(source);\n\n function randomLogNormal() {\n var randomNormal = N.apply(this, arguments);\n return function() {\n return Math.exp(randomNormal());\n };\n }\n\n randomLogNormal.source = sourceRandomLogNormal;\n\n return randomLogNormal;\n})(defaultSource);\n\nvar irwinHall = (function sourceRandomIrwinHall(source) {\n function randomIrwinHall(n) {\n if ((n = +n) <= 0) return () => 0;\n return function() {\n for (var sum = 0, i = n; i > 1; --i) sum += source();\n return sum + i * source();\n };\n }\n\n randomIrwinHall.source = sourceRandomIrwinHall;\n\n return randomIrwinHall;\n})(defaultSource);\n\nvar bates = (function sourceRandomBates(source) {\n var I = irwinHall.source(source);\n\n function randomBates(n) {\n // use limiting distribution at n === 0\n if ((n = +n) === 0) return source;\n var randomIrwinHall = I(n);\n return function() {\n return randomIrwinHall() / n;\n };\n }\n\n randomBates.source = sourceRandomBates;\n\n return randomBates;\n})(defaultSource);\n\nvar exponential = (function sourceRandomExponential(source) {\n function randomExponential(lambda) {\n return function() {\n return -Math.log1p(-source()) / lambda;\n };\n }\n\n randomExponential.source = sourceRandomExponential;\n\n return randomExponential;\n})(defaultSource);\n\nvar pareto = (function sourceRandomPareto(source) {\n function randomPareto(alpha) {\n if ((alpha = +alpha) < 0) throw new RangeError(\"invalid alpha\");\n alpha = 1 / -alpha;\n return function() {\n return Math.pow(1 - source(), alpha);\n };\n }\n\n randomPareto.source = sourceRandomPareto;\n\n return randomPareto;\n})(defaultSource);\n\nvar bernoulli = (function sourceRandomBernoulli(source) {\n function randomBernoulli(p) {\n if ((p = +p) < 0 || p > 1) throw new RangeError(\"invalid p\");\n return function() {\n return Math.floor(source() + p);\n };\n }\n\n randomBernoulli.source = sourceRandomBernoulli;\n\n return randomBernoulli;\n})(defaultSource);\n\nvar geometric = (function sourceRandomGeometric(source) {\n function randomGeometric(p) {\n if ((p = +p) < 0 || p > 1) throw new RangeError(\"invalid p\");\n if (p === 0) return () => Infinity;\n if (p === 1) return () => 1;\n p = Math.log1p(-p);\n return function() {\n return 1 + Math.floor(Math.log1p(-source()) / p);\n };\n }\n\n randomGeometric.source = sourceRandomGeometric;\n\n return randomGeometric;\n})(defaultSource);\n\nvar gamma = (function sourceRandomGamma(source) {\n var randomNormal = normal.source(source)();\n\n function randomGamma(k, theta) {\n if ((k = +k) < 0) throw new RangeError(\"invalid k\");\n // degenerate distribution if k === 0\n if (k === 0) return () => 0;\n theta = theta == null ? 1 : +theta;\n // exponential distribution if k === 1\n if (k === 1) return () => -Math.log1p(-source()) * theta;\n\n var d = (k < 1 ? k + 1 : k) - 1 / 3,\n c = 1 / (3 * Math.sqrt(d)),\n multiplier = k < 1 ? () => Math.pow(source(), 1 / k) : () => 1;\n return function() {\n do {\n do {\n var x = randomNormal(),\n v = 1 + c * x;\n } while (v <= 0);\n v *= v * v;\n var u = 1 - source();\n } while (u >= 1 - 0.0331 * x * x * x * x && Math.log(u) >= 0.5 * x * x + d * (1 - v + Math.log(v)));\n return d * v * multiplier() * theta;\n };\n }\n\n randomGamma.source = sourceRandomGamma;\n\n return randomGamma;\n})(defaultSource);\n\nvar beta = (function sourceRandomBeta(source) {\n var G = gamma.source(source);\n\n function randomBeta(alpha, beta) {\n var X = G(alpha),\n Y = G(beta);\n return function() {\n var x = X();\n return x === 0 ? 0 : x / (x + Y());\n };\n }\n\n randomBeta.source = sourceRandomBeta;\n\n return randomBeta;\n})(defaultSource);\n\nvar binomial = (function sourceRandomBinomial(source) {\n var G = geometric.source(source),\n B = beta.source(source);\n\n function randomBinomial(n, p) {\n n = +n;\n if ((p = +p) >= 1) return () => n;\n if (p <= 0) return () => 0;\n return function() {\n var acc = 0, nn = n, pp = p;\n while (nn * pp > 16 && nn * (1 - pp) > 16) {\n var i = Math.floor((nn + 1) * pp),\n y = B(i, nn - i + 1)();\n if (y <= pp) {\n acc += i;\n nn -= i;\n pp = (pp - y) / (1 - y);\n } else {\n nn = i - 1;\n pp /= y;\n }\n }\n var sign = pp < 0.5,\n pFinal = sign ? pp : 1 - pp,\n g = G(pFinal);\n for (var s = g(), k = 0; s <= nn; ++k) s += g();\n return acc + (sign ? k : nn - k);\n };\n }\n\n randomBinomial.source = sourceRandomBinomial;\n\n return randomBinomial;\n})(defaultSource);\n\nvar weibull = (function sourceRandomWeibull(source) {\n function randomWeibull(k, a, b) {\n var outerFunc;\n if ((k = +k) === 0) {\n outerFunc = x => -Math.log(x);\n } else {\n k = 1 / k;\n outerFunc = x => Math.pow(x, k);\n }\n a = a == null ? 0 : +a;\n b = b == null ? 1 : +b;\n return function() {\n return a + b * outerFunc(-Math.log1p(-source()));\n };\n }\n\n randomWeibull.source = sourceRandomWeibull;\n\n return randomWeibull;\n})(defaultSource);\n\nvar cauchy = (function sourceRandomCauchy(source) {\n function randomCauchy(a, b) {\n a = a == null ? 0 : +a;\n b = b == null ? 1 : +b;\n return function() {\n return a + b * Math.tan(Math.PI * source());\n };\n }\n\n randomCauchy.source = sourceRandomCauchy;\n\n return randomCauchy;\n})(defaultSource);\n\nvar logistic = (function sourceRandomLogistic(source) {\n function randomLogistic(a, b) {\n a = a == null ? 0 : +a;\n b = b == null ? 1 : +b;\n return function() {\n var u = source();\n return a + b * Math.log(u / (1 - u));\n };\n }\n\n randomLogistic.source = sourceRandomLogistic;\n\n return randomLogistic;\n})(defaultSource);\n\nvar poisson = (function sourceRandomPoisson(source) {\n var G = gamma.source(source),\n B = binomial.source(source);\n\n function randomPoisson(lambda) {\n return function() {\n var acc = 0, l = lambda;\n while (l > 16) {\n var n = Math.floor(0.875 * l),\n t = G(n)();\n if (t > l) return acc + B(n - 1, l / t)();\n acc += n;\n l -= t;\n }\n for (var s = -Math.log1p(-source()), k = 0; s <= l; ++k) s -= Math.log1p(-source());\n return acc + k;\n };\n }\n\n randomPoisson.source = sourceRandomPoisson;\n\n return randomPoisson;\n})(defaultSource);\n\n// https://en.wikipedia.org/wiki/Linear_congruential_generator#Parameters_in_common_use\nconst mul = 0x19660D;\nconst inc = 0x3C6EF35F;\nconst eps = 1 / 0x100000000;\n\nfunction lcg(seed = Math.random()) {\n let state = (0 <= seed && seed < 1 ? seed / eps : Math.abs(seed)) | 0;\n return () => (state = mul * state + inc | 0, eps * (state >>> 0));\n}\n\nexports.randomBates = bates;\nexports.randomBernoulli = bernoulli;\nexports.randomBeta = beta;\nexports.randomBinomial = binomial;\nexports.randomCauchy = cauchy;\nexports.randomExponential = exponential;\nexports.randomGamma = gamma;\nexports.randomGeometric = geometric;\nexports.randomInt = int;\nexports.randomIrwinHall = irwinHall;\nexports.randomLcg = lcg;\nexports.randomLogNormal = logNormal;\nexports.randomLogistic = logistic;\nexports.randomNormal = normal;\nexports.randomPareto = pareto;\nexports.randomPoisson = poisson;\nexports.randomUniform = uniform;\nexports.randomWeibull = weibull;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n","// https://d3js.org/d3-scale-chromatic/ v2.0.0 Copyright 2020 Mike Bostock\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-interpolate'), require('d3-color')) :\ntypeof define === 'function' && define.amd ? define(['exports', 'd3-interpolate', 'd3-color'], factory) :\n(global = global || self, factory(global.d3 = global.d3 || {}, global.d3, global.d3));\n}(this, function (exports, d3Interpolate, d3Color) { 'use strict';\n\nfunction colors(specifier) {\n var n = specifier.length / 6 | 0, colors = new Array(n), i = 0;\n while (i < n) colors[i] = \"#\" + specifier.slice(i * 6, ++i * 6);\n return colors;\n}\n\nvar category10 = colors(\"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf\");\n\nvar Accent = colors(\"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666\");\n\nvar Dark2 = colors(\"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666\");\n\nvar Paired = colors(\"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928\");\n\nvar Pastel1 = colors(\"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2\");\n\nvar Pastel2 = colors(\"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc\");\n\nvar Set1 = colors(\"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999\");\n\nvar Set2 = colors(\"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3\");\n\nvar Set3 = colors(\"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f\");\n\nvar Tableau10 = colors(\"4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab\");\n\nvar ramp = scheme => d3Interpolate.interpolateRgbBasis(scheme[scheme.length - 1]);\n\nvar scheme = new Array(3).concat(\n \"d8b365f5f5f55ab4ac\",\n \"a6611adfc27d80cdc1018571\",\n \"a6611adfc27df5f5f580cdc1018571\",\n \"8c510ad8b365f6e8c3c7eae55ab4ac01665e\",\n \"8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e\",\n \"8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e\",\n \"8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e\",\n \"5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30\",\n \"5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30\"\n).map(colors);\n\nvar BrBG = ramp(scheme);\n\nvar scheme$1 = new Array(3).concat(\n \"af8dc3f7f7f77fbf7b\",\n \"7b3294c2a5cfa6dba0008837\",\n \"7b3294c2a5cff7f7f7a6dba0008837\",\n \"762a83af8dc3e7d4e8d9f0d37fbf7b1b7837\",\n \"762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837\",\n \"762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837\",\n \"762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837\",\n \"40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b\",\n \"40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b\"\n).map(colors);\n\nvar PRGn = ramp(scheme$1);\n\nvar scheme$2 = new Array(3).concat(\n \"e9a3c9f7f7f7a1d76a\",\n \"d01c8bf1b6dab8e1864dac26\",\n \"d01c8bf1b6daf7f7f7b8e1864dac26\",\n \"c51b7de9a3c9fde0efe6f5d0a1d76a4d9221\",\n \"c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221\",\n \"c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221\",\n \"c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221\",\n \"8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419\",\n \"8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419\"\n).map(colors);\n\nvar PiYG = ramp(scheme$2);\n\nvar scheme$3 = new Array(3).concat(\n \"998ec3f7f7f7f1a340\",\n \"5e3c99b2abd2fdb863e66101\",\n \"5e3c99b2abd2f7f7f7fdb863e66101\",\n \"542788998ec3d8daebfee0b6f1a340b35806\",\n \"542788998ec3d8daebf7f7f7fee0b6f1a340b35806\",\n \"5427888073acb2abd2d8daebfee0b6fdb863e08214b35806\",\n \"5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806\",\n \"2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08\",\n \"2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08\"\n).map(colors);\n\nvar PuOr = ramp(scheme$3);\n\nvar scheme$4 = new Array(3).concat(\n \"ef8a62f7f7f767a9cf\",\n \"ca0020f4a58292c5de0571b0\",\n \"ca0020f4a582f7f7f792c5de0571b0\",\n \"b2182bef8a62fddbc7d1e5f067a9cf2166ac\",\n \"b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac\",\n \"b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac\",\n \"b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac\",\n \"67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061\",\n \"67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061\"\n).map(colors);\n\nvar RdBu = ramp(scheme$4);\n\nvar scheme$5 = new Array(3).concat(\n \"ef8a62ffffff999999\",\n \"ca0020f4a582bababa404040\",\n \"ca0020f4a582ffffffbababa404040\",\n \"b2182bef8a62fddbc7e0e0e09999994d4d4d\",\n \"b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d\",\n \"b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d\",\n \"b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d\",\n \"67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a\",\n \"67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a\"\n).map(colors);\n\nvar RdGy = ramp(scheme$5);\n\nvar scheme$6 = new Array(3).concat(\n \"fc8d59ffffbf91bfdb\",\n \"d7191cfdae61abd9e92c7bb6\",\n \"d7191cfdae61ffffbfabd9e92c7bb6\",\n \"d73027fc8d59fee090e0f3f891bfdb4575b4\",\n \"d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4\",\n \"d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4\",\n \"d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4\",\n \"a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695\",\n \"a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695\"\n).map(colors);\n\nvar RdYlBu = ramp(scheme$6);\n\nvar scheme$7 = new Array(3).concat(\n \"fc8d59ffffbf91cf60\",\n \"d7191cfdae61a6d96a1a9641\",\n \"d7191cfdae61ffffbfa6d96a1a9641\",\n \"d73027fc8d59fee08bd9ef8b91cf601a9850\",\n \"d73027fc8d59fee08bffffbfd9ef8b91cf601a9850\",\n \"d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850\",\n \"d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850\",\n \"a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837\",\n \"a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837\"\n).map(colors);\n\nvar RdYlGn = ramp(scheme$7);\n\nvar scheme$8 = new Array(3).concat(\n \"fc8d59ffffbf99d594\",\n \"d7191cfdae61abdda42b83ba\",\n \"d7191cfdae61ffffbfabdda42b83ba\",\n \"d53e4ffc8d59fee08be6f59899d5943288bd\",\n \"d53e4ffc8d59fee08bffffbfe6f59899d5943288bd\",\n \"d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd\",\n \"d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd\",\n \"9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2\",\n \"9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2\"\n).map(colors);\n\nvar Spectral = ramp(scheme$8);\n\nvar scheme$9 = new Array(3).concat(\n \"e5f5f999d8c92ca25f\",\n \"edf8fbb2e2e266c2a4238b45\",\n \"edf8fbb2e2e266c2a42ca25f006d2c\",\n \"edf8fbccece699d8c966c2a42ca25f006d2c\",\n \"edf8fbccece699d8c966c2a441ae76238b45005824\",\n \"f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824\",\n \"f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b\"\n).map(colors);\n\nvar BuGn = ramp(scheme$9);\n\nvar scheme$a = new Array(3).concat(\n \"e0ecf49ebcda8856a7\",\n \"edf8fbb3cde38c96c688419d\",\n \"edf8fbb3cde38c96c68856a7810f7c\",\n \"edf8fbbfd3e69ebcda8c96c68856a7810f7c\",\n \"edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b\",\n \"f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b\",\n \"f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b\"\n).map(colors);\n\nvar BuPu = ramp(scheme$a);\n\nvar scheme$b = new Array(3).concat(\n \"e0f3dba8ddb543a2ca\",\n \"f0f9e8bae4bc7bccc42b8cbe\",\n \"f0f9e8bae4bc7bccc443a2ca0868ac\",\n \"f0f9e8ccebc5a8ddb57bccc443a2ca0868ac\",\n \"f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e\",\n \"f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e\",\n \"f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081\"\n).map(colors);\n\nvar GnBu = ramp(scheme$b);\n\nvar scheme$c = new Array(3).concat(\n \"fee8c8fdbb84e34a33\",\n \"fef0d9fdcc8afc8d59d7301f\",\n \"fef0d9fdcc8afc8d59e34a33b30000\",\n \"fef0d9fdd49efdbb84fc8d59e34a33b30000\",\n \"fef0d9fdd49efdbb84fc8d59ef6548d7301f990000\",\n \"fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000\",\n \"fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000\"\n).map(colors);\n\nvar OrRd = ramp(scheme$c);\n\nvar scheme$d = new Array(3).concat(\n \"ece2f0a6bddb1c9099\",\n \"f6eff7bdc9e167a9cf02818a\",\n \"f6eff7bdc9e167a9cf1c9099016c59\",\n \"f6eff7d0d1e6a6bddb67a9cf1c9099016c59\",\n \"f6eff7d0d1e6a6bddb67a9cf3690c002818a016450\",\n \"fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450\",\n \"fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636\"\n).map(colors);\n\nvar PuBuGn = ramp(scheme$d);\n\nvar scheme$e = new Array(3).concat(\n \"ece7f2a6bddb2b8cbe\",\n \"f1eef6bdc9e174a9cf0570b0\",\n \"f1eef6bdc9e174a9cf2b8cbe045a8d\",\n \"f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d\",\n \"f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b\",\n \"fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b\",\n \"fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858\"\n).map(colors);\n\nvar PuBu = ramp(scheme$e);\n\nvar scheme$f = new Array(3).concat(\n \"e7e1efc994c7dd1c77\",\n \"f1eef6d7b5d8df65b0ce1256\",\n \"f1eef6d7b5d8df65b0dd1c77980043\",\n \"f1eef6d4b9dac994c7df65b0dd1c77980043\",\n \"f1eef6d4b9dac994c7df65b0e7298ace125691003f\",\n \"f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f\",\n \"f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f\"\n).map(colors);\n\nvar PuRd = ramp(scheme$f);\n\nvar scheme$g = new Array(3).concat(\n \"fde0ddfa9fb5c51b8a\",\n \"feebe2fbb4b9f768a1ae017e\",\n \"feebe2fbb4b9f768a1c51b8a7a0177\",\n \"feebe2fcc5c0fa9fb5f768a1c51b8a7a0177\",\n \"feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177\",\n \"fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177\",\n \"fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a\"\n).map(colors);\n\nvar RdPu = ramp(scheme$g);\n\nvar scheme$h = new Array(3).concat(\n \"edf8b17fcdbb2c7fb8\",\n \"ffffcca1dab441b6c4225ea8\",\n \"ffffcca1dab441b6c42c7fb8253494\",\n \"ffffccc7e9b47fcdbb41b6c42c7fb8253494\",\n \"ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84\",\n \"ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84\",\n \"ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58\"\n).map(colors);\n\nvar YlGnBu = ramp(scheme$h);\n\nvar scheme$i = new Array(3).concat(\n \"f7fcb9addd8e31a354\",\n \"ffffccc2e69978c679238443\",\n \"ffffccc2e69978c67931a354006837\",\n \"ffffccd9f0a3addd8e78c67931a354006837\",\n \"ffffccd9f0a3addd8e78c67941ab5d238443005a32\",\n \"ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32\",\n \"ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529\"\n).map(colors);\n\nvar YlGn = ramp(scheme$i);\n\nvar scheme$j = new Array(3).concat(\n \"fff7bcfec44fd95f0e\",\n \"ffffd4fed98efe9929cc4c02\",\n \"ffffd4fed98efe9929d95f0e993404\",\n \"ffffd4fee391fec44ffe9929d95f0e993404\",\n \"ffffd4fee391fec44ffe9929ec7014cc4c028c2d04\",\n \"ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04\",\n \"ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506\"\n).map(colors);\n\nvar YlOrBr = ramp(scheme$j);\n\nvar scheme$k = new Array(3).concat(\n \"ffeda0feb24cf03b20\",\n \"ffffb2fecc5cfd8d3ce31a1c\",\n \"ffffb2fecc5cfd8d3cf03b20bd0026\",\n \"ffffb2fed976feb24cfd8d3cf03b20bd0026\",\n \"ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026\",\n \"ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026\",\n \"ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026\"\n).map(colors);\n\nvar YlOrRd = ramp(scheme$k);\n\nvar scheme$l = new Array(3).concat(\n \"deebf79ecae13182bd\",\n \"eff3ffbdd7e76baed62171b5\",\n \"eff3ffbdd7e76baed63182bd08519c\",\n \"eff3ffc6dbef9ecae16baed63182bd08519c\",\n \"eff3ffc6dbef9ecae16baed64292c62171b5084594\",\n \"f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594\",\n \"f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b\"\n).map(colors);\n\nvar Blues = ramp(scheme$l);\n\nvar scheme$m = new Array(3).concat(\n \"e5f5e0a1d99b31a354\",\n \"edf8e9bae4b374c476238b45\",\n \"edf8e9bae4b374c47631a354006d2c\",\n \"edf8e9c7e9c0a1d99b74c47631a354006d2c\",\n \"edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32\",\n \"f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32\",\n \"f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b\"\n).map(colors);\n\nvar Greens = ramp(scheme$m);\n\nvar scheme$n = new Array(3).concat(\n \"f0f0f0bdbdbd636363\",\n \"f7f7f7cccccc969696525252\",\n \"f7f7f7cccccc969696636363252525\",\n \"f7f7f7d9d9d9bdbdbd969696636363252525\",\n \"f7f7f7d9d9d9bdbdbd969696737373525252252525\",\n \"fffffff0f0f0d9d9d9bdbdbd969696737373525252252525\",\n \"fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000\"\n).map(colors);\n\nvar Greys = ramp(scheme$n);\n\nvar scheme$o = new Array(3).concat(\n \"efedf5bcbddc756bb1\",\n \"f2f0f7cbc9e29e9ac86a51a3\",\n \"f2f0f7cbc9e29e9ac8756bb154278f\",\n \"f2f0f7dadaebbcbddc9e9ac8756bb154278f\",\n \"f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486\",\n \"fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486\",\n \"fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d\"\n).map(colors);\n\nvar Purples = ramp(scheme$o);\n\nvar scheme$p = new Array(3).concat(\n \"fee0d2fc9272de2d26\",\n \"fee5d9fcae91fb6a4acb181d\",\n \"fee5d9fcae91fb6a4ade2d26a50f15\",\n \"fee5d9fcbba1fc9272fb6a4ade2d26a50f15\",\n \"fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d\",\n \"fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d\",\n \"fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d\"\n).map(colors);\n\nvar Reds = ramp(scheme$p);\n\nvar scheme$q = new Array(3).concat(\n \"fee6cefdae6be6550d\",\n \"feeddefdbe85fd8d3cd94701\",\n \"feeddefdbe85fd8d3ce6550da63603\",\n \"feeddefdd0a2fdae6bfd8d3ce6550da63603\",\n \"feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04\",\n \"fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04\",\n \"fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704\"\n).map(colors);\n\nvar Oranges = ramp(scheme$q);\n\nfunction cividis(t) {\n t = Math.max(0, Math.min(1, t));\n return \"rgb(\"\n + Math.max(0, Math.min(255, Math.round(-4.54 - t * (35.34 - t * (2381.73 - t * (6402.7 - t * (7024.72 - t * 2710.57))))))) + \", \"\n + Math.max(0, Math.min(255, Math.round(32.49 + t * (170.73 + t * (52.82 - t * (131.46 - t * (176.58 - t * 67.37))))))) + \", \"\n + Math.max(0, Math.min(255, Math.round(81.24 + t * (442.36 - t * (2482.43 - t * (6167.24 - t * (6614.94 - t * 2475.67)))))))\n + \")\";\n}\n\nvar cubehelix = d3Interpolate.interpolateCubehelixLong(d3Color.cubehelix(300, 0.5, 0.0), d3Color.cubehelix(-240, 0.5, 1.0));\n\nvar warm = d3Interpolate.interpolateCubehelixLong(d3Color.cubehelix(-100, 0.75, 0.35), d3Color.cubehelix(80, 1.50, 0.8));\n\nvar cool = d3Interpolate.interpolateCubehelixLong(d3Color.cubehelix(260, 0.75, 0.35), d3Color.cubehelix(80, 1.50, 0.8));\n\nvar c = d3Color.cubehelix();\n\nfunction rainbow(t) {\n if (t < 0 || t > 1) t -= Math.floor(t);\n var ts = Math.abs(t - 0.5);\n c.h = 360 * t - 100;\n c.s = 1.5 - 1.5 * ts;\n c.l = 0.8 - 0.9 * ts;\n return c + \"\";\n}\n\nvar c$1 = d3Color.rgb(),\n pi_1_3 = Math.PI / 3,\n pi_2_3 = Math.PI * 2 / 3;\n\nfunction sinebow(t) {\n var x;\n t = (0.5 - t) * Math.PI;\n c$1.r = 255 * (x = Math.sin(t)) * x;\n c$1.g = 255 * (x = Math.sin(t + pi_1_3)) * x;\n c$1.b = 255 * (x = Math.sin(t + pi_2_3)) * x;\n return c$1 + \"\";\n}\n\nfunction turbo(t) {\n t = Math.max(0, Math.min(1, t));\n return \"rgb(\"\n + Math.max(0, Math.min(255, Math.round(34.61 + t * (1172.33 - t * (10793.56 - t * (33300.12 - t * (38394.49 - t * 14825.05))))))) + \", \"\n + Math.max(0, Math.min(255, Math.round(23.31 + t * (557.33 + t * (1225.33 - t * (3574.96 - t * (1073.77 + t * 707.56))))))) + \", \"\n + Math.max(0, Math.min(255, Math.round(27.2 + t * (3211.1 - t * (15327.97 - t * (27814 - t * (22569.18 - t * 6838.66)))))))\n + \")\";\n}\n\nfunction ramp$1(range) {\n var n = range.length;\n return function(t) {\n return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];\n };\n}\n\nvar viridis = ramp$1(colors(\"44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725\"));\n\nvar magma = ramp$1(colors(\"00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf\"));\n\nvar inferno = ramp$1(colors(\"00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4\"));\n\nvar plasma = ramp$1(colors(\"0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921\"));\n\nexports.interpolateBlues = Blues;\nexports.interpolateBrBG = BrBG;\nexports.interpolateBuGn = BuGn;\nexports.interpolateBuPu = BuPu;\nexports.interpolateCividis = cividis;\nexports.interpolateCool = cool;\nexports.interpolateCubehelixDefault = cubehelix;\nexports.interpolateGnBu = GnBu;\nexports.interpolateGreens = Greens;\nexports.interpolateGreys = Greys;\nexports.interpolateInferno = inferno;\nexports.interpolateMagma = magma;\nexports.interpolateOrRd = OrRd;\nexports.interpolateOranges = Oranges;\nexports.interpolatePRGn = PRGn;\nexports.interpolatePiYG = PiYG;\nexports.interpolatePlasma = plasma;\nexports.interpolatePuBu = PuBu;\nexports.interpolatePuBuGn = PuBuGn;\nexports.interpolatePuOr = PuOr;\nexports.interpolatePuRd = PuRd;\nexports.interpolatePurples = Purples;\nexports.interpolateRainbow = rainbow;\nexports.interpolateRdBu = RdBu;\nexports.interpolateRdGy = RdGy;\nexports.interpolateRdPu = RdPu;\nexports.interpolateRdYlBu = RdYlBu;\nexports.interpolateRdYlGn = RdYlGn;\nexports.interpolateReds = Reds;\nexports.interpolateSinebow = sinebow;\nexports.interpolateSpectral = Spectral;\nexports.interpolateTurbo = turbo;\nexports.interpolateViridis = viridis;\nexports.interpolateWarm = warm;\nexports.interpolateYlGn = YlGn;\nexports.interpolateYlGnBu = YlGnBu;\nexports.interpolateYlOrBr = YlOrBr;\nexports.interpolateYlOrRd = YlOrRd;\nexports.schemeAccent = Accent;\nexports.schemeBlues = scheme$l;\nexports.schemeBrBG = scheme;\nexports.schemeBuGn = scheme$9;\nexports.schemeBuPu = scheme$a;\nexports.schemeCategory10 = category10;\nexports.schemeDark2 = Dark2;\nexports.schemeGnBu = scheme$b;\nexports.schemeGreens = scheme$m;\nexports.schemeGreys = scheme$n;\nexports.schemeOrRd = scheme$c;\nexports.schemeOranges = scheme$q;\nexports.schemePRGn = scheme$1;\nexports.schemePaired = Paired;\nexports.schemePastel1 = Pastel1;\nexports.schemePastel2 = Pastel2;\nexports.schemePiYG = scheme$2;\nexports.schemePuBu = scheme$e;\nexports.schemePuBuGn = scheme$d;\nexports.schemePuOr = scheme$3;\nexports.schemePuRd = scheme$f;\nexports.schemePurples = scheme$o;\nexports.schemeRdBu = scheme$4;\nexports.schemeRdGy = scheme$5;\nexports.schemeRdPu = scheme$g;\nexports.schemeRdYlBu = scheme$6;\nexports.schemeRdYlGn = scheme$7;\nexports.schemeReds = scheme$p;\nexports.schemeSet1 = Set1;\nexports.schemeSet2 = Set2;\nexports.schemeSet3 = Set3;\nexports.schemeSpectral = scheme$8;\nexports.schemeTableau10 = Tableau10;\nexports.schemeYlGn = scheme$i;\nexports.schemeYlGnBu = scheme$h;\nexports.schemeYlOrBr = scheme$j;\nexports.schemeYlOrRd = scheme$k;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","// https://d3js.org/d3-scale/ v3.3.0 Copyright 2021 Mike Bostock\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-array'), require('d3-interpolate'), require('d3-format'), require('d3-time'), require('d3-time-format')) :\ntypeof define === 'function' && define.amd ? define(['exports', 'd3-array', 'd3-interpolate', 'd3-format', 'd3-time', 'd3-time-format'], factory) :\n(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.d3 = global.d3 || {}, global.d3, global.d3, global.d3, global.d3, global.d3));\n}(this, (function (exports, d3Array, d3Interpolate, d3Format, d3Time, d3TimeFormat) { 'use strict';\n\nfunction initRange(domain, range) {\n switch (arguments.length) {\n case 0: break;\n case 1: this.range(domain); break;\n default: this.range(range).domain(domain); break;\n }\n return this;\n}\n\nfunction initInterpolator(domain, interpolator) {\n switch (arguments.length) {\n case 0: break;\n case 1: {\n if (typeof domain === \"function\") this.interpolator(domain);\n else this.range(domain);\n break;\n }\n default: {\n this.domain(domain);\n if (typeof interpolator === \"function\") this.interpolator(interpolator);\n else this.range(interpolator);\n break;\n }\n }\n return this;\n}\n\nconst implicit = Symbol(\"implicit\");\n\nfunction ordinal() {\n var index = new Map(),\n domain = [],\n range = [],\n unknown = implicit;\n\n function scale(d) {\n var key = d + \"\", i = index.get(key);\n if (!i) {\n if (unknown !== implicit) return unknown;\n index.set(key, i = domain.push(d));\n }\n return range[(i - 1) % range.length];\n }\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [], index = new Map();\n for (const value of _) {\n const key = value + \"\";\n if (index.has(key)) continue;\n index.set(key, domain.push(value));\n }\n return scale;\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), scale) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return ordinal(domain, range).unknown(unknown);\n };\n\n initRange.apply(scale, arguments);\n\n return scale;\n}\n\nfunction band() {\n var scale = ordinal().unknown(undefined),\n domain = scale.domain,\n ordinalRange = scale.range,\n r0 = 0,\n r1 = 1,\n step,\n bandwidth,\n round = false,\n paddingInner = 0,\n paddingOuter = 0,\n align = 0.5;\n\n delete scale.unknown;\n\n function rescale() {\n var n = domain().length,\n reverse = r1 < r0,\n start = reverse ? r1 : r0,\n stop = reverse ? r0 : r1;\n step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);\n if (round) step = Math.floor(step);\n start += (stop - start - step * (n - paddingInner)) * align;\n bandwidth = step * (1 - paddingInner);\n if (round) start = Math.round(start), bandwidth = Math.round(bandwidth);\n var values = d3Array.range(n).map(function(i) { return start + step * i; });\n return ordinalRange(reverse ? values.reverse() : values);\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.range = function(_) {\n return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1];\n };\n\n scale.rangeRound = function(_) {\n return [r0, r1] = _, r0 = +r0, r1 = +r1, round = true, rescale();\n };\n\n scale.bandwidth = function() {\n return bandwidth;\n };\n\n scale.step = function() {\n return step;\n };\n\n scale.round = function(_) {\n return arguments.length ? (round = !!_, rescale()) : round;\n };\n\n scale.padding = function(_) {\n return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner;\n };\n\n scale.paddingInner = function(_) {\n return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner;\n };\n\n scale.paddingOuter = function(_) {\n return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter;\n };\n\n scale.align = function(_) {\n return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;\n };\n\n scale.copy = function() {\n return band(domain(), [r0, r1])\n .round(round)\n .paddingInner(paddingInner)\n .paddingOuter(paddingOuter)\n .align(align);\n };\n\n return initRange.apply(rescale(), arguments);\n}\n\nfunction pointish(scale) {\n var copy = scale.copy;\n\n scale.padding = scale.paddingOuter;\n delete scale.paddingInner;\n delete scale.paddingOuter;\n\n scale.copy = function() {\n return pointish(copy());\n };\n\n return scale;\n}\n\nfunction point() {\n return pointish(band.apply(null, arguments).paddingInner(1));\n}\n\nfunction constants(x) {\n return function() {\n return x;\n };\n}\n\nfunction number$1(x) {\n return +x;\n}\n\nvar unit = [0, 1];\n\nfunction identity$1(x) {\n return x;\n}\n\nfunction normalize(a, b) {\n return (b -= (a = +a))\n ? function(x) { return (x - a) / b; }\n : constants(isNaN(b) ? NaN : 0.5);\n}\n\nfunction clamper(a, b) {\n var t;\n if (a > b) t = a, a = b, b = t;\n return function(x) { return Math.max(a, Math.min(b, x)); };\n}\n\n// normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].\n// interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].\nfunction bimap(domain, range, interpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);\n else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n}\n\nfunction polymap(domain, range, interpolate) {\n var j = Math.min(domain.length, range.length) - 1,\n d = new Array(j),\n r = new Array(j),\n i = -1;\n\n // Reverse descending domains.\n if (domain[j] < domain[0]) {\n domain = domain.slice().reverse();\n range = range.slice().reverse();\n }\n\n while (++i < j) {\n d[i] = normalize(domain[i], domain[i + 1]);\n r[i] = interpolate(range[i], range[i + 1]);\n }\n\n return function(x) {\n var i = d3Array.bisect(domain, x, 1, j) - 1;\n return r[i](d[i](x));\n };\n}\n\nfunction copy$1(source, target) {\n return target\n .domain(source.domain())\n .range(source.range())\n .interpolate(source.interpolate())\n .clamp(source.clamp())\n .unknown(source.unknown());\n}\n\nfunction transformer$2() {\n var domain = unit,\n range = unit,\n interpolate = d3Interpolate.interpolate,\n transform,\n untransform,\n unknown,\n clamp = identity$1,\n piecewise,\n output,\n input;\n\n function rescale() {\n var n = Math.min(domain.length, range.length);\n if (clamp !== identity$1) clamp = clamper(domain[0], domain[n - 1]);\n piecewise = n > 2 ? polymap : bimap;\n output = input = null;\n return scale;\n }\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate)))(transform(clamp(x)));\n }\n\n scale.invert = function(y) {\n return clamp(untransform((input || (input = piecewise(range, domain.map(transform), d3Interpolate.interpolateNumber)))(y)));\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain = Array.from(_, number$1), rescale()) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), rescale()) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return range = Array.from(_), interpolate = d3Interpolate.interpolateRound, rescale();\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = _ ? true : identity$1, rescale()) : clamp !== identity$1;\n };\n\n scale.interpolate = function(_) {\n return arguments.length ? (interpolate = _, rescale()) : interpolate;\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t, u) {\n transform = t, untransform = u;\n return rescale();\n };\n}\n\nfunction continuous() {\n return transformer$2()(identity$1, identity$1);\n}\n\nfunction tickFormat(start, stop, count, specifier) {\n var step = d3Array.tickStep(start, stop, count),\n precision;\n specifier = d3Format.formatSpecifier(specifier == null ? \",f\" : specifier);\n switch (specifier.type) {\n case \"s\": {\n var value = Math.max(Math.abs(start), Math.abs(stop));\n if (specifier.precision == null && !isNaN(precision = d3Format.precisionPrefix(step, value))) specifier.precision = precision;\n return d3Format.formatPrefix(specifier, value);\n }\n case \"\":\n case \"e\":\n case \"g\":\n case \"p\":\n case \"r\": {\n if (specifier.precision == null && !isNaN(precision = d3Format.precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === \"e\");\n break;\n }\n case \"f\":\n case \"%\": {\n if (specifier.precision == null && !isNaN(precision = d3Format.precisionFixed(step))) specifier.precision = precision - (specifier.type === \"%\") * 2;\n break;\n }\n }\n return d3Format.format(specifier);\n}\n\nfunction linearish(scale) {\n var domain = scale.domain;\n\n scale.ticks = function(count) {\n var d = domain();\n return d3Array.ticks(d[0], d[d.length - 1], count == null ? 10 : count);\n };\n\n scale.tickFormat = function(count, specifier) {\n var d = domain();\n return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);\n };\n\n scale.nice = function(count) {\n if (count == null) count = 10;\n\n var d = domain();\n var i0 = 0;\n var i1 = d.length - 1;\n var start = d[i0];\n var stop = d[i1];\n var prestep;\n var step;\n var maxIter = 10;\n\n if (stop < start) {\n step = start, start = stop, stop = step;\n step = i0, i0 = i1, i1 = step;\n }\n \n while (maxIter-- > 0) {\n step = d3Array.tickIncrement(start, stop, count);\n if (step === prestep) {\n d[i0] = start;\n d[i1] = stop;\n return domain(d);\n } else if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n } else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n } else {\n break;\n }\n prestep = step;\n }\n\n return scale;\n };\n\n return scale;\n}\n\nfunction linear() {\n var scale = continuous();\n\n scale.copy = function() {\n return copy$1(scale, linear());\n };\n\n initRange.apply(scale, arguments);\n\n return linearish(scale);\n}\n\nfunction identity(domain) {\n var unknown;\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : x;\n }\n\n scale.invert = scale;\n\n scale.domain = scale.range = function(_) {\n return arguments.length ? (domain = Array.from(_, number$1), scale) : domain.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return identity(domain).unknown(unknown);\n };\n\n domain = arguments.length ? Array.from(domain, number$1) : [0, 1];\n\n return linearish(scale);\n}\n\nfunction nice(domain, interval) {\n domain = domain.slice();\n\n var i0 = 0,\n i1 = domain.length - 1,\n x0 = domain[i0],\n x1 = domain[i1],\n t;\n\n if (x1 < x0) {\n t = i0, i0 = i1, i1 = t;\n t = x0, x0 = x1, x1 = t;\n }\n\n domain[i0] = interval.floor(x0);\n domain[i1] = interval.ceil(x1);\n return domain;\n}\n\nfunction transformLog(x) {\n return Math.log(x);\n}\n\nfunction transformExp(x) {\n return Math.exp(x);\n}\n\nfunction transformLogn(x) {\n return -Math.log(-x);\n}\n\nfunction transformExpn(x) {\n return -Math.exp(-x);\n}\n\nfunction pow10(x) {\n return isFinite(x) ? +(\"1e\" + x) : x < 0 ? 0 : x;\n}\n\nfunction powp(base) {\n return base === 10 ? pow10\n : base === Math.E ? Math.exp\n : function(x) { return Math.pow(base, x); };\n}\n\nfunction logp(base) {\n return base === Math.E ? Math.log\n : base === 10 && Math.log10\n || base === 2 && Math.log2\n || (base = Math.log(base), function(x) { return Math.log(x) / base; });\n}\n\nfunction reflect(f) {\n return function(x) {\n return -f(-x);\n };\n}\n\nfunction loggish(transform) {\n var scale = transform(transformLog, transformExp),\n domain = scale.domain,\n base = 10,\n logs,\n pows;\n\n function rescale() {\n logs = logp(base), pows = powp(base);\n if (domain()[0] < 0) {\n logs = reflect(logs), pows = reflect(pows);\n transform(transformLogn, transformExpn);\n } else {\n transform(transformLog, transformExp);\n }\n return scale;\n }\n\n scale.base = function(_) {\n return arguments.length ? (base = +_, rescale()) : base;\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.ticks = function(count) {\n var d = domain(),\n u = d[0],\n v = d[d.length - 1],\n r;\n\n if (r = v < u) i = u, u = v, v = i;\n\n var i = logs(u),\n j = logs(v),\n p,\n k,\n t,\n n = count == null ? 10 : +count,\n z = [];\n\n if (!(base % 1) && j - i < n) {\n i = Math.floor(i), j = Math.ceil(j);\n if (u > 0) for (; i <= j; ++i) {\n for (k = 1, p = pows(i); k < base; ++k) {\n t = p * k;\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n } else for (; i <= j; ++i) {\n for (k = base - 1, p = pows(i); k >= 1; --k) {\n t = p * k;\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n }\n if (z.length * 2 < n) z = d3Array.ticks(u, v, n);\n } else {\n z = d3Array.ticks(i, j, Math.min(j - i, n)).map(pows);\n }\n\n return r ? z.reverse() : z;\n };\n\n scale.tickFormat = function(count, specifier) {\n if (specifier == null) specifier = base === 10 ? \".0e\" : \",\";\n if (typeof specifier !== \"function\") specifier = d3Format.format(specifier);\n if (count === Infinity) return specifier;\n if (count == null) count = 10;\n var k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?\n return function(d) {\n var i = d / pows(Math.round(logs(d)));\n if (i * base < base - 0.5) i *= base;\n return i <= k ? specifier(d) : \"\";\n };\n };\n\n scale.nice = function() {\n return domain(nice(domain(), {\n floor: function(x) { return pows(Math.floor(logs(x))); },\n ceil: function(x) { return pows(Math.ceil(logs(x))); }\n }));\n };\n\n return scale;\n}\n\nfunction log() {\n var scale = loggish(transformer$2()).domain([1, 10]);\n\n scale.copy = function() {\n return copy$1(scale, log()).base(scale.base());\n };\n\n initRange.apply(scale, arguments);\n\n return scale;\n}\n\nfunction transformSymlog(c) {\n return function(x) {\n return Math.sign(x) * Math.log1p(Math.abs(x / c));\n };\n}\n\nfunction transformSymexp(c) {\n return function(x) {\n return Math.sign(x) * Math.expm1(Math.abs(x)) * c;\n };\n}\n\nfunction symlogish(transform) {\n var c = 1, scale = transform(transformSymlog(c), transformSymexp(c));\n\n scale.constant = function(_) {\n return arguments.length ? transform(transformSymlog(c = +_), transformSymexp(c)) : c;\n };\n\n return linearish(scale);\n}\n\nfunction symlog() {\n var scale = symlogish(transformer$2());\n\n scale.copy = function() {\n return copy$1(scale, symlog()).constant(scale.constant());\n };\n\n return initRange.apply(scale, arguments);\n}\n\nfunction transformPow(exponent) {\n return function(x) {\n return x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\n };\n}\n\nfunction transformSqrt(x) {\n return x < 0 ? -Math.sqrt(-x) : Math.sqrt(x);\n}\n\nfunction transformSquare(x) {\n return x < 0 ? -x * x : x * x;\n}\n\nfunction powish(transform) {\n var scale = transform(identity$1, identity$1),\n exponent = 1;\n\n function rescale() {\n return exponent === 1 ? transform(identity$1, identity$1)\n : exponent === 0.5 ? transform(transformSqrt, transformSquare)\n : transform(transformPow(exponent), transformPow(1 / exponent));\n }\n\n scale.exponent = function(_) {\n return arguments.length ? (exponent = +_, rescale()) : exponent;\n };\n\n return linearish(scale);\n}\n\nfunction pow() {\n var scale = powish(transformer$2());\n\n scale.copy = function() {\n return copy$1(scale, pow()).exponent(scale.exponent());\n };\n\n initRange.apply(scale, arguments);\n\n return scale;\n}\n\nfunction sqrt() {\n return pow.apply(null, arguments).exponent(0.5);\n}\n\nfunction square(x) {\n return Math.sign(x) * x * x;\n}\n\nfunction unsquare(x) {\n return Math.sign(x) * Math.sqrt(Math.abs(x));\n}\n\nfunction radial() {\n var squared = continuous(),\n range = [0, 1],\n round = false,\n unknown;\n\n function scale(x) {\n var y = unsquare(squared(x));\n return isNaN(y) ? unknown : round ? Math.round(y) : y;\n }\n\n scale.invert = function(y) {\n return squared.invert(square(y));\n };\n\n scale.domain = function(_) {\n return arguments.length ? (squared.domain(_), scale) : squared.domain();\n };\n\n scale.range = function(_) {\n return arguments.length ? (squared.range((range = Array.from(_, number$1)).map(square)), scale) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return scale.range(_).round(true);\n };\n\n scale.round = function(_) {\n return arguments.length ? (round = !!_, scale) : round;\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (squared.clamp(_), scale) : squared.clamp();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return radial(squared.domain(), range)\n .round(round)\n .clamp(squared.clamp())\n .unknown(unknown);\n };\n\n initRange.apply(scale, arguments);\n\n return linearish(scale);\n}\n\nfunction quantile() {\n var domain = [],\n range = [],\n thresholds = [],\n unknown;\n\n function rescale() {\n var i = 0, n = Math.max(1, range.length);\n thresholds = new Array(n - 1);\n while (++i < n) thresholds[i - 1] = d3Array.quantileSorted(domain, i / n);\n return scale;\n }\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : range[d3Array.bisect(thresholds, x)];\n }\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN] : [\n i > 0 ? thresholds[i - 1] : domain[0],\n i < thresholds.length ? thresholds[i] : domain[domain.length - 1]\n ];\n };\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [];\n for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d);\n domain.sort(d3Array.ascending);\n return rescale();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), rescale()) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.quantiles = function() {\n return thresholds.slice();\n };\n\n scale.copy = function() {\n return quantile()\n .domain(domain)\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(scale, arguments);\n}\n\nfunction quantize() {\n var x0 = 0,\n x1 = 1,\n n = 1,\n domain = [0.5],\n range = [0, 1],\n unknown;\n\n function scale(x) {\n return x != null && x <= x ? range[d3Array.bisect(domain, x, 0, n)] : unknown;\n }\n\n function rescale() {\n var i = -1;\n domain = new Array(n);\n while (++i < n) domain[i] = ((i + 1) * x1 - (i - n) * x0) / (n + 1);\n return scale;\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1] = _, x0 = +x0, x1 = +x1, rescale()) : [x0, x1];\n };\n\n scale.range = function(_) {\n return arguments.length ? (n = (range = Array.from(_)).length - 1, rescale()) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN]\n : i < 1 ? [x0, domain[0]]\n : i >= n ? [domain[n - 1], x1]\n : [domain[i - 1], domain[i]];\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : scale;\n };\n\n scale.thresholds = function() {\n return domain.slice();\n };\n\n scale.copy = function() {\n return quantize()\n .domain([x0, x1])\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(linearish(scale), arguments);\n}\n\nfunction threshold() {\n var domain = [0.5],\n range = [0, 1],\n unknown,\n n = 1;\n\n function scale(x) {\n return x != null && x <= x ? range[d3Array.bisect(domain, x, 0, n)] : unknown;\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return [domain[i - 1], domain[i]];\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return threshold()\n .domain(domain)\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(scale, arguments);\n}\n\nfunction date(t) {\n return new Date(t);\n}\n\nfunction number(t) {\n return t instanceof Date ? +t : +new Date(+t);\n}\n\nfunction calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format) {\n var scale = continuous(),\n invert = scale.invert,\n domain = scale.domain;\n\n var formatMillisecond = format(\".%L\"),\n formatSecond = format(\":%S\"),\n formatMinute = format(\"%I:%M\"),\n formatHour = format(\"%I %p\"),\n formatDay = format(\"%a %d\"),\n formatWeek = format(\"%b %d\"),\n formatMonth = format(\"%B\"),\n formatYear = format(\"%Y\");\n\n function tickFormat(date) {\n return (second(date) < date ? formatMillisecond\n : minute(date) < date ? formatSecond\n : hour(date) < date ? formatMinute\n : day(date) < date ? formatHour\n : month(date) < date ? (week(date) < date ? formatDay : formatWeek)\n : year(date) < date ? formatMonth\n : formatYear)(date);\n }\n\n scale.invert = function(y) {\n return new Date(invert(y));\n };\n\n scale.domain = function(_) {\n return arguments.length ? domain(Array.from(_, number)) : domain().map(date);\n };\n\n scale.ticks = function(interval) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], interval == null ? 10 : interval);\n };\n\n scale.tickFormat = function(count, specifier) {\n return specifier == null ? tickFormat : format(specifier);\n };\n\n scale.nice = function(interval) {\n var d = domain();\n if (!interval || typeof interval.range !== \"function\") interval = tickInterval(d[0], d[d.length - 1], interval == null ? 10 : interval);\n return interval ? domain(nice(d, interval)) : scale;\n };\n\n scale.copy = function() {\n return copy$1(scale, calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format));\n };\n\n return scale;\n}\n\nfunction time() {\n return initRange.apply(calendar(d3Time.timeTicks, d3Time.timeTickInterval, d3Time.timeYear, d3Time.timeMonth, d3Time.timeWeek, d3Time.timeDay, d3Time.timeHour, d3Time.timeMinute, d3Time.timeSecond, d3TimeFormat.timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]), arguments);\n}\n\nfunction utcTime() {\n return initRange.apply(calendar(d3Time.utcTicks, d3Time.utcTickInterval, d3Time.utcYear, d3Time.utcMonth, d3Time.utcWeek, d3Time.utcDay, d3Time.utcHour, d3Time.utcMinute, d3Time.utcSecond, d3TimeFormat.utcFormat).domain([Date.UTC(2000, 0, 1), Date.UTC(2000, 0, 2)]), arguments);\n}\n\nfunction transformer$1() {\n var x0 = 0,\n x1 = 1,\n t0,\n t1,\n k10,\n transform,\n interpolator = identity$1,\n clamp = false,\n unknown;\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : interpolator(k10 === 0 ? 0.5 : (x = (transform(x) - t0) * k10, clamp ? Math.max(0, Math.min(1, x)) : x));\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0), scale) : [x0, x1];\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, scale) : clamp;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n function range(interpolate) {\n return function(_) {\n var r0, r1;\n return arguments.length ? ([r0, r1] = _, interpolator = interpolate(r0, r1), scale) : [interpolator(0), interpolator(1)];\n };\n }\n\n scale.range = range(d3Interpolate.interpolate);\n\n scale.rangeRound = range(d3Interpolate.interpolateRound);\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t) {\n transform = t, t0 = t(x0), t1 = t(x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0);\n return scale;\n };\n}\n\nfunction copy(source, target) {\n return target\n .domain(source.domain())\n .interpolator(source.interpolator())\n .clamp(source.clamp())\n .unknown(source.unknown());\n}\n\nfunction sequential() {\n var scale = linearish(transformer$1()(identity$1));\n\n scale.copy = function() {\n return copy(scale, sequential());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nfunction sequentialLog() {\n var scale = loggish(transformer$1()).domain([1, 10]);\n\n scale.copy = function() {\n return copy(scale, sequentialLog()).base(scale.base());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nfunction sequentialSymlog() {\n var scale = symlogish(transformer$1());\n\n scale.copy = function() {\n return copy(scale, sequentialSymlog()).constant(scale.constant());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nfunction sequentialPow() {\n var scale = powish(transformer$1());\n\n scale.copy = function() {\n return copy(scale, sequentialPow()).exponent(scale.exponent());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nfunction sequentialSqrt() {\n return sequentialPow.apply(null, arguments).exponent(0.5);\n}\n\nfunction sequentialQuantile() {\n var domain = [],\n interpolator = identity$1;\n\n function scale(x) {\n if (x != null && !isNaN(x = +x)) return interpolator((d3Array.bisect(domain, x, 1) - 1) / (domain.length - 1));\n }\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [];\n for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d);\n domain.sort(d3Array.ascending);\n return scale;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n scale.range = function() {\n return domain.map((d, i) => interpolator(i / (domain.length - 1)));\n };\n\n scale.quantiles = function(n) {\n return Array.from({length: n + 1}, (_, i) => d3Array.quantile(domain, i / n));\n };\n\n scale.copy = function() {\n return sequentialQuantile(interpolator).domain(domain);\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nfunction transformer() {\n var x0 = 0,\n x1 = 0.5,\n x2 = 1,\n s = 1,\n t0,\n t1,\n t2,\n k10,\n k21,\n interpolator = identity$1,\n transform,\n clamp = false,\n unknown;\n\n function scale(x) {\n return isNaN(x = +x) ? unknown : (x = 0.5 + ((x = +transform(x)) - t1) * (s * x < s * t1 ? k10 : k21), interpolator(clamp ? Math.max(0, Math.min(1, x)) : x));\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1, x2] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), t2 = transform(x2 = +x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), s = t1 < t0 ? -1 : 1, scale) : [x0, x1, x2];\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, scale) : clamp;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n function range(interpolate) {\n return function(_) {\n var r0, r1, r2;\n return arguments.length ? ([r0, r1, r2] = _, interpolator = d3Interpolate.piecewise(interpolate, [r0, r1, r2]), scale) : [interpolator(0), interpolator(0.5), interpolator(1)];\n };\n }\n\n scale.range = range(d3Interpolate.interpolate);\n\n scale.rangeRound = range(d3Interpolate.interpolateRound);\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t) {\n transform = t, t0 = t(x0), t1 = t(x1), t2 = t(x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), s = t1 < t0 ? -1 : 1;\n return scale;\n };\n}\n\nfunction diverging() {\n var scale = linearish(transformer()(identity$1));\n\n scale.copy = function() {\n return copy(scale, diverging());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nfunction divergingLog() {\n var scale = loggish(transformer()).domain([0.1, 1, 10]);\n\n scale.copy = function() {\n return copy(scale, divergingLog()).base(scale.base());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nfunction divergingSymlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, divergingSymlog()).constant(scale.constant());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nfunction divergingPow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, divergingPow()).exponent(scale.exponent());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nfunction divergingSqrt() {\n return divergingPow.apply(null, arguments).exponent(0.5);\n}\n\nexports.scaleBand = band;\nexports.scaleDiverging = diverging;\nexports.scaleDivergingLog = divergingLog;\nexports.scaleDivergingPow = divergingPow;\nexports.scaleDivergingSqrt = divergingSqrt;\nexports.scaleDivergingSymlog = divergingSymlog;\nexports.scaleIdentity = identity;\nexports.scaleImplicit = implicit;\nexports.scaleLinear = linear;\nexports.scaleLog = log;\nexports.scaleOrdinal = ordinal;\nexports.scalePoint = point;\nexports.scalePow = pow;\nexports.scaleQuantile = quantile;\nexports.scaleQuantize = quantize;\nexports.scaleRadial = radial;\nexports.scaleSequential = sequential;\nexports.scaleSequentialLog = sequentialLog;\nexports.scaleSequentialPow = sequentialPow;\nexports.scaleSequentialQuantile = sequentialQuantile;\nexports.scaleSequentialSqrt = sequentialSqrt;\nexports.scaleSequentialSymlog = sequentialSymlog;\nexports.scaleSqrt = sqrt;\nexports.scaleSymlog = symlog;\nexports.scaleThreshold = threshold;\nexports.scaleTime = time;\nexports.scaleUtc = utcTime;\nexports.tickFormat = tickFormat;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n","// https://d3js.org/d3-selection/ v2.0.0 Copyright 2020 Mike Bostock\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\ntypeof define === 'function' && define.amd ? define(['exports'], factory) :\n(global = global || self, factory(global.d3 = global.d3 || {}));\n}(this, function (exports) { 'use strict';\n\nvar xhtml = \"http://www.w3.org/1999/xhtml\";\n\nvar namespaces = {\n svg: \"http://www.w3.org/2000/svg\",\n xhtml: xhtml,\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\",\n xmlns: \"http://www.w3.org/2000/xmlns/\"\n};\n\nfunction namespace(name) {\n var prefix = name += \"\", i = prefix.indexOf(\":\");\n if (i >= 0 && (prefix = name.slice(0, i)) !== \"xmlns\") name = name.slice(i + 1);\n return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name; // eslint-disable-line no-prototype-builtins\n}\n\nfunction creatorInherit(name) {\n return function() {\n var document = this.ownerDocument,\n uri = this.namespaceURI;\n return uri === xhtml && document.documentElement.namespaceURI === xhtml\n ? document.createElement(name)\n : document.createElementNS(uri, name);\n };\n}\n\nfunction creatorFixed(fullname) {\n return function() {\n return this.ownerDocument.createElementNS(fullname.space, fullname.local);\n };\n}\n\nfunction creator(name) {\n var fullname = namespace(name);\n return (fullname.local\n ? creatorFixed\n : creatorInherit)(fullname);\n}\n\nfunction none() {}\n\nfunction selector(selector) {\n return selector == null ? none : function() {\n return this.querySelector(selector);\n };\n}\n\nfunction selection_select(select) {\n if (typeof select !== \"function\") select = selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n}\n\nfunction array(x) {\n return typeof x === \"object\" && \"length\" in x\n ? x // Array, TypedArray, NodeList, array-like\n : Array.from(x); // Map, Set, iterable, string, or anything else\n}\n\nfunction empty() {\n return [];\n}\n\nfunction selectorAll(selector) {\n return selector == null ? empty : function() {\n return this.querySelectorAll(selector);\n };\n}\n\nfunction arrayAll(select) {\n return function() {\n var group = select.apply(this, arguments);\n return group == null ? [] : array(group);\n };\n}\n\nfunction selection_selectAll(select) {\n if (typeof select === \"function\") select = arrayAll(select);\n else select = selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n subgroups.push(select.call(node, node.__data__, i, group));\n parents.push(node);\n }\n }\n }\n\n return new Selection(subgroups, parents);\n}\n\nfunction matcher(selector) {\n return function() {\n return this.matches(selector);\n };\n}\n\nfunction childMatcher(selector) {\n return function(node) {\n return node.matches(selector);\n };\n}\n\nvar find = Array.prototype.find;\n\nfunction childFind(match) {\n return function() {\n return find.call(this.children, match);\n };\n}\n\nfunction childFirst() {\n return this.firstElementChild;\n}\n\nfunction selection_selectChild(match) {\n return this.select(match == null ? childFirst\n : childFind(typeof match === \"function\" ? match : childMatcher(match)));\n}\n\nvar filter = Array.prototype.filter;\n\nfunction children() {\n return this.children;\n}\n\nfunction childrenFilter(match) {\n return function() {\n return filter.call(this.children, match);\n };\n}\n\nfunction selection_selectChildren(match) {\n return this.selectAll(match == null ? children\n : childrenFilter(typeof match === \"function\" ? match : childMatcher(match)));\n}\n\nfunction selection_filter(match) {\n if (typeof match !== \"function\") match = matcher(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n}\n\nfunction sparse(update) {\n return new Array(update.length);\n}\n\nfunction selection_enter() {\n return new Selection(this._enter || this._groups.map(sparse), this._parents);\n}\n\nfunction EnterNode(parent, datum) {\n this.ownerDocument = parent.ownerDocument;\n this.namespaceURI = parent.namespaceURI;\n this._next = null;\n this._parent = parent;\n this.__data__ = datum;\n}\n\nEnterNode.prototype = {\n constructor: EnterNode,\n appendChild: function(child) { return this._parent.insertBefore(child, this._next); },\n insertBefore: function(child, next) { return this._parent.insertBefore(child, next); },\n querySelector: function(selector) { return this._parent.querySelector(selector); },\n querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); }\n};\n\nfunction constant(x) {\n return function() {\n return x;\n };\n}\n\nfunction bindIndex(parent, group, enter, update, exit, data) {\n var i = 0,\n node,\n groupLength = group.length,\n dataLength = data.length;\n\n // Put any non-null nodes that fit into update.\n // Put any null nodes into enter.\n // Put any remaining data into enter.\n for (; i < dataLength; ++i) {\n if (node = group[i]) {\n node.__data__ = data[i];\n update[i] = node;\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Put any non-null nodes that don’t fit into exit.\n for (; i < groupLength; ++i) {\n if (node = group[i]) {\n exit[i] = node;\n }\n }\n}\n\nfunction bindKey(parent, group, enter, update, exit, data, key) {\n var i,\n node,\n nodeByKeyValue = new Map,\n groupLength = group.length,\n dataLength = data.length,\n keyValues = new Array(groupLength),\n keyValue;\n\n // Compute the key for each node.\n // If multiple nodes have the same key, the duplicates are added to exit.\n for (i = 0; i < groupLength; ++i) {\n if (node = group[i]) {\n keyValues[i] = keyValue = key.call(node, node.__data__, i, group) + \"\";\n if (nodeByKeyValue.has(keyValue)) {\n exit[i] = node;\n } else {\n nodeByKeyValue.set(keyValue, node);\n }\n }\n }\n\n // Compute the key for each datum.\n // If there a node associated with this key, join and add it to update.\n // If there is not (or the key is a duplicate), add it to enter.\n for (i = 0; i < dataLength; ++i) {\n keyValue = key.call(parent, data[i], i, data) + \"\";\n if (node = nodeByKeyValue.get(keyValue)) {\n update[i] = node;\n node.__data__ = data[i];\n nodeByKeyValue.delete(keyValue);\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Add any remaining nodes that were not bound to data to exit.\n for (i = 0; i < groupLength; ++i) {\n if ((node = group[i]) && (nodeByKeyValue.get(keyValues[i]) === node)) {\n exit[i] = node;\n }\n }\n}\n\nfunction datum(node) {\n return node.__data__;\n}\n\nfunction selection_data(value, key) {\n if (!arguments.length) return Array.from(this, datum);\n\n var bind = key ? bindKey : bindIndex,\n parents = this._parents,\n groups = this._groups;\n\n if (typeof value !== \"function\") value = constant(value);\n\n for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) {\n var parent = parents[j],\n group = groups[j],\n groupLength = group.length,\n data = array(value.call(parent, parent && parent.__data__, j, parents)),\n dataLength = data.length,\n enterGroup = enter[j] = new Array(dataLength),\n updateGroup = update[j] = new Array(dataLength),\n exitGroup = exit[j] = new Array(groupLength);\n\n bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);\n\n // Now connect the enter nodes to their following update node, such that\n // appendChild can insert the materialized enter node before this node,\n // rather than at the end of the parent node.\n for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {\n if (previous = enterGroup[i0]) {\n if (i0 >= i1) i1 = i0 + 1;\n while (!(next = updateGroup[i1]) && ++i1 < dataLength);\n previous._next = next || null;\n }\n }\n }\n\n update = new Selection(update, parents);\n update._enter = enter;\n update._exit = exit;\n return update;\n}\n\nfunction selection_exit() {\n return new Selection(this._exit || this._groups.map(sparse), this._parents);\n}\n\nfunction selection_join(onenter, onupdate, onexit) {\n var enter = this.enter(), update = this, exit = this.exit();\n enter = typeof onenter === \"function\" ? onenter(enter) : enter.append(onenter + \"\");\n if (onupdate != null) update = onupdate(update);\n if (onexit == null) exit.remove(); else onexit(exit);\n return enter && update ? enter.merge(update).order() : update;\n}\n\nfunction selection_merge(selection) {\n if (!(selection instanceof Selection)) throw new Error(\"invalid merge\");\n\n for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Selection(merges, this._parents);\n}\n\nfunction selection_order() {\n\n for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) {\n for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) {\n if (node = group[i]) {\n if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next);\n next = node;\n }\n }\n }\n\n return this;\n}\n\nfunction selection_sort(compare) {\n if (!compare) compare = ascending;\n\n function compareNode(a, b) {\n return a && b ? compare(a.__data__, b.__data__) : !a - !b;\n }\n\n for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n sortgroup[i] = node;\n }\n }\n sortgroup.sort(compareNode);\n }\n\n return new Selection(sortgroups, this._parents).order();\n}\n\nfunction ascending(a, b) {\n return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n\nfunction selection_call() {\n var callback = arguments[0];\n arguments[0] = this;\n callback.apply(null, arguments);\n return this;\n}\n\nfunction selection_nodes() {\n return Array.from(this);\n}\n\nfunction selection_node() {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length; i < n; ++i) {\n var node = group[i];\n if (node) return node;\n }\n }\n\n return null;\n}\n\nfunction selection_size() {\n let size = 0;\n for (const node of this) ++size; // eslint-disable-line no-unused-vars\n return size;\n}\n\nfunction selection_empty() {\n return !this.node();\n}\n\nfunction selection_each(callback) {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {\n if (node = group[i]) callback.call(node, node.__data__, i, group);\n }\n }\n\n return this;\n}\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, value) {\n return function() {\n this.setAttribute(name, value);\n };\n}\n\nfunction attrConstantNS(fullname, value) {\n return function() {\n this.setAttributeNS(fullname.space, fullname.local, value);\n };\n}\n\nfunction attrFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttribute(name);\n else this.setAttribute(name, v);\n };\n}\n\nfunction attrFunctionNS(fullname, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttributeNS(fullname.space, fullname.local);\n else this.setAttributeNS(fullname.space, fullname.local, v);\n };\n}\n\nfunction selection_attr(name, value) {\n var fullname = namespace(name);\n\n if (arguments.length < 2) {\n var node = this.node();\n return fullname.local\n ? node.getAttributeNS(fullname.space, fullname.local)\n : node.getAttribute(fullname);\n }\n\n return this.each((value == null\n ? (fullname.local ? attrRemoveNS : attrRemove) : (typeof value === \"function\"\n ? (fullname.local ? attrFunctionNS : attrFunction)\n : (fullname.local ? attrConstantNS : attrConstant)))(fullname, value));\n}\n\nfunction defaultView(node) {\n return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node\n || (node.document && node) // node is a Window\n || node.defaultView; // node is a Document\n}\n\nfunction styleRemove(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, value, priority) {\n return function() {\n this.style.setProperty(name, value, priority);\n };\n}\n\nfunction styleFunction(name, value, priority) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.style.removeProperty(name);\n else this.style.setProperty(name, v, priority);\n };\n}\n\nfunction selection_style(name, value, priority) {\n return arguments.length > 1\n ? this.each((value == null\n ? styleRemove : typeof value === \"function\"\n ? styleFunction\n : styleConstant)(name, value, priority == null ? \"\" : priority))\n : styleValue(this.node(), name);\n}\n\nfunction styleValue(node, name) {\n return node.style.getPropertyValue(name)\n || defaultView(node).getComputedStyle(node, null).getPropertyValue(name);\n}\n\nfunction propertyRemove(name) {\n return function() {\n delete this[name];\n };\n}\n\nfunction propertyConstant(name, value) {\n return function() {\n this[name] = value;\n };\n}\n\nfunction propertyFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) delete this[name];\n else this[name] = v;\n };\n}\n\nfunction selection_property(name, value) {\n return arguments.length > 1\n ? this.each((value == null\n ? propertyRemove : typeof value === \"function\"\n ? propertyFunction\n : propertyConstant)(name, value))\n : this.node()[name];\n}\n\nfunction classArray(string) {\n return string.trim().split(/^|\\s+/);\n}\n\nfunction classList(node) {\n return node.classList || new ClassList(node);\n}\n\nfunction ClassList(node) {\n this._node = node;\n this._names = classArray(node.getAttribute(\"class\") || \"\");\n}\n\nClassList.prototype = {\n add: function(name) {\n var i = this._names.indexOf(name);\n if (i < 0) {\n this._names.push(name);\n this._node.setAttribute(\"class\", this._names.join(\" \"));\n }\n },\n remove: function(name) {\n var i = this._names.indexOf(name);\n if (i >= 0) {\n this._names.splice(i, 1);\n this._node.setAttribute(\"class\", this._names.join(\" \"));\n }\n },\n contains: function(name) {\n return this._names.indexOf(name) >= 0;\n }\n};\n\nfunction classedAdd(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.add(names[i]);\n}\n\nfunction classedRemove(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.remove(names[i]);\n}\n\nfunction classedTrue(names) {\n return function() {\n classedAdd(this, names);\n };\n}\n\nfunction classedFalse(names) {\n return function() {\n classedRemove(this, names);\n };\n}\n\nfunction classedFunction(names, value) {\n return function() {\n (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);\n };\n}\n\nfunction selection_classed(name, value) {\n var names = classArray(name + \"\");\n\n if (arguments.length < 2) {\n var list = classList(this.node()), i = -1, n = names.length;\n while (++i < n) if (!list.contains(names[i])) return false;\n return true;\n }\n\n return this.each((typeof value === \"function\"\n ? classedFunction : value\n ? classedTrue\n : classedFalse)(names, value));\n}\n\nfunction textRemove() {\n this.textContent = \"\";\n}\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.textContent = v == null ? \"\" : v;\n };\n}\n\nfunction selection_text(value) {\n return arguments.length\n ? this.each(value == null\n ? textRemove : (typeof value === \"function\"\n ? textFunction\n : textConstant)(value))\n : this.node().textContent;\n}\n\nfunction htmlRemove() {\n this.innerHTML = \"\";\n}\n\nfunction htmlConstant(value) {\n return function() {\n this.innerHTML = value;\n };\n}\n\nfunction htmlFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.innerHTML = v == null ? \"\" : v;\n };\n}\n\nfunction selection_html(value) {\n return arguments.length\n ? this.each(value == null\n ? htmlRemove : (typeof value === \"function\"\n ? htmlFunction\n : htmlConstant)(value))\n : this.node().innerHTML;\n}\n\nfunction raise() {\n if (this.nextSibling) this.parentNode.appendChild(this);\n}\n\nfunction selection_raise() {\n return this.each(raise);\n}\n\nfunction lower() {\n if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild);\n}\n\nfunction selection_lower() {\n return this.each(lower);\n}\n\nfunction selection_append(name) {\n var create = typeof name === \"function\" ? name : creator(name);\n return this.select(function() {\n return this.appendChild(create.apply(this, arguments));\n });\n}\n\nfunction constantNull() {\n return null;\n}\n\nfunction selection_insert(name, before) {\n var create = typeof name === \"function\" ? name : creator(name),\n select = before == null ? constantNull : typeof before === \"function\" ? before : selector(before);\n return this.select(function() {\n return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null);\n });\n}\n\nfunction remove() {\n var parent = this.parentNode;\n if (parent) parent.removeChild(this);\n}\n\nfunction selection_remove() {\n return this.each(remove);\n}\n\nfunction selection_cloneShallow() {\n var clone = this.cloneNode(false), parent = this.parentNode;\n return parent ? parent.insertBefore(clone, this.nextSibling) : clone;\n}\n\nfunction selection_cloneDeep() {\n var clone = this.cloneNode(true), parent = this.parentNode;\n return parent ? parent.insertBefore(clone, this.nextSibling) : clone;\n}\n\nfunction selection_clone(deep) {\n return this.select(deep ? selection_cloneDeep : selection_cloneShallow);\n}\n\nfunction selection_datum(value) {\n return arguments.length\n ? this.property(\"__data__\", value)\n : this.node().__data__;\n}\n\nfunction contextListener(listener) {\n return function(event) {\n listener.call(this, event, this.__data__);\n };\n}\n\nfunction parseTypenames(typenames) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n return {type: t, name: name};\n });\n}\n\nfunction onRemove(typename) {\n return function() {\n var on = this.__on;\n if (!on) return;\n for (var j = 0, i = -1, m = on.length, o; j < m; ++j) {\n if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.options);\n } else {\n on[++i] = o;\n }\n }\n if (++i) on.length = i;\n else delete this.__on;\n };\n}\n\nfunction onAdd(typename, value, options) {\n return function() {\n var on = this.__on, o, listener = contextListener(value);\n if (on) for (var j = 0, m = on.length; j < m; ++j) {\n if ((o = on[j]).type === typename.type && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.options);\n this.addEventListener(o.type, o.listener = listener, o.options = options);\n o.value = value;\n return;\n }\n }\n this.addEventListener(typename.type, listener, options);\n o = {type: typename.type, name: typename.name, value: value, listener: listener, options: options};\n if (!on) this.__on = [o];\n else on.push(o);\n };\n}\n\nfunction selection_on(typename, value, options) {\n var typenames = parseTypenames(typename + \"\"), i, n = typenames.length, t;\n\n if (arguments.length < 2) {\n var on = this.node().__on;\n if (on) for (var j = 0, m = on.length, o; j < m; ++j) {\n for (i = 0, o = on[j]; i < n; ++i) {\n if ((t = typenames[i]).type === o.type && t.name === o.name) {\n return o.value;\n }\n }\n }\n return;\n }\n\n on = value ? onAdd : onRemove;\n for (i = 0; i < n; ++i) this.each(on(typenames[i], value, options));\n return this;\n}\n\nfunction dispatchEvent(node, type, params) {\n var window = defaultView(node),\n event = window.CustomEvent;\n\n if (typeof event === \"function\") {\n event = new event(type, params);\n } else {\n event = window.document.createEvent(\"Event\");\n if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;\n else event.initEvent(type, false, false);\n }\n\n node.dispatchEvent(event);\n}\n\nfunction dispatchConstant(type, params) {\n return function() {\n return dispatchEvent(this, type, params);\n };\n}\n\nfunction dispatchFunction(type, params) {\n return function() {\n return dispatchEvent(this, type, params.apply(this, arguments));\n };\n}\n\nfunction selection_dispatch(type, params) {\n return this.each((typeof params === \"function\"\n ? dispatchFunction\n : dispatchConstant)(type, params));\n}\n\nfunction* selection_iterator() {\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {\n if (node = group[i]) yield node;\n }\n }\n}\n\nvar root = [null];\n\nfunction Selection(groups, parents) {\n this._groups = groups;\n this._parents = parents;\n}\n\nfunction selection() {\n return new Selection([[document.documentElement]], root);\n}\n\nfunction selection_selection() {\n return this;\n}\n\nSelection.prototype = selection.prototype = {\n constructor: Selection,\n select: selection_select,\n selectAll: selection_selectAll,\n selectChild: selection_selectChild,\n selectChildren: selection_selectChildren,\n filter: selection_filter,\n data: selection_data,\n enter: selection_enter,\n exit: selection_exit,\n join: selection_join,\n merge: selection_merge,\n selection: selection_selection,\n order: selection_order,\n sort: selection_sort,\n call: selection_call,\n nodes: selection_nodes,\n node: selection_node,\n size: selection_size,\n empty: selection_empty,\n each: selection_each,\n attr: selection_attr,\n style: selection_style,\n property: selection_property,\n classed: selection_classed,\n text: selection_text,\n html: selection_html,\n raise: selection_raise,\n lower: selection_lower,\n append: selection_append,\n insert: selection_insert,\n remove: selection_remove,\n clone: selection_clone,\n datum: selection_datum,\n on: selection_on,\n dispatch: selection_dispatch,\n [Symbol.iterator]: selection_iterator\n};\n\nfunction select(selector) {\n return typeof selector === \"string\"\n ? new Selection([[document.querySelector(selector)]], [document.documentElement])\n : new Selection([[selector]], root);\n}\n\nfunction create(name) {\n return select(creator(name).call(document.documentElement));\n}\n\nvar nextId = 0;\n\nfunction local() {\n return new Local;\n}\n\nfunction Local() {\n this._ = \"@\" + (++nextId).toString(36);\n}\n\nLocal.prototype = local.prototype = {\n constructor: Local,\n get: function(node) {\n var id = this._;\n while (!(id in node)) if (!(node = node.parentNode)) return;\n return node[id];\n },\n set: function(node, value) {\n return node[this._] = value;\n },\n remove: function(node) {\n return this._ in node && delete node[this._];\n },\n toString: function() {\n return this._;\n }\n};\n\nfunction sourceEvent(event) {\n let sourceEvent;\n while (sourceEvent = event.sourceEvent) event = sourceEvent;\n return event;\n}\n\nfunction pointer(event, node) {\n event = sourceEvent(event);\n if (node === undefined) node = event.currentTarget;\n if (node) {\n var svg = node.ownerSVGElement || node;\n if (svg.createSVGPoint) {\n var point = svg.createSVGPoint();\n point.x = event.clientX, point.y = event.clientY;\n point = point.matrixTransform(node.getScreenCTM().inverse());\n return [point.x, point.y];\n }\n if (node.getBoundingClientRect) {\n var rect = node.getBoundingClientRect();\n return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];\n }\n }\n return [event.pageX, event.pageY];\n}\n\nfunction pointers(events, node) {\n if (events.target) { // i.e., instanceof Event, not TouchList or iterable\n events = sourceEvent(events);\n if (node === undefined) node = events.currentTarget;\n events = events.touches || [events];\n }\n return Array.from(events, event => pointer(event, node));\n}\n\nfunction selectAll(selector) {\n return typeof selector === \"string\"\n ? new Selection([document.querySelectorAll(selector)], [document.documentElement])\n : new Selection([selector == null ? [] : array(selector)], root);\n}\n\nexports.create = create;\nexports.creator = creator;\nexports.local = local;\nexports.matcher = matcher;\nexports.namespace = namespace;\nexports.namespaces = namespaces;\nexports.pointer = pointer;\nexports.pointers = pointers;\nexports.select = select;\nexports.selectAll = selectAll;\nexports.selection = selection;\nexports.selector = selector;\nexports.selectorAll = selectorAll;\nexports.style = styleValue;\nexports.window = defaultView;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","// https://d3js.org/d3-shape/ v2.1.0 Copyright 2021 Mike Bostock\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-path')) :\ntypeof define === 'function' && define.amd ? define(['exports', 'd3-path'], factory) :\n(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.d3 = global.d3 || {}, global.d3));\n}(this, (function (exports, d3Path) { 'use strict';\n\nfunction constant(x) {\n return function constant() {\n return x;\n };\n}\n\nvar abs = Math.abs;\nvar atan2 = Math.atan2;\nvar cos = Math.cos;\nvar max = Math.max;\nvar min = Math.min;\nvar sin = Math.sin;\nvar sqrt = Math.sqrt;\n\nvar epsilon = 1e-12;\nvar pi = Math.PI;\nvar halfPi = pi / 2;\nvar tau = 2 * pi;\n\nfunction acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nfunction asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n\nfunction arcInnerRadius(d) {\n return d.innerRadius;\n}\n\nfunction arcOuterRadius(d) {\n return d.outerRadius;\n}\n\nfunction arcStartAngle(d) {\n return d.startAngle;\n}\n\nfunction arcEndAngle(d) {\n return d.endAngle;\n}\n\nfunction arcPadAngle(d) {\n return d && d.padAngle; // Note: optional!\n}\n\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\n var x10 = x1 - x0, y10 = y1 - y0,\n x32 = x3 - x2, y32 = y3 - y2,\n t = y32 * x10 - x32 * y10;\n if (t * t < epsilon) return;\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\n return [x0 + t * x10, y0 + t * y10];\n}\n\n// Compute perpendicular offset line of length rc.\n// http://mathworld.wolfram.com/Circle-LineIntersection.html\nfunction cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}\n\nfunction arc() {\n var innerRadius = arcInnerRadius,\n outerRadius = arcOuterRadius,\n cornerRadius = constant(0),\n padRadius = null,\n startAngle = arcStartAngle,\n endAngle = arcEndAngle,\n padAngle = arcPadAngle,\n context = null;\n\n function arc() {\n var buffer,\n r,\n r0 = +innerRadius.apply(this, arguments),\n r1 = +outerRadius.apply(this, arguments),\n a0 = startAngle.apply(this, arguments) - halfPi,\n a1 = endAngle.apply(this, arguments) - halfPi,\n da = abs(a1 - a0),\n cw = a1 > a0;\n\n if (!context) context = buffer = d3Path.path();\n\n // Ensure that the outer radius is always larger than the inner radius.\n if (r1 < r0) r = r1, r1 = r0, r0 = r;\n\n // Is it a point?\n if (!(r1 > epsilon)) context.moveTo(0, 0);\n\n // Or is it a circle or annulus?\n else if (da > tau - epsilon) {\n context.moveTo(r1 * cos(a0), r1 * sin(a0));\n context.arc(0, 0, r1, a0, a1, !cw);\n if (r0 > epsilon) {\n context.moveTo(r0 * cos(a1), r0 * sin(a1));\n context.arc(0, 0, r0, a1, a0, cw);\n }\n }\n\n // Or is it a circular or annular sector?\n else {\n var a01 = a0,\n a11 = a1,\n a00 = a0,\n a10 = a1,\n da0 = da,\n da1 = da,\n ap = padAngle.apply(this, arguments) / 2,\n rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),\n rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),\n rc0 = rc,\n rc1 = rc,\n t0,\n t1;\n\n // Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.\n if (rp > epsilon) {\n var p0 = asin(rp / r0 * sin(ap)),\n p1 = asin(rp / r1 * sin(ap));\n if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;\n else da0 = 0, a00 = a10 = (a0 + a1) / 2;\n if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;\n else da1 = 0, a01 = a11 = (a0 + a1) / 2;\n }\n\n var x01 = r1 * cos(a01),\n y01 = r1 * sin(a01),\n x10 = r0 * cos(a10),\n y10 = r0 * sin(a10);\n\n // Apply rounded corners?\n if (rc > epsilon) {\n var x11 = r1 * cos(a11),\n y11 = r1 * sin(a11),\n x00 = r0 * cos(a00),\n y00 = r0 * sin(a00),\n oc;\n\n // Restrict the corner radius according to the sector angle.\n if (da < pi && (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10))) {\n var ax = x01 - oc[0],\n ay = y01 - oc[1],\n bx = x11 - oc[0],\n by = y11 - oc[1],\n kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2),\n lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);\n rc0 = min(rc, (r0 - lc) / (kc - 1));\n rc1 = min(rc, (r1 - lc) / (kc + 1));\n }\n }\n\n // Is the sector collapsed to a line?\n if (!(da1 > epsilon)) context.moveTo(x01, y01);\n\n // Does the sector’s outer ring have rounded corners?\n else if (rc1 > epsilon) {\n t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);\n t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);\n\n context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);\n context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the outer ring just a circular arc?\n else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);\n\n // Is there no inner ring, and it’s a circular sector?\n // Or perhaps it’s an annular sector collapsed due to padding?\n if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);\n\n // Does the sector’s inner ring (or point) have rounded corners?\n else if (rc0 > epsilon) {\n t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);\n t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);\n\n context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);\n context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the inner ring just a circular arc?\n else context.arc(0, 0, r0, a10, a00, cw);\n }\n\n context.closePath();\n\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n arc.centroid = function() {\n var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,\n a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;\n return [cos(a) * r, sin(a) * r];\n };\n\n arc.innerRadius = function(_) {\n return arguments.length ? (innerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : innerRadius;\n };\n\n arc.outerRadius = function(_) {\n return arguments.length ? (outerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : outerRadius;\n };\n\n arc.cornerRadius = function(_) {\n return arguments.length ? (cornerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : cornerRadius;\n };\n\n arc.padRadius = function(_) {\n return arguments.length ? (padRadius = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), arc) : padRadius;\n };\n\n arc.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : startAngle;\n };\n\n arc.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : endAngle;\n };\n\n arc.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : padAngle;\n };\n\n arc.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), arc) : context;\n };\n\n return arc;\n}\n\nvar slice = Array.prototype.slice;\n\nfunction array(x) {\n return typeof x === \"object\" && \"length\" in x\n ? x // Array, TypedArray, NodeList, array-like\n : Array.from(x); // Map, Set, iterable, string, or anything else\n}\n\nfunction Linear(context) {\n this._context = context;\n}\n\nLinear.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // proceed\n default: this._context.lineTo(x, y); break;\n }\n }\n};\n\nfunction curveLinear(context) {\n return new Linear(context);\n}\n\nfunction x(p) {\n return p[0];\n}\n\nfunction y(p) {\n return p[1];\n}\n\nfunction line(x$1, y$1) {\n var defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null;\n\n x$1 = typeof x$1 === \"function\" ? x$1 : (x$1 === undefined) ? x : constant(x$1);\n y$1 = typeof y$1 === \"function\" ? y$1 : (y$1 === undefined) ? y : constant(y$1);\n\n function line(data) {\n var i,\n n = (data = array(data)).length,\n d,\n defined0 = false,\n buffer;\n\n if (context == null) output = curve(buffer = d3Path.path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) output.lineStart();\n else output.lineEnd();\n }\n if (defined0) output.point(+x$1(d, i, data), +y$1(d, i, data));\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n line.x = function(_) {\n return arguments.length ? (x$1 = typeof _ === \"function\" ? _ : constant(+_), line) : x$1;\n };\n\n line.y = function(_) {\n return arguments.length ? (y$1 = typeof _ === \"function\" ? _ : constant(+_), line) : y$1;\n };\n\n line.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), line) : defined;\n };\n\n line.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;\n };\n\n line.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;\n };\n\n return line;\n}\n\nfunction area(x0, y0, y1) {\n var x1 = null,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null;\n\n x0 = typeof x0 === \"function\" ? x0 : (x0 === undefined) ? x : constant(+x0);\n y0 = typeof y0 === \"function\" ? y0 : (y0 === undefined) ? constant(0) : constant(+y0);\n y1 = typeof y1 === \"function\" ? y1 : (y1 === undefined) ? y : constant(+y1);\n\n function area(data) {\n var i,\n j,\n k,\n n = (data = array(data)).length,\n d,\n defined0 = false,\n buffer,\n x0z = new Array(n),\n y0z = new Array(n);\n\n if (context == null) output = curve(buffer = d3Path.path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) {\n j = i;\n output.areaStart();\n output.lineStart();\n } else {\n output.lineEnd();\n output.lineStart();\n for (k = i - 1; k >= j; --k) {\n output.point(x0z[k], y0z[k]);\n }\n output.lineEnd();\n output.areaEnd();\n }\n }\n if (defined0) {\n x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data);\n output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]);\n }\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n function arealine() {\n return line().defined(defined).curve(curve).context(context);\n }\n\n area.x = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), x1 = null, area) : x0;\n };\n\n area.x0 = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), area) : x0;\n };\n\n area.x1 = function(_) {\n return arguments.length ? (x1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : x1;\n };\n\n area.y = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), y1 = null, area) : y0;\n };\n\n area.y0 = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), area) : y0;\n };\n\n area.y1 = function(_) {\n return arguments.length ? (y1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : y1;\n };\n\n area.lineX0 =\n area.lineY0 = function() {\n return arealine().x(x0).y(y0);\n };\n\n area.lineY1 = function() {\n return arealine().x(x0).y(y1);\n };\n\n area.lineX1 = function() {\n return arealine().x(x1).y(y0);\n };\n\n area.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), area) : defined;\n };\n\n area.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;\n };\n\n area.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;\n };\n\n return area;\n}\n\nfunction descending$1(a, b) {\n return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;\n}\n\nfunction identity(d) {\n return d;\n}\n\nfunction pie() {\n var value = identity,\n sortValues = descending$1,\n sort = null,\n startAngle = constant(0),\n endAngle = constant(tau),\n padAngle = constant(0);\n\n function pie(data) {\n var i,\n n = (data = array(data)).length,\n j,\n k,\n sum = 0,\n index = new Array(n),\n arcs = new Array(n),\n a0 = +startAngle.apply(this, arguments),\n da = Math.min(tau, Math.max(-tau, endAngle.apply(this, arguments) - a0)),\n a1,\n p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)),\n pa = p * (da < 0 ? -1 : 1),\n v;\n\n for (i = 0; i < n; ++i) {\n if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {\n sum += v;\n }\n }\n\n // Optionally sort the arcs by previously-computed values or by data.\n if (sortValues != null) index.sort(function(i, j) { return sortValues(arcs[i], arcs[j]); });\n else if (sort != null) index.sort(function(i, j) { return sort(data[i], data[j]); });\n\n // Compute the arcs! They are stored in the original data's order.\n for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) {\n j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = {\n data: data[j],\n index: i,\n value: v,\n startAngle: a0,\n endAngle: a1,\n padAngle: p\n };\n }\n\n return arcs;\n }\n\n pie.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), pie) : value;\n };\n\n pie.sortValues = function(_) {\n return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;\n };\n\n pie.sort = function(_) {\n return arguments.length ? (sort = _, sortValues = null, pie) : sort;\n };\n\n pie.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : startAngle;\n };\n\n pie.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : endAngle;\n };\n\n pie.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : padAngle;\n };\n\n return pie;\n}\n\nvar curveRadialLinear = curveRadial$1(curveLinear);\n\nfunction Radial(curve) {\n this._curve = curve;\n}\n\nRadial.prototype = {\n areaStart: function() {\n this._curve.areaStart();\n },\n areaEnd: function() {\n this._curve.areaEnd();\n },\n lineStart: function() {\n this._curve.lineStart();\n },\n lineEnd: function() {\n this._curve.lineEnd();\n },\n point: function(a, r) {\n this._curve.point(r * Math.sin(a), r * -Math.cos(a));\n }\n};\n\nfunction curveRadial$1(curve) {\n\n function radial(context) {\n return new Radial(curve(context));\n }\n\n radial._curve = curve;\n\n return radial;\n}\n\nfunction lineRadial(l) {\n var c = l.curve;\n\n l.angle = l.x, delete l.x;\n l.radius = l.y, delete l.y;\n\n l.curve = function(_) {\n return arguments.length ? c(curveRadial$1(_)) : c()._curve;\n };\n\n return l;\n}\n\nfunction lineRadial$1() {\n return lineRadial(line().curve(curveRadialLinear));\n}\n\nfunction areaRadial() {\n var a = area().curve(curveRadialLinear),\n c = a.curve,\n x0 = a.lineX0,\n x1 = a.lineX1,\n y0 = a.lineY0,\n y1 = a.lineY1;\n\n a.angle = a.x, delete a.x;\n a.startAngle = a.x0, delete a.x0;\n a.endAngle = a.x1, delete a.x1;\n a.radius = a.y, delete a.y;\n a.innerRadius = a.y0, delete a.y0;\n a.outerRadius = a.y1, delete a.y1;\n a.lineStartAngle = function() { return lineRadial(x0()); }, delete a.lineX0;\n a.lineEndAngle = function() { return lineRadial(x1()); }, delete a.lineX1;\n a.lineInnerRadius = function() { return lineRadial(y0()); }, delete a.lineY0;\n a.lineOuterRadius = function() { return lineRadial(y1()); }, delete a.lineY1;\n\n a.curve = function(_) {\n return arguments.length ? c(curveRadial$1(_)) : c()._curve;\n };\n\n return a;\n}\n\nfunction pointRadial(x, y) {\n return [(y = +y) * Math.cos(x -= Math.PI / 2), y * Math.sin(x)];\n}\n\nfunction linkSource(d) {\n return d.source;\n}\n\nfunction linkTarget(d) {\n return d.target;\n}\n\nfunction link(curve) {\n var source = linkSource,\n target = linkTarget,\n x$1 = x,\n y$1 = y,\n context = null;\n\n function link() {\n var buffer, argv = slice.call(arguments), s = source.apply(this, argv), t = target.apply(this, argv);\n if (!context) context = buffer = d3Path.path();\n curve(context, +x$1.apply(this, (argv[0] = s, argv)), +y$1.apply(this, argv), +x$1.apply(this, (argv[0] = t, argv)), +y$1.apply(this, argv));\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n link.source = function(_) {\n return arguments.length ? (source = _, link) : source;\n };\n\n link.target = function(_) {\n return arguments.length ? (target = _, link) : target;\n };\n\n link.x = function(_) {\n return arguments.length ? (x$1 = typeof _ === \"function\" ? _ : constant(+_), link) : x$1;\n };\n\n link.y = function(_) {\n return arguments.length ? (y$1 = typeof _ === \"function\" ? _ : constant(+_), link) : y$1;\n };\n\n link.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), link) : context;\n };\n\n return link;\n}\n\nfunction curveHorizontal(context, x0, y0, x1, y1) {\n context.moveTo(x0, y0);\n context.bezierCurveTo(x0 = (x0 + x1) / 2, y0, x0, y1, x1, y1);\n}\n\nfunction curveVertical(context, x0, y0, x1, y1) {\n context.moveTo(x0, y0);\n context.bezierCurveTo(x0, y0 = (y0 + y1) / 2, x1, y0, x1, y1);\n}\n\nfunction curveRadial(context, x0, y0, x1, y1) {\n var p0 = pointRadial(x0, y0),\n p1 = pointRadial(x0, y0 = (y0 + y1) / 2),\n p2 = pointRadial(x1, y0),\n p3 = pointRadial(x1, y1);\n context.moveTo(p0[0], p0[1]);\n context.bezierCurveTo(p1[0], p1[1], p2[0], p2[1], p3[0], p3[1]);\n}\n\nfunction linkHorizontal() {\n return link(curveHorizontal);\n}\n\nfunction linkVertical() {\n return link(curveVertical);\n}\n\nfunction linkRadial() {\n var l = link(curveRadial);\n l.angle = l.x, delete l.x;\n l.radius = l.y, delete l.y;\n return l;\n}\n\nvar circle = {\n draw: function(context, size) {\n var r = Math.sqrt(size / pi);\n context.moveTo(r, 0);\n context.arc(0, 0, r, 0, tau);\n }\n};\n\nvar cross = {\n draw: function(context, size) {\n var r = Math.sqrt(size / 5) / 2;\n context.moveTo(-3 * r, -r);\n context.lineTo(-r, -r);\n context.lineTo(-r, -3 * r);\n context.lineTo(r, -3 * r);\n context.lineTo(r, -r);\n context.lineTo(3 * r, -r);\n context.lineTo(3 * r, r);\n context.lineTo(r, r);\n context.lineTo(r, 3 * r);\n context.lineTo(-r, 3 * r);\n context.lineTo(-r, r);\n context.lineTo(-3 * r, r);\n context.closePath();\n }\n};\n\nvar tan30 = Math.sqrt(1 / 3),\n tan30_2 = tan30 * 2;\n\nvar diamond = {\n draw: function(context, size) {\n var y = Math.sqrt(size / tan30_2),\n x = y * tan30;\n context.moveTo(0, -y);\n context.lineTo(x, 0);\n context.lineTo(0, y);\n context.lineTo(-x, 0);\n context.closePath();\n }\n};\n\nvar ka = 0.89081309152928522810,\n kr = Math.sin(pi / 10) / Math.sin(7 * pi / 10),\n kx = Math.sin(tau / 10) * kr,\n ky = -Math.cos(tau / 10) * kr;\n\nvar star = {\n draw: function(context, size) {\n var r = Math.sqrt(size * ka),\n x = kx * r,\n y = ky * r;\n context.moveTo(0, -r);\n context.lineTo(x, y);\n for (var i = 1; i < 5; ++i) {\n var a = tau * i / 5,\n c = Math.cos(a),\n s = Math.sin(a);\n context.lineTo(s * r, -c * r);\n context.lineTo(c * x - s * y, s * x + c * y);\n }\n context.closePath();\n }\n};\n\nvar square = {\n draw: function(context, size) {\n var w = Math.sqrt(size),\n x = -w / 2;\n context.rect(x, x, w, w);\n }\n};\n\nvar sqrt3 = Math.sqrt(3);\n\nvar triangle = {\n draw: function(context, size) {\n var y = -Math.sqrt(size / (sqrt3 * 3));\n context.moveTo(0, y * 2);\n context.lineTo(-sqrt3 * y, -y);\n context.lineTo(sqrt3 * y, -y);\n context.closePath();\n }\n};\n\nvar c = -0.5,\n s = Math.sqrt(3) / 2,\n k = 1 / Math.sqrt(12),\n a = (k / 2 + 1) * 3;\n\nvar wye = {\n draw: function(context, size) {\n var r = Math.sqrt(size / a),\n x0 = r / 2,\n y0 = r * k,\n x1 = x0,\n y1 = r * k + r,\n x2 = -x1,\n y2 = y1;\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n context.lineTo(x2, y2);\n context.lineTo(c * x0 - s * y0, s * x0 + c * y0);\n context.lineTo(c * x1 - s * y1, s * x1 + c * y1);\n context.lineTo(c * x2 - s * y2, s * x2 + c * y2);\n context.lineTo(c * x0 + s * y0, c * y0 - s * x0);\n context.lineTo(c * x1 + s * y1, c * y1 - s * x1);\n context.lineTo(c * x2 + s * y2, c * y2 - s * x2);\n context.closePath();\n }\n};\n\nvar symbols = [\n circle,\n cross,\n diamond,\n square,\n star,\n triangle,\n wye\n];\n\nfunction symbol(type, size) {\n var context = null;\n type = typeof type === \"function\" ? type : constant(type || circle);\n size = typeof size === \"function\" ? size : constant(size === undefined ? 64 : +size);\n\n function symbol() {\n var buffer;\n if (!context) context = buffer = d3Path.path();\n type.apply(this, arguments).draw(context, +size.apply(this, arguments));\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n symbol.type = function(_) {\n return arguments.length ? (type = typeof _ === \"function\" ? _ : constant(_), symbol) : type;\n };\n\n symbol.size = function(_) {\n return arguments.length ? (size = typeof _ === \"function\" ? _ : constant(+_), symbol) : size;\n };\n\n symbol.context = function(_) {\n return arguments.length ? (context = _ == null ? null : _, symbol) : context;\n };\n\n return symbol;\n}\n\nfunction noop() {}\n\nfunction point$3(that, x, y) {\n that._context.bezierCurveTo(\n (2 * that._x0 + that._x1) / 3,\n (2 * that._y0 + that._y1) / 3,\n (that._x0 + 2 * that._x1) / 3,\n (that._y0 + 2 * that._y1) / 3,\n (that._x0 + 4 * that._x1 + x) / 6,\n (that._y0 + 4 * that._y1 + y) / 6\n );\n}\n\nfunction Basis(context) {\n this._context = context;\n}\n\nBasis.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 3: point$3(this, this._x1, this._y1); // proceed\n case 2: this._context.lineTo(this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // proceed\n default: point$3(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nfunction basis(context) {\n return new Basis(context);\n}\n\nfunction BasisClosed(context) {\n this._context = context;\n}\n\nBasisClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x2, this._y2);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);\n this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x2, this._y2);\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x2 = x, this._y2 = y; break;\n case 1: this._point = 2; this._x3 = x, this._y3 = y; break;\n case 2: this._point = 3; this._x4 = x, this._y4 = y; this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6); break;\n default: point$3(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nfunction basisClosed(context) {\n return new BasisClosed(context);\n}\n\nfunction BasisOpen(context) {\n this._context = context;\n}\n\nBasisOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; var x0 = (this._x0 + 4 * this._x1 + x) / 6, y0 = (this._y0 + 4 * this._y1 + y) / 6; this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); break;\n case 3: this._point = 4; // proceed\n default: point$3(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nfunction basisOpen(context) {\n return new BasisOpen(context);\n}\n\nclass Bump {\n constructor(context, x) {\n this._context = context;\n this._x = x;\n }\n areaStart() {\n this._line = 0;\n }\n areaEnd() {\n this._line = NaN;\n }\n lineStart() {\n this._point = 0;\n }\n lineEnd() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n }\n point(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: {\n this._point = 1;\n if (this._line) this._context.lineTo(x, y);\n else this._context.moveTo(x, y);\n break;\n }\n case 1: this._point = 2; // proceed\n default: {\n if (this._x) this._context.bezierCurveTo(this._x0 = (this._x0 + x) / 2, this._y0, this._x0, y, x, y);\n else this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + y) / 2, x, this._y0, x, y);\n break;\n }\n }\n this._x0 = x, this._y0 = y;\n }\n}\n\nfunction bumpX(context) {\n return new Bump(context, true);\n}\n\nfunction bumpY(context) {\n return new Bump(context, false);\n}\n\nfunction Bundle(context, beta) {\n this._basis = new Basis(context);\n this._beta = beta;\n}\n\nBundle.prototype = {\n lineStart: function() {\n this._x = [];\n this._y = [];\n this._basis.lineStart();\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n j = x.length - 1;\n\n if (j > 0) {\n var x0 = x[0],\n y0 = y[0],\n dx = x[j] - x0,\n dy = y[j] - y0,\n i = -1,\n t;\n\n while (++i <= j) {\n t = i / j;\n this._basis.point(\n this._beta * x[i] + (1 - this._beta) * (x0 + t * dx),\n this._beta * y[i] + (1 - this._beta) * (y0 + t * dy)\n );\n }\n }\n\n this._x = this._y = null;\n this._basis.lineEnd();\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\nvar bundle = (function custom(beta) {\n\n function bundle(context) {\n return beta === 1 ? new Basis(context) : new Bundle(context, beta);\n }\n\n bundle.beta = function(beta) {\n return custom(+beta);\n };\n\n return bundle;\n})(0.85);\n\nfunction point$2(that, x, y) {\n that._context.bezierCurveTo(\n that._x1 + that._k * (that._x2 - that._x0),\n that._y1 + that._k * (that._y2 - that._y0),\n that._x2 + that._k * (that._x1 - x),\n that._y2 + that._k * (that._y1 - y),\n that._x2,\n that._y2\n );\n}\n\nfunction Cardinal(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinal.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: point$2(this, this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; this._x1 = x, this._y1 = y; break;\n case 2: this._point = 3; // proceed\n default: point$2(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nvar cardinal = (function custom(tension) {\n\n function cardinal(context) {\n return new Cardinal(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n\nfunction CardinalClosed(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point$2(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nvar cardinalClosed = (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalClosed(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n\nfunction CardinalOpen(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // proceed\n default: point$2(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nvar cardinalOpen = (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalOpen(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n\nfunction point$1(that, x, y) {\n var x1 = that._x1,\n y1 = that._y1,\n x2 = that._x2,\n y2 = that._y2;\n\n if (that._l01_a > epsilon) {\n var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a,\n n = 3 * that._l01_a * (that._l01_a + that._l12_a);\n x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;\n y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;\n }\n\n if (that._l23_a > epsilon) {\n var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a,\n m = 3 * that._l23_a * (that._l23_a + that._l12_a);\n x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m;\n y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m;\n }\n\n that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2);\n}\n\nfunction CatmullRom(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRom.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: this.point(this._x2, this._y2); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; // proceed\n default: point$1(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nvar catmullRom = (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n\nfunction CatmullRomClosed(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point$1(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nvar catmullRomClosed = (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n\nfunction CatmullRomOpen(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // proceed\n default: point$1(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nvar catmullRomOpen = (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n\nfunction LinearClosed(context) {\n this._context = context;\n}\n\nLinearClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._point) this._context.closePath();\n },\n point: function(x, y) {\n x = +x, y = +y;\n if (this._point) this._context.lineTo(x, y);\n else this._point = 1, this._context.moveTo(x, y);\n }\n};\n\nfunction linearClosed(context) {\n return new LinearClosed(context);\n}\n\nfunction sign(x) {\n return x < 0 ? -1 : 1;\n}\n\n// Calculate the slopes of the tangents (Hermite-type interpolation) based on\n// the following paper: Steffen, M. 1990. A Simple Method for Monotonic\n// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.\n// NOV(II), P. 443, 1990.\nfunction slope3(that, x2, y2) {\n var h0 = that._x1 - that._x0,\n h1 = x2 - that._x1,\n s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n p = (s0 * h1 + s1 * h0) / (h0 + h1);\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n}\n\n// Calculate a one-sided slope.\nfunction slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}\n\n// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\n// \"you can express cubic Hermite interpolation in terms of cubic Bézier curves\n// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\nfunction point(that, t0, t1) {\n var x0 = that._x0,\n y0 = that._y0,\n x1 = that._x1,\n y1 = that._y1,\n dx = (x1 - x0) / 3;\n that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);\n}\n\nfunction MonotoneX(context) {\n this._context = context;\n}\n\nMonotoneX.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 =\n this._t0 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x1, this._y1); break;\n case 3: point(this, this._t0, slope2(this, this._t0)); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n var t1 = NaN;\n\n x = +x, y = +y;\n if (x === this._x1 && y === this._y1) return; // Ignore coincident points.\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; point(this, slope2(this, t1 = slope3(this, x, y)), t1); break;\n default: point(this, this._t0, t1 = slope3(this, x, y)); break;\n }\n\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n this._t0 = t1;\n }\n};\n\nfunction MonotoneY(context) {\n this._context = new ReflectContext(context);\n}\n\n(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {\n MonotoneX.prototype.point.call(this, y, x);\n};\n\nfunction ReflectContext(context) {\n this._context = context;\n}\n\nReflectContext.prototype = {\n moveTo: function(x, y) { this._context.moveTo(y, x); },\n closePath: function() { this._context.closePath(); },\n lineTo: function(x, y) { this._context.lineTo(y, x); },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }\n};\n\nfunction monotoneX(context) {\n return new MonotoneX(context);\n}\n\nfunction monotoneY(context) {\n return new MonotoneY(context);\n}\n\nfunction Natural(context) {\n this._context = context;\n}\n\nNatural.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = [];\n this._y = [];\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n n = x.length;\n\n if (n) {\n this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]);\n if (n === 2) {\n this._context.lineTo(x[1], y[1]);\n } else {\n var px = controlPoints(x),\n py = controlPoints(y);\n for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {\n this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]);\n }\n }\n }\n\n if (this._line || (this._line !== 0 && n === 1)) this._context.closePath();\n this._line = 1 - this._line;\n this._x = this._y = null;\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\n// See https://www.particleincell.com/2012/bezier-splines/ for derivation.\nfunction controlPoints(x) {\n var i,\n n = x.length - 1,\n m,\n a = new Array(n),\n b = new Array(n),\n r = new Array(n);\n a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1];\n for (i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1];\n a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n];\n for (i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];\n a[n - 1] = r[n - 1] / b[n - 1];\n for (i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i];\n b[n - 1] = (x[n] + a[n - 1]) / 2;\n for (i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1];\n return [a, b];\n}\n\nfunction natural(context) {\n return new Natural(context);\n}\n\nfunction Step(context, t) {\n this._context = context;\n this._t = t;\n}\n\nStep.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = this._y = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // proceed\n default: {\n if (this._t <= 0) {\n this._context.lineTo(this._x, y);\n this._context.lineTo(x, y);\n } else {\n var x1 = this._x * (1 - this._t) + x * this._t;\n this._context.lineTo(x1, this._y);\n this._context.lineTo(x1, y);\n }\n break;\n }\n }\n this._x = x, this._y = y;\n }\n};\n\nfunction step(context) {\n return new Step(context, 0.5);\n}\n\nfunction stepBefore(context) {\n return new Step(context, 0);\n}\n\nfunction stepAfter(context) {\n return new Step(context, 1);\n}\n\nfunction none$1(series, order) {\n if (!((n = series.length) > 1)) return;\n for (var i = 1, j, s0, s1 = series[order[0]], n, m = s1.length; i < n; ++i) {\n s0 = s1, s1 = series[order[i]];\n for (j = 0; j < m; ++j) {\n s1[j][1] += s1[j][0] = isNaN(s0[j][1]) ? s0[j][0] : s0[j][1];\n }\n }\n}\n\nfunction none(series) {\n var n = series.length, o = new Array(n);\n while (--n >= 0) o[n] = n;\n return o;\n}\n\nfunction stackValue(d, key) {\n return d[key];\n}\n\nfunction stackSeries(key) {\n const series = [];\n series.key = key;\n return series;\n}\n\nfunction stack() {\n var keys = constant([]),\n order = none,\n offset = none$1,\n value = stackValue;\n\n function stack(data) {\n var sz = Array.from(keys.apply(this, arguments), stackSeries),\n i, n = sz.length, j = -1,\n oz;\n\n for (const d of data) {\n for (i = 0, ++j; i < n; ++i) {\n (sz[i][j] = [0, +value(d, sz[i].key, j, data)]).data = d;\n }\n }\n\n for (i = 0, oz = array(order(sz)); i < n; ++i) {\n sz[oz[i]].index = i;\n }\n\n offset(sz, oz);\n return sz;\n }\n\n stack.keys = function(_) {\n return arguments.length ? (keys = typeof _ === \"function\" ? _ : constant(Array.from(_)), stack) : keys;\n };\n\n stack.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), stack) : value;\n };\n\n stack.order = function(_) {\n return arguments.length ? (order = _ == null ? none : typeof _ === \"function\" ? _ : constant(Array.from(_)), stack) : order;\n };\n\n stack.offset = function(_) {\n return arguments.length ? (offset = _ == null ? none$1 : _, stack) : offset;\n };\n\n return stack;\n}\n\nfunction expand(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var i, n, j = 0, m = series[0].length, y; j < m; ++j) {\n for (y = i = 0; i < n; ++i) y += series[i][j][1] || 0;\n if (y) for (i = 0; i < n; ++i) series[i][j][1] /= y;\n }\n none$1(series, order);\n}\n\nfunction diverging(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var i, j = 0, d, dy, yp, yn, n, m = series[order[0]].length; j < m; ++j) {\n for (yp = yn = 0, i = 0; i < n; ++i) {\n if ((dy = (d = series[order[i]][j])[1] - d[0]) > 0) {\n d[0] = yp, d[1] = yp += dy;\n } else if (dy < 0) {\n d[1] = yn, d[0] = yn += dy;\n } else {\n d[0] = 0, d[1] = dy;\n }\n }\n }\n}\n\nfunction silhouette(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var j = 0, s0 = series[order[0]], n, m = s0.length; j < m; ++j) {\n for (var i = 0, y = 0; i < n; ++i) y += series[i][j][1] || 0;\n s0[j][1] += s0[j][0] = -y / 2;\n }\n none$1(series, order);\n}\n\nfunction wiggle(series, order) {\n if (!((n = series.length) > 0) || !((m = (s0 = series[order[0]]).length) > 0)) return;\n for (var y = 0, j = 1, s0, m, n; j < m; ++j) {\n for (var i = 0, s1 = 0, s2 = 0; i < n; ++i) {\n var si = series[order[i]],\n sij0 = si[j][1] || 0,\n sij1 = si[j - 1][1] || 0,\n s3 = (sij0 - sij1) / 2;\n for (var k = 0; k < i; ++k) {\n var sk = series[order[k]],\n skj0 = sk[j][1] || 0,\n skj1 = sk[j - 1][1] || 0;\n s3 += skj0 - skj1;\n }\n s1 += sij0, s2 += s3 * sij0;\n }\n s0[j - 1][1] += s0[j - 1][0] = y;\n if (s1) y -= s2 / s1;\n }\n s0[j - 1][1] += s0[j - 1][0] = y;\n none$1(series, order);\n}\n\nfunction appearance(series) {\n var peaks = series.map(peak);\n return none(series).sort(function(a, b) { return peaks[a] - peaks[b]; });\n}\n\nfunction peak(series) {\n var i = -1, j = 0, n = series.length, vi, vj = -Infinity;\n while (++i < n) if ((vi = +series[i][1]) > vj) vj = vi, j = i;\n return j;\n}\n\nfunction ascending(series) {\n var sums = series.map(sum);\n return none(series).sort(function(a, b) { return sums[a] - sums[b]; });\n}\n\nfunction sum(series) {\n var s = 0, i = -1, n = series.length, v;\n while (++i < n) if (v = +series[i][1]) s += v;\n return s;\n}\n\nfunction descending(series) {\n return ascending(series).reverse();\n}\n\nfunction insideOut(series) {\n var n = series.length,\n i,\n j,\n sums = series.map(sum),\n order = appearance(series),\n top = 0,\n bottom = 0,\n tops = [],\n bottoms = [];\n\n for (i = 0; i < n; ++i) {\n j = order[i];\n if (top < bottom) {\n top += sums[j];\n tops.push(j);\n } else {\n bottom += sums[j];\n bottoms.push(j);\n }\n }\n\n return bottoms.reverse().concat(tops);\n}\n\nfunction reverse(series) {\n return none(series).reverse();\n}\n\nexports.arc = arc;\nexports.area = area;\nexports.areaRadial = areaRadial;\nexports.curveBasis = basis;\nexports.curveBasisClosed = basisClosed;\nexports.curveBasisOpen = basisOpen;\nexports.curveBumpX = bumpX;\nexports.curveBumpY = bumpY;\nexports.curveBundle = bundle;\nexports.curveCardinal = cardinal;\nexports.curveCardinalClosed = cardinalClosed;\nexports.curveCardinalOpen = cardinalOpen;\nexports.curveCatmullRom = catmullRom;\nexports.curveCatmullRomClosed = catmullRomClosed;\nexports.curveCatmullRomOpen = catmullRomOpen;\nexports.curveLinear = curveLinear;\nexports.curveLinearClosed = linearClosed;\nexports.curveMonotoneX = monotoneX;\nexports.curveMonotoneY = monotoneY;\nexports.curveNatural = natural;\nexports.curveStep = step;\nexports.curveStepAfter = stepAfter;\nexports.curveStepBefore = stepBefore;\nexports.line = line;\nexports.lineRadial = lineRadial$1;\nexports.linkHorizontal = linkHorizontal;\nexports.linkRadial = linkRadial;\nexports.linkVertical = linkVertical;\nexports.pie = pie;\nexports.pointRadial = pointRadial;\nexports.radialArea = areaRadial;\nexports.radialLine = lineRadial$1;\nexports.stack = stack;\nexports.stackOffsetDiverging = diverging;\nexports.stackOffsetExpand = expand;\nexports.stackOffsetNone = none$1;\nexports.stackOffsetSilhouette = silhouette;\nexports.stackOffsetWiggle = wiggle;\nexports.stackOrderAppearance = appearance;\nexports.stackOrderAscending = ascending;\nexports.stackOrderDescending = descending;\nexports.stackOrderInsideOut = insideOut;\nexports.stackOrderNone = none;\nexports.stackOrderReverse = reverse;\nexports.symbol = symbol;\nexports.symbolCircle = circle;\nexports.symbolCross = cross;\nexports.symbolDiamond = diamond;\nexports.symbolSquare = square;\nexports.symbolStar = star;\nexports.symbolTriangle = triangle;\nexports.symbolWye = wye;\nexports.symbols = symbols;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n","// https://d3js.org/d3-time-format/ v3.0.0 Copyright 2020 Mike Bostock\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-time')) :\ntypeof define === 'function' && define.amd ? define(['exports', 'd3-time'], factory) :\n(global = global || self, factory(global.d3 = global.d3 || {}, global.d3));\n}(this, function (exports, d3Time) { 'use strict';\n\nfunction localDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);\n date.setFullYear(d.y);\n return date;\n }\n return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);\n}\n\nfunction utcDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));\n date.setUTCFullYear(d.y);\n return date;\n }\n return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));\n}\n\nfunction newDate(y, m, d) {\n return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0};\n}\n\nfunction formatLocale(locale) {\n var locale_dateTime = locale.dateTime,\n locale_date = locale.date,\n locale_time = locale.time,\n locale_periods = locale.periods,\n locale_weekdays = locale.days,\n locale_shortWeekdays = locale.shortDays,\n locale_months = locale.months,\n locale_shortMonths = locale.shortMonths;\n\n var periodRe = formatRe(locale_periods),\n periodLookup = formatLookup(locale_periods),\n weekdayRe = formatRe(locale_weekdays),\n weekdayLookup = formatLookup(locale_weekdays),\n shortWeekdayRe = formatRe(locale_shortWeekdays),\n shortWeekdayLookup = formatLookup(locale_shortWeekdays),\n monthRe = formatRe(locale_months),\n monthLookup = formatLookup(locale_months),\n shortMonthRe = formatRe(locale_shortMonths),\n shortMonthLookup = formatLookup(locale_shortMonths);\n\n var formats = {\n \"a\": formatShortWeekday,\n \"A\": formatWeekday,\n \"b\": formatShortMonth,\n \"B\": formatMonth,\n \"c\": null,\n \"d\": formatDayOfMonth,\n \"e\": formatDayOfMonth,\n \"f\": formatMicroseconds,\n \"g\": formatYearISO,\n \"G\": formatFullYearISO,\n \"H\": formatHour24,\n \"I\": formatHour12,\n \"j\": formatDayOfYear,\n \"L\": formatMilliseconds,\n \"m\": formatMonthNumber,\n \"M\": formatMinutes,\n \"p\": formatPeriod,\n \"q\": formatQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatSeconds,\n \"u\": formatWeekdayNumberMonday,\n \"U\": formatWeekNumberSunday,\n \"V\": formatWeekNumberISO,\n \"w\": formatWeekdayNumberSunday,\n \"W\": formatWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatYear,\n \"Y\": formatFullYear,\n \"Z\": formatZone,\n \"%\": formatLiteralPercent\n };\n\n var utcFormats = {\n \"a\": formatUTCShortWeekday,\n \"A\": formatUTCWeekday,\n \"b\": formatUTCShortMonth,\n \"B\": formatUTCMonth,\n \"c\": null,\n \"d\": formatUTCDayOfMonth,\n \"e\": formatUTCDayOfMonth,\n \"f\": formatUTCMicroseconds,\n \"g\": formatUTCYearISO,\n \"G\": formatUTCFullYearISO,\n \"H\": formatUTCHour24,\n \"I\": formatUTCHour12,\n \"j\": formatUTCDayOfYear,\n \"L\": formatUTCMilliseconds,\n \"m\": formatUTCMonthNumber,\n \"M\": formatUTCMinutes,\n \"p\": formatUTCPeriod,\n \"q\": formatUTCQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatUTCSeconds,\n \"u\": formatUTCWeekdayNumberMonday,\n \"U\": formatUTCWeekNumberSunday,\n \"V\": formatUTCWeekNumberISO,\n \"w\": formatUTCWeekdayNumberSunday,\n \"W\": formatUTCWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatUTCYear,\n \"Y\": formatUTCFullYear,\n \"Z\": formatUTCZone,\n \"%\": formatLiteralPercent\n };\n\n var parses = {\n \"a\": parseShortWeekday,\n \"A\": parseWeekday,\n \"b\": parseShortMonth,\n \"B\": parseMonth,\n \"c\": parseLocaleDateTime,\n \"d\": parseDayOfMonth,\n \"e\": parseDayOfMonth,\n \"f\": parseMicroseconds,\n \"g\": parseYear,\n \"G\": parseFullYear,\n \"H\": parseHour24,\n \"I\": parseHour24,\n \"j\": parseDayOfYear,\n \"L\": parseMilliseconds,\n \"m\": parseMonthNumber,\n \"M\": parseMinutes,\n \"p\": parsePeriod,\n \"q\": parseQuarter,\n \"Q\": parseUnixTimestamp,\n \"s\": parseUnixTimestampSeconds,\n \"S\": parseSeconds,\n \"u\": parseWeekdayNumberMonday,\n \"U\": parseWeekNumberSunday,\n \"V\": parseWeekNumberISO,\n \"w\": parseWeekdayNumberSunday,\n \"W\": parseWeekNumberMonday,\n \"x\": parseLocaleDate,\n \"X\": parseLocaleTime,\n \"y\": parseYear,\n \"Y\": parseFullYear,\n \"Z\": parseZone,\n \"%\": parseLiteralPercent\n };\n\n // These recursive directive definitions must be deferred.\n formats.x = newFormat(locale_date, formats);\n formats.X = newFormat(locale_time, formats);\n formats.c = newFormat(locale_dateTime, formats);\n utcFormats.x = newFormat(locale_date, utcFormats);\n utcFormats.X = newFormat(locale_time, utcFormats);\n utcFormats.c = newFormat(locale_dateTime, utcFormats);\n\n function newFormat(specifier, formats) {\n return function(date) {\n var string = [],\n i = -1,\n j = 0,\n n = specifier.length,\n c,\n pad,\n format;\n\n if (!(date instanceof Date)) date = new Date(+date);\n\n while (++i < n) {\n if (specifier.charCodeAt(i) === 37) {\n string.push(specifier.slice(j, i));\n if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);\n else pad = c === \"e\" ? \" \" : \"0\";\n if (format = formats[c]) c = format(date, pad);\n string.push(c);\n j = i + 1;\n }\n }\n\n string.push(specifier.slice(j, i));\n return string.join(\"\");\n };\n }\n\n function newParse(specifier, Z) {\n return function(string) {\n var d = newDate(1900, undefined, 1),\n i = parseSpecifier(d, specifier, string += \"\", 0),\n week, day;\n if (i != string.length) return null;\n\n // If a UNIX timestamp is specified, return it.\n if (\"Q\" in d) return new Date(d.Q);\n if (\"s\" in d) return new Date(d.s * 1000 + (\"L\" in d ? d.L : 0));\n\n // If this is utcParse, never use the local timezone.\n if (Z && !(\"Z\" in d)) d.Z = 0;\n\n // The am-pm flag is 0 for AM, and 1 for PM.\n if (\"p\" in d) d.H = d.H % 12 + d.p * 12;\n\n // If the month was not specified, inherit from the quarter.\n if (d.m === undefined) d.m = \"q\" in d ? d.q : 0;\n\n // Convert day-of-week and week-of-year to day-of-year.\n if (\"V\" in d) {\n if (d.V < 1 || d.V > 53) return null;\n if (!(\"w\" in d)) d.w = 1;\n if (\"Z\" in d) {\n week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();\n week = day > 4 || day === 0 ? d3Time.utcMonday.ceil(week) : d3Time.utcMonday(week);\n week = d3Time.utcDay.offset(week, (d.V - 1) * 7);\n d.y = week.getUTCFullYear();\n d.m = week.getUTCMonth();\n d.d = week.getUTCDate() + (d.w + 6) % 7;\n } else {\n week = localDate(newDate(d.y, 0, 1)), day = week.getDay();\n week = day > 4 || day === 0 ? d3Time.timeMonday.ceil(week) : d3Time.timeMonday(week);\n week = d3Time.timeDay.offset(week, (d.V - 1) * 7);\n d.y = week.getFullYear();\n d.m = week.getMonth();\n d.d = week.getDate() + (d.w + 6) % 7;\n }\n } else if (\"W\" in d || \"U\" in d) {\n if (!(\"w\" in d)) d.w = \"u\" in d ? d.u % 7 : \"W\" in d ? 1 : 0;\n day = \"Z\" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();\n d.m = 0;\n d.d = \"W\" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;\n }\n\n // If a time zone is specified, all fields are interpreted as UTC and then\n // offset according to the specified time zone.\n if (\"Z\" in d) {\n d.H += d.Z / 100 | 0;\n d.M += d.Z % 100;\n return utcDate(d);\n }\n\n // Otherwise, all fields are in local time.\n return localDate(d);\n };\n }\n\n function parseSpecifier(d, specifier, string, j) {\n var i = 0,\n n = specifier.length,\n m = string.length,\n c,\n parse;\n\n while (i < n) {\n if (j >= m) return -1;\n c = specifier.charCodeAt(i++);\n if (c === 37) {\n c = specifier.charAt(i++);\n parse = parses[c in pads ? specifier.charAt(i++) : c];\n if (!parse || ((j = parse(d, string, j)) < 0)) return -1;\n } else if (c != string.charCodeAt(j++)) {\n return -1;\n }\n }\n\n return j;\n }\n\n function parsePeriod(d, string, i) {\n var n = periodRe.exec(string.slice(i));\n return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortWeekday(d, string, i) {\n var n = shortWeekdayRe.exec(string.slice(i));\n return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseWeekday(d, string, i) {\n var n = weekdayRe.exec(string.slice(i));\n return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortMonth(d, string, i) {\n var n = shortMonthRe.exec(string.slice(i));\n return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseMonth(d, string, i) {\n var n = monthRe.exec(string.slice(i));\n return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseLocaleDateTime(d, string, i) {\n return parseSpecifier(d, locale_dateTime, string, i);\n }\n\n function parseLocaleDate(d, string, i) {\n return parseSpecifier(d, locale_date, string, i);\n }\n\n function parseLocaleTime(d, string, i) {\n return parseSpecifier(d, locale_time, string, i);\n }\n\n function formatShortWeekday(d) {\n return locale_shortWeekdays[d.getDay()];\n }\n\n function formatWeekday(d) {\n return locale_weekdays[d.getDay()];\n }\n\n function formatShortMonth(d) {\n return locale_shortMonths[d.getMonth()];\n }\n\n function formatMonth(d) {\n return locale_months[d.getMonth()];\n }\n\n function formatPeriod(d) {\n return locale_periods[+(d.getHours() >= 12)];\n }\n\n function formatQuarter(d) {\n return 1 + ~~(d.getMonth() / 3);\n }\n\n function formatUTCShortWeekday(d) {\n return locale_shortWeekdays[d.getUTCDay()];\n }\n\n function formatUTCWeekday(d) {\n return locale_weekdays[d.getUTCDay()];\n }\n\n function formatUTCShortMonth(d) {\n return locale_shortMonths[d.getUTCMonth()];\n }\n\n function formatUTCMonth(d) {\n return locale_months[d.getUTCMonth()];\n }\n\n function formatUTCPeriod(d) {\n return locale_periods[+(d.getUTCHours() >= 12)];\n }\n\n function formatUTCQuarter(d) {\n return 1 + ~~(d.getUTCMonth() / 3);\n }\n\n return {\n format: function(specifier) {\n var f = newFormat(specifier += \"\", formats);\n f.toString = function() { return specifier; };\n return f;\n },\n parse: function(specifier) {\n var p = newParse(specifier += \"\", false);\n p.toString = function() { return specifier; };\n return p;\n },\n utcFormat: function(specifier) {\n var f = newFormat(specifier += \"\", utcFormats);\n f.toString = function() { return specifier; };\n return f;\n },\n utcParse: function(specifier) {\n var p = newParse(specifier += \"\", true);\n p.toString = function() { return specifier; };\n return p;\n }\n };\n}\n\nvar pads = {\"-\": \"\", \"_\": \" \", \"0\": \"0\"},\n numberRe = /^\\s*\\d+/, // note: ignores next directive\n percentRe = /^%/,\n requoteRe = /[\\\\^$*+?|[\\]().{}]/g;\n\nfunction pad(value, fill, width) {\n var sign = value < 0 ? \"-\" : \"\",\n string = (sign ? -value : value) + \"\",\n length = string.length;\n return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);\n}\n\nfunction requote(s) {\n return s.replace(requoteRe, \"\\\\$&\");\n}\n\nfunction formatRe(names) {\n return new RegExp(\"^(?:\" + names.map(requote).join(\"|\") + \")\", \"i\");\n}\n\nfunction formatLookup(names) {\n return new Map(names.map((name, i) => [name.toLowerCase(), i]));\n}\n\nfunction parseWeekdayNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.w = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekdayNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.u = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.U = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberISO(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.V = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.W = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseFullYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 4));\n return n ? (d.y = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;\n}\n\nfunction parseZone(d, string, i) {\n var n = /^(Z)|([+-]\\d\\d)(?::?(\\d\\d))?/.exec(string.slice(i, i + 6));\n return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || \"00\")), i + n[0].length) : -1;\n}\n\nfunction parseQuarter(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;\n}\n\nfunction parseMonthNumber(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.m = n[0] - 1, i + n[0].length) : -1;\n}\n\nfunction parseDayOfMonth(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseDayOfYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseHour24(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.H = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMinutes(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.M = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.S = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMilliseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.L = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMicroseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 6));\n return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;\n}\n\nfunction parseLiteralPercent(d, string, i) {\n var n = percentRe.exec(string.slice(i, i + 1));\n return n ? i + n[0].length : -1;\n}\n\nfunction parseUnixTimestamp(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.Q = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseUnixTimestampSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.s = +n[0], i + n[0].length) : -1;\n}\n\nfunction formatDayOfMonth(d, p) {\n return pad(d.getDate(), p, 2);\n}\n\nfunction formatHour24(d, p) {\n return pad(d.getHours(), p, 2);\n}\n\nfunction formatHour12(d, p) {\n return pad(d.getHours() % 12 || 12, p, 2);\n}\n\nfunction formatDayOfYear(d, p) {\n return pad(1 + d3Time.timeDay.count(d3Time.timeYear(d), d), p, 3);\n}\n\nfunction formatMilliseconds(d, p) {\n return pad(d.getMilliseconds(), p, 3);\n}\n\nfunction formatMicroseconds(d, p) {\n return formatMilliseconds(d, p) + \"000\";\n}\n\nfunction formatMonthNumber(d, p) {\n return pad(d.getMonth() + 1, p, 2);\n}\n\nfunction formatMinutes(d, p) {\n return pad(d.getMinutes(), p, 2);\n}\n\nfunction formatSeconds(d, p) {\n return pad(d.getSeconds(), p, 2);\n}\n\nfunction formatWeekdayNumberMonday(d) {\n var day = d.getDay();\n return day === 0 ? 7 : day;\n}\n\nfunction formatWeekNumberSunday(d, p) {\n return pad(d3Time.timeSunday.count(d3Time.timeYear(d) - 1, d), p, 2);\n}\n\nfunction dISO(d) {\n var day = d.getDay();\n return (day >= 4 || day === 0) ? d3Time.timeThursday(d) : d3Time.timeThursday.ceil(d);\n}\n\nfunction formatWeekNumberISO(d, p) {\n d = dISO(d);\n return pad(d3Time.timeThursday.count(d3Time.timeYear(d), d) + (d3Time.timeYear(d).getDay() === 4), p, 2);\n}\n\nfunction formatWeekdayNumberSunday(d) {\n return d.getDay();\n}\n\nfunction formatWeekNumberMonday(d, p) {\n return pad(d3Time.timeMonday.count(d3Time.timeYear(d) - 1, d), p, 2);\n}\n\nfunction formatYear(d, p) {\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatYearISO(d, p) {\n d = dISO(d);\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatFullYear(d, p) {\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatFullYearISO(d, p) {\n var day = d.getDay();\n d = (day >= 4 || day === 0) ? d3Time.timeThursday(d) : d3Time.timeThursday.ceil(d);\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatZone(d) {\n var z = d.getTimezoneOffset();\n return (z > 0 ? \"-\" : (z *= -1, \"+\"))\n + pad(z / 60 | 0, \"0\", 2)\n + pad(z % 60, \"0\", 2);\n}\n\nfunction formatUTCDayOfMonth(d, p) {\n return pad(d.getUTCDate(), p, 2);\n}\n\nfunction formatUTCHour24(d, p) {\n return pad(d.getUTCHours(), p, 2);\n}\n\nfunction formatUTCHour12(d, p) {\n return pad(d.getUTCHours() % 12 || 12, p, 2);\n}\n\nfunction formatUTCDayOfYear(d, p) {\n return pad(1 + d3Time.utcDay.count(d3Time.utcYear(d), d), p, 3);\n}\n\nfunction formatUTCMilliseconds(d, p) {\n return pad(d.getUTCMilliseconds(), p, 3);\n}\n\nfunction formatUTCMicroseconds(d, p) {\n return formatUTCMilliseconds(d, p) + \"000\";\n}\n\nfunction formatUTCMonthNumber(d, p) {\n return pad(d.getUTCMonth() + 1, p, 2);\n}\n\nfunction formatUTCMinutes(d, p) {\n return pad(d.getUTCMinutes(), p, 2);\n}\n\nfunction formatUTCSeconds(d, p) {\n return pad(d.getUTCSeconds(), p, 2);\n}\n\nfunction formatUTCWeekdayNumberMonday(d) {\n var dow = d.getUTCDay();\n return dow === 0 ? 7 : dow;\n}\n\nfunction formatUTCWeekNumberSunday(d, p) {\n return pad(d3Time.utcSunday.count(d3Time.utcYear(d) - 1, d), p, 2);\n}\n\nfunction UTCdISO(d) {\n var day = d.getUTCDay();\n return (day >= 4 || day === 0) ? d3Time.utcThursday(d) : d3Time.utcThursday.ceil(d);\n}\n\nfunction formatUTCWeekNumberISO(d, p) {\n d = UTCdISO(d);\n return pad(d3Time.utcThursday.count(d3Time.utcYear(d), d) + (d3Time.utcYear(d).getUTCDay() === 4), p, 2);\n}\n\nfunction formatUTCWeekdayNumberSunday(d) {\n return d.getUTCDay();\n}\n\nfunction formatUTCWeekNumberMonday(d, p) {\n return pad(d3Time.utcMonday.count(d3Time.utcYear(d) - 1, d), p, 2);\n}\n\nfunction formatUTCYear(d, p) {\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCYearISO(d, p) {\n d = UTCdISO(d);\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCFullYear(d, p) {\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCFullYearISO(d, p) {\n var day = d.getUTCDay();\n d = (day >= 4 || day === 0) ? d3Time.utcThursday(d) : d3Time.utcThursday.ceil(d);\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCZone() {\n return \"+0000\";\n}\n\nfunction formatLiteralPercent() {\n return \"%\";\n}\n\nfunction formatUnixTimestamp(d) {\n return +d;\n}\n\nfunction formatUnixTimestampSeconds(d) {\n return Math.floor(+d / 1000);\n}\n\nvar locale;\n\ndefaultLocale({\n dateTime: \"%x, %X\",\n date: \"%-m/%-d/%Y\",\n time: \"%-I:%M:%S %p\",\n periods: [\"AM\", \"PM\"],\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n shortDays: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n shortMonths: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n});\n\nfunction defaultLocale(definition) {\n locale = formatLocale(definition);\n exports.timeFormat = locale.format;\n exports.timeParse = locale.parse;\n exports.utcFormat = locale.utcFormat;\n exports.utcParse = locale.utcParse;\n return locale;\n}\n\nvar isoSpecifier = \"%Y-%m-%dT%H:%M:%S.%LZ\";\n\nfunction formatIsoNative(date) {\n return date.toISOString();\n}\n\nvar formatIso = Date.prototype.toISOString\n ? formatIsoNative\n : exports.utcFormat(isoSpecifier);\n\nfunction parseIsoNative(string) {\n var date = new Date(string);\n return isNaN(date) ? null : date;\n}\n\nvar parseIso = +new Date(\"2000-01-01T00:00:00.000Z\")\n ? parseIsoNative\n : exports.utcParse(isoSpecifier);\n\nexports.isoFormat = formatIso;\nexports.isoParse = parseIso;\nexports.timeFormatDefaultLocale = defaultLocale;\nexports.timeFormatLocale = formatLocale;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","// https://d3js.org/d3-time/ v2.1.1 Copyright 2021 Mike Bostock\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-array')) :\ntypeof define === 'function' && define.amd ? define(['exports', 'd3-array'], factory) :\n(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.d3 = global.d3 || {}, global.d3));\n}(this, (function (exports, d3Array) { 'use strict';\n\nvar t0 = new Date,\n t1 = new Date;\n\nfunction newInterval(floori, offseti, count, field) {\n\n function interval(date) {\n return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;\n }\n\n interval.floor = function(date) {\n return floori(date = new Date(+date)), date;\n };\n\n interval.ceil = function(date) {\n return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;\n };\n\n interval.round = function(date) {\n var d0 = interval(date),\n d1 = interval.ceil(date);\n return date - d0 < d1 - date ? d0 : d1;\n };\n\n interval.offset = function(date, step) {\n return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;\n };\n\n interval.range = function(start, stop, step) {\n var range = [], previous;\n start = interval.ceil(start);\n step = step == null ? 1 : Math.floor(step);\n if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date\n do range.push(previous = new Date(+start)), offseti(start, step), floori(start);\n while (previous < start && start < stop);\n return range;\n };\n\n interval.filter = function(test) {\n return newInterval(function(date) {\n if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);\n }, function(date, step) {\n if (date >= date) {\n if (step < 0) while (++step <= 0) {\n while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty\n } else while (--step >= 0) {\n while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty\n }\n }\n });\n };\n\n if (count) {\n interval.count = function(start, end) {\n t0.setTime(+start), t1.setTime(+end);\n floori(t0), floori(t1);\n return Math.floor(count(t0, t1));\n };\n\n interval.every = function(step) {\n step = Math.floor(step);\n return !isFinite(step) || !(step > 0) ? null\n : !(step > 1) ? interval\n : interval.filter(field\n ? function(d) { return field(d) % step === 0; }\n : function(d) { return interval.count(0, d) % step === 0; });\n };\n }\n\n return interval;\n}\n\nvar millisecond = newInterval(function() {\n // noop\n}, function(date, step) {\n date.setTime(+date + step);\n}, function(start, end) {\n return end - start;\n});\n\n// An optimized implementation for this simple case.\nmillisecond.every = function(k) {\n k = Math.floor(k);\n if (!isFinite(k) || !(k > 0)) return null;\n if (!(k > 1)) return millisecond;\n return newInterval(function(date) {\n date.setTime(Math.floor(date / k) * k);\n }, function(date, step) {\n date.setTime(+date + step * k);\n }, function(start, end) {\n return (end - start) / k;\n });\n};\nvar milliseconds = millisecond.range;\n\nconst durationSecond = 1000;\nconst durationMinute = durationSecond * 60;\nconst durationHour = durationMinute * 60;\nconst durationDay = durationHour * 24;\nconst durationWeek = durationDay * 7;\nconst durationMonth = durationDay * 30;\nconst durationYear = durationDay * 365;\n\nvar second = newInterval(function(date) {\n date.setTime(date - date.getMilliseconds());\n}, function(date, step) {\n date.setTime(+date + step * durationSecond);\n}, function(start, end) {\n return (end - start) / durationSecond;\n}, function(date) {\n return date.getUTCSeconds();\n});\nvar seconds = second.range;\n\nvar minute = newInterval(function(date) {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);\n}, function(date, step) {\n date.setTime(+date + step * durationMinute);\n}, function(start, end) {\n return (end - start) / durationMinute;\n}, function(date) {\n return date.getMinutes();\n});\nvar minutes = minute.range;\n\nvar hour = newInterval(function(date) {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);\n}, function(date, step) {\n date.setTime(+date + step * durationHour);\n}, function(start, end) {\n return (end - start) / durationHour;\n}, function(date) {\n return date.getHours();\n});\nvar hours = hour.range;\n\nvar day = newInterval(\n date => date.setHours(0, 0, 0, 0),\n (date, step) => date.setDate(date.getDate() + step),\n (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,\n date => date.getDate() - 1\n);\nvar days = day.range;\n\nfunction weekday(i) {\n return newInterval(function(date) {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setDate(date.getDate() + step * 7);\n }, function(start, end) {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;\n });\n}\n\nvar sunday = weekday(0);\nvar monday = weekday(1);\nvar tuesday = weekday(2);\nvar wednesday = weekday(3);\nvar thursday = weekday(4);\nvar friday = weekday(5);\nvar saturday = weekday(6);\n\nvar sundays = sunday.range;\nvar mondays = monday.range;\nvar tuesdays = tuesday.range;\nvar wednesdays = wednesday.range;\nvar thursdays = thursday.range;\nvar fridays = friday.range;\nvar saturdays = saturday.range;\n\nvar month = newInterval(function(date) {\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setMonth(date.getMonth() + step);\n}, function(start, end) {\n return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;\n}, function(date) {\n return date.getMonth();\n});\nvar months = month.range;\n\nvar year = newInterval(function(date) {\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setFullYear(date.getFullYear() + step);\n}, function(start, end) {\n return end.getFullYear() - start.getFullYear();\n}, function(date) {\n return date.getFullYear();\n});\n\n// An optimized implementation for this simple case.\nyear.every = function(k) {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function(date) {\n date.setFullYear(Math.floor(date.getFullYear() / k) * k);\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setFullYear(date.getFullYear() + step * k);\n });\n};\nvar years = year.range;\n\nvar utcMinute = newInterval(function(date) {\n date.setUTCSeconds(0, 0);\n}, function(date, step) {\n date.setTime(+date + step * durationMinute);\n}, function(start, end) {\n return (end - start) / durationMinute;\n}, function(date) {\n return date.getUTCMinutes();\n});\nvar utcMinutes = utcMinute.range;\n\nvar utcHour = newInterval(function(date) {\n date.setUTCMinutes(0, 0, 0);\n}, function(date, step) {\n date.setTime(+date + step * durationHour);\n}, function(start, end) {\n return (end - start) / durationHour;\n}, function(date) {\n return date.getUTCHours();\n});\nvar utcHours = utcHour.range;\n\nvar utcDay = newInterval(function(date) {\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCDate(date.getUTCDate() + step);\n}, function(start, end) {\n return (end - start) / durationDay;\n}, function(date) {\n return date.getUTCDate() - 1;\n});\nvar utcDays = utcDay.range;\n\nfunction utcWeekday(i) {\n return newInterval(function(date) {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, function(start, end) {\n return (end - start) / durationWeek;\n });\n}\n\nvar utcSunday = utcWeekday(0);\nvar utcMonday = utcWeekday(1);\nvar utcTuesday = utcWeekday(2);\nvar utcWednesday = utcWeekday(3);\nvar utcThursday = utcWeekday(4);\nvar utcFriday = utcWeekday(5);\nvar utcSaturday = utcWeekday(6);\n\nvar utcSundays = utcSunday.range;\nvar utcMondays = utcMonday.range;\nvar utcTuesdays = utcTuesday.range;\nvar utcWednesdays = utcWednesday.range;\nvar utcThursdays = utcThursday.range;\nvar utcFridays = utcFriday.range;\nvar utcSaturdays = utcSaturday.range;\n\nvar utcMonth = newInterval(function(date) {\n date.setUTCDate(1);\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCMonth(date.getUTCMonth() + step);\n}, function(start, end) {\n return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;\n}, function(date) {\n return date.getUTCMonth();\n});\nvar utcMonths = utcMonth.range;\n\nvar utcYear = newInterval(function(date) {\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCFullYear(date.getUTCFullYear() + step);\n}, function(start, end) {\n return end.getUTCFullYear() - start.getUTCFullYear();\n}, function(date) {\n return date.getUTCFullYear();\n});\n\n// An optimized implementation for this simple case.\nutcYear.every = function(k) {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function(date) {\n date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setUTCFullYear(date.getUTCFullYear() + step * k);\n });\n};\nvar utcYears = utcYear.range;\n\nfunction ticker(year, month, week, day, hour, minute) {\n\n const tickIntervals = [\n [second, 1, durationSecond],\n [second, 5, 5 * durationSecond],\n [second, 15, 15 * durationSecond],\n [second, 30, 30 * durationSecond],\n [minute, 1, durationMinute],\n [minute, 5, 5 * durationMinute],\n [minute, 15, 15 * durationMinute],\n [minute, 30, 30 * durationMinute],\n [ hour, 1, durationHour ],\n [ hour, 3, 3 * durationHour ],\n [ hour, 6, 6 * durationHour ],\n [ hour, 12, 12 * durationHour ],\n [ day, 1, durationDay ],\n [ day, 2, 2 * durationDay ],\n [ week, 1, durationWeek ],\n [ month, 1, durationMonth ],\n [ month, 3, 3 * durationMonth ],\n [ year, 1, durationYear ]\n ];\n\n function ticks(start, stop, count) {\n const reverse = stop < start;\n if (reverse) [start, stop] = [stop, start];\n const interval = count && typeof count.range === \"function\" ? count : tickInterval(start, stop, count);\n const ticks = interval ? interval.range(start, +stop + 1) : []; // inclusive stop\n return reverse ? ticks.reverse() : ticks;\n }\n\n function tickInterval(start, stop, count) {\n const target = Math.abs(stop - start) / count;\n const i = d3Array.bisector(([,, step]) => step).right(tickIntervals, target);\n if (i === tickIntervals.length) return year.every(d3Array.tickStep(start / durationYear, stop / durationYear, count));\n if (i === 0) return millisecond.every(Math.max(d3Array.tickStep(start, stop, count), 1));\n const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];\n return t.every(step);\n }\n\n return [ticks, tickInterval];\n}\n\nconst [utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcSunday, utcDay, utcHour, utcMinute);\nconst [timeTicks, timeTickInterval] = ticker(year, month, sunday, day, hour, minute);\n\nexports.timeDay = day;\nexports.timeDays = days;\nexports.timeFriday = friday;\nexports.timeFridays = fridays;\nexports.timeHour = hour;\nexports.timeHours = hours;\nexports.timeInterval = newInterval;\nexports.timeMillisecond = millisecond;\nexports.timeMilliseconds = milliseconds;\nexports.timeMinute = minute;\nexports.timeMinutes = minutes;\nexports.timeMonday = monday;\nexports.timeMondays = mondays;\nexports.timeMonth = month;\nexports.timeMonths = months;\nexports.timeSaturday = saturday;\nexports.timeSaturdays = saturdays;\nexports.timeSecond = second;\nexports.timeSeconds = seconds;\nexports.timeSunday = sunday;\nexports.timeSundays = sundays;\nexports.timeThursday = thursday;\nexports.timeThursdays = thursdays;\nexports.timeTickInterval = timeTickInterval;\nexports.timeTicks = timeTicks;\nexports.timeTuesday = tuesday;\nexports.timeTuesdays = tuesdays;\nexports.timeWednesday = wednesday;\nexports.timeWednesdays = wednesdays;\nexports.timeWeek = sunday;\nexports.timeWeeks = sundays;\nexports.timeYear = year;\nexports.timeYears = years;\nexports.utcDay = utcDay;\nexports.utcDays = utcDays;\nexports.utcFriday = utcFriday;\nexports.utcFridays = utcFridays;\nexports.utcHour = utcHour;\nexports.utcHours = utcHours;\nexports.utcMillisecond = millisecond;\nexports.utcMilliseconds = milliseconds;\nexports.utcMinute = utcMinute;\nexports.utcMinutes = utcMinutes;\nexports.utcMonday = utcMonday;\nexports.utcMondays = utcMondays;\nexports.utcMonth = utcMonth;\nexports.utcMonths = utcMonths;\nexports.utcSaturday = utcSaturday;\nexports.utcSaturdays = utcSaturdays;\nexports.utcSecond = second;\nexports.utcSeconds = seconds;\nexports.utcSunday = utcSunday;\nexports.utcSundays = utcSundays;\nexports.utcThursday = utcThursday;\nexports.utcThursdays = utcThursdays;\nexports.utcTickInterval = utcTickInterval;\nexports.utcTicks = utcTicks;\nexports.utcTuesday = utcTuesday;\nexports.utcTuesdays = utcTuesdays;\nexports.utcWednesday = utcWednesday;\nexports.utcWednesdays = utcWednesdays;\nexports.utcWeek = utcSunday;\nexports.utcWeeks = utcSundays;\nexports.utcYear = utcYear;\nexports.utcYears = utcYears;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n","// https://d3js.org/d3-timer/ v2.0.0 Copyright 2020 Mike Bostock\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\ntypeof define === 'function' && define.amd ? define(['exports'], factory) :\n(global = global || self, factory(global.d3 = global.d3 || {}));\n}(this, function (exports) { 'use strict';\n\nvar frame = 0, // is an animation frame pending?\n timeout = 0, // is a timeout pending?\n interval = 0, // are any timers active?\n pokeDelay = 1000, // how frequently we check for clock skew\n taskHead,\n taskTail,\n clockLast = 0,\n clockNow = 0,\n clockSkew = 0,\n clock = typeof performance === \"object\" && performance.now ? performance : Date,\n setFrame = typeof window === \"object\" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };\n\nfunction now() {\n return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);\n}\n\nfunction clearNow() {\n clockNow = 0;\n}\n\nfunction Timer() {\n this._call =\n this._time =\n this._next = null;\n}\n\nTimer.prototype = timer.prototype = {\n constructor: Timer,\n restart: function(callback, delay, time) {\n if (typeof callback !== \"function\") throw new TypeError(\"callback is not a function\");\n time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);\n if (!this._next && taskTail !== this) {\n if (taskTail) taskTail._next = this;\n else taskHead = this;\n taskTail = this;\n }\n this._call = callback;\n this._time = time;\n sleep();\n },\n stop: function() {\n if (this._call) {\n this._call = null;\n this._time = Infinity;\n sleep();\n }\n }\n};\n\nfunction timer(callback, delay, time) {\n var t = new Timer;\n t.restart(callback, delay, time);\n return t;\n}\n\nfunction timerFlush() {\n now(); // Get the current time, if not already set.\n ++frame; // Pretend we’ve set an alarm, if we haven’t already.\n var t = taskHead, e;\n while (t) {\n if ((e = clockNow - t._time) >= 0) t._call.call(null, e);\n t = t._next;\n }\n --frame;\n}\n\nfunction wake() {\n clockNow = (clockLast = clock.now()) + clockSkew;\n frame = timeout = 0;\n try {\n timerFlush();\n } finally {\n frame = 0;\n nap();\n clockNow = 0;\n }\n}\n\nfunction poke() {\n var now = clock.now(), delay = now - clockLast;\n if (delay > pokeDelay) clockSkew -= delay, clockLast = now;\n}\n\nfunction nap() {\n var t0, t1 = taskHead, t2, time = Infinity;\n while (t1) {\n if (t1._call) {\n if (time > t1._time) time = t1._time;\n t0 = t1, t1 = t1._next;\n } else {\n t2 = t1._next, t1._next = null;\n t1 = t0 ? t0._next = t2 : taskHead = t2;\n }\n }\n taskTail = t0;\n sleep(time);\n}\n\nfunction sleep(time) {\n if (frame) return; // Soonest alarm already set, or will be.\n if (timeout) timeout = clearTimeout(timeout);\n var delay = time - clockNow; // Strictly less than if we recomputed clockNow.\n if (delay > 24) {\n if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);\n if (interval) interval = clearInterval(interval);\n } else {\n if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);\n frame = 1, setFrame(wake);\n }\n}\n\nfunction timeout$1(callback, delay, time) {\n var t = new Timer;\n delay = delay == null ? 0 : +delay;\n t.restart(elapsed => {\n t.stop();\n callback(elapsed + delay);\n }, delay, time);\n return t;\n}\n\nfunction interval$1(callback, delay, time) {\n var t = new Timer, total = delay;\n if (delay == null) return t.restart(callback, delay, time), t;\n t._restart = t.restart;\n t.restart = function(callback, delay, time) {\n delay = +delay, time = time == null ? now() : +time;\n t._restart(function tick(elapsed) {\n elapsed += total;\n t._restart(tick, total += delay, time);\n callback(elapsed);\n }, delay, time);\n };\n t.restart(callback, delay, time);\n return t;\n}\n\nexports.interval = interval$1;\nexports.now = now;\nexports.timeout = timeout$1;\nexports.timer = timer;\nexports.timerFlush = timerFlush;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","// https://d3js.org/d3-transition/ v2.0.0 Copyright 2020 Mike Bostock\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-selection'), require('d3-dispatch'), require('d3-timer'), require('d3-interpolate'), require('d3-color'), require('d3-ease')) :\ntypeof define === 'function' && define.amd ? define(['exports', 'd3-selection', 'd3-dispatch', 'd3-timer', 'd3-interpolate', 'd3-color', 'd3-ease'], factory) :\n(global = global || self, factory(global.d3 = global.d3 || {}, global.d3, global.d3, global.d3, global.d3, global.d3, global.d3));\n}(this, function (exports, d3Selection, d3Dispatch, d3Timer, d3Interpolate, d3Color, d3Ease) { 'use strict';\n\nvar emptyOn = d3Dispatch.dispatch(\"start\", \"end\", \"cancel\", \"interrupt\");\nvar emptyTween = [];\n\nvar CREATED = 0;\nvar SCHEDULED = 1;\nvar STARTING = 2;\nvar STARTED = 3;\nvar RUNNING = 4;\nvar ENDING = 5;\nvar ENDED = 6;\n\nfunction schedule(node, name, id, index, group, timing) {\n var schedules = node.__transition;\n if (!schedules) node.__transition = {};\n else if (id in schedules) return;\n create(node, id, {\n name: name,\n index: index, // For context during callback.\n group: group, // For context during callback.\n on: emptyOn,\n tween: emptyTween,\n time: timing.time,\n delay: timing.delay,\n duration: timing.duration,\n ease: timing.ease,\n timer: null,\n state: CREATED\n });\n}\n\nfunction init(node, id) {\n var schedule = get(node, id);\n if (schedule.state > CREATED) throw new Error(\"too late; already scheduled\");\n return schedule;\n}\n\nfunction set(node, id) {\n var schedule = get(node, id);\n if (schedule.state > STARTED) throw new Error(\"too late; already running\");\n return schedule;\n}\n\nfunction get(node, id) {\n var schedule = node.__transition;\n if (!schedule || !(schedule = schedule[id])) throw new Error(\"transition not found\");\n return schedule;\n}\n\nfunction create(node, id, self) {\n var schedules = node.__transition,\n tween;\n\n // Initialize the self timer when the transition is created.\n // Note the actual delay is not known until the first callback!\n schedules[id] = self;\n self.timer = d3Timer.timer(schedule, 0, self.time);\n\n function schedule(elapsed) {\n self.state = SCHEDULED;\n self.timer.restart(start, self.delay, self.time);\n\n // If the elapsed delay is less than our first sleep, start immediately.\n if (self.delay <= elapsed) start(elapsed - self.delay);\n }\n\n function start(elapsed) {\n var i, j, n, o;\n\n // If the state is not SCHEDULED, then we previously errored on start.\n if (self.state !== SCHEDULED) return stop();\n\n for (i in schedules) {\n o = schedules[i];\n if (o.name !== self.name) continue;\n\n // While this element already has a starting transition during this frame,\n // defer starting an interrupting transition until that transition has a\n // chance to tick (and possibly end); see d3/d3-transition#54!\n if (o.state === STARTED) return d3Timer.timeout(start);\n\n // Interrupt the active transition, if any.\n if (o.state === RUNNING) {\n o.state = ENDED;\n o.timer.stop();\n o.on.call(\"interrupt\", node, node.__data__, o.index, o.group);\n delete schedules[i];\n }\n\n // Cancel any pre-empted transitions.\n else if (+i < id) {\n o.state = ENDED;\n o.timer.stop();\n o.on.call(\"cancel\", node, node.__data__, o.index, o.group);\n delete schedules[i];\n }\n }\n\n // Defer the first tick to end of the current frame; see d3/d3#1576.\n // Note the transition may be canceled after start and before the first tick!\n // Note this must be scheduled before the start event; see d3/d3-transition#16!\n // Assuming this is successful, subsequent callbacks go straight to tick.\n d3Timer.timeout(function() {\n if (self.state === STARTED) {\n self.state = RUNNING;\n self.timer.restart(tick, self.delay, self.time);\n tick(elapsed);\n }\n });\n\n // Dispatch the start event.\n // Note this must be done before the tween are initialized.\n self.state = STARTING;\n self.on.call(\"start\", node, node.__data__, self.index, self.group);\n if (self.state !== STARTING) return; // interrupted\n self.state = STARTED;\n\n // Initialize the tween, deleting null tween.\n tween = new Array(n = self.tween.length);\n for (i = 0, j = -1; i < n; ++i) {\n if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) {\n tween[++j] = o;\n }\n }\n tween.length = j + 1;\n }\n\n function tick(elapsed) {\n var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1),\n i = -1,\n n = tween.length;\n\n while (++i < n) {\n tween[i].call(node, t);\n }\n\n // Dispatch the end event.\n if (self.state === ENDING) {\n self.on.call(\"end\", node, node.__data__, self.index, self.group);\n stop();\n }\n }\n\n function stop() {\n self.state = ENDED;\n self.timer.stop();\n delete schedules[id];\n for (var i in schedules) return; // eslint-disable-line no-unused-vars\n delete node.__transition;\n }\n}\n\nfunction interrupt(node, name) {\n var schedules = node.__transition,\n schedule,\n active,\n empty = true,\n i;\n\n if (!schedules) return;\n\n name = name == null ? null : name + \"\";\n\n for (i in schedules) {\n if ((schedule = schedules[i]).name !== name) { empty = false; continue; }\n active = schedule.state > STARTING && schedule.state < ENDING;\n schedule.state = ENDED;\n schedule.timer.stop();\n schedule.on.call(active ? \"interrupt\" : \"cancel\", node, node.__data__, schedule.index, schedule.group);\n delete schedules[i];\n }\n\n if (empty) delete node.__transition;\n}\n\nfunction selection_interrupt(name) {\n return this.each(function() {\n interrupt(this, name);\n });\n}\n\nfunction tweenRemove(id, name) {\n var tween0, tween1;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we’re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = tween0 = tween;\n for (var i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1 = tween1.slice();\n tween1.splice(i, 1);\n break;\n }\n }\n }\n\n schedule.tween = tween1;\n };\n}\n\nfunction tweenFunction(id, name, value) {\n var tween0, tween1;\n if (typeof value !== \"function\") throw new Error;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we’re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = (tween0 = tween).slice();\n for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1[i] = t;\n break;\n }\n }\n if (i === n) tween1.push(t);\n }\n\n schedule.tween = tween1;\n };\n}\n\nfunction transition_tween(name, value) {\n var id = this._id;\n\n name += \"\";\n\n if (arguments.length < 2) {\n var tween = get(this.node(), id).tween;\n for (var i = 0, n = tween.length, t; i < n; ++i) {\n if ((t = tween[i]).name === name) {\n return t.value;\n }\n }\n return null;\n }\n\n return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value));\n}\n\nfunction tweenValue(transition, name, value) {\n var id = transition._id;\n\n transition.each(function() {\n var schedule = set(this, id);\n (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments);\n });\n\n return function(node) {\n return get(node, id).value[name];\n };\n}\n\nfunction interpolate(a, b) {\n var c;\n return (typeof b === \"number\" ? d3Interpolate.interpolateNumber\n : b instanceof d3Color.color ? d3Interpolate.interpolateRgb\n : (c = d3Color.color(b)) ? (b = c, d3Interpolate.interpolateRgb)\n : d3Interpolate.interpolateString)(a, b);\n}\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = this.getAttribute(name);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction attrConstantNS(fullname, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = this.getAttributeNS(fullname.space, fullname.local);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction attrFunction(name, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0, value1 = value(this), string1;\n if (value1 == null) return void this.removeAttribute(name);\n string0 = this.getAttribute(name);\n string1 = value1 + \"\";\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nfunction attrFunctionNS(fullname, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0, value1 = value(this), string1;\n if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local);\n string0 = this.getAttributeNS(fullname.space, fullname.local);\n string1 = value1 + \"\";\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nfunction transition_attr(name, value) {\n var fullname = d3Selection.namespace(name), i = fullname === \"transform\" ? d3Interpolate.interpolateTransformSvg : interpolate;\n return this.attrTween(name, typeof value === \"function\"\n ? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i, tweenValue(this, \"attr.\" + name, value))\n : value == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname)\n : (fullname.local ? attrConstantNS : attrConstant)(fullname, i, value));\n}\n\nfunction attrInterpolate(name, i) {\n return function(t) {\n this.setAttribute(name, i.call(this, t));\n };\n}\n\nfunction attrInterpolateNS(fullname, i) {\n return function(t) {\n this.setAttributeNS(fullname.space, fullname.local, i.call(this, t));\n };\n}\n\nfunction attrTweenNS(fullname, value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nfunction attrTween(name, value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nfunction transition_attrTween(name, value) {\n var key = \"attr.\" + name;\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n var fullname = d3Selection.namespace(name);\n return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));\n}\n\nfunction delayFunction(id, value) {\n return function() {\n init(this, id).delay = +value.apply(this, arguments);\n };\n}\n\nfunction delayConstant(id, value) {\n return value = +value, function() {\n init(this, id).delay = value;\n };\n}\n\nfunction transition_delay(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === \"function\"\n ? delayFunction\n : delayConstant)(id, value))\n : get(this.node(), id).delay;\n}\n\nfunction durationFunction(id, value) {\n return function() {\n set(this, id).duration = +value.apply(this, arguments);\n };\n}\n\nfunction durationConstant(id, value) {\n return value = +value, function() {\n set(this, id).duration = value;\n };\n}\n\nfunction transition_duration(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === \"function\"\n ? durationFunction\n : durationConstant)(id, value))\n : get(this.node(), id).duration;\n}\n\nfunction easeConstant(id, value) {\n if (typeof value !== \"function\") throw new Error;\n return function() {\n set(this, id).ease = value;\n };\n}\n\nfunction transition_ease(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each(easeConstant(id, value))\n : get(this.node(), id).ease;\n}\n\nfunction easeVarying(id, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (typeof v !== \"function\") throw new Error;\n set(this, id).ease = v;\n };\n}\n\nfunction transition_easeVarying(value) {\n if (typeof value !== \"function\") throw new Error;\n return this.each(easeVarying(this._id, value));\n}\n\nfunction transition_filter(match) {\n if (typeof match !== \"function\") match = d3Selection.matcher(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Transition(subgroups, this._parents, this._name, this._id);\n}\n\nfunction transition_merge(transition) {\n if (transition._id !== this._id) throw new Error;\n\n for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Transition(merges, this._parents, this._name, this._id);\n}\n\nfunction start(name) {\n return (name + \"\").trim().split(/^|\\s+/).every(function(t) {\n var i = t.indexOf(\".\");\n if (i >= 0) t = t.slice(0, i);\n return !t || t === \"start\";\n });\n}\n\nfunction onFunction(id, name, listener) {\n var on0, on1, sit = start(name) ? init : set;\n return function() {\n var schedule = sit(this, id),\n on = schedule.on;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we’re done!\n // Otherwise, copy-on-write.\n if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener);\n\n schedule.on = on1;\n };\n}\n\nfunction transition_on(name, listener) {\n var id = this._id;\n\n return arguments.length < 2\n ? get(this.node(), id).on.on(name)\n : this.each(onFunction(id, name, listener));\n}\n\nfunction removeFunction(id) {\n return function() {\n var parent = this.parentNode;\n for (var i in this.__transition) if (+i !== id) return;\n if (parent) parent.removeChild(this);\n };\n}\n\nfunction transition_remove() {\n return this.on(\"end.remove\", removeFunction(this._id));\n}\n\nfunction transition_select(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== \"function\") select = d3Selection.selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n schedule(subgroup[i], name, id, i, subgroup, get(node, id));\n }\n }\n }\n\n return new Transition(subgroups, this._parents, name, id);\n}\n\nfunction transition_selectAll(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== \"function\") select = d3Selection.selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n for (var children = select.call(node, node.__data__, i, group), child, inherit = get(node, id), k = 0, l = children.length; k < l; ++k) {\n if (child = children[k]) {\n schedule(child, name, id, k, children, inherit);\n }\n }\n subgroups.push(children);\n parents.push(node);\n }\n }\n }\n\n return new Transition(subgroups, parents, name, id);\n}\n\nvar Selection = d3Selection.selection.prototype.constructor;\n\nfunction transition_selection() {\n return new Selection(this._groups, this._parents);\n}\n\nfunction styleNull(name, interpolate) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0 = d3Selection.style(this, name),\n string1 = (this.style.removeProperty(name), d3Selection.style(this, name));\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, string10 = string1);\n };\n}\n\nfunction styleRemove(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = d3Selection.style(this, name);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction styleFunction(name, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0 = d3Selection.style(this, name),\n value1 = value(this),\n string1 = value1 + \"\";\n if (value1 == null) string1 = value1 = (this.style.removeProperty(name), d3Selection.style(this, name));\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nfunction styleMaybeRemove(id, name) {\n var on0, on1, listener0, key = \"style.\" + name, event = \"end.\" + key, remove;\n return function() {\n var schedule = set(this, id),\n on = schedule.on,\n listener = schedule.value[key] == null ? remove || (remove = styleRemove(name)) : undefined;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we’re done!\n // Otherwise, copy-on-write.\n if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener);\n\n schedule.on = on1;\n };\n}\n\nfunction transition_style(name, value, priority) {\n var i = (name += \"\") === \"transform\" ? d3Interpolate.interpolateTransformCss : interpolate;\n return value == null ? this\n .styleTween(name, styleNull(name, i))\n .on(\"end.style.\" + name, styleRemove(name))\n : typeof value === \"function\" ? this\n .styleTween(name, styleFunction(name, i, tweenValue(this, \"style.\" + name, value)))\n .each(styleMaybeRemove(this._id, name))\n : this\n .styleTween(name, styleConstant(name, i, value), priority)\n .on(\"end.style.\" + name, null);\n}\n\nfunction styleInterpolate(name, i, priority) {\n return function(t) {\n this.style.setProperty(name, i.call(this, t), priority);\n };\n}\n\nfunction styleTween(name, value, priority) {\n var t, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority);\n return t;\n }\n tween._value = value;\n return tween;\n}\n\nfunction transition_styleTween(name, value, priority) {\n var key = \"style.\" + (name += \"\");\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n return this.tween(key, styleTween(name, value, priority == null ? \"\" : priority));\n}\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var value1 = value(this);\n this.textContent = value1 == null ? \"\" : value1;\n };\n}\n\nfunction transition_text(value) {\n return this.tween(\"text\", typeof value === \"function\"\n ? textFunction(tweenValue(this, \"text\", value))\n : textConstant(value == null ? \"\" : value + \"\"));\n}\n\nfunction textInterpolate(i) {\n return function(t) {\n this.textContent = i.call(this, t);\n };\n}\n\nfunction textTween(value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && textInterpolate(i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nfunction transition_textTween(value) {\n var key = \"text\";\n if (arguments.length < 1) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n return this.tween(key, textTween(value));\n}\n\nfunction transition_transition() {\n var name = this._name,\n id0 = this._id,\n id1 = newId();\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n var inherit = get(node, id0);\n schedule(node, name, id1, i, group, {\n time: inherit.time + inherit.delay + inherit.duration,\n delay: 0,\n duration: inherit.duration,\n ease: inherit.ease\n });\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id1);\n}\n\nfunction transition_end() {\n var on0, on1, that = this, id = that._id, size = that.size();\n return new Promise(function(resolve, reject) {\n var cancel = {value: reject},\n end = {value: function() { if (--size === 0) resolve(); }};\n\n that.each(function() {\n var schedule = set(this, id),\n on = schedule.on;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we’re done!\n // Otherwise, copy-on-write.\n if (on !== on0) {\n on1 = (on0 = on).copy();\n on1._.cancel.push(cancel);\n on1._.interrupt.push(cancel);\n on1._.end.push(end);\n }\n\n schedule.on = on1;\n });\n\n // The selection was empty, resolve end immediately\n if (size === 0) resolve();\n });\n}\n\nvar id = 0;\n\nfunction Transition(groups, parents, name, id) {\n this._groups = groups;\n this._parents = parents;\n this._name = name;\n this._id = id;\n}\n\nfunction transition(name) {\n return d3Selection.selection().transition(name);\n}\n\nfunction newId() {\n return ++id;\n}\n\nvar selection_prototype = d3Selection.selection.prototype;\n\nTransition.prototype = transition.prototype = {\n constructor: Transition,\n select: transition_select,\n selectAll: transition_selectAll,\n filter: transition_filter,\n merge: transition_merge,\n selection: transition_selection,\n transition: transition_transition,\n call: selection_prototype.call,\n nodes: selection_prototype.nodes,\n node: selection_prototype.node,\n size: selection_prototype.size,\n empty: selection_prototype.empty,\n each: selection_prototype.each,\n on: transition_on,\n attr: transition_attr,\n attrTween: transition_attrTween,\n style: transition_style,\n styleTween: transition_styleTween,\n text: transition_text,\n textTween: transition_textTween,\n remove: transition_remove,\n tween: transition_tween,\n delay: transition_delay,\n duration: transition_duration,\n ease: transition_ease,\n easeVarying: transition_easeVarying,\n end: transition_end,\n [Symbol.iterator]: selection_prototype[Symbol.iterator]\n};\n\nvar defaultTiming = {\n time: null, // Set on use.\n delay: 0,\n duration: 250,\n ease: d3Ease.easeCubicInOut\n};\n\nfunction inherit(node, id) {\n var timing;\n while (!(timing = node.__transition) || !(timing = timing[id])) {\n if (!(node = node.parentNode)) {\n throw new Error(`transition ${id} not found`);\n }\n }\n return timing;\n}\n\nfunction selection_transition(name) {\n var id,\n timing;\n\n if (name instanceof Transition) {\n id = name._id, name = name._name;\n } else {\n id = newId(), (timing = defaultTiming).time = d3Timer.now(), name = name == null ? null : name + \"\";\n }\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n schedule(node, name, id, i, group, timing || inherit(node, id));\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id);\n}\n\nd3Selection.selection.prototype.interrupt = selection_interrupt;\nd3Selection.selection.prototype.transition = selection_transition;\n\nvar root = [null];\n\nfunction active(node, name) {\n var schedules = node.__transition,\n schedule,\n i;\n\n if (schedules) {\n name = name == null ? null : name + \"\";\n for (i in schedules) {\n if ((schedule = schedules[i]).state > SCHEDULED && schedule.name === name) {\n return new Transition([[node]], root, name, +i);\n }\n }\n }\n\n return null;\n}\n\nexports.active = active;\nexports.interrupt = interrupt;\nexports.transition = transition;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","// https://d3js.org/d3-zoom/ v2.0.0 Copyright 2020 Mike Bostock\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-dispatch'), require('d3-drag'), require('d3-interpolate'), require('d3-selection'), require('d3-transition')) :\ntypeof define === 'function' && define.amd ? define(['exports', 'd3-dispatch', 'd3-drag', 'd3-interpolate', 'd3-selection', 'd3-transition'], factory) :\n(global = global || self, factory(global.d3 = global.d3 || {}, global.d3, global.d3, global.d3, global.d3, global.d3));\n}(this, (function (exports, d3Dispatch, d3Drag, d3Interpolate, d3Selection, d3Transition) { 'use strict';\n\nvar constant = x => () => x;\n\nfunction ZoomEvent(type, {\n sourceEvent,\n target,\n transform,\n dispatch\n}) {\n Object.defineProperties(this, {\n type: {value: type, enumerable: true, configurable: true},\n sourceEvent: {value: sourceEvent, enumerable: true, configurable: true},\n target: {value: target, enumerable: true, configurable: true},\n transform: {value: transform, enumerable: true, configurable: true},\n _: {value: dispatch}\n });\n}\n\nfunction Transform(k, x, y) {\n this.k = k;\n this.x = x;\n this.y = y;\n}\n\nTransform.prototype = {\n constructor: Transform,\n scale: function(k) {\n return k === 1 ? this : new Transform(this.k * k, this.x, this.y);\n },\n translate: function(x, y) {\n return x === 0 & y === 0 ? this : new Transform(this.k, this.x + this.k * x, this.y + this.k * y);\n },\n apply: function(point) {\n return [point[0] * this.k + this.x, point[1] * this.k + this.y];\n },\n applyX: function(x) {\n return x * this.k + this.x;\n },\n applyY: function(y) {\n return y * this.k + this.y;\n },\n invert: function(location) {\n return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];\n },\n invertX: function(x) {\n return (x - this.x) / this.k;\n },\n invertY: function(y) {\n return (y - this.y) / this.k;\n },\n rescaleX: function(x) {\n return x.copy().domain(x.range().map(this.invertX, this).map(x.invert, x));\n },\n rescaleY: function(y) {\n return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y));\n },\n toString: function() {\n return \"translate(\" + this.x + \",\" + this.y + \") scale(\" + this.k + \")\";\n }\n};\n\nvar identity = new Transform(1, 0, 0);\n\ntransform.prototype = Transform.prototype;\n\nfunction transform(node) {\n while (!node.__zoom) if (!(node = node.parentNode)) return identity;\n return node.__zoom;\n}\n\nfunction nopropagation(event) {\n event.stopImmediatePropagation();\n}\n\nfunction noevent(event) {\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n\n// Ignore right-click, since that should open the context menu.\n// except for pinch-to-zoom, which is sent as a wheel+ctrlKey event\nfunction defaultFilter(event) {\n return (!event.ctrlKey || event.type === 'wheel') && !event.button;\n}\n\nfunction defaultExtent() {\n var e = this;\n if (e instanceof SVGElement) {\n e = e.ownerSVGElement || e;\n if (e.hasAttribute(\"viewBox\")) {\n e = e.viewBox.baseVal;\n return [[e.x, e.y], [e.x + e.width, e.y + e.height]];\n }\n return [[0, 0], [e.width.baseVal.value, e.height.baseVal.value]];\n }\n return [[0, 0], [e.clientWidth, e.clientHeight]];\n}\n\nfunction defaultTransform() {\n return this.__zoom || identity;\n}\n\nfunction defaultWheelDelta(event) {\n return -event.deltaY * (event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 0.002) * (event.ctrlKey ? 10 : 1);\n}\n\nfunction defaultTouchable() {\n return navigator.maxTouchPoints || (\"ontouchstart\" in this);\n}\n\nfunction defaultConstrain(transform, extent, translateExtent) {\n var dx0 = transform.invertX(extent[0][0]) - translateExtent[0][0],\n dx1 = transform.invertX(extent[1][0]) - translateExtent[1][0],\n dy0 = transform.invertY(extent[0][1]) - translateExtent[0][1],\n dy1 = transform.invertY(extent[1][1]) - translateExtent[1][1];\n return transform.translate(\n dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1),\n dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1)\n );\n}\n\nfunction zoom() {\n var filter = defaultFilter,\n extent = defaultExtent,\n constrain = defaultConstrain,\n wheelDelta = defaultWheelDelta,\n touchable = defaultTouchable,\n scaleExtent = [0, Infinity],\n translateExtent = [[-Infinity, -Infinity], [Infinity, Infinity]],\n duration = 250,\n interpolate = d3Interpolate.interpolateZoom,\n listeners = d3Dispatch.dispatch(\"start\", \"zoom\", \"end\"),\n touchstarting,\n touchfirst,\n touchending,\n touchDelay = 500,\n wheelDelay = 150,\n clickDistance2 = 0,\n tapDistance = 10;\n\n function zoom(selection) {\n selection\n .property(\"__zoom\", defaultTransform)\n .on(\"wheel.zoom\", wheeled)\n .on(\"mousedown.zoom\", mousedowned)\n .on(\"dblclick.zoom\", dblclicked)\n .filter(touchable)\n .on(\"touchstart.zoom\", touchstarted)\n .on(\"touchmove.zoom\", touchmoved)\n .on(\"touchend.zoom touchcancel.zoom\", touchended)\n .style(\"-webkit-tap-highlight-color\", \"rgba(0,0,0,0)\");\n }\n\n zoom.transform = function(collection, transform, point, event) {\n var selection = collection.selection ? collection.selection() : collection;\n selection.property(\"__zoom\", defaultTransform);\n if (collection !== selection) {\n schedule(collection, transform, point, event);\n } else {\n selection.interrupt().each(function() {\n gesture(this, arguments)\n .event(event)\n .start()\n .zoom(null, typeof transform === \"function\" ? transform.apply(this, arguments) : transform)\n .end();\n });\n }\n };\n\n zoom.scaleBy = function(selection, k, p, event) {\n zoom.scaleTo(selection, function() {\n var k0 = this.__zoom.k,\n k1 = typeof k === \"function\" ? k.apply(this, arguments) : k;\n return k0 * k1;\n }, p, event);\n };\n\n zoom.scaleTo = function(selection, k, p, event) {\n zoom.transform(selection, function() {\n var e = extent.apply(this, arguments),\n t0 = this.__zoom,\n p0 = p == null ? centroid(e) : typeof p === \"function\" ? p.apply(this, arguments) : p,\n p1 = t0.invert(p0),\n k1 = typeof k === \"function\" ? k.apply(this, arguments) : k;\n return constrain(translate(scale(t0, k1), p0, p1), e, translateExtent);\n }, p, event);\n };\n\n zoom.translateBy = function(selection, x, y, event) {\n zoom.transform(selection, function() {\n return constrain(this.__zoom.translate(\n typeof x === \"function\" ? x.apply(this, arguments) : x,\n typeof y === \"function\" ? y.apply(this, arguments) : y\n ), extent.apply(this, arguments), translateExtent);\n }, null, event);\n };\n\n zoom.translateTo = function(selection, x, y, p, event) {\n zoom.transform(selection, function() {\n var e = extent.apply(this, arguments),\n t = this.__zoom,\n p0 = p == null ? centroid(e) : typeof p === \"function\" ? p.apply(this, arguments) : p;\n return constrain(identity.translate(p0[0], p0[1]).scale(t.k).translate(\n typeof x === \"function\" ? -x.apply(this, arguments) : -x,\n typeof y === \"function\" ? -y.apply(this, arguments) : -y\n ), e, translateExtent);\n }, p, event);\n };\n\n function scale(transform, k) {\n k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], k));\n return k === transform.k ? transform : new Transform(k, transform.x, transform.y);\n }\n\n function translate(transform, p0, p1) {\n var x = p0[0] - p1[0] * transform.k, y = p0[1] - p1[1] * transform.k;\n return x === transform.x && y === transform.y ? transform : new Transform(transform.k, x, y);\n }\n\n function centroid(extent) {\n return [(+extent[0][0] + +extent[1][0]) / 2, (+extent[0][1] + +extent[1][1]) / 2];\n }\n\n function schedule(transition, transform, point, event) {\n transition\n .on(\"start.zoom\", function() { gesture(this, arguments).event(event).start(); })\n .on(\"interrupt.zoom end.zoom\", function() { gesture(this, arguments).event(event).end(); })\n .tween(\"zoom\", function() {\n var that = this,\n args = arguments,\n g = gesture(that, args).event(event),\n e = extent.apply(that, args),\n p = point == null ? centroid(e) : typeof point === \"function\" ? point.apply(that, args) : point,\n w = Math.max(e[1][0] - e[0][0], e[1][1] - e[0][1]),\n a = that.__zoom,\n b = typeof transform === \"function\" ? transform.apply(that, args) : transform,\n i = interpolate(a.invert(p).concat(w / a.k), b.invert(p).concat(w / b.k));\n return function(t) {\n if (t === 1) t = b; // Avoid rounding error on end.\n else { var l = i(t), k = w / l[2]; t = new Transform(k, p[0] - l[0] * k, p[1] - l[1] * k); }\n g.zoom(null, t);\n };\n });\n }\n\n function gesture(that, args, clean) {\n return (!clean && that.__zooming) || new Gesture(that, args);\n }\n\n function Gesture(that, args) {\n this.that = that;\n this.args = args;\n this.active = 0;\n this.sourceEvent = null;\n this.extent = extent.apply(that, args);\n this.taps = 0;\n }\n\n Gesture.prototype = {\n event: function(event) {\n if (event) this.sourceEvent = event;\n return this;\n },\n start: function() {\n if (++this.active === 1) {\n this.that.__zooming = this;\n this.emit(\"start\");\n }\n return this;\n },\n zoom: function(key, transform) {\n if (this.mouse && key !== \"mouse\") this.mouse[1] = transform.invert(this.mouse[0]);\n if (this.touch0 && key !== \"touch\") this.touch0[1] = transform.invert(this.touch0[0]);\n if (this.touch1 && key !== \"touch\") this.touch1[1] = transform.invert(this.touch1[0]);\n this.that.__zoom = transform;\n this.emit(\"zoom\");\n return this;\n },\n end: function() {\n if (--this.active === 0) {\n delete this.that.__zooming;\n this.emit(\"end\");\n }\n return this;\n },\n emit: function(type) {\n var d = d3Selection.select(this.that).datum();\n listeners.call(\n type,\n this.that,\n new ZoomEvent(type, {\n sourceEvent: this.sourceEvent,\n target: zoom,\n type,\n transform: this.that.__zoom,\n dispatch: listeners\n }),\n d\n );\n }\n };\n\n function wheeled(event, ...args) {\n if (!filter.apply(this, arguments)) return;\n var g = gesture(this, args).event(event),\n t = this.__zoom,\n k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], t.k * Math.pow(2, wheelDelta.apply(this, arguments)))),\n p = d3Selection.pointer(event);\n\n // If the mouse is in the same location as before, reuse it.\n // If there were recent wheel events, reset the wheel idle timeout.\n if (g.wheel) {\n if (g.mouse[0][0] !== p[0] || g.mouse[0][1] !== p[1]) {\n g.mouse[1] = t.invert(g.mouse[0] = p);\n }\n clearTimeout(g.wheel);\n }\n\n // If this wheel event won’t trigger a transform change, ignore it.\n else if (t.k === k) return;\n\n // Otherwise, capture the mouse point and location at the start.\n else {\n g.mouse = [p, t.invert(p)];\n d3Transition.interrupt(this);\n g.start();\n }\n\n noevent(event);\n g.wheel = setTimeout(wheelidled, wheelDelay);\n g.zoom(\"mouse\", constrain(translate(scale(t, k), g.mouse[0], g.mouse[1]), g.extent, translateExtent));\n\n function wheelidled() {\n g.wheel = null;\n g.end();\n }\n }\n\n function mousedowned(event, ...args) {\n if (touchending || !filter.apply(this, arguments)) return;\n var g = gesture(this, args, true).event(event),\n v = d3Selection.select(event.view).on(\"mousemove.zoom\", mousemoved, true).on(\"mouseup.zoom\", mouseupped, true),\n p = d3Selection.pointer(event, currentTarget),\n currentTarget = event.currentTarget,\n x0 = event.clientX,\n y0 = event.clientY;\n\n d3Drag.dragDisable(event.view);\n nopropagation(event);\n g.mouse = [p, this.__zoom.invert(p)];\n d3Transition.interrupt(this);\n g.start();\n\n function mousemoved(event) {\n noevent(event);\n if (!g.moved) {\n var dx = event.clientX - x0, dy = event.clientY - y0;\n g.moved = dx * dx + dy * dy > clickDistance2;\n }\n g.event(event)\n .zoom(\"mouse\", constrain(translate(g.that.__zoom, g.mouse[0] = d3Selection.pointer(event, currentTarget), g.mouse[1]), g.extent, translateExtent));\n }\n\n function mouseupped(event) {\n v.on(\"mousemove.zoom mouseup.zoom\", null);\n d3Drag.dragEnable(event.view, g.moved);\n noevent(event);\n g.event(event).end();\n }\n }\n\n function dblclicked(event, ...args) {\n if (!filter.apply(this, arguments)) return;\n var t0 = this.__zoom,\n p0 = d3Selection.pointer(event.changedTouches ? event.changedTouches[0] : event, this),\n p1 = t0.invert(p0),\n k1 = t0.k * (event.shiftKey ? 0.5 : 2),\n t1 = constrain(translate(scale(t0, k1), p0, p1), extent.apply(this, args), translateExtent);\n\n noevent(event);\n if (duration > 0) d3Selection.select(this).transition().duration(duration).call(schedule, t1, p0, event);\n else d3Selection.select(this).call(zoom.transform, t1, p0, event);\n }\n\n function touchstarted(event, ...args) {\n if (!filter.apply(this, arguments)) return;\n var touches = event.touches,\n n = touches.length,\n g = gesture(this, args, event.changedTouches.length === n).event(event),\n started, i, t, p;\n\n nopropagation(event);\n for (i = 0; i < n; ++i) {\n t = touches[i], p = d3Selection.pointer(t, this);\n p = [p, this.__zoom.invert(p), t.identifier];\n if (!g.touch0) g.touch0 = p, started = true, g.taps = 1 + !!touchstarting;\n else if (!g.touch1 && g.touch0[2] !== p[2]) g.touch1 = p, g.taps = 0;\n }\n\n if (touchstarting) touchstarting = clearTimeout(touchstarting);\n\n if (started) {\n if (g.taps < 2) touchfirst = p[0], touchstarting = setTimeout(function() { touchstarting = null; }, touchDelay);\n d3Transition.interrupt(this);\n g.start();\n }\n }\n\n function touchmoved(event, ...args) {\n if (!this.__zooming) return;\n var g = gesture(this, args).event(event),\n touches = event.changedTouches,\n n = touches.length, i, t, p, l;\n\n noevent(event);\n for (i = 0; i < n; ++i) {\n t = touches[i], p = d3Selection.pointer(t, this);\n if (g.touch0 && g.touch0[2] === t.identifier) g.touch0[0] = p;\n else if (g.touch1 && g.touch1[2] === t.identifier) g.touch1[0] = p;\n }\n t = g.that.__zoom;\n if (g.touch1) {\n var p0 = g.touch0[0], l0 = g.touch0[1],\n p1 = g.touch1[0], l1 = g.touch1[1],\n dp = (dp = p1[0] - p0[0]) * dp + (dp = p1[1] - p0[1]) * dp,\n dl = (dl = l1[0] - l0[0]) * dl + (dl = l1[1] - l0[1]) * dl;\n t = scale(t, Math.sqrt(dp / dl));\n p = [(p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2];\n l = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2];\n }\n else if (g.touch0) p = g.touch0[0], l = g.touch0[1];\n else return;\n\n g.zoom(\"touch\", constrain(translate(t, p, l), g.extent, translateExtent));\n }\n\n function touchended(event, ...args) {\n if (!this.__zooming) return;\n var g = gesture(this, args).event(event),\n touches = event.changedTouches,\n n = touches.length, i, t;\n\n nopropagation(event);\n if (touchending) clearTimeout(touchending);\n touchending = setTimeout(function() { touchending = null; }, touchDelay);\n for (i = 0; i < n; ++i) {\n t = touches[i];\n if (g.touch0 && g.touch0[2] === t.identifier) delete g.touch0;\n else if (g.touch1 && g.touch1[2] === t.identifier) delete g.touch1;\n }\n if (g.touch1 && !g.touch0) g.touch0 = g.touch1, delete g.touch1;\n if (g.touch0) g.touch0[1] = this.__zoom.invert(g.touch0[0]);\n else {\n g.end();\n // If this was a dbltap, reroute to the (optional) dblclick.zoom handler.\n if (g.taps === 2) {\n t = d3Selection.pointer(t, this);\n if (Math.hypot(touchfirst[0] - t[0], touchfirst[1] - t[1]) < tapDistance) {\n var p = d3Selection.select(this).on(\"dblclick.zoom\");\n if (p) p.apply(this, arguments);\n }\n }\n }\n }\n\n zoom.wheelDelta = function(_) {\n return arguments.length ? (wheelDelta = typeof _ === \"function\" ? _ : constant(+_), zoom) : wheelDelta;\n };\n\n zoom.filter = function(_) {\n return arguments.length ? (filter = typeof _ === \"function\" ? _ : constant(!!_), zoom) : filter;\n };\n\n zoom.touchable = function(_) {\n return arguments.length ? (touchable = typeof _ === \"function\" ? _ : constant(!!_), zoom) : touchable;\n };\n\n zoom.extent = function(_) {\n return arguments.length ? (extent = typeof _ === \"function\" ? _ : constant([[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]]), zoom) : extent;\n };\n\n zoom.scaleExtent = function(_) {\n return arguments.length ? (scaleExtent[0] = +_[0], scaleExtent[1] = +_[1], zoom) : [scaleExtent[0], scaleExtent[1]];\n };\n\n zoom.translateExtent = function(_) {\n return arguments.length ? (translateExtent[0][0] = +_[0][0], translateExtent[1][0] = +_[1][0], translateExtent[0][1] = +_[0][1], translateExtent[1][1] = +_[1][1], zoom) : [[translateExtent[0][0], translateExtent[0][1]], [translateExtent[1][0], translateExtent[1][1]]];\n };\n\n zoom.constrain = function(_) {\n return arguments.length ? (constrain = _, zoom) : constrain;\n };\n\n zoom.duration = function(_) {\n return arguments.length ? (duration = +_, zoom) : duration;\n };\n\n zoom.interpolate = function(_) {\n return arguments.length ? (interpolate = _, zoom) : interpolate;\n };\n\n zoom.on = function() {\n var value = listeners.on.apply(listeners, arguments);\n return value === listeners ? zoom : value;\n };\n\n zoom.clickDistance = function(_) {\n return arguments.length ? (clickDistance2 = (_ = +_) * _, zoom) : Math.sqrt(clickDistance2);\n };\n\n zoom.tapDistance = function(_) {\n return arguments.length ? (tapDistance = +_, zoom) : tapDistance;\n };\n\n return zoom;\n}\n\nexports.zoom = zoom;\nexports.zoomIdentity = identity;\nexports.zoomTransform = transform;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar d3Array = require('d3-array');\nvar d3Axis = require('d3-axis');\nvar d3Brush = require('d3-brush');\nvar d3Chord = require('d3-chord');\nvar d3Color = require('d3-color');\nvar d3Contour = require('d3-contour');\nvar d3Delaunay = require('d3-delaunay');\nvar d3Dispatch = require('d3-dispatch');\nvar d3Drag = require('d3-drag');\nvar d3Dsv = require('d3-dsv');\nvar d3Ease = require('d3-ease');\nvar d3Fetch = require('d3-fetch');\nvar d3Force = require('d3-force');\nvar d3Format = require('d3-format');\nvar d3Geo = require('d3-geo');\nvar d3Hierarchy = require('d3-hierarchy');\nvar d3Interpolate = require('d3-interpolate');\nvar d3Path = require('d3-path');\nvar d3Polygon = require('d3-polygon');\nvar d3Quadtree = require('d3-quadtree');\nvar d3Random = require('d3-random');\nvar d3Scale = require('d3-scale');\nvar d3ScaleChromatic = require('d3-scale-chromatic');\nvar d3Selection = require('d3-selection');\nvar d3Shape = require('d3-shape');\nvar d3Time = require('d3-time');\nvar d3TimeFormat = require('d3-time-format');\nvar d3Timer = require('d3-timer');\nvar d3Transition = require('d3-transition');\nvar d3Zoom = require('d3-zoom');\n\nvar version = \"6.7.0\";\n\nexports.version = version;\nObject.keys(d3Array).forEach(function (k) {\n\tif (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\treturn d3Array[k];\n\t\t}\n\t});\n});\nObject.keys(d3Axis).forEach(function (k) {\n\tif (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\treturn d3Axis[k];\n\t\t}\n\t});\n});\nObject.keys(d3Brush).forEach(function (k) {\n\tif (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\treturn d3Brush[k];\n\t\t}\n\t});\n});\nObject.keys(d3Chord).forEach(function (k) {\n\tif (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\treturn d3Chord[k];\n\t\t}\n\t});\n});\nObject.keys(d3Color).forEach(function (k) {\n\tif (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\treturn d3Color[k];\n\t\t}\n\t});\n});\nObject.keys(d3Contour).forEach(function (k) {\n\tif (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\treturn d3Contour[k];\n\t\t}\n\t});\n});\nObject.keys(d3Delaunay).forEach(function (k) {\n\tif (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\treturn d3Delaunay[k];\n\t\t}\n\t});\n});\nObject.keys(d3Dispatch).forEach(function (k) {\n\tif (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\treturn d3Dispatch[k];\n\t\t}\n\t});\n});\nObject.keys(d3Drag).forEach(function (k) {\n\tif (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\treturn d3Drag[k];\n\t\t}\n\t});\n});\nObject.keys(d3Dsv).forEach(function (k) {\n\tif (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\treturn d3Dsv[k];\n\t\t}\n\t});\n});\nObject.keys(d3Ease).forEach(function (k) {\n\tif (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\treturn d3Ease[k];\n\t\t}\n\t});\n});\nObject.keys(d3Fetch).forEach(function (k) {\n\tif (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\treturn d3Fetch[k];\n\t\t}\n\t});\n});\nObject.keys(d3Force).forEach(function (k) {\n\tif (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\treturn d3Force[k];\n\t\t}\n\t});\n});\nObject.keys(d3Format).forEach(function (k) {\n\tif (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\treturn d3Format[k];\n\t\t}\n\t});\n});\nObject.keys(d3Geo).forEach(function (k) {\n\tif (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\treturn d3Geo[k];\n\t\t}\n\t});\n});\nObject.keys(d3Hierarchy).forEach(function (k) {\n\tif (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\treturn d3Hierarchy[k];\n\t\t}\n\t});\n});\nObject.keys(d3Interpolate).forEach(function (k) {\n\tif (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\treturn d3Interpolate[k];\n\t\t}\n\t});\n});\nObject.keys(d3Path).forEach(function (k) {\n\tif (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\treturn d3Path[k];\n\t\t}\n\t});\n});\nObject.keys(d3Polygon).forEach(function (k) {\n\tif (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\treturn d3Polygon[k];\n\t\t}\n\t});\n});\nObject.keys(d3Quadtree).forEach(function (k) {\n\tif (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\treturn d3Quadtree[k];\n\t\t}\n\t});\n});\nObject.keys(d3Random).forEach(function (k) {\n\tif (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\treturn d3Random[k];\n\t\t}\n\t});\n});\nObject.keys(d3Scale).forEach(function (k) {\n\tif (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\treturn d3Scale[k];\n\t\t}\n\t});\n});\nObject.keys(d3ScaleChromatic).forEach(function (k) {\n\tif (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\treturn d3ScaleChromatic[k];\n\t\t}\n\t});\n});\nObject.keys(d3Selection).forEach(function (k) {\n\tif (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\treturn d3Selection[k];\n\t\t}\n\t});\n});\nObject.keys(d3Shape).forEach(function (k) {\n\tif (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\treturn d3Shape[k];\n\t\t}\n\t});\n});\nObject.keys(d3Time).forEach(function (k) {\n\tif (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\treturn d3Time[k];\n\t\t}\n\t});\n});\nObject.keys(d3TimeFormat).forEach(function (k) {\n\tif (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\treturn d3TimeFormat[k];\n\t\t}\n\t});\n});\nObject.keys(d3Timer).forEach(function (k) {\n\tif (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\treturn d3Timer[k];\n\t\t}\n\t});\n});\nObject.keys(d3Transition).forEach(function (k) {\n\tif (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\treturn d3Transition[k];\n\t\t}\n\t});\n});\nObject.keys(d3Zoom).forEach(function (k) {\n\tif (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\treturn d3Zoom[k];\n\t\t}\n\t});\n});\n","\"use strict\";\nconst MIMEType = require(\"whatwg-mimetype\");\nconst { parseURL, serializeURL } = require(\"whatwg-url\");\nconst {\n stripLeadingAndTrailingASCIIWhitespace,\n stringPercentDecode,\n isomorphicDecode,\n forgivingBase64Decode\n} = require(\"./utils.js\");\n\nmodule.exports = stringInput => {\n const urlRecord = parseURL(stringInput);\n\n if (urlRecord === null) {\n return null;\n }\n\n return module.exports.fromURLRecord(urlRecord);\n};\n\nmodule.exports.fromURLRecord = urlRecord => {\n if (urlRecord.scheme !== \"data\") {\n return null;\n }\n\n const input = serializeURL(urlRecord, true).substring(\"data:\".length);\n\n let position = 0;\n\n let mimeType = \"\";\n while (position < input.length && input[position] !== \",\") {\n mimeType += input[position];\n ++position;\n }\n mimeType = stripLeadingAndTrailingASCIIWhitespace(mimeType);\n\n if (position === input.length) {\n return null;\n }\n\n ++position;\n\n const encodedBody = input.substring(position);\n\n let body = stringPercentDecode(encodedBody);\n\n // Can't use /i regexp flag because it isn't restricted to ASCII.\n const mimeTypeBase64MatchResult = /(.*); *[Bb][Aa][Ss][Ee]64$/.exec(mimeType);\n if (mimeTypeBase64MatchResult) {\n const stringBody = isomorphicDecode(body);\n body = forgivingBase64Decode(stringBody);\n\n if (body === null) {\n return null;\n }\n mimeType = mimeTypeBase64MatchResult[1];\n }\n\n if (mimeType.startsWith(\";\")) {\n mimeType = \"text/plain\" + mimeType;\n }\n\n let mimeTypeRecord;\n try {\n mimeTypeRecord = new MIMEType(mimeType);\n } catch (e) {\n mimeTypeRecord = new MIMEType(\"text/plain;charset=US-ASCII\");\n }\n\n return {\n mimeType: mimeTypeRecord,\n body\n };\n};\n","\"use strict\";\nconst { percentDecode } = require(\"whatwg-url\");\nconst { atob } = require(\"abab\");\n\nexports.stripLeadingAndTrailingASCIIWhitespace = string => {\n return string.replace(/^[ \\t\\n\\f\\r]+/, \"\").replace(/[ \\t\\n\\f\\r]+$/, \"\");\n};\n\nexports.stringPercentDecode = input => {\n return percentDecode(Buffer.from(input, \"utf-8\"));\n};\n\nexports.isomorphicDecode = input => {\n return input.toString(\"binary\");\n};\n\nexports.forgivingBase64Decode = data => {\n const asString = atob(data);\n if (asString === null) {\n return null;\n }\n return Buffer.from(asString, \"binary\");\n};\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => enableOverride === null ? createDebug.enabled(namespace) : enableOverride,\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/**\n * Detect Electron renderer / nwjs process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {\n\tmodule.exports = require('./browser.js');\n} else {\n\tmodule.exports = require('./node.js');\n}\n","/**\n * Module dependencies.\n */\n\nconst tty = require('tty');\nconst util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n */\n\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.destroy = util.deprecate(\n\t() => {},\n\t'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'\n);\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\ntry {\n\t// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)\n\t// eslint-disable-next-line import/no-extraneous-dependencies\n\tconst supportsColor = require('supports-color');\n\n\tif (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {\n\t\texports.colors = [\n\t\t\t20,\n\t\t\t21,\n\t\t\t26,\n\t\t\t27,\n\t\t\t32,\n\t\t\t33,\n\t\t\t38,\n\t\t\t39,\n\t\t\t40,\n\t\t\t41,\n\t\t\t42,\n\t\t\t43,\n\t\t\t44,\n\t\t\t45,\n\t\t\t56,\n\t\t\t57,\n\t\t\t62,\n\t\t\t63,\n\t\t\t68,\n\t\t\t69,\n\t\t\t74,\n\t\t\t75,\n\t\t\t76,\n\t\t\t77,\n\t\t\t78,\n\t\t\t79,\n\t\t\t80,\n\t\t\t81,\n\t\t\t92,\n\t\t\t93,\n\t\t\t98,\n\t\t\t99,\n\t\t\t112,\n\t\t\t113,\n\t\t\t128,\n\t\t\t129,\n\t\t\t134,\n\t\t\t135,\n\t\t\t148,\n\t\t\t149,\n\t\t\t160,\n\t\t\t161,\n\t\t\t162,\n\t\t\t163,\n\t\t\t164,\n\t\t\t165,\n\t\t\t166,\n\t\t\t167,\n\t\t\t168,\n\t\t\t169,\n\t\t\t170,\n\t\t\t171,\n\t\t\t172,\n\t\t\t173,\n\t\t\t178,\n\t\t\t179,\n\t\t\t184,\n\t\t\t185,\n\t\t\t196,\n\t\t\t197,\n\t\t\t198,\n\t\t\t199,\n\t\t\t200,\n\t\t\t201,\n\t\t\t202,\n\t\t\t203,\n\t\t\t204,\n\t\t\t205,\n\t\t\t206,\n\t\t\t207,\n\t\t\t208,\n\t\t\t209,\n\t\t\t214,\n\t\t\t215,\n\t\t\t220,\n\t\t\t221\n\t\t];\n\t}\n} catch (error) {\n\t// Swallow - we only care if `supports-color` is available; it doesn't have to be.\n}\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(key => {\n\treturn /^debug_/i.test(key);\n}).reduce((obj, key) => {\n\t// Camel-case\n\tconst prop = key\n\t\t.substring(6)\n\t\t.toLowerCase()\n\t\t.replace(/_([a-z])/g, (_, k) => {\n\t\t\treturn k.toUpperCase();\n\t\t});\n\n\t// Coerce string value into JS value\n\tlet val = process.env[key];\n\tif (/^(yes|on|true|enabled)$/i.test(val)) {\n\t\tval = true;\n\t} else if (/^(no|off|false|disabled)$/i.test(val)) {\n\t\tval = false;\n\t} else if (val === 'null') {\n\t\tval = null;\n\t} else {\n\t\tval = Number(val);\n\t}\n\n\tobj[prop] = val;\n\treturn obj;\n}, {});\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\tconst {namespace: name, useColors} = this;\n\n\tif (useColors) {\n\t\tconst c = this.color;\n\t\tconst colorCode = '\\u001B[3' + (c < 8 ? c : '8;5;' + c);\n\t\tconst prefix = ` ${colorCode};1m${name} \\u001B[0m`;\n\n\t\targs[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n\t\targs.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\\u001B[0m');\n\t} else {\n\t\targs[0] = getDate() + name + ' ' + args[0];\n\t}\n}\n\nfunction getDate() {\n\tif (exports.inspectOpts.hideDate) {\n\t\treturn '';\n\t}\n\treturn new Date().toISOString() + ' ';\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to stderr.\n */\n\nfunction log(...args) {\n\treturn process.stderr.write(util.format(...args) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\tif (namespaces) {\n\t\tprocess.env.DEBUG = namespaces;\n\t} else {\n\t\t// If you set a process.env field to null or undefined, it gets cast to the\n\t\t// string 'null' or 'undefined'. Just delete instead.\n\t\tdelete process.env.DEBUG;\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n\treturn process.env.DEBUG;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init(debug) {\n\tdebug.inspectOpts = {};\n\n\tconst keys = Object.keys(exports.inspectOpts);\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tdebug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nformatters.o = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts)\n\t\t.split('\\n')\n\t\t.map(str => str.trim())\n\t\t.join(' ');\n};\n\n/**\n * Map %O to `util.inspect()`, allowing multiple lines if needed.\n */\n\nformatters.O = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts);\n};\n",";(function (globalScope) {\r\n 'use strict';\r\n\r\n\r\n /*\r\n * decimal.js v10.3.1\r\n * An arbitrary-precision Decimal type for JavaScript.\r\n * https://github.com/MikeMcl/decimal.js\r\n * Copyright (c) 2021 Michael Mclaughlin \r\n * MIT Licence\r\n */\r\n\r\n\r\n // ----------------------------------- EDITABLE DEFAULTS ------------------------------------ //\r\n\r\n\r\n // The maximum exponent magnitude.\r\n // The limit on the value of `toExpNeg`, `toExpPos`, `minE` and `maxE`.\r\n var EXP_LIMIT = 9e15, // 0 to 9e15\r\n\r\n // The limit on the value of `precision`, and on the value of the first argument to\r\n // `toDecimalPlaces`, `toExponential`, `toFixed`, `toPrecision` and `toSignificantDigits`.\r\n MAX_DIGITS = 1e9, // 0 to 1e9\r\n\r\n // Base conversion alphabet.\r\n NUMERALS = '0123456789abcdef',\r\n\r\n // The natural logarithm of 10 (1025 digits).\r\n LN10 = '2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058',\r\n\r\n // Pi (1025 digits).\r\n PI = '3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789',\r\n\r\n\r\n // The initial configuration properties of the Decimal constructor.\r\n DEFAULTS = {\r\n\r\n // These values must be integers within the stated ranges (inclusive).\r\n // Most of these values can be changed at run-time using the `Decimal.config` method.\r\n\r\n // The maximum number of significant digits of the result of a calculation or base conversion.\r\n // E.g. `Decimal.config({ precision: 20 });`\r\n precision: 20, // 1 to MAX_DIGITS\r\n\r\n // The rounding mode used when rounding to `precision`.\r\n //\r\n // ROUND_UP 0 Away from zero.\r\n // ROUND_DOWN 1 Towards zero.\r\n // ROUND_CEIL 2 Towards +Infinity.\r\n // ROUND_FLOOR 3 Towards -Infinity.\r\n // ROUND_HALF_UP 4 Towards nearest neighbour. If equidistant, up.\r\n // ROUND_HALF_DOWN 5 Towards nearest neighbour. If equidistant, down.\r\n // ROUND_HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour.\r\n // ROUND_HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity.\r\n // ROUND_HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.\r\n //\r\n // E.g.\r\n // `Decimal.rounding = 4;`\r\n // `Decimal.rounding = Decimal.ROUND_HALF_UP;`\r\n rounding: 4, // 0 to 8\r\n\r\n // The modulo mode used when calculating the modulus: a mod n.\r\n // The quotient (q = a / n) is calculated according to the corresponding rounding mode.\r\n // The remainder (r) is calculated as: r = a - n * q.\r\n //\r\n // UP 0 The remainder is positive if the dividend is negative, else is negative.\r\n // DOWN 1 The remainder has the same sign as the dividend (JavaScript %).\r\n // FLOOR 3 The remainder has the same sign as the divisor (Python %).\r\n // HALF_EVEN 6 The IEEE 754 remainder function.\r\n // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). Always positive.\r\n //\r\n // Truncated division (1), floored division (3), the IEEE 754 remainder (6), and Euclidian\r\n // division (9) are commonly used for the modulus operation. The other rounding modes can also\r\n // be used, but they may not give useful results.\r\n modulo: 1, // 0 to 9\r\n\r\n // The exponent value at and beneath which `toString` returns exponential notation.\r\n // JavaScript numbers: -7\r\n toExpNeg: -7, // 0 to -EXP_LIMIT\r\n\r\n // The exponent value at and above which `toString` returns exponential notation.\r\n // JavaScript numbers: 21\r\n toExpPos: 21, // 0 to EXP_LIMIT\r\n\r\n // The minimum exponent value, beneath which underflow to zero occurs.\r\n // JavaScript numbers: -324 (5e-324)\r\n minE: -EXP_LIMIT, // -1 to -EXP_LIMIT\r\n\r\n // The maximum exponent value, above which overflow to Infinity occurs.\r\n // JavaScript numbers: 308 (1.7976931348623157e+308)\r\n maxE: EXP_LIMIT, // 1 to EXP_LIMIT\r\n\r\n // Whether to use cryptographically-secure random number generation, if available.\r\n crypto: false // true/false\r\n },\r\n\r\n\r\n // ----------------------------------- END OF EDITABLE DEFAULTS ------------------------------- //\r\n\r\n\r\n Decimal, inexact, noConflict, quadrant,\r\n external = true,\r\n\r\n decimalError = '[DecimalError] ',\r\n invalidArgument = decimalError + 'Invalid argument: ',\r\n precisionLimitExceeded = decimalError + 'Precision limit exceeded',\r\n cryptoUnavailable = decimalError + 'crypto unavailable',\r\n tag = '[object Decimal]',\r\n\r\n mathfloor = Math.floor,\r\n mathpow = Math.pow,\r\n\r\n isBinary = /^0b([01]+(\\.[01]*)?|\\.[01]+)(p[+-]?\\d+)?$/i,\r\n isHex = /^0x([0-9a-f]+(\\.[0-9a-f]*)?|\\.[0-9a-f]+)(p[+-]?\\d+)?$/i,\r\n isOctal = /^0o([0-7]+(\\.[0-7]*)?|\\.[0-7]+)(p[+-]?\\d+)?$/i,\r\n isDecimal = /^(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,\r\n\r\n BASE = 1e7,\r\n LOG_BASE = 7,\r\n MAX_SAFE_INTEGER = 9007199254740991,\r\n\r\n LN10_PRECISION = LN10.length - 1,\r\n PI_PRECISION = PI.length - 1,\r\n\r\n // Decimal.prototype object\r\n P = { toStringTag: tag };\r\n\r\n\r\n // Decimal prototype methods\r\n\r\n\r\n /*\r\n * absoluteValue abs\r\n * ceil\r\n * clampedTo clamp\r\n * comparedTo cmp\r\n * cosine cos\r\n * cubeRoot cbrt\r\n * decimalPlaces dp\r\n * dividedBy div\r\n * dividedToIntegerBy divToInt\r\n * equals eq\r\n * floor\r\n * greaterThan gt\r\n * greaterThanOrEqualTo gte\r\n * hyperbolicCosine cosh\r\n * hyperbolicSine sinh\r\n * hyperbolicTangent tanh\r\n * inverseCosine acos\r\n * inverseHyperbolicCosine acosh\r\n * inverseHyperbolicSine asinh\r\n * inverseHyperbolicTangent atanh\r\n * inverseSine asin\r\n * inverseTangent atan\r\n * isFinite\r\n * isInteger isInt\r\n * isNaN\r\n * isNegative isNeg\r\n * isPositive isPos\r\n * isZero\r\n * lessThan lt\r\n * lessThanOrEqualTo lte\r\n * logarithm log\r\n * [maximum] [max]\r\n * [minimum] [min]\r\n * minus sub\r\n * modulo mod\r\n * naturalExponential exp\r\n * naturalLogarithm ln\r\n * negated neg\r\n * plus add\r\n * precision sd\r\n * round\r\n * sine sin\r\n * squareRoot sqrt\r\n * tangent tan\r\n * times mul\r\n * toBinary\r\n * toDecimalPlaces toDP\r\n * toExponential\r\n * toFixed\r\n * toFraction\r\n * toHexadecimal toHex\r\n * toNearest\r\n * toNumber\r\n * toOctal\r\n * toPower pow\r\n * toPrecision\r\n * toSignificantDigits toSD\r\n * toString\r\n * truncated trunc\r\n * valueOf toJSON\r\n */\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the absolute value of this Decimal.\r\n *\r\n */\r\n P.absoluteValue = P.abs = function () {\r\n var x = new this.constructor(this);\r\n if (x.s < 0) x.s = 1;\r\n return finalise(x);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the\r\n * direction of positive Infinity.\r\n *\r\n */\r\n P.ceil = function () {\r\n return finalise(new this.constructor(this), this.e + 1, 2);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal clamped to the range\r\n * delineated by `min` and `max`.\r\n *\r\n * min {number|string|Decimal}\r\n * max {number|string|Decimal}\r\n *\r\n */\r\n P.clampedTo = P.clamp = function (min, max) {\r\n var k,\r\n x = this,\r\n Ctor = x.constructor;\r\n min = new Ctor(min);\r\n max = new Ctor(max);\r\n if (!min.s || !max.s) return new Ctor(NaN);\r\n if (min.gt(max)) throw Error(invalidArgument + max);\r\n k = x.cmp(min);\r\n return k < 0 ? min : x.cmp(max) > 0 ? max : new Ctor(x);\r\n };\r\n\r\n\r\n /*\r\n * Return\r\n * 1 if the value of this Decimal is greater than the value of `y`,\r\n * -1 if the value of this Decimal is less than the value of `y`,\r\n * 0 if they have the same value,\r\n * NaN if the value of either Decimal is NaN.\r\n *\r\n */\r\n P.comparedTo = P.cmp = function (y) {\r\n var i, j, xdL, ydL,\r\n x = this,\r\n xd = x.d,\r\n yd = (y = new x.constructor(y)).d,\r\n xs = x.s,\r\n ys = y.s;\r\n\r\n // Either NaN or ±Infinity?\r\n if (!xd || !yd) {\r\n return !xs || !ys ? NaN : xs !== ys ? xs : xd === yd ? 0 : !xd ^ xs < 0 ? 1 : -1;\r\n }\r\n\r\n // Either zero?\r\n if (!xd[0] || !yd[0]) return xd[0] ? xs : yd[0] ? -ys : 0;\r\n\r\n // Signs differ?\r\n if (xs !== ys) return xs;\r\n\r\n // Compare exponents.\r\n if (x.e !== y.e) return x.e > y.e ^ xs < 0 ? 1 : -1;\r\n\r\n xdL = xd.length;\r\n ydL = yd.length;\r\n\r\n // Compare digit by digit.\r\n for (i = 0, j = xdL < ydL ? xdL : ydL; i < j; ++i) {\r\n if (xd[i] !== yd[i]) return xd[i] > yd[i] ^ xs < 0 ? 1 : -1;\r\n }\r\n\r\n // Compare lengths.\r\n return xdL === ydL ? 0 : xdL > ydL ^ xs < 0 ? 1 : -1;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the cosine of the value in radians of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-1, 1]\r\n *\r\n * cos(0) = 1\r\n * cos(-0) = 1\r\n * cos(Infinity) = NaN\r\n * cos(-Infinity) = NaN\r\n * cos(NaN) = NaN\r\n *\r\n */\r\n P.cosine = P.cos = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.d) return new Ctor(NaN);\r\n\r\n // cos(0) = cos(-0) = 1\r\n if (!x.d[0]) return new Ctor(1);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE;\r\n Ctor.rounding = 1;\r\n\r\n x = cosine(Ctor, toLessThanHalfPi(Ctor, x));\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(quadrant == 2 || quadrant == 3 ? x.neg() : x, pr, rm, true);\r\n };\r\n\r\n\r\n /*\r\n *\r\n * Return a new Decimal whose value is the cube root of the value of this Decimal, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * cbrt(0) = 0\r\n * cbrt(-0) = -0\r\n * cbrt(1) = 1\r\n * cbrt(-1) = -1\r\n * cbrt(N) = N\r\n * cbrt(-I) = -I\r\n * cbrt(I) = I\r\n *\r\n * Math.cbrt(x) = (x < 0 ? -Math.pow(-x, 1/3) : Math.pow(x, 1/3))\r\n *\r\n */\r\n P.cubeRoot = P.cbrt = function () {\r\n var e, m, n, r, rep, s, sd, t, t3, t3plusx,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite() || x.isZero()) return new Ctor(x);\r\n external = false;\r\n\r\n // Initial estimate.\r\n s = x.s * mathpow(x.s * x, 1 / 3);\r\n\r\n // Math.cbrt underflow/overflow?\r\n // Pass x to Math.pow as integer, then adjust the exponent of the result.\r\n if (!s || Math.abs(s) == 1 / 0) {\r\n n = digitsToString(x.d);\r\n e = x.e;\r\n\r\n // Adjust n exponent so it is a multiple of 3 away from x exponent.\r\n if (s = (e - n.length + 1) % 3) n += (s == 1 || s == -2 ? '0' : '00');\r\n s = mathpow(n, 1 / 3);\r\n\r\n // Rarely, e may be one less than the result exponent value.\r\n e = mathfloor((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2));\r\n\r\n if (s == 1 / 0) {\r\n n = '5e' + e;\r\n } else {\r\n n = s.toExponential();\r\n n = n.slice(0, n.indexOf('e') + 1) + e;\r\n }\r\n\r\n r = new Ctor(n);\r\n r.s = x.s;\r\n } else {\r\n r = new Ctor(s.toString());\r\n }\r\n\r\n sd = (e = Ctor.precision) + 3;\r\n\r\n // Halley's method.\r\n // TODO? Compare Newton's method.\r\n for (;;) {\r\n t = r;\r\n t3 = t.times(t).times(t);\r\n t3plusx = t3.plus(x);\r\n r = divide(t3plusx.plus(x).times(t), t3plusx.plus(t3), sd + 2, 1);\r\n\r\n // TODO? Replace with for-loop and checkRoundingDigits.\r\n if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) {\r\n n = n.slice(sd - 3, sd + 1);\r\n\r\n // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or 4999\r\n // , i.e. approaching a rounding boundary, continue the iteration.\r\n if (n == '9999' || !rep && n == '4999') {\r\n\r\n // On the first iteration only, check to see if rounding up gives the exact result as the\r\n // nines may infinitely repeat.\r\n if (!rep) {\r\n finalise(t, e + 1, 0);\r\n\r\n if (t.times(t).times(t).eq(x)) {\r\n r = t;\r\n break;\r\n }\r\n }\r\n\r\n sd += 4;\r\n rep = 1;\r\n } else {\r\n\r\n // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result.\r\n // If not, then there are further digits and m will be truthy.\r\n if (!+n || !+n.slice(1) && n.charAt(0) == '5') {\r\n\r\n // Truncate to the first rounding digit.\r\n finalise(r, e + 1, 1);\r\n m = !r.times(r).times(r).eq(x);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n }\r\n\r\n external = true;\r\n\r\n return finalise(r, e, Ctor.rounding, m);\r\n };\r\n\r\n\r\n /*\r\n * Return the number of decimal places of the value of this Decimal.\r\n *\r\n */\r\n P.decimalPlaces = P.dp = function () {\r\n var w,\r\n d = this.d,\r\n n = NaN;\r\n\r\n if (d) {\r\n w = d.length - 1;\r\n n = (w - mathfloor(this.e / LOG_BASE)) * LOG_BASE;\r\n\r\n // Subtract the number of trailing zeros of the last word.\r\n w = d[w];\r\n if (w) for (; w % 10 == 0; w /= 10) n--;\r\n if (n < 0) n = 0;\r\n }\r\n\r\n return n;\r\n };\r\n\r\n\r\n /*\r\n * n / 0 = I\r\n * n / N = N\r\n * n / I = 0\r\n * 0 / n = 0\r\n * 0 / 0 = N\r\n * 0 / N = N\r\n * 0 / I = 0\r\n * N / n = N\r\n * N / 0 = N\r\n * N / N = N\r\n * N / I = N\r\n * I / n = I\r\n * I / 0 = I\r\n * I / N = N\r\n * I / I = N\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal divided by `y`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n */\r\n P.dividedBy = P.div = function (y) {\r\n return divide(this, new this.constructor(y));\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the integer part of dividing the value of this Decimal\r\n * by the value of `y`, rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n */\r\n P.dividedToIntegerBy = P.divToInt = function (y) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n return finalise(divide(x, new Ctor(y), 0, 1, 1), Ctor.precision, Ctor.rounding);\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is equal to the value of `y`, otherwise return false.\r\n *\r\n */\r\n P.equals = P.eq = function (y) {\r\n return this.cmp(y) === 0;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the\r\n * direction of negative Infinity.\r\n *\r\n */\r\n P.floor = function () {\r\n return finalise(new this.constructor(this), this.e + 1, 3);\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is greater than the value of `y`, otherwise return\r\n * false.\r\n *\r\n */\r\n P.greaterThan = P.gt = function (y) {\r\n return this.cmp(y) > 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is greater than or equal to the value of `y`,\r\n * otherwise return false.\r\n *\r\n */\r\n P.greaterThanOrEqualTo = P.gte = function (y) {\r\n var k = this.cmp(y);\r\n return k == 1 || k === 0;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the hyperbolic cosine of the value in radians of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [1, Infinity]\r\n *\r\n * cosh(x) = 1 + x^2/2! + x^4/4! + x^6/6! + ...\r\n *\r\n * cosh(0) = 1\r\n * cosh(-0) = 1\r\n * cosh(Infinity) = Infinity\r\n * cosh(-Infinity) = Infinity\r\n * cosh(NaN) = NaN\r\n *\r\n * x time taken (ms) result\r\n * 1000 9 9.8503555700852349694e+433\r\n * 10000 25 4.4034091128314607936e+4342\r\n * 100000 171 1.4033316802130615897e+43429\r\n * 1000000 3817 1.5166076984010437725e+434294\r\n * 10000000 abandoned after 2 minute wait\r\n *\r\n * TODO? Compare performance of cosh(x) = 0.5 * (exp(x) + exp(-x))\r\n *\r\n */\r\n P.hyperbolicCosine = P.cosh = function () {\r\n var k, n, pr, rm, len,\r\n x = this,\r\n Ctor = x.constructor,\r\n one = new Ctor(1);\r\n\r\n if (!x.isFinite()) return new Ctor(x.s ? 1 / 0 : NaN);\r\n if (x.isZero()) return one;\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + 4;\r\n Ctor.rounding = 1;\r\n len = x.d.length;\r\n\r\n // Argument reduction: cos(4x) = 1 - 8cos^2(x) + 8cos^4(x) + 1\r\n // i.e. cos(x) = 1 - cos^2(x/4)(8 - 8cos^2(x/4))\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n // TODO? Estimation reused from cosine() and may not be optimal here.\r\n if (len < 32) {\r\n k = Math.ceil(len / 3);\r\n n = (1 / tinyPow(4, k)).toString();\r\n } else {\r\n k = 16;\r\n n = '2.3283064365386962890625e-10';\r\n }\r\n\r\n x = taylorSeries(Ctor, 1, x.times(n), new Ctor(1), true);\r\n\r\n // Reverse argument reduction\r\n var cosh2_x,\r\n i = k,\r\n d8 = new Ctor(8);\r\n for (; i--;) {\r\n cosh2_x = x.times(x);\r\n x = one.minus(cosh2_x.times(d8.minus(cosh2_x.times(d8))));\r\n }\r\n\r\n return finalise(x, Ctor.precision = pr, Ctor.rounding = rm, true);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the hyperbolic sine of the value in radians of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * sinh(x) = x + x^3/3! + x^5/5! + x^7/7! + ...\r\n *\r\n * sinh(0) = 0\r\n * sinh(-0) = -0\r\n * sinh(Infinity) = Infinity\r\n * sinh(-Infinity) = -Infinity\r\n * sinh(NaN) = NaN\r\n *\r\n * x time taken (ms)\r\n * 10 2 ms\r\n * 100 5 ms\r\n * 1000 14 ms\r\n * 10000 82 ms\r\n * 100000 886 ms 1.4033316802130615897e+43429\r\n * 200000 2613 ms\r\n * 300000 5407 ms\r\n * 400000 8824 ms\r\n * 500000 13026 ms 8.7080643612718084129e+217146\r\n * 1000000 48543 ms\r\n *\r\n * TODO? Compare performance of sinh(x) = 0.5 * (exp(x) - exp(-x))\r\n *\r\n */\r\n P.hyperbolicSine = P.sinh = function () {\r\n var k, pr, rm, len,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite() || x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + 4;\r\n Ctor.rounding = 1;\r\n len = x.d.length;\r\n\r\n if (len < 3) {\r\n x = taylorSeries(Ctor, 2, x, x, true);\r\n } else {\r\n\r\n // Alternative argument reduction: sinh(3x) = sinh(x)(3 + 4sinh^2(x))\r\n // i.e. sinh(x) = sinh(x/3)(3 + 4sinh^2(x/3))\r\n // 3 multiplications and 1 addition\r\n\r\n // Argument reduction: sinh(5x) = sinh(x)(5 + sinh^2(x)(20 + 16sinh^2(x)))\r\n // i.e. sinh(x) = sinh(x/5)(5 + sinh^2(x/5)(20 + 16sinh^2(x/5)))\r\n // 4 multiplications and 2 additions\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n k = 1.4 * Math.sqrt(len);\r\n k = k > 16 ? 16 : k | 0;\r\n\r\n x = x.times(1 / tinyPow(5, k));\r\n x = taylorSeries(Ctor, 2, x, x, true);\r\n\r\n // Reverse argument reduction\r\n var sinh2_x,\r\n d5 = new Ctor(5),\r\n d16 = new Ctor(16),\r\n d20 = new Ctor(20);\r\n for (; k--;) {\r\n sinh2_x = x.times(x);\r\n x = x.times(d5.plus(sinh2_x.times(d16.times(sinh2_x).plus(d20))));\r\n }\r\n }\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(x, pr, rm, true);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the hyperbolic tangent of the value in radians of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-1, 1]\r\n *\r\n * tanh(x) = sinh(x) / cosh(x)\r\n *\r\n * tanh(0) = 0\r\n * tanh(-0) = -0\r\n * tanh(Infinity) = 1\r\n * tanh(-Infinity) = -1\r\n * tanh(NaN) = NaN\r\n *\r\n */\r\n P.hyperbolicTangent = P.tanh = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(x.s);\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + 7;\r\n Ctor.rounding = 1;\r\n\r\n return divide(x.sinh(), x.cosh(), Ctor.precision = pr, Ctor.rounding = rm);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the arccosine (inverse cosine) in radians of the value of\r\n * this Decimal.\r\n *\r\n * Domain: [-1, 1]\r\n * Range: [0, pi]\r\n *\r\n * acos(x) = pi/2 - asin(x)\r\n *\r\n * acos(0) = pi/2\r\n * acos(-0) = pi/2\r\n * acos(1) = 0\r\n * acos(-1) = pi\r\n * acos(1/2) = pi/3\r\n * acos(-1/2) = 2*pi/3\r\n * acos(|x| > 1) = NaN\r\n * acos(NaN) = NaN\r\n *\r\n */\r\n P.inverseCosine = P.acos = function () {\r\n var halfPi,\r\n x = this,\r\n Ctor = x.constructor,\r\n k = x.abs().cmp(1),\r\n pr = Ctor.precision,\r\n rm = Ctor.rounding;\r\n\r\n if (k !== -1) {\r\n return k === 0\r\n // |x| is 1\r\n ? x.isNeg() ? getPi(Ctor, pr, rm) : new Ctor(0)\r\n // |x| > 1 or x is NaN\r\n : new Ctor(NaN);\r\n }\r\n\r\n if (x.isZero()) return getPi(Ctor, pr + 4, rm).times(0.5);\r\n\r\n // TODO? Special case acos(0.5) = pi/3 and acos(-0.5) = 2*pi/3\r\n\r\n Ctor.precision = pr + 6;\r\n Ctor.rounding = 1;\r\n\r\n x = x.asin();\r\n halfPi = getPi(Ctor, pr + 4, rm).times(0.5);\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return halfPi.minus(x);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic cosine in radians of the\r\n * value of this Decimal.\r\n *\r\n * Domain: [1, Infinity]\r\n * Range: [0, Infinity]\r\n *\r\n * acosh(x) = ln(x + sqrt(x^2 - 1))\r\n *\r\n * acosh(x < 1) = NaN\r\n * acosh(NaN) = NaN\r\n * acosh(Infinity) = Infinity\r\n * acosh(-Infinity) = NaN\r\n * acosh(0) = NaN\r\n * acosh(-0) = NaN\r\n * acosh(1) = 0\r\n * acosh(-1) = NaN\r\n *\r\n */\r\n P.inverseHyperbolicCosine = P.acosh = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (x.lte(1)) return new Ctor(x.eq(1) ? 0 : NaN);\r\n if (!x.isFinite()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(Math.abs(x.e), x.sd()) + 4;\r\n Ctor.rounding = 1;\r\n external = false;\r\n\r\n x = x.times(x).minus(1).sqrt().plus(x);\r\n\r\n external = true;\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.ln();\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic sine in radians of the value\r\n * of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * asinh(x) = ln(x + sqrt(x^2 + 1))\r\n *\r\n * asinh(NaN) = NaN\r\n * asinh(Infinity) = Infinity\r\n * asinh(-Infinity) = -Infinity\r\n * asinh(0) = 0\r\n * asinh(-0) = -0\r\n *\r\n */\r\n P.inverseHyperbolicSine = P.asinh = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite() || x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + 2 * Math.max(Math.abs(x.e), x.sd()) + 6;\r\n Ctor.rounding = 1;\r\n external = false;\r\n\r\n x = x.times(x).plus(1).sqrt().plus(x);\r\n\r\n external = true;\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.ln();\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic tangent in radians of the\r\n * value of this Decimal.\r\n *\r\n * Domain: [-1, 1]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * atanh(x) = 0.5 * ln((1 + x) / (1 - x))\r\n *\r\n * atanh(|x| > 1) = NaN\r\n * atanh(NaN) = NaN\r\n * atanh(Infinity) = NaN\r\n * atanh(-Infinity) = NaN\r\n * atanh(0) = 0\r\n * atanh(-0) = -0\r\n * atanh(1) = Infinity\r\n * atanh(-1) = -Infinity\r\n *\r\n */\r\n P.inverseHyperbolicTangent = P.atanh = function () {\r\n var pr, rm, wpr, xsd,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(NaN);\r\n if (x.e >= 0) return new Ctor(x.abs().eq(1) ? x.s / 0 : x.isZero() ? x : NaN);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n xsd = x.sd();\r\n\r\n if (Math.max(xsd, pr) < 2 * -x.e - 1) return finalise(new Ctor(x), pr, rm, true);\r\n\r\n Ctor.precision = wpr = xsd - x.e;\r\n\r\n x = divide(x.plus(1), new Ctor(1).minus(x), wpr + pr, 1);\r\n\r\n Ctor.precision = pr + 4;\r\n Ctor.rounding = 1;\r\n\r\n x = x.ln();\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.times(0.5);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the arcsine (inverse sine) in radians of the value of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-pi/2, pi/2]\r\n *\r\n * asin(x) = 2*atan(x/(1 + sqrt(1 - x^2)))\r\n *\r\n * asin(0) = 0\r\n * asin(-0) = -0\r\n * asin(1/2) = pi/6\r\n * asin(-1/2) = -pi/6\r\n * asin(1) = pi/2\r\n * asin(-1) = -pi/2\r\n * asin(|x| > 1) = NaN\r\n * asin(NaN) = NaN\r\n *\r\n * TODO? Compare performance of Taylor series.\r\n *\r\n */\r\n P.inverseSine = P.asin = function () {\r\n var halfPi, k,\r\n pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n k = x.abs().cmp(1);\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n if (k !== -1) {\r\n\r\n // |x| is 1\r\n if (k === 0) {\r\n halfPi = getPi(Ctor, pr + 4, rm).times(0.5);\r\n halfPi.s = x.s;\r\n return halfPi;\r\n }\r\n\r\n // |x| > 1 or x is NaN\r\n return new Ctor(NaN);\r\n }\r\n\r\n // TODO? Special case asin(1/2) = pi/6 and asin(-1/2) = -pi/6\r\n\r\n Ctor.precision = pr + 6;\r\n Ctor.rounding = 1;\r\n\r\n x = x.div(new Ctor(1).minus(x.times(x)).sqrt().plus(1)).atan();\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.times(2);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the arctangent (inverse tangent) in radians of the value\r\n * of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-pi/2, pi/2]\r\n *\r\n * atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ...\r\n *\r\n * atan(0) = 0\r\n * atan(-0) = -0\r\n * atan(1) = pi/4\r\n * atan(-1) = -pi/4\r\n * atan(Infinity) = pi/2\r\n * atan(-Infinity) = -pi/2\r\n * atan(NaN) = NaN\r\n *\r\n */\r\n P.inverseTangent = P.atan = function () {\r\n var i, j, k, n, px, t, r, wpr, x2,\r\n x = this,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision,\r\n rm = Ctor.rounding;\r\n\r\n if (!x.isFinite()) {\r\n if (!x.s) return new Ctor(NaN);\r\n if (pr + 4 <= PI_PRECISION) {\r\n r = getPi(Ctor, pr + 4, rm).times(0.5);\r\n r.s = x.s;\r\n return r;\r\n }\r\n } else if (x.isZero()) {\r\n return new Ctor(x);\r\n } else if (x.abs().eq(1) && pr + 4 <= PI_PRECISION) {\r\n r = getPi(Ctor, pr + 4, rm).times(0.25);\r\n r.s = x.s;\r\n return r;\r\n }\r\n\r\n Ctor.precision = wpr = pr + 10;\r\n Ctor.rounding = 1;\r\n\r\n // TODO? if (x >= 1 && pr <= PI_PRECISION) atan(x) = halfPi * x.s - atan(1 / x);\r\n\r\n // Argument reduction\r\n // Ensure |x| < 0.42\r\n // atan(x) = 2 * atan(x / (1 + sqrt(1 + x^2)))\r\n\r\n k = Math.min(28, wpr / LOG_BASE + 2 | 0);\r\n\r\n for (i = k; i; --i) x = x.div(x.times(x).plus(1).sqrt().plus(1));\r\n\r\n external = false;\r\n\r\n j = Math.ceil(wpr / LOG_BASE);\r\n n = 1;\r\n x2 = x.times(x);\r\n r = new Ctor(x);\r\n px = x;\r\n\r\n // atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ...\r\n for (; i !== -1;) {\r\n px = px.times(x2);\r\n t = r.minus(px.div(n += 2));\r\n\r\n px = px.times(x2);\r\n r = t.plus(px.div(n += 2));\r\n\r\n if (r.d[j] !== void 0) for (i = j; r.d[i] === t.d[i] && i--;);\r\n }\r\n\r\n if (k) r = r.times(2 << (k - 1));\r\n\r\n external = true;\r\n\r\n return finalise(r, Ctor.precision = pr, Ctor.rounding = rm, true);\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is a finite number, otherwise return false.\r\n *\r\n */\r\n P.isFinite = function () {\r\n return !!this.d;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is an integer, otherwise return false.\r\n *\r\n */\r\n P.isInteger = P.isInt = function () {\r\n return !!this.d && mathfloor(this.e / LOG_BASE) > this.d.length - 2;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is NaN, otherwise return false.\r\n *\r\n */\r\n P.isNaN = function () {\r\n return !this.s;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is negative, otherwise return false.\r\n *\r\n */\r\n P.isNegative = P.isNeg = function () {\r\n return this.s < 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is positive, otherwise return false.\r\n *\r\n */\r\n P.isPositive = P.isPos = function () {\r\n return this.s > 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is 0 or -0, otherwise return false.\r\n *\r\n */\r\n P.isZero = function () {\r\n return !!this.d && this.d[0] === 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is less than `y`, otherwise return false.\r\n *\r\n */\r\n P.lessThan = P.lt = function (y) {\r\n return this.cmp(y) < 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is less than or equal to `y`, otherwise return false.\r\n *\r\n */\r\n P.lessThanOrEqualTo = P.lte = function (y) {\r\n return this.cmp(y) < 1;\r\n };\r\n\r\n\r\n /*\r\n * Return the logarithm of the value of this Decimal to the specified base, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * If no base is specified, return log[10](arg).\r\n *\r\n * log[base](arg) = ln(arg) / ln(base)\r\n *\r\n * The result will always be correctly rounded if the base of the log is 10, and 'almost always'\r\n * otherwise:\r\n *\r\n * Depending on the rounding mode, the result may be incorrectly rounded if the first fifteen\r\n * rounding digits are [49]99999999999999 or [50]00000000000000. In that case, the maximum error\r\n * between the result and the correctly rounded result will be one ulp (unit in the last place).\r\n *\r\n * log[-b](a) = NaN\r\n * log[0](a) = NaN\r\n * log[1](a) = NaN\r\n * log[NaN](a) = NaN\r\n * log[Infinity](a) = NaN\r\n * log[b](0) = -Infinity\r\n * log[b](-0) = -Infinity\r\n * log[b](-a) = NaN\r\n * log[b](1) = 0\r\n * log[b](Infinity) = Infinity\r\n * log[b](NaN) = NaN\r\n *\r\n * [base] {number|string|Decimal} The base of the logarithm.\r\n *\r\n */\r\n P.logarithm = P.log = function (base) {\r\n var isBase10, d, denominator, k, inf, num, sd, r,\r\n arg = this,\r\n Ctor = arg.constructor,\r\n pr = Ctor.precision,\r\n rm = Ctor.rounding,\r\n guard = 5;\r\n\r\n // Default base is 10.\r\n if (base == null) {\r\n base = new Ctor(10);\r\n isBase10 = true;\r\n } else {\r\n base = new Ctor(base);\r\n d = base.d;\r\n\r\n // Return NaN if base is negative, or non-finite, or is 0 or 1.\r\n if (base.s < 0 || !d || !d[0] || base.eq(1)) return new Ctor(NaN);\r\n\r\n isBase10 = base.eq(10);\r\n }\r\n\r\n d = arg.d;\r\n\r\n // Is arg negative, non-finite, 0 or 1?\r\n if (arg.s < 0 || !d || !d[0] || arg.eq(1)) {\r\n return new Ctor(d && !d[0] ? -1 / 0 : arg.s != 1 ? NaN : d ? 0 : 1 / 0);\r\n }\r\n\r\n // The result will have a non-terminating decimal expansion if base is 10 and arg is not an\r\n // integer power of 10.\r\n if (isBase10) {\r\n if (d.length > 1) {\r\n inf = true;\r\n } else {\r\n for (k = d[0]; k % 10 === 0;) k /= 10;\r\n inf = k !== 1;\r\n }\r\n }\r\n\r\n external = false;\r\n sd = pr + guard;\r\n num = naturalLogarithm(arg, sd);\r\n denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd);\r\n\r\n // The result will have 5 rounding digits.\r\n r = divide(num, denominator, sd, 1);\r\n\r\n // If at a rounding boundary, i.e. the result's rounding digits are [49]9999 or [50]0000,\r\n // calculate 10 further digits.\r\n //\r\n // If the result is known to have an infinite decimal expansion, repeat this until it is clear\r\n // that the result is above or below the boundary. Otherwise, if after calculating the 10\r\n // further digits, the last 14 are nines, round up and assume the result is exact.\r\n // Also assume the result is exact if the last 14 are zero.\r\n //\r\n // Example of a result that will be incorrectly rounded:\r\n // log[1048576](4503599627370502) = 2.60000000000000009610279511444746...\r\n // The above result correctly rounded using ROUND_CEIL to 1 decimal place should be 2.7, but it\r\n // will be given as 2.6 as there are 15 zeros immediately after the requested decimal place, so\r\n // the exact result would be assumed to be 2.6, which rounded using ROUND_CEIL to 1 decimal\r\n // place is still 2.6.\r\n if (checkRoundingDigits(r.d, k = pr, rm)) {\r\n\r\n do {\r\n sd += 10;\r\n num = naturalLogarithm(arg, sd);\r\n denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd);\r\n r = divide(num, denominator, sd, 1);\r\n\r\n if (!inf) {\r\n\r\n // Check for 14 nines from the 2nd rounding digit, as the first may be 4.\r\n if (+digitsToString(r.d).slice(k + 1, k + 15) + 1 == 1e14) {\r\n r = finalise(r, pr + 1, 0);\r\n }\r\n\r\n break;\r\n }\r\n } while (checkRoundingDigits(r.d, k += 10, rm));\r\n }\r\n\r\n external = true;\r\n\r\n return finalise(r, pr, rm);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the maximum of the arguments and the value of this Decimal.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\n P.max = function () {\r\n Array.prototype.push.call(arguments, this);\r\n return maxOrMin(this.constructor, arguments, 'lt');\r\n };\r\n */\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the minimum of the arguments and the value of this Decimal.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\n P.min = function () {\r\n Array.prototype.push.call(arguments, this);\r\n return maxOrMin(this.constructor, arguments, 'gt');\r\n };\r\n */\r\n\r\n\r\n /*\r\n * n - 0 = n\r\n * n - N = N\r\n * n - I = -I\r\n * 0 - n = -n\r\n * 0 - 0 = 0\r\n * 0 - N = N\r\n * 0 - I = -I\r\n * N - n = N\r\n * N - 0 = N\r\n * N - N = N\r\n * N - I = N\r\n * I - n = I\r\n * I - 0 = I\r\n * I - N = N\r\n * I - I = N\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal minus `y`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n */\r\n P.minus = P.sub = function (y) {\r\n var d, e, i, j, k, len, pr, rm, xd, xe, xLTy, yd,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n y = new Ctor(y);\r\n\r\n // If either is not finite...\r\n if (!x.d || !y.d) {\r\n\r\n // Return NaN if either is NaN.\r\n if (!x.s || !y.s) y = new Ctor(NaN);\r\n\r\n // Return y negated if x is finite and y is ±Infinity.\r\n else if (x.d) y.s = -y.s;\r\n\r\n // Return x if y is finite and x is ±Infinity.\r\n // Return x if both are ±Infinity with different signs.\r\n // Return NaN if both are ±Infinity with the same sign.\r\n else y = new Ctor(y.d || x.s !== y.s ? x : NaN);\r\n\r\n return y;\r\n }\r\n\r\n // If signs differ...\r\n if (x.s != y.s) {\r\n y.s = -y.s;\r\n return x.plus(y);\r\n }\r\n\r\n xd = x.d;\r\n yd = y.d;\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n // If either is zero...\r\n if (!xd[0] || !yd[0]) {\r\n\r\n // Return y negated if x is zero and y is non-zero.\r\n if (yd[0]) y.s = -y.s;\r\n\r\n // Return x if y is zero and x is non-zero.\r\n else if (xd[0]) y = new Ctor(x);\r\n\r\n // Return zero if both are zero.\r\n // From IEEE 754 (2008) 6.3: 0 - 0 = -0 - -0 = -0 when rounding to -Infinity.\r\n else return new Ctor(rm === 3 ? -0 : 0);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n }\r\n\r\n // x and y are finite, non-zero numbers with the same sign.\r\n\r\n // Calculate base 1e7 exponents.\r\n e = mathfloor(y.e / LOG_BASE);\r\n xe = mathfloor(x.e / LOG_BASE);\r\n\r\n xd = xd.slice();\r\n k = xe - e;\r\n\r\n // If base 1e7 exponents differ...\r\n if (k) {\r\n xLTy = k < 0;\r\n\r\n if (xLTy) {\r\n d = xd;\r\n k = -k;\r\n len = yd.length;\r\n } else {\r\n d = yd;\r\n e = xe;\r\n len = xd.length;\r\n }\r\n\r\n // Numbers with massively different exponents would result in a very high number of\r\n // zeros needing to be prepended, but this can be avoided while still ensuring correct\r\n // rounding by limiting the number of zeros to `Math.ceil(pr / LOG_BASE) + 2`.\r\n i = Math.max(Math.ceil(pr / LOG_BASE), len) + 2;\r\n\r\n if (k > i) {\r\n k = i;\r\n d.length = 1;\r\n }\r\n\r\n // Prepend zeros to equalise exponents.\r\n d.reverse();\r\n for (i = k; i--;) d.push(0);\r\n d.reverse();\r\n\r\n // Base 1e7 exponents equal.\r\n } else {\r\n\r\n // Check digits to determine which is the bigger number.\r\n\r\n i = xd.length;\r\n len = yd.length;\r\n xLTy = i < len;\r\n if (xLTy) len = i;\r\n\r\n for (i = 0; i < len; i++) {\r\n if (xd[i] != yd[i]) {\r\n xLTy = xd[i] < yd[i];\r\n break;\r\n }\r\n }\r\n\r\n k = 0;\r\n }\r\n\r\n if (xLTy) {\r\n d = xd;\r\n xd = yd;\r\n yd = d;\r\n y.s = -y.s;\r\n }\r\n\r\n len = xd.length;\r\n\r\n // Append zeros to `xd` if shorter.\r\n // Don't add zeros to `yd` if shorter as subtraction only needs to start at `yd` length.\r\n for (i = yd.length - len; i > 0; --i) xd[len++] = 0;\r\n\r\n // Subtract yd from xd.\r\n for (i = yd.length; i > k;) {\r\n\r\n if (xd[--i] < yd[i]) {\r\n for (j = i; j && xd[--j] === 0;) xd[j] = BASE - 1;\r\n --xd[j];\r\n xd[i] += BASE;\r\n }\r\n\r\n xd[i] -= yd[i];\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (; xd[--len] === 0;) xd.pop();\r\n\r\n // Remove leading zeros and adjust exponent accordingly.\r\n for (; xd[0] === 0; xd.shift()) --e;\r\n\r\n // Zero?\r\n if (!xd[0]) return new Ctor(rm === 3 ? -0 : 0);\r\n\r\n y.d = xd;\r\n y.e = getBase10Exponent(xd, e);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n };\r\n\r\n\r\n /*\r\n * n % 0 = N\r\n * n % N = N\r\n * n % I = n\r\n * 0 % n = 0\r\n * -0 % n = -0\r\n * 0 % 0 = N\r\n * 0 % N = N\r\n * 0 % I = 0\r\n * N % n = N\r\n * N % 0 = N\r\n * N % N = N\r\n * N % I = N\r\n * I % n = N\r\n * I % 0 = N\r\n * I % N = N\r\n * I % I = N\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal modulo `y`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * The result depends on the modulo mode.\r\n *\r\n */\r\n P.modulo = P.mod = function (y) {\r\n var q,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n y = new Ctor(y);\r\n\r\n // Return NaN if x is ±Infinity or NaN, or y is NaN or ±0.\r\n if (!x.d || !y.s || y.d && !y.d[0]) return new Ctor(NaN);\r\n\r\n // Return x if y is ±Infinity or x is ±0.\r\n if (!y.d || x.d && !x.d[0]) {\r\n return finalise(new Ctor(x), Ctor.precision, Ctor.rounding);\r\n }\r\n\r\n // Prevent rounding of intermediate calculations.\r\n external = false;\r\n\r\n if (Ctor.modulo == 9) {\r\n\r\n // Euclidian division: q = sign(y) * floor(x / abs(y))\r\n // result = x - q * y where 0 <= result < abs(y)\r\n q = divide(x, y.abs(), 0, 3, 1);\r\n q.s *= y.s;\r\n } else {\r\n q = divide(x, y, 0, Ctor.modulo, 1);\r\n }\r\n\r\n q = q.times(y);\r\n\r\n external = true;\r\n\r\n return x.minus(q);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the natural exponential of the value of this Decimal,\r\n * i.e. the base e raised to the power the value of this Decimal, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n */\r\n P.naturalExponential = P.exp = function () {\r\n return naturalExponential(this);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the natural logarithm of the value of this Decimal,\r\n * rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n */\r\n P.naturalLogarithm = P.ln = function () {\r\n return naturalLogarithm(this);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal negated, i.e. as if multiplied by\r\n * -1.\r\n *\r\n */\r\n P.negated = P.neg = function () {\r\n var x = new this.constructor(this);\r\n x.s = -x.s;\r\n return finalise(x);\r\n };\r\n\r\n\r\n /*\r\n * n + 0 = n\r\n * n + N = N\r\n * n + I = I\r\n * 0 + n = n\r\n * 0 + 0 = 0\r\n * 0 + N = N\r\n * 0 + I = I\r\n * N + n = N\r\n * N + 0 = N\r\n * N + N = N\r\n * N + I = N\r\n * I + n = I\r\n * I + 0 = I\r\n * I + N = N\r\n * I + I = I\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal plus `y`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n */\r\n P.plus = P.add = function (y) {\r\n var carry, d, e, i, k, len, pr, rm, xd, yd,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n y = new Ctor(y);\r\n\r\n // If either is not finite...\r\n if (!x.d || !y.d) {\r\n\r\n // Return NaN if either is NaN.\r\n if (!x.s || !y.s) y = new Ctor(NaN);\r\n\r\n // Return x if y is finite and x is ±Infinity.\r\n // Return x if both are ±Infinity with the same sign.\r\n // Return NaN if both are ±Infinity with different signs.\r\n // Return y if x is finite and y is ±Infinity.\r\n else if (!x.d) y = new Ctor(y.d || x.s === y.s ? x : NaN);\r\n\r\n return y;\r\n }\r\n\r\n // If signs differ...\r\n if (x.s != y.s) {\r\n y.s = -y.s;\r\n return x.minus(y);\r\n }\r\n\r\n xd = x.d;\r\n yd = y.d;\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n // If either is zero...\r\n if (!xd[0] || !yd[0]) {\r\n\r\n // Return x if y is zero.\r\n // Return y if y is non-zero.\r\n if (!yd[0]) y = new Ctor(x);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n }\r\n\r\n // x and y are finite, non-zero numbers with the same sign.\r\n\r\n // Calculate base 1e7 exponents.\r\n k = mathfloor(x.e / LOG_BASE);\r\n e = mathfloor(y.e / LOG_BASE);\r\n\r\n xd = xd.slice();\r\n i = k - e;\r\n\r\n // If base 1e7 exponents differ...\r\n if (i) {\r\n\r\n if (i < 0) {\r\n d = xd;\r\n i = -i;\r\n len = yd.length;\r\n } else {\r\n d = yd;\r\n e = k;\r\n len = xd.length;\r\n }\r\n\r\n // Limit number of zeros prepended to max(ceil(pr / LOG_BASE), len) + 1.\r\n k = Math.ceil(pr / LOG_BASE);\r\n len = k > len ? k + 1 : len + 1;\r\n\r\n if (i > len) {\r\n i = len;\r\n d.length = 1;\r\n }\r\n\r\n // Prepend zeros to equalise exponents. Note: Faster to use reverse then do unshifts.\r\n d.reverse();\r\n for (; i--;) d.push(0);\r\n d.reverse();\r\n }\r\n\r\n len = xd.length;\r\n i = yd.length;\r\n\r\n // If yd is longer than xd, swap xd and yd so xd points to the longer array.\r\n if (len - i < 0) {\r\n i = len;\r\n d = yd;\r\n yd = xd;\r\n xd = d;\r\n }\r\n\r\n // Only start adding at yd.length - 1 as the further digits of xd can be left as they are.\r\n for (carry = 0; i;) {\r\n carry = (xd[--i] = xd[i] + yd[i] + carry) / BASE | 0;\r\n xd[i] %= BASE;\r\n }\r\n\r\n if (carry) {\r\n xd.unshift(carry);\r\n ++e;\r\n }\r\n\r\n // Remove trailing zeros.\r\n // No need to check for zero, as +x + +y != 0 && -x + -y != 0\r\n for (len = xd.length; xd[--len] == 0;) xd.pop();\r\n\r\n y.d = xd;\r\n y.e = getBase10Exponent(xd, e);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n };\r\n\r\n\r\n /*\r\n * Return the number of significant digits of the value of this Decimal.\r\n *\r\n * [z] {boolean|number} Whether to count integer-part trailing zeros: true, false, 1 or 0.\r\n *\r\n */\r\n P.precision = P.sd = function (z) {\r\n var k,\r\n x = this;\r\n\r\n if (z !== void 0 && z !== !!z && z !== 1 && z !== 0) throw Error(invalidArgument + z);\r\n\r\n if (x.d) {\r\n k = getPrecision(x.d);\r\n if (z && x.e + 1 > k) k = x.e + 1;\r\n } else {\r\n k = NaN;\r\n }\r\n\r\n return k;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a whole number using\r\n * rounding mode `rounding`.\r\n *\r\n */\r\n P.round = function () {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n return finalise(new Ctor(x), x.e + 1, Ctor.rounding);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the sine of the value in radians of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-1, 1]\r\n *\r\n * sin(x) = x - x^3/3! + x^5/5! - ...\r\n *\r\n * sin(0) = 0\r\n * sin(-0) = -0\r\n * sin(Infinity) = NaN\r\n * sin(-Infinity) = NaN\r\n * sin(NaN) = NaN\r\n *\r\n */\r\n P.sine = P.sin = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(NaN);\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE;\r\n Ctor.rounding = 1;\r\n\r\n x = sine(Ctor, toLessThanHalfPi(Ctor, x));\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(quadrant > 2 ? x.neg() : x, pr, rm, true);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the square root of this Decimal, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * sqrt(-n) = N\r\n * sqrt(N) = N\r\n * sqrt(-I) = N\r\n * sqrt(I) = I\r\n * sqrt(0) = 0\r\n * sqrt(-0) = -0\r\n *\r\n */\r\n P.squareRoot = P.sqrt = function () {\r\n var m, n, sd, r, rep, t,\r\n x = this,\r\n d = x.d,\r\n e = x.e,\r\n s = x.s,\r\n Ctor = x.constructor;\r\n\r\n // Negative/NaN/Infinity/zero?\r\n if (s !== 1 || !d || !d[0]) {\r\n return new Ctor(!s || s < 0 && (!d || d[0]) ? NaN : d ? x : 1 / 0);\r\n }\r\n\r\n external = false;\r\n\r\n // Initial estimate.\r\n s = Math.sqrt(+x);\r\n\r\n // Math.sqrt underflow/overflow?\r\n // Pass x to Math.sqrt as integer, then adjust the exponent of the result.\r\n if (s == 0 || s == 1 / 0) {\r\n n = digitsToString(d);\r\n\r\n if ((n.length + e) % 2 == 0) n += '0';\r\n s = Math.sqrt(n);\r\n e = mathfloor((e + 1) / 2) - (e < 0 || e % 2);\r\n\r\n if (s == 1 / 0) {\r\n n = '5e' + e;\r\n } else {\r\n n = s.toExponential();\r\n n = n.slice(0, n.indexOf('e') + 1) + e;\r\n }\r\n\r\n r = new Ctor(n);\r\n } else {\r\n r = new Ctor(s.toString());\r\n }\r\n\r\n sd = (e = Ctor.precision) + 3;\r\n\r\n // Newton-Raphson iteration.\r\n for (;;) {\r\n t = r;\r\n r = t.plus(divide(x, t, sd + 2, 1)).times(0.5);\r\n\r\n // TODO? Replace with for-loop and checkRoundingDigits.\r\n if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) {\r\n n = n.slice(sd - 3, sd + 1);\r\n\r\n // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or\r\n // 4999, i.e. approaching a rounding boundary, continue the iteration.\r\n if (n == '9999' || !rep && n == '4999') {\r\n\r\n // On the first iteration only, check to see if rounding up gives the exact result as the\r\n // nines may infinitely repeat.\r\n if (!rep) {\r\n finalise(t, e + 1, 0);\r\n\r\n if (t.times(t).eq(x)) {\r\n r = t;\r\n break;\r\n }\r\n }\r\n\r\n sd += 4;\r\n rep = 1;\r\n } else {\r\n\r\n // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result.\r\n // If not, then there are further digits and m will be truthy.\r\n if (!+n || !+n.slice(1) && n.charAt(0) == '5') {\r\n\r\n // Truncate to the first rounding digit.\r\n finalise(r, e + 1, 1);\r\n m = !r.times(r).eq(x);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n }\r\n\r\n external = true;\r\n\r\n return finalise(r, e, Ctor.rounding, m);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the tangent of the value in radians of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * tan(0) = 0\r\n * tan(-0) = -0\r\n * tan(Infinity) = NaN\r\n * tan(-Infinity) = NaN\r\n * tan(NaN) = NaN\r\n *\r\n */\r\n P.tangent = P.tan = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(NaN);\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + 10;\r\n Ctor.rounding = 1;\r\n\r\n x = x.sin();\r\n x.s = 1;\r\n x = divide(x, new Ctor(1).minus(x.times(x)).sqrt(), pr + 10, 0);\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(quadrant == 2 || quadrant == 4 ? x.neg() : x, pr, rm, true);\r\n };\r\n\r\n\r\n /*\r\n * n * 0 = 0\r\n * n * N = N\r\n * n * I = I\r\n * 0 * n = 0\r\n * 0 * 0 = 0\r\n * 0 * N = N\r\n * 0 * I = N\r\n * N * n = N\r\n * N * 0 = N\r\n * N * N = N\r\n * N * I = N\r\n * I * n = I\r\n * I * 0 = N\r\n * I * N = N\r\n * I * I = I\r\n *\r\n * Return a new Decimal whose value is this Decimal times `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n */\r\n P.times = P.mul = function (y) {\r\n var carry, e, i, k, r, rL, t, xdL, ydL,\r\n x = this,\r\n Ctor = x.constructor,\r\n xd = x.d,\r\n yd = (y = new Ctor(y)).d;\r\n\r\n y.s *= x.s;\r\n\r\n // If either is NaN, ±Infinity or ±0...\r\n if (!xd || !xd[0] || !yd || !yd[0]) {\r\n\r\n return new Ctor(!y.s || xd && !xd[0] && !yd || yd && !yd[0] && !xd\r\n\r\n // Return NaN if either is NaN.\r\n // Return NaN if x is ±0 and y is ±Infinity, or y is ±0 and x is ±Infinity.\r\n ? NaN\r\n\r\n // Return ±Infinity if either is ±Infinity.\r\n // Return ±0 if either is ±0.\r\n : !xd || !yd ? y.s / 0 : y.s * 0);\r\n }\r\n\r\n e = mathfloor(x.e / LOG_BASE) + mathfloor(y.e / LOG_BASE);\r\n xdL = xd.length;\r\n ydL = yd.length;\r\n\r\n // Ensure xd points to the longer array.\r\n if (xdL < ydL) {\r\n r = xd;\r\n xd = yd;\r\n yd = r;\r\n rL = xdL;\r\n xdL = ydL;\r\n ydL = rL;\r\n }\r\n\r\n // Initialise the result array with zeros.\r\n r = [];\r\n rL = xdL + ydL;\r\n for (i = rL; i--;) r.push(0);\r\n\r\n // Multiply!\r\n for (i = ydL; --i >= 0;) {\r\n carry = 0;\r\n for (k = xdL + i; k > i;) {\r\n t = r[k] + yd[i] * xd[k - i - 1] + carry;\r\n r[k--] = t % BASE | 0;\r\n carry = t / BASE | 0;\r\n }\r\n\r\n r[k] = (r[k] + carry) % BASE | 0;\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (; !r[--rL];) r.pop();\r\n\r\n if (carry) ++e;\r\n else r.shift();\r\n\r\n y.d = r;\r\n y.e = getBase10Exponent(r, e);\r\n\r\n return external ? finalise(y, Ctor.precision, Ctor.rounding) : y;\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this Decimal in base 2, round to `sd` significant\r\n * digits using rounding mode `rm`.\r\n *\r\n * If the optional `sd` argument is present then return binary exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\n P.toBinary = function (sd, rm) {\r\n return toStringBinary(this, 2, sd, rm);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `dp`\r\n * decimal places using rounding mode `rm` or `rounding` if `rm` is omitted.\r\n *\r\n * If `dp` is omitted, return a new Decimal whose value is the value of this Decimal.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\n P.toDecimalPlaces = P.toDP = function (dp, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n x = new Ctor(x);\r\n if (dp === void 0) return x;\r\n\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n return finalise(x, dp + x.e + 1, rm);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this Decimal in exponential notation rounded to\r\n * `dp` fixed decimal places using rounding mode `rounding`.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\n P.toExponential = function (dp, rm) {\r\n var str,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (dp === void 0) {\r\n str = finiteToString(x, true);\r\n } else {\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n x = finalise(new Ctor(x), dp + 1, rm);\r\n str = finiteToString(x, true, dp + 1);\r\n }\r\n\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this Decimal in normal (fixed-point) notation to\r\n * `dp` fixed decimal places and rounded using rounding mode `rm` or `rounding` if `rm` is\r\n * omitted.\r\n *\r\n * As with JavaScript numbers, (-0).toFixed(0) is '0', but e.g. (-0.00001).toFixed(0) is '-0'.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.\r\n * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.\r\n * (-0).toFixed(3) is '0.000'.\r\n * (-0.5).toFixed(0) is '-0'.\r\n *\r\n */\r\n P.toFixed = function (dp, rm) {\r\n var str, y,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (dp === void 0) {\r\n str = finiteToString(x);\r\n } else {\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n y = finalise(new Ctor(x), dp + x.e + 1, rm);\r\n str = finiteToString(y, false, dp + y.e + 1);\r\n }\r\n\r\n // To determine whether to add the minus sign look at the value before it was rounded,\r\n // i.e. look at `x` rather than `y`.\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n };\r\n\r\n\r\n /*\r\n * Return an array representing the value of this Decimal as a simple fraction with an integer\r\n * numerator and an integer denominator.\r\n *\r\n * The denominator will be a positive non-zero value less than or equal to the specified maximum\r\n * denominator. If a maximum denominator is not specified, the denominator will be the lowest\r\n * value necessary to represent the number exactly.\r\n *\r\n * [maxD] {number|string|Decimal} Maximum denominator. Integer >= 1 and < Infinity.\r\n *\r\n */\r\n P.toFraction = function (maxD) {\r\n var d, d0, d1, d2, e, k, n, n0, n1, pr, q, r,\r\n x = this,\r\n xd = x.d,\r\n Ctor = x.constructor;\r\n\r\n if (!xd) return new Ctor(x);\r\n\r\n n1 = d0 = new Ctor(1);\r\n d1 = n0 = new Ctor(0);\r\n\r\n d = new Ctor(d1);\r\n e = d.e = getPrecision(xd) - x.e - 1;\r\n k = e % LOG_BASE;\r\n d.d[0] = mathpow(10, k < 0 ? LOG_BASE + k : k);\r\n\r\n if (maxD == null) {\r\n\r\n // d is 10**e, the minimum max-denominator needed.\r\n maxD = e > 0 ? d : n1;\r\n } else {\r\n n = new Ctor(maxD);\r\n if (!n.isInt() || n.lt(n1)) throw Error(invalidArgument + n);\r\n maxD = n.gt(d) ? (e > 0 ? d : n1) : n;\r\n }\r\n\r\n external = false;\r\n n = new Ctor(digitsToString(xd));\r\n pr = Ctor.precision;\r\n Ctor.precision = e = xd.length * LOG_BASE * 2;\r\n\r\n for (;;) {\r\n q = divide(n, d, 0, 1, 1);\r\n d2 = d0.plus(q.times(d1));\r\n if (d2.cmp(maxD) == 1) break;\r\n d0 = d1;\r\n d1 = d2;\r\n d2 = n1;\r\n n1 = n0.plus(q.times(d2));\r\n n0 = d2;\r\n d2 = d;\r\n d = n.minus(q.times(d2));\r\n n = d2;\r\n }\r\n\r\n d2 = divide(maxD.minus(d0), d1, 0, 1, 1);\r\n n0 = n0.plus(d2.times(n1));\r\n d0 = d0.plus(d2.times(d1));\r\n n0.s = n1.s = x.s;\r\n\r\n // Determine which fraction is closer to x, n0/d0 or n1/d1?\r\n r = divide(n1, d1, e, 1).minus(x).abs().cmp(divide(n0, d0, e, 1).minus(x).abs()) < 1\r\n ? [n1, d1] : [n0, d0];\r\n\r\n Ctor.precision = pr;\r\n external = true;\r\n\r\n return r;\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this Decimal in base 16, round to `sd` significant\r\n * digits using rounding mode `rm`.\r\n *\r\n * If the optional `sd` argument is present then return binary exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\n P.toHexadecimal = P.toHex = function (sd, rm) {\r\n return toStringBinary(this, 16, sd, rm);\r\n };\r\n\r\n\r\n /*\r\n * Returns a new Decimal whose value is the nearest multiple of `y` in the direction of rounding\r\n * mode `rm`, or `Decimal.rounding` if `rm` is omitted, to the value of this Decimal.\r\n *\r\n * The return value will always have the same sign as this Decimal, unless either this Decimal\r\n * or `y` is NaN, in which case the return value will be also be NaN.\r\n *\r\n * The return value is not affected by the value of `precision`.\r\n *\r\n * y {number|string|Decimal} The magnitude to round to a multiple of.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * 'toNearest() rounding mode not an integer: {rm}'\r\n * 'toNearest() rounding mode out of range: {rm}'\r\n *\r\n */\r\n P.toNearest = function (y, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n x = new Ctor(x);\r\n\r\n if (y == null) {\r\n\r\n // If x is not finite, return x.\r\n if (!x.d) return x;\r\n\r\n y = new Ctor(1);\r\n rm = Ctor.rounding;\r\n } else {\r\n y = new Ctor(y);\r\n if (rm === void 0) {\r\n rm = Ctor.rounding;\r\n } else {\r\n checkInt32(rm, 0, 8);\r\n }\r\n\r\n // If x is not finite, return x if y is not NaN, else NaN.\r\n if (!x.d) return y.s ? x : y;\r\n\r\n // If y is not finite, return Infinity with the sign of x if y is Infinity, else NaN.\r\n if (!y.d) {\r\n if (y.s) y.s = x.s;\r\n return y;\r\n }\r\n }\r\n\r\n // If y is not zero, calculate the nearest multiple of y to x.\r\n if (y.d[0]) {\r\n external = false;\r\n x = divide(x, y, 0, rm, 1).times(y);\r\n external = true;\r\n finalise(x);\r\n\r\n // If y is zero, return zero with the sign of x.\r\n } else {\r\n y.s = x.s;\r\n x = y;\r\n }\r\n\r\n return x;\r\n };\r\n\r\n\r\n /*\r\n * Return the value of this Decimal converted to a number primitive.\r\n * Zero keeps its sign.\r\n *\r\n */\r\n P.toNumber = function () {\r\n return +this;\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this Decimal in base 8, round to `sd` significant\r\n * digits using rounding mode `rm`.\r\n *\r\n * If the optional `sd` argument is present then return binary exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\n P.toOctal = function (sd, rm) {\r\n return toStringBinary(this, 8, sd, rm);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal raised to the power `y`, rounded\r\n * to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * ECMAScript compliant.\r\n *\r\n * pow(x, NaN) = NaN\r\n * pow(x, ±0) = 1\r\n\r\n * pow(NaN, non-zero) = NaN\r\n * pow(abs(x) > 1, +Infinity) = +Infinity\r\n * pow(abs(x) > 1, -Infinity) = +0\r\n * pow(abs(x) == 1, ±Infinity) = NaN\r\n * pow(abs(x) < 1, +Infinity) = +0\r\n * pow(abs(x) < 1, -Infinity) = +Infinity\r\n * pow(+Infinity, y > 0) = +Infinity\r\n * pow(+Infinity, y < 0) = +0\r\n * pow(-Infinity, odd integer > 0) = -Infinity\r\n * pow(-Infinity, even integer > 0) = +Infinity\r\n * pow(-Infinity, odd integer < 0) = -0\r\n * pow(-Infinity, even integer < 0) = +0\r\n * pow(+0, y > 0) = +0\r\n * pow(+0, y < 0) = +Infinity\r\n * pow(-0, odd integer > 0) = -0\r\n * pow(-0, even integer > 0) = +0\r\n * pow(-0, odd integer < 0) = -Infinity\r\n * pow(-0, even integer < 0) = +Infinity\r\n * pow(finite x < 0, finite non-integer) = NaN\r\n *\r\n * For non-integer or very large exponents pow(x, y) is calculated using\r\n *\r\n * x^y = exp(y*ln(x))\r\n *\r\n * Assuming the first 15 rounding digits are each equally likely to be any digit 0-9, the\r\n * probability of an incorrectly rounded result\r\n * P([49]9{14} | [50]0{14}) = 2 * 0.2 * 10^-14 = 4e-15 = 1/2.5e+14\r\n * i.e. 1 in 250,000,000,000,000\r\n *\r\n * If a result is incorrectly rounded the maximum error will be 1 ulp (unit in last place).\r\n *\r\n * y {number|string|Decimal} The power to which to raise this Decimal.\r\n *\r\n */\r\n P.toPower = P.pow = function (y) {\r\n var e, k, pr, r, rm, s,\r\n x = this,\r\n Ctor = x.constructor,\r\n yn = +(y = new Ctor(y));\r\n\r\n // Either ±Infinity, NaN or ±0?\r\n if (!x.d || !y.d || !x.d[0] || !y.d[0]) return new Ctor(mathpow(+x, yn));\r\n\r\n x = new Ctor(x);\r\n\r\n if (x.eq(1)) return x;\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n if (y.eq(1)) return finalise(x, pr, rm);\r\n\r\n // y exponent\r\n e = mathfloor(y.e / LOG_BASE);\r\n\r\n // If y is a small integer use the 'exponentiation by squaring' algorithm.\r\n if (e >= y.d.length - 1 && (k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) {\r\n r = intPow(Ctor, x, k, pr);\r\n return y.s < 0 ? new Ctor(1).div(r) : finalise(r, pr, rm);\r\n }\r\n\r\n s = x.s;\r\n\r\n // if x is negative\r\n if (s < 0) {\r\n\r\n // if y is not an integer\r\n if (e < y.d.length - 1) return new Ctor(NaN);\r\n\r\n // Result is positive if x is negative and the last digit of integer y is even.\r\n if ((y.d[e] & 1) == 0) s = 1;\r\n\r\n // if x.eq(-1)\r\n if (x.e == 0 && x.d[0] == 1 && x.d.length == 1) {\r\n x.s = s;\r\n return x;\r\n }\r\n }\r\n\r\n // Estimate result exponent.\r\n // x^y = 10^e, where e = y * log10(x)\r\n // log10(x) = log10(x_significand) + x_exponent\r\n // log10(x_significand) = ln(x_significand) / ln(10)\r\n k = mathpow(+x, yn);\r\n e = k == 0 || !isFinite(k)\r\n ? mathfloor(yn * (Math.log('0.' + digitsToString(x.d)) / Math.LN10 + x.e + 1))\r\n : new Ctor(k + '').e;\r\n\r\n // Exponent estimate may be incorrect e.g. x: 0.999999999999999999, y: 2.29, e: 0, r.e: -1.\r\n\r\n // Overflow/underflow?\r\n if (e > Ctor.maxE + 1 || e < Ctor.minE - 1) return new Ctor(e > 0 ? s / 0 : 0);\r\n\r\n external = false;\r\n Ctor.rounding = x.s = 1;\r\n\r\n // Estimate the extra guard digits needed to ensure five correct rounding digits from\r\n // naturalLogarithm(x). Example of failure without these extra digits (precision: 10):\r\n // new Decimal(2.32456).pow('2087987436534566.46411')\r\n // should be 1.162377823e+764914905173815, but is 1.162355823e+764914905173815\r\n k = Math.min(12, (e + '').length);\r\n\r\n // r = x^y = exp(y*ln(x))\r\n r = naturalExponential(y.times(naturalLogarithm(x, pr + k)), pr);\r\n\r\n // r may be Infinity, e.g. (0.9999999999999999).pow(-1e+40)\r\n if (r.d) {\r\n\r\n // Truncate to the required precision plus five rounding digits.\r\n r = finalise(r, pr + 5, 1);\r\n\r\n // If the rounding digits are [49]9999 or [50]0000 increase the precision by 10 and recalculate\r\n // the result.\r\n if (checkRoundingDigits(r.d, pr, rm)) {\r\n e = pr + 10;\r\n\r\n // Truncate to the increased precision plus five rounding digits.\r\n r = finalise(naturalExponential(y.times(naturalLogarithm(x, e + k)), e), e + 5, 1);\r\n\r\n // Check for 14 nines from the 2nd rounding digit (the first rounding digit may be 4 or 9).\r\n if (+digitsToString(r.d).slice(pr + 1, pr + 15) + 1 == 1e14) {\r\n r = finalise(r, pr + 1, 0);\r\n }\r\n }\r\n }\r\n\r\n r.s = s;\r\n external = true;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(r, pr, rm);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this Decimal rounded to `sd` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * Return exponential notation if `sd` is less than the number of digits necessary to represent\r\n * the integer part of the value in normal notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\n P.toPrecision = function (sd, rm) {\r\n var str,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (sd === void 0) {\r\n str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\r\n } else {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n x = finalise(new Ctor(x), sd, rm);\r\n str = finiteToString(x, sd <= x.e || x.e <= Ctor.toExpNeg, sd);\r\n }\r\n\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `sd`\r\n * significant digits using rounding mode `rm`, or to `precision` and `rounding` respectively if\r\n * omitted.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * 'toSD() digits out of range: {sd}'\r\n * 'toSD() digits not an integer: {sd}'\r\n * 'toSD() rounding mode not an integer: {rm}'\r\n * 'toSD() rounding mode out of range: {rm}'\r\n *\r\n */\r\n P.toSignificantDigits = P.toSD = function (sd, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n if (sd === void 0) {\r\n sd = Ctor.precision;\r\n rm = Ctor.rounding;\r\n } else {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n }\r\n\r\n return finalise(new Ctor(x), sd, rm);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this Decimal.\r\n *\r\n * Return exponential notation if this Decimal has a positive exponent equal to or greater than\r\n * `toExpPos`, or a negative exponent equal to or less than `toExpNeg`.\r\n *\r\n */\r\n P.toString = function () {\r\n var x = this,\r\n Ctor = x.constructor,\r\n str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\r\n\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal truncated to a whole number.\r\n *\r\n */\r\n P.truncated = P.trunc = function () {\r\n return finalise(new this.constructor(this), this.e + 1, 1);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this Decimal.\r\n * Unlike `toString`, negative zero will include the minus sign.\r\n *\r\n */\r\n P.valueOf = P.toJSON = function () {\r\n var x = this,\r\n Ctor = x.constructor,\r\n str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\r\n\r\n return x.isNeg() ? '-' + str : str;\r\n };\r\n\r\n\r\n // Helper functions for Decimal.prototype (P) and/or Decimal methods, and their callers.\r\n\r\n\r\n /*\r\n * digitsToString P.cubeRoot, P.logarithm, P.squareRoot, P.toFraction, P.toPower,\r\n * finiteToString, naturalExponential, naturalLogarithm\r\n * checkInt32 P.toDecimalPlaces, P.toExponential, P.toFixed, P.toNearest,\r\n * P.toPrecision, P.toSignificantDigits, toStringBinary, random\r\n * checkRoundingDigits P.logarithm, P.toPower, naturalExponential, naturalLogarithm\r\n * convertBase toStringBinary, parseOther\r\n * cos P.cos\r\n * divide P.atanh, P.cubeRoot, P.dividedBy, P.dividedToIntegerBy,\r\n * P.logarithm, P.modulo, P.squareRoot, P.tan, P.tanh, P.toFraction,\r\n * P.toNearest, toStringBinary, naturalExponential, naturalLogarithm,\r\n * taylorSeries, atan2, parseOther\r\n * finalise P.absoluteValue, P.atan, P.atanh, P.ceil, P.cos, P.cosh,\r\n * P.cubeRoot, P.dividedToIntegerBy, P.floor, P.logarithm, P.minus,\r\n * P.modulo, P.negated, P.plus, P.round, P.sin, P.sinh, P.squareRoot,\r\n * P.tan, P.times, P.toDecimalPlaces, P.toExponential, P.toFixed,\r\n * P.toNearest, P.toPower, P.toPrecision, P.toSignificantDigits,\r\n * P.truncated, divide, getLn10, getPi, naturalExponential,\r\n * naturalLogarithm, ceil, floor, round, trunc\r\n * finiteToString P.toExponential, P.toFixed, P.toPrecision, P.toString, P.valueOf,\r\n * toStringBinary\r\n * getBase10Exponent P.minus, P.plus, P.times, parseOther\r\n * getLn10 P.logarithm, naturalLogarithm\r\n * getPi P.acos, P.asin, P.atan, toLessThanHalfPi, atan2\r\n * getPrecision P.precision, P.toFraction\r\n * getZeroString digitsToString, finiteToString\r\n * intPow P.toPower, parseOther\r\n * isOdd toLessThanHalfPi\r\n * maxOrMin max, min\r\n * naturalExponential P.naturalExponential, P.toPower\r\n * naturalLogarithm P.acosh, P.asinh, P.atanh, P.logarithm, P.naturalLogarithm,\r\n * P.toPower, naturalExponential\r\n * nonFiniteToString finiteToString, toStringBinary\r\n * parseDecimal Decimal\r\n * parseOther Decimal\r\n * sin P.sin\r\n * taylorSeries P.cosh, P.sinh, cos, sin\r\n * toLessThanHalfPi P.cos, P.sin\r\n * toStringBinary P.toBinary, P.toHexadecimal, P.toOctal\r\n * truncate intPow\r\n *\r\n * Throws: P.logarithm, P.precision, P.toFraction, checkInt32, getLn10, getPi,\r\n * naturalLogarithm, config, parseOther, random, Decimal\r\n */\r\n\r\n\r\n function digitsToString(d) {\r\n var i, k, ws,\r\n indexOfLastWord = d.length - 1,\r\n str = '',\r\n w = d[0];\r\n\r\n if (indexOfLastWord > 0) {\r\n str += w;\r\n for (i = 1; i < indexOfLastWord; i++) {\r\n ws = d[i] + '';\r\n k = LOG_BASE - ws.length;\r\n if (k) str += getZeroString(k);\r\n str += ws;\r\n }\r\n\r\n w = d[i];\r\n ws = w + '';\r\n k = LOG_BASE - ws.length;\r\n if (k) str += getZeroString(k);\r\n } else if (w === 0) {\r\n return '0';\r\n }\r\n\r\n // Remove trailing zeros of last w.\r\n for (; w % 10 === 0;) w /= 10;\r\n\r\n return str + w;\r\n }\r\n\r\n\r\n function checkInt32(i, min, max) {\r\n if (i !== ~~i || i < min || i > max) {\r\n throw Error(invalidArgument + i);\r\n }\r\n }\r\n\r\n\r\n /*\r\n * Check 5 rounding digits if `repeating` is null, 4 otherwise.\r\n * `repeating == null` if caller is `log` or `pow`,\r\n * `repeating != null` if caller is `naturalLogarithm` or `naturalExponential`.\r\n */\r\n function checkRoundingDigits(d, i, rm, repeating) {\r\n var di, k, r, rd;\r\n\r\n // Get the length of the first word of the array d.\r\n for (k = d[0]; k >= 10; k /= 10) --i;\r\n\r\n // Is the rounding digit in the first word of d?\r\n if (--i < 0) {\r\n i += LOG_BASE;\r\n di = 0;\r\n } else {\r\n di = Math.ceil((i + 1) / LOG_BASE);\r\n i %= LOG_BASE;\r\n }\r\n\r\n // i is the index (0 - 6) of the rounding digit.\r\n // E.g. if within the word 3487563 the first rounding digit is 5,\r\n // then i = 4, k = 1000, rd = 3487563 % 1000 = 563\r\n k = mathpow(10, LOG_BASE - i);\r\n rd = d[di] % k | 0;\r\n\r\n if (repeating == null) {\r\n if (i < 3) {\r\n if (i == 0) rd = rd / 100 | 0;\r\n else if (i == 1) rd = rd / 10 | 0;\r\n r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 50000 || rd == 0;\r\n } else {\r\n r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 ||\r\n (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0;\r\n }\r\n } else {\r\n if (i < 4) {\r\n if (i == 0) rd = rd / 1000 | 0;\r\n else if (i == 1) rd = rd / 100 | 0;\r\n else if (i == 2) rd = rd / 10 | 0;\r\n r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999;\r\n } else {\r\n r = ((repeating || rm < 4) && rd + 1 == k ||\r\n (!repeating && rm > 3) && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 1000 | 0) == mathpow(10, i - 3) - 1;\r\n }\r\n }\r\n\r\n return r;\r\n }\r\n\r\n\r\n // Convert string of `baseIn` to an array of numbers of `baseOut`.\r\n // Eg. convertBase('255', 10, 16) returns [15, 15].\r\n // Eg. convertBase('ff', 16, 10) returns [2, 5, 5].\r\n function convertBase(str, baseIn, baseOut) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n strL = str.length;\r\n\r\n for (; i < strL;) {\r\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\r\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\r\n for (j = 0; j < arr.length; j++) {\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }\r\n\r\n\r\n /*\r\n * cos(x) = 1 - x^2/2! + x^4/4! - ...\r\n * |x| < pi/2\r\n *\r\n */\r\n function cosine(Ctor, x) {\r\n var k, len, y;\r\n\r\n if (x.isZero()) return x;\r\n\r\n // Argument reduction: cos(4x) = 8*(cos^4(x) - cos^2(x)) + 1\r\n // i.e. cos(x) = 8*(cos^4(x/4) - cos^2(x/4)) + 1\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n len = x.d.length;\r\n if (len < 32) {\r\n k = Math.ceil(len / 3);\r\n y = (1 / tinyPow(4, k)).toString();\r\n } else {\r\n k = 16;\r\n y = '2.3283064365386962890625e-10';\r\n }\r\n\r\n Ctor.precision += k;\r\n\r\n x = taylorSeries(Ctor, 1, x.times(y), new Ctor(1));\r\n\r\n // Reverse argument reduction\r\n for (var i = k; i--;) {\r\n var cos2x = x.times(x);\r\n x = cos2x.times(cos2x).minus(cos2x).times(8).plus(1);\r\n }\r\n\r\n Ctor.precision -= k;\r\n\r\n return x;\r\n }\r\n\r\n\r\n /*\r\n * Perform division in the specified base.\r\n */\r\n var divide = (function () {\r\n\r\n // Assumes non-zero x and k, and hence non-zero result.\r\n function multiplyInteger(x, k, base) {\r\n var temp,\r\n carry = 0,\r\n i = x.length;\r\n\r\n for (x = x.slice(); i--;) {\r\n temp = x[i] * k + carry;\r\n x[i] = temp % base | 0;\r\n carry = temp / base | 0;\r\n }\r\n\r\n if (carry) x.unshift(carry);\r\n\r\n return x;\r\n }\r\n\r\n function compare(a, b, aL, bL) {\r\n var i, r;\r\n\r\n if (aL != bL) {\r\n r = aL > bL ? 1 : -1;\r\n } else {\r\n for (i = r = 0; i < aL; i++) {\r\n if (a[i] != b[i]) {\r\n r = a[i] > b[i] ? 1 : -1;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return r;\r\n }\r\n\r\n function subtract(a, b, aL, base) {\r\n var i = 0;\r\n\r\n // Subtract b from a.\r\n for (; aL--;) {\r\n a[aL] -= i;\r\n i = a[aL] < b[aL] ? 1 : 0;\r\n a[aL] = i * base + a[aL] - b[aL];\r\n }\r\n\r\n // Remove leading zeros.\r\n for (; !a[0] && a.length > 1;) a.shift();\r\n }\r\n\r\n return function (x, y, pr, rm, dp, base) {\r\n var cmp, e, i, k, logBase, more, prod, prodL, q, qd, rem, remL, rem0, sd, t, xi, xL, yd0,\r\n yL, yz,\r\n Ctor = x.constructor,\r\n sign = x.s == y.s ? 1 : -1,\r\n xd = x.d,\r\n yd = y.d;\r\n\r\n // Either NaN, Infinity or 0?\r\n if (!xd || !xd[0] || !yd || !yd[0]) {\r\n\r\n return new Ctor(// Return NaN if either NaN, or both Infinity or 0.\r\n !x.s || !y.s || (xd ? yd && xd[0] == yd[0] : !yd) ? NaN :\r\n\r\n // Return ±0 if x is 0 or y is ±Infinity, or return ±Infinity as y is 0.\r\n xd && xd[0] == 0 || !yd ? sign * 0 : sign / 0);\r\n }\r\n\r\n if (base) {\r\n logBase = 1;\r\n e = x.e - y.e;\r\n } else {\r\n base = BASE;\r\n logBase = LOG_BASE;\r\n e = mathfloor(x.e / logBase) - mathfloor(y.e / logBase);\r\n }\r\n\r\n yL = yd.length;\r\n xL = xd.length;\r\n q = new Ctor(sign);\r\n qd = q.d = [];\r\n\r\n // Result exponent may be one less than e.\r\n // The digit array of a Decimal from toStringBinary may have trailing zeros.\r\n for (i = 0; yd[i] == (xd[i] || 0); i++);\r\n\r\n if (yd[i] > (xd[i] || 0)) e--;\r\n\r\n if (pr == null) {\r\n sd = pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n } else if (dp) {\r\n sd = pr + (x.e - y.e) + 1;\r\n } else {\r\n sd = pr;\r\n }\r\n\r\n if (sd < 0) {\r\n qd.push(1);\r\n more = true;\r\n } else {\r\n\r\n // Convert precision in number of base 10 digits to base 1e7 digits.\r\n sd = sd / logBase + 2 | 0;\r\n i = 0;\r\n\r\n // divisor < 1e7\r\n if (yL == 1) {\r\n k = 0;\r\n yd = yd[0];\r\n sd++;\r\n\r\n // k is the carry.\r\n for (; (i < xL || k) && sd--; i++) {\r\n t = k * base + (xd[i] || 0);\r\n qd[i] = t / yd | 0;\r\n k = t % yd | 0;\r\n }\r\n\r\n more = k || i < xL;\r\n\r\n // divisor >= 1e7\r\n } else {\r\n\r\n // Normalise xd and yd so highest order digit of yd is >= base/2\r\n k = base / (yd[0] + 1) | 0;\r\n\r\n if (k > 1) {\r\n yd = multiplyInteger(yd, k, base);\r\n xd = multiplyInteger(xd, k, base);\r\n yL = yd.length;\r\n xL = xd.length;\r\n }\r\n\r\n xi = yL;\r\n rem = xd.slice(0, yL);\r\n remL = rem.length;\r\n\r\n // Add zeros to make remainder as long as divisor.\r\n for (; remL < yL;) rem[remL++] = 0;\r\n\r\n yz = yd.slice();\r\n yz.unshift(0);\r\n yd0 = yd[0];\r\n\r\n if (yd[1] >= base / 2) ++yd0;\r\n\r\n do {\r\n k = 0;\r\n\r\n // Compare divisor and remainder.\r\n cmp = compare(yd, rem, yL, remL);\r\n\r\n // If divisor < remainder.\r\n if (cmp < 0) {\r\n\r\n // Calculate trial digit, k.\r\n rem0 = rem[0];\r\n if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);\r\n\r\n // k will be how many times the divisor goes into the current remainder.\r\n k = rem0 / yd0 | 0;\r\n\r\n // Algorithm:\r\n // 1. product = divisor * trial digit (k)\r\n // 2. if product > remainder: product -= divisor, k--\r\n // 3. remainder -= product\r\n // 4. if product was < remainder at 2:\r\n // 5. compare new remainder and divisor\r\n // 6. If remainder > divisor: remainder -= divisor, k++\r\n\r\n if (k > 1) {\r\n if (k >= base) k = base - 1;\r\n\r\n // product = divisor * trial digit.\r\n prod = multiplyInteger(yd, k, base);\r\n prodL = prod.length;\r\n remL = rem.length;\r\n\r\n // Compare product and remainder.\r\n cmp = compare(prod, rem, prodL, remL);\r\n\r\n // product > remainder.\r\n if (cmp == 1) {\r\n k--;\r\n\r\n // Subtract divisor from product.\r\n subtract(prod, yL < prodL ? yz : yd, prodL, base);\r\n }\r\n } else {\r\n\r\n // cmp is -1.\r\n // If k is 0, there is no need to compare yd and rem again below, so change cmp to 1\r\n // to avoid it. If k is 1 there is a need to compare yd and rem again below.\r\n if (k == 0) cmp = k = 1;\r\n prod = yd.slice();\r\n }\r\n\r\n prodL = prod.length;\r\n if (prodL < remL) prod.unshift(0);\r\n\r\n // Subtract product from remainder.\r\n subtract(rem, prod, remL, base);\r\n\r\n // If product was < previous remainder.\r\n if (cmp == -1) {\r\n remL = rem.length;\r\n\r\n // Compare divisor and new remainder.\r\n cmp = compare(yd, rem, yL, remL);\r\n\r\n // If divisor < new remainder, subtract divisor from remainder.\r\n if (cmp < 1) {\r\n k++;\r\n\r\n // Subtract divisor from remainder.\r\n subtract(rem, yL < remL ? yz : yd, remL, base);\r\n }\r\n }\r\n\r\n remL = rem.length;\r\n } else if (cmp === 0) {\r\n k++;\r\n rem = [0];\r\n } // if cmp === 1, k will be 0\r\n\r\n // Add the next digit, k, to the result array.\r\n qd[i++] = k;\r\n\r\n // Update the remainder.\r\n if (cmp && rem[0]) {\r\n rem[remL++] = xd[xi] || 0;\r\n } else {\r\n rem = [xd[xi]];\r\n remL = 1;\r\n }\r\n\r\n } while ((xi++ < xL || rem[0] !== void 0) && sd--);\r\n\r\n more = rem[0] !== void 0;\r\n }\r\n\r\n // Leading zero?\r\n if (!qd[0]) qd.shift();\r\n }\r\n\r\n // logBase is 1 when divide is being used for base conversion.\r\n if (logBase == 1) {\r\n q.e = e;\r\n inexact = more;\r\n } else {\r\n\r\n // To calculate q.e, first get the number of digits of qd[0].\r\n for (i = 1, k = qd[0]; k >= 10; k /= 10) i++;\r\n q.e = i + e * logBase - 1;\r\n\r\n finalise(q, dp ? pr + q.e + 1 : pr, rm, more);\r\n }\r\n\r\n return q;\r\n };\r\n })();\r\n\r\n\r\n /*\r\n * Round `x` to `sd` significant digits using rounding mode `rm`.\r\n * Check for over/under-flow.\r\n */\r\n function finalise(x, sd, rm, isTruncated) {\r\n var digits, i, j, k, rd, roundUp, w, xd, xdi,\r\n Ctor = x.constructor;\r\n\r\n // Don't round if sd is null or undefined.\r\n out: if (sd != null) {\r\n xd = x.d;\r\n\r\n // Infinity/NaN.\r\n if (!xd) return x;\r\n\r\n // rd: the rounding digit, i.e. the digit after the digit that may be rounded up.\r\n // w: the word of xd containing rd, a base 1e7 number.\r\n // xdi: the index of w within xd.\r\n // digits: the number of digits of w.\r\n // i: what would be the index of rd within w if all the numbers were 7 digits long (i.e. if\r\n // they had leading zeros)\r\n // j: if > 0, the actual index of rd within w (if < 0, rd is a leading zero).\r\n\r\n // Get the length of the first word of the digits array xd.\r\n for (digits = 1, k = xd[0]; k >= 10; k /= 10) digits++;\r\n i = sd - digits;\r\n\r\n // Is the rounding digit in the first word of xd?\r\n if (i < 0) {\r\n i += LOG_BASE;\r\n j = sd;\r\n w = xd[xdi = 0];\r\n\r\n // Get the rounding digit at index j of w.\r\n rd = w / mathpow(10, digits - j - 1) % 10 | 0;\r\n } else {\r\n xdi = Math.ceil((i + 1) / LOG_BASE);\r\n k = xd.length;\r\n if (xdi >= k) {\r\n if (isTruncated) {\r\n\r\n // Needed by `naturalExponential`, `naturalLogarithm` and `squareRoot`.\r\n for (; k++ <= xdi;) xd.push(0);\r\n w = rd = 0;\r\n digits = 1;\r\n i %= LOG_BASE;\r\n j = i - LOG_BASE + 1;\r\n } else {\r\n break out;\r\n }\r\n } else {\r\n w = k = xd[xdi];\r\n\r\n // Get the number of digits of w.\r\n for (digits = 1; k >= 10; k /= 10) digits++;\r\n\r\n // Get the index of rd within w.\r\n i %= LOG_BASE;\r\n\r\n // Get the index of rd within w, adjusted for leading zeros.\r\n // The number of leading zeros of w is given by LOG_BASE - digits.\r\n j = i - LOG_BASE + digits;\r\n\r\n // Get the rounding digit at index j of w.\r\n rd = j < 0 ? 0 : w / mathpow(10, digits - j - 1) % 10 | 0;\r\n }\r\n }\r\n\r\n // Are there any non-zero digits after the rounding digit?\r\n isTruncated = isTruncated || sd < 0 ||\r\n xd[xdi + 1] !== void 0 || (j < 0 ? w : w % mathpow(10, digits - j - 1));\r\n\r\n // The expression `w % mathpow(10, digits - j - 1)` returns all the digits of w to the right\r\n // of the digit at (left-to-right) index j, e.g. if w is 908714 and j is 2, the expression\r\n // will give 714.\r\n\r\n roundUp = rm < 4\r\n ? (rd || isTruncated) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))\r\n : rd > 5 || rd == 5 && (rm == 4 || isTruncated || rm == 6 &&\r\n\r\n // Check whether the digit to the left of the rounding digit is odd.\r\n ((i > 0 ? j > 0 ? w / mathpow(10, digits - j) : 0 : xd[xdi - 1]) % 10) & 1 ||\r\n rm == (x.s < 0 ? 8 : 7));\r\n\r\n if (sd < 1 || !xd[0]) {\r\n xd.length = 0;\r\n if (roundUp) {\r\n\r\n // Convert sd to decimal places.\r\n sd -= x.e + 1;\r\n\r\n // 1, 0.1, 0.01, 0.001, 0.0001 etc.\r\n xd[0] = mathpow(10, (LOG_BASE - sd % LOG_BASE) % LOG_BASE);\r\n x.e = -sd || 0;\r\n } else {\r\n\r\n // Zero.\r\n xd[0] = x.e = 0;\r\n }\r\n\r\n return x;\r\n }\r\n\r\n // Remove excess digits.\r\n if (i == 0) {\r\n xd.length = xdi;\r\n k = 1;\r\n xdi--;\r\n } else {\r\n xd.length = xdi + 1;\r\n k = mathpow(10, LOG_BASE - i);\r\n\r\n // E.g. 56700 becomes 56000 if 7 is the rounding digit.\r\n // j > 0 means i > number of leading zeros of w.\r\n xd[xdi] = j > 0 ? (w / mathpow(10, digits - j) % mathpow(10, j) | 0) * k : 0;\r\n }\r\n\r\n if (roundUp) {\r\n for (;;) {\r\n\r\n // Is the digit to be rounded up in the first word of xd?\r\n if (xdi == 0) {\r\n\r\n // i will be the length of xd[0] before k is added.\r\n for (i = 1, j = xd[0]; j >= 10; j /= 10) i++;\r\n j = xd[0] += k;\r\n for (k = 1; j >= 10; j /= 10) k++;\r\n\r\n // if i != k the length has increased.\r\n if (i != k) {\r\n x.e++;\r\n if (xd[0] == BASE) xd[0] = 1;\r\n }\r\n\r\n break;\r\n } else {\r\n xd[xdi] += k;\r\n if (xd[xdi] != BASE) break;\r\n xd[xdi--] = 0;\r\n k = 1;\r\n }\r\n }\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (i = xd.length; xd[--i] === 0;) xd.pop();\r\n }\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > Ctor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < Ctor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // Ctor.underflow = true;\r\n } // else Ctor.underflow = false;\r\n }\r\n\r\n return x;\r\n }\r\n\r\n\r\n function finiteToString(x, isExp, sd) {\r\n if (!x.isFinite()) return nonFiniteToString(x);\r\n var k,\r\n e = x.e,\r\n str = digitsToString(x.d),\r\n len = str.length;\r\n\r\n if (isExp) {\r\n if (sd && (k = sd - len) > 0) {\r\n str = str.charAt(0) + '.' + str.slice(1) + getZeroString(k);\r\n } else if (len > 1) {\r\n str = str.charAt(0) + '.' + str.slice(1);\r\n }\r\n\r\n str = str + (x.e < 0 ? 'e' : 'e+') + x.e;\r\n } else if (e < 0) {\r\n str = '0.' + getZeroString(-e - 1) + str;\r\n if (sd && (k = sd - len) > 0) str += getZeroString(k);\r\n } else if (e >= len) {\r\n str += getZeroString(e + 1 - len);\r\n if (sd && (k = sd - e - 1) > 0) str = str + '.' + getZeroString(k);\r\n } else {\r\n if ((k = e + 1) < len) str = str.slice(0, k) + '.' + str.slice(k);\r\n if (sd && (k = sd - len) > 0) {\r\n if (e + 1 === len) str += '.';\r\n str += getZeroString(k);\r\n }\r\n }\r\n\r\n return str;\r\n }\r\n\r\n\r\n // Calculate the base 10 exponent from the base 1e7 exponent.\r\n function getBase10Exponent(digits, e) {\r\n var w = digits[0];\r\n\r\n // Add the number of digits of the first word of the digits array.\r\n for ( e *= LOG_BASE; w >= 10; w /= 10) e++;\r\n return e;\r\n }\r\n\r\n\r\n function getLn10(Ctor, sd, pr) {\r\n if (sd > LN10_PRECISION) {\r\n\r\n // Reset global state in case the exception is caught.\r\n external = true;\r\n if (pr) Ctor.precision = pr;\r\n throw Error(precisionLimitExceeded);\r\n }\r\n return finalise(new Ctor(LN10), sd, 1, true);\r\n }\r\n\r\n\r\n function getPi(Ctor, sd, rm) {\r\n if (sd > PI_PRECISION) throw Error(precisionLimitExceeded);\r\n return finalise(new Ctor(PI), sd, rm, true);\r\n }\r\n\r\n\r\n function getPrecision(digits) {\r\n var w = digits.length - 1,\r\n len = w * LOG_BASE + 1;\r\n\r\n w = digits[w];\r\n\r\n // If non-zero...\r\n if (w) {\r\n\r\n // Subtract the number of trailing zeros of the last word.\r\n for (; w % 10 == 0; w /= 10) len--;\r\n\r\n // Add the number of digits of the first word.\r\n for (w = digits[0]; w >= 10; w /= 10) len++;\r\n }\r\n\r\n return len;\r\n }\r\n\r\n\r\n function getZeroString(k) {\r\n var zs = '';\r\n for (; k--;) zs += '0';\r\n return zs;\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of Decimal `x` to the power `n`, where `n` is an\r\n * integer of type number.\r\n *\r\n * Implements 'exponentiation by squaring'. Called by `pow` and `parseOther`.\r\n *\r\n */\r\n function intPow(Ctor, x, n, pr) {\r\n var isTruncated,\r\n r = new Ctor(1),\r\n\r\n // Max n of 9007199254740991 takes 53 loop iterations.\r\n // Maximum digits array length; leaves [28, 34] guard digits.\r\n k = Math.ceil(pr / LOG_BASE + 4);\r\n\r\n external = false;\r\n\r\n for (;;) {\r\n if (n % 2) {\r\n r = r.times(x);\r\n if (truncate(r.d, k)) isTruncated = true;\r\n }\r\n\r\n n = mathfloor(n / 2);\r\n if (n === 0) {\r\n\r\n // To ensure correct rounding when r.d is truncated, increment the last word if it is zero.\r\n n = r.d.length - 1;\r\n if (isTruncated && r.d[n] === 0) ++r.d[n];\r\n break;\r\n }\r\n\r\n x = x.times(x);\r\n truncate(x.d, k);\r\n }\r\n\r\n external = true;\r\n\r\n return r;\r\n }\r\n\r\n\r\n function isOdd(n) {\r\n return n.d[n.d.length - 1] & 1;\r\n }\r\n\r\n\r\n /*\r\n * Handle `max` and `min`. `ltgt` is 'lt' or 'gt'.\r\n */\r\n function maxOrMin(Ctor, args, ltgt) {\r\n var y,\r\n x = new Ctor(args[0]),\r\n i = 0;\r\n\r\n for (; ++i < args.length;) {\r\n y = new Ctor(args[i]);\r\n if (!y.s) {\r\n x = y;\r\n break;\r\n } else if (x[ltgt](y)) {\r\n x = y;\r\n }\r\n }\r\n\r\n return x;\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the natural exponential of `x` rounded to `sd` significant\r\n * digits.\r\n *\r\n * Taylor/Maclaurin series.\r\n *\r\n * exp(x) = x^0/0! + x^1/1! + x^2/2! + x^3/3! + ...\r\n *\r\n * Argument reduction:\r\n * Repeat x = x / 32, k += 5, until |x| < 0.1\r\n * exp(x) = exp(x / 2^k)^(2^k)\r\n *\r\n * Previously, the argument was initially reduced by\r\n * exp(x) = exp(r) * 10^k where r = x - k * ln10, k = floor(x / ln10)\r\n * to first put r in the range [0, ln10], before dividing by 32 until |x| < 0.1, but this was\r\n * found to be slower than just dividing repeatedly by 32 as above.\r\n *\r\n * Max integer argument: exp('20723265836946413') = 6.3e+9000000000000000\r\n * Min integer argument: exp('-20723265836946411') = 1.2e-9000000000000000\r\n * (Math object integer min/max: Math.exp(709) = 8.2e+307, Math.exp(-745) = 5e-324)\r\n *\r\n * exp(Infinity) = Infinity\r\n * exp(-Infinity) = 0\r\n * exp(NaN) = NaN\r\n * exp(±0) = 1\r\n *\r\n * exp(x) is non-terminating for any finite, non-zero x.\r\n *\r\n * The result will always be correctly rounded.\r\n *\r\n */\r\n function naturalExponential(x, sd) {\r\n var denominator, guard, j, pow, sum, t, wpr,\r\n rep = 0,\r\n i = 0,\r\n k = 0,\r\n Ctor = x.constructor,\r\n rm = Ctor.rounding,\r\n pr = Ctor.precision;\r\n\r\n // 0/NaN/Infinity?\r\n if (!x.d || !x.d[0] || x.e > 17) {\r\n\r\n return new Ctor(x.d\r\n ? !x.d[0] ? 1 : x.s < 0 ? 0 : 1 / 0\r\n : x.s ? x.s < 0 ? 0 : x : 0 / 0);\r\n }\r\n\r\n if (sd == null) {\r\n external = false;\r\n wpr = pr;\r\n } else {\r\n wpr = sd;\r\n }\r\n\r\n t = new Ctor(0.03125);\r\n\r\n // while abs(x) >= 0.1\r\n while (x.e > -2) {\r\n\r\n // x = x / 2^5\r\n x = x.times(t);\r\n k += 5;\r\n }\r\n\r\n // Use 2 * log10(2^k) + 5 (empirically derived) to estimate the increase in precision\r\n // necessary to ensure the first 4 rounding digits are correct.\r\n guard = Math.log(mathpow(2, k)) / Math.LN10 * 2 + 5 | 0;\r\n wpr += guard;\r\n denominator = pow = sum = new Ctor(1);\r\n Ctor.precision = wpr;\r\n\r\n for (;;) {\r\n pow = finalise(pow.times(x), wpr, 1);\r\n denominator = denominator.times(++i);\r\n t = sum.plus(divide(pow, denominator, wpr, 1));\r\n\r\n if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {\r\n j = k;\r\n while (j--) sum = finalise(sum.times(sum), wpr, 1);\r\n\r\n // Check to see if the first 4 rounding digits are [49]999.\r\n // If so, repeat the summation with a higher precision, otherwise\r\n // e.g. with precision: 18, rounding: 1\r\n // exp(18.404272462595034083567793919843761) = 98372560.1229999999 (should be 98372560.123)\r\n // `wpr - guard` is the index of first rounding digit.\r\n if (sd == null) {\r\n\r\n if (rep < 3 && checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {\r\n Ctor.precision = wpr += 10;\r\n denominator = pow = t = new Ctor(1);\r\n i = 0;\r\n rep++;\r\n } else {\r\n return finalise(sum, Ctor.precision = pr, rm, external = true);\r\n }\r\n } else {\r\n Ctor.precision = pr;\r\n return sum;\r\n }\r\n }\r\n\r\n sum = t;\r\n }\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the natural logarithm of `x` rounded to `sd` significant\r\n * digits.\r\n *\r\n * ln(-n) = NaN\r\n * ln(0) = -Infinity\r\n * ln(-0) = -Infinity\r\n * ln(1) = 0\r\n * ln(Infinity) = Infinity\r\n * ln(-Infinity) = NaN\r\n * ln(NaN) = NaN\r\n *\r\n * ln(n) (n != 1) is non-terminating.\r\n *\r\n */\r\n function naturalLogarithm(y, sd) {\r\n var c, c0, denominator, e, numerator, rep, sum, t, wpr, x1, x2,\r\n n = 1,\r\n guard = 10,\r\n x = y,\r\n xd = x.d,\r\n Ctor = x.constructor,\r\n rm = Ctor.rounding,\r\n pr = Ctor.precision;\r\n\r\n // Is x negative or Infinity, NaN, 0 or 1?\r\n if (x.s < 0 || !xd || !xd[0] || !x.e && xd[0] == 1 && xd.length == 1) {\r\n return new Ctor(xd && !xd[0] ? -1 / 0 : x.s != 1 ? NaN : xd ? 0 : x);\r\n }\r\n\r\n if (sd == null) {\r\n external = false;\r\n wpr = pr;\r\n } else {\r\n wpr = sd;\r\n }\r\n\r\n Ctor.precision = wpr += guard;\r\n c = digitsToString(xd);\r\n c0 = c.charAt(0);\r\n\r\n if (Math.abs(e = x.e) < 1.5e15) {\r\n\r\n // Argument reduction.\r\n // The series converges faster the closer the argument is to 1, so using\r\n // ln(a^b) = b * ln(a), ln(a) = ln(a^b) / b\r\n // multiply the argument by itself until the leading digits of the significand are 7, 8, 9,\r\n // 10, 11, 12 or 13, recording the number of multiplications so the sum of the series can\r\n // later be divided by this number, then separate out the power of 10 using\r\n // ln(a*10^b) = ln(a) + b*ln(10).\r\n\r\n // max n is 21 (gives 0.9, 1.0 or 1.1) (9e15 / 21 = 4.2e14).\r\n //while (c0 < 9 && c0 != 1 || c0 == 1 && c.charAt(1) > 1) {\r\n // max n is 6 (gives 0.7 - 1.3)\r\n while (c0 < 7 && c0 != 1 || c0 == 1 && c.charAt(1) > 3) {\r\n x = x.times(y);\r\n c = digitsToString(x.d);\r\n c0 = c.charAt(0);\r\n n++;\r\n }\r\n\r\n e = x.e;\r\n\r\n if (c0 > 1) {\r\n x = new Ctor('0.' + c);\r\n e++;\r\n } else {\r\n x = new Ctor(c0 + '.' + c.slice(1));\r\n }\r\n } else {\r\n\r\n // The argument reduction method above may result in overflow if the argument y is a massive\r\n // number with exponent >= 1500000000000000 (9e15 / 6 = 1.5e15), so instead recall this\r\n // function using ln(x*10^e) = ln(x) + e*ln(10).\r\n t = getLn10(Ctor, wpr + 2, pr).times(e + '');\r\n x = naturalLogarithm(new Ctor(c0 + '.' + c.slice(1)), wpr - guard).plus(t);\r\n Ctor.precision = pr;\r\n\r\n return sd == null ? finalise(x, pr, rm, external = true) : x;\r\n }\r\n\r\n // x1 is x reduced to a value near 1.\r\n x1 = x;\r\n\r\n // Taylor series.\r\n // ln(y) = ln((1 + x)/(1 - x)) = 2(x + x^3/3 + x^5/5 + x^7/7 + ...)\r\n // where x = (y - 1)/(y + 1) (|x| < 1)\r\n sum = numerator = x = divide(x.minus(1), x.plus(1), wpr, 1);\r\n x2 = finalise(x.times(x), wpr, 1);\r\n denominator = 3;\r\n\r\n for (;;) {\r\n numerator = finalise(numerator.times(x2), wpr, 1);\r\n t = sum.plus(divide(numerator, new Ctor(denominator), wpr, 1));\r\n\r\n if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {\r\n sum = sum.times(2);\r\n\r\n // Reverse the argument reduction. Check that e is not 0 because, besides preventing an\r\n // unnecessary calculation, -0 + 0 = +0 and to ensure correct rounding -0 needs to stay -0.\r\n if (e !== 0) sum = sum.plus(getLn10(Ctor, wpr + 2, pr).times(e + ''));\r\n sum = divide(sum, new Ctor(n), wpr, 1);\r\n\r\n // Is rm > 3 and the first 4 rounding digits 4999, or rm < 4 (or the summation has\r\n // been repeated previously) and the first 4 rounding digits 9999?\r\n // If so, restart the summation with a higher precision, otherwise\r\n // e.g. with precision: 12, rounding: 1\r\n // ln(135520028.6126091714265381533) = 18.7246299999 when it should be 18.72463.\r\n // `wpr - guard` is the index of first rounding digit.\r\n if (sd == null) {\r\n if (checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {\r\n Ctor.precision = wpr += guard;\r\n t = numerator = x = divide(x1.minus(1), x1.plus(1), wpr, 1);\r\n x2 = finalise(x.times(x), wpr, 1);\r\n denominator = rep = 1;\r\n } else {\r\n return finalise(sum, Ctor.precision = pr, rm, external = true);\r\n }\r\n } else {\r\n Ctor.precision = pr;\r\n return sum;\r\n }\r\n }\r\n\r\n sum = t;\r\n denominator += 2;\r\n }\r\n }\r\n\r\n\r\n // ±Infinity, NaN.\r\n function nonFiniteToString(x) {\r\n // Unsigned.\r\n return String(x.s * x.s / 0);\r\n }\r\n\r\n\r\n /*\r\n * Parse the value of a new Decimal `x` from string `str`.\r\n */\r\n function parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48; --len);\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n x.e = e = e - i - 1;\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > x.constructor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < x.constructor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // x.constructor.underflow = true;\r\n } // else x.constructor.underflow = false;\r\n }\r\n } else {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n }\r\n\r\n\r\n /*\r\n * Parse the value of a new Decimal `x` from a string `str`, which is not a decimal value.\r\n */\r\n function parseOther(x, str) {\r\n var base, Ctor, divisor, i, isFloat, len, p, xd, xe;\r\n\r\n if (str.indexOf('_') > -1) {\r\n str = str.replace(/(\\d)_(?=\\d)/g, '$1');\r\n if (isDecimal.test(str)) return parseDecimal(x, str);\r\n } else if (str === 'Infinity' || str === 'NaN') {\r\n if (!+str) x.s = NaN;\r\n x.e = NaN;\r\n x.d = null;\r\n return x;\r\n }\r\n\r\n if (isHex.test(str)) {\r\n base = 16;\r\n str = str.toLowerCase();\r\n } else if (isBinary.test(str)) {\r\n base = 2;\r\n } else if (isOctal.test(str)) {\r\n base = 8;\r\n } else {\r\n throw Error(invalidArgument + str);\r\n }\r\n\r\n // Is there a binary exponent part?\r\n i = str.search(/p/i);\r\n\r\n if (i > 0) {\r\n p = +str.slice(i + 1);\r\n str = str.substring(2, i);\r\n } else {\r\n str = str.slice(2);\r\n }\r\n\r\n // Convert `str` as an integer then divide the result by `base` raised to a power such that the\r\n // fraction part will be restored.\r\n i = str.indexOf('.');\r\n isFloat = i >= 0;\r\n Ctor = x.constructor;\r\n\r\n if (isFloat) {\r\n str = str.replace('.', '');\r\n len = str.length;\r\n i = len - i;\r\n\r\n // log[10](16) = 1.2041... , log[10](88) = 1.9444....\r\n divisor = intPow(Ctor, new Ctor(base), i, i * 2);\r\n }\r\n\r\n xd = convertBase(str, base, BASE);\r\n xe = xd.length - 1;\r\n\r\n // Remove trailing zeros.\r\n for (i = xe; xd[i] === 0; --i) xd.pop();\r\n if (i < 0) return new Ctor(x.s * 0);\r\n x.e = getBase10Exponent(xd, xe);\r\n x.d = xd;\r\n external = false;\r\n\r\n // At what precision to perform the division to ensure exact conversion?\r\n // maxDecimalIntegerPartDigitCount = ceil(log[10](b) * otherBaseIntegerPartDigitCount)\r\n // log[10](2) = 0.30103, log[10](8) = 0.90309, log[10](16) = 1.20412\r\n // E.g. ceil(1.2 * 3) = 4, so up to 4 decimal digits are needed to represent 3 hex int digits.\r\n // maxDecimalFractionPartDigitCount = {Hex:4|Oct:3|Bin:1} * otherBaseFractionPartDigitCount\r\n // Therefore using 4 * the number of digits of str will always be enough.\r\n if (isFloat) x = divide(x, divisor, len * 4);\r\n\r\n // Multiply by the binary exponent part if present.\r\n if (p) x = x.times(Math.abs(p) < 54 ? mathpow(2, p) : Decimal.pow(2, p));\r\n external = true;\r\n\r\n return x;\r\n }\r\n\r\n\r\n /*\r\n * sin(x) = x - x^3/3! + x^5/5! - ...\r\n * |x| < pi/2\r\n *\r\n */\r\n function sine(Ctor, x) {\r\n var k,\r\n len = x.d.length;\r\n\r\n if (len < 3) {\r\n return x.isZero() ? x : taylorSeries(Ctor, 2, x, x);\r\n }\r\n\r\n // Argument reduction: sin(5x) = 16*sin^5(x) - 20*sin^3(x) + 5*sin(x)\r\n // i.e. sin(x) = 16*sin^5(x/5) - 20*sin^3(x/5) + 5*sin(x/5)\r\n // and sin(x) = sin(x/5)(5 + sin^2(x/5)(16sin^2(x/5) - 20))\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n k = 1.4 * Math.sqrt(len);\r\n k = k > 16 ? 16 : k | 0;\r\n\r\n x = x.times(1 / tinyPow(5, k));\r\n x = taylorSeries(Ctor, 2, x, x);\r\n\r\n // Reverse argument reduction\r\n var sin2_x,\r\n d5 = new Ctor(5),\r\n d16 = new Ctor(16),\r\n d20 = new Ctor(20);\r\n for (; k--;) {\r\n sin2_x = x.times(x);\r\n x = x.times(d5.plus(sin2_x.times(d16.times(sin2_x).minus(d20))));\r\n }\r\n\r\n return x;\r\n }\r\n\r\n\r\n // Calculate Taylor series for `cos`, `cosh`, `sin` and `sinh`.\r\n function taylorSeries(Ctor, n, x, y, isHyperbolic) {\r\n var j, t, u, x2,\r\n i = 1,\r\n pr = Ctor.precision,\r\n k = Math.ceil(pr / LOG_BASE);\r\n\r\n external = false;\r\n x2 = x.times(x);\r\n u = new Ctor(y);\r\n\r\n for (;;) {\r\n t = divide(u.times(x2), new Ctor(n++ * n++), pr, 1);\r\n u = isHyperbolic ? y.plus(t) : y.minus(t);\r\n y = divide(t.times(x2), new Ctor(n++ * n++), pr, 1);\r\n t = u.plus(y);\r\n\r\n if (t.d[k] !== void 0) {\r\n for (j = k; t.d[j] === u.d[j] && j--;);\r\n if (j == -1) break;\r\n }\r\n\r\n j = u;\r\n u = y;\r\n y = t;\r\n t = j;\r\n i++;\r\n }\r\n\r\n external = true;\r\n t.d.length = k + 1;\r\n\r\n return t;\r\n }\r\n\r\n\r\n // Exponent e must be positive and non-zero.\r\n function tinyPow(b, e) {\r\n var n = b;\r\n while (--e) n *= b;\r\n return n;\r\n }\r\n\r\n\r\n // Return the absolute value of `x` reduced to less than or equal to half pi.\r\n function toLessThanHalfPi(Ctor, x) {\r\n var t,\r\n isNeg = x.s < 0,\r\n pi = getPi(Ctor, Ctor.precision, 1),\r\n halfPi = pi.times(0.5);\r\n\r\n x = x.abs();\r\n\r\n if (x.lte(halfPi)) {\r\n quadrant = isNeg ? 4 : 1;\r\n return x;\r\n }\r\n\r\n t = x.divToInt(pi);\r\n\r\n if (t.isZero()) {\r\n quadrant = isNeg ? 3 : 2;\r\n } else {\r\n x = x.minus(t.times(pi));\r\n\r\n // 0 <= x < pi\r\n if (x.lte(halfPi)) {\r\n quadrant = isOdd(t) ? (isNeg ? 2 : 3) : (isNeg ? 4 : 1);\r\n return x;\r\n }\r\n\r\n quadrant = isOdd(t) ? (isNeg ? 1 : 4) : (isNeg ? 3 : 2);\r\n }\r\n\r\n return x.minus(pi).abs();\r\n }\r\n\r\n\r\n /*\r\n * Return the value of Decimal `x` as a string in base `baseOut`.\r\n *\r\n * If the optional `sd` argument is present include a binary exponent suffix.\r\n */\r\n function toStringBinary(x, baseOut, sd, rm) {\r\n var base, e, i, k, len, roundUp, str, xd, y,\r\n Ctor = x.constructor,\r\n isExp = sd !== void 0;\r\n\r\n if (isExp) {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n } else {\r\n sd = Ctor.precision;\r\n rm = Ctor.rounding;\r\n }\r\n\r\n if (!x.isFinite()) {\r\n str = nonFiniteToString(x);\r\n } else {\r\n str = finiteToString(x);\r\n i = str.indexOf('.');\r\n\r\n // Use exponential notation according to `toExpPos` and `toExpNeg`? No, but if required:\r\n // maxBinaryExponent = floor((decimalExponent + 1) * log[2](10))\r\n // minBinaryExponent = floor(decimalExponent * log[2](10))\r\n // log[2](10) = 3.321928094887362347870319429489390175864\r\n\r\n if (isExp) {\r\n base = 2;\r\n if (baseOut == 16) {\r\n sd = sd * 4 - 3;\r\n } else if (baseOut == 8) {\r\n sd = sd * 3 - 2;\r\n }\r\n } else {\r\n base = baseOut;\r\n }\r\n\r\n // Convert the number as an integer then divide the result by its base raised to a power such\r\n // that the fraction part will be restored.\r\n\r\n // Non-integer.\r\n if (i >= 0) {\r\n str = str.replace('.', '');\r\n y = new Ctor(1);\r\n y.e = str.length - i;\r\n y.d = convertBase(finiteToString(y), 10, base);\r\n y.e = y.d.length;\r\n }\r\n\r\n xd = convertBase(str, 10, base);\r\n e = len = xd.length;\r\n\r\n // Remove trailing zeros.\r\n for (; xd[--len] == 0;) xd.pop();\r\n\r\n if (!xd[0]) {\r\n str = isExp ? '0p+0' : '0';\r\n } else {\r\n if (i < 0) {\r\n e--;\r\n } else {\r\n x = new Ctor(x);\r\n x.d = xd;\r\n x.e = e;\r\n x = divide(x, y, sd, rm, 0, base);\r\n xd = x.d;\r\n e = x.e;\r\n roundUp = inexact;\r\n }\r\n\r\n // The rounding digit, i.e. the digit after the digit that may be rounded up.\r\n i = xd[sd];\r\n k = base / 2;\r\n roundUp = roundUp || xd[sd + 1] !== void 0;\r\n\r\n roundUp = rm < 4\r\n ? (i !== void 0 || roundUp) && (rm === 0 || rm === (x.s < 0 ? 3 : 2))\r\n : i > k || i === k && (rm === 4 || roundUp || rm === 6 && xd[sd - 1] & 1 ||\r\n rm === (x.s < 0 ? 8 : 7));\r\n\r\n xd.length = sd;\r\n\r\n if (roundUp) {\r\n\r\n // Rounding up may mean the previous digit has to be rounded up and so on.\r\n for (; ++xd[--sd] > base - 1;) {\r\n xd[sd] = 0;\r\n if (!sd) {\r\n ++e;\r\n xd.unshift(1);\r\n }\r\n }\r\n }\r\n\r\n // Determine trailing zeros.\r\n for (len = xd.length; !xd[len - 1]; --len);\r\n\r\n // E.g. [4, 11, 15] becomes 4bf.\r\n for (i = 0, str = ''; i < len; i++) str += NUMERALS.charAt(xd[i]);\r\n\r\n // Add binary exponent suffix?\r\n if (isExp) {\r\n if (len > 1) {\r\n if (baseOut == 16 || baseOut == 8) {\r\n i = baseOut == 16 ? 4 : 3;\r\n for (--len; len % i; len++) str += '0';\r\n xd = convertBase(str, base, baseOut);\r\n for (len = xd.length; !xd[len - 1]; --len);\r\n\r\n // xd[0] will always be be 1\r\n for (i = 1, str = '1.'; i < len; i++) str += NUMERALS.charAt(xd[i]);\r\n } else {\r\n str = str.charAt(0) + '.' + str.slice(1);\r\n }\r\n }\r\n\r\n str = str + (e < 0 ? 'p' : 'p+') + e;\r\n } else if (e < 0) {\r\n for (; ++e;) str = '0' + str;\r\n str = '0.' + str;\r\n } else {\r\n if (++e > len) for (e -= len; e-- ;) str += '0';\r\n else if (e < len) str = str.slice(0, e) + '.' + str.slice(e);\r\n }\r\n }\r\n\r\n str = (baseOut == 16 ? '0x' : baseOut == 2 ? '0b' : baseOut == 8 ? '0o' : '') + str;\r\n }\r\n\r\n return x.s < 0 ? '-' + str : str;\r\n }\r\n\r\n\r\n // Does not strip trailing zeros.\r\n function truncate(arr, len) {\r\n if (arr.length > len) {\r\n arr.length = len;\r\n return true;\r\n }\r\n }\r\n\r\n\r\n // Decimal methods\r\n\r\n\r\n /*\r\n * abs\r\n * acos\r\n * acosh\r\n * add\r\n * asin\r\n * asinh\r\n * atan\r\n * atanh\r\n * atan2\r\n * cbrt\r\n * ceil\r\n * clamp\r\n * clone\r\n * config\r\n * cos\r\n * cosh\r\n * div\r\n * exp\r\n * floor\r\n * hypot\r\n * ln\r\n * log\r\n * log2\r\n * log10\r\n * max\r\n * min\r\n * mod\r\n * mul\r\n * pow\r\n * random\r\n * round\r\n * set\r\n * sign\r\n * sin\r\n * sinh\r\n * sqrt\r\n * sub\r\n * sum\r\n * tan\r\n * tanh\r\n * trunc\r\n */\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the absolute value of `x`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\n function abs(x) {\r\n return new this(x).abs();\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the arccosine in radians of `x`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\n function acos(x) {\r\n return new this(x).acos();\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic cosine of `x`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\n function acosh(x) {\r\n return new this(x).acosh();\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the sum of `x` and `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\n function add(x, y) {\r\n return new this(x).plus(y);\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the arcsine in radians of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\n function asin(x) {\r\n return new this(x).asin();\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic sine of `x`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\n function asinh(x) {\r\n return new this(x).asinh();\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the arctangent in radians of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\n function atan(x) {\r\n return new this(x).atan();\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic tangent of `x`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\n function atanh(x) {\r\n return new this(x).atanh();\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the arctangent in radians of `y/x` in the range -pi to pi\r\n * (inclusive), rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-pi, pi]\r\n *\r\n * y {number|string|Decimal} The y-coordinate.\r\n * x {number|string|Decimal} The x-coordinate.\r\n *\r\n * atan2(±0, -0) = ±pi\r\n * atan2(±0, +0) = ±0\r\n * atan2(±0, -x) = ±pi for x > 0\r\n * atan2(±0, x) = ±0 for x > 0\r\n * atan2(-y, ±0) = -pi/2 for y > 0\r\n * atan2(y, ±0) = pi/2 for y > 0\r\n * atan2(±y, -Infinity) = ±pi for finite y > 0\r\n * atan2(±y, +Infinity) = ±0 for finite y > 0\r\n * atan2(±Infinity, x) = ±pi/2 for finite x\r\n * atan2(±Infinity, -Infinity) = ±3*pi/4\r\n * atan2(±Infinity, +Infinity) = ±pi/4\r\n * atan2(NaN, x) = NaN\r\n * atan2(y, NaN) = NaN\r\n *\r\n */\r\n function atan2(y, x) {\r\n y = new this(y);\r\n x = new this(x);\r\n var r,\r\n pr = this.precision,\r\n rm = this.rounding,\r\n wpr = pr + 4;\r\n\r\n // Either NaN\r\n if (!y.s || !x.s) {\r\n r = new this(NaN);\r\n\r\n // Both ±Infinity\r\n } else if (!y.d && !x.d) {\r\n r = getPi(this, wpr, 1).times(x.s > 0 ? 0.25 : 0.75);\r\n r.s = y.s;\r\n\r\n // x is ±Infinity or y is ±0\r\n } else if (!x.d || y.isZero()) {\r\n r = x.s < 0 ? getPi(this, pr, rm) : new this(0);\r\n r.s = y.s;\r\n\r\n // y is ±Infinity or x is ±0\r\n } else if (!y.d || x.isZero()) {\r\n r = getPi(this, wpr, 1).times(0.5);\r\n r.s = y.s;\r\n\r\n // Both non-zero and finite\r\n } else if (x.s < 0) {\r\n this.precision = wpr;\r\n this.rounding = 1;\r\n r = this.atan(divide(y, x, wpr, 1));\r\n x = getPi(this, wpr, 1);\r\n this.precision = pr;\r\n this.rounding = rm;\r\n r = y.s < 0 ? r.minus(x) : r.plus(x);\r\n } else {\r\n r = this.atan(divide(y, x, wpr, 1));\r\n }\r\n\r\n return r;\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the cube root of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\n function cbrt(x) {\r\n return new this(x).cbrt();\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is `x` rounded to an integer using `ROUND_CEIL`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\n function ceil(x) {\r\n return finalise(x = new this(x), x.e + 1, 2);\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is `x` clamped to the range delineated by `min` and `max`.\r\n *\r\n * x {number|string|Decimal}\r\n * min {number|string|Decimal}\r\n * max {number|string|Decimal}\r\n *\r\n */\r\n function clamp(x, min, max) {\r\n return new this(x).clamp(min, max);\r\n }\r\n\r\n\r\n /*\r\n * Configure global settings for a Decimal constructor.\r\n *\r\n * `obj` is an object with one or more of the following properties,\r\n *\r\n * precision {number}\r\n * rounding {number}\r\n * toExpNeg {number}\r\n * toExpPos {number}\r\n * maxE {number}\r\n * minE {number}\r\n * modulo {number}\r\n * crypto {boolean|number}\r\n * defaults {true}\r\n *\r\n * E.g. Decimal.config({ precision: 20, rounding: 4 })\r\n *\r\n */\r\n function config(obj) {\r\n if (!obj || typeof obj !== 'object') throw Error(decimalError + 'Object expected');\r\n var i, p, v,\r\n useDefaults = obj.defaults === true,\r\n ps = [\r\n 'precision', 1, MAX_DIGITS,\r\n 'rounding', 0, 8,\r\n 'toExpNeg', -EXP_LIMIT, 0,\r\n 'toExpPos', 0, EXP_LIMIT,\r\n 'maxE', 0, EXP_LIMIT,\r\n 'minE', -EXP_LIMIT, 0,\r\n 'modulo', 0, 9\r\n ];\r\n\r\n for (i = 0; i < ps.length; i += 3) {\r\n if (p = ps[i], useDefaults) this[p] = DEFAULTS[p];\r\n if ((v = obj[p]) !== void 0) {\r\n if (mathfloor(v) === v && v >= ps[i + 1] && v <= ps[i + 2]) this[p] = v;\r\n else throw Error(invalidArgument + p + ': ' + v);\r\n }\r\n }\r\n\r\n if (p = 'crypto', useDefaults) this[p] = DEFAULTS[p];\r\n if ((v = obj[p]) !== void 0) {\r\n if (v === true || v === false || v === 0 || v === 1) {\r\n if (v) {\r\n if (typeof crypto != 'undefined' && crypto &&\r\n (crypto.getRandomValues || crypto.randomBytes)) {\r\n this[p] = true;\r\n } else {\r\n throw Error(cryptoUnavailable);\r\n }\r\n } else {\r\n this[p] = false;\r\n }\r\n } else {\r\n throw Error(invalidArgument + p + ': ' + v);\r\n }\r\n }\r\n\r\n return this;\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the cosine of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\n function cos(x) {\r\n return new this(x).cos();\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the hyperbolic cosine of `x`, rounded to precision\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\n function cosh(x) {\r\n return new this(x).cosh();\r\n }\r\n\r\n\r\n /*\r\n * Create and return a Decimal constructor with the same configuration properties as this Decimal\r\n * constructor.\r\n *\r\n */\r\n function clone(obj) {\r\n var i, p, ps;\r\n\r\n /*\r\n * The Decimal constructor and exported function.\r\n * Return a new Decimal instance.\r\n *\r\n * v {number|string|Decimal} A numeric value.\r\n *\r\n */\r\n function Decimal(v) {\r\n var e, i, t,\r\n x = this;\r\n\r\n // Decimal called without new.\r\n if (!(x instanceof Decimal)) return new Decimal(v);\r\n\r\n // Retain a reference to this Decimal constructor, and shadow Decimal.prototype.constructor\r\n // which points to Object.\r\n x.constructor = Decimal;\r\n\r\n // Duplicate.\r\n if (isDecimalInstance(v)) {\r\n x.s = v.s;\r\n\r\n if (external) {\r\n if (!v.d || v.e > Decimal.maxE) {\r\n\r\n // Infinity.\r\n x.e = NaN;\r\n x.d = null;\r\n } else if (v.e < Decimal.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n } else {\r\n x.e = v.e;\r\n x.d = v.d.slice();\r\n }\r\n } else {\r\n x.e = v.e;\r\n x.d = v.d ? v.d.slice() : v.d;\r\n }\r\n\r\n return;\r\n }\r\n\r\n t = typeof v;\r\n\r\n if (t === 'number') {\r\n if (v === 0) {\r\n x.s = 1 / v < 0 ? -1 : 1;\r\n x.e = 0;\r\n x.d = [0];\r\n return;\r\n }\r\n\r\n if (v < 0) {\r\n v = -v;\r\n x.s = -1;\r\n } else {\r\n x.s = 1;\r\n }\r\n\r\n // Fast path for small integers.\r\n if (v === ~~v && v < 1e7) {\r\n for (e = 0, i = v; i >= 10; i /= 10) e++;\r\n\r\n if (external) {\r\n if (e > Decimal.maxE) {\r\n x.e = NaN;\r\n x.d = null;\r\n } else if (e < Decimal.minE) {\r\n x.e = 0;\r\n x.d = [0];\r\n } else {\r\n x.e = e;\r\n x.d = [v];\r\n }\r\n } else {\r\n x.e = e;\r\n x.d = [v];\r\n }\r\n\r\n return;\r\n\r\n // Infinity, NaN.\r\n } else if (v * 0 !== 0) {\r\n if (!v) x.s = NaN;\r\n x.e = NaN;\r\n x.d = null;\r\n return;\r\n }\r\n\r\n return parseDecimal(x, v.toString());\r\n\r\n } else if (t !== 'string') {\r\n throw Error(invalidArgument + v);\r\n }\r\n\r\n // Minus sign?\r\n if ((i = v.charCodeAt(0)) === 45) {\r\n v = v.slice(1);\r\n x.s = -1;\r\n } else {\r\n // Plus sign?\r\n if (i === 43) v = v.slice(1);\r\n x.s = 1;\r\n }\r\n\r\n return isDecimal.test(v) ? parseDecimal(x, v) : parseOther(x, v);\r\n }\r\n\r\n Decimal.prototype = P;\r\n\r\n Decimal.ROUND_UP = 0;\r\n Decimal.ROUND_DOWN = 1;\r\n Decimal.ROUND_CEIL = 2;\r\n Decimal.ROUND_FLOOR = 3;\r\n Decimal.ROUND_HALF_UP = 4;\r\n Decimal.ROUND_HALF_DOWN = 5;\r\n Decimal.ROUND_HALF_EVEN = 6;\r\n Decimal.ROUND_HALF_CEIL = 7;\r\n Decimal.ROUND_HALF_FLOOR = 8;\r\n Decimal.EUCLID = 9;\r\n\r\n Decimal.config = Decimal.set = config;\r\n Decimal.clone = clone;\r\n Decimal.isDecimal = isDecimalInstance;\r\n\r\n Decimal.abs = abs;\r\n Decimal.acos = acos;\r\n Decimal.acosh = acosh; // ES6\r\n Decimal.add = add;\r\n Decimal.asin = asin;\r\n Decimal.asinh = asinh; // ES6\r\n Decimal.atan = atan;\r\n Decimal.atanh = atanh; // ES6\r\n Decimal.atan2 = atan2;\r\n Decimal.cbrt = cbrt; // ES6\r\n Decimal.ceil = ceil;\r\n Decimal.clamp = clamp;\r\n Decimal.cos = cos;\r\n Decimal.cosh = cosh; // ES6\r\n Decimal.div = div;\r\n Decimal.exp = exp;\r\n Decimal.floor = floor;\r\n Decimal.hypot = hypot; // ES6\r\n Decimal.ln = ln;\r\n Decimal.log = log;\r\n Decimal.log10 = log10; // ES6\r\n Decimal.log2 = log2; // ES6\r\n Decimal.max = max;\r\n Decimal.min = min;\r\n Decimal.mod = mod;\r\n Decimal.mul = mul;\r\n Decimal.pow = pow;\r\n Decimal.random = random;\r\n Decimal.round = round;\r\n Decimal.sign = sign; // ES6\r\n Decimal.sin = sin;\r\n Decimal.sinh = sinh; // ES6\r\n Decimal.sqrt = sqrt;\r\n Decimal.sub = sub;\r\n Decimal.sum = sum;\r\n Decimal.tan = tan;\r\n Decimal.tanh = tanh; // ES6\r\n Decimal.trunc = trunc; // ES6\r\n\r\n if (obj === void 0) obj = {};\r\n if (obj) {\r\n if (obj.defaults !== true) {\r\n ps = ['precision', 'rounding', 'toExpNeg', 'toExpPos', 'maxE', 'minE', 'modulo', 'crypto'];\r\n for (i = 0; i < ps.length;) if (!obj.hasOwnProperty(p = ps[i++])) obj[p] = this[p];\r\n }\r\n }\r\n\r\n Decimal.config(obj);\r\n\r\n return Decimal;\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is `x` divided by `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\n function div(x, y) {\r\n return new this(x).div(y);\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the natural exponential of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} The power to which to raise the base of the natural log.\r\n *\r\n */\r\n function exp(x) {\r\n return new this(x).exp();\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is `x` round to an integer using `ROUND_FLOOR`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\n function floor(x) {\r\n return finalise(x = new this(x), x.e + 1, 3);\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the square root of the sum of the squares of the arguments,\r\n * rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * hypot(a, b, ...) = sqrt(a^2 + b^2 + ...)\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\n */\r\n function hypot() {\r\n var i, n,\r\n t = new this(0);\r\n\r\n external = false;\r\n\r\n for (i = 0; i < arguments.length;) {\r\n n = new this(arguments[i++]);\r\n if (!n.d) {\r\n if (n.s) {\r\n external = true;\r\n return new this(1 / 0);\r\n }\r\n t = n;\r\n } else if (t.d) {\r\n t = t.plus(n.times(n));\r\n }\r\n }\r\n\r\n external = true;\r\n\r\n return t.sqrt();\r\n }\r\n\r\n\r\n /*\r\n * Return true if object is a Decimal instance (where Decimal is any Decimal constructor),\r\n * otherwise return false.\r\n *\r\n */\r\n function isDecimalInstance(obj) {\r\n return obj instanceof Decimal || obj && obj.toStringTag === tag || false;\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the natural logarithm of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\n function ln(x) {\r\n return new this(x).ln();\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the log of `x` to the base `y`, or to base 10 if no base\r\n * is specified, rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * log[y](x)\r\n *\r\n * x {number|string|Decimal} The argument of the logarithm.\r\n * y {number|string|Decimal} The base of the logarithm.\r\n *\r\n */\r\n function log(x, y) {\r\n return new this(x).log(y);\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the base 2 logarithm of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\n function log2(x) {\r\n return new this(x).log(2);\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the base 10 logarithm of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\n function log10(x) {\r\n return new this(x).log(10);\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the maximum of the arguments.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\n */\r\n function max() {\r\n return maxOrMin(this, arguments, 'lt');\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the minimum of the arguments.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\n */\r\n function min() {\r\n return maxOrMin(this, arguments, 'gt');\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is `x` modulo `y`, rounded to `precision` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\n function mod(x, y) {\r\n return new this(x).mod(y);\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is `x` multiplied by `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\n function mul(x, y) {\r\n return new this(x).mul(y);\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is `x` raised to the power `y`, rounded to precision\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} The base.\r\n * y {number|string|Decimal} The exponent.\r\n *\r\n */\r\n function pow(x, y) {\r\n return new this(x).pow(y);\r\n }\r\n\r\n\r\n /*\r\n * Returns a new Decimal with a random value equal to or greater than 0 and less than 1, and with\r\n * `sd`, or `Decimal.precision` if `sd` is omitted, significant digits (or less if trailing zeros\r\n * are produced).\r\n *\r\n * [sd] {number} Significant digits. Integer, 0 to MAX_DIGITS inclusive.\r\n *\r\n */\r\n function random(sd) {\r\n var d, e, k, n,\r\n i = 0,\r\n r = new this(1),\r\n rd = [];\r\n\r\n if (sd === void 0) sd = this.precision;\r\n else checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n k = Math.ceil(sd / LOG_BASE);\r\n\r\n if (!this.crypto) {\r\n for (; i < k;) rd[i++] = Math.random() * 1e7 | 0;\r\n\r\n // Browsers supporting crypto.getRandomValues.\r\n } else if (crypto.getRandomValues) {\r\n d = crypto.getRandomValues(new Uint32Array(k));\r\n\r\n for (; i < k;) {\r\n n = d[i];\r\n\r\n // 0 <= n < 4294967296\r\n // Probability n >= 4.29e9, is 4967296 / 4294967296 = 0.00116 (1 in 865).\r\n if (n >= 4.29e9) {\r\n d[i] = crypto.getRandomValues(new Uint32Array(1))[0];\r\n } else {\r\n\r\n // 0 <= n <= 4289999999\r\n // 0 <= (n % 1e7) <= 9999999\r\n rd[i++] = n % 1e7;\r\n }\r\n }\r\n\r\n // Node.js supporting crypto.randomBytes.\r\n } else if (crypto.randomBytes) {\r\n\r\n // buffer\r\n d = crypto.randomBytes(k *= 4);\r\n\r\n for (; i < k;) {\r\n\r\n // 0 <= n < 2147483648\r\n n = d[i] + (d[i + 1] << 8) + (d[i + 2] << 16) + ((d[i + 3] & 0x7f) << 24);\r\n\r\n // Probability n >= 2.14e9, is 7483648 / 2147483648 = 0.0035 (1 in 286).\r\n if (n >= 2.14e9) {\r\n crypto.randomBytes(4).copy(d, i);\r\n } else {\r\n\r\n // 0 <= n <= 2139999999\r\n // 0 <= (n % 1e7) <= 9999999\r\n rd.push(n % 1e7);\r\n i += 4;\r\n }\r\n }\r\n\r\n i = k / 4;\r\n } else {\r\n throw Error(cryptoUnavailable);\r\n }\r\n\r\n k = rd[--i];\r\n sd %= LOG_BASE;\r\n\r\n // Convert trailing digits to zeros according to sd.\r\n if (k && sd) {\r\n n = mathpow(10, LOG_BASE - sd);\r\n rd[i] = (k / n | 0) * n;\r\n }\r\n\r\n // Remove trailing words which are zero.\r\n for (; rd[i] === 0; i--) rd.pop();\r\n\r\n // Zero?\r\n if (i < 0) {\r\n e = 0;\r\n rd = [0];\r\n } else {\r\n e = -1;\r\n\r\n // Remove leading words which are zero and adjust exponent accordingly.\r\n for (; rd[0] === 0; e -= LOG_BASE) rd.shift();\r\n\r\n // Count the digits of the first word of rd to determine leading zeros.\r\n for (k = 1, n = rd[0]; n >= 10; n /= 10) k++;\r\n\r\n // Adjust the exponent for leading zeros of the first word of rd.\r\n if (k < LOG_BASE) e -= LOG_BASE - k;\r\n }\r\n\r\n r.e = e;\r\n r.d = rd;\r\n\r\n return r;\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is `x` rounded to an integer using rounding mode `rounding`.\r\n *\r\n * To emulate `Math.round`, set rounding to 7 (ROUND_HALF_CEIL).\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\n function round(x) {\r\n return finalise(x = new this(x), x.e + 1, this.rounding);\r\n }\r\n\r\n\r\n /*\r\n * Return\r\n * 1 if x > 0,\r\n * -1 if x < 0,\r\n * 0 if x is 0,\r\n * -0 if x is -0,\r\n * NaN otherwise\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\n function sign(x) {\r\n x = new this(x);\r\n return x.d ? (x.d[0] ? x.s : 0 * x.s) : x.s || NaN;\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the sine of `x`, rounded to `precision` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\n function sin(x) {\r\n return new this(x).sin();\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the hyperbolic sine of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\n function sinh(x) {\r\n return new this(x).sinh();\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the square root of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\n function sqrt(x) {\r\n return new this(x).sqrt();\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is `x` minus `y`, rounded to `precision` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\n function sub(x, y) {\r\n return new this(x).sub(y);\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the sum of the arguments, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * Only the result is rounded, not the intermediate calculations.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\n */\r\n function sum() {\r\n var i = 0,\r\n args = arguments,\r\n x = new this(args[i]);\r\n\r\n external = false;\r\n for (; x.s && ++i < args.length;) x = x.plus(args[i]);\r\n external = true;\r\n\r\n return finalise(x, this.precision, this.rounding);\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the tangent of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\n function tan(x) {\r\n return new this(x).tan();\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the hyperbolic tangent of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\n function tanh(x) {\r\n return new this(x).tanh();\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is `x` truncated to an integer.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\n function trunc(x) {\r\n return finalise(x = new this(x), x.e + 1, 1);\r\n }\r\n\r\n\r\n // Create and configure initial Decimal constructor.\r\n Decimal = clone(DEFAULTS);\r\n Decimal.prototype.constructor = Decimal;\r\n Decimal['default'] = Decimal.Decimal = Decimal;\r\n\r\n // Create the internal constants from their string values.\r\n LN10 = new Decimal(LN10);\r\n PI = new Decimal(PI);\r\n\r\n\r\n // Export.\r\n\r\n\r\n // AMD.\r\n if (typeof define == 'function' && define.amd) {\r\n define(function () {\r\n return Decimal;\r\n });\r\n\r\n // Node and other environments that support module.exports.\r\n } else if (typeof module != 'undefined' && module.exports) {\r\n if (typeof Symbol == 'function' && typeof Symbol.iterator == 'symbol') {\r\n P[Symbol['for']('nodejs.util.inspect.custom')] = P.toString;\r\n P[Symbol.toStringTag] = 'Decimal';\r\n }\r\n\r\n module.exports = Decimal;\r\n\r\n // Browser.\r\n } else {\r\n if (!globalScope) {\r\n globalScope = typeof self != 'undefined' && self && self.self == self ? self : window;\r\n }\r\n\r\n noConflict = globalScope.Decimal;\r\n Decimal.noConflict = function () {\r\n globalScope.Decimal = noConflict;\r\n return Decimal;\r\n };\r\n\r\n globalScope.Decimal = Decimal;\r\n }\r\n})(this);\r\n","var Stream = require('stream').Stream;\nvar util = require('util');\n\nmodule.exports = DelayedStream;\nfunction DelayedStream() {\n this.source = null;\n this.dataSize = 0;\n this.maxDataSize = 1024 * 1024;\n this.pauseStream = true;\n\n this._maxDataSizeExceeded = false;\n this._released = false;\n this._bufferedEvents = [];\n}\nutil.inherits(DelayedStream, Stream);\n\nDelayedStream.create = function(source, options) {\n var delayedStream = new this();\n\n options = options || {};\n for (var option in options) {\n delayedStream[option] = options[option];\n }\n\n delayedStream.source = source;\n\n var realEmit = source.emit;\n source.emit = function() {\n delayedStream._handleEmit(arguments);\n return realEmit.apply(source, arguments);\n };\n\n source.on('error', function() {});\n if (delayedStream.pauseStream) {\n source.pause();\n }\n\n return delayedStream;\n};\n\nObject.defineProperty(DelayedStream.prototype, 'readable', {\n configurable: true,\n enumerable: true,\n get: function() {\n return this.source.readable;\n }\n});\n\nDelayedStream.prototype.setEncoding = function() {\n return this.source.setEncoding.apply(this.source, arguments);\n};\n\nDelayedStream.prototype.resume = function() {\n if (!this._released) {\n this.release();\n }\n\n this.source.resume();\n};\n\nDelayedStream.prototype.pause = function() {\n this.source.pause();\n};\n\nDelayedStream.prototype.release = function() {\n this._released = true;\n\n this._bufferedEvents.forEach(function(args) {\n this.emit.apply(this, args);\n }.bind(this));\n this._bufferedEvents = [];\n};\n\nDelayedStream.prototype.pipe = function() {\n var r = Stream.prototype.pipe.apply(this, arguments);\n this.resume();\n return r;\n};\n\nDelayedStream.prototype._handleEmit = function(args) {\n if (this._released) {\n this.emit.apply(this, args);\n return;\n }\n\n if (args[0] === 'data') {\n this.dataSize += args[1].length;\n this._checkIfMaxDataSizeExceeded();\n }\n\n this._bufferedEvents.push(args);\n};\n\nDelayedStream.prototype._checkIfMaxDataSizeExceeded = function() {\n if (this._maxDataSizeExceeded) {\n return;\n }\n\n if (this.dataSize <= this.maxDataSize) {\n return;\n }\n\n this._maxDataSizeExceeded = true;\n var message =\n 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'\n this.emit('error', new Error(message));\n};\n","\"use strict\";\nconst legacyErrorCodes = require(\"./legacy-error-codes.json\");\nconst idlUtils = require(\"./utils.js\");\n\nexports.implementation = class DOMExceptionImpl {\n constructor(globalObject, [message, name]) {\n this.name = name;\n this.message = message;\n }\n\n get code() {\n return legacyErrorCodes[this.name] || 0;\n }\n};\n\n// A proprietary V8 extension that causes the stack property to appear.\nexports.init = impl => {\n if (Error.captureStackTrace) {\n const wrapper = idlUtils.wrapperForImpl(impl);\n Error.captureStackTrace(wrapper, wrapper.constructor);\n }\n};\n","\"use strict\";\n\nconst conversions = require(\"webidl-conversions\");\nconst utils = require(\"./utils.js\");\n\nconst impl = utils.implSymbol;\nconst ctorRegistry = utils.ctorRegistrySymbol;\n\nconst iface = {\n // When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`\n // method into this array. It allows objects that directly implements *those* interfaces to be recognized as\n // implementing this mixin interface.\n _mixedIntoPredicates: [],\n is(obj) {\n if (obj) {\n if (utils.hasOwn(obj, impl) && obj[impl] instanceof Impl.implementation) {\n return true;\n }\n for (const isMixedInto of module.exports._mixedIntoPredicates) {\n if (isMixedInto(obj)) {\n return true;\n }\n }\n }\n return false;\n },\n isImpl(obj) {\n if (obj) {\n if (obj instanceof Impl.implementation) {\n return true;\n }\n\n const wrapper = utils.wrapperForImpl(obj);\n for (const isMixedInto of module.exports._mixedIntoPredicates) {\n if (isMixedInto(wrapper)) {\n return true;\n }\n }\n }\n return false;\n },\n convert(obj, { context = \"The provided value\" } = {}) {\n if (module.exports.is(obj)) {\n return utils.implForWrapper(obj);\n }\n throw new TypeError(`${context} is not of type 'DOMException'.`);\n },\n\n create(globalObject, constructorArgs, privateData) {\n if (globalObject[ctorRegistry] === undefined) {\n throw new Error(\"Internal error: invalid global object\");\n }\n\n const ctor = globalObject[ctorRegistry][\"DOMException\"];\n if (ctor === undefined) {\n throw new Error(\"Internal error: constructor DOMException is not installed on the passed global object\");\n }\n\n let obj = Object.create(ctor.prototype);\n obj = iface.setup(obj, globalObject, constructorArgs, privateData);\n return obj;\n },\n createImpl(globalObject, constructorArgs, privateData) {\n const obj = iface.create(globalObject, constructorArgs, privateData);\n return utils.implForWrapper(obj);\n },\n _internalSetup(obj) {},\n setup(obj, globalObject, constructorArgs = [], privateData = {}) {\n privateData.wrapper = obj;\n\n iface._internalSetup(obj);\n Object.defineProperty(obj, impl, {\n value: new Impl.implementation(globalObject, constructorArgs, privateData),\n configurable: true\n });\n\n obj[impl][utils.wrapperSymbol] = obj;\n if (Impl.init) {\n Impl.init(obj[impl], privateData);\n }\n return obj;\n },\n\n install(globalObject) {\n class DOMException {\n constructor() {\n const args = [];\n {\n let curArg = arguments[0];\n if (curArg !== undefined) {\n curArg = conversions[\"DOMString\"](curArg, { context: \"Failed to construct 'DOMException': parameter 1\" });\n } else {\n curArg = \"\";\n }\n args.push(curArg);\n }\n {\n let curArg = arguments[1];\n if (curArg !== undefined) {\n curArg = conversions[\"DOMString\"](curArg, { context: \"Failed to construct 'DOMException': parameter 2\" });\n } else {\n curArg = \"Error\";\n }\n args.push(curArg);\n }\n return iface.setup(Object.create(new.target.prototype), globalObject, args);\n }\n\n get name() {\n if (!this || !module.exports.is(this)) {\n throw new TypeError(\"Illegal invocation\");\n }\n\n return this[impl][\"name\"];\n }\n\n get message() {\n if (!this || !module.exports.is(this)) {\n throw new TypeError(\"Illegal invocation\");\n }\n\n return this[impl][\"message\"];\n }\n\n get code() {\n if (!this || !module.exports.is(this)) {\n throw new TypeError(\"Illegal invocation\");\n }\n\n return this[impl][\"code\"];\n }\n }\n Object.defineProperties(DOMException.prototype, {\n name: { enumerable: true },\n message: { enumerable: true },\n code: { enumerable: true },\n [Symbol.toStringTag]: { value: \"DOMException\", configurable: true },\n INDEX_SIZE_ERR: { value: 1, enumerable: true },\n DOMSTRING_SIZE_ERR: { value: 2, enumerable: true },\n HIERARCHY_REQUEST_ERR: { value: 3, enumerable: true },\n WRONG_DOCUMENT_ERR: { value: 4, enumerable: true },\n INVALID_CHARACTER_ERR: { value: 5, enumerable: true },\n NO_DATA_ALLOWED_ERR: { value: 6, enumerable: true },\n NO_MODIFICATION_ALLOWED_ERR: { value: 7, enumerable: true },\n NOT_FOUND_ERR: { value: 8, enumerable: true },\n NOT_SUPPORTED_ERR: { value: 9, enumerable: true },\n INUSE_ATTRIBUTE_ERR: { value: 10, enumerable: true },\n INVALID_STATE_ERR: { value: 11, enumerable: true },\n SYNTAX_ERR: { value: 12, enumerable: true },\n INVALID_MODIFICATION_ERR: { value: 13, enumerable: true },\n NAMESPACE_ERR: { value: 14, enumerable: true },\n INVALID_ACCESS_ERR: { value: 15, enumerable: true },\n VALIDATION_ERR: { value: 16, enumerable: true },\n TYPE_MISMATCH_ERR: { value: 17, enumerable: true },\n SECURITY_ERR: { value: 18, enumerable: true },\n NETWORK_ERR: { value: 19, enumerable: true },\n ABORT_ERR: { value: 20, enumerable: true },\n URL_MISMATCH_ERR: { value: 21, enumerable: true },\n QUOTA_EXCEEDED_ERR: { value: 22, enumerable: true },\n TIMEOUT_ERR: { value: 23, enumerable: true },\n INVALID_NODE_TYPE_ERR: { value: 24, enumerable: true },\n DATA_CLONE_ERR: { value: 25, enumerable: true }\n });\n Object.defineProperties(DOMException, {\n INDEX_SIZE_ERR: { value: 1, enumerable: true },\n DOMSTRING_SIZE_ERR: { value: 2, enumerable: true },\n HIERARCHY_REQUEST_ERR: { value: 3, enumerable: true },\n WRONG_DOCUMENT_ERR: { value: 4, enumerable: true },\n INVALID_CHARACTER_ERR: { value: 5, enumerable: true },\n NO_DATA_ALLOWED_ERR: { value: 6, enumerable: true },\n NO_MODIFICATION_ALLOWED_ERR: { value: 7, enumerable: true },\n NOT_FOUND_ERR: { value: 8, enumerable: true },\n NOT_SUPPORTED_ERR: { value: 9, enumerable: true },\n INUSE_ATTRIBUTE_ERR: { value: 10, enumerable: true },\n INVALID_STATE_ERR: { value: 11, enumerable: true },\n SYNTAX_ERR: { value: 12, enumerable: true },\n INVALID_MODIFICATION_ERR: { value: 13, enumerable: true },\n NAMESPACE_ERR: { value: 14, enumerable: true },\n INVALID_ACCESS_ERR: { value: 15, enumerable: true },\n VALIDATION_ERR: { value: 16, enumerable: true },\n TYPE_MISMATCH_ERR: { value: 17, enumerable: true },\n SECURITY_ERR: { value: 18, enumerable: true },\n NETWORK_ERR: { value: 19, enumerable: true },\n ABORT_ERR: { value: 20, enumerable: true },\n URL_MISMATCH_ERR: { value: 21, enumerable: true },\n QUOTA_EXCEEDED_ERR: { value: 22, enumerable: true },\n TIMEOUT_ERR: { value: 23, enumerable: true },\n INVALID_NODE_TYPE_ERR: { value: 24, enumerable: true },\n DATA_CLONE_ERR: { value: 25, enumerable: true }\n });\n if (globalObject[ctorRegistry] === undefined) {\n globalObject[ctorRegistry] = Object.create(null);\n }\n globalObject[ctorRegistry][\"DOMException\"] = DOMException;\n\n Object.defineProperty(globalObject, \"DOMException\", {\n configurable: true,\n writable: true,\n value: DOMException\n });\n }\n}; // iface\nmodule.exports = iface;\n\nconst Impl = require(\"./DOMException-impl.js\");\n","\"use strict\";\n\n// Returns \"Type(value) is Object\" in ES terminology.\nfunction isObject(value) {\n return typeof value === \"object\" && value !== null || typeof value === \"function\";\n}\n\nfunction hasOwn(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nconst wrapperSymbol = Symbol(\"wrapper\");\nconst implSymbol = Symbol(\"impl\");\nconst sameObjectCaches = Symbol(\"SameObject caches\");\nconst ctorRegistrySymbol = Symbol.for(\"[webidl2js] constructor registry\");\n\nfunction getSameObject(wrapper, prop, creator) {\n if (!wrapper[sameObjectCaches]) {\n wrapper[sameObjectCaches] = Object.create(null);\n }\n\n if (prop in wrapper[sameObjectCaches]) {\n return wrapper[sameObjectCaches][prop];\n }\n\n wrapper[sameObjectCaches][prop] = creator();\n return wrapper[sameObjectCaches][prop];\n}\n\nfunction wrapperForImpl(impl) {\n return impl ? impl[wrapperSymbol] : null;\n}\n\nfunction implForWrapper(wrapper) {\n return wrapper ? wrapper[implSymbol] : null;\n}\n\nfunction tryWrapperForImpl(impl) {\n const wrapper = wrapperForImpl(impl);\n return wrapper ? wrapper : impl;\n}\n\nfunction tryImplForWrapper(wrapper) {\n const impl = implForWrapper(wrapper);\n return impl ? impl : wrapper;\n}\n\nconst iterInternalSymbol = Symbol(\"internal\");\nconst IteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));\n\nfunction isArrayIndexPropName(P) {\n if (typeof P !== \"string\") {\n return false;\n }\n const i = P >>> 0;\n if (i === Math.pow(2, 32) - 1) {\n return false;\n }\n const s = `${i}`;\n if (P !== s) {\n return false;\n }\n return true;\n}\n\nconst byteLengthGetter =\n Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, \"byteLength\").get;\nfunction isArrayBuffer(value) {\n try {\n byteLengthGetter.call(value);\n return true;\n } catch (e) {\n return false;\n }\n}\n\nconst supportsPropertyIndex = Symbol(\"supports property index\");\nconst supportedPropertyIndices = Symbol(\"supported property indices\");\nconst supportsPropertyName = Symbol(\"supports property name\");\nconst supportedPropertyNames = Symbol(\"supported property names\");\nconst indexedGet = Symbol(\"indexed property get\");\nconst indexedSetNew = Symbol(\"indexed property set new\");\nconst indexedSetExisting = Symbol(\"indexed property set existing\");\nconst namedGet = Symbol(\"named property get\");\nconst namedSetNew = Symbol(\"named property set new\");\nconst namedSetExisting = Symbol(\"named property set existing\");\nconst namedDelete = Symbol(\"named property delete\");\n\nmodule.exports = exports = {\n isObject,\n hasOwn,\n wrapperSymbol,\n implSymbol,\n getSameObject,\n ctorRegistrySymbol,\n wrapperForImpl,\n implForWrapper,\n tryWrapperForImpl,\n tryImplForWrapper,\n iterInternalSymbol,\n IteratorPrototype,\n isArrayBuffer,\n isArrayIndexPropName,\n supportsPropertyIndex,\n supportedPropertyIndices,\n supportsPropertyName,\n supportedPropertyNames,\n indexedGet,\n indexedSetNew,\n indexedSetExisting,\n namedGet,\n namedSetNew,\n namedSetExisting,\n namedDelete\n};\n","\"use strict\";\n\nfunction _(message, opts) {\n return `${opts && opts.context ? opts.context : \"Value\"} ${message}.`;\n}\n\nfunction type(V) {\n if (V === null) {\n return \"Null\";\n }\n switch (typeof V) {\n case \"undefined\":\n return \"Undefined\";\n case \"boolean\":\n return \"Boolean\";\n case \"number\":\n return \"Number\";\n case \"string\":\n return \"String\";\n case \"symbol\":\n return \"Symbol\";\n case \"object\":\n // Falls through\n case \"function\":\n // Falls through\n default:\n // Per ES spec, typeof returns an implemention-defined value that is not any of the existing ones for\n // uncallable non-standard exotic objects. Yet Type() which the Web IDL spec depends on returns Object for\n // such cases. So treat the default case as an object.\n return \"Object\";\n }\n}\n\n// Round x to the nearest integer, choosing the even integer if it lies halfway between two.\nfunction evenRound(x) {\n // There are four cases for numbers with fractional part being .5:\n //\n // case | x | floor(x) | round(x) | expected | x <> 0 | x % 1 | x & 1 | example\n // 1 | 2n + 0.5 | 2n | 2n + 1 | 2n | > | 0.5 | 0 | 0.5 -> 0\n // 2 | 2n + 1.5 | 2n + 1 | 2n + 2 | 2n + 2 | > | 0.5 | 1 | 1.5 -> 2\n // 3 | -2n - 0.5 | -2n - 1 | -2n | -2n | < | -0.5 | 0 | -0.5 -> 0\n // 4 | -2n - 1.5 | -2n - 2 | -2n - 1 | -2n - 2 | < | -0.5 | 1 | -1.5 -> -2\n // (where n is a non-negative integer)\n //\n // Branch here for cases 1 and 4\n if ((x > 0 && (x % 1) === +0.5 && (x & 1) === 0) ||\n (x < 0 && (x % 1) === -0.5 && (x & 1) === 1)) {\n return censorNegativeZero(Math.floor(x));\n }\n\n return censorNegativeZero(Math.round(x));\n}\n\nfunction integerPart(n) {\n return censorNegativeZero(Math.trunc(n));\n}\n\nfunction sign(x) {\n return x < 0 ? -1 : 1;\n}\n\nfunction modulo(x, y) {\n // https://tc39.github.io/ecma262/#eqn-modulo\n // Note that http://stackoverflow.com/a/4467559/3191 does NOT work for large modulos\n const signMightNotMatch = x % y;\n if (sign(y) !== sign(signMightNotMatch)) {\n return signMightNotMatch + y;\n }\n return signMightNotMatch;\n}\n\nfunction censorNegativeZero(x) {\n return x === 0 ? 0 : x;\n}\n\nfunction createIntegerConversion(bitLength, typeOpts) {\n const isSigned = !typeOpts.unsigned;\n\n let lowerBound;\n let upperBound;\n if (bitLength === 64) {\n upperBound = Math.pow(2, 53) - 1;\n lowerBound = !isSigned ? 0 : -Math.pow(2, 53) + 1;\n } else if (!isSigned) {\n lowerBound = 0;\n upperBound = Math.pow(2, bitLength) - 1;\n } else {\n lowerBound = -Math.pow(2, bitLength - 1);\n upperBound = Math.pow(2, bitLength - 1) - 1;\n }\n\n const twoToTheBitLength = Math.pow(2, bitLength);\n const twoToOneLessThanTheBitLength = Math.pow(2, bitLength - 1);\n\n return (V, opts) => {\n if (opts === undefined) {\n opts = {};\n }\n\n let x = +V;\n x = censorNegativeZero(x); // Spec discussion ongoing: https://github.com/heycam/webidl/issues/306\n\n if (opts.enforceRange) {\n if (!Number.isFinite(x)) {\n throw new TypeError(_(\"is not a finite number\", opts));\n }\n\n x = integerPart(x);\n\n if (x < lowerBound || x > upperBound) {\n throw new TypeError(_(\n `is outside the accepted range of ${lowerBound} to ${upperBound}, inclusive`, opts));\n }\n\n return x;\n }\n\n if (!Number.isNaN(x) && opts.clamp) {\n x = Math.min(Math.max(x, lowerBound), upperBound);\n x = evenRound(x);\n return x;\n }\n\n if (!Number.isFinite(x) || x === 0) {\n return 0;\n }\n x = integerPart(x);\n\n // Math.pow(2, 64) is not accurately representable in JavaScript, so try to avoid these per-spec operations if\n // possible. Hopefully it's an optimization for the non-64-bitLength cases too.\n if (x >= lowerBound && x <= upperBound) {\n return x;\n }\n\n // These will not work great for bitLength of 64, but oh well. See the README for more details.\n x = modulo(x, twoToTheBitLength);\n if (isSigned && x >= twoToOneLessThanTheBitLength) {\n return x - twoToTheBitLength;\n }\n return x;\n };\n}\n\nexports.any = V => {\n return V;\n};\n\nexports.void = function () {\n return undefined;\n};\n\nexports.boolean = function (val) {\n return !!val;\n};\n\nexports.byte = createIntegerConversion(8, { unsigned: false });\nexports.octet = createIntegerConversion(8, { unsigned: true });\n\nexports.short = createIntegerConversion(16, { unsigned: false });\nexports[\"unsigned short\"] = createIntegerConversion(16, { unsigned: true });\n\nexports.long = createIntegerConversion(32, { unsigned: false });\nexports[\"unsigned long\"] = createIntegerConversion(32, { unsigned: true });\n\nexports[\"long long\"] = createIntegerConversion(64, { unsigned: false });\nexports[\"unsigned long long\"] = createIntegerConversion(64, { unsigned: true });\n\nexports.double = (V, opts) => {\n const x = +V;\n\n if (!Number.isFinite(x)) {\n throw new TypeError(_(\"is not a finite floating-point value\", opts));\n }\n\n return x;\n};\n\nexports[\"unrestricted double\"] = V => {\n const x = +V;\n\n return x;\n};\n\nexports.float = (V, opts) => {\n const x = +V;\n\n if (!Number.isFinite(x)) {\n throw new TypeError(_(\"is not a finite floating-point value\", opts));\n }\n\n if (Object.is(x, -0)) {\n return x;\n }\n\n const y = Math.fround(x);\n\n if (!Number.isFinite(y)) {\n throw new TypeError(_(\"is outside the range of a single-precision floating-point value\", opts));\n }\n\n return y;\n};\n\nexports[\"unrestricted float\"] = V => {\n const x = +V;\n\n if (isNaN(x)) {\n return x;\n }\n\n if (Object.is(x, -0)) {\n return x;\n }\n\n return Math.fround(x);\n};\n\nexports.DOMString = function (V, opts) {\n if (opts === undefined) {\n opts = {};\n }\n\n if (opts.treatNullAsEmptyString && V === null) {\n return \"\";\n }\n\n if (typeof V === \"symbol\") {\n throw new TypeError(_(\"is a symbol, which cannot be converted to a string\", opts));\n }\n\n return String(V);\n};\n\nexports.ByteString = (V, opts) => {\n const x = exports.DOMString(V, opts);\n let c;\n for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) {\n if (c > 255) {\n throw new TypeError(_(\"is not a valid ByteString\", opts));\n }\n }\n\n return x;\n};\n\nexports.USVString = (V, opts) => {\n const S = exports.DOMString(V, opts);\n const n = S.length;\n const U = [];\n for (let i = 0; i < n; ++i) {\n const c = S.charCodeAt(i);\n if (c < 0xD800 || c > 0xDFFF) {\n U.push(String.fromCodePoint(c));\n } else if (0xDC00 <= c && c <= 0xDFFF) {\n U.push(String.fromCodePoint(0xFFFD));\n } else if (i === n - 1) {\n U.push(String.fromCodePoint(0xFFFD));\n } else {\n const d = S.charCodeAt(i + 1);\n if (0xDC00 <= d && d <= 0xDFFF) {\n const a = c & 0x3FF;\n const b = d & 0x3FF;\n U.push(String.fromCodePoint((2 << 15) + ((2 << 9) * a) + b));\n ++i;\n } else {\n U.push(String.fromCodePoint(0xFFFD));\n }\n }\n }\n\n return U.join(\"\");\n};\n\nexports.object = (V, opts) => {\n if (type(V) !== \"Object\") {\n throw new TypeError(_(\"is not an object\", opts));\n }\n\n return V;\n};\n\n// Not exported, but used in Function and VoidFunction.\n\n// Neither Function nor VoidFunction is defined with [TreatNonObjectAsNull], so\n// handling for that is omitted.\nfunction convertCallbackFunction(V, opts) {\n if (typeof V !== \"function\") {\n throw new TypeError(_(\"is not a function\", opts));\n }\n return V;\n}\n\nconst abByteLengthGetter =\n Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, \"byteLength\").get;\n\nfunction isArrayBuffer(V) {\n try {\n abByteLengthGetter.call(V);\n return true;\n } catch (e) {\n return false;\n }\n}\n\n// I don't think we can reliably detect detached ArrayBuffers.\nexports.ArrayBuffer = (V, opts) => {\n if (!isArrayBuffer(V)) {\n throw new TypeError(_(\"is not a view on an ArrayBuffer object\", opts));\n }\n return V;\n};\n\nconst dvByteLengthGetter =\n Object.getOwnPropertyDescriptor(DataView.prototype, \"byteLength\").get;\nexports.DataView = (V, opts) => {\n try {\n dvByteLengthGetter.call(V);\n return V;\n } catch (e) {\n throw new TypeError(_(\"is not a view on an DataView object\", opts));\n }\n};\n\n[\n Int8Array, Int16Array, Int32Array, Uint8Array,\n Uint16Array, Uint32Array, Uint8ClampedArray, Float32Array, Float64Array\n].forEach(func => {\n const name = func.name;\n const article = /^[AEIOU]/.test(name) ? \"an\" : \"a\";\n exports[name] = (V, opts) => {\n if (!ArrayBuffer.isView(V) || V.constructor.name !== name) {\n throw new TypeError(_(`is not ${article} ${name} object`, opts));\n }\n\n return V;\n };\n});\n\n// Common definitions\n\nexports.ArrayBufferView = (V, opts) => {\n if (!ArrayBuffer.isView(V)) {\n throw new TypeError(_(\"is not a view on an ArrayBuffer object\", opts));\n }\n\n return V;\n};\n\nexports.BufferSource = (V, opts) => {\n if (!ArrayBuffer.isView(V) && !isArrayBuffer(V)) {\n throw new TypeError(_(\"is not an ArrayBuffer object or a view on one\", opts));\n }\n\n return V;\n};\n\nexports.DOMTimeStamp = exports[\"unsigned long long\"];\n\nexports.Function = convertCallbackFunction;\n\nexports.VoidFunction = convertCallbackFunction;\n","\"use strict\";\nconst DOMException = require(\"./lib/DOMException.js\");\n\n// Special install function to make the DOMException inherit from Error.\n// https://heycam.github.io/webidl/#es-DOMException-specialness\nfunction installOverride(globalObject) {\n if (typeof globalObject.Error !== \"function\") {\n throw new Error(\"Internal error: Error constructor is not present on the given global object.\");\n }\n\n DOMException.install(globalObject);\n Object.setPrototypeOf(globalObject.DOMException.prototype, globalObject.Error.prototype);\n}\n\nmodule.exports = {...DOMException, install: installOverride };\n","var debug;\n\nmodule.exports = function () {\n if (!debug) {\n try {\n /* eslint global-require: off */\n debug = require(\"debug\")(\"follow-redirects\");\n }\n catch (error) { /* */ }\n if (typeof debug !== \"function\") {\n debug = function () { /* */ };\n }\n }\n debug.apply(null, arguments);\n};\n","var url = require(\"url\");\nvar URL = url.URL;\nvar http = require(\"http\");\nvar https = require(\"https\");\nvar Writable = require(\"stream\").Writable;\nvar assert = require(\"assert\");\nvar debug = require(\"./debug\");\n\n// Create handlers that pass events from native requests\nvar events = [\"abort\", \"aborted\", \"connect\", \"error\", \"socket\", \"timeout\"];\nvar eventHandlers = Object.create(null);\nevents.forEach(function (event) {\n eventHandlers[event] = function (arg1, arg2, arg3) {\n this._redirectable.emit(event, arg1, arg2, arg3);\n };\n});\n\n// Error types with codes\nvar RedirectionError = createErrorType(\n \"ERR_FR_REDIRECTION_FAILURE\",\n \"Redirected request failed\"\n);\nvar TooManyRedirectsError = createErrorType(\n \"ERR_FR_TOO_MANY_REDIRECTS\",\n \"Maximum number of redirects exceeded\"\n);\nvar MaxBodyLengthExceededError = createErrorType(\n \"ERR_FR_MAX_BODY_LENGTH_EXCEEDED\",\n \"Request body larger than maxBodyLength limit\"\n);\nvar WriteAfterEndError = createErrorType(\n \"ERR_STREAM_WRITE_AFTER_END\",\n \"write after end\"\n);\n\n// An HTTP(S) request that can be redirected\nfunction RedirectableRequest(options, responseCallback) {\n // Initialize the request\n Writable.call(this);\n this._sanitizeOptions(options);\n this._options = options;\n this._ended = false;\n this._ending = false;\n this._redirectCount = 0;\n this._redirects = [];\n this._requestBodyLength = 0;\n this._requestBodyBuffers = [];\n\n // Attach a callback if passed\n if (responseCallback) {\n this.on(\"response\", responseCallback);\n }\n\n // React to responses of native requests\n var self = this;\n this._onNativeResponse = function (response) {\n self._processResponse(response);\n };\n\n // Perform the first request\n this._performRequest();\n}\nRedirectableRequest.prototype = Object.create(Writable.prototype);\n\nRedirectableRequest.prototype.abort = function () {\n abortRequest(this._currentRequest);\n this.emit(\"abort\");\n};\n\n// Writes buffered data to the current native request\nRedirectableRequest.prototype.write = function (data, encoding, callback) {\n // Writing is not allowed if end has been called\n if (this._ending) {\n throw new WriteAfterEndError();\n }\n\n // Validate input and shift parameters if necessary\n if (!(typeof data === \"string\" || typeof data === \"object\" && (\"length\" in data))) {\n throw new TypeError(\"data should be a string, Buffer or Uint8Array\");\n }\n if (typeof encoding === \"function\") {\n callback = encoding;\n encoding = null;\n }\n\n // Ignore empty buffers, since writing them doesn't invoke the callback\n // https://github.com/nodejs/node/issues/22066\n if (data.length === 0) {\n if (callback) {\n callback();\n }\n return;\n }\n // Only write when we don't exceed the maximum body length\n if (this._requestBodyLength + data.length <= this._options.maxBodyLength) {\n this._requestBodyLength += data.length;\n this._requestBodyBuffers.push({ data: data, encoding: encoding });\n this._currentRequest.write(data, encoding, callback);\n }\n // Error when we exceed the maximum body length\n else {\n this.emit(\"error\", new MaxBodyLengthExceededError());\n this.abort();\n }\n};\n\n// Ends the current native request\nRedirectableRequest.prototype.end = function (data, encoding, callback) {\n // Shift parameters if necessary\n if (typeof data === \"function\") {\n callback = data;\n data = encoding = null;\n }\n else if (typeof encoding === \"function\") {\n callback = encoding;\n encoding = null;\n }\n\n // Write data if needed and end\n if (!data) {\n this._ended = this._ending = true;\n this._currentRequest.end(null, null, callback);\n }\n else {\n var self = this;\n var currentRequest = this._currentRequest;\n this.write(data, encoding, function () {\n self._ended = true;\n currentRequest.end(null, null, callback);\n });\n this._ending = true;\n }\n};\n\n// Sets a header value on the current native request\nRedirectableRequest.prototype.setHeader = function (name, value) {\n this._options.headers[name] = value;\n this._currentRequest.setHeader(name, value);\n};\n\n// Clears a header value on the current native request\nRedirectableRequest.prototype.removeHeader = function (name) {\n delete this._options.headers[name];\n this._currentRequest.removeHeader(name);\n};\n\n// Global timeout for all underlying requests\nRedirectableRequest.prototype.setTimeout = function (msecs, callback) {\n var self = this;\n\n // Destroys the socket on timeout\n function destroyOnTimeout(socket) {\n socket.setTimeout(msecs);\n socket.removeListener(\"timeout\", socket.destroy);\n socket.addListener(\"timeout\", socket.destroy);\n }\n\n // Sets up a timer to trigger a timeout event\n function startTimer(socket) {\n if (self._timeout) {\n clearTimeout(self._timeout);\n }\n self._timeout = setTimeout(function () {\n self.emit(\"timeout\");\n clearTimer();\n }, msecs);\n destroyOnTimeout(socket);\n }\n\n // Stops a timeout from triggering\n function clearTimer() {\n // Clear the timeout\n if (self._timeout) {\n clearTimeout(self._timeout);\n self._timeout = null;\n }\n\n // Clean up all attached listeners\n self.removeListener(\"abort\", clearTimer);\n self.removeListener(\"error\", clearTimer);\n self.removeListener(\"response\", clearTimer);\n if (callback) {\n self.removeListener(\"timeout\", callback);\n }\n if (!self.socket) {\n self._currentRequest.removeListener(\"socket\", startTimer);\n }\n }\n\n // Attach callback if passed\n if (callback) {\n this.on(\"timeout\", callback);\n }\n\n // Start the timer if or when the socket is opened\n if (this.socket) {\n startTimer(this.socket);\n }\n else {\n this._currentRequest.once(\"socket\", startTimer);\n }\n\n // Clean up on events\n this.on(\"socket\", destroyOnTimeout);\n this.on(\"abort\", clearTimer);\n this.on(\"error\", clearTimer);\n this.on(\"response\", clearTimer);\n\n return this;\n};\n\n// Proxy all other public ClientRequest methods\n[\n \"flushHeaders\", \"getHeader\",\n \"setNoDelay\", \"setSocketKeepAlive\",\n].forEach(function (method) {\n RedirectableRequest.prototype[method] = function (a, b) {\n return this._currentRequest[method](a, b);\n };\n});\n\n// Proxy all public ClientRequest properties\n[\"aborted\", \"connection\", \"socket\"].forEach(function (property) {\n Object.defineProperty(RedirectableRequest.prototype, property, {\n get: function () { return this._currentRequest[property]; },\n });\n});\n\nRedirectableRequest.prototype._sanitizeOptions = function (options) {\n // Ensure headers are always present\n if (!options.headers) {\n options.headers = {};\n }\n\n // Since http.request treats host as an alias of hostname,\n // but the url module interprets host as hostname plus port,\n // eliminate the host property to avoid confusion.\n if (options.host) {\n // Use hostname if set, because it has precedence\n if (!options.hostname) {\n options.hostname = options.host;\n }\n delete options.host;\n }\n\n // Complete the URL object when necessary\n if (!options.pathname && options.path) {\n var searchPos = options.path.indexOf(\"?\");\n if (searchPos < 0) {\n options.pathname = options.path;\n }\n else {\n options.pathname = options.path.substring(0, searchPos);\n options.search = options.path.substring(searchPos);\n }\n }\n};\n\n\n// Executes the next native request (initial or redirect)\nRedirectableRequest.prototype._performRequest = function () {\n // Load the native protocol\n var protocol = this._options.protocol;\n var nativeProtocol = this._options.nativeProtocols[protocol];\n if (!nativeProtocol) {\n this.emit(\"error\", new TypeError(\"Unsupported protocol \" + protocol));\n return;\n }\n\n // If specified, use the agent corresponding to the protocol\n // (HTTP and HTTPS use different types of agents)\n if (this._options.agents) {\n var scheme = protocol.substr(0, protocol.length - 1);\n this._options.agent = this._options.agents[scheme];\n }\n\n // Create the native request\n var request = this._currentRequest =\n nativeProtocol.request(this._options, this._onNativeResponse);\n this._currentUrl = url.format(this._options);\n\n // Set up event handlers\n request._redirectable = this;\n for (var e = 0; e < events.length; e++) {\n request.on(events[e], eventHandlers[events[e]]);\n }\n\n // End a redirected request\n // (The first request must be ended explicitly with RedirectableRequest#end)\n if (this._isRedirect) {\n // Write the request entity and end.\n var i = 0;\n var self = this;\n var buffers = this._requestBodyBuffers;\n (function writeNext(error) {\n // Only write if this request has not been redirected yet\n /* istanbul ignore else */\n if (request === self._currentRequest) {\n // Report any write errors\n /* istanbul ignore if */\n if (error) {\n self.emit(\"error\", error);\n }\n // Write the next buffer if there are still left\n else if (i < buffers.length) {\n var buffer = buffers[i++];\n /* istanbul ignore else */\n if (!request.finished) {\n request.write(buffer.data, buffer.encoding, writeNext);\n }\n }\n // End the request if `end` has been called on us\n else if (self._ended) {\n request.end();\n }\n }\n }());\n }\n};\n\n// Processes a response from the current native request\nRedirectableRequest.prototype._processResponse = function (response) {\n // Store the redirected response\n var statusCode = response.statusCode;\n if (this._options.trackRedirects) {\n this._redirects.push({\n url: this._currentUrl,\n headers: response.headers,\n statusCode: statusCode,\n });\n }\n\n // RFC7231§6.4: The 3xx (Redirection) class of status code indicates\n // that further action needs to be taken by the user agent in order to\n // fulfill the request. If a Location header field is provided,\n // the user agent MAY automatically redirect its request to the URI\n // referenced by the Location field value,\n // even if the specific status code is not understood.\n\n // If the response is not a redirect; return it as-is\n var location = response.headers.location;\n if (!location || this._options.followRedirects === false ||\n statusCode < 300 || statusCode >= 400) {\n response.responseUrl = this._currentUrl;\n response.redirects = this._redirects;\n this.emit(\"response\", response);\n\n // Clean up\n this._requestBodyBuffers = [];\n return;\n }\n\n // The response is a redirect, so abort the current request\n abortRequest(this._currentRequest);\n // Discard the remainder of the response to avoid waiting for data\n response.destroy();\n\n // RFC7231§6.4: A client SHOULD detect and intervene\n // in cyclical redirections (i.e., \"infinite\" redirection loops).\n if (++this._redirectCount > this._options.maxRedirects) {\n this.emit(\"error\", new TooManyRedirectsError());\n return;\n }\n\n // RFC7231§6.4: Automatic redirection needs to done with\n // care for methods not known to be safe, […]\n // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change\n // the request method from POST to GET for the subsequent request.\n if ((statusCode === 301 || statusCode === 302) && this._options.method === \"POST\" ||\n // RFC7231§6.4.4: The 303 (See Other) status code indicates that\n // the server is redirecting the user agent to a different resource […]\n // A user agent can perform a retrieval request targeting that URI\n // (a GET or HEAD request if using HTTP) […]\n (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) {\n this._options.method = \"GET\";\n // Drop a possible entity and headers related to it\n this._requestBodyBuffers = [];\n removeMatchingHeaders(/^content-/i, this._options.headers);\n }\n\n // Drop the Host header, as the redirect might lead to a different host\n var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);\n\n // If the redirect is relative, carry over the host of the last request\n var currentUrlParts = url.parse(this._currentUrl);\n var currentHost = currentHostHeader || currentUrlParts.host;\n var currentUrl = /^\\w+:/.test(location) ? this._currentUrl :\n url.format(Object.assign(currentUrlParts, { host: currentHost }));\n\n // Determine the URL of the redirection\n var redirectUrl;\n try {\n redirectUrl = url.resolve(currentUrl, location);\n }\n catch (cause) {\n this.emit(\"error\", new RedirectionError(cause));\n return;\n }\n\n // Create the redirected request\n debug(\"redirecting to\", redirectUrl);\n this._isRedirect = true;\n var redirectUrlParts = url.parse(redirectUrl);\n Object.assign(this._options, redirectUrlParts);\n\n // Drop confidential headers when redirecting to a less secure protocol\n // or to a different domain that is not a superdomain\n if (redirectUrlParts.protocol !== currentUrlParts.protocol &&\n redirectUrlParts.protocol !== \"https:\" ||\n redirectUrlParts.host !== currentHost &&\n !isSubdomain(redirectUrlParts.host, currentHost)) {\n removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers);\n }\n\n // Evaluate the beforeRedirect callback\n if (typeof this._options.beforeRedirect === \"function\") {\n var responseDetails = { headers: response.headers };\n try {\n this._options.beforeRedirect.call(null, this._options, responseDetails);\n }\n catch (err) {\n this.emit(\"error\", err);\n return;\n }\n this._sanitizeOptions(this._options);\n }\n\n // Perform the redirected request\n try {\n this._performRequest();\n }\n catch (cause) {\n this.emit(\"error\", new RedirectionError(cause));\n }\n};\n\n// Wraps the key/value object of protocols with redirect functionality\nfunction wrap(protocols) {\n // Default settings\n var exports = {\n maxRedirects: 21,\n maxBodyLength: 10 * 1024 * 1024,\n };\n\n // Wrap each protocol\n var nativeProtocols = {};\n Object.keys(protocols).forEach(function (scheme) {\n var protocol = scheme + \":\";\n var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];\n var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol);\n\n // Executes a request, following redirects\n function request(input, options, callback) {\n // Parse parameters\n if (typeof input === \"string\") {\n var urlStr = input;\n try {\n input = urlToOptions(new URL(urlStr));\n }\n catch (err) {\n /* istanbul ignore next */\n input = url.parse(urlStr);\n }\n }\n else if (URL && (input instanceof URL)) {\n input = urlToOptions(input);\n }\n else {\n callback = options;\n options = input;\n input = { protocol: protocol };\n }\n if (typeof options === \"function\") {\n callback = options;\n options = null;\n }\n\n // Set defaults\n options = Object.assign({\n maxRedirects: exports.maxRedirects,\n maxBodyLength: exports.maxBodyLength,\n }, input, options);\n options.nativeProtocols = nativeProtocols;\n\n assert.equal(options.protocol, protocol, \"protocol mismatch\");\n debug(\"options\", options);\n return new RedirectableRequest(options, callback);\n }\n\n // Executes a GET request, following redirects\n function get(input, options, callback) {\n var wrappedRequest = wrappedProtocol.request(input, options, callback);\n wrappedRequest.end();\n return wrappedRequest;\n }\n\n // Expose the properties on the wrapped protocol\n Object.defineProperties(wrappedProtocol, {\n request: { value: request, configurable: true, enumerable: true, writable: true },\n get: { value: get, configurable: true, enumerable: true, writable: true },\n });\n });\n return exports;\n}\n\n/* istanbul ignore next */\nfunction noop() { /* empty */ }\n\n// from https://github.com/nodejs/node/blob/master/lib/internal/url.js\nfunction urlToOptions(urlObject) {\n var options = {\n protocol: urlObject.protocol,\n hostname: urlObject.hostname.startsWith(\"[\") ?\n /* istanbul ignore next */\n urlObject.hostname.slice(1, -1) :\n urlObject.hostname,\n hash: urlObject.hash,\n search: urlObject.search,\n pathname: urlObject.pathname,\n path: urlObject.pathname + urlObject.search,\n href: urlObject.href,\n };\n if (urlObject.port !== \"\") {\n options.port = Number(urlObject.port);\n }\n return options;\n}\n\nfunction removeMatchingHeaders(regex, headers) {\n var lastValue;\n for (var header in headers) {\n if (regex.test(header)) {\n lastValue = headers[header];\n delete headers[header];\n }\n }\n return (lastValue === null || typeof lastValue === \"undefined\") ?\n undefined : String(lastValue).trim();\n}\n\nfunction createErrorType(code, defaultMessage) {\n function CustomError(cause) {\n Error.captureStackTrace(this, this.constructor);\n if (!cause) {\n this.message = defaultMessage;\n }\n else {\n this.message = defaultMessage + \": \" + cause.message;\n this.cause = cause;\n }\n }\n CustomError.prototype = new Error();\n CustomError.prototype.constructor = CustomError;\n CustomError.prototype.name = \"Error [\" + code + \"]\";\n CustomError.prototype.code = code;\n return CustomError;\n}\n\nfunction abortRequest(request) {\n for (var e = 0; e < events.length; e++) {\n request.removeListener(events[e], eventHandlers[events[e]]);\n }\n request.on(\"error\", noop);\n request.abort();\n}\n\nfunction isSubdomain(subdomain, domain) {\n const dot = subdomain.length - domain.length - 1;\n return dot > 0 && subdomain[dot] === \".\" && subdomain.endsWith(domain);\n}\n\n// Exports\nmodule.exports = wrap({ http: http, https: https });\nmodule.exports.wrap = wrap;\n","var CombinedStream = require('combined-stream');\nvar util = require('util');\nvar path = require('path');\nvar http = require('http');\nvar https = require('https');\nvar parseUrl = require('url').parse;\nvar fs = require('fs');\nvar mime = require('mime-types');\nvar asynckit = require('asynckit');\nvar populate = require('./populate.js');\n\n// Public API\nmodule.exports = FormData;\n\n// make it a Stream\nutil.inherits(FormData, CombinedStream);\n\n/**\n * Create readable \"multipart/form-data\" streams.\n * Can be used to submit forms\n * and file uploads to other web applications.\n *\n * @constructor\n * @param {Object} options - Properties to be added/overriden for FormData and CombinedStream\n */\nfunction FormData(options) {\n if (!(this instanceof FormData)) {\n return new FormData(options);\n }\n\n this._overheadLength = 0;\n this._valueLength = 0;\n this._valuesToMeasure = [];\n\n CombinedStream.call(this);\n\n options = options || {};\n for (var option in options) {\n this[option] = options[option];\n }\n}\n\nFormData.LINE_BREAK = '\\r\\n';\nFormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream';\n\nFormData.prototype.append = function(field, value, options) {\n\n options = options || {};\n\n // allow filename as single option\n if (typeof options == 'string') {\n options = {filename: options};\n }\n\n var append = CombinedStream.prototype.append.bind(this);\n\n // all that streamy business can't handle numbers\n if (typeof value == 'number') {\n value = '' + value;\n }\n\n // https://github.com/felixge/node-form-data/issues/38\n if (util.isArray(value)) {\n // Please convert your array into string\n // the way web server expects it\n this._error(new Error('Arrays are not supported.'));\n return;\n }\n\n var header = this._multiPartHeader(field, value, options);\n var footer = this._multiPartFooter();\n\n append(header);\n append(value);\n append(footer);\n\n // pass along options.knownLength\n this._trackLength(header, value, options);\n};\n\nFormData.prototype._trackLength = function(header, value, options) {\n var valueLength = 0;\n\n // used w/ getLengthSync(), when length is known.\n // e.g. for streaming directly from a remote server,\n // w/ a known file a size, and not wanting to wait for\n // incoming file to finish to get its size.\n if (options.knownLength != null) {\n valueLength += +options.knownLength;\n } else if (Buffer.isBuffer(value)) {\n valueLength = value.length;\n } else if (typeof value === 'string') {\n valueLength = Buffer.byteLength(value);\n }\n\n this._valueLength += valueLength;\n\n // @check why add CRLF? does this account for custom/multiple CRLFs?\n this._overheadLength +=\n Buffer.byteLength(header) +\n FormData.LINE_BREAK.length;\n\n // empty or either doesn't have path or not an http response\n if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) )) {\n return;\n }\n\n // no need to bother with the length\n if (!options.knownLength) {\n this._valuesToMeasure.push(value);\n }\n};\n\nFormData.prototype._lengthRetriever = function(value, callback) {\n\n if (value.hasOwnProperty('fd')) {\n\n // take read range into a account\n // `end` = Infinity –> read file till the end\n //\n // TODO: Looks like there is bug in Node fs.createReadStream\n // it doesn't respect `end` options without `start` options\n // Fix it when node fixes it.\n // https://github.com/joyent/node/issues/7819\n if (value.end != undefined && value.end != Infinity && value.start != undefined) {\n\n // when end specified\n // no need to calculate range\n // inclusive, starts with 0\n callback(null, value.end + 1 - (value.start ? value.start : 0));\n\n // not that fast snoopy\n } else {\n // still need to fetch file size from fs\n fs.stat(value.path, function(err, stat) {\n\n var fileSize;\n\n if (err) {\n callback(err);\n return;\n }\n\n // update final size based on the range options\n fileSize = stat.size - (value.start ? value.start : 0);\n callback(null, fileSize);\n });\n }\n\n // or http response\n } else if (value.hasOwnProperty('httpVersion')) {\n callback(null, +value.headers['content-length']);\n\n // or request stream http://github.com/mikeal/request\n } else if (value.hasOwnProperty('httpModule')) {\n // wait till response come back\n value.on('response', function(response) {\n value.pause();\n callback(null, +response.headers['content-length']);\n });\n value.resume();\n\n // something else\n } else {\n callback('Unknown stream');\n }\n};\n\nFormData.prototype._multiPartHeader = function(field, value, options) {\n // custom header specified (as string)?\n // it becomes responsible for boundary\n // (e.g. to handle extra CRLFs on .NET servers)\n if (typeof options.header == 'string') {\n return options.header;\n }\n\n var contentDisposition = this._getContentDisposition(value, options);\n var contentType = this._getContentType(value, options);\n\n var contents = '';\n var headers = {\n // add custom disposition as third element or keep it two elements if not\n 'Content-Disposition': ['form-data', 'name=\"' + field + '\"'].concat(contentDisposition || []),\n // if no content type. allow it to be empty array\n 'Content-Type': [].concat(contentType || [])\n };\n\n // allow custom headers.\n if (typeof options.header == 'object') {\n populate(headers, options.header);\n }\n\n var header;\n for (var prop in headers) {\n if (!headers.hasOwnProperty(prop)) continue;\n header = headers[prop];\n\n // skip nullish headers.\n if (header == null) {\n continue;\n }\n\n // convert all headers to arrays.\n if (!Array.isArray(header)) {\n header = [header];\n }\n\n // add non-empty headers.\n if (header.length) {\n contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK;\n }\n }\n\n return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK;\n};\n\nFormData.prototype._getContentDisposition = function(value, options) {\n\n var filename\n , contentDisposition\n ;\n\n if (typeof options.filepath === 'string') {\n // custom filepath for relative paths\n filename = path.normalize(options.filepath).replace(/\\\\/g, '/');\n } else if (options.filename || value.name || value.path) {\n // custom filename take precedence\n // formidable and the browser add a name property\n // fs- and request- streams have path property\n filename = path.basename(options.filename || value.name || value.path);\n } else if (value.readable && value.hasOwnProperty('httpVersion')) {\n // or try http response\n filename = path.basename(value.client._httpMessage.path || '');\n }\n\n if (filename) {\n contentDisposition = 'filename=\"' + filename + '\"';\n }\n\n return contentDisposition;\n};\n\nFormData.prototype._getContentType = function(value, options) {\n\n // use custom content-type above all\n var contentType = options.contentType;\n\n // or try `name` from formidable, browser\n if (!contentType && value.name) {\n contentType = mime.lookup(value.name);\n }\n\n // or try `path` from fs-, request- streams\n if (!contentType && value.path) {\n contentType = mime.lookup(value.path);\n }\n\n // or if it's http-reponse\n if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) {\n contentType = value.headers['content-type'];\n }\n\n // or guess it from the filepath or filename\n if (!contentType && (options.filepath || options.filename)) {\n contentType = mime.lookup(options.filepath || options.filename);\n }\n\n // fallback to the default content type if `value` is not simple value\n if (!contentType && typeof value == 'object') {\n contentType = FormData.DEFAULT_CONTENT_TYPE;\n }\n\n return contentType;\n};\n\nFormData.prototype._multiPartFooter = function() {\n return function(next) {\n var footer = FormData.LINE_BREAK;\n\n var lastPart = (this._streams.length === 0);\n if (lastPart) {\n footer += this._lastBoundary();\n }\n\n next(footer);\n }.bind(this);\n};\n\nFormData.prototype._lastBoundary = function() {\n return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK;\n};\n\nFormData.prototype.getHeaders = function(userHeaders) {\n var header;\n var formHeaders = {\n 'content-type': 'multipart/form-data; boundary=' + this.getBoundary()\n };\n\n for (header in userHeaders) {\n if (userHeaders.hasOwnProperty(header)) {\n formHeaders[header.toLowerCase()] = userHeaders[header];\n }\n }\n\n return formHeaders;\n};\n\nFormData.prototype.setBoundary = function(boundary) {\n this._boundary = boundary;\n};\n\nFormData.prototype.getBoundary = function() {\n if (!this._boundary) {\n this._generateBoundary();\n }\n\n return this._boundary;\n};\n\nFormData.prototype.getBuffer = function() {\n var dataBuffer = new Buffer.alloc( 0 );\n var boundary = this.getBoundary();\n\n // Create the form content. Add Line breaks to the end of data.\n for (var i = 0, len = this._streams.length; i < len; i++) {\n if (typeof this._streams[i] !== 'function') {\n\n // Add content to the buffer.\n if(Buffer.isBuffer(this._streams[i])) {\n dataBuffer = Buffer.concat( [dataBuffer, this._streams[i]]);\n }else {\n dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(this._streams[i])]);\n }\n\n // Add break after content.\n if (typeof this._streams[i] !== 'string' || this._streams[i].substring( 2, boundary.length + 2 ) !== boundary) {\n dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(FormData.LINE_BREAK)] );\n }\n }\n }\n\n // Add the footer and return the Buffer object.\n return Buffer.concat( [dataBuffer, Buffer.from(this._lastBoundary())] );\n};\n\nFormData.prototype._generateBoundary = function() {\n // This generates a 50 character boundary similar to those used by Firefox.\n // They are optimized for boyer-moore parsing.\n var boundary = '--------------------------';\n for (var i = 0; i < 24; i++) {\n boundary += Math.floor(Math.random() * 10).toString(16);\n }\n\n this._boundary = boundary;\n};\n\n// Note: getLengthSync DOESN'T calculate streams length\n// As workaround one can calculate file size manually\n// and add it as knownLength option\nFormData.prototype.getLengthSync = function() {\n var knownLength = this._overheadLength + this._valueLength;\n\n // Don't get confused, there are 3 \"internal\" streams for each keyval pair\n // so it basically checks if there is any value added to the form\n if (this._streams.length) {\n knownLength += this._lastBoundary().length;\n }\n\n // https://github.com/form-data/form-data/issues/40\n if (!this.hasKnownLength()) {\n // Some async length retrievers are present\n // therefore synchronous length calculation is false.\n // Please use getLength(callback) to get proper length\n this._error(new Error('Cannot calculate proper length in synchronous way.'));\n }\n\n return knownLength;\n};\n\n// Public API to check if length of added values is known\n// https://github.com/form-data/form-data/issues/196\n// https://github.com/form-data/form-data/issues/262\nFormData.prototype.hasKnownLength = function() {\n var hasKnownLength = true;\n\n if (this._valuesToMeasure.length) {\n hasKnownLength = false;\n }\n\n return hasKnownLength;\n};\n\nFormData.prototype.getLength = function(cb) {\n var knownLength = this._overheadLength + this._valueLength;\n\n if (this._streams.length) {\n knownLength += this._lastBoundary().length;\n }\n\n if (!this._valuesToMeasure.length) {\n process.nextTick(cb.bind(this, null, knownLength));\n return;\n }\n\n asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) {\n if (err) {\n cb(err);\n return;\n }\n\n values.forEach(function(length) {\n knownLength += length;\n });\n\n cb(null, knownLength);\n });\n};\n\nFormData.prototype.submit = function(params, cb) {\n var request\n , options\n , defaults = {method: 'post'}\n ;\n\n // parse provided url if it's string\n // or treat it as options object\n if (typeof params == 'string') {\n\n params = parseUrl(params);\n options = populate({\n port: params.port,\n path: params.pathname,\n host: params.hostname,\n protocol: params.protocol\n }, defaults);\n\n // use custom params\n } else {\n\n options = populate(params, defaults);\n // if no port provided use default one\n if (!options.port) {\n options.port = options.protocol == 'https:' ? 443 : 80;\n }\n }\n\n // put that good code in getHeaders to some use\n options.headers = this.getHeaders(params.headers);\n\n // https if specified, fallback to http in any other case\n if (options.protocol == 'https:') {\n request = https.request(options);\n } else {\n request = http.request(options);\n }\n\n // get content length and fire away\n this.getLength(function(err, length) {\n if (err) {\n this._error(err);\n return;\n }\n\n // add content length\n request.setHeader('Content-Length', length);\n\n this.pipe(request);\n if (cb) {\n var onResponse;\n\n var callback = function (error, responce) {\n request.removeListener('error', callback);\n request.removeListener('response', onResponse);\n\n return cb.call(this, error, responce);\n };\n\n onResponse = callback.bind(this, null);\n\n request.on('error', callback);\n request.on('response', onResponse);\n }\n }.bind(this));\n\n return request;\n};\n\nFormData.prototype._error = function(err) {\n if (!this.error) {\n this.error = err;\n this.pause();\n this.emit('error', err);\n }\n};\n\nFormData.prototype.toString = function () {\n return '[object FormData]';\n};\n","// populates missing values\nmodule.exports = function(dst, src) {\n\n Object.keys(src).forEach(function(prop)\n {\n dst[prop] = dst[prop] || src[prop];\n });\n\n return dst;\n};\n","'use strict';\n\nmodule.exports = (flag, argv = process.argv) => {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n};\n","\"use strict\";\nconst whatwgEncoding = require(\"whatwg-encoding\");\n\n// https://html.spec.whatwg.org/#encoding-sniffing-algorithm\nmodule.exports = (buffer, { transportLayerEncodingLabel, defaultEncoding = \"windows-1252\" } = {}) => {\n let encoding = whatwgEncoding.getBOMEncoding(buffer); // see https://github.com/whatwg/html/issues/1910\n\n if (encoding === null && transportLayerEncodingLabel !== undefined) {\n encoding = whatwgEncoding.labelToName(transportLayerEncodingLabel);\n }\n\n if (encoding === null) {\n encoding = prescanMetaCharset(buffer);\n }\n\n if (encoding === null) {\n encoding = defaultEncoding;\n }\n\n return encoding;\n};\n\n// https://html.spec.whatwg.org/multipage/syntax.html#prescan-a-byte-stream-to-determine-its-encoding\nfunction prescanMetaCharset(buffer) {\n const l = Math.min(buffer.length, 1024);\n for (let i = 0; i < l; i++) {\n let c = buffer[i];\n if (c === 0x3C) {\n // \"<\"\n const c1 = buffer[i + 1];\n const c2 = buffer[i + 2];\n const c3 = buffer[i + 3];\n const c4 = buffer[i + 4];\n const c5 = buffer[i + 5];\n // !-- (comment start)\n if (c1 === 0x21 && c2 === 0x2D && c3 === 0x2D) {\n i += 4;\n for (; i < l; i++) {\n c = buffer[i];\n const cMinus1 = buffer[i - 1];\n const cMinus2 = buffer[i - 2];\n // --> (comment end)\n if (c === 0x3E && cMinus1 === 0x2D && cMinus2 === 0x2D) {\n break;\n }\n }\n } else if ((c1 === 0x4D || c1 === 0x6D) &&\n (c2 === 0x45 || c2 === 0x65) &&\n (c3 === 0x54 || c3 === 0x74) &&\n (c4 === 0x41 || c4 === 0x61) &&\n (isSpaceCharacter(c5) || c5 === 0x2F)) {\n // \"meta\" + space or /\n i += 6;\n const attributeList = new Set();\n let gotPragma = false;\n let needPragma = null;\n let charset = null;\n\n let attrRes;\n do {\n attrRes = getAttribute(buffer, i, l);\n if (attrRes.attr && !attributeList.has(attrRes.attr.name)) {\n attributeList.add(attrRes.attr.name);\n if (attrRes.attr.name === \"http-equiv\") {\n gotPragma = attrRes.attr.value === \"content-type\";\n } else if (attrRes.attr.name === \"content\" && !charset) {\n charset = extractCharacterEncodingFromMeta(attrRes.attr.value);\n if (charset !== null) {\n needPragma = true;\n }\n } else if (attrRes.attr.name === \"charset\") {\n charset = whatwgEncoding.labelToName(attrRes.attr.value);\n needPragma = false;\n }\n }\n i = attrRes.i;\n } while (attrRes.attr);\n\n if (needPragma === null) {\n continue;\n }\n if (needPragma === true && gotPragma === false) {\n continue;\n }\n if (charset === null) {\n continue;\n }\n\n if (charset === \"UTF-16LE\" || charset === \"UTF-16BE\") {\n charset = \"UTF-8\";\n }\n if (charset === \"x-user-defined\") {\n charset = \"windows-1252\";\n }\n\n return charset;\n } else if ((c1 >= 0x41 && c1 <= 0x5A) || (c1 >= 0x61 && c1 <= 0x7A)) {\n // a-z or A-Z\n for (i += 2; i < l; i++) {\n c = buffer[i];\n // space or >\n if (isSpaceCharacter(c) || c === 0x3E) {\n break;\n }\n }\n let attrRes;\n do {\n attrRes = getAttribute(buffer, i, l);\n i = attrRes.i;\n } while (attrRes.attr);\n } else if (c1 === 0x21 || c1 === 0x2F || c1 === 0x3F) {\n // ! or / or ?\n for (i += 2; i < l; i++) {\n c = buffer[i];\n // >\n if (c === 0x3E) {\n break;\n }\n }\n }\n }\n }\n return null;\n}\n\n// https://html.spec.whatwg.org/multipage/syntax.html#concept-get-attributes-when-sniffing\nfunction getAttribute(buffer, i, l) {\n for (; i < l; i++) {\n let c = buffer[i];\n // space or /\n if (isSpaceCharacter(c) || c === 0x2F) {\n continue;\n }\n // \">\"\n if (c === 0x3E) {\n break;\n }\n let name = \"\";\n let value = \"\";\n nameLoop:for (; i < l; i++) {\n c = buffer[i];\n // \"=\"\n if (c === 0x3D && name !== \"\") {\n i++;\n break;\n }\n // space\n if (isSpaceCharacter(c)) {\n for (i++; i < l; i++) {\n c = buffer[i];\n // space\n if (isSpaceCharacter(c)) {\n continue;\n }\n // not \"=\"\n if (c !== 0x3D) {\n return { attr: { name, value }, i };\n }\n\n i++;\n break nameLoop;\n }\n break;\n }\n // / or >\n if (c === 0x2F || c === 0x3E) {\n return { attr: { name, value }, i };\n }\n // A-Z\n if (c >= 0x41 && c <= 0x5A) {\n name += String.fromCharCode(c + 0x20); // lowercase\n } else {\n name += String.fromCharCode(c);\n }\n }\n c = buffer[i];\n // space\n if (isSpaceCharacter(c)) {\n for (i++; i < l; i++) {\n c = buffer[i];\n // space\n if (isSpaceCharacter(c)) {\n continue;\n } else {\n break;\n }\n }\n }\n // \" or '\n if (c === 0x22 || c === 0x27) {\n const quote = c;\n for (i++; i < l; i++) {\n c = buffer[i];\n\n if (c === quote) {\n i++;\n return { attr: { name, value }, i };\n }\n\n // A-Z\n if (c >= 0x41 && c <= 0x5A) {\n value += String.fromCharCode(c + 0x20); // lowercase\n } else {\n value += String.fromCharCode(c);\n }\n }\n }\n\n // >\n if (c === 0x3E) {\n return { attr: { name, value }, i };\n }\n\n // A-Z\n if (c >= 0x41 && c <= 0x5A) {\n value += String.fromCharCode(c + 0x20); // lowercase\n } else {\n value += String.fromCharCode(c);\n }\n\n for (i++; i < l; i++) {\n c = buffer[i];\n\n // space or >\n if (isSpaceCharacter(c) || c === 0x3E) {\n return { attr: { name, value }, i };\n }\n\n // A-Z\n if (c >= 0x41 && c <= 0x5A) {\n value += String.fromCharCode(c + 0x20); // lowercase\n } else {\n value += String.fromCharCode(c);\n }\n }\n }\n return { i };\n}\n\nfunction extractCharacterEncodingFromMeta(string) {\n let position = 0;\n\n while (true) {\n const indexOfCharset = string.substring(position).search(/charset/i);\n\n if (indexOfCharset === -1) {\n return null;\n }\n let subPosition = position + indexOfCharset + \"charset\".length;\n\n while (isSpaceCharacter(string[subPosition].charCodeAt(0))) {\n ++subPosition;\n }\n\n if (string[subPosition] !== \"=\") {\n position = subPosition - 1;\n continue;\n }\n\n ++subPosition;\n\n while (isSpaceCharacter(string[subPosition].charCodeAt(0))) {\n ++subPosition;\n }\n\n position = subPosition;\n break;\n }\n\n if (string[position] === \"\\\"\" || string[position] === \"'\") {\n const nextIndex = string.indexOf(string[position], position + 1);\n\n if (nextIndex !== -1) {\n return whatwgEncoding.labelToName(string.substring(position + 1, nextIndex));\n }\n\n // It is an unmatched quotation mark\n return null;\n }\n\n if (string.length === position + 1) {\n return null;\n }\n\n const indexOfASCIIWhitespaceOrSemicolon = string.substring(position + 1).search(/\\x09|\\x0A|\\x0C|\\x0D|\\x20|;/);\n const end = indexOfASCIIWhitespaceOrSemicolon === -1 ?\n string.length :\n position + indexOfASCIIWhitespaceOrSemicolon + 1;\n\n return whatwgEncoding.labelToName(string.substring(position, end));\n}\n\nfunction isSpaceCharacter(c) {\n return c === 0x09 || c === 0x0A || c === 0x0C || c === 0x0D || c === 0x20;\n}\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst net_1 = __importDefault(require(\"net\"));\nconst tls_1 = __importDefault(require(\"tls\"));\nconst url_1 = __importDefault(require(\"url\"));\nconst debug_1 = __importDefault(require(\"debug\"));\nconst once_1 = __importDefault(require(\"@tootallnate/once\"));\nconst agent_base_1 = require(\"agent-base\");\nconst debug = debug_1.default('http-proxy-agent');\nfunction isHTTPS(protocol) {\n return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false;\n}\n/**\n * The `HttpProxyAgent` implements an HTTP Agent subclass that connects\n * to the specified \"HTTP proxy server\" in order to proxy HTTP requests.\n *\n * @api public\n */\nclass HttpProxyAgent extends agent_base_1.Agent {\n constructor(_opts) {\n let opts;\n if (typeof _opts === 'string') {\n opts = url_1.default.parse(_opts);\n }\n else {\n opts = _opts;\n }\n if (!opts) {\n throw new Error('an HTTP(S) proxy server `host` and `port` must be specified!');\n }\n debug('Creating new HttpProxyAgent instance: %o', opts);\n super(opts);\n const proxy = Object.assign({}, opts);\n // If `true`, then connect to the proxy server over TLS.\n // Defaults to `false`.\n this.secureProxy = opts.secureProxy || isHTTPS(proxy.protocol);\n // Prefer `hostname` over `host`, and set the `port` if needed.\n proxy.host = proxy.hostname || proxy.host;\n if (typeof proxy.port === 'string') {\n proxy.port = parseInt(proxy.port, 10);\n }\n if (!proxy.port && proxy.host) {\n proxy.port = this.secureProxy ? 443 : 80;\n }\n if (proxy.host && proxy.path) {\n // If both a `host` and `path` are specified then it's most likely\n // the result of a `url.parse()` call... we need to remove the\n // `path` portion so that `net.connect()` doesn't attempt to open\n // that as a Unix socket file.\n delete proxy.path;\n delete proxy.pathname;\n }\n this.proxy = proxy;\n }\n /**\n * Called when the node-core HTTP client library is creating a\n * new HTTP request.\n *\n * @api protected\n */\n callback(req, opts) {\n return __awaiter(this, void 0, void 0, function* () {\n const { proxy, secureProxy } = this;\n const parsed = url_1.default.parse(req.path);\n if (!parsed.protocol) {\n parsed.protocol = 'http:';\n }\n if (!parsed.hostname) {\n parsed.hostname = opts.hostname || opts.host || null;\n }\n if (parsed.port == null && typeof opts.port) {\n parsed.port = String(opts.port);\n }\n if (parsed.port === '80') {\n // if port is 80, then we can remove the port so that the\n // \":80\" portion is not on the produced URL\n delete parsed.port;\n }\n // Change the `http.ClientRequest` instance's \"path\" field\n // to the absolute path of the URL that will be requested.\n req.path = url_1.default.format(parsed);\n // Inject the `Proxy-Authorization` header if necessary.\n if (proxy.auth) {\n req.setHeader('Proxy-Authorization', `Basic ${Buffer.from(proxy.auth).toString('base64')}`);\n }\n // Create a socket connection to the proxy server.\n let socket;\n if (secureProxy) {\n debug('Creating `tls.Socket`: %o', proxy);\n socket = tls_1.default.connect(proxy);\n }\n else {\n debug('Creating `net.Socket`: %o', proxy);\n socket = net_1.default.connect(proxy);\n }\n // At this point, the http ClientRequest's internal `_header` field\n // might have already been set. If this is the case then we'll need\n // to re-generate the string since we just changed the `req.path`.\n if (req._header) {\n let first;\n let endOfHeaders;\n debug('Regenerating stored HTTP header string for request');\n req._header = null;\n req._implicitHeader();\n if (req.output && req.output.length > 0) {\n // Node < 12\n debug('Patching connection write() output buffer with updated header');\n first = req.output[0];\n endOfHeaders = first.indexOf('\\r\\n\\r\\n') + 4;\n req.output[0] = req._header + first.substring(endOfHeaders);\n debug('Output buffer: %o', req.output);\n }\n else if (req.outputData && req.outputData.length > 0) {\n // Node >= 12\n debug('Patching connection write() output buffer with updated header');\n first = req.outputData[0].data;\n endOfHeaders = first.indexOf('\\r\\n\\r\\n') + 4;\n req.outputData[0].data =\n req._header + first.substring(endOfHeaders);\n debug('Output buffer: %o', req.outputData[0].data);\n }\n }\n // Wait for the socket's `connect` event, so that this `callback()`\n // function throws instead of the `http` request machinery. This is\n // important for i.e. `PacProxyAgent` which determines a failed proxy\n // connection via the `callback()` function throwing.\n yield once_1.default(socket, 'connect');\n return socket;\n });\n }\n}\nexports.default = HttpProxyAgent;\n//# sourceMappingURL=agent.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nconst agent_1 = __importDefault(require(\"./agent\"));\nfunction createHttpProxyAgent(opts) {\n return new agent_1.default(opts);\n}\n(function (createHttpProxyAgent) {\n createHttpProxyAgent.HttpProxyAgent = agent_1.default;\n createHttpProxyAgent.prototype = agent_1.default.prototype;\n})(createHttpProxyAgent || (createHttpProxyAgent = {}));\nmodule.exports = createHttpProxyAgent;\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst net_1 = __importDefault(require(\"net\"));\nconst tls_1 = __importDefault(require(\"tls\"));\nconst url_1 = __importDefault(require(\"url\"));\nconst assert_1 = __importDefault(require(\"assert\"));\nconst debug_1 = __importDefault(require(\"debug\"));\nconst agent_base_1 = require(\"agent-base\");\nconst parse_proxy_response_1 = __importDefault(require(\"./parse-proxy-response\"));\nconst debug = debug_1.default('https-proxy-agent:agent');\n/**\n * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to\n * the specified \"HTTP(s) proxy server\" in order to proxy HTTPS requests.\n *\n * Outgoing HTTP requests are first tunneled through the proxy server using the\n * `CONNECT` HTTP request method to establish a connection to the proxy server,\n * and then the proxy server connects to the destination target and issues the\n * HTTP request from the proxy server.\n *\n * `https:` requests have their socket connection upgraded to TLS once\n * the connection to the proxy server has been established.\n *\n * @api public\n */\nclass HttpsProxyAgent extends agent_base_1.Agent {\n constructor(_opts) {\n let opts;\n if (typeof _opts === 'string') {\n opts = url_1.default.parse(_opts);\n }\n else {\n opts = _opts;\n }\n if (!opts) {\n throw new Error('an HTTP(S) proxy server `host` and `port` must be specified!');\n }\n debug('creating new HttpsProxyAgent instance: %o', opts);\n super(opts);\n const proxy = Object.assign({}, opts);\n // If `true`, then connect to the proxy server over TLS.\n // Defaults to `false`.\n this.secureProxy = opts.secureProxy || isHTTPS(proxy.protocol);\n // Prefer `hostname` over `host`, and set the `port` if needed.\n proxy.host = proxy.hostname || proxy.host;\n if (typeof proxy.port === 'string') {\n proxy.port = parseInt(proxy.port, 10);\n }\n if (!proxy.port && proxy.host) {\n proxy.port = this.secureProxy ? 443 : 80;\n }\n // ALPN is supported by Node.js >= v5.\n // attempt to negotiate http/1.1 for proxy servers that support http/2\n if (this.secureProxy && !('ALPNProtocols' in proxy)) {\n proxy.ALPNProtocols = ['http 1.1'];\n }\n if (proxy.host && proxy.path) {\n // If both a `host` and `path` are specified then it's most likely\n // the result of a `url.parse()` call... we need to remove the\n // `path` portion so that `net.connect()` doesn't attempt to open\n // that as a Unix socket file.\n delete proxy.path;\n delete proxy.pathname;\n }\n this.proxy = proxy;\n }\n /**\n * Called when the node-core HTTP client library is creating a\n * new HTTP request.\n *\n * @api protected\n */\n callback(req, opts) {\n return __awaiter(this, void 0, void 0, function* () {\n const { proxy, secureProxy } = this;\n // Create a socket connection to the proxy server.\n let socket;\n if (secureProxy) {\n debug('Creating `tls.Socket`: %o', proxy);\n socket = tls_1.default.connect(proxy);\n }\n else {\n debug('Creating `net.Socket`: %o', proxy);\n socket = net_1.default.connect(proxy);\n }\n const headers = Object.assign({}, proxy.headers);\n const hostname = `${opts.host}:${opts.port}`;\n let payload = `CONNECT ${hostname} HTTP/1.1\\r\\n`;\n // Inject the `Proxy-Authorization` header if necessary.\n if (proxy.auth) {\n headers['Proxy-Authorization'] = `Basic ${Buffer.from(proxy.auth).toString('base64')}`;\n }\n // The `Host` header should only include the port\n // number when it is not the default port.\n let { host, port, secureEndpoint } = opts;\n if (!isDefaultPort(port, secureEndpoint)) {\n host += `:${port}`;\n }\n headers.Host = host;\n headers.Connection = 'close';\n for (const name of Object.keys(headers)) {\n payload += `${name}: ${headers[name]}\\r\\n`;\n }\n const proxyResponsePromise = parse_proxy_response_1.default(socket);\n socket.write(`${payload}\\r\\n`);\n const { statusCode, buffered } = yield proxyResponsePromise;\n if (statusCode === 200) {\n req.once('socket', resume);\n if (opts.secureEndpoint) {\n const servername = opts.servername || opts.host;\n if (!servername) {\n throw new Error('Could not determine \"servername\"');\n }\n // The proxy is connecting to a TLS server, so upgrade\n // this socket connection to a TLS connection.\n debug('Upgrading socket connection to TLS');\n return tls_1.default.connect(Object.assign(Object.assign({}, omit(opts, 'host', 'hostname', 'path', 'port')), { socket,\n servername }));\n }\n return socket;\n }\n // Some other status code that's not 200... need to re-play the HTTP\n // header \"data\" events onto the socket once the HTTP machinery is\n // attached so that the node core `http` can parse and handle the\n // error status code.\n // Close the original socket, and a new \"fake\" socket is returned\n // instead, so that the proxy doesn't get the HTTP request\n // written to it (which may contain `Authorization` headers or other\n // sensitive data).\n //\n // See: https://hackerone.com/reports/541502\n socket.destroy();\n const fakeSocket = new net_1.default.Socket();\n fakeSocket.readable = true;\n // Need to wait for the \"socket\" event to re-play the \"data\" events.\n req.once('socket', (s) => {\n debug('replaying proxy buffer for failed request');\n assert_1.default(s.listenerCount('data') > 0);\n // Replay the \"buffered\" Buffer onto the fake `socket`, since at\n // this point the HTTP module machinery has been hooked up for\n // the user.\n s.push(buffered);\n s.push(null);\n });\n return fakeSocket;\n });\n }\n}\nexports.default = HttpsProxyAgent;\nfunction resume(socket) {\n socket.resume();\n}\nfunction isDefaultPort(port, secure) {\n return Boolean((!secure && port === 80) || (secure && port === 443));\n}\nfunction isHTTPS(protocol) {\n return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false;\n}\nfunction omit(obj, ...keys) {\n const ret = {};\n let key;\n for (key in obj) {\n if (!keys.includes(key)) {\n ret[key] = obj[key];\n }\n }\n return ret;\n}\n//# sourceMappingURL=agent.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nconst agent_1 = __importDefault(require(\"./agent\"));\nfunction createHttpsProxyAgent(opts) {\n return new agent_1.default(opts);\n}\n(function (createHttpsProxyAgent) {\n createHttpsProxyAgent.HttpsProxyAgent = agent_1.default;\n createHttpsProxyAgent.prototype = agent_1.default.prototype;\n})(createHttpsProxyAgent || (createHttpsProxyAgent = {}));\nmodule.exports = createHttpsProxyAgent;\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst debug_1 = __importDefault(require(\"debug\"));\nconst debug = debug_1.default('https-proxy-agent:parse-proxy-response');\nfunction parseProxyResponse(socket) {\n return new Promise((resolve, reject) => {\n // we need to buffer any HTTP traffic that happens with the proxy before we get\n // the CONNECT response, so that if the response is anything other than an \"200\"\n // response code, then we can re-play the \"data\" events on the socket once the\n // HTTP parser is hooked up...\n let buffersLength = 0;\n const buffers = [];\n function read() {\n const b = socket.read();\n if (b)\n ondata(b);\n else\n socket.once('readable', read);\n }\n function cleanup() {\n socket.removeListener('end', onend);\n socket.removeListener('error', onerror);\n socket.removeListener('close', onclose);\n socket.removeListener('readable', read);\n }\n function onclose(err) {\n debug('onclose had error %o', err);\n }\n function onend() {\n debug('onend');\n }\n function onerror(err) {\n cleanup();\n debug('onerror %o', err);\n reject(err);\n }\n function ondata(b) {\n buffers.push(b);\n buffersLength += b.length;\n const buffered = Buffer.concat(buffers, buffersLength);\n const endOfHeaders = buffered.indexOf('\\r\\n\\r\\n');\n if (endOfHeaders === -1) {\n // keep buffering\n debug('have not received end of HTTP headers yet...');\n read();\n return;\n }\n const firstLine = buffered.toString('ascii', 0, buffered.indexOf('\\r\\n'));\n const statusCode = +firstLine.split(' ')[1];\n debug('got proxy server response: %o', firstLine);\n resolve({\n statusCode,\n buffered\n });\n }\n socket.on('error', onerror);\n socket.on('close', onclose);\n socket.on('end', onend);\n read();\n });\n}\nexports.default = parseProxyResponse;\n//# sourceMappingURL=parse-proxy-response.js.map","\"use strict\";\nvar Buffer = require(\"safer-buffer\").Buffer;\n\n// Multibyte codec. In this scheme, a character is represented by 1 or more bytes.\n// Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences.\n// To save memory and loading time, we read table files only when requested.\n\nexports._dbcs = DBCSCodec;\n\nvar UNASSIGNED = -1,\n GB18030_CODE = -2,\n SEQ_START = -10,\n NODE_START = -1000,\n UNASSIGNED_NODE = new Array(0x100),\n DEF_CHAR = -1;\n\nfor (var i = 0; i < 0x100; i++)\n UNASSIGNED_NODE[i] = UNASSIGNED;\n\n\n// Class DBCSCodec reads and initializes mapping tables.\nfunction DBCSCodec(codecOptions, iconv) {\n this.encodingName = codecOptions.encodingName;\n if (!codecOptions)\n throw new Error(\"DBCS codec is called without the data.\")\n if (!codecOptions.table)\n throw new Error(\"Encoding '\" + this.encodingName + \"' has no data.\");\n\n // Load tables.\n var mappingTable = codecOptions.table();\n\n\n // Decode tables: MBCS -> Unicode.\n\n // decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256.\n // Trie root is decodeTables[0].\n // Values: >= 0 -> unicode character code. can be > 0xFFFF\n // == UNASSIGNED -> unknown/unassigned sequence.\n // == GB18030_CODE -> this is the end of a GB18030 4-byte sequence.\n // <= NODE_START -> index of the next node in our trie to process next byte.\n // <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq.\n this.decodeTables = [];\n this.decodeTables[0] = UNASSIGNED_NODE.slice(0); // Create root node.\n\n // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here. \n this.decodeTableSeq = [];\n\n // Actual mapping tables consist of chunks. Use them to fill up decode tables.\n for (var i = 0; i < mappingTable.length; i++)\n this._addDecodeChunk(mappingTable[i]);\n\n this.defaultCharUnicode = iconv.defaultCharUnicode;\n\n \n // Encode tables: Unicode -> DBCS.\n\n // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance.\n // Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null.\n // Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.).\n // == UNASSIGNED -> no conversion found. Output a default char.\n // <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence.\n this.encodeTable = [];\n \n // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of\n // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key\n // means end of sequence (needed when one sequence is a strict subsequence of another).\n // Objects are kept separately from encodeTable to increase performance.\n this.encodeTableSeq = [];\n\n // Some chars can be decoded, but need not be encoded.\n var skipEncodeChars = {};\n if (codecOptions.encodeSkipVals)\n for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) {\n var val = codecOptions.encodeSkipVals[i];\n if (typeof val === 'number')\n skipEncodeChars[val] = true;\n else\n for (var j = val.from; j <= val.to; j++)\n skipEncodeChars[j] = true;\n }\n \n // Use decode trie to recursively fill out encode tables.\n this._fillEncodeTable(0, 0, skipEncodeChars);\n\n // Add more encoding pairs when needed.\n if (codecOptions.encodeAdd) {\n for (var uChar in codecOptions.encodeAdd)\n if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar))\n this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]);\n }\n\n this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)];\n if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]['?'];\n if (this.defCharSB === UNASSIGNED) this.defCharSB = \"?\".charCodeAt(0);\n\n\n // Load & create GB18030 tables when needed.\n if (typeof codecOptions.gb18030 === 'function') {\n this.gb18030 = codecOptions.gb18030(); // Load GB18030 ranges.\n\n // Add GB18030 decode tables.\n var thirdByteNodeIdx = this.decodeTables.length;\n var thirdByteNode = this.decodeTables[thirdByteNodeIdx] = UNASSIGNED_NODE.slice(0);\n\n var fourthByteNodeIdx = this.decodeTables.length;\n var fourthByteNode = this.decodeTables[fourthByteNodeIdx] = UNASSIGNED_NODE.slice(0);\n\n for (var i = 0x81; i <= 0xFE; i++) {\n var secondByteNodeIdx = NODE_START - this.decodeTables[0][i];\n var secondByteNode = this.decodeTables[secondByteNodeIdx];\n for (var j = 0x30; j <= 0x39; j++)\n secondByteNode[j] = NODE_START - thirdByteNodeIdx;\n }\n for (var i = 0x81; i <= 0xFE; i++)\n thirdByteNode[i] = NODE_START - fourthByteNodeIdx;\n for (var i = 0x30; i <= 0x39; i++)\n fourthByteNode[i] = GB18030_CODE\n } \n}\n\nDBCSCodec.prototype.encoder = DBCSEncoder;\nDBCSCodec.prototype.decoder = DBCSDecoder;\n\n// Decoder helpers\nDBCSCodec.prototype._getDecodeTrieNode = function(addr) {\n var bytes = [];\n for (; addr > 0; addr >>= 8)\n bytes.push(addr & 0xFF);\n if (bytes.length == 0)\n bytes.push(0);\n\n var node = this.decodeTables[0];\n for (var i = bytes.length-1; i > 0; i--) { // Traverse nodes deeper into the trie.\n var val = node[bytes[i]];\n\n if (val == UNASSIGNED) { // Create new node.\n node[bytes[i]] = NODE_START - this.decodeTables.length;\n this.decodeTables.push(node = UNASSIGNED_NODE.slice(0));\n }\n else if (val <= NODE_START) { // Existing node.\n node = this.decodeTables[NODE_START - val];\n }\n else\n throw new Error(\"Overwrite byte in \" + this.encodingName + \", addr: \" + addr.toString(16));\n }\n return node;\n}\n\n\nDBCSCodec.prototype._addDecodeChunk = function(chunk) {\n // First element of chunk is the hex mbcs code where we start.\n var curAddr = parseInt(chunk[0], 16);\n\n // Choose the decoding node where we'll write our chars.\n var writeTable = this._getDecodeTrieNode(curAddr);\n curAddr = curAddr & 0xFF;\n\n // Write all other elements of the chunk to the table.\n for (var k = 1; k < chunk.length; k++) {\n var part = chunk[k];\n if (typeof part === \"string\") { // String, write as-is.\n for (var l = 0; l < part.length;) {\n var code = part.charCodeAt(l++);\n if (0xD800 <= code && code < 0xDC00) { // Decode surrogate\n var codeTrail = part.charCodeAt(l++);\n if (0xDC00 <= codeTrail && codeTrail < 0xE000)\n writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00);\n else\n throw new Error(\"Incorrect surrogate pair in \" + this.encodingName + \" at chunk \" + chunk[0]);\n }\n else if (0x0FF0 < code && code <= 0x0FFF) { // Character sequence (our own encoding used)\n var len = 0xFFF - code + 2;\n var seq = [];\n for (var m = 0; m < len; m++)\n seq.push(part.charCodeAt(l++)); // Simple variation: don't support surrogates or subsequences in seq.\n\n writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length;\n this.decodeTableSeq.push(seq);\n }\n else\n writeTable[curAddr++] = code; // Basic char\n }\n } \n else if (typeof part === \"number\") { // Integer, meaning increasing sequence starting with prev character.\n var charCode = writeTable[curAddr - 1] + 1;\n for (var l = 0; l < part; l++)\n writeTable[curAddr++] = charCode++;\n }\n else\n throw new Error(\"Incorrect type '\" + typeof part + \"' given in \" + this.encodingName + \" at chunk \" + chunk[0]);\n }\n if (curAddr > 0xFF)\n throw new Error(\"Incorrect chunk in \" + this.encodingName + \" at addr \" + chunk[0] + \": too long\" + curAddr);\n}\n\n// Encoder helpers\nDBCSCodec.prototype._getEncodeBucket = function(uCode) {\n var high = uCode >> 8; // This could be > 0xFF because of astral characters.\n if (this.encodeTable[high] === undefined)\n this.encodeTable[high] = UNASSIGNED_NODE.slice(0); // Create bucket on demand.\n return this.encodeTable[high];\n}\n\nDBCSCodec.prototype._setEncodeChar = function(uCode, dbcsCode) {\n var bucket = this._getEncodeBucket(uCode);\n var low = uCode & 0xFF;\n if (bucket[low] <= SEQ_START)\n this.encodeTableSeq[SEQ_START-bucket[low]][DEF_CHAR] = dbcsCode; // There's already a sequence, set a single-char subsequence of it.\n else if (bucket[low] == UNASSIGNED)\n bucket[low] = dbcsCode;\n}\n\nDBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) {\n \n // Get the root of character tree according to first character of the sequence.\n var uCode = seq[0];\n var bucket = this._getEncodeBucket(uCode);\n var low = uCode & 0xFF;\n\n var node;\n if (bucket[low] <= SEQ_START) {\n // There's already a sequence with - use it.\n node = this.encodeTableSeq[SEQ_START-bucket[low]];\n }\n else {\n // There was no sequence object - allocate a new one.\n node = {};\n if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low]; // If a char was set before - make it a single-char subsequence.\n bucket[low] = SEQ_START - this.encodeTableSeq.length;\n this.encodeTableSeq.push(node);\n }\n\n // Traverse the character tree, allocating new nodes as needed.\n for (var j = 1; j < seq.length-1; j++) {\n var oldVal = node[uCode];\n if (typeof oldVal === 'object')\n node = oldVal;\n else {\n node = node[uCode] = {}\n if (oldVal !== undefined)\n node[DEF_CHAR] = oldVal\n }\n }\n\n // Set the leaf to given dbcsCode.\n uCode = seq[seq.length-1];\n node[uCode] = dbcsCode;\n}\n\nDBCSCodec.prototype._fillEncodeTable = function(nodeIdx, prefix, skipEncodeChars) {\n var node = this.decodeTables[nodeIdx];\n for (var i = 0; i < 0x100; i++) {\n var uCode = node[i];\n var mbCode = prefix + i;\n if (skipEncodeChars[mbCode])\n continue;\n\n if (uCode >= 0)\n this._setEncodeChar(uCode, mbCode);\n else if (uCode <= NODE_START)\n this._fillEncodeTable(NODE_START - uCode, mbCode << 8, skipEncodeChars);\n else if (uCode <= SEQ_START)\n this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode);\n }\n}\n\n\n\n// == Encoder ==================================================================\n\nfunction DBCSEncoder(options, codec) {\n // Encoder state\n this.leadSurrogate = -1;\n this.seqObj = undefined;\n \n // Static data\n this.encodeTable = codec.encodeTable;\n this.encodeTableSeq = codec.encodeTableSeq;\n this.defaultCharSingleByte = codec.defCharSB;\n this.gb18030 = codec.gb18030;\n}\n\nDBCSEncoder.prototype.write = function(str) {\n var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)),\n leadSurrogate = this.leadSurrogate,\n seqObj = this.seqObj, nextChar = -1,\n i = 0, j = 0;\n\n while (true) {\n // 0. Get next character.\n if (nextChar === -1) {\n if (i == str.length) break;\n var uCode = str.charCodeAt(i++);\n }\n else {\n var uCode = nextChar;\n nextChar = -1; \n }\n\n // 1. Handle surrogates.\n if (0xD800 <= uCode && uCode < 0xE000) { // Char is one of surrogates.\n if (uCode < 0xDC00) { // We've got lead surrogate.\n if (leadSurrogate === -1) {\n leadSurrogate = uCode;\n continue;\n } else {\n leadSurrogate = uCode;\n // Double lead surrogate found.\n uCode = UNASSIGNED;\n }\n } else { // We've got trail surrogate.\n if (leadSurrogate !== -1) {\n uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00);\n leadSurrogate = -1;\n } else {\n // Incomplete surrogate pair - only trail surrogate found.\n uCode = UNASSIGNED;\n }\n \n }\n }\n else if (leadSurrogate !== -1) {\n // Incomplete surrogate pair - only lead surrogate found.\n nextChar = uCode; uCode = UNASSIGNED; // Write an error, then current char.\n leadSurrogate = -1;\n }\n\n // 2. Convert uCode character.\n var dbcsCode = UNASSIGNED;\n if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence\n var resCode = seqObj[uCode];\n if (typeof resCode === 'object') { // Sequence continues.\n seqObj = resCode;\n continue;\n\n } else if (typeof resCode == 'number') { // Sequence finished. Write it.\n dbcsCode = resCode;\n\n } else if (resCode == undefined) { // Current character is not part of the sequence.\n\n // Try default character for this sequence\n resCode = seqObj[DEF_CHAR];\n if (resCode !== undefined) {\n dbcsCode = resCode; // Found. Write it.\n nextChar = uCode; // Current character will be written too in the next iteration.\n\n } else {\n // TODO: What if we have no default? (resCode == undefined)\n // Then, we should write first char of the sequence as-is and try the rest recursively.\n // Didn't do it for now because no encoding has this situation yet.\n // Currently, just skip the sequence and write current char.\n }\n }\n seqObj = undefined;\n }\n else if (uCode >= 0) { // Regular character\n var subtable = this.encodeTable[uCode >> 8];\n if (subtable !== undefined)\n dbcsCode = subtable[uCode & 0xFF];\n \n if (dbcsCode <= SEQ_START) { // Sequence start\n seqObj = this.encodeTableSeq[SEQ_START-dbcsCode];\n continue;\n }\n\n if (dbcsCode == UNASSIGNED && this.gb18030) {\n // Use GB18030 algorithm to find character(s) to write.\n var idx = findIdx(this.gb18030.uChars, uCode);\n if (idx != -1) {\n var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]);\n newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600); dbcsCode = dbcsCode % 12600;\n newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260); dbcsCode = dbcsCode % 1260;\n newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10); dbcsCode = dbcsCode % 10;\n newBuf[j++] = 0x30 + dbcsCode;\n continue;\n }\n }\n }\n\n // 3. Write dbcsCode character.\n if (dbcsCode === UNASSIGNED)\n dbcsCode = this.defaultCharSingleByte;\n \n if (dbcsCode < 0x100) {\n newBuf[j++] = dbcsCode;\n }\n else if (dbcsCode < 0x10000) {\n newBuf[j++] = dbcsCode >> 8; // high byte\n newBuf[j++] = dbcsCode & 0xFF; // low byte\n }\n else {\n newBuf[j++] = dbcsCode >> 16;\n newBuf[j++] = (dbcsCode >> 8) & 0xFF;\n newBuf[j++] = dbcsCode & 0xFF;\n }\n }\n\n this.seqObj = seqObj;\n this.leadSurrogate = leadSurrogate;\n return newBuf.slice(0, j);\n}\n\nDBCSEncoder.prototype.end = function() {\n if (this.leadSurrogate === -1 && this.seqObj === undefined)\n return; // All clean. Most often case.\n\n var newBuf = Buffer.alloc(10), j = 0;\n\n if (this.seqObj) { // We're in the sequence.\n var dbcsCode = this.seqObj[DEF_CHAR];\n if (dbcsCode !== undefined) { // Write beginning of the sequence.\n if (dbcsCode < 0x100) {\n newBuf[j++] = dbcsCode;\n }\n else {\n newBuf[j++] = dbcsCode >> 8; // high byte\n newBuf[j++] = dbcsCode & 0xFF; // low byte\n }\n } else {\n // See todo above.\n }\n this.seqObj = undefined;\n }\n\n if (this.leadSurrogate !== -1) {\n // Incomplete surrogate pair - only lead surrogate found.\n newBuf[j++] = this.defaultCharSingleByte;\n this.leadSurrogate = -1;\n }\n \n return newBuf.slice(0, j);\n}\n\n// Export for testing\nDBCSEncoder.prototype.findIdx = findIdx;\n\n\n// == Decoder ==================================================================\n\nfunction DBCSDecoder(options, codec) {\n // Decoder state\n this.nodeIdx = 0;\n this.prevBuf = Buffer.alloc(0);\n\n // Static data\n this.decodeTables = codec.decodeTables;\n this.decodeTableSeq = codec.decodeTableSeq;\n this.defaultCharUnicode = codec.defaultCharUnicode;\n this.gb18030 = codec.gb18030;\n}\n\nDBCSDecoder.prototype.write = function(buf) {\n var newBuf = Buffer.alloc(buf.length*2),\n nodeIdx = this.nodeIdx, \n prevBuf = this.prevBuf, prevBufOffset = this.prevBuf.length,\n seqStart = -this.prevBuf.length, // idx of the start of current parsed sequence.\n uCode;\n\n if (prevBufOffset > 0) // Make prev buf overlap a little to make it easier to slice later.\n prevBuf = Buffer.concat([prevBuf, buf.slice(0, 10)]);\n \n for (var i = 0, j = 0; i < buf.length; i++) {\n var curByte = (i >= 0) ? buf[i] : prevBuf[i + prevBufOffset];\n\n // Lookup in current trie node.\n var uCode = this.decodeTables[nodeIdx][curByte];\n\n if (uCode >= 0) { \n // Normal character, just use it.\n }\n else if (uCode === UNASSIGNED) { // Unknown char.\n // TODO: Callback with seq.\n //var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset);\n i = seqStart; // Try to parse again, after skipping first byte of the sequence ('i' will be incremented by 'for' cycle).\n uCode = this.defaultCharUnicode.charCodeAt(0);\n }\n else if (uCode === GB18030_CODE) {\n var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset);\n var ptr = (curSeq[0]-0x81)*12600 + (curSeq[1]-0x30)*1260 + (curSeq[2]-0x81)*10 + (curSeq[3]-0x30);\n var idx = findIdx(this.gb18030.gbChars, ptr);\n uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx];\n }\n else if (uCode <= NODE_START) { // Go to next trie node.\n nodeIdx = NODE_START - uCode;\n continue;\n }\n else if (uCode <= SEQ_START) { // Output a sequence of chars.\n var seq = this.decodeTableSeq[SEQ_START - uCode];\n for (var k = 0; k < seq.length - 1; k++) {\n uCode = seq[k];\n newBuf[j++] = uCode & 0xFF;\n newBuf[j++] = uCode >> 8;\n }\n uCode = seq[seq.length-1];\n }\n else\n throw new Error(\"iconv-lite internal error: invalid decoding table value \" + uCode + \" at \" + nodeIdx + \"/\" + curByte);\n\n // Write the character to buffer, handling higher planes using surrogate pair.\n if (uCode > 0xFFFF) { \n uCode -= 0x10000;\n var uCodeLead = 0xD800 + Math.floor(uCode / 0x400);\n newBuf[j++] = uCodeLead & 0xFF;\n newBuf[j++] = uCodeLead >> 8;\n\n uCode = 0xDC00 + uCode % 0x400;\n }\n newBuf[j++] = uCode & 0xFF;\n newBuf[j++] = uCode >> 8;\n\n // Reset trie node.\n nodeIdx = 0; seqStart = i+1;\n }\n\n this.nodeIdx = nodeIdx;\n this.prevBuf = (seqStart >= 0) ? buf.slice(seqStart) : prevBuf.slice(seqStart + prevBufOffset);\n return newBuf.slice(0, j).toString('ucs2');\n}\n\nDBCSDecoder.prototype.end = function() {\n var ret = '';\n\n // Try to parse all remaining chars.\n while (this.prevBuf.length > 0) {\n // Skip 1 character in the buffer.\n ret += this.defaultCharUnicode;\n var buf = this.prevBuf.slice(1);\n\n // Parse remaining as usual.\n this.prevBuf = Buffer.alloc(0);\n this.nodeIdx = 0;\n if (buf.length > 0)\n ret += this.write(buf);\n }\n\n this.nodeIdx = 0;\n return ret;\n}\n\n// Binary search for GB18030. Returns largest i such that table[i] <= val.\nfunction findIdx(table, val) {\n if (table[0] > val)\n return -1;\n\n var l = 0, r = table.length;\n while (l < r-1) { // always table[l] <= val < table[r]\n var mid = l + Math.floor((r-l+1)/2);\n if (table[mid] <= val)\n l = mid;\n else\n r = mid;\n }\n return l;\n}\n\n","\"use strict\";\n\n// Description of supported double byte encodings and aliases.\n// Tables are not require()-d until they are needed to speed up library load.\n// require()-s are direct to support Browserify.\n\nmodule.exports = {\n \n // == Japanese/ShiftJIS ====================================================\n // All japanese encodings are based on JIS X set of standards:\n // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF.\n // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. \n // Has several variations in 1978, 1983, 1990 and 1997.\n // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead.\n // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233.\n // 2 planes, first is superset of 0208, second - revised 0212.\n // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx)\n\n // Byte encodings are:\n // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte\n // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC.\n // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI.\n // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes.\n // 0x00-0x7F - lower part of 0201\n // 0x8E, 0xA1-0xDF - upper part of 0201\n // (0xA1-0xFE)x2 - 0208 plane (94x94).\n // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94).\n // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon.\n // Used as-is in ISO2022 family.\n // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, \n // 0201-1976 Roman, 0208-1978, 0208-1983.\n // * ISO2022-JP-1: Adds esc seq for 0212-1990.\n // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7.\n // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2.\n // * ISO2022-JP-2004: Adds 0213-2004 Plane 1.\n //\n // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes.\n //\n // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html\n\n 'shiftjis': {\n type: '_dbcs',\n table: function() { return require('./tables/shiftjis.json') },\n encodeAdd: {'\\u00a5': 0x5C, '\\u203E': 0x7E},\n encodeSkipVals: [{from: 0xED40, to: 0xF940}],\n },\n 'csshiftjis': 'shiftjis',\n 'mskanji': 'shiftjis',\n 'sjis': 'shiftjis',\n 'windows31j': 'shiftjis',\n 'ms31j': 'shiftjis',\n 'xsjis': 'shiftjis',\n 'windows932': 'shiftjis',\n 'ms932': 'shiftjis',\n '932': 'shiftjis',\n 'cp932': 'shiftjis',\n\n 'eucjp': {\n type: '_dbcs',\n table: function() { return require('./tables/eucjp.json') },\n encodeAdd: {'\\u00a5': 0x5C, '\\u203E': 0x7E},\n },\n\n // TODO: KDDI extension to Shift_JIS\n // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes.\n // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars.\n\n\n // == Chinese/GBK ==========================================================\n // http://en.wikipedia.org/wiki/GBK\n // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder\n\n // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936\n 'gb2312': 'cp936',\n 'gb231280': 'cp936',\n 'gb23121980': 'cp936',\n 'csgb2312': 'cp936',\n 'csiso58gb231280': 'cp936',\n 'euccn': 'cp936',\n\n // Microsoft's CP936 is a subset and approximation of GBK.\n 'windows936': 'cp936',\n 'ms936': 'cp936',\n '936': 'cp936',\n 'cp936': {\n type: '_dbcs',\n table: function() { return require('./tables/cp936.json') },\n },\n\n // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other.\n 'gbk': {\n type: '_dbcs',\n table: function() { return require('./tables/cp936.json').concat(require('./tables/gbk-added.json')) },\n },\n 'xgbk': 'gbk',\n 'isoir58': 'gbk',\n\n // GB18030 is an algorithmic extension of GBK.\n // Main source: https://www.w3.org/TR/encoding/#gbk-encoder\n // http://icu-project.org/docs/papers/gb18030.html\n // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml\n // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0\n 'gb18030': {\n type: '_dbcs',\n table: function() { return require('./tables/cp936.json').concat(require('./tables/gbk-added.json')) },\n gb18030: function() { return require('./tables/gb18030-ranges.json') },\n encodeSkipVals: [0x80],\n encodeAdd: {'€': 0xA2E3},\n },\n\n 'chinese': 'gb18030',\n\n\n // == Korean ===============================================================\n // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same.\n 'windows949': 'cp949',\n 'ms949': 'cp949',\n '949': 'cp949',\n 'cp949': {\n type: '_dbcs',\n table: function() { return require('./tables/cp949.json') },\n },\n\n 'cseuckr': 'cp949',\n 'csksc56011987': 'cp949',\n 'euckr': 'cp949',\n 'isoir149': 'cp949',\n 'korean': 'cp949',\n 'ksc56011987': 'cp949',\n 'ksc56011989': 'cp949',\n 'ksc5601': 'cp949',\n\n\n // == Big5/Taiwan/Hong Kong ================================================\n // There are lots of tables for Big5 and cp950. Please see the following links for history:\n // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html\n // Variations, in roughly number of defined chars:\n // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT\n // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/\n // * Big5-2003 (Taiwan standard) almost superset of cp950.\n // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers.\n // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. \n // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years.\n // Plus, it has 4 combining sequences.\n // 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\n // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way.\n // Implementations are not consistent within browsers; sometimes labeled as just big5.\n // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied.\n // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31\n // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s.\n // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt\n // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt\n // \n // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder\n // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong.\n\n 'windows950': 'cp950',\n 'ms950': 'cp950',\n '950': 'cp950',\n 'cp950': {\n type: '_dbcs',\n table: function() { return require('./tables/cp950.json') },\n },\n\n // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus.\n 'big5': 'big5hkscs',\n 'big5hkscs': {\n type: '_dbcs',\n table: function() { return require('./tables/cp950.json').concat(require('./tables/big5-added.json')) },\n encodeSkipVals: [0xa2cc],\n },\n\n 'cnbig5': 'big5hkscs',\n 'csbig5': 'big5hkscs',\n 'xxbig5': 'big5hkscs',\n};\n","\"use strict\";\n\n// Update this array if you add/rename/remove files in this directory.\n// We support Browserify by skipping automatic module discovery and requiring modules directly.\nvar modules = [\n require(\"./internal\"),\n require(\"./utf16\"),\n require(\"./utf7\"),\n require(\"./sbcs-codec\"),\n require(\"./sbcs-data\"),\n require(\"./sbcs-data-generated\"),\n require(\"./dbcs-codec\"),\n require(\"./dbcs-data\"),\n];\n\n// Put all encoding/alias/codec definitions to single object and export it. \nfor (var i = 0; i < modules.length; i++) {\n var module = modules[i];\n for (var enc in module)\n if (Object.prototype.hasOwnProperty.call(module, enc))\n exports[enc] = module[enc];\n}\n","\"use strict\";\nvar Buffer = require(\"safer-buffer\").Buffer;\n\n// Export Node.js internal encodings.\n\nmodule.exports = {\n // Encodings\n utf8: { type: \"_internal\", bomAware: true},\n cesu8: { type: \"_internal\", bomAware: true},\n unicode11utf8: \"utf8\",\n\n ucs2: { type: \"_internal\", bomAware: true},\n utf16le: \"ucs2\",\n\n binary: { type: \"_internal\" },\n base64: { type: \"_internal\" },\n hex: { type: \"_internal\" },\n\n // Codec.\n _internal: InternalCodec,\n};\n\n//------------------------------------------------------------------------------\n\nfunction InternalCodec(codecOptions, iconv) {\n this.enc = codecOptions.encodingName;\n this.bomAware = codecOptions.bomAware;\n\n if (this.enc === \"base64\")\n this.encoder = InternalEncoderBase64;\n else if (this.enc === \"cesu8\") {\n this.enc = \"utf8\"; // Use utf8 for decoding.\n this.encoder = InternalEncoderCesu8;\n\n // Add decoder for versions of Node not supporting CESU-8\n if (Buffer.from('eda0bdedb2a9', 'hex').toString() !== '💩') {\n this.decoder = InternalDecoderCesu8;\n this.defaultCharUnicode = iconv.defaultCharUnicode;\n }\n }\n}\n\nInternalCodec.prototype.encoder = InternalEncoder;\nInternalCodec.prototype.decoder = InternalDecoder;\n\n//------------------------------------------------------------------------------\n\n// We use node.js internal decoder. Its signature is the same as ours.\nvar StringDecoder = require('string_decoder').StringDecoder;\n\nif (!StringDecoder.prototype.end) // Node v0.8 doesn't have this method.\n StringDecoder.prototype.end = function() {};\n\n\nfunction InternalDecoder(options, codec) {\n StringDecoder.call(this, codec.enc);\n}\n\nInternalDecoder.prototype = StringDecoder.prototype;\n\n\n//------------------------------------------------------------------------------\n// Encoder is mostly trivial\n\nfunction InternalEncoder(options, codec) {\n this.enc = codec.enc;\n}\n\nInternalEncoder.prototype.write = function(str) {\n return Buffer.from(str, this.enc);\n}\n\nInternalEncoder.prototype.end = function() {\n}\n\n\n//------------------------------------------------------------------------------\n// Except base64 encoder, which must keep its state.\n\nfunction InternalEncoderBase64(options, codec) {\n this.prevStr = '';\n}\n\nInternalEncoderBase64.prototype.write = function(str) {\n str = this.prevStr + str;\n var completeQuads = str.length - (str.length % 4);\n this.prevStr = str.slice(completeQuads);\n str = str.slice(0, completeQuads);\n\n return Buffer.from(str, \"base64\");\n}\n\nInternalEncoderBase64.prototype.end = function() {\n return Buffer.from(this.prevStr, \"base64\");\n}\n\n\n//------------------------------------------------------------------------------\n// CESU-8 encoder is also special.\n\nfunction InternalEncoderCesu8(options, codec) {\n}\n\nInternalEncoderCesu8.prototype.write = function(str) {\n var buf = Buffer.alloc(str.length * 3), bufIdx = 0;\n for (var i = 0; i < str.length; i++) {\n var charCode = str.charCodeAt(i);\n // Naive implementation, but it works because CESU-8 is especially easy\n // to convert from UTF-16 (which all JS strings are encoded in).\n if (charCode < 0x80)\n buf[bufIdx++] = charCode;\n else if (charCode < 0x800) {\n buf[bufIdx++] = 0xC0 + (charCode >>> 6);\n buf[bufIdx++] = 0x80 + (charCode & 0x3f);\n }\n else { // charCode will always be < 0x10000 in javascript.\n buf[bufIdx++] = 0xE0 + (charCode >>> 12);\n buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f);\n buf[bufIdx++] = 0x80 + (charCode & 0x3f);\n }\n }\n return buf.slice(0, bufIdx);\n}\n\nInternalEncoderCesu8.prototype.end = function() {\n}\n\n//------------------------------------------------------------------------------\n// CESU-8 decoder is not implemented in Node v4.0+\n\nfunction InternalDecoderCesu8(options, codec) {\n this.acc = 0;\n this.contBytes = 0;\n this.accBytes = 0;\n this.defaultCharUnicode = codec.defaultCharUnicode;\n}\n\nInternalDecoderCesu8.prototype.write = function(buf) {\n var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes, \n res = '';\n for (var i = 0; i < buf.length; i++) {\n var curByte = buf[i];\n if ((curByte & 0xC0) !== 0x80) { // Leading byte\n if (contBytes > 0) { // Previous code is invalid\n res += this.defaultCharUnicode;\n contBytes = 0;\n }\n\n if (curByte < 0x80) { // Single-byte code\n res += String.fromCharCode(curByte);\n } else if (curByte < 0xE0) { // Two-byte code\n acc = curByte & 0x1F;\n contBytes = 1; accBytes = 1;\n } else if (curByte < 0xF0) { // Three-byte code\n acc = curByte & 0x0F;\n contBytes = 2; accBytes = 1;\n } else { // Four or more are not supported for CESU-8.\n res += this.defaultCharUnicode;\n }\n } else { // Continuation byte\n if (contBytes > 0) { // We're waiting for it.\n acc = (acc << 6) | (curByte & 0x3f);\n contBytes--; accBytes++;\n if (contBytes === 0) {\n // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80)\n if (accBytes === 2 && acc < 0x80 && acc > 0)\n res += this.defaultCharUnicode;\n else if (accBytes === 3 && acc < 0x800)\n res += this.defaultCharUnicode;\n else\n // Actually add character.\n res += String.fromCharCode(acc);\n }\n } else { // Unexpected continuation byte\n res += this.defaultCharUnicode;\n }\n }\n }\n this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes;\n return res;\n}\n\nInternalDecoderCesu8.prototype.end = function() {\n var res = 0;\n if (this.contBytes > 0)\n res += this.defaultCharUnicode;\n return res;\n}\n","\"use strict\";\nvar Buffer = require(\"safer-buffer\").Buffer;\n\n// Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that\n// correspond to encoded bytes (if 128 - then lower half is ASCII). \n\nexports._sbcs = SBCSCodec;\nfunction SBCSCodec(codecOptions, iconv) {\n if (!codecOptions)\n throw new Error(\"SBCS codec is called without the data.\")\n \n // Prepare char buffer for decoding.\n if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256))\n throw new Error(\"Encoding '\"+codecOptions.type+\"' has incorrect 'chars' (must be of len 128 or 256)\");\n \n if (codecOptions.chars.length === 128) {\n var asciiString = \"\";\n for (var i = 0; i < 128; i++)\n asciiString += String.fromCharCode(i);\n codecOptions.chars = asciiString + codecOptions.chars;\n }\n\n this.decodeBuf = Buffer.from(codecOptions.chars, 'ucs2');\n \n // Encoding buffer.\n var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0));\n\n for (var i = 0; i < codecOptions.chars.length; i++)\n encodeBuf[codecOptions.chars.charCodeAt(i)] = i;\n\n this.encodeBuf = encodeBuf;\n}\n\nSBCSCodec.prototype.encoder = SBCSEncoder;\nSBCSCodec.prototype.decoder = SBCSDecoder;\n\n\nfunction SBCSEncoder(options, codec) {\n this.encodeBuf = codec.encodeBuf;\n}\n\nSBCSEncoder.prototype.write = function(str) {\n var buf = Buffer.alloc(str.length);\n for (var i = 0; i < str.length; i++)\n buf[i] = this.encodeBuf[str.charCodeAt(i)];\n \n return buf;\n}\n\nSBCSEncoder.prototype.end = function() {\n}\n\n\nfunction SBCSDecoder(options, codec) {\n this.decodeBuf = codec.decodeBuf;\n}\n\nSBCSDecoder.prototype.write = function(buf) {\n // Strings are immutable in JS -> we use ucs2 buffer to speed up computations.\n var decodeBuf = this.decodeBuf;\n var newBuf = Buffer.alloc(buf.length*2);\n var idx1 = 0, idx2 = 0;\n for (var i = 0; i < buf.length; i++) {\n idx1 = buf[i]*2; idx2 = i*2;\n newBuf[idx2] = decodeBuf[idx1];\n newBuf[idx2+1] = decodeBuf[idx1+1];\n }\n return newBuf.toString('ucs2');\n}\n\nSBCSDecoder.prototype.end = function() {\n}\n","\"use strict\";\n\n// Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script.\nmodule.exports = {\n \"437\": \"cp437\",\n \"737\": \"cp737\",\n \"775\": \"cp775\",\n \"850\": \"cp850\",\n \"852\": \"cp852\",\n \"855\": \"cp855\",\n \"856\": \"cp856\",\n \"857\": \"cp857\",\n \"858\": \"cp858\",\n \"860\": \"cp860\",\n \"861\": \"cp861\",\n \"862\": \"cp862\",\n \"863\": \"cp863\",\n \"864\": \"cp864\",\n \"865\": \"cp865\",\n \"866\": \"cp866\",\n \"869\": \"cp869\",\n \"874\": \"windows874\",\n \"922\": \"cp922\",\n \"1046\": \"cp1046\",\n \"1124\": \"cp1124\",\n \"1125\": \"cp1125\",\n \"1129\": \"cp1129\",\n \"1133\": \"cp1133\",\n \"1161\": \"cp1161\",\n \"1162\": \"cp1162\",\n \"1163\": \"cp1163\",\n \"1250\": \"windows1250\",\n \"1251\": \"windows1251\",\n \"1252\": \"windows1252\",\n \"1253\": \"windows1253\",\n \"1254\": \"windows1254\",\n \"1255\": \"windows1255\",\n \"1256\": \"windows1256\",\n \"1257\": \"windows1257\",\n \"1258\": \"windows1258\",\n \"28591\": \"iso88591\",\n \"28592\": \"iso88592\",\n \"28593\": \"iso88593\",\n \"28594\": \"iso88594\",\n \"28595\": \"iso88595\",\n \"28596\": \"iso88596\",\n \"28597\": \"iso88597\",\n \"28598\": \"iso88598\",\n \"28599\": \"iso88599\",\n \"28600\": \"iso885910\",\n \"28601\": \"iso885911\",\n \"28603\": \"iso885913\",\n \"28604\": \"iso885914\",\n \"28605\": \"iso885915\",\n \"28606\": \"iso885916\",\n \"windows874\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����\"\n },\n \"win874\": \"windows874\",\n \"cp874\": \"windows874\",\n \"windows1250\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙\"\n },\n \"win1250\": \"windows1250\",\n \"cp1250\": \"windows1250\",\n \"windows1251\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя\"\n },\n \"win1251\": \"windows1251\",\n \"cp1251\": \"windows1251\",\n \"windows1252\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ\"\n },\n \"win1252\": \"windows1252\",\n \"cp1252\": \"windows1252\",\n \"windows1253\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�\"\n },\n \"win1253\": \"windows1253\",\n \"cp1253\": \"windows1253\",\n \"windows1254\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ\"\n },\n \"win1254\": \"windows1254\",\n \"cp1254\": \"windows1254\",\n \"windows1255\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�\"\n },\n \"win1255\": \"windows1255\",\n \"cp1255\": \"windows1255\",\n \"windows1256\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے\"\n },\n \"win1256\": \"windows1256\",\n \"cp1256\": \"windows1256\",\n \"windows1257\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙\"\n },\n \"win1257\": \"windows1257\",\n \"cp1257\": \"windows1257\",\n \"windows1258\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ\"\n },\n \"win1258\": \"windows1258\",\n \"cp1258\": \"windows1258\",\n \"iso88591\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ\"\n },\n \"cp28591\": \"iso88591\",\n \"iso88592\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙\"\n },\n \"cp28592\": \"iso88592\",\n \"iso88593\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�Ż°ħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙\"\n },\n \"cp28593\": \"iso88593\",\n \"iso88594\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤ĨĻ§¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩļˇ¸šēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖ×ØŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙\"\n },\n \"cp28594\": \"iso88594\",\n \"iso88595\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ\"\n },\n \"cp28595\": \"iso88595\",\n \"iso88596\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������\"\n },\n \"cp28596\": \"iso88596\",\n \"iso88597\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�\"\n },\n \"cp28597\": \"iso88597\",\n \"iso88598\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�\"\n },\n \"cp28598\": \"iso88598\",\n \"iso88599\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ\"\n },\n \"cp28599\": \"iso88599\",\n \"iso885910\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨĶ§ĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ\"\n },\n \"cp28600\": \"iso885910\",\n \"iso885911\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����\"\n },\n \"cp28601\": \"iso885911\",\n \"iso885913\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’\"\n },\n \"cp28603\": \"iso885913\",\n \"iso885914\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ\"\n },\n \"cp28604\": \"iso885914\",\n \"iso885915\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ\"\n },\n \"cp28605\": \"iso885915\",\n \"iso885916\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Š§š©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ\"\n },\n \"cp28606\": \"iso885916\",\n \"cp437\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ \"\n },\n \"ibm437\": \"cp437\",\n \"csibm437\": \"cp437\",\n \"cp737\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ \"\n },\n \"ibm737\": \"cp737\",\n \"csibm737\": \"cp737\",\n \"cp775\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£ØפĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ \"\n },\n \"ibm775\": \"cp775\",\n \"csibm775\": \"cp775\",\n \"cp850\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ \"\n },\n \"ibm850\": \"cp850\",\n \"csibm850\": \"cp850\",\n \"cp852\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ \"\n },\n \"ibm852\": \"cp852\",\n \"csibm852\": \"cp852\",\n \"cp855\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ \"\n },\n \"ibm855\": \"cp855\",\n \"csibm855\": \"cp855\",\n \"cp856\": {\n \"type\": \"_sbcs\",\n \"chars\": \"אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ \"\n },\n \"ibm856\": \"cp856\",\n \"csibm856\": \"cp856\",\n \"cp857\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ \"\n },\n \"ibm857\": \"cp857\",\n \"csibm857\": \"cp857\",\n \"cp858\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ \"\n },\n \"ibm858\": \"cp858\",\n \"csibm858\": \"cp858\",\n \"cp860\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ \"\n },\n \"ibm860\": \"cp860\",\n \"csibm860\": \"cp860\",\n \"cp861\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ \"\n },\n \"ibm861\": \"cp861\",\n \"csibm861\": \"cp861\",\n \"cp862\": {\n \"type\": \"_sbcs\",\n \"chars\": \"אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ \"\n },\n \"ibm862\": \"cp862\",\n \"csibm862\": \"cp862\",\n \"cp863\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ \"\n },\n \"ibm863\": \"cp863\",\n \"csibm863\": \"cp863\",\n \"cp864\": {\n \"type\": \"_sbcs\",\n \"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{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�\"\n },\n \"ibm864\": \"cp864\",\n \"csibm864\": \"cp864\",\n \"cp865\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ \"\n },\n \"ibm865\": \"cp865\",\n \"csibm865\": \"cp865\",\n \"cp866\": {\n \"type\": \"_sbcs\",\n \"chars\": \"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ \"\n },\n \"ibm866\": \"cp866\",\n \"csibm866\": \"cp866\",\n \"cp869\": {\n \"type\": \"_sbcs\",\n \"chars\": \"������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ \"\n },\n \"ibm869\": \"cp869\",\n \"csibm869\": \"cp869\",\n \"cp922\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖ×ØÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ\"\n },\n \"ibm922\": \"cp922\",\n \"csibm922\": \"cp922\",\n \"cp1046\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�\"\n },\n \"ibm1046\": \"cp1046\",\n \"csibm1046\": \"cp1046\",\n \"cp1124\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ\"\n },\n \"ibm1124\": \"cp1124\",\n \"csibm1124\": \"cp1124\",\n \"cp1125\": {\n \"type\": \"_sbcs\",\n \"chars\": \"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ \"\n },\n \"ibm1125\": \"cp1125\",\n \"csibm1125\": \"cp1125\",\n \"cp1129\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ\"\n },\n \"ibm1129\": \"cp1129\",\n \"csibm1129\": \"cp1129\",\n \"cp1133\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�\"\n },\n \"ibm1133\": \"cp1133\",\n \"csibm1133\": \"cp1133\",\n \"cp1161\": {\n \"type\": \"_sbcs\",\n \"chars\": \"��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ \"\n },\n \"ibm1161\": \"cp1161\",\n \"csibm1161\": \"cp1161\",\n \"cp1162\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����\"\n },\n \"ibm1162\": \"cp1162\",\n \"csibm1162\": \"cp1162\",\n \"cp1163\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ\"\n },\n \"ibm1163\": \"cp1163\",\n \"csibm1163\": \"cp1163\",\n \"maccroatian\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ\"\n },\n \"maccyrillic\": {\n \"type\": \"_sbcs\",\n \"chars\": \"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤\"\n },\n \"macgreek\": {\n \"type\": \"_sbcs\",\n \"chars\": \"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�\"\n },\n \"maciceland\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ\"\n },\n \"macroman\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ\"\n },\n \"macromania\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ\"\n },\n \"macthai\": {\n \"type\": \"_sbcs\",\n \"chars\": \"«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����\"\n },\n \"macturkish\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ\"\n },\n \"macukraine\": {\n \"type\": \"_sbcs\",\n \"chars\": \"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤\"\n },\n \"koi8r\": {\n \"type\": \"_sbcs\",\n \"chars\": \"─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ\"\n },\n \"koi8u\": {\n \"type\": \"_sbcs\",\n \"chars\": \"─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ\"\n },\n \"koi8ru\": {\n \"type\": \"_sbcs\",\n \"chars\": \"─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ\"\n },\n \"koi8t\": {\n \"type\": \"_sbcs\",\n \"chars\": \"қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ\"\n },\n \"armscii8\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�\"\n },\n \"rk1048\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя\"\n },\n \"tcvn\": {\n \"type\": \"_sbcs\",\n \"chars\": \"\\u0000ÚỤ\\u0003ỪỬỮ\\u0007\\b\\t\\n\\u000b\\f\\r\\u000e\\u000f\\u0010ỨỰỲỶỸÝỴ\\u0018\\u0019\\u001a\\u001b\\u001c\\u001d\\u001e\\u001f !\\\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ\"\n },\n \"georgianacademy\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ\"\n },\n \"georgianps\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ\"\n },\n \"pt154\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя\"\n },\n \"viscii\": {\n \"type\": \"_sbcs\",\n \"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{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ\"\n },\n \"iso646cn\": {\n \"type\": \"_sbcs\",\n \"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{|}‾��������������������������������������������������������������������������������������������������������������������������������\"\n },\n \"iso646jp\": {\n \"type\": \"_sbcs\",\n \"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{|}‾��������������������������������������������������������������������������������������������������������������������������������\"\n },\n \"hproman8\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�\"\n },\n \"macintosh\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ\"\n },\n \"ascii\": {\n \"type\": \"_sbcs\",\n \"chars\": \"��������������������������������������������������������������������������������������������������������������������������������\"\n },\n \"tis620\": {\n \"type\": \"_sbcs\",\n \"chars\": \"���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����\"\n }\n}","\"use strict\";\n\n// Manually added data to be used by sbcs codec in addition to generated one.\n\nmodule.exports = {\n // Not supported by iconv, not sure why.\n \"10029\": \"maccenteuro\",\n \"maccenteuro\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ\"\n },\n\n \"808\": \"cp808\",\n \"ibm808\": \"cp808\",\n \"cp808\": {\n \"type\": \"_sbcs\",\n \"chars\": \"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ \"\n },\n\n \"mik\": {\n \"type\": \"_sbcs\",\n \"chars\": \"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ \"\n },\n\n // Aliases of generated encodings.\n \"ascii8bit\": \"ascii\",\n \"usascii\": \"ascii\",\n \"ansix34\": \"ascii\",\n \"ansix341968\": \"ascii\",\n \"ansix341986\": \"ascii\",\n \"csascii\": \"ascii\",\n \"cp367\": \"ascii\",\n \"ibm367\": \"ascii\",\n \"isoir6\": \"ascii\",\n \"iso646us\": \"ascii\",\n \"iso646irv\": \"ascii\",\n \"us\": \"ascii\",\n\n \"latin1\": \"iso88591\",\n \"latin2\": \"iso88592\",\n \"latin3\": \"iso88593\",\n \"latin4\": \"iso88594\",\n \"latin5\": \"iso88599\",\n \"latin6\": \"iso885910\",\n \"latin7\": \"iso885913\",\n \"latin8\": \"iso885914\",\n \"latin9\": \"iso885915\",\n \"latin10\": \"iso885916\",\n\n \"csisolatin1\": \"iso88591\",\n \"csisolatin2\": \"iso88592\",\n \"csisolatin3\": \"iso88593\",\n \"csisolatin4\": \"iso88594\",\n \"csisolatincyrillic\": \"iso88595\",\n \"csisolatinarabic\": \"iso88596\",\n \"csisolatingreek\" : \"iso88597\",\n \"csisolatinhebrew\": \"iso88598\",\n \"csisolatin5\": \"iso88599\",\n \"csisolatin6\": \"iso885910\",\n\n \"l1\": \"iso88591\",\n \"l2\": \"iso88592\",\n \"l3\": \"iso88593\",\n \"l4\": \"iso88594\",\n \"l5\": \"iso88599\",\n \"l6\": \"iso885910\",\n \"l7\": \"iso885913\",\n \"l8\": \"iso885914\",\n \"l9\": \"iso885915\",\n \"l10\": \"iso885916\",\n\n \"isoir14\": \"iso646jp\",\n \"isoir57\": \"iso646cn\",\n \"isoir100\": \"iso88591\",\n \"isoir101\": \"iso88592\",\n \"isoir109\": \"iso88593\",\n \"isoir110\": \"iso88594\",\n \"isoir144\": \"iso88595\",\n \"isoir127\": \"iso88596\",\n \"isoir126\": \"iso88597\",\n \"isoir138\": \"iso88598\",\n \"isoir148\": \"iso88599\",\n \"isoir157\": \"iso885910\",\n \"isoir166\": \"tis620\",\n \"isoir179\": \"iso885913\",\n \"isoir199\": \"iso885914\",\n \"isoir203\": \"iso885915\",\n \"isoir226\": \"iso885916\",\n\n \"cp819\": \"iso88591\",\n \"ibm819\": \"iso88591\",\n\n \"cyrillic\": \"iso88595\",\n\n \"arabic\": \"iso88596\",\n \"arabic8\": \"iso88596\",\n \"ecma114\": \"iso88596\",\n \"asmo708\": \"iso88596\",\n\n \"greek\" : \"iso88597\",\n \"greek8\" : \"iso88597\",\n \"ecma118\" : \"iso88597\",\n \"elot928\" : \"iso88597\",\n\n \"hebrew\": \"iso88598\",\n \"hebrew8\": \"iso88598\",\n\n \"turkish\": \"iso88599\",\n \"turkish8\": \"iso88599\",\n\n \"thai\": \"iso885911\",\n \"thai8\": \"iso885911\",\n\n \"celtic\": \"iso885914\",\n \"celtic8\": \"iso885914\",\n \"isoceltic\": \"iso885914\",\n\n \"tis6200\": \"tis620\",\n \"tis62025291\": \"tis620\",\n \"tis62025330\": \"tis620\",\n\n \"10000\": \"macroman\",\n \"10006\": \"macgreek\",\n \"10007\": \"maccyrillic\",\n \"10079\": \"maciceland\",\n \"10081\": \"macturkish\",\n\n \"cspc8codepage437\": \"cp437\",\n \"cspc775baltic\": \"cp775\",\n \"cspc850multilingual\": \"cp850\",\n \"cspcp852\": \"cp852\",\n \"cspc862latinhebrew\": \"cp862\",\n \"cpgr\": \"cp869\",\n\n \"msee\": \"cp1250\",\n \"mscyrl\": \"cp1251\",\n \"msansi\": \"cp1252\",\n \"msgreek\": \"cp1253\",\n \"msturk\": \"cp1254\",\n \"mshebr\": \"cp1255\",\n \"msarab\": \"cp1256\",\n \"winbaltrim\": \"cp1257\",\n\n \"cp20866\": \"koi8r\",\n \"20866\": \"koi8r\",\n \"ibm878\": \"koi8r\",\n \"cskoi8r\": \"koi8r\",\n\n \"cp21866\": \"koi8u\",\n \"21866\": \"koi8u\",\n \"ibm1168\": \"koi8u\",\n\n \"strk10482002\": \"rk1048\",\n\n \"tcvn5712\": \"tcvn\",\n \"tcvn57121\": \"tcvn\",\n\n \"gb198880\": \"iso646cn\",\n \"cn\": \"iso646cn\",\n\n \"csiso14jisc6220ro\": \"iso646jp\",\n \"jisc62201969ro\": \"iso646jp\",\n \"jp\": \"iso646jp\",\n\n \"cshproman8\": \"hproman8\",\n \"r8\": \"hproman8\",\n \"roman8\": \"hproman8\",\n \"xroman8\": \"hproman8\",\n \"ibm1051\": \"hproman8\",\n\n \"mac\": \"macintosh\",\n \"csmacintosh\": \"macintosh\",\n};\n\n","\"use strict\";\nvar Buffer = require(\"safer-buffer\").Buffer;\n\n// Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js\n\n// == UTF16-BE codec. ==========================================================\n\nexports.utf16be = Utf16BECodec;\nfunction Utf16BECodec() {\n}\n\nUtf16BECodec.prototype.encoder = Utf16BEEncoder;\nUtf16BECodec.prototype.decoder = Utf16BEDecoder;\nUtf16BECodec.prototype.bomAware = true;\n\n\n// -- Encoding\n\nfunction Utf16BEEncoder() {\n}\n\nUtf16BEEncoder.prototype.write = function(str) {\n var buf = Buffer.from(str, 'ucs2');\n for (var i = 0; i < buf.length; i += 2) {\n var tmp = buf[i]; buf[i] = buf[i+1]; buf[i+1] = tmp;\n }\n return buf;\n}\n\nUtf16BEEncoder.prototype.end = function() {\n}\n\n\n// -- Decoding\n\nfunction Utf16BEDecoder() {\n this.overflowByte = -1;\n}\n\nUtf16BEDecoder.prototype.write = function(buf) {\n if (buf.length == 0)\n return '';\n\n var buf2 = Buffer.alloc(buf.length + 1),\n i = 0, j = 0;\n\n if (this.overflowByte !== -1) {\n buf2[0] = buf[0];\n buf2[1] = this.overflowByte;\n i = 1; j = 2;\n }\n\n for (; i < buf.length-1; i += 2, j+= 2) {\n buf2[j] = buf[i+1];\n buf2[j+1] = buf[i];\n }\n\n this.overflowByte = (i == buf.length-1) ? buf[buf.length-1] : -1;\n\n return buf2.slice(0, j).toString('ucs2');\n}\n\nUtf16BEDecoder.prototype.end = function() {\n}\n\n\n// == UTF-16 codec =============================================================\n// Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic.\n// Defaults to UTF-16LE, as it's prevalent and default in Node.\n// http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le\n// Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'});\n\n// Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false).\n\nexports.utf16 = Utf16Codec;\nfunction Utf16Codec(codecOptions, iconv) {\n this.iconv = iconv;\n}\n\nUtf16Codec.prototype.encoder = Utf16Encoder;\nUtf16Codec.prototype.decoder = Utf16Decoder;\n\n\n// -- Encoding (pass-through)\n\nfunction Utf16Encoder(options, codec) {\n options = options || {};\n if (options.addBOM === undefined)\n options.addBOM = true;\n this.encoder = codec.iconv.getEncoder('utf-16le', options);\n}\n\nUtf16Encoder.prototype.write = function(str) {\n return this.encoder.write(str);\n}\n\nUtf16Encoder.prototype.end = function() {\n return this.encoder.end();\n}\n\n\n// -- Decoding\n\nfunction Utf16Decoder(options, codec) {\n this.decoder = null;\n this.initialBytes = [];\n this.initialBytesLen = 0;\n\n this.options = options || {};\n this.iconv = codec.iconv;\n}\n\nUtf16Decoder.prototype.write = function(buf) {\n if (!this.decoder) {\n // Codec is not chosen yet. Accumulate initial bytes.\n this.initialBytes.push(buf);\n this.initialBytesLen += buf.length;\n \n if (this.initialBytesLen < 16) // We need more bytes to use space heuristic (see below)\n return '';\n\n // We have enough bytes -> detect endianness.\n var buf = Buffer.concat(this.initialBytes),\n encoding = detectEncoding(buf, this.options.defaultEncoding);\n this.decoder = this.iconv.getDecoder(encoding, this.options);\n this.initialBytes.length = this.initialBytesLen = 0;\n }\n\n return this.decoder.write(buf);\n}\n\nUtf16Decoder.prototype.end = function() {\n if (!this.decoder) {\n var buf = Buffer.concat(this.initialBytes),\n encoding = detectEncoding(buf, this.options.defaultEncoding);\n this.decoder = this.iconv.getDecoder(encoding, this.options);\n\n var res = this.decoder.write(buf),\n trail = this.decoder.end();\n\n return trail ? (res + trail) : res;\n }\n return this.decoder.end();\n}\n\nfunction detectEncoding(buf, defaultEncoding) {\n var enc = defaultEncoding || 'utf-16le';\n\n if (buf.length >= 2) {\n // Check BOM.\n if (buf[0] == 0xFE && buf[1] == 0xFF) // UTF-16BE BOM\n enc = 'utf-16be';\n else if (buf[0] == 0xFF && buf[1] == 0xFE) // UTF-16LE BOM\n enc = 'utf-16le';\n else {\n // No BOM found. Try to deduce encoding from initial content.\n // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon.\n // So, we count ASCII as if it was LE or BE, and decide from that.\n var asciiCharsLE = 0, asciiCharsBE = 0, // Counts of chars in both positions\n _len = Math.min(buf.length - (buf.length % 2), 64); // Len is always even.\n\n for (var i = 0; i < _len; i += 2) {\n if (buf[i] === 0 && buf[i+1] !== 0) asciiCharsBE++;\n if (buf[i] !== 0 && buf[i+1] === 0) asciiCharsLE++;\n }\n\n if (asciiCharsBE > asciiCharsLE)\n enc = 'utf-16be';\n else if (asciiCharsBE < asciiCharsLE)\n enc = 'utf-16le';\n }\n }\n\n return enc;\n}\n\n\n","\"use strict\";\nvar Buffer = require(\"safer-buffer\").Buffer;\n\n// UTF-7 codec, according to https://tools.ietf.org/html/rfc2152\n// See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3\n\nexports.utf7 = Utf7Codec;\nexports.unicode11utf7 = 'utf7'; // Alias UNICODE-1-1-UTF-7\nfunction Utf7Codec(codecOptions, iconv) {\n this.iconv = iconv;\n};\n\nUtf7Codec.prototype.encoder = Utf7Encoder;\nUtf7Codec.prototype.decoder = Utf7Decoder;\nUtf7Codec.prototype.bomAware = true;\n\n\n// -- Encoding\n\nvar nonDirectChars = /[^A-Za-z0-9'\\(\\),-\\.\\/:\\? \\n\\r\\t]+/g;\n\nfunction Utf7Encoder(options, codec) {\n this.iconv = codec.iconv;\n}\n\nUtf7Encoder.prototype.write = function(str) {\n // Naive implementation.\n // Non-direct chars are encoded as \"+-\"; single \"+\" char is encoded as \"+-\".\n return Buffer.from(str.replace(nonDirectChars, function(chunk) {\n return \"+\" + (chunk === '+' ? '' : \n this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, '')) \n + \"-\";\n }.bind(this)));\n}\n\nUtf7Encoder.prototype.end = function() {\n}\n\n\n// -- Decoding\n\nfunction Utf7Decoder(options, codec) {\n this.iconv = codec.iconv;\n this.inBase64 = false;\n this.base64Accum = '';\n}\n\nvar base64Regex = /[A-Za-z0-9\\/+]/;\nvar base64Chars = [];\nfor (var i = 0; i < 256; i++)\n base64Chars[i] = base64Regex.test(String.fromCharCode(i));\n\nvar plusChar = '+'.charCodeAt(0), \n minusChar = '-'.charCodeAt(0),\n andChar = '&'.charCodeAt(0);\n\nUtf7Decoder.prototype.write = function(buf) {\n var res = \"\", lastI = 0,\n inBase64 = this.inBase64,\n base64Accum = this.base64Accum;\n\n // The decoder is more involved as we must handle chunks in stream.\n\n for (var i = 0; i < buf.length; i++) {\n if (!inBase64) { // We're in direct mode.\n // Write direct chars until '+'\n if (buf[i] == plusChar) {\n res += this.iconv.decode(buf.slice(lastI, i), \"ascii\"); // Write direct chars.\n lastI = i+1;\n inBase64 = true;\n }\n } else { // We decode base64.\n if (!base64Chars[buf[i]]) { // Base64 ended.\n if (i == lastI && buf[i] == minusChar) {// \"+-\" -> \"+\"\n res += \"+\";\n } else {\n var b64str = base64Accum + buf.slice(lastI, i).toString();\n res += this.iconv.decode(Buffer.from(b64str, 'base64'), \"utf16-be\");\n }\n\n if (buf[i] != minusChar) // Minus is absorbed after base64.\n i--;\n\n lastI = i+1;\n inBase64 = false;\n base64Accum = '';\n }\n }\n }\n\n if (!inBase64) {\n res += this.iconv.decode(buf.slice(lastI), \"ascii\"); // Write direct chars.\n } else {\n var b64str = base64Accum + buf.slice(lastI).toString();\n\n var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars.\n base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future.\n b64str = b64str.slice(0, canBeDecoded);\n\n res += this.iconv.decode(Buffer.from(b64str, 'base64'), \"utf16-be\");\n }\n\n this.inBase64 = inBase64;\n this.base64Accum = base64Accum;\n\n return res;\n}\n\nUtf7Decoder.prototype.end = function() {\n var res = \"\";\n if (this.inBase64 && this.base64Accum.length > 0)\n res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), \"utf16-be\");\n\n this.inBase64 = false;\n this.base64Accum = '';\n return res;\n}\n\n\n// UTF-7-IMAP codec.\n// RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3)\n// Differences:\n// * Base64 part is started by \"&\" instead of \"+\"\n// * Direct characters are 0x20-0x7E, except \"&\" (0x26)\n// * In Base64, \",\" is used instead of \"/\"\n// * Base64 must not be used to represent direct characters.\n// * No implicit shift back from Base64 (should always end with '-')\n// * String must end in non-shifted position.\n// * \"-&\" while in base64 is not allowed.\n\n\nexports.utf7imap = Utf7IMAPCodec;\nfunction Utf7IMAPCodec(codecOptions, iconv) {\n this.iconv = iconv;\n};\n\nUtf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder;\nUtf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder;\nUtf7IMAPCodec.prototype.bomAware = true;\n\n\n// -- Encoding\n\nfunction Utf7IMAPEncoder(options, codec) {\n this.iconv = codec.iconv;\n this.inBase64 = false;\n this.base64Accum = Buffer.alloc(6);\n this.base64AccumIdx = 0;\n}\n\nUtf7IMAPEncoder.prototype.write = function(str) {\n var inBase64 = this.inBase64,\n base64Accum = this.base64Accum,\n base64AccumIdx = this.base64AccumIdx,\n buf = Buffer.alloc(str.length*5 + 10), bufIdx = 0;\n\n for (var i = 0; i < str.length; i++) {\n var uChar = str.charCodeAt(i);\n if (0x20 <= uChar && uChar <= 0x7E) { // Direct character or '&'.\n if (inBase64) {\n if (base64AccumIdx > 0) {\n bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString('base64').replace(/\\//g, ',').replace(/=+$/, ''), bufIdx);\n base64AccumIdx = 0;\n }\n\n buf[bufIdx++] = minusChar; // Write '-', then go to direct mode.\n inBase64 = false;\n }\n\n if (!inBase64) {\n buf[bufIdx++] = uChar; // Write direct character\n\n if (uChar === andChar) // Ampersand -> '&-'\n buf[bufIdx++] = minusChar;\n }\n\n } else { // Non-direct character\n if (!inBase64) {\n buf[bufIdx++] = andChar; // Write '&', then go to base64 mode.\n inBase64 = true;\n }\n if (inBase64) {\n base64Accum[base64AccumIdx++] = uChar >> 8;\n base64Accum[base64AccumIdx++] = uChar & 0xFF;\n\n if (base64AccumIdx == base64Accum.length) {\n bufIdx += buf.write(base64Accum.toString('base64').replace(/\\//g, ','), bufIdx);\n base64AccumIdx = 0;\n }\n }\n }\n }\n\n this.inBase64 = inBase64;\n this.base64AccumIdx = base64AccumIdx;\n\n return buf.slice(0, bufIdx);\n}\n\nUtf7IMAPEncoder.prototype.end = function() {\n var buf = Buffer.alloc(10), bufIdx = 0;\n if (this.inBase64) {\n if (this.base64AccumIdx > 0) {\n bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\\//g, ',').replace(/=+$/, ''), bufIdx);\n this.base64AccumIdx = 0;\n }\n\n buf[bufIdx++] = minusChar; // Write '-', then go to direct mode.\n this.inBase64 = false;\n }\n\n return buf.slice(0, bufIdx);\n}\n\n\n// -- Decoding\n\nfunction Utf7IMAPDecoder(options, codec) {\n this.iconv = codec.iconv;\n this.inBase64 = false;\n this.base64Accum = '';\n}\n\nvar base64IMAPChars = base64Chars.slice();\nbase64IMAPChars[','.charCodeAt(0)] = true;\n\nUtf7IMAPDecoder.prototype.write = function(buf) {\n var res = \"\", lastI = 0,\n inBase64 = this.inBase64,\n base64Accum = this.base64Accum;\n\n // The decoder is more involved as we must handle chunks in stream.\n // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end).\n\n for (var i = 0; i < buf.length; i++) {\n if (!inBase64) { // We're in direct mode.\n // Write direct chars until '&'\n if (buf[i] == andChar) {\n res += this.iconv.decode(buf.slice(lastI, i), \"ascii\"); // Write direct chars.\n lastI = i+1;\n inBase64 = true;\n }\n } else { // We decode base64.\n if (!base64IMAPChars[buf[i]]) { // Base64 ended.\n if (i == lastI && buf[i] == minusChar) { // \"&-\" -> \"&\"\n res += \"&\";\n } else {\n var b64str = base64Accum + buf.slice(lastI, i).toString().replace(/,/g, '/');\n res += this.iconv.decode(Buffer.from(b64str, 'base64'), \"utf16-be\");\n }\n\n if (buf[i] != minusChar) // Minus may be absorbed after base64.\n i--;\n\n lastI = i+1;\n inBase64 = false;\n base64Accum = '';\n }\n }\n }\n\n if (!inBase64) {\n res += this.iconv.decode(buf.slice(lastI), \"ascii\"); // Write direct chars.\n } else {\n var b64str = base64Accum + buf.slice(lastI).toString().replace(/,/g, '/');\n\n var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars.\n base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future.\n b64str = b64str.slice(0, canBeDecoded);\n\n res += this.iconv.decode(Buffer.from(b64str, 'base64'), \"utf16-be\");\n }\n\n this.inBase64 = inBase64;\n this.base64Accum = base64Accum;\n\n return res;\n}\n\nUtf7IMAPDecoder.prototype.end = function() {\n var res = \"\";\n if (this.inBase64 && this.base64Accum.length > 0)\n res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), \"utf16-be\");\n\n this.inBase64 = false;\n this.base64Accum = '';\n return res;\n}\n\n\n","\"use strict\";\n\nvar BOMChar = '\\uFEFF';\n\nexports.PrependBOM = PrependBOMWrapper\nfunction PrependBOMWrapper(encoder, options) {\n this.encoder = encoder;\n this.addBOM = true;\n}\n\nPrependBOMWrapper.prototype.write = function(str) {\n if (this.addBOM) {\n str = BOMChar + str;\n this.addBOM = false;\n }\n\n return this.encoder.write(str);\n}\n\nPrependBOMWrapper.prototype.end = function() {\n return this.encoder.end();\n}\n\n\n//------------------------------------------------------------------------------\n\nexports.StripBOM = StripBOMWrapper;\nfunction StripBOMWrapper(decoder, options) {\n this.decoder = decoder;\n this.pass = false;\n this.options = options || {};\n}\n\nStripBOMWrapper.prototype.write = function(buf) {\n var res = this.decoder.write(buf);\n if (this.pass || !res)\n return res;\n\n if (res[0] === BOMChar) {\n res = res.slice(1);\n if (typeof this.options.stripBOM === 'function')\n this.options.stripBOM();\n }\n\n this.pass = true;\n return res;\n}\n\nStripBOMWrapper.prototype.end = function() {\n return this.decoder.end();\n}\n\n","\"use strict\";\nvar Buffer = require(\"buffer\").Buffer;\n// Note: not polyfilled with safer-buffer on a purpose, as overrides Buffer\n\n// == Extend Node primitives to use iconv-lite =================================\n\nmodule.exports = function (iconv) {\n var original = undefined; // Place to keep original methods.\n\n // Node authors rewrote Buffer internals to make it compatible with\n // Uint8Array and we cannot patch key functions since then.\n // Note: this does use older Buffer API on a purpose\n iconv.supportsNodeEncodingsExtension = !(Buffer.from || new Buffer(0) instanceof Uint8Array);\n\n iconv.extendNodeEncodings = function extendNodeEncodings() {\n if (original) return;\n original = {};\n\n if (!iconv.supportsNodeEncodingsExtension) {\n console.error(\"ACTION NEEDED: require('iconv-lite').extendNodeEncodings() is not supported in your version of Node\");\n console.error(\"See more info at https://github.com/ashtuchkin/iconv-lite/wiki/Node-v4-compatibility\");\n return;\n }\n\n var nodeNativeEncodings = {\n 'hex': true, 'utf8': true, 'utf-8': true, 'ascii': true, 'binary': true, \n 'base64': true, 'ucs2': true, 'ucs-2': true, 'utf16le': true, 'utf-16le': true,\n };\n\n Buffer.isNativeEncoding = function(enc) {\n return enc && nodeNativeEncodings[enc.toLowerCase()];\n }\n\n // -- SlowBuffer -----------------------------------------------------------\n var SlowBuffer = require('buffer').SlowBuffer;\n\n original.SlowBufferToString = SlowBuffer.prototype.toString;\n SlowBuffer.prototype.toString = function(encoding, start, end) {\n encoding = String(encoding || 'utf8').toLowerCase();\n\n // Use native conversion when possible\n if (Buffer.isNativeEncoding(encoding))\n return original.SlowBufferToString.call(this, encoding, start, end);\n\n // Otherwise, use our decoding method.\n if (typeof start == 'undefined') start = 0;\n if (typeof end == 'undefined') end = this.length;\n return iconv.decode(this.slice(start, end), encoding);\n }\n\n original.SlowBufferWrite = SlowBuffer.prototype.write;\n SlowBuffer.prototype.write = function(string, offset, length, encoding) {\n // Support both (string, offset, length, encoding)\n // and the legacy (string, encoding, offset, length)\n if (isFinite(offset)) {\n if (!isFinite(length)) {\n encoding = length;\n length = undefined;\n }\n } else { // legacy\n var swap = encoding;\n encoding = offset;\n offset = length;\n length = swap;\n }\n\n offset = +offset || 0;\n var remaining = this.length - offset;\n if (!length) {\n length = remaining;\n } else {\n length = +length;\n if (length > remaining) {\n length = remaining;\n }\n }\n encoding = String(encoding || 'utf8').toLowerCase();\n\n // Use native conversion when possible\n if (Buffer.isNativeEncoding(encoding))\n return original.SlowBufferWrite.call(this, string, offset, length, encoding);\n\n if (string.length > 0 && (length < 0 || offset < 0))\n throw new RangeError('attempt to write beyond buffer bounds');\n\n // Otherwise, use our encoding method.\n var buf = iconv.encode(string, encoding);\n if (buf.length < length) length = buf.length;\n buf.copy(this, offset, 0, length);\n return length;\n }\n\n // -- Buffer ---------------------------------------------------------------\n\n original.BufferIsEncoding = Buffer.isEncoding;\n Buffer.isEncoding = function(encoding) {\n return Buffer.isNativeEncoding(encoding) || iconv.encodingExists(encoding);\n }\n\n original.BufferByteLength = Buffer.byteLength;\n Buffer.byteLength = SlowBuffer.byteLength = function(str, encoding) {\n encoding = String(encoding || 'utf8').toLowerCase();\n\n // Use native conversion when possible\n if (Buffer.isNativeEncoding(encoding))\n return original.BufferByteLength.call(this, str, encoding);\n\n // Slow, I know, but we don't have a better way yet.\n return iconv.encode(str, encoding).length;\n }\n\n original.BufferToString = Buffer.prototype.toString;\n Buffer.prototype.toString = function(encoding, start, end) {\n encoding = String(encoding || 'utf8').toLowerCase();\n\n // Use native conversion when possible\n if (Buffer.isNativeEncoding(encoding))\n return original.BufferToString.call(this, encoding, start, end);\n\n // Otherwise, use our decoding method.\n if (typeof start == 'undefined') start = 0;\n if (typeof end == 'undefined') end = this.length;\n return iconv.decode(this.slice(start, end), encoding);\n }\n\n original.BufferWrite = Buffer.prototype.write;\n Buffer.prototype.write = function(string, offset, length, encoding) {\n var _offset = offset, _length = length, _encoding = encoding;\n // Support both (string, offset, length, encoding)\n // and the legacy (string, encoding, offset, length)\n if (isFinite(offset)) {\n if (!isFinite(length)) {\n encoding = length;\n length = undefined;\n }\n } else { // legacy\n var swap = encoding;\n encoding = offset;\n offset = length;\n length = swap;\n }\n\n encoding = String(encoding || 'utf8').toLowerCase();\n\n // Use native conversion when possible\n if (Buffer.isNativeEncoding(encoding))\n return original.BufferWrite.call(this, string, _offset, _length, _encoding);\n\n offset = +offset || 0;\n var remaining = this.length - offset;\n if (!length) {\n length = remaining;\n } else {\n length = +length;\n if (length > remaining) {\n length = remaining;\n }\n }\n\n if (string.length > 0 && (length < 0 || offset < 0))\n throw new RangeError('attempt to write beyond buffer bounds');\n\n // Otherwise, use our encoding method.\n var buf = iconv.encode(string, encoding);\n if (buf.length < length) length = buf.length;\n buf.copy(this, offset, 0, length);\n return length;\n\n // TODO: Set _charsWritten.\n }\n\n\n // -- Readable -------------------------------------------------------------\n if (iconv.supportsStreams) {\n var Readable = require('stream').Readable;\n\n original.ReadableSetEncoding = Readable.prototype.setEncoding;\n Readable.prototype.setEncoding = function setEncoding(enc, options) {\n // Use our own decoder, it has the same interface.\n // We cannot use original function as it doesn't handle BOM-s.\n this._readableState.decoder = iconv.getDecoder(enc, options);\n this._readableState.encoding = enc;\n }\n\n Readable.prototype.collect = iconv._collect;\n }\n }\n\n // Remove iconv-lite Node primitive extensions.\n iconv.undoExtendNodeEncodings = function undoExtendNodeEncodings() {\n if (!iconv.supportsNodeEncodingsExtension)\n return;\n if (!original)\n throw new Error(\"require('iconv-lite').undoExtendNodeEncodings(): Nothing to undo; extendNodeEncodings() is not called.\")\n\n delete Buffer.isNativeEncoding;\n\n var SlowBuffer = require('buffer').SlowBuffer;\n\n SlowBuffer.prototype.toString = original.SlowBufferToString;\n SlowBuffer.prototype.write = original.SlowBufferWrite;\n\n Buffer.isEncoding = original.BufferIsEncoding;\n Buffer.byteLength = original.BufferByteLength;\n Buffer.prototype.toString = original.BufferToString;\n Buffer.prototype.write = original.BufferWrite;\n\n if (iconv.supportsStreams) {\n var Readable = require('stream').Readable;\n\n Readable.prototype.setEncoding = original.ReadableSetEncoding;\n delete Readable.prototype.collect;\n }\n\n original = undefined;\n }\n}\n","\"use strict\";\n\n// Some environments don't have global Buffer (e.g. React Native).\n// Solution would be installing npm modules \"buffer\" and \"stream\" explicitly.\nvar Buffer = require(\"safer-buffer\").Buffer;\n\nvar bomHandling = require(\"./bom-handling\"),\n iconv = module.exports;\n\n// All codecs and aliases are kept here, keyed by encoding name/alias.\n// They are lazy loaded in `iconv.getCodec` from `encodings/index.js`.\niconv.encodings = null;\n\n// Characters emitted in case of error.\niconv.defaultCharUnicode = '�';\niconv.defaultCharSingleByte = '?';\n\n// Public API.\niconv.encode = function encode(str, encoding, options) {\n str = \"\" + (str || \"\"); // Ensure string.\n\n var encoder = iconv.getEncoder(encoding, options);\n\n var res = encoder.write(str);\n var trail = encoder.end();\n \n return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res;\n}\n\niconv.decode = function decode(buf, encoding, options) {\n if (typeof buf === 'string') {\n if (!iconv.skipDecodeWarning) {\n console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding');\n iconv.skipDecodeWarning = true;\n }\n\n buf = Buffer.from(\"\" + (buf || \"\"), \"binary\"); // Ensure buffer.\n }\n\n var decoder = iconv.getDecoder(encoding, options);\n\n var res = decoder.write(buf);\n var trail = decoder.end();\n\n return trail ? (res + trail) : res;\n}\n\niconv.encodingExists = function encodingExists(enc) {\n try {\n iconv.getCodec(enc);\n return true;\n } catch (e) {\n return false;\n }\n}\n\n// Legacy aliases to convert functions\niconv.toEncoding = iconv.encode;\niconv.fromEncoding = iconv.decode;\n\n// Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache.\niconv._codecDataCache = {};\niconv.getCodec = function getCodec(encoding) {\n if (!iconv.encodings)\n iconv.encodings = require(\"../encodings\"); // Lazy load all encoding definitions.\n \n // Canonicalize encoding name: strip all non-alphanumeric chars and appended year.\n var enc = iconv._canonicalizeEncoding(encoding);\n\n // Traverse iconv.encodings to find actual codec.\n var codecOptions = {};\n while (true) {\n var codec = iconv._codecDataCache[enc];\n if (codec)\n return codec;\n\n var codecDef = iconv.encodings[enc];\n\n switch (typeof codecDef) {\n case \"string\": // Direct alias to other encoding.\n enc = codecDef;\n break;\n\n case \"object\": // Alias with options. Can be layered.\n for (var key in codecDef)\n codecOptions[key] = codecDef[key];\n\n if (!codecOptions.encodingName)\n codecOptions.encodingName = enc;\n \n enc = codecDef.type;\n break;\n\n case \"function\": // Codec itself.\n if (!codecOptions.encodingName)\n codecOptions.encodingName = enc;\n\n // The codec function must load all tables and return object with .encoder and .decoder methods.\n // It'll be called only once (for each different options object).\n codec = new codecDef(codecOptions, iconv);\n\n iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later.\n return codec;\n\n default:\n throw new Error(\"Encoding not recognized: '\" + encoding + \"' (searched as: '\"+enc+\"')\");\n }\n }\n}\n\niconv._canonicalizeEncoding = function(encoding) {\n // Canonicalize encoding name: strip all non-alphanumeric chars and appended year.\n return (''+encoding).toLowerCase().replace(/:\\d{4}$|[^0-9a-z]/g, \"\");\n}\n\niconv.getEncoder = function getEncoder(encoding, options) {\n var codec = iconv.getCodec(encoding),\n encoder = new codec.encoder(options, codec);\n\n if (codec.bomAware && options && options.addBOM)\n encoder = new bomHandling.PrependBOM(encoder, options);\n\n return encoder;\n}\n\niconv.getDecoder = function getDecoder(encoding, options) {\n var codec = iconv.getCodec(encoding),\n decoder = new codec.decoder(options, codec);\n\n if (codec.bomAware && !(options && options.stripBOM === false))\n decoder = new bomHandling.StripBOM(decoder, options);\n\n return decoder;\n}\n\n\n// Load extensions in Node. All of them are omitted in Browserify build via 'browser' field in package.json.\nvar nodeVer = typeof process !== 'undefined' && process.versions && process.versions.node;\nif (nodeVer) {\n\n // Load streaming support in Node v0.10+\n var nodeVerArr = nodeVer.split(\".\").map(Number);\n if (nodeVerArr[0] > 0 || nodeVerArr[1] >= 10) {\n require(\"./streams\")(iconv);\n }\n\n // Load Node primitive extensions.\n require(\"./extend-node\")(iconv);\n}\n\nif (\"Ā\" != \"\\u0100\") {\n console.error(\"iconv-lite warning: javascript files use encoding different from utf-8. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info.\");\n}\n","\"use strict\";\n\nvar Buffer = require(\"buffer\").Buffer,\n Transform = require(\"stream\").Transform;\n\n\n// == Exports ==================================================================\nmodule.exports = function(iconv) {\n \n // Additional Public API.\n iconv.encodeStream = function encodeStream(encoding, options) {\n return new IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options);\n }\n\n iconv.decodeStream = function decodeStream(encoding, options) {\n return new IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options);\n }\n\n iconv.supportsStreams = true;\n\n\n // Not published yet.\n iconv.IconvLiteEncoderStream = IconvLiteEncoderStream;\n iconv.IconvLiteDecoderStream = IconvLiteDecoderStream;\n iconv._collect = IconvLiteDecoderStream.prototype.collect;\n};\n\n\n// == Encoder stream =======================================================\nfunction IconvLiteEncoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.decodeStrings = false; // We accept only strings, so we don't need to decode them.\n Transform.call(this, options);\n}\n\nIconvLiteEncoderStream.prototype = Object.create(Transform.prototype, {\n constructor: { value: IconvLiteEncoderStream }\n});\n\nIconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) {\n if (typeof chunk != 'string')\n return done(new Error(\"Iconv encoding stream needs strings as its input.\"));\n try {\n var res = this.conv.write(chunk);\n if (res && res.length) this.push(res);\n done();\n }\n catch (e) {\n done(e);\n }\n}\n\nIconvLiteEncoderStream.prototype._flush = function(done) {\n try {\n var res = this.conv.end();\n if (res && res.length) this.push(res);\n done();\n }\n catch (e) {\n done(e);\n }\n}\n\nIconvLiteEncoderStream.prototype.collect = function(cb) {\n var chunks = [];\n this.on('error', cb);\n this.on('data', function(chunk) { chunks.push(chunk); });\n this.on('end', function() {\n cb(null, Buffer.concat(chunks));\n });\n return this;\n}\n\n\n// == Decoder stream =======================================================\nfunction IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}\n\nIconvLiteDecoderStream.prototype = Object.create(Transform.prototype, {\n constructor: { value: IconvLiteDecoderStream }\n});\n\nIconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) {\n if (!Buffer.isBuffer(chunk))\n return done(new Error(\"Iconv decoding stream needs buffers as its input.\"));\n try {\n var res = this.conv.write(chunk);\n if (res && res.length) this.push(res, this.encoding);\n done();\n }\n catch (e) {\n done(e);\n }\n}\n\nIconvLiteDecoderStream.prototype._flush = function(done) {\n try {\n var res = this.conv.end();\n if (res && res.length) this.push(res, this.encoding); \n done();\n }\n catch (e) {\n done(e);\n }\n}\n\nIconvLiteDecoderStream.prototype.collect = function(cb) {\n var res = '';\n this.on('error', cb);\n this.on('data', function(chunk) { res += chunk; });\n this.on('end', function() {\n cb(null, res);\n });\n return this;\n}\n\n","// Generated using `npm run build`. Do not edit.\n\nvar regex = /^[a-z](?:[\\.0-9_a-z\\xB7\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u037D\\u037F-\\u1FFF\\u200C\\u200D\\u203F\\u2040\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|[\\uD800-\\uDB7F][\\uDC00-\\uDFFF])*-(?:[\\x2D\\.0-9_a-z\\xB7\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u037D\\u037F-\\u1FFF\\u200C\\u200D\\u203F\\u2040\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|[\\uD800-\\uDB7F][\\uDC00-\\uDFFF])*$/;\n\nvar isPotentialCustomElementName = function(string) {\n\treturn regex.test(string);\n};\n\nmodule.exports = isPotentialCustomElementName;\n","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__export(require(\"./src/abbreviateNumber\"));\n__export(require(\"./src/unabbreviateNumber\"));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar const_1 = require(\"./const\");\nvar defaultOptions = {\n padding: true,\n symbols: const_1.defaultSymbols,\n};\nfunction abbreviateNumber(num, digit, options) {\n if (digit === void 0) { digit = 1; }\n // Previous options style\n if (Array.isArray(options)) {\n options = { symbols: options };\n }\n var _a = Object.assign({}, defaultOptions, options), symbols = _a.symbols, padding = _a.padding;\n // handle negatives\n var sign = Math.sign(num) >= 0;\n num = Math.abs(num);\n // what tier? (determines SI symbol)\n var tier = (Math.log10(num) / 3) | 0;\n // if zero, we don't need a suffix\n if (tier == 0)\n return (!sign ? \"-\" : \"\") + num.toString();\n // get suffix and determine scale\n var suffix = symbols[tier];\n if (!suffix)\n throw new RangeError();\n var scale = Math.pow(10, tier * 3);\n // scale the number\n var scaled = num / scale;\n var rounded = scaled.toFixed(digit);\n if (!padding) {\n rounded = String(Number(rounded));\n }\n // format number and add suffix\n return (!sign ? \"-\" : \"\") + rounded + suffix;\n}\nexports.abbreviateNumber = abbreviateNumber;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultSymbols = [\"\", \"k\", \"M\", \"G\", \"T\", \"P\", \"E\"];\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar const_1 = require(\"./const\");\nvar utils_1 = require(\"./utils\");\nfunction unabbreviateNumber(num, symbols) {\n if (symbols === void 0) { symbols = const_1.defaultSymbols; }\n var numberPattern = \"[+-]?([0-9]*[.])?[0-9]+\";\n var symbolPattern = \"\" + symbols.join(\"|\");\n var pattern = \"^(\" + numberPattern + \")(\" + symbolPattern + \")$\";\n var regex = new RegExp(pattern);\n var match = num.match(pattern) || [];\n if (regex.test(num) && match.length > 3) {\n var symbol = match[3];\n var symbolValue = utils_1.symbolPow(symbols.indexOf(symbol));\n var pureNum = Number(match[1]);\n return pureNum * symbolValue;\n }\n else {\n throw Error(\"This is not a valid input\");\n }\n}\nexports.unabbreviateNumber = unabbreviateNumber;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.symbolPow = function (index) {\n if (index === void 0) { index = 0; }\n return Math.pow(10, index * 3);\n};\n","\"use strict\";\nconst path = require(\"path\");\nconst fs = require(\"fs\").promises;\nconst vm = require(\"vm\");\nconst toughCookie = require(\"tough-cookie\");\nconst sniffHTMLEncoding = require(\"html-encoding-sniffer\");\nconst whatwgURL = require(\"whatwg-url\");\nconst whatwgEncoding = require(\"whatwg-encoding\");\nconst { URL } = require(\"whatwg-url\");\nconst MIMEType = require(\"whatwg-mimetype\");\nconst idlUtils = require(\"./jsdom/living/generated/utils.js\");\nconst VirtualConsole = require(\"./jsdom/virtual-console.js\");\nconst { createWindow } = require(\"./jsdom/browser/Window.js\");\nconst { parseIntoDocument } = require(\"./jsdom/browser/parser\");\nconst { fragmentSerialization } = require(\"./jsdom/living/domparsing/serialization.js\");\nconst ResourceLoader = require(\"./jsdom/browser/resources/resource-loader.js\");\nconst NoOpResourceLoader = require(\"./jsdom/browser/resources/no-op-resource-loader.js\");\n\nclass CookieJar extends toughCookie.CookieJar {\n constructor(store, options) {\n // jsdom cookie jars must be loose by default\n super(store, { looseMode: true, ...options });\n }\n}\n\nconst window = Symbol(\"window\");\nlet sharedFragmentDocument = null;\n\nclass JSDOM {\n constructor(input = \"\", options = {}) {\n const mimeType = new MIMEType(options.contentType === undefined ? \"text/html\" : options.contentType);\n const { html, encoding } = normalizeHTML(input, mimeType);\n\n options = transformOptions(options, encoding, mimeType);\n\n this[window] = createWindow(options.windowOptions);\n\n const documentImpl = idlUtils.implForWrapper(this[window]._document);\n\n options.beforeParse(this[window]._globalProxy);\n\n parseIntoDocument(html, documentImpl);\n\n documentImpl.close();\n }\n\n get window() {\n // It's important to grab the global proxy, instead of just the result of `createWindow(...)`, since otherwise\n // things like `window.eval` don't exist.\n return this[window]._globalProxy;\n }\n\n get virtualConsole() {\n return this[window]._virtualConsole;\n }\n\n get cookieJar() {\n // TODO NEWAPI move _cookieJar to window probably\n return idlUtils.implForWrapper(this[window]._document)._cookieJar;\n }\n\n serialize() {\n return fragmentSerialization(idlUtils.implForWrapper(this[window]._document), { requireWellFormed: false });\n }\n\n nodeLocation(node) {\n if (!idlUtils.implForWrapper(this[window]._document)._parseOptions.sourceCodeLocationInfo) {\n throw new Error(\"Location information was not saved for this jsdom. Use includeNodeLocations during creation.\");\n }\n\n return idlUtils.implForWrapper(node).sourceCodeLocation;\n }\n\n getInternalVMContext() {\n if (!vm.isContext(this[window])) {\n throw new TypeError(\"This jsdom was not configured to allow script running. \" +\n \"Use the runScripts option during creation.\");\n }\n\n return this[window];\n }\n\n reconfigure(settings) {\n if (\"windowTop\" in settings) {\n this[window]._top = settings.windowTop;\n }\n\n if (\"url\" in settings) {\n const document = idlUtils.implForWrapper(this[window]._document);\n\n const url = whatwgURL.parseURL(settings.url);\n if (url === null) {\n throw new TypeError(`Could not parse \"${settings.url}\" as a URL`);\n }\n\n document._URL = url;\n document._origin = whatwgURL.serializeURLOrigin(document._URL);\n }\n }\n\n static fragment(string = \"\") {\n if (!sharedFragmentDocument) {\n sharedFragmentDocument = (new JSDOM()).window.document;\n }\n\n const template = sharedFragmentDocument.createElement(\"template\");\n template.innerHTML = string;\n return template.content;\n }\n\n static fromURL(url, options = {}) {\n return Promise.resolve().then(() => {\n // Remove the hash while sending this through the research loader fetch().\n // It gets added back a few lines down when constructing the JSDOM object.\n const parsedURL = new URL(url);\n const originalHash = parsedURL.hash;\n parsedURL.hash = \"\";\n url = parsedURL.href;\n\n options = normalizeFromURLOptions(options);\n\n const resourceLoader = resourcesToResourceLoader(options.resources);\n const resourceLoaderForInitialRequest = resourceLoader.constructor === NoOpResourceLoader ?\n new ResourceLoader() :\n resourceLoader;\n\n const req = resourceLoaderForInitialRequest.fetch(url, {\n accept: \"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\",\n cookieJar: options.cookieJar,\n referrer: options.referrer\n });\n\n return req.then(body => {\n const res = req.response;\n\n options = Object.assign(options, {\n url: req.href + originalHash,\n contentType: res.headers[\"content-type\"],\n referrer: req.getHeader(\"referer\")\n });\n\n return new JSDOM(body, options);\n });\n });\n }\n\n static async fromFile(filename, options = {}) {\n options = normalizeFromFileOptions(filename, options);\n const buffer = await fs.readFile(filename);\n\n return new JSDOM(buffer, options);\n }\n}\n\nfunction normalizeFromURLOptions(options) {\n // Checks on options that are invalid for `fromURL`\n if (options.url !== undefined) {\n throw new TypeError(\"Cannot supply a url option when using fromURL\");\n }\n if (options.contentType !== undefined) {\n throw new TypeError(\"Cannot supply a contentType option when using fromURL\");\n }\n\n // Normalization of options which must be done before the rest of the fromURL code can use them, because they are\n // given to request()\n const normalized = { ...options };\n\n if (options.referrer !== undefined) {\n normalized.referrer = (new URL(options.referrer)).href;\n }\n\n if (options.cookieJar === undefined) {\n normalized.cookieJar = new CookieJar();\n }\n\n return normalized;\n\n // All other options don't need to be processed yet, and can be taken care of in the normal course of things when\n // `fromURL` calls `new JSDOM(html, options)`.\n}\n\nfunction normalizeFromFileOptions(filename, options) {\n const normalized = { ...options };\n\n if (normalized.contentType === undefined) {\n const extname = path.extname(filename);\n if (extname === \".xhtml\" || extname === \".xht\" || extname === \".xml\") {\n normalized.contentType = \"application/xhtml+xml\";\n }\n }\n\n if (normalized.url === undefined) {\n normalized.url = new URL(\"file:\" + path.resolve(filename));\n }\n\n return normalized;\n}\n\nfunction transformOptions(options, encoding, mimeType) {\n const transformed = {\n windowOptions: {\n // Defaults\n url: \"about:blank\",\n referrer: \"\",\n contentType: \"text/html\",\n parsingMode: \"html\",\n parseOptions: {\n sourceCodeLocationInfo: false,\n scriptingEnabled: false\n },\n runScripts: undefined,\n encoding,\n pretendToBeVisual: false,\n storageQuota: 5000000,\n\n // Defaults filled in later\n resourceLoader: undefined,\n virtualConsole: undefined,\n cookieJar: undefined\n },\n\n // Defaults\n beforeParse() { }\n };\n\n // options.contentType was parsed into mimeType by the caller.\n if (!mimeType.isHTML() && !mimeType.isXML()) {\n throw new RangeError(`The given content type of \"${options.contentType}\" was not a HTML or XML content type`);\n }\n\n transformed.windowOptions.contentType = mimeType.essence;\n transformed.windowOptions.parsingMode = mimeType.isHTML() ? \"html\" : \"xml\";\n\n if (options.url !== undefined) {\n transformed.windowOptions.url = (new URL(options.url)).href;\n }\n\n if (options.referrer !== undefined) {\n transformed.windowOptions.referrer = (new URL(options.referrer)).href;\n }\n\n if (options.includeNodeLocations) {\n if (transformed.windowOptions.parsingMode === \"xml\") {\n throw new TypeError(\"Cannot set includeNodeLocations to true with an XML content type\");\n }\n\n transformed.windowOptions.parseOptions = { sourceCodeLocationInfo: true };\n }\n\n transformed.windowOptions.cookieJar = options.cookieJar === undefined ?\n new CookieJar() :\n options.cookieJar;\n\n transformed.windowOptions.virtualConsole = options.virtualConsole === undefined ?\n (new VirtualConsole()).sendTo(console) :\n options.virtualConsole;\n\n if (!(transformed.windowOptions.virtualConsole instanceof VirtualConsole)) {\n throw new TypeError(\"virtualConsole must be an instance of VirtualConsole\");\n }\n\n transformed.windowOptions.resourceLoader = resourcesToResourceLoader(options.resources);\n\n if (options.runScripts !== undefined) {\n transformed.windowOptions.runScripts = String(options.runScripts);\n if (transformed.windowOptions.runScripts === \"dangerously\") {\n transformed.windowOptions.parseOptions.scriptingEnabled = true;\n } else if (transformed.windowOptions.runScripts !== \"outside-only\") {\n throw new RangeError(`runScripts must be undefined, \"dangerously\", or \"outside-only\"`);\n }\n }\n\n if (options.beforeParse !== undefined) {\n transformed.beforeParse = options.beforeParse;\n }\n\n if (options.pretendToBeVisual !== undefined) {\n transformed.windowOptions.pretendToBeVisual = Boolean(options.pretendToBeVisual);\n }\n\n if (options.storageQuota !== undefined) {\n transformed.windowOptions.storageQuota = Number(options.storageQuota);\n }\n\n return transformed;\n}\n\nfunction normalizeHTML(html, mimeType) {\n let encoding = \"UTF-8\";\n\n if (ArrayBuffer.isView(html)) {\n html = Buffer.from(html.buffer, html.byteOffset, html.byteLength);\n } else if (html instanceof ArrayBuffer) {\n html = Buffer.from(html);\n }\n\n if (Buffer.isBuffer(html)) {\n encoding = sniffHTMLEncoding(html, {\n defaultEncoding: mimeType.isXML() ? \"UTF-8\" : \"windows-1252\",\n transportLayerEncodingLabel: mimeType.parameters.get(\"charset\")\n });\n html = whatwgEncoding.decode(html, encoding);\n } else {\n html = String(html);\n }\n\n return { html, encoding };\n}\n\nfunction resourcesToResourceLoader(resources) {\n switch (resources) {\n case undefined: {\n return new NoOpResourceLoader();\n }\n case \"usable\": {\n return new ResourceLoader();\n }\n default: {\n if (!(resources instanceof ResourceLoader)) {\n throw new TypeError(\"resources must be an instance of ResourceLoader\");\n }\n return resources;\n }\n }\n}\n\nexports.JSDOM = JSDOM;\n\nexports.VirtualConsole = VirtualConsole;\nexports.CookieJar = CookieJar;\nexports.ResourceLoader = ResourceLoader;\n\nexports.toughCookie = toughCookie;\n","\"use strict\";\nconst vm = require(\"vm\");\nconst webIDLConversions = require(\"webidl-conversions\");\nconst { CSSStyleDeclaration } = require(\"cssstyle\");\nconst { Performance: RawPerformance } = require(\"w3c-hr-time\");\nconst notImplemented = require(\"./not-implemented\");\nconst { installInterfaces } = require(\"../living/interfaces\");\nconst { define, mixin } = require(\"../utils\");\nconst Element = require(\"../living/generated/Element\");\nconst EventTarget = require(\"../living/generated/EventTarget\");\nconst EventHandlerNonNull = require(\"../living/generated/EventHandlerNonNull\");\nconst OnBeforeUnloadEventHandlerNonNull = require(\"../living/generated/OnBeforeUnloadEventHandlerNonNull\");\nconst OnErrorEventHandlerNonNull = require(\"../living/generated/OnErrorEventHandlerNonNull\");\nconst PageTransitionEvent = require(\"../living/generated/PageTransitionEvent\");\nconst namedPropertiesWindow = require(\"../living/named-properties-window\");\nconst postMessage = require(\"../living/post-message\");\nconst DOMException = require(\"domexception/webidl2js-wrapper\");\nconst { btoa, atob } = require(\"abab\");\nconst idlUtils = require(\"../living/generated/utils\");\nconst WebSocketImpl = require(\"../living/websockets/WebSocket-impl\").implementation;\nconst BarProp = require(\"../living/generated/BarProp\");\nconst documents = require(\"../living/documents.js\");\nconst External = require(\"../living/generated/External\");\nconst Navigator = require(\"../living/generated/Navigator\");\nconst Performance = require(\"../living/generated/Performance\");\nconst Screen = require(\"../living/generated/Screen\");\nconst Storage = require(\"../living/generated/Storage\");\nconst Selection = require(\"../living/generated/Selection\");\nconst reportException = require(\"../living/helpers/runtime-script-errors\");\nconst { getCurrentEventHandlerValue } = require(\"../living/helpers/create-event-accessor.js\");\nconst { fireAnEvent } = require(\"../living/helpers/events\");\nconst SessionHistory = require(\"../living/window/SessionHistory\");\nconst { forEachMatchingSheetRuleOfElement, getResolvedValue, propertiesWithResolvedValueImplemented,\n SHADOW_DOM_PSEUDO_REGEXP } = require(\"../living/helpers/style-rules.js\");\nconst CustomElementRegistry = require(\"../living/generated/CustomElementRegistry\");\nconst jsGlobals = require(\"./js-globals.json\");\n\nconst GlobalEventHandlersImpl = require(\"../living/nodes/GlobalEventHandlers-impl\").implementation;\nconst WindowEventHandlersImpl = require(\"../living/nodes/WindowEventHandlers-impl\").implementation;\n\nconst events = new Set([\n // GlobalEventHandlers\n \"abort\", \"autocomplete\",\n \"autocompleteerror\", \"blur\",\n \"cancel\", \"canplay\", \"canplaythrough\",\n \"change\", \"click\",\n \"close\", \"contextmenu\",\n \"cuechange\", \"dblclick\",\n \"drag\", \"dragend\",\n \"dragenter\",\n \"dragleave\", \"dragover\",\n \"dragstart\", \"drop\",\n \"durationchange\", \"emptied\",\n \"ended\", \"focus\",\n \"input\", \"invalid\",\n \"keydown\", \"keypress\",\n \"keyup\", \"load\", \"loadeddata\",\n \"loadedmetadata\", \"loadstart\",\n \"mousedown\", \"mouseenter\",\n \"mouseleave\", \"mousemove\",\n \"mouseout\", \"mouseover\",\n \"mouseup\", \"wheel\",\n \"pause\", \"play\",\n \"playing\", \"progress\",\n \"ratechange\", \"reset\",\n \"resize\", \"scroll\",\n \"securitypolicyviolation\",\n \"seeked\", \"seeking\",\n \"select\", \"sort\", \"stalled\",\n \"submit\", \"suspend\",\n \"timeupdate\", \"toggle\",\n \"volumechange\", \"waiting\",\n\n // WindowEventHandlers\n \"afterprint\",\n \"beforeprint\",\n \"hashchange\",\n \"languagechange\",\n \"message\",\n \"messageerror\",\n \"offline\",\n \"online\",\n \"pagehide\",\n \"pageshow\",\n \"popstate\",\n \"rejectionhandled\",\n \"storage\",\n \"unhandledrejection\",\n \"unload\"\n\n // \"error\" and \"beforeunload\" are added separately\n]);\n\nexports.createWindow = function (options) {\n return new Window(options);\n};\n\nconst jsGlobalEntriesToInstall = Object.entries(jsGlobals).filter(([name]) => name in global);\n\n// TODO remove when we drop Node v10 support.\nconst anyNodeVersionQueueMicrotask = typeof queueMicrotask === \"function\" ? queueMicrotask : process.nextTick;\n\n// https://html.spec.whatwg.org/#the-window-object\nfunction setupWindow(windowInstance, { runScripts }) {\n if (runScripts === \"outside-only\" || runScripts === \"dangerously\") {\n contextifyWindow(windowInstance);\n\n // Without this, these globals will only appear to scripts running inside the context using vm.runScript; they will\n // not appear to scripts running from the outside, including to JSDOM implementation code.\n for (const [globalName, globalPropDesc] of jsGlobalEntriesToInstall) {\n const propDesc = { ...globalPropDesc, value: vm.runInContext(globalName, windowInstance) };\n Object.defineProperty(windowInstance, globalName, propDesc);\n }\n } else {\n // Without contextifying the window, none of the globals will exist. So, let's at least alias them from the Node.js\n // context. See https://github.com/jsdom/jsdom/issues/2727 for more background and discussion.\n for (const [globalName, globalPropDesc] of jsGlobalEntriesToInstall) {\n const propDesc = { ...globalPropDesc, value: global[globalName] };\n Object.defineProperty(windowInstance, globalName, propDesc);\n }\n }\n\n installInterfaces(windowInstance, [\"Window\"]);\n\n const EventTargetConstructor = windowInstance.EventTarget;\n\n // eslint-disable-next-line func-name-matching, func-style, no-shadow\n const windowConstructor = function Window() {\n throw new TypeError(\"Illegal constructor\");\n };\n Object.setPrototypeOf(windowConstructor, EventTargetConstructor);\n\n Object.defineProperty(windowInstance, \"Window\", {\n configurable: true,\n writable: true,\n value: windowConstructor\n });\n\n const windowPrototype = Object.create(EventTargetConstructor.prototype);\n Object.defineProperties(windowPrototype, {\n constructor: {\n value: windowConstructor,\n writable: true,\n configurable: true\n },\n [Symbol.toStringTag]: {\n value: \"Window\",\n configurable: true\n }\n });\n\n windowConstructor.prototype = windowPrototype;\n Object.setPrototypeOf(windowInstance, windowPrototype);\n\n EventTarget.setup(windowInstance, windowInstance);\n mixin(windowInstance, WindowEventHandlersImpl.prototype);\n mixin(windowInstance, GlobalEventHandlersImpl.prototype);\n windowInstance._initGlobalEvents();\n\n Object.defineProperty(windowInstance, \"onbeforeunload\", {\n configurable: true,\n enumerable: true,\n get() {\n return idlUtils.tryWrapperForImpl(getCurrentEventHandlerValue(this, \"beforeunload\"));\n },\n set(V) {\n if (!idlUtils.isObject(V)) {\n V = null;\n } else {\n V = OnBeforeUnloadEventHandlerNonNull.convert(V, {\n context: \"Failed to set the 'onbeforeunload' property on 'Window': The provided value\"\n });\n }\n this._setEventHandlerFor(\"beforeunload\", V);\n }\n });\n\n Object.defineProperty(windowInstance, \"onerror\", {\n configurable: true,\n enumerable: true,\n get() {\n return idlUtils.tryWrapperForImpl(getCurrentEventHandlerValue(this, \"error\"));\n },\n set(V) {\n if (!idlUtils.isObject(V)) {\n V = null;\n } else {\n V = OnErrorEventHandlerNonNull.convert(V, {\n context: \"Failed to set the 'onerror' property on 'Window': The provided value\"\n });\n }\n this._setEventHandlerFor(\"error\", V);\n }\n });\n\n for (const event of events) {\n Object.defineProperty(windowInstance, `on${event}`, {\n configurable: true,\n enumerable: true,\n get() {\n return idlUtils.tryWrapperForImpl(getCurrentEventHandlerValue(this, event));\n },\n set(V) {\n if (!idlUtils.isObject(V)) {\n V = null;\n } else {\n V = EventHandlerNonNull.convert(V, {\n context: `Failed to set the 'on${event}' property on 'Window': The provided value`\n });\n }\n this._setEventHandlerFor(event, V);\n }\n });\n }\n\n windowInstance._globalObject = windowInstance;\n}\n\n// NOTE: per https://heycam.github.io/webidl/#Global, all properties on the Window object must be own-properties.\n// That is why we assign everything inside of the constructor, instead of using a shared prototype.\n// You can verify this in e.g. Firefox or Internet Explorer, which do a good job with Web IDL compliance.\nfunction Window(options) {\n setupWindow(this, { runScripts: options.runScripts });\n\n const rawPerformance = new RawPerformance();\n const windowInitialized = rawPerformance.now();\n\n const window = this;\n\n // ### PRIVATE DATA PROPERTIES\n\n this._resourceLoader = options.resourceLoader;\n\n // vm initialization is deferred until script processing is activated\n this._globalProxy = this;\n Object.defineProperty(idlUtils.implForWrapper(this), idlUtils.wrapperSymbol, { get: () => this._globalProxy });\n\n // List options explicitly to be clear which are passed through\n this._document = documents.createWrapper(window, {\n parsingMode: options.parsingMode,\n contentType: options.contentType,\n encoding: options.encoding,\n cookieJar: options.cookieJar,\n url: options.url,\n lastModified: options.lastModified,\n referrer: options.referrer,\n parseOptions: options.parseOptions,\n defaultView: this._globalProxy,\n global: this,\n parentOrigin: options.parentOrigin\n }, { alwaysUseDocumentClass: true });\n\n if (vm.isContext(window)) {\n const documentImpl = idlUtils.implForWrapper(window._document);\n documentImpl._defaultView = window._globalProxy = vm.runInContext(\"this\", window);\n }\n\n const documentOrigin = idlUtils.implForWrapper(this._document)._origin;\n this._origin = documentOrigin;\n\n // https://html.spec.whatwg.org/#session-history\n this._sessionHistory = new SessionHistory({\n document: idlUtils.implForWrapper(this._document),\n url: idlUtils.implForWrapper(this._document)._URL,\n stateObject: null\n }, this);\n\n this._virtualConsole = options.virtualConsole;\n\n this._runScripts = options.runScripts;\n\n // Set up the window as if it's a top level window.\n // If it's not, then references will be corrected by frame/iframe code.\n this._parent = this._top = this._globalProxy;\n this._frameElement = null;\n\n // This implements window.frames.length, since window.frames returns a\n // self reference to the window object. This value is incremented in the\n // HTMLFrameElement implementation.\n this._length = 0;\n\n // https://dom.spec.whatwg.org/#window-current-event\n this._currentEvent = undefined;\n\n this._pretendToBeVisual = options.pretendToBeVisual;\n this._storageQuota = options.storageQuota;\n\n // Some properties (such as localStorage and sessionStorage) share data\n // between windows in the same origin. This object is intended\n // to contain such data.\n if (options.commonForOrigin && options.commonForOrigin[documentOrigin]) {\n this._commonForOrigin = options.commonForOrigin;\n } else {\n this._commonForOrigin = {\n [documentOrigin]: {\n localStorageArea: new Map(),\n sessionStorageArea: new Map(),\n windowsInSameOrigin: [this]\n }\n };\n }\n\n this._currentOriginData = this._commonForOrigin[documentOrigin];\n\n // ### WEB STORAGE\n\n this._localStorage = Storage.create(window, [], {\n associatedWindow: this,\n storageArea: this._currentOriginData.localStorageArea,\n type: \"localStorage\",\n url: this._document.documentURI,\n storageQuota: this._storageQuota\n });\n this._sessionStorage = Storage.create(window, [], {\n associatedWindow: this,\n storageArea: this._currentOriginData.sessionStorageArea,\n type: \"sessionStorage\",\n url: this._document.documentURI,\n storageQuota: this._storageQuota\n });\n\n // ### SELECTION\n\n // https://w3c.github.io/selection-api/#dfn-selection\n this._selection = Selection.createImpl(window);\n\n // https://w3c.github.io/selection-api/#dom-window\n this.getSelection = function () {\n return window._selection;\n };\n\n // ### GETTERS\n\n const locationbar = BarProp.create(window);\n const menubar = BarProp.create(window);\n const personalbar = BarProp.create(window);\n const scrollbars = BarProp.create(window);\n const statusbar = BarProp.create(window);\n const toolbar = BarProp.create(window);\n const external = External.create(window);\n const navigator = Navigator.create(window, [], { userAgent: this._resourceLoader._userAgent });\n const performance = Performance.create(window, [], { rawPerformance });\n const screen = Screen.create(window);\n const customElementRegistry = CustomElementRegistry.create(window);\n\n define(this, {\n get length() {\n return window._length;\n },\n get window() {\n return window._globalProxy;\n },\n get frameElement() {\n return idlUtils.wrapperForImpl(window._frameElement);\n },\n get frames() {\n return window._globalProxy;\n },\n get self() {\n return window._globalProxy;\n },\n get parent() {\n return window._parent;\n },\n get top() {\n return window._top;\n },\n get document() {\n return window._document;\n },\n get external() {\n return external;\n },\n get location() {\n return idlUtils.wrapperForImpl(idlUtils.implForWrapper(window._document)._location);\n },\n get history() {\n return idlUtils.wrapperForImpl(idlUtils.implForWrapper(window._document)._history);\n },\n get navigator() {\n return navigator;\n },\n get locationbar() {\n return locationbar;\n },\n get menubar() {\n return menubar;\n },\n get personalbar() {\n return personalbar;\n },\n get scrollbars() {\n return scrollbars;\n },\n get statusbar() {\n return statusbar;\n },\n get toolbar() {\n return toolbar;\n },\n get performance() {\n return performance;\n },\n get screen() {\n return screen;\n },\n get origin() {\n return window._origin;\n },\n // The origin IDL attribute is defined with [Replaceable].\n set origin(value) {\n Object.defineProperty(this, \"origin\", {\n value,\n writable: true,\n enumerable: true,\n configurable: true\n });\n },\n get localStorage() {\n if (idlUtils.implForWrapper(this._document)._origin === \"null\") {\n throw DOMException.create(window, [\n \"localStorage is not available for opaque origins\",\n \"SecurityError\"\n ]);\n }\n\n return this._localStorage;\n },\n get sessionStorage() {\n if (idlUtils.implForWrapper(this._document)._origin === \"null\") {\n throw DOMException.create(window, [\n \"sessionStorage is not available for opaque origins\",\n \"SecurityError\"\n ]);\n }\n\n return this._sessionStorage;\n },\n get customElements() {\n return customElementRegistry;\n },\n get event() {\n return window._currentEvent ? idlUtils.wrapperForImpl(window._currentEvent) : undefined;\n },\n set event(value) {\n Object.defineProperty(window, \"event\", { configurable: true, enumerable: true, writable: true, value });\n }\n });\n\n namedPropertiesWindow.initializeWindow(this, this._globalProxy);\n\n // ### METHODS\n\n // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers\n\n // In the spec the list of active timers is a set of IDs. We make it a map of IDs to Node.js timer objects, so that\n // we can call Node.js-side clearTimeout() when clearing, and thus allow process shutdown faster.\n const listOfActiveTimers = new Map();\n let latestTimerId = 0;\n\n this.setTimeout = function (handler, timeout = 0, ...args) {\n if (typeof handler !== \"function\") {\n handler = webIDLConversions.DOMString(handler);\n }\n timeout = webIDLConversions.long(timeout);\n\n return timerInitializationSteps(handler, timeout, args, { methodContext: window, repeat: false });\n };\n this.setInterval = function (handler, timeout = 0, ...args) {\n if (typeof handler !== \"function\") {\n handler = webIDLConversions.DOMString(handler);\n }\n timeout = webIDLConversions.long(timeout);\n\n return timerInitializationSteps(handler, timeout, args, { methodContext: window, repeat: true });\n };\n\n this.clearTimeout = function (handle = 0) {\n handle = webIDLConversions.long(handle);\n\n const nodejsTimer = listOfActiveTimers.get(handle);\n if (nodejsTimer) {\n clearTimeout(nodejsTimer);\n listOfActiveTimers.delete(handle);\n }\n };\n this.clearInterval = function (handle = 0) {\n handle = webIDLConversions.long(handle);\n\n const nodejsTimer = listOfActiveTimers.get(handle);\n if (nodejsTimer) {\n // We use setTimeout() in timerInitializationSteps even for this.setInterval().\n clearTimeout(nodejsTimer);\n listOfActiveTimers.delete(handle);\n }\n };\n\n function timerInitializationSteps(handler, timeout, args, { methodContext, repeat, previousHandle }) {\n // This appears to be unspecced, but matches browser behavior for close()ed windows.\n if (!methodContext._document) {\n return 0;\n }\n\n // TODO: implement timer nesting level behavior.\n\n const methodContextProxy = methodContext._globalProxy;\n const handle = previousHandle !== undefined ? previousHandle : ++latestTimerId;\n\n function task() {\n if (!listOfActiveTimers.has(handle)) {\n return;\n }\n\n try {\n if (typeof handler === \"function\") {\n handler.apply(methodContextProxy, args);\n } else if (window._runScripts === \"dangerously\") {\n vm.runInContext(handler, window, { filename: window.location.href, displayErrors: false });\n }\n } catch (e) {\n reportException(window, e, window.location.href);\n }\n\n if (listOfActiveTimers.has(handle)) {\n if (repeat) {\n timerInitializationSteps(handler, timeout, args, { methodContext, repeat: true, previousHandle: handle });\n } else {\n listOfActiveTimers.delete(handle);\n }\n }\n }\n\n if (timeout < 0) {\n timeout = 0;\n }\n\n const nodejsTimer = setTimeout(task, timeout);\n listOfActiveTimers.set(handle, nodejsTimer);\n\n return handle;\n }\n\n // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#microtask-queuing\n\n this.queueMicrotask = function (callback) {\n callback = webIDLConversions.Function(callback);\n\n anyNodeVersionQueueMicrotask(() => {\n try {\n callback();\n } catch (e) {\n reportException(window, e, window.location.href);\n }\n });\n };\n\n // https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#animation-frames\n\n let animationFrameCallbackId = 0;\n const mapOfAnimationFrameCallbacks = new Map();\n let animationFrameNodejsInterval = null;\n\n // Unlike the spec, where an animation frame happens every 60 Hz regardless, we optimize so that if there are no\n // requestAnimationFrame() calls outstanding, we don't fire the timer. This helps us track that.\n let numberOfOngoingAnimationFrameCallbacks = 0;\n\n if (this._pretendToBeVisual) {\n this.requestAnimationFrame = function (callback) {\n callback = webIDLConversions.Function(callback);\n\n const handle = ++animationFrameCallbackId;\n mapOfAnimationFrameCallbacks.set(handle, callback);\n\n ++numberOfOngoingAnimationFrameCallbacks;\n if (numberOfOngoingAnimationFrameCallbacks === 1) {\n animationFrameNodejsInterval = setInterval(() => {\n runAnimationFrameCallbacks(rawPerformance.now() - windowInitialized);\n }, 1000 / 60);\n }\n\n return handle;\n };\n\n this.cancelAnimationFrame = function (handle) {\n handle = webIDLConversions[\"unsigned long\"](handle);\n\n removeAnimationFrameCallback(handle);\n };\n\n function runAnimationFrameCallbacks(now) {\n // Converting to an array is important to get a sync snapshot and thus match spec semantics.\n const callbackHandles = [...mapOfAnimationFrameCallbacks.keys()];\n for (const handle of callbackHandles) {\n // This has() can be false if a callback calls cancelAnimationFrame().\n if (mapOfAnimationFrameCallbacks.has(handle)) {\n const callback = mapOfAnimationFrameCallbacks.get(handle);\n removeAnimationFrameCallback(handle);\n try {\n callback(now);\n } catch (e) {\n reportException(window, e, window.location.href);\n }\n }\n }\n }\n\n function removeAnimationFrameCallback(handle) {\n if (mapOfAnimationFrameCallbacks.has(handle)) {\n --numberOfOngoingAnimationFrameCallbacks;\n if (numberOfOngoingAnimationFrameCallbacks === 0) {\n clearInterval(animationFrameNodejsInterval);\n }\n }\n\n mapOfAnimationFrameCallbacks.delete(handle);\n }\n }\n\n function stopAllTimers() {\n for (const nodejsTimer of listOfActiveTimers.values()) {\n clearTimeout(nodejsTimer);\n }\n listOfActiveTimers.clear();\n\n clearInterval(animationFrameNodejsInterval);\n }\n\n function Option(text, value, defaultSelected, selected) {\n if (text === undefined) {\n text = \"\";\n }\n text = webIDLConversions.DOMString(text);\n\n if (value !== undefined) {\n value = webIDLConversions.DOMString(value);\n }\n\n defaultSelected = webIDLConversions.boolean(defaultSelected);\n selected = webIDLConversions.boolean(selected);\n\n const option = window._document.createElement(\"option\");\n const impl = idlUtils.implForWrapper(option);\n\n if (text !== \"\") {\n impl.text = text;\n }\n if (value !== undefined) {\n impl.setAttributeNS(null, \"value\", value);\n }\n if (defaultSelected) {\n impl.setAttributeNS(null, \"selected\", \"\");\n }\n impl._selectedness = selected;\n\n return option;\n }\n Object.defineProperty(Option, \"prototype\", {\n value: this.HTMLOptionElement.prototype,\n configurable: false,\n enumerable: false,\n writable: false\n });\n Object.defineProperty(window, \"Option\", {\n value: Option,\n configurable: true,\n enumerable: false,\n writable: true\n });\n\n function Image(...args) {\n const img = window._document.createElement(\"img\");\n const impl = idlUtils.implForWrapper(img);\n\n if (args.length > 0) {\n impl.setAttributeNS(null, \"width\", String(args[0]));\n }\n if (args.length > 1) {\n impl.setAttributeNS(null, \"height\", String(args[1]));\n }\n\n return img;\n }\n Object.defineProperty(Image, \"prototype\", {\n value: this.HTMLImageElement.prototype,\n configurable: false,\n enumerable: false,\n writable: false\n });\n Object.defineProperty(window, \"Image\", {\n value: Image,\n configurable: true,\n enumerable: false,\n writable: true\n });\n\n function Audio(src) {\n const audio = window._document.createElement(\"audio\");\n const impl = idlUtils.implForWrapper(audio);\n impl.setAttributeNS(null, \"preload\", \"auto\");\n\n if (src !== undefined) {\n impl.setAttributeNS(null, \"src\", String(src));\n }\n\n return audio;\n }\n Object.defineProperty(Audio, \"prototype\", {\n value: this.HTMLAudioElement.prototype,\n configurable: false,\n enumerable: false,\n writable: false\n });\n Object.defineProperty(window, \"Audio\", {\n value: Audio,\n configurable: true,\n enumerable: false,\n writable: true\n });\n\n this.postMessage = postMessage(window);\n\n this.atob = function (str) {\n const result = atob(str);\n if (result === null) {\n throw DOMException.create(window, [\n \"The string to be decoded contains invalid characters.\",\n \"InvalidCharacterError\"\n ]);\n }\n return result;\n };\n\n this.btoa = function (str) {\n const result = btoa(str);\n if (result === null) {\n throw DOMException.create(window, [\n \"The string to be encoded contains invalid characters.\",\n \"InvalidCharacterError\"\n ]);\n }\n return result;\n };\n\n this.stop = function () {\n const manager = idlUtils.implForWrapper(this._document)._requestManager;\n if (manager) {\n manager.close();\n }\n };\n\n this.close = function () {\n // Recursively close child frame windows, then ourselves (depth-first).\n for (let i = 0; i < this.length; ++i) {\n this[i].close();\n }\n\n // Clear out all listeners. Any in-flight or upcoming events should not get delivered.\n idlUtils.implForWrapper(this)._eventListeners = Object.create(null);\n\n if (this._document) {\n if (this._document.body) {\n this._document.body.innerHTML = \"\";\n }\n\n if (this._document.close) {\n // It's especially important to clear out the listeners here because document.close() causes a \"load\" event to\n // fire.\n idlUtils.implForWrapper(this._document)._eventListeners = Object.create(null);\n this._document.close();\n }\n const doc = idlUtils.implForWrapper(this._document);\n if (doc._requestManager) {\n doc._requestManager.close();\n }\n delete this._document;\n }\n\n stopAllTimers();\n WebSocketImpl.cleanUpWindow(this);\n };\n\n this.getComputedStyle = function (elt, pseudoElt = undefined) {\n elt = Element.convert(elt);\n if (pseudoElt !== undefined && pseudoElt !== null) {\n pseudoElt = webIDLConversions.DOMString(pseudoElt);\n }\n\n if (pseudoElt !== undefined && pseudoElt !== null && pseudoElt !== \"\") {\n // TODO: Parse pseudoElt\n\n if (SHADOW_DOM_PSEUDO_REGEXP.test(pseudoElt)) {\n throw new TypeError(\"Tried to get the computed style of a Shadow DOM pseudo-element.\");\n }\n\n notImplemented(\"window.computedStyle(elt, pseudoElt)\", this);\n }\n\n const declaration = new CSSStyleDeclaration();\n const { forEach } = Array.prototype;\n const { style } = elt;\n\n forEachMatchingSheetRuleOfElement(elt, rule => {\n forEach.call(rule.style, property => {\n declaration.setProperty(\n property,\n rule.style.getPropertyValue(property),\n rule.style.getPropertyPriority(property)\n );\n });\n });\n\n // https://drafts.csswg.org/cssom/#dom-window-getcomputedstyle\n const declarations = Object.keys(propertiesWithResolvedValueImplemented);\n forEach.call(declarations, property => {\n declaration.setProperty(property, getResolvedValue(elt, property));\n });\n\n forEach.call(style, property => {\n declaration.setProperty(property, style.getPropertyValue(property), style.getPropertyPriority(property));\n });\n\n return declaration;\n };\n\n this.getSelection = function () {\n return window._document.getSelection();\n };\n\n // The captureEvents() and releaseEvents() methods must do nothing\n this.captureEvents = function () {};\n\n this.releaseEvents = function () {};\n\n // ### PUBLIC DATA PROPERTIES (TODO: should be getters)\n\n function wrapConsoleMethod(method) {\n return (...args) => {\n window._virtualConsole.emit(method, ...args);\n };\n }\n\n this.console = {\n assert: wrapConsoleMethod(\"assert\"),\n clear: wrapConsoleMethod(\"clear\"),\n count: wrapConsoleMethod(\"count\"),\n countReset: wrapConsoleMethod(\"countReset\"),\n debug: wrapConsoleMethod(\"debug\"),\n dir: wrapConsoleMethod(\"dir\"),\n dirxml: wrapConsoleMethod(\"dirxml\"),\n error: wrapConsoleMethod(\"error\"),\n group: wrapConsoleMethod(\"group\"),\n groupCollapsed: wrapConsoleMethod(\"groupCollapsed\"),\n groupEnd: wrapConsoleMethod(\"groupEnd\"),\n info: wrapConsoleMethod(\"info\"),\n log: wrapConsoleMethod(\"log\"),\n table: wrapConsoleMethod(\"table\"),\n time: wrapConsoleMethod(\"time\"),\n timeLog: wrapConsoleMethod(\"timeLog\"),\n timeEnd: wrapConsoleMethod(\"timeEnd\"),\n trace: wrapConsoleMethod(\"trace\"),\n warn: wrapConsoleMethod(\"warn\")\n };\n\n function notImplementedMethod(name) {\n return function () {\n notImplemented(name, window);\n };\n }\n\n define(this, {\n name: \"\",\n status: \"\",\n devicePixelRatio: 1,\n innerWidth: 1024,\n innerHeight: 768,\n outerWidth: 1024,\n outerHeight: 768,\n pageXOffset: 0,\n pageYOffset: 0,\n screenX: 0,\n screenLeft: 0,\n screenY: 0,\n screenTop: 0,\n scrollX: 0,\n scrollY: 0,\n\n alert: notImplementedMethod(\"window.alert\"),\n blur: notImplementedMethod(\"window.blur\"),\n confirm: notImplementedMethod(\"window.confirm\"),\n focus: notImplementedMethod(\"window.focus\"),\n moveBy: notImplementedMethod(\"window.moveBy\"),\n moveTo: notImplementedMethod(\"window.moveTo\"),\n open: notImplementedMethod(\"window.open\"),\n print: notImplementedMethod(\"window.print\"),\n prompt: notImplementedMethod(\"window.prompt\"),\n resizeBy: notImplementedMethod(\"window.resizeBy\"),\n resizeTo: notImplementedMethod(\"window.resizeTo\"),\n scroll: notImplementedMethod(\"window.scroll\"),\n scrollBy: notImplementedMethod(\"window.scrollBy\"),\n scrollTo: notImplementedMethod(\"window.scrollTo\")\n });\n\n // ### INITIALIZATION\n\n process.nextTick(() => {\n if (!window.document) {\n return; // window might've been closed already\n }\n\n const documentImpl = idlUtils.implForWrapper(window._document);\n\n if (window.document.readyState === \"complete\") {\n fireAnEvent(\"load\", window, undefined, {}, documentImpl);\n } else {\n window.document.addEventListener(\"load\", () => {\n fireAnEvent(\"load\", window, undefined, {}, documentImpl);\n\n if (!documentImpl._pageShowingFlag) {\n documentImpl._pageShowingFlag = true;\n fireAnEvent(\"pageshow\", window, PageTransitionEvent, { persisted: false }, documentImpl);\n }\n });\n }\n });\n}\n\nfunction contextifyWindow(window) {\n if (vm.isContext(window)) {\n return;\n }\n\n vm.createContext(window);\n}\n","// Ideally, we would use\n// https://html.spec.whatwg.org/multipage/rendering.html#the-css-user-agent-style-sheet-and-presentational-hints\n// but for now, just use the version from blink. This file is copied from\n// https://chromium.googlesource.com/chromium/blink/+/96aa3a280ab7d67178c8f122a04949ce5f8579e0/Source/core/css/html.css\n// (removed a line which had octal literals inside since octal literals are not allowed in template strings)\n\n// We use a .js file because otherwise we can't browserify this. (brfs is unusable due to lack of ES2015 support)\n\nmodule.exports = `\n/*\n * The default style sheet used to render HTML.\n *\n * Copyright (C) 2000 Lars Knoll (knoll@kde.org)\n * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Library General Public\n * License as published by the Free Software Foundation; either\n * version 2 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Library General Public License for more details.\n *\n * You should have received a copy of the GNU Library General Public License\n * along with this library; see the file COPYING.LIB. If not, write to\n * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\n * Boston, MA 02110-1301, USA.\n *\n */\n\n@namespace \"http://www.w3.org/1999/xhtml\";\n\nhtml {\n display: block\n}\n\n:root {\n scroll-blocks-on: start-touch wheel-event\n}\n\n/* children of the element all have display:none */\nhead {\n display: none\n}\n\nmeta {\n display: none\n}\n\ntitle {\n display: none\n}\n\nlink {\n display: none\n}\n\nstyle {\n display: none\n}\n\nscript {\n display: none\n}\n\n/* generic block-level elements */\n\nbody {\n display: block;\n margin: 8px\n}\n\np {\n display: block;\n -webkit-margin-before: 1__qem;\n -webkit-margin-after: 1__qem;\n -webkit-margin-start: 0;\n -webkit-margin-end: 0;\n}\n\ndiv {\n display: block\n}\n\nlayer {\n display: block\n}\n\narticle, aside, footer, header, hgroup, main, nav, section {\n display: block\n}\n\nmarquee {\n display: inline-block;\n}\n\naddress {\n display: block\n}\n\nblockquote {\n display: block;\n -webkit-margin-before: 1__qem;\n -webkit-margin-after: 1em;\n -webkit-margin-start: 40px;\n -webkit-margin-end: 40px;\n}\n\nfigcaption {\n display: block\n}\n\nfigure {\n display: block;\n -webkit-margin-before: 1em;\n -webkit-margin-after: 1em;\n -webkit-margin-start: 40px;\n -webkit-margin-end: 40px;\n}\n\nq {\n display: inline\n}\n\n/* nwmatcher does not support ::before and ::after, so we can't render q\ncorrectly: https://html.spec.whatwg.org/multipage/rendering.html#phrasing-content-3\nTODO: add q::before and q::after selectors\n*/\n\ncenter {\n display: block;\n /* special centering to be able to emulate the html4/netscape behaviour */\n text-align: -webkit-center\n}\n\nhr {\n display: block;\n -webkit-margin-before: 0.5em;\n -webkit-margin-after: 0.5em;\n -webkit-margin-start: auto;\n -webkit-margin-end: auto;\n border-style: inset;\n border-width: 1px;\n box-sizing: border-box\n}\n\nmap {\n display: inline\n}\n\nvideo {\n object-fit: contain;\n}\n\n/* heading elements */\n\nh1 {\n display: block;\n font-size: 2em;\n -webkit-margin-before: 0.67__qem;\n -webkit-margin-after: 0.67em;\n -webkit-margin-start: 0;\n -webkit-margin-end: 0;\n font-weight: bold\n}\n\narticle h1,\naside h1,\nnav h1,\nsection h1 {\n font-size: 1.5em;\n -webkit-margin-before: 0.83__qem;\n -webkit-margin-after: 0.83em;\n}\n\narticle article h1,\narticle aside h1,\narticle nav h1,\narticle section h1,\naside article h1,\naside aside h1,\naside nav h1,\naside section h1,\nnav article h1,\nnav aside h1,\nnav nav h1,\nnav section h1,\nsection article h1,\nsection aside h1,\nsection nav h1,\nsection section h1 {\n font-size: 1.17em;\n -webkit-margin-before: 1__qem;\n -webkit-margin-after: 1em;\n}\n\n/* Remaining selectors are deleted because nwmatcher does not support\n:matches() and expanding the selectors manually would be far too verbose.\nAlso see https://html.spec.whatwg.org/multipage/rendering.html#sections-and-headings\nTODO: rewrite to use :matches() when nwmatcher supports it.\n*/\n\nh2 {\n display: block;\n font-size: 1.5em;\n -webkit-margin-before: 0.83__qem;\n -webkit-margin-after: 0.83em;\n -webkit-margin-start: 0;\n -webkit-margin-end: 0;\n font-weight: bold\n}\n\nh3 {\n display: block;\n font-size: 1.17em;\n -webkit-margin-before: 1__qem;\n -webkit-margin-after: 1em;\n -webkit-margin-start: 0;\n -webkit-margin-end: 0;\n font-weight: bold\n}\n\nh4 {\n display: block;\n -webkit-margin-before: 1.33__qem;\n -webkit-margin-after: 1.33em;\n -webkit-margin-start: 0;\n -webkit-margin-end: 0;\n font-weight: bold\n}\n\nh5 {\n display: block;\n font-size: .83em;\n -webkit-margin-before: 1.67__qem;\n -webkit-margin-after: 1.67em;\n -webkit-margin-start: 0;\n -webkit-margin-end: 0;\n font-weight: bold\n}\n\nh6 {\n display: block;\n font-size: .67em;\n -webkit-margin-before: 2.33__qem;\n -webkit-margin-after: 2.33em;\n -webkit-margin-start: 0;\n -webkit-margin-end: 0;\n font-weight: bold\n}\n\n/* tables */\n\ntable {\n display: table;\n border-collapse: separate;\n border-spacing: 2px;\n border-color: gray\n}\n\nthead {\n display: table-header-group;\n vertical-align: middle;\n border-color: inherit\n}\n\ntbody {\n display: table-row-group;\n vertical-align: middle;\n border-color: inherit\n}\n\ntfoot {\n display: table-footer-group;\n vertical-align: middle;\n border-color: inherit\n}\n\n/* for tables without table section elements (can happen with XHTML or dynamically created tables) */\ntable > tr {\n vertical-align: middle;\n}\n\ncol {\n display: table-column\n}\n\ncolgroup {\n display: table-column-group\n}\n\ntr {\n display: table-row;\n vertical-align: inherit;\n border-color: inherit\n}\n\ntd, th {\n display: table-cell;\n vertical-align: inherit\n}\n\nth {\n font-weight: bold\n}\n\ncaption {\n display: table-caption;\n text-align: -webkit-center\n}\n\n/* lists */\n\nul, menu, dir {\n display: block;\n list-style-type: disc;\n -webkit-margin-before: 1__qem;\n -webkit-margin-after: 1em;\n -webkit-margin-start: 0;\n -webkit-margin-end: 0;\n -webkit-padding-start: 40px\n}\n\nol {\n display: block;\n list-style-type: decimal;\n -webkit-margin-before: 1__qem;\n -webkit-margin-after: 1em;\n -webkit-margin-start: 0;\n -webkit-margin-end: 0;\n -webkit-padding-start: 40px\n}\n\nli {\n display: list-item;\n text-align: -webkit-match-parent;\n}\n\nul ul, ol ul {\n list-style-type: circle\n}\n\nol ol ul, ol ul ul, ul ol ul, ul ul ul {\n list-style-type: square\n}\n\ndd {\n display: block;\n -webkit-margin-start: 40px\n}\n\ndl {\n display: block;\n -webkit-margin-before: 1__qem;\n -webkit-margin-after: 1em;\n -webkit-margin-start: 0;\n -webkit-margin-end: 0;\n}\n\ndt {\n display: block\n}\n\nol ul, ul ol, ul ul, ol ol {\n -webkit-margin-before: 0;\n -webkit-margin-after: 0\n}\n\n/* form elements */\n\nform {\n display: block;\n margin-top: 0__qem;\n}\n\nlabel {\n cursor: default;\n}\n\nlegend {\n display: block;\n -webkit-padding-start: 2px;\n -webkit-padding-end: 2px;\n border: none\n}\n\nfieldset {\n display: block;\n -webkit-margin-start: 2px;\n -webkit-margin-end: 2px;\n -webkit-padding-before: 0.35em;\n -webkit-padding-start: 0.75em;\n -webkit-padding-end: 0.75em;\n -webkit-padding-after: 0.625em;\n border: 2px groove ThreeDFace;\n min-width: -webkit-min-content;\n}\n\nbutton {\n -webkit-appearance: button;\n}\n\n/* Form controls don't go vertical. */\ninput, textarea, select, button, meter, progress {\n -webkit-writing-mode: horizontal-tb !important;\n}\n\ninput, textarea, select, button {\n margin: 0__qem;\n font: -webkit-small-control;\n text-rendering: auto; /* FIXME: Remove when tabs work with optimizeLegibility. */\n color: initial;\n letter-spacing: normal;\n word-spacing: normal;\n line-height: normal;\n text-transform: none;\n text-indent: 0;\n text-shadow: none;\n display: inline-block;\n text-align: start;\n}\n\n/* TODO: Add \" i\" to attribute matchers to support case-insensitive matching */\ninput[type=\"hidden\"] {\n display: none\n}\n\ninput {\n -webkit-appearance: textfield;\n padding: 1px;\n background-color: white;\n border: 2px inset;\n -webkit-rtl-ordering: logical;\n -webkit-user-select: text;\n cursor: auto;\n}\n\ninput[type=\"search\"] {\n -webkit-appearance: searchfield;\n box-sizing: border-box;\n}\n\nselect {\n border-radius: 5px;\n}\n\ntextarea {\n -webkit-appearance: textarea;\n background-color: white;\n border: 1px solid;\n -webkit-rtl-ordering: logical;\n -webkit-user-select: text;\n flex-direction: column;\n resize: auto;\n cursor: auto;\n padding: 2px;\n white-space: pre-wrap;\n word-wrap: break-word;\n}\n\ninput[type=\"password\"] {\n -webkit-text-security: disc !important;\n}\n\ninput[type=\"hidden\"], input[type=\"image\"], input[type=\"file\"] {\n -webkit-appearance: initial;\n padding: initial;\n background-color: initial;\n border: initial;\n}\n\ninput[type=\"file\"] {\n align-items: baseline;\n color: inherit;\n text-align: start !important;\n}\n\ninput[type=\"radio\"], input[type=\"checkbox\"] {\n margin: 3px 0.5ex;\n padding: initial;\n background-color: initial;\n border: initial;\n}\n\ninput[type=\"button\"], input[type=\"submit\"], input[type=\"reset\"] {\n -webkit-appearance: push-button;\n -webkit-user-select: none;\n white-space: pre\n}\n\ninput[type=\"button\"], input[type=\"submit\"], input[type=\"reset\"], button {\n align-items: flex-start;\n text-align: center;\n cursor: default;\n color: ButtonText;\n padding: 2px 6px 3px 6px;\n border: 2px outset ButtonFace;\n background-color: ButtonFace;\n box-sizing: border-box\n}\n\ninput[type=\"range\"] {\n -webkit-appearance: slider-horizontal;\n padding: initial;\n border: initial;\n margin: 2px;\n color: #909090;\n}\n\ninput[type=\"button\"]:disabled, input[type=\"submit\"]:disabled, input[type=\"reset\"]:disabled,\nbutton:disabled, select:disabled, optgroup:disabled, option:disabled,\nselect[disabled]>option {\n color: GrayText\n}\n\ninput[type=\"button\"]:active, input[type=\"submit\"]:active, input[type=\"reset\"]:active, button:active {\n border-style: inset\n}\n\ninput[type=\"button\"]:active:disabled, input[type=\"submit\"]:active:disabled, input[type=\"reset\"]:active:disabled, button:active:disabled {\n border-style: outset\n}\n\ndatalist {\n display: none\n}\n\narea {\n display: inline;\n cursor: pointer;\n}\n\nparam {\n display: none\n}\n\ninput[type=\"checkbox\"] {\n -webkit-appearance: checkbox;\n box-sizing: border-box;\n}\n\ninput[type=\"radio\"] {\n -webkit-appearance: radio;\n box-sizing: border-box;\n}\n\ninput[type=\"color\"] {\n -webkit-appearance: square-button;\n width: 44px;\n height: 23px;\n background-color: ButtonFace;\n /* Same as native_theme_base. */\n border: 1px #a9a9a9 solid;\n padding: 1px 2px;\n}\n\ninput[type=\"color\"][list] {\n -webkit-appearance: menulist;\n width: 88px;\n height: 23px\n}\n\nselect {\n -webkit-appearance: menulist;\n box-sizing: border-box;\n align-items: center;\n border: 1px solid;\n white-space: pre;\n -webkit-rtl-ordering: logical;\n color: black;\n background-color: white;\n cursor: default;\n}\n\noptgroup {\n font-weight: bolder;\n display: block;\n}\n\noption {\n font-weight: normal;\n display: block;\n padding: 0 2px 1px 2px;\n white-space: pre;\n min-height: 1.2em;\n}\n\noutput {\n display: inline;\n}\n\n/* meter */\n\nmeter {\n -webkit-appearance: meter;\n box-sizing: border-box;\n display: inline-block;\n height: 1em;\n width: 5em;\n vertical-align: -0.2em;\n}\n\n/* progress */\n\nprogress {\n -webkit-appearance: progress-bar;\n box-sizing: border-box;\n display: inline-block;\n height: 1em;\n width: 10em;\n vertical-align: -0.2em;\n}\n\n/* inline elements */\n\nu, ins {\n text-decoration: underline\n}\n\nstrong, b {\n font-weight: bold\n}\n\ni, cite, em, var, address, dfn {\n font-style: italic\n}\n\ntt, code, kbd, samp {\n font-family: monospace\n}\n\npre, xmp, plaintext, listing {\n display: block;\n font-family: monospace;\n white-space: pre;\n margin: 1__qem 0\n}\n\nmark {\n background-color: yellow;\n color: black\n}\n\nbig {\n font-size: larger\n}\n\nsmall {\n font-size: smaller\n}\n\ns, strike, del {\n text-decoration: line-through\n}\n\nsub {\n vertical-align: sub;\n font-size: smaller\n}\n\nsup {\n vertical-align: super;\n font-size: smaller\n}\n\nnobr {\n white-space: nowrap\n}\n\n/* states */\n\n:focus {\n outline: auto 5px -webkit-focus-ring-color\n}\n\n/* Read-only text fields do not show a focus ring but do still receive focus */\nhtml:focus, body:focus, input[readonly]:focus {\n outline: none\n}\n\nembed:focus, iframe:focus, object:focus {\n outline: none\n}\n\ninput:focus, textarea:focus, select:focus {\n outline-offset: -2px\n}\n\ninput[type=\"button\"]:focus,\ninput[type=\"checkbox\"]:focus,\ninput[type=\"file\"]:focus,\ninput[type=\"hidden\"]:focus,\ninput[type=\"image\"]:focus,\ninput[type=\"radio\"]:focus,\ninput[type=\"reset\"]:focus,\ninput[type=\"search\"]:focus,\ninput[type=\"submit\"]:focus {\n outline-offset: 0\n}\n\n/* HTML5 ruby elements */\n\nruby, rt {\n text-indent: 0; /* blocks used for ruby rendering should not trigger this */\n}\n\nrt {\n line-height: normal;\n -webkit-text-emphasis: none;\n}\n\nruby > rt {\n display: block;\n font-size: 50%;\n text-align: start;\n}\n\nruby > rp {\n display: none;\n}\n\n/* other elements */\n\nnoframes {\n display: none\n}\n\nframeset, frame {\n display: block\n}\n\nframeset {\n border-color: inherit\n}\n\niframe {\n border: 2px inset\n}\n\ndetails {\n display: block\n}\n\nsummary {\n display: block\n}\n\ntemplate {\n display: none\n}\n\nbdi, output {\n unicode-bidi: -webkit-isolate;\n}\n\nbdo {\n unicode-bidi: bidi-override;\n}\n\ntextarea[dir=auto] {\n unicode-bidi: -webkit-plaintext;\n}\n\ndialog:not([open]) {\n display: none\n}\n\ndialog {\n position: absolute;\n left: 0;\n right: 0;\n width: -webkit-fit-content;\n height: -webkit-fit-content;\n margin: auto;\n border: solid;\n padding: 1em;\n background: white;\n color: black\n}\n\n[hidden] {\n display: none\n}\n\n/* noscript is handled internally, as it depends on settings. */\n\n`;\n","\"use strict\";\n\nmodule.exports = function (nameForErrorMessage, window) {\n if (!window) {\n // Do nothing for window-less documents.\n return;\n }\n\n const error = new Error(`Not implemented: ${nameForErrorMessage}`);\n error.type = \"not implemented\";\n\n window._virtualConsole.emit(\"jsdomError\", error);\n};\n","\"use strict\";\n\nconst parse5 = require(\"parse5\");\n\nconst { createElement } = require(\"../../living/helpers/create-element\");\nconst { HTML_NS } = require(\"../../living/helpers/namespaces\");\n\nconst DocumentType = require(\"../../living/generated/DocumentType\");\nconst DocumentFragment = require(\"../../living/generated/DocumentFragment\");\nconst Text = require(\"../../living/generated/Text\");\nconst Comment = require(\"../../living/generated/Comment\");\n\nconst attributes = require(\"../../living/attributes\");\nconst nodeTypes = require(\"../../living/node-type\");\n\nconst serializationAdapter = require(\"../../living/domparsing/parse5-adapter-serialization\");\nconst {\n customElementReactionsStack, invokeCEReactions, lookupCEDefinition\n} = require(\"../../living/helpers/custom-elements\");\n\n// Horrible monkey-patch to implement https://github.com/inikulin/parse5/issues/237 and\n// https://github.com/inikulin/parse5/issues/285.\nconst OpenElementStack = require(\"parse5/lib/parser/open-element-stack\");\n\nconst openElementStackOriginalPush = OpenElementStack.prototype.push;\nOpenElementStack.prototype.push = function (...args) {\n openElementStackOriginalPush.apply(this, args);\n this.treeAdapter._currentElement = this.current;\n\n const after = this.items[this.stackTop];\n if (after._pushedOnStackOfOpenElements) {\n after._pushedOnStackOfOpenElements();\n }\n};\n\nconst openElementStackOriginalPop = OpenElementStack.prototype.pop;\nOpenElementStack.prototype.pop = function (...args) {\n const before = this.items[this.stackTop];\n\n openElementStackOriginalPop.apply(this, args);\n this.treeAdapter._currentElement = this.current;\n\n if (before._poppedOffStackOfOpenElements) {\n before._poppedOffStackOfOpenElements();\n }\n};\n\nclass JSDOMParse5Adapter {\n constructor(documentImpl, options = {}) {\n this._documentImpl = documentImpl;\n this._globalObject = documentImpl._globalObject;\n this._fragment = options.fragment || false;\n\n // Since the createElement hook doesn't provide the parent element, we keep track of this using _currentElement:\n // https://github.com/inikulin/parse5/issues/285. See above horrible monkey-patch for how this is maintained.\n this._currentElement = undefined;\n }\n\n _ownerDocument() {\n const { _currentElement } = this;\n\n // The _currentElement is undefined when parsing elements at the root of the document.\n if (_currentElement) {\n return _currentElement.localName === \"template\" && _currentElement.namespaceURI === HTML_NS ?\n _currentElement.content._ownerDocument :\n _currentElement._ownerDocument;\n }\n\n return this._documentImpl;\n }\n\n createDocument() {\n // parse5's model assumes that parse(html) will call into here to create the new Document, then return it. However,\n // jsdom's model assumes we can create a Window (and through that create an empty Document), do some other setup\n // stuff, and then parse, stuffing nodes into that Document as we go. So to adapt between these two models, we just\n // return the already-created Document when asked by parse5 to \"create\" a Document.\n return this._documentImpl;\n }\n\n createDocumentFragment() {\n const ownerDocument = this._ownerDocument();\n return DocumentFragment.createImpl(this._globalObject, [], { ownerDocument });\n }\n\n // https://html.spec.whatwg.org/#create-an-element-for-the-token\n createElement(localName, namespace, attrs) {\n const ownerDocument = this._ownerDocument();\n\n const isAttribute = attrs.find(attr => attr.name === \"is\");\n const isValue = isAttribute ? isAttribute.value : null;\n\n const definition = lookupCEDefinition(ownerDocument, namespace, localName);\n\n let willExecuteScript = false;\n if (definition !== null && !this._fragment) {\n willExecuteScript = true;\n }\n\n if (willExecuteScript) {\n ownerDocument._throwOnDynamicMarkupInsertionCounter++;\n customElementReactionsStack.push([]);\n }\n\n const element = createElement(ownerDocument, localName, namespace, null, isValue, willExecuteScript);\n this.adoptAttributes(element, attrs);\n\n if (willExecuteScript) {\n const queue = customElementReactionsStack.pop();\n invokeCEReactions(queue);\n ownerDocument._throwOnDynamicMarkupInsertionCounter--;\n }\n\n if (\"_parserInserted\" in element) {\n element._parserInserted = true;\n }\n\n return element;\n }\n\n createCommentNode(data) {\n const ownerDocument = this._ownerDocument();\n return Comment.createImpl(this._globalObject, [], { data, ownerDocument });\n }\n\n appendChild(parentNode, newNode) {\n parentNode._append(newNode);\n }\n\n insertBefore(parentNode, newNode, referenceNode) {\n parentNode._insert(newNode, referenceNode);\n }\n\n setTemplateContent(templateElement, contentFragment) {\n // This code makes the glue between jsdom and parse5 HTMLTemplateElement parsing:\n //\n // * jsdom during the construction of the HTMLTemplateElement (for example when create via\n // `document.createElement(\"template\")`), creates a DocumentFragment and set it into _templateContents.\n // * parse5 when parsing a