summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.eslintrc.json25
-rw-r--r--README.md2
-rw-r--r--ext/bg/background.html3
-rw-r--r--ext/bg/context.html3
-rw-r--r--ext/bg/css/settings.css2
-rw-r--r--ext/bg/js/anki.js12
-rw-r--r--ext/bg/js/api.js10
-rw-r--r--ext/bg/js/audio.js8
-rw-r--r--ext/bg/js/backend-api-forwarder.js4
-rw-r--r--ext/bg/js/backend.js10
-rw-r--r--ext/bg/js/conditions-ui.js20
-rw-r--r--ext/bg/js/conditions.js30
-rw-r--r--ext/bg/js/context.js34
-rw-r--r--ext/bg/js/database.js24
-rw-r--r--ext/bg/js/deinflector.js2
-rw-r--r--ext/bg/js/dictionary.js16
-rw-r--r--ext/bg/js/handlebars.js2
-rw-r--r--ext/bg/js/mecab.js4
-rw-r--r--ext/bg/js/options.js12
-rw-r--r--ext/bg/js/page-exit-prevention.js60
-rw-r--r--ext/bg/js/profile-conditions.js2
-rw-r--r--ext/bg/js/request.js2
-rw-r--r--ext/bg/js/search-query-parser.js18
-rw-r--r--ext/bg/js/search.js13
-rw-r--r--ext/bg/js/settings.js852
-rw-r--r--ext/bg/js/settings/anki-templates.js109
-rw-r--r--ext/bg/js/settings/anki.js247
-rw-r--r--ext/bg/js/settings/audio.js102
-rw-r--r--ext/bg/js/settings/dictionaries.js (renamed from ext/bg/js/settings-dictionaries.js)14
-rw-r--r--ext/bg/js/settings/main.js239
-rw-r--r--ext/bg/js/settings/popup-preview-frame.js (renamed from ext/bg/js/settings-popup-preview.js)2
-rw-r--r--ext/bg/js/settings/popup-preview.js62
-rw-r--r--ext/bg/js/settings/profiles.js (renamed from ext/bg/js/settings-profiles.js)18
-rw-r--r--ext/bg/js/settings/storage.js138
-rw-r--r--ext/bg/js/templates.js212
-rw-r--r--ext/bg/js/translator.js20
-rw-r--r--ext/bg/js/util.js14
-rw-r--r--ext/bg/legal.html2
-rw-r--r--ext/bg/search.html6
-rw-r--r--ext/bg/settings-popup-preview.html6
-rw-r--r--ext/bg/settings.html30
-rw-r--r--ext/fg/float.html4
-rw-r--r--ext/fg/js/api.js64
-rw-r--r--ext/fg/js/document.js21
-rw-r--r--ext/fg/js/float.js4
-rw-r--r--ext/fg/js/frontend-api-receiver.js6
-rw-r--r--ext/fg/js/frontend-api-sender.js6
-rw-r--r--ext/fg/js/frontend.js63
-rw-r--r--ext/fg/js/popup-proxy-host.js4
-rw-r--r--ext/fg/js/popup.js8
-rw-r--r--ext/fg/js/source.js8
-rw-r--r--ext/fg/js/util.js52
-rw-r--r--ext/manifest.json4
-rw-r--r--ext/mixed/css/display.css15
-rw-r--r--ext/mixed/js/audio.js4
-rw-r--r--ext/mixed/js/core.js (renamed from ext/mixed/js/extension.js)85
-rw-r--r--ext/mixed/js/display-context.js55
-rw-r--r--ext/mixed/js/display.js163
-rw-r--r--ext/mixed/js/dom.js66
-rw-r--r--ext/mixed/js/japanese.js22
-rw-r--r--ext/mixed/lib/wanakana.min.js3
-rw-r--r--ext/mixed/lib/wanakana.min.js.map1
-rw-r--r--tmpl/kanji.html9
-rw-r--r--tmpl/terms.html9
64 files changed, 1685 insertions, 1382 deletions
diff --git a/.eslintrc.json b/.eslintrc.json
index 44eaeff8..0e3b939a 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -3,19 +3,26 @@
"parserOptions": {
"ecmaVersion": 8
},
+ "ignorePatterns": [
+ "/ext/mixed/lib/",
+ "/ext/bg/js/templates.js"
+ ],
"rules": {
- "arrow-parens": ["error", "as-needed"],
+ "arrow-parens": ["error", "always"],
"comma-dangle": ["error", "never"],
+ "curly": ["error", "all"],
"dot-notation": "error",
- "eqeqeq": 2,
+ "eqeqeq": "error",
"no-case-declarations": "error",
- "no-const-assign": 2,
- "no-undef": 0,
- "no-unused-vars": 0,
- "no-var": 2,
- "prefer-const": 2,
+ "no-const-assign": "error",
+ "no-constant-condition": "off",
+ "no-undef": "off",
+ "no-unused-vars": ["error", {"vars": "local", "args": "after-used", "argsIgnorePattern": "^_", "caughtErrors": "none"}],
+ "no-var": "error",
+ "prefer-const": ["error", {"destructuring": "all"}],
"quote-props": ["error", "consistent"],
- "quotes": [2, "single", "avoid-escape"],
- "semi": 2
+ "quotes": ["error", "single", "avoid-escape"],
+ "require-atomic-updates": "off",
+ "semi": "error"
}
}
diff --git a/README.md b/README.md
index a5c00b17..7b25b852 100644
--- a/README.md
+++ b/README.md
@@ -259,7 +259,7 @@ versions packaged.
* Handlebars: [homepage](https://handlebarsjs.com/) - [snapshot](http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars.min-714a4c4.js) - [license](https://github.com/wycats/handlebars.js/blob/v4.0.6/LICENSE)
* jQuery: [homepage](https://blog.jquery.com/) - [snapshot](https://code.jquery.com/jquery-3.2.1.min.js) - [license](https://github.com/jquery/jquery/blob/3.2.1/LICENSE.txt)
* JSZip: [homepage](https://stuk.github.io/jszip/) - [snapshot](https://raw.githubusercontent.com/Stuk/jszip/de7f52fbcba485737bef7923a83f0fad92d9f5bc/dist/jszip.min.js) - [license](https://github.com/Stuk/jszip/blob/v3.1.3/LICENSE.markdown)
-* WanaKana: [homepage](https://wanakana.com/) - [snapshot](https://raw.githubusercontent.com/WaniKani/WanaKana/7c4a052/gh-pages/assets/js/wanakana.min.js) - [license](https://github.com/WaniKani/WanaKana/blob/2.2.3/LICENSE)
+* WanaKana: [homepage](https://wanakana.com/) - [snapshot](https://unpkg.com/wanakana@4.0.2/umd/wanakana.min.js) - [license](https://github.com/WaniKani/WanaKana/blob/4.0.2/LICENSE)
## Frequently Asked Questions ##
diff --git a/ext/bg/background.html b/ext/bg/background.html
index 6e6e7c26..5a6970c3 100644
--- a/ext/bg/background.html
+++ b/ext/bg/background.html
@@ -18,7 +18,8 @@
<script src="/mixed/lib/jszip.min.js"></script>
<script src="/mixed/lib/wanakana.min.js"></script>
- <script src="/mixed/js/extension.js"></script>
+ <script src="/mixed/js/core.js"></script>
+ <script src="/mixed/js/dom.js"></script>
<script src="/bg/js/anki.js"></script>
<script src="/bg/js/mecab.js"></script>
diff --git a/ext/bg/context.html b/ext/bg/context.html
index bd62270b..eda09a68 100644
--- a/ext/bg/context.html
+++ b/ext/bg/context.html
@@ -178,7 +178,8 @@
</a>
</div>
- <script src="/mixed/js/extension.js"></script>
+ <script src="/mixed/js/core.js"></script>
+ <script src="/mixed/js/dom.js"></script>
<script src="/bg/js/api.js"></script>
<script src="/bg/js/options.js"></script>
diff --git a/ext/bg/css/settings.css b/ext/bg/css/settings.css
index 5dfbd931..8adae47c 100644
--- a/ext/bg/css/settings.css
+++ b/ext/bg/css/settings.css
@@ -17,7 +17,7 @@
*/
-#anki-spinner, #anki-error,
+#anki-spinner,
#dict-spinner, #dict-import-progress,
.storage-hidden, #storage-spinner {
display: none;
diff --git a/ext/bg/js/anki.js b/ext/bg/js/anki.js
index 9f851f13..17b93620 100644
--- a/ext/bg/js/anki.js
+++ b/ext/bg/js/anki.js
@@ -74,7 +74,7 @@ class AnkiConnect {
async findNoteIds(notes) {
await this.checkVersion();
- const actions = notes.map(note => ({
+ const actions = notes.map((note) => ({
action: 'findNotes',
params: {
query: `deck:"${AnkiConnect.escapeQuery(note.deckName)}" ${AnkiConnect.fieldsToQuery(note.fields)}`
@@ -108,11 +108,11 @@ class AnkiConnect {
*/
class AnkiNull {
- async addNote(note) {
+ async addNote() {
return null;
}
- async canAddNotes(notes) {
+ async canAddNotes() {
return [];
}
@@ -124,15 +124,15 @@ class AnkiNull {
return [];
}
- async getModelFieldNames(modelName) {
+ async getModelFieldNames() {
return [];
}
- async guiBrowse(query) {
+ async guiBrowse() {
return [];
}
- async findNoteIds(notes) {
+ async findNoteIds() {
return [];
}
}
diff --git a/ext/bg/js/api.js b/ext/bg/js/api.js
index 766fb0ed..b489b8d2 100644
--- a/ext/bg/js/api.js
+++ b/ext/bg/js/api.js
@@ -45,7 +45,7 @@ async function apiOptionsSet(changedOptions, optionsContext, source) {
function modifyOption(path, value, options) {
let pivot = options;
for (const key of path.slice(0, -1)) {
- if (!pivot.hasOwnProperty(key)) {
+ if (!hasOwn(pivot, key)) {
return false;
}
pivot = pivot[key];
@@ -207,7 +207,7 @@ async function apiDefinitionsAddable(definitions, modes, optionsContext) {
}
if (cannotAdd.length > 0) {
- const noteIdsArray = await anki.findNoteIds(cannotAdd.map(e => e[0]));
+ const noteIdsArray = await anki.findNoteIds(cannotAdd.map((e) => e[0]));
for (let i = 0, ii = Math.min(cannotAdd.length, noteIdsArray.length); i < ii; ++i) {
const noteIds = noteIdsArray[i];
if (noteIds.length > 0) {
@@ -236,7 +236,7 @@ async function apiTemplateRender(template, data, dynamic) {
async function apiCommandExec(command, params) {
const handlers = apiCommandExec.handlers;
- if (handlers.hasOwnProperty(command)) {
+ if (hasOwn(handlers, command)) {
const handler = handlers[command];
handler(params);
}
@@ -404,7 +404,9 @@ async function apiGetBrowser() {
if (info.name === 'Fennec') {
return 'firefox-mobile';
}
- } catch (e) { }
+ } catch (e) {
+ // NOP
+ }
return 'firefox';
} else {
return 'chrome';
diff --git a/ext/bg/js/audio.js b/ext/bg/js/audio.js
index cd42a158..dc0ba5eb 100644
--- a/ext/bg/js/audio.js
+++ b/ext/bg/js/audio.js
@@ -107,12 +107,12 @@ const audioUrlBuilders = {
'custom': async (definition, optionsContext) => {
const options = await apiOptionsGet(optionsContext);
const customSourceUrl = options.audio.customSourceUrl;
- return customSourceUrl.replace(/\{([^\}]*)\}/g, (m0, m1) => (definition.hasOwnProperty(m1) ? `${definition[m1]}` : m0));
+ return customSourceUrl.replace(/\{([^}]*)\}/g, (m0, m1) => (hasOwn(definition, m1) ? `${definition[m1]}` : m0));
}
};
async function audioGetUrl(definition, mode, optionsContext, download) {
- if (audioUrlBuilders.hasOwnProperty(mode)) {
+ if (hasOwn(audioUrlBuilders, mode)) {
const handler = audioUrlBuilders[mode];
try {
return await handler(definition, optionsContext, download);
@@ -133,7 +133,7 @@ function audioUrlNormalize(url, baseUrl, basePath) {
// Begins with "/"
url = baseUrl + url;
}
- } else if (!/^[a-z][a-z0-9\+\-\.]*:/i.test(url)) {
+ } else if (!/^[a-z][a-z0-9\-+.]*:/i.test(url)) {
// No URI scheme => relative path
url = baseUrl + basePath + url;
}
@@ -171,7 +171,7 @@ async function audioInject(definition, fields, sources, optionsContext) {
try {
let audioSourceDefinition = definition;
- if (definition.hasOwnProperty('expressions')) {
+ if (hasOwn(definition, 'expressions')) {
audioSourceDefinition = definition.expressions[0];
}
diff --git a/ext/bg/js/backend-api-forwarder.js b/ext/bg/js/backend-api-forwarder.js
index 979afd16..db4d30b9 100644
--- a/ext/bg/js/backend-api-forwarder.js
+++ b/ext/bg/js/backend-api-forwarder.js
@@ -37,8 +37,8 @@ class BackendApiForwarder {
const forwardPort = chrome.tabs.connect(tabId, {name: 'frontend-api-receiver'});
- port.onMessage.addListener(message => forwardPort.postMessage(message));
- forwardPort.onMessage.addListener(message => port.postMessage(message));
+ port.onMessage.addListener((message) => forwardPort.postMessage(message));
+ forwardPort.onMessage.addListener((message) => port.postMessage(message));
port.onDisconnect.addListener(() => forwardPort.disconnect());
forwardPort.onDisconnect.addListener(() => port.disconnect());
}
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index 45db9660..d9f9b586 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -60,7 +60,7 @@ class Backend {
this.applyOptions();
const callback = () => this.checkLastError(chrome.runtime.lastError);
- chrome.tabs.query({}, tabs => {
+ chrome.tabs.query({}, (tabs) => {
for (const tab of tabs) {
chrome.tabs.sendMessage(tab.id, {action: 'optionsUpdate', params: {source}}, callback);
}
@@ -73,12 +73,12 @@ class Backend {
onMessage({action, params}, sender, callback) {
const handlers = Backend.messageHandlers;
- if (handlers.hasOwnProperty(action)) {
+ if (hasOwn(handlers, action)) {
const handler = handlers[action];
const promise = handler(params, sender);
promise.then(
- result => callback({result}),
- error => callback({error: errorToJson(error)})
+ (result) => callback({result}),
+ (error) => callback({error: errorToJson(error)})
);
}
@@ -177,7 +177,7 @@ class Backend {
}
}
- checkLastError(e) {
+ checkLastError() {
// NOP
}
}
diff --git a/ext/bg/js/conditions-ui.js b/ext/bg/js/conditions-ui.js
index 43c6dc08..cc9db087 100644
--- a/ext/bg/js/conditions-ui.js
+++ b/ext/bg/js/conditions-ui.js
@@ -84,7 +84,7 @@ ConditionsUI.Container = class Container {
createDefaultCondition(type) {
let operator = '';
let value = '';
- if (this.conditionDescriptors.hasOwnProperty(type)) {
+ if (hasOwn(this.conditionDescriptors, type)) {
const conditionDescriptor = this.conditionDescriptors[type];
operator = conditionDescriptor.defaultOperator;
({value} = this.getOperatorDefaultValue(type, operator));
@@ -96,15 +96,15 @@ ConditionsUI.Container = class Container {
}
getOperatorDefaultValue(type, operator) {
- if (this.conditionDescriptors.hasOwnProperty(type)) {
+ if (hasOwn(this.conditionDescriptors, type)) {
const conditionDescriptor = this.conditionDescriptors[type];
- if (conditionDescriptor.operators.hasOwnProperty(operator)) {
+ if (hasOwn(conditionDescriptor.operators, operator)) {
const operatorDescriptor = conditionDescriptor.operators[operator];
- if (operatorDescriptor.hasOwnProperty('defaultValue')) {
+ if (hasOwn(operatorDescriptor, 'defaultValue')) {
return {value: operatorDescriptor.defaultValue, fromOperator: true};
}
}
- if (conditionDescriptor.hasOwnProperty('defaultValue')) {
+ if (hasOwn(conditionDescriptor, 'defaultValue')) {
return {value: conditionDescriptor.defaultValue, fromOperator: false};
}
}
@@ -219,7 +219,7 @@ ConditionsUI.Condition = class Condition {
optionGroup.empty();
const type = this.condition.type;
- if (conditionDescriptors.hasOwnProperty(type)) {
+ if (hasOwn(conditionDescriptors, type)) {
const conditionDescriptor = conditionDescriptors[type];
const operators = conditionDescriptor.operators;
for (const operatorName of Object.keys(operators)) {
@@ -240,23 +240,23 @@ ConditionsUI.Condition = class Condition {
};
const objects = [];
- if (conditionDescriptors.hasOwnProperty(type)) {
+ if (hasOwn(conditionDescriptors, type)) {
const conditionDescriptor = conditionDescriptors[type];
objects.push(conditionDescriptor);
- if (conditionDescriptor.operators.hasOwnProperty(operator)) {
+ if (hasOwn(conditionDescriptor.operators, operator)) {
const operatorDescriptor = conditionDescriptor.operators[operator];
objects.push(operatorDescriptor);
}
}
for (const object of objects) {
- if (object.hasOwnProperty('placeholder')) {
+ if (hasOwn(object, 'placeholder')) {
props.placeholder = object.placeholder;
}
if (object.type === 'number') {
props.type = 'number';
for (const prop of ['step', 'min', 'max']) {
- if (object.hasOwnProperty(prop)) {
+ if (hasOwn(object, prop)) {
props[prop] = object[prop];
}
}
diff --git a/ext/bg/js/conditions.js b/ext/bg/js/conditions.js
index ed4b14f5..c0f0f301 100644
--- a/ext/bg/js/conditions.js
+++ b/ext/bg/js/conditions.js
@@ -18,14 +18,14 @@
function conditionsValidateOptionValue(object, value) {
- if (object.hasOwnProperty('validate') && !object.validate(value)) {
+ if (hasOwn(object, 'validate') && !object.validate(value)) {
throw new Error('Invalid value for condition');
}
- if (object.hasOwnProperty('transform')) {
+ if (hasOwn(object, 'transform')) {
value = object.transform(value);
- if (object.hasOwnProperty('validateTransformed') && !object.validateTransformed(value)) {
+ if (hasOwn(object, 'validateTransformed') && !object.validateTransformed(value)) {
throw new Error('Invalid value for condition');
}
}
@@ -34,12 +34,12 @@ function conditionsValidateOptionValue(object, value) {
}
function conditionsNormalizeOptionValue(descriptors, type, operator, optionValue) {
- if (!descriptors.hasOwnProperty(type)) {
+ if (!hasOwn(descriptors, type)) {
throw new Error('Invalid type');
}
const conditionDescriptor = descriptors[type];
- if (!conditionDescriptor.operators.hasOwnProperty(operator)) {
+ if (!hasOwn(conditionDescriptor.operators, operator)) {
throw new Error('Invalid operator');
}
@@ -48,28 +48,28 @@ function conditionsNormalizeOptionValue(descriptors, type, operator, optionValue
let transformedValue = conditionsValidateOptionValue(conditionDescriptor, optionValue);
transformedValue = conditionsValidateOptionValue(operatorDescriptor, transformedValue);
- if (operatorDescriptor.hasOwnProperty('transformReverse')) {
+ if (hasOwn(operatorDescriptor, 'transformReverse')) {
transformedValue = operatorDescriptor.transformReverse(transformedValue);
}
return transformedValue;
}
function conditionsTestValueThrowing(descriptors, type, operator, optionValue, value) {
- if (!descriptors.hasOwnProperty(type)) {
+ if (!hasOwn(descriptors, type)) {
throw new Error('Invalid type');
}
const conditionDescriptor = descriptors[type];
- if (!conditionDescriptor.operators.hasOwnProperty(operator)) {
+ if (!hasOwn(conditionDescriptor.operators, operator)) {
throw new Error('Invalid operator');
}
const operatorDescriptor = conditionDescriptor.operators[operator];
- if (operatorDescriptor.hasOwnProperty('transform')) {
- if (operatorDescriptor.hasOwnProperty('transformCache')) {
+ if (hasOwn(operatorDescriptor, 'transform')) {
+ if (hasOwn(operatorDescriptor, 'transformCache')) {
const key = `${optionValue}`;
const transformCache = operatorDescriptor.transformCache;
- if (transformCache.hasOwnProperty(key)) {
+ if (hasOwn(transformCache, key)) {
optionValue = transformCache[key];
} else {
optionValue = operatorDescriptor.transform(optionValue);
@@ -93,23 +93,23 @@ function conditionsTestValue(descriptors, type, operator, optionValue, value) {
function conditionsClearCaches(descriptors) {
for (const type in descriptors) {
- if (!descriptors.hasOwnProperty(type)) {
+ if (!hasOwn(descriptors, type)) {
continue;
}
const conditionDescriptor = descriptors[type];
- if (conditionDescriptor.hasOwnProperty('transformCache')) {
+ if (hasOwn(conditionDescriptor, 'transformCache')) {
conditionDescriptor.transformCache = {};
}
const operatorDescriptors = conditionDescriptor.operators;
for (const operator in operatorDescriptors) {
- if (!operatorDescriptors.hasOwnProperty(operator)) {
+ if (!hasOwn(operatorDescriptors, operator)) {
continue;
}
const operatorDescriptor = operatorDescriptors[operator];
- if (operatorDescriptor.hasOwnProperty('transformCache')) {
+ if (hasOwn(operatorDescriptor, 'transformCache')) {
operatorDescriptor.transformCache = {};
}
}
diff --git a/ext/bg/js/context.js b/ext/bg/js/context.js
index b288a79a..0b21f662 100644
--- a/ext/bg/js/context.js
+++ b/ext/bg/js/context.js
@@ -26,22 +26,24 @@ function showExtensionInfo() {
}
function setupButtonEvents(selector, command, url) {
- const node = document.querySelector(selector);
- node.addEventListener('click', (e) => {
- if (e.button !== 0) { return; }
- apiCommandExec(command, {newTab: e.ctrlKey});
- e.preventDefault();
- }, false);
- node.addEventListener('auxclick', (e) => {
- if (e.button !== 1) { return; }
- apiCommandExec(command, {newTab: true});
- e.preventDefault();
- }, false);
+ const nodes = document.querySelectorAll(selector);
+ for (const node of nodes) {
+ node.addEventListener('click', (e) => {
+ if (e.button !== 0) { return; }
+ apiCommandExec(command, {newTab: e.ctrlKey});
+ e.preventDefault();
+ }, false);
+ node.addEventListener('auxclick', (e) => {
+ if (e.button !== 1) { return; }
+ apiCommandExec(command, {newTab: true});
+ e.preventDefault();
+ }, false);
- if (typeof url === 'string') {
- node.href = url;
- node.target = '_blank';
- node.rel = 'noopener';
+ if (typeof url === 'string') {
+ node.href = url;
+ node.target = '_blank';
+ node.rel = 'noopener';
+ }
}
}
@@ -63,7 +65,7 @@ window.addEventListener('DOMContentLoaded', () => {
depth: 0,
url: window.location.href
};
- apiOptionsGet(optionsContext).then(options => {
+ apiOptionsGet(optionsContext).then((options) => {
const toggle = document.querySelector('#enable-search');
toggle.checked = options.general.enable;
toggle.addEventListener('change', () => apiCommandExec('toggle'), false);
diff --git a/ext/bg/js/database.js b/ext/bg/js/database.js
index 9b560f78..a20d5f15 100644
--- a/ext/bg/js/database.js
+++ b/ext/bg/js/database.js
@@ -137,7 +137,7 @@ class Database {
const visited = {};
const results = [];
const processRow = (row, index) => {
- if (titles.includes(row.dictionary) && !visited.hasOwnProperty(row.id)) {
+ if (titles.includes(row.dictionary) && !hasOwn(visited, row.id)) {
visited[row.id] = true;
results.push(Database.createTerm(row, index));
}
@@ -257,7 +257,7 @@ class Database {
const dbTerms = dbTransaction.objectStore('tagMeta');
const dbIndex = dbTerms.index('name');
const only = IDBKeyRange.only(name);
- await Database.getAll(dbIndex, only, null, row => {
+ await Database.getAll(dbIndex, only, null, (row) => {
if (title === row.dictionary) {
result = row;
}
@@ -273,7 +273,7 @@ class Database {
const dbTransaction = this.db.transaction(['dictionaries'], 'readonly');
const dbDictionaries = dbTransaction.objectStore('dictionaries');
- await Database.getAll(dbDictionaries, null, null, info => results.push(info));
+ await Database.getAll(dbDictionaries, null, null, (info) => results.push(info));
return results;
}
@@ -308,7 +308,7 @@ class Database {
counts.push(null);
const index = i;
const query2 = IDBKeyRange.only(dictionaryNames[i]);
- const countPromise = Database.getCounts(targets, query2).then(v => counts[index] = v);
+ const countPromise = Database.getCounts(targets, query2).then((v) => counts[index] = v);
countPromises.push(countPromise);
}
await Promise.all(countPromises);
@@ -346,7 +346,7 @@ class Database {
}
};
- const indexDataLoaded = async summary => {
+ const indexDataLoaded = async (summary) => {
if (summary.version > 3) {
throw new Error('Unsupported dictionary version');
}
@@ -522,13 +522,13 @@ class Database {
await indexDataLoaded(summary);
- const buildTermBankName = index => `term_bank_${index + 1}.json`;
- const buildTermMetaBankName = index => `term_meta_bank_${index + 1}.json`;
- const buildKanjiBankName = index => `kanji_bank_${index + 1}.json`;
- const buildKanjiMetaBankName = index => `kanji_meta_bank_${index + 1}.json`;
- const buildTagBankName = index => `tag_bank_${index + 1}.json`;
+ const buildTermBankName = (index) => `term_bank_${index + 1}.json`;
+ const buildTermMetaBankName = (index) => `term_meta_bank_${index + 1}.json`;
+ const buildKanjiBankName = (index) => `kanji_bank_${index + 1}.json`;
+ const buildKanjiMetaBankName = (index) => `kanji_meta_bank_${index + 1}.json`;
+ const buildTagBankName = (index) => `tag_bank_${index + 1}.json`;
- const countBanks = namer => {
+ const countBanks = (namer) => {
let count = 0;
while (zip.files[namer(count)]) {
++count;
@@ -657,7 +657,7 @@ class Database {
const counts = {};
for (const [objectStoreName, index] of targets) {
const n = objectStoreName;
- const countPromise = Database.getCount(index, query).then(count => counts[n] = count);
+ const countPromise = Database.getCount(index, query).then((count) => counts[n] = count);
countPromises.push(countPromise);
}
return Promise.all(countPromises).then(() => counts);
diff --git a/ext/bg/js/deinflector.js b/ext/bg/js/deinflector.js
index e2fb7461..51f4723c 100644
--- a/ext/bg/js/deinflector.js
+++ b/ext/bg/js/deinflector.js
@@ -88,5 +88,5 @@ Deinflector.ruleTypes = {
'vs': 0b0000100, // Verb suru
'vk': 0b0001000, // Verb kuru
'adj-i': 0b0010000, // Adjective i
- 'iru': 0b0100000, // Intermediate -iru endings for progressive or perfect tense
+ 'iru': 0b0100000 // Intermediate -iru endings for progressive or perfect tense
};
diff --git a/ext/bg/js/dictionary.js b/ext/bg/js/dictionary.js
index 9aa0af9c..0b35e32e 100644
--- a/ext/bg/js/dictionary.js
+++ b/ext/bg/js/dictionary.js
@@ -81,7 +81,7 @@ function dictTermsUndupe(definitions) {
const definitionGroups = {};
for (const definition of definitions) {
const definitionExisting = definitionGroups[definition.id];
- if (!definitionGroups.hasOwnProperty(definition.id) || definition.expression.length > definitionExisting.expression.length) {
+ if (!hasOwn(definitionGroups, definition.id) || definition.expression.length > definitionExisting.expression.length) {
definitionGroups[definition.id] = definition;
}
}
@@ -99,8 +99,8 @@ function dictTermsCompressTags(definitions) {
let lastPartOfSpeech = '';
for (const definition of definitions) {
- const dictionary = JSON.stringify(definition.definitionTags.filter(tag => tag.category === 'dictionary').map(tag => tag.name).sort());
- const partOfSpeech = JSON.stringify(definition.definitionTags.filter(tag => tag.category === 'partOfSpeech').map(tag => tag.name).sort());
+ const dictionary = JSON.stringify(definition.definitionTags.filter((tag) => tag.category === 'dictionary').map((tag) => tag.name).sort());
+ const partOfSpeech = JSON.stringify(definition.definitionTags.filter((tag) => tag.category === 'partOfSpeech').map((tag) => tag.name).sort());
const filterOutCategories = [];
@@ -117,7 +117,7 @@ function dictTermsCompressTags(definitions) {
lastPartOfSpeech = partOfSpeech;
}
- definition.definitionTags = definition.definitionTags.filter(tag => !filterOutCategories.includes(tag.category));
+ definition.definitionTags = definition.definitionTags.filter((tag) => !filterOutCategories.includes(tag.category));
}
}
@@ -131,7 +131,7 @@ function dictTermsGroup(definitions, dictionaries) {
}
const keyString = key.toString();
- if (groups.hasOwnProperty(keyString)) {
+ if (hasOwn(groups, keyString)) {
groups[keyString].push(definition);
} else {
groups[keyString] = [definition];
@@ -231,7 +231,7 @@ function dictTermsMergeByGloss(result, definitions, appendTo, mergedIndices) {
result.reading.add(definition.reading);
for (const tag of definition.definitionTags) {
- if (!definitionsByGloss[gloss].definitionTags.find(existingTag => existingTag.name === tag.name)) {
+ if (!definitionsByGloss[gloss].definitionTags.find((existingTag) => existingTag.name === tag.name)) {
definitionsByGloss[gloss].definitionTags.push(tag);
}
}
@@ -246,7 +246,7 @@ function dictTermsMergeByGloss(result, definitions, appendTo, mergedIndices) {
}
for (const tag of definition.termTags) {
- if (!result.expressions.get(definition.expression).get(definition.reading).find(existingTag => existingTag.name === tag.name)) {
+ if (!result.expressions.get(definition.expression).get(definition.reading).find((existingTag) => existingTag.name === tag.name)) {
result.expressions.get(definition.expression).get(definition.reading).push(tag);
}
}
@@ -322,7 +322,7 @@ async function dictFieldFormat(field, definition, mode, options, exceptions) {
compactGlossaries: options.general.compactGlossaries
};
const markers = dictFieldFormat.markers;
- const pattern = /\{([\w\-]+)\}/g;
+ const pattern = /\{([\w-]+)\}/g;
return await stringReplaceAsync(field, pattern, async (g0, marker) => {
if (!markers.has(marker)) {
return g0;
diff --git a/ext/bg/js/handlebars.js b/ext/bg/js/handlebars.js
index d6307e1d..8f43cf9a 100644
--- a/ext/bg/js/handlebars.js
+++ b/ext/bg/js/handlebars.js
@@ -89,7 +89,7 @@ function handlebarsRegexReplace(...args) {
let value = args[args.length - 1].fn(this);
if (args.length >= 3) {
try {
- let flags = args.length > 3 ? args[2] : 'g';
+ const flags = args.length > 3 ? args[2] : 'g';
const regex = new RegExp(args[0], flags);
value = value.replace(regex, args[1]);
} catch (e) {
diff --git a/ext/bg/js/mecab.js b/ext/bg/js/mecab.js
index 246f8bba..62111f73 100644
--- a/ext/bg/js/mecab.js
+++ b/ext/bg/js/mecab.js
@@ -60,7 +60,7 @@ class Mecab {
}
onNativeMessage({sequence, data}) {
- if (this.listeners.hasOwnProperty(sequence)) {
+ if (hasOwn(this.listeners, sequence)) {
const {callback, timer} = this.listeners[sequence];
clearTimeout(timer);
callback(data);
@@ -81,7 +81,7 @@ class Mecab {
delete this.listeners[sequence];
reject(new Error(`Mecab invoke timed out in ${Mecab.timeout} ms`));
}, Mecab.timeout)
- }
+ };
this.port.postMessage({action, params, sequence});
});
diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js
index b9bf85f3..e53a8a13 100644
--- a/ext/bg/js/options.js
+++ b/ext/bg/js/options.js
@@ -336,7 +336,7 @@ function profileOptionsSetDefaults(options) {
const combine = (target, source) => {
for (const key in source) {
- if (!target.hasOwnProperty(key)) {
+ if (!hasOwn(target, key)) {
target[key] = source[key];
}
}
@@ -389,7 +389,7 @@ function optionsUpdateVersion(options, defaultProfileOptions) {
// Remove invalid
const profiles = options.profiles;
for (let i = profiles.length - 1; i >= 0; --i) {
- if (!utilIsObject(profiles[i])) {
+ if (!isObject(profiles[i])) {
profiles.splice(i, 1);
}
}
@@ -429,7 +429,7 @@ function optionsUpdateVersion(options, defaultProfileOptions) {
function optionsLoad() {
return new Promise((resolve, reject) => {
- chrome.storage.local.get(['options'], store => {
+ chrome.storage.local.get(['options'], (store) => {
const error = chrome.runtime.lastError;
if (error) {
reject(new Error(error));
@@ -437,17 +437,17 @@ function optionsLoad() {
resolve(store.options);
}
});
- }).then(optionsStr => {
+ }).then((optionsStr) => {
if (typeof optionsStr === 'string') {
const options = JSON.parse(optionsStr);
- if (utilIsObject(options)) {
+ if (isObject(options)) {
return options;
}
}
return {};
}).catch(() => {
return {};
- }).then(options => {
+ }).then((options) => {
return (
Array.isArray(options.profiles) ?
optionsUpdateVersion(options, {}) :
diff --git a/ext/bg/js/page-exit-prevention.js b/ext/bg/js/page-exit-prevention.js
new file mode 100644
index 00000000..aee4e3c2
--- /dev/null
+++ b/ext/bg/js/page-exit-prevention.js
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2019 Alex Yatskov <alex@foosoft.net>
+ * Author: Alex Yatskov <alex@foosoft.net>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+class PageExitPrevention {
+ constructor() {
+ }
+
+ start() {
+ PageExitPrevention._addInstance(this);
+ }
+
+ end() {
+ PageExitPrevention._removeInstance(this);
+ }
+
+ static _addInstance(instance) {
+ const size = PageExitPrevention._instances.size;
+ PageExitPrevention._instances.set(instance, true);
+ if (size === 0) {
+ window.addEventListener('beforeunload', PageExitPrevention._onBeforeUnload);
+ }
+ }
+
+ static _removeInstance(instance) {
+ if (
+ PageExitPrevention._instances.delete(instance) &&
+ PageExitPrevention._instances.size === 0
+ ) {
+ window.removeEventListener('beforeunload', PageExitPrevention._onBeforeUnload);
+ }
+ }
+
+ static _onBeforeUnload(e) {
+ if (PageExitPrevention._instances.size === 0) {
+ return;
+ }
+
+ e.preventDefault();
+ e.returnValue = '';
+ return '';
+ }
+}
+
+PageExitPrevention._instances = new Map();
diff --git a/ext/bg/js/profile-conditions.js b/ext/bg/js/profile-conditions.js
index 8272e5dd..ebc6680a 100644
--- a/ext/bg/js/profile-conditions.js
+++ b/ext/bg/js/profile-conditions.js
@@ -86,7 +86,7 @@ const profileConditionsDescriptor = {
placeholder: 'Comma separated list of domains',
defaultValue: 'example.com',
transformCache: {},
- transform: (optionValue) => optionValue.split(/[,;\s]+/).map(v => v.trim().toLowerCase()).filter(v => v.length > 0),
+ transform: (optionValue) => optionValue.split(/[,;\s]+/).map((v) => v.trim().toLowerCase()).filter((v) => v.length > 0),
transformReverse: (transformedOptionValue) => transformedOptionValue.join(', '),
validateTransformed: (transformedOptionValue) => (transformedOptionValue.length > 0),
test: ({url}, transformedOptionValue) => _profileConditionTestDomainList(url, transformedOptionValue)
diff --git a/ext/bg/js/request.js b/ext/bg/js/request.js
index 3afc1506..7d73d49b 100644
--- a/ext/bg/js/request.js
+++ b/ext/bg/js/request.js
@@ -29,7 +29,7 @@ function requestJson(url, action, params) {
} else {
xhr.send();
}
- }).then(responseText => {
+ }).then((responseText) => {
try {
return JSON.parse(responseText);
}
diff --git a/ext/bg/js/search-query-parser.js b/ext/bg/js/search-query-parser.js
index 42e53989..8dc2e30a 100644
--- a/ext/bg/js/search-query-parser.js
+++ b/ext/bg/js/search-query-parser.js
@@ -38,16 +38,16 @@ class QueryParser {
}
onMouseDown(e) {
- if (Frontend.isMouseButton('primary', e)) {
+ if (DOM.isMouseButtonPressed(e, 'primary')) {
this.clickScanPrevent = false;
}
}
onMouseUp(e) {
if (
- this.search.options.scanning.clickGlossary &&
+ this.search.options.scanning.enablePopupSearch &&
!this.clickScanPrevent &&
- Frontend.isMouseButton('primary', e)
+ DOM.isMouseButtonPressed(e, 'primary')
) {
const selectText = this.search.options.scanning.selectText;
this.onTermLookup(e, {disableScroll: true, selectText});
@@ -55,7 +55,7 @@ class QueryParser {
}
onMouseMove(e) {
- if (this.pendingLookup || Frontend.isMouseButton('primary', e)) {
+ if (this.pendingLookup || DOM.isMouseButtonDown(e, 'primary')) {
return;
}
@@ -63,7 +63,7 @@ class QueryParser {
const scanningModifier = scanningOptions.modifier;
if (!(
Frontend.isScanningModifierPressed(scanningModifier, e) ||
- (scanningOptions.middleMouse && Frontend.isMouseButton('auxiliary', e))
+ (scanningOptions.middleMouse && DOM.isMouseButtonDown(e, 'auxiliary'))
)) {
return;
}
@@ -107,7 +107,7 @@ class QueryParser {
}
getParseResult() {
- return this.parseResults.find(r => r.id === this.selectedParser);
+ return this.parseResults.find((r) => r.id === this.selectedParser);
}
async setText(text) {
@@ -134,7 +134,7 @@ class QueryParser {
});
}
if (this.search.options.parsing.enableMecabParser) {
- let mecabResults = await apiTextParseMecab(text, this.search.getOptionsContext());
+ const mecabResults = await apiTextParseMecab(text, this.search.getOptionsContext());
for (const mecabDictName in mecabResults) {
results.push({
name: `MeCab: ${mecabDictName}`,
@@ -216,11 +216,11 @@ class QueryParser {
static processParseResultForDisplay(result) {
return result.map((term) => {
- return term.filter(part => part.text.trim()).map((part) => {
+ return term.filter((part) => part.text.trim()).map((part) => {
return {
text: Array.from(part.text),
reading: part.reading,
- raw: !part.reading || !part.reading.trim(),
+ raw: !part.reading || !part.reading.trim()
};
});
});
diff --git a/ext/bg/js/search.js b/ext/bg/js/search.js
index 0922d938..00b7ca4b 100644
--- a/ext/bg/js/search.js
+++ b/ext/bg/js/search.js
@@ -167,7 +167,7 @@ class DisplaySearch extends Display {
this.onSearchQueryUpdated(query, true);
}
- onPopState(e) {
+ onPopState() {
const query = DisplaySearch.getSearchQueryFromLocation(window.location.href) || '';
if (this.query !== null) {
if (this.isWanakanaEnabled()) {
@@ -207,7 +207,7 @@ class DisplaySearch extends Display {
async onSearchQueryUpdated(query, animate) {
try {
const details = {};
- const match = /[\*\uff0a]+$/.exec(query);
+ const match = /[*\uff0a]+$/.exec(query);
if (match !== null) {
details.wildcard = true;
query = query.substring(0, query.length - match[0].length);
@@ -220,6 +220,7 @@ class DisplaySearch extends Display {
const {definitions} = await apiTermsFind(query, details, this.optionsContext);
this.setContentTerms(definitions, {
focus: false,
+ disableHistory: true,
sentence: {text: query, offset: 0},
url: window.location.href
});
@@ -234,7 +235,7 @@ class DisplaySearch extends Display {
onRuntimeMessage({action, params}, sender, callback) {
const handlers = DisplaySearch.runtimeMessageHandlers;
- if (handlers.hasOwnProperty(action)) {
+ if (hasOwn(handlers, action)) {
const handler = handlers[action];
const result = handler(this, params);
callback(result);
@@ -245,7 +246,7 @@ class DisplaySearch extends Display {
initClipboardMonitor() {
// ignore copy from search page
- window.addEventListener('copy', (e) => {
+ window.addEventListener('copy', () => {
this.clipboardPrevText = document.getSelection().toString().trim();
});
}
@@ -324,7 +325,7 @@ class DisplaySearch extends Display {
this.intro.style.transition = '';
this.intro.style.height = '';
const size = this.intro.getBoundingClientRect();
- this.intro.style.height = `0px`;
+ this.intro.style.height = '0px';
this.intro.style.transition = `height ${duration}s ease-in-out 0s`;
window.getComputedStyle(this.intro).getPropertyValue('height'); // Commits height so next line can start animation
this.intro.style.height = `${size.height}px`;
@@ -356,7 +357,7 @@ class DisplaySearch extends Display {
}
static getSearchQueryFromLocation(url) {
- let match = /^[^\?#]*\?(?:[^&#]*&)?query=([^&#]*)/.exec(url);
+ const match = /^[^?#]*\?(?:[^&#]*&)?query=([^&#]*)/.exec(url);
return match !== null ? decodeURIComponent(match[1]) : null;
}
}
diff --git a/ext/bg/js/settings.js b/ext/bg/js/settings.js
deleted file mode 100644
index ab267c32..00000000
--- a/ext/bg/js/settings.js
+++ /dev/null
@@ -1,852 +0,0 @@
-/*
- * Copyright (C) 2016-2017 Alex Yatskov <alex@foosoft.net>
- * Author: Alex Yatskov <alex@foosoft.net>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-async function getOptionsArray() {
- const optionsFull = await apiOptionsGetFull();
- return optionsFull.profiles.map(profile => profile.options);
-}
-
-async function formRead(options) {
- options.general.enable = $('#enable').prop('checked');
- options.general.showGuide = $('#show-usage-guide').prop('checked');
- options.general.compactTags = $('#compact-tags').prop('checked');
- options.general.compactGlossaries = $('#compact-glossaries').prop('checked');
- options.general.resultOutputMode = $('#result-output-mode').val();
- options.general.debugInfo = $('#show-debug-info').prop('checked');
- options.general.showAdvanced = $('#show-advanced-options').prop('checked');
- options.general.maxResults = parseInt($('#max-displayed-results').val(), 10);
- options.general.popupDisplayMode = $('#popup-display-mode').val();
- options.general.popupHorizontalTextPosition = $('#popup-horizontal-text-position').val();
- options.general.popupVerticalTextPosition = $('#popup-vertical-text-position').val();
- options.general.popupWidth = parseInt($('#popup-width').val(), 10);
- options.general.popupHeight = parseInt($('#popup-height').val(), 10);
- options.general.popupHorizontalOffset = parseInt($('#popup-horizontal-offset').val(), 0);
- options.general.popupVerticalOffset = parseInt($('#popup-vertical-offset').val(), 10);
- options.general.popupHorizontalOffset2 = parseInt($('#popup-horizontal-offset2').val(), 0);
- options.general.popupVerticalOffset2 = parseInt($('#popup-vertical-offset2').val(), 10);
- options.general.popupTheme = $('#popup-theme').val();
- options.general.popupOuterTheme = $('#popup-outer-theme').val();
- options.general.customPopupCss = $('#custom-popup-css').val();
- options.general.customPopupOuterCss = $('#custom-popup-outer-css').val();
-
- options.audio.enabled = $('#audio-playback-enabled').prop('checked');
- options.audio.autoPlay = $('#auto-play-audio').prop('checked');
- options.audio.volume = parseFloat($('#audio-playback-volume').val());
- options.audio.customSourceUrl = $('#audio-custom-source').val();
- options.audio.textToSpeechVoice = $('#text-to-speech-voice').val();
-
- options.scanning.middleMouse = $('#middle-mouse-button-scan').prop('checked');
- options.scanning.touchInputEnabled = $('#touch-input-enabled').prop('checked');
- options.scanning.selectText = $('#select-matched-text').prop('checked');
- options.scanning.alphanumeric = $('#search-alphanumeric').prop('checked');
- options.scanning.autoHideResults = $('#auto-hide-results').prop('checked');
- options.scanning.deepDomScan = $('#deep-dom-scan').prop('checked');
- options.scanning.enablePopupSearch = $('#enable-search-within-first-popup').prop('checked');
- options.scanning.enableOnPopupExpressions = $('#enable-scanning-of-popup-expressions').prop('checked');
- options.scanning.enableOnSearchPage = $('#enable-scanning-on-search-page').prop('checked');
- options.scanning.delay = parseInt($('#scan-delay').val(), 10);
- options.scanning.length = parseInt($('#scan-length').val(), 10);
- options.scanning.modifier = $('#scan-modifier-key').val();
- options.scanning.popupNestingMaxDepth = parseInt($('#popup-nesting-max-depth').val(), 10);
-
- options.parsing.enableScanningParser = $('#parsing-scan-enable').prop('checked');
- options.parsing.enableMecabParser = $('#parsing-mecab-enable').prop('checked');
- options.parsing.readingMode = $('#parsing-reading-mode').val();
-
- const optionsAnkiEnableOld = options.anki.enable;
- options.anki.enable = $('#anki-enable').prop('checked');
- options.anki.tags = utilBackgroundIsolate($('#card-tags').val().split(/[,; ]+/));
- options.anki.sentenceExt = parseInt($('#sentence-detection-extent').val(), 10);
- options.anki.server = $('#interface-server').val();
- options.anki.screenshot.format = $('#screenshot-format').val();
- options.anki.screenshot.quality = parseInt($('#screenshot-quality').val(), 10);
- options.anki.fieldTemplates = $('#field-templates').val();
-
- if (optionsAnkiEnableOld && !ankiErrorShown()) {
- options.anki.terms.deck = $('#anki-terms-deck').val();
- options.anki.terms.model = $('#anki-terms-model').val();
- options.anki.terms.fields = utilBackgroundIsolate(ankiFieldsToDict($('#terms .anki-field-value')));
- options.anki.kanji.deck = $('#anki-kanji-deck').val();
- options.anki.kanji.model = $('#anki-kanji-model').val();
- options.anki.kanji.fields = utilBackgroundIsolate(ankiFieldsToDict($('#kanji .anki-field-value')));
- }
-}
-
-async function formWrite(options) {
- $('#enable').prop('checked', options.general.enable);
- $('#show-usage-guide').prop('checked', options.general.showGuide);
- $('#compact-tags').prop('checked', options.general.compactTags);
- $('#compact-glossaries').prop('checked', options.general.compactGlossaries);
- $('#result-output-mode').val(options.general.resultOutputMode);
- $('#show-debug-info').prop('checked', options.general.debugInfo);
- $('#show-advanced-options').prop('checked', options.general.showAdvanced);
- $('#max-displayed-results').val(options.general.maxResults);
- $('#popup-display-mode').val(options.general.popupDisplayMode);
- $('#popup-horizontal-text-position').val(options.general.popupHorizontalTextPosition);
- $('#popup-vertical-text-position').val(options.general.popupVerticalTextPosition);
- $('#popup-width').val(options.general.popupWidth);
- $('#popup-height').val(options.general.popupHeight);
- $('#popup-horizontal-offset').val(options.general.popupHorizontalOffset);
- $('#popup-vertical-offset').val(options.general.popupVerticalOffset);
- $('#popup-horizontal-offset2').val(options.general.popupHorizontalOffset2);
- $('#popup-vertical-offset2').val(options.general.popupVerticalOffset2);
- $('#popup-theme').val(options.general.popupTheme);
- $('#popup-outer-theme').val(options.general.popupOuterTheme);
- $('#custom-popup-css').val(options.general.customPopupCss);
- $('#custom-popup-outer-css').val(options.general.customPopupOuterCss);
-
- $('#audio-playback-enabled').prop('checked', options.audio.enabled);
- $('#auto-play-audio').prop('checked', options.audio.autoPlay);
- $('#audio-playback-volume').val(options.audio.volume);
- $('#audio-custom-source').val(options.audio.customSourceUrl);
- $('#text-to-speech-voice').val(options.audio.textToSpeechVoice).attr('data-value', options.audio.textToSpeechVoice);
-
- $('#middle-mouse-button-scan').prop('checked', options.scanning.middleMouse);
- $('#touch-input-enabled').prop('checked', options.scanning.touchInputEnabled);
- $('#select-matched-text').prop('checked', options.scanning.selectText);
- $('#search-alphanumeric').prop('checked', options.scanning.alphanumeric);
- $('#auto-hide-results').prop('checked', options.scanning.autoHideResults);
- $('#deep-dom-scan').prop('checked', options.scanning.deepDomScan);
- $('#enable-search-within-first-popup').prop('checked', options.scanning.enablePopupSearch);
- $('#enable-scanning-of-popup-expressions').prop('checked', options.scanning.enableOnPopupExpressions);
- $('#enable-scanning-on-search-page').prop('checked', options.scanning.enableOnSearchPage);
- $('#scan-delay').val(options.scanning.delay);
- $('#scan-length').val(options.scanning.length);
- $('#scan-modifier-key').val(options.scanning.modifier);
- $('#popup-nesting-max-depth').val(options.scanning.popupNestingMaxDepth);
-
- $('#parsing-scan-enable').prop('checked', options.parsing.enableScanningParser);
- $('#parsing-mecab-enable').prop('checked', options.parsing.enableMecabParser);
- $('#parsing-reading-mode').val(options.parsing.readingMode);
-
- $('#anki-enable').prop('checked', options.anki.enable);
- $('#card-tags').val(options.anki.tags.join(' '));
- $('#sentence-detection-extent').val(options.anki.sentenceExt);
- $('#interface-server').val(options.anki.server);
- $('#screenshot-format').val(options.anki.screenshot.format);
- $('#screenshot-quality').val(options.anki.screenshot.quality);
- $('#field-templates').val(options.anki.fieldTemplates);
-
- onAnkiTemplatesValidateCompile();
- await onDictionaryOptionsChanged(options);
-
- try {
- await ankiDeckAndModelPopulate(options);
- } catch (e) {
- ankiErrorShow(e);
- }
-
- formUpdateVisibility(options);
-}
-
-function formSetupEventListeners() {
- $('input, select, textarea').not('.anki-model').not('.ignore-form-changes *').change(utilAsync(onFormOptionsChanged));
- $('.anki-model').change(utilAsync(onAnkiModelChanged));
-}
-
-function formUpdateVisibility(options) {
- document.documentElement.dataset.optionsAnkiEnable = `${!!options.anki.enable}`;
- document.documentElement.dataset.optionsGeneralDebugInfo = `${!!options.general.debugInfo}`;
- document.documentElement.dataset.optionsGeneralShowAdvanced = `${!!options.general.showAdvanced}`;
- document.documentElement.dataset.optionsGeneralResultOutputMode = `${options.general.resultOutputMode}`;
-
- if (options.general.debugInfo) {
- const temp = utilIsolate(options);
- temp.anki.fieldTemplates = '...';
- const text = JSON.stringify(temp, null, 4);
- $('#debug').text(text);
- }
-}
-
-async function onFormOptionsChanged(e) {
- if (!e.originalEvent && !e.isTrigger) {
- return;
- }
-
- const optionsContext = getOptionsContext();
- const options = await apiOptionsGet(optionsContext);
- const optionsAnkiEnableOld = options.anki.enable;
- const optionsAnkiServerOld = options.anki.server;
-
- await formRead(options);
- await settingsSaveOptions();
- formUpdateVisibility(options);
-
- try {
- const ankiUpdated =
- options.anki.enable !== optionsAnkiEnableOld ||
- options.anki.server !== optionsAnkiServerOld;
-
- if (ankiUpdated) {
- ankiSpinnerShow(true);
- await ankiDeckAndModelPopulate(options);
- ankiErrorShow();
- }
- } catch (error) {
- ankiErrorShow(error);
- } finally {
- ankiSpinnerShow(false);
- }
-}
-
-async function onReady() {
- showExtensionInformation();
-
- formSetupEventListeners();
- appearanceInitialize();
- await audioSettingsInitialize();
- await profileOptionsSetup();
- await dictSettingsInitialize();
- ankiTemplatesInitialize();
-
- storageInfoInitialize();
-
- chrome.runtime.onMessage.addListener(onMessage);
-}
-
-$(document).ready(utilAsync(onReady));
-
-
-/*
- * Page exit prevention
- */
-
-class PageExitPrevention {
- constructor() {
- }
-
- start() {
- PageExitPrevention._addInstance(this);
- }
-
- end() {
- PageExitPrevention._removeInstance(this);
- }
-
- static _addInstance(instance) {
- const size = PageExitPrevention._instances.size;
- PageExitPrevention._instances.set(instance, true);
- if (size === 0) {
- window.addEventListener('beforeunload', PageExitPrevention._onBeforeUnload);
- }
- }
-
- static _removeInstance(instance) {
- if (
- PageExitPrevention._instances.delete(instance) &&
- PageExitPrevention._instances.size === 0
- ) {
- window.removeEventListener('beforeunload', PageExitPrevention._onBeforeUnload);
- }
- }
-
- static _onBeforeUnload(e) {
- if (PageExitPrevention._instances.size === 0) {
- return;
- }
-
- e.preventDefault();
- e.returnValue = '';
- return '';
- }
-}
-PageExitPrevention._instances = new Map();
-
-
-/*
- * Appearance
- */
-
-function appearanceInitialize() {
- let previewVisible = false;
- $('#settings-popup-preview-button').on('click', () => {
- if (previewVisible) { return; }
- showAppearancePreview();
- previewVisible = true;
- });
-}
-
-function showAppearancePreview() {
- const container = $('#settings-popup-preview-container');
- const buttonContainer = $('#settings-popup-preview-button-container');
- const settings = $('#settings-popup-preview-settings');
- const text = $('#settings-popup-preview-text');
- const customCss = $('#custom-popup-css');
- const customOuterCss = $('#custom-popup-outer-css');
-
- const frame = document.createElement('iframe');
- frame.src = '/bg/settings-popup-preview.html';
- frame.id = 'settings-popup-preview-frame';
-
- window.wanakana.bind(text[0]);
-
- text.on('input', () => {
- const action = 'setText';
- const params = {text: text.val()};
- frame.contentWindow.postMessage({action, params}, '*');
- });
- customCss.on('input', () => {
- const action = 'setCustomCss';
- const params = {css: customCss.val()};
- frame.contentWindow.postMessage({action, params}, '*');
- });
- customOuterCss.on('input', () => {
- const action = 'setCustomOuterCss';
- const params = {css: customOuterCss.val()};
- frame.contentWindow.postMessage({action, params}, '*');
- });
-
- container.append(frame);
- buttonContainer.remove();
- settings.css('display', '');
-}
-
-
-/*
- * Audio
- */
-
-let audioSourceUI = null;
-
-async function audioSettingsInitialize() {
- const optionsContext = getOptionsContext();
- const options = await apiOptionsGet(optionsContext);
- audioSourceUI = new AudioSourceUI.Container(options.audio.sources, $('.audio-source-list'), $('.audio-source-add'));
- audioSourceUI.save = () => settingsSaveOptions();
-
- textToSpeechInitialize();
-}
-
-function textToSpeechInitialize() {
- if (typeof speechSynthesis === 'undefined') { return; }
-
- speechSynthesis.addEventListener('voiceschanged', () => updateTextToSpeechVoices(), false);
- updateTextToSpeechVoices();
-
- $('#text-to-speech-voice-test').on('click', () => textToSpeechTest());
-}
-
-function updateTextToSpeechVoices() {
- const voices = Array.prototype.map.call(speechSynthesis.getVoices(), (voice, index) => ({voice, index}));
- voices.sort(textToSpeechVoiceCompare);
- if (voices.length > 0) {
- $('#text-to-speech-voice-container').css('display', '');
- }
-
- const select = $('#text-to-speech-voice');
- select.empty();
- select.append($('<option>').val('').text('None'));
- for (const {voice} of voices) {
- select.append($('<option>').val(voice.voiceURI).text(`${voice.name} (${voice.lang})`));
- }
-
- select.val(select.attr('data-value'));
-}
-
-function languageTagIsJapanese(languageTag) {
- return (
- languageTag.startsWith('ja-') ||
- languageTag.startsWith('jpn-')
- );
-}
-
-function textToSpeechVoiceCompare(a, b) {
- const aIsJapanese = languageTagIsJapanese(a.voice.lang);
- const bIsJapanese = languageTagIsJapanese(b.voice.lang);
- if (aIsJapanese) {
- if (!bIsJapanese) { return -1; }
- } else {
- if (bIsJapanese) { return 1; }
- }
-
- const aIsDefault = a.voice.default;
- const bIsDefault = b.voice.default;
- if (aIsDefault) {
- if (!bIsDefault) { return -1; }
- } else {
- if (bIsDefault) { return 1; }
- }
-
- if (a.index < b.index) { return -1; }
- if (a.index > b.index) { return 1; }
- return 0;
-}
-
-function textToSpeechTest() {
- try {
- const text = $('#text-to-speech-voice-test').attr('data-speech-text') || '';
- const voiceURI = $('#text-to-speech-voice').val();
- const voice = audioGetTextToSpeechVoice(voiceURI);
- if (voice === null) { return; }
-
- const utterance = new SpeechSynthesisUtterance(text);
- utterance.lang = 'ja-JP';
- utterance.voice = voice;
- utterance.volume = 1.0;
-
- speechSynthesis.speak(utterance);
- } catch (e) {
- // NOP
- }
-}
-
-
-/*
- * Remote options updates
- */
-
-function settingsGetSource() {
- return new Promise((resolve) => {
- chrome.tabs.getCurrent((tab) => resolve(`settings${tab ? tab.id : ''}`));
- });
-}
-
-async function settingsSaveOptions() {
- const source = await settingsGetSource();
- await apiOptionsSave(source);
-}
-
-async function onOptionsUpdate({source}) {
- const thisSource = await settingsGetSource();
- if (source === thisSource) { return; }
-
- const optionsContext = getOptionsContext();
- const options = await apiOptionsGet(optionsContext);
- await formWrite(options);
-}
-
-function onMessage({action, params}, sender, callback) {
- switch (action) {
- case 'optionsUpdate':
- onOptionsUpdate(params);
- break;
- case 'getUrl':
- callback({url: window.location.href});
- break;
- }
-}
-
-
-/*
- * Anki
- */
-
-function ankiSpinnerShow(show) {
- const spinner = $('#anki-spinner');
- if (show) {
- spinner.show();
- } else {
- spinner.hide();
- }
-}
-
-function ankiErrorShow(error) {
- const dialog = $('#anki-error');
- if (error) {
- dialog.show().text(error);
- }
- else {
- dialog.hide();
- }
-}
-
-function ankiErrorShown() {
- return $('#anki-error').is(':visible');
-}
-
-function ankiFieldsToDict(selection) {
- const result = {};
- selection.each((index, element) => {
- result[$(element).data('field')] = $(element).val();
- });
-
- return result;
-}
-
-async function ankiDeckAndModelPopulate(options) {
- const ankiFormat = $('#anki-format').hide();
-
- const deckNames = await utilAnkiGetDeckNames();
- const ankiDeck = $('.anki-deck');
- ankiDeck.find('option').remove();
- deckNames.sort().forEach(name => ankiDeck.append($('<option/>', {value: name, text: name})));
-
- const modelNames = await utilAnkiGetModelNames();
- const ankiModel = $('.anki-model');
- ankiModel.find('option').remove();
- modelNames.sort().forEach(name => ankiModel.append($('<option/>', {value: name, text: name})));
-
- $('#anki-terms-deck').val(options.anki.terms.deck);
- await ankiFieldsPopulate($('#anki-terms-model').val(options.anki.terms.model), options);
-
- $('#anki-kanji-deck').val(options.anki.kanji.deck);
- await ankiFieldsPopulate($('#anki-kanji-model').val(options.anki.kanji.model), options);
-
- ankiFormat.show();
-}
-
-function ankiCreateFieldTemplate(name, value, markers) {
- const template = document.querySelector('#anki-field-template').content;
- const content = document.importNode(template, true).firstChild;
-
- content.querySelector('.anki-field-name').textContent = name;
-
- const field = content.querySelector('.anki-field-value');
- field.dataset.field = name;
- field.value = value;
-
- content.querySelector('.anki-field-marker-list').appendChild(ankiGetFieldMarkersHtml(markers));
-
- return content;
-}
-
-function ankiGetFieldMarkersHtml(markers, fragment) {
- const template = document.querySelector('#anki-field-marker-template').content;
- if (!fragment) {
- fragment = new DocumentFragment();
- }
- for (const marker of markers) {
- const markerNode = document.importNode(template, true).firstChild;
- markerNode.querySelector('.marker-link').textContent = marker;
- fragment.appendChild(markerNode);
- }
- return fragment;
-}
-
-function ankiGetFieldMarkers(type) {
- switch (type) {
- case 'terms':
- return [
- 'audio',
- 'cloze-body',
- 'cloze-prefix',
- 'cloze-suffix',
- 'dictionary',
- 'expression',
- 'furigana',
- 'furigana-plain',
- 'glossary',
- 'glossary-brief',
- 'reading',
- 'screenshot',
- 'sentence',
- 'tags',
- 'url'
- ];
- case 'kanji':
- return [
- 'character',
- 'dictionary',
- 'glossary',
- 'kunyomi',
- 'onyomi',
- 'screenshot',
- 'sentence',
- 'tags',
- 'url'
- ];
- default:
- return [];
- }
-}
-
-async function ankiFieldsPopulate(element, options) {
- const modelName = element.val();
- if (!modelName) {
- return;
- }
-
- const tab = element.closest('.tab-pane');
- const tabId = tab.attr('id');
- const container = tab.find('tbody').empty();
- const markers = ankiGetFieldMarkers(tabId);
-
- for (const name of await utilAnkiGetModelFieldNames(modelName)) {
- const value = options.anki[tabId].fields[name] || '';
- const html = ankiCreateFieldTemplate(name, value, markers);
- container.append($(html));
- }
-
- tab.find('.anki-field-value').change(utilAsync(onFormOptionsChanged));
- tab.find('.marker-link').click(onAnkiMarkerClicked);
-}
-
-function onAnkiMarkerClicked(e) {
- e.preventDefault();
- const link = e.target;
- $(link).closest('.input-group').find('.anki-field-value').val(`{${link.text}}`).trigger('change');
-}
-
-async function onAnkiModelChanged(e) {
- try {
- if (!e.originalEvent) {
- return;
- }
-
- const element = $(this);
- const tab = element.closest('.tab-pane');
- const tabId = tab.attr('id');
-
- const optionsContext = getOptionsContext();
- const options = await apiOptionsGet(optionsContext);
- await formRead(options);
- options.anki[tabId].fields = utilBackgroundIsolate({});
- await settingsSaveOptions();
-
- ankiSpinnerShow(true);
- await ankiFieldsPopulate(element, options);
- ankiErrorShow();
- } catch (error) {
- ankiErrorShow(error);
- } finally {
- ankiSpinnerShow(false);
- }
-}
-
-function onAnkiFieldTemplatesReset(e) {
- e.preventDefault();
- $('#field-template-reset-modal').modal('show');
-}
-
-async function onAnkiFieldTemplatesResetConfirm(e) {
- try {
- e.preventDefault();
-
- $('#field-template-reset-modal').modal('hide');
-
- const optionsContext = getOptionsContext();
- const options = await apiOptionsGet(optionsContext);
- const fieldTemplates = profileOptionsGetDefaultFieldTemplates();
- options.anki.fieldTemplates = fieldTemplates;
- $('#field-templates').val(fieldTemplates);
- onAnkiTemplatesValidateCompile();
- await settingsSaveOptions();
- } catch (error) {
- ankiErrorShow(error);
- }
-}
-
-function ankiTemplatesInitialize() {
- const markers = new Set(ankiGetFieldMarkers('terms').concat(ankiGetFieldMarkers('kanji')));
- const fragment = ankiGetFieldMarkersHtml(markers);
-
- const list = document.querySelector('#field-templates-list');
- list.appendChild(fragment);
- for (const node of list.querySelectorAll('.marker-link')) {
- node.addEventListener('click', onAnkiTemplateMarkerClicked, false);
- }
-
- $('#field-templates').on('change', onAnkiTemplatesValidateCompile);
- $('#field-template-render').on('click', onAnkiTemplateRender);
- $('#field-templates-reset').on('click', onAnkiFieldTemplatesReset);
- $('#field-templates-reset-confirm').on('click', onAnkiFieldTemplatesResetConfirm);
-}
-
-const ankiTemplatesValidateGetDefinition = (() => {
- let cachedValue = null;
- let cachedText = null;
-
- return async (text, optionsContext) => {
- if (cachedText !== text) {
- const {definitions} = await apiTermsFind(text, {}, optionsContext);
- if (definitions.length === 0) { return null; }
-
- cachedValue = definitions[0];
- cachedText = text;
- }
- return cachedValue;
- };
-})();
-
-async function ankiTemplatesValidate(infoNode, field, mode, showSuccessResult, invalidateInput) {
- const text = document.querySelector('#field-templates-preview-text').value || '';
- const exceptions = [];
- let result = `No definition found for ${text}`;
- try {
- const optionsContext = getOptionsContext();
- const definition = await ankiTemplatesValidateGetDefinition(text, optionsContext);
- if (definition !== null) {
- const options = await apiOptionsGet(optionsContext);
- result = await dictFieldFormat(field, definition, mode, options, exceptions);
- }
- } catch (e) {
- exceptions.push(e);
- }
-
- const hasException = exceptions.length > 0;
- infoNode.hidden = !(showSuccessResult || hasException);
- infoNode.textContent = hasException ? exceptions.map(e => `${e}`).join('\n') : (showSuccessResult ? result : '');
- infoNode.classList.toggle('text-danger', hasException);
- if (invalidateInput) {
- const input = document.querySelector('#field-templates');
- input.classList.toggle('is-invalid', hasException);
- }
-}
-
-function onAnkiTemplatesValidateCompile() {
- const infoNode = document.querySelector('#field-template-compile-result');
- ankiTemplatesValidate(infoNode, '{expression}', 'term-kanji', false, true);
-}
-
-function onAnkiTemplateMarkerClicked(e) {
- e.preventDefault();
- document.querySelector('#field-template-render-text').value = `{${e.target.textContent}}`;
-}
-
-function onAnkiTemplateRender(e) {
- e.preventDefault();
-
- const field = document.querySelector('#field-template-render-text').value;
- const infoNode = document.querySelector('#field-template-render-result');
- infoNode.hidden = true;
- ankiTemplatesValidate(infoNode, field, 'term-kanji', true, false);
-}
-
-
-/*
- * Storage
- */
-
-function storageBytesToLabeledString(size) {
- const base = 1000;
- const labels = [' bytes', 'KB', 'MB', 'GB'];
- let labelIndex = 0;
- while (size >= base) {
- size /= base;
- ++labelIndex;
- }
- const label = labelIndex === 0 ? `${size}` : size.toFixed(1);
- return `${label}${labels[labelIndex]}`;
-}
-
-async function storageEstimate() {
- try {
- return (storageEstimate.mostRecent = await navigator.storage.estimate());
- } catch (e) { }
- return null;
-}
-storageEstimate.mostRecent = null;
-
-async function isStoragePeristent() {
- try {
- return await navigator.storage.persisted();
- } catch (e) { }
- return false;
-}
-
-async function storageInfoInitialize() {
- storagePersistInitialize();
- const {browser, platform} = await apiGetEnvironmentInfo();
- document.documentElement.dataset.browser = browser;
- document.documentElement.dataset.operatingSystem = platform.os;
-
- await storageShowInfo();
-
- document.querySelector('#storage-refresh').addEventListener('click', () => storageShowInfo(), false);
-}
-
-async function storageUpdateStats() {
- storageUpdateStats.isUpdating = true;
-
- const estimate = await storageEstimate();
- const valid = (estimate !== null);
-
- if (valid) {
- // Firefox reports usage as 0 when persistent storage is enabled.
- const finite = (estimate.usage > 0 || !(await isStoragePeristent()));
- if (finite) {
- document.querySelector('#storage-usage').textContent = storageBytesToLabeledString(estimate.usage);
- document.querySelector('#storage-quota').textContent = storageBytesToLabeledString(estimate.quota);
- }
- document.querySelector('#storage-use-finite').classList.toggle('storage-hidden', !finite);
- document.querySelector('#storage-use-infinite').classList.toggle('storage-hidden', finite);
- }
-
- storageUpdateStats.isUpdating = false;
- return valid;
-}
-storageUpdateStats.isUpdating = false;
-
-async function storageShowInfo() {
- storageSpinnerShow(true);
-
- const valid = await storageUpdateStats();
- document.querySelector('#storage-use').classList.toggle('storage-hidden', !valid);
- document.querySelector('#storage-error').classList.toggle('storage-hidden', valid);
-
- storageSpinnerShow(false);
-}
-
-function storageSpinnerShow(show) {
- const spinner = $('#storage-spinner');
- if (show) {
- spinner.show();
- } else {
- spinner.hide();
- }
-}
-
-async function storagePersistInitialize() {
- if (!(navigator.storage && navigator.storage.persist)) {
- // Not supported
- return;
- }
-
- const info = document.querySelector('#storage-persist-info');
- const button = document.querySelector('#storage-persist-button');
- const checkbox = document.querySelector('#storage-persist-button-checkbox');
-
- info.classList.remove('storage-hidden');
- button.classList.remove('storage-hidden');
-
- let persisted = await isStoragePeristent();
- checkbox.checked = persisted;
-
- button.addEventListener('click', async () => {
- if (persisted) {
- return;
- }
- let result = false;
- try {
- result = await navigator.storage.persist();
- } catch (e) {
- // NOP
- }
-
- if (result) {
- persisted = true;
- checkbox.checked = true;
- storageShowInfo();
- } else {
- $('.storage-persist-fail-warning').removeClass('storage-hidden');
- }
- }, false);
-}
-
-
-/*
- * Information
- */
-
-function showExtensionInformation() {
- const node = document.getElementById('extension-info');
- if (node === null) { return; }
-
- const manifest = chrome.runtime.getManifest();
- node.textContent = `${manifest.name} v${manifest.version}`;
-}
diff --git a/ext/bg/js/settings/anki-templates.js b/ext/bg/js/settings/anki-templates.js
new file mode 100644
index 00000000..9cdfc134
--- /dev/null
+++ b/ext/bg/js/settings/anki-templates.js
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2019 Alex Yatskov <alex@foosoft.net>
+ * Author: Alex Yatskov <alex@foosoft.net>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+function onAnkiFieldTemplatesReset(e) {
+ e.preventDefault();
+ $('#field-template-reset-modal').modal('show');
+}
+
+function onAnkiFieldTemplatesResetConfirm(e) {
+ e.preventDefault();
+
+ $('#field-template-reset-modal').modal('hide');
+
+ const element = document.querySelector('#field-templates');
+ element.value = profileOptionsGetDefaultFieldTemplates();
+ element.dispatchEvent(new Event('change'));
+}
+
+function ankiTemplatesInitialize() {
+ const markers = new Set(ankiGetFieldMarkers('terms').concat(ankiGetFieldMarkers('kanji')));
+ const fragment = ankiGetFieldMarkersHtml(markers);
+
+ const list = document.querySelector('#field-templates-list');
+ list.appendChild(fragment);
+ for (const node of list.querySelectorAll('.marker-link')) {
+ node.addEventListener('click', onAnkiTemplateMarkerClicked, false);
+ }
+
+ $('#field-templates').on('change', (e) => onAnkiTemplatesValidateCompile(e));
+ $('#field-template-render').on('click', (e) => onAnkiTemplateRender(e));
+ $('#field-templates-reset').on('click', (e) => onAnkiFieldTemplatesReset(e));
+ $('#field-templates-reset-confirm').on('click', (e) => onAnkiFieldTemplatesResetConfirm(e));
+}
+
+const ankiTemplatesValidateGetDefinition = (() => {
+ let cachedValue = null;
+ let cachedText = null;
+
+ return async (text, optionsContext) => {
+ if (cachedText !== text) {
+ const {definitions} = await apiTermsFind(text, {}, optionsContext);
+ if (definitions.length === 0) { return null; }
+
+ cachedValue = definitions[0];
+ cachedText = text;
+ }
+ return cachedValue;
+ };
+})();
+
+async function ankiTemplatesValidate(infoNode, field, mode, showSuccessResult, invalidateInput) {
+ const text = document.querySelector('#field-templates-preview-text').value || '';
+ const exceptions = [];
+ let result = `No definition found for ${text}`;
+ try {
+ const optionsContext = getOptionsContext();
+ const definition = await ankiTemplatesValidateGetDefinition(text, optionsContext);
+ if (definition !== null) {
+ const options = await apiOptionsGet(optionsContext);
+ result = await dictFieldFormat(field, definition, mode, options, exceptions);
+ }
+ } catch (e) {
+ exceptions.push(e);
+ }
+
+ const hasException = exceptions.length > 0;
+ infoNode.hidden = !(showSuccessResult || hasException);
+ infoNode.textContent = hasException ? exceptions.map((e) => `${e}`).join('\n') : (showSuccessResult ? result : '');
+ infoNode.classList.toggle('text-danger', hasException);
+ if (invalidateInput) {
+ const input = document.querySelector('#field-templates');
+ input.classList.toggle('is-invalid', hasException);
+ }
+}
+
+function onAnkiTemplatesValidateCompile() {
+ const infoNode = document.querySelector('#field-template-compile-result');
+ ankiTemplatesValidate(infoNode, '{expression}', 'term-kanji', false, true);
+}
+
+function onAnkiTemplateMarkerClicked(e) {
+ e.preventDefault();
+ document.querySelector('#field-template-render-text').value = `{${e.target.textContent}}`;
+}
+
+function onAnkiTemplateRender(e) {
+ e.preventDefault();
+
+ const field = document.querySelector('#field-template-render-text').value;
+ const infoNode = document.querySelector('#field-template-render-result');
+ infoNode.hidden = true;
+ ankiTemplatesValidate(infoNode, field, 'term-kanji', true, false);
+}
diff --git a/ext/bg/js/settings/anki.js b/ext/bg/js/settings/anki.js
new file mode 100644
index 00000000..e1aabbaf
--- /dev/null
+++ b/ext/bg/js/settings/anki.js
@@ -0,0 +1,247 @@
+/*
+ * Copyright (C) 2019 Alex Yatskov <alex@foosoft.net>
+ * Author: Alex Yatskov <alex@foosoft.net>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+// Private
+
+let _ankiDataPopulated = false;
+
+
+function _ankiSpinnerShow(show) {
+ const spinner = $('#anki-spinner');
+ if (show) {
+ spinner.show();
+ } else {
+ spinner.hide();
+ }
+}
+
+function _ankiSetError(error) {
+ const node = document.querySelector('#anki-error');
+ if (!node) { return; }
+ if (error) {
+ node.hidden = false;
+ node.textContent = `${error}`;
+ }
+ else {
+ node.hidden = true;
+ node.textContent = '';
+ }
+}
+
+function _ankiSetDropdownOptions(dropdown, optionValues) {
+ const fragment = document.createDocumentFragment();
+ for (const optionValue of optionValues) {
+ const option = document.createElement('option');
+ option.value = optionValue;
+ option.textContent = optionValue;
+ fragment.appendChild(option);
+ }
+ dropdown.textContent = '';
+ dropdown.appendChild(fragment);
+}
+
+async function _ankiDeckAndModelPopulate(options) {
+ const termsDeck = {value: options.anki.terms.deck, selector: '#anki-terms-deck'};
+ const kanjiDeck = {value: options.anki.kanji.deck, selector: '#anki-kanji-deck'};
+ const termsModel = {value: options.anki.terms.model, selector: '#anki-terms-model'};
+ const kanjiModel = {value: options.anki.kanji.model, selector: '#anki-kanji-model'};
+ try {
+ _ankiSpinnerShow(true);
+ const [deckNames, modelNames] = await Promise.all([utilAnkiGetDeckNames(), utilAnkiGetModelNames()]);
+ deckNames.sort();
+ modelNames.sort();
+ termsDeck.values = deckNames;
+ kanjiDeck.values = deckNames;
+ termsModel.values = modelNames;
+ kanjiModel.values = modelNames;
+ _ankiSetError(null);
+ } catch (error) {
+ _ankiSetError(error);
+ } finally {
+ _ankiSpinnerShow(false);
+ }
+
+ for (const {value, values, selector} of [termsDeck, kanjiDeck, termsModel, kanjiModel]) {
+ const node = document.querySelector(selector);
+ _ankiSetDropdownOptions(node, Array.isArray(values) ? values : [value]);
+ node.value = value;
+ }
+}
+
+function _ankiCreateFieldTemplate(name, value, markers) {
+ const template = document.querySelector('#anki-field-template').content;
+ const content = document.importNode(template, true).firstChild;
+
+ content.querySelector('.anki-field-name').textContent = name;
+
+ const field = content.querySelector('.anki-field-value');
+ field.dataset.field = name;
+ field.value = value;
+
+ content.querySelector('.anki-field-marker-list').appendChild(ankiGetFieldMarkersHtml(markers));
+
+ return content;
+}
+
+async function _ankiFieldsPopulate(tabId, options) {
+ const tab = document.querySelector(`.tab-pane[data-anki-card-type=${tabId}]`);
+ const container = tab.querySelector('tbody');
+ const markers = ankiGetFieldMarkers(tabId);
+
+ const fragment = document.createDocumentFragment();
+ const fields = options.anki[tabId].fields;
+ for (const name of Object.keys(fields)) {
+ const value = fields[name];
+ const html = _ankiCreateFieldTemplate(name, value, markers);
+ fragment.appendChild(html);
+ }
+
+ container.textContent = '';
+ container.appendChild(fragment);
+
+ for (const node of container.querySelectorAll('.anki-field-value')) {
+ node.addEventListener('change', (e) => onFormOptionsChanged(e), false);
+ }
+ for (const node of container.querySelectorAll('.marker-link')) {
+ node.addEventListener('click', (e) => _onAnkiMarkerClicked(e), false);
+ }
+}
+
+function _onAnkiMarkerClicked(e) {
+ e.preventDefault();
+ const link = e.currentTarget;
+ const input = $(link).closest('.input-group').find('.anki-field-value')[0];
+ input.value = `{${link.textContent}}`;
+ input.dispatchEvent(new Event('change'));
+}
+
+async function _onAnkiModelChanged(e) {
+ const node = e.currentTarget;
+ let fieldNames;
+ try {
+ const modelName = node.value;
+ fieldNames = await utilAnkiGetModelFieldNames(modelName);
+ _ankiSetError(null);
+ } catch (error) {
+ _ankiSetError(error);
+ return;
+ } finally {
+ _ankiSpinnerShow(false);
+ }
+
+ const tabId = node.dataset.ankiCardType;
+ if (tabId !== 'terms' && tabId !== 'kanji') { return; }
+
+ const fields = {};
+ for (const name of fieldNames) {
+ fields[name] = '';
+ }
+
+ const optionsContext = getOptionsContext();
+ const options = await apiOptionsGet(optionsContext);
+ options.anki[tabId].fields = utilBackgroundIsolate(fields);
+ await settingsSaveOptions();
+
+ await _ankiFieldsPopulate(tabId, options);
+}
+
+
+// Public
+
+function ankiErrorShown() {
+ const node = document.querySelector('#anki-error');
+ return node && !node.hidden;
+}
+
+function ankiFieldsToDict(elements) {
+ const result = {};
+ for (const element of elements) {
+ result[element.dataset.field] = element.value;
+ }
+ return result;
+}
+
+
+function ankiGetFieldMarkersHtml(markers) {
+ const template = document.querySelector('#anki-field-marker-template').content;
+ const fragment = document.createDocumentFragment();
+ for (const marker of markers) {
+ const markerNode = document.importNode(template, true).firstChild;
+ markerNode.querySelector('.marker-link').textContent = marker;
+ fragment.appendChild(markerNode);
+ }
+ return fragment;
+}
+
+function ankiGetFieldMarkers(type) {
+ switch (type) {
+ case 'terms':
+ return [
+ 'audio',
+ 'cloze-body',
+ 'cloze-prefix',
+ 'cloze-suffix',
+ 'dictionary',
+ 'expression',
+ 'furigana',
+ 'furigana-plain',
+ 'glossary',
+ 'glossary-brief',
+ 'reading',
+ 'screenshot',
+ 'sentence',
+ 'tags',
+ 'url'
+ ];
+ case 'kanji':
+ return [
+ 'character',
+ 'dictionary',
+ 'glossary',
+ 'kunyomi',
+ 'onyomi',
+ 'screenshot',
+ 'sentence',
+ 'tags',
+ 'url'
+ ];
+ default:
+ return [];
+ }
+}
+
+
+function ankiInitialize() {
+ for (const node of document.querySelectorAll('#anki-terms-model,#anki-kanji-model')) {
+ node.addEventListener('change', (e) => _onAnkiModelChanged(e), false);
+ }
+}
+
+async function onAnkiOptionsChanged(options) {
+ if (!options.anki.enable) {
+ _ankiDataPopulated = false;
+ return;
+ }
+
+ if (_ankiDataPopulated) { return; }
+
+ await _ankiDeckAndModelPopulate(options);
+ _ankiDataPopulated = true;
+ await Promise.all([_ankiFieldsPopulate('terms', options), _ankiFieldsPopulate('kanji', options)]);
+}
diff --git a/ext/bg/js/settings/audio.js b/ext/bg/js/settings/audio.js
new file mode 100644
index 00000000..f63551ed
--- /dev/null
+++ b/ext/bg/js/settings/audio.js
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2019 Alex Yatskov <alex@foosoft.net>
+ * Author: Alex Yatskov <alex@foosoft.net>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+let audioSourceUI = null;
+
+async function audioSettingsInitialize() {
+ const optionsContext = getOptionsContext();
+ const options = await apiOptionsGet(optionsContext);
+ audioSourceUI = new AudioSourceUI.Container(options.audio.sources, $('.audio-source-list'), $('.audio-source-add'));
+ audioSourceUI.save = () => settingsSaveOptions();
+
+ textToSpeechInitialize();
+}
+
+function textToSpeechInitialize() {
+ if (typeof speechSynthesis === 'undefined') { return; }
+
+ speechSynthesis.addEventListener('voiceschanged', () => updateTextToSpeechVoices(), false);
+ updateTextToSpeechVoices();
+
+ $('#text-to-speech-voice-test').on('click', () => textToSpeechTest());
+}
+
+function updateTextToSpeechVoices() {
+ const voices = Array.prototype.map.call(speechSynthesis.getVoices(), (voice, index) => ({voice, index}));
+ voices.sort(textToSpeechVoiceCompare);
+ if (voices.length > 0) {
+ $('#text-to-speech-voice-container').css('display', '');
+ }
+
+ const select = $('#text-to-speech-voice');
+ select.empty();
+ select.append($('<option>').val('').text('None'));
+ for (const {voice} of voices) {
+ select.append($('<option>').val(voice.voiceURI).text(`${voice.name} (${voice.lang})`));
+ }
+
+ select.val(select.attr('data-value'));
+}
+
+function languageTagIsJapanese(languageTag) {
+ return (
+ languageTag.startsWith('ja-') ||
+ languageTag.startsWith('jpn-')
+ );
+}
+
+function textToSpeechVoiceCompare(a, b) {
+ const aIsJapanese = languageTagIsJapanese(a.voice.lang);
+ const bIsJapanese = languageTagIsJapanese(b.voice.lang);
+ if (aIsJapanese) {
+ if (!bIsJapanese) { return -1; }
+ } else {
+ if (bIsJapanese) { return 1; }
+ }
+
+ const aIsDefault = a.voice.default;
+ const bIsDefault = b.voice.default;
+ if (aIsDefault) {
+ if (!bIsDefault) { return -1; }
+ } else {
+ if (bIsDefault) { return 1; }
+ }
+
+ if (a.index < b.index) { return -1; }
+ if (a.index > b.index) { return 1; }
+ return 0;
+}
+
+function textToSpeechTest() {
+ try {
+ const text = $('#text-to-speech-voice-test').attr('data-speech-text') || '';
+ const voiceURI = $('#text-to-speech-voice').val();
+ const voice = audioGetTextToSpeechVoice(voiceURI);
+ if (voice === null) { return; }
+
+ const utterance = new SpeechSynthesisUtterance(text);
+ utterance.lang = 'ja-JP';
+ utterance.voice = voice;
+ utterance.volume = 1.0;
+
+ speechSynthesis.speak(utterance);
+ } catch (e) {
+ // NOP
+ }
+}
diff --git a/ext/bg/js/settings-dictionaries.js b/ext/bg/js/settings/dictionaries.js
index ebd380ac..065a8abc 100644
--- a/ext/bg/js/settings-dictionaries.js
+++ b/ext/bg/js/settings/dictionaries.js
@@ -62,8 +62,8 @@ class SettingsDictionaryListUI {
this.updateDictionaryOrder();
- const titles = this.dictionaryEntries.map(e => e.dictionaryInfo.title);
- const removeKeys = Object.keys(this.optionsDictionaries).filter(key => titles.indexOf(key) < 0);
+ const titles = this.dictionaryEntries.map((e) => e.dictionaryInfo.title);
+ const removeKeys = Object.keys(this.optionsDictionaries).filter((key) => titles.indexOf(key) < 0);
if (removeKeys.length > 0) {
for (const key of toIterable(removeKeys)) {
delete this.optionsDictionaries[key];
@@ -81,7 +81,7 @@ class SettingsDictionaryListUI {
let changed = false;
let optionsDictionary;
const optionsDictionaries = this.optionsDictionaries;
- if (optionsDictionaries.hasOwnProperty(title)) {
+ if (hasOwn(optionsDictionaries, title)) {
optionsDictionary = optionsDictionaries[title];
} else {
optionsDictionary = SettingsDictionaryListUI.createDictionaryOptions();
@@ -161,7 +161,7 @@ class SettingsDictionaryListUI {
delete n.dataset.dict;
$(n).modal('hide');
- const index = this.dictionaryEntries.findIndex(e => e.dictionaryInfo.title === title);
+ const index = this.dictionaryEntries.findIndex((e) => e.dictionaryInfo.title === title);
if (index >= 0) {
this.dictionaryEntries[index].deleteDictionary();
}
@@ -377,7 +377,7 @@ async function onDatabaseUpdated(options) {
updateMainDictionarySelect(options, dictionaries);
- const {counts, total} = await utilDatabaseGetDictionaryCounts(dictionaries.map(v => v.title), true);
+ const {counts, total} = await utilDatabaseGetDictionaryCounts(dictionaries.map((v) => v.title), true);
dictionaryUI.setCounts(counts, total);
} catch (e) {
dictionaryErrorsShow([e]);
@@ -466,7 +466,7 @@ function dictionaryErrorsShow(errors) {
for (let e of errors) {
console.error(e);
e = dictionaryErrorToString(e);
- uniqueErrors[e] = uniqueErrors.hasOwnProperty(e) ? uniqueErrors[e] + 1 : 1;
+ uniqueErrors[e] = hasOwn(uniqueErrors, e) ? uniqueErrors[e] + 1 : 1;
}
for (const e in uniqueErrors) {
@@ -564,7 +564,7 @@ async function onDictionaryImport(e) {
dictionaryErrorsShow(null);
dictionarySpinnerShow(true);
- const setProgress = percent => dictProgress.find('.progress-bar').css('width', `${percent}%`);
+ const setProgress = (percent) => dictProgress.find('.progress-bar').css('width', `${percent}%`);
const updateProgress = (total, current) => {
setProgress(current / total * 100.0);
if (storageEstimate.mostRecent !== null && !storageUpdateStats.isUpdating) {
diff --git a/ext/bg/js/settings/main.js b/ext/bg/js/settings/main.js
new file mode 100644
index 00000000..7456e7a4
--- /dev/null
+++ b/ext/bg/js/settings/main.js
@@ -0,0 +1,239 @@
+/*
+ * Copyright (C) 2016-2017 Alex Yatskov <alex@foosoft.net>
+ * Author: Alex Yatskov <alex@foosoft.net>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+async function getOptionsArray() {
+ const optionsFull = await apiOptionsGetFull();
+ return optionsFull.profiles.map((profile) => profile.options);
+}
+
+async function formRead(options) {
+ options.general.enable = $('#enable').prop('checked');
+ options.general.showGuide = $('#show-usage-guide').prop('checked');
+ options.general.compactTags = $('#compact-tags').prop('checked');
+ options.general.compactGlossaries = $('#compact-glossaries').prop('checked');
+ options.general.resultOutputMode = $('#result-output-mode').val();
+ options.general.debugInfo = $('#show-debug-info').prop('checked');
+ options.general.showAdvanced = $('#show-advanced-options').prop('checked');
+ options.general.maxResults = parseInt($('#max-displayed-results').val(), 10);
+ options.general.popupDisplayMode = $('#popup-display-mode').val();
+ options.general.popupHorizontalTextPosition = $('#popup-horizontal-text-position').val();
+ options.general.popupVerticalTextPosition = $('#popup-vertical-text-position').val();
+ options.general.popupWidth = parseInt($('#popup-width').val(), 10);
+ options.general.popupHeight = parseInt($('#popup-height').val(), 10);
+ options.general.popupHorizontalOffset = parseInt($('#popup-horizontal-offset').val(), 0);
+ options.general.popupVerticalOffset = parseInt($('#popup-vertical-offset').val(), 10);
+ options.general.popupHorizontalOffset2 = parseInt($('#popup-horizontal-offset2').val(), 0);
+ options.general.popupVerticalOffset2 = parseInt($('#popup-vertical-offset2').val(), 10);
+ options.general.popupTheme = $('#popup-theme').val();
+ options.general.popupOuterTheme = $('#popup-outer-theme').val();
+ options.general.customPopupCss = $('#custom-popup-css').val();
+ options.general.customPopupOuterCss = $('#custom-popup-outer-css').val();
+
+ options.audio.enabled = $('#audio-playback-enabled').prop('checked');
+ options.audio.autoPlay = $('#auto-play-audio').prop('checked');
+ options.audio.volume = parseFloat($('#audio-playback-volume').val());
+ options.audio.customSourceUrl = $('#audio-custom-source').val();
+ options.audio.textToSpeechVoice = $('#text-to-speech-voice').val();
+
+ options.scanning.middleMouse = $('#middle-mouse-button-scan').prop('checked');
+ options.scanning.touchInputEnabled = $('#touch-input-enabled').prop('checked');
+ options.scanning.selectText = $('#select-matched-text').prop('checked');
+ options.scanning.alphanumeric = $('#search-alphanumeric').prop('checked');
+ options.scanning.autoHideResults = $('#auto-hide-results').prop('checked');
+ options.scanning.deepDomScan = $('#deep-dom-scan').prop('checked');
+ options.scanning.enablePopupSearch = $('#enable-search-within-first-popup').prop('checked');
+ options.scanning.enableOnPopupExpressions = $('#enable-scanning-of-popup-expressions').prop('checked');
+ options.scanning.enableOnSearchPage = $('#enable-scanning-on-search-page').prop('checked');
+ options.scanning.delay = parseInt($('#scan-delay').val(), 10);
+ options.scanning.length = parseInt($('#scan-length').val(), 10);
+ options.scanning.modifier = $('#scan-modifier-key').val();
+ options.scanning.popupNestingMaxDepth = parseInt($('#popup-nesting-max-depth').val(), 10);
+
+ options.parsing.enableScanningParser = $('#parsing-scan-enable').prop('checked');
+ options.parsing.enableMecabParser = $('#parsing-mecab-enable').prop('checked');
+ options.parsing.readingMode = $('#parsing-reading-mode').val();
+
+ const optionsAnkiEnableOld = options.anki.enable;
+ options.anki.enable = $('#anki-enable').prop('checked');
+ options.anki.tags = utilBackgroundIsolate($('#card-tags').val().split(/[,; ]+/));
+ options.anki.sentenceExt = parseInt($('#sentence-detection-extent').val(), 10);
+ options.anki.server = $('#interface-server').val();
+ options.anki.screenshot.format = $('#screenshot-format').val();
+ options.anki.screenshot.quality = parseInt($('#screenshot-quality').val(), 10);
+ options.anki.fieldTemplates = $('#field-templates').val();
+
+ if (optionsAnkiEnableOld && !ankiErrorShown()) {
+ options.anki.terms.deck = $('#anki-terms-deck').val();
+ options.anki.terms.model = $('#anki-terms-model').val();
+ options.anki.terms.fields = utilBackgroundIsolate(ankiFieldsToDict(document.querySelectorAll('#terms .anki-field-value')));
+ options.anki.kanji.deck = $('#anki-kanji-deck').val();
+ options.anki.kanji.model = $('#anki-kanji-model').val();
+ options.anki.kanji.fields = utilBackgroundIsolate(ankiFieldsToDict(document.querySelectorAll('#kanji .anki-field-value')));
+ }
+}
+
+async function formWrite(options) {
+ $('#enable').prop('checked', options.general.enable);
+ $('#show-usage-guide').prop('checked', options.general.showGuide);
+ $('#compact-tags').prop('checked', options.general.compactTags);
+ $('#compact-glossaries').prop('checked', options.general.compactGlossaries);
+ $('#result-output-mode').val(options.general.resultOutputMode);
+ $('#show-debug-info').prop('checked', options.general.debugInfo);
+ $('#show-advanced-options').prop('checked', options.general.showAdvanced);
+ $('#max-displayed-results').val(options.general.maxResults);
+ $('#popup-display-mode').val(options.general.popupDisplayMode);
+ $('#popup-horizontal-text-position').val(options.general.popupHorizontalTextPosition);
+ $('#popup-vertical-text-position').val(options.general.popupVerticalTextPosition);
+ $('#popup-width').val(options.general.popupWidth);
+ $('#popup-height').val(options.general.popupHeight);
+ $('#popup-horizontal-offset').val(options.general.popupHorizontalOffset);
+ $('#popup-vertical-offset').val(options.general.popupVerticalOffset);
+ $('#popup-horizontal-offset2').val(options.general.popupHorizontalOffset2);
+ $('#popup-vertical-offset2').val(options.general.popupVerticalOffset2);
+ $('#popup-theme').val(options.general.popupTheme);
+ $('#popup-outer-theme').val(options.general.popupOuterTheme);
+ $('#custom-popup-css').val(options.general.customPopupCss);
+ $('#custom-popup-outer-css').val(options.general.customPopupOuterCss);
+
+ $('#audio-playback-enabled').prop('checked', options.audio.enabled);
+ $('#auto-play-audio').prop('checked', options.audio.autoPlay);
+ $('#audio-playback-volume').val(options.audio.volume);
+ $('#audio-custom-source').val(options.audio.customSourceUrl);
+ $('#text-to-speech-voice').val(options.audio.textToSpeechVoice).attr('data-value', options.audio.textToSpeechVoice);
+
+ $('#middle-mouse-button-scan').prop('checked', options.scanning.middleMouse);
+ $('#touch-input-enabled').prop('checked', options.scanning.touchInputEnabled);
+ $('#select-matched-text').prop('checked', options.scanning.selectText);
+ $('#search-alphanumeric').prop('checked', options.scanning.alphanumeric);
+ $('#auto-hide-results').prop('checked', options.scanning.autoHideResults);
+ $('#deep-dom-scan').prop('checked', options.scanning.deepDomScan);
+ $('#enable-search-within-first-popup').prop('checked', options.scanning.enablePopupSearch);
+ $('#enable-scanning-of-popup-expressions').prop('checked', options.scanning.enableOnPopupExpressions);
+ $('#enable-scanning-on-search-page').prop('checked', options.scanning.enableOnSearchPage);
+ $('#scan-delay').val(options.scanning.delay);
+ $('#scan-length').val(options.scanning.length);
+ $('#scan-modifier-key').val(options.scanning.modifier);
+ $('#popup-nesting-max-depth').val(options.scanning.popupNestingMaxDepth);
+
+ $('#parsing-scan-enable').prop('checked', options.parsing.enableScanningParser);
+ $('#parsing-mecab-enable').prop('checked', options.parsing.enableMecabParser);
+ $('#parsing-reading-mode').val(options.parsing.readingMode);
+
+ $('#anki-enable').prop('checked', options.anki.enable);
+ $('#card-tags').val(options.anki.tags.join(' '));
+ $('#sentence-detection-extent').val(options.anki.sentenceExt);
+ $('#interface-server').val(options.anki.server);
+ $('#screenshot-format').val(options.anki.screenshot.format);
+ $('#screenshot-quality').val(options.anki.screenshot.quality);
+ $('#field-templates').val(options.anki.fieldTemplates);
+
+ onAnkiTemplatesValidateCompile();
+ await onAnkiOptionsChanged(options);
+ await onDictionaryOptionsChanged(options);
+
+ formUpdateVisibility(options);
+}
+
+function formSetupEventListeners() {
+ $('input, select, textarea').not('.anki-model').not('.ignore-form-changes *').change((e) => onFormOptionsChanged(e));
+}
+
+function formUpdateVisibility(options) {
+ document.documentElement.dataset.optionsAnkiEnable = `${!!options.anki.enable}`;
+ document.documentElement.dataset.optionsGeneralDebugInfo = `${!!options.general.debugInfo}`;
+ document.documentElement.dataset.optionsGeneralShowAdvanced = `${!!options.general.showAdvanced}`;
+ document.documentElement.dataset.optionsGeneralResultOutputMode = `${options.general.resultOutputMode}`;
+
+ if (options.general.debugInfo) {
+ const temp = utilIsolate(options);
+ temp.anki.fieldTemplates = '...';
+ const text = JSON.stringify(temp, null, 4);
+ $('#debug').text(text);
+ }
+}
+
+async function onFormOptionsChanged() {
+ const optionsContext = getOptionsContext();
+ const options = await apiOptionsGet(optionsContext);
+
+ await formRead(options);
+ await settingsSaveOptions();
+ formUpdateVisibility(options);
+
+ await onAnkiOptionsChanged(options);
+}
+
+
+function settingsGetSource() {
+ return new Promise((resolve) => {
+ chrome.tabs.getCurrent((tab) => resolve(`settings${tab ? tab.id : ''}`));
+ });
+}
+
+async function settingsSaveOptions() {
+ const source = await settingsGetSource();
+ await apiOptionsSave(source);
+}
+
+async function onOptionsUpdate({source}) {
+ const thisSource = await settingsGetSource();
+ if (source === thisSource) { return; }
+
+ const optionsContext = getOptionsContext();
+ const options = await apiOptionsGet(optionsContext);
+ await formWrite(options);
+}
+
+function onMessage({action, params}, sender, callback) {
+ switch (action) {
+ case 'optionsUpdate':
+ onOptionsUpdate(params);
+ break;
+ case 'getUrl':
+ callback({url: window.location.href});
+ break;
+ }
+}
+
+
+function showExtensionInformation() {
+ const node = document.getElementById('extension-info');
+ if (node === null) { return; }
+
+ const manifest = chrome.runtime.getManifest();
+ node.textContent = `${manifest.name} v${manifest.version}`;
+}
+
+
+async function onReady() {
+ showExtensionInformation();
+
+ formSetupEventListeners();
+ appearanceInitialize();
+ await audioSettingsInitialize();
+ await profileOptionsSetup();
+ await dictSettingsInitialize();
+ ankiInitialize();
+ ankiTemplatesInitialize();
+
+ storageInfoInitialize();
+
+ chrome.runtime.onMessage.addListener(onMessage);
+}
+
+$(document).ready(() => onReady());
diff --git a/ext/bg/js/settings-popup-preview.js b/ext/bg/js/settings/popup-preview-frame.js
index 7d641c46..49409968 100644
--- a/ext/bg/js/settings-popup-preview.js
+++ b/ext/bg/js/settings/popup-preview-frame.js
@@ -106,7 +106,7 @@ class SettingsPopupPreview {
onMessage(e) {
const {action, params} = e.data;
const handlers = SettingsPopupPreview.messageHandlers;
- if (handlers.hasOwnProperty(action)) {
+ if (hasOwn(handlers, action)) {
const handler = handlers[action];
handler(this, params);
}
diff --git a/ext/bg/js/settings/popup-preview.js b/ext/bg/js/settings/popup-preview.js
new file mode 100644
index 00000000..d8579eb1
--- /dev/null
+++ b/ext/bg/js/settings/popup-preview.js
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2019 Alex Yatskov <alex@foosoft.net>
+ * Author: Alex Yatskov <alex@foosoft.net>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+function appearanceInitialize() {
+ let previewVisible = false;
+ $('#settings-popup-preview-button').on('click', () => {
+ if (previewVisible) { return; }
+ showAppearancePreview();
+ previewVisible = true;
+ });
+}
+
+function showAppearancePreview() {
+ const container = $('#settings-popup-preview-container');
+ const buttonContainer = $('#settings-popup-preview-button-container');
+ const settings = $('#settings-popup-preview-settings');
+ const text = $('#settings-popup-preview-text');
+ const customCss = $('#custom-popup-css');
+ const customOuterCss = $('#custom-popup-outer-css');
+
+ const frame = document.createElement('iframe');
+ frame.src = '/bg/settings-popup-preview.html';
+ frame.id = 'settings-popup-preview-frame';
+
+ window.wanakana.bind(text[0]);
+
+ text.on('input', () => {
+ const action = 'setText';
+ const params = {text: text.val()};
+ frame.contentWindow.postMessage({action, params}, '*');
+ });
+ customCss.on('input', () => {
+ const action = 'setCustomCss';
+ const params = {css: customCss.val()};
+ frame.contentWindow.postMessage({action, params}, '*');
+ });
+ customOuterCss.on('input', () => {
+ const action = 'setCustomOuterCss';
+ const params = {css: customOuterCss.val()};
+ frame.contentWindow.postMessage({action, params}, '*');
+ });
+
+ container.append(frame);
+ buttonContainer.remove();
+ settings.css('display', '');
+}
diff --git a/ext/bg/js/settings-profiles.js b/ext/bg/js/settings/profiles.js
index 3ae9db14..8c218e97 100644
--- a/ext/bg/js/settings-profiles.js
+++ b/ext/bg/js/settings/profiles.js
@@ -35,16 +35,16 @@ async function profileOptionsSetup() {
}
function profileOptionsSetupEventListeners() {
- $('#profile-target').change(utilAsync(onTargetProfileChanged));
- $('#profile-name').change(onProfileNameChanged);
- $('#profile-add').click(utilAsync(onProfileAdd));
- $('#profile-remove').click(utilAsync(onProfileRemove));
- $('#profile-remove-confirm').click(utilAsync(onProfileRemoveConfirm));
- $('#profile-copy').click(utilAsync(onProfileCopy));
- $('#profile-copy-confirm').click(utilAsync(onProfileCopyConfirm));
+ $('#profile-target').change((e) => onTargetProfileChanged(e));
+ $('#profile-name').change((e) => onProfileNameChanged(e));
+ $('#profile-add').click((e) => onProfileAdd(e));
+ $('#profile-remove').click((e) => onProfileRemove(e));
+ $('#profile-remove-confirm').click((e) => onProfileRemoveConfirm(e));
+ $('#profile-copy').click((e) => onProfileCopy(e));
+ $('#profile-copy-confirm').click((e) => onProfileCopyConfirm(e));
$('#profile-move-up').click(() => onProfileMove(-1));
$('#profile-move-down').click(() => onProfileMove(1));
- $('.profile-form').find('input, select, textarea').not('.profile-form-manual').change(utilAsync(onProfileOptionsChanged));
+ $('.profile-form').find('input, select, textarea').not('.profile-form-manual').change((e) => onProfileOptionsChanged(e));
}
function tryGetIntegerValue(selector, min, max) {
@@ -147,7 +147,7 @@ function profileOptionsCreateCopyName(name, profiles, maxUniqueAttempts) {
let i = 0;
while (true) {
const newName = `${prefix}${space}${index}${suffix}`;
- if (i++ >= maxUniqueAttempts || profiles.findIndex(profile => profile.name === newName) < 0) {
+ if (i++ >= maxUniqueAttempts || profiles.findIndex((profile) => profile.name === newName) < 0) {
return newName;
}
if (typeof index !== 'number') {
diff --git a/ext/bg/js/settings/storage.js b/ext/bg/js/settings/storage.js
new file mode 100644
index 00000000..51ca6855
--- /dev/null
+++ b/ext/bg/js/settings/storage.js
@@ -0,0 +1,138 @@
+/*
+ * Copyright (C) 2019 Alex Yatskov <alex@foosoft.net>
+ * Author: Alex Yatskov <alex@foosoft.net>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+function storageBytesToLabeledString(size) {
+ const base = 1000;
+ const labels = [' bytes', 'KB', 'MB', 'GB'];
+ let labelIndex = 0;
+ while (size >= base) {
+ size /= base;
+ ++labelIndex;
+ }
+ const label = labelIndex === 0 ? `${size}` : size.toFixed(1);
+ return `${label}${labels[labelIndex]}`;
+}
+
+async function storageEstimate() {
+ try {
+ return (storageEstimate.mostRecent = await navigator.storage.estimate());
+ } catch (e) {
+ // NOP
+ }
+ return null;
+}
+storageEstimate.mostRecent = null;
+
+async function isStoragePeristent() {
+ try {
+ return await navigator.storage.persisted();
+ } catch (e) {
+ // NOP
+ }
+ return false;
+}
+
+async function storageInfoInitialize() {
+ storagePersistInitialize();
+ const {browser, platform} = await apiGetEnvironmentInfo();
+ document.documentElement.dataset.browser = browser;
+ document.documentElement.dataset.operatingSystem = platform.os;
+
+ await storageShowInfo();
+
+ document.querySelector('#storage-refresh').addEventListener('click', () => storageShowInfo(), false);
+}
+
+async function storageUpdateStats() {
+ storageUpdateStats.isUpdating = true;
+
+ const estimate = await storageEstimate();
+ const valid = (estimate !== null);
+
+ if (valid) {
+ // Firefox reports usage as 0 when persistent storage is enabled.
+ const finite = (estimate.usage > 0 || !(await isStoragePeristent()));
+ if (finite) {
+ document.querySelector('#storage-usage').textContent = storageBytesToLabeledString(estimate.usage);
+ document.querySelector('#storage-quota').textContent = storageBytesToLabeledString(estimate.quota);
+ }
+ document.querySelector('#storage-use-finite').classList.toggle('storage-hidden', !finite);
+ document.querySelector('#storage-use-infinite').classList.toggle('storage-hidden', finite);
+ }
+
+ storageUpdateStats.isUpdating = false;
+ return valid;
+}
+storageUpdateStats.isUpdating = false;
+
+async function storageShowInfo() {
+ storageSpinnerShow(true);
+
+ const valid = await storageUpdateStats();
+ document.querySelector('#storage-use').classList.toggle('storage-hidden', !valid);
+ document.querySelector('#storage-error').classList.toggle('storage-hidden', valid);
+
+ storageSpinnerShow(false);
+}
+
+function storageSpinnerShow(show) {
+ const spinner = $('#storage-spinner');
+ if (show) {
+ spinner.show();
+ } else {
+ spinner.hide();
+ }
+}
+
+async function storagePersistInitialize() {
+ if (!(navigator.storage && navigator.storage.persist)) {
+ // Not supported
+ return;
+ }
+
+ const info = document.querySelector('#storage-persist-info');
+ const button = document.querySelector('#storage-persist-button');
+ const checkbox = document.querySelector('#storage-persist-button-checkbox');
+
+ info.classList.remove('storage-hidden');
+ button.classList.remove('storage-hidden');
+
+ let persisted = await isStoragePeristent();
+ checkbox.checked = persisted;
+
+ button.addEventListener('click', async () => {
+ if (persisted) {
+ return;
+ }
+ let result = false;
+ try {
+ result = await navigator.storage.persist();
+ } catch (e) {
+ // NOP
+ }
+
+ if (result) {
+ persisted = true;
+ checkbox.checked = true;
+ storageShowInfo();
+ } else {
+ $('.storage-persist-fail-warning').removeClass('storage-hidden');
+ }
+ }, false);
+}
diff --git a/ext/bg/js/templates.js b/ext/bg/js/templates.js
index 6e377957..9320477f 100644
--- a/ext/bg/js/templates.js
+++ b/ext/bg/js/templates.js
@@ -33,19 +33,18 @@ templates['kanji.html'] = template({"1":function(container,depth0,helpers,partia
return "<div class=\"entry\" data-type=\"kanji\">\n <div class=\"actions\">\n"
+ ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.addable : depth0),{"name":"if","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.source : depth0),{"name":"if","hash":{},"fn":container.program(13, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ " <img src=\"/mixed/img/entry-current.svg\" class=\"current\" title=\"Current entry (Alt + Up/Down/Home/End/PgUp/PgDn)\" alt>\n </div>\n\n <div class=\"glyph expression-scan-toggle\">"
+ container.escapeExpression(((helper = (helper = helpers.character || (depth0 != null ? depth0.character : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(alias1,{"name":"character","hash":{},"data":data}) : helper)))
+ "</div>\n\n"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.frequencies : depth0),{"name":"if","hash":{},"fn":container.program(15, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.frequencies : depth0),{"name":"if","hash":{},"fn":container.program(13, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "\n"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.tags : depth0),{"name":"if","hash":{},"fn":container.program(18, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.tags : depth0),{"name":"if","hash":{},"fn":container.program(16, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "\n <table class=\"table table-condensed glyph-data\">\n <tr>\n <th>Glossary</th>\n <th>Readings</th>\n <th>Statistics</th>\n </tr>\n <tr>\n <td class=\"glossary\">\n"
- + ((stack1 = helpers["if"].call(alias1,((stack1 = (depth0 != null ? depth0.glossary : depth0)) != null ? stack1["1"] : stack1),{"name":"if","hash":{},"fn":container.program(21, data, 0),"inverse":container.program(24, data, 0),"data":data})) != null ? stack1 : "")
+ + ((stack1 = helpers["if"].call(alias1,((stack1 = (depth0 != null ? depth0.glossary : depth0)) != null ? stack1["1"] : stack1),{"name":"if","hash":{},"fn":container.program(19, data, 0),"inverse":container.program(22, data, 0),"data":data})) != null ? stack1 : "")
+ " </td>\n <td class=\"reading\">\n "
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.onyomi : depth0),{"name":"if","hash":{},"fn":container.program(26, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.onyomi : depth0),{"name":"if","hash":{},"fn":container.program(24, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "\n "
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.kunyomi : depth0),{"name":"if","hash":{},"fn":container.program(29, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.kunyomi : depth0),{"name":"if","hash":{},"fn":container.program(27, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "\n </td>\n <td>"
+ ((stack1 = container.invokePartial(partials.table,depth0,{"name":"table","hash":{"data":((stack1 = (depth0 != null ? depth0.stats : depth0)) != null ? stack1.misc : stack1)},"data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "")
+ "</td>\n </tr>\n <tr>\n <th colspan=\"3\">Classifications</th>\n </tr>\n <tr>\n <td colspan=\"3\">"
@@ -55,19 +54,17 @@ templates['kanji.html'] = template({"1":function(container,depth0,helpers,partia
+ "</td>\n </tr>\n <tr>\n <th colspan=\"3\">Dictionary Indices</th>\n </tr>\n <tr>\n <td colspan=\"3\">"
+ ((stack1 = container.invokePartial(partials.table,depth0,{"name":"table","hash":{"data":((stack1 = (depth0 != null ? depth0.stats : depth0)) != null ? stack1.index : stack1)},"data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "")
+ "</td>\n </tr>\n </table>\n\n"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.debug : depth0),{"name":"if","hash":{},"fn":container.program(31, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.debug : depth0),{"name":"if","hash":{},"fn":container.program(29, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "</div>\n";
},"11":function(container,depth0,helpers,partials,data) {
return " <a href=\"#\" class=\"action-view-note pending disabled\"><img src=\"/mixed/img/view-note.svg\" title=\"View added note (Alt + V)\" alt></a>\n <a href=\"#\" class=\"action-add-note pending disabled\" data-mode=\"kanji\"><img src=\"/mixed/img/add-term-kanji.svg\" title=\"Add Kanji (Alt + K)\" alt></a>\n";
},"13":function(container,depth0,helpers,partials,data) {
- return " <a href=\"#\" class=\"source-term\"><img src=\"/mixed/img/source-term.svg\" title=\"Source term (Alt + B)\" alt></a>\n";
-},"15":function(container,depth0,helpers,partials,data) {
var stack1;
return " <div>\n"
- + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.frequencies : depth0),{"name":"each","hash":{},"fn":container.program(16, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.frequencies : depth0),{"name":"each","hash":{},"fn":container.program(14, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ " </div>\n";
-},"16":function(container,depth0,helpers,partials,data) {
+},"14":function(container,depth0,helpers,partials,data) {
var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
return " <span class=\"label label-default tag-frequency\">"
@@ -75,13 +72,13 @@ templates['kanji.html'] = template({"1":function(container,depth0,helpers,partia
+ ":"
+ alias4(((helper = (helper = helpers.frequency || (depth0 != null ? depth0.frequency : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"frequency","hash":{},"data":data}) : helper)))
+ "</span>\n";
-},"18":function(container,depth0,helpers,partials,data) {
+},"16":function(container,depth0,helpers,partials,data) {
var stack1;
return " <div>\n"
- + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.tags : depth0),{"name":"each","hash":{},"fn":container.program(19, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.tags : depth0),{"name":"each","hash":{},"fn":container.program(17, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ " </div>\n";
-},"19":function(container,depth0,helpers,partials,data) {
+},"17":function(container,depth0,helpers,partials,data) {
var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
return " <span class=\"label label-default tag-"
@@ -91,68 +88,81 @@ templates['kanji.html'] = template({"1":function(container,depth0,helpers,partia
+ "\">"
+ alias4(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data}) : helper)))
+ "</span>\n";
-},"21":function(container,depth0,helpers,partials,data) {
+},"19":function(container,depth0,helpers,partials,data) {
var stack1;
return " <ol>"
- + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.glossary : depth0),{"name":"each","hash":{},"fn":container.program(22, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.glossary : depth0),{"name":"each","hash":{},"fn":container.program(20, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "</ol>\n";
-},"22":function(container,depth0,helpers,partials,data) {
+},"20":function(container,depth0,helpers,partials,data) {
return "<li><span class=\"glossary-item\">"
+ container.escapeExpression(container.lambda(depth0, depth0))
+ "</span></li>";
-},"24":function(container,depth0,helpers,partials,data) {
+},"22":function(container,depth0,helpers,partials,data) {
var stack1;
return " <span class=\"glossary-item\">"
+ container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? depth0.glossary : depth0)) != null ? stack1["0"] : stack1), depth0))
+ "</span>\n";
-},"26":function(container,depth0,helpers,partials,data) {
+},"24":function(container,depth0,helpers,partials,data) {
var stack1;
return "<dl>"
- + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.onyomi : depth0),{"name":"each","hash":{},"fn":container.program(27, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.onyomi : depth0),{"name":"each","hash":{},"fn":container.program(25, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "</dl>";
-},"27":function(container,depth0,helpers,partials,data) {
+},"25":function(container,depth0,helpers,partials,data) {
return "<dd>"
+ container.escapeExpression(container.lambda(depth0, depth0))
+ "</dd>";
-},"29":function(container,depth0,helpers,partials,data) {
+},"27":function(container,depth0,helpers,partials,data) {
var stack1;
return "<dl>"
- + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.kunyomi : depth0),{"name":"each","hash":{},"fn":container.program(27, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.kunyomi : depth0),{"name":"each","hash":{},"fn":container.program(25, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "</dl>";
-},"31":function(container,depth0,helpers,partials,data) {
+},"29":function(container,depth0,helpers,partials,data) {
var stack1, helper, options, buffer =
" <pre>";
- stack1 = ((helper = (helper = helpers.dumpObject || (depth0 != null ? depth0.dumpObject : depth0)) != null ? helper : helpers.helperMissing),(options={"name":"dumpObject","hash":{},"fn":container.program(32, data, 0),"inverse":container.noop,"data":data}),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),options) : helper));
+ stack1 = ((helper = (helper = helpers.dumpObject || (depth0 != null ? depth0.dumpObject : depth0)) != null ? helper : helpers.helperMissing),(options={"name":"dumpObject","hash":{},"fn":container.program(30, data, 0),"inverse":container.noop,"data":data}),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),options) : helper));
if (!helpers.dumpObject) { stack1 = helpers.blockHelperMissing.call(depth0,stack1,options)}
if (stack1 != null) { buffer += stack1; }
return buffer + "</pre>\n";
-},"32":function(container,depth0,helpers,partials,data) {
+},"30":function(container,depth0,helpers,partials,data) {
var stack1;
return ((stack1 = container.lambda(depth0, depth0)) != null ? stack1 : "");
-},"34":function(container,depth0,helpers,partials,data,blockParams,depths) {
- var stack1;
+},"32":function(container,depth0,helpers,partials,data,blockParams,depths) {
+ var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {});
- return ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.definitions : depth0),{"name":"each","hash":{},"fn":container.program(35, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "");
-},"35":function(container,depth0,helpers,partials,data,blockParams,depths) {
+ return "<div class=\"term-navigation\">\n <a href=\"#\" "
+ + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.source : depth0),{"name":"if","hash":{},"fn":container.program(33, data, 0, blockParams, depths),"inverse":container.program(35, data, 0, blockParams, depths),"data":data})) != null ? stack1 : "")
+ + "><img src=\"/mixed/img/source-term.svg\" title=\"Source term (Alt + B)\" alt></a>\n <a href=\"#\" "
+ + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.next : depth0),{"name":"if","hash":{},"fn":container.program(37, data, 0, blockParams, depths),"inverse":container.program(39, data, 0, blockParams, depths),"data":data})) != null ? stack1 : "")
+ + "><img src=\"/mixed/img/source-term.svg\" style=\"transform: scaleX(-1);\" title=\"Next term (Alt + F)\" alt></a>\n</div>\n"
+ + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.definitions : depth0),{"name":"each","hash":{},"fn":container.program(41, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "");
+},"33":function(container,depth0,helpers,partials,data) {
+ return "class=\"source-term\"";
+},"35":function(container,depth0,helpers,partials,data) {
+ return "class=\"source-term term-button-fade\"";
+},"37":function(container,depth0,helpers,partials,data) {
+ return "class=\"next-term\"";
+},"39":function(container,depth0,helpers,partials,data) {
+ return "class=\"next-term term-button-fade\"";
+},"41":function(container,depth0,helpers,partials,data,blockParams,depths) {
var stack1;
- return ((stack1 = helpers.unless.call(depth0 != null ? depth0 : (container.nullContext || {}),(data && data.first),{"name":"unless","hash":{},"fn":container.program(36, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ return ((stack1 = helpers.unless.call(depth0 != null ? depth0 : (container.nullContext || {}),(data && data.first),{"name":"unless","hash":{},"fn":container.program(42, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "\n"
- + ((stack1 = container.invokePartial(partials.kanji,depth0,{"name":"kanji","hash":{"root":(depths[1] != null ? depths[1].root : depths[1]),"source":(depths[1] != null ? depths[1].source : depths[1]),"addable":(depths[1] != null ? depths[1].addable : depths[1]),"debug":(depths[1] != null ? depths[1].debug : depths[1])},"data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "");
-},"36":function(container,depth0,helpers,partials,data) {
+ + ((stack1 = container.invokePartial(partials.kanji,depth0,{"name":"kanji","hash":{"root":(depths[1] != null ? depths[1].root : depths[1]),"addable":(depths[1] != null ? depths[1].addable : depths[1]),"debug":(depths[1] != null ? depths[1].debug : depths[1])},"data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "");
+},"42":function(container,depth0,helpers,partials,data) {
return "<hr>";
-},"38":function(container,depth0,helpers,partials,data) {
+},"44":function(container,depth0,helpers,partials,data) {
return "<p class=\"note\">No results found</p>\n";
},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data,blockParams,depths) {
var stack1;
return "\n\n"
- + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.definitions : depth0),{"name":"if","hash":{},"fn":container.program(34, data, 0, blockParams, depths),"inverse":container.program(38, data, 0, blockParams, depths),"data":data})) != null ? stack1 : "");
+ + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.definitions : depth0),{"name":"if","hash":{},"fn":container.program(32, data, 0, blockParams, depths),"inverse":container.program(44, data, 0, blockParams, depths),"data":data})) != null ? stack1 : "");
},"main_d": function(fn, props, container, depth0, data, blockParams, depths) {
var decorators = container.decorators;
@@ -306,17 +316,16 @@ templates['terms.html'] = template({"1":function(container,depth0,helpers,partia
return "<div class=\"entry\" data-type=\"term\">\n <div class=\"actions\">\n"
+ ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.addable : depth0),{"name":"if","hash":{},"fn":container.program(25, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ ((stack1 = helpers.unless.call(alias1,(depth0 != null ? depth0.merged : depth0),{"name":"unless","hash":{},"fn":container.program(27, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.source : depth0),{"name":"if","hash":{},"fn":container.program(30, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ " <img src=\"/mixed/img/entry-current.svg\" class=\"current\" title=\"Current entry (Alt + Up/Down/Home/End/PgUp/PgDn)\" alt>\n </div>\n\n"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.merged : depth0),{"name":"if","hash":{},"fn":container.program(32, data, 0, blockParams, depths),"inverse":container.program(47, data, 0, blockParams, depths),"data":data})) != null ? stack1 : "")
+ + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.merged : depth0),{"name":"if","hash":{},"fn":container.program(30, data, 0, blockParams, depths),"inverse":container.program(45, data, 0, blockParams, depths),"data":data})) != null ? stack1 : "")
+ "\n"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.reasons : depth0),{"name":"if","hash":{},"fn":container.program(50, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.reasons : depth0),{"name":"if","hash":{},"fn":container.program(48, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "\n"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.frequencies : depth0),{"name":"if","hash":{},"fn":container.program(54, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.frequencies : depth0),{"name":"if","hash":{},"fn":container.program(52, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "\n <div class=\"glossary\">\n"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.grouped : depth0),{"name":"if","hash":{},"fn":container.program(57, data, 0, blockParams, depths),"inverse":container.program(63, data, 0, blockParams, depths),"data":data})) != null ? stack1 : "")
+ + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.grouped : depth0),{"name":"if","hash":{},"fn":container.program(55, data, 0, blockParams, depths),"inverse":container.program(61, data, 0, blockParams, depths),"data":data})) != null ? stack1 : "")
+ " </div>\n\n"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.debug : depth0),{"name":"if","hash":{},"fn":container.program(66, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.debug : depth0),{"name":"if","hash":{},"fn":container.program(64, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "</div>\n";
},"25":function(container,depth0,helpers,partials,data) {
return " <a href=\"#\" class=\"action-view-note pending disabled\"><img src=\"/mixed/img/view-note.svg\" title=\"View added note (Alt + V)\" alt></a>\n <a href=\"#\" class=\"action-add-note pending disabled\" data-mode=\"term-kanji\"><img src=\"/mixed/img/add-term-kanji.svg\" title=\"Add expression (Alt + E)\" alt></a>\n <a href=\"#\" class=\"action-add-note pending disabled\" data-mode=\"term-kana\"><img src=\"/mixed/img/add-term-kana.svg\" title=\"Add reading (Alt + R)\" alt></a>\n";
@@ -326,47 +335,45 @@ templates['terms.html'] = template({"1":function(container,depth0,helpers,partia
return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.playback : depth0),{"name":"if","hash":{},"fn":container.program(28, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "");
},"28":function(container,depth0,helpers,partials,data) {
return " <a href=\"#\" class=\"action-play-audio\"><img src=\"/mixed/img/play-audio.svg\" title=\"Play audio (Alt + P)\" alt></a>\n";
-},"30":function(container,depth0,helpers,partials,data) {
- return " <a href=\"#\" class=\"source-term\"><img src=\"/mixed/img/source-term.svg\" title=\"Source term (Alt + B)\" alt></a>\n";
-},"32":function(container,depth0,helpers,partials,data,blockParams,depths) {
+},"30":function(container,depth0,helpers,partials,data,blockParams,depths) {
var stack1;
- return ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.expressions : depth0),{"name":"each","hash":{},"fn":container.program(33, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "");
-},"33":function(container,depth0,helpers,partials,data,blockParams,depths) {
+ return ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.expressions : depth0),{"name":"each","hash":{},"fn":container.program(31, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "");
+},"31":function(container,depth0,helpers,partials,data,blockParams,depths) {
var stack1, helper, options, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", buffer =
"<div class=\"expression expression-scan-toggle\"><span class=\"expression-"
+ container.escapeExpression(((helper = (helper = helpers.termFrequency || (depth0 != null ? depth0.termFrequency : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"termFrequency","hash":{},"data":data}) : helper)))
+ "\">";
- stack1 = ((helper = (helper = helpers.kanjiLinks || (depth0 != null ? depth0.kanjiLinks : depth0)) != null ? helper : alias2),(options={"name":"kanjiLinks","hash":{},"fn":container.program(34, data, 0, blockParams, depths),"inverse":container.noop,"data":data}),(typeof helper === alias3 ? helper.call(alias1,options) : helper));
+ stack1 = ((helper = (helper = helpers.kanjiLinks || (depth0 != null ? depth0.kanjiLinks : depth0)) != null ? helper : alias2),(options={"name":"kanjiLinks","hash":{},"fn":container.program(32, data, 0, blockParams, depths),"inverse":container.noop,"data":data}),(typeof helper === alias3 ? helper.call(alias1,options) : helper));
if (!helpers.kanjiLinks) { stack1 = helpers.blockHelperMissing.call(depth0,stack1,options)}
if (stack1 != null) { buffer += stack1; }
return buffer + "</span><div class=\"peek-wrapper\">"
- + ((stack1 = helpers["if"].call(alias1,(depths[1] != null ? depths[1].playback : depths[1]),{"name":"if","hash":{},"fn":container.program(37, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.termTags : depth0),{"name":"if","hash":{},"fn":container.program(39, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.frequencies : depth0),{"name":"if","hash":{},"fn":container.program(42, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + ((stack1 = helpers["if"].call(alias1,(depths[1] != null ? depths[1].playback : depths[1]),{"name":"if","hash":{},"fn":container.program(35, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.termTags : depth0),{"name":"if","hash":{},"fn":container.program(37, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.frequencies : depth0),{"name":"if","hash":{},"fn":container.program(40, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "</div><span class=\""
- + ((stack1 = helpers["if"].call(alias1,(data && data.last),{"name":"if","hash":{},"fn":container.program(45, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + ((stack1 = helpers["if"].call(alias1,(data && data.last),{"name":"if","hash":{},"fn":container.program(43, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "\">、</span></div>";
-},"34":function(container,depth0,helpers,partials,data) {
+},"32":function(container,depth0,helpers,partials,data) {
var stack1, helper, options;
- stack1 = ((helper = (helper = helpers.furigana || (depth0 != null ? depth0.furigana : depth0)) != null ? helper : helpers.helperMissing),(options={"name":"furigana","hash":{},"fn":container.program(35, data, 0),"inverse":container.noop,"data":data}),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),options) : helper));
+ stack1 = ((helper = (helper = helpers.furigana || (depth0 != null ? depth0.furigana : depth0)) != null ? helper : helpers.helperMissing),(options={"name":"furigana","hash":{},"fn":container.program(33, data, 0),"inverse":container.noop,"data":data}),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),options) : helper));
if (!helpers.furigana) { stack1 = helpers.blockHelperMissing.call(depth0,stack1,options)}
if (stack1 != null) { return stack1; }
else { return ''; }
-},"35":function(container,depth0,helpers,partials,data) {
+},"33":function(container,depth0,helpers,partials,data) {
var stack1;
return ((stack1 = container.lambda(depth0, depth0)) != null ? stack1 : "");
-},"37":function(container,depth0,helpers,partials,data) {
+},"35":function(container,depth0,helpers,partials,data) {
return "<a href=\"#\" class=\"action-play-audio\"><img src=\"/mixed/img/play-audio.svg\" title=\"Play audio\" alt></a>";
-},"39":function(container,depth0,helpers,partials,data) {
+},"37":function(container,depth0,helpers,partials,data) {
var stack1;
return "<div class=\"tags\">"
- + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.termTags : depth0),{"name":"each","hash":{},"fn":container.program(40, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.termTags : depth0),{"name":"each","hash":{},"fn":container.program(38, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "</div>";
-},"40":function(container,depth0,helpers,partials,data) {
+},"38":function(container,depth0,helpers,partials,data) {
var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
return " <span class=\"label label-default tag-"
@@ -376,13 +383,13 @@ templates['terms.html'] = template({"1":function(container,depth0,helpers,partia
+ "\">"
+ alias4(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data}) : helper)))
+ "</span>\n";
-},"42":function(container,depth0,helpers,partials,data) {
+},"40":function(container,depth0,helpers,partials,data) {
var stack1;
return "<div class=\"frequencies\">"
- + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.frequencies : depth0),{"name":"each","hash":{},"fn":container.program(43, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.frequencies : depth0),{"name":"each","hash":{},"fn":container.program(41, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "</div>";
-},"43":function(container,depth0,helpers,partials,data) {
+},"41":function(container,depth0,helpers,partials,data) {
var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
return " <span class=\"label label-default tag-frequency\">"
@@ -390,45 +397,45 @@ templates['terms.html'] = template({"1":function(container,depth0,helpers,partia
+ ":"
+ alias4(((helper = (helper = helpers.frequency || (depth0 != null ? depth0.frequency : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"frequency","hash":{},"data":data}) : helper)))
+ "</span>\n";
-},"45":function(container,depth0,helpers,partials,data) {
+},"43":function(container,depth0,helpers,partials,data) {
return "invisible";
-},"47":function(container,depth0,helpers,partials,data) {
+},"45":function(container,depth0,helpers,partials,data) {
var stack1, helper, options, alias1=depth0 != null ? depth0 : (container.nullContext || {}), buffer =
" <div class=\"expression expression-scan-toggle\">";
- stack1 = ((helper = (helper = helpers.kanjiLinks || (depth0 != null ? depth0.kanjiLinks : depth0)) != null ? helper : helpers.helperMissing),(options={"name":"kanjiLinks","hash":{},"fn":container.program(34, data, 0),"inverse":container.noop,"data":data}),(typeof helper === "function" ? helper.call(alias1,options) : helper));
+ stack1 = ((helper = (helper = helpers.kanjiLinks || (depth0 != null ? depth0.kanjiLinks : depth0)) != null ? helper : helpers.helperMissing),(options={"name":"kanjiLinks","hash":{},"fn":container.program(32, data, 0),"inverse":container.noop,"data":data}),(typeof helper === "function" ? helper.call(alias1,options) : helper));
if (!helpers.kanjiLinks) { stack1 = helpers.blockHelperMissing.call(depth0,stack1,options)}
if (stack1 != null) { buffer += stack1; }
return buffer + "</div>\n"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.termTags : depth0),{"name":"if","hash":{},"fn":container.program(48, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "");
-},"48":function(container,depth0,helpers,partials,data) {
+ + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.termTags : depth0),{"name":"if","hash":{},"fn":container.program(46, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "");
+},"46":function(container,depth0,helpers,partials,data) {
var stack1;
return " <div style=\"display: inline-block;\">\n"
+ ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.termTags : depth0),{"name":"each","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ " </div>\n";
-},"50":function(container,depth0,helpers,partials,data) {
+},"48":function(container,depth0,helpers,partials,data) {
var stack1;
return " <div class=\"reasons\">\n"
- + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.reasons : depth0),{"name":"each","hash":{},"fn":container.program(51, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.reasons : depth0),{"name":"each","hash":{},"fn":container.program(49, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ " </div>\n";
-},"51":function(container,depth0,helpers,partials,data) {
+},"49":function(container,depth0,helpers,partials,data) {
var stack1;
return " <span class=\"reasons\">"
+ container.escapeExpression(container.lambda(depth0, depth0))
+ "</span> "
- + ((stack1 = helpers.unless.call(depth0 != null ? depth0 : (container.nullContext || {}),(data && data.last),{"name":"unless","hash":{},"fn":container.program(52, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + ((stack1 = helpers.unless.call(depth0 != null ? depth0 : (container.nullContext || {}),(data && data.last),{"name":"unless","hash":{},"fn":container.program(50, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "\n";
-},"52":function(container,depth0,helpers,partials,data) {
+},"50":function(container,depth0,helpers,partials,data) {
return "&laquo;";
-},"54":function(container,depth0,helpers,partials,data) {
+},"52":function(container,depth0,helpers,partials,data) {
var stack1;
return " <div>\n"
- + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.frequencies : depth0),{"name":"each","hash":{},"fn":container.program(55, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.frequencies : depth0),{"name":"each","hash":{},"fn":container.program(53, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ " </div>\n";
-},"55":function(container,depth0,helpers,partials,data) {
+},"53":function(container,depth0,helpers,partials,data) {
var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
return " <span class=\"label label-default tag-frequency\">"
@@ -436,61 +443,74 @@ templates['terms.html'] = template({"1":function(container,depth0,helpers,partia
+ ":"
+ alias4(((helper = (helper = helpers.frequency || (depth0 != null ? depth0.frequency : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"frequency","hash":{},"data":data}) : helper)))
+ "</span>\n";
-},"57":function(container,depth0,helpers,partials,data,blockParams,depths) {
+},"55":function(container,depth0,helpers,partials,data,blockParams,depths) {
var stack1;
- return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),((stack1 = (depth0 != null ? depth0.definitions : depth0)) != null ? stack1["1"] : stack1),{"name":"if","hash":{},"fn":container.program(58, data, 0, blockParams, depths),"inverse":container.program(61, data, 0, blockParams, depths),"data":data})) != null ? stack1 : "");
-},"58":function(container,depth0,helpers,partials,data,blockParams,depths) {
+ return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),((stack1 = (depth0 != null ? depth0.definitions : depth0)) != null ? stack1["1"] : stack1),{"name":"if","hash":{},"fn":container.program(56, data, 0, blockParams, depths),"inverse":container.program(59, data, 0, blockParams, depths),"data":data})) != null ? stack1 : "");
+},"56":function(container,depth0,helpers,partials,data,blockParams,depths) {
var stack1;
return " <ol>\n"
- + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.definitions : depth0),{"name":"each","hash":{},"fn":container.program(59, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.definitions : depth0),{"name":"each","hash":{},"fn":container.program(57, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ " </ol>\n";
-},"59":function(container,depth0,helpers,partials,data,blockParams,depths) {
+},"57":function(container,depth0,helpers,partials,data,blockParams,depths) {
var stack1;
return " <li>"
+ ((stack1 = container.invokePartial(partials.definition,depth0,{"name":"definition","hash":{"compactGlossaries":(depths[1] != null ? depths[1].compactGlossaries : depths[1])},"data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "")
+ "</li>\n";
-},"61":function(container,depth0,helpers,partials,data) {
+},"59":function(container,depth0,helpers,partials,data) {
var stack1;
return ((stack1 = container.invokePartial(partials.definition,((stack1 = (depth0 != null ? depth0.definitions : depth0)) != null ? stack1["0"] : stack1),{"name":"definition","hash":{"compactGlossaries":(depth0 != null ? depth0.compactGlossaries : depth0)},"data":data,"indent":" ","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "");
-},"63":function(container,depth0,helpers,partials,data,blockParams,depths) {
+},"61":function(container,depth0,helpers,partials,data,blockParams,depths) {
var stack1;
- return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.merged : depth0),{"name":"if","hash":{},"fn":container.program(57, data, 0, blockParams, depths),"inverse":container.program(64, data, 0, blockParams, depths),"data":data})) != null ? stack1 : "");
-},"64":function(container,depth0,helpers,partials,data) {
+ return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.merged : depth0),{"name":"if","hash":{},"fn":container.program(55, data, 0, blockParams, depths),"inverse":container.program(62, data, 0, blockParams, depths),"data":data})) != null ? stack1 : "");
+},"62":function(container,depth0,helpers,partials,data) {
var stack1;
return ((stack1 = container.invokePartial(partials.definition,depth0,{"name":"definition","hash":{"compactGlossaries":(depth0 != null ? depth0.compactGlossaries : depth0)},"data":data,"indent":" ","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "")
+ " ";
-},"66":function(container,depth0,helpers,partials,data) {
+},"64":function(container,depth0,helpers,partials,data) {
var stack1, helper, options, buffer =
" <pre>";
- stack1 = ((helper = (helper = helpers.dumpObject || (depth0 != null ? depth0.dumpObject : depth0)) != null ? helper : helpers.helperMissing),(options={"name":"dumpObject","hash":{},"fn":container.program(35, data, 0),"inverse":container.noop,"data":data}),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),options) : helper));
+ stack1 = ((helper = (helper = helpers.dumpObject || (depth0 != null ? depth0.dumpObject : depth0)) != null ? helper : helpers.helperMissing),(options={"name":"dumpObject","hash":{},"fn":container.program(33, data, 0),"inverse":container.noop,"data":data}),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),options) : helper));
if (!helpers.dumpObject) { stack1 = helpers.blockHelperMissing.call(depth0,stack1,options)}
if (stack1 != null) { buffer += stack1; }
return buffer + "</pre>\n";
-},"68":function(container,depth0,helpers,partials,data,blockParams,depths) {
- var stack1;
-
- return ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.definitions : depth0),{"name":"each","hash":{},"fn":container.program(69, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "");
-},"69":function(container,depth0,helpers,partials,data,blockParams,depths) {
- var stack1;
+},"66":function(container,depth0,helpers,partials,data,blockParams,depths) {
+ var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {});
- return ((stack1 = helpers.unless.call(depth0 != null ? depth0 : (container.nullContext || {}),(data && data.first),{"name":"unless","hash":{},"fn":container.program(70, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ return "<div class=\"term-navigation\">\n <a href=\"#\" "
+ + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.source : depth0),{"name":"if","hash":{},"fn":container.program(67, data, 0, blockParams, depths),"inverse":container.program(69, data, 0, blockParams, depths),"data":data})) != null ? stack1 : "")
+ + "><img src=\"/mixed/img/source-term.svg\" title=\"Source term (Alt + B)\" alt></a>\n <a href=\"#\" "
+ + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.next : depth0),{"name":"if","hash":{},"fn":container.program(71, data, 0, blockParams, depths),"inverse":container.program(73, data, 0, blockParams, depths),"data":data})) != null ? stack1 : "")
+ + "><img src=\"/mixed/img/source-term.svg\" style=\"transform: scaleX(-1);\" title=\"Next term (Alt + F)\" alt></a>\n</div>\n"
+ + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.definitions : depth0),{"name":"each","hash":{},"fn":container.program(75, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "");
+},"67":function(container,depth0,helpers,partials,data) {
+ return "class=\"source-term\"";
+},"69":function(container,depth0,helpers,partials,data) {
+ return "class=\"source-term term-button-fade\"";
+},"71":function(container,depth0,helpers,partials,data) {
+ return "class=\"next-term\"";
+},"73":function(container,depth0,helpers,partials,data) {
+ return "class=\"next-term term-button-fade\"";
+},"75":function(container,depth0,helpers,partials,data,blockParams,depths) {
+ var stack1;
+
+ return ((stack1 = helpers.unless.call(depth0 != null ? depth0 : (container.nullContext || {}),(data && data.first),{"name":"unless","hash":{},"fn":container.program(76, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "\n"
- + ((stack1 = container.invokePartial(partials.term,depth0,{"name":"term","hash":{"source":(depths[1] != null ? depths[1].source : depths[1]),"compactGlossaries":(depths[1] != null ? depths[1].compactGlossaries : depths[1]),"playback":(depths[1] != null ? depths[1].playback : depths[1]),"addable":(depths[1] != null ? depths[1].addable : depths[1]),"merged":(depths[1] != null ? depths[1].merged : depths[1]),"grouped":(depths[1] != null ? depths[1].grouped : depths[1]),"debug":(depths[1] != null ? depths[1].debug : depths[1])},"data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "");
-},"70":function(container,depth0,helpers,partials,data) {
+ + ((stack1 = container.invokePartial(partials.term,depth0,{"name":"term","hash":{"compactGlossaries":(depths[1] != null ? depths[1].compactGlossaries : depths[1]),"playback":(depths[1] != null ? depths[1].playback : depths[1]),"addable":(depths[1] != null ? depths[1].addable : depths[1]),"merged":(depths[1] != null ? depths[1].merged : depths[1]),"grouped":(depths[1] != null ? depths[1].grouped : depths[1]),"debug":(depths[1] != null ? depths[1].debug : depths[1])},"data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "");
+},"76":function(container,depth0,helpers,partials,data) {
return "<hr>";
-},"72":function(container,depth0,helpers,partials,data) {
+},"78":function(container,depth0,helpers,partials,data) {
return "<p class=\"note\">No results found.</p>\n";
},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data,blockParams,depths) {
var stack1;
return "\n\n"
- + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.definitions : depth0),{"name":"if","hash":{},"fn":container.program(68, data, 0, blockParams, depths),"inverse":container.program(72, data, 0, blockParams, depths),"data":data})) != null ? stack1 : "");
+ + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.definitions : depth0),{"name":"if","hash":{},"fn":container.program(66, data, 0, blockParams, depths),"inverse":container.program(78, data, 0, blockParams, depths),"data":data})) != null ? stack1 : "");
},"main_d": function(fn, props, container, depth0, data, blockParams, depths) {
var decorators = container.decorators;
diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js
index e27cbdff..202014c9 100644
--- a/ext/bg/js/translator.js
+++ b/ext/bg/js/translator.js
@@ -51,7 +51,7 @@ class Translator {
const definitionsBySequence = dictTermsMergeBySequence(definitions, mainDictionary);
const defaultDefinitions = definitionsBySequence['-1'];
- const sequenceList = Object.keys(definitionsBySequence).map(v => Number(v)).filter(v => v >= 0);
+ const sequenceList = Object.keys(definitionsBySequence).map((v) => Number(v)).filter((v) => v >= 0);
const sequencedDefinitions = sequenceList.map((key) => ({
definitions: definitionsBySequence[key],
rawDefinitions: []
@@ -124,7 +124,7 @@ class Translator {
for (const expression of result.expressions.keys()) {
for (const reading of result.expressions.get(expression).keys()) {
const termTags = result.expressions.get(expression).get(reading);
- const score = termTags.map(tag => tag.score).reduce((p, v) => p + v, 0);
+ const score = termTags.map((tag) => tag.score).reduce((p, v) => p + v, 0);
expressions.push({
expression: expression,
reading: reading,
@@ -173,7 +173,7 @@ class Translator {
async findTermsMerged(text, details, options) {
const dictionaries = dictEnabledSet(options);
- const secondarySearchTitles = Object.keys(options.dictionaries).filter(dict => options.dictionaries[dict].allowSecondarySearches);
+ const secondarySearchTitles = Object.keys(options.dictionaries).filter((dict) => options.dictionaries[dict].allowSecondarySearches);
const titles = Object.keys(dictionaries);
const [definitions, length] = await this.findTermsInternal(text, dictionaries, options.scanning.alphanumeric, details);
const {sequencedDefinitions, defaultDefinitions} = await this.getSequencedDefinitions(definitions, options.general.mainDictionary);
@@ -297,7 +297,7 @@ class Translator {
for (const deinflection of deinflections) {
const term = deinflection.term;
let deinflectionArray;
- if (uniqueDeinflectionsMap.hasOwnProperty(term)) {
+ if (hasOwn(uniqueDeinflectionsMap, term)) {
deinflectionArray = uniqueDeinflectionsMap[term];
} else {
deinflectionArray = [];
@@ -320,7 +320,7 @@ class Translator {
}
}
- return deinflections.filter(e => e.definitions.length > 0);
+ return deinflections.filter((e) => e.definitions.length > 0);
}
getDeinflections(text) {
@@ -355,7 +355,7 @@ class Translator {
const kanjiUnique = {};
const kanjiList = [];
for (const c of text) {
- if (!kanjiUnique.hasOwnProperty(c)) {
+ if (!hasOwn(kanjiUnique, c)) {
kanjiList.push(c);
kanjiUnique[c] = true;
}
@@ -417,7 +417,7 @@ class Translator {
const expression = term.expression;
term.frequencies = [];
- if (termsUniqueMap.hasOwnProperty(expression)) {
+ if (hasOwn(termsUniqueMap, expression)) {
termsUniqueMap[expression].push(term);
} else {
const termList = [term];
@@ -464,7 +464,7 @@ class Translator {
const category = meta.category;
const group = (
- stats.hasOwnProperty(category) ?
+ hasOwn(stats, category) ?
stats[category] :
(stats[category] = [])
);
@@ -484,7 +484,7 @@ class Translator {
async getTagMetaList(names, title) {
const tagMetaList = [];
const cache = (
- this.tagCache.hasOwnProperty(title) ?
+ hasOwn(this.tagCache, title) ?
this.tagCache[title] :
(this.tagCache[title] = {})
);
@@ -492,7 +492,7 @@ class Translator {
for (const name of names) {
const base = Translator.getNameBase(name);
- if (cache.hasOwnProperty(base)) {
+ if (hasOwn(cache, base)) {
tagMetaList.push(cache[base]);
} else {
const tagMeta = await this.database.findTagForTitle(base, title);
diff --git a/ext/bg/js/util.js b/ext/bg/js/util.js
index a6126677..3dd5fd55 100644
--- a/ext/bg/js/util.js
+++ b/ext/bg/js/util.js
@@ -16,12 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-function utilAsync(func) {
- return function(...args) {
- func.apply(this, args);
- };
-}
-
function utilIsolate(data) {
return JSON.parse(JSON.stringify(data));
}
@@ -47,13 +41,13 @@ function utilSetEqual(setA, setB) {
function utilSetIntersection(setA, setB) {
return new Set(
- [...setA].filter(value => setB.has(value))
+ [...setA].filter((value) => setB.has(value))
);
}
function utilSetDifference(setA, setB) {
return new Set(
- [...setA].filter(value => !setB.has(value))
+ [...setA].filter((value) => !setB.has(value))
);
}
@@ -117,7 +111,3 @@ function utilReadFile(file) {
reader.readAsBinaryString(file);
});
}
-
-function utilIsObject(value) {
- return typeof value === 'object' && value !== null && !Array.isArray(value);
-}
diff --git a/ext/bg/legal.html b/ext/bg/legal.html
index 3047ab3e..082239d7 100644
--- a/ext/bg/legal.html
+++ b/ext/bg/legal.html
@@ -44,7 +44,7 @@ and are used in conformance with the Group's <a href="https://www.edrdg.org/edrd
<li><a href="https://github.com/wycats/handlebars.js/blob/v4.0.6/LICENSE" target="_blank" rel="noopener">Handlebars v4.0.6</a></li>
<li><a href="https://github.com/jquery/jquery/blob/3.2.1/LICENSE.txt" target="_blank" rel="noopener">jQuery v3.2.1</a></li>
<li><a href="https://github.com/Stuk/jszip/blob/v3.1.3/LICENSE.markdown" target="_blank" rel="noopener">JSZip v3.1.3</a></li>
- <li><a href="https://github.com/WaniKani/WanaKana/blob/2.2.3/LICENSE" target="_blank" rel="noopener">WanaKana v2.2.3</a></li>
+ <li><a href="https://github.com/WaniKani/WanaKana/blob/4.0.2/LICENSE" target="_blank" rel="noopener">WanaKana v4.0.2</a></li>
</ul>
</div>
</div>
diff --git a/ext/bg/search.html b/ext/bg/search.html
index e819ebe6..fef30456 100644
--- a/ext/bg/search.html
+++ b/ext/bg/search.html
@@ -25,7 +25,7 @@
<p style="margin-bottom: 0;">Search your installed dictionaries by entering a Japanese expression into the field below.</p>
</div>
- <div class="input-group" style="padding-top: 10px;">
+ <div class="input-group" style="padding-top: 20px;">
<span title="Enable kana input method" class="input-group-text">
<input type="checkbox" id="wanakana-enable" class="icon-checkbox" />
<label for="wanakana-enable" class="scan-disable">あ</label>
@@ -60,7 +60,8 @@
<script src="/mixed/lib/handlebars.min.js"></script>
<script src="/mixed/lib/wanakana.min.js"></script>
- <script src="/mixed/js/extension.js"></script>
+ <script src="/mixed/js/core.js"></script>
+ <script src="/mixed/js/dom.js"></script>
<script src="/bg/js/dictionary.js"></script>
<script src="/bg/js/handlebars.js"></script>
@@ -70,6 +71,7 @@
<script src="/fg/js/source.js"></script>
<script src="/fg/js/util.js"></script>
<script src="/mixed/js/audio.js"></script>
+ <script src="/mixed/js/display-context.js"></script>
<script src="/mixed/js/display.js"></script>
<script src="/mixed/js/japanese.js"></script>
<script src="/mixed/js/scroll.js"></script>
diff --git a/ext/bg/settings-popup-preview.html b/ext/bg/settings-popup-preview.html
index d27a9a33..339467d4 100644
--- a/ext/bg/settings-popup-preview.html
+++ b/ext/bg/settings-popup-preview.html
@@ -117,7 +117,9 @@
</div>
</div></div></div>
- <script src="/mixed/js/extension.js"></script>
+ <script src="/mixed/js/core.js"></script>
+ <script src="/mixed/js/dom.js"></script>
+
<script src="/fg/js/api.js"></script>
<script src="/fg/js/document.js"></script>
<script src="/fg/js/frontend-api-receiver.js"></script>
@@ -126,6 +128,6 @@
<script src="/fg/js/util.js"></script>
<script src="/fg/js/popup-proxy-host.js"></script>
<script src="/fg/js/frontend.js"></script>
- <script src="/bg/js/settings-popup-preview.js"></script>
+ <script src="/bg/js/settings/popup-preview-frame.js"></script>
</body>
</html>
diff --git a/ext/bg/settings.html b/ext/bg/settings.html
index 262386e9..3c5494b8 100644
--- a/ext/bg/settings.html
+++ b/ext/bg/settings.html
@@ -650,7 +650,7 @@
</div>
</div>
- <div class="alert alert-danger" id="anki-error"></div>
+ <div class="alert alert-danger" id="anki-error" hidden></div>
<div class="form-group">
<label for="card-tags">Card tags <span class="label-light">(comma or space separated)</span></label>
@@ -694,16 +694,16 @@
</ul>
<div class="tab-content">
- <div id="terms" class="tab-pane fade in active">
+ <div id="terms" class="tab-pane fade in active" data-anki-card-type="terms">
<div class="row">
<div class="form-group col-xs-6">
<label for="anki-terms-deck">Deck</label>
- <select class="form-control anki-deck" id="anki-terms-deck"></select>
+ <select class="form-control anki-deck" id="anki-terms-deck" data-anki-card-type="terms"></select>
</div>
<div class="form-group col-xs-6">
<label for="anki-terms-model">Model</label>
- <select class="form-control anki-model" id="anki-terms-model"></select>
+ <select class="form-control anki-model" id="anki-terms-model" data-anki-card-type="terms"></select>
</div>
</div>
@@ -713,16 +713,16 @@
</table>
</div>
- <div id="kanji" class="tab-pane fade">
+ <div id="kanji" class="tab-pane fade" data-anki-card-type="kanji">
<div class="row">
<div class="form-group col-xs-6">
<label for="anki-kanji-deck">Deck</label>
- <select class="form-control anki-deck" id="anki-kanji-deck"></select>
+ <select class="form-control anki-deck" id="anki-kanji-deck" data-anki-card-type="kanji"></select>
</div>
<div class="form-group col-xs-6">
<label for="anki-kanji-model">Model</label>
- <select class="form-control anki-model" id="anki-kanji-model"></select>
+ <select class="form-control anki-model" id="anki-kanji-model" data-anki-card-type="kanji"></select>
</div>
</div>
@@ -864,7 +864,8 @@
<script src="/mixed/lib/handlebars.min.js"></script>
<script src="/mixed/lib/wanakana.min.js"></script>
- <script src="/mixed/js/extension.js"></script>
+ <script src="/mixed/js/core.js"></script>
+ <script src="/mixed/js/dom.js"></script>
<script src="/mixed/js/japanese.js"></script>
<script src="/bg/js/anki.js"></script>
@@ -875,13 +876,20 @@
<script src="/bg/js/dictionary.js"></script>
<script src="/bg/js/handlebars.js"></script>
<script src="/bg/js/options.js"></script>
+ <script src="/bg/js/page-exit-prevention.js"></script>
<script src="/bg/js/profile-conditions.js"></script>
<script src="/bg/js/templates.js"></script>
<script src="/bg/js/util.js"></script>
<script src="/mixed/js/audio.js"></script>
- <script src="/bg/js/settings-dictionaries.js"></script>
- <script src="/bg/js/settings-profiles.js"></script>
- <script src="/bg/js/settings.js"></script>
+ <script src="/bg/js/settings/anki.js"></script>
+ <script src="/bg/js/settings/anki-templates.js"></script>
+ <script src="/bg/js/settings/audio.js"></script>
+ <script src="/bg/js/settings/dictionaries.js"></script>
+ <script src="/bg/js/settings/popup-preview.js"></script>
+ <script src="/bg/js/settings/profiles.js"></script>
+ <script src="/bg/js/settings/storage.js"></script>
+
+ <script src="/bg/js/settings/main.js"></script>
</body>
</html>
diff --git a/ext/fg/float.html b/ext/fg/float.html
index 73118917..8cc5a129 100644
--- a/ext/fg/float.html
+++ b/ext/fg/float.html
@@ -31,13 +31,15 @@
</div>
</div>
- <script src="/mixed/js/extension.js"></script>
+ <script src="/mixed/js/core.js"></script>
+ <script src="/mixed/js/dom.js"></script>
<script src="/fg/js/api.js"></script>
<script src="/fg/js/util.js"></script>
<script src="/fg/js/document.js"></script>
<script src="/fg/js/source.js"></script>
<script src="/mixed/js/audio.js"></script>
+ <script src="/mixed/js/display-context.js"></script>
<script src="/mixed/js/display.js"></script>
<script src="/mixed/js/scroll.js"></script>
diff --git a/ext/fg/js/api.js b/ext/fg/js/api.js
index 92330d9c..0e100b59 100644
--- a/ext/fg/js/api.js
+++ b/ext/fg/js/api.js
@@ -18,73 +18,101 @@
function apiOptionsGet(optionsContext) {
- return utilInvoke('optionsGet', {optionsContext});
+ return _apiInvoke('optionsGet', {optionsContext});
}
function apiOptionsSet(changedOptions, optionsContext, source) {
- return utilInvoke('optionsSet', {changedOptions, optionsContext, source});
+ return _apiInvoke('optionsSet', {changedOptions, optionsContext, source});
}
function apiTermsFind(text, details, optionsContext) {
- return utilInvoke('termsFind', {text, details, optionsContext});
+ return _apiInvoke('termsFind', {text, details, optionsContext});
}
function apiTextParse(text, optionsContext) {
- return utilInvoke('textParse', {text, optionsContext});
+ return _apiInvoke('textParse', {text, optionsContext});
}
function apiTextParseMecab(text, optionsContext) {
- return utilInvoke('textParseMecab', {text, optionsContext});
+ return _apiInvoke('textParseMecab', {text, optionsContext});
}
function apiKanjiFind(text, optionsContext) {
- return utilInvoke('kanjiFind', {text, optionsContext});
+ return _apiInvoke('kanjiFind', {text, optionsContext});
}
function apiDefinitionAdd(definition, mode, context, optionsContext) {
- return utilInvoke('definitionAdd', {definition, mode, context, optionsContext});
+ return _apiInvoke('definitionAdd', {definition, mode, context, optionsContext});
}
function apiDefinitionsAddable(definitions, modes, optionsContext) {
- return utilInvoke('definitionsAddable', {definitions, modes, optionsContext}).catch(() => null);
+ return _apiInvoke('definitionsAddable', {definitions, modes, optionsContext}).catch(() => null);
}
function apiNoteView(noteId) {
- return utilInvoke('noteView', {noteId});
+ return _apiInvoke('noteView', {noteId});
}
function apiTemplateRender(template, data, dynamic) {
- return utilInvoke('templateRender', {data, template, dynamic});
+ return _apiInvoke('templateRender', {data, template, dynamic});
}
function apiAudioGetUrl(definition, source, optionsContext) {
- return utilInvoke('audioGetUrl', {definition, source, optionsContext});
+ return _apiInvoke('audioGetUrl', {definition, source, optionsContext});
}
function apiCommandExec(command, params) {
- return utilInvoke('commandExec', {command, params});
+ return _apiInvoke('commandExec', {command, params});
}
function apiScreenshotGet(options) {
- return utilInvoke('screenshotGet', {options});
+ return _apiInvoke('screenshotGet', {options});
}
function apiForward(action, params) {
- return utilInvoke('forward', {action, params});
+ return _apiInvoke('forward', {action, params});
}
function apiFrameInformationGet() {
- return utilInvoke('frameInformationGet');
+ return _apiInvoke('frameInformationGet');
}
function apiInjectStylesheet(css) {
- return utilInvoke('injectStylesheet', {css});
+ return _apiInvoke('injectStylesheet', {css});
}
function apiGetEnvironmentInfo() {
- return utilInvoke('getEnvironmentInfo');
+ return _apiInvoke('getEnvironmentInfo');
}
function apiClipboardGet() {
- return utilInvoke('clipboardGet');
+ return _apiInvoke('clipboardGet');
+}
+
+function _apiInvoke(action, params={}) {
+ const data = {action, params};
+ return new Promise((resolve, reject) => {
+ try {
+ chrome.runtime.sendMessage(data, (response) => {
+ _apiCheckLastError(chrome.runtime.lastError);
+ if (response !== null && typeof response === 'object') {
+ if (typeof response.error !== 'undefined') {
+ reject(jsonToError(response.error));
+ } else {
+ resolve(response.result);
+ }
+ } else {
+ const message = response === null ? 'Unexpected null response' : `Unexpected response of type ${typeof response}`;
+ reject(new Error(`${message} (${JSON.stringify(data)})`));
+ }
+ });
+ } catch (e) {
+ window.yomichan_orphaned = true;
+ reject(e);
+ }
+ });
+}
+
+function _apiCheckLastError() {
+ // NOP
}
diff --git a/ext/fg/js/document.js b/ext/fg/js/document.js
index 8161c85a..10dea7df 100644
--- a/ext/fg/js/document.js
+++ b/ext/fg/js/document.js
@@ -17,7 +17,7 @@
*/
-const REGEX_TRANSPARENT_COLOR = /rgba\s*\([^\)]*,\s*0(?:\.0+)?\s*\)/;
+const REGEX_TRANSPARENT_COLOR = /rgba\s*\([^)]*,\s*0(?:\.0+)?\s*\)/;
function docSetImposterStyle(style, propertyName, value) {
style.setProperty(propertyName, value, 'important');
@@ -223,7 +223,7 @@ function isPointInRange(x, y, range) {
const {node, offset, content} = TextSourceRange.seekForward(range.endContainer, range.endOffset, 1);
range.setEnd(node, offset);
- if (!isWhitespace(content) && isPointInAnyRect(x, y, range.getClientRects())) {
+ if (!isWhitespace(content) && DOM.isPointInAnyRect(x, y, range.getClientRects())) {
return true;
}
} finally {
@@ -234,7 +234,7 @@ function isPointInRange(x, y, range) {
const {node, offset, content} = TextSourceRange.seekBackward(range.startContainer, range.startOffset, 1);
range.setStart(node, offset);
- if (!isWhitespace(content) && isPointInAnyRect(x, y, range.getClientRects())) {
+ if (!isWhitespace(content) && DOM.isPointInAnyRect(x, y, range.getClientRects())) {
// This purposefully leaves the starting offset as modified and sets the range length to 0.
range.setEnd(node, offset);
return true;
@@ -248,21 +248,6 @@ function isWhitespace(string) {
return string.trim().length === 0;
}
-function isPointInAnyRect(x, y, rects) {
- for (const rect of rects) {
- if (isPointInRect(x, y, rect)) {
- return true;
- }
- }
- return false;
-}
-
-function isPointInRect(x, y, rect) {
- return (
- x >= rect.left && x < rect.right &&
- y >= rect.top && y < rect.bottom);
-}
-
const caretRangeFromPoint = (() => {
if (typeof document.caretRangeFromPoint === 'function') {
// Chrome, Edge
diff --git a/ext/fg/js/float.js b/ext/fg/js/float.js
index 089c9422..ae54be00 100644
--- a/ext/fg/js/float.js
+++ b/ext/fg/js/float.js
@@ -49,7 +49,7 @@ class DisplayFloat extends Display {
onMessage(e) {
const {action, params} = e.data;
const handlers = DisplayFloat.messageHandlers;
- if (handlers.hasOwnProperty(action)) {
+ if (hasOwn(handlers, action)) {
const handler = handlers[action];
handler(this, params);
}
@@ -58,7 +58,7 @@ class DisplayFloat extends Display {
onKeyDown(e) {
const key = Display.getKeyFromEvent(e);
const handlers = DisplayFloat.onKeyDownHandlers;
- if (handlers.hasOwnProperty(key)) {
+ if (hasOwn(handlers, key)) {
const handler = handlers[key];
if (handler(this, e)) {
e.preventDefault();
diff --git a/ext/fg/js/frontend-api-receiver.js b/ext/fg/js/frontend-api-receiver.js
index fbfb3ab0..7d38ddd5 100644
--- a/ext/fg/js/frontend-api-receiver.js
+++ b/ext/fg/js/frontend-api-receiver.js
@@ -34,7 +34,7 @@ class FrontendApiReceiver {
onMessage(port, {id, action, params, target, senderId}) {
if (
target !== this.source ||
- !this.handlers.hasOwnProperty(action)
+ !hasOwn(this.handlers, action)
) {
return;
}
@@ -43,10 +43,10 @@ class FrontendApiReceiver {
const handler = this.handlers[action];
handler(params).then(
- result => {
+ (result) => {
this.sendResult(port, id, senderId, {result});
},
- error => {
+ (error) => {
this.sendResult(port, id, senderId, {error: errorToJson(error)});
});
}
diff --git a/ext/fg/js/frontend-api-sender.js b/ext/fg/js/frontend-api-sender.js
index c6eeaeb2..af998a8f 100644
--- a/ext/fg/js/frontend-api-sender.js
+++ b/ext/fg/js/frontend-api-sender.js
@@ -78,7 +78,7 @@ class FrontendApiSender {
}
onAck(id) {
- if (!this.callbacks.hasOwnProperty(id)) {
+ if (!hasOwn(this.callbacks, id)) {
console.warn(`ID ${id} not found for ack`);
return;
}
@@ -95,7 +95,7 @@ class FrontendApiSender {
}
onResult(id, data) {
- if (!this.callbacks.hasOwnProperty(id)) {
+ if (!hasOwn(this.callbacks, id)) {
console.warn(`ID ${id} not found`);
return;
}
@@ -118,7 +118,7 @@ class FrontendApiSender {
}
onError(id, reason) {
- if (!this.callbacks.hasOwnProperty(id)) { return; }
+ if (!hasOwn(this.callbacks, id)) { return; }
const info = this.callbacks[id];
delete this.callbacks[id];
info.timer = null;
diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js
index 6002dfcb..9a1d507b 100644
--- a/ext/fg/js/frontend.js
+++ b/ext/fg/js/frontend.js
@@ -80,7 +80,7 @@ class Frontend {
onMouseMove(e) {
this.popupTimerClear();
- if (this.pendingLookup || Frontend.isMouseButtonDown('primary', e)) {
+ if (this.pendingLookup || DOM.isMouseButtonDown(e, 'primary')) {
return;
}
@@ -88,7 +88,7 @@ class Frontend {
const scanningModifier = scanningOptions.modifier;
if (!(
Frontend.isScanningModifierPressed(scanningModifier, e) ||
- (scanningOptions.middleMouse && Frontend.isMouseButtonDown('auxiliary', e))
+ (scanningOptions.middleMouse && DOM.isMouseButtonDown(e, 'auxiliary'))
)) {
return;
}
@@ -122,7 +122,7 @@ class Frontend {
}
}
- onMouseOut(e) {
+ onMouseOut() {
this.popupTimerClear();
}
@@ -135,7 +135,7 @@ class Frontend {
}
}
- onAuxClick(e) {
+ onAuxClick() {
this.preventNextContextMenu = false;
}
@@ -159,7 +159,7 @@ class Frontend {
this.preventNextClick = false;
const primaryTouch = e.changedTouches[0];
- if (Frontend.selectionContainsPoint(window.getSelection(), primaryTouch.clientX, primaryTouch.clientY)) {
+ if (DOM.isPointInSelection(primaryTouch.clientX, primaryTouch.clientY, window.getSelection())) {
return;
}
@@ -237,7 +237,7 @@ class Frontend {
onWindowMessage(e) {
const action = e.data;
const handlers = Frontend.windowMessageHandlers;
- if (handlers.hasOwnProperty(action)) {
+ if (hasOwn(handlers, action)) {
const handler = handlers[action];
handler(this);
}
@@ -245,7 +245,7 @@ class Frontend {
onRuntimeMessage({action, params}, sender, callback) {
const handlers = Frontend.runtimeMessageHandlers;
- if (handlers.hasOwnProperty(action)) {
+ if (hasOwn(handlers, action)) {
const handler = handlers[action];
const result = handler(this, params);
callback(result);
@@ -398,7 +398,7 @@ class Frontend {
textSource.getRect(),
textSource.getWritingMode(),
type,
- {definitions, context: {sentence, url, focus}}
+ {definitions, context: {sentence, url, focus, disableHistory: true}}
);
this.textSourceCurrent = textSource;
@@ -447,8 +447,8 @@ class Frontend {
}
getIndexOfTouch(touchList, identifier) {
- for (let i in touchList) {
- let t = touchList[i];
+ for (const i in touchList) {
+ const t = touchList[i];
if (t.identifier === identifier) {
return i;
}
@@ -456,18 +456,6 @@ class Frontend {
return -1;
}
- static selectionContainsPoint(selection, x, y) {
- for (let i = 0; i < selection.rangeCount; ++i) {
- const range = selection.getRangeAt(i);
- for (const rect of range.getClientRects()) {
- if (x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom) {
- return true;
- }
- }
- }
- return false;
- }
-
setTextSourceScanLength(textSource, length) {
textSource.setEndOffset(length);
if (this.ignoreNodes === null || !textSource.range) {
@@ -499,37 +487,6 @@ class Frontend {
default: return false;
}
}
-
- static isMouseButton(button, mouseEvent) {
- switch (mouseEvent.type) {
- case 'mouseup':
- case 'mousedown':
- case 'click':
- return Frontend.isMouseButtonPressed(button, mouseEvent);
- default:
- return Frontend.isMouseButtonDown(button, mouseEvent);
- }
- }
-
- static isMouseButtonPressed(button, mouseEvent) {
- const mouseEventButton = mouseEvent.button;
- switch (button) {
- case 'primary': return mouseEventButton === 0;
- case 'secondary': return mouseEventButton === 2;
- case 'auxiliary': return mouseEventButton === 1;
- default: return false;
- }
- }
-
- static isMouseButtonDown(button, mouseEvent) {
- const mouseEventButtons = mouseEvent.buttons;
- switch (button) {
- case 'primary': return (mouseEventButtons & 0x1) !== 0x0;
- case 'secondary': return (mouseEventButtons & 0x2) !== 0x0;
- case 'auxiliary': return (mouseEventButtons & 0x4) !== 0x0;
- default: return false;
- }
- }
}
Frontend.windowMessageHandlers = {
diff --git a/ext/fg/js/popup-proxy-host.js b/ext/fg/js/popup-proxy-host.js
index d8dec4df..b2f18b97 100644
--- a/ext/fg/js/popup-proxy-host.js
+++ b/ext/fg/js/popup-proxy-host.js
@@ -50,7 +50,7 @@ class PopupProxyHost {
}
createPopup(parentId, depth) {
- const parent = (typeof parentId === 'string' && this.popups.hasOwnProperty(parentId) ? this.popups[parentId] : null);
+ const parent = (typeof parentId === 'string' && hasOwn(this.popups, parentId) ? this.popups[parentId] : null);
const id = `${this.nextId}`;
if (parent !== null) {
depth = parent.depth + 1;
@@ -70,7 +70,7 @@ class PopupProxyHost {
}
getPopup(id) {
- if (!this.popups.hasOwnProperty(id)) {
+ if (!hasOwn(this.popups, id)) {
throw new Error('Invalid popup ID');
}
diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js
index ac96f9e8..42475d96 100644
--- a/ext/fg/js/popup.js
+++ b/ext/fg/js/popup.js
@@ -28,8 +28,8 @@ class Popup {
this.childrenSupported = true;
this.container = document.createElement('iframe');
this.container.className = 'yomichan-float';
- this.container.addEventListener('mousedown', e => e.stopPropagation());
- this.container.addEventListener('scroll', e => e.stopPropagation());
+ this.container.addEventListener('mousedown', (e) => e.stopPropagation());
+ this.container.addEventListener('scroll', (e) => e.stopPropagation());
this.container.setAttribute('src', chrome.runtime.getURL('/fg/float.html'));
this.container.style.width = '0px';
this.container.style.height = '0px';
@@ -303,7 +303,7 @@ class Popup {
}
static getColorInfo(cssColor) {
- const m = /^\s*rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d\.]+)\s*)?\)\s*$/.exec(cssColor);
+ const m = /^\s*rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+)\s*)?\)\s*$/.exec(cssColor);
if (m === null) { return null; }
const m4 = m[4];
@@ -401,7 +401,7 @@ class Popup {
if (Popup.outerStylesheet === null) {
if (!css) { return; }
Popup.outerStylesheet = document.createElement('style');
- Popup.outerStylesheet.id = "yomichan-popup-outer-stylesheet";
+ Popup.outerStylesheet.id = 'yomichan-popup-outer-stylesheet';
}
const outerStylesheet = Popup.outerStylesheet;
diff --git a/ext/fg/js/source.js b/ext/fg/js/source.js
index 5be521fa..a84feed4 100644
--- a/ext/fg/js/source.js
+++ b/ext/fg/js/source.js
@@ -99,9 +99,9 @@ class TextSourceRange {
static getRubyElement(node) {
node = TextSourceRange.getParentElement(node);
- if (node !== null && node.nodeName.toUpperCase() === "RT") {
+ if (node !== null && node.nodeName.toUpperCase() === 'RT') {
node = node.parentNode;
- return (node !== null && node.nodeName.toUpperCase() === "RUBY") ? node : null;
+ return (node !== null && node.nodeName.toUpperCase() === 'RUBY') ? node : null;
}
return null;
}
@@ -361,7 +361,7 @@ class TextSourceElement {
let consumed = 0;
let content = '';
- for (let currentChar of this.content || '') {
+ for (const currentChar of this.content || '') {
if (consumed >= length) {
break;
} else if (!currentChar.match(IGNORE_TEXT_PATTERN)) {
@@ -375,7 +375,7 @@ class TextSourceElement {
return this.content.length;
}
- setStartOffset(length) {
+ setStartOffset() {
return 0;
}
diff --git a/ext/fg/js/util.js b/ext/fg/js/util.js
deleted file mode 100644
index 9a7968a7..00000000
--- a/ext/fg/js/util.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2016-2017 Alex Yatskov <alex@foosoft.net>
- * Author: Alex Yatskov <alex@foosoft.net>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-
-function utilAsync(func) {
- return function(...args) {
- func.apply(this, args);
- };
-}
-
-function utilInvoke(action, params={}) {
- const data = {action, params};
- return new Promise((resolve, reject) => {
- try {
- chrome.runtime.sendMessage(data, (response) => {
- utilCheckLastError(chrome.runtime.lastError);
- if (response !== null && typeof response === 'object') {
- if (typeof response.error !== 'undefined') {
- reject(jsonToError(response.error));
- } else {
- resolve(response.result);
- }
- } else {
- const message = response === null ? 'Unexpected null response' : `Unexpected response of type ${typeof response}`;
- reject(new Error(`${message} (${JSON.stringify(data)})`));
- }
- });
- } catch (e) {
- window.yomichan_orphaned = true;
- reject(e);
- }
- });
-}
-
-function utilCheckLastError(e) {
- // NOP
-}
diff --git a/ext/manifest.json b/ext/manifest.json
index 4d75cd54..dc670633 100644
--- a/ext/manifest.json
+++ b/ext/manifest.json
@@ -18,13 +18,13 @@
"content_scripts": [{
"matches": ["http://*/*", "https://*/*", "file://*/*"],
"js": [
- "mixed/js/extension.js",
+ "mixed/js/core.js",
+ "mixed/js/dom.js",
"fg/js/api.js",
"fg/js/document.js",
"fg/js/frontend-api-receiver.js",
"fg/js/popup.js",
"fg/js/source.js",
- "fg/js/util.js",
"fg/js/popup-proxy-host.js",
"fg/js/frontend.js",
"fg/js/frontend-initialize.js"
diff --git a/ext/mixed/css/display.css b/ext/mixed/css/display.css
index ba2fadb7..9152216f 100644
--- a/ext/mixed/css/display.css
+++ b/ext/mixed/css/display.css
@@ -72,6 +72,19 @@ ol, ul {
visibility: hidden;
}
+/*
+ * Navigation
+ */
+
+.term-navigation {
+ position: fixed;
+ top: 0px;
+}
+
+.term-button-fade {
+ opacity: 0.4;
+}
+
/*
* Search page
@@ -107,7 +120,7 @@ html:root[data-yomichan-page=search] body {
*/
.entry, .note {
- padding-top: 10px;
+ padding-top: 20px;
padding-bottom: 10px;
}
diff --git a/ext/mixed/js/audio.js b/ext/mixed/js/audio.js
index 4e9d04fa..35f283a4 100644
--- a/ext/mixed/js/audio.js
+++ b/ext/mixed/js/audio.js
@@ -68,7 +68,7 @@ class TextToSpeechAudio {
}
static createFromUri(ttsUri) {
- const m = /^tts:[^#\?]*\?([^#]*)/.exec(ttsUri);
+ const m = /^tts:[^#?]*\?([^#]*)/.exec(ttsUri);
if (m === null) { return null; }
const searchParameters = {};
@@ -113,7 +113,7 @@ function audioGetFromUrl(url, willDownload) {
async function audioGetFromSources(expression, sources, optionsContext, willDownload, cache=null) {
const key = `${expression.expression}:${expression.reading}`;
- if (cache !== null && cache.hasOwnProperty(expression)) {
+ if (cache !== null && hasOwn(cache, expression)) {
return cache[key];
}
diff --git a/ext/mixed/js/extension.js b/ext/mixed/js/core.js
index 12ed9c1f..b5911535 100644
--- a/ext/mixed/js/extension.js
+++ b/ext/mixed/js/core.js
@@ -17,27 +17,11 @@
*/
-// toIterable is required on Edge for cross-window origin objects.
-function toIterable(value) {
- if (typeof Symbol !== 'undefined' && typeof value[Symbol.iterator] !== 'undefined') {
- return value;
- }
-
- if (value !== null && typeof value === 'object') {
- const length = value.length;
- if (typeof length === 'number' && Number.isFinite(length)) {
- const array = [];
- for (let i = 0; i < length; ++i) {
- array.push(value[i]);
- }
- return array;
- }
- }
-
- throw new Error('Could not convert to iterable');
-}
+/*
+ * Extension information
+ */
-function extensionHasChrome() {
+function _extensionHasChrome() {
try {
return typeof chrome === 'object' && chrome !== null;
} catch (e) {
@@ -45,7 +29,7 @@ function extensionHasChrome() {
}
}
-function extensionHasBrowser() {
+function _extensionHasBrowser() {
try {
return typeof browser === 'object' && browser !== null;
} catch (e) {
@@ -53,6 +37,21 @@ function extensionHasBrowser() {
}
}
+const EXTENSION_IS_BROWSER_EDGE = (
+ _extensionHasBrowser() &&
+ (!_extensionHasChrome() || (typeof chrome.runtime === 'undefined' && typeof browser.runtime !== 'undefined'))
+);
+
+if (EXTENSION_IS_BROWSER_EDGE) {
+ // Edge does not have chrome defined.
+ chrome = browser;
+}
+
+
+/*
+ * Error handling
+ */
+
function errorToJson(error) {
return {
name: error.name,
@@ -86,16 +85,44 @@ function logError(error, alert) {
}
}
-const EXTENSION_IS_BROWSER_EDGE = (
- extensionHasBrowser() &&
- (!extensionHasChrome() || (typeof chrome.runtime === 'undefined' && typeof browser.runtime !== 'undefined'))
-);
-if (EXTENSION_IS_BROWSER_EDGE) {
- // Edge does not have chrome defined.
- chrome = browser;
+/*
+ * Common helpers
+ */
+
+function isObject(value) {
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
+}
+
+function hasOwn(object, property) {
+ return Object.prototype.hasOwnProperty.call(object, property);
}
+// toIterable is required on Edge for cross-window origin objects.
+function toIterable(value) {
+ if (typeof Symbol !== 'undefined' && typeof value[Symbol.iterator] !== 'undefined') {
+ return value;
+ }
+
+ if (value !== null && typeof value === 'object') {
+ const length = value.length;
+ if (typeof length === 'number' && Number.isFinite(length)) {
+ const array = [];
+ for (let i = 0; i < length; ++i) {
+ array.push(value[i]);
+ }
+ return array;
+ }
+ }
+
+ throw new Error('Could not convert to iterable');
+}
+
+
+/*
+ * Async utilities
+ */
+
function promiseTimeout(delay, resolveValue) {
if (delay <= 0) {
return Promise.resolve(resolveValue);
@@ -146,5 +173,5 @@ function stringReplaceAsync(str, regex, replacer) {
return Promise.resolve(str);
}
parts.push(str.substring(index));
- return Promise.all(parts).then(v => v.join(''));
+ return Promise.all(parts).then((v) => v.join(''));
}
diff --git a/ext/mixed/js/display-context.js b/ext/mixed/js/display-context.js
new file mode 100644
index 00000000..4b399881
--- /dev/null
+++ b/ext/mixed/js/display-context.js
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2019 Alex Yatskov <alex@foosoft.net>
+ * Author: Alex Yatskov <alex@foosoft.net>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+class DisplayContext {
+ constructor(type, definitions, context) {
+ this.type = type;
+ this.definitions = definitions;
+ this.context = context;
+ }
+
+ get(key) {
+ return this.context[key];
+ }
+
+ set(key, value) {
+ this.context[key] = value;
+ }
+
+ update(data) {
+ Object.assign(this.context, data);
+ }
+
+ get previous() {
+ return this.context.previous;
+ }
+
+ get next() {
+ return this.context.next;
+ }
+
+ static push(self, type, definitions, context) {
+ const newContext = new DisplayContext(type, definitions, context);
+ if (self !== null) {
+ newContext.update({previous: self});
+ self.update({next: newContext});
+ }
+ return newContext;
+ }
+}
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index f231fab5..c32852ad 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -42,7 +42,7 @@ class Display {
this.setInteractive(true);
}
- onError(error) {
+ onError(_error) {
throw new Error('Override me');
}
@@ -55,26 +55,24 @@ class Display {
this.sourceTermView();
}
+ onNextTermView(e) {
+ e.preventDefault();
+ this.nextTermView();
+ }
+
async onKanjiLookup(e) {
try {
e.preventDefault();
if (!this.context) { return; }
const link = e.target;
- this.windowScroll.toY(0);
+ this.context.update({
+ index: this.entryIndexFind(link),
+ scroll: this.windowScroll.y
+ });
const context = {
- source: {
- type: 'terms',
- details: {
- definitions: this.definitions,
- context: Object.assign({}, this.context, {
- index: this.entryIndexFind(link),
- scroll: this.windowScroll.y
- })
- }
- },
- sentence: this.context.sentence,
- url: this.context.url
+ sentence: this.context.get('sentence'),
+ url: this.context.get('url')
};
const definitions = await apiKanjiFind(link.textContent, this.getOptionsContext());
@@ -85,17 +83,17 @@ class Display {
}
onGlossaryMouseDown(e) {
- if (Frontend.isMouseButtonPressed('primary', e)) {
+ if (DOM.isMouseButtonPressed(e, 'primary')) {
this.clickScanPrevent = false;
}
}
- onGlossaryMouseMove(e) {
+ onGlossaryMouseMove() {
this.clickScanPrevent = true;
}
onGlossaryMouseUp(e) {
- if (!this.clickScanPrevent && Frontend.isMouseButtonPressed('primary', e)) {
+ if (!this.clickScanPrevent && DOM.isMouseButtonPressed(e, 'primary')) {
this.onTermLookup(e);
}
}
@@ -103,6 +101,7 @@ class Display {
async onTermLookup(e, {disableScroll, selectText, disableHistory}={}) {
try {
if (!this.context) { return; }
+
const termLookupResults = await this.termLookup(e);
if (!termLookupResults) { return; }
const {textSource, definitions} = termLookupResults;
@@ -110,25 +109,26 @@ class Display {
const scannedElement = e.target;
const sentence = docSentenceExtract(textSource, this.options.anki.sentenceExt);
- if (!disableScroll) {
- this.windowScroll.toY(0);
- }
-
+ this.context.update({
+ index: this.entryIndexFind(scannedElement),
+ scroll: this.windowScroll.y
+ });
const context = {
- source: disableHistory ? this.context.source : {
- type: 'terms',
- details: {
- definitions: this.definitions,
- context: Object.assign({}, this.context, {
- index: this.entryIndexFind(scannedElement),
- scroll: this.windowScroll.y
- })
- }
- },
disableScroll,
+ disableHistory,
sentence,
- url: this.context.url
+ url: this.context.get('url')
};
+ if (disableHistory) {
+ Object.assign(context, {
+ previous: this.context.previous,
+ next: this.context.next
+ });
+ } else {
+ Object.assign(context, {
+ previous: this.context
+ });
+ }
this.setContentTerms(definitions, context);
@@ -194,7 +194,7 @@ class Display {
onKeyDown(e) {
const key = Display.getKeyFromEvent(e);
const handlers = Display.onKeyDownHandlers;
- if (handlers.hasOwnProperty(key)) {
+ if (hasOwn(handlers, key)) {
const handler = handlers[key];
if (handler(this, e)) {
e.preventDefault();
@@ -206,9 +206,17 @@ class Display {
onWheel(e) {
if (e.altKey) {
- const delta = e.deltaY;
- if (delta !== 0) {
- this.entryScrollIntoView(this.index + (delta > 0 ? 1 : -1), null, true);
+ if (e.deltaY !== 0) {
+ this.entryScrollIntoView(this.index + (e.deltaY > 0 ? 1 : -1), null, true);
+ e.preventDefault();
+ }
+ } else if (e.shiftKey) {
+ const delta = -e.deltaX || e.deltaY;
+ if (delta > 0) {
+ this.sourceTermView();
+ e.preventDefault();
+ } else if (delta < 0) {
+ this.nextTermView();
e.preventDefault();
}
}
@@ -216,7 +224,7 @@ class Display {
onRuntimeMessage({action, params}, sender, callback) {
const handlers = Display.runtimeMessageHandlers;
- if (handlers.hasOwnProperty(action)) {
+ if (hasOwn(handlers, action)) {
const handler = handlers[action];
const result = handler(this, params);
callback(result);
@@ -292,6 +300,7 @@ class Display {
this.addEventListeners('.action-play-audio', 'click', this.onAudioPlay.bind(this));
this.addEventListeners('.kanji-link', 'click', this.onKanjiLookup.bind(this));
this.addEventListeners('.source-term', 'click', this.onSourceTermView.bind(this));
+ this.addEventListeners('.next-term', 'click', this.onNextTermView.bind(this));
if (this.options.scanning.enablePopupSearch) {
this.addEventListeners('.glossary-item', 'mouseup', this.onGlossaryMouseUp.bind(this));
this.addEventListeners('.glossary-item', 'mousedown', this.onGlossaryMouseDown.bind(this));
@@ -335,12 +344,18 @@ class Display {
}
this.definitions = definitions;
- this.context = context;
+ if (context.disableHistory) {
+ delete context.disableHistory;
+ this.context = new DisplayContext('terms', definitions, context);
+ } else {
+ this.context = DisplayContext.push(this.context, 'terms', definitions, context);
+ }
const sequence = ++this.sequence;
const params = {
definitions,
- source: context.source,
+ source: this.context.previous,
+ next: this.context.next,
addable: options.anki.enable,
grouped: options.general.resultOutputMode === 'group',
merged: options.general.resultOutputMode === 'merge',
@@ -359,6 +374,9 @@ class Display {
const {index, scroll, disableScroll} = context;
if (!disableScroll) {
this.entryScrollIntoView(index || 0, scroll);
+ } else {
+ delete context.disableScroll;
+ this.entrySetCurrent(index || 0);
}
if (options.audio.enabled && options.audio.autoPlay) {
@@ -387,12 +405,18 @@ class Display {
}
this.definitions = definitions;
- this.context = context;
+ if (context.disableHistory) {
+ delete context.disableHistory;
+ this.context = new DisplayContext('kanji', definitions, context);
+ } else {
+ this.context = DisplayContext.push(this.context, 'kanji', definitions, context);
+ }
const sequence = ++this.sequence;
const params = {
definitions,
- source: context.source,
+ source: this.context.previous,
+ next: this.context.next,
addable: options.anki.enable,
debug: options.general.debugInfo
};
@@ -464,7 +488,7 @@ class Display {
}
}
- entryScrollIntoView(index, scroll, smooth) {
+ entrySetCurrent(index) {
index = Math.min(index, this.definitions.length - 1);
index = Math.max(index, 0);
@@ -478,13 +502,20 @@ class Display {
entry.classList.add('entry-current');
}
+ this.index = index;
+
+ return entry;
+ }
+
+ entryScrollIntoView(index, scroll, smooth) {
this.windowScroll.stop();
- let target;
- if (scroll) {
+ const entry = this.entrySetCurrent(index);
+ let target;
+ if (scroll !== null) {
target = scroll;
} else {
- target = index === 0 || entry === null ? 0 : Display.getElementTop(entry);
+ target = this.index === 0 || entry === null ? 0 : Display.getElementTop(entry);
}
if (smooth) {
@@ -492,14 +523,36 @@ class Display {
} else {
this.windowScroll.toY(target);
}
-
- this.index = index;
}
sourceTermView() {
- if (!this.context || !this.context.source) { return; }
- const {type, details} = this.context.source;
- this.setContent(type, details);
+ if (!this.context || !this.context.previous) { return; }
+ this.context.update({
+ index: this.index,
+ scroll: this.windowScroll.y
+ });
+ const previousContext = this.context.previous;
+ previousContext.set('disableHistory', true);
+ const details = {
+ definitions: previousContext.definitions,
+ context: previousContext.context
+ };
+ this.setContent(previousContext.type, details);
+ }
+
+ nextTermView() {
+ if (!this.context || !this.context.next) { return; }
+ this.context.update({
+ index: this.index,
+ scroll: this.windowScroll.y
+ });
+ const nextContext = this.context.next;
+ nextContext.set('disableHistory', true);
+ const details = {
+ definitions: nextContext.definitions,
+ context: nextContext.context
+ };
+ this.setContent(nextContext.type, details);
}
noteTryAdd(mode) {
@@ -574,7 +627,7 @@ class Display {
if (button !== null) {
let titleDefault = button.dataset.titleDefault;
if (!titleDefault) {
- titleDefault = button.title || "";
+ titleDefault = button.title || '';
button.dataset.titleDefault = titleDefault;
}
button.title = `${titleDefault}\n${info}`;
@@ -770,6 +823,14 @@ Display.onKeyDownHandlers = {
return false;
},
+ 'F': (self, e) => {
+ if (e.altKey) {
+ self.nextTermView();
+ return true;
+ }
+ return false;
+ },
+
'E': (self, e) => {
if (e.altKey) {
self.noteTryAdd('term-kanji');
diff --git a/ext/mixed/js/dom.js b/ext/mixed/js/dom.js
new file mode 100644
index 00000000..4e4d49e3
--- /dev/null
+++ b/ext/mixed/js/dom.js
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2019 Alex Yatskov <alex@foosoft.net>
+ * Author: Alex Yatskov <alex@foosoft.net>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+class DOM {
+ static isPointInRect(x, y, rect) {
+ return (
+ x >= rect.left && x < rect.right &&
+ y >= rect.top && y < rect.bottom
+ );
+ }
+
+ static isPointInAnyRect(x, y, rects) {
+ for (const rect of rects) {
+ if (DOM.isPointInRect(x, y, rect)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ static isPointInSelection(x, y, selection) {
+ for (let i = 0; i < selection.rangeCount; ++i) {
+ const range = selection.getRangeAt(i);
+ if (DOM.isPointInAnyRect(x, y, range.getClientRects())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ static isMouseButtonPressed(mouseEvent, button) {
+ const mouseEventButton = mouseEvent.button;
+ switch (button) {
+ case 'primary': return mouseEventButton === 0;
+ case 'secondary': return mouseEventButton === 2;
+ case 'auxiliary': return mouseEventButton === 1;
+ default: return false;
+ }
+ }
+
+ static isMouseButtonDown(mouseEvent, button) {
+ const mouseEventButtons = mouseEvent.buttons;
+ switch (button) {
+ case 'primary': return (mouseEventButtons & 0x1) !== 0x0;
+ case 'secondary': return (mouseEventButtons & 0x2) !== 0x0;
+ case 'auxiliary': return (mouseEventButtons & 0x4) !== 0x0;
+ default: return false;
+ }
+ }
+}
diff --git a/ext/mixed/js/japanese.js b/ext/mixed/js/japanese.js
index a7cd0452..8b841b2e 100644
--- a/ext/mixed/js/japanese.js
+++ b/ext/mixed/js/japanese.js
@@ -91,8 +91,9 @@ function jpDistributeFurigana(expression, reading) {
return fallback;
}
+ let isAmbiguous = false;
const segmentize = (reading, groups) => {
- if (groups.length === 0) {
+ if (groups.length === 0 || isAmbiguous) {
return [];
}
@@ -106,14 +107,25 @@ function jpDistributeFurigana(expression, reading) {
}
}
} else {
+ let foundSegments = null;
for (let i = reading.length; i >= group.text.length; --i) {
const readingUsed = reading.substring(0, i);
const readingLeft = reading.substring(i);
const segs = segmentize(readingLeft, groups.slice(1));
if (segs) {
- return [{text: group.text, furigana: readingUsed}].concat(segs);
+ if (foundSegments !== null) {
+ // more than one way to segmentize the tail, mark as ambiguous
+ isAmbiguous = true;
+ return null;
+ }
+ foundSegments = [{text: group.text, furigana: readingUsed}].concat(segs);
+ }
+ // there is only one way to segmentize the last non-kana group
+ if (groups.length === 1) {
+ break;
}
}
+ return foundSegments;
}
};
@@ -129,7 +141,11 @@ function jpDistributeFurigana(expression, reading) {
}
}
- return segmentize(reading, groups) || fallback;
+ const segments = segmentize(reading, groups);
+ if (segments && !isAmbiguous) {
+ return segments;
+ }
+ return fallback;
}
function jpDistributeFuriganaInflected(expression, reading, source) {
diff --git a/ext/mixed/lib/wanakana.min.js b/ext/mixed/lib/wanakana.min.js
index bfc36d56..07b0d976 100644
--- a/ext/mixed/lib/wanakana.min.js
+++ b/ext/mixed/lib/wanakana.min.js
@@ -1 +1,2 @@
-!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(e.wanakana=e.wanakana||{})}(this,function(e){"use strict";function n(e){return"string"!=typeof e||!e.length}function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments[1],a=arguments[2];if(n(e))return!1;var r=e.charCodeAt(0);return r>=t&&a>=r}function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return[].concat(le(e)).map(function(e,n){var a=e.charCodeAt(0),r=t(e,re,oe),o=t(e,ie,ue);return r?String.fromCharCode(a-re+V):o?String.fromCharCode(a-ie+W):e}).join("")}function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=1>=arguments.length||void 0===arguments[1]||arguments[1];if(n(e))return!1;var a=t?/[bcdfghjklmnpqrstvwxyz]/:/[bcdfghjklmnpqrstvwxz]/;return-1!==e.toLowerCase().charAt(0).search(a)}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!n(e)&&t(e,W,Y)}function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Math.min(e,n)}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments[2];return e.slice(n,t)}function y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=1>=arguments.length||void 0===arguments[1]||arguments[1];if(n(e))return!1;var a=t?/[aeiouy]/:/[aeiou]/;return-1!==e.toLowerCase().charAt(0).search(a)}function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!n(e)&&e.charCodeAt(0)===ye}function h(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!n(e)&&e.charCodeAt(0)===ce}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!n(e)&&(!!c(e)||t(e,Z,$))}function f(){var e=[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split("").forEach(function(n){if(c(n)||h(n))e.push(n);else if(s(n)){var t=n.charCodeAt(0)+(ee-Z),a=String.fromCharCode(t);e.push(a)}else e.push(n)}),e.join("")}function d(){return t(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",ee,ne)}function v(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!n(e)&&(s(e)||d(e))}function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!n(e)&&[].concat(le(e)).every(v)}function g(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=Object.assign({},X,n),h=[],s=0,d=e.length,v=3,g="",w="";d>s;){var p=null;for(v=i(3,d-s);v>0;){if(g=u(e,s,s+v),w=g.toLowerCase(),se.includes(w)&&d-s>=4)w=(g=u(e,s,s+(v+=1))).toLowerCase();else{if("n"===w.charAt(0)){if(2===v){if(!c.IMEMode&&" "===w.charAt(1)){p="ん ";break}if(c.IMEMode&&"n'"===w){p="ん";break}}r(w.charAt(1),!1)&&y(w.charAt(2))&&(w=(g=u(e,s,s+(v=1))).toLowerCase())}"n"!==w.charAt(0)&&r(w.charAt(0))&&g.charAt(0)===g.charAt(1)&&(v=1,t(g.charAt(0),W,Y)?(w="ッ",g="ッ"):(w="っ",g="っ"))}if(null!=(p=fe[w]))break;v-=4===v?2:1}null==p&&(p=g),c.useObsoleteKana&&("wi"===w&&(p="ゐ"),"we"===w&&(p="ゑ")),c.IMEMode&&"n"===w.charAt(0)&&("y"===e.charAt(s+1).toLowerCase()&&!1===y(e.charAt(s+2))||s===d-1||l(e.charAt(s+1)))&&(p=g.charAt(0)),a||o(g.charAt(0))&&(p=f(p)),h.push(p),s+=v||1}return h.join("")}function w(e){var n=m(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});if(e instanceof Element&&ge.includes(e.nodeName)){var t=be();e.setAttribute("data-wanakana-id",t),e.autocapitalize="none",e.addEventListener("compositionupdate",b),e.addEventListener("input",n),we=k(n,t)}else console.warn("Input provided to wanakana.bind was not a valid input field.")}function p(e){var n=j(e);null!=n?(e.removeAttribute("data-wanakana-id"),e.removeEventListener("compositionupdate",b),e.removeEventListener("input",n.handler),we=A(n)):console.warn("Input had no listener registered.")}function m(e){var n=Object.assign({},X,e);return function(e){var t=e.target;if(me)me=!1;else{var r=a(t.value),o=g(x(r,n.IMEMode),Object.assign({},n,{IMEMode:!0}));if(r!==o){if(t.value=o,null!=t.setSelectionRange&&"number"==typeof t.selectionStart)return void t.setSelectionRange(t.value.length,t.value.length);if(null!=t.createTextRange){t.focus();var i=t.createTextRange();i.collapse(!1),i.select()}}}}}function b(e){var n=e.data||e.detail&&e.detail.data,t=n&&n.slice(-2).split("")||[],o="n"===t[0],i=t.every(function(e){return r(a(e))});me=!o&&i}function k(e,n){return we.concat({id:n,handler:e})}function j(e){return e&&we.find(function(n){return n.id===e.getAttribute("data-wanakana-id")})}function A(e){var n=e.id;return we.filter(function(e){return e.id!==n})}function x(e,n){switch(!0){case"toHiragana"===n:return e.toLowerCase();case"toKatakana"===n:return e.toUpperCase();default:return e}}function q(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!n(e)&&F.test(e)}function C(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!n(e)&&[].concat(le(e)).every(function(e){return q(e)})}function z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!n(e)&&[].concat(le(e)).every(function(e){return B.test(e)})}function E(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!n(e)&&[].concat(le(e)).every(s)}function M(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!n(e)&&[].concat(le(e)).every(d)}function K(){return t(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",te,ae)}function L(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!n(e)&&[].concat(le(e)).every(K)}function O(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{passKanji:!0},t=[].concat(le(e)),a=!1;return n.passKanji||(a=t.some(L)),(t.some(E)||t.some(M))&&t.some(C)&&!a}function I(){for(var e=[],n="",t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(""),a=0;t.length>a;a+=1){var r=t[a],o=[h(r),c(r)],i=o[0],u=o[1];if(i||u&&1>a)e.push(r);else if(u&&a>0){var y=de[n].slice(-1);e.push(he[y])}else if(d(r)){var s=r.charCodeAt(0)+(Z-ee),f=String.fromCharCode(s);e.push(f),n=f}else e.push(r),n=""}return e.join("")}function R(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=Object.assign({},X,n),a=e.length,r=[],o=0,y=2,c="",h="",s=void 0;a>o;){y=i(2,a-o);for(var f=!1;y>0;){if(c=u(e,o,o+y),M(c)&&(f=t.upcaseKatakana,c=I(c)),"っ"===c.charAt(0)&&1===y&&a-1>o){s=!0,h="";break}if(null!=(h=de[c])&&s&&(h=h.charAt(0).concat(h),s=!1),null!=h)break;y-=1}null==h&&(h=c),f&&(h=h.toUpperCase()),r.push(h),o+=y||1}return r.join("")}function S(){return g(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},!0)}function T(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=Object.assign({},X,n);return t.passRomaji?I(e):C(e)?S(e,t):O(e,{passKanji:!0})?S(I(e),t):I(e)}function H(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=Object.assign({},X,n);return f(t.passRomaji?e:C(e)||O(e)?S(e,t):e)}function P(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!n(e)&&G.some(function(n){var a=ve(n,2);return t(e,a[0],a[1])})}function U(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Q.some(function(n){var a=ve(n,2);return t(e,a[0],a[1])})}function D(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!n(e)&&(P(e)||U(e))}function N(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{all:!1};if(n(e)||!z(e)||l(e))return e;var a=[].concat(le(e));if(t.all)return a.filter(function(e){return!v(e)}).join("");for(var r=a.reverse(),o=0,i=r.length;i>o;o+=1){var u=r[o];if(!D(u)){if(L(u))break;r[o]=""}}return r.reverse().join("")}function _(e){switch(!0){case U(e):return"japanesePunctuation";case K(e):return"kanji";case s(e):return"hiragana";case d(e):return"katakana";default:return"romaji"}}function J(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(n(e))return[""];var t=[].concat(le(e)),a=t.shift(),r=_(a);return t.reduce(function(e,n){var t=_(n)===r;if(r=_(n),t){var a=e.pop();return e.concat(a.concat(n))}return e.concat(n)},[a])}var X={useObsoleteKana:!1,passRomaji:!1,upcaseKatakana:!1,IMEMode:!1},B=/[\u3000-\u303f\u3040-\u309f\u30a0-\u30ff\uff01-\uff0f\u4e00-\u9faf\u3400-\u4dbf]/,F=/[\u0000-\u007f\u0100-\u0101\u0112-\u0113\u012a-\u012b\u014c-\u014d\u016a-\u016b\u2018-\u2019\u201C-\u201D]/,G=[[33,47],[58,63],[91,96],[123,126],[8216,8217],[8220,8221]],Q=[[12289,12350],[12539,12540],[65281,65295],[65306,65311],[65339,65343],[65371,65376]],V=97,W=65,Y=90,Z=12353,$=12438,ee=12449,ne=12540,te=19968,ae=40879,re=65345,oe=65370,ie=65313,ue=65338,ye=12540,ce=12539,he={a:"あ",i:"い",u:"う",e:"え",o:"う"},se=["lts","chy","shy"],fe={".":"。",",":"、",":":":","/":"・","!":"!","?":"?","~":"〜","-":"ー","‘":"「","’":"」","“":"『","”":"』","[":"[","]":"]","(":"(",")":")","{":"{","}":"}",a:"あ",i:"い",u:"う",e:"え",o:"お",yi:"い",wu:"う",whu:"う",xa:"ぁ",xi:"ぃ",xu:"ぅ",xe:"ぇ",xo:"ぉ",xyi:"ぃ",xye:"ぇ",ye:"いぇ",wha:"うぁ",whi:"うぃ",whe:"うぇ",who:"うぉ",wi:"うぃ",we:"うぇ",va:"ゔぁ",vi:"ゔぃ",vu:"ゔ",ve:"ゔぇ",vo:"ゔぉ",vya:"ゔゃ",vyi:"ゔぃ",vyu:"ゔゅ",vye:"ゔぇ",vyo:"ゔょ",ka:"か",ki:"き",ku:"く",ke:"け",ko:"こ",lka:"ヵ",lke:"ヶ",xka:"ヵ",xke:"ヶ",kya:"きゃ",kyi:"きぃ",kyu:"きゅ",kye:"きぇ",kyo:"きょ",ca:"か",ci:"き",cu:"く",ce:"け",co:"こ",lca:"ヵ",lce:"ヶ",xca:"ヵ",xce:"ヶ",qya:"くゃ",qyu:"くゅ",qyo:"くょ",qwa:"くぁ",qwi:"くぃ",qwu:"くぅ",qwe:"くぇ",qwo:"くぉ",qa:"くぁ",qi:"くぃ",qe:"くぇ",qo:"くぉ",kwa:"くぁ",qyi:"くぃ",qye:"くぇ",ga:"が",gi:"ぎ",gu:"ぐ",ge:"げ",go:"ご",gya:"ぎゃ",gyi:"ぎぃ",gyu:"ぎゅ",gye:"ぎぇ",gyo:"ぎょ",gwa:"ぐぁ",gwi:"ぐぃ",gwu:"ぐぅ",gwe:"ぐぇ",gwo:"ぐぉ",sa:"さ",si:"し",shi:"し",su:"す",se:"せ",so:"そ",za:"ざ",zi:"じ",zu:"ず",ze:"ぜ",zo:"ぞ",ji:"じ",sya:"しゃ",syi:"しぃ",syu:"しゅ",sye:"しぇ",syo:"しょ",sha:"しゃ",shu:"しゅ",she:"しぇ",sho:"しょ",shya:"しゃ",shyu:"しゅ",shye:"しぇ",shyo:"しょ",swa:"すぁ",swi:"すぃ",swu:"すぅ",swe:"すぇ",swo:"すぉ",zya:"じゃ",zyi:"じぃ",zyu:"じゅ",zye:"じぇ",zyo:"じょ",ja:"じゃ",ju:"じゅ",je:"じぇ",jo:"じょ",jya:"じゃ",jyi:"じぃ",jyu:"じゅ",jye:"じぇ",jyo:"じょ",ta:"た",ti:"ち",tu:"つ",te:"て",to:"と",chi:"ち",tsu:"つ",ltu:"っ",xtu:"っ",tya:"ちゃ",tyi:"ちぃ",tyu:"ちゅ",tye:"ちぇ",tyo:"ちょ",cha:"ちゃ",chu:"ちゅ",che:"ちぇ",cho:"ちょ",cya:"ちゃ",cyi:"ちぃ",cyu:"ちゅ",cye:"ちぇ",cyo:"ちょ",chya:"ちゃ",chyu:"ちゅ",chye:"ちぇ",chyo:"ちょ",tsa:"つぁ",tsi:"つぃ",tse:"つぇ",tso:"つぉ",tha:"てゃ",thi:"てぃ",thu:"てゅ",the:"てぇ",tho:"てょ",twa:"とぁ",twi:"とぃ",twu:"とぅ",twe:"とぇ",two:"とぉ",da:"だ",di:"ぢ",du:"づ",de:"で",do:"ど",dya:"ぢゃ",dyi:"ぢぃ",dyu:"ぢゅ",dye:"ぢぇ",dyo:"ぢょ",dha:"でゃ",dhi:"でぃ",dhu:"でゅ",dhe:"でぇ",dho:"でょ",dwa:"どぁ",dwi:"どぃ",dwu:"どぅ",dwe:"どぇ",dwo:"どぉ",na:"な",ni:"に",nu:"ぬ",ne:"ね",no:"の",nya:"にゃ",nyi:"にぃ",nyu:"にゅ",nye:"にぇ",nyo:"にょ",ha:"は",hi:"ひ",hu:"ふ",he:"へ",ho:"ほ",fu:"ふ",hya:"ひゃ",hyi:"ひぃ",hyu:"ひゅ",hye:"ひぇ",hyo:"ひょ",fya:"ふゃ",fyu:"ふゅ",fyo:"ふょ",fwa:"ふぁ",fwi:"ふぃ",fwu:"ふぅ",fwe:"ふぇ",fwo:"ふぉ",fa:"ふぁ",fi:"ふぃ",fe:"ふぇ",fo:"ふぉ",fyi:"ふぃ",fye:"ふぇ",ba:"ば",bi:"び",bu:"ぶ",be:"べ",bo:"ぼ",bya:"びゃ",byi:"びぃ",byu:"びゅ",bye:"びぇ",byo:"びょ",pa:"ぱ",pi:"ぴ",pu:"ぷ",pe:"ぺ",po:"ぽ",pya:"ぴゃ",pyi:"ぴぃ",pyu:"ぴゅ",pye:"ぴぇ",pyo:"ぴょ",ma:"ま",mi:"み",mu:"む",me:"め",mo:"も",mya:"みゃ",myi:"みぃ",myu:"みゅ",mye:"みぇ",myo:"みょ",ya:"や",yu:"ゆ",yo:"よ",xya:"ゃ",xyu:"ゅ",xyo:"ょ",ra:"ら",ri:"り",ru:"る",re:"れ",ro:"ろ",rya:"りゃ",ryi:"りぃ",ryu:"りゅ",rye:"りぇ",ryo:"りょ",la:"ら",li:"り",lu:"る",le:"れ",lo:"ろ",lya:"りゃ",lyi:"りぃ",lyu:"りゅ",lye:"りぇ",lyo:"りょ",wa:"わ",wo:"を",lwe:"ゎ",xwa:"ゎ",n:"ん",nn:"ん","n'":"ん","n ":"ん",xn:"ん",ltsu:"っ"},de={" ":" ","!":"!","?":"?","。":".",":":":","・":"/","、":",","〜":"~","ー":"-","「":"‘","」":"’","『":"“","』":"”","[":"[","]":"]","(":"(",")":")","{":"{","}":"}","あ":"a","い":"i","う":"u","え":"e","お":"o","ゔぁ":"va","ゔぃ":"vi","ゔ":"vu","ゔぇ":"ve","ゔぉ":"vo","か":"ka","き":"ki","きゃ":"kya","きぃ":"kyi","きゅ":"kyu","く":"ku","け":"ke","こ":"ko","が":"ga","ぎ":"gi","ぐ":"gu","げ":"ge","ご":"go","ぎゃ":"gya","ぎぃ":"gyi","ぎゅ":"gyu","ぎぇ":"gye","ぎょ":"gyo","さ":"sa","す":"su","せ":"se","そ":"so","ざ":"za","ず":"zu","ぜ":"ze","ぞ":"zo","し":"shi","しゃ":"sha","しゅ":"shu","しょ":"sho","じ":"ji","じゃ":"ja","じゅ":"ju","じょ":"jo","た":"ta","ち":"chi","ちゃ":"cha","ちゅ":"chu","ちょ":"cho","つ":"tsu","て":"te","と":"to","だ":"da","ぢ":"di","づ":"du","で":"de","ど":"do","な":"na","に":"ni","にゃ":"nya","にゅ":"nyu","にょ":"nyo","ぬ":"nu","ね":"ne","の":"no","は":"ha","ひ":"hi","ふ":"fu","へ":"he","ほ":"ho","ひゃ":"hya","ひゅ":"hyu","ひょ":"hyo","ふぁ":"fa","ふぃ":"fi","ふぇ":"fe","ふぉ":"fo","ば":"ba","び":"bi","ぶ":"bu","べ":"be","ぼ":"bo","びゃ":"bya","びゅ":"byu","びょ":"byo","ぱ":"pa","ぴ":"pi","ぷ":"pu","ぺ":"pe","ぽ":"po","ぴゃ":"pya","ぴゅ":"pyu","ぴょ":"pyo","ま":"ma","み":"mi","む":"mu","め":"me","も":"mo","みゃ":"mya","みゅ":"myu","みょ":"myo","や":"ya","ゆ":"yu","よ":"yo","ら":"ra","り":"ri","る":"ru","れ":"re","ろ":"ro","りゃ":"rya","りゅ":"ryu","りょ":"ryo","わ":"wa","を":"wo","ん":"n","ゐ":"wi","ゑ":"we","きぇ":"kye","きょ":"kyo","じぃ":"jyi","じぇ":"jye","ちぃ":"cyi","ちぇ":"che","ひぃ":"hyi","ひぇ":"hye","びぃ":"byi","びぇ":"bye","ぴぃ":"pyi","ぴぇ":"pye","みぇ":"mye","みぃ":"myi","りぃ":"ryi","りぇ":"rye","にぃ":"nyi","にぇ":"nye","しぃ":"syi","しぇ":"she","いぇ":"ye","うぁ":"wha","うぉ":"who","うぃ":"wi","うぇ":"we","ゔゃ":"vya","ゔゅ":"vyu","ゔょ":"vyo","すぁ":"swa","すぃ":"swi","すぅ":"swu","すぇ":"swe","すぉ":"swo","くゃ":"qya","くゅ":"qyu","くょ":"qyo","くぁ":"qwa","くぃ":"qwi","くぅ":"qwu","くぇ":"qwe","くぉ":"qwo","ぐぁ":"gwa","ぐぃ":"gwi","ぐぅ":"gwu","ぐぇ":"gwe","ぐぉ":"gwo","つぁ":"tsa","つぃ":"tsi","つぇ":"tse","つぉ":"tso","てゃ":"tha","てぃ":"thi","てゅ":"thu","てぇ":"the","てょ":"tho","とぁ":"twa","とぃ":"twi","とぅ":"twu","とぇ":"twe","とぉ":"two","ぢゃ":"dya","ぢぃ":"dyi","ぢゅ":"dyu","ぢぇ":"dye","ぢょ":"dyo","でゃ":"dha","でぃ":"dhi","でゅ":"dhu","でぇ":"dhe","でょ":"dho","どぁ":"dwa","どぃ":"dwi","どぅ":"dwu","どぇ":"dwe","どぉ":"dwo","ふぅ":"fwu","ふゃ":"fya","ふゅ":"fyu","ふょ":"fyo","ぁ":"a","ぃ":"i","ぇ":"e","ぅ":"u","ぉ":"o","ゃ":"ya","ゅ":"yu","ょ":"yo","っ":"","ゕ":"ka","ゖ":"ka","ゎ":"wa","んあ":"n'a","んい":"n'i","んう":"n'u","んえ":"n'e","んお":"n'o","んや":"n'ya","んゆ":"n'yu","んよ":"n'yo"},ve=function(){function e(e,n){var t=[],a=!0,r=!1,o=void 0;try{for(var i,u=e[Symbol.iterator]();!(a=(i=u.next()).done)&&(t.push(i.value),!n||t.length!==n);a=!0);}catch(e){r=!0,o=e}finally{try{!a&&u.return&&u.return()}finally{if(r)throw o}}return t}return function(n,t){if(Array.isArray(n))return n;if(Symbol.iterator in Object(n))return e(n,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),le=function(e){if(Array.isArray(e)){for(var n=0,t=Array(e.length);e.length>n;n++)t[n]=e[n];return t}return Array.from(e)},ge=["TEXTAREA","INPUT"],we=[],pe=0,me=!1,be=function(){return pe+=1,""+Date.now()+pe};e.bind=w,e.unbind=p,e.isRomaji=C,e.isJapanese=z,e.isKana=l,e.isHiragana=E,e.isKatakana=M,e.isMixed=O,e.isKanji=L,e.toRomaji=R,e.toKana=g,e.toHiragana=T,e.toKatakana=H,e.stripOkurigana=N,e.tokenize=J,Object.defineProperty(e,"__esModule",{value:!0})});
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.wanakana={})}(this,function(t){"use strict";var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(t,e){return t(e={exports:{}},e.exports),e.exports}var r=n(function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)}),o=Object.freeze({default:r,__moduleExports:r}),i=n(function(t){var e=t.exports={version:"2.5.5"};"number"==typeof __e&&(__e=e)}),u=Object.freeze({default:i,__moduleExports:i,version:i.version}),a=function(t){return"object"==typeof t?null!==t:"function"==typeof t},c=Object.freeze({default:a,__moduleExports:a}),f=c&&a||c,s=function(t){if(!f(t))throw TypeError(t+" is not an object!");return t},l=Object.freeze({default:s,__moduleExports:s}),h=function(t){try{return!!t()}catch(t){return!0}},d=Object.freeze({default:h,__moduleExports:h}),v=d&&h||d,p=!v(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),y=Object.freeze({default:p,__moduleExports:p}),g=o&&r||o,_=g.document,m=f(_)&&f(_.createElement),b=function(t){return m?_.createElement(t):{}},E=Object.freeze({default:b,__moduleExports:b}),O=y&&p||y,j=E&&b||E,w=!O&&!v(function(){return 7!=Object.defineProperty(j("div"),"a",{get:function(){return 7}}).a}),x=Object.freeze({default:w,__moduleExports:w}),S=function(t,e){if(!f(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!f(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!f(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!f(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},A=Object.freeze({default:S,__moduleExports:S}),M=l&&s||l,z=x&&w||x,N=A&&S||A,P=Object.defineProperty,k=O?Object.defineProperty:function(t,e,n){if(M(t),e=N(e,!0),M(n),z)try{return P(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t},L={f:k},F=Object.freeze({default:L,__moduleExports:L,f:k}),I=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},R=Object.freeze({default:I,__moduleExports:I}),T=F&&L||F,C=R&&I||R,W=O?function(t,e,n){return T.f(t,e,C(1,n))}:function(t,e,n){return t[e]=n,t},U=Object.freeze({default:W,__moduleExports:W}),K={}.hasOwnProperty,B=function(t,e){return K.call(t,e)},D=Object.freeze({default:B,__moduleExports:B}),V=0,G=Math.random(),J=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++V+G).toString(36))},H=Object.freeze({default:J,__moduleExports:J}),Y=U&&W||U,q=D&&B||D,X=H&&J||H,$=u&&i||u,Q=n(function(t){var e=X("src"),n=Function.toString,r=(""+n).split("toString");$.inspectSource=function(t){return n.call(t)},(t.exports=function(t,n,o,i){var u="function"==typeof o;u&&(q(o,"name")||Y(o,"name",n)),t[n]!==o&&(u&&(q(o,e)||Y(o,e,t[n]?""+t[n]:r.join(n+""))),t===g?t[n]=o:i?t[n]?t[n]=o:Y(t,n,o):(delete t[n],Y(t,n,o)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[e]||n.call(this)})}),Z=Object.freeze({default:Q,__moduleExports:Q}),tt=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t},et=Object.freeze({default:tt,__moduleExports:tt}),nt=et&&tt||et,rt=function(t,e,n){if(nt(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}},ot=Object.freeze({default:rt,__moduleExports:rt}),it=Z&&Q||Z,ut=ot&&rt||ot,at=function(t,e,n){var r,o,i,u,a=t&at.F,c=t&at.G,f=t&at.P,s=t&at.B,l=c?g:t&at.S?g[e]||(g[e]={}):(g[e]||{}).prototype,h=c?$:$[e]||($[e]={}),d=h.prototype||(h.prototype={});for(r in c&&(n=e),n)i=((o=!a&&l&&void 0!==l[r])?l:n)[r],u=s&&o?ut(i,g):f&&"function"==typeof i?ut(Function.call,i):i,l&&it(l,r,i,t&at.U),h[r]!=i&&Y(h,r,u),f&&d[r]!=i&&(d[r]=i)};g.core=$,at.F=1,at.G=2,at.S=4,at.P=8,at.B=16,at.W=32,at.U=64,at.R=128;for(var ct,ft=at,st=Object.freeze({default:ft,__moduleExports:ft}),lt=X("typed_array"),ht=X("view"),dt=!(!g.ArrayBuffer||!g.DataView),vt=dt,pt=0,yt="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");9>pt;)(ct=g[yt[pt++]])?(Y(ct.prototype,lt,!0),Y(ct.prototype,ht,!0)):vt=!1;var gt={ABV:dt,CONSTR:vt,TYPED:lt,VIEW:ht},_t=Object.freeze({default:gt,__moduleExports:gt,ABV:gt.ABV,CONSTR:gt.CONSTR,TYPED:gt.TYPED,VIEW:gt.VIEW}),mt=Object.freeze({default:!1,__moduleExports:!1}),bt=function(t,e,n){for(var r in e)it(t,r,e[r],n);return t},Et=Object.freeze({default:bt,__moduleExports:bt}),Ot=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t},jt=Object.freeze({default:Ot,__moduleExports:Ot}),wt=Math.ceil,xt=Math.floor,St=function(t){return isNaN(t=+t)?0:(t>0?xt:wt)(t)},At=Object.freeze({default:St,__moduleExports:St}),Mt=At&&St||At,zt=Math.min,Nt=function(t){return t>0?zt(Mt(t),9007199254740991):0},Pt=Object.freeze({default:Nt,__moduleExports:Nt}),kt=Pt&&Nt||Pt,Lt=function(t){if(void 0===t)return 0;var e=Mt(t),n=kt(e);if(e!==n)throw RangeError("Wrong length!");return n},Ft=Object.freeze({default:Lt,__moduleExports:Lt}),It={}.toString,Rt=function(t){return It.call(t).slice(8,-1)},Tt=Object.freeze({default:Rt,__moduleExports:Rt}),Ct=Tt&&Rt||Tt,Wt=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==Ct(t)?t.split(""):Object(t)},Ut=Object.freeze({default:Wt,__moduleExports:Wt}),Kt=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t},Bt=Object.freeze({default:Kt,__moduleExports:Kt}),Dt=Ut&&Wt||Ut,Vt=Bt&&Kt||Bt,Gt=function(t){return Dt(Vt(t))},Jt=Object.freeze({default:Gt,__moduleExports:Gt}),Ht=Math.max,Yt=Math.min,qt=function(t,e){return 0>(t=Mt(t))?Ht(t+e,0):Yt(t,e)},Xt=Object.freeze({default:qt,__moduleExports:qt}),$t=Jt&&Gt||Jt,Qt=Xt&&qt||Xt,Zt=function(t){return function(e,n,r){var o,i=$t(e),u=kt(i.length),a=Qt(r,u);if(t&&n!=n){for(;u>a;)if((o=i[a++])!=o)return!0}else for(;u>a;a++)if((t||a in i)&&i[a]===n)return t||a||0;return!t&&-1}},te=Object.freeze({default:Zt,__moduleExports:Zt}),ee=g["__core-js_shared__"]||(g["__core-js_shared__"]={}),ne=function(t){return ee[t]||(ee[t]={})},re=Object.freeze({default:ne,__moduleExports:ne}),oe=re&&ne||re,ie=oe("keys"),ue=function(t){return ie[t]||(ie[t]=X(t))},ae=Object.freeze({default:ue,__moduleExports:ue}),ce=te&&Zt||te,fe=ae&&ue||ae,se=ce(!1),le=fe("IE_PROTO"),he=function(t,e){var n,r=$t(t),o=0,i=[];for(n in r)n!=le&&q(r,n)&&i.push(n);for(;e.length>o;)q(r,n=e[o++])&&(~se(i,n)||i.push(n));return i},de=Object.freeze({default:he,__moduleExports:he}),ve="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),pe=Object.freeze({default:ve,__moduleExports:ve}),ye=de&&he||de,ge=pe&&ve||pe,_e=ge.concat("length","prototype"),me=Object.getOwnPropertyNames||function(t){return ye(t,_e)},be={f:me},Ee=Object.freeze({default:be,__moduleExports:be,f:me}),Oe=function(t){return Object(Vt(t))},je=Object.freeze({default:Oe,__moduleExports:Oe}),we=je&&Oe||je,xe=function(t){for(var e=we(this),n=kt(e.length),r=arguments.length,o=Qt(r>1?arguments[1]:void 0,n),i=r>2?arguments[2]:void 0,u=void 0===i?n:Qt(i,n);u>o;)e[o++]=t;return e},Se=Object.freeze({default:xe,__moduleExports:xe}),Ae=n(function(t){var e=oe("wks"),n=g.Symbol,r="function"==typeof n;(t.exports=function(t){return e[t]||(e[t]=r&&n[t]||(r?n:X)("Symbol."+t))}).store=e}),Me=Object.freeze({default:Ae,__moduleExports:Ae}),ze=Me&&Ae||Me,Ne=T.f,Pe=ze("toStringTag"),ke=function(t,e,n){t&&!q(t=n?t:t.prototype,Pe)&&Ne(t,Pe,{configurable:!0,value:e})},Le=Object.freeze({default:ke,__moduleExports:ke}),Fe=mt,Ie=_t&&gt||_t,Re=Et&&bt||Et,Te=jt&&Ot||jt,Ce=Ft&&Lt||Ft,We=Ee&&be||Ee,Ue=Se&&xe||Se,Ke=Le&&ke||Le,Be=n(function(t,e){var n=We.f,r=T.f,o="prototype",i="Wrong index!",u=g.ArrayBuffer,a=g.DataView,c=g.Math,f=g.RangeError,s=g.Infinity,l=u,h=c.abs,d=c.pow,p=c.floor,y=c.log,_=c.LN2,m=O?"_b":"buffer",b=O?"_l":"byteLength",E=O?"_o":"byteOffset";function j(t,e,n){var r,o,i,u=Array(n),a=8*n-e-1,c=(1<<a)-1,f=c>>1,l=23===e?d(2,-24)-d(2,-77):0,v=0,g=0>t||0===t&&0>1/t?1:0;for((t=h(t))!=t||t===s?(o=t!=t?1:0,r=c):(r=p(y(t)/_),1>t*(i=d(2,-r))&&(r--,i*=2),2>(t+=1>r+f?l*d(2,1-f):l/i)*i||(r++,i/=2),c>r+f?1>r+f?(o=t*d(2,f-1)*d(2,e),r=0):(o=(t*i-1)*d(2,e),r+=f):(o=0,r=c));e>=8;u[v++]=255&o,o/=256,e-=8);for(r=r<<e|o,a+=e;a>0;u[v++]=255&r,r/=256,a-=8);return u[--v]|=128*g,u}function w(t,e,n){var r,o=8*n-e-1,i=(1<<o)-1,u=i>>1,a=o-7,c=n-1,f=t[c--],l=127&f;for(f>>=7;a>0;l=256*l+t[c],c--,a-=8);for(r=l&(1<<-a)-1,l>>=-a,a+=e;a>0;r=256*r+t[c],c--,a-=8);if(0===l)l=1-u;else{if(l===i)return r?NaN:f?-s:s;r+=d(2,e),l-=u}return(f?-1:1)*r*d(2,l-e)}function x(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]}function S(t){return[255&t]}function A(t){return[255&t,t>>8&255]}function M(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function z(t){return j(t,52,8)}function N(t){return j(t,23,4)}function P(t,e,n){r(t[o],e,{get:function(){return this[n]}})}function k(t,e,n,r){var o=Ce(+n);if(o+e>t[b])throw f(i);var u=o+t[E],a=t[m]._b.slice(u,u+e);return r?a:a.reverse()}function L(t,e,n,r,o,u){var a=Ce(+n);if(a+e>t[b])throw f(i);for(var c=t[m]._b,s=a+t[E],l=r(+o),h=0;e>h;h++)c[s+h]=l[u?h:e-h-1]}if(Ie.ABV){if(!v(function(){u(1)})||!v(function(){new u(-1)})||v(function(){return new u,new u(1.5),new u(NaN),"ArrayBuffer"!=u.name})){for(var F,I=(u=function(t){return Te(this,u),new l(Ce(t))})[o]=l[o],R=n(l),C=0;R.length>C;)(F=R[C++])in u||Y(u,F,l[F]);Fe||(I.constructor=u)}var W=new a(new u(2)),U=a[o].setInt8;W.setInt8(0,2147483648),W.setInt8(1,2147483649),!W.getInt8(0)&&W.getInt8(1)||Re(a[o],{setInt8:function(t,e){U.call(this,t,e<<24>>24)},setUint8:function(t,e){U.call(this,t,e<<24>>24)}},!0)}else u=function(t){Te(this,u,"ArrayBuffer");var e=Ce(t);this._b=Ue.call(Array(e),0),this[b]=e},a=function(t,e,n){Te(this,a,"DataView"),Te(t,u,"DataView");var r=t[b],o=Mt(e);if(0>o||o>r)throw f("Wrong offset!");if(o+(n=void 0===n?r-o:kt(n))>r)throw f("Wrong length!");this[m]=t,this[E]=o,this[b]=n},O&&(P(u,"byteLength","_l"),P(a,"buffer","_b"),P(a,"byteLength","_l"),P(a,"byteOffset","_o")),Re(a[o],{getInt8:function(t){return k(this,1,t)[0]<<24>>24},getUint8:function(t){return k(this,1,t)[0]},getInt16:function(t){var e=k(this,2,t,arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=k(this,2,t,arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return x(k(this,4,t,arguments[1]))},getUint32:function(t){return x(k(this,4,t,arguments[1]))>>>0},getFloat32:function(t){return w(k(this,4,t,arguments[1]),23,4)},getFloat64:function(t){return w(k(this,8,t,arguments[1]),52,8)},setInt8:function(t,e){L(this,1,t,S,e)},setUint8:function(t,e){L(this,1,t,S,e)},setInt16:function(t,e){L(this,2,t,A,e,arguments[2])},setUint16:function(t,e){L(this,2,t,A,e,arguments[2])},setInt32:function(t,e){L(this,4,t,M,e,arguments[2])},setUint32:function(t,e){L(this,4,t,M,e,arguments[2])},setFloat32:function(t,e){L(this,4,t,N,e,arguments[2])},setFloat64:function(t,e){L(this,8,t,z,e,arguments[2])}});Ke(u,"ArrayBuffer"),Ke(a,"DataView"),Y(a[o],Ie.VIEW,!0),e.ArrayBuffer=u,e.DataView=a}),De=Object.freeze({default:Be,__moduleExports:Be}),Ve=ze("species"),Ge=function(t,e){var n,r=M(t).constructor;return void 0===r||void 0==(n=M(r)[Ve])?e:nt(n)},Je=Object.freeze({default:Ge,__moduleExports:Ge}),He=ze("species"),Ye=function(t){var e=g[t];O&&e&&!e[He]&&T.f(e,He,{configurable:!0,get:function(){return this}})},qe=Object.freeze({default:Ye,__moduleExports:Ye}),Xe=st&&ft||st,$e=De&&Be||De,Qe=Je&&Ge||Je,Ze=qe&&Ye||qe,tn=g.ArrayBuffer,en=$e.ArrayBuffer,nn=$e.DataView,rn=Ie.ABV&&tn.isView,on=en.prototype.slice,un=Ie.VIEW;Xe(Xe.G+Xe.W+Xe.F*(tn!==en),{ArrayBuffer:en}),Xe(Xe.S+Xe.F*!Ie.CONSTR,"ArrayBuffer",{isView:function(t){return rn&&rn(t)||f(t)&&un in t}}),Xe(Xe.P+Xe.U+Xe.F*v(function(){return!new en(2).slice(1,void 0).byteLength}),"ArrayBuffer",{slice:function(t,e){if(void 0!==on&&void 0===e)return on.call(M(this),t);for(var n=M(this).byteLength,r=Qt(t,n),o=Qt(void 0===e?n:e,n),i=new(Qe(this,en))(kt(o-r)),u=new nn(this),a=new nn(i),c=0;o>r;)a.setUint8(c++,u.getUint8(r++));return i}}),Ze("ArrayBuffer");var an=ze("toStringTag"),cn="Arguments"==Ct(function(){return arguments}()),fn=function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),an))?n:cn?Ct(e):"Object"==(r=Ct(e))&&"function"==typeof e.callee?"Arguments":r},sn=Object.freeze({default:fn,__moduleExports:fn}),ln={},hn=Object.freeze({default:ln,__moduleExports:ln}),dn=hn&&ln||hn,vn=ze("iterator"),pn=Array.prototype,yn=function(t){return void 0!==t&&(dn.Array===t||pn[vn]===t)},gn=Object.freeze({default:yn,__moduleExports:yn}),_n=Object.keys||function(t){return ye(t,ge)},mn=Object.freeze({default:_n,__moduleExports:_n}),bn=mn&&_n||mn,En=O?Object.defineProperties:function(t,e){M(t);for(var n,r=bn(e),o=r.length,i=0;o>i;)T.f(t,n=r[i++],e[n]);return t},On=Object.freeze({default:En,__moduleExports:En}),jn=g.document,wn=jn&&jn.documentElement,xn=Object.freeze({default:wn,__moduleExports:wn}),Sn=On&&En||On,An=xn&&wn||xn,Mn=fe("IE_PROTO"),zn=function(){},Nn=function(){var t,e=j("iframe"),n=ge.length;for(e.style.display="none",An.appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),Nn=t.F;n--;)delete Nn.prototype[ge[n]];return Nn()},Pn=Object.create||function(t,e){var n;return null!==t?(zn.prototype=M(t),n=new zn,zn.prototype=null,n[Mn]=t):n=Nn(),void 0===e?n:Sn(n,e)},kn=Object.freeze({default:Pn,__moduleExports:Pn}),Ln=fe("IE_PROTO"),Fn=Object.prototype,In=Object.getPrototypeOf||function(t){return t=we(t),q(t,Ln)?t[Ln]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?Fn:null},Rn=Object.freeze({default:In,__moduleExports:In}),Tn=sn&&fn||sn,Cn=ze("iterator"),Wn=$.getIteratorMethod=function(t){if(void 0!=t)return t[Cn]||t["@@iterator"]||dn[Tn(t)]},Un=Object.freeze({default:Wn,__moduleExports:Wn}),Kn=Array.isArray||function(t){return"Array"==Ct(t)},Bn=Object.freeze({default:Kn,__moduleExports:Kn}),Dn=Bn&&Kn||Bn,Vn=ze("species"),Gn=function(t){var e;return Dn(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!Dn(e.prototype)||(e=void 0),f(e)&&null===(e=e[Vn])&&(e=void 0)),void 0===e?Array:e},Jn=Object.freeze({default:Gn,__moduleExports:Gn}),Hn=Jn&&Gn||Jn,Yn=function(t,e){return new(Hn(t))(e)},qn=Object.freeze({default:Yn,__moduleExports:Yn}),Xn=qn&&Yn||qn,$n=function(t,e){var n=1==t,r=2==t,o=3==t,i=4==t,u=6==t,a=5==t||u,c=e||Xn;return function(e,f,s){for(var l,h,d=we(e),v=Dt(d),p=ut(f,s,3),y=kt(v.length),g=0,_=n?c(e,y):r?c(e,0):void 0;y>g;g++)if((a||g in v)&&(h=p(l=v[g],g,d),t))if(n)_[g]=h;else if(h)switch(t){case 3:return!0;case 5:return l;case 6:return g;case 2:_.push(l)}else if(i)return!1;return u?-1:o||i?i:_}},Qn=Object.freeze({default:$n,__moduleExports:$n}),Zn=ze("unscopables"),tr=Array.prototype;void 0==tr[Zn]&&Y(tr,Zn,{});var er=function(t){tr[Zn][t]=!0},nr=Object.freeze({default:er,__moduleExports:er}),rr=function(t,e){return{value:e,done:!!t}},or=Object.freeze({default:rr,__moduleExports:rr}),ir=kn&&Pn||kn,ur={};Y(ur,ze("iterator"),function(){return this});var ar=function(t,e,n){t.prototype=ir(ur,{next:C(1,n)}),Ke(t,e+" Iterator")},cr=Object.freeze({default:ar,__moduleExports:ar}),fr=cr&&ar||cr,sr=Rn&&In||Rn,lr=ze("iterator"),hr=!([].keys&&"next"in[].keys()),dr=function(){return this},vr=function(t,e,n,r,o,i,u){fr(n,e,r);var a,c,f,s=function(t){if(!hr&&t in v)return v[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},l=e+" Iterator",h="values"==o,d=!1,v=t.prototype,p=v[lr]||v["@@iterator"]||o&&v[o],y=p||s(o),g=o?h?s("entries"):y:void 0,_="Array"==e&&v.entries||p;if(_&&(f=sr(_.call(new t)))!==Object.prototype&&f.next&&(Ke(f,l,!0),Fe||"function"==typeof f[lr]||Y(f,lr,dr)),h&&p&&"values"!==p.name&&(d=!0,y=function(){return p.call(this)}),Fe&&!u||!hr&&!d&&v[lr]||Y(v,lr,y),dn[e]=y,dn[l]=dr,o)if(a={values:h?y:s("values"),keys:i?y:s("keys"),entries:g},u)for(c in a)c in v||it(v,c,a[c]);else Xe(Xe.P+Xe.F*(hr||d),e,a);return a},pr=Object.freeze({default:vr,__moduleExports:vr}),yr=nr&&er||nr,gr=or&&rr||or,_r=pr&&vr||pr,mr=_r(Array,"Array",function(t,e){this._t=$t(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return t&&t.length>n?gr(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]]):(this._t=void 0,gr(1))},"values");dn.Arguments=dn.Array,yr("keys"),yr("values"),yr("entries");var br=ze("iterator"),Er=!1;try{[7][br]().return=function(){Er=!0}}catch(t){}var Or=function(t,e){if(!e&&!Er)return!1;var n=!1;try{var r=[7],o=r[br]();o.next=function(){return{done:n=!0}},r[br]=function(){return o},t(r)}catch(t){}return n},jr=Object.freeze({default:Or,__moduleExports:Or}),wr=[].copyWithin||function(t,e){var n=we(this),r=kt(n.length),o=Qt(t,r),i=Qt(e,r),u=arguments.length>2?arguments[2]:void 0,a=Math.min((void 0===u?r:Qt(u,r))-i,r-o),c=1;for(o>i&&i+a>o&&(c=-1,i+=a-1,o+=a-1);a-- >0;)i in n?n[o]=n[i]:delete n[o],o+=c,i+=c;return n},xr=Object.freeze({default:wr,__moduleExports:wr}),Sr={}.propertyIsEnumerable,Ar={f:Sr},Mr=Object.freeze({default:Ar,__moduleExports:Ar,f:Sr}),zr=Mr&&Ar||Mr,Nr=Object.getOwnPropertyDescriptor,Pr=O?Nr:function(t,e){if(t=$t(t),e=N(e,!0),z)try{return Nr(t,e)}catch(t){}if(q(t,e))return C(!zr.f.call(t,e),t[e])},kr={f:Pr},Lr=Object.freeze({default:kr,__moduleExports:kr,f:Pr}),Fr=gn&&yn||gn,Ir=Un&&Wn||Un,Rr=Qn&&$n||Qn,Tr=jr&&Or||jr,Cr=xr&&wr||xr,Wr=Lr&&kr||Lr,Ur=n(function(t){if(O){var e=Fe,n=g,r=v,o=Xe,i=Ie,u=ut,a=Te,c=C,s=Y,l=Re,h=Mt,d=kt,p=Ce,y=Qt,_=N,m=q,b=Tn,E=f,j=we,w=Fr,x=ir,S=sr,A=We.f,M=Ir,z=X,P=ze,k=Rr,L=ce,F=Qe,I=mr,R=dn,W=Tr,U=Ze,K=Ue,B=Cr,D=T,V=Wr,G=D.f,J=V.f,H=n.RangeError,$=n.TypeError,Q=n.Uint8Array,Z=Array.prototype,tt=$e.ArrayBuffer,et=$e.DataView,nt=k(0),rt=k(2),ot=k(3),it=k(4),at=k(5),ct=k(6),ft=L(!0),st=L(!1),lt=I.values,ht=I.keys,dt=I.entries,vt=Z.lastIndexOf,pt=Z.reduce,yt=Z.reduceRight,gt=Z.join,_t=Z.sort,mt=Z.slice,bt=Z.toString,Et=Z.toLocaleString,Ot=P("iterator"),jt=P("toStringTag"),wt=z("typed_constructor"),xt=z("def_constructor"),St=i.CONSTR,At=i.TYPED,zt=i.VIEW,Nt=k(1,function(t,e){return Rt(F(t,t[xt]),e)}),Pt=r(function(){return 1===new Q(new Uint16Array([1]).buffer)[0]}),Lt=!!Q&&!!Q.prototype.set&&r(function(){new Q(1).set({})}),Ft=function(t,e){var n=h(t);if(0>n||n%e)throw H("Wrong offset!");return n},It=function(t){if(E(t)&&At in t)return t;throw $(t+" is not a typed array!")},Rt=function(t,e){if(!(E(t)&&wt in t))throw $("It is not a typed array constructor!");return new t(e)},Tt=function(t,e){return Ct(F(t,t[xt]),e)},Ct=function(t,e){for(var n=0,r=e.length,o=Rt(t,r);r>n;)o[n]=e[n++];return o},Wt=function(t,e,n){G(t,e,{get:function(){return this._d[n]}})},Ut=function(t){var e,n,r,o,i,a,c=j(t),f=arguments.length,s=f>1?arguments[1]:void 0,l=void 0!==s,h=M(c);if(void 0!=h&&!w(h)){for(a=h.call(c),r=[],e=0;!(i=a.next()).done;e++)r.push(i.value);c=r}for(l&&f>2&&(s=u(s,arguments[2],2)),e=0,n=d(c.length),o=Rt(this,n);n>e;e++)o[e]=l?s(c[e],e):c[e];return o},Kt=function(){for(var t=0,e=arguments.length,n=Rt(this,e);e>t;)n[t]=arguments[t++];return n},Bt=!!Q&&r(function(){Et.call(new Q(1))}),Dt=function(){return Et.apply(Bt?mt.call(It(this)):It(this),arguments)},Vt={copyWithin:function(t,e){return B.call(It(this),t,e,arguments.length>2?arguments[2]:void 0)},every:function(t){return it(It(this),t,arguments.length>1?arguments[1]:void 0)},fill:function(t){return K.apply(It(this),arguments)},filter:function(t){return Tt(this,rt(It(this),t,arguments.length>1?arguments[1]:void 0))},find:function(t){return at(It(this),t,arguments.length>1?arguments[1]:void 0)},findIndex:function(t){return ct(It(this),t,arguments.length>1?arguments[1]:void 0)},forEach:function(t){nt(It(this),t,arguments.length>1?arguments[1]:void 0)},indexOf:function(t){return st(It(this),t,arguments.length>1?arguments[1]:void 0)},includes:function(t){return ft(It(this),t,arguments.length>1?arguments[1]:void 0)},join:function(t){return gt.apply(It(this),arguments)},lastIndexOf:function(t){return vt.apply(It(this),arguments)},map:function(t){return Nt(It(this),t,arguments.length>1?arguments[1]:void 0)},reduce:function(t){return pt.apply(It(this),arguments)},reduceRight:function(t){return yt.apply(It(this),arguments)},reverse:function(){for(var t,e=It(this).length,n=Math.floor(e/2),r=0;n>r;)t=this[r],this[r++]=this[--e],this[e]=t;return this},some:function(t){return ot(It(this),t,arguments.length>1?arguments[1]:void 0)},sort:function(t){return _t.call(It(this),t)},subarray:function(t,e){var n=It(this),r=n.length,o=y(t,r);return new(F(n,n[xt]))(n.buffer,n.byteOffset+o*n.BYTES_PER_ELEMENT,d((void 0===e?r:y(e,r))-o))}},Gt=function(t,e){return Tt(this,mt.call(It(this),t,e))},Jt=function(t){It(this);var e=Ft(arguments[1],1),n=this.length,r=j(t),o=d(r.length),i=0;if(o+e>n)throw H("Wrong length!");for(;o>i;)this[e+i]=r[i++]},Ht={entries:function(){return dt.call(It(this))},keys:function(){return ht.call(It(this))},values:function(){return lt.call(It(this))}},Yt=function(t,e){return E(t)&&t[At]&&"symbol"!=typeof e&&e in t&&+e+""==e+""},qt=function(t,e){return Yt(t,e=_(e,!0))?c(2,t[e]):J(t,e)},Xt=function(t,e,n){return!(Yt(t,e=_(e,!0))&&E(n)&&m(n,"value"))||m(n,"get")||m(n,"set")||n.configurable||m(n,"writable")&&!n.writable||m(n,"enumerable")&&!n.enumerable?G(t,e,n):(t[e]=n.value,t)};St||(V.f=qt,D.f=Xt),o(o.S+o.F*!St,"Object",{getOwnPropertyDescriptor:qt,defineProperty:Xt}),r(function(){bt.call({})})&&(bt=Et=function(){return gt.call(this)});var $t=l({},Vt);l($t,Ht),s($t,Ot,Ht.values),l($t,{slice:Gt,set:Jt,constructor:function(){},toString:bt,toLocaleString:Dt}),Wt($t,"buffer","b"),Wt($t,"byteOffset","o"),Wt($t,"byteLength","l"),Wt($t,"length","e"),G($t,jt,{get:function(){return this[At]}}),t.exports=function(t,u,c,f){var l=t+((f=!!f)?"Clamped":"")+"Array",h="get"+t,v="set"+t,y=n[l],g=y||{},_=y&&S(y),m={},O=y&&y.prototype,j=function(t,e){G(t,e,{get:function(){return function(t,e){var n=t._d;return n.v[h](e*u+n.o,Pt)}(this,e)},set:function(t){return function(t,e,n){var r=t._d;f&&(n=0>(n=Math.round(n))?0:n>255?255:255&n),r.v[v](e*u+r.o,n,Pt)}(this,e,t)},enumerable:!0})};!y||!i.ABV?(y=c(function(t,e,n,r){a(t,y,l,"_d");var o,i,c,f,h=0,v=0;if(E(e)){if(!(e instanceof tt||"ArrayBuffer"==(f=b(e))||"SharedArrayBuffer"==f))return At in e?Ct(y,e):Ut.call(y,e);o=e,v=Ft(n,u);var g=e.byteLength;if(void 0===r){if(g%u)throw H("Wrong length!");if(0>(i=g-v))throw H("Wrong length!")}else if((i=d(r)*u)+v>g)throw H("Wrong length!");c=i/u}else c=p(e),o=new tt(i=c*u);for(s(t,"_d",{b:o,o:v,l:i,e:c,v:new et(o)});c>h;)j(t,h++)}),O=y.prototype=x($t),s(O,"constructor",y)):r(function(){y(1)})&&r(function(){new y(-1)})&&W(function(t){new y,new y(null),new y(1.5),new y(t)},!0)||(y=c(function(t,e,n,r){var o;return a(t,y,l),E(e)?e instanceof tt||"ArrayBuffer"==(o=b(e))||"SharedArrayBuffer"==o?void 0!==r?new g(e,Ft(n,u),r):void 0!==n?new g(e,Ft(n,u)):new g(e):At in e?Ct(y,e):Ut.call(y,e):new g(p(e))}),nt(_!==Function.prototype?A(g).concat(A(_)):A(g),function(t){t in y||s(y,t,g[t])}),y.prototype=O,e||(O.constructor=y));var w=O[Ot],M=!!w&&("values"==w.name||void 0==w.name),z=Ht.values;s(y,wt,!0),s(O,At,l),s(O,zt,!0),s(O,xt,y),(f?new y(1)[jt]==l:jt in O)||G(O,jt,{get:function(){return l}}),m[l]=y,o(o.G+o.W+o.F*(y!=g),m),o(o.S,l,{BYTES_PER_ELEMENT:u}),o(o.S+o.F*r(function(){g.of.call(y,1)}),l,{from:Ut,of:Kt}),"BYTES_PER_ELEMENT"in O||s(O,"BYTES_PER_ELEMENT",u),o(o.P,l,Vt),U(l),o(o.P+o.F*Lt,l,{set:Jt}),o(o.P+o.F*!M,l,Ht),e||O.toString==bt||(O.toString=bt),o(o.P+o.F*r(function(){new y(1).slice()}),l,{slice:Gt}),o(o.P+o.F*(r(function(){return[1,2].toLocaleString()!=new y([1,2]).toLocaleString()})||!r(function(){O.toLocaleString.call([1,2])})),l,{toLocaleString:Dt}),R[l]=M?w:z,e||M||s(O,Ot,z)}}else t.exports=function(){}}),Kr=Object.freeze({default:Ur,__moduleExports:Ur}),Br=Kr&&Ur||Kr;Br("Int8",1,function(t){return function(e,n,r){return t(this,e,n,r)}}),Br("Uint8",1,function(t){return function(e,n,r){return t(this,e,n,r)}}),Br("Uint8",1,function(t){return function(e,n,r){return t(this,e,n,r)}},!0),Br("Int16",2,function(t){return function(e,n,r){return t(this,e,n,r)}}),Br("Uint16",2,function(t){return function(e,n,r){return t(this,e,n,r)}}),Br("Int32",4,function(t){return function(e,n,r){return t(this,e,n,r)}}),Br("Uint32",4,function(t){return function(e,n,r){return t(this,e,n,r)}}),Br("Float32",4,function(t){return function(e,n,r){return t(this,e,n,r)}}),Br("Float64",8,function(t){return function(e,n,r){return t(this,e,n,r)}});var Dr=function(t,e,n,r){try{return r?e(M(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&M(o.call(t)),e}},Vr=Object.freeze({default:Dr,__moduleExports:Dr}),Gr=Vr&&Dr||Vr,Jr=n(function(t){var e={},n={},r=t.exports=function(t,r,o,i,u){var a,c,f,s,l=u?function(){return t}:Ir(t),h=ut(o,i,r?2:1),d=0;if("function"!=typeof l)throw TypeError(t+" is not iterable!");if(Fr(l)){for(a=kt(t.length);a>d;d++)if((s=r?h(M(c=t[d])[0],c[1]):h(t[d]))===e||s===n)return s}else for(f=l.call(t);!(c=f.next()).done;)if((s=Gr(f,h,c.value,r))===e||s===n)return s};r.BREAK=e,r.RETURN=n}),Hr=Object.freeze({default:Jr,__moduleExports:Jr}),Yr=n(function(t){var e=X("meta"),n=T.f,r=0,o=Object.isExtensible||function(){return!0},i=!v(function(){return o(Object.preventExtensions({}))}),u=function(t){n(t,e,{value:{i:"O"+ ++r,w:{}}})},a=t.exports={KEY:e,NEED:!1,fastKey:function(t,n){if(!f(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!q(t,e)){if(!o(t))return"F";if(!n)return"E";u(t)}return t[e].i},getWeak:function(t,n){if(!q(t,e)){if(!o(t))return!0;if(!n)return!1;u(t)}return t[e].w},onFreeze:function(t){return i&&a.NEED&&o(t)&&!q(t,e)&&u(t),t}}}),qr=Object.freeze({default:Yr,__moduleExports:Yr,KEY:Yr.KEY,NEED:Yr.NEED,fastKey:Yr.fastKey,getWeak:Yr.getWeak,onFreeze:Yr.onFreeze}),Xr=function(t,e){if(!f(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t},$r=Object.freeze({default:Xr,__moduleExports:Xr}),Qr=Hr&&Jr||Hr,Zr=qr&&Yr||qr,to=$r&&Xr||$r,eo=T.f,no=Zr.fastKey,ro=O?"_s":"size",oo=function(t,e){var n,r=no(e);if("F"!==r)return t._i[r];for(n=t._f;n;n=n.n)if(n.k==e)return n},io={getConstructor:function(t,e,n,r){var o=t(function(t,i){Te(t,o,e,"_i"),t._t=e,t._i=ir(null),t._f=void 0,t._l=void 0,t[ro]=0,void 0!=i&&Qr(i,n,t[r],t)});return Re(o.prototype,{clear:function(){for(var t=to(this,e),n=t._i,r=t._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];t._f=t._l=void 0,t[ro]=0},delete:function(t){var n=to(this,e),r=oo(n,t);if(r){var o=r.n,i=r.p;delete n._i[r.i],r.r=!0,i&&(i.n=o),o&&(o.p=i),n._f==r&&(n._f=o),n._l==r&&(n._l=i),n[ro]--}return!!r},forEach:function(t){to(this,e);for(var n,r=ut(t,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(t){return!!oo(to(this,e),t)}}),O&&eo(o.prototype,"size",{get:function(){return to(this,e)[ro]}}),o},def:function(t,e,n){var r,o,i=oo(t,e);return i?i.v=n:(t._l=i={i:o=no(e,!0),k:e,v:n,p:r=t._l,n:void 0,r:!1},t._f||(t._f=i),r&&(r.n=i),t[ro]++,"F"!==o&&(t._i[o]=i)),t},getEntry:oo,setStrong:function(t,e,n){_r(t,e,function(t,n){this._t=to(t,e),this._k=n,this._l=void 0},function(){for(var t=this._k,e=this._l;e&&e.r;)e=e.p;return this._t&&(this._l=e=e?e.n:this._t._f)?gr(0,"keys"==t?e.k:"values"==t?e.v:[e.k,e.v]):(this._t=void 0,gr(1))},n?"entries":"values",!n,!0),Ze(e)}},uo=Object.freeze({default:io,__moduleExports:io,getConstructor:io.getConstructor,def:io.def,getEntry:io.getEntry,setStrong:io.setStrong}),ao=function(t,e){if(M(t),!f(e)&&null!==e)throw TypeError(e+": can't set as prototype!")},co={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,n){try{(n=ut(Function.call,Wr.f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,r){return ao(t,r),e?t.__proto__=r:n(t,r),t}}({},!1):void 0),check:ao},fo=Object.freeze({default:co,__moduleExports:co,set:co.set,check:co.check}),so=fo&&co||fo,lo=so.set,ho=function(t,e,n){var r,o=e.constructor;return o!==n&&"function"==typeof o&&(r=o.prototype)!==n.prototype&&f(r)&&lo&&lo(t,r),t},vo=Object.freeze({default:ho,__moduleExports:ho}),po=vo&&ho||vo,yo=function(t,e,n,r,o,i){var u=g[t],a=u,c=o?"set":"add",s=a&&a.prototype,l={},h=function(t){var e=s[t];it(s,t,"delete"==t?function(t){return!(i&&!f(t))&&e.call(this,0===t?0:t)}:"has"==t?function(t){return!(i&&!f(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return i&&!f(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,n){return e.call(this,0===t?0:t,n),this})};if("function"==typeof a&&(i||s.forEach&&!v(function(){(new a).entries().next()}))){var d=new a,p=d[c](i?{}:-0,1)!=d,y=v(function(){d.has(1)}),_=Tr(function(t){new a(t)}),m=!i&&v(function(){for(var t=new a,e=5;e--;)t[c](e,e);return!t.has(-0)});_||((a=e(function(e,n){Te(e,a,t);var r=po(new u,e,a);return void 0!=n&&Qr(n,o,r[c],r),r})).prototype=s,s.constructor=a),(y||m)&&(h("delete"),h("has"),o&&h("get")),(m||p)&&h(c),i&&s.clear&&delete s.clear}else a=r.getConstructor(e,t,o,c),Re(a.prototype,n),Zr.NEED=!0;return Ke(a,t),l[t]=a,Xe(Xe.G+Xe.W+Xe.F*(a!=u),l),i||r.setStrong(a,t,o),a},go=Object.freeze({default:yo,__moduleExports:yo}),_o=uo&&io||uo,mo=go&&yo||go,bo=(mo("Map",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{get:function(t){var e=_o.getEntry(to(this,"Map"),t);return e&&e.v},set:function(t,e){return _o.def(to(this,"Map"),0===t?0:t,e)}},_o,!0),mo("Set",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function(t){return _o.def(to(this,"Set"),t=0===t?0:t,t)}},_o),Object.getOwnPropertySymbols),Eo={f:bo},Oo=Object.freeze({default:Eo,__moduleExports:Eo,f:bo}),jo=Oo&&Eo||Oo,wo=Object.assign,xo=!wo||v(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=wo({},t)[n]||Object.keys(wo({},e)).join("")!=r})?function(t,e){for(var n=we(t),r=arguments.length,o=1,i=jo.f,u=zr.f;r>o;)for(var a,c=Dt(arguments[o++]),f=i?bn(c).concat(i(c)):bn(c),s=f.length,l=0;s>l;)u.call(c,a=f[l++])&&(n[a]=c[a]);return n}:wo,So=Object.freeze({default:xo,__moduleExports:xo}),Ao=Zr.getWeak,Mo=Rr(5),zo=Rr(6),No=0,Po=function(t){return t._l||(t._l=new ko)},ko=function(){this.a=[]},Lo=function(t,e){return Mo(t.a,function(t){return t[0]===e})};ko.prototype={get:function(t){var e=Lo(this,t);if(e)return e[1]},has:function(t){return!!Lo(this,t)},set:function(t,e){var n=Lo(this,t);n?n[1]=e:this.a.push([t,e])},delete:function(t){var e=zo(this.a,function(e){return e[0]===t});return~e&&this.a.splice(e,1),!!~e}};var Fo={getConstructor:function(t,e,n,r){var o=t(function(t,i){Te(t,o,e,"_i"),t._t=e,t._i=No++,t._l=void 0,void 0!=i&&Qr(i,n,t[r],t)});return Re(o.prototype,{delete:function(t){if(!f(t))return!1;var n=Ao(t);return!0===n?Po(to(this,e)).delete(t):n&&q(n,this._i)&&delete n[this._i]},has:function(t){if(!f(t))return!1;var n=Ao(t);return!0===n?Po(to(this,e)).has(t):n&&q(n,this._i)}}),o},def:function(t,e,n){var r=Ao(M(e),!0);return!0===r?Po(t).set(e,n):r[t._i]=n,t},ufstore:Po},Io=Object.freeze({default:Fo,__moduleExports:Fo,getConstructor:Fo.getConstructor,def:Fo.def,ufstore:Fo.ufstore}),Ro=So&&xo||So,To=Io&&Fo||Io;n(function(t){var e,n=Rr(0),r=Zr.getWeak,o=Object.isExtensible,i=To.ufstore,u={},a=function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},c={get:function(t){if(f(t)){var e=r(t);return!0===e?i(to(this,"WeakMap")).get(t):e?e[this._i]:void 0}},set:function(t,e){return To.def(to(this,"WeakMap"),t,e)}},s=t.exports=mo("WeakMap",a,c,To,!0,!0);v(function(){return 7!=(new s).set((Object.freeze||Object)(u),7).get(u)})&&(e=To.getConstructor(a,"WeakMap"),Ro(e.prototype,c),Zr.NEED=!0,n(["delete","has","get","set"],function(t){var n=s.prototype,r=n[t];it(n,t,function(n,i){if(f(n)&&!o(n)){this._f||(this._f=new e);var u=this._f[t](n,i);return"set"==t?this:u}return r.call(this,n,i)})}))});mo("WeakSet",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function(t){return To.def(to(this,"WeakSet"),t,!0)}},To,!1,!0);var Co=(g.Reflect||{}).apply,Wo=Function.apply;Xe(Xe.S+Xe.F*!v(function(){Co(function(){})}),"Reflect",{apply:function(t,e,n){var r=nt(t),o=M(n);return Co?Co(r,e,o):Wo.call(r,e,o)}});var Uo=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)},Ko=Object.freeze({default:Uo,__moduleExports:Uo}),Bo=Ko&&Uo||Ko,Do=[].slice,Vo={},Go=Function.bind||function(t){var e=nt(this),n=Do.call(arguments,1),r=function(){var o=n.concat(Do.call(arguments));return this instanceof r?function(t,e,n){if(!(e in Vo)){for(var r=[],o=0;e>o;o++)r[o]="a["+o+"]";Vo[e]=Function("F,a","return new F("+r.join(",")+")")}return Vo[e](t,n)}(e,o.length,o):Bo(e,o,t)};return f(e.prototype)&&(r.prototype=e.prototype),r},Jo=Object.freeze({default:Go,__moduleExports:Go}),Ho=Jo&&Go||Jo,Yo=(g.Reflect||{}).construct,qo=v(function(){function t(){}return!(Yo(function(){},[],t)instanceof t)}),Xo=!v(function(){Yo(function(){})});Xe(Xe.S+Xe.F*(qo||Xo),"Reflect",{construct:function(t,e){nt(t),M(e);var n=3>arguments.length?t:nt(arguments[2]);if(Xo&&!qo)return Yo(t,e,n);if(t==n){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var r=[null];return r.push.apply(r,e),new(Ho.apply(t,r))}var o=n.prototype,i=ir(f(o)?o:Object.prototype),u=Function.apply.call(t,i,e);return f(u)?u:i}}),Xe(Xe.S+Xe.F*v(function(){Reflect.defineProperty(T.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function(t,e,n){M(t),e=N(e,!0),M(n);try{return T.f(t,e,n),!0}catch(t){return!1}}});var $o=Wr.f;Xe(Xe.S,"Reflect",{deleteProperty:function(t,e){var n=$o(M(t),e);return!(n&&!n.configurable)&&delete t[e]}}),Xe(Xe.S,"Reflect",{get:function t(e,n){var r,o,i=3>arguments.length?e:arguments[2];return M(e)===i?e[n]:(r=Wr.f(e,n))?q(r,"value")?r.value:void 0!==r.get?r.get.call(i):void 0:f(o=sr(e))?t(o,n,i):void 0}}),Xe(Xe.S,"Reflect",{getOwnPropertyDescriptor:function(t,e){return Wr.f(M(t),e)}}),Xe(Xe.S,"Reflect",{getPrototypeOf:function(t){return sr(M(t))}}),Xe(Xe.S,"Reflect",{has:function(t,e){return e in t}});var Qo=Object.isExtensible;Xe(Xe.S,"Reflect",{isExtensible:function(t){return M(t),!Qo||Qo(t)}});var Zo=g.Reflect,ti=Zo&&Zo.ownKeys||function(t){var e=We.f(M(t)),n=jo.f;return n?e.concat(n(t)):e},ei=Object.freeze({default:ti,__moduleExports:ti}),ni=ei&&ti||ei;Xe(Xe.S,"Reflect",{ownKeys:ni});var ri=Object.preventExtensions;Xe(Xe.S,"Reflect",{preventExtensions:function(t){M(t);try{return ri&&ri(t),!0}catch(t){return!1}}}),Xe(Xe.S,"Reflect",{set:function t(e,n,r){var o,i,u=4>arguments.length?e:arguments[3],a=Wr.f(M(e),n);if(!a){if(f(i=sr(e)))return t(i,n,r,u);a=C(0)}if(q(a,"value")){if(!1===a.writable||!f(u))return!1;if(o=Wr.f(u,n)){if(o.get||o.set||!1===o.writable)return!1;o.value=r,T.f(u,n,o)}else T.f(u,n,C(0,r));return!0}return void 0!==a.set&&(a.set.call(u,r),!0)}}),so&&Xe(Xe.S,"Reflect",{setPrototypeOf:function(t,e){so.check(t,e);try{return so.set(t,e),!0}catch(t){return!1}}});var oi,ii,ui,ai=g.process,ci=g.setImmediate,fi=g.clearImmediate,si=g.MessageChannel,li=g.Dispatch,hi=0,di={},vi=function(){var t=+this;if(di.hasOwnProperty(t)){var e=di[t];delete di[t],e()}},pi=function(t){vi.call(t.data)};ci&&fi||(ci=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return di[++hi]=function(){Bo("function"==typeof t?t:Function(t),e)},oi(hi),hi},fi=function(t){delete di[t]},"process"==Ct(ai)?oi=function(t){ai.nextTick(ut(vi,t,1))}:li&&li.now?oi=function(t){li.now(ut(vi,t,1))}:si?(ui=(ii=new si).port2,ii.port1.onmessage=pi,oi=ut(ui.postMessage,ui,1)):g.addEventListener&&"function"==typeof postMessage&&!g.importScripts?(oi=function(t){g.postMessage(t+"","*")},g.addEventListener("message",pi,!1)):oi="onreadystatechange"in j("script")?function(t){An.appendChild(j("script")).onreadystatechange=function(){An.removeChild(this),vi.call(t)}}:function(t){setTimeout(ut(vi,t,1),0)});var yi={set:ci,clear:fi},gi=Object.freeze({default:yi,__moduleExports:yi,set:yi.set,clear:yi.clear}),_i=gi&&yi||gi,mi=_i.set,bi=g.MutationObserver||g.WebKitMutationObserver,Ei=g.process,Oi=g.Promise,ji="process"==Ct(Ei),wi=function(){var t,e,n,r=function(){var r,o;for(ji&&(r=Ei.domain)&&r.exit();t;){o=t.fn,t=t.next;try{o()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(ji)n=function(){Ei.nextTick(r)};else if(!bi||g.navigator&&g.navigator.standalone)if(Oi&&Oi.resolve){var o=Oi.resolve();n=function(){o.then(r)}}else n=function(){mi.call(g,r)};else{var i=!0,u=document.createTextNode("");new bi(r).observe(u,{characterData:!0}),n=function(){u.data=i=!i}}return function(r){var o={fn:r,next:void 0};e&&(e.next=o),t||(t=o,n()),e=o}},xi=Object.freeze({default:wi,__moduleExports:wi});var Si,Ai,Mi,zi,Ni=function(t){return new function(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r}),this.resolve=nt(e),this.reject=nt(n)}(t)},Pi={f:Ni},ki=Object.freeze({default:Pi,__moduleExports:Pi,f:Ni}),Li=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}},Fi=Object.freeze({default:Li,__moduleExports:Li}),Ii=ki&&Pi||ki,Ri=function(t,e){if(M(t),f(e)&&e.constructor===t)return e;var n=Ii.f(t);return(0,n.resolve)(e),n.promise},Ti=Object.freeze({default:Ri,__moduleExports:Ri}),Ci=Fi&&Li||Fi,Wi=Ti&&Ri||Ti,Ui=_i.set,Ki=(xi&&wi||xi)(),Bi=g.TypeError,Di=g.process,Vi=g.Promise,Gi="process"==Tn(Di),Ji=function(){},Hi=Ai=Ii.f,Yi=!!function(){try{var t=Vi.resolve(1),e=(t.constructor={})[ze("species")]=function(t){t(Ji,Ji)};return(Gi||"function"==typeof PromiseRejectionEvent)&&t.then(Ji)instanceof e}catch(t){}}(),qi=function(t){var e;return!(!f(t)||"function"!=typeof(e=t.then))&&e},Xi=function(t,e){if(!t._n){t._n=!0;var n=t._c;Ki(function(){for(var r=t._v,o=1==t._s,i=0,u=function(e){var n,i,u,a=o?e.ok:e.fail,c=e.resolve,f=e.reject,s=e.domain;try{a?(o||(2==t._h&&Zi(t),t._h=1),!0===a?n=r:(s&&s.enter(),n=a(r),s&&(s.exit(),u=!0)),n===e.promise?f(Bi("Promise-chain cycle")):(i=qi(n))?i.call(n,c,f):c(n)):f(r)}catch(t){s&&!u&&s.exit(),f(t)}};n.length>i;)u(n[i++]);t._c=[],t._n=!1,e&&!t._h&&$i(t)})}},$i=function(t){Ui.call(g,function(){var e,n,r,o=t._v,i=Qi(t);if(i&&(e=Ci(function(){Gi?Di.emit("unhandledRejection",o,t):(n=g.onunhandledrejection)?n({promise:t,reason:o}):(r=g.console)&&r.error&&r.error("Unhandled promise rejection",o)}),t._h=Gi||Qi(t)?2:1),t._a=void 0,i&&e.e)throw e.v})},Qi=function(t){return 1!==t._h&&0===(t._a||t._c).length},Zi=function(t){Ui.call(g,function(){var e;Gi?Di.emit("rejectionHandled",t):(e=g.onrejectionhandled)&&e({promise:t,reason:t._v})})},tu=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),Xi(e,!0))},eu=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw Bi("Promise can't be resolved itself");(e=qi(t))?Ki(function(){var r={_w:n,_d:!1};try{e.call(t,ut(eu,r,1),ut(tu,r,1))}catch(t){tu.call(r,t)}}):(n._v=t,n._s=1,Xi(n,!1))}catch(t){tu.call({_w:n,_d:!1},t)}}};Yi||(Vi=function(t){Te(this,Vi,"Promise","_h"),nt(t),Si.call(this);try{t(ut(eu,this,1),ut(tu,this,1))}catch(t){tu.call(this,t)}},(Si=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=Re(Vi.prototype,{then:function(t,e){var n=Hi(Qe(this,Vi));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=Gi?Di.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&Xi(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),Mi=function(){var t=new Si;this.promise=t,this.resolve=ut(eu,t,1),this.reject=ut(tu,t,1)},Ii.f=Hi=function(t){return t===Vi||t===zi?new Mi(t):Ai(t)}),Xe(Xe.G+Xe.W+Xe.F*!Yi,{Promise:Vi}),Ke(Vi,"Promise"),Ze("Promise"),zi=$.Promise,Xe(Xe.S+Xe.F*!Yi,"Promise",{reject:function(t){var e=Hi(this);return(0,e.reject)(t),e.promise}}),Xe(Xe.S+Xe.F*(Fe||!Yi),"Promise",{resolve:function(t){return Wi(Fe&&this===zi?Vi:this,t)}}),Xe(Xe.S+Xe.F*!(Yi&&Tr(function(t){Vi.all(t).catch(Ji)})),"Promise",{all:function(t){var e=this,n=Hi(e),r=n.resolve,o=n.reject,i=Ci(function(){var n=[],i=0,u=1;Qr(t,!1,function(t){var a=i++,c=!1;n.push(void 0),u++,e.resolve(t).then(function(t){c||(c=!0,n[a]=t,--u||r(n))},o)}),--u||r(n)});return i.e&&o(i.v),n.promise},race:function(t){var e=this,n=Hi(e),r=n.reject,o=Ci(function(){Qr(t,!1,function(t){e.resolve(t).then(n.resolve,r)})});return o.e&&r(o.v),n.promise}});var nu={f:ze},ru=Object.freeze({default:nu,__moduleExports:nu,f:ze}),ou=ru&&nu||ru,iu=T.f,uu=function(t){var e=$.Symbol||($.Symbol=Fe?{}:g.Symbol||{});"_"==t.charAt(0)||t in e||iu(e,t,{value:ou.f(t)})},au=Object.freeze({default:uu,__moduleExports:uu}),cu=function(t){var e=bn(t),n=jo.f;if(n)for(var r,o=n(t),i=zr.f,u=0;o.length>u;)i.call(t,r=o[u++])&&e.push(r);return e},fu=Object.freeze({default:cu,__moduleExports:cu}),su=We.f,lu={}.toString,hu="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],du=function(t){return hu&&"[object Window]"==lu.call(t)?function(t){try{return su(t)}catch(t){return hu.slice()}}(t):su($t(t))},vu={f:du},pu=Object.freeze({default:vu,__moduleExports:vu,f:du}),yu=au&&uu||au,gu=fu&&cu||fu,_u=pu&&vu||pu,mu=Zr.KEY,bu=Wr.f,Eu=T.f,Ou=_u.f,ju=g.Symbol,wu=g.JSON,xu=wu&&wu.stringify,Su=ze("_hidden"),Au=ze("toPrimitive"),Mu={}.propertyIsEnumerable,zu=oe("symbol-registry"),Nu=oe("symbols"),Pu=oe("op-symbols"),ku=Object.prototype,Lu="function"==typeof ju,Fu=g.QObject,Iu=!Fu||!Fu.prototype||!Fu.prototype.findChild,Ru=O&&v(function(){return 7!=ir(Eu({},"a",{get:function(){return Eu(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=bu(ku,e);r&&delete ku[e],Eu(t,e,n),r&&t!==ku&&Eu(ku,e,r)}:Eu,Tu=function(t){var e=Nu[t]=ir(ju.prototype);return e._k=t,e},Cu=Lu&&"symbol"==typeof ju.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof ju},Wu=function(t,e,n){return t===ku&&Wu(Pu,e,n),M(t),e=N(e,!0),M(n),q(Nu,e)?(n.enumerable?(q(t,Su)&&t[Su][e]&&(t[Su][e]=!1),n=ir(n,{enumerable:C(0,!1)})):(q(t,Su)||Eu(t,Su,C(1,{})),t[Su][e]=!0),Ru(t,e,n)):Eu(t,e,n)},Uu=function(t,e){M(t);for(var n,r=gu(e=$t(e)),o=0,i=r.length;i>o;)Wu(t,n=r[o++],e[n]);return t},Ku=function(t){var e=Mu.call(this,t=N(t,!0));return!(this===ku&&q(Nu,t)&&!q(Pu,t))&&(!(e||!q(this,t)||!q(Nu,t)||q(this,Su)&&this[Su][t])||e)},Bu=function(t,e){if(t=$t(t),e=N(e,!0),t!==ku||!q(Nu,e)||q(Pu,e)){var n=bu(t,e);return!n||!q(Nu,e)||q(t,Su)&&t[Su][e]||(n.enumerable=!0),n}},Du=function(t){for(var e,n=Ou($t(t)),r=[],o=0;n.length>o;)q(Nu,e=n[o++])||e==Su||e==mu||r.push(e);return r},Vu=function(t){for(var e,n=t===ku,r=Ou(n?Pu:$t(t)),o=[],i=0;r.length>i;)!q(Nu,e=r[i++])||n&&!q(ku,e)||o.push(Nu[e]);return o};Lu||(it((ju=function(){if(this instanceof ju)throw TypeError("Symbol is not a constructor!");var t=X(arguments.length>0?arguments[0]:void 0),e=function(n){this===ku&&e.call(Pu,n),q(this,Su)&&q(this[Su],t)&&(this[Su][t]=!1),Ru(this,t,C(1,n))};return O&&Iu&&Ru(ku,t,{configurable:!0,set:e}),Tu(t)}).prototype,"toString",function(){return this._k}),Wr.f=Bu,T.f=Wu,We.f=_u.f=Du,zr.f=Ku,jo.f=Vu,O&&!Fe&&it(ku,"propertyIsEnumerable",Ku,!0),ou.f=function(t){return Tu(ze(t))}),Xe(Xe.G+Xe.W+Xe.F*!Lu,{Symbol:ju});for(var Gu="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),Ju=0;Gu.length>Ju;)ze(Gu[Ju++]);for(var Hu=bn(ze.store),Yu=0;Hu.length>Yu;)yu(Hu[Yu++]);Xe(Xe.S+Xe.F*!Lu,"Symbol",{for:function(t){return q(zu,t+="")?zu[t]:zu[t]=ju(t)},keyFor:function(t){if(!Cu(t))throw TypeError(t+" is not a symbol!");for(var e in zu)if(zu[e]===t)return e},useSetter:function(){Iu=!0},useSimple:function(){Iu=!1}}),Xe(Xe.S+Xe.F*!Lu,"Object",{create:function(t,e){return void 0===e?ir(t):Uu(ir(t),e)},defineProperty:Wu,defineProperties:Uu,getOwnPropertyDescriptor:Bu,getOwnPropertyNames:Du,getOwnPropertySymbols:Vu}),wu&&Xe(Xe.S+Xe.F*(!Lu||v(function(){var t=ju();return"[null]"!=xu([t])||"{}"!=xu({a:t})||"{}"!=xu(Object(t))})),"JSON",{stringify:function(t){for(var e,n,r=[t],o=1;arguments.length>o;)r.push(arguments[o++]);if(n=e=r[1],(f(e)||void 0!==t)&&!Cu(t))return Dn(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!Cu(e))return e}),r[1]=e,xu.apply(wu,r)}}),ju.prototype[Au]||Y(ju.prototype,Au,ju.prototype.valueOf),Ke(ju,"Symbol"),Ke(Math,"Math",!0),Ke(g.JSON,"JSON",!0);var qu=function(t,e){var n=($.Object||{})[t]||Object[t],r={};r[t]=e(n),Xe(Xe.S+Xe.F*v(function(){n(1)}),"Object",r)},Xu=Object.freeze({default:qu,__moduleExports:qu}),$u=Xu&&qu||Xu,Qu=Zr.onFreeze;$u("freeze",function(t){return function(e){return t&&f(e)?t(Qu(e)):e}});var Zu=Zr.onFreeze;$u("seal",function(t){return function(e){return t&&f(e)?t(Zu(e)):e}});var ta=Zr.onFreeze;$u("preventExtensions",function(t){return function(e){return t&&f(e)?t(ta(e)):e}}),$u("isFrozen",function(t){return function(e){return!f(e)||!!t&&t(e)}}),$u("isSealed",function(t){return function(e){return!f(e)||!!t&&t(e)}}),$u("isExtensible",function(t){return function(e){return!!f(e)&&(!t||t(e))}});var ea=Wr.f;$u("getOwnPropertyDescriptor",function(){return function(t,e){return ea($t(t),e)}}),$u("getPrototypeOf",function(){return function(t){return sr(we(t))}}),$u("keys",function(){return function(t){return bn(we(t))}}),$u("getOwnPropertyNames",function(){return _u.f}),Xe(Xe.S+Xe.F,"Object",{assign:Ro});var na=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e},ra=Object.freeze({default:na,__moduleExports:na});Xe(Xe.S,"Object",{is:ra&&na||ra}),Xe(Xe.S,"Object",{setPrototypeOf:so.set});var oa=Function.prototype,ia=/^\s*function ([^ (]*)/;"name"in oa||O&&(0,T.f)(oa,"name",{configurable:!0,get:function(){try{return(""+this).match(ia)[1]}catch(t){return""}}}),Xe(Xe.S,"String",{raw:function(t){for(var e=$t(t.raw),n=kt(e.length),r=arguments.length,o=[],i=0;n>i;)o.push(e[i++]+""),r>i&&o.push(arguments[i]+"");return o.join("")}});var ua=String.fromCharCode,aa=String.fromCodePoint;Xe(Xe.S+Xe.F*(!!aa&&1!=aa.length),"String",{fromCodePoint:function(t){for(var e,n=[],r=arguments.length,o=0;r>o;){if(e=+arguments[o++],Qt(e,1114111)!==e)throw RangeError(e+" is not a valid code point");n.push(65536>e?ua(e):ua(55296+((e-=65536)>>10),e%1024+56320))}return n.join("")}});var ca=function(t){return function(e,n){var r,o,i=Vt(e)+"",u=Mt(n),a=i.length;return 0>u||u>=a?t?"":void 0:55296>(r=i.charCodeAt(u))||r>56319||u+1===a||56320>(o=i.charCodeAt(u+1))||o>57343?t?i.charAt(u):r:t?i.slice(u,u+2):o-56320+(r-55296<<10)+65536}},fa=Object.freeze({default:ca,__moduleExports:ca}),sa=(fa&&ca||fa)(!1);Xe(Xe.P,"String",{codePointAt:function(t){return sa(this,t)}});var la=function(t){var e=Vt(this)+"",n="",r=Mt(t);if(0>r||r==1/0)throw RangeError("Count can't be negative");for(;r>0;(r>>>=1)&&(e+=e))1&r&&(n+=e);return n},ha=Object.freeze({default:la,__moduleExports:la}),da=ha&&la||ha;Xe(Xe.P,"String",{repeat:da});var va=ze("match"),pa=function(t){var e;return f(t)&&(void 0!==(e=t[va])?!!e:"RegExp"==Ct(t))},ya=Object.freeze({default:pa,__moduleExports:pa}),ga=ya&&pa||ya,_a=function(t,e,n){if(ga(e))throw TypeError("String#"+n+" doesn't accept regex!");return Vt(t)+""},ma=Object.freeze({default:_a,__moduleExports:_a}),ba=ze("match"),Ea=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[ba]=!1,!"/./"[t](e)}catch(t){}}return!0},Oa=Object.freeze({default:Ea,__moduleExports:Ea}),ja=ma&&_a||ma,wa=Oa&&Ea||Oa,xa="".startsWith;Xe(Xe.P+Xe.F*wa("startsWith"),"String",{startsWith:function(t){var e=ja(this,t,"startsWith"),n=kt(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),r=t+"";return xa?xa.call(e,r,n):e.slice(n,n+r.length)===r}});var Sa="".endsWith;Xe(Xe.P+Xe.F*wa("endsWith"),"String",{endsWith:function(t){var e=ja(this,t,"endsWith"),n=arguments.length>1?arguments[1]:void 0,r=kt(e.length),o=void 0===n?r:Math.min(kt(n),r),i=t+"";return Sa?Sa.call(e,i,o):e.slice(o-i.length,o)===i}});Xe(Xe.P+Xe.F*wa("includes"),"String",{includes:function(t){return!!~ja(this,t,"includes").indexOf(t,arguments.length>1?arguments[1]:void 0)}});var Aa=function(){var t=M(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e},Ma=Object.freeze({default:Aa,__moduleExports:Aa});O&&"g"!=/./g.flags&&T.f(RegExp.prototype,"flags",{configurable:!0,get:Ma&&Aa||Ma});var za=function(t,e,n){var r=ze(t),o=n(Vt,r,""[t]),i=o[0],u=o[1];v(function(){var e={};return e[r]=function(){return 7},7!=""[t](e)})&&(it(String.prototype,t,i),Y(RegExp.prototype,r,2==e?function(t,e){return u.call(t,this,e)}:function(t){return u.call(t,this)}))},Na=Object.freeze({default:za,__moduleExports:za}),Pa=Na&&za||Na;Pa("match",1,function(t,e,n){return[function(n){var r=t(this),o=void 0==n?void 0:n[e];return void 0!==o?o.call(n,r):RegExp(n)[e](r+"")},n]}),Pa("replace",2,function(t,e,n){return[function(r,o){var i=t(this),u=void 0==r?void 0:r[e];return void 0!==u?u.call(r,i,o):n.call(i+"",r,o)},n]}),Pa("split",2,function(t,e,n){var r=ga,o=n,i=[].push;if("".split(/.?/).length){var u=void 0===/()??/.exec("")[1];n=function(t,e){var n=this+"";if(void 0===t&&0===e)return[];if(!r(t))return o.call(n,t,e);var a,c,f,s,l,h=[],d=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),v=0,p=void 0===e?4294967295:e>>>0,y=RegExp(t.source,d+"g");for(u||(a=RegExp("^"+y.source+"$(?!\\s)",d));(c=y.exec(n))&&((f=c.index+c[0].length)<=v||(h.push(n.slice(v,c.index)),!u&&c.length>1&&c[0].replace(a,function(){for(l=1;arguments.length-2>l;l++)void 0===arguments[l]&&(c[l]=void 0)}),c.length>1&&n.length>c.index&&i.apply(h,c.slice(1)),s=c[0].length,v=f,p>h.length));)y.lastIndex===c.index&&y.lastIndex++;return v===n.length?!s&&y.test("")||h.push(""):h.push(n.slice(v)),h.length>p?h.slice(0,p):h}}else 0;return[function(r,o){var i=t(this),u=void 0==r?void 0:r[e];return void 0!==u?u.call(r,i,o):n.call(i+"",r,o)},n]}),Pa("search",1,function(t,e,n){return[function(n){var r=t(this),o=void 0==n?void 0:n[e];return void 0!==o?o.call(n,r):RegExp(n)[e](r+"")},n]});var ka=function(t,e,n){e in t?T.f(t,e,C(0,n)):t[e]=n},La=Object.freeze({default:ka,__moduleExports:ka}),Fa=La&&ka||La;Xe(Xe.S+Xe.F*!Tr(function(t){}),"Array",{from:function(t){var e,n,r,o,i=we(t),u="function"==typeof this?this:Array,a=arguments.length,c=a>1?arguments[1]:void 0,f=void 0!==c,s=0,l=Ir(i);if(f&&(c=ut(c,a>2?arguments[2]:void 0,2)),void 0==l||u==Array&&Fr(l))for(n=new u(e=kt(i.length));e>s;s++)Fa(n,s,f?c(i[s],s):i[s]);else for(o=l.call(i),n=new u;!(r=o.next()).done;s++)Fa(n,s,f?Gr(o,c,[r.value,s],!0):r.value);return n.length=s,n}}),Xe(Xe.S+Xe.F*v(function(){function t(){}return!(Array.of.call(t)instanceof t)}),"Array",{of:function(){for(var t=0,e=arguments.length,n=new("function"==typeof this?this:Array)(e);e>t;)Fa(n,t,arguments[t++]);return n.length=e,n}}),Xe(Xe.P,"Array",{copyWithin:Cr}),yr("copyWithin");var Ia=Rr(5),Ra=!0;"find"in[]&&Array(1).find(function(){Ra=!1}),Xe(Xe.P+Xe.F*Ra,"Array",{find:function(t){return Ia(this,t,arguments.length>1?arguments[1]:void 0)}}),yr("find");var Ta=Rr(6),Ca=!0;"findIndex"in[]&&Array(1).findIndex(function(){Ca=!1}),Xe(Xe.P+Xe.F*Ca,"Array",{findIndex:function(t){return Ta(this,t,arguments.length>1?arguments[1]:void 0)}}),yr("findIndex"),Xe(Xe.P,"Array",{fill:Ue}),yr("fill");var Wa=g.isFinite;Xe(Xe.S,"Number",{isFinite:function(t){return"number"==typeof t&&Wa(t)}});var Ua=Math.floor,Ka=function(t){return!f(t)&&isFinite(t)&&Ua(t)===t},Ba=Object.freeze({default:Ka,__moduleExports:Ka}),Da=Ba&&Ka||Ba;Xe(Xe.S,"Number",{isInteger:Da});var Va=Math.abs;Xe(Xe.S,"Number",{isSafeInteger:function(t){return Da(t)&&9007199254740991>=Va(t)}}),Xe(Xe.S,"Number",{isNaN:function(t){return t!=t}}),Xe(Xe.S,"Number",{EPSILON:Math.pow(2,-52)}),Xe(Xe.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991}),Xe(Xe.S,"Number",{MAX_SAFE_INTEGER:9007199254740991});var Ga=Math.log1p||function(t){return(t=+t)>-1e-8&&1e-8>t?t-t*t/2:Math.log(1+t)},Ja=Object.freeze({default:Ga,__moduleExports:Ga}),Ha=Ja&&Ga||Ja,Ya=Math.sqrt,qa=Math.acosh;Xe(Xe.S+Xe.F*!(qa&&710==Math.floor(qa(Number.MAX_VALUE))&&qa(1/0)==1/0),"Math",{acosh:function(t){return 1>(t=+t)?NaN:t>94906265.62425156?Math.log(t)+Math.LN2:Ha(t-1+Ya(t-1)*Ya(t+1))}});var Xa=Math.asinh;Xe(Xe.S+Xe.F*!(Xa&&1/Xa(0)>0),"Math",{asinh:function t(e){return isFinite(e=+e)&&0!=e?0>e?-t(-e):Math.log(e+Math.sqrt(e*e+1)):e}});var $a=Math.atanh;Xe(Xe.S+Xe.F*!($a&&0>1/$a(-0)),"Math",{atanh:function(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}});var Qa=Math.sign||function(t){return 0==(t=+t)||t!=t?t:0>t?-1:1},Za=Object.freeze({default:Qa,__moduleExports:Qa}),tc=Za&&Qa||Za;Xe(Xe.S,"Math",{cbrt:function(t){return tc(t=+t)*Math.pow(Math.abs(t),1/3)}}),Xe(Xe.S,"Math",{clz32:function(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}});var ec=Math.exp;Xe(Xe.S,"Math",{cosh:function(t){return(ec(t=+t)+ec(-t))/2}});var nc=Math.expm1,rc=!nc||nc(10)>22025.465794806718||22025.465794806718>nc(10)||-2e-17!=nc(-2e-17)?function(t){return 0==(t=+t)?t:t>-1e-6&&1e-6>t?t+t*t/2:Math.exp(t)-1}:nc,oc=Object.freeze({default:rc,__moduleExports:rc}),ic=oc&&rc||oc;Xe(Xe.S+Xe.F*(ic!=Math.expm1),"Math",{expm1:ic});var uc=Math.pow,ac=uc(2,-52),cc=uc(2,-23),fc=uc(2,127)*(2-cc),sc=uc(2,-126),lc=Math.fround||function(t){var e,n,r=Math.abs(t),o=tc(t);return sc>r?o*(r/sc/cc+1/ac-1/ac)*sc*cc:(n=(e=(1+cc/ac)*r)-(e-r))>fc||n!=n?o*(1/0):o*n},hc=Object.freeze({default:lc,__moduleExports:lc});Xe(Xe.S,"Math",{fround:hc&&lc||hc});var dc=Math.abs;Xe(Xe.S,"Math",{hypot:function(t,e){for(var n,r,o=0,i=0,u=arguments.length,a=0;u>i;)(n=dc(arguments[i++]))>a?(o=o*(r=a/n)*r+1,a=n):o+=n>0?(r=n/a)*r:n;return a===1/0?1/0:a*Math.sqrt(o)}});var vc=Math.imul;Xe(Xe.S+Xe.F*v(function(){return-5!=vc(4294967295,5)||2!=vc.length}),"Math",{imul:function(t,e){var n=+t,r=+e,o=65535&n,i=65535&r;return 0|o*i+((65535&n>>>16)*i+o*(65535&r>>>16)<<16>>>0)}}),Xe(Xe.S,"Math",{log1p:Ha}),Xe(Xe.S,"Math",{log10:function(t){return Math.log(t)*Math.LOG10E}}),Xe(Xe.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}}),Xe(Xe.S,"Math",{sign:tc});var pc=Math.exp;Xe(Xe.S+Xe.F*v(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function(t){return 1>Math.abs(t=+t)?(ic(t)-ic(-t))/2:(pc(t-1)-pc(-t-1))*(Math.E/2)}});var yc=Math.exp;Xe(Xe.S,"Math",{tanh:function(t){var e=ic(t=+t),n=ic(-t);return e==1/0?1:n==1/0?-1:(e-n)/(yc(t)+yc(-t))}}),Xe(Xe.S,"Math",{trunc:function(t){return(t>0?Math.floor:Math.ceil)(t)}});var gc=ce(!0);Xe(Xe.P,"Array",{includes:function(t){return gc(this,t,arguments.length>1?arguments[1]:void 0)}}),yr("includes");var _c=zr.f,mc=function(t){return function(e){for(var n,r=$t(e),o=bn(r),i=o.length,u=0,a=[];i>u;)_c.call(r,n=o[u++])&&a.push(t?[n,r[n]]:r[n]);return a}},bc=Object.freeze({default:mc,__moduleExports:mc}),Ec=bc&&mc||bc,Oc=Ec(!1);Xe(Xe.S,"Object",{values:function(t){return Oc(t)}});var jc=Ec(!0);Xe(Xe.S,"Object",{entries:function(t){return jc(t)}}),Xe(Xe.S,"Object",{getOwnPropertyDescriptors:function(t){for(var e,n,r=$t(t),o=Wr.f,i=ni(r),u={},a=0;i.length>a;)void 0!==(n=o(r,e=i[a++]))&&Fa(u,e,n);return u}});var wc=function(t,e,n,r){var o=Vt(t)+"",i=o.length,u=void 0===n?" ":n+"",a=kt(e);if(i>=a||""==u)return o;var c=a-i,f=da.call(u,Math.ceil(c/u.length));return f.length>c&&(f=f.slice(0,c)),r?f+o:o+f},xc=Object.freeze({default:wc,__moduleExports:wc}),Sc=g.navigator,Ac=Sc&&Sc.userAgent||"",Mc=Object.freeze({default:Ac,__moduleExports:Ac}),zc=xc&&wc||xc,Nc=Mc&&Ac||Mc;Xe(Xe.P+Xe.F*/Version\/10\.\d+(\.\d+)? Safari\//.test(Nc),"String",{padStart:function(t){return zc(this,t,arguments.length>1?arguments[1]:void 0,!0)}}),Xe(Xe.P+Xe.F*/Version\/10\.\d+(\.\d+)? Safari\//.test(Nc),"String",{padEnd:function(t){return zc(this,t,arguments.length>1?arguments[1]:void 0,!1)}});var Pc=[].slice,kc=function(t){return function(e,n){var r=arguments.length>2,o=!!r&&Pc.call(arguments,2);return t(r?function(){("function"==typeof e?e:Function(e)).apply(this,o)}:e,n)}};Xe(Xe.G+Xe.B+Xe.F*/MSIE .\./.test(Nc),{setTimeout:kc(g.setTimeout),setInterval:kc(g.setInterval)}),Xe(Xe.G+Xe.B,{setImmediate:_i.set,clearImmediate:_i.clear});for(var Lc=ze("iterator"),Fc=ze("toStringTag"),Ic=dn.Array,Rc={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},Tc=bn(Rc),Cc=0;Tc.length>Cc;Cc++){var Wc,Uc=Tc[Cc],Kc=Rc[Uc],Bc=g[Uc],Dc=Bc&&Bc.prototype;if(Dc&&(Dc[Lc]||Y(Dc,Lc,Ic),Dc[Fc]||Y(Dc,Fc,Uc),dn[Uc]=Ic,Kc))for(Wc in mr)Dc[Wc]||it(Dc,Wc,mr[Wc],!0)}n(function(t){!function(e){var n,r=Object.prototype,o=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},u=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag",f=e.regeneratorRuntime;if(f)t.exports=f;else{(f=e.regeneratorRuntime=t.exports).wrap=m;var s="suspendedStart",l="suspendedYield",h="executing",d="completed",v={},p={};p[u]=function(){return this};var y=Object.getPrototypeOf,g=y&&y(y(N([])));g&&g!==r&&o.call(g,u)&&(p=g);var _=j.prototype=E.prototype=Object.create(p);O.prototype=_.constructor=j,j.constructor=O,j[c]=O.displayName="GeneratorFunction",f.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===O||"GeneratorFunction"===(e.displayName||e.name))},f.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,j):(t.__proto__=j,c in t||(t[c]="GeneratorFunction")),t.prototype=Object.create(_),t},f.awrap=function(t){return{__await:t}},w(x.prototype),x.prototype[a]=function(){return this},f.AsyncIterator=x,f.async=function(t,e,n,r){var o=new x(m(t,e,n,r));return f.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},w(_),_[c]="Generator",_[u]=function(){return this},_.toString=function(){return"[object Generator]"},f.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},f.values=N,z.prototype={constructor:z,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(M),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=n)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,o){return a.type="throw",a.arg=t,e.next=r,o&&(e.method="next",e.arg=n),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var u=this.tryEntries[i],a=u.completion;if("root"===u.tryLoc)return r("end");if(this.prev>=u.tryLoc){var c=o.call(u,"catchLoc"),f=o.call(u,"finallyLoc");if(c&&f){if(u.catchLoc>this.prev)return r(u.catchLoc,!0);if(u.finallyLoc>this.prev)return r(u.finallyLoc)}else if(c){if(u.catchLoc>this.prev)return r(u.catchLoc,!0)}else{if(!f)throw Error("try statement without catch or finally");if(u.finallyLoc>this.prev)return r(u.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(this.prev>=r.tryLoc&&o.call(r,"finallyLoc")&&r.finallyLoc>this.prev){var i=r;break}}!i||"break"!==t&&"continue"!==t||i.tryLoc>e||e>i.finallyLoc||(i=null);var u=i?i.completion:{};return u.type=t,u.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(u)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),M(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;M(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:N(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=n),v}}}function m(t,e,n,r){var o=Object.create((e&&e.prototype instanceof E?e:E).prototype),i=new z(r||[]);return o._invoke=function(t,e,n){var r=s;return function(o,i){if(r===h)throw Error("Generator is already running");if(r===d){if("throw"===o)throw i;return P()}for(n.method=o,n.arg=i;;){var u=n.delegate;if(u){var a=S(u,n);if(a){if(a===v)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===s)throw r=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=h;var c=b(t,e,n);if("normal"===c.type){if(r=n.done?d:l,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=d,n.method="throw",n.arg=c.arg)}}}(t,n,i),o}function b(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function E(){}function O(){}function j(){}function w(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function x(t){function n(e,r,i,u){var a=b(t[e],t,r);if("throw"!==a.type){var c=a.arg,f=c.value;return f&&"object"==typeof f&&o.call(f,"__await")?Promise.resolve(f.__await).then(function(t){n("next",t,i,u)},function(t){n("throw",t,i,u)}):Promise.resolve(f).then(function(t){c.value=t,i(c)},u)}u(a.arg)}var r;"object"==typeof e.process&&e.process.domain&&(n=e.process.domain.bind(n)),this._invoke=function(t,e){function o(){return new Promise(function(r,o){n(t,e,r,o)})}return r=r?r.then(o,o):o()}}function S(t,e){var r=t.iterator[e.method];if(r===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=n,S(t,e),"throw"===e.method))return v;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=b(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,v;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=n),e.delegate=null,v):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,v)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function M(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function z(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function N(t){if(t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(o.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=n,e.done=!0,e};return i.next=i}}return{next:P}}function P(){return{value:n,done:!0}}}("object"==typeof e?e:"object"==typeof window?window:"object"==typeof self?self:e)});var Vc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gc=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var u,a=t[Symbol.iterator]();!(r=(u=a.next()).done)&&(n.push(u.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),Jc=function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);t.length>e;e++)n[e]=t[e];return n}return Array.from(t)};function Hc(t){return null===t?"null":t!==Object(t)?void 0===t?"undefined":Vc(t):{}.toString.call(t).slice(8,-1).toLowerCase()}function Yc(t){return"string"!==Hc(t)||!t.length}function qc(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments[1],n=arguments[2];if(Yc(t))return!1;var r=t.charCodeAt(0);return r>=e&&n>=r}var Xc={HIRAGANA:"toHiragana",KATAKANA:"toKatakana"},$c={HEPBURN:"hepburn"},Qc={useObsoleteKana:!1,passRomaji:!1,upcaseKatakana:!1,ignoreCase:!1,IMEMode:!1,romanization:$c.HEPBURN},Zc=65,tf=90,ef=12353,nf=12438,rf=12449,of=12540,uf=19968,af=40879,cf=12540,ff=12539,sf=[65377,65381],lf=[[12288,12351],sf,[12539,12540],[65281,65295],[65306,65311],[65339,65343],[65371,65376],[65504,65518]],hf=[].concat([[12352,12447],[12448,12543],sf,[65382,65439]],lf,[[65313,65338],[65345,65370],[65296,65305],[19968,40959],[13312,19903]]),df=[[0,127]].concat([[256,257],[274,275],[298,299],[332,333],[362,363]]),vf=[[32,47],[58,63],[91,96],[123,126]].concat([[8216,8217],[8220,8221]]);function pf(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return hf.some(function(e){var n=Gc(e,2);return qc(t,n[0],n[1])})}function yf(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments[1],n="regexp"===Hc(e);return!Yc(t)&&[].concat(Jc(t)).every(function(t){var r=pf(t);return n?r||e.test(t):r})}var gf=function(){return Object.assign({},Qc,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})};function _f(t,e,n){var r=e;function o(t,e){var i=t.charAt(0);return function t(e,r,i,u){if(!r)return n||1===Object.keys(e).length?e[""]?[[i,u,e[""]]]:[]:[[i,u,null]];if(1===Object.keys(e).length)return[[i,u,e[""]]].concat(o(r,u));var a=function(t,e){if(void 0!==t[e])return Object.assign({"":t[""]+e},t[e])}(e,r.charAt(0));if(void 0===a)return[[i,u,e[""]]].concat(o(r,u));return t(a,r.slice(1),i,u+1)}(Object.assign({"":i},r[i]),t.slice(1),e,e+1)}return o(t,0)}function mf(t){return Object.entries(t).reduce(function(t,e){var n=Gc(e,2),r=n[0],o=n[1],i="string"===Hc(o);return t[r]=i?{"":o}:mf(o),t},{})}function bf(t,e){return e.split("").reduce(function(t,e){return void 0===t[e]&&(t[e]={}),t[e]},t)}function Ef(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={};return"object"===Hc(t)&&Object.entries(t).forEach(function(t){var n=Gc(t,2),r=n[1],o=e;n[0].split("").forEach(function(t){void 0===o[t]&&(o[t]={}),o=o[t]}),o[""]=r}),function(t){return function t(e,n){return void 0===e||"string"===Hc(e)?n:Object.entries(n).reduce(function(n,r){var o=Gc(r,2),i=o[0];return n[i]=t(e[i],o[1]),n},e)}(JSON.parse(JSON.stringify(t)),e)}}function Of(t,e){return e?"function"===Hc(e)?e(t):Ef(e)(t):t}var jf={a:"あ",i:"い",u:"う",e:"え",o:"お",k:{a:"か",i:"き",u:"く",e:"け",o:"こ"},s:{a:"さ",i:"し",u:"す",e:"せ",o:"そ"},t:{a:"た",i:"ち",u:"つ",e:"て",o:"と"},n:{a:"な",i:"に",u:"ぬ",e:"ね",o:"の"},h:{a:"は",i:"ひ",u:"ふ",e:"へ",o:"ほ"},m:{a:"ま",i:"み",u:"む",e:"め",o:"も"},y:{a:"や",u:"ゆ",o:"よ"},r:{a:"ら",i:"り",u:"る",e:"れ",o:"ろ"},w:{a:"わ",i:"ゐ",e:"ゑ",o:"を"},g:{a:"が",i:"ぎ",u:"ぐ",e:"げ",o:"ご"},z:{a:"ざ",i:"じ",u:"ず",e:"ぜ",o:"ぞ"},d:{a:"だ",i:"ぢ",u:"づ",e:"で",o:"ど"},b:{a:"ば",i:"び",u:"ぶ",e:"べ",o:"ぼ"},p:{a:"ぱ",i:"ぴ",u:"ぷ",e:"ぺ",o:"ぽ"},v:{a:"ゔぁ",i:"ゔぃ",u:"ゔ",e:"ゔぇ",o:"ゔぉ"}},wf={".":"。",",":"、",":":":","/":"・","!":"!","?":"?","~":"〜","-":"ー","‘":"「","’":"」","“":"『","”":"』","[":"[","]":"]","(":"(",")":")","{":"{","}":"}"},xf={k:"き",s:"し",t:"ち",n:"に",h:"ひ",m:"み",r:"り",g:"ぎ",z:"じ",d:"ぢ",b:"び",p:"ぴ",v:"ゔ",q:"く",f:"ふ"},Sf={ya:"ゃ",yi:"ぃ",yu:"ゅ",ye:"ぇ",yo:"ょ"},Af={a:"ぁ",i:"ぃ",u:"ぅ",e:"ぇ",o:"ぉ"},Mf={sh:"sy",ch:"ty",cy:"ty",chy:"ty",shy:"sy",j:"zy",jy:"zy",shi:"si",chi:"ti",tsu:"tu",ji:"zi",fu:"hu"},zf=Object.assign({tu:"っ",wa:"ゎ",ka:"ヵ",ke:"ヶ"},Af,Sf),Nf={yi:"い",wu:"う",ye:"いぇ",wi:"うぃ",we:"うぇ",kwa:"くぁ",whu:"う",tha:"てゃ",thu:"てゅ",tho:"てょ",dha:"でゃ",dhu:"でゅ",dho:"でょ"},Pf={wh:"う",qw:"く",q:"く",gw:"ぐ",sw:"す",ts:"つ",th:"て",tw:"と",dh:"で",dw:"ど",fw:"ふ",f:"ふ"};function kf(){var t=mf(jf),e=function(e){return bf(t,e)};return Object.entries(xf).forEach(function(t){var n=Gc(t,2),r=n[0],o=n[1];Object.entries(Sf).forEach(function(t){var n=Gc(t,2),i=n[1];e(r+n[0])[""]=o+i})}),Object.entries(wf).forEach(function(t){var n=Gc(t,2),r=n[1];e(n[0])[""]=r}),Object.entries(Pf).forEach(function(t){var n=Gc(t,2),r=n[0],o=n[1];Object.entries(Af).forEach(function(t){var n=Gc(t,2),i=n[1];e(r+n[0])[""]=o+i})}),["n","n'","xn"].forEach(function(t){e(t)[""]="ん"}),t.c=JSON.parse(JSON.stringify(t.k)),Object.entries(Mf).forEach(function(t){var n=Gc(t,2),r=n[0],o=n[1],i=r.slice(0,r.length-1),u=r.charAt(r.length-1);e(i)[u]=JSON.parse(JSON.stringify(e(o)))}),Object.entries(zf).forEach(function(t){var n,r=Gc(t,2),o=r[0],i=r[1],u=function(t){return t.charAt(t.length-1)},a=function(t){return t.slice(0,t.length-1)},c=e("x"+o);c[""]=i,e("l"+a(o))[u(o)]=c,(n=o,[].concat(Jc(Object.entries(Mf)),[["c","k"]]).reduce(function(t,e){var r=Gc(e,2),o=r[0],i=r[1];return n.startsWith(i)?t.concat(n.replace(i,o)):t},[])).forEach(function(t){["l","x"].forEach(function(n){e(n+a(t))[u(t)]=e(n+o)})})}),Object.entries(Nf).forEach(function(t){var n=Gc(t,2),r=n[1];e(n[0])[""]=r}),[].concat(Jc(Object.keys(xf)),["c","y","w","j"]).forEach(function(e){var n=t[e];n[e]=function t(e){return Object.entries(e).reduce(function(e,n){var r=Gc(n,2),o=r[0],i=r[1];return e[o]=o?t(i):"っ"+i,e},{})}(n)}),delete t.n.n,Object.freeze(JSON.parse(JSON.stringify(t)))}var Lf=null;var Ff=Ef({wi:"ゐ",we:"ゑ"});function If(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!Yc(t)&&qc(t,Zc,tf)}function Rf(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!Yc(t)&&t.charCodeAt(0)===cf}function Tf(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!Yc(t)&&t.charCodeAt(0)===ff}function Cf(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!Yc(t)&&(!!Rf(t)||qc(t,ef,nf))}function Wf(){var t=[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split("").forEach(function(e){if(Rf(e)||Tf(e))t.push(e);else if(Cf(e)){var n=e.charCodeAt(0)+(rf-ef);t.push(String.fromCharCode(n))}else t.push(e)}),t.join("")}function Uf(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2],r=void 0;return n?r=e:n=Bf(r=gf(e)),function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2];n||(n=Bf(e));return _f(t.toLowerCase(),n,!e.IMEMode)}(t,r,n).map(function(e){var n=Gc(e,3),o=n[0],i=n[1],u=n[2];if(null===u)return t.slice(o);var a=r.IMEMode===Xc.HIRAGANA,c=r.IMEMode===Xc.KATAKANA||[].concat(Jc(t.slice(o,i))).every(If);return a||!c?u:Wf(u)}).join("")}var Kf=null;function Bf(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=(null==Lf&&(Lf=kf()),Lf);return e=t.IMEMode?function(t){var e=JSON.parse(JSON.stringify(t));return e.n.n={"":"ん"},e.n[" "]={"":"ん"},e}(e):e,e=t.useObsoleteKana?Ff(e):e,t.customKanaMapping&&(null==Kf&&(Kf=Of(e,t.customKanaMapping)),e=Kf),e}var Df=[];function Vf(t){var e=Object.assign({},gf(t),{IMEMode:t.IMEMode||!0}),n=Bf(e),r=[].concat(Jc(Object.keys(n)),Jc(Object.keys(n).map(function(t){return t.toUpperCase()})));return function(t){var o=t.target;void 0!==o.value&&"true"!==o.dataset.ignoreComposition&&function(t,e,n,r,o){var i=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=void 0,o=void 0,i=void 0;if(0===e&&n.includes(t[0])){var u=function(t,e){return[""].concat(Jc(Jf(t,function(t){return e.includes(t)||!yf(t,/[0-9]/)})))}(t,n),a=Gc(u,3);r=a[0],o=a[1],i=a[2]}else if(e>0){var c=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=Jf([].concat(Jc(t.slice(0,e))).reverse(),function(t){return!yf(t)}),r=Gc(n,2),o=r[0];return[r[1].reverse().join(""),o.split("").reverse().join(""),t.slice(e)]}(t,e),f=Gc(c,3);r=f[0],o=f[1],i=f[2]}else{var s=Jf(t,function(t){return!n.includes(t)}),l=Gc(s,2);r=l[0];var h=Jf(o=l[1],function(t){return!yf(t)}),d=Gc(h,2);o=d[0],i=d[1]}return[r,o,i]}(t.value,t.selectionEnd,r),u=Gc(i,3),a=u[0],c=u[1],f=u[2],s=Uf(c,e,n);if(c!==s){var l=a.length+s.length,h=a+s+f;t.value=h,h,f.length?setTimeout(function(){return t.setSelectionRange(l,l)},1):t.setSelectionRange(l,l)}else t.value}(o,e,n,r)}}function Gf(t){var e=t.type,n=t.target,r=t.data;/Mac/.test(window.navigator&&window.navigator.platform)&&("compositionupdate"===e&&yf(r)&&(n.dataset.ignoreComposition="true"),"compositionend"===e&&(n.dataset.ignoreComposition="false"))}function Jf(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(t){return!!t},n=[],r=t.length,o=0;r>o&&e(t[o],o);)n.push(t[o]),o+=1;return[n.join(""),t.slice(o)]}var Hf={input:function(t){var e=t.target;return console.log("input:",{value:e.value,selectionStart:e.selectionStart,selectionEnd:e.selectionEnd})},compositionstart:function(){return console.log("compositionstart")},compositionupdate:function(t){var e=t.target;return console.log("compositionupdate",{data:t.data,value:e.value,selectionStart:e.selectionStart,selectionEnd:e.selectionEnd})},compositionend:function(){return console.log("compositionend")}},Yf=function(t){Object.entries(Hf).forEach(function(e){var n=Gc(e,2);return t.addEventListener(n[0],n[1])})},qf=function(t){Object.entries(Hf).forEach(function(e){var n=Gc(e,2);return t.removeEventListener(n[0],n[1])})},Xf=["TEXTAREA","INPUT"],$f=0,Qf=function(){return $f+=1,""+Date.now()+$f};function Zf(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!Yc(t)&&df.some(function(e){var n=Gc(e,2);return qc(t,n[0],n[1])})}function ts(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments[1],n="regexp"===Hc(e);return!Yc(t)&&[].concat(Jc(t)).every(function(t){var r=Zf(t);return n?r||e.test(t):r})}function es(){return qc(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",rf,of)}function ns(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!Yc(t)&&(Cf(t)||es(t))}function rs(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!Yc(t)&&[].concat(Jc(t)).every(ns)}function os(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!Yc(t)&&[].concat(Jc(t)).every(Cf)}function is(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!Yc(t)&&[].concat(Jc(t)).every(es)}function us(){return qc(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",uf,af)}function as(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!Yc(t)&&[].concat(Jc(t)).every(us)}function cs(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{passKanji:!0},e=[].concat(Jc(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")),n=!1;return t.passKanji||(n=e.some(as)),(e.some(os)||e.some(is))&&e.some(ts)&&!n}var fs=function(t,e){return Rf(t)&&1>e},ss=function(t,e){return Rf(t)&&e>0},ls=function(t){return["ヶ","ヵ"].includes(t)},hs={a:"あ",i:"い",u:"う",e:"え",o:"う"};function ds(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments[1],n=arguments[2],r="";return t.split("").reduce(function(o,i,u){if(Tf(i)||fs(i,u)||ls(i))return o.concat(i);if(r&&ss(i,u)){var a=e(r).slice(-1);return es(t[u-1])&&"o"===a&&n?o.concat("お"):o.concat(hs[a])}if(!Rf(i)&&es(i)){var c=i.charCodeAt(0)+(ef-rf),f=String.fromCharCode(c);return r=f,o.concat(f)}return r="",o.concat(i)},[]).join("")}var vs=null,ps={"あ":"a","い":"i","う":"u","え":"e","お":"o","か":"ka","き":"ki","く":"ku","け":"ke","こ":"ko","さ":"sa","し":"shi","す":"su","せ":"se","そ":"so","た":"ta","ち":"chi","つ":"tsu","て":"te","と":"to","な":"na","に":"ni","ぬ":"nu","ね":"ne","の":"no","は":"ha","ひ":"hi","ふ":"fu","へ":"he","ほ":"ho","ま":"ma","み":"mi","む":"mu","め":"me","も":"mo","ら":"ra","り":"ri","る":"ru","れ":"re","ろ":"ro","や":"ya","ゆ":"yu","よ":"yo","わ":"wa","ゐ":"wi","ゑ":"we","を":"wo","ん":"n","が":"ga","ぎ":"gi","ぐ":"gu","げ":"ge","ご":"go","ざ":"za","じ":"ji","ず":"zu","ぜ":"ze","ぞ":"zo","だ":"da","ぢ":"ji","づ":"zu","で":"de","ど":"do","ば":"ba","び":"bi","ぶ":"bu","べ":"be","ぼ":"bo","ぱ":"pa","ぴ":"pi","ぷ":"pu","ぺ":"pe","ぽ":"po","ゔぁ":"va","ゔぃ":"vi","ゔ":"vu","ゔぇ":"ve","ゔぉ":"vo"},ys={"。":".","、":",",":":":","・":"/","!":"!","?":"?","〜":"~","ー":"-","「":"‘","」":"’","『":"“","』":"”","[":"[","]":"]","(":"(",")":")","{":"{","}":"}"," ":" "},gs=["あ","い","う","え","お","や","ゆ","よ"],_s={"ゃ":"ya","ゅ":"yu","ょ":"yo"},ms={"ぃ":"yi","ぇ":"ye"},bs={"ぁ":"a","ぃ":"i","ぅ":"u","ぇ":"e","ぉ":"o"},Es=["き","に","ひ","み","り","ぎ","び","ぴ","ゔ","く","ふ"],Os={"し":"sh","ち":"ch","じ":"j","ぢ":"j"},js={"っ":"","ゃ":"ya","ゅ":"yu","ょ":"yo","ぁ":"a","ぃ":"i","ぅ":"u","ぇ":"e","ぉ":"o"},ws={b:"b",c:"t",d:"d",f:"f",g:"g",h:"h",j:"j",k:"k",m:"m",p:"p",q:"q",r:"r",s:"s",t:"t",v:"v",w:"w",x:"x",z:"z"};function xs(){var t,e,n;return null==vs&&(t=mf(ps),e=function(e){return bf(t,e)},n=function(t,n){e(t)[""]=n},Object.entries(ys).forEach(function(t){var n=Gc(t,2),r=n[1];e(n[0])[""]=r}),[].concat(Jc(Object.entries(_s)),Jc(Object.entries(bs))).forEach(function(t){var e=Gc(t,2);n(e[0],e[1])}),Es.forEach(function(t){var r=e(t)[""][0];Object.entries(_s).forEach(function(e){var o=Gc(e,2);n(t+o[0],r+o[1])}),Object.entries(ms).forEach(function(e){var o=Gc(e,2);n(t+o[0],r+o[1])})}),Object.entries(Os).forEach(function(t){var e=Gc(t,2),r=e[0],o=e[1];Object.entries(_s).forEach(function(t){var e=Gc(t,2);n(r+e[0],o+e[1][1])}),n(r+"ぃ",o+"yi"),n(r+"ぇ",o+"e")}),t["っ"]=function t(e){return Object.entries(e).reduce(function(e,n){var r=Gc(n,2),o=r[0],i=r[1];if(o)e[o]=t(i);else{var u=i.charAt(0);e[o]=Object.keys(ws).includes(u)?ws[u]+i:i}return e},{})}(t),Object.entries(js).forEach(function(t){var e=Gc(t,2);n(e[0],e[1])}),gs.forEach(function(t){n("ん"+t,"n'"+e(t)[""])}),vs=Object.freeze(JSON.parse(JSON.stringify(t)))),vs}function Ss(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=gf(e);return function(t,e){var n=function(t){switch(t.romanization){case $c.HEPBURN:return xs();default:return{}}}(e);e.customRomajiMapping&&(null==As&&(As=Of(n,e.customRomajiMapping)),n=As);return _f(ds(t,Ss,!0),n,!e.IMEMode)}(t,n).map(function(n){var r=Gc(n,3),o=r[2];return e.upcaseKatakana&&is(t.slice(r[0],r[1]))?o.toUpperCase():o}).join("")}var As=null;function Ms(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!Yc(t)&&vf.some(function(e){var n=Gc(e,2);return qc(t,n[0],n[1])})}function zs(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!Yc(t)&&lf.some(function(e){var n=Gc(e,2);return qc(t,n[0],n[1])})}var Ns=function(t){return" "===t},Ps=function(t){return" "===t},ks=function(t){return/[0-9]/.test(t)},Ls=function(t){return/[0-9]/.test(t)},Fs={EN:"en",JA:"ja",EN_NUM:"englishNumeral",JA_NUM:"japaneseNumeral",EN_PUNC:"englishPunctuation",JA_PUNC:"japanesePunctuation",KANJI:"kanji",HIRAGANA:"hiragana",KATAKANA:"katakana",SPACE:"space",OTHER:"other"};function Is(t){var e=Fs.EN,n=Fs.JA,r=Fs.EN_NUM,o=Fs.JA_NUM,i=Fs.EN_PUNC,u=Fs.JA_PUNC,a=Fs.KANJI,c=Fs.HIRAGANA,f=Fs.KATAKANA,s=Fs.SPACE,l=Fs.OTHER;if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])switch(!0){case ks(t):case Ls(t):return l;case Ns(t):return e;case Ms(t):return l;case Ps(t):return n;case zs(t):return l;case pf(t):return n;case Zf(t):return e;default:return l}else switch(!0){case Ps(t):case Ns(t):return s;case ks(t):return o;case Ls(t):return r;case Ms(t):return i;case zs(t):return u;case us(t):return a;case Cf(t):return c;case es(t):return f;case pf(t):return n;case Zf(t):return e;default:return l}}function Rs(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.compact,r=void 0!==n&&n,o=e.detailed,i=void 0!==o&&o;if(null==t||Yc(t))return[];var u=[].concat(Jc(t)),a=u.shift(),c=Is(a,r);return u.reduce(function(t,e){var n=Is(e,r),o=n===c;c=n;var u=e;return o&&(u=(i?t.pop().value:t.pop())+u),t.concat(i?{type:n,value:u}:u)},[a=i?{type:c,value:a}:a])}var Ts=function(t,e){return e&&!rs(t[0])},Cs=function(t,e){return!e&&!rs(t[t.length-1])},Ws=function(t,e){return e&&![].concat(Jc(e)).some(as)||!e&&rs(t)};t.bind=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!Xf.includes(t.nodeName))throw Error("Element provided to Wanakana bind() was not a valid input or textarea element.\n Received: ("+JSON.stringify(t)+")");var r=Vf(e),o=Qf();t.setAttribute("data-wanakana-id",o),t.setAttribute("lang","ja"),t.setAttribute("autoCapitalize","none"),t.setAttribute("autoCorrect","off"),t.setAttribute("autoComplete","off"),t.setAttribute("spellCheck","false"),t.addEventListener("input",r),t.addEventListener("compositionupdate",Gf),t.addEventListener("compositionend",Gf),function(t,e,n){Df=Df.concat({id:t,inputHandler:e,compositionHandler:n})}(o,r,Gf),!0===n&&Yf(t)},t.unbind=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=(e=t)&&Df.find(function(t){return t.id===e.getAttribute("data-wanakana-id")});if(null==r)throw Error("Element provided to Wanakana unbind() had no listener registered.\n Received: "+JSON.stringify(t));var o,i=r.inputHandler,u=r.compositionHandler;t.removeAttribute("data-wanakana-id"),t.removeAttribute("data-ignore-composition"),t.removeEventListener("input",i),t.removeEventListener("compositionstart",u),t.removeEventListener("compositionupdate",u),t.removeEventListener("compositionend",u),o=r.id,Df=Df.filter(function(t){return t.id!==o}),!0===n&&qf(t)},t.isRomaji=ts,t.isJapanese=yf,t.isKana=rs,t.isHiragana=os,t.isKatakana=is,t.isMixed=cs,t.isKanji=as,t.toRomaji=Ss,t.toKana=Uf,t.toHiragana=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=gf(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return e.passRomaji?ds(t,Ss):cs(t,{passKanji:!0})?Uf(ds(t,Ss).toLowerCase(),e):ts(t)||Ms(t)?Uf(t.toLowerCase(),e):ds(t,Ss)},t.toKatakana=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=gf(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return e.passRomaji?Wf(t):cs(t)||ts(t)||Ms(t)?Wf(Uf(t.toLowerCase(),e)):Wf(t)},t.stripOkurigana=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.leading,r=void 0!==n&&n,o=e.matchKanji,i=void 0===o?"":o;if(!yf(t)||Ts(t,r)||Cs(t,r)||Ws(t,i))return t;var u=i||t,a=RegExp(r?"^"+Rs(u).shift():Rs(u).pop()+"$");return t.replace(a,"")},t.tokenize=Rs,t.VERSION="4.0.2",t.TO_KANA_METHODS=Xc,t.ROMANIZATIONS=$c,Object.defineProperty(t,"__esModule",{value:!0})});
+//# sourceMappingURL=wanakana.min.js.map
diff --git a/ext/mixed/lib/wanakana.min.js.map b/ext/mixed/lib/wanakana.min.js.map
new file mode 100644
index 00000000..518174e1
--- /dev/null
+++ b/ext/mixed/lib/wanakana.min.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"wanakana.min.js","sources":["../../node_modules/core-js/modules/_global.js","../../node_modules/core-js/modules/_core.js","../../node_modules/core-js/modules/_is-object.js","../../node_modules/core-js/modules/_an-object.js","../../node_modules/core-js/modules/_fails.js","../../node_modules/core-js/modules/_descriptors.js","../../node_modules/core-js/modules/_dom-create.js","../../node_modules/core-js/modules/_ie8-dom-define.js","../../node_modules/core-js/modules/_to-primitive.js","../../node_modules/core-js/modules/_object-dp.js","../../node_modules/core-js/modules/_property-desc.js","../../node_modules/core-js/modules/_hide.js","../../node_modules/core-js/modules/_has.js","../../node_modules/core-js/modules/_uid.js","../../node_modules/core-js/modules/_redefine.js","../../node_modules/core-js/modules/_a-function.js","../../node_modules/core-js/modules/_ctx.js","../../node_modules/core-js/modules/_export.js","../../node_modules/core-js/modules/_typed.js","../../node_modules/core-js/modules/_library.js","../../node_modules/core-js/modules/_redefine-all.js","../../node_modules/core-js/modules/_an-instance.js","../../node_modules/core-js/modules/_to-integer.js","../../node_modules/core-js/modules/_to-length.js","../../node_modules/core-js/modules/_to-index.js","../../node_modules/core-js/modules/_cof.js","../../node_modules/core-js/modules/_iobject.js","../../node_modules/core-js/modules/_defined.js","../../node_modules/core-js/modules/_to-iobject.js","../../node_modules/core-js/modules/_to-absolute-index.js","../../node_modules/core-js/modules/_array-includes.js","../../node_modules/core-js/modules/_shared.js","../../node_modules/core-js/modules/_shared-key.js","../../node_modules/core-js/modules/_object-keys-internal.js","../../node_modules/core-js/modules/_enum-bug-keys.js","../../node_modules/core-js/modules/_object-gopn.js","../../node_modules/core-js/modules/_to-object.js","../../node_modules/core-js/modules/_array-fill.js","../../node_modules/core-js/modules/_wks.js","../../node_modules/core-js/modules/_set-to-string-tag.js","../../node_modules/core-js/modules/_typed-buffer.js","../../node_modules/core-js/modules/_species-constructor.js","../../node_modules/core-js/modules/_set-species.js","../../node_modules/core-js/modules/es6.typed.array-buffer.js","../../node_modules/core-js/modules/_classof.js","../../node_modules/core-js/modules/_is-array-iter.js","../../node_modules/core-js/modules/_object-keys.js","../../node_modules/core-js/modules/_object-dps.js","../../node_modules/core-js/modules/_html.js","../../node_modules/core-js/modules/_object-create.js","../../node_modules/core-js/modules/_object-gpo.js","../../node_modules/core-js/modules/core.get-iterator-method.js","../../node_modules/core-js/modules/_is-array.js","../../node_modules/core-js/modules/_array-species-constructor.js","../../node_modules/core-js/modules/_array-species-create.js","../../node_modules/core-js/modules/_array-methods.js","../../node_modules/core-js/modules/_add-to-unscopables.js","../../node_modules/core-js/modules/_iter-step.js","../../node_modules/core-js/modules/_iter-create.js","../../node_modules/core-js/modules/_iter-define.js","../../node_modules/core-js/modules/es6.array.iterator.js","../../node_modules/core-js/modules/_iter-detect.js","../../node_modules/core-js/modules/_array-copy-within.js","../../node_modules/core-js/modules/_object-pie.js","../../node_modules/core-js/modules/_object-gopd.js","../../node_modules/core-js/modules/_typed-array.js","../../node_modules/core-js/modules/es6.typed.int8-array.js","../../node_modules/core-js/modules/es6.typed.uint8-array.js","../../node_modules/core-js/modules/es6.typed.uint8-clamped-array.js","../../node_modules/core-js/modules/es6.typed.int16-array.js","../../node_modules/core-js/modules/es6.typed.uint16-array.js","../../node_modules/core-js/modules/es6.typed.int32-array.js","../../node_modules/core-js/modules/es6.typed.uint32-array.js","../../node_modules/core-js/modules/es6.typed.float32-array.js","../../node_modules/core-js/modules/es6.typed.float64-array.js","../../node_modules/core-js/modules/_iter-call.js","../../node_modules/core-js/modules/_for-of.js","../../node_modules/core-js/modules/_meta.js","../../node_modules/core-js/modules/_validate-collection.js","../../node_modules/core-js/modules/_collection-strong.js","../../node_modules/core-js/modules/_set-proto.js","../../node_modules/core-js/modules/_inherit-if-required.js","../../node_modules/core-js/modules/_collection.js","../../node_modules/core-js/modules/es6.map.js","../../node_modules/core-js/modules/es6.set.js","../../node_modules/core-js/modules/_object-gops.js","../../node_modules/core-js/modules/_object-assign.js","../../node_modules/core-js/modules/_collection-weak.js","../../node_modules/core-js/modules/es6.weak-map.js","../../node_modules/core-js/modules/es6.weak-set.js","../../node_modules/core-js/modules/es6.reflect.apply.js","../../node_modules/core-js/modules/_invoke.js","../../node_modules/core-js/modules/_bind.js","../../node_modules/core-js/modules/es6.reflect.construct.js","../../node_modules/core-js/modules/es6.reflect.define-property.js","../../node_modules/core-js/modules/es6.reflect.delete-property.js","../../node_modules/core-js/modules/es6.reflect.get.js","../../node_modules/core-js/modules/es6.reflect.get-own-property-descriptor.js","../../node_modules/core-js/modules/es6.reflect.get-prototype-of.js","../../node_modules/core-js/modules/es6.reflect.has.js","../../node_modules/core-js/modules/es6.reflect.is-extensible.js","../../node_modules/core-js/modules/_own-keys.js","../../node_modules/core-js/modules/es6.reflect.own-keys.js","../../node_modules/core-js/modules/es6.reflect.prevent-extensions.js","../../node_modules/core-js/modules/es6.reflect.set.js","../../node_modules/core-js/modules/es6.reflect.set-prototype-of.js","../../node_modules/core-js/modules/_task.js","../../node_modules/core-js/modules/_microtask.js","../../node_modules/core-js/modules/_new-promise-capability.js","../../node_modules/core-js/modules/es6.promise.js","../../node_modules/core-js/modules/_perform.js","../../node_modules/core-js/modules/_promise-resolve.js","../../node_modules/core-js/modules/_wks-ext.js","../../node_modules/core-js/modules/_wks-define.js","../../node_modules/core-js/modules/_enum-keys.js","../../node_modules/core-js/modules/_object-gopn-ext.js","../../node_modules/core-js/modules/es6.symbol.js","../../node_modules/core-js/modules/_object-sap.js","../../node_modules/core-js/modules/es6.object.freeze.js","../../node_modules/core-js/modules/es6.object.seal.js","../../node_modules/core-js/modules/es6.object.prevent-extensions.js","../../node_modules/core-js/modules/es6.object.is-frozen.js","../../node_modules/core-js/modules/es6.object.is-sealed.js","../../node_modules/core-js/modules/es6.object.is-extensible.js","../../node_modules/core-js/modules/es6.object.get-own-property-descriptor.js","../../node_modules/core-js/modules/es6.object.get-prototype-of.js","../../node_modules/core-js/modules/es6.object.keys.js","../../node_modules/core-js/modules/es6.object.get-own-property-names.js","../../node_modules/core-js/modules/es6.object.assign.js","../../node_modules/core-js/modules/_same-value.js","../../node_modules/core-js/modules/es6.object.is.js","../../node_modules/core-js/modules/es6.object.set-prototype-of.js","../../node_modules/core-js/modules/es6.function.name.js","../../node_modules/core-js/modules/es6.string.raw.js","../../node_modules/core-js/modules/es6.string.from-code-point.js","../../node_modules/core-js/modules/_string-at.js","../../node_modules/core-js/modules/es6.string.code-point-at.js","../../node_modules/core-js/modules/_string-repeat.js","../../node_modules/core-js/modules/es6.string.repeat.js","../../node_modules/core-js/modules/_is-regexp.js","../../node_modules/core-js/modules/_string-context.js","../../node_modules/core-js/modules/_fails-is-regexp.js","../../node_modules/core-js/modules/es6.string.starts-with.js","../../node_modules/core-js/modules/es6.string.ends-with.js","../../node_modules/core-js/modules/es6.string.includes.js","../../node_modules/core-js/modules/_flags.js","../../node_modules/core-js/modules/es6.regexp.flags.js","../../node_modules/core-js/modules/_fix-re-wks.js","../../node_modules/core-js/modules/es6.regexp.match.js","../../node_modules/core-js/modules/es6.regexp.replace.js","../../node_modules/core-js/modules/es6.regexp.split.js","../../node_modules/core-js/modules/es6.regexp.search.js","../../node_modules/core-js/modules/_create-property.js","../../node_modules/core-js/modules/es6.array.from.js","../../node_modules/core-js/modules/es6.array.of.js","../../node_modules/core-js/modules/es6.array.copy-within.js","../../node_modules/core-js/modules/es6.array.find.js","../../node_modules/core-js/modules/es6.array.find-index.js","../../node_modules/core-js/modules/es6.array.fill.js","../../node_modules/core-js/modules/es6.number.is-finite.js","../../node_modules/core-js/modules/_is-integer.js","../../node_modules/core-js/modules/es6.number.is-integer.js","../../node_modules/core-js/modules/es6.number.is-safe-integer.js","../../node_modules/core-js/modules/es6.number.is-nan.js","../../node_modules/core-js/modules/es6.number.epsilon.js","../../node_modules/core-js/modules/es6.number.min-safe-integer.js","../../node_modules/core-js/modules/es6.number.max-safe-integer.js","../../node_modules/core-js/modules/_math-log1p.js","../../node_modules/core-js/modules/es6.math.acosh.js","../../node_modules/core-js/modules/es6.math.asinh.js","../../node_modules/core-js/modules/es6.math.atanh.js","../../node_modules/core-js/modules/_math-sign.js","../../node_modules/core-js/modules/es6.math.cbrt.js","../../node_modules/core-js/modules/es6.math.clz32.js","../../node_modules/core-js/modules/es6.math.cosh.js","../../node_modules/core-js/modules/_math-expm1.js","../../node_modules/core-js/modules/es6.math.expm1.js","../../node_modules/core-js/modules/_math-fround.js","../../node_modules/core-js/modules/es6.math.fround.js","../../node_modules/core-js/modules/es6.math.hypot.js","../../node_modules/core-js/modules/es6.math.imul.js","../../node_modules/core-js/modules/es6.math.log1p.js","../../node_modules/core-js/modules/es6.math.log10.js","../../node_modules/core-js/modules/es6.math.log2.js","../../node_modules/core-js/modules/es6.math.sign.js","../../node_modules/core-js/modules/es6.math.sinh.js","../../node_modules/core-js/modules/es6.math.tanh.js","../../node_modules/core-js/modules/es6.math.trunc.js","../../node_modules/core-js/modules/es7.array.includes.js","../../node_modules/core-js/modules/_object-to-array.js","../../node_modules/core-js/modules/es7.object.values.js","../../node_modules/core-js/modules/es7.object.entries.js","../../node_modules/core-js/modules/es7.object.get-own-property-descriptors.js","../../node_modules/core-js/modules/_string-pad.js","../../node_modules/core-js/modules/_user-agent.js","../../node_modules/core-js/modules/es7.string.pad-start.js","../../node_modules/core-js/modules/es7.string.pad-end.js","../../node_modules/core-js/modules/web.timers.js","../../node_modules/core-js/modules/web.immediate.js","../../node_modules/core-js/modules/web.dom.iterable.js","../../node_modules/regenerator-runtime/runtime.js","../../src/utils/typeOf.js","../../src/utils/isEmpty.js","../../src/utils/isCharInRange.js","../../src/constants.js","../../src/utils/isCharJapanese.js","../../src/isJapanese.js","../../src/utils/mergeWithDefaultOptions.js","../../src/utils/kanaMapping.js","../../src/utils/romajiToKanaMap.js","../../src/utils/isCharUpperCase.js","../../src/utils/isCharLongDash.js","../../src/utils/isCharSlashDot.js","../../src/utils/isCharHiragana.js","../../src/utils/hiraganaToKatakana.js","../../src/toKana.js","../../src/utils/dom.js","../../src/utils/logInputEvents.js","../../src/bind.js","../../src/utils/isCharRomaji.js","../../src/isRomaji.js","../../src/utils/isCharKatakana.js","../../src/utils/isCharKana.js","../../src/isKana.js","../../src/isHiragana.js","../../src/isKatakana.js","../../src/utils/isCharKanji.js","../../src/isKanji.js","../../src/isMixed.js","../../src/utils/katakanaToHiragana.js","../../src/utils/kanaToRomajiMap.js","../../src/toRomaji.js","../../src/utils/isCharEnglishPunctuation.js","../../src/utils/isCharJapanesePunctuation.js","../../src/tokenize.js","../../src/stripOkurigana.js","../../src/unbind.js","../../src/toHiragana.js","../../src/toKatakana.js"],"sourcesContent":["// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n","var core = module.exports = { version: '2.5.5' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","var isObject = require('./_is-object');\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n","var isObject = require('./_is-object');\nvar document = require('./_global').document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n","module.exports = !require('./_descriptors') && !require('./_fails')(function () {\n return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","var anObject = require('./_an-object');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar toPrimitive = require('./_to-primitive');\nvar dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","var dP = require('./_object-dp');\nvar createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n","var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n","var global = require('./_global');\nvar hide = require('./_hide');\nvar has = require('./_has');\nvar SRC = require('./_uid')('src');\nvar TO_STRING = 'toString';\nvar $toString = Function[TO_STRING];\nvar TPL = ('' + $toString).split(TO_STRING);\n\nrequire('./_core').inspectSource = function (it) {\n return $toString.call(it);\n};\n\n(module.exports = function (O, key, val, safe) {\n var isFunction = typeof val == 'function';\n if (isFunction) has(val, 'name') || hide(val, 'name', key);\n if (O[key] === val) return;\n if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if (O === global) {\n O[key] = val;\n } else if (!safe) {\n delete O[key];\n hide(O, key, val);\n } else if (O[key]) {\n O[key] = val;\n } else {\n hide(O, key, val);\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString() {\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});\n","module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","var global = require('./_global');\nvar core = require('./_core');\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar ctx = require('./_ctx');\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});\n var key, own, out, exp;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if (target) redefine(target, key, out, type & $export.U);\n // export\n if (exports[key] != out) hide(exports, key, exp);\n if (IS_PROTO && expProto[key] != out) expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n","var global = require('./_global');\nvar hide = require('./_hide');\nvar uid = require('./_uid');\nvar TYPED = uid('typed_array');\nvar VIEW = uid('view');\nvar ABV = !!(global.ArrayBuffer && global.DataView);\nvar CONSTR = ABV;\nvar i = 0;\nvar l = 9;\nvar Typed;\n\nvar TypedArrayConstructors = (\n 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array'\n).split(',');\n\nwhile (i < l) {\n if (Typed = global[TypedArrayConstructors[i++]]) {\n hide(Typed.prototype, TYPED, true);\n hide(Typed.prototype, VIEW, true);\n } else CONSTR = false;\n}\n\nmodule.exports = {\n ABV: ABV,\n CONSTR: CONSTR,\n TYPED: TYPED,\n VIEW: VIEW\n};\n","module.exports = false;\n","var redefine = require('./_redefine');\nmodule.exports = function (target, src, safe) {\n for (var key in src) redefine(target, key, src[key], safe);\n return target;\n};\n","module.exports = function (it, Constructor, name, forbiddenField) {\n if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {\n throw TypeError(name + ': incorrect invocation!');\n } return it;\n};\n","// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer');\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n","// https://tc39.github.io/ecma262/#sec-toindex\nvar toInteger = require('./_to-integer');\nvar toLength = require('./_to-length');\nmodule.exports = function (it) {\n if (it === undefined) return 0;\n var number = toInteger(it);\n var length = toLength(number);\n if (number !== length) throw RangeError('Wrong length!');\n return length;\n};\n","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject');\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n","var toInteger = require('./_to-integer');\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject');\nvar toLength = require('./_to-length');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n","var global = require('./_global');\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\nmodule.exports = function (key) {\n return store[key] || (store[key] = {});\n};\n","var shared = require('./_shared')('keys');\nvar uid = require('./_uid');\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n","var has = require('./_has');\nvar toIObject = require('./_to-iobject');\nvar arrayIndexOf = require('./_array-includes')(false);\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n","// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n","// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\nvar $keys = require('./_object-keys-internal');\nvar hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype');\n\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return $keys(O, hiddenKeys);\n};\n","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n","// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)\n'use strict';\nvar toObject = require('./_to-object');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar toLength = require('./_to-length');\nmodule.exports = function fill(value /* , start = 0, end = @length */) {\n var O = toObject(this);\n var length = toLength(O.length);\n var aLen = arguments.length;\n var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length);\n var end = aLen > 2 ? arguments[2] : undefined;\n var endPos = end === undefined ? length : toAbsoluteIndex(end, length);\n while (endPos > index) O[index++] = value;\n return O;\n};\n","var store = require('./_shared')('wks');\nvar uid = require('./_uid');\nvar Symbol = require('./_global').Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n","var def = require('./_object-dp').f;\nvar has = require('./_has');\nvar TAG = require('./_wks')('toStringTag');\n\nmodule.exports = function (it, tag, stat) {\n if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });\n};\n","'use strict';\nvar global = require('./_global');\nvar DESCRIPTORS = require('./_descriptors');\nvar LIBRARY = require('./_library');\nvar $typed = require('./_typed');\nvar hide = require('./_hide');\nvar redefineAll = require('./_redefine-all');\nvar fails = require('./_fails');\nvar anInstance = require('./_an-instance');\nvar toInteger = require('./_to-integer');\nvar toLength = require('./_to-length');\nvar toIndex = require('./_to-index');\nvar gOPN = require('./_object-gopn').f;\nvar dP = require('./_object-dp').f;\nvar arrayFill = require('./_array-fill');\nvar setToStringTag = require('./_set-to-string-tag');\nvar ARRAY_BUFFER = 'ArrayBuffer';\nvar DATA_VIEW = 'DataView';\nvar PROTOTYPE = 'prototype';\nvar WRONG_LENGTH = 'Wrong length!';\nvar WRONG_INDEX = 'Wrong index!';\nvar $ArrayBuffer = global[ARRAY_BUFFER];\nvar $DataView = global[DATA_VIEW];\nvar Math = global.Math;\nvar RangeError = global.RangeError;\n// eslint-disable-next-line no-shadow-restricted-names\nvar Infinity = global.Infinity;\nvar BaseBuffer = $ArrayBuffer;\nvar abs = Math.abs;\nvar pow = Math.pow;\nvar floor = Math.floor;\nvar log = Math.log;\nvar LN2 = Math.LN2;\nvar BUFFER = 'buffer';\nvar BYTE_LENGTH = 'byteLength';\nvar BYTE_OFFSET = 'byteOffset';\nvar $BUFFER = DESCRIPTORS ? '_b' : BUFFER;\nvar $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH;\nvar $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET;\n\n// IEEE754 conversions based on https://github.com/feross/ieee754\nfunction packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}\nfunction unpackIEEE754(buffer, mLen, nBytes) {\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var nBits = eLen - 7;\n var i = nBytes - 1;\n var s = buffer[i--];\n var e = s & 127;\n var m;\n s >>= 7;\n for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8);\n m = e & (1 << -nBits) - 1;\n e >>= -nBits;\n nBits += mLen;\n for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8);\n if (e === 0) {\n e = 1 - eBias;\n } else if (e === eMax) {\n return m ? NaN : s ? -Infinity : Infinity;\n } else {\n m = m + pow(2, mLen);\n e = e - eBias;\n } return (s ? -1 : 1) * m * pow(2, e - mLen);\n}\n\nfunction unpackI32(bytes) {\n return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0];\n}\nfunction packI8(it) {\n return [it & 0xff];\n}\nfunction packI16(it) {\n return [it & 0xff, it >> 8 & 0xff];\n}\nfunction packI32(it) {\n return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff];\n}\nfunction packF64(it) {\n return packIEEE754(it, 52, 8);\n}\nfunction packF32(it) {\n return packIEEE754(it, 23, 4);\n}\n\nfunction addGetter(C, key, internal) {\n dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } });\n}\n\nfunction get(view, bytes, index, isLittleEndian) {\n var numIndex = +index;\n var intIndex = toIndex(numIndex);\n if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);\n var store = view[$BUFFER]._b;\n var start = intIndex + view[$OFFSET];\n var pack = store.slice(start, start + bytes);\n return isLittleEndian ? pack : pack.reverse();\n}\nfunction set(view, bytes, index, conversion, value, isLittleEndian) {\n var numIndex = +index;\n var intIndex = toIndex(numIndex);\n if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);\n var store = view[$BUFFER]._b;\n var start = intIndex + view[$OFFSET];\n var pack = conversion(+value);\n for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1];\n}\n\nif (!$typed.ABV) {\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, $ArrayBuffer, ARRAY_BUFFER);\n var byteLength = toIndex(length);\n this._b = arrayFill.call(new Array(byteLength), 0);\n this[$LENGTH] = byteLength;\n };\n\n $DataView = function DataView(buffer, byteOffset, byteLength) {\n anInstance(this, $DataView, DATA_VIEW);\n anInstance(buffer, $ArrayBuffer, DATA_VIEW);\n var bufferLength = buffer[$LENGTH];\n var offset = toInteger(byteOffset);\n if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!');\n byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);\n if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);\n this[$BUFFER] = buffer;\n this[$OFFSET] = offset;\n this[$LENGTH] = byteLength;\n };\n\n if (DESCRIPTORS) {\n addGetter($ArrayBuffer, BYTE_LENGTH, '_l');\n addGetter($DataView, BUFFER, '_b');\n addGetter($DataView, BYTE_LENGTH, '_l');\n addGetter($DataView, BYTE_OFFSET, '_o');\n }\n\n redefineAll($DataView[PROTOTYPE], {\n getInt8: function getInt8(byteOffset) {\n return get(this, 1, byteOffset)[0] << 24 >> 24;\n },\n getUint8: function getUint8(byteOffset) {\n return get(this, 1, byteOffset)[0];\n },\n getInt16: function getInt16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments[1]);\n return (bytes[1] << 8 | bytes[0]) << 16 >> 16;\n },\n getUint16: function getUint16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments[1]);\n return bytes[1] << 8 | bytes[0];\n },\n getInt32: function getInt32(byteOffset /* , littleEndian */) {\n return unpackI32(get(this, 4, byteOffset, arguments[1]));\n },\n getUint32: function getUint32(byteOffset /* , littleEndian */) {\n return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0;\n },\n getFloat32: function getFloat32(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4);\n },\n getFloat64: function getFloat64(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8);\n },\n setInt8: function setInt8(byteOffset, value) {\n set(this, 1, byteOffset, packI8, value);\n },\n setUint8: function setUint8(byteOffset, value) {\n set(this, 1, byteOffset, packI8, value);\n },\n setInt16: function setInt16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packI16, value, arguments[2]);\n },\n setUint16: function setUint16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packI16, value, arguments[2]);\n },\n setInt32: function setInt32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packI32, value, arguments[2]);\n },\n setUint32: function setUint32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packI32, value, arguments[2]);\n },\n setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packF32, value, arguments[2]);\n },\n setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {\n set(this, 8, byteOffset, packF64, value, arguments[2]);\n }\n });\n} else {\n if (!fails(function () {\n $ArrayBuffer(1);\n }) || !fails(function () {\n new $ArrayBuffer(-1); // eslint-disable-line no-new\n }) || fails(function () {\n new $ArrayBuffer(); // eslint-disable-line no-new\n new $ArrayBuffer(1.5); // eslint-disable-line no-new\n new $ArrayBuffer(NaN); // eslint-disable-line no-new\n return $ArrayBuffer.name != ARRAY_BUFFER;\n })) {\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, $ArrayBuffer);\n return new BaseBuffer(toIndex(length));\n };\n var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE];\n for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) {\n if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]);\n }\n if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer;\n }\n // iOS Safari 7.x bug\n var view = new $DataView(new $ArrayBuffer(2));\n var $setInt8 = $DataView[PROTOTYPE].setInt8;\n view.setInt8(0, 2147483648);\n view.setInt8(1, 2147483649);\n if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], {\n setInt8: function setInt8(byteOffset, value) {\n $setInt8.call(this, byteOffset, value << 24 >> 24);\n },\n setUint8: function setUint8(byteOffset, value) {\n $setInt8.call(this, byteOffset, value << 24 >> 24);\n }\n }, true);\n}\nsetToStringTag($ArrayBuffer, ARRAY_BUFFER);\nsetToStringTag($DataView, DATA_VIEW);\nhide($DataView[PROTOTYPE], $typed.VIEW, true);\nexports[ARRAY_BUFFER] = $ArrayBuffer;\nexports[DATA_VIEW] = $DataView;\n","// 7.3.20 SpeciesConstructor(O, defaultConstructor)\nvar anObject = require('./_an-object');\nvar aFunction = require('./_a-function');\nvar SPECIES = require('./_wks')('species');\nmodule.exports = function (O, D) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);\n};\n","'use strict';\nvar global = require('./_global');\nvar dP = require('./_object-dp');\nvar DESCRIPTORS = require('./_descriptors');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (KEY) {\n var C = global[KEY];\n if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n};\n","'use strict';\nvar $export = require('./_export');\nvar $typed = require('./_typed');\nvar buffer = require('./_typed-buffer');\nvar anObject = require('./_an-object');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar toLength = require('./_to-length');\nvar isObject = require('./_is-object');\nvar ArrayBuffer = require('./_global').ArrayBuffer;\nvar speciesConstructor = require('./_species-constructor');\nvar $ArrayBuffer = buffer.ArrayBuffer;\nvar $DataView = buffer.DataView;\nvar $isView = $typed.ABV && ArrayBuffer.isView;\nvar $slice = $ArrayBuffer.prototype.slice;\nvar VIEW = $typed.VIEW;\nvar ARRAY_BUFFER = 'ArrayBuffer';\n\n$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer });\n\n$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, {\n // 24.1.3.1 ArrayBuffer.isView(arg)\n isView: function isView(it) {\n return $isView && $isView(it) || isObject(it) && VIEW in it;\n }\n});\n\n$export($export.P + $export.U + $export.F * require('./_fails')(function () {\n return !new $ArrayBuffer(2).slice(1, undefined).byteLength;\n}), ARRAY_BUFFER, {\n // 24.1.4.3 ArrayBuffer.prototype.slice(start, end)\n slice: function slice(start, end) {\n if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix\n var len = anObject(this).byteLength;\n var first = toAbsoluteIndex(start, len);\n var final = toAbsoluteIndex(end === undefined ? len : end, len);\n var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(final - first));\n var viewS = new $DataView(this);\n var viewT = new $DataView(result);\n var index = 0;\n while (first < final) {\n viewT.setUint8(index++, viewS.getUint8(first++));\n } return result;\n }\n});\n\nrequire('./_set-species')(ARRAY_BUFFER);\n","// getting tag from 19.1.3.6 Object.prototype.toString()\nvar cof = require('./_cof');\nvar TAG = require('./_wks')('toStringTag');\n// ES3 wrong here\nvar ARG = cof(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (e) { /* empty */ }\n};\n\nmodule.exports = function (it) {\n var O, T, B;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T\n // builtinTag case\n : ARG ? cof(O)\n // ES3 arguments fallback\n : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;\n};\n","// check on default Array iterator\nvar Iterators = require('./_iterators');\nvar ITERATOR = require('./_wks')('iterator');\nvar ArrayProto = Array.prototype;\n\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);\n};\n","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal');\nvar enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n","var dP = require('./_object-dp');\nvar anObject = require('./_an-object');\nvar getKeys = require('./_object-keys');\n\nmodule.exports = require('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n","var document = require('./_global').document;\nmodule.exports = document && document.documentElement;\n","// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = require('./_an-object');\nvar dPs = require('./_object-dps');\nvar enumBugKeys = require('./_enum-bug-keys');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar Empty = function () { /* empty */ };\nvar PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = require('./_dom-create')('iframe');\n var i = enumBugKeys.length;\n var lt = '<';\n var gt = '>';\n var iframeDocument;\n iframe.style.display = 'none';\n require('./_html').appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];\n return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty();\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : dPs(result, Properties);\n};\n","// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = require('./_has');\nvar toObject = require('./_to-object');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n","var classof = require('./_classof');\nvar ITERATOR = require('./_wks')('iterator');\nvar Iterators = require('./_iterators');\nmodule.exports = require('./_core').getIteratorMethod = function (it) {\n if (it != undefined) return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n","// 7.2.2 IsArray(argument)\nvar cof = require('./_cof');\nmodule.exports = Array.isArray || function isArray(arg) {\n return cof(arg) == 'Array';\n};\n","var isObject = require('./_is-object');\nvar isArray = require('./_is-array');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (original) {\n var C;\n if (isArray(original)) {\n C = original.constructor;\n // cross-realm fallback\n if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;\n if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return C === undefined ? Array : C;\n};\n","// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = require('./_array-species-constructor');\n\nmodule.exports = function (original, length) {\n return new (speciesConstructor(original))(length);\n};\n","// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = require('./_ctx');\nvar IObject = require('./_iobject');\nvar toObject = require('./_to-object');\nvar toLength = require('./_to-length');\nvar asc = require('./_array-species-create');\nmodule.exports = function (TYPE, $create) {\n var IS_MAP = TYPE == 1;\n var IS_FILTER = TYPE == 2;\n var IS_SOME = TYPE == 3;\n var IS_EVERY = TYPE == 4;\n var IS_FIND_INDEX = TYPE == 6;\n var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n var create = $create || asc;\n return function ($this, callbackfn, that) {\n var O = toObject($this);\n var self = IObject(O);\n var f = ctx(callbackfn, that, 3);\n var length = toLength(self.length);\n var index = 0;\n var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;\n var val, res;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n val = self[index];\n res = f(val, index, O);\n if (TYPE) {\n if (IS_MAP) result[index] = res; // map\n else if (res) switch (TYPE) {\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if (IS_EVERY) return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};\n","// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = require('./_wks')('unscopables');\nvar ArrayProto = Array.prototype;\nif (ArrayProto[UNSCOPABLES] == undefined) require('./_hide')(ArrayProto, UNSCOPABLES, {});\nmodule.exports = function (key) {\n ArrayProto[UNSCOPABLES][key] = true;\n};\n","module.exports = function (done, value) {\n return { value: value, done: !!done };\n};\n","'use strict';\nvar create = require('./_object-create');\nvar descriptor = require('./_property-desc');\nvar setToStringTag = require('./_set-to-string-tag');\nvar IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\nrequire('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function () { return this; });\n\nmodule.exports = function (Constructor, NAME, next) {\n Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n","'use strict';\nvar LIBRARY = require('./_library');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar hide = require('./_hide');\nvar Iterators = require('./_iterators');\nvar $iterCreate = require('./_iter-create');\nvar setToStringTag = require('./_set-to-string-tag');\nvar getPrototypeOf = require('./_object-gpo');\nvar ITERATOR = require('./_wks')('iterator');\nvar BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`\nvar FF_ITERATOR = '@@iterator';\nvar KEYS = 'keys';\nvar VALUES = 'values';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\n $iterCreate(Constructor, NAME, next);\n var getMethod = function (kind) {\n if (!BUGGY && kind in proto) return proto[kind];\n switch (kind) {\n case KEYS: return function keys() { return new Constructor(this, kind); };\n case VALUES: return function values() { return new Constructor(this, kind); };\n } return function entries() { return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator';\n var DEF_VALUES = DEFAULT == VALUES;\n var VALUES_BUG = false;\n var proto = Base.prototype;\n var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\n var $default = $native || getMethod(DEFAULT);\n var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;\n var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;\n var methods, key, IteratorPrototype;\n // Fix native\n if ($anyNative) {\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));\n if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEF_VALUES && $native && $native.name !== VALUES) {\n VALUES_BUG = true;\n $default = function values() { return $native.call(this); };\n }\n // Define iterator\n if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\n hide(proto, ITERATOR, $default);\n }\n // Plug for library\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n if (DEFAULT) {\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if (FORCED) for (key in methods) {\n if (!(key in proto)) redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n","'use strict';\nvar addToUnscopables = require('./_add-to-unscopables');\nvar step = require('./_iter-step');\nvar Iterators = require('./_iterators');\nvar toIObject = require('./_to-iobject');\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = require('./_iter-define')(Array, 'Array', function (iterated, kind) {\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var kind = this._k;\n var index = this._i++;\n if (!O || index >= O.length) {\n this._t = undefined;\n return step(1);\n }\n if (kind == 'keys') return step(0, index);\n if (kind == 'values') return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n","var ITERATOR = require('./_wks')('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var riter = [7][ITERATOR]();\n riter['return'] = function () { SAFE_CLOSING = true; };\n // eslint-disable-next-line no-throw-literal\n Array.from(riter, function () { throw 2; });\n} catch (e) { /* empty */ }\n\nmodule.exports = function (exec, skipClosing) {\n if (!skipClosing && !SAFE_CLOSING) return false;\n var safe = false;\n try {\n var arr = [7];\n var iter = arr[ITERATOR]();\n iter.next = function () { return { done: safe = true }; };\n arr[ITERATOR] = function () { return iter; };\n exec(arr);\n } catch (e) { /* empty */ }\n return safe;\n};\n","// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)\n'use strict';\nvar toObject = require('./_to-object');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar toLength = require('./_to-length');\n\nmodule.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {\n var O = toObject(this);\n var len = toLength(O.length);\n var to = toAbsoluteIndex(target, len);\n var from = toAbsoluteIndex(start, len);\n var end = arguments.length > 2 ? arguments[2] : undefined;\n var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);\n var inc = 1;\n if (from < to && to < from + count) {\n inc = -1;\n from += count - 1;\n to += count - 1;\n }\n while (count-- > 0) {\n if (from in O) O[to] = O[from];\n else delete O[to];\n to += inc;\n from += inc;\n } return O;\n};\n","exports.f = {}.propertyIsEnumerable;\n","var pIE = require('./_object-pie');\nvar createDesc = require('./_property-desc');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar has = require('./_has');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = require('./_descriptors') ? gOPD : function getOwnPropertyDescriptor(O, P) {\n O = toIObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return gOPD(O, P);\n } catch (e) { /* empty */ }\n if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);\n};\n","'use strict';\nif (require('./_descriptors')) {\n var LIBRARY = require('./_library');\n var global = require('./_global');\n var fails = require('./_fails');\n var $export = require('./_export');\n var $typed = require('./_typed');\n var $buffer = require('./_typed-buffer');\n var ctx = require('./_ctx');\n var anInstance = require('./_an-instance');\n var propertyDesc = require('./_property-desc');\n var hide = require('./_hide');\n var redefineAll = require('./_redefine-all');\n var toInteger = require('./_to-integer');\n var toLength = require('./_to-length');\n var toIndex = require('./_to-index');\n var toAbsoluteIndex = require('./_to-absolute-index');\n var toPrimitive = require('./_to-primitive');\n var has = require('./_has');\n var classof = require('./_classof');\n var isObject = require('./_is-object');\n var toObject = require('./_to-object');\n var isArrayIter = require('./_is-array-iter');\n var create = require('./_object-create');\n var getPrototypeOf = require('./_object-gpo');\n var gOPN = require('./_object-gopn').f;\n var getIterFn = require('./core.get-iterator-method');\n var uid = require('./_uid');\n var wks = require('./_wks');\n var createArrayMethod = require('./_array-methods');\n var createArrayIncludes = require('./_array-includes');\n var speciesConstructor = require('./_species-constructor');\n var ArrayIterators = require('./es6.array.iterator');\n var Iterators = require('./_iterators');\n var $iterDetect = require('./_iter-detect');\n var setSpecies = require('./_set-species');\n var arrayFill = require('./_array-fill');\n var arrayCopyWithin = require('./_array-copy-within');\n var $DP = require('./_object-dp');\n var $GOPD = require('./_object-gopd');\n var dP = $DP.f;\n var gOPD = $GOPD.f;\n var RangeError = global.RangeError;\n var TypeError = global.TypeError;\n var Uint8Array = global.Uint8Array;\n var ARRAY_BUFFER = 'ArrayBuffer';\n var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER;\n var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';\n var PROTOTYPE = 'prototype';\n var ArrayProto = Array[PROTOTYPE];\n var $ArrayBuffer = $buffer.ArrayBuffer;\n var $DataView = $buffer.DataView;\n var arrayForEach = createArrayMethod(0);\n var arrayFilter = createArrayMethod(2);\n var arraySome = createArrayMethod(3);\n var arrayEvery = createArrayMethod(4);\n var arrayFind = createArrayMethod(5);\n var arrayFindIndex = createArrayMethod(6);\n var arrayIncludes = createArrayIncludes(true);\n var arrayIndexOf = createArrayIncludes(false);\n var arrayValues = ArrayIterators.values;\n var arrayKeys = ArrayIterators.keys;\n var arrayEntries = ArrayIterators.entries;\n var arrayLastIndexOf = ArrayProto.lastIndexOf;\n var arrayReduce = ArrayProto.reduce;\n var arrayReduceRight = ArrayProto.reduceRight;\n var arrayJoin = ArrayProto.join;\n var arraySort = ArrayProto.sort;\n var arraySlice = ArrayProto.slice;\n var arrayToString = ArrayProto.toString;\n var arrayToLocaleString = ArrayProto.toLocaleString;\n var ITERATOR = wks('iterator');\n var TAG = wks('toStringTag');\n var TYPED_CONSTRUCTOR = uid('typed_constructor');\n var DEF_CONSTRUCTOR = uid('def_constructor');\n var ALL_CONSTRUCTORS = $typed.CONSTR;\n var TYPED_ARRAY = $typed.TYPED;\n var VIEW = $typed.VIEW;\n var WRONG_LENGTH = 'Wrong length!';\n\n var $map = createArrayMethod(1, function (O, length) {\n return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length);\n });\n\n var LITTLE_ENDIAN = fails(function () {\n // eslint-disable-next-line no-undef\n return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;\n });\n\n var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () {\n new Uint8Array(1).set({});\n });\n\n var toOffset = function (it, BYTES) {\n var offset = toInteger(it);\n if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!');\n return offset;\n };\n\n var validate = function (it) {\n if (isObject(it) && TYPED_ARRAY in it) return it;\n throw TypeError(it + ' is not a typed array!');\n };\n\n var allocate = function (C, length) {\n if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) {\n throw TypeError('It is not a typed array constructor!');\n } return new C(length);\n };\n\n var speciesFromList = function (O, list) {\n return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list);\n };\n\n var fromList = function (C, list) {\n var index = 0;\n var length = list.length;\n var result = allocate(C, length);\n while (length > index) result[index] = list[index++];\n return result;\n };\n\n var addGetter = function (it, key, internal) {\n dP(it, key, { get: function () { return this._d[internal]; } });\n };\n\n var $from = function from(source /* , mapfn, thisArg */) {\n var O = toObject(source);\n var aLen = arguments.length;\n var mapfn = aLen > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var iterFn = getIterFn(O);\n var i, length, values, result, step, iterator;\n if (iterFn != undefined && !isArrayIter(iterFn)) {\n for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) {\n values.push(step.value);\n } O = values;\n }\n if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2);\n for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) {\n result[i] = mapping ? mapfn(O[i], i) : O[i];\n }\n return result;\n };\n\n var $of = function of(/* ...items */) {\n var index = 0;\n var length = arguments.length;\n var result = allocate(this, length);\n while (length > index) result[index] = arguments[index++];\n return result;\n };\n\n // iOS Safari 6.x fails here\n var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); });\n\n var $toLocaleString = function toLocaleString() {\n return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments);\n };\n\n var proto = {\n copyWithin: function copyWithin(target, start /* , end */) {\n return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined);\n },\n every: function every(callbackfn /* , thisArg */) {\n return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars\n return arrayFill.apply(validate(this), arguments);\n },\n filter: function filter(callbackfn /* , thisArg */) {\n return speciesFromList(this, arrayFilter(validate(this), callbackfn,\n arguments.length > 1 ? arguments[1] : undefined));\n },\n find: function find(predicate /* , thisArg */) {\n return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n },\n findIndex: function findIndex(predicate /* , thisArg */) {\n return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n },\n forEach: function forEach(callbackfn /* , thisArg */) {\n arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n indexOf: function indexOf(searchElement /* , fromIndex */) {\n return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n },\n includes: function includes(searchElement /* , fromIndex */) {\n return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n },\n join: function join(separator) { // eslint-disable-line no-unused-vars\n return arrayJoin.apply(validate(this), arguments);\n },\n lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars\n return arrayLastIndexOf.apply(validate(this), arguments);\n },\n map: function map(mapfn /* , thisArg */) {\n return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars\n return arrayReduce.apply(validate(this), arguments);\n },\n reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars\n return arrayReduceRight.apply(validate(this), arguments);\n },\n reverse: function reverse() {\n var that = this;\n var length = validate(that).length;\n var middle = Math.floor(length / 2);\n var index = 0;\n var value;\n while (index < middle) {\n value = that[index];\n that[index++] = that[--length];\n that[length] = value;\n } return that;\n },\n some: function some(callbackfn /* , thisArg */) {\n return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n sort: function sort(comparefn) {\n return arraySort.call(validate(this), comparefn);\n },\n subarray: function subarray(begin, end) {\n var O = validate(this);\n var length = O.length;\n var $begin = toAbsoluteIndex(begin, length);\n return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))(\n O.buffer,\n O.byteOffset + $begin * O.BYTES_PER_ELEMENT,\n toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin)\n );\n }\n };\n\n var $slice = function slice(start, end) {\n return speciesFromList(this, arraySlice.call(validate(this), start, end));\n };\n\n var $set = function set(arrayLike /* , offset */) {\n validate(this);\n var offset = toOffset(arguments[1], 1);\n var length = this.length;\n var src = toObject(arrayLike);\n var len = toLength(src.length);\n var index = 0;\n if (len + offset > length) throw RangeError(WRONG_LENGTH);\n while (index < len) this[offset + index] = src[index++];\n };\n\n var $iterators = {\n entries: function entries() {\n return arrayEntries.call(validate(this));\n },\n keys: function keys() {\n return arrayKeys.call(validate(this));\n },\n values: function values() {\n return arrayValues.call(validate(this));\n }\n };\n\n var isTAIndex = function (target, key) {\n return isObject(target)\n && target[TYPED_ARRAY]\n && typeof key != 'symbol'\n && key in target\n && String(+key) == String(key);\n };\n var $getDesc = function getOwnPropertyDescriptor(target, key) {\n return isTAIndex(target, key = toPrimitive(key, true))\n ? propertyDesc(2, target[key])\n : gOPD(target, key);\n };\n var $setDesc = function defineProperty(target, key, desc) {\n if (isTAIndex(target, key = toPrimitive(key, true))\n && isObject(desc)\n && has(desc, 'value')\n && !has(desc, 'get')\n && !has(desc, 'set')\n // TODO: add validation descriptor w/o calling accessors\n && !desc.configurable\n && (!has(desc, 'writable') || desc.writable)\n && (!has(desc, 'enumerable') || desc.enumerable)\n ) {\n target[key] = desc.value;\n return target;\n } return dP(target, key, desc);\n };\n\n if (!ALL_CONSTRUCTORS) {\n $GOPD.f = $getDesc;\n $DP.f = $setDesc;\n }\n\n $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', {\n getOwnPropertyDescriptor: $getDesc,\n defineProperty: $setDesc\n });\n\n if (fails(function () { arrayToString.call({}); })) {\n arrayToString = arrayToLocaleString = function toString() {\n return arrayJoin.call(this);\n };\n }\n\n var $TypedArrayPrototype$ = redefineAll({}, proto);\n redefineAll($TypedArrayPrototype$, $iterators);\n hide($TypedArrayPrototype$, ITERATOR, $iterators.values);\n redefineAll($TypedArrayPrototype$, {\n slice: $slice,\n set: $set,\n constructor: function () { /* noop */ },\n toString: arrayToString,\n toLocaleString: $toLocaleString\n });\n addGetter($TypedArrayPrototype$, 'buffer', 'b');\n addGetter($TypedArrayPrototype$, 'byteOffset', 'o');\n addGetter($TypedArrayPrototype$, 'byteLength', 'l');\n addGetter($TypedArrayPrototype$, 'length', 'e');\n dP($TypedArrayPrototype$, TAG, {\n get: function () { return this[TYPED_ARRAY]; }\n });\n\n // eslint-disable-next-line max-statements\n module.exports = function (KEY, BYTES, wrapper, CLAMPED) {\n CLAMPED = !!CLAMPED;\n var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array';\n var GETTER = 'get' + KEY;\n var SETTER = 'set' + KEY;\n var TypedArray = global[NAME];\n var Base = TypedArray || {};\n var TAC = TypedArray && getPrototypeOf(TypedArray);\n var FORCED = !TypedArray || !$typed.ABV;\n var O = {};\n var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE];\n var getter = function (that, index) {\n var data = that._d;\n return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN);\n };\n var setter = function (that, index, value) {\n var data = that._d;\n if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff;\n data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN);\n };\n var addElement = function (that, index) {\n dP(that, index, {\n get: function () {\n return getter(this, index);\n },\n set: function (value) {\n return setter(this, index, value);\n },\n enumerable: true\n });\n };\n if (FORCED) {\n TypedArray = wrapper(function (that, data, $offset, $length) {\n anInstance(that, TypedArray, NAME, '_d');\n var index = 0;\n var offset = 0;\n var buffer, byteLength, length, klass;\n if (!isObject(data)) {\n length = toIndex(data);\n byteLength = length * BYTES;\n buffer = new $ArrayBuffer(byteLength);\n } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {\n buffer = data;\n offset = toOffset($offset, BYTES);\n var $len = data.byteLength;\n if ($length === undefined) {\n if ($len % BYTES) throw RangeError(WRONG_LENGTH);\n byteLength = $len - offset;\n if (byteLength < 0) throw RangeError(WRONG_LENGTH);\n } else {\n byteLength = toLength($length) * BYTES;\n if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH);\n }\n length = byteLength / BYTES;\n } else if (TYPED_ARRAY in data) {\n return fromList(TypedArray, data);\n } else {\n return $from.call(TypedArray, data);\n }\n hide(that, '_d', {\n b: buffer,\n o: offset,\n l: byteLength,\n e: length,\n v: new $DataView(buffer)\n });\n while (index < length) addElement(that, index++);\n });\n TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$);\n hide(TypedArrayPrototype, 'constructor', TypedArray);\n } else if (!fails(function () {\n TypedArray(1);\n }) || !fails(function () {\n new TypedArray(-1); // eslint-disable-line no-new\n }) || !$iterDetect(function (iter) {\n new TypedArray(); // eslint-disable-line no-new\n new TypedArray(null); // eslint-disable-line no-new\n new TypedArray(1.5); // eslint-disable-line no-new\n new TypedArray(iter); // eslint-disable-line no-new\n }, true)) {\n TypedArray = wrapper(function (that, data, $offset, $length) {\n anInstance(that, TypedArray, NAME);\n var klass;\n // `ws` module bug, temporarily remove validation length for Uint8Array\n // https://github.com/websockets/ws/pull/645\n if (!isObject(data)) return new Base(toIndex(data));\n if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {\n return $length !== undefined\n ? new Base(data, toOffset($offset, BYTES), $length)\n : $offset !== undefined\n ? new Base(data, toOffset($offset, BYTES))\n : new Base(data);\n }\n if (TYPED_ARRAY in data) return fromList(TypedArray, data);\n return $from.call(TypedArray, data);\n });\n arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) {\n if (!(key in TypedArray)) hide(TypedArray, key, Base[key]);\n });\n TypedArray[PROTOTYPE] = TypedArrayPrototype;\n if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray;\n }\n var $nativeIterator = TypedArrayPrototype[ITERATOR];\n var CORRECT_ITER_NAME = !!$nativeIterator\n && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined);\n var $iterator = $iterators.values;\n hide(TypedArray, TYPED_CONSTRUCTOR, true);\n hide(TypedArrayPrototype, TYPED_ARRAY, NAME);\n hide(TypedArrayPrototype, VIEW, true);\n hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray);\n\n if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) {\n dP(TypedArrayPrototype, TAG, {\n get: function () { return NAME; }\n });\n }\n\n O[NAME] = TypedArray;\n\n $export($export.G + $export.W + $export.F * (TypedArray != Base), O);\n\n $export($export.S, NAME, {\n BYTES_PER_ELEMENT: BYTES\n });\n\n $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, {\n from: $from,\n of: $of\n });\n\n if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES);\n\n $export($export.P, NAME, proto);\n\n setSpecies(NAME);\n\n $export($export.P + $export.F * FORCED_SET, NAME, { set: $set });\n\n $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators);\n\n if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString;\n\n $export($export.P + $export.F * fails(function () {\n new TypedArray(1).slice();\n }), NAME, { slice: $slice });\n\n $export($export.P + $export.F * (fails(function () {\n return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString();\n }) || !fails(function () {\n TypedArrayPrototype.toLocaleString.call([1, 2]);\n })), NAME, { toLocaleString: $toLocaleString });\n\n Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator;\n if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator);\n };\n} else module.exports = function () { /* empty */ };\n","require('./_typed-array')('Int8', 1, function (init) {\n return function Int8Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Uint8', 1, function (init) {\n return function Uint8Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Uint8', 1, function (init) {\n return function Uint8ClampedArray(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n}, true);\n","require('./_typed-array')('Int16', 2, function (init) {\n return function Int16Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Uint16', 2, function (init) {\n return function Uint16Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Int32', 4, function (init) {\n return function Int32Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Uint32', 4, function (init) {\n return function Uint32Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Float32', 4, function (init) {\n return function Float32Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Float64', 8, function (init) {\n return function Float64Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","// call something on iterator step with safe closing on error\nvar anObject = require('./_an-object');\nmodule.exports = function (iterator, fn, value, entries) {\n try {\n return entries ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch (e) {\n var ret = iterator['return'];\n if (ret !== undefined) anObject(ret.call(iterator));\n throw e;\n }\n};\n","var ctx = require('./_ctx');\nvar call = require('./_iter-call');\nvar isArrayIter = require('./_is-array-iter');\nvar anObject = require('./_an-object');\nvar toLength = require('./_to-length');\nvar getIterFn = require('./core.get-iterator-method');\nvar BREAK = {};\nvar RETURN = {};\nvar exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {\n var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);\n var f = ctx(fn, that, entries ? 2 : 1);\n var index = 0;\n var length, step, iterator, result;\n if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');\n // fast case for arrays with default iterator\n if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {\n result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);\n if (result === BREAK || result === RETURN) return result;\n } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {\n result = call(iterator, f, step.value, entries);\n if (result === BREAK || result === RETURN) return result;\n }\n};\nexports.BREAK = BREAK;\nexports.RETURN = RETURN;\n","var META = require('./_uid')('meta');\nvar isObject = require('./_is-object');\nvar has = require('./_has');\nvar setDesc = require('./_object-dp').f;\nvar id = 0;\nvar isExtensible = Object.isExtensible || function () {\n return true;\n};\nvar FREEZE = !require('./_fails')(function () {\n return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function (it) {\n setDesc(it, META, { value: {\n i: 'O' + ++id, // object ID\n w: {} // weak collections IDs\n } });\n};\nvar fastKey = function (it, create) {\n // return primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMeta(it);\n // return object ID\n } return it[META].i;\n};\nvar getWeak = function (it, create) {\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMeta(it);\n // return hash weak collections IDs\n } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);\n return it;\n};\nvar meta = module.exports = {\n KEY: META,\n NEED: false,\n fastKey: fastKey,\n getWeak: getWeak,\n onFreeze: onFreeze\n};\n","var isObject = require('./_is-object');\nmodule.exports = function (it, TYPE) {\n if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');\n return it;\n};\n","'use strict';\nvar dP = require('./_object-dp').f;\nvar create = require('./_object-create');\nvar redefineAll = require('./_redefine-all');\nvar ctx = require('./_ctx');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar $iterDefine = require('./_iter-define');\nvar step = require('./_iter-step');\nvar setSpecies = require('./_set-species');\nvar DESCRIPTORS = require('./_descriptors');\nvar fastKey = require('./_meta').fastKey;\nvar validate = require('./_validate-collection');\nvar SIZE = DESCRIPTORS ? '_s' : 'size';\n\nvar getEntry = function (that, key) {\n // fast case\n var index = fastKey(key);\n var entry;\n if (index !== 'F') return that._i[index];\n // frozen object case\n for (entry = that._f; entry; entry = entry.n) {\n if (entry.k == key) return entry;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = create(null); // index\n that._f = undefined; // first entry\n that._l = undefined; // last entry\n that[SIZE] = 0; // size\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.1.3.1 Map.prototype.clear()\n // 23.2.3.2 Set.prototype.clear()\n clear: function clear() {\n for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {\n entry.r = true;\n if (entry.p) entry.p = entry.p.n = undefined;\n delete data[entry.i];\n }\n that._f = that._l = undefined;\n that[SIZE] = 0;\n },\n // 23.1.3.3 Map.prototype.delete(key)\n // 23.2.3.4 Set.prototype.delete(value)\n 'delete': function (key) {\n var that = validate(this, NAME);\n var entry = getEntry(that, key);\n if (entry) {\n var next = entry.n;\n var prev = entry.p;\n delete that._i[entry.i];\n entry.r = true;\n if (prev) prev.n = next;\n if (next) next.p = prev;\n if (that._f == entry) that._f = next;\n if (that._l == entry) that._l = prev;\n that[SIZE]--;\n } return !!entry;\n },\n // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)\n // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)\n forEach: function forEach(callbackfn /* , that = undefined */) {\n validate(this, NAME);\n var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);\n var entry;\n while (entry = entry ? entry.n : this._f) {\n f(entry.v, entry.k, this);\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n }\n },\n // 23.1.3.7 Map.prototype.has(key)\n // 23.2.3.7 Set.prototype.has(value)\n has: function has(key) {\n return !!getEntry(validate(this, NAME), key);\n }\n });\n if (DESCRIPTORS) dP(C.prototype, 'size', {\n get: function () {\n return validate(this, NAME)[SIZE];\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var entry = getEntry(that, key);\n var prev, index;\n // change existing entry\n if (entry) {\n entry.v = value;\n // create new entry\n } else {\n that._l = entry = {\n i: index = fastKey(key, true), // <- index\n k: key, // <- key\n v: value, // <- value\n p: prev = that._l, // <- previous entry\n n: undefined, // <- next entry\n r: false // <- removed\n };\n if (!that._f) that._f = entry;\n if (prev) prev.n = entry;\n that[SIZE]++;\n // add to index\n if (index !== 'F') that._i[index] = entry;\n } return that;\n },\n getEntry: getEntry,\n setStrong: function (C, NAME, IS_MAP) {\n // add .keys, .values, .entries, [@@iterator]\n // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11\n $iterDefine(C, NAME, function (iterated, kind) {\n this._t = validate(iterated, NAME); // target\n this._k = kind; // kind\n this._l = undefined; // previous\n }, function () {\n var that = this;\n var kind = that._k;\n var entry = that._l;\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n // get next entry\n if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {\n // or finish the iteration\n that._t = undefined;\n return step(1);\n }\n // return step by kind\n if (kind == 'keys') return step(0, entry.k);\n if (kind == 'values') return step(0, entry.v);\n return step(0, [entry.k, entry.v]);\n }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);\n\n // add [@@species], 23.1.2.2, 23.2.2.2\n setSpecies(NAME);\n }\n};\n","// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nvar isObject = require('./_is-object');\nvar anObject = require('./_an-object');\nvar check = function (O, proto) {\n anObject(O);\n if (!isObject(proto) && proto !== null) throw TypeError(proto + \": can't set as prototype!\");\n};\nmodule.exports = {\n set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line\n function (test, buggy, set) {\n try {\n set = require('./_ctx')(Function.call, require('./_object-gopd').f(Object.prototype, '__proto__').set, 2);\n set(test, []);\n buggy = !(test instanceof Array);\n } catch (e) { buggy = true; }\n return function setPrototypeOf(O, proto) {\n check(O, proto);\n if (buggy) O.__proto__ = proto;\n else set(O, proto);\n return O;\n };\n }({}, false) : undefined),\n check: check\n};\n","var isObject = require('./_is-object');\nvar setPrototypeOf = require('./_set-proto').set;\nmodule.exports = function (that, target, C) {\n var S = target.constructor;\n var P;\n if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) {\n setPrototypeOf(that, P);\n } return that;\n};\n","'use strict';\nvar global = require('./_global');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar redefineAll = require('./_redefine-all');\nvar meta = require('./_meta');\nvar forOf = require('./_for-of');\nvar anInstance = require('./_an-instance');\nvar isObject = require('./_is-object');\nvar fails = require('./_fails');\nvar $iterDetect = require('./_iter-detect');\nvar setToStringTag = require('./_set-to-string-tag');\nvar inheritIfRequired = require('./_inherit-if-required');\n\nmodule.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {\n var Base = global[NAME];\n var C = Base;\n var ADDER = IS_MAP ? 'set' : 'add';\n var proto = C && C.prototype;\n var O = {};\n var fixMethod = function (KEY) {\n var fn = proto[KEY];\n redefine(proto, KEY,\n KEY == 'delete' ? function (a) {\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'has' ? function has(a) {\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'get' ? function get(a) {\n return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; }\n : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; }\n );\n };\n if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {\n new C().entries().next();\n }))) {\n // create collection constructor\n C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);\n redefineAll(C.prototype, methods);\n meta.NEED = true;\n } else {\n var instance = new C();\n // early implementations not supports chaining\n var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;\n // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false\n var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });\n // most early implementations doesn't supports iterables, most modern - not close it correctly\n var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new\n // for early implementations -0 and +0 not the same\n var BUGGY_ZERO = !IS_WEAK && fails(function () {\n // V8 ~ Chromium 42- fails only with 5+ elements\n var $instance = new C();\n var index = 5;\n while (index--) $instance[ADDER](index, index);\n return !$instance.has(-0);\n });\n if (!ACCEPT_ITERABLES) {\n C = wrapper(function (target, iterable) {\n anInstance(target, C, NAME);\n var that = inheritIfRequired(new Base(), target, C);\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n return that;\n });\n C.prototype = proto;\n proto.constructor = C;\n }\n if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {\n fixMethod('delete');\n fixMethod('has');\n IS_MAP && fixMethod('get');\n }\n if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);\n // weak collections should not contains .clear method\n if (IS_WEAK && proto.clear) delete proto.clear;\n }\n\n setToStringTag(C, NAME);\n\n O[NAME] = C;\n $export($export.G + $export.W + $export.F * (C != Base), O);\n\n if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);\n\n return C;\n};\n","'use strict';\nvar strong = require('./_collection-strong');\nvar validate = require('./_validate-collection');\nvar MAP = 'Map';\n\n// 23.1 Map Objects\nmodule.exports = require('./_collection')(MAP, function (get) {\n return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.1.3.6 Map.prototype.get(key)\n get: function get(key) {\n var entry = strong.getEntry(validate(this, MAP), key);\n return entry && entry.v;\n },\n // 23.1.3.9 Map.prototype.set(key, value)\n set: function set(key, value) {\n return strong.def(validate(this, MAP), key === 0 ? 0 : key, value);\n }\n}, strong, true);\n","'use strict';\nvar strong = require('./_collection-strong');\nvar validate = require('./_validate-collection');\nvar SET = 'Set';\n\n// 23.2 Set Objects\nmodule.exports = require('./_collection')(SET, function (get) {\n return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.2.3.1 Set.prototype.add(value)\n add: function add(value) {\n return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);\n }\n}, strong);\n","exports.f = Object.getOwnPropertySymbols;\n","'use strict';\n// 19.1.2.1 Object.assign(target, source, ...)\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nvar toObject = require('./_to-object');\nvar IObject = require('./_iobject');\nvar $assign = Object.assign;\n\n// should work with symbols and should have deterministic property order (V8 bug)\nmodule.exports = !$assign || require('./_fails')(function () {\n var A = {};\n var B = {};\n // eslint-disable-next-line no-undef\n var S = Symbol();\n var K = 'abcdefghijklmnopqrst';\n A[S] = 7;\n K.split('').forEach(function (k) { B[k] = k; });\n return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\n var T = toObject(target);\n var aLen = arguments.length;\n var index = 1;\n var getSymbols = gOPS.f;\n var isEnum = pIE.f;\n while (aLen > index) {\n var S = IObject(arguments[index++]);\n var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];\n } return T;\n} : $assign;\n","'use strict';\nvar redefineAll = require('./_redefine-all');\nvar getWeak = require('./_meta').getWeak;\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar createArrayMethod = require('./_array-methods');\nvar $has = require('./_has');\nvar validate = require('./_validate-collection');\nvar arrayFind = createArrayMethod(5);\nvar arrayFindIndex = createArrayMethod(6);\nvar id = 0;\n\n// fallback for uncaught frozen keys\nvar uncaughtFrozenStore = function (that) {\n return that._l || (that._l = new UncaughtFrozenStore());\n};\nvar UncaughtFrozenStore = function () {\n this.a = [];\n};\nvar findUncaughtFrozen = function (store, key) {\n return arrayFind(store.a, function (it) {\n return it[0] === key;\n });\n};\nUncaughtFrozenStore.prototype = {\n get: function (key) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) return entry[1];\n },\n has: function (key) {\n return !!findUncaughtFrozen(this, key);\n },\n set: function (key, value) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) entry[1] = value;\n else this.a.push([key, value]);\n },\n 'delete': function (key) {\n var index = arrayFindIndex(this.a, function (it) {\n return it[0] === key;\n });\n if (~index) this.a.splice(index, 1);\n return !!~index;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = id++; // collection id\n that._l = undefined; // leak store for uncaught frozen objects\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.3.3.2 WeakMap.prototype.delete(key)\n // 23.4.3.3 WeakSet.prototype.delete(value)\n 'delete': function (key) {\n if (!isObject(key)) return false;\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key);\n return data && $has(data, this._i) && delete data[this._i];\n },\n // 23.3.3.4 WeakMap.prototype.has(key)\n // 23.4.3.4 WeakSet.prototype.has(value)\n has: function has(key) {\n if (!isObject(key)) return false;\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key);\n return data && $has(data, this._i);\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var data = getWeak(anObject(key), true);\n if (data === true) uncaughtFrozenStore(that).set(key, value);\n else data[that._i] = value;\n return that;\n },\n ufstore: uncaughtFrozenStore\n};\n","'use strict';\nvar each = require('./_array-methods')(0);\nvar redefine = require('./_redefine');\nvar meta = require('./_meta');\nvar assign = require('./_object-assign');\nvar weak = require('./_collection-weak');\nvar isObject = require('./_is-object');\nvar fails = require('./_fails');\nvar validate = require('./_validate-collection');\nvar WEAK_MAP = 'WeakMap';\nvar getWeak = meta.getWeak;\nvar isExtensible = Object.isExtensible;\nvar uncaughtFrozenStore = weak.ufstore;\nvar tmp = {};\nvar InternalMap;\n\nvar wrapper = function (get) {\n return function WeakMap() {\n return get(this, arguments.length > 0 ? arguments[0] : undefined);\n };\n};\n\nvar methods = {\n // 23.3.3.3 WeakMap.prototype.get(key)\n get: function get(key) {\n if (isObject(key)) {\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key);\n return data ? data[this._i] : undefined;\n }\n },\n // 23.3.3.5 WeakMap.prototype.set(key, value)\n set: function set(key, value) {\n return weak.def(validate(this, WEAK_MAP), key, value);\n }\n};\n\n// 23.3 WeakMap Objects\nvar $WeakMap = module.exports = require('./_collection')(WEAK_MAP, wrapper, methods, weak, true, true);\n\n// IE11 WeakMap frozen keys fix\nif (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) {\n InternalMap = weak.getConstructor(wrapper, WEAK_MAP);\n assign(InternalMap.prototype, methods);\n meta.NEED = true;\n each(['delete', 'has', 'get', 'set'], function (key) {\n var proto = $WeakMap.prototype;\n var method = proto[key];\n redefine(proto, key, function (a, b) {\n // store frozen objects on internal weakmap shim\n if (isObject(a) && !isExtensible(a)) {\n if (!this._f) this._f = new InternalMap();\n var result = this._f[key](a, b);\n return key == 'set' ? this : result;\n // store all the rest on native weakmap\n } return method.call(this, a, b);\n });\n });\n}\n","'use strict';\nvar weak = require('./_collection-weak');\nvar validate = require('./_validate-collection');\nvar WEAK_SET = 'WeakSet';\n\n// 23.4 WeakSet Objects\nrequire('./_collection')(WEAK_SET, function (get) {\n return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.4.3.1 WeakSet.prototype.add(value)\n add: function add(value) {\n return weak.def(validate(this, WEAK_SET), value, true);\n }\n}, weak, false, true);\n","// 26.1.1 Reflect.apply(target, thisArgument, argumentsList)\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar anObject = require('./_an-object');\nvar rApply = (require('./_global').Reflect || {}).apply;\nvar fApply = Function.apply;\n// MS Edge argumentsList argument is optional\n$export($export.S + $export.F * !require('./_fails')(function () {\n rApply(function () { /* empty */ });\n}), 'Reflect', {\n apply: function apply(target, thisArgument, argumentsList) {\n var T = aFunction(target);\n var L = anObject(argumentsList);\n return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L);\n }\n});\n","// fast apply, http://jsperf.lnkit.com/fast-apply/5\nmodule.exports = function (fn, args, that) {\n var un = that === undefined;\n switch (args.length) {\n case 0: return un ? fn()\n : fn.call(that);\n case 1: return un ? fn(args[0])\n : fn.call(that, args[0]);\n case 2: return un ? fn(args[0], args[1])\n : fn.call(that, args[0], args[1]);\n case 3: return un ? fn(args[0], args[1], args[2])\n : fn.call(that, args[0], args[1], args[2]);\n case 4: return un ? fn(args[0], args[1], args[2], args[3])\n : fn.call(that, args[0], args[1], args[2], args[3]);\n } return fn.apply(that, args);\n};\n","'use strict';\nvar aFunction = require('./_a-function');\nvar isObject = require('./_is-object');\nvar invoke = require('./_invoke');\nvar arraySlice = [].slice;\nvar factories = {};\n\nvar construct = function (F, len, args) {\n if (!(len in factories)) {\n for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']';\n // eslint-disable-next-line no-new-func\n factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')');\n } return factories[len](F, args);\n};\n\nmodule.exports = Function.bind || function bind(that /* , ...args */) {\n var fn = aFunction(this);\n var partArgs = arraySlice.call(arguments, 1);\n var bound = function (/* args... */) {\n var args = partArgs.concat(arraySlice.call(arguments));\n return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that);\n };\n if (isObject(fn.prototype)) bound.prototype = fn.prototype;\n return bound;\n};\n","// 26.1.2 Reflect.construct(target, argumentsList [, newTarget])\nvar $export = require('./_export');\nvar create = require('./_object-create');\nvar aFunction = require('./_a-function');\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar fails = require('./_fails');\nvar bind = require('./_bind');\nvar rConstruct = (require('./_global').Reflect || {}).construct;\n\n// MS Edge supports only 2 arguments and argumentsList argument is optional\n// FF Nightly sets third argument as `new.target`, but does not create `this` from it\nvar NEW_TARGET_BUG = fails(function () {\n function F() { /* empty */ }\n return !(rConstruct(function () { /* empty */ }, [], F) instanceof F);\n});\nvar ARGS_BUG = !fails(function () {\n rConstruct(function () { /* empty */ });\n});\n\n$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', {\n construct: function construct(Target, args /* , newTarget */) {\n aFunction(Target);\n anObject(args);\n var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]);\n if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget);\n if (Target == newTarget) {\n // w/o altered newTarget, optimization for 0-4 arguments\n switch (args.length) {\n case 0: return new Target();\n case 1: return new Target(args[0]);\n case 2: return new Target(args[0], args[1]);\n case 3: return new Target(args[0], args[1], args[2]);\n case 4: return new Target(args[0], args[1], args[2], args[3]);\n }\n // w/o altered newTarget, lot of arguments case\n var $args = [null];\n $args.push.apply($args, args);\n return new (bind.apply(Target, $args))();\n }\n // with altered newTarget, not support built-in constructors\n var proto = newTarget.prototype;\n var instance = create(isObject(proto) ? proto : Object.prototype);\n var result = Function.apply.call(Target, instance, args);\n return isObject(result) ? result : instance;\n }\n});\n","// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes)\nvar dP = require('./_object-dp');\nvar $export = require('./_export');\nvar anObject = require('./_an-object');\nvar toPrimitive = require('./_to-primitive');\n\n// MS Edge has broken Reflect.defineProperty - throwing instead of returning false\n$export($export.S + $export.F * require('./_fails')(function () {\n // eslint-disable-next-line no-undef\n Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 });\n}), 'Reflect', {\n defineProperty: function defineProperty(target, propertyKey, attributes) {\n anObject(target);\n propertyKey = toPrimitive(propertyKey, true);\n anObject(attributes);\n try {\n dP.f(target, propertyKey, attributes);\n return true;\n } catch (e) {\n return false;\n }\n }\n});\n","// 26.1.4 Reflect.deleteProperty(target, propertyKey)\nvar $export = require('./_export');\nvar gOPD = require('./_object-gopd').f;\nvar anObject = require('./_an-object');\n\n$export($export.S, 'Reflect', {\n deleteProperty: function deleteProperty(target, propertyKey) {\n var desc = gOPD(anObject(target), propertyKey);\n return desc && !desc.configurable ? false : delete target[propertyKey];\n }\n});\n","// 26.1.6 Reflect.get(target, propertyKey [, receiver])\nvar gOPD = require('./_object-gopd');\nvar getPrototypeOf = require('./_object-gpo');\nvar has = require('./_has');\nvar $export = require('./_export');\nvar isObject = require('./_is-object');\nvar anObject = require('./_an-object');\n\nfunction get(target, propertyKey /* , receiver */) {\n var receiver = arguments.length < 3 ? target : arguments[2];\n var desc, proto;\n if (anObject(target) === receiver) return target[propertyKey];\n if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value')\n ? desc.value\n : desc.get !== undefined\n ? desc.get.call(receiver)\n : undefined;\n if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver);\n}\n\n$export($export.S, 'Reflect', { get: get });\n","// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey)\nvar gOPD = require('./_object-gopd');\nvar $export = require('./_export');\nvar anObject = require('./_an-object');\n\n$export($export.S, 'Reflect', {\n getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) {\n return gOPD.f(anObject(target), propertyKey);\n }\n});\n","// 26.1.8 Reflect.getPrototypeOf(target)\nvar $export = require('./_export');\nvar getProto = require('./_object-gpo');\nvar anObject = require('./_an-object');\n\n$export($export.S, 'Reflect', {\n getPrototypeOf: function getPrototypeOf(target) {\n return getProto(anObject(target));\n }\n});\n","// 26.1.9 Reflect.has(target, propertyKey)\nvar $export = require('./_export');\n\n$export($export.S, 'Reflect', {\n has: function has(target, propertyKey) {\n return propertyKey in target;\n }\n});\n","// 26.1.10 Reflect.isExtensible(target)\nvar $export = require('./_export');\nvar anObject = require('./_an-object');\nvar $isExtensible = Object.isExtensible;\n\n$export($export.S, 'Reflect', {\n isExtensible: function isExtensible(target) {\n anObject(target);\n return $isExtensible ? $isExtensible(target) : true;\n }\n});\n","// all object keys, includes non-enumerable and symbols\nvar gOPN = require('./_object-gopn');\nvar gOPS = require('./_object-gops');\nvar anObject = require('./_an-object');\nvar Reflect = require('./_global').Reflect;\nmodule.exports = Reflect && Reflect.ownKeys || function ownKeys(it) {\n var keys = gOPN.f(anObject(it));\n var getSymbols = gOPS.f;\n return getSymbols ? keys.concat(getSymbols(it)) : keys;\n};\n","// 26.1.11 Reflect.ownKeys(target)\nvar $export = require('./_export');\n\n$export($export.S, 'Reflect', { ownKeys: require('./_own-keys') });\n","// 26.1.12 Reflect.preventExtensions(target)\nvar $export = require('./_export');\nvar anObject = require('./_an-object');\nvar $preventExtensions = Object.preventExtensions;\n\n$export($export.S, 'Reflect', {\n preventExtensions: function preventExtensions(target) {\n anObject(target);\n try {\n if ($preventExtensions) $preventExtensions(target);\n return true;\n } catch (e) {\n return false;\n }\n }\n});\n","// 26.1.13 Reflect.set(target, propertyKey, V [, receiver])\nvar dP = require('./_object-dp');\nvar gOPD = require('./_object-gopd');\nvar getPrototypeOf = require('./_object-gpo');\nvar has = require('./_has');\nvar $export = require('./_export');\nvar createDesc = require('./_property-desc');\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\n\nfunction set(target, propertyKey, V /* , receiver */) {\n var receiver = arguments.length < 4 ? target : arguments[3];\n var ownDesc = gOPD.f(anObject(target), propertyKey);\n var existingDescriptor, proto;\n if (!ownDesc) {\n if (isObject(proto = getPrototypeOf(target))) {\n return set(proto, propertyKey, V, receiver);\n }\n ownDesc = createDesc(0);\n }\n if (has(ownDesc, 'value')) {\n if (ownDesc.writable === false || !isObject(receiver)) return false;\n if (existingDescriptor = gOPD.f(receiver, propertyKey)) {\n if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false;\n existingDescriptor.value = V;\n dP.f(receiver, propertyKey, existingDescriptor);\n } else dP.f(receiver, propertyKey, createDesc(0, V));\n return true;\n }\n return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true);\n}\n\n$export($export.S, 'Reflect', { set: set });\n","// 26.1.14 Reflect.setPrototypeOf(target, proto)\nvar $export = require('./_export');\nvar setProto = require('./_set-proto');\n\nif (setProto) $export($export.S, 'Reflect', {\n setPrototypeOf: function setPrototypeOf(target, proto) {\n setProto.check(target, proto);\n try {\n setProto.set(target, proto);\n return true;\n } catch (e) {\n return false;\n }\n }\n});\n","var ctx = require('./_ctx');\nvar invoke = require('./_invoke');\nvar html = require('./_html');\nvar cel = require('./_dom-create');\nvar global = require('./_global');\nvar process = global.process;\nvar setTask = global.setImmediate;\nvar clearTask = global.clearImmediate;\nvar MessageChannel = global.MessageChannel;\nvar Dispatch = global.Dispatch;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar defer, channel, port;\nvar run = function () {\n var id = +this;\n // eslint-disable-next-line no-prototype-builtins\n if (queue.hasOwnProperty(id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\nvar listener = function (event) {\n run.call(event.data);\n};\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!setTask || !clearTask) {\n setTask = function setImmediate(fn) {\n var args = [];\n var i = 1;\n while (arguments.length > i) args.push(arguments[i++]);\n queue[++counter] = function () {\n // eslint-disable-next-line no-new-func\n invoke(typeof fn == 'function' ? fn : Function(fn), args);\n };\n defer(counter);\n return counter;\n };\n clearTask = function clearImmediate(id) {\n delete queue[id];\n };\n // Node.js 0.8-\n if (require('./_cof')(process) == 'process') {\n defer = function (id) {\n process.nextTick(ctx(run, id, 1));\n };\n // Sphere (JS game engine) Dispatch API\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(ctx(run, id, 1));\n };\n // Browsers with MessageChannel, includes WebWorkers\n } else if (MessageChannel) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = ctx(port.postMessage, port, 1);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {\n defer = function (id) {\n global.postMessage(id + '', '*');\n };\n global.addEventListener('message', listener, false);\n // IE8-\n } else if (ONREADYSTATECHANGE in cel('script')) {\n defer = function (id) {\n html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run.call(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function (id) {\n setTimeout(ctx(run, id, 1), 0);\n };\n }\n}\nmodule.exports = {\n set: setTask,\n clear: clearTask\n};\n","var global = require('./_global');\nvar macrotask = require('./_task').set;\nvar Observer = global.MutationObserver || global.WebKitMutationObserver;\nvar process = global.process;\nvar Promise = global.Promise;\nvar isNode = require('./_cof')(process) == 'process';\n\nmodule.exports = function () {\n var head, last, notify;\n\n var flush = function () {\n var parent, fn;\n if (isNode && (parent = process.domain)) parent.exit();\n while (head) {\n fn = head.fn;\n head = head.next;\n try {\n fn();\n } catch (e) {\n if (head) notify();\n else last = undefined;\n throw e;\n }\n } last = undefined;\n if (parent) parent.enter();\n };\n\n // Node.js\n if (isNode) {\n notify = function () {\n process.nextTick(flush);\n };\n // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339\n } else if (Observer && !(global.navigator && global.navigator.standalone)) {\n var toggle = true;\n var node = document.createTextNode('');\n new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new\n notify = function () {\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if (Promise && Promise.resolve) {\n var promise = Promise.resolve();\n notify = function () {\n promise.then(flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessag\n // - onreadystatechange\n // - setTimeout\n } else {\n notify = function () {\n // strange IE + webpack dev server bug - use .call(global)\n macrotask.call(global, flush);\n };\n }\n\n return function (fn) {\n var task = { fn: fn, next: undefined };\n if (last) last.next = task;\n if (!head) {\n head = task;\n notify();\n } last = task;\n };\n};\n","'use strict';\n// 25.4.1.5 NewPromiseCapability(C)\nvar aFunction = require('./_a-function');\n\nfunction PromiseCapability(C) {\n var resolve, reject;\n this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aFunction(resolve);\n this.reject = aFunction(reject);\n}\n\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n","'use strict';\nvar LIBRARY = require('./_library');\nvar global = require('./_global');\nvar ctx = require('./_ctx');\nvar classof = require('./_classof');\nvar $export = require('./_export');\nvar isObject = require('./_is-object');\nvar aFunction = require('./_a-function');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar speciesConstructor = require('./_species-constructor');\nvar task = require('./_task').set;\nvar microtask = require('./_microtask')();\nvar newPromiseCapabilityModule = require('./_new-promise-capability');\nvar perform = require('./_perform');\nvar promiseResolve = require('./_promise-resolve');\nvar PROMISE = 'Promise';\nvar TypeError = global.TypeError;\nvar process = global.process;\nvar $Promise = global[PROMISE];\nvar isNode = classof(process) == 'process';\nvar empty = function () { /* empty */ };\nvar Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;\nvar newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;\n\nvar USE_NATIVE = !!function () {\n try {\n // correct subclassing with @@species support\n var promise = $Promise.resolve(1);\n var FakePromise = (promise.constructor = {})[require('./_wks')('species')] = function (exec) {\n exec(empty, empty);\n };\n // unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise;\n } catch (e) { /* empty */ }\n}();\n\n// helpers\nvar isThenable = function (it) {\n var then;\n return isObject(it) && typeof (then = it.then) == 'function' ? then : false;\n};\nvar notify = function (promise, isReject) {\n if (promise._n) return;\n promise._n = true;\n var chain = promise._c;\n microtask(function () {\n var value = promise._v;\n var ok = promise._s == 1;\n var i = 0;\n var run = function (reaction) {\n var handler = ok ? reaction.ok : reaction.fail;\n var resolve = reaction.resolve;\n var reject = reaction.reject;\n var domain = reaction.domain;\n var result, then, exited;\n try {\n if (handler) {\n if (!ok) {\n if (promise._h == 2) onHandleUnhandled(promise);\n promise._h = 1;\n }\n if (handler === true) result = value;\n else {\n if (domain) domain.enter();\n result = handler(value); // may throw\n if (domain) {\n domain.exit();\n exited = true;\n }\n }\n if (result === reaction.promise) {\n reject(TypeError('Promise-chain cycle'));\n } else if (then = isThenable(result)) {\n then.call(result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch (e) {\n if (domain && !exited) domain.exit();\n reject(e);\n }\n };\n while (chain.length > i) run(chain[i++]); // variable length - can't use forEach\n promise._c = [];\n promise._n = false;\n if (isReject && !promise._h) onUnhandled(promise);\n });\n};\nvar onUnhandled = function (promise) {\n task.call(global, function () {\n var value = promise._v;\n var unhandled = isUnhandled(promise);\n var result, handler, console;\n if (unhandled) {\n result = perform(function () {\n if (isNode) {\n process.emit('unhandledRejection', value, promise);\n } else if (handler = global.onunhandledrejection) {\n handler({ promise: promise, reason: value });\n } else if ((console = global.console) && console.error) {\n console.error('Unhandled promise rejection', value);\n }\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n promise._h = isNode || isUnhandled(promise) ? 2 : 1;\n } promise._a = undefined;\n if (unhandled && result.e) throw result.v;\n });\n};\nvar isUnhandled = function (promise) {\n return promise._h !== 1 && (promise._a || promise._c).length === 0;\n};\nvar onHandleUnhandled = function (promise) {\n task.call(global, function () {\n var handler;\n if (isNode) {\n process.emit('rejectionHandled', promise);\n } else if (handler = global.onrejectionhandled) {\n handler({ promise: promise, reason: promise._v });\n }\n });\n};\nvar $reject = function (value) {\n var promise = this;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n promise._v = value;\n promise._s = 2;\n if (!promise._a) promise._a = promise._c.slice();\n notify(promise, true);\n};\nvar $resolve = function (value) {\n var promise = this;\n var then;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n try {\n if (promise === value) throw TypeError(\"Promise can't be resolved itself\");\n if (then = isThenable(value)) {\n microtask(function () {\n var wrapper = { _w: promise, _d: false }; // wrap\n try {\n then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));\n } catch (e) {\n $reject.call(wrapper, e);\n }\n });\n } else {\n promise._v = value;\n promise._s = 1;\n notify(promise, false);\n }\n } catch (e) {\n $reject.call({ _w: promise, _d: false }, e); // wrap\n }\n};\n\n// constructor polyfill\nif (!USE_NATIVE) {\n // 25.4.3.1 Promise(executor)\n $Promise = function Promise(executor) {\n anInstance(this, $Promise, PROMISE, '_h');\n aFunction(executor);\n Internal.call(this);\n try {\n executor(ctx($resolve, this, 1), ctx($reject, this, 1));\n } catch (err) {\n $reject.call(this, err);\n }\n };\n // eslint-disable-next-line no-unused-vars\n Internal = function Promise(executor) {\n this._c = []; // <- awaiting reactions\n this._a = undefined; // <- checked in isUnhandled reactions\n this._s = 0; // <- state\n this._d = false; // <- done\n this._v = undefined; // <- value\n this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled\n this._n = false; // <- notify\n };\n Internal.prototype = require('./_redefine-all')($Promise.prototype, {\n // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)\n then: function then(onFulfilled, onRejected) {\n var reaction = newPromiseCapability(speciesConstructor(this, $Promise));\n reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;\n reaction.fail = typeof onRejected == 'function' && onRejected;\n reaction.domain = isNode ? process.domain : undefined;\n this._c.push(reaction);\n if (this._a) this._a.push(reaction);\n if (this._s) notify(this, false);\n return reaction.promise;\n },\n // 25.4.5.1 Promise.prototype.catch(onRejected)\n 'catch': function (onRejected) {\n return this.then(undefined, onRejected);\n }\n });\n OwnPromiseCapability = function () {\n var promise = new Internal();\n this.promise = promise;\n this.resolve = ctx($resolve, promise, 1);\n this.reject = ctx($reject, promise, 1);\n };\n newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n return C === $Promise || C === Wrapper\n ? new OwnPromiseCapability(C)\n : newGenericPromiseCapability(C);\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });\nrequire('./_set-to-string-tag')($Promise, PROMISE);\nrequire('./_set-species')(PROMISE);\nWrapper = require('./_core')[PROMISE];\n\n// statics\n$export($export.S + $export.F * !USE_NATIVE, PROMISE, {\n // 25.4.4.5 Promise.reject(r)\n reject: function reject(r) {\n var capability = newPromiseCapability(this);\n var $$reject = capability.reject;\n $$reject(r);\n return capability.promise;\n }\n});\n$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {\n // 25.4.4.6 Promise.resolve(x)\n resolve: function resolve(x) {\n return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);\n }\n});\n$export($export.S + $export.F * !(USE_NATIVE && require('./_iter-detect')(function (iter) {\n $Promise.all(iter)['catch'](empty);\n})), PROMISE, {\n // 25.4.4.1 Promise.all(iterable)\n all: function all(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var values = [];\n var index = 0;\n var remaining = 1;\n forOf(iterable, false, function (promise) {\n var $index = index++;\n var alreadyCalled = false;\n values.push(undefined);\n remaining++;\n C.resolve(promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[$index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if (result.e) reject(result.v);\n return capability.promise;\n },\n // 25.4.4.4 Promise.race(iterable)\n race: function race(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var reject = capability.reject;\n var result = perform(function () {\n forOf(iterable, false, function (promise) {\n C.resolve(promise).then(capability.resolve, reject);\n });\n });\n if (result.e) reject(result.v);\n return capability.promise;\n }\n});\n","module.exports = function (exec) {\n try {\n return { e: false, v: exec() };\n } catch (e) {\n return { e: true, v: e };\n }\n};\n","var anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar newPromiseCapability = require('./_new-promise-capability');\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n","exports.f = require('./_wks');\n","var global = require('./_global');\nvar core = require('./_core');\nvar LIBRARY = require('./_library');\nvar wksExt = require('./_wks-ext');\nvar defineProperty = require('./_object-dp').f;\nmodule.exports = function (name) {\n var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});\n if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });\n};\n","// all enumerable object keys, includes symbols\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nmodule.exports = function (it) {\n var result = getKeys(it);\n var getSymbols = gOPS.f;\n if (getSymbols) {\n var symbols = getSymbols(it);\n var isEnum = pIE.f;\n var i = 0;\n var key;\n while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);\n } return result;\n};\n","// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nvar toIObject = require('./_to-iobject');\nvar gOPN = require('./_object-gopn').f;\nvar toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return gOPN(it);\n } catch (e) {\n return windowNames.slice();\n }\n};\n\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));\n};\n","'use strict';\n// ECMAScript 6 symbols shim\nvar global = require('./_global');\nvar has = require('./_has');\nvar DESCRIPTORS = require('./_descriptors');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar META = require('./_meta').KEY;\nvar $fails = require('./_fails');\nvar shared = require('./_shared');\nvar setToStringTag = require('./_set-to-string-tag');\nvar uid = require('./_uid');\nvar wks = require('./_wks');\nvar wksExt = require('./_wks-ext');\nvar wksDefine = require('./_wks-define');\nvar enumKeys = require('./_enum-keys');\nvar isArray = require('./_is-array');\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar createDesc = require('./_property-desc');\nvar _create = require('./_object-create');\nvar gOPNExt = require('./_object-gopn-ext');\nvar $GOPD = require('./_object-gopd');\nvar $DP = require('./_object-dp');\nvar $keys = require('./_object-keys');\nvar gOPD = $GOPD.f;\nvar dP = $DP.f;\nvar gOPN = gOPNExt.f;\nvar $Symbol = global.Symbol;\nvar $JSON = global.JSON;\nvar _stringify = $JSON && $JSON.stringify;\nvar PROTOTYPE = 'prototype';\nvar HIDDEN = wks('_hidden');\nvar TO_PRIMITIVE = wks('toPrimitive');\nvar isEnum = {}.propertyIsEnumerable;\nvar SymbolRegistry = shared('symbol-registry');\nvar AllSymbols = shared('symbols');\nvar OPSymbols = shared('op-symbols');\nvar ObjectProto = Object[PROTOTYPE];\nvar USE_NATIVE = typeof $Symbol == 'function';\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function () {\n return _create(dP({}, 'a', {\n get: function () { return dP(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (it, key, D) {\n var protoDesc = gOPD(ObjectProto, key);\n if (protoDesc) delete ObjectProto[key];\n dP(it, key, D);\n if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function (tag) {\n var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D) {\n if (it === ObjectProto) $defineProperty(OPSymbols, key, D);\n anObject(it);\n key = toPrimitive(key, true);\n anObject(D);\n if (has(AllSymbols, key)) {\n if (!D.enumerable) {\n if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;\n D = _create(D, { enumerable: createDesc(0, false) });\n } return setSymbolDesc(it, key, D);\n } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P) {\n anObject(it);\n var keys = enumKeys(P = toIObject(P));\n var i = 0;\n var l = keys.length;\n var key;\n while (l > i) $defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P) {\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key) {\n var E = isEnum.call(this, key = toPrimitive(key, true));\n if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {\n it = toIObject(it);\n key = toPrimitive(key, true);\n if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;\n var D = gOPD(it, key);\n if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it) {\n var names = gOPN(toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it) {\n var IS_OP = it === ObjectProto;\n var names = gOPN(IS_OP ? OPSymbols : toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif (!USE_NATIVE) {\n $Symbol = function Symbol() {\n if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');\n var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function (value) {\n if (this === ObjectProto) $set.call(OPSymbols, value);\n if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n };\n if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });\n return wrap(tag);\n };\n redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n return this._k;\n });\n\n $GOPD.f = $getOwnPropertyDescriptor;\n $DP.f = $defineProperty;\n require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames;\n require('./_object-pie').f = $propertyIsEnumerable;\n require('./_object-gops').f = $getOwnPropertySymbols;\n\n if (DESCRIPTORS && !require('./_library')) {\n redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n wksExt.f = function (name) {\n return wrap(wks(name));\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });\n\nfor (var es6Symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);\n\nfor (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function (key) {\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');\n for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;\n },\n useSetter: function () { setter = true; },\n useSimple: function () { setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it) {\n var args = [it];\n var i = 1;\n var replacer, $replacer;\n while (arguments.length > i) args.push(arguments[i++]);\n $replacer = replacer = args[1];\n if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n if (!isArray(replacer)) replacer = function (key, value) {\n if (typeof $replacer == 'function') value = $replacer.call(this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || require('./_hide')($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n","// most Object methods by ES6 should accept primitives\nvar $export = require('./_export');\nvar core = require('./_core');\nvar fails = require('./_fails');\nmodule.exports = function (KEY, exec) {\n var fn = (core.Object || {})[KEY] || Object[KEY];\n var exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);\n};\n","// 19.1.2.5 Object.freeze(O)\nvar isObject = require('./_is-object');\nvar meta = require('./_meta').onFreeze;\n\nrequire('./_object-sap')('freeze', function ($freeze) {\n return function freeze(it) {\n return $freeze && isObject(it) ? $freeze(meta(it)) : it;\n };\n});\n","// 19.1.2.17 Object.seal(O)\nvar isObject = require('./_is-object');\nvar meta = require('./_meta').onFreeze;\n\nrequire('./_object-sap')('seal', function ($seal) {\n return function seal(it) {\n return $seal && isObject(it) ? $seal(meta(it)) : it;\n };\n});\n","// 19.1.2.15 Object.preventExtensions(O)\nvar isObject = require('./_is-object');\nvar meta = require('./_meta').onFreeze;\n\nrequire('./_object-sap')('preventExtensions', function ($preventExtensions) {\n return function preventExtensions(it) {\n return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it;\n };\n});\n","// 19.1.2.12 Object.isFrozen(O)\nvar isObject = require('./_is-object');\n\nrequire('./_object-sap')('isFrozen', function ($isFrozen) {\n return function isFrozen(it) {\n return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true;\n };\n});\n","// 19.1.2.13 Object.isSealed(O)\nvar isObject = require('./_is-object');\n\nrequire('./_object-sap')('isSealed', function ($isSealed) {\n return function isSealed(it) {\n return isObject(it) ? $isSealed ? $isSealed(it) : false : true;\n };\n});\n","// 19.1.2.11 Object.isExtensible(O)\nvar isObject = require('./_is-object');\n\nrequire('./_object-sap')('isExtensible', function ($isExtensible) {\n return function isExtensible(it) {\n return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false;\n };\n});\n","// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\nvar toIObject = require('./_to-iobject');\nvar $getOwnPropertyDescriptor = require('./_object-gopd').f;\n\nrequire('./_object-sap')('getOwnPropertyDescriptor', function () {\n return function getOwnPropertyDescriptor(it, key) {\n return $getOwnPropertyDescriptor(toIObject(it), key);\n };\n});\n","// 19.1.2.9 Object.getPrototypeOf(O)\nvar toObject = require('./_to-object');\nvar $getPrototypeOf = require('./_object-gpo');\n\nrequire('./_object-sap')('getPrototypeOf', function () {\n return function getPrototypeOf(it) {\n return $getPrototypeOf(toObject(it));\n };\n});\n","// 19.1.2.14 Object.keys(O)\nvar toObject = require('./_to-object');\nvar $keys = require('./_object-keys');\n\nrequire('./_object-sap')('keys', function () {\n return function keys(it) {\n return $keys(toObject(it));\n };\n});\n","// 19.1.2.7 Object.getOwnPropertyNames(O)\nrequire('./_object-sap')('getOwnPropertyNames', function () {\n return require('./_object-gopn-ext').f;\n});\n","// 19.1.3.1 Object.assign(target, source)\nvar $export = require('./_export');\n\n$export($export.S + $export.F, 'Object', { assign: require('./_object-assign') });\n","// 7.2.9 SameValue(x, y)\nmodule.exports = Object.is || function is(x, y) {\n // eslint-disable-next-line no-self-compare\n return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;\n};\n","// 19.1.3.10 Object.is(value1, value2)\nvar $export = require('./_export');\n$export($export.S, 'Object', { is: require('./_same-value') });\n","// 19.1.3.19 Object.setPrototypeOf(O, proto)\nvar $export = require('./_export');\n$export($export.S, 'Object', { setPrototypeOf: require('./_set-proto').set });\n","var dP = require('./_object-dp').f;\nvar FProto = Function.prototype;\nvar nameRE = /^\\s*function ([^ (]*)/;\nvar NAME = 'name';\n\n// 19.2.4.2 name\nNAME in FProto || require('./_descriptors') && dP(FProto, NAME, {\n configurable: true,\n get: function () {\n try {\n return ('' + this).match(nameRE)[1];\n } catch (e) {\n return '';\n }\n }\n});\n","var $export = require('./_export');\nvar toIObject = require('./_to-iobject');\nvar toLength = require('./_to-length');\n\n$export($export.S, 'String', {\n // 21.1.2.4 String.raw(callSite, ...substitutions)\n raw: function raw(callSite) {\n var tpl = toIObject(callSite.raw);\n var len = toLength(tpl.length);\n var aLen = arguments.length;\n var res = [];\n var i = 0;\n while (len > i) {\n res.push(String(tpl[i++]));\n if (i < aLen) res.push(String(arguments[i]));\n } return res.join('');\n }\n});\n","var $export = require('./_export');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar fromCharCode = String.fromCharCode;\nvar $fromCodePoint = String.fromCodePoint;\n\n// length should be 1, old FF problem\n$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {\n // 21.1.2.2 String.fromCodePoint(...codePoints)\n fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars\n var res = [];\n var aLen = arguments.length;\n var i = 0;\n var code;\n while (aLen > i) {\n code = +arguments[i++];\n if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point');\n res.push(code < 0x10000\n ? fromCharCode(code)\n : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)\n );\n } return res.join('');\n }\n});\n","var toInteger = require('./_to-integer');\nvar defined = require('./_defined');\n// true -> String#at\n// false -> String#codePointAt\nmodule.exports = function (TO_STRING) {\n return function (that, pos) {\n var s = String(defined(that));\n var i = toInteger(pos);\n var l = s.length;\n var a, b;\n if (i < 0 || i >= l) return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n","'use strict';\nvar $export = require('./_export');\nvar $at = require('./_string-at')(false);\n$export($export.P, 'String', {\n // 21.1.3.3 String.prototype.codePointAt(pos)\n codePointAt: function codePointAt(pos) {\n return $at(this, pos);\n }\n});\n","'use strict';\nvar toInteger = require('./_to-integer');\nvar defined = require('./_defined');\n\nmodule.exports = function repeat(count) {\n var str = String(defined(this));\n var res = '';\n var n = toInteger(count);\n if (n < 0 || n == Infinity) throw RangeError(\"Count can't be negative\");\n for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str;\n return res;\n};\n","var $export = require('./_export');\n\n$export($export.P, 'String', {\n // 21.1.3.13 String.prototype.repeat(count)\n repeat: require('./_string-repeat')\n});\n","// 7.2.8 IsRegExp(argument)\nvar isObject = require('./_is-object');\nvar cof = require('./_cof');\nvar MATCH = require('./_wks')('match');\nmodule.exports = function (it) {\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');\n};\n","// helper for String#{startsWith, endsWith, includes}\nvar isRegExp = require('./_is-regexp');\nvar defined = require('./_defined');\n\nmodule.exports = function (that, searchString, NAME) {\n if (isRegExp(searchString)) throw TypeError('String#' + NAME + \" doesn't accept regex!\");\n return String(defined(that));\n};\n","var MATCH = require('./_wks')('match');\nmodule.exports = function (KEY) {\n var re = /./;\n try {\n '/./'[KEY](re);\n } catch (e) {\n try {\n re[MATCH] = false;\n return !'/./'[KEY](re);\n } catch (f) { /* empty */ }\n } return true;\n};\n","// 21.1.3.18 String.prototype.startsWith(searchString [, position ])\n'use strict';\nvar $export = require('./_export');\nvar toLength = require('./_to-length');\nvar context = require('./_string-context');\nvar STARTS_WITH = 'startsWith';\nvar $startsWith = ''[STARTS_WITH];\n\n$export($export.P + $export.F * require('./_fails-is-regexp')(STARTS_WITH), 'String', {\n startsWith: function startsWith(searchString /* , position = 0 */) {\n var that = context(this, searchString, STARTS_WITH);\n var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length));\n var search = String(searchString);\n return $startsWith\n ? $startsWith.call(that, search, index)\n : that.slice(index, index + search.length) === search;\n }\n});\n","// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])\n'use strict';\nvar $export = require('./_export');\nvar toLength = require('./_to-length');\nvar context = require('./_string-context');\nvar ENDS_WITH = 'endsWith';\nvar $endsWith = ''[ENDS_WITH];\n\n$export($export.P + $export.F * require('./_fails-is-regexp')(ENDS_WITH), 'String', {\n endsWith: function endsWith(searchString /* , endPosition = @length */) {\n var that = context(this, searchString, ENDS_WITH);\n var endPosition = arguments.length > 1 ? arguments[1] : undefined;\n var len = toLength(that.length);\n var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len);\n var search = String(searchString);\n return $endsWith\n ? $endsWith.call(that, search, end)\n : that.slice(end - search.length, end) === search;\n }\n});\n","// 21.1.3.7 String.prototype.includes(searchString, position = 0)\n'use strict';\nvar $export = require('./_export');\nvar context = require('./_string-context');\nvar INCLUDES = 'includes';\n\n$export($export.P + $export.F * require('./_fails-is-regexp')(INCLUDES), 'String', {\n includes: function includes(searchString /* , position = 0 */) {\n return !!~context(this, searchString, INCLUDES)\n .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","'use strict';\n// 21.2.5.3 get RegExp.prototype.flags\nvar anObject = require('./_an-object');\nmodule.exports = function () {\n var that = anObject(this);\n var result = '';\n if (that.global) result += 'g';\n if (that.ignoreCase) result += 'i';\n if (that.multiline) result += 'm';\n if (that.unicode) result += 'u';\n if (that.sticky) result += 'y';\n return result;\n};\n","// 21.2.5.3 get RegExp.prototype.flags()\nif (require('./_descriptors') && /./g.flags != 'g') require('./_object-dp').f(RegExp.prototype, 'flags', {\n configurable: true,\n get: require('./_flags')\n});\n","'use strict';\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar fails = require('./_fails');\nvar defined = require('./_defined');\nvar wks = require('./_wks');\n\nmodule.exports = function (KEY, length, exec) {\n var SYMBOL = wks(KEY);\n var fns = exec(defined, SYMBOL, ''[KEY]);\n var strfn = fns[0];\n var rxfn = fns[1];\n if (fails(function () {\n var O = {};\n O[SYMBOL] = function () { return 7; };\n return ''[KEY](O) != 7;\n })) {\n redefine(String.prototype, KEY, strfn);\n hide(RegExp.prototype, SYMBOL, length == 2\n // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)\n // 21.2.5.11 RegExp.prototype[@@split](string, limit)\n ? function (string, arg) { return rxfn.call(string, this, arg); }\n // 21.2.5.6 RegExp.prototype[@@match](string)\n // 21.2.5.9 RegExp.prototype[@@search](string)\n : function (string) { return rxfn.call(string, this); }\n );\n }\n};\n","// @@match logic\nrequire('./_fix-re-wks')('match', 1, function (defined, MATCH, $match) {\n // 21.1.3.11 String.prototype.match(regexp)\n return [function match(regexp) {\n 'use strict';\n var O = defined(this);\n var fn = regexp == undefined ? undefined : regexp[MATCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));\n }, $match];\n});\n","// @@replace logic\nrequire('./_fix-re-wks')('replace', 2, function (defined, REPLACE, $replace) {\n // 21.1.3.14 String.prototype.replace(searchValue, replaceValue)\n return [function replace(searchValue, replaceValue) {\n 'use strict';\n var O = defined(this);\n var fn = searchValue == undefined ? undefined : searchValue[REPLACE];\n return fn !== undefined\n ? fn.call(searchValue, O, replaceValue)\n : $replace.call(String(O), searchValue, replaceValue);\n }, $replace];\n});\n","// @@split logic\nrequire('./_fix-re-wks')('split', 2, function (defined, SPLIT, $split) {\n 'use strict';\n var isRegExp = require('./_is-regexp');\n var _split = $split;\n var $push = [].push;\n var $SPLIT = 'split';\n var LENGTH = 'length';\n var LAST_INDEX = 'lastIndex';\n if (\n 'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||\n 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||\n 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||\n '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||\n '.'[$SPLIT](/()()/)[LENGTH] > 1 ||\n ''[$SPLIT](/.?/)[LENGTH]\n ) {\n var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group\n // based on es5-shim implementation, need to rework it\n $split = function (separator, limit) {\n var string = String(this);\n if (separator === undefined && limit === 0) return [];\n // If `separator` is not a regex, use native split\n if (!isRegExp(separator)) return _split.call(string, separator, limit);\n var output = [];\n var flags = (separator.ignoreCase ? 'i' : '') +\n (separator.multiline ? 'm' : '') +\n (separator.unicode ? 'u' : '') +\n (separator.sticky ? 'y' : '');\n var lastLastIndex = 0;\n var splitLimit = limit === undefined ? 4294967295 : limit >>> 0;\n // Make `global` and avoid `lastIndex` issues by working with a copy\n var separatorCopy = new RegExp(separator.source, flags + 'g');\n var separator2, match, lastIndex, lastLength, i;\n // Doesn't need flags gy, but they don't hurt\n if (!NPCG) separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\\\s)', flags);\n while (match = separatorCopy.exec(string)) {\n // `separatorCopy.lastIndex` is not reliable cross-browser\n lastIndex = match.index + match[0][LENGTH];\n if (lastIndex > lastLastIndex) {\n output.push(string.slice(lastLastIndex, match.index));\n // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG\n // eslint-disable-next-line no-loop-func\n if (!NPCG && match[LENGTH] > 1) match[0].replace(separator2, function () {\n for (i = 1; i < arguments[LENGTH] - 2; i++) if (arguments[i] === undefined) match[i] = undefined;\n });\n if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1));\n lastLength = match[0][LENGTH];\n lastLastIndex = lastIndex;\n if (output[LENGTH] >= splitLimit) break;\n }\n if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop\n }\n if (lastLastIndex === string[LENGTH]) {\n if (lastLength || !separatorCopy.test('')) output.push('');\n } else output.push(string.slice(lastLastIndex));\n return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;\n };\n // Chakra, V8\n } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) {\n $split = function (separator, limit) {\n return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit);\n };\n }\n // 21.1.3.17 String.prototype.split(separator, limit)\n return [function split(separator, limit) {\n var O = defined(this);\n var fn = separator == undefined ? undefined : separator[SPLIT];\n return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit);\n }, $split];\n});\n","// @@search logic\nrequire('./_fix-re-wks')('search', 1, function (defined, SEARCH, $search) {\n // 21.1.3.15 String.prototype.search(regexp)\n return [function search(regexp) {\n 'use strict';\n var O = defined(this);\n var fn = regexp == undefined ? undefined : regexp[SEARCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));\n }, $search];\n});\n","'use strict';\nvar $defineProperty = require('./_object-dp');\nvar createDesc = require('./_property-desc');\n\nmodule.exports = function (object, index, value) {\n if (index in object) $defineProperty.f(object, index, createDesc(0, value));\n else object[index] = value;\n};\n","'use strict';\nvar ctx = require('./_ctx');\nvar $export = require('./_export');\nvar toObject = require('./_to-object');\nvar call = require('./_iter-call');\nvar isArrayIter = require('./_is-array-iter');\nvar toLength = require('./_to-length');\nvar createProperty = require('./_create-property');\nvar getIterFn = require('./core.get-iterator-method');\n\n$export($export.S + $export.F * !require('./_iter-detect')(function (iter) { Array.from(iter); }), 'Array', {\n // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)\n from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {\n var O = toObject(arrayLike);\n var C = typeof this == 'function' ? this : Array;\n var aLen = arguments.length;\n var mapfn = aLen > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var index = 0;\n var iterFn = getIterFn(O);\n var length, result, step, iterator;\n if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);\n // if object isn't iterable or it's array with default iterator - use simple case\n if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {\n for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {\n createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);\n }\n } else {\n length = toLength(O.length);\n for (result = new C(length); length > index; index++) {\n createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);\n }\n }\n result.length = index;\n return result;\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar createProperty = require('./_create-property');\n\n// WebKit Array.of isn't generic\n$export($export.S + $export.F * require('./_fails')(function () {\n function F() { /* empty */ }\n return !(Array.of.call(F) instanceof F);\n}), 'Array', {\n // 22.1.2.3 Array.of( ...items)\n of: function of(/* ...args */) {\n var index = 0;\n var aLen = arguments.length;\n var result = new (typeof this == 'function' ? this : Array)(aLen);\n while (aLen > index) createProperty(result, index, arguments[index++]);\n result.length = aLen;\n return result;\n }\n});\n","// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)\nvar $export = require('./_export');\n\n$export($export.P, 'Array', { copyWithin: require('./_array-copy-within') });\n\nrequire('./_add-to-unscopables')('copyWithin');\n","'use strict';\n// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)\nvar $export = require('./_export');\nvar $find = require('./_array-methods')(5);\nvar KEY = 'find';\nvar forced = true;\n// Shouldn't skip holes\nif (KEY in []) Array(1)[KEY](function () { forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n find: function find(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\nrequire('./_add-to-unscopables')(KEY);\n","'use strict';\n// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)\nvar $export = require('./_export');\nvar $find = require('./_array-methods')(6);\nvar KEY = 'findIndex';\nvar forced = true;\n// Shouldn't skip holes\nif (KEY in []) Array(1)[KEY](function () { forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n findIndex: function findIndex(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\nrequire('./_add-to-unscopables')(KEY);\n","// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)\nvar $export = require('./_export');\n\n$export($export.P, 'Array', { fill: require('./_array-fill') });\n\nrequire('./_add-to-unscopables')('fill');\n","// 20.1.2.2 Number.isFinite(number)\nvar $export = require('./_export');\nvar _isFinite = require('./_global').isFinite;\n\n$export($export.S, 'Number', {\n isFinite: function isFinite(it) {\n return typeof it == 'number' && _isFinite(it);\n }\n});\n","// 20.1.2.3 Number.isInteger(number)\nvar isObject = require('./_is-object');\nvar floor = Math.floor;\nmodule.exports = function isInteger(it) {\n return !isObject(it) && isFinite(it) && floor(it) === it;\n};\n","// 20.1.2.3 Number.isInteger(number)\nvar $export = require('./_export');\n\n$export($export.S, 'Number', { isInteger: require('./_is-integer') });\n","// 20.1.2.5 Number.isSafeInteger(number)\nvar $export = require('./_export');\nvar isInteger = require('./_is-integer');\nvar abs = Math.abs;\n\n$export($export.S, 'Number', {\n isSafeInteger: function isSafeInteger(number) {\n return isInteger(number) && abs(number) <= 0x1fffffffffffff;\n }\n});\n","// 20.1.2.4 Number.isNaN(number)\nvar $export = require('./_export');\n\n$export($export.S, 'Number', {\n isNaN: function isNaN(number) {\n // eslint-disable-next-line no-self-compare\n return number != number;\n }\n});\n","// 20.1.2.1 Number.EPSILON\nvar $export = require('./_export');\n\n$export($export.S, 'Number', { EPSILON: Math.pow(2, -52) });\n","// 20.1.2.10 Number.MIN_SAFE_INTEGER\nvar $export = require('./_export');\n\n$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff });\n","// 20.1.2.6 Number.MAX_SAFE_INTEGER\nvar $export = require('./_export');\n\n$export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff });\n","// 20.2.2.20 Math.log1p(x)\nmodule.exports = Math.log1p || function log1p(x) {\n return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x);\n};\n","// 20.2.2.3 Math.acosh(x)\nvar $export = require('./_export');\nvar log1p = require('./_math-log1p');\nvar sqrt = Math.sqrt;\nvar $acosh = Math.acosh;\n\n$export($export.S + $export.F * !($acosh\n // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509\n && Math.floor($acosh(Number.MAX_VALUE)) == 710\n // Tor Browser bug: Math.acosh(Infinity) -> NaN\n && $acosh(Infinity) == Infinity\n), 'Math', {\n acosh: function acosh(x) {\n return (x = +x) < 1 ? NaN : x > 94906265.62425156\n ? Math.log(x) + Math.LN2\n : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1));\n }\n});\n","// 20.2.2.5 Math.asinh(x)\nvar $export = require('./_export');\nvar $asinh = Math.asinh;\n\nfunction asinh(x) {\n return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1));\n}\n\n// Tor Browser bug: Math.asinh(0) -> -0\n$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh });\n","// 20.2.2.7 Math.atanh(x)\nvar $export = require('./_export');\nvar $atanh = Math.atanh;\n\n// Tor Browser bug: Math.atanh(-0) -> 0\n$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', {\n atanh: function atanh(x) {\n return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2;\n }\n});\n","// 20.2.2.28 Math.sign(x)\nmodule.exports = Math.sign || function sign(x) {\n // eslint-disable-next-line no-self-compare\n return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;\n};\n","// 20.2.2.9 Math.cbrt(x)\nvar $export = require('./_export');\nvar sign = require('./_math-sign');\n\n$export($export.S, 'Math', {\n cbrt: function cbrt(x) {\n return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3);\n }\n});\n","// 20.2.2.11 Math.clz32(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n clz32: function clz32(x) {\n return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32;\n }\n});\n","// 20.2.2.12 Math.cosh(x)\nvar $export = require('./_export');\nvar exp = Math.exp;\n\n$export($export.S, 'Math', {\n cosh: function cosh(x) {\n return (exp(x = +x) + exp(-x)) / 2;\n }\n});\n","// 20.2.2.14 Math.expm1(x)\nvar $expm1 = Math.expm1;\nmodule.exports = (!$expm1\n // Old FF bug\n || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168\n // Tor Browser bug\n || $expm1(-2e-17) != -2e-17\n) ? function expm1(x) {\n return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1;\n} : $expm1;\n","// 20.2.2.14 Math.expm1(x)\nvar $export = require('./_export');\nvar $expm1 = require('./_math-expm1');\n\n$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 });\n","// 20.2.2.16 Math.fround(x)\nvar sign = require('./_math-sign');\nvar pow = Math.pow;\nvar EPSILON = pow(2, -52);\nvar EPSILON32 = pow(2, -23);\nvar MAX32 = pow(2, 127) * (2 - EPSILON32);\nvar MIN32 = pow(2, -126);\n\nvar roundTiesToEven = function (n) {\n return n + 1 / EPSILON - 1 / EPSILON;\n};\n\nmodule.exports = Math.fround || function fround(x) {\n var $abs = Math.abs(x);\n var $sign = sign(x);\n var a, result;\n if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;\n a = (1 + EPSILON32 / EPSILON) * $abs;\n result = a - (a - $abs);\n // eslint-disable-next-line no-self-compare\n if (result > MAX32 || result != result) return $sign * Infinity;\n return $sign * result;\n};\n","// 20.2.2.16 Math.fround(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', { fround: require('./_math-fround') });\n","// 20.2.2.17 Math.hypot([value1[, value2[, … ]]])\nvar $export = require('./_export');\nvar abs = Math.abs;\n\n$export($export.S, 'Math', {\n hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars\n var sum = 0;\n var i = 0;\n var aLen = arguments.length;\n var larg = 0;\n var arg, div;\n while (i < aLen) {\n arg = abs(arguments[i++]);\n if (larg < arg) {\n div = larg / arg;\n sum = sum * div * div + 1;\n larg = arg;\n } else if (arg > 0) {\n div = arg / larg;\n sum += div * div;\n } else sum += arg;\n }\n return larg === Infinity ? Infinity : larg * Math.sqrt(sum);\n }\n});\n","// 20.2.2.18 Math.imul(x, y)\nvar $export = require('./_export');\nvar $imul = Math.imul;\n\n// some WebKit versions fails with big numbers, some has wrong arity\n$export($export.S + $export.F * require('./_fails')(function () {\n return $imul(0xffffffff, 5) != -5 || $imul.length != 2;\n}), 'Math', {\n imul: function imul(x, y) {\n var UINT16 = 0xffff;\n var xn = +x;\n var yn = +y;\n var xl = UINT16 & xn;\n var yl = UINT16 & yn;\n return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0);\n }\n});\n","// 20.2.2.20 Math.log1p(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', { log1p: require('./_math-log1p') });\n","// 20.2.2.21 Math.log10(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n log10: function log10(x) {\n return Math.log(x) * Math.LOG10E;\n }\n});\n","// 20.2.2.22 Math.log2(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n log2: function log2(x) {\n return Math.log(x) / Math.LN2;\n }\n});\n","// 20.2.2.28 Math.sign(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', { sign: require('./_math-sign') });\n","// 20.2.2.30 Math.sinh(x)\nvar $export = require('./_export');\nvar expm1 = require('./_math-expm1');\nvar exp = Math.exp;\n\n// V8 near Chromium 38 has a problem with very small numbers\n$export($export.S + $export.F * require('./_fails')(function () {\n return !Math.sinh(-2e-17) != -2e-17;\n}), 'Math', {\n sinh: function sinh(x) {\n return Math.abs(x = +x) < 1\n ? (expm1(x) - expm1(-x)) / 2\n : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2);\n }\n});\n","// 20.2.2.33 Math.tanh(x)\nvar $export = require('./_export');\nvar expm1 = require('./_math-expm1');\nvar exp = Math.exp;\n\n$export($export.S, 'Math', {\n tanh: function tanh(x) {\n var a = expm1(x = +x);\n var b = expm1(-x);\n return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x));\n }\n});\n","// 20.2.2.34 Math.trunc(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n trunc: function trunc(it) {\n return (it > 0 ? Math.floor : Math.ceil)(it);\n }\n});\n","'use strict';\n// https://github.com/tc39/Array.prototype.includes\nvar $export = require('./_export');\nvar $includes = require('./_array-includes')(true);\n\n$export($export.P, 'Array', {\n includes: function includes(el /* , fromIndex = 0 */) {\n return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\nrequire('./_add-to-unscopables')('includes');\n","var getKeys = require('./_object-keys');\nvar toIObject = require('./_to-iobject');\nvar isEnum = require('./_object-pie').f;\nmodule.exports = function (isEntries) {\n return function (it) {\n var O = toIObject(it);\n var keys = getKeys(O);\n var length = keys.length;\n var i = 0;\n var result = [];\n var key;\n while (length > i) if (isEnum.call(O, key = keys[i++])) {\n result.push(isEntries ? [key, O[key]] : O[key]);\n } return result;\n };\n};\n","// https://github.com/tc39/proposal-object-values-entries\nvar $export = require('./_export');\nvar $values = require('./_object-to-array')(false);\n\n$export($export.S, 'Object', {\n values: function values(it) {\n return $values(it);\n }\n});\n","// https://github.com/tc39/proposal-object-values-entries\nvar $export = require('./_export');\nvar $entries = require('./_object-to-array')(true);\n\n$export($export.S, 'Object', {\n entries: function entries(it) {\n return $entries(it);\n }\n});\n","// https://github.com/tc39/proposal-object-getownpropertydescriptors\nvar $export = require('./_export');\nvar ownKeys = require('./_own-keys');\nvar toIObject = require('./_to-iobject');\nvar gOPD = require('./_object-gopd');\nvar createProperty = require('./_create-property');\n\n$export($export.S, 'Object', {\n getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {\n var O = toIObject(object);\n var getDesc = gOPD.f;\n var keys = ownKeys(O);\n var result = {};\n var i = 0;\n var key, desc;\n while (keys.length > i) {\n desc = getDesc(O, key = keys[i++]);\n if (desc !== undefined) createProperty(result, key, desc);\n }\n return result;\n }\n});\n","// https://github.com/tc39/proposal-string-pad-start-end\nvar toLength = require('./_to-length');\nvar repeat = require('./_string-repeat');\nvar defined = require('./_defined');\n\nmodule.exports = function (that, maxLength, fillString, left) {\n var S = String(defined(that));\n var stringLength = S.length;\n var fillStr = fillString === undefined ? ' ' : String(fillString);\n var intMaxLength = toLength(maxLength);\n if (intMaxLength <= stringLength || fillStr == '') return S;\n var fillLen = intMaxLength - stringLength;\n var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));\n if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);\n return left ? stringFiller + S : S + stringFiller;\n};\n","var global = require('./_global');\nvar navigator = global.navigator;\n\nmodule.exports = navigator && navigator.userAgent || '';\n","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export');\nvar $pad = require('./_string-pad');\nvar userAgent = require('./_user-agent');\n\n// https://github.com/zloirock/core-js/issues/280\n$export($export.P + $export.F * /Version\\/10\\.\\d+(\\.\\d+)? Safari\\//.test(userAgent), 'String', {\n padStart: function padStart(maxLength /* , fillString = ' ' */) {\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);\n }\n});\n","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export');\nvar $pad = require('./_string-pad');\nvar userAgent = require('./_user-agent');\n\n// https://github.com/zloirock/core-js/issues/280\n$export($export.P + $export.F * /Version\\/10\\.\\d+(\\.\\d+)? Safari\\//.test(userAgent), 'String', {\n padEnd: function padEnd(maxLength /* , fillString = ' ' */) {\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);\n }\n});\n","// ie9- setTimeout & setInterval additional parameters fix\nvar global = require('./_global');\nvar $export = require('./_export');\nvar userAgent = require('./_user-agent');\nvar slice = [].slice;\nvar MSIE = /MSIE .\\./.test(userAgent); // <- dirty ie9- check\nvar wrap = function (set) {\n return function (fn, time /* , ...args */) {\n var boundArgs = arguments.length > 2;\n var args = boundArgs ? slice.call(arguments, 2) : false;\n return set(boundArgs ? function () {\n // eslint-disable-next-line no-new-func\n (typeof fn == 'function' ? fn : Function(fn)).apply(this, args);\n } : fn, time);\n };\n};\n$export($export.G + $export.B + $export.F * MSIE, {\n setTimeout: wrap(global.setTimeout),\n setInterval: wrap(global.setInterval)\n});\n","var $export = require('./_export');\nvar $task = require('./_task');\n$export($export.G + $export.B, {\n setImmediate: $task.set,\n clearImmediate: $task.clear\n});\n","var $iterators = require('./es6.array.iterator');\nvar getKeys = require('./_object-keys');\nvar redefine = require('./_redefine');\nvar global = require('./_global');\nvar hide = require('./_hide');\nvar Iterators = require('./_iterators');\nvar wks = require('./_wks');\nvar ITERATOR = wks('iterator');\nvar TO_STRING_TAG = wks('toStringTag');\nvar ArrayValues = Iterators.Array;\n\nvar DOMIterables = {\n CSSRuleList: true, // TODO: Not spec compliant, should be false.\n CSSStyleDeclaration: false,\n CSSValueList: false,\n ClientRectList: false,\n DOMRectList: false,\n DOMStringList: false,\n DOMTokenList: true,\n DataTransferItemList: false,\n FileList: false,\n HTMLAllCollection: false,\n HTMLCollection: false,\n HTMLFormElement: false,\n HTMLSelectElement: false,\n MediaList: true, // TODO: Not spec compliant, should be false.\n MimeTypeArray: false,\n NamedNodeMap: false,\n NodeList: true,\n PaintRequestList: false,\n Plugin: false,\n PluginArray: false,\n SVGLengthList: false,\n SVGNumberList: false,\n SVGPathSegList: false,\n SVGPointList: false,\n SVGStringList: false,\n SVGTransformList: false,\n SourceBufferList: false,\n StyleSheetList: true, // TODO: Not spec compliant, should be false.\n TextTrackCueList: false,\n TextTrackList: false,\n TouchList: false\n};\n\nfor (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {\n var NAME = collections[i];\n var explicit = DOMIterables[NAME];\n var Collection = global[NAME];\n var proto = Collection && Collection.prototype;\n var key;\n if (proto) {\n if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);\n if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);\n Iterators[NAME] = ArrayValues;\n if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);\n }\n}\n","/**\n * Copyright (c) 2014, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * https://raw.github.com/facebook/regenerator/master/LICENSE file. An\n * additional grant of patent rights can be found in the PATENTS file in\n * the same directory.\n */\n\n!(function(global) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n var inModule = typeof module === \"object\";\n var runtime = global.regeneratorRuntime;\n if (runtime) {\n if (inModule) {\n // If regeneratorRuntime is defined globally and we're in a module,\n // make the exports object identical to regeneratorRuntime.\n module.exports = runtime;\n }\n // Don't bother evaluating the rest of this file if the runtime was\n // already defined globally.\n return;\n }\n\n // Define the runtime globally (as expected by generated code) as either\n // module.exports (if we're in a module) or a new, empty object.\n runtime = global.regeneratorRuntime = inModule ? module.exports : {};\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n runtime.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunctionPrototype[toStringTagSymbol] =\n GeneratorFunction.displayName = \"GeneratorFunction\";\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }\n\n runtime.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n runtime.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n if (!(toStringTagSymbol in genFun)) {\n genFun[toStringTagSymbol] = \"GeneratorFunction\";\n }\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n runtime.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return Promise.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return Promise.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration. If the Promise is rejected, however, the\n // result for this iteration will be rejected with the same\n // reason. Note that rejections of yielded Promises are not\n // thrown back into the generator function, as is the case\n // when an awaited Promise is rejected. This difference in\n // behavior between yield and await is important, because it\n // allows the consumer to decide what to do with the yielded\n // rejection (swallow it and continue, manually .throw it back\n // into the generator, abandon iteration, whatever). With\n // await, by contrast, there is no opportunity to examine the\n // rejection reason outside the generator function, so the\n // only option is to throw it from the await expression, and\n // let the generator function handle the exception.\n result.value = unwrapped;\n resolve(result);\n }, reject);\n }\n }\n\n if (typeof global.process === \"object\" && global.process.domain) {\n invoke = global.process.domain.bind(invoke);\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new Promise(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n runtime.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n runtime.async = function(innerFn, outerFn, self, tryLocsList) {\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList)\n );\n\n return runtime.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n if (delegate.iterator.return) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n Gp[toStringTagSymbol] = \"Generator\";\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n runtime.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n runtime.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n})(\n // Among the various tricks for obtaining a reference to the global\n // object, this seems to be the most reliable technique that does not\n // use indirect eval (which violates Content Security Policy).\n typeof global === \"object\" ? global :\n typeof window === \"object\" ? window :\n typeof self === \"object\" ? self : this\n);\n","/**\n * Returns detailed type as string (instead of just 'object' for arrays etc)\n * @private\n * @param {any} value js value\n * @returns {String} type of value\n * @example\n * typeOf({}); // 'object'\n * typeOf([]); // 'array'\n * typeOf(function() {}); // 'function'\n * typeOf(/a/); // 'regexp'\n * typeOf(new Date()); // 'date'\n * typeOf(null); // 'null'\n * typeOf(undefined); // 'undefined'\n * typeOf('a'); // 'string'\n * typeOf(1); // 'number'\n * typeOf(true); // 'boolean'\n * typeOf(new Map()); // 'map'\n * typeOf(new Set()); // 'map'\n */\nfunction typeOf(value) {\n if (value === null) {\n return 'null';\n }\n if (value !== Object(value)) {\n return typeof value;\n }\n return {}.toString\n .call(value)\n .slice(8, -1)\n .toLowerCase();\n}\n\nexport default typeOf;\n","import typeOf from './typeOf';\n/**\n * Checks if input string is empty\n * @param {String} input text input\n * @return {Boolean} true if no input\n */\nfunction isEmpty(input) {\n if (typeOf(input) !== 'string') {\n return true;\n }\n return !input.length;\n}\n\nexport default isEmpty;\n","import isEmpty from './isEmpty';\n\n/**\n * Takes a character and a unicode range. Returns true if the char is in the range.\n * @param {String} char unicode character\n * @param {Number} start unicode start range\n * @param {Number} end unicode end range\n * @return {Boolean}\n */\nfunction isCharInRange(char = '', start, end) {\n if (isEmpty(char)) return false;\n const code = char.charCodeAt(0);\n return start <= code && code <= end;\n}\n\nexport default isCharInRange;\n","export const VERSION = '4.0.2';\n\nexport const TO_KANA_METHODS = {\n HIRAGANA: 'toHiragana',\n KATAKANA: 'toKatakana',\n};\n\nexport const ROMANIZATIONS = {\n HEPBURN: 'hepburn',\n};\n\n/**\n * Default config for WanaKana, user passed options will be merged with these\n * @type {DefaultOptions}\n * @name defaultOptions\n * @property {Boolean} [useObsoleteKana=false] - Set to true to use obsolete characters, such as ゐ and ゑ.\n * @example\n * toHiragana('we', { useObsoleteKana: true })\n * // => 'ゑ'\n * @property {Boolean} [passRomaji=false] - Set to true to pass romaji when using mixed syllabaries with toKatakana() or toHiragana()\n * @example\n * toHiragana('only convert the katakana: ヒラガナ', { passRomaji: true })\n * // => \"only convert the katakana: ひらがな\"\n * @property {Boolean} [upcaseKatakana=false] - Set to true to convert katakana to uppercase using toRomaji()\n * @example\n * toRomaji('ひらがな カタカナ', { upcaseKatakana: true })\n * // => \"hiragana KATAKANA\"\n * @property {Boolean|String} [IMEMode=false] - Set to true, 'toHiragana', or 'toKatakana' to handle conversion while it is being typed.\n * @property {String} [romanization='hepburn'] - choose toRomaji() romanization map (currently only 'hepburn')\n * @property {Object} [customKanaMapping] - custom map will be merged with default conversion\n * @example\n * toKana('wanakana', { customKanaMapping: { na: 'に', ka: 'Bana' }) };\n * // => 'わにBanaに'\n * @property {Object} [customRomajiMapping] - custom map will be merged with default conversion\n * @example\n * toRomaji('つじぎり', { customRomajiMapping: { じ: 'zi', つ: 'tu', り: 'li' }) };\n * // => 'tuzigili'\n */\nexport const DEFAULT_OPTIONS = {\n useObsoleteKana: false,\n passRomaji: false,\n upcaseKatakana: false,\n ignoreCase: false,\n IMEMode: false,\n romanization: ROMANIZATIONS.HEPBURN,\n};\n\n// CharCode References\n// http://www.rikai.com/library/kanjitables/kanji_codes.unicode.shtml\n// http://unicode-table.com\n\nexport const LATIN_LOWERCASE_START = 0x61;\nexport const LATIN_LOWERCASE_END = 0x7a;\nexport const LATIN_UPPERCASE_START = 0x41;\nexport const LATIN_UPPERCASE_END = 0x5a;\nexport const LOWERCASE_ZENKAKU_START = 0xff41;\nexport const LOWERCASE_ZENKAKU_END = 0xff5a;\nexport const UPPERCASE_ZENKAKU_START = 0xff21;\nexport const UPPERCASE_ZENKAKU_END = 0xff3a;\nexport const HIRAGANA_START = 0x3041;\nexport const HIRAGANA_END = 0x3096;\nexport const KATAKANA_START = 0x30a1;\nexport const KATAKANA_END = 0x30fc;\nexport const KANJI_START = 0x4e00;\nexport const KANJI_END = 0x9faf;\nexport const PROLONGED_SOUND_MARK = 0x30fc;\nexport const KANA_SLASH_DOT = 0x30fb;\n\nconst ZENKAKU_NUMBERS = [0xff10, 0xff19];\nconst ZENKAKU_UPPERCASE = [UPPERCASE_ZENKAKU_START, UPPERCASE_ZENKAKU_END];\nconst ZENKAKU_LOWERCASE = [LOWERCASE_ZENKAKU_START, LOWERCASE_ZENKAKU_END];\nconst ZENKAKU_PUNCTUATION_1 = [0xff01, 0xff0f];\nconst ZENKAKU_PUNCTUATION_2 = [0xff1a, 0xff1f];\nconst ZENKAKU_PUNCTUATION_3 = [0xff3b, 0xff3f];\nconst ZENKAKU_PUNCTUATION_4 = [0xff5b, 0xff60];\nconst ZENKAKU_SYMBOLS_CURRENCY = [0xffe0, 0xffee];\n\nconst HIRAGANA_CHARS = [0x3040, 0x309f];\nconst KATAKANA_CHARS = [0x30a0, 0x30ff];\nconst HANKAKU_KATAKANA = [0xff66, 0xff9f];\nconst KATAKANA_PUNCTUATION = [0x30fb, 0x30fc];\nconst KANA_PUNCTUATION = [0xff61, 0xff65];\nconst CJK_SYMBOLS_PUNCTUATION = [0x3000, 0x303f];\nconst COMMON_CJK = [0x4e00, 0x9fff];\nconst RARE_CJK = [0x3400, 0x4dbf];\n\nexport const KANA_RANGES = [HIRAGANA_CHARS, KATAKANA_CHARS, KANA_PUNCTUATION, HANKAKU_KATAKANA];\n\nexport const JA_PUNCTUATION_RANGES = [\n CJK_SYMBOLS_PUNCTUATION,\n KANA_PUNCTUATION,\n KATAKANA_PUNCTUATION,\n ZENKAKU_PUNCTUATION_1,\n ZENKAKU_PUNCTUATION_2,\n ZENKAKU_PUNCTUATION_3,\n ZENKAKU_PUNCTUATION_4,\n ZENKAKU_SYMBOLS_CURRENCY,\n];\n\n// All Japanese unicode start and end ranges\n// Includes kanji, kana, zenkaku latin chars, punctuation, and number ranges.\nexport const JAPANESE_RANGES = [\n ...KANA_RANGES,\n ...JA_PUNCTUATION_RANGES,\n ZENKAKU_UPPERCASE,\n ZENKAKU_LOWERCASE,\n ZENKAKU_NUMBERS,\n COMMON_CJK,\n RARE_CJK,\n];\n\nconst MODERN_ENGLISH = [0x0000, 0x007f];\nconst HEPBURN_MACRON_RANGES = [\n [0x0100, 0x0101], // Ā ā\n [0x0112, 0x0113], // Ē ē\n [0x012a, 0x012b], // Ī ī\n [0x014c, 0x014d], // Ō ō\n [0x016a, 0x016b], // Ū ū\n];\nconst SMART_QUOTE_RANGES = [\n [0x2018, 0x2019], // ‘ ’\n [0x201c, 0x201d], // “ ”\n];\n\nexport const ROMAJI_RANGES = [MODERN_ENGLISH, ...HEPBURN_MACRON_RANGES];\n\nexport const EN_PUNCTUATION_RANGES = [\n [0x20, 0x2f],\n [0x3a, 0x3f],\n [0x5b, 0x60],\n [0x7b, 0x7e],\n ...SMART_QUOTE_RANGES,\n];\n","import isCharInRange from './isCharInRange';\nimport { JAPANESE_RANGES } from '../constants';\n\n/**\n * Tests a character. Returns true if the character is [Katakana](https://en.wikipedia.org/wiki/Katakana).\n * @param {String} char character string to test\n * @return {Boolean}\n */\nfunction isCharJapanese(char = '') {\n return JAPANESE_RANGES.some(([start, end]) => isCharInRange(char, start, end));\n}\n\nexport default isCharJapanese;\n","import typeOf from './utils/typeOf';\nimport isEmpty from './utils/isEmpty';\nimport isCharJapanese from './utils/isCharJapanese';\n\n/**\n * Test if `input` only includes [Kanji](https://en.wikipedia.org/wiki/Kanji), [Kana](https://en.wikipedia.org/wiki/Kana), zenkaku numbers, and JA punctuation/symbols.”\n * @param {String} [input=''] text\n * @param {Regexp} [allowed] additional test allowed to pass for each char\n * @return {Boolean} true if passes checks\n * @example\n * isJapanese('泣き虫')\n * // => true\n * isJapanese('あア')\n * // => true\n * isJapanese('2月') // Zenkaku numbers allowed\n * // => true\n * isJapanese('泣き虫。!〜$') // Zenkaku/JA punctuation\n * // => true\n * isJapanese('泣き虫.!~$') // Latin punctuation fails\n * // => false\n * isJapanese('A泣き虫')\n * // => false\n * isJapanese('≪偽括弧≫', /[≪≫]/);\n * // => true\n */\nfunction isJapanese(input = '', allowed) {\n const augmented = typeOf(allowed) === 'regexp';\n return isEmpty(input)\n ? false\n : [...input].every((char) => {\n const isJa = isCharJapanese(char);\n return !augmented ? isJa : isJa || allowed.test(char);\n });\n}\n\nexport default isJapanese;\n","import { DEFAULT_OPTIONS } from '../constants';\n/**\n * Easy re-use of merging with default options\n * @param {Object} opts user options\n * @returns user options merged over default options\n */\nconst mergeWithDefaultOptions = (opts = {}) => Object.assign({}, DEFAULT_OPTIONS, opts);\n\nexport default mergeWithDefaultOptions;\n","import typeOf from './typeOf';\n\nexport function applyMapping(string, mapping, convertEnding) {\n const root = mapping;\n\n function nextSubtree(tree, nextChar) {\n const subtree = tree[nextChar];\n if (subtree === undefined) {\n return undefined;\n }\n // if the next child node does not have a node value, set its node value to the input\n return Object.assign({ '': tree[''] + nextChar }, tree[nextChar]);\n }\n\n function newChunk(remaining, currentCursor) {\n // start parsing a new chunk\n const firstChar = remaining.charAt(0);\n\n return parse(\n Object.assign({ '': firstChar }, root[firstChar]),\n remaining.slice(1),\n currentCursor,\n currentCursor + 1\n );\n }\n\n function parse(tree, remaining, lastCursor, currentCursor) {\n if (!remaining) {\n if (convertEnding || Object.keys(tree).length === 1) {\n // nothing more to consume, just commit the last chunk and return it\n // so as to not have an empty element at the end of the result\n return tree[''] ? [[lastCursor, currentCursor, tree['']]] : [];\n }\n // if we don't want to convert the ending, because there are still possible continuations\n // return null as the final node value\n return [[lastCursor, currentCursor, null]];\n }\n\n if (Object.keys(tree).length === 1) {\n return [[lastCursor, currentCursor, tree['']]].concat(newChunk(remaining, currentCursor));\n }\n\n const subtree = nextSubtree(tree, remaining.charAt(0));\n\n if (subtree === undefined) {\n return [[lastCursor, currentCursor, tree['']]].concat(newChunk(remaining, currentCursor));\n }\n // continue current branch\n return parse(subtree, remaining.slice(1), lastCursor, currentCursor + 1);\n }\n\n return newChunk(string, 0);\n}\n\n// transform the tree, so that for example hepburnTree['ゔ']['ぁ'][''] === 'va'\n// or kanaTree['k']['y']['a'][''] === 'きゃ'\nexport function transform(tree) {\n return Object.entries(tree).reduce((map, [char, subtree]) => {\n const endOfBranch = typeOf(subtree) === 'string';\n map[char] = endOfBranch ? { '': subtree } : transform(subtree);\n return map;\n }, {});\n}\n\nexport function getSubTreeOf(tree, string) {\n return string.split('').reduce((correctSubTree, char) => {\n if (correctSubTree[char] === undefined) {\n correctSubTree[char] = {};\n }\n return correctSubTree[char];\n }, tree);\n}\n\n/**\n * Creates a custom mapping tree, returns a function that accepts a defaultMap which the newly created customMapping will be merged with and returned\n * (customMap) => (defaultMap) => mergedMap\n * @param {Object} customMap { 'ka' : 'な' }\n * @return {Function} (defaultMap) => defaultMergedWithCustomMap\n * @example\n * const sillyMap = createCustomMapping({ 'ちゃ': 'time', '茎': 'cookie' });\n * // sillyMap is passed defaultMapping to merge with when called in toRomaji()\n * toRomaji(\"It's 茎 ちゃ よ\", { customRomajiMapping: sillyMap });\n * // => 'It's cookie time yo';\n */\nexport function createCustomMapping(customMap = {}) {\n const customTree = {};\n\n if (typeOf(customMap) === 'object') {\n Object.entries(customMap).forEach(([roma, kana]) => {\n let subTree = customTree;\n roma.split('').forEach((char) => {\n if (subTree[char] === undefined) {\n subTree[char] = {};\n }\n subTree = subTree[char];\n });\n subTree[''] = kana;\n });\n }\n\n return function makeMap(map) {\n const mapCopy = JSON.parse(JSON.stringify(map));\n\n function transformMap(mapSubtree, customSubtree) {\n if (mapSubtree === undefined || typeOf(mapSubtree) === 'string') {\n return customSubtree;\n }\n return Object.entries(customSubtree).reduce((newSubtree, [char, subtree]) => {\n newSubtree[char] = transformMap(mapSubtree[char], subtree);\n return newSubtree;\n }, mapSubtree);\n }\n\n return transformMap(mapCopy, customTree);\n };\n}\n\n// allow consumer to pass either function or object as customMapping\nexport function mergeCustomMapping(map, customMapping) {\n if (!customMapping) {\n return map;\n }\n return typeOf(customMapping) === 'function'\n ? customMapping(map)\n : createCustomMapping(customMapping)(map);\n}\n","import { transform, getSubTreeOf, createCustomMapping } from './kanaMapping';\n\n// NOTE: not exactly kunrei shiki, for example ぢゃ -> dya instead of zya, to avoid name clashing\n/* eslint-disable */\n// prettier-ignore\nconst BASIC_KUNREI = {\n a: 'あ', i: 'い', u: 'う', e: 'え', o: 'お',\n k: { a: 'か', i: 'き', u: 'く', e: 'け', o: 'こ', },\n s: { a: 'さ', i: 'し', u: 'す', e: 'せ', o: 'そ', },\n t: { a: 'た', i: 'ち', u: 'つ', e: 'て', o: 'と', },\n n: { a: 'な', i: 'に', u: 'ぬ', e: 'ね', o: 'の', },\n h: { a: 'は', i: 'ひ', u: 'ふ', e: 'へ', o: 'ほ', },\n m: { a: 'ま', i: 'み', u: 'む', e: 'め', o: 'も', },\n y: { a: 'や', u: 'ゆ', o: 'よ' },\n r: { a: 'ら', i: 'り', u: 'る', e: 'れ', o: 'ろ', },\n w: { a: 'わ', i: 'ゐ', e: 'ゑ', o: 'を', },\n g: { a: 'が', i: 'ぎ', u: 'ぐ', e: 'げ', o: 'ご', },\n z: { a: 'ざ', i: 'じ', u: 'ず', e: 'ぜ', o: 'ぞ', },\n d: { a: 'だ', i: 'ぢ', u: 'づ', e: 'で', o: 'ど', },\n b: { a: 'ば', i: 'び', u: 'ぶ', e: 'べ', o: 'ぼ', },\n p: { a: 'ぱ', i: 'ぴ', u: 'ぷ', e: 'ぺ', o: 'ぽ', },\n v: { a: 'ゔぁ', i: 'ゔぃ', u: 'ゔ', e: 'ゔぇ', o: 'ゔぉ', },\n};\n\nconst SPECIAL_SYMBOLS = {\n '.': '。',\n ',': '、',\n ':': ':',\n '/': '・',\n '!': '!',\n '?': '?',\n '~': '〜',\n '-': 'ー',\n '‘': '「',\n '’': '」',\n '“': '『',\n '”': '』',\n '[': '[',\n ']': ']',\n '(': '(',\n ')': ')',\n '{': '{',\n '}': '}',\n};\n\nconst CONSONANTS = {\n k: 'き',\n s: 'し',\n t: 'ち',\n n: 'に',\n h: 'ひ',\n m: 'み',\n r: 'り',\n g: 'ぎ',\n z: 'じ',\n d: 'ぢ',\n b: 'び',\n p: 'ぴ',\n v: 'ゔ',\n q: 'く',\n f: 'ふ',\n};\nconst SMALL_Y = { ya: 'ゃ', yi: 'ぃ', yu: 'ゅ', ye: 'ぇ', yo: 'ょ' };\nconst SMALL_VOWELS = { a: 'ぁ', i: 'ぃ', u: 'ぅ', e: 'ぇ', o: 'ぉ' };\n\n// typing one should be the same as having typed the other instead\nconst ALIASES = {\n sh: 'sy', // sha -> sya\n ch: 'ty', // cho -> tyo\n cy: 'ty', // cyo -> tyo\n chy: 'ty', // chyu -> tyu\n shy: 'sy', // shya -> sya\n j: 'zy', // ja -> zya\n jy: 'zy', // jye -> zye\n\n // exceptions to above rules\n shi: 'si',\n chi: 'ti',\n tsu: 'tu',\n ji: 'zi',\n fu: 'hu',\n};\n\n// xtu -> っ\nconst SMALL_LETTERS = Object.assign(\n {\n tu: 'っ',\n wa: 'ゎ',\n ka: 'ヵ',\n ke: 'ヶ',\n },\n SMALL_VOWELS,\n SMALL_Y\n);\n\n// don't follow any notable patterns\nconst SPECIAL_CASES = {\n yi: 'い',\n wu: 'う',\n ye: 'いぇ',\n wi: 'うぃ',\n we: 'うぇ',\n kwa: 'くぁ',\n whu: 'う',\n // because it's not thya for てゃ but tha\n // and tha is not てぁ, but てゃ\n tha: 'てゃ',\n thu: 'てゅ',\n tho: 'てょ',\n dha: 'でゃ',\n dhu: 'でゅ',\n dho: 'でょ',\n};\n\nconst AIUEO_CONSTRUCTIONS = {\n wh: 'う',\n qw: 'く',\n q: 'く',\n gw: 'ぐ',\n sw: 'す',\n ts: 'つ',\n th: 'て',\n tw: 'と',\n dh: 'で',\n dw: 'ど',\n fw: 'ふ',\n f: 'ふ',\n};\n\n/* eslint-enable */\nfunction createRomajiToKanaMap() {\n const kanaTree = transform(BASIC_KUNREI);\n // pseudo partial application\n const subtreeOf = (string) => getSubTreeOf(kanaTree, string);\n\n // add tya, sya, etc.\n Object.entries(CONSONANTS).forEach(([consonant, yKana]) => {\n Object.entries(SMALL_Y).forEach(([roma, kana]) => {\n // for example kyo -> き + ょ\n subtreeOf(consonant + roma)[''] = yKana + kana;\n });\n });\n\n Object.entries(SPECIAL_SYMBOLS).forEach(([symbol, jsymbol]) => {\n subtreeOf(symbol)[''] = jsymbol;\n });\n\n // things like うぃ, くぃ, etc.\n Object.entries(AIUEO_CONSTRUCTIONS).forEach(([consonant, aiueoKana]) => {\n Object.entries(SMALL_VOWELS).forEach(([vowel, kana]) => {\n const subtree = subtreeOf(consonant + vowel);\n subtree[''] = aiueoKana + kana;\n });\n });\n\n // different ways to write ん\n ['n', \"n'\", 'xn'].forEach((nChar) => {\n subtreeOf(nChar)[''] = 'ん';\n });\n\n // c is equivalent to k, but not for chi, cha, etc. that's why we have to make a copy of k\n kanaTree.c = JSON.parse(JSON.stringify(kanaTree.k));\n\n Object.entries(ALIASES).forEach(([string, alternative]) => {\n const allExceptLast = string.slice(0, string.length - 1);\n const last = string.charAt(string.length - 1);\n const parentTree = subtreeOf(allExceptLast);\n // copy to avoid recursive containment\n parentTree[last] = JSON.parse(JSON.stringify(subtreeOf(alternative)));\n });\n\n function getAlternatives(string) {\n return [...Object.entries(ALIASES), ...[['c', 'k']]].reduce(\n (list, [alt, roma]) =>\n (string.startsWith(roma) ? list.concat(string.replace(roma, alt)) : list),\n []\n );\n }\n\n Object.entries(SMALL_LETTERS).forEach(([kunreiRoma, kana]) => {\n const last = (char) => char.charAt(char.length - 1);\n const allExceptLast = (chars) => chars.slice(0, chars.length - 1);\n const xRoma = `x${kunreiRoma}`;\n const xSubtree = subtreeOf(xRoma);\n xSubtree[''] = kana;\n\n // ltu -> xtu -> っ\n const parentTree = subtreeOf(`l${allExceptLast(kunreiRoma)}`);\n parentTree[last(kunreiRoma)] = xSubtree;\n\n // ltsu -> ltu -> っ\n getAlternatives(kunreiRoma).forEach((altRoma) => {\n ['l', 'x'].forEach((prefix) => {\n const altParentTree = subtreeOf(prefix + allExceptLast(altRoma));\n altParentTree[last(altRoma)] = subtreeOf(prefix + kunreiRoma);\n });\n });\n });\n\n Object.entries(SPECIAL_CASES).forEach(([string, kana]) => {\n subtreeOf(string)[''] = kana;\n });\n\n // add kka, tta, etc.\n function addTsu(tree) {\n return Object.entries(tree).reduce((tsuTree, [key, value]) => {\n if (!key) {\n // we have reached the bottom of this branch\n tsuTree[key] = `っ${value}`;\n } else {\n // more subtrees\n tsuTree[key] = addTsu(value);\n }\n return tsuTree;\n }, {});\n }\n // have to explicitly name c here, because we made it a copy of k, not a reference\n [...Object.keys(CONSONANTS), 'c', 'y', 'w', 'j'].forEach((consonant) => {\n const subtree = kanaTree[consonant];\n subtree[consonant] = addTsu(subtree);\n });\n // nn should not be っん\n delete kanaTree.n.n;\n // solidify the results, so that there there is referential transparency within the tree\n return Object.freeze(JSON.parse(JSON.stringify(kanaTree)));\n}\n\nlet romajiToKanaMap = null;\n\nexport function getRomajiToKanaTree() {\n if (romajiToKanaMap == null) {\n romajiToKanaMap = createRomajiToKanaMap();\n }\n return romajiToKanaMap;\n}\n\nexport const USE_OBSOLETE_KANA_MAP = createCustomMapping({ wi: 'ゐ', we: 'ゑ' });\n\nexport function IME_MODE_MAP(map) {\n // in IME mode, we do not want to convert single ns\n const mapCopy = JSON.parse(JSON.stringify(map));\n mapCopy.n.n = { '': 'ん' };\n mapCopy.n[' '] = { '': 'ん' };\n return mapCopy;\n}\n","import isEmpty from './isEmpty';\nimport isCharInRange from './isCharInRange';\nimport { LATIN_UPPERCASE_START, LATIN_UPPERCASE_END } from '../constants';\n\n/**\n * Tests if char is in English unicode uppercase range\n * @param {String} char\n * @return {Boolean}\n */\nfunction isCharUpperCase(char = '') {\n if (isEmpty(char)) return false;\n return isCharInRange(char, LATIN_UPPERCASE_START, LATIN_UPPERCASE_END);\n}\n\nexport default isCharUpperCase;\n","import isEmpty from './isEmpty';\nimport { PROLONGED_SOUND_MARK } from '../constants';\n\n/**\n * Returns true if char is 'ー'\n * @param {String} char to test\n * @return {Boolean}\n */\nfunction isCharLongDash(char = '') {\n if (isEmpty(char)) return false;\n return char.charCodeAt(0) === PROLONGED_SOUND_MARK;\n}\n\nexport default isCharLongDash;\n","import isEmpty from './isEmpty';\nimport { KANA_SLASH_DOT } from '../constants';\n\n/**\n * Tests if char is '・'\n * @param {String} char\n * @return {Boolean} true if '・'\n */\nfunction isCharSlashDot(char = '') {\n if (isEmpty(char)) return false;\n return char.charCodeAt(0) === KANA_SLASH_DOT;\n}\n\nexport default isCharSlashDot;\n","import isEmpty from './isEmpty';\nimport isCharLongDash from './isCharLongDash';\nimport isCharInRange from './isCharInRange';\nimport {\n HIRAGANA_START,\n HIRAGANA_END,\n} from '../constants';\n\n/**\n * Tests a character. Returns true if the character is [Hiragana](https://en.wikipedia.org/wiki/Hiragana).\n * @param {String} char character string to test\n * @return {Boolean}\n */\nfunction isCharHiragana(char = '') {\n if (isEmpty(char)) return false;\n if (isCharLongDash(char)) return true;\n return isCharInRange(char, HIRAGANA_START, HIRAGANA_END);\n}\n\nexport default isCharHiragana;\n","import { KATAKANA_START, HIRAGANA_START } from '../constants';\n\nimport isCharLongDash from './isCharLongDash';\nimport isCharSlashDot from './isCharSlashDot';\nimport isCharHiragana from './isCharHiragana';\n\n/**\n * Convert [Hiragana](https://en.wikipedia.org/wiki/Hiragana) to [Katakana](https://en.wikipedia.org/wiki/Katakana)\n * Passes through any non-hiragana chars\n * @private\n * @param {String} [input=''] text input\n * @return {String} converted text\n * @example\n * hiraganaToKatakana('ひらがな')\n * // => \"ヒラガナ\"\n * hiraganaToKatakana('ひらがな is a type of kana')\n * // => \"ヒラガナ is a type of kana\"\n */\nfunction hiraganaToKatakana(input = '') {\n const kata = [];\n input.split('').forEach((char) => {\n // Short circuit to avoid incorrect codeshift for 'ー' and '・'\n if (isCharLongDash(char) || isCharSlashDot(char)) {\n kata.push(char);\n } else if (isCharHiragana(char)) {\n // Shift charcode.\n const code = char.charCodeAt(0) + (KATAKANA_START - HIRAGANA_START);\n const kataChar = String.fromCharCode(code);\n kata.push(kataChar);\n } else {\n // Pass non-hiragana chars through\n kata.push(char);\n }\n });\n return kata.join('');\n}\n\nexport default hiraganaToKatakana;\n","import { TO_KANA_METHODS } from './constants';\nimport mergeWithDefaultOptions from './utils/mergeWithDefaultOptions';\nimport { getRomajiToKanaTree, IME_MODE_MAP, USE_OBSOLETE_KANA_MAP } from './utils/romajiToKanaMap';\nimport { applyMapping, mergeCustomMapping } from './utils/kanaMapping';\nimport isCharUpperCase from './utils/isCharUpperCase';\nimport hiraganaToKatakana from './utils/hiraganaToKatakana';\n\n/**\n * Convert [Romaji](https://en.wikipedia.org/wiki/Romaji) to [Kana](https://en.wikipedia.org/wiki/Kana), lowercase text will result in [Hiragana](https://en.wikipedia.org/wiki/Hiragana) and uppercase text will result in [Katakana](https://en.wikipedia.org/wiki/Katakana).\n * @param {String} [input=''] text\n * @param {DefaultOptions} [options=defaultOptions]\n * @return {String} converted text\n * @example\n * toKana('onaji BUTTSUUJI')\n * // => 'おなじ ブッツウジ'\n * toKana('ONAJI buttsuuji')\n * // => 'オナジ ぶっつうじ'\n * toKana('座禅‘zazen’スタイル')\n * // => '座禅「ざぜん」スタイル'\n * toKana('batsuge-mu')\n * // => 'ばつげーむ'\n * toKana('!?.:/,~-‘’“”[](){}') // Punctuation conversion\n * // => '!?。:・、〜ー「」『』[](){}'\n * toKana('we', { useObsoleteKana: true })\n * // => 'ゑ'\n * toKana('wanakana', { customKanaMapping: { na: 'に', ka: 'bana' } });\n * // => 'わにbanaに'\n */\nexport function toKana(input = '', options = {}, map) {\n let config;\n if (!map) {\n config = mergeWithDefaultOptions(options);\n map = createRomajiToKanaMap(config);\n } else {\n config = options;\n }\n\n // throw away the substring index information and just concatenate all the kana\n return splitIntoConvertedKana(input, config, map)\n .map((kanaToken) => {\n const [start, end, kana] = kanaToken;\n if (kana === null) {\n // haven't converted the end of the string, since we are in IME mode\n return input.slice(start);\n }\n const enforceHiragana = config.IMEMode === TO_KANA_METHODS.HIRAGANA;\n const enforceKatakana =\n config.IMEMode === TO_KANA_METHODS.KATAKANA ||\n [...input.slice(start, end)].every(isCharUpperCase);\n\n return enforceHiragana || !enforceKatakana ? kana : hiraganaToKatakana(kana);\n })\n .join('');\n}\n\n/**\n *\n * @private\n * @param {String} [input=''] input text\n * @param {Object} [options={}] toKana options\n * @returns {Array[]} [[start, end, token]]\n * @example\n * splitIntoConvertedKana('buttsuuji')\n * // => [[0, 2, 'ぶ'], [2, 6, 'っつ'], [6, 7, 'う'], [7, 9, 'じ']]\n */\nexport function splitIntoConvertedKana(input = '', options = {}, map) {\n if (!map) {\n map = createRomajiToKanaMap(options);\n }\n return applyMapping(input.toLowerCase(), map, !options.IMEMode);\n}\n\nlet customMapping = null;\nexport function createRomajiToKanaMap(options = {}) {\n let map = getRomajiToKanaTree();\n\n map = options.IMEMode ? IME_MODE_MAP(map) : map;\n map = options.useObsoleteKana ? USE_OBSOLETE_KANA_MAP(map) : map;\n\n if (options.customKanaMapping) {\n if (customMapping == null) {\n customMapping = mergeCustomMapping(map, options.customKanaMapping);\n }\n map = customMapping;\n }\n\n return map;\n}\n\nexport default toKana;\n","import isJapanese from '../isJapanese';\nimport toKana, { createRomajiToKanaMap } from '../toKana';\nimport mergeWithDefaultOptions from './mergeWithDefaultOptions';\n\nlet LISTENERS = [];\n/**\n * Automagically replaces input values with converted text to kana\n * @param {defaultOptions} [options] user config overrides, default conversion is toKana()\n * @return {Function} event handler with bound options\n * @private\n */\nexport function makeOnInput(options) {\n let prevInput;\n // Enforce IMEMode if not already specified\n const mergedConfig = Object.assign({}, mergeWithDefaultOptions(options), {\n IMEMode: options.IMEMode || true,\n });\n const preConfiguredMap = createRomajiToKanaMap(mergedConfig);\n const triggers = [\n ...Object.keys(preConfiguredMap),\n ...Object.keys(preConfiguredMap).map((char) => char.toUpperCase()),\n ];\n\n return function onInput({ target }) {\n if (target.value !== prevInput && target.dataset.ignoreComposition !== 'true') {\n convertInput(target, mergedConfig, preConfiguredMap, triggers, prevInput);\n }\n };\n}\n\nexport function convertInput(target, options, map, triggers, prevInput) {\n const [head, textToConvert, tail] = splitInput(target.value, target.selectionEnd, triggers);\n const convertedText = toKana(textToConvert, options, map);\n const changed = textToConvert !== convertedText;\n\n if (changed) {\n const newCursor = head.length + convertedText.length;\n const newValue = head + convertedText + tail;\n target.value = newValue;\n prevInput = newValue;\n\n if (tail.length) {\n // push later on event loop (otherwise mid-text insertion can be 1 char too far to the right)\n setTimeout(() => target.setSelectionRange(newCursor, newCursor), 1);\n } else {\n target.setSelectionRange(newCursor, newCursor);\n }\n } else {\n prevInput = target.value;\n }\n}\n\nexport function onComposition({ type, target, data }) {\n // navigator.platform is not 100% reliable for singling out all OS,\n // but for determining desktop \"Mac OS\" it is effective enough.\n const isMacOS = /Mac/.test(window.navigator && window.navigator.platform);\n // We don't want to ignore on Android:\n // https://github.com/WaniKani/WanaKana/issues/82\n // But MacOS IME auto-closes if we don't ignore:\n // https://github.com/WaniKani/WanaKana/issues/71\n // Other platform Japanese IMEs pass through happily\n if (isMacOS) {\n if (type === 'compositionupdate' && isJapanese(data)) {\n target.dataset.ignoreComposition = 'true';\n }\n\n if (type === 'compositionend') {\n target.dataset.ignoreComposition = 'false';\n }\n }\n}\n\nexport function trackListeners(id, inputHandler, compositionHandler) {\n LISTENERS = LISTENERS.concat({\n id,\n inputHandler,\n compositionHandler,\n });\n}\n\nexport function untrackListeners({ id: targetId }) {\n LISTENERS = LISTENERS.filter(({ id }) => id !== targetId);\n}\n\nexport function findListeners(el) {\n return el && LISTENERS.find(({ id }) => id === el.getAttribute('data-wanakana-id'));\n}\n\n// Handle non-terminal inserted input conversion:\n// | -> わ| -> わび| -> わ|び -> わs|び -> わsh|び -> わshi|び -> わし|び\n// or multiple ambiguous positioning (to select which \"s\" to work from)\n// こsこs|こsこ -> こsこso|こsこ -> こsこそ|こsこ\nexport function splitInput(text = '', cursor = 0, triggers = []) {\n let head;\n let toConvert;\n let tail;\n\n if (cursor === 0 && triggers.includes(text[0])) {\n [head, toConvert, tail] = workFromStart(text, triggers);\n } else if (cursor > 0) {\n [head, toConvert, tail] = workBackwards(text, cursor);\n } else {\n [head, toConvert] = takeWhileAndSlice(text, (char) => !triggers.includes(char));\n [toConvert, tail] = takeWhileAndSlice(toConvert, (char) => !isJapanese(char));\n }\n\n return [head, toConvert, tail];\n}\n\nfunction workFromStart(text, catalystChars) {\n return [\n '',\n ...takeWhileAndSlice(\n text,\n (char) => catalystChars.includes(char) || !isJapanese(char, /[0-9]/)\n ),\n ];\n}\n\nfunction workBackwards(text = '', startIndex = 0) {\n const [toConvert, head] = takeWhileAndSlice(\n [...text.slice(0, startIndex)].reverse(),\n (char) => !isJapanese(char)\n );\n return [\n head.reverse().join(''),\n toConvert\n .split('')\n .reverse()\n .join(''),\n text.slice(startIndex),\n ];\n}\n\nfunction takeWhileAndSlice(source = {}, predicate = (x) => !!x) {\n const result = [];\n const { length } = source;\n let i = 0;\n while (i < length && predicate(source[i], i)) {\n result.push(source[i]);\n i += 1;\n }\n return [result.join(''), source.slice(i)];\n}\n","/* eslint-disable no-console */\nconst onInput = ({ target: { value, selectionStart, selectionEnd } }) =>\n console.log('input:', { value, selectionStart, selectionEnd });\nconst onCompositionStart = () => console.log('compositionstart');\nconst onCompositionUpdate = ({ target: { value, selectionStart, selectionEnd }, data }) =>\n console.log('compositionupdate', {\n data,\n value,\n selectionStart,\n selectionEnd,\n });\nconst onCompositionEnd = () => console.log('compositionend');\n\nconst events = {\n input: onInput,\n compositionstart: onCompositionStart,\n compositionupdate: onCompositionUpdate,\n compositionend: onCompositionEnd,\n};\n\nexport const addDebugListeners = (input) => {\n Object.entries(events).forEach(([event, handler]) => input.addEventListener(event, handler));\n};\n\nexport const removeDebugListeners = (input) => {\n Object.entries(events).forEach(([event, handler]) => input.removeEventListener(event, handler));\n};\n","import { makeOnInput, onComposition, trackListeners } from './utils/dom';\nimport { addDebugListeners } from './utils/logInputEvents';\n\nconst ELEMENTS = ['TEXTAREA', 'INPUT'];\n\nlet idCounter = 0;\nconst newId = () => {\n idCounter += 1;\n return `${Date.now()}${idCounter}`;\n};\n\n/**\n * Binds eventListener for 'input' events to an input field to automagically replace values with kana\n * Can pass `{ IMEMode: 'toHiragana' || 'toKatakana' }` to enforce kana conversion type\n * @param {HTMLElement} element textarea, input[type=\"text\"] etc\n * @param {DefaultOptions} [options=defaultOptions] defaults to { IMEMode: true } using `toKana`\n * @example\n * bind(document.querySelector('#myInput'));\n */\nfunction bind(element = {}, options = {}, debug = false) {\n if (!ELEMENTS.includes(element.nodeName)) {\n throw new Error(\n `Element provided to Wanakana bind() was not a valid input or textarea element.\\n Received: (${JSON.stringify(\n element\n )})`\n );\n }\n const onInput = makeOnInput(options);\n const id = newId();\n element.setAttribute('data-wanakana-id', id);\n element.setAttribute('lang', 'ja');\n element.setAttribute('autoCapitalize', 'none');\n element.setAttribute('autoCorrect', 'off');\n element.setAttribute('autoComplete', 'off');\n element.setAttribute('spellCheck', 'false');\n element.addEventListener('input', onInput);\n element.addEventListener('compositionupdate', onComposition);\n element.addEventListener('compositionend', onComposition);\n trackListeners(id, onInput, onComposition);\n if (debug === true) {\n addDebugListeners(element);\n }\n}\n\nexport default bind;\n","import isEmpty from './isEmpty';\nimport isCharInRange from './isCharInRange';\nimport { ROMAJI_RANGES } from '../constants';\n\n/**\n * Tests a character. Returns true if the character is [Romaji](https://en.wikipedia.org/wiki/Romaji) (allowing [Hepburn romanisation](https://en.wikipedia.org/wiki/Hepburn_romanization))\n * @param {String} char character string to test\n * @return {Boolean}\n */\nfunction isCharRomaji(char = '') {\n if (isEmpty(char)) return false;\n return ROMAJI_RANGES.some(([start, end]) => isCharInRange(char, start, end));\n}\n\nexport default isCharRomaji;\n","import typeOf from './utils/typeOf';\nimport isEmpty from './utils/isEmpty';\nimport isCharRomaji from './utils/isCharRomaji';\n\n/**\n * Test if `input` is [Romaji](https://en.wikipedia.org/wiki/Romaji) (allowing [Hepburn romanisation](https://en.wikipedia.org/wiki/Hepburn_romanization))\n * @param {String} [input=''] text\n * @param {Regexp} [allowed] additional test allowed to pass for each char\n * @return {Boolean} true if [Romaji](https://en.wikipedia.org/wiki/Romaji)\n * @example\n * isRomaji('Tōkyō and Ōsaka')\n * // => true\n * isRomaji('12a*b&c-d')\n * // => true\n * isRomaji('あアA')\n * // => false\n * isRomaji('お願い')\n * // => false\n * isRomaji('a!b&cーd') // Zenkaku punctuation fails\n * // => false\n * isRomaji('a!b&cーd', /[!ー]/)\n * // => true\n */\nfunction isRomaji(input = '', allowed) {\n const augmented = typeOf(allowed) === 'regexp';\n return isEmpty(input)\n ? false\n : [...input].every((char) => {\n const isRoma = isCharRomaji(char);\n return !augmented ? isRoma : isRoma || allowed.test(char);\n });\n}\n\nexport default isRomaji;\n","import {\n KATAKANA_START,\n KATAKANA_END,\n} from '../constants';\n\nimport isCharInRange from './isCharInRange';\n\n/**\n * Tests a character. Returns true if the character is [Katakana](https://en.wikipedia.org/wiki/Katakana).\n * @param {String} char character string to test\n * @return {Boolean}\n */\nfunction isCharKatakana(char = '') {\n return isCharInRange(char, KATAKANA_START, KATAKANA_END);\n}\n\nexport default isCharKatakana;\n","import isEmpty from './isEmpty';\nimport isCharHiragana from './isCharHiragana';\nimport isCharKatakana from './isCharKatakana';\n\n/**\n * Tests a character. Returns true if the character is [Hiragana](https://en.wikipedia.org/wiki/Hiragana) or [Katakana](https://en.wikipedia.org/wiki/Katakana).\n * @param {String} char character string to test\n * @return {Boolean}\n */\nfunction isCharKana(char = '') {\n if (isEmpty(char)) return false;\n return isCharHiragana(char) || isCharKatakana(char);\n}\n\nexport default isCharKana;\n","import isEmpty from './utils/isEmpty';\nimport isCharKana from './utils/isCharKana';\n\n/**\n * Test if `input` is [Kana](https://en.wikipedia.org/wiki/Kana) ([Katakana](https://en.wikipedia.org/wiki/Katakana) and/or [Hiragana](https://en.wikipedia.org/wiki/Hiragana))\n * @param {String} [input=''] text\n * @return {Boolean} true if all [Kana](https://en.wikipedia.org/wiki/Kana)\n * @example\n * isKana('あ')\n * // => true\n * isKana('ア')\n * // => true\n * isKana('あーア')\n * // => true\n * isKana('A')\n * // => false\n * isKana('あAア')\n * // => false\n */\nfunction isKana(input = '') {\n if (isEmpty(input)) return false;\n return [...input].every(isCharKana);\n}\n\nexport default isKana;\n","import isEmpty from './utils/isEmpty';\nimport isCharHiragana from './utils/isCharHiragana';\n\n/**\n * Test if `input` is [Hiragana](https://en.wikipedia.org/wiki/Hiragana)\n * @param {String} [input=''] text\n * @return {Boolean} true if all [Hiragana](https://en.wikipedia.org/wiki/Hiragana)\n * @example\n * isHiragana('げーむ')\n * // => true\n * isHiragana('A')\n * // => false\n * isHiragana('あア')\n * // => false\n */\nfunction isHiragana(input = '') {\n if (isEmpty(input)) return false;\n return [...input].every(isCharHiragana);\n}\n\nexport default isHiragana;\n","import isEmpty from './utils/isEmpty';\nimport isCharKatakana from './utils/isCharKatakana';\n\n/**\n * Test if `input` is [Katakana](https://en.wikipedia.org/wiki/Katakana)\n * @param {String} [input=''] text\n * @return {Boolean} true if all [Katakana](https://en.wikipedia.org/wiki/Katakana)\n * @example\n * isKatakana('ゲーム')\n * // => true\n * isKatakana('あ')\n * // => false\n * isKatakana('A')\n * // => false\n * isKatakana('あア')\n * // => false\n */\nfunction isKatakana(input = '') {\n if (isEmpty(input)) return false;\n return [...input].every(isCharKatakana);\n}\n\nexport default isKatakana;\n","import {\n KANJI_START,\n KANJI_END,\n} from '../constants';\n\nimport isCharInRange from './isCharInRange';\n/**\n * Tests a character. Returns true if the character is a CJK ideograph (kanji).\n * @param {String} char character string to test\n * @return {Boolean}\n */\nfunction isCharKanji(char = '') {\n return isCharInRange(char, KANJI_START, KANJI_END);\n}\n\nexport default isCharKanji;\n","import isEmpty from './utils/isEmpty';\nimport isCharKanji from './utils/isCharKanji';\n\n/**\n * Tests if `input` is [Kanji](https://en.wikipedia.org/wiki/Kanji) ([Japanese CJK ideographs](https://en.wikipedia.org/wiki/CJK_Unified_Ideographs))\n * @param {String} [input=''] text\n * @return {Boolean} true if all [Kanji](https://en.wikipedia.org/wiki/Kanji)\n * @example\n * isKanji('刀')\n * // => true\n * isKanji('切腹')\n * // => true\n * isKanji('勢い')\n * // => false\n * isKanji('あAア')\n * // => false\n * isKanji('🐸')\n * // => false\n */\nfunction isKanji(input = '') {\n if (isEmpty(input)) return false;\n return [...input].every(isCharKanji);\n}\n\nexport default isKanji;\n","import isKanji from './isKanji';\nimport isHiragana from './isHiragana';\nimport isKatakana from './isKatakana';\nimport isRomaji from './isRomaji';\n\n/**\n * Test if `input` contains a mix of [Romaji](https://en.wikipedia.org/wiki/Romaji) *and* [Kana](https://en.wikipedia.org/wiki/Kana), defaults to pass through [Kanji](https://en.wikipedia.org/wiki/Kanji)\n * @param {String} input text\n * @param {Object} [options={ passKanji: true }] optional config to pass through kanji\n * @return {Boolean} true if mixed\n * @example\n * isMixed('Abあア'))\n * // => true\n * isMixed('お腹A')) // ignores kanji by default\n * // => true\n * isMixed('お腹A', { passKanji: false }))\n * // => false\n * isMixed('ab'))\n * // => false\n * isMixed('あア'))\n * // => false\n */\nfunction isMixed(input = '', options = { passKanji: true }) {\n const chars = [...input];\n let hasKanji = false;\n if (!options.passKanji) {\n hasKanji = chars.some(isKanji);\n }\n return (chars.some(isHiragana) || chars.some(isKatakana)) && chars.some(isRomaji) && !hasKanji;\n}\n\nexport default isMixed;\n","import { KATAKANA_START, HIRAGANA_START } from '../constants';\n\nimport isCharLongDash from './isCharLongDash';\nimport isCharSlashDot from './isCharSlashDot';\nimport isCharKatakana from './isCharKatakana';\nconst isCharInitialLongDash = (char, index) => isCharLongDash(char) && index < 1;\nconst isCharInnerLongDash = (char, index) => isCharLongDash(char) && index > 0;\nconst isKanaAsSymbol = (char) => ['ヶ', 'ヵ'].includes(char);\nconst LONG_VOWELS = {\n a: 'あ',\n i: 'い',\n u: 'う',\n e: 'え',\n o: 'う',\n};\n\n// inject toRomaji to avoid circular dependency between toRomaji <-> katakanaToHiragana\nfunction katakanaToHiragana(input = '', toRomaji, isDestinationRomaji) {\n let previousKana = '';\n\n return input\n .split('')\n .reduce((hira, char, index) => {\n // Short circuit to avoid incorrect codeshift for 'ー' and '・'\n if (isCharSlashDot(char) || isCharInitialLongDash(char, index) || isKanaAsSymbol(char)) {\n return hira.concat(char);\n // Transform long vowels: 'オー' to 'おう'\n } else if (previousKana && isCharInnerLongDash(char, index)) {\n // Transform previousKana back to romaji, and slice off the vowel\n const romaji = toRomaji(previousKana).slice(-1);\n // However, ensure 'オー' => 'おお' => 'oo' if this is a transform on the way to romaji\n if (isCharKatakana(input[index - 1]) && romaji === 'o' && isDestinationRomaji) {\n return hira.concat('お');\n }\n return hira.concat(LONG_VOWELS[romaji]);\n } else if (!isCharLongDash(char) && isCharKatakana(char)) {\n // Shift charcode.\n const code = char.charCodeAt(0) + (HIRAGANA_START - KATAKANA_START);\n const hiraChar = String.fromCharCode(code);\n previousKana = hiraChar;\n return hira.concat(hiraChar);\n }\n // Pass non katakana chars through\n previousKana = '';\n return hira.concat(char);\n }, [])\n .join('');\n}\n\nexport default katakanaToHiragana;\n","import { transform, getSubTreeOf } from './kanaMapping';\nimport { ROMANIZATIONS } from '../constants';\n\nlet kanaToHepburnMap = null;\n\n/* eslint-disable */\n// prettier-ignore\nconst BASIC_ROMAJI = {\n あ:'a', い:'i', う:'u', え:'e', お:'o',\n か:'ka', き:'ki', く:'ku', け:'ke', こ:'ko',\n さ:'sa', し:'shi', す:'su', せ:'se', そ:'so',\n た:'ta', ち:'chi', つ:'tsu', て:'te', と:'to',\n な:'na', に:'ni', ぬ:'nu', ね:'ne', の:'no',\n は:'ha', ひ:'hi', ふ:'fu', へ:'he', ほ:'ho',\n ま:'ma', み:'mi', む:'mu', め:'me', も:'mo',\n ら:'ra', り:'ri', る:'ru', れ:'re', ろ:'ro',\n や:'ya', ゆ:'yu', よ:'yo',\n わ:'wa', ゐ:'wi', ゑ:'we', を:'wo',\n ん: 'n',\n が:'ga', ぎ:'gi', ぐ:'gu', げ:'ge', ご:'go',\n ざ:'za', じ:'ji', ず:'zu', ぜ:'ze', ぞ:'zo',\n だ:'da', ぢ:'ji', づ:'zu', で:'de', ど:'do',\n ば:'ba', び:'bi', ぶ:'bu', べ:'be', ぼ:'bo',\n ぱ:'pa', ぴ:'pi', ぷ:'pu', ぺ:'pe', ぽ:'po',\n ゔぁ:'va', ゔぃ:'vi', ゔ:'vu', ゔぇ:'ve', ゔぉ:'vo',\n};\n/* eslint-enable */\n\nconst SPECIAL_SYMBOLS = {\n '。': '.',\n '、': ',',\n ':': ':',\n '・': '/',\n '!': '!',\n '?': '?',\n '〜': '~',\n 'ー': '-',\n '「': '‘',\n '」': '’',\n '『': '“',\n '』': '”',\n '[': '[',\n ']': ']',\n '(': '(',\n ')': ')',\n '{': '{',\n '}': '}',\n ' ': ' ',\n};\n\n// んい -> n'i\nconst AMBIGUOUS_VOWELS = ['あ', 'い', 'う', 'え', 'お', 'や', 'ゆ', 'よ'];\nconst SMALL_Y = { ゃ: 'ya', ゅ: 'yu', ょ: 'yo' };\nconst SMALL_Y_EXTRA = { ぃ: 'yi', ぇ: 'ye' };\nconst SMALL_AIUEO = {\n ぁ: 'a',\n ぃ: 'i',\n ぅ: 'u',\n ぇ: 'e',\n ぉ: 'o',\n};\nconst YOON_KANA = ['き', 'に', 'ひ', 'み', 'り', 'ぎ', 'び', 'ぴ', 'ゔ', 'く', 'ふ'];\nconst YOON_EXCEPTIONS = {\n し: 'sh',\n ち: 'ch',\n じ: 'j',\n ぢ: 'j',\n};\nconst SMALL_KANA = {\n っ: '',\n ゃ: 'ya',\n ゅ: 'yu',\n ょ: 'yo',\n ぁ: 'a',\n ぃ: 'i',\n ぅ: 'u',\n ぇ: 'e',\n ぉ: 'o',\n};\n\n// going with the intuitive (yet incorrect) solution where っや -> yya and っぃ -> ii\n// in other words, just assume the sokuon could have been applied to anything\nconst SOKUON_WHITELIST = {\n b: 'b',\n c: 't',\n d: 'd',\n f: 'f',\n g: 'g',\n h: 'h',\n j: 'j',\n k: 'k',\n m: 'm',\n p: 'p',\n q: 'q',\n r: 'r',\n s: 's',\n t: 't',\n v: 'v',\n w: 'w',\n x: 'x',\n z: 'z',\n};\n\nfunction getKanaToHepburnTree() {\n if (kanaToHepburnMap == null) {\n kanaToHepburnMap = createKanaToHepburnMap();\n }\n return kanaToHepburnMap;\n}\n\nexport function getKanaToRomajiTree(fullOptions) {\n switch (fullOptions.romanization) {\n case ROMANIZATIONS.HEPBURN:\n return getKanaToHepburnTree(fullOptions);\n default:\n return {};\n }\n}\n\nfunction createKanaToHepburnMap() {\n const romajiTree = transform(BASIC_ROMAJI);\n\n const subtreeOf = (string) => getSubTreeOf(romajiTree, string);\n const setTrans = (string, transliteration) => {\n subtreeOf(string)[''] = transliteration;\n };\n\n Object.entries(SPECIAL_SYMBOLS).forEach(([jsymbol, symbol]) => {\n subtreeOf(jsymbol)[''] = symbol;\n });\n\n [...Object.entries(SMALL_Y), ...Object.entries(SMALL_AIUEO)].forEach(([roma, kana]) => {\n setTrans(roma, kana);\n });\n\n // きゃ -> kya\n YOON_KANA.forEach((kana) => {\n const firstRomajiChar = subtreeOf(kana)[''][0];\n Object.entries(SMALL_Y).forEach(([yKana, yRoma]) => {\n setTrans(kana + yKana, firstRomajiChar + yRoma);\n });\n // きぃ -> kyi\n Object.entries(SMALL_Y_EXTRA).forEach(([yKana, yRoma]) => {\n setTrans(kana + yKana, firstRomajiChar + yRoma);\n });\n });\n\n Object.entries(YOON_EXCEPTIONS).forEach(([kana, roma]) => {\n // じゃ -> ja\n Object.entries(SMALL_Y).forEach(([yKana, yRoma]) => {\n setTrans(kana + yKana, roma + yRoma[1]);\n });\n // じぃ -> jyi, じぇ -> je\n setTrans(`${kana}ぃ`, `${roma}yi`);\n setTrans(`${kana}ぇ`, `${roma}e`);\n });\n\n romajiTree['っ'] = resolveTsu(romajiTree);\n\n Object.entries(SMALL_KANA).forEach(([kana, roma]) => {\n setTrans(kana, roma);\n });\n\n AMBIGUOUS_VOWELS.forEach((kana) => {\n setTrans(`ん${kana}`, `n'${subtreeOf(kana)['']}`);\n });\n\n // NOTE: could be re-enabled with an option?\n // // んば -> mbo\n // const LABIAL = [\n // 'ば', 'び', 'ぶ', 'べ', 'ぼ',\n // 'ぱ', 'ぴ', 'ぷ', 'ぺ', 'ぽ',\n // 'ま', 'み', 'む', 'め', 'も',\n // ];\n // LABIAL.forEach((kana) => {\n // setTrans(`ん${kana}`, `m${subtreeOf(kana)['']}`);\n // });\n\n return Object.freeze(JSON.parse(JSON.stringify(romajiTree)));\n}\n\nfunction resolveTsu(tree) {\n return Object.entries(tree).reduce((tsuTree, [key, value]) => {\n if (!key) {\n // we have reached the bottom of this branch\n const consonant = value.charAt(0);\n tsuTree[key] = Object.keys(SOKUON_WHITELIST).includes(consonant)\n ? SOKUON_WHITELIST[consonant] + value\n : value;\n } else {\n // more subtrees\n tsuTree[key] = resolveTsu(value);\n }\n return tsuTree;\n }, {});\n}\n","import mergeWithDefaultOptions from './utils/mergeWithDefaultOptions';\nimport katakanaToHiragana from './utils/katakanaToHiragana';\nimport isKatakana from './isKatakana';\nimport { getKanaToRomajiTree } from './utils/kanaToRomajiMap';\nimport { applyMapping, mergeCustomMapping } from './utils/kanaMapping';\n\n/**\n * Convert kana to romaji\n * @param {String} kana text input\n * @param {DefaultOptions} [options=defaultOptions]\n * @return {String} converted text\n * @example\n * toRomaji('ひらがな カタカナ')\n * // => 'hiragana katakana'\n * toRomaji('げーむ ゲーム')\n * // => 'ge-mu geemu'\n * toRomaji('ひらがな カタカナ', { upcaseKatakana: true })\n * // => 'hiragana KATAKANA'\n * toRomaji('つじぎり', { customRomajiMapping: { じ: 'zi', つ: 'tu', り: 'li' } });\n * // => 'tuzigili'\n */\nexport function toRomaji(input = '', options = {}) {\n const mergedOptions = mergeWithDefaultOptions(options);\n // just throw away the substring index information and just concatenate all the kana\n return splitIntoRomaji(input, mergedOptions)\n .map((romajiToken) => {\n const [start, end, romaji] = romajiToken;\n const makeUpperCase = options.upcaseKatakana && isKatakana(input.slice(start, end));\n return makeUpperCase ? romaji.toUpperCase() : romaji;\n })\n .join('');\n}\n\nlet customMapping = null;\nfunction splitIntoRomaji(input, options) {\n let map = getKanaToRomajiTree(options);\n\n if (options.customRomajiMapping) {\n if (customMapping == null) {\n customMapping = mergeCustomMapping(map, options.customRomajiMapping);\n }\n map = customMapping;\n }\n\n return applyMapping(katakanaToHiragana(input, toRomaji, true), map, !options.IMEMode);\n}\n\nexport default toRomaji;\n","import isEmpty from './isEmpty';\nimport { EN_PUNCTUATION_RANGES } from '../constants';\nimport isCharInRange from './isCharInRange';\n\n/**\n * Tests a character. Returns true if the character is considered English punctuation.\n * @param {String} char character string to test\n * @return {Boolean}\n */\nfunction isCharEnglishPunctuation(char = '') {\n if (isEmpty(char)) return false;\n return EN_PUNCTUATION_RANGES.some(([start, end]) => isCharInRange(char, start, end));\n}\n\nexport default isCharEnglishPunctuation;\n","import isEmpty from './isEmpty';\nimport { JA_PUNCTUATION_RANGES } from '../constants';\nimport isCharInRange from './isCharInRange';\n\n/**\n * Tests a character. Returns true if the character is considered English punctuation.\n * @param {String} char character string to test\n * @return {Boolean}\n */\nfunction isCharJapanesePunctuation(char = '') {\n if (isEmpty(char)) return false;\n return JA_PUNCTUATION_RANGES.some(([start, end]) => isCharInRange(char, start, end));\n}\n\nexport default isCharJapanesePunctuation;\n","import isEmpty from './utils/isEmpty';\nimport isCharEnglishPunctuation from './utils/isCharEnglishPunctuation';\nimport isCharJapanesePunctuation from './utils/isCharJapanesePunctuation';\nimport isCharRomaji from './utils/isCharRomaji';\nimport isCharKanji from './utils/isCharKanji';\nimport isCharHiragana from './utils/isCharHiragana';\nimport isCharKatakana from './utils/isCharKatakana';\nimport isCharJapanese from './utils/isCharJapanese';\n\nconst isCharEnSpace = (x) => x === ' ';\nconst isCharJaSpace = (x) => x === ' ';\nconst isCharJaNum = (x) => /[0-9]/.test(x);\nconst isCharEnNum = (x) => /[0-9]/.test(x);\n\nexport const TOKEN_TYPES = {\n EN: 'en',\n JA: 'ja',\n EN_NUM: 'englishNumeral',\n JA_NUM: 'japaneseNumeral',\n EN_PUNC: 'englishPunctuation',\n JA_PUNC: 'japanesePunctuation',\n KANJI: 'kanji',\n HIRAGANA: 'hiragana',\n KATAKANA: 'katakana',\n SPACE: 'space',\n OTHER: 'other',\n};\n\n// prettier-ignore\nexport function getType(input, compact = false) {\n const {\n EN, JA, EN_NUM, JA_NUM, EN_PUNC, JA_PUNC, KANJI, HIRAGANA, KATAKANA, SPACE, OTHER,\n } = TOKEN_TYPES;\n\n if (compact) {\n switch (true) {\n case isCharJaNum(input): return OTHER;\n case isCharEnNum(input): return OTHER;\n case isCharEnSpace(input): return EN;\n case isCharEnglishPunctuation(input): return OTHER;\n case isCharJaSpace(input): return JA;\n case isCharJapanesePunctuation(input): return OTHER;\n case isCharJapanese(input): return JA;\n case isCharRomaji(input): return EN;\n default: return OTHER;\n }\n } else {\n switch (true) {\n case isCharJaSpace(input): return SPACE;\n case isCharEnSpace(input): return SPACE;\n case isCharJaNum(input): return JA_NUM;\n case isCharEnNum(input): return EN_NUM;\n case isCharEnglishPunctuation(input): return EN_PUNC;\n case isCharJapanesePunctuation(input): return JA_PUNC;\n case isCharKanji(input): return KANJI;\n case isCharHiragana(input): return HIRAGANA;\n case isCharKatakana(input): return KATAKANA;\n case isCharJapanese(input): return JA;\n case isCharRomaji(input): return EN;\n default: return OTHER;\n }\n }\n}\n\n/**\n * Splits input into array of strings separated by opinionated token types\n * `'en', 'ja', 'englishNumeral', 'japaneseNumeral','englishPunctuation', 'japanesePunctuation','kanji', 'hiragana', 'katakana', 'space', 'other'`.\n * If `{ compact: true }` then many same-language tokens are combined (spaces + text, kanji + kana, numeral + punctuation).\n * If `{ detailed: true }` then return array will contain `{ type, value }` instead of `'value'`\n * @param {String} input text\n * @param {Object} [options={ compact: false, detailed: false}] options to modify output style\n * @return {String|Object[]} text split into tokens containing values, or detailed object\n * @example\n * tokenize('ふふフフ')\n * // ['ふふ', 'フフ']\n *\n * tokenize('感じ')\n * // ['感', 'じ']\n *\n * tokenize('truly 私は悲しい')\n * // ['truly', ' ', '私', 'は', '悲', 'しい']\n *\n * tokenize('truly 私は悲しい', { compact: true })\n * // ['truly ', '私は悲しい']\n *\n * tokenize('5romaji here...!?漢字ひらがな4カタ カナ「SHIO」。!')\n * // [ '5', 'romaji', ' ', 'here', '...!?', '漢字', 'ひらがな', 'カタ', ' ', 'カナ', '4', '「', 'SHIO', '」。!']\n *\n * tokenize('5romaji here...!?漢字ひらがな4カタ カナ「SHIO」。!', { compact: true })\n * // [ '5', 'romaji here', '...!?', '漢字ひらがなカタ カナ', '4「', 'SHIO', '」。!']\n *\n * tokenize('5romaji here...!?漢字ひらがなカタ カナ4「SHIO」。! لنذهب', { detailed: true })\n * // [\n * { type: 'englishNumeral', value: '5' },\n * { type: 'en', value: 'romaji' },\n * { type: 'space', value: ' ' },\n * { type: 'en', value: 'here' },\n * { type: 'englishPunctuation', value: '...!?' },\n * { type: 'kanji', value: '漢字' },\n * { type: 'hiragana', value: 'ひらがな' },\n * { type: 'katakana', value: 'カタ' },\n * { type: 'space', value: ' ' },\n * { type: 'katakana', value: 'カナ' },\n * { type: 'japaneseNumeral', value: '4' },\n * { type: 'japanesePunctuation', value: '「' },\n * { type: 'ja', value: 'SHIO' },\n * { type: 'japanesePunctuation', value: '」。!' },\n * { type: 'space', value: ' ' },\n * { type: 'other', value: 'لنذهب' },\n * ]\n *\n * tokenize('5romaji here...!?漢字ひらがなカタ カナ4「SHIO」。! لنذهب', { compact: true, detailed: true})\n * // [\n * { type: 'other', value: '5' },\n * { type: 'en', value: 'romaji here' },\n * { type: 'other', value: '...!?' },\n * { type: 'ja', value: '漢字ひらがなカタ カナ' },\n * { type: 'other', value: '4「' },\n * { type: 'ja', value: 'SHIO' },\n * { type: 'other', value: '」。!' },\n * { type: 'en', value: ' ' },\n * { type: 'other', value: 'لنذهب' },\n *]\n */\nfunction tokenize(input, { compact = false, detailed = false } = {}) {\n if (input == null || isEmpty(input)) {\n return [];\n }\n const chars = [...input];\n let initial = chars.shift();\n let prevType = getType(initial, compact);\n initial = detailed ? { type: prevType, value: initial } : initial;\n\n const result = chars.reduce(\n (tokens, char) => {\n const currType = getType(char, compact);\n const sameType = currType === prevType;\n prevType = currType;\n let newValue = char;\n\n if (sameType) {\n newValue = (detailed ? tokens.pop().value : tokens.pop()) + newValue;\n }\n\n return detailed\n ? tokens.concat({ type: currType, value: newValue })\n : tokens.concat(newValue);\n },\n [initial]\n );\n return result;\n}\n\nexport default tokenize;\n","import isJapanese from './isJapanese';\nimport isKana from './isKana';\nimport isKanji from './isKanji';\nimport tokenize from './tokenize';\n\nconst isLeadingWithoutInitialKana = (input, leading) => leading && !isKana(input[0]);\nconst isTrailingWithoutFinalKana = (input, leading) => !leading && !isKana(input[input.length - 1]);\nconst isInvalidMatcher = (input, matchKanji) =>\n (matchKanji && ![...matchKanji].some(isKanji)) || (!matchKanji && isKana(input));\n\n/**\n * Strips [Okurigana](https://en.wikipedia.org/wiki/Okurigana)\n * @param {String} input text\n * @param {Object} [options={ leading: false, matchKanji: '' }] optional config\n * @return {String} text with okurigana removed\n * @example\n * stripOkurigana('踏み込む')\n * // => '踏み込'\n * stripOkurigana('お祝い')\n * // => 'お祝'\n * stripOkurigana('お腹', { leading: true });\n * // => '腹'\n * stripOkurigana('ふみこむ', { matchKanji: '踏み込む' });\n * // => 'ふみこ'\n * stripOkurigana('おみまい', { matchKanji: 'お祝い', leading: true });\n * // => 'みまい'\n */\nfunction stripOkurigana(input = '', { leading = false, matchKanji = '' } = {}) {\n if (\n !isJapanese(input) ||\n isLeadingWithoutInitialKana(input, leading) ||\n isTrailingWithoutFinalKana(input, leading) ||\n isInvalidMatcher(input, matchKanji)\n ) {\n return input;\n }\n\n const chars = matchKanji || input;\n const okuriganaRegex = new RegExp(\n leading ? `^${tokenize(chars).shift()}` : `${tokenize(chars).pop()}$`\n );\n return input.replace(okuriganaRegex, '');\n}\n\nexport default stripOkurigana;\n","import { findListeners, untrackListeners } from './utils/dom';\nimport { removeDebugListeners } from './utils/logInputEvents';\n\n/**\n * Unbinds eventListener from input field\n * @param {HTMLElement} element textarea, input\n */\nexport function unbind(element, debug = false) {\n const listeners = findListeners(element);\n if (listeners == null) {\n throw new Error(\n `Element provided to Wanakana unbind() had no listener registered.\\n Received: ${JSON.stringify(\n element\n )}`\n );\n }\n const { inputHandler, compositionHandler } = listeners;\n element.removeAttribute('data-wanakana-id');\n element.removeAttribute('data-ignore-composition');\n element.removeEventListener('input', inputHandler);\n element.removeEventListener('compositionstart', compositionHandler);\n element.removeEventListener('compositionupdate', compositionHandler);\n element.removeEventListener('compositionend', compositionHandler);\n untrackListeners(listeners);\n if (debug === true) {\n removeDebugListeners(element);\n }\n}\n\nexport default unbind;\n","import mergeWithDefaultOptions from './utils/mergeWithDefaultOptions';\nimport katakanaToHiragana from './utils/katakanaToHiragana';\nimport isCharEnglishPunctuation from './utils/isCharEnglishPunctuation';\nimport isRomaji from './isRomaji';\nimport isMixed from './isMixed';\nimport toKana from './toKana';\nimport toRomaji from './toRomaji';\n\n/**\n * Convert input to [Hiragana](https://en.wikipedia.org/wiki/Hiragana)\n * @param {String} [input=''] text\n * @param {DefaultOptions} [options=defaultOptions]\n * @return {String} converted text\n * @example\n * toHiragana('toukyou, オオサカ')\n * // => 'とうきょう、 おおさか'\n * toHiragana('only カナ', { passRomaji: true })\n * // => 'only かな'\n * toHiragana('wi')\n * // => 'うぃ'\n * toHiragana('wi', { useObsoleteKana: true })\n * // => 'ゐ'\n */\nfunction toHiragana(input = '', options = {}) {\n const config = mergeWithDefaultOptions(options);\n if (config.passRomaji) {\n return katakanaToHiragana(input, toRomaji);\n }\n\n if (isMixed(input, { passKanji: true })) {\n const convertedKatakana = katakanaToHiragana(input, toRomaji);\n return toKana(convertedKatakana.toLowerCase(), config);\n }\n\n if (isRomaji(input) || isCharEnglishPunctuation(input)) {\n return toKana(input.toLowerCase(), config);\n }\n\n return katakanaToHiragana(input, toRomaji);\n}\n\nexport default toHiragana;\n","import mergeWithDefaultOptions from './utils/mergeWithDefaultOptions';\nimport hiraganaToKatakana from './utils/hiraganaToKatakana';\nimport isCharEnglishPunctuation from './utils/isCharEnglishPunctuation';\nimport toKana from './toKana';\nimport isRomaji from './isRomaji';\nimport isMixed from './isMixed';\n\n/**\n * Convert input to [Katakana](https://en.wikipedia.org/wiki/Katakana)\n * @param {String} [input=''] text\n * @param {DefaultOptions} [options=defaultOptions]\n * @return {String} converted text\n * @example\n * toKatakana('toukyou, おおさか')\n * // => 'トウキョウ、 オオサカ'\n * toKatakana('only かな', { passRomaji: true })\n * // => 'only カナ'\n * toKatakana('wi')\n * // => 'ウィ'\n * toKatakana('wi', { useObsoleteKana: true })\n * // => 'ヰ'\n */\nfunction toKatakana(input = '', options = {}) {\n const mergedOptions = mergeWithDefaultOptions(options);\n if (mergedOptions.passRomaji) {\n return hiraganaToKatakana(input);\n }\n\n if (isMixed(input) || isRomaji(input) || isCharEnglishPunctuation(input)) {\n const hiragana = toKana(input.toLowerCase(), mergedOptions);\n return hiraganaToKatakana(hiragana);\n }\n\n return hiraganaToKatakana(input);\n}\n\nexport default toKatakana;\n"],"names":["global","module","window","Math","self","Function","__g","core","version","__e","it","isObject","TypeError","exec","e","require$$0","Object","defineProperty","get","a","document","is","createElement","require$$1","require$$2","S","fn","val","toString","call","valueOf","dP","O","P","Attributes","anObject","toPrimitive","IE8_DOM_DEFINE","value","bitmap","enumerable","configurable","writable","object","key","f","createDesc","hasOwnProperty","id","px","random","concat","undefined","SRC","$toString","TPL","split","inspectSource","safe","isFunction","has","hide","join","String","prototype","this","that","length","aFunction","b","c","apply","arguments","$export","type","name","source","own","out","exp","IS_FORCED","F","IS_GLOBAL","G","IS_PROTO","IS_BIND","B","target","exports","expProto","ctx","redefine","U","W","R","Typed","TYPED","uid","VIEW","ABV","ArrayBuffer","DataView","CONSTR","i","TypedArrayConstructors","src","Constructor","forbiddenField","ceil","floor","isNaN","min","toInteger","number","toLength","RangeError","slice","propertyIsEnumerable","cof","IObject","defined","max","index","IS_INCLUDES","$this","el","fromIndex","toIObject","toAbsoluteIndex","store","shared","arrayIndexOf","IE_PROTO","names","result","push","hiddenKeys","getOwnPropertyNames","$keys","toObject","aLen","end","endPos","Symbol","USE_SYMBOL","def","TAG","tag","stat","gOPN","PROTOTYPE","WRONG_INDEX","$ArrayBuffer","$DataView","Infinity","BaseBuffer","abs","pow","log","LN2","$BUFFER","DESCRIPTORS","$LENGTH","$OFFSET","packIEEE754","mLen","nBytes","m","buffer","Array","eLen","eMax","eBias","rt","s","unpackIEEE754","nBits","NaN","unpackI32","bytes","packI8","packI16","packI32","packF64","packF32","addGetter","C","internal","view","isLittleEndian","intIndex","toIndex","start","pack","_b","reverse","set","conversion","$typed","fails","ArrayBufferProto","anInstance","keys","j","LIBRARY","constructor","$setInt8","setInt8","getInt8","redefineAll","byteOffset","setUint8","byteLength","arrayFill","bufferLength","offset","getUint8","getInt16","getUint16","getInt32","getUint32","getFloat32","getFloat64","setInt16","setUint16","setInt32","setUint32","setFloat32","setFloat64","setToStringTag","SPECIES","D","KEY","$isView","isView","$slice","len","first","final","speciesConstructor","viewS","viewT","ARG","T","tryGet","callee","ITERATOR","ArrayProto","Iterators","enumBugKeys","defineProperties","Properties","getKeys","documentElement","Empty","createDict","iframeDocument","iframe","style","display","appendChild","contentWindow","open","write","lt","close","create","dPs","ObjectProto","getPrototypeOf","getIteratorMethod","classof","isArray","arg","original","TYPE","$create","IS_MAP","IS_FILTER","IS_SOME","IS_EVERY","IS_FIND_INDEX","NO_HOLES","asc","callbackfn","res","UNSCOPABLES","done","IteratorPrototype","NAME","next","descriptor","BUGGY","returnThis","Base","DEFAULT","IS_SET","FORCED","$iterCreate","methods","getMethod","kind","proto","DEF_VALUES","VALUES_BUG","$native","$default","$entries","$anyNative","entries","values","iterated","_t","_i","_k","step","Arguments","SAFE_CLOSING","skipClosing","arr","iter","copyWithin","to","from","count","inc","gOPD","getOwnPropertyDescriptor","pIE","require$$3","require$$4","require$$5","require$$7","require$$8","propertyDesc","require$$9","require$$10","require$$11","require$$12","require$$13","require$$14","require$$15","require$$16","require$$17","require$$18","require$$19","require$$20","isArrayIter","require$$21","require$$22","require$$23","require$$24","getIterFn","require$$25","require$$26","wks","require$$27","createArrayMethod","require$$28","createArrayIncludes","require$$29","require$$30","ArrayIterators","require$$31","require$$32","$iterDetect","require$$33","setSpecies","require$$34","require$$35","arrayCopyWithin","require$$36","$DP","require$$37","$GOPD","require$$38","Uint8Array","require$$6","arrayForEach","arrayFilter","arraySome","arrayEvery","arrayFind","arrayFindIndex","arrayIncludes","arrayValues","arrayKeys","arrayEntries","arrayLastIndexOf","lastIndexOf","arrayReduce","reduce","arrayReduceRight","reduceRight","arrayJoin","arraySort","sort","arraySlice","arrayToString","arrayToLocaleString","toLocaleString","TYPED_CONSTRUCTOR","DEF_CONSTRUCTOR","ALL_CONSTRUCTORS","TYPED_ARRAY","$map","allocate","LITTLE_ENDIAN","Uint16Array","FORCED_SET","toOffset","BYTES","validate","speciesFromList","list","fromList","_d","$from","iterator","mapfn","mapping","iterFn","$of","TO_LOCALE_BUG","$toLocaleString","every","fill","filter","find","predicate","findIndex","forEach","indexOf","searchElement","includes","separator","map","middle","some","comparefn","subarray","begin","$begin","BYTES_PER_ELEMENT","$set","arrayLike","$iterators","isTAIndex","$getDesc","$setDesc","desc","$TypedArrayPrototype$","wrapper","CLAMPED","GETTER","SETTER","TypedArray","TAC","TypedArrayPrototype","addElement","data","v","o","getter","round","setter","$offset","$length","klass","$len","l","$nativeIterator","CORRECT_ITER_NAME","$iterator","of","init","ret","BREAK","RETURN","iterable","META","setDesc","isExtensible","FREEZE","preventExtensions","setMeta","w","meta","NEED","fastKey","getWeak","onFreeze","SIZE","getEntry","entry","_f","n","k","getConstructor","ADDER","_l","forOf","clear","r","p","delete","prev","setStrong","$iterDefine","check","setPrototypeOf","test","buggy","__proto__","common","IS_WEAK","fixMethod","instance","HASNT_CHAINING","THROWS_ON_PRIMITIVES","ACCEPT_ITERABLES","BUGGY_ZERO","$instance","inheritIfRequired","strong","add","getOwnPropertySymbols","$assign","assign","A","K","getSymbols","gOPS","isEnum","uncaughtFrozenStore","UncaughtFrozenStore","findUncaughtFrozen","splice","$has","ufstore","InternalMap","each","weak","tmp","$WeakMap","freeze","method","rApply","Reflect","fApply","thisArgument","argumentsList","L","args","un","factories","bind","partArgs","bound","construct","invoke","rConstruct","NEW_TARGET_BUG","ARGS_BUG","Target","newTarget","$args","propertyKey","attributes","deleteProperty","receiver","getProto","$isExtensible","ownKeys","$preventExtensions","V","existingDescriptor","ownDesc","setProto","defer","channel","port","process","setTask","setImmediate","clearTask","clearImmediate","MessageChannel","Dispatch","counter","queue","run","listener","event","nextTick","now","port2","port1","onmessage","postMessage","addEventListener","importScripts","cel","html","removeChild","setTimeout","macrotask","Observer","MutationObserver","WebKitMutationObserver","Promise","isNode","head","last","notify","flush","parent","domain","exit","enter","navigator","standalone","resolve","promise","then","toggle","node","createTextNode","observe","characterData","task","Internal","newGenericPromiseCapability","OwnPromiseCapability","Wrapper","reject","$$resolve","$$reject","x","promiseCapability","newPromiseCapability","microtask","$Promise","empty","newPromiseCapabilityModule","USE_NATIVE","FakePromise","PromiseRejectionEvent","isThenable","isReject","_n","chain","_c","_v","ok","_s","reaction","exited","handler","fail","_h","onHandleUnhandled","onUnhandled","console","unhandled","isUnhandled","perform","emit","onunhandledrejection","reason","error","_a","onrejectionhandled","$reject","_w","$resolve","executor","err","onFulfilled","onRejected","catch","capability","promiseResolve","all","remaining","$index","alreadyCalled","race","$Symbol","charAt","wksExt","symbols","windowNames","getWindowNames","gOPNExt","$JSON","JSON","_stringify","stringify","HIDDEN","TO_PRIMITIVE","SymbolRegistry","AllSymbols","OPSymbols","QObject","findChild","setSymbolDesc","$fails","_create","protoDesc","wrap","sym","isSymbol","$defineProperty","$defineProperties","enumKeys","$propertyIsEnumerable","E","$getOwnPropertyDescriptor","$getOwnPropertyNames","$getOwnPropertySymbols","IS_OP","es6Symbols","wellKnownSymbols","wksDefine","for","keyFor","useSetter","useSimple","replacer","$replacer","$freeze","$seal","$isFrozen","$isSealed","$getPrototypeOf","y","FProto","nameRE","match","raw","callSite","tpl","fromCharCode","$fromCodePoint","fromCodePoint","code","TO_STRING","pos","charCodeAt","$at","codePointAt","str","repeat","MATCH","isRegExp","searchString","re","$startsWith","startsWith","context","search","$endsWith","endsWith","endPosition","ignoreCase","multiline","unicode","sticky","flags","RegExp","SYMBOL","fns","strfn","rxfn","string","$match","regexp","REPLACE","$replace","searchValue","replaceValue","SPLIT","$split","_split","$push","NPCG","limit","separator2","lastIndex","lastLength","output","lastLastIndex","splitLimit","separatorCopy","replace","SEARCH","$search","createProperty","$find","forced","_isFinite","isFinite","isInteger","isSafeInteger","EPSILON","MIN_SAFE_INTEGER","MAX_SAFE_INTEGER","log1p","sqrt","$acosh","acosh","Number","MAX_VALUE","$asinh","asinh","$atanh","atanh","sign","cbrt","clz32","LOG2E","cosh","$expm1","expm1","EPSILON32","MAX32","MIN32","fround","$abs","$sign","hypot","value1","value2","div","sum","larg","$imul","imul","xn","yn","xl","yl","log10","LOG10E","log2","sinh","tanh","trunc","$includes","isEntries","$values","getOwnPropertyDescriptors","getDesc","maxLength","fillString","left","stringLength","fillStr","intMaxLength","fillLen","stringFiller","userAgent","padStart","$pad","padEnd","time","boundArgs","setInterval","$task","TO_STRING_TAG","ArrayValues","DOMIterables","CSSRuleList","CSSStyleDeclaration","CSSValueList","ClientRectList","DOMRectList","DOMStringList","DOMTokenList","DataTransferItemList","FileList","HTMLAllCollection","HTMLCollection","HTMLFormElement","HTMLSelectElement","MediaList","MimeTypeArray","NamedNodeMap","NodeList","PaintRequestList","Plugin","PluginArray","SVGLengthList","SVGNumberList","SVGPathSegList","SVGPointList","SVGStringList","SVGTransformList","SourceBufferList","StyleSheetList","TextTrackCueList","TextTrackList","TouchList","collections","explicit","Collection","Op","hasOwn","iteratorSymbol","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","runtime","regeneratorRuntime","GenStateSuspendedStart","GenStateSuspendedYield","GenStateExecuting","GenStateCompleted","ContinueSentinel","NativeIteratorPrototype","Gp","GeneratorFunctionPrototype","Generator","GeneratorFunction","displayName","isGeneratorFunction","genFun","ctor","mark","awrap","__await","defineIteratorMethods","AsyncIterator","async","innerFn","outerFn","tryLocsList","pop","Context","reset","skipTempReset","sent","_sent","delegate","tryEntries","resetTryEntry","stop","rootRecord","completion","rval","dispatchException","exception","handle","loc","caught","record","tryLoc","hasCatch","hasFinally","catchLoc","finallyLoc","Error","abrupt","finallyEntry","complete","afterLoc","finish","thrown","delegateYield","resultName","nextLoc","generator","_invoke","state","doneResult","delegateResult","maybeInvokeDelegate","tryCatch","makeInvokeMethod","obj","unwrapped","previousPromise","callInvokeWithMethodAndArg","return","info","pushTryEntry","locs","iteratorMethod","typeOf","toLowerCase","isEmpty","input","isCharInRange","char","TO_KANA_METHODS","ROMANIZATIONS","DEFAULT_OPTIONS","HEPBURN","LATIN_UPPERCASE_START","LATIN_UPPERCASE_END","HIRAGANA_START","HIRAGANA_END","KATAKANA_START","KATAKANA_END","KANJI_START","KANJI_END","PROLONGED_SOUND_MARK","KANA_SLASH_DOT","KANA_PUNCTUATION","JA_PUNCTUATION_RANGES","JAPANESE_RANGES","ROMAJI_RANGES","EN_PUNCTUATION_RANGES","isCharJapanese","isJapanese","allowed","augmented","isJa","mergeWithDefaultOptions","applyMapping","convertEnding","root","newChunk","currentCursor","firstChar","parse","tree","lastCursor","subtree","nextChar","nextSubtree","transform","endOfBranch","getSubTreeOf","correctSubTree","createCustomMapping","customMap","customTree","kana","subTree","transformMap","mapSubtree","customSubtree","newSubtree","mergeCustomMapping","customMapping","BASIC_KUNREI","u","SPECIAL_SYMBOLS","CONSONANTS","SMALL_Y","ya","yi","yu","ye","yo","SMALL_VOWELS","ALIASES","SMALL_LETTERS","SPECIAL_CASES","AIUEO_CONSTRUCTIONS","createRomajiToKanaMap","kanaTree","subtreeOf","consonant","yKana","jsymbol","aiueoKana","nChar","alternative","allExceptLast","kunreiRoma","chars","xSubtree","alt","roma","altRoma","prefix","addTsu","tsuTree","romajiToKanaMap","USE_OBSOLETE_KANA_MAP","wi","we","isCharUpperCase","isCharLongDash","isCharSlashDot","isCharHiragana","hiraganaToKatakana","kata","toKana","options","config","IMEMode","splitIntoConvertedKana","kanaToken","enforceHiragana","HIRAGANA","enforceKatakana","KATAKANA","mapCopy","IME_MODE_MAP","useObsoleteKana","customKanaMapping","LISTENERS","makeOnInput","mergedConfig","preConfiguredMap","triggers","toUpperCase","dataset","ignoreComposition","prevInput","text","cursor","toConvert","tail","catalystChars","takeWhileAndSlice","workFromStart","startIndex","workBackwards","splitInput","selectionEnd","textToConvert","convertedText","newCursor","newValue","setSelectionRange","onComposition","platform","events","selectionStart","addDebugListeners","removeDebugListeners","removeEventListener","ELEMENTS","idCounter","newId","Date","isCharRomaji","isRomaji","isRoma","isCharKatakana","isCharKana","isKana","isHiragana","isKatakana","isCharKanji","isKanji","isMixed","passKanji","hasKanji","isCharInitialLongDash","isCharInnerLongDash","isKanaAsSymbol","LONG_VOWELS","katakanaToHiragana","toRomaji","isDestinationRomaji","previousKana","hira","romaji","hiraChar","kanaToHepburnMap","BASIC_ROMAJI","い","う","え","お","き","く","け","こ","し","す","せ","そ","ち","つ","て","と","に","ぬ","ね","の","ひ","ふ","へ","ほ","み","む","め","も","り","る","れ","ろ","ゆ","よ","ゐ","ゑ","を","ぎ","ぐ","げ","ご","じ","ず","ぜ","ぞ","ぢ","づ","で","ど","び","ぶ","べ","ぼ","ぴ","ぷ","ぺ","ぽ","ゔぃ","ゔ","ゔぇ","ゔぉ","AMBIGUOUS_VOWELS","ゃ","ゅ","ょ","SMALL_Y_EXTRA","ぃ","ぇ","SMALL_AIUEO","YOON_KANA","YOON_EXCEPTIONS","SMALL_KANA","SOKUON_WHITELIST","getKanaToHepburnTree","romajiTree","setTrans","transliteration","symbol","firstRomajiChar","resolveTsu","mergedOptions","fullOptions","romanization","getKanaToRomajiTree","customRomajiMapping","splitIntoRomaji","romajiToken","upcaseKatakana","isCharEnglishPunctuation","isCharJapanesePunctuation","isCharEnSpace","isCharJaSpace","isCharJaNum","isCharEnNum","TOKEN_TYPES","getType","EN","JA","EN_NUM","JA_NUM","EN_PUNC","JA_PUNC","KANJI","SPACE","OTHER","tokenize","compact","detailed","initial","shift","prevType","tokens","currType","sameType","isLeadingWithoutInitialKana","leading","isTrailingWithoutFinalKana","isInvalidMatcher","matchKanji","element","debug","nodeName","onInput","setAttribute","inputHandler","compositionHandler","listeners","getAttribute","targetId","removeAttribute","passRomaji","oku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git a/tmpl/kanji.html b/tmpl/kanji.html
index c3064526..bbc0fc9d 100644
--- a/tmpl/kanji.html
+++ b/tmpl/kanji.html
@@ -20,9 +20,6 @@ No data found
<a href="#" class="action-view-note pending disabled"><img src="/mixed/img/view-note.svg" title="View added note (Alt + V)" alt></a>
<a href="#" class="action-add-note pending disabled" data-mode="kanji"><img src="/mixed/img/add-term-kanji.svg" title="Add Kanji (Alt + K)" alt></a>
{{/if}}
- {{#if source}}
- <a href="#" class="source-term"><img src="/mixed/img/source-term.svg" title="Source term (Alt + B)" alt></a>
- {{/if}}
<img src="/mixed/img/entry-current.svg" class="current" title="Current entry (Alt + Up/Down/Home/End/PgUp/PgDn)" alt>
</div>
@@ -91,9 +88,13 @@ No data found
{{/inline}}
{{#if definitions}}
+<div class="term-navigation">
+ <a href="#" {{#if source}}class="source-term"{{else}}class="source-term term-button-fade"{{/if}}><img src="/mixed/img/source-term.svg" title="Source term (Alt + B)" alt></a>
+ <a href="#" {{#if next}}class="next-term"{{else}}class="next-term term-button-fade"{{/if}}><img src="/mixed/img/source-term.svg" style="transform: scaleX(-1);" title="Next term (Alt + F)" alt></a>
+</div>
{{#each definitions}}
{{#unless @first}}<hr>{{/unless}}
-{{> kanji debug=../debug addable=../addable source=../source root=../root}}
+{{> kanji debug=../debug addable=../addable root=../root}}
{{/each}}
{{else}}
<p class="note">No results found</p>
diff --git a/tmpl/terms.html b/tmpl/terms.html
index 993b5aa0..9cfabc58 100644
--- a/tmpl/terms.html
+++ b/tmpl/terms.html
@@ -41,9 +41,6 @@
<a href="#" class="action-play-audio"><img src="/mixed/img/play-audio.svg" title="Play audio (Alt + P)" alt></a>
{{/if}}
{{/unless}}
- {{#if source}}
- <a href="#" class="source-term"><img src="/mixed/img/source-term.svg" title="Source term (Alt + B)" alt></a>
- {{/if}}
<img src="/mixed/img/entry-current.svg" class="current" title="Current entry (Alt + Up/Down/Home/End/PgUp/PgDn)" alt>
</div>
@@ -129,9 +126,13 @@
{{/inline}}
{{#if definitions}}
+<div class="term-navigation">
+ <a href="#" {{#if source}}class="source-term"{{else}}class="source-term term-button-fade"{{/if}}><img src="/mixed/img/source-term.svg" title="Source term (Alt + B)" alt></a>
+ <a href="#" {{#if next}}class="next-term"{{else}}class="next-term term-button-fade"{{/if}}><img src="/mixed/img/source-term.svg" style="transform: scaleX(-1);" title="Next term (Alt + F)" alt></a>
+</div>
{{#each definitions}}
{{#unless @first}}<hr>{{/unless}}
-{{> term debug=../debug grouped=../grouped merged=../merged addable=../addable playback=../playback compactGlossaries=../compactGlossaries source=../source}}
+{{> term debug=../debug grouped=../grouped merged=../merged addable=../addable playback=../playback compactGlossaries=../compactGlossaries}}
{{/each}}
{{else}}
<p class="note">No results found.</p>